Esempio n. 1
0
/* static */
int ProcXagCreate (
    register ClientPtr client)
{
    REQUEST (xXagCreateReq);
    AppGroupPtr pAppGrp;
    int ret;

    REQUEST_AT_LEAST_SIZE (xXagCreateReq);

    LEGAL_NEW_RESOURCE (stuff->app_group, client);
    pAppGrp = CreateAppGroup (client, stuff->app_group, 
		stuff->attrib_mask, (CARD32*) &stuff[1]);
    if (!pAppGrp)
	return BadAlloc;
    ret = AttrValidate (client, stuff->attrib_mask, pAppGrp);
    if (ret != Success) {
	XagAppGroupFree ((pointer)pAppGrp, (XID)0);
	return ret;
    }
    if (pAppGrp->single_screen) {
	CreateConnectionInfo (pAppGrp);
	if (!pAppGrp->ConnectionInfo)
	    return BadAlloc;
    }
    if (!AddResource (stuff->app_group, RT_APPGROUP, (pointer)pAppGrp))
	return BadAlloc;
    if (XagCallbackRefCount++ == 0)
	(void) AddCallback (&ClientStateCallback, XagClientStateChange, NULL);
    return client->noClientException;
}
Esempio n. 2
0
/*ARGSUSED*/
static 
void XagResetProc(
    ExtensionEntry* extEntry)
{
    DeleteCallback (&ClientStateCallback, XagClientStateChange, NULL);
    XagCallbackRefCount = 0;
    while (appGrpList) XagAppGroupFree ((pointer) appGrpList, 0);
}
Esempio n. 3
0
void
XagExtensionInit(INITARGS)
{
#if 0
    ExtensionEntry* extEntry;

    if ((extEntry = AddExtension (XAGNAME,
				0,
				XagNumberErrors,
				ProcXagDispatch,
				SProcXagDispatch,
				XagResetProc,
				StandardMinorOpcode))) {
	XagReqCode = (unsigned char)extEntry->base;
	XagErrorBase = extEntry->errorBase;
#else
    if (AddExtension (XAGNAME,
		      0,
		      XagNumberErrors,
		      ProcXagDispatch,
		      SProcXagDispatch,
		      XagResetProc,
		      StandardMinorOpcode)) {
#endif
	RT_APPGROUP = CreateNewResourceType (XagAppGroupFree);
    }
}

/*ARGSUSED*/
static 
void XagResetProc(
    ExtensionEntry* extEntry)
{
    DeleteCallback (&ClientStateCallback, XagClientStateChange, NULL);
    XagCallbackRefCount = 0;
    while (appGrpList) XagAppGroupFree ((pointer) appGrpList, 0);
}