[Xcb] A simple question on XCBGCFunction (when value[0] = XCBGXxor)

Ian Osgood iano at quirkster.com
Thu May 18 08:02:58 PDT 2006


Hi, Osmo!

I was not able to get this to work unless I used  
XCBLineStyleDoubleDash.  Then xor did the right thing.  You can also  
verify this behavior using the "xgc" app.

Dashed lines have very complex behavior, which seems to be affected  
by many GC params, including Function, Foreground, Background,  
LineStyle, LineWidth, DashOffset, DashList, and Stipple.  I'm not  
sure what the best combination is for this kind of interactive  
bounding box.

(BTW, you want to use XCBCoordModeOrigin below.)

Ian

On May 18, 2006, at 2:04 AM, Osmo Maatta wrote:

> Hello,
>
> I try to create a GC (graphic context) to draw some rubber lines  
> using the XOR pen.
>
> I do this:
>
>  XCBGCONTEXT    sel_rect;
>  ....
>
>  sel_rect = XCBGCONTEXTNew (c);
>  mask =   XCBGCFunction | XCBGCForeground | XCBGCLineStyle |  
> XCBGCGraphicsExposures;
>  values[0] = XCBGXxor;  values[1] = screen->black_pixel;
>  values[2] = XCBLineStyleOnOffDash;
>  values[3] = 0;
>  XCBCreateGC (c, sel_rect,  win, mask, values);
>
>
> and later in
>
> case XCBExpose:
> {
>     printf("Debug expose\n");
>
>     XCBPolyRectangle (c, win, sel_rect, 2, rectangles);
>           XCBPolyLine (c, CoordModeOrigin, win, sel_rect, 4,  
> polyline);
>
>     break;
> }
> ---------------------------------
>   But it does not draw anything. Only the debug line appears on the  
> console.
> -------------------
>
> I have even tried with  XCBGXcopy  value as XCBGCFunction.
>
> values[0] = XCBGXcopy;
> Xlib manual says that GXcopy is the default GCFunction. I suppose  
> it's the same in XCB.
> But it does not work.
>
> It works (draws lines in a window) if I remove XCBGCFunction from  
> the mask and remove the value[0]= line.
> How to use the values for XCBGCFunction mask ?
> -------------------------------------------------------------------
>
> I follow this tutorial
> http://www.iecn.u-nancy.fr/~torri/files/xcb/doc/
>
> Many TIA.
>  Osmo
>
> _______________________________________________
> Xcb mailing list
> Xcb at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xcb
>



More information about the Xcb mailing list