Subject: question about colorset implementation

From: Dominik Vogt <[email-masked]>
Date: Mon, 9 Aug 1999 13:34:01 +0200

Tim,

I'd be willing to attack colorsets for FvwmButtons. But first
I need to know what I will have to do. Can you make a
checklist for this? I'd like to know what the Colorset module
can do for me. E.g. is there a function to set a window
background to use a specific colorur set? And is there a function
that updates the attributes for window creation according to
the colour set?

Bye

Dominik ^_^

-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-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: Tim Phipps <[email-masked]>
Date: Tue, 10 Aug 1999 15:50:01 +0100

Dominik Vogt wrote:
> checklist for this?

0) #include "libs/colorset.h"
1) AllocColorset(0) soon after XOpenDisplay
2) Add M_SEND_CONFIG to messagemask
3) in the parse options routine look for "Colorset" and pass to
LoadColorset() Redraw if necessary
4) in the main event loop hand M_CONFIG_INFO packets to parse_config
   
> I'd like to know what the Colorset module

SetWindowBackground() takes a (colorset *), sets the background and
generates
an expose event

CreateBackgroundPixmap() creates the pixmap used by SetWindowBackground
in case you want to paint the background manually, you have to check
that the colorset contains a pixmap first though.

if cset is the colorset specified use Colorset[cset % nColorsets].fg to
access a pixel.

The most difficult part is trying to keep backward compatibility which
means you have to keep around the old configuration specified colors and
choose at redraw time wether to use the colorset pixels or the old ones.
The way I did it with FvwmIdent was to have the colorset default to 0
and if the configuration specified a color the colorset is set to -1. In
the redraw routine if the colorset >= 0 then it is used.
This gives a default colorset if there is nothing specified at all but
doesn't change any working configs.

Cheers,
Tim.