Esempio n. 1
0
Bool
compInitDisplayOptionsFromMetadata (CompDisplay			 *d,
				    CompMetadata		 *m,
				    const CompMetadataOptionInfo *info,
				    CompOption			 *opt,
				    int				 n)
{
    int i;

    for (i = 0; i < n; i++)
    {
	if (!compInitDisplayOptionFromMetadata (d, m, &opt[i], info[i].name))
	{
	    compFiniDisplayOptions (d, opt, i);
	    return FALSE;
	}

	if (info[i].initiate)
	    opt[i].value.action.initiate = info[i].initiate;

	if (info[i].terminate)
	    opt[i].value.action.terminate = info[i].terminate;
    }

    return TRUE;
}
Esempio n. 2
0
static Bool cloneInitDisplay(CompPlugin * p, CompDisplay * d)
{
	CloneDisplay *cd;

	if (!checkPluginABI("core", CORE_ABIVERSION))
		return FALSE;

	cd = malloc(sizeof(CloneDisplay));
	if (!cd)
		return FALSE;

	if (!compInitDisplayOptionsFromMetadata(d,
						&cloneMetadata,
						cloneDisplayOptionInfo,
						cd->opt,
						CLONE_DISPLAY_OPTION_NUM)) {
		free(cd);
		return FALSE;
	}

	cd->screenPrivateIndex = allocateScreenPrivateIndex(d);
	if (cd->screenPrivateIndex < 0) {
		compFiniDisplayOptions(d, cd->opt, CLONE_DISPLAY_OPTION_NUM);
		free(cd);
		return FALSE;
	}

	WRAP(cd, d, handleEvent, cloneHandleEvent);

	d->base.privates[displayPrivateIndex].ptr = cd;

	return TRUE;
}
Esempio n. 3
0
static void
textFiniDisplay (CompPlugin  *p,
		 CompDisplay *d)
{
    TEXT_DISPLAY (d);

    compFiniDisplayOptions (d, td->opt, TEXT_DISPLAY_OPTION_NUM);

    free (td);
}
Esempio n. 4
0
static void
commandsFiniDisplay(CompPlugin *p,
                    CompDisplay *d)
{
   COMMANDS_DISPLAY(d);

   compFiniDisplayOptions(d, cd->opt, COMMANDS_DISPLAY_OPTION_NUM);

   free(cd);
}
static void
notifyFiniDisplay (CompPlugin  *p,
                   CompDisplay *d)
{
    NOTIFY_DISPLAY (d);

    compFiniDisplayOptions (d, nd->opt, NOTIFY_DISPLAY_OPTION_NUM);

    free (nd);
}
Esempio n. 6
0
File: fuse.c Progetto: zmike/compiz
static Bool
fuseInitDisplay(CompPlugin *p,
                CompDisplay *d)
{
   FuseDisplay *fd;
   struct sigaction sa;

   if (!checkPluginABI("core", CORE_ABIVERSION))
     return FALSE;

   memset(&sa, 0, sizeof (struct sigaction));

   sa.sa_handler = SIG_IGN;
   sigemptyset(&sa.sa_mask);
   sa.sa_flags = 0;

   if (sigaction(SIGPIPE, &sa, NULL) == -1)
     return FALSE;

   fd = malloc(sizeof (FuseDisplay));
   if (!fd)
     return FALSE;

   if (!compInitDisplayOptionsFromMetadata(d,
                                           &fuseMetadata,
                                           fuseDisplayOptionInfo,
                                           fd->opt,
                                           FUSE_DISPLAY_OPTION_NUM))
     {
        free(fd);
        return FALSE;
     }

   fd->session = fuse_lowlevel_new(NULL,
                                   &compiz_ll_oper, sizeof (compiz_ll_oper),
                                   (void *)d);
   if (!fd->session)
     {
        compFiniDisplayOptions(d, fd->opt, FUSE_DISPLAY_OPTION_NUM);
        free(fd);
        return FALSE;
     }

   fd->watchFdHandle = 0;
   fd->channel = NULL;
   fd->buffer = NULL;
   fd->mountPoint = NULL;

   d->base.privates[displayPrivateIndex].ptr = fd;

   fuseMount(d);

   return TRUE;
}
Esempio n. 7
0
static void waterFiniDisplay(CompPlugin * p, CompDisplay * d)
{
	WATER_DISPLAY(d);

	freeScreenPrivateIndex(d, wd->screenPrivateIndex);

	UNWRAP(wd, d, handleEvent);

	compFiniDisplayOptions(d, wd->opt, WATER_DISPLAY_OPTION_NUM);

	free(wd);
}
Esempio n. 8
0
static void cloneFiniDisplay(CompPlugin * p, CompDisplay * d)
{
	CLONE_DISPLAY(d);

	freeScreenPrivateIndex(d, cd->screenPrivateIndex);

	UNWRAP(cd, d, handleEvent);

	compFiniDisplayOptions(d, cd->opt, CLONE_DISPLAY_OPTION_NUM);

	free(cd);
}
Esempio n. 9
0
static Bool
decorInitDisplay (CompPlugin  *p,
		  CompDisplay *d)
{
    DecorDisplay *dd;

    dd = malloc (sizeof (DecorDisplay));
    if (!dd)
	return FALSE;

    if (!compInitDisplayOptionsFromMetadata (d,
					     &decorMetadata,
					     decorDisplayOptionInfo,
					     dd->opt,
					     DECOR_DISPLAY_OPTION_NUM))
    {
	free (dd);
	return FALSE;
    }

    dd->screenPrivateIndex = allocateScreenPrivateIndex (d);
    if (dd->screenPrivateIndex < 0)
    {
	compFiniDisplayOptions (d, dd->opt, DECOR_DISPLAY_OPTION_NUM);
	free (dd);
	return FALSE;
    }

    dd->textures = 0;

    dd->supportingDmCheckAtom =
	XInternAtom (d->display, DECOR_SUPPORTING_DM_CHECK_ATOM_NAME, 0);
    dd->winDecorAtom =
	XInternAtom (d->display, DECOR_WINDOW_ATOM_NAME, 0);
    dd->decorAtom[DECOR_BARE] =
	XInternAtom (d->display, DECOR_BARE_ATOM_NAME, 0);
    dd->decorAtom[DECOR_NORMAL] =
	XInternAtom (d->display, DECOR_NORMAL_ATOM_NAME, 0);
    dd->decorAtom[DECOR_ACTIVE] =
	XInternAtom (d->display, DECOR_ACTIVE_ATOM_NAME, 0);
    dd->requestFrameExtentsAtom =
	XInternAtom (d->display, "_NET_REQUEST_FRAME_EXTENTS", 0);

    WRAP (dd, d, handleEvent, decorHandleEvent);
    WRAP (dd, d, matchPropertyChanged, decorMatchPropertyChanged);

    d->base.privates[displayPrivateIndex].ptr = dd;

    return TRUE;
}
Esempio n. 10
0
File: fuse.c Progetto: zmike/compiz
static void
fuseFiniDisplay(CompPlugin *p,
                CompDisplay *d)
{
   FUSE_DISPLAY(d);

   fuseUnmount(d);

   fuse_session_destroy(fd->session);

   compFiniDisplayOptions(d, fd->opt, FUSE_DISPLAY_OPTION_NUM);

   free(fd);
}
Esempio n. 11
0
File: video.c Progetto: zmike/compiz
static void
videoFiniDisplay(CompPlugin *p,
                 CompDisplay *d)
{
   VIDEO_DISPLAY(d);

   freeScreenPrivateIndex(d, vd->screenPrivateIndex);

   UNWRAP(vd, d, handleEvent);

   compFiniDisplayOptions(d, vd->opt, VIDEO_DISPLAY_OPTION_NUM);

   free(vd);
}
Esempio n. 12
0
File: zoom.c Progetto: zmike/compiz
static void
zoomFiniDisplay(CompPlugin *p,
                CompDisplay *d)
{
   ZOOM_DISPLAY(d);

   freeScreenPrivateIndex(d, zd->screenPrivateIndex);

   UNWRAP(zd, d, handleEvent);

   compFiniDisplayOptions(d, zd->opt, ZOOM_DISPLAY_OPTION_NUM);

   free(zd);
}
Esempio n. 13
0
File: video.c Progetto: zmike/compiz
static Bool
videoInitDisplay(CompPlugin *p,
                 CompDisplay *d)
{
   VideoDisplay *vd;

   if (!checkPluginABI("core", CORE_ABIVERSION))
     return FALSE;

   vd = malloc(sizeof (VideoDisplay));
   if (!vd)
     return FALSE;

   if (!compInitDisplayOptionsFromMetadata(d,
                                           &videoMetadata,
                                           videoDisplayOptionInfo,
                                           vd->opt,
                                           VIDEO_DISPLAY_OPTION_NUM))
     {
        free(vd);
        return FALSE;
     }

   vd->screenPrivateIndex = allocateScreenPrivateIndex(d);
   if (vd->screenPrivateIndex < 0)
     {
        compFiniDisplayOptions(d, vd->opt, VIDEO_DISPLAY_OPTION_NUM);
        free(vd);
        return FALSE;
     }

   vd->textures = 0;

   vd->videoAtom =
     XInternAtom(d->display, "_COMPIZ_VIDEO", 0);
   vd->videoSupportedAtom =
     XInternAtom(d->display, "_COMPIZ_VIDEO_SUPPORTED", 0);

   vd->videoImageFormatAtom[IMAGE_FORMAT_RGB] =
     XInternAtom(d->display, "_COMPIZ_VIDEO_IMAGE_FORMAT_RGB", 0);
   vd->videoImageFormatAtom[IMAGE_FORMAT_YV12] =
     XInternAtom(d->display, "_COMPIZ_VIDEO_IMAGE_FORMAT_YV12", 0);

   WRAP(vd, d, handleEvent, videoHandleEvent);

   d->base.privates[displayPrivateIndex].ptr = vd;

   return TRUE;
}
Esempio n. 14
0
static void
decorFiniDisplay (CompPlugin  *p,
		  CompDisplay *d)
{
    DECOR_DISPLAY (d);

    freeScreenPrivateIndex (d, dd->screenPrivateIndex);

    UNWRAP (dd, d, handleEvent);
    UNWRAP (dd, d, matchPropertyChanged);

    compFiniDisplayOptions (d, dd->opt, DECOR_DISPLAY_OPTION_NUM);

    free (dd);
}
static void
sessionFiniDisplay (CompPlugin  *p,
		    CompDisplay *d)
{
    SESSION_DISPLAY (d);

    UNWRAP (sd, d, handleEvent);

    if (sd->windowAddTimeout)
	compRemoveTimeout (sd->windowAddTimeout);

    compFiniDisplayOptions (d, sd->opt, SESSION_DISPLAY_OPTION_NUM);

    free (sd);
}
static int
sessionInitDisplay (CompPlugin  *p,
		    CompDisplay *d)
{
    SessionDisplay *sd;
    char           *prevClientId;

    sd = malloc (sizeof (SessionDisplay));
    if (!sd)
	return FALSE;

    if (!compInitDisplayOptionsFromMetadata (d,
					     &sessionMetadata,
					     sessionDisplayOptionInfo,
					     sd->opt,
					     SESSION_DISPLAY_OPTION_NUM))
    {
	compFiniDisplayOptions (d, sd->opt, SESSION_DISPLAY_OPTION_NUM);
	free (sd);
	return FALSE;
    }

    d->base.privates[displayPrivateIndex].ptr = sd;

    sd->visibleNameAtom = XInternAtom (d->display, "_NET_WM_VISIBLE_NAME", 0);
    sd->clientIdAtom = XInternAtom (d->display, "SM_CLIENT_ID", 0);
    sd->embedInfoAtom = XInternAtom (d->display, "_XEMBED_INFO", 0);
    sd->roleAtom = XInternAtom (d->display, "WM_WINDOW_ROLE", 0);
    sd->commandAtom = XInternAtom (d->display, "WM_COMMAND", 0);

    prevClientId = getSessionClientId (CompSessionPrevClientId);
    if (prevClientId)
    {
	loadState (d, prevClientId);
	free (prevClientId);
    }

    sd->windowAddTimeout = compAddTimeout (0, 0, sessionWindowAddTimeout, d);

    WRAP (sd, d, handleEvent, sessionHandleEvent);

    d->base.privates[displayPrivateIndex].ptr = sd;

    return TRUE;
}
Esempio n. 17
0
File: svg.c Progetto: zmike/compiz
static Bool
svgInitDisplay(CompPlugin *p,
               CompDisplay *d)
{
    SvgDisplay *sd;
    CompScreen *s;

    if (!checkPluginABI("core", CORE_ABIVERSION))
        return FALSE;

    sd = malloc(sizeof (SvgDisplay));
    if (!sd)
        return FALSE;

    if (!compInitDisplayOptionsFromMetadata(d,
                                            &svgMetadata,
                                            svgDisplayOptionInfo,
                                            sd->opt,
                                            SVG_DISPLAY_OPTION_NUM))
    {
        free(sd);
        return FALSE;
    }

    sd->screenPrivateIndex = allocateScreenPrivateIndex(d);
    if (sd->screenPrivateIndex < 0)
    {
        compFiniDisplayOptions(d, sd->opt, SVG_DISPLAY_OPTION_NUM);
        free(sd);
        return FALSE;
    }

    WRAP(sd, d, handleCompizEvent, svgHandleCompizEvent);
    WRAP(sd, d, fileToImage, svgFileToImage);

    d->base.privates[displayPrivateIndex].ptr = sd;

    for (s = d->screens; s; s = s->next)
        updateDefaultIcon(s);

    return TRUE;
}
Esempio n. 18
0
File: svg.c Progetto: zmike/compiz
static void
svgFiniDisplay(CompPlugin *p,
               CompDisplay *d)
{
    CompScreen *s;

    SVG_DISPLAY(d);

    UNWRAP(sd, d, handleCompizEvent);
    UNWRAP(sd, d, fileToImage);

    for (s = d->screens; s; s = s->next)
        updateDefaultIcon(s);

    freeScreenPrivateIndex(d, sd->screenPrivateIndex);

    compFiniDisplayOptions(d, sd->opt, SVG_DISPLAY_OPTION_NUM);

    free(sd);
}
Esempio n. 19
0
static Bool
waterInitDisplay (CompPlugin  *p,
		  CompDisplay *d)
{
    WaterDisplay *wd;

    if (!checkPluginABI ("core", CORE_ABIVERSION))
	return FALSE;

    wd = malloc (sizeof (WaterDisplay));
    if (!wd)
	return FALSE;

    if (!compInitDisplayOptionsFromMetadata (d,
					     &waterMetadata,
					     waterDisplayOptionInfo,
					     wd->opt,
					     WATER_DISPLAY_OPTION_NUM))
    {
	free (wd);
	return FALSE;
    }

    wd->screenPrivateIndex = allocateScreenPrivateIndex (d);
    if (wd->screenPrivateIndex < 0)
    {
	compFiniDisplayOptions (d, wd->opt, WATER_DISPLAY_OPTION_NUM);
	free (wd);
	return FALSE;
    }

    wd->offsetScale = wd->opt[WATER_DISPLAY_OPTION_OFFSET_SCALE].value.f * 50.0f;

    WRAP (wd, d, handleEvent, waterHandleEvent);

    d->base.privates[displayPrivateIndex].ptr = wd;

    return TRUE;
}
Esempio n. 20
0
File: zoom.c Progetto: zmike/compiz
static Bool
zoomInitDisplay(CompPlugin *p,
                CompDisplay *d)
{
   ZoomDisplay *zd;

   if (!checkPluginABI("core", CORE_ABIVERSION))
     return FALSE;

   zd = malloc(sizeof (ZoomDisplay));
   if (!zd)
     return FALSE;

   if (!compInitDisplayOptionsFromMetadata(d,
                                           &zoomMetadata,
                                           zoomDisplayOptionInfo,
                                           zd->opt,
                                           ZOOM_DISPLAY_OPTION_NUM))
     {
        free(zd);
        return FALSE;
     }

   zd->screenPrivateIndex = allocateScreenPrivateIndex(d);
   if (zd->screenPrivateIndex < 0)
     {
        compFiniDisplayOptions(d, zd->opt, ZOOM_DISPLAY_OPTION_NUM);
        free(zd);
        return FALSE;
     }

   WRAP(zd, d, handleEvent, zoomHandleEvent);

   d->base.privates[displayPrivateIndex].ptr = zd;

   return TRUE;
}