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; }
static Bool magInitDisplay (CompPlugin *p, CompDisplay *d) { /* Generate a mag display */ MagDisplay *md; int index; if (!checkPluginABI ("core", CORE_ABIVERSION) || !checkPluginABI ("mousepoll", MOUSEPOLL_ABIVERSION)) return FALSE; if (!getPluginDisplayIndex (d, "mousepoll", &index)) return FALSE; md = malloc (sizeof (MagDisplay)); if (!md) return FALSE; /* Allocate a private index */ md->screenPrivateIndex = allocateScreenPrivateIndex (d); /* Check if its valid */ if (md->screenPrivateIndex < 0) { /* It's invalid so free memory and return */ free (md); return FALSE; } md->mpFunc = d->base.privates[index].ptr; magSetInitiateInitiate (d, magInitiate); magSetInitiateTerminate (d, magTerminate); magSetZoomInButtonInitiate (d, magZoomIn); magSetZoomOutButtonInitiate (d, magZoomOut); /* Record the display */ d->base.privates[displayPrivateIndex].ptr = md; return TRUE; }
static Bool wizardInitDisplay (CompPlugin *p, CompDisplay *d) { //Generate a wizard display WizardDisplay *wd; int index; if (!checkPluginABI ("core", CORE_ABIVERSION) || !checkPluginABI ("mousepoll", MOUSEPOLL_ABIVERSION)) return FALSE; if (!getPluginDisplayIndex (d, "mousepoll", &index)) return FALSE; wd = (WizardDisplay *) malloc (sizeof (WizardDisplay)); if (!wd) return FALSE; //Allocate a private index wd->screenPrivateIndex = allocateScreenPrivateIndex (d); //Check if its valid if (wd->screenPrivateIndex < 0) { //Its invalid so free memory and return free (wd); return FALSE; } wd->mpFunc = d->base.privates[index].ptr; wizardSetInitiateInitiate (d, wizardInitiate); wizardSetInitiateTerminate (d, wizardTerminate); wizardSetDefaultEnabledNotify (d, wizardDisplayOptionChanged); //Record the display d->base.privates[displayPrivateIndex].ptr = wd; return TRUE; }
static Bool fadeInitDisplay(CompPlugin *p, CompDisplay *d) { FadeDisplay *fd; if (!checkPluginABI("core", CORE_ABIVERSION)) return FALSE; fd = malloc(sizeof (FadeDisplay)); if (!fd) return FALSE; fd->screenPrivateIndex = allocateScreenPrivateIndex(d); if (fd->screenPrivateIndex < 0) { free(fd); return FALSE; } fd->displayModals = 0; fd->suppressMinimizeOpenClose = (findActivePlugin("animation") != NULL); /* Always fade opening and closing of screen-dimming layer of logout window and gksu. */ matchInit(&fd->alwaysFadeWindowMatch); matchAddExp(&fd->alwaysFadeWindowMatch, 0, "title=gksu"); matchAddExp(&fd->alwaysFadeWindowMatch, 0, "title=x-session-manager"); matchAddExp(&fd->alwaysFadeWindowMatch, 0, "title=mate-session"); matchUpdate(d, &fd->alwaysFadeWindowMatch); WRAP(fd, d, handleEvent, fadeHandleEvent); WRAP(fd, d, matchExpHandlerChanged, fadeMatchExpHandlerChanged); d->base.privates[displayPrivateIndex].ptr = fd; return TRUE; }
static Bool opacifyInitDisplay (CompPlugin *p, CompDisplay *d) { OpacifyDisplay *od; od = malloc (sizeof (OpacifyDisplay)); if (!od) return FALSE; od->screenPrivateIndex = allocateScreenPrivateIndex (); if (od->screenPrivateIndex < 0) { free (od); return FALSE; } d->privates[displayPrivateIndex].ptr = od; od->timeoutHandle = 0; od->activeScreen = d->screens->screenNum; const BananaValue * option_init_toggle = bananaGetOption (bananaIndex, "init_toggle", -1); od->toggle = option_init_toggle->b; const BananaValue * option_toggle_key = bananaGetOption (bananaIndex, "toggle_key", -1); registerKey (option_toggle_key->s, &od->toggle_key); WRAP (od, d, handleEvent, opacifyHandleEvent); return TRUE; }
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; }
static Bool fadeInitDisplay (CompPlugin *p, CompDisplay *d) { FadeDisplay *fd; fd = malloc (sizeof (FadeDisplay)); if (!fd) return FALSE; fd->screenPrivateIndex = allocateScreenPrivateIndex (d); if (fd->screenPrivateIndex < 0) { free (fd); return FALSE; } WRAP (fd, d, handleEvent, fadeHandleEvent); d->privates[displayPrivateIndex].ptr = fd; return TRUE; }
static Bool wsnamesInitDisplay (CompPlugin *p, CompDisplay *d) { WSNamesDisplay *wd; wd = malloc (sizeof (WSNamesDisplay)); if (!wd) return FALSE; wd->screenPrivateIndex = allocateScreenPrivateIndex (); if (wd->screenPrivateIndex < 0) { free (wd); return FALSE; } WRAP (wd, d, handleEvent, wsnamesHandleEvent); d->privates[displayPrivateIndex].ptr = wd; return TRUE; }
static Bool staticInitDisplay (CompPlugin *p, CompDisplay *d) { StaticDisplay *sd; sd = malloc (sizeof (StaticDisplay) ); if (!sd) return FALSE; sd->screenPrivateIndex = allocateScreenPrivateIndex (d); if (sd->screenPrivateIndex < 0) { free (sd); return FALSE; } d->base.privates[displayPrivateIndex].ptr = sd; return TRUE; }
static Bool shotInitDisplay (CompPlugin *p, CompDisplay *d) { ShotDisplay *sd; sd = malloc (sizeof (ShotDisplay)); if (!sd) return FALSE; sd->screenPrivateIndex = allocateScreenPrivateIndex (); if (sd->screenPrivateIndex < 0) { free (sd); return FALSE; } WRAP (sd, d, handleEvent, shotHandleEvent); d->privates[displayPrivateIndex].ptr = sd; return TRUE; }
static Bool gridInitDisplay (CompPlugin *p, CompDisplay *d) { GridDisplay *gd; if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; gridSetPutCenterKeyInitiate (d, gridCenter); gridSetPutLeftKeyInitiate (d, gridLeft); gridSetPutRightKeyInitiate (d, gridRight); gridSetPutTopKeyInitiate (d, gridTop); gridSetPutBottomKeyInitiate (d, gridBottom); gridSetPutTopleftKeyInitiate (d, gridTopLeft); gridSetPutToprightKeyInitiate (d, gridTopRight); gridSetPutBottomleftKeyInitiate (d, gridBottomLeft); gridSetPutBottomrightKeyInitiate (d, gridBottomRight); gridSetPutMaximizeKeyInitiate (d, gridMaximize); gd = malloc (sizeof (GridDisplay)); if (!gd) return FALSE; gd->screenPrivateIndex = allocateScreenPrivateIndex (d); if (gd->screenPrivateIndex < 0) { free (gd); return FALSE; } WRAP (gd, d, handleEvent, gridHandleEvent); d->base.privates[displayPrivateIndex].ptr = gd; return TRUE; }
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; }
static Bool throwInitDisplay (CompPlugin *p, CompDisplay *d) { ThrowDisplay *td; if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; td = malloc (sizeof (ThrowDisplay)); if (!td) return FALSE; td->screenPrivateIndex = allocateScreenPrivateIndex (d); if (td->screenPrivateIndex < 0) { free (td); return FALSE; } d->base.privates[displayPrivateIndex].ptr = td; return TRUE; }
static Bool thumbInitDisplay (CompPlugin *p, CompDisplay *d) { ThumbDisplay *td; td = malloc (sizeof (ThumbDisplay)); if (!td) return FALSE; td->screenPrivateIndex = allocateScreenPrivateIndex (); if (td->screenPrivateIndex < 0) { free (td); return FALSE; } WRAP (td, d, handleEvent, thumbHandleEvent); d->privates[displayPrivateIndex].ptr = td; return TRUE; }
static Bool NEGInitDisplay (CompPlugin *p, CompDisplay *d) { NEGDisplay *nd; nd = malloc (sizeof (NEGDisplay)); if (!nd) return FALSE; nd->screenPrivateIndex = allocateScreenPrivateIndex(d); if (nd->screenPrivateIndex < 0) { free (nd); return FALSE; } negSetWindowToggleKeyInitiate (d, negToggle); negSetScreenToggleKeyInitiate (d, negToggleAll); d->base.privates[displayPrivateIndex].ptr = nd; return TRUE; }
/* Configuration, initialization, boring stuff. --------------------- */ static Bool smartputInitDisplay (CompPlugin *p, CompDisplay *d) { SmartputDisplay *spd; if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; spd = malloc (sizeof (SmartputDisplay)); if (!spd) return FALSE; spd->screenPrivateIndex = allocateScreenPrivateIndex (d); if (spd->screenPrivateIndex < 0) { free (spd); return FALSE; } /* custom atom for client events */ spd->compizSmartputWindowAtom = XInternAtom(d->display, "_COMPIZ_SMARTPUT_WINDOW", 0); spd->lastWindow = None; smartputSetTriggerButtonInitiate(d, smartputTrigger); smartputSetTriggerAllButtonInitiate (d, smartputAllTrigger); smartputSetTriggerKeyInitiate (d, smartputTrigger); smartputSetUndoKeyInitiate (d, smartputUndo); WRAP (spd, d, handleEvent, smartputHandleEvent); d->base.privates[SmartputDisplayPrivateIndex].ptr = spd; return TRUE; }
static Bool colorFilterInitDisplay (CompPlugin * p, CompDisplay * d) { ColorFilterDisplay *cfd; cfd = malloc (sizeof (ColorFilterDisplay)); if (!cfd) return FALSE; cfd->screenPrivateIndex = allocateScreenPrivateIndex (d); if (cfd->screenPrivateIndex < 0) { free (cfd); return FALSE; } colorfilterSetToggleWindowKeyInitiate (d, colorFilterToggle); colorfilterSetToggleScreenKeyInitiate (d, colorFilterToggleAll); colorfilterSetSwitchFilterKeyInitiate (d, colorFilterSwitch); d->base.privates[displayPrivateIndex].ptr = cfd; return TRUE; }
static Bool winrulesInitDisplay (CompPlugin *p, CompDisplay *d) { WinrulesDisplay *wd; wd = malloc (sizeof (WinrulesDisplay)); if (!wd) return FALSE; wd->screenPrivateIndex = allocateScreenPrivateIndex (); if (wd->screenPrivateIndex < 0) { free (wd); return FALSE; } WRAP (wd, d, handleEvent, winrulesHandleEvent); WRAP (wd, d, matchPropertyChanged, winrulesMatchPropertyChanged); d->privates[displayPrivateIndex].ptr = wd; return TRUE; }
static Bool elementsInitDisplay (CompPlugin *p, CompDisplay *d) { CompOption *texAutOpt, *texFfOpt, *texSnowOpt, *texStarsOpt; CompOption *texBubblesOpt; eDisplay *ed; if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; ed = malloc (sizeof (eDisplay)); ed->privateIndex = allocateScreenPrivateIndex (d); if (ed->privateIndex < 0) { free (ed); return FALSE; } elementsSetToggleAutumnKeyInitiate (d, elementsAutumnToggle); elementsSetToggleFirefliesKeyInitiate (d, elementsFirefliesToggle); elementsSetToggleSnowKeyInitiate (d, elementsSnowToggle); elementsSetToggleStarsKeyInitiate (d, elementsStarsToggle); elementsSetToggleBubblesKeyInitiate (d, elementsBubblesToggle); elementsSetToggleNotify (d, elementsDisplayOptionChanged); elementsSetToggleSnowCheckNotify (d, elementsDisplayOptionChanged); elementsSetToggleAutumnCheckNotify (d, elementsDisplayOptionChanged); elementsSetToggleStarsCheckNotify (d, elementsDisplayOptionChanged); elementsSetToggleFirefliesCheckNotify (d, elementsDisplayOptionChanged); elementsSetToggleBubblesCheckNotify (d, elementsDisplayOptionChanged); elementsSetNumSnowflakesNotify (d, elementsDisplayOptionChanged); elementsSetNumBubblesNotify (d, elementsDisplayOptionChanged); elementsSetAutumnSwayNotify (d, elementsDisplayOptionChanged); elementsSetNumLeavesNotify (d, elementsDisplayOptionChanged); elementsSetNumFirefliesNotify (d, elementsDisplayOptionChanged); elementsSetNumStarsNotify (d, elementsDisplayOptionChanged); elementsSetLeafSizeNotify (d, elementsDisplayOptionChanged); elementsSetBubblesSizeNotify (d, elementsDisplayOptionChanged); elementsSetFireflySizeNotify (d, elementsDisplayOptionChanged); elementsSetSnowSizeNotify (d, elementsDisplayOptionChanged); elementsSetSnowSwayNotify (d, elementsDisplayOptionChanged); elementsSetStarsSizeNotify (d, elementsDisplayOptionChanged); elementsSetLeafTexturesNotify (d, elementsDisplayOptionChanged); elementsSetFirefliesTexturesNotify (d, elementsDisplayOptionChanged); elementsSetSnowTexturesNotify (d, elementsDisplayOptionChanged); elementsSetStarsTexturesNotify (d, elementsDisplayOptionChanged); elementsSetBubblesTexturesNotify (d, elementsDisplayOptionChanged); texAutOpt = elementsGetLeafTexturesOption (d); texFfOpt = elementsGetFirefliesTexturesOption (d); texSnowOpt = elementsGetSnowTexturesOption (d); texStarsOpt = elementsGetStarsTexturesOption (d); texBubblesOpt = elementsGetBubblesTexturesOption (d); ed->texFiles[0] = texAutOpt->value.list.value; ed->texFiles[1] = texFfOpt->value.list.value; ed->texFiles[2] = texSnowOpt->value.list.value; ed->texFiles[3] = texStarsOpt->value.list.value; ed->texFiles[4] = texBubblesOpt->value.list.value; ed->numTex[0] = texAutOpt->value.list.nValue; ed->numTex[1] = texFfOpt->value.list.nValue; ed->numTex[2] = texSnowOpt->value.list.nValue; ed->numTex[3] = texStarsOpt->value.list.nValue; ed->numTex[4] = texBubblesOpt->value.list.nValue; d->base.privates[displayPrivateIndex].ptr = ed; return TRUE; }
static Bool ringInitDisplay (CompPlugin *p, CompDisplay *d) { RingDisplay *rd; int index; if (!checkPluginABI ("core", CORE_ABIVERSION)) return FALSE; rd = malloc (sizeof (RingDisplay)); if (!rd) return FALSE; rd->screenPrivateIndex = allocateScreenPrivateIndex (d); if (rd->screenPrivateIndex < 0) { free (rd); return FALSE; } if (checkPluginABI ("text", TEXT_ABIVERSION) && getPluginDisplayIndex (d, "text", &index)) { rd->textFunc = d->base.privates[index].ptr; } else { compLogMessage ("ring", CompLogLevelWarn, "No compatible text plugin found."); rd->textFunc = NULL; } ringSetNextKeyInitiate (d, ringNext); ringSetNextKeyTerminate (d, ringTerminate); ringSetPrevKeyInitiate (d, ringPrev); ringSetPrevKeyTerminate (d, ringTerminate); ringSetNextAllKeyInitiate (d, ringNextAll); ringSetNextAllKeyTerminate (d, ringTerminate); ringSetPrevAllKeyInitiate (d, ringPrevAll); ringSetPrevAllKeyTerminate (d, ringTerminate); ringSetNextGroupKeyInitiate (d, ringNextGroup); ringSetNextGroupKeyTerminate (d, ringTerminate); ringSetPrevGroupKeyInitiate (d, ringPrevGroup); ringSetPrevGroupKeyTerminate (d, ringTerminate); ringSetNextButtonInitiate (d, ringNext); ringSetNextButtonTerminate (d, ringTerminate); ringSetPrevButtonInitiate (d, ringPrev); ringSetPrevButtonTerminate (d, ringTerminate); ringSetNextAllButtonInitiate (d, ringNextAll); ringSetNextAllButtonTerminate (d, ringTerminate); ringSetPrevAllButtonInitiate (d, ringPrevAll); ringSetPrevAllButtonTerminate (d, ringTerminate); ringSetNextGroupButtonInitiate (d, ringNextGroup); ringSetNextGroupButtonTerminate (d, ringTerminate); ringSetPrevGroupButtonInitiate (d, ringPrevGroup); ringSetPrevGroupButtonTerminate (d, ringTerminate); WRAP (rd, d, handleEvent, ringHandleEvent); d->base.privates[displayPrivateIndex].ptr = rd; return TRUE; }
/* * groupInitDisplay * */ static Bool groupInitDisplay (CompPlugin *p, CompDisplay *d) { GroupDisplay *gd; gd = malloc (sizeof (GroupDisplay)); if (!gd) return FALSE; gd->screenPrivateIndex = allocateScreenPrivateIndex (); if (gd->screenPrivateIndex < 0) { free (gd); return FALSE; } gd->glowTextureProperties = (GlowTextureProperties*) glowTextureProperties; gd->ignoreMode = FALSE; gd->lastRestackedGroup = NULL; gd->resizeInfo = NULL; gd->groupWinPropertyAtom = XInternAtom (d->display, "_COMPIZ_GROUP", 0); gd->resizeNotifyAtom = XInternAtom (d->display, "_COMPIZ_RESIZE_NOTIFY", 0); WRAP (gd, d, handleEvent, groupHandleEvent); const BananaValue * option_select_button = bananaGetOption (bananaIndex, "select_button", -1); registerButton (option_select_button->s, &gd->select_button); const BananaValue * option_select_single_key = bananaGetOption (bananaIndex, "select_single_key", -1); registerKey (option_select_single_key->s, &gd->select_single_key); const BananaValue * option_group_key = bananaGetOption (bananaIndex, "group_key", -1); registerKey (option_group_key->s, &gd->group_key); const BananaValue * option_ungroup_key = bananaGetOption (bananaIndex, "ungroup_key", -1); registerKey (option_ungroup_key->s, &gd->ungroup_key); const BananaValue * option_remove_key = bananaGetOption (bananaIndex, "remove_key", -1); registerKey (option_remove_key->s, &gd->remove_key); const BananaValue * option_close_key = bananaGetOption (bananaIndex, "close_key", -1); registerKey (option_close_key->s, &gd->close_key); const BananaValue * option_ignore_key = bananaGetOption (bananaIndex, "ignore_key", -1); registerKey (option_ignore_key->s, &gd->ignore_key); const BananaValue * option_tabmode_key = bananaGetOption (bananaIndex, "tabmode_key", -1); registerKey (option_tabmode_key->s, &gd->tabmode_key); const BananaValue * option_change_tab_left_key = bananaGetOption (bananaIndex, "change_tab_left_key", -1); registerKey (option_change_tab_left_key->s, &gd->change_tab_left_key); const BananaValue * option_change_tab_right_key = bananaGetOption (bananaIndex, "change_tab_right_key", -1); registerKey (option_change_tab_right_key->s, &gd->change_tab_right_key); const BananaValue * option_change_color_key = bananaGetOption (bananaIndex, "change_color_key", -1); registerKey (option_change_color_key->s, &gd->change_color_key); d->privates[displayPrivateIndex].ptr = gd; srand (time (NULL)); return TRUE; }