Subject: FvwmBacker Xpm patch

From: Nemeth Ervin <[email-masked]>
Date: 22 Nov 1999 11:10:06 +0100

Hi,

I've added Xpm support to the FvwmBacker module.

It is now faster and also saves network bandwidth, because the Xserver is
caching the background pixmaps.

The patch is made against fvwm-2.2.2, but not much have changed in FvwmBacker
recently so I think patching the CVS-tree will be a cakewalk.

Any feedback welcome, but cc to my address, because I'm not a list-member.

-- 
  ____                 ____________________________________________________
 /____| NEMETH, ERVIN |____________________________________________________|
//	< airwin @ inf.bme.hu >		http://www.inf.bme.hu/~airwin
||
||	"Nonsense.  All you have to do is say 'Engage'"
||					-- Patrick Stewart about warp theory

---

From: Mikhael Goikhman <[email-masked]>
Date: Mon, 22 Nov 1999 14:15:10 +0200

> I've added Xpm support to the FvwmBacker module.

Actually, there is already colorset support in the FvwmBacker module,
so you can set up a background pixmap for every desk (and page).

> recently so I think patching the CVS-tree will be a cakewalk.

Not exactly, there was a number of changes and I am going to apply
another FvwmBacker patch in a day or two after fixing it.

Can you redo your patch against the CVS or fvwm-snap-19991124.tar.gz?
(if you feel that colorset support is not that you want, of course.)

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 23 Nov 1999 01:18:43 +0200

On 22 Nov 1999 16:12:21 +0100, Nemeth Ervin wrote:
> >>>>> Mikhael Goikhman writes:
> I've made a CVS checkout, but I haven't found, what this colorset is.
> 
> Could you explain in a nutshell, please, what it is?

To fvwm-workers: maybe someone can write a FAQ or html page about this?
Or a documentation in FvwmTheme.1 is enough?

Ok, it is not trivial to understand, but once you understand, it is very
simple. You can take a look at the FvwmTheme and FvwmBacker man pages.

Basically, you should run FvwmTheme module, hare are commands for .fvwm2rc:

  AddToFunc StartFunction "I" ModuleSynchronous FvwmTheme

Then you should define colorsets themselves, here are some examples:

  *FvwmThemeColorset 0 fg black, bg rgb:E4/D2/C0
  *FvwmThemeColorset 1 YGradient 200 3 blue 49 navy 1 blue 50 navy
  *FvwmThemeColorset 8 Pixmap my_big_background.xpm
  *FvwmThemeColorset 9 TiledPixmap my_small_background.xpm

Then you should tell FvwmBacker to use some of the defined colorsets.

  *FvwmBackerDesk 0 Colorset 8
  *FvwmBackerDesk 1 Colorset 9

All fvwm modules and menus support colorsets. The purpose of colorsets is
to define color themes. So you can say that every module uses a colorset 0
as its main colors (background, foreground), a colorset 1 for its second
colors and so on (a man page of every module defines its colorset syntax).
The FvwmTheme man page contains many ideas.

Now, it is possible to change a look of all modules at once, just send
these commands using FvwmConsole (FvwmTheme should be running):

  SendToModule FvwmTheme Colorset 0 fg red bg white
  SendToModule FvwmTheme Colorset 8 YGradient 800 3 red 1 green 1 blue 1 red

The last command will replace my_big_background.xpm background
with a nice rainbow.

Colorsets are supposed to be used by experienced fvwm users. It is
possible to use fvwm without them.
I hope this helps.

Regards,
Mikhael.

---

From: Nemeth Ervin <[email-masked]>
Date: 24 Nov 1999 09:54:08 +0100

>>>>> Mikhael Goikhman writes:

[...]

> Or a documentation in FvwmTheme.1 is enough?

This was my fault, sorry.  The nroff documentation contains a good
description, though it is not so clear and your mail helped a lot.  I suggest
respectfully someone to refine FvwmTheme.1.

> Basically, you should run FvwmTheme module, hare are commands for .fvwm2rc:

[...]

> possible to use fvwm without them.

Ok. Then my next question is: should FvwmBacker support Xpm backgrounds
*without* FvwmTheme?  What is your opinion, everibody?

Thanks,

---

From: Dominik Vogt <[email-masked]>
Date: Wed, 24 Nov 1999 11:10:47 +0100

> respectfully someone to refine FvwmTheme.1.

Can you explain what you have in mind?

> > possible to use fvwm without them.

To be honest I see no real reason to re-implement stuff that can already
be done.  It may be more simple, yes; but in the future I don't want
to maintain and debug code that is not necessary.  The FvwmTheme
approach even doesn't suffer from the memory penalty you mentioned
plus the ColorLimit command takes effect too.  And a colour set is
much more flexible than an explicit Xpm option because with colour
sets you can even have gradient backgrounds and stretched vs. tiled
pixmaps.

Bye

Dominik ^_^

-- 
Dominik Vogt, Agilent Technologies, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/464-4596, fax: 07031/464-3883, [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Mikhael Goikhman <[email-masked]>
Date: Wed, 24 Nov 1999 18:21:56 +0200

> *without* FvwmTheme?  What is your opinion, everibody?

I would prefer to have an unified image format support in one place
and not in all modules, which require it.

FvwmBacker already supports pixmap backgrounds without FvwmTheme using
Exec commands.

Regards,
Mikhael.

---

From: Nemeth Ervin <[email-masked]>
Date: 24 Nov 1999 16:44:12 +0100

> and not in all modules, which require it.

Imlib comes about my mind.  In FvwmTheme.

> FvwmBacker already supports pixmap backgrounds without FvwmTheme using

Sure.  But it _really_ slow.  It requires
1. a fork
2. opening/reading/decoding the image file
3. transferring the Pixmap to the server
and this everytime the user is switching desktop.

The fast way is, if FvwmBacker simply instructs the Xserver, that the
root-background is now a previously transferred pixmap.

---

From: Tim Phipps <[email-masked]>
Date: Wed, 24 Nov 1999 16:06:33 +0000

> Imlib comes about my mind.  In FvwmTheme.

I'd rather see a Gnome/GTK program that converts the Gnome theme into
colorset messages. FvwmGTK may be a candidate since it already does
Gnome themes, all we have to do is convert the GTK internals into
colorset messages and Fvwm would become Gnome theme compatible. As you
can tell I don't know anything about Gnome/GTK internals so this may be
difficult/impossible.
> root-background is now a previously transferred pixmap.
Oh I see.  You want to trade lots of memory for speed.  How about
modifying FvwmBacker so that it creates the pixmap from the colorset and
keeps it in the desk structure list.  Rather than SetWindowBackground()
when the desk changes it would be XSetWindowBackgroundPixmap() and a
CreateBackgroundPixmap() whenever a colorset changes. This should be
optional as I really don't want my XServer to grow by 4MB per desk.

Cheers,
Tim.