dnl Copyright (C) 2001-2002 Bart Massey and Jamey Sharp. dnl All Rights Reserved. See the file COPYING for licensing information. /* * This file automatically generated by xcbwrap.m4. * Edit at your peril. */ #include "xclint.h" #include "Xlibint.h" divert(-1) dnl kill output until the next diversion dnl default values define(`SETDEFAULTS', ` define(`CALL', `') define(`RETTYPE', `int') define(`RETVAL', `1') define(`PARAMS', `') define(`FLUSHGC', `') define(`LOCALS', `') ') SETDEFAULTS() dnl XCLREQ(name, specs ...) define(`XCLREQ', ` dnl evaluate anything that the caller passed in shift($@) ifelse(CALL, , `define(`CALL', $1)') dnl save values into their per-request storage define(CALL`CALLERS', `$1, 'defn(CALL`CALLERS')) define(`$1'`RETTYPE', RETTYPE) define(`$1'`RETVAL', RETVAL) define(`$1'`PARAMS', defn(`PARAMS')) define(`$1'`FLUSHGC', FLUSHGC) define(`$1'`LOCALS', LOCALS) dnl restore defaults for next round SETDEFAULTS() ') define(`XCLCALL', `define(`CALL', `$1')') define(`XCLRETTYPE', `define(`RETTYPE', `$1')') define(`XCLRETVAL', `define(`RETVAL', `$1')') define(`XCLPARAMS', `define(`PARAMS', `,$@')') define(`XCLGC', `define(`FLUSHGC', `$1')') define(`XCLLOCAL', `define(`LOCALS', defn(`LOCALS')` const `$1';') ') define(`XCLALLOC', `XCLLOCAL(`$1 $2 = dnl ifelse( $1, `Window', `WINDOW', $1, `Pixmap', `PIXMAP', $1, `Cursor', `CURSOR', $1, `Font', `FONT', $1, `GContext', `GCONTEXT', $1, `Colormap', `COLORMAP', $1, `Atom', `ATOM', )`'New(c).xid') define(`RETTYPE', `$1') define(`RETVAL', `$2') ') dnl XCLFUNC(Xlib name, XCB name, XCB args) define(`XCLFUNC', `PUSHDIV(0) $1RETTYPE X`'$1(Display *dpy`'$1PARAMS) { XCBConnection *c = XCBConnectionOfDisplay(dpy);dnl $1LOCALS ifelse($1FLUSHGC, , `dnl _XPutXCBBufferIf(dpy, _XBufferLocked); ', `dnl LockDisplay(dpy); FlushGC(dpy, $1FLUSHGC); _XPutXCBBuffer(dpy); ')dnl XCB$2(c`'PUSHDIV(-1) $3 POPDIV()); ifelse($1FLUSHGC, , `dnl _XGetXCBBufferIf(dpy, _XBufferLocked); ', `dnl _XGetXCBBuffer(dpy); UnlockDisplay(dpy); ')dnl return $1RETVAL; } POPDIV()') define(`XCLFUNCS', `ifelse($2, , , `XCLFUNC($2, $1) XCLFUNCS(`$1', shift(shift($@)))' )') dnl Implementations of XCB request description macros define(`VOIDREQUEST', `ifdef(`$1'`CALLERS', `XCLFUNCS(`$@', $1CALLERS)')') define(`REQUEST') define(`PARAM', `PUSHDIV(0), dnl ifelse( $1, `XCBWINDOW', `XCLWINDOW($2)', $1, `XCBPIXMAP', `XCLPIXMAP($2)', $1, `XCBCURSOR', `XCLCURSOR($2)', $1, `XCBFONT', `XCLFONT($2)', $1, `XCBGCONTEXT', `XCLGCONTEXT($2->gid)', $1, `XCBCOLORMAP', `XCLCOLORMAP($2)', $1, `XCBATOM', `XCLATOM($2)', $1, `XCBDRAWABLE', `XCLDRAWABLE($2)', $1, `XCBFONTABLE', `XCLFONTABLE($2)', $1, `XCBVISUALID', `XCLVISUALID($2 == CopyFromParent ? CopyFromParent : $2->visualid)', $1, `XCBTIMESTAMP', `XCLTIMESTAMP($2)', $1, `XCBKEYSYM', `XCLKEYSYM($2)', $1, `XCBKEYCODE', `XCLKEYCODE($2)', $1, `XCBBUTTON', `XCLBUTTON($2)', `$2')`'dnl POPDIV()') define(`LOCALPARAM', ` PARAM($1, $2) ') define(`LISTPARAM', `ifelse(`$3', , `PARAM(CARD32, $2_len)') PUSHDIV(0), dnl ($1 *) $2`'dnl POPDIV()') define(`VALUEPARAM', ` PARAM($1, $2) LISTPARAM(CARD32, $3, dummy-len) ')