On Fri, 11 Oct 2002, Martin Ding wrote:

> How Can I get GC information only in client side? I mean not searching
> in Server side

   In theory the client GC is an opaque handle and you're not
supposed to be able to get any info from it on the client side.
However, Xlib does cache all of these values as an optimization.
It compresses state changes and sends them down in blocks only
when they are needed.  So if you look at a function like
XSetLineAttributes it will show how the line values are stored:

#include "Xlibint.h"


int
XSetLineAttributes(dpy, gc, linewidth, linestyle, capstyle, joinstyle)
register Display *dpy;
GC gc;
unsigned int linewidth; /* CARD16 */
int linestyle;
int capstyle;
int joinstyle;
{
    XGCValues *gv = &gc->values;

    LockDisplay(dpy);
    if (linewidth != gv->line_width) {
        gv->line_width = linewidth;
        gc->dirty |= GCLineWidth;
    }
    if (linestyle != gv->line_style) {
        gv->line_style = linestyle;
        gc->dirty |= GCLineStyle;
    }
    if (capstyle != gv->cap_style) {
        gv->cap_style = capstyle;
        gc->dirty |= GCCapStyle;
    }
    if (joinstyle != gv->join_style) {
        gv->join_style = joinstyle;
        gc->dirty |= GCJoinStyle;
    }
    UnlockDisplay(dpy);
    SyncHandle();
    return 1;
}

   You can see where it stores it and how it marks what state it
has that it hasn't flushed to the server yet.  When the GC is actually
used to draw something, it will flush the dirty state back to the
server.


                        Mark.
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to