static int ProcAppleWMFrameHitTest( register ClientPtr client ) { xAppleWMFrameHitTestReply rep; BoxRec ir, or; int ret; REQUEST(xAppleWMFrameHitTestReq); REQUEST_SIZE_MATCH(xAppleWMFrameHitTestReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih); or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh); if (appleWMProcs->FrameHitTest(stuff->frame_class, stuff->px, stuff->py, &or, &ir, &ret) != Success) { return BadValue; } rep.ret = ret; WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep); return (client->noClientException); }
static int ProcAppleWMAttachTransient(register ClientPtr client) { WindowPtr pWinChild, pWinParent; REQUEST(xAppleWMAttachTransientReq); int err; REQUEST_SIZE_MATCH(xAppleWMAttachTransientReq); if(!appleWMProcs->AttachTransient) return BadRequest; if (Success != dixLookupWindow(&pWinChild, stuff->child, client, DixReadAccess)) return BadValue; if(stuff->parent) { if(Success != dixLookupWindow(&pWinParent, stuff->parent, client, DixReadAccess)) return BadValue; } else { pWinParent = NULL; } err = appleWMProcs->AttachTransient(pWinChild, pWinParent); if (err != Success) { return err; } return (client->noClientException); }
static int ProcAppleWMFrameGetRect( register ClientPtr client ) { xAppleWMFrameGetRectReply rep; BoxRec ir, or, rr; REQUEST(xAppleWMFrameGetRectReq); REQUEST_SIZE_MATCH(xAppleWMFrameGetRectReq); rep.type = X_Reply; rep.length = 0; rep.sequenceNumber = client->sequence; ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih); or = make_box (stuff->ox, stuff->oy, stuff->ow, stuff->oh); if (appleWMProcs->FrameGetRect(stuff->frame_rect, stuff->frame_class, &or, &ir, &rr) != Success) { return BadValue; } rep.x = rr.x1; rep.y = rr.y1; rep.w = rr.x2 - rr.x1; rep.h = rr.y2 - rr.y1; WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep); return (client->noClientException); }
static int ProcAppleWMFrameDraw(register ClientPtr client) { BoxRec ir, or; unsigned int title_length, title_max; unsigned char *title_bytes; REQUEST(xAppleWMFrameDrawReq); WindowPtr pWin; REQUEST_AT_LEAST_SIZE(xAppleWMFrameDrawReq); if (Success != dixLookupWindow(&pWin, stuff->window, client, DixReadAccess)) return BadValue; ir = make_box(stuff->ix, stuff->iy, stuff->iw, stuff->ih); or = make_box(stuff->ox, stuff->oy, stuff->ow, stuff->oh); title_length = stuff->title_length; title_max = (stuff->length << 2) - sizeof(xAppleWMFrameDrawReq); if (title_max < title_length) return BadValue; title_bytes = (unsigned char *)&stuff[1]; errno = appleWMProcs->FrameDraw(pWin, stuff->frame_class, stuff->frame_attr, &or, &ir, title_length, title_bytes); if (errno != Success) { return errno; } return Success; }
static int ProcAppleWMReenableUpdate(register ClientPtr client) { REQUEST_SIZE_MATCH(xAppleWMReenableUpdateReq); appleWMProcs->EnableUpdate(); return Success; }
static int ProcAppleWMReenableUpdate( register ClientPtr client ) { REQUEST_SIZE_MATCH(xAppleWMReenableUpdateReq); appleWMProcs->EnableUpdate(); return (client->noClientException); }
static int ProcAppleWMSendPSN(register ClientPtr client) { REQUEST(xAppleWMSendPSNReq); int err; REQUEST_SIZE_MATCH(xAppleWMSendPSNReq); if(!appleWMProcs->SendPSN) return BadRequest; err = appleWMProcs->SendPSN(stuff->psn_hi, stuff->psn_lo); if (err != Success) { return err; } return (client->noClientException); }
static int ProcAppleWMSetWindowLevel(register ClientPtr client) { REQUEST(xAppleWMSetWindowLevelReq); WindowPtr pWin; int err; REQUEST_SIZE_MATCH(xAppleWMSetWindowLevelReq); if (Success != dixLookupWindow(&pWin, stuff->window, client, DixReadAccess)) return BadValue; if (stuff->level < 0 || stuff->level >= AppleWMNumWindowLevels) { return BadValue; } err = appleWMProcs->SetWindowLevel(pWin, stuff->level); if (err != Success) { return err; } return (client->noClientException); }