Re: Color sharable question regarding gdk_colormap_alloc_color()



On Tue, Oct 17, 2006 at 07:29:43PM +0000, DC A wrote:
> In api it says if gboolean writable argument is set to TRUE for 
> gdk_colormap_alloc_color() function then that color cannot be shared 
> between applications. I created an application main.c and allocate color 
> with above mentioned function with the writable argument set to TRUE. After 
> compilation and linking when i run the same program in two separate 
> terminals I can draw a pie chart with the same color on both application. 
> How is it possible? Shouldn't it complain(as colors should not be 
> sharable)? Can anyone kindly shed light on this?

Sharing of colours means sharing of colourmap entries.

All the colour allocation stuff dates back to the pre-direct
colour era when only a limited number of colours were
available.  The table of all available colours is called
colourmap, sometimes its entries were changeable, sometimes
even didn't.  Applications were fighting for colourmap
entries with other applications that wanted entirely
different colours...

Shareable means the application says `I want a colour at
least a bit similar to this' to the windowing system and
the windowing system assigns to it a colour from the
colourmap.  Other applications that wish a similar colour
can obtain the very same colourmap entry, therefore our
application must not change the entry to a different
colour.

Non-shareable means the application says `I want a colour
and I want to change it later' to the windowing system and
it gets an entry in the colourmap that no one else uses.
(Well, at least not at the same time.)

Yeti


--
Whatever.



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