Xnest: replace XChangeGC() by xcb_change_gc()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
db2743387b
commit
8a068eb15a
|
@ -43,19 +43,16 @@ xnestCursorFuncRec xnestCursorFuncs = { NULL };
|
||||||
Bool
|
Bool
|
||||||
xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
xnestRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
|
||||||
{
|
{
|
||||||
unsigned long valuemask;
|
uint32_t valuemask = XCB_GC_FUNCTION | XCB_GC_PLANE_MASK | XCB_GC_FOREGROUND
|
||||||
XGCValues values;
|
| XCB_GC_BACKGROUND | XCB_GC_CLIP_MASK;
|
||||||
|
|
||||||
valuemask = GCFunction |
|
XnGCValues values = {
|
||||||
GCPlaneMask | GCForeground | GCBackground | GCClipMask;
|
.function = XCB_GX_COPY,
|
||||||
|
.plane_mask = ((unsigned long)~0L),
|
||||||
|
.foreground = 1L,
|
||||||
|
};
|
||||||
|
|
||||||
values.function = GXcopy;
|
xnChangeGC(xnestUpstreamInfo.conn, xnestBitmapGC->gid, values, valuemask);
|
||||||
values.plane_mask = AllPlanes;
|
|
||||||
values.foreground = 1L;
|
|
||||||
values.background = 0L;
|
|
||||||
values.clip_mask = XCB_PIXMAP_NONE;
|
|
||||||
|
|
||||||
XChangeGC(xnestDisplay, xnestBitmapGC, valuemask, &values);
|
|
||||||
|
|
||||||
uint32_t const winId = xnestDefaultWindows[pScreen->myNum];
|
uint32_t const winId = xnestDefaultWindows[pScreen->myNum];
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ is" without express or implied warranty.
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
|
|
||||||
#include "Xnest.h"
|
#include "Xnest.h"
|
||||||
|
#include "xnest-xcb.h"
|
||||||
|
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "XNGC.h"
|
#include "XNGC.h"
|
||||||
|
@ -95,7 +96,7 @@ xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
|
||||||
void
|
void
|
||||||
xnestChangeGC(GCPtr pGC, unsigned long mask)
|
xnestChangeGC(GCPtr pGC, unsigned long mask)
|
||||||
{
|
{
|
||||||
XGCValues values;
|
XnGCValues values;
|
||||||
|
|
||||||
if (mask & GCFunction)
|
if (mask & GCFunction)
|
||||||
values.function = pGC->alu;
|
values.function = pGC->alu;
|
||||||
|
@ -174,7 +175,7 @@ xnestChangeGC(GCPtr pGC, unsigned long mask)
|
||||||
values.arc_mode = pGC->arcMode;
|
values.arc_mode = pGC->arcMode;
|
||||||
|
|
||||||
if (mask)
|
if (mask)
|
||||||
XChangeGC(xnestDisplay, xnestGC(pGC), mask, &values);
|
xnChangeGC(xnestUpstreamInfo.conn, xnestUpstreamGC(pGC), values, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -115,3 +115,37 @@ void xnestEncodeKeyboardControl(XnKeyboardControl ctrl, long mask, uint32_t *val
|
||||||
if (mask & KBAutoRepeatMode)
|
if (mask & KBAutoRepeatMode)
|
||||||
*value++ = ctrl.auto_repeat_mode;
|
*value++ = ctrl.auto_repeat_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void xnChangeGC(xcb_connection_t *conn, uint32_t gc, XnGCValues gcval, uint32_t mask)
|
||||||
|
{
|
||||||
|
char value_list[128] = { 0 };
|
||||||
|
char *walk = value_list;
|
||||||
|
|
||||||
|
#define EXTRA_VALUE(flag,val) if (mask & flag) { *((uint32_t*)walk) = gcval.val; walk+=4; }
|
||||||
|
EXTRA_VALUE(GCFunction, function);
|
||||||
|
EXTRA_VALUE(GCPlaneMask, plane_mask);
|
||||||
|
EXTRA_VALUE(GCForeground, foreground);
|
||||||
|
EXTRA_VALUE(GCBackground, background);
|
||||||
|
EXTRA_VALUE(GCLineWidth, line_width);
|
||||||
|
EXTRA_VALUE(GCLineStyle, line_style);
|
||||||
|
EXTRA_VALUE(GCCapStyle, cap_style);
|
||||||
|
EXTRA_VALUE(GCJoinStyle, join_style);
|
||||||
|
EXTRA_VALUE(GCFillStyle, fill_style);
|
||||||
|
EXTRA_VALUE(GCFillRule, fill_rule);
|
||||||
|
EXTRA_VALUE(GCTile, tile);
|
||||||
|
EXTRA_VALUE(GCStipple, stipple);
|
||||||
|
EXTRA_VALUE(GCTileStipXOrigin, ts_x_origin);
|
||||||
|
EXTRA_VALUE(GCTileStipYOrigin, ts_y_origin);
|
||||||
|
EXTRA_VALUE(GCFont, font);
|
||||||
|
EXTRA_VALUE(GCSubwindowMode, subwindow_mode);
|
||||||
|
EXTRA_VALUE(GCGraphicsExposures, graphics_exposures);
|
||||||
|
EXTRA_VALUE(GCClipXOrigin, clip_x_origin);
|
||||||
|
EXTRA_VALUE(GCClipYOrigin, clip_y_origin);
|
||||||
|
EXTRA_VALUE(GCClipMask, clip_mask);
|
||||||
|
EXTRA_VALUE(GCDashOffset, dash_offset);
|
||||||
|
EXTRA_VALUE(GCDashList, dashes);
|
||||||
|
EXTRA_VALUE(GCArcMode, arc_mode);
|
||||||
|
#undef EXTRA_VALUE
|
||||||
|
|
||||||
|
xcb_change_gc(conn, gc, mask, value_list);
|
||||||
|
}
|
||||||
|
|
|
@ -65,4 +65,34 @@ typedef struct {
|
||||||
|
|
||||||
void xnestEncodeKeyboardControl(XnKeyboardControl ctrl, long mask, uint32_t *value);
|
void xnestEncodeKeyboardControl(XnKeyboardControl ctrl, long mask, uint32_t *value);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int function; /* logical operation */
|
||||||
|
unsigned long plane_mask;/* plane mask */
|
||||||
|
unsigned long foreground;/* foreground pixel */
|
||||||
|
unsigned long background;/* background pixel */
|
||||||
|
int line_width; /* line width */
|
||||||
|
int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */
|
||||||
|
int cap_style; /* CapNotLast, CapButt,
|
||||||
|
CapRound, CapProjecting */
|
||||||
|
int join_style; /* JoinMiter, JoinRound, JoinBevel */
|
||||||
|
int fill_style; /* FillSolid, FillTiled,
|
||||||
|
FillStippled, FillOpaqueStippled */
|
||||||
|
int fill_rule; /* EvenOddRule, WindingRule */
|
||||||
|
int arc_mode; /* ArcChord, ArcPieSlice */
|
||||||
|
xcb_pixmap_t tile; /* tile pixmap for tiling operations */
|
||||||
|
xcb_pixmap_t stipple; /* stipple 1 plane pixmap for stippling */
|
||||||
|
int ts_x_origin; /* offset for tile or stipple operations */
|
||||||
|
int ts_y_origin;
|
||||||
|
xcb_font_t font; /* default text font for text operations */
|
||||||
|
int subwindow_mode; /* ClipByChildren, IncludeInferiors */
|
||||||
|
Bool graphics_exposures;/* boolean, should exposures be generated */
|
||||||
|
int clip_x_origin; /* origin for clipping */
|
||||||
|
int clip_y_origin;
|
||||||
|
xcb_pixmap_t clip_mask; /* bitmap clipping; other calls for rects */
|
||||||
|
int dash_offset; /* patterned/dashed line information */
|
||||||
|
char dashes;
|
||||||
|
} XnGCValues;
|
||||||
|
|
||||||
|
void xnChangeGC(xcb_connection_t *conn, uint32_t gc, XnGCValues gcval, uint32_t mask);
|
||||||
|
|
||||||
#endif /* __XNEST__XCB_H */
|
#endif /* __XNEST__XCB_H */
|
||||||
|
|
Loading…
Reference in New Issue