当前位置: 首页>>代码示例>>C++>>正文


C++ dixLookupResourceByType函数代码示例

本文整理汇总了C++中dixLookupResourceByType函数的典型用法代码示例。如果您正苦于以下问题:C++ dixLookupResourceByType函数的具体用法?C++ dixLookupResourceByType怎么用?C++ dixLookupResourceByType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dixLookupResourceByType函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProcPanoramiXShapeMask

static int
ProcPanoramiXShapeMask(ClientPtr client)
{
    REQUEST(xShapeMaskReq);
    PanoramiXRes *win, *pmap;
    int j, result;

    REQUEST_SIZE_MATCH(xShapeMaskReq);

    result = dixLookupResourceByType((pointer *) &win, stuff->dest, XRT_WINDOW,
                                     client, DixWriteAccess);
    if (result != Success)
        return result;

    if (stuff->src != None) {
        result = dixLookupResourceByType((pointer *) &pmap, stuff->src,
                                         XRT_PIXMAP, client, DixReadAccess);
        if (result != Success)
            return result;
    }
    else
        pmap = NULL;

    FOR_NSCREENS(j) {
        stuff->dest = win->info[j].id;
        if (pmap)
            stuff->src = pmap->info[j].id;
        result = ProcShapeMask(client);
        if (result != Success)
            break;
    }
    return result;
}
开发者ID:coffee8651,项目名称:turbovnc,代码行数:33,代码来源:shape.c

示例2: FOR_NSCREENS_FORWARD_SKIP

/** When Xinerama is active, the client pixmaps are always obtained from
 * screen 0.  When screen 0 is detached, the pixmaps must be obtained
 * from any other screen that is not detached.  Usually, this is screen
 * 1. */
static DMXScreenInfo *dmxFindAlternatePixmap(DrawablePtr pDrawable, XID *draw)
{
#ifdef PANORAMIX
    PanoramiXRes  *pXinPix;
    int           i;
    DMXScreenInfo *dmxScreen;
            
    if (noPanoramiXExtension)               return NULL;
    if (pDrawable->type != DRAWABLE_PIXMAP) return NULL;

    if (Success != dixLookupResourceByType((pointer*) &pXinPix,
					   pDrawable->id, XRT_PIXMAP,
					   NullClient, DixUnknownAccess))
        return NULL;

    FOR_NSCREENS_FORWARD_SKIP(i) {
        dmxScreen = &dmxScreens[i];
        if (dmxScreen->beDisplay) {
            PixmapPtr     pSrc;
            dmxPixPrivPtr pSrcPriv;
            
            dixLookupResourceByType((pointer*) &pSrc, pXinPix->info[i].id,
				    RT_PIXMAP, NullClient, DixUnknownAccess);
            pSrcPriv = DMX_GET_PIXMAP_PRIV(pSrc);
            if (pSrcPriv->pixmap) {
                *draw = pSrcPriv->pixmap;
                return dmxScreen;
            }
        }
    }
#endif
    return NULL;
}
开发者ID:4eremuxa,项目名称:xserver,代码行数:37,代码来源:dmxgcops.c

示例3: ProcPanoramiXShapeCombine

static int
ProcPanoramiXShapeCombine(ClientPtr client)
{
    REQUEST(xShapeCombineReq);
    PanoramiXRes *win, *win2;
    int j, result;

    REQUEST_AT_LEAST_SIZE(xShapeCombineReq);

    result = dixLookupResourceByType((pointer *) &win, stuff->dest, XRT_WINDOW,
                                     client, DixWriteAccess);
    if (result != Success)
        return result;

    result = dixLookupResourceByType((pointer *) &win2, stuff->src, XRT_WINDOW,
                                     client, DixReadAccess);
    if (result != Success)
        return result;

    FOR_NSCREENS(j) {
        stuff->dest = win->info[j].id;
        stuff->src = win2->info[j].id;
        result = ProcShapeCombine(client);
        if (result != Success)
            break;
    }
    return result;
}
开发者ID:coffee8651,项目名称:turbovnc,代码行数:28,代码来源:shape.c

示例4: XineramaXvShmPutImage

static int 
XineramaXvShmPutImage(ClientPtr client)
{
    REQUEST(xvShmPutImageReq);
    PanoramiXRes *draw, *gc, *port;
    Bool send_event = stuff->send_event;
    Bool isRoot;
    int result, i, x, y;

    REQUEST_SIZE_MATCH(xvShmPutImageReq);

    result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
				      XRC_DRAWABLE, client, DixWriteAccess);
    if (result != Success)
	return (result == BadValue) ? BadDrawable : result;

    result = dixLookupResourceByType((pointer *)&gc, stuff->gc,
				     XRT_GC, client, DixReadAccess);
    if (result != Success)
        return result;

    result = dixLookupResourceByType((pointer *)&port, stuff->port,
				     XvXRTPort, client, DixReadAccess);
    if (result != Success)
	return result;
 
    isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;

    x = stuff->drw_x;
    y = stuff->drw_y;

    FOR_NSCREENS_BACKWARD(i) {
	if(port->info[i].id) {
	   stuff->drawable = draw->info[i].id;
	   stuff->port = port->info[i].id;
	   stuff->gc = gc->info[i].id;
	   stuff->drw_x = x;
	   stuff->drw_y = y;
	   if(isRoot) {
		stuff->drw_x -= screenInfo.screens[i]->x;
		stuff->drw_y -= screenInfo.screens[i]->y;
	   }
	   stuff->send_event = (send_event && !i) ? 1 : 0;

	   result = ProcXvShmPutImage(client);
	}
    }
    return result;
}
开发者ID:eriytt,项目名称:xserver-xsdl,代码行数:49,代码来源:xvdisp.c

示例5: SecurityClientState

static void
SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
{
    NewClientInfoRec *pci = calldata;
    SecurityStateRec *state;
    SecurityAuthorizationPtr pAuth;
    int rc;

    state = dixLookupPrivate(&pci->client->devPrivates, stateKey);

    switch (pci->client->clientState) {
    case ClientStateInitial:
	state->trustLevel = XSecurityClientTrusted;
	state->authId = None;
	state->haveState = TRUE;
	break;

    case ClientStateRunning:
	state->authId = AuthorizationIDOfClient(pci->client);
	rc = dixLookupResourceByType((pointer *)&pAuth, state->authId,
			       SecurityAuthorizationResType, serverClient,
			       DixGetAttrAccess);
	if (rc == Success) {
	    /* it is a generated authorization */
	    pAuth->refcnt++;
	    if (pAuth->refcnt == 1 && pAuth->timer)
		TimerCancel(pAuth->timer);

	    state->trustLevel = pAuth->trustLevel;
	}
	break;

    case ClientStateGone:
    case ClientStateRetained:
	rc = dixLookupResourceByType((pointer *)&pAuth, state->authId,
			       SecurityAuthorizationResType, serverClient,
			       DixGetAttrAccess);
	if (rc == Success) {
	    /* it is a generated authorization */
	    pAuth->refcnt--;
	    if (pAuth->refcnt == 0)
		SecurityStartAuthorizationTimer(pAuth);
	}
	break;

    default:
	break;
    }
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-xorg-server,代码行数:49,代码来源:security.c

示例6: __glXDisp_UseXFont

int __glXDisp_UseXFont(__GLXclientState *cl, GLbyte *pc)
{
    ClientPtr client = cl->client;
    xGLXUseXFontReq *req;
    FontPtr pFont;
    GC *pGC;
    GLuint currentListIndex;
    __GLXcontext *cx;
    int error;

    req = (xGLXUseXFontReq *) pc;
    cx = __glXForceCurrent(cl, req->contextTag, &error);
    if (!cx) {
	return error;
    }

    CALL_GetIntegerv( GET_DISPATCH(), (GL_LIST_INDEX, (GLint*) &currentListIndex) );
    if (currentListIndex != 0) {
	/*
	** A display list is currently being made.  It is an error
	** to try to make a font during another lists construction.
	*/
	client->errorValue = cx->id;
	return __glXError(GLXBadContextState);
    }

    /*
    ** Font can actually be either the ID of a font or the ID of a GC
    ** containing a font.
    */

    error = dixLookupResourceByType((pointer *)&pFont,
				    req->font, RT_FONT,
				    client, DixReadAccess);
    if (error != Success) {
	error = dixLookupResourceByType((pointer *)&pGC,
					req->font, RT_GC,
					client, DixReadAccess);
        if (error != Success) {
	    client->errorValue = req->font;
            return error == BadGC ? BadFont : error;
	}
	pFont = pGC->font;
    }

    return MakeBitmapsFromFont(pFont, req->first, req->count,
				    req->listBase);
}
开发者ID:JoliOS,项目名称:xorg-server,代码行数:48,代码来源:xfont.c

示例7: AppleWMSendEvent

void
AppleWMSendEvent (int type, unsigned int mask, int which, int arg) {
    WMEventPtr      *pHead, pEvent;
    ClientPtr       client;
    xAppleWMNotifyEvent se;
    int             i;

    i = dixLookupResourceByType((pointer *)&pHead, eventResource, EventType, serverClient, DixReadAccess);
    if (i != Success || !pHead)
        return;
    for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
        client = pEvent->client;
        if ((pEvent->mask & mask) == 0
                || client == serverClient || client->clientGone)
        {
            continue;
        }
        se.type = type + WMEventBase;
        se.kind = which;
        se.arg = arg;
        se.sequenceNumber = client->sequence;
        se.time = currentTime.milliseconds;
        WriteEventsToClient (client, 1, (xEvent *) &se);
    }
}
开发者ID:hush-z,项目名称:VMGL,代码行数:25,代码来源:applewm.c

示例8: ChangeGCXIDs

int
ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32)
{
    ChangeGCVal vals[GCLastBit + 1];
    int i;

    if (mask & ~GCAllBits) {
        client->errorValue = mask;
        return BadValue;
    }
    for (i = Ones(mask); i--;)
        vals[i].val = pC32[i];
    for (i = 0; i < ARRAY_SIZE(xidfields); ++i) {
        int offset, rc;

        if (!(mask & xidfields[i].mask))
            continue;
        offset = Ones(mask & (xidfields[i].mask - 1));
        if (xidfields[i].mask == GCClipMask && vals[offset].val == None) {
            vals[offset].ptr = NullPixmap;
            continue;
        }
        rc = dixLookupResourceByType(&vals[offset].ptr, vals[offset].val,
                                     xidfields[i].type, client,
                                     xidfields[i].access_mode);
        if (rc != Success) {
            client->errorValue = vals[offset].val;
            return rc;
        }
    }
    return ChangeGC(client, pGC, mask, vals);
}
开发者ID:jon-turney,项目名称:xorg-server,代码行数:32,代码来源:gc.c

示例9: dixLookupFontable

int
dixLookupFontable(FontPtr *pFont, XID id, ClientPtr client, Mask access)
{
    int rc;
    GC *pGC;
    client->errorValue = id;		/* EITHER font or gc */
    rc = dixLookupResourceByType((pointer *) pFont, id, RT_FONT, client, access);
    if (rc != BadFont)
	return rc;
    rc = dixLookupResourceByType((pointer *) &pGC, id, RT_GC, client, access);
    if (rc == BadGC)
	return BadFont;
    if (rc == Success)
	*pFont = pGC->font;
    return rc;
}
开发者ID:4eremuxa,项目名称:xserver,代码行数:16,代码来源:dixutils.c

示例10: ShapeFreeClient

 /*ARGSUSED*/ static int
ShapeFreeClient(pointer data, XID id)
{
    ShapeEventPtr pShapeEvent;
    WindowPtr pWin;
    ShapeEventPtr *pHead, pCur, pPrev;
    int rc;

    pShapeEvent = (ShapeEventPtr) data;
    pWin = pShapeEvent->window;
    rc = dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id,
                                 ShapeEventType, serverClient, DixReadAccess);
    if (rc == Success) {
        pPrev = 0;
        for (pCur = *pHead; pCur && pCur != pShapeEvent; pCur = pCur->next)
            pPrev = pCur;
        if (pCur) {
            if (pPrev)
                pPrev->next = pShapeEvent->next;
            else
                *pHead = pShapeEvent->next;
        }
    }
    free((pointer) pShapeEvent);
    return 1;
}
开发者ID:coffee8651,项目名称:turbovnc,代码行数:26,代码来源:shape.c

示例11: WMFreeClient

/*ARGSUSED*/
static int
WMFreeClient(void *data, XID id)
{
    WMEventPtr pEvent;
    WMEventPtr   *pHead, pCur, pPrev;
    int i;

    pEvent = (WMEventPtr)data;
    i = dixLookupResourceByType(
        (void **)&pHead, eventResource, EventType, serverClient,
        DixReadAccess |
        DixWriteAccess | DixDestroyAccess);
    if (i == Success && pHead) {
        pPrev = 0;
        for (pCur = *pHead; pCur && pCur != pEvent; pCur = pCur->next)
            pPrev = pCur;
        if (pCur) {
            if (pPrev)
                pPrev->next = pEvent->next;
            else
                *pHead = pEvent->next;
        }
        updateEventMask(pHead);
    }
    free((void *)pEvent);
    return 1;
}
开发者ID:AmesianX,项目名称:xorg-server,代码行数:28,代码来源:applewm.c

示例12: vfbUninstallColormap

static void
vfbUninstallColormap(ColormapPtr pmap)
{
#if XORG < 113
    ColormapPtr curpmap = InstalledMaps[pmap->pScreen->myNum];
#else
    ColormapPtr curpmap = GetInstalledColormap(pmap->pScreen);
#endif

    if(pmap == curpmap)
    {
	if (pmap->mid != pmap->pScreen->defColormap)
	{
#if XORG < 111
	    curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap,
						   RT_COLORMAP);
#else
	    int rc =  dixLookupResourceByType((void * *) &curpmap, pmap->pScreen->defColormap,
					      RT_COLORMAP, serverClient, DixUnknownAccess);
	    if (rc != Success)
		ErrorF("Failed to uninstall color map\n");
	    else
#endif
		(*pmap->pScreen->InstallColormap)(curpmap);
	}
    }
}
开发者ID:CendioOssman,项目名称:tigervnc,代码行数:27,代码来源:xvnc.c

示例13: XvdiSendVideoNotify

static int
XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason)
{
  xvEvent event;
  XvVideoNotifyPtr pn;

  dixLookupResourceByType((pointer *)&pn, pDraw->id, XvRTVideoNotifyList,
			  serverClient, DixReadAccess);

  while (pn) 
    {
      if (pn->client)
	{
	  event.u.u.type = XvEventBase + XvVideoNotify;
	  event.u.u.sequenceNumber = pn->client->sequence;
	  event.u.videoNotify.time = currentTime.milliseconds;
	  event.u.videoNotify.drawable = pDraw->id;
	  event.u.videoNotify.port = pPort->id;
	  event.u.videoNotify.reason = reason;
	  TryClientEvents(pn->client, NULL, (xEventPtr)&event, 1,
                          NoEventMask, NoEventMask, NullGrab);
	}
      pn = pn->next;
    }

  return Success;

}
开发者ID:JoliOS,项目名称:xorg-server,代码行数:28,代码来源:xvmain.c

示例14: LookupIDByType

/* replaced by dixLookupResourceByType */
pointer
LookupIDByType(XID id, RESTYPE rtype)
{
    pointer val;
    dixLookupResourceByType(&val, id, rtype, NullClient, DixUnknownAccess);
    return val;
}
开发者ID:Agnarr,项目名称:xserver,代码行数:8,代码来源:deprecated.c

示例15: XineramaXvStopVideo

static int
XineramaXvStopVideo(ClientPtr client)
{
   int result, i;
   PanoramiXRes *draw, *port;
   REQUEST(xvStopVideoReq);
   REQUEST_SIZE_MATCH(xvStopVideoReq);

   result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
				     XRC_DRAWABLE, client, DixWriteAccess);
   if (result != Success)
       return (result == BadValue) ? BadDrawable : result;

   result = dixLookupResourceByType((pointer *)&port, stuff->port,
				    XvXRTPort, client, DixReadAccess);
   if (result != Success)
       return result;

   FOR_NSCREENS_BACKWARD(i) {
	if(port->info[i].id) {
	   stuff->drawable = draw->info[i].id;
	   stuff->port = port->info[i].id;
	   result = ProcXvStopVideo(client);
     	}
   }

   return result;
}
开发者ID:eriytt,项目名称:xserver-xsdl,代码行数:28,代码来源:xvdisp.c


注:本文中的dixLookupResourceByType函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。