Re: [patch] clist uses GDK_XOR



On  6 Oct, Shawn T . Amundson scribbled:
->  On Tue, Oct 06, 1998 at 11:32:52AM -0400, Owen Taylor wrote:
->  > 
->  > raster@redhat.com writes:
->  > 
->  > > On  6 Oct, Frank Loemker scribbled:
->  > > ->  Hello,
->  > > ->  
->  > > ->  In gtk V1.0.6 there was a change from GDK_XOR to GDK_INVERT in the
->  > > ->  paned widget to ensure that the drawn line is visible (white pixel
->  > > ->  can have a value of 0, so GDK_XOR would have no effect).
->  > > ->  
->  > > ->  The clist widget still uses GDK_XOR for the same purpose (if you
->  > > ->  change the column with in a clist). The patch below changes the clist
->  > > ->  to use GDK_INVERT.
->  > > 
->  > > why don't u use white pixel and use black pixel IF whitepixel == 0 ? :)
->  > 
->  > The advantage of Raster's method is that it is pretty much guaranteed
->  > to swap black and white, while GDK_INVERT is not. (On pseudocolor
->  > displays, black and white usually get colormap values 0 and 1, or
->  > vice-versa.)
->  
->  How do we implement raster's method?  Just check the background of clist
->  and selection and draw accordingly? What if a background pixmap is there
->  instead of a plain color?  Is the suggestion to draw one pixel at a time?

from E source code:

      gcv.function = GXxor;
      gcv.foreground = WhitePixel(disp, root.scr);
      if (gcv.foreground == 0)
        gcv.foreground = BlackPixel(disp, root.scr);
      gcv.subwindow_mode = IncludeInferiors;
      gc = XCreateGC(disp, root.win, GCFunction | GCForeground | GCSubwindowMode, &gcv);

basically XORing values of 0 will have no effect, so in the case of
white being 0 we use black (in 8bpp they are nearly always pixels 0 and
1 - 0 could be either blakc or white - i've ntoiced under sun X servers
0 is white - under Xfree it seems to be black) under b&W this works,
16color and 8bpp, it also works fine for 15,16 and 24/32bpp. :)

->  > However, since the color that the line for the CList is inverting is
->  > usually not white (the default being a pinkish-gray), I'm not sure
->  > if that really matters here.
->  
->  It is white on my B/W display. ;-)
->  
->  > (I think the default colors of the CList _should_ be those currently
->  >  used for the List, but that's another story)
->  > 
->  > Regards,
->  >                                         Owen
->  --
->  Shawn T. Amundson               
->  amundson@gimp.org               http://www.gimp.org/~amundson
->  
->  "The assumption that the universe looks the same in every
->   direction is clearly not true in reality." - Stephen Hawking
->  
->  

-- 
--------------- Codito, ergo sum - "I code, therefore I am" --------------------
raster@rasterman.com       /\___ /\ ___/||\___ ____/|/\___  raster@redhat.com
Carsten Haitzler           | _ //__\\ __||_ __\\ ___|| _ /  Red Hat Advanced
218/21 Conner Drive        || // __ \\_ \ | |   \ _/_|| /   Development Labs
Chapel Hill NC 27514 USA   ||\\\/  \//__/ |_|   /___/||\\   919 547 0012 ext 282
+1 (919) 929 9443, 801 4392   For pure Enlightenment   http://www.rasterman.com/



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