本文整理汇总了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);
}
}
示例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);
}
示例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;
}
示例4: XFixesSelectionInit
Bool
XFixesSelectionInit (void)
{
SelectionClientType = CreateNewResourceType(SelectionFreeClient);
SelectionWindowType = CreateNewResourceType(SelectionFreeWindow);
return SelectionClientType && SelectionWindowType;
}
示例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();
}
示例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;
}
}
示例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);
}
示例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
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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");
}
}
示例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;
}
}
示例14: XFixesRegionInit
Bool
XFixesRegionInit(void)
{
RegionResType = CreateNewResourceType(RegionResFree, "XFixesRegion");
return RegionResType != 0;
}
示例15: DRIExtensionInit
Bool
DRIExtensionInit(void)
{
DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);
return TRUE;
}