#include "lx.h" #include "proto.h" #include "internal.h" extern void lx_GrabButton( LX_CONN *xc, int button, unsigned int modifiers, LX_XID grabwin, int ownerevents, unsigned int eventmask, LX_GRABMODE ptrmode, LX_GRABMODE kbdmode, LX_XID confine, LX_XID cursor) { unsigned char req[24]; int proto_pmode; int proto_kmode; if ( (xc->flags & XCF_FAIL) || (eventmask & EVM_POINTEREVENT_MBZ) || ((modifiers & EVS_KEYMASK_MBZ) && (modifiers != LX_AnyModifier)) ) { lx__bad_call(xc,"lx_GrabButton"); return; } proto_pmode = lx__grabmode_to_proto(ptrmode); proto_kmode = lx__grabmode_to_proto(kbdmode); if ((proto_pmode < 0) || (proto_kmode < 0)) { lx__bad_call(xc,"lx_GrabButton"); return; } if (confine == LX_WINDOW_None) confine = 0; if (cursor == LX_CURSOR_None) cursor = 0; req[0] = XP_REQ_GrabButton; req[1] = lx__boolean_to_proto(ownerevents); w_card16(&req[2],6); w_card32(&req[4],grabwin); w_card16(&req[8],eventmask); req[10] = proto_pmode; req[11] = proto_kmode; w_card32(&req[12],confine); w_card32(&req[16],cursor); req[20] = button; w_card16(&req[22],modifiers); lx__send_req(xc,&req[0],-1); }