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


C++ CreateNewResourceType函数代码示例

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


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

示例1: DamageExtensionInit

void
DamageExtensionInit(void)
{
    ExtensionEntry *extEntry;
    int		    s;

    for (s = 0; s < screenInfo.numScreens; s++)
	DamageSetup (screenInfo.screens[s]);

    DamageExtType = CreateNewResourceType (FreeDamageExt, "DamageExt");
    if (!DamageExtType)
	return;

    DamageExtWinType = CreateNewResourceType (FreeDamageExtWin, "DamageExtWin");
    if (!DamageExtWinType)
	return;

    if (!dixRegisterPrivateKey(&DamageClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (DamageClientRec)))
	return;

    if (!AddCallback (&ClientStateCallback, DamageClientCallback, 0))
	return;

    if ((extEntry = AddExtension(DAMAGE_NAME, XDamageNumberEvents, 
				 XDamageNumberErrors,
				 ProcDamageDispatch, SProcDamageDispatch,
				 DamageResetProc, StandardMinorOpcode)) != 0)
    {
	DamageReqCode = (unsigned char)extEntry->base;
	DamageEventBase = extEntry->eventBase;
	EventSwapVector[DamageEventBase + XDamageNotify] =
			(EventSwapPtr) SDamageNotifyEvent;
	SetResourceTypeErrorValue(DamageExtType, extEntry->errorBase + BadDamage);
    }
}
开发者ID:EMGD-Community,项目名称:xserver-xorg,代码行数:35,代码来源:damageext.c

示例2: vivante_dri2_ScreenInit

Bool vivante_dri2_ScreenInit(ScreenPtr pScreen)
{
	struct vivante *vivante = vivante_get_screen_priv(pScreen);
	struct vivante_dri2_info *dri;
	DRI2InfoRec info;
	int dri2_major = 0;
	int dri2_minor = 0;
	const char *driverNames[1];

	if (xf86LoaderCheckSymbol("DRI2Version"))
		DRI2Version(&dri2_major, &dri2_minor);

	if (dri2_major < 1 || (dri2_major == 1 && dri2_minor < 1)) {
		xf86DrvMsg(vivante->scrnIndex, X_WARNING,
			   "DRI2 requires DRI2 module version 1.1.0 or later\n");
		return FALSE;
	}

	if (!vivante_dri2_register_private())
		return FALSE;

	if (dri2_server_generation != serverGeneration) {
		dri2_server_generation = serverGeneration;

		wait_client_restype = CreateNewResourceType(vivante_dri2_client_gone,
							"Frame Event Client");
		wait_drawable_restype = CreateNewResourceType(vivante_dri2_drawable_gone,
							  "Frame Event Drawable");

		if (!wait_client_restype || !wait_drawable_restype) {
			xf86DrvMsg(vivante->scrnIndex, X_WARNING,
				   "Can not register DRI2 frame event resources\n");
			return FALSE;
		}
	}

	dri = xnfcalloc(1, sizeof *dri);
	dri->devname = drmGetDeviceNameFromFd(vivante->drm_fd);

	vivante->dri2 = dri;

	memset(&info, 0, sizeof(info));
	info.version = 4;
	info.fd = vivante->drm_fd;
	info.driverName = "galdri";
	info.deviceName = dri->devname;

	info.CreateBuffer = vivante_dri2_CreateBuffer;
	info.DestroyBuffer = vivante_dri2_DestroyBuffer;
	info.CopyRegion = vivante_dri2_CopyRegion;

	info.ScheduleSwap = vivante_dri2_ScheduleSwap;
	info.GetMSC = vivante_dri2_GetMSC;
	info.ScheduleWaitMSC = vivante_dri2_ScheduleWaitMSC;
	info.numDrivers = 1;
	info.driverNames = driverNames;
	driverNames[0] = info.driverName;

	return DRI2ScreenInit(pScreen, &info);
}
开发者ID:stefan-langenmaier,项目名称:xf86-video-armada,代码行数:60,代码来源:vivante_dri2.c

示例3: XvMCExtensionInit

void 
XvMCExtensionInit()
{
   ExtensionEntry *extEntry;

   if(XvMCScreenIndex < 0) /* nobody supports it */
	return; 

   if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes)))
	return;

   if(!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes)))
	return;

   if(!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes)))
	return;

   extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors, 
                              ProcXvMCDispatch, SProcXvMCDispatch,
                              XvMCResetProc, StandardMinorOpcode);

   if(!extEntry) return;
  
   XvMCReqCode = extEntry->base;
   XvMCEventBase = extEntry->eventBase;
   XvMCErrorBase = extEntry->errorBase;
}
开发者ID:GrahamCobb,项目名称:maemo-xsisusb,代码行数:27,代码来源:xvmc.c

示例4: XFixesSelectionInit

Bool
XFixesSelectionInit (void)
{
    SelectionClientType = CreateNewResourceType(SelectionFreeClient);
    SelectionWindowType = CreateNewResourceType(SelectionFreeWindow);
    return SelectionClientType && SelectionWindowType;
}
开发者ID:aosm,项目名称:X11server,代码行数:7,代码来源:select.c

示例5: SecurityExtensionInit

void
SecurityExtensionInit(INITARGS)
{
    ExtensionEntry	*extEntry;
    int ret = TRUE;

    SecurityAuthorizationResType =
	CreateNewResourceType(SecurityDeleteAuthorization,
			      "SecurityAuthorization");

    RTEventClient =
	CreateNewResourceType(SecurityDeleteAuthorizationEventClient,
			      "SecurityEventClient");

    if (!SecurityAuthorizationResType || !RTEventClient)
	return;

    RTEventClient |= RC_NEVERRETAIN;

    /* Allocate the private storage */
    if (!dixRegisterPrivateKey(stateKey, PRIVATE_CLIENT, sizeof(SecurityStateRec)))
	FatalError("SecurityExtensionSetup: Can't allocate client private.\n");

    /* Register callbacks */
    ret &= AddCallback(&ClientStateCallback, SecurityClientState, NULL);

    ret &= XaceRegisterCallback(XACE_EXT_DISPATCH, SecurityExtension, NULL);
    ret &= XaceRegisterCallback(XACE_RESOURCE_ACCESS, SecurityResource, NULL);
    ret &= XaceRegisterCallback(XACE_DEVICE_ACCESS, SecurityDevice, NULL);
    ret &= XaceRegisterCallback(XACE_PROPERTY_ACCESS, SecurityProperty, NULL);
    ret &= XaceRegisterCallback(XACE_SEND_ACCESS, SecuritySend, NULL);
    ret &= XaceRegisterCallback(XACE_RECEIVE_ACCESS, SecurityReceive, NULL);
    ret &= XaceRegisterCallback(XACE_CLIENT_ACCESS, SecurityClient, NULL);
    ret &= XaceRegisterCallback(XACE_EXT_ACCESS, SecurityExtension, NULL);
    ret &= XaceRegisterCallback(XACE_SERVER_ACCESS, SecurityServer, NULL);

    if (!ret)
	FatalError("SecurityExtensionSetup: Failed to register callbacks\n");

    /* Add extension to server */
    extEntry = AddExtension(SECURITY_EXTENSION_NAME,
			    XSecurityNumberEvents, XSecurityNumberErrors,
			    ProcSecurityDispatch, SProcSecurityDispatch,
                            SecurityResetProc, StandardMinorOpcode);

    SecurityErrorBase = extEntry->errorBase;
    SecurityEventBase = extEntry->eventBase;

    EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] =
	(EventSwapPtr)SwapSecurityAuthorizationRevokedEvent;

    SetResourceTypeErrorValue(SecurityAuthorizationResType, SecurityErrorBase + XSecurityBadAuthorization);

    /* Label objects that were created before we could register ourself */
    SecurityLabelInitial();
}
开发者ID:OpenInkpot-archive,项目名称:iplinux-xorg-server,代码行数:56,代码来源:security.c

示例6: winWindowsWMExtensionInit

void
winWindowsWMExtensionInit(void)
{
    ExtensionEntry *extEntry;

    ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
    eventResourceType = CreateNewResourceType(WMFreeEvents, "WMEvent");
    eventResource = FakeClientID(0);

    if (ClientType && eventResourceType &&
        (extEntry = AddExtension(WINDOWSWMNAME,
                                 WindowsWMNumberEvents,
                                 WindowsWMNumberErrors,
                                 ProcWindowsWMDispatch,
                                 SProcWindowsWMDispatch,
                                 NULL, StandardMinorOpcode))) {
        size_t i;

        WMReqCode = (unsigned char) extEntry->base;
        WMErrorBase = extEntry->errorBase;
        WMEventBase = extEntry->eventBase;
        for (i = 0; i < WindowsWMNumberEvents; i++)
            EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent;
    }
}
开发者ID:cubanismo,项目名称:xserver,代码行数:25,代码来源:winwindowswm.c

示例7: XvMCExtensionInit

void
XvMCExtensionInit(void)
{
   ExtensionEntry *extEntry;

   if(XvMCScreenKey == NULL) /* nobody supports it */
	return; 

   if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes,
					      "XvMCRTContext")))
	return;

   if(!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes,
					      "XvMCRTSurface")))
	return;

   if(!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes,
						 "XvMCRTSubpicture")))
	return;

   extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors, 
                              ProcXvMCDispatch, SProcXvMCDispatch,
                              NULL, StandardMinorOpcode);

   if(!extEntry) return;
  
   XvMCReqCode = extEntry->base;
   XvMCEventBase = extEntry->eventBase;
   SetResourceTypeErrorValue(XvMCRTContext, extEntry->errorBase + XvMCBadContext);
   SetResourceTypeErrorValue(XvMCRTSurface, extEntry->errorBase + XvMCBadSurface);
   SetResourceTypeErrorValue(XvMCRTSubpicture, extEntry->errorBase + XvMCBadSubpicture);
}
开发者ID:Agnarr,项目名称:xserver,代码行数:32,代码来源:xvmc.c

示例8: RRExtensionInit

void
RRExtensionInit (void)
{
    ExtensionEntry *extEntry;

    if (RRNScreens == 0) return;

    if (!dixRequestPrivate(RRClientPrivateKey,
                           sizeof (RRClientRec) +
                           screenInfo.numScreens * sizeof (RRTimesRec)))
        return;
    if (!AddCallback (&ClientStateCallback, RRClientCallback, 0))
        return;

    RRClientType = CreateNewResourceType(RRFreeClient);
    if (!RRClientType)
        return;
    RREventType = CreateNewResourceType(RRFreeEvents);
    if (!RREventType)
        return;
    extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors,
                             ProcRRDispatch, SProcRRDispatch,
                             NULL, StandardMinorOpcode);
    if (!extEntry)
        return;
    RRErrorBase = extEntry->errorBase;
    RREventBase = extEntry->eventBase;
    EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr)
            SRRScreenChangeNotifyEvent;
    EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr)
            SRRNotifyEvent;
#ifdef PANORAMIX
    RRXineramaExtensionInit();
#endif
}
开发者ID:hush-z,项目名称:VMGL,代码行数:35,代码来源:randr.c

示例9: AppleWMExtensionInit

void
AppleWMExtensionInit(
    AppleWMProcsPtr procsPtr)
{
    ExtensionEntry* extEntry;

    ClientType = CreateNewResourceType(WMFreeClient);
    EventType = CreateNewResourceType(WMFreeEvents);
    eventResource = FakeClientID(0);

    if (ClientType && EventType &&
            (extEntry = AddExtension(APPLEWMNAME,
                                     AppleWMNumberEvents,
                                     AppleWMNumberErrors,
                                     ProcAppleWMDispatch,
                                     SProcAppleWMDispatch,
                                     NULL,
                                     StandardMinorOpcode)))
    {
        WMReqCode = (unsigned char)extEntry->base;
        WMErrorBase = extEntry->errorBase;
        WMEventBase = extEntry->eventBase;
        EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
        appleWMProcs = procsPtr;
    }
}
开发者ID:hush-z,项目名称:VMGL,代码行数:26,代码来源:applewm.c

示例10: ShapeExtensionInit

void
ShapeExtensionInit(void)
{
    ExtensionEntry *extEntry;

    ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
    ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
    if (ClientType && ShapeEventType &&
        (extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
                                 ProcShapeDispatch, SProcShapeDispatch,
                                 NULL, StandardMinorOpcode))) {
        ShapeEventBase = extEntry->eventBase;
        EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
    }
}
开发者ID:coffee8651,项目名称:turbovnc,代码行数:15,代码来源:shape.c

示例11: DRIExtensionInit

Bool
DRIExtensionInit(void)
{
    static unsigned long DRIGeneration = 0;

    if (DRIGeneration != serverGeneration) {
        if ((DRIScreenPrivIndex = AllocateScreenPrivateIndex()) < 0)
            return FALSE;
        DRIGeneration = serverGeneration;
    }

    /*
     * Allocate a window private index with a zero sized private area for
     * each window, then should a window become a DRI window, we'll hang
     * a DRIWindowPrivateRec off of this private index. Do same for pixmaps.
     */
    if ((DRIWindowPrivIndex = AllocateWindowPrivateIndex()) < 0)
        return FALSE;
    if ((DRIPixmapPrivIndex = AllocatePixmapPrivateIndex()) < 0)
        return FALSE;

    DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);

    return TRUE;
}
开发者ID:BackupTheBerlios,项目名称:dri-ex-svn,代码行数:25,代码来源:dri.c

示例12: XInputExtensionInit

void
XInputExtensionInit(void)
{
    ExtensionEntry *extEntry;

    extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch,
                            SProcIDispatch, IResetProc, StandardMinorOpcode);
    if (extEntry) {
        IReqCode = extEntry->base;
        AllExtensionVersions[IReqCode - 128] = thisversion;
        MakeDeviceTypeAtoms();
        RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
        FixExtensionEvents(extEntry);
        ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
        EventSwapVector[DeviceValuator] = SEventIDispatch;
        EventSwapVector[DeviceKeyPress] = SEventIDispatch;
        EventSwapVector[DeviceKeyRelease] = SEventIDispatch;
        EventSwapVector[DeviceButtonPress] = SEventIDispatch;
        EventSwapVector[DeviceButtonRelease] = SEventIDispatch;
        EventSwapVector[DeviceMotionNotify] = SEventIDispatch;
        EventSwapVector[DeviceFocusIn] = SEventIDispatch;
        EventSwapVector[DeviceFocusOut] = SEventIDispatch;
        EventSwapVector[ProximityIn] = SEventIDispatch;
        EventSwapVector[ProximityOut] = SEventIDispatch;
        EventSwapVector[DeviceStateNotify] = SEventIDispatch;
        EventSwapVector[DeviceKeyStateNotify] = SEventIDispatch;
        EventSwapVector[DeviceButtonStateNotify] = SEventIDispatch;
        EventSwapVector[DeviceMappingNotify] = SEventIDispatch;
        EventSwapVector[ChangeDeviceNotify] = SEventIDispatch;
    } else {
        FatalError("IExtensionInit: AddExtensions failed\n");
    }
}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:33,代码来源:extinit.c

示例13: XFree86DRIExtensionInit

void
XFree86DRIExtensionInit(void)
{
    ExtensionEntry* extEntry;

#ifdef XF86DRI_EVENTS
    EventType = CreateNewResourceType(XF86DRIFreeEvents);
#endif

    if (
	DRIExtensionInit() &&
#ifdef XF86DRI_EVENTS
        EventType && ScreenPrivateIndex != -1 &&
#endif
	(extEntry = AddExtension(XF86DRINAME,
				 XF86DRINumberEvents,
				 XF86DRINumberErrors,
				 ProcXF86DRIDispatch,
				 SProcXF86DRIDispatch,
				 XF86DRIResetProc,
				 StandardMinorOpcode))) {
	DRIReqCode = (unsigned char)extEntry->base;
	DRIErrorBase = extEntry->errorBase;
    }
}
开发者ID:mcr,项目名称:xorg-xvnc4,代码行数:25,代码来源:xf86dri.c

示例14: XFixesRegionInit

Bool
XFixesRegionInit(void)
{
    RegionResType = CreateNewResourceType(RegionResFree, "XFixesRegion");

    return RegionResType != 0;
}
开发者ID:mirror,项目名称:xserver,代码行数:7,代码来源:region.c

示例15: DRIExtensionInit

Bool
DRIExtensionInit(void)
{
    DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);

    return TRUE;
}
开发者ID:L3oV1nc3,项目名称:VMGL,代码行数:7,代码来源:dri.c


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