On Wed, Mar 20, 2002 at 08:49:18PM +0100, Johannes Gajdosik wrote:
> Dear fvwm developers,
> 
> I am using fvwm2 since a couple of months and I am very pleased with it.
> I liked the vector buttons very much and I was a little sad
> because a vector button can only have 31 lines and because
> these lines must always be connected to one another.
> Therefore I would like to propose a new fwwm-feature.
> 
> This is the first open source project that I want to contribute,
> so please be patient with me.
> It would be a great honor if this feature could be introduced
> in one of the next versions.
> I am using it in version 2.4.6 and it works fine.

Well, I see no real reason why the number of lines is hard coded
to a maximum of 32.  It can easily be changed.  I have comitted a
patch to the development branch.

If you want to submit fvwm patches, please make sure you base them
on the latest development code or at least the latest snapshot.
Also, please use the diff program to generate patches that can be
applied with the "patch" program.  Just copy all the files to a
file named old_name.orig:

  $ cp borders.c borders.c.orig

Make your modifications and the run diff:

  $ diff -u borders.c.orig borders.c

(or if your diff doesn't support the -u option, use -c instead).

We always appreciate optimizing the code.  On the other hand, the
new feature can be implemented with a very small change.  All you
have to do is skip the drawing command when a certain colour is
used.  I have applied a patch that uses colour 4 for this feature.

If you want help cleaning this ugly mess up a bit, please download
the latest snapshot or code from cvs first and redo your changes.
I am currently busy with exactly the files you modified too, so it
can become a bit difficult to keep the patches up to date.
Finally, if you do download the development code, don't expect
much of it.  It needs another week before window titles and window
shading work well again.


To comment on your code:

> ------------------------------------------------------
> 
> Feature description:
> 
> the man-page says:
> 
> > ...,num  is  a  number  of
> > point  specifications  of  the form [EMAIL PROTECTED]
> > ...  C specifies a line color
> > (0 - the shadow color, 1 - the highlight color, 2 -
> > the  background  color,  3 - the foreground color).
> > ... You can use up to 32 points in a line pattern.
> 
> The new feature is:
>   1) You can use up to 1000 (or more?) points in a line pattern.
>   2) special color C=-1: no line is drawn.
>      This is different from color C=2, because a line of color C=2
>      makes that all pixels of this line get the background color
>      and so are erased.
> 
> The implementation affects 5 files.
> 
> -----------------------------------------------------
> 
> 1) the man page:
> The new text should be:
>   ...  C specifies a line color
>   (0 - the shadow color, 1 - the highlight color,
>   2 - the  background  color,  3 - the foreground color,
>   -1 - special meaning: this line is not drawn).
>   ... You can use up to 1000 points in a line pattern.
> 
> ------------------------------------------------------
> 
> 2) screen.h
> Instead of
> 
> >    struct vector_coords
> >    {
> >      int num;
> >      int *x;
> >      int *y;
> >      unsigned long line_style;
> >      unsigned long use_fgbg;
> >    } vector;
> 
> I propose
> 
>      struct vector_coords
>      {
>        int num;
>        struct vector_vertex {
>          unsigned char x;
>          unsigned char y;
>          unsigned short color;
>        } *vertices;
>        unsigned long use_fgbg;
>      } vector;
> 
> Please observe that in the old code every point needs 8 bytes,
> in the new code only 4 bytes. Furthermore the color is not any more 
> stored
> in the bits of two unsigned long variables(line_style,use_fgbg),
> but instead in just on variable(color), so the code becomes more 
> readable.

Yes, very good work.  I hope I didn't discourage you from
contributing that work is definitely helpful.

> The variable use_fgbg remains just because of an optimization when
> drawing the button.

Ah, forget it.  A few extra CPU cycles are not worth the effort.
DrawLinePattern() can calculate what it needs to know when it's
called.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
--
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 PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to