Exemplo n.º 1
0
CompBool initCore(void)
{
    CompPlugin *corePlugin;

    compObjectInit(&core.base, 0, COMP_OBJECT_TYPE_CORE);

    core.displays = NULL;

    core.tmpRegion = XCreateRegion();
    if(!core.tmpRegion)
    {
		return FALSE;
    }

    core.outputRegion = XCreateRegion();
    if(!core.outputRegion)
    {
		XDestroyRegion(core.tmpRegion);
		return FALSE;
    }

    core.fileWatch	     = NULL;
    core.lastFileWatchHandle = 1;

    core.timeouts	   = NULL;
    core.lastTimeoutHandle = 1;

    core.watchFds	   = NULL;
    core.lastWatchFdHandle = 1;
    core.watchPollFds	   = NULL;
    core.nWatchFds	   = 0;

    gettimeofday(&core.lastTimeout, 0);

    setCoreProcs();

    corePlugin = loadPlugin("core");
    if(!corePlugin)
    {
		compLogMessage("core", CompLogLevelFatal, "Couldn't load core plugin");
		return FALSE;
    }

    if(!pushPlugin(corePlugin))
    {
		compLogMessage("core", CompLogLevelFatal, "Couldn't activate core plugin");
		return FALSE;
    }

    return TRUE;
}
Exemplo n.º 2
0
CompBool
initCore (void)
{
    CompPlugin *corePlugin;

    compObjectInit (&core.base, 0, COMP_OBJECT_TYPE_CORE);

    core.displays = NULL;

    core.tmpRegion = XCreateRegion ();
    if (!core.tmpRegion)
	return FALSE;

    core.outputRegion = XCreateRegion ();
    if (!core.outputRegion)
    {
	XDestroyRegion (core.tmpRegion);
	return FALSE;
    }

    core.fileWatch	     = NULL;
    core.lastFileWatchHandle = 1;

    core.timeouts	   = NULL;
    core.lastTimeoutHandle = 1;

    core.watchFds	   = NULL;
    core.lastWatchFdHandle = 1;
    core.watchPollFds	   = NULL;
    core.nWatchFds	   = 0;

    gettimeofday (&core.lastTimeout, 0);

    core.initPluginForObject = initCorePluginForObject;
    core.finiPluginForObject = finiCorePluginForObject;

    core.setOptionForPlugin = setOptionForPlugin;

    core.objectAdd    = coreObjectAdd;
    core.objectRemove = coreObjectRemove;

    core.fileWatchAdded   = fileWatchAdded;
    core.fileWatchRemoved = fileWatchRemoved;

    core.sessionEvent = sessionEvent;
    core.logMessage   = logMessage;

    corePlugin = loadPlugin ("core");
    if (!corePlugin)
    {
	compLogMessage ("core", CompLogLevelFatal,
			"Couldn't load core plugin");
	return FALSE;
    }

    if (!pushPlugin (corePlugin))
    {
	compLogMessage ("core", CompLogLevelFatal,
			"Couldn't activate core plugin");
	return FALSE;
    }

    return TRUE;
}