Re: FVWM: Re: UseStyle

From: Todd Fries <todd_at_miango.com>
Date: Wed, 8 May 1996 07:55:10 -0500 (CDT)

> >> Dan Niles(d) wrote:
> d> I am trying to set up some generic styles so I can use UseStyle for
> d> many windows. It seems to work except for Color.
> d> For example:
[...]
> d> it works fine. I believe there is a bug (or undocumented feature) in
> d> UseStyle.

> If it's broke, ditch it. I'm curious -- does UseStyle provide any new
> functionality that isn't already provided by FvwmCPP/FvwmM4? Seems like

> #define HIGHLIGHT "Color Black/Red"
> Style "Window" HIGHLIGHT
>
> would be effectively the same. And it's more powerful, since you can
> customize the setting based on the display, e.g.,

> /* Window and icon fonts */
>
> #if Y_RESOLUTION >= 3700
> #define WINDOWFONT -adobe-times-bold-r-*-*-18-*-*-*-*-*-*-*
> #define ICONFONT -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
> #else
> #define WINDOWFONT -adobe-times-bold-r-*-*-16-*-*-*-*-*-*-*
> #define ICONFONT -adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-*-*
> #endif
>
> WindowFont WINDOWFONT
> IconFont ICONFONT


> Comments?

Sure. I was the person who submitted the UseStyle patch. I thought
that I had a good idea when I searched for the style structure with
the same name as the style we wanted to mimic....

 nptr = Scr.TheList;
 while(nptr && mystrncasecmp(restofline,nptr->name,len) )
   nptr = nptr->next;
 if (nptr&& !mystrncasecmp(restofline,nptr->name,len))
 {
   on_flags = nptr->on_flags;
   off_flags = nptr->off_flags;
   icon_name = nptr->value;
[...]

It looks like, to me, that the structure is copied entirely..
Being my 'initiate' patch to fvwm, I would more than bet there
are things wrong with it...

Perhaps should the char*'s be strdup'ed? .. of course!
doit! I guess this should be fixed...sorry if these have
caused any problems...

564c564
< icon_name = strdup(nptr->value);
---
>               icon_name     = nptr->value;
568,569c568,569
<               forecolor     = strdup(nptr->ForeColor);
<               backcolor     = strdup(nptr->BackColor);
---
>               forecolor     = nptr->ForeColor;
>               backcolor     = nptr->BackColor = backcolor;
See if this helps things out abit...
Also, to address the question at hand...does m4/cpp preprocessing
already provide the same functionality as UseStyle.
To some degree.  However, you can't use an m4 macro in FvwmTalk,
and an m4 macro isn't quite the same as copying the binary
contents of a structure.  An m4 macro couldn't do, for
example:
Style "a" Color Black/Red
Style "b" UseStyle a
Style "a" NoTitle
To jump the fence, so to speak....however....UseStyle was
originally intended to be 'macro-like' and what better way
to do something 'like' a macro than to use a macro itself?
What does anybody else think?
-- 
Todd Fries
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Wed May 08 1996 - 07:54:55 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:58 BST