pthread_t thr;
int i;
- CARD32 mask = GCForeground | GCGraphicsExposures;
+ CARD32 mask = XCBGCForeground | XCBGCGraphicsExposures;
CARD32 values[2];
XCBDRAWABLE rootwin;
int screen_num;
CARD32 values[3];
XCBRECTANGLE rect = { 0, 0, windows[idx].width, windows[idx].height };
values[0] = root->white_pixel;
- values[1] = ButtonReleaseMask | ExposureMask;
- values[2] = ButtonPressMask;
+ values[1] = XCBEventMaskButtonRelease | XCBEventMaskExposure;
+ values[2] = XCBEventMaskButtonPress;
XCBCreateWindow(c, depth, windows[idx].w.window, root->root,
/* x */ 0, /* y */ 0,
windows[idx].width, windows[idx].height,
- /* border */ 0, InputOutput,
+ /* border */ 0, XCBWindowClassInputOutput,
/* visual */ root->root_visual,
mask, values);
{
line[1].x = xo + r * cos(theta);
line[1].y = yo + r * sin(theta);
- XCBPolyLine(c, CoordModeOrigin, windows[idx].p, black,
+ XCBPolyLine(c, XCBCoordModeOrigin, windows[idx].p, black,
2, line);
line[1].x = xo + r * cos(theta + LAG);
line[1].y = yo + r * sin(theta + LAG);
- XCBPolyLine(c, CoordModeOrigin, windows[idx].p, white,
+ XCBPolyLine(c, XCBCoordModeOrigin, windows[idx].p, white,
2, line);
paint(idx);
fprintf(stderr, "ButtonRelease on unknown window!\n");
else
{
- if(bre->detail.id == Button1)
+ if(bre->detail.id == XCBButton1)
windows[idx].angv = -windows[idx].angv;
- else if(bre->detail.id == Button4)
+ else if(bre->detail.id == XCBButton4)
windows[idx].angv += 0.001;
- else if(bre->detail.id == Button5)
+ else if(bre->detail.id == XCBButton5)
windows[idx].angv -= 0.001;
}
}
values[1] = root->black_pixel;
mask |= XCBCWBackingStore;
- values[2] = Always;
+ values[2] = XCBBackingStoreAlways;
mask |= XCBCWOverrideRedirect;
values[3] = 0;
mask |= XCBCWEventMask;
- values[4] = ButtonReleaseMask | ExposureMask | StructureNotifyMask
- | EnterWindowMask | LeaveWindowMask;
+ values[4] = XCBEventMaskButtonRelease
+ | XCBEventMaskExposure | XCBEventMaskStructureNotify
+ | XCBEventMaskEnterWindow | XCBEventMaskLeaveWindow;
mask |= XCBCWDontPropagate;
- values[5] = ButtonPressMask;
+ values[5] = XCBEventMaskButtonPress;
XCBCreateWindow(c, /* depth */ 0,
window, root->root,
/* x */ 20, /* y */ 200, /* width */ 150, /* height */ 150,
- /* border_width */ 10, /* class */ InputOutput,
+ /* border_width */ 10, /* class */ XCBWindowClassInputOutput,
/* visual */ root->root_visual, mask, values);
#ifdef TEST_ICCCM
atom[0] = XCBInternAtom(c, 0, sizeof("WM_PROTOCOLS")-1, "WM_PROTOCOLS");
{
XCBATOM XA_WM_NAME = { 39 };
XCBATOM XA_STRING = { 31 };
- XCBChangeProperty(c, PropModeReplace, window, XA_WM_NAME, XA_STRING, 8, strlen(argv[0]), argv[0]);
+ XCBChangeProperty(c, XCBPropModeReplace, window, XA_WM_NAME, XA_STRING, 8, strlen(argv[0]), argv[0]);
}
if(atomrep[0] && atomrep[1])
{
XCBATOM WM_PROTOCOLS = atomrep[0]->atom;
XCBATOM WM_DELETE_WINDOW = atomrep[1]->atom;
XCBATOM XA_ATOM = { 4 };
- XCBChangeProperty(c, PropModeReplace, window, WM_PROTOCOLS, XA_ATOM, 32, 1, &WM_DELETE_WINDOW);
+ XCBChangeProperty(c, XCBPropModeReplace, window, WM_PROTOCOLS, XA_ATOM, 32, 1, &WM_DELETE_WINDOW);
}
free(atomrep[0]);
free(atomrep[1]);
0, 0, /* x and y */
600, 600, /* width and height */
0, /* border width */
- InputOutput, /* class */
+ XCBWindowClassInputOutput, /* class */
root->root_visual, /* XCBVISUALID */
value_mask, value_list); /* LISTofVALUES */
int width = 0, height = 0;
int have_pixel_size = 0;
XCBGenericError *err;
- CARD16 mask = (CARD16) StructureNotifyMask;
+ CARD16 mask = (CARD16) XCBEventMaskStructureNotify;
CARD32 values[1];
XCBRandRGetScreenInfoCookie scookie;
int major_version, minor_version;
XRRUpdateConfiguration (&event);
#endif
- if (event->response_type == ConfigureNotify)
- printf("Received ConfigureNotify Event!\n");
-
switch (event->response_type - event_base) {
case XCBRandRScreenChangeNotify:
sce = (XCBRandRScreenChangeNotifyEvent *) event;
else printf ("new Subpixel rendering model is %s\n", order[spo]);
break;
default:
- if (event->response_type != ConfigureNotify)
+ if (event->response_type == XCBConfigureNotify)
+ printf("Received ConfigureNotify Event!\n");
+ else
printf("unknown event received, type = %d!\n", event->response_type);
}
}
/* "\n" "XFree86 version: %d.%d.%d.%d" */
printf("\n" "maximum request size: %d bytes", XCBGetSetup(c)->maximum_request_length * 4);
printf("\n" "motion buffer size: %d", (int)XCBGetSetup(c)->motion_buffer_size);
- printf("\n" "bitmap unit, bit order, padding: %d, %s, %d", XCBGetSetup(c)->bitmap_format_scanline_unit, (XCBGetSetup(c)->bitmap_format_bit_order == LSBFirst) ? "LSBFirst" : "MSBFirst", XCBGetSetup(c)->bitmap_format_scanline_pad);
- printf("\n" "image byte order: %s", (XCBGetSetup(c)->image_byte_order == LSBFirst) ? "LSBFirst" : "MSBFirst");
+ printf("\n" "bitmap unit, bit order, padding: %d, %s, %d", XCBGetSetup(c)->bitmap_format_scanline_unit, (XCBGetSetup(c)->bitmap_format_bit_order == XCBImageOrderLSBFirst) ? "LSBFirst" : "MSBFirst", XCBGetSetup(c)->bitmap_format_scanline_pad);
+ printf("\n" "image byte order: %s", (XCBGetSetup(c)->image_byte_order == XCBImageOrderLSBFirst) ? "LSBFirst" : "MSBFirst");
print_formats();