Subject: FVWM: symbolic xpm colors (with FVWMCPP? )

From: Shay Hill <[email-masked]>
Date: Tue, 13 Jan 2004 09:36:08 -0600

Is it possible to take my SetEnv defined colors and translate them into 
symbolic colors useable by an xpm? This seems possible with FVWMCPP, but 
I've got not idea where even to begin.

Thank you,
 -Shay

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

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 13 Jan 2004 17:17:34 +0000

> I've got not idea where even to begin.

No, FVWM does not support symbolic colors in XPM.

If it ever supports symbolic colors (fg, bg, sh, hi) in XPM, then you
will need to define them in the colorset that is used in the area where
your XPM image is drawn.

But maybe if you explain what you need exactly there is a different way
to achieve this than to use XPM symbolic colors (like used, say, in CDE).
For example, you may generate XPM dynamically (using "FvwmCPP -debug
-noread", or maybe "FvwmPerl -p" or a shell script) and use this
generated image for your needs.

Regards,
Mikhael.

---

From: Shay Hill <[email-masked]>
Date: Tue, 13 Jan 2004 13:32:54 -0600

>generated image for your needs.
Yes, I should have started with this.

I have declared (SetEnv) four strings at the top of my fvwm2rc file 
representing  foreground, background,  outline , and desktop color 
definitions. I would like to use these colors in some way to color 
three-color xmps without having to define the colors anywhere else in 
the file.

I apologize, Mikhael, for the personal email. It was unintentional.

-Shay

---

From: Mikhael Goikhman <[email-masked]>
Date: Tue, 13 Jan 2004 20:58:49 +0000

> three-color xmps without having to define the colors anywhere else in 

If you want a generic way to do this, then, like I said, this is not
supported. However it probably may be solve case by case if we know where
you plan to use such XPMs. For example, titlebar vector buttons support
drawing using bg, fg, sh and hi colors of the corresponding colorset.

You may partially achieve what you want if you use colorsets, transparent
XPM and alpha blended PNG images to draw different things. Then you may
just change colorset definitions at any time and transparent images will
adapt to a new background and the text will use a new foreground color.
If we speak about menus, modules and decorations.

You may read about colorsets in the man pages. See fvwm-themes package
for colorset usage examples.

Please always specify your fvwm version, because there are different
receipts for different versions.

Regards,
Mikhael.

---

From: Shay Hill <[email-masked]>
Date: Tue, 13 Jan 2004 17:02:27 -0600

>receipts for different versions.
I have two titlebar buttons where vector graphics should work, but my 
real problem is xpms which I use across the entire titlebar in order to 
simulate a border between the titlebar and the window (like twm). One of 
these problem xpms has three colors. The background color checkered with 
the foreground color and then a strip of border color along the bottom.

I am using version 2.5.8

Thank you for all of your help.

 -Shay

---

From: Marcus Lundblad <[email-masked]>
Date: Thu, 15 Jan 2004 19:59:27 +0100 (CET)

> will need to define them in the colorset that is used in the area where
Maybe it could support a syntax something like this (in a possible
future) (in the XPM):

". s cs1bg"
", s cs1hi"
": s cs1sh"

For enabling the use of several coloursets in the same file.
bg,fg,sh,hi (without a colourset) could refer to the colourset of the
"context" where the XPM is used (for example title bar).

I was also thinking of using XPMs with colours from my "theme" as
root image, but this would require creating temporary files (script,
perl etc.)
By the way, is it possible to "query" FVWM for the current definition of
coloursets via FvwmCommand? (for use in a script to set the root
image).

//Marcus

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 16 Jan 2004 00:10:31 +0000

> coloursets via FvwmCommand? (for use in a script to set the root

FvwmCommand is not the best way to query colorsets, but tricks like the
following are possible:

  % FvwmCommand 'PipeRead "echo $[fg.cs1] $[bg.cs1] >/tmp/cs1.txt"'
  % cat /tmp/cs1.txt

It is easy to write a module in Perl that queries the colorset definitions
(including image properties that can't be queried ourside of modules).
You just create Colorsets tracker object and it does all the black work
for your module to keep an up to date information about all colorsets.

If you take this path, run "fvwm-perllib man" from a shell, and
"FvwmDebug --xconsole --track Colorsets" from FvwmConsole in 2.5.x.

Regards,
Mikhael.