[comp.windows.x] Gcontexts and their Drawables

Bill.Chiles@WB1.CS.CMU.EDU (10/24/88)

Would someone please post a theory behind graphics context's being
associated with a drawables.  I don't really see an efficiency issue here,
but I don't know much about putting monitors or servers together.  I would
also like to know what is expected of a client when he creates graphics
contexts.  Are you supposed to have one GC per drawable?  Can you make all
your GC's on the root for convenience, even though you apply them with your
windows?  Can you have one GC for N windows because they all act the same?

I recently discovered that if you are putting an image on a pixmap for the
megapel display, then you must have a 1:1 mapping with the GC's, or you get
some error I don't remember.  I was doing this to make a cursor.  Before, I
was using one GC for both the cursor and mask pixmaps.

It seems to me that a graphics context manifests all the information about
how you like to do some graphics operation, modulo how you affect a request
by passing specific arguments to some programmer's interface for that
operation.  If this is solely true, then there is no reason a graphics
context should ever need a pointer to some drawable.  It should be
applicable with any drawable.

If this is documented anywhere, I'd be glad to only receive a pointer.

In case it is pertinent, I always deal with X through CLX.

Bill