Subject: Re: FVWM: picky picky : shadow/hilight colors

From: Dan Espen <[email-masked]>
Date: Mon, 20 Dec 1999 10:26:34 -0500

Dominik Vogt <[email-masked]> writes:
> Dan, do you feel inclined to
> port lesstif's algorithm to fvwm?  I've attached the source file
> with the code.  Look for the '_XmColorProcDefaultProc' function.

I noticed FvwmTheme made direct calls to what I thought were the internals
of the shadow/hilite routines.  I don't understand why yet, so I haven't
changed them.  (I left the old routines in ColorUtils.c for a while).

There also seems to be an extra Percent sign at the end of the format strings
in pixel_to_color_string.  I haven't tracked down how thats used either.

Meanwhile, the new logic looks pretty good to me.

I have to do some real work for a while.  Anyone else want to look into
FvwmTheme?

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
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: Dominik Vogt <[email-masked]>
Date: Mon, 20 Dec 1999 16:45:07 +0100

> changed them.  (I left the old routines in ColorUtils.c for a while).

Tim?  Why can't we call GetHilight() and GetShadow here?

> in pixel_to_color_string.  I haven't tracked down how thats used either.

Huh? What's wrong about

  sprintf(output, "rgb:%04x/%04x/%04x%n", ..., &n);

and

  sprintf(output, "#%04x%04x%04x%n", ..., &n);

Do you mean the final '%n'?  This writes the number of characters
printed up to the %n into a variable (like sscanf would do).

> I have to do some real work for a while.  Anyone else want to look into

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: Tim Phipps <[email-masked]>
Date: Mon, 20 Dec 1999 15:45:21 +0000

> changed them.  (I left the old routines in ColorUtils.c for a while).

FvwmTheme can operate with read/write colors.  It can't use GetHilight()
in this case since that calls XAllocColor().
> in pixel_to_color_string.  I haven't tracked down how thats used either.
Do you mean the %n in this?

    sprintf(output, "rgb:%04x/%04x/%04x%n", (int)color.red,
(int)color.green,
            (int)color.blue, &n);

It's used to tell the caller how many character were placed in the
output string.  It may not be used but I don't think it's a bug.

> I have to do some real work for a while.  Anyone else want to look into

I'll have a go.

Cheers,
Tim.

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 20 Dec 1999 16:49:25 +0100

> output string.  It may not be used but I don't think it's a bug.

It *is* used.  It's the function's return code.

Bye

Dominik ^_^

---

From: Dan Espen <[email-masked]>
Date: Mon, 20 Dec 1999 10:50:05 -0500

> Do you mean the %n in this?

yes.

> output string.  It may not be used but I don't think it's a bug.

OK, my ignorance.