本文整理汇总了C++中dixLookupWindow函数的典型用法代码示例。如果您正苦于以下问题:C++ dixLookupWindow函数的具体用法?C++ dixLookupWindow怎么用?C++ dixLookupWindow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dixLookupWindow函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ProcAppleWMAttachTransient
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);
}
开发者ID:hush-z,项目名称:VMGL,代码行数:29,代码来源:applewm.c
示例2: ProcPseudoramiXGetScreenCount
// was PanoramiX
static int
ProcPseudoramiXGetScreenCount(ClientPtr client)
{
REQUEST(xPanoramiXGetScreenCountReq);
WindowPtr pWin;
xPanoramiXGetScreenCountReply rep;
register int rc;
TRACE;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.ScreenCount = pseudoramiXNumScreens;
rep.window = stuff->window;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.window);
}
WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply),&rep);
return Success;
}
开发者ID:Agnesa,项目名称:xserver,代码行数:29,代码来源:pseudoramiX.c
示例3: proc_present_notify_msc
static int
proc_present_notify_msc(ClientPtr client)
{
REQUEST(xPresentNotifyMSCReq);
WindowPtr window;
int rc;
REQUEST_SIZE_MATCH(xPresentNotifyMSCReq);
rc = dixLookupWindow(&window, stuff->window, client, DixReadAccess);
if (rc != Success)
return rc;
/*
* Check to see if remainder is sane
*/
if (stuff->divisor == 0) {
if (stuff->remainder != 0) {
client->errorValue = (CARD32) stuff->remainder;
return BadValue;
}
} else {
if (stuff->remainder >= stuff->divisor) {
client->errorValue = (CARD32) stuff->remainder;
return BadValue;
}
}
return present_notify_msc(window, stuff->serial,
stuff->target_msc, stuff->divisor, stuff->remainder);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:xorg__xserver-test,代码行数:30,代码来源:present_request.c
示例4: ProcRRGetOutputPrimary
int
ProcRRGetOutputPrimary(ClientPtr client)
{
REQUEST(xRRGetOutputPrimaryReq);
WindowPtr pWin;
rrScrPrivPtr pScrPriv;
xRRGetOutputPrimaryReply rep;
RROutputPtr primary = NULL;
int rc;
REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
if (pScrPriv)
primary = pScrPriv->primaryOutput;
memset(&rep, 0, sizeof(rep));
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
rep.output = primary ? primary->id : None;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.output);
}
WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep);
return Success;
}
开发者ID:RavenB,项目名称:turbovnc,代码行数:34,代码来源:rroutput.c
示例5: ProcRRSetOutputPrimary
int
ProcRRSetOutputPrimary(ClientPtr client)
{
REQUEST(xRRSetOutputPrimaryReq);
RROutputPtr output = NULL;
WindowPtr pWin;
rrScrPrivPtr pScrPriv;
int rc;
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
if (stuff->output) {
VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
if (output->pScreen != pWin->drawable.pScreen) {
client->errorValue = stuff->window;
return BadMatch;
}
}
pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
return Success;
}
开发者ID:RavenB,项目名称:turbovnc,代码行数:29,代码来源:rroutput.c
示例6: ProcShapeOffset
static int
ProcShapeOffset(ClientPtr client)
{
WindowPtr pWin;
REQUEST(xShapeOffsetReq);
RegionPtr srcRgn;
int rc;
REQUEST_SIZE_MATCH(xShapeOffsetReq);
UpdateCurrentTime();
rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
if (rc != Success)
return rc;
switch (stuff->destKind) {
case ShapeBounding:
srcRgn = wBoundingShape(pWin);
break;
case ShapeClip:
srcRgn = wClipShape(pWin);
break;
case ShapeInput:
srcRgn = wInputShape(pWin);
break;
default:
client->errorValue = stuff->destKind;
return BadValue;
}
if (srcRgn) {
RegionTranslate(srcRgn, stuff->xOff, stuff->yOff);
(*pWin->drawable.pScreen->SetShape) (pWin, stuff->destKind);
}
SendShapeNotify(pWin, (int) stuff->destKind);
return Success;
}
开发者ID:coffee8651,项目名称:turbovnc,代码行数:35,代码来源:shape.c
示例7: miSendExposures
void
miSendExposures(WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
{
BoxPtr pBox;
int numRects;
xEvent *pEvent, *pe;
int i;
pBox = RegionRects(pRgn);
numRects = RegionNumRects(pRgn);
if (!(pEvent = calloc(1, numRects * sizeof(xEvent))))
return;
for (i = numRects, pe = pEvent; --i >= 0; pe++, pBox++) {
pe->u.u.type = Expose;
pe->u.expose.window = pWin->drawable.id;
pe->u.expose.x = pBox->x1 - dx;
pe->u.expose.y = pBox->y1 - dy;
pe->u.expose.width = pBox->x2 - pBox->x1;
pe->u.expose.height = pBox->y2 - pBox->y1;
pe->u.expose.count = i;
}
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
int scrnum = pWin->drawable.pScreen->myNum;
int x = 0, y = 0;
XID realWin = 0;
if (!pWin->parent) {
x = screenInfo.screens[scrnum]->x;
y = screenInfo.screens[scrnum]->y;
pWin = screenInfo.screens[0]->root;
realWin = pWin->drawable.id;
}
else if (scrnum) {
PanoramiXRes *win;
win = PanoramiXFindIDByScrnum(XRT_WINDOW,
pWin->drawable.id, scrnum);
if (!win) {
free(pEvent);
return;
}
realWin = win->info[0].id;
dixLookupWindow(&pWin, realWin, serverClient, DixSendAccess);
}
if (x || y || scrnum)
for (i = 0; i < numRects; i++) {
pEvent[i].u.expose.window = realWin;
pEvent[i].u.expose.x += x;
pEvent[i].u.expose.y += y;
}
}
#endif
DeliverEvents(pWin, pEvent, numRects, NullWindow);
free(pEvent);
}
开发者ID:mirror,项目名称:xserver,代码行数:60,代码来源:miexpose.c
示例8: ProcAppleWMFrameDraw
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;
}
开发者ID:AmesianX,项目名称:xorg-server,代码行数:35,代码来源:applewm.c
示例9: ProcDMXForceWindowCreation
static int ProcDMXForceWindowCreation(ClientPtr client)
{
xDMXForceWindowCreationReply rep;
REQUEST(xDMXForceWindowCreationReq);
WindowPtr pWin;
int n;
REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
PanoramiXRes *win;
int i;
if (!(win = SecurityLookupIDByType(client, stuff->window, XRT_WINDOW,
DixReadAccess)))
return -1; /* BadWindow */
FOR_NSCREENS(i) {
if (Success != dixLookupWindow(&pWin, win->info[i].id, client,
DixReadAccess))
return -1; /* BadWindow */
dmxForceWindowCreation(pWin);
}
goto doreply;
}
开发者ID:mozyg,项目名称:xorg,代码行数:27,代码来源:dmx.c
示例10: ProcXUngrabDeviceButton
int
ProcXUngrabDeviceButton(ClientPtr client)
{
DeviceIntPtr dev;
DeviceIntPtr mdev;
WindowPtr pWin;
GrabPtr temporaryGrab;
int rc;
REQUEST(xUngrabDeviceButtonReq);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
if (rc != Success)
return rc;
if (dev->button == NULL)
return BadMatch;
if (stuff->modifier_device != UseXKeyboard) {
rc = dixLookupDevice(&mdev, stuff->modifier_device, client,
DixReadAccess);
if (rc != Success)
return BadDevice;
if (mdev->key == NULL)
return BadMatch;
}
else
mdev = PickKeyboard(client);
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
if (rc != Success)
return rc;
if ((stuff->modifiers != AnyModifier) &&
(stuff->modifiers & ~AllModifiersMask))
return BadValue;
temporaryGrab = AllocGrab();
if (!temporaryGrab)
return BadAlloc;
temporaryGrab->resource = client->clientAsMask;
temporaryGrab->device = dev;
temporaryGrab->window = pWin;
temporaryGrab->type = DeviceButtonPress;
temporaryGrab->grabtype = XI;
temporaryGrab->modifierDevice = mdev;
temporaryGrab->modifiersDetail.exact = stuff->modifiers;
temporaryGrab->modifiersDetail.pMask = NULL;
temporaryGrab->detail.exact = stuff->button;
temporaryGrab->detail.pMask = NULL;
DeletePassiveGrabFromList(temporaryGrab);
FreeGrab(temporaryGrab);
return Success;
}
开发者ID:0taKu163,项目名称:xserver,代码行数:57,代码来源:ungrdevb.c
示例11: ProcWindowsWMFrameSetTitle
static int
ProcWindowsWMFrameSetTitle(ClientPtr client)
{
unsigned int title_length, title_max;
char *title_bytes;
REQUEST(xWindowsWMFrameSetTitleReq);
WindowPtr pWin;
win32RootlessWindowPtr pRLWinPriv;
int rc;
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameSetTitle\n");
#endif
REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
if (rc != Success)
return rc;
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameSetTitle - Window found\n");
#endif
title_length = stuff->title_length;
title_max = (stuff->length << 2) - sizeof(xWindowsWMFrameSetTitleReq);
if (title_max < title_length)
return BadValue;
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameSetTitle - length is valid\n");
#endif
title_bytes = malloc(title_length + 1);
strncpy(title_bytes, (char *) &stuff[1], title_length);
title_bytes[title_length] = '\0';
pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE);
if (pRLWinPriv == 0) {
free(title_bytes);
return BadWindow;
}
/* Flush the window style */
SetWindowText(pRLWinPriv->hWnd, title_bytes);
free(title_bytes);
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameSetTitle - done\n");
#endif
return Success;
}
开发者ID:cubanismo,项目名称:xserver,代码行数:56,代码来源:winwindowswm.c
示例12: ProcXUngrabDeviceKey
int
ProcXUngrabDeviceKey(ClientPtr client)
{
DeviceIntPtr dev;
DeviceIntPtr mdev;
WindowPtr pWin;
GrabRec temporaryGrab;
int rc;
REQUEST(xUngrabDeviceKeyReq);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
rc = dixLookupDevice(&dev, stuff->grabbed_device, client, DixGrabAccess);
if (rc != Success)
return rc;
if (dev->key == NULL)
return BadMatch;
if (stuff->modifier_device != UseXKeyboard) {
rc = dixLookupDevice(&mdev, stuff->modifier_device, client,
DixReadAccess);
if (rc != Success)
return BadDevice;
if (mdev->key == NULL)
return BadMatch;
} else
mdev = PickKeyboard(client);
rc = dixLookupWindow(&pWin, stuff->grabWindow, client, DixSetAttrAccess);
if (rc != Success)
return rc;
if (((stuff->key > dev->key->curKeySyms.maxKeyCode) ||
(stuff->key < dev->key->curKeySyms.minKeyCode))
&& (stuff->key != AnyKey))
return BadValue;
if ((stuff->modifiers != AnyModifier) &&
(stuff->modifiers & ~AllModifiersMask))
return BadValue;
temporaryGrab.resource = client->clientAsMask;
temporaryGrab.device = dev;
temporaryGrab.window = pWin;
temporaryGrab.type = DeviceKeyPress;
temporaryGrab.modifierDevice = mdev;
temporaryGrab.modifiersDetail.exact = stuff->modifiers;
temporaryGrab.modifiersDetail.pMask = NULL;
temporaryGrab.detail.exact = stuff->key;
temporaryGrab.detail.pMask = NULL;
DeletePassiveGrabFromList(&temporaryGrab);
return Success;
}
开发者ID:aosm,项目名称:X11server,代码行数:54,代码来源:ungrdevk.c
示例13: proc_present_query_capabilities
static int
proc_present_query_capabilities (ClientPtr client)
{
REQUEST(xPresentQueryCapabilitiesReq);
xPresentQueryCapabilitiesReply rep = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0,
};
WindowPtr window;
RRCrtcPtr crtc = NULL;
int r;
REQUEST_SIZE_MATCH(xPresentQueryCapabilitiesReq);
r = dixLookupWindow(&window, stuff->target, client, DixGetAttrAccess);
switch (r) {
case Success:
crtc = present_get_crtc(window);
break;
case BadWindow:
VERIFY_RR_CRTC(stuff->target, crtc, DixGetAttrAccess);
break;
default:
return r;
}
rep.capabilities = present_query_capabilities(crtc);
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.capabilities);
}
WriteToClient(client, sizeof(rep), &rep);
return Success;
}
static int (*proc_present_vector[PresentNumberRequests]) (ClientPtr) = {
proc_present_query_version, /* 0 */
proc_present_pixmap, /* 1 */
proc_present_notify_msc, /* 2 */
proc_present_select_input, /* 3 */
proc_present_query_capabilities, /* 4 */
};
int
proc_present_dispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data >= PresentNumberRequests || !proc_present_vector[stuff->data])
return BadRequest;
return (*proc_present_vector[stuff->data]) (client);
}
开发者ID:AmesianX,项目名称:xorg-server,代码行数:53,代码来源:present_request.c
示例14: SecurityLookupWindow
/* replaced by dixLookupWindow */
WindowPtr
SecurityLookupWindow(XID id, ClientPtr client, Mask access_mode)
{
WindowPtr pWin;
int i = dixLookupWindow(&pWin, id, client, access_mode);
static int warn = 1;
if (warn > 0 && --warn)
ErrorF("Warning: LookupWindow()/SecurityLookupWindow() "
"are deprecated. Please convert your driver/module "
"to use dixLookupWindow().\n");
return (i == Success) ? pWin : NULL;
}
开发者ID:Agnarr,项目名称:xserver,代码行数:13,代码来源:deprecated.c
示例15: ProcConvertSelection
int
ProcConvertSelection(ClientPtr client)
{
Bool paramsOkay;
xEvent event;
WindowPtr pWin;
Selection *pSel;
int rc;
REQUEST(xConvertSelectionReq);
REQUEST_SIZE_MATCH(xConvertSelectionReq);
rc = dixLookupWindow(&pWin, stuff->requestor, client, DixSetAttrAccess);
if (rc != Success)
return rc;
paramsOkay = ValidAtom(stuff->selection) && ValidAtom(stuff->target);
paramsOkay &= (stuff->property == None) || ValidAtom(stuff->property);
if (!paramsOkay) {
client->errorValue = stuff->property;
return BadAtom;
}
rc = dixLookupSelection(&pSel, stuff->selection, client, DixReadAccess);
memset(&event, 0, sizeof(xEvent));
if (rc != Success && rc != BadMatch)
return rc;
else if (rc == Success && pSel->window != None) {
event.u.u.type = SelectionRequest;
event.u.selectionRequest.owner = pSel->window;
event.u.selectionRequest.time = stuff->time;
event.u.selectionRequest.requestor = stuff->requestor;
event.u.selectionRequest.selection = stuff->selection;
event.u.selectionRequest.target = stuff->target;
event.u.selectionRequest.property = stuff->property;
if (pSel->client && pSel->client != serverClient &&
!pSel->client->clientGone) {
WriteEventsToClient(pSel->client, 1, &event);
return Success;
}
}
event.u.u.type = SelectionNotify;
event.u.selectionNotify.time = stuff->time;
event.u.selectionNotify.requestor = stuff->requestor;
event.u.selectionNotify.selection = stuff->selection;
event.u.selectionNotify.target = stuff->target;
event.u.selectionNotify.property = None;
WriteEventsToClient(client, 1, &event);
return Success;
}
开发者ID:sheldonrobinson,项目名称:VcXsrv,代码行数:52,代码来源:selection.c
示例16: ProcSetSelectionOwner
int
ProcSetSelectionOwner(ClientPtr client)
{
WindowPtr pWin = NULL;
TimeStamp time;
Selection *pSel;
int rc;
REQUEST(xSetSelectionOwnerReq);
REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
UpdateCurrentTime();
time = ClientTimeToServerTime(stuff->time);
/* If the client's time stamp is in the future relative to the server's
time stamp, do not set the selection, just return success. */
if (CompareTimeStamps(time, currentTime) == LATER)
return Success;
if (stuff->window != None) {
rc = dixLookupWindow(&pWin, stuff->window, client, DixSetAttrAccess);
if (rc != Success)
return rc;
}
if (!ValidAtom(stuff->selection)) {
client->errorValue = stuff->selection;
return BadAtom;
}
/*
* First, see if the selection is already set...
*/
rc = dixLookupSelection(&pSel, stuff->selection, client, DixSetAttrAccess);
if (rc == Success) {
/* If the timestamp in client's request is in the past relative
to the time stamp indicating the last time the owner of the
selection was set, do not set the selection, just return
success. */
if (CompareTimeStamps(time, pSel->lastTimeChanged) == EARLIER)
return Success;
if (pSel->client && (!pWin || (pSel->client != client))) {
xEvent event = {
.u.selectionClear.time = time.milliseconds,
.u.selectionClear.window = pSel->window,
.u.selectionClear.atom = pSel->selection
};
event.u.u.type = SelectionClear;
WriteEventsToClient(pSel->client, 1, &event);
}
}
else if (rc == BadMatch) {
开发者ID:AmesianX,项目名称:xorg-server,代码行数:52,代码来源:selection.c
示例17: ProcConvertSelection
int
ProcConvertSelection(ClientPtr client)
{
Bool paramsOkay;
xEvent event;
WindowPtr pWin;
Selection *pSel;
int rc;
REQUEST(xConvertSelectionReq);
REQUEST_SIZE_MATCH(xConvertSelectionReq);
rc = dixLookupWindow(&pWin, stuff->requestor, client, DixSetAttrAccess);
if (rc != Success)
return rc;
paramsOkay = ValidAtom(stuff->selection) && ValidAtom(stuff->target);
paramsOkay &= (stuff->property == None) || ValidAtom(stuff->property);
if (!paramsOkay) {
client->errorValue = stuff->property;
return BadAtom;
}
rc = dixLookupSelection(&pSel, stuff->selection, client, DixReadAccess);
memset(&event, 0, sizeof(xEvent));
if (rc != Success && rc != BadMatch)
return rc;
else if (rc == Success && pSel->window != None) {
event.u.u.type = SelectionRequest;
event.u.selectionRequest.owner = pSel->window;
event.u.selectionRequest.time = stuff->time;
event.u.selectionRequest.requestor = stuff->requestor;
event.u.selectionRequest.selection = stuff->selection;
event.u.selectionRequest.target = stuff->target;
event.u.selectionRequest.property = stuff->property;
if (TryClientEvents(pSel->client, NULL, &event, 1, NoEventMask,
NoEventMask /* CantBeFiltered */, NullGrab))
return client->noClientException;
}
event.u.u.type = SelectionNotify;
event.u.selectionNotify.time = stuff->time;
event.u.selectionNotify.requestor = stuff->requestor;
event.u.selectionNotify.selection = stuff->selection;
event.u.selectionNotify.target = stuff->target;
event.u.selectionNotify.property = None;
TryClientEvents(client, NULL, &event, 1, NoEventMask,
NoEventMask /* CantBeFiltered */, NullGrab);
return client->noClientException;
}
开发者ID:Happy-Ferret,项目名称:xserver-with-gl-accelerated-xephyr,代码行数:51,代码来源:selection.c
示例18: ProcRRCreateMode
int
ProcRRCreateMode (ClientPtr client)
{
REQUEST(xRRCreateModeReq);
xRRCreateModeReply rep;
WindowPtr pWin;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
xRRModeInfo *modeInfo;
long units_after;
char *name;
int error, rc;
RRModePtr mode;
REQUEST_AT_LEAST_SIZE (xRRCreateModeReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
pScreen = pWin->drawable.pScreen;
pScrPriv = rrGetScrPriv(pScreen);
modeInfo = &stuff->modeInfo;
name = (char *) (stuff + 1);
units_after = (stuff->length - bytes_to_int32(sizeof (xRRCreateModeReq)));
/* check to make sure requested name fits within the data provided */
if (bytes_to_int32(modeInfo->nameLength) > units_after)
return BadLength;
mode = RRModeCreateUser (pScreen, modeInfo, name, &error);
if (!mode)
return error;
rep.type = X_Reply;
rep.pad0 = 0;
rep.sequenceNumber = client->sequence;
rep.length = 0;
rep.mode = mode->mode.id;
if (client->swapped)
{
int n;
swaps(&rep.sequenceNumber, n);
swapl(&rep.length, n);
swapl(&rep.mode, n);
}
WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
/* Drop out reference to this mode */
RRModeDestroy (mode);
return client->noClientException;
}
开发者ID:fenghaitao,项目名称:xserver-with-gl-accelerated-xephyr,代码行数:51,代码来源:rrmode.c
示例19: ProcXGetDeviceDontPropagateList
int
ProcXGetDeviceDontPropagateList(ClientPtr client)
{
CARD16 count = 0;
int i, rc;
XEventClass *buf = NULL, *tbuf;
WindowPtr pWin;
xGetDeviceDontPropagateListReply rep;
OtherInputMasks *others;
REQUEST(xGetDeviceDontPropagateListReq);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
rep.repType = X_Reply;
rep.RepType = X_GetDeviceDontPropagateList;
rep.sequenceNumber = client->sequence;
rep.length = 0;
rep.count = 0;
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
if ((others = wOtherInputMasks(pWin)) != 0) {
for (i = 0; i < EMASKSIZE; i++)
ClassFromMask(NULL, others->dontPropagateMask[i], i,
&count, COUNT);
if (count) {
rep.count = count;
buf = (XEventClass *) malloc(rep.count * sizeof(XEventClass));
rep.length = bytes_to_int32(rep.count * sizeof(XEventClass));
tbuf = buf;
for (i = 0; i < EMASKSIZE; i++)
tbuf = ClassFromMask(tbuf, others->dontPropagateMask[i], i,
NULL, CREATE);
}
}
WriteReplyToClient(client, sizeof(xGetDeviceDontPropagateListReply), &rep);
if (count) {
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
WriteSwappedDataToClient(client, count * sizeof(XEventClass), buf);
free(buf);
}
return Success;
}
开发者ID:EMGD-Community,项目名称:xserver-xorg,代码行数:48,代码来源:getprop.c
示例20: ProcXFixesSelectSelectionInput
int
ProcXFixesSelectSelectionInput(ClientPtr client)
{
REQUEST(xXFixesSelectSelectionInputReq);
WindowPtr pWin;
int rc;
REQUEST_SIZE_MATCH(xXFixesSelectSelectionInputReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
if (rc != Success)
return rc;
if (stuff->eventMask & ~SelectionAllEvents) {
client->errorValue = stuff->eventMask;
return BadValue;
}
return XFixesSelectSelectionInput(client, stuff->selection,
pWin, stuff->eventMask);
}
开发者ID:coffee8651,项目名称:turbovnc,代码行数:18,代码来源:select.c
注:本文中的dixLookupWindow函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论