Re: Bevels, sigh

Shawn T. Amundson writes:
 > On 30 Jan 1998, Russell Nelson wrote:
 > > I don't think we should make the theme code more complicated by having
 > > special bevel-drawing code.  Much better to make themes be efficient,
 > > so that standard buttons could be specified with a nine-pixel pixmap
 > > with a border of one.
 > > 
 > Even if the buttons can be specified in a nine-pixel pixmap, when
 > the pixmap is enlarged it is no longer as efficient (memory wise) as 
 > just using drawing routines.

Why enlarge the pixmap, then draw the pixmap?  Why not draw FROM the
pixmap?  It's not too tough to notice that the pixmap only has 3x3
pixels, that the border is 1, and then draw it as four lines, four
pixels, and one filled rectangle.

I did a paint program over a century ago which drew bitmaps, ala
MacPaint (originally it was a perfect clone of MacPaint for the PC,
called MockPaint, but the lawyers squashed that).  And when it filled
a box, it knew how to fill in the left hand side bits, all the bytes
in the middle, and all the right hand side bits.  Same thing for
drawing lines.  Horizontal lines were much faster than vertical lines,
which were much faster than diagonal lines.  But it also meant that
there was only one draw_line or fill_rectangle or copy_bits routine.
And the copy_bits routine (which had no hardware assistance) compiled
a little program to do the copy, then jumped to it.

Program design is a lot easier if you minimize the number of entry
points, and Make Common Things Happen Fast.

 > This can be gotton around only with 
 > 9 X-Windows and tiling correct?
 > I don't like the sound of making the simplest gtkbutton take 9 
 > windows.

Does a bevel-drawn button take 9 windows?  No.  So why should a
pixmap-drawn button take 9 windows?

-russ <>
Crynwr Software supports freed software | PGPok |   Freedom is the primary
521 Pleasant Valley Rd. | +1 315 268 1925 voice |   cause of Peace, Love,
Potsdam, NY 13676-3213  | +1 315 268 9201 FAX   |   Truth and Justice.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]