static Bool
fadeInitScreen (CompPlugin *p,
		CompScreen *s)
{
    FadeScreen *fs;

    FADE_DISPLAY (s->display);

    fs = malloc (sizeof (FadeScreen));
    if (!fs)
	return FALSE;

    fs->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (fs->windowPrivateIndex < 0)
    {
	free (fs);
	return FALSE;
    }

    fs->steps    = 0;
    fs->fadeTime = 1000.0f / FADE_SPEED_DEFAULT;

    fadeScreenInitOptions (fs);

    WRAP (fs, s, preparePaintScreen, fadePreparePaintScreen);
    WRAP (fs, s, paintWindow, fadePaintWindow);
    WRAP (fs, s, damageWindowRect, fadeDamageWindowRect);

    s->privates[fd->screenPrivateIndex].ptr = fs;

    return TRUE;
}
static Bool
tileInitScreen (CompPlugin *p,
		CompScreen *s)
{
    TileScreen *ts;

    TILE_DISPLAY (s->display);

    ts = (TileScreen *) calloc (1, sizeof (TileScreen));

    ts->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (ts->windowPrivateIndex < 0)
    {
	free (ts);
	return FALSE;
    }
    srand (time (0));

    s->base.privates[td->screenPrivateIndex].ptr = ts;

    ts->grabIndex = 0;
    ts->msResizing = 0;
    ts->oneDuration = 0;

    /* Wrap plugin functions */
    WRAP (ts, s, paintOutput, tilePaintOutput);
    WRAP (ts, s, preparePaintScreen, tilePreparePaintScreen);
    WRAP (ts, s, paintScreen, tilePaintScreen);
    WRAP (ts, s, donePaintScreen, tileDonePaintScreen);
    WRAP (ts, s, windowResizeNotify, tileResizeNotify);
    WRAP (ts, s, paintWindow, tilePaintWindow);

    return TRUE;
}
Пример #3
0
Файл: svg.c Проект: zmike/compiz
static Bool
svgInitScreen(CompPlugin *p,
              CompScreen *s)
{
    SvgScreen *ss;

    SVG_DISPLAY(s->display);

    ss = malloc(sizeof (SvgScreen));
    if (!ss)
        return FALSE;

    ss->windowPrivateIndex = allocateWindowPrivateIndex(s);
    if (ss->windowPrivateIndex < 0)
    {
        free(ss);
        return FALSE;
    }

    memset(&ss->zoom, 0, sizeof (BoxRec));

    WRAP(ss, s, drawWindow, svgDrawWindow);
    WRAP(ss, s, windowMoveNotify, svgWindowMoveNotify);
    WRAP(ss, s, windowResizeNotify, svgWindowResizeNotify);

    s->base.privates[sd->screenPrivateIndex].ptr = ss;

    return TRUE;
}
static Bool
titleinfoInitScreen (CompPlugin *p,
		     CompScreen *s)
{
    TitleinfoScreen *ts;

    TITLEINFO_DISPLAY (s->display);

    ts = malloc (sizeof (TitleinfoScreen));
    if (!ts)
	return FALSE;

    ts->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (ts->windowPrivateIndex < 0) 
    {
	free (ts);
	return FALSE;
    }

    s->base.privates[td->screenPrivateIndex].ptr = ts;

    WRAP (ts, s, addSupportedAtoms, titleinfoAddSupportedAtoms);

    return TRUE;
}
Пример #5
0
static Bool
throwInitScreen (CompPlugin *p,
		CompScreen *s)
{
    ThrowScreen * ts;

    THROW_DISPLAY (s->display);

    ts = malloc (sizeof (ThrowScreen));
    if (!ts)
	return FALSE;

    ts->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (ts->windowPrivateIndex < 0)
    {
	free (ts);
	return FALSE;
    }

    WRAP (ts, s, windowGrabNotify, throwWindowGrabNotify);
    WRAP (ts, s, windowUngrabNotify, throwWindowUngrabNotify);
    WRAP (ts, s, preparePaintScreen, throwPreparePaintScreen);
    WRAP (ts, s, windowMoveNotify, throwWindowMoveNotify);
    WRAP (ts, s, donePaintScreen, throwDonePaintScreen);

    s->base.privates[td->screenPrivateIndex].ptr = ts;

    return TRUE;
}
static Bool
staticInitScreen (CompPlugin *p,
                  CompScreen *s)
{
    StaticScreen *ss;

    STATIC_DISPLAY (s->display);

    ss = calloc (1, sizeof (StaticScreen) );

    if (!ss)
        return FALSE;

    ss->windowPrivateIndex = allocateWindowPrivateIndex (s);

    if (ss->windowPrivateIndex < 0)
    {
        free (ss);
        return FALSE;
    }

    ss->active = FALSE;

    WRAP (ss, s, paintWindow, staticPaintWindow);
    WRAP (ss, s, paintOutput, staticPaintOutput);
    WRAP (ss, s, addWindowGeometry, staticAddWindowGeometry);
    WRAP (ss, s, drawWindowTexture, staticDrawWindowTexture);
    WRAP (ss, s, preparePaintScreen, staticPreparePaintScreen);
    WRAP (ss, s, applyScreenTransform, staticApplyScreenTransform);
    WRAP (ss, s, paintTransformedOutput, staticPaintTransformedOutput);

    s->base.privates[sd->screenPrivateIndex].ptr = ss;

    return TRUE;
}
static Bool
smartputInitScreen (CompPlugin *p,
		    CompScreen *s)
{
    SmartputScreen *sps;

    SMARTPUT_DISPLAY (s->display);

    sps = malloc (sizeof (SmartputScreen));
    if (!sps)
	return FALSE;

    sps->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (sps->windowPrivateIndex < 0)
    {
	free (sps);
	return FALSE;
    }

    /* initialize variables
     * bad stuff happens if we don't do this
     */
    sps->animation = FALSE;
    sps->grabIndex = 0;
    sps->lastWindow = None;

    /* wrap the overloaded functions */
    WRAP (sps, s, preparePaintScreen, smartputPreparePaintScreen);
    WRAP (sps, s, donePaintScreen, smartputDonePaintScreen);
    WRAP (sps, s, paintOutput, smartputPaintOutput);
    WRAP (sps, s, paintWindow, smartputPaintWindow);

    s->base.privates[spd->screenPrivateIndex].ptr = sps;
    return TRUE;
}
Пример #8
0
static Bool snapInitScreen(CompPlugin * p, CompScreen * s)
{
	SnapScreen *ss;

	SNAP_DISPLAY(s->display);

	ss = malloc(sizeof(SnapScreen));
	if (!ss)
		return FALSE;

	ss->windowPrivateIndex = allocateWindowPrivateIndex(s);
	if (ss->windowPrivateIndex < 0)
	{
		free(ss);
		return FALSE;
	}

	//WRAP(ss, s, windowResizeNotify, snapWindowResizeNotify);
	WRAP(ss, s, windowMoveNotify, snapWindowMoveNotify);
	WRAP(ss, s, windowGrabNotify, snapWindowGrabNotify);
	WRAP(ss, s, windowUngrabNotify, snapWindowUngrabNotify);

	s->base.privates[sd->screenPrivateIndex].ptr = ss;

	return TRUE;
}
static Bool
screenSaverInitScreen (CompPlugin *p,
		      CompScreen *s)
{
	ScreenSaverScreen *ss;

	SCREENSAVER_DISPLAY (s->display);

	ss = (ScreenSaverScreen*)malloc (sizeof (ScreenSaverScreen));
	if (!ss)
	    return FALSE;

	ss->windowPrivateIndex = allocateWindowPrivateIndex (s);
	if (ss->windowPrivateIndex < 0)
	{
	    free (ss);
	    return FALSE;
	}

	s->base.privates[sd->screenPrivateIndex].ptr = ss;
	ss->effect = new ScreenEffect(s);
	ss->desktopOpacity = OPAQUE;

	WRAP (ss, s, preparePaintScreen, screenSaverPreparePaintScreen);
	WRAP (ss, s, donePaintScreen, screenSaverDonePaintScreen);
	WRAP (ss, s, paintOutput, screenSaverPaintOutput);
	WRAP (ss, s, paintWindow, screenSaverPaintWindow);
	WRAP (ss, s, paintTransformedOutput, screenSaverPaintTransformedOutput);
	WRAP (ss, s, paintScreen, screenSaverPaintScreen);

	return TRUE;
}
Пример #10
0
static Bool
colorFilterInitScreen (CompPlugin *p,
                       CompScreen *s)
{
	ColorFilterScreen *cfs;

	FILTER_DISPLAY (&display);

	if (!s->fragmentProgram)
	{
		compLogMessage ("colorfilter", CompLogLevelFatal,
		                "Fragment program support missing.");
		return TRUE;
	}

	cfs = malloc (sizeof (ColorFilterScreen));
	if (!cfs)
		return FALSE;

	cfs->windowPrivateIndex = allocateWindowPrivateIndex (s);
	if (cfs->windowPrivateIndex < 0)
	{
		free (cfs);
		return FALSE;
	}

	cfs->isFiltered = FALSE;
	cfs->currentFilter = 0;

	cfs->filtersLoaded = FALSE;
	cfs->filtersFunctions = NULL;
	cfs->filtersCount = 0;	

	WRAP (cfs, s, drawWindowTexture, colorFilterDrawWindowTexture);
	WRAP (cfs, s, windowAddNotify, colorFilterWindowAddNotify);

	s->privates[cfd->screenPrivateIndex].ptr = cfs;

	const BananaValue *
	option_filter_match = bananaGetOption (bananaIndex,
	                                       "filter_match",
	                                       s->screenNum);

	matchInit (&cfs->filter_match);
	matchAddFromString (&cfs->filter_match, option_filter_match->s);
	matchUpdate (&cfs->filter_match);

	const BananaValue *
	option_exclude_match = bananaGetOption (bananaIndex,
	                                        "exclude_match",
	                                        s->screenNum);

	matchInit (&cfs->exclude_match);
	matchAddFromString (&cfs->exclude_match, option_exclude_match->s);
	matchUpdate (&cfs->exclude_match);

	return TRUE;
}
static Bool
ringInitScreen (CompPlugin *p,
		CompScreen *s)
{
    RingScreen *rs;

    RING_DISPLAY (s->display);

    rs = malloc (sizeof (RingScreen));
    if (!rs)
	return FALSE;

    rs->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (rs->windowPrivateIndex < 0)
    {
	free (rs);
	return FALSE;
    }

    rs->grabIndex = 0;

    rs->state = RingStateNone;

    rs->windows     = NULL;
    rs->drawSlots   = NULL;
    rs->windowsSize = 0;

    rs->paintingSwitcher = FALSE;

    rs->selectedWindow = NULL;

    rs->moreAdjust   = FALSE;
    rs->rotateAdjust = FALSE;

    rs->rotAdjust = 0;
    rs->rVelocity = 0;

    rs->textData = NULL;

    matchInit (&rs->match);

    WRAP (rs, s, preparePaintScreen, ringPreparePaintScreen);
    WRAP (rs, s, donePaintScreen, ringDonePaintScreen);
    WRAP (rs, s, paintOutput, ringPaintOutput);
    WRAP (rs, s, paintWindow, ringPaintWindow);
    WRAP (rs, s, damageWindowRect, ringDamageWindowRect);

    s->base.privates[rd->screenPrivateIndex].ptr = rs;

    return TRUE;
}
Пример #12
0
static Bool
videoInitScreen(CompPlugin *p,
                CompScreen *s)
{
   VideoScreen *vs;

   VIDEO_DISPLAY(s->display);

   vs = malloc(sizeof (VideoScreen));
   if (!vs)
     return FALSE;

   vs->windowPrivateIndex = allocateWindowPrivateIndex(s);
   if (vs->windowPrivateIndex < 0)
     {
        free(vs);
        return FALSE;
     }

   vs->yv12Functions = NULL;

   memset(vs->imageFormat, 0, sizeof (vs->imageFormat));

   vs->imageFormat[IMAGE_FORMAT_RGB] = TRUE;
   if (s->fragmentProgram)
     {
        if (s->glxPixmapFBConfigs[8].fbConfig)
          {
             vs->imageFormat[IMAGE_FORMAT_YV12] = TRUE;
          }
        else
          {
             compLogMessage("video", CompLogLevelWarn,
                            "No 8 bit GLX pixmap format, "
                            "disabling YV12 image format");
          }
     }

   WRAP(vs, s, drawWindow, videoDrawWindow);
   WRAP(vs, s, drawWindowTexture, videoDrawWindowTexture);
   WRAP(vs, s, damageWindowRect, videoDamageWindowRect);
   WRAP(vs, s, windowMoveNotify, videoWindowMoveNotify);
   WRAP(vs, s, windowResizeNotify, videoWindowResizeNotify);

   s->base.privates[vd->screenPrivateIndex].ptr = vs;

   videoSetSupportedHint(s);

   return TRUE;
}
Пример #13
0
static Bool
fadeInitScreen(CompPlugin *p,
               CompScreen *s)
{
   FadeScreen *fs;

   FADE_DISPLAY(s->display);

   fs = malloc(sizeof (FadeScreen));
   if (!fs)
     return FALSE;

   if (!compInitScreenOptionsFromMetadata(s,
                                          &fadeMetadata,
                                          fadeScreenOptionInfo,
                                          fs->opt,
                                          FADE_SCREEN_OPTION_NUM))
     {
        free(fs);
        return FALSE;
     }

   fs->windowPrivateIndex = allocateWindowPrivateIndex(s);
   if (fs->windowPrivateIndex < 0)
     {
        compFiniScreenOptions(s, fs->opt, FADE_SCREEN_OPTION_NUM);
        free(fs);
        return FALSE;
     }

   fs->fadeTime = 1000.0f / fs->opt[FADE_SCREEN_OPTION_FADE_SPEED].value.f;

   matchInit(&fs->match);

   fadeUpdateWindowFadeMatch(s->display,
                             &fs->opt[FADE_SCREEN_OPTION_WINDOW_MATCH].value,
                             &fs->match);

   WRAP(fs, s, preparePaintScreen, fadePreparePaintScreen);
   WRAP(fs, s, paintWindow, fadePaintWindow);
   WRAP(fs, s, damageWindowRect, fadeDamageWindowRect);
   WRAP(fs, s, focusWindow, fadeFocusWindow);
   WRAP(fs, s, windowResizeNotify, fadeWindowResizeNotify);

   s->base.privates[fd->screenPrivateIndex].ptr = fs;

   return TRUE;
}
Пример #14
0
static Bool
minInitScreen (CompPlugin *p,
               CompScreen *s)
{
	MinScreen *ms;

	MIN_DISPLAY (&display);

	ms = malloc (sizeof (MinScreen));
	if (!ms)
		return FALSE;

	ms->windowPrivateIndex = allocateWindowPrivateIndex (s);
	if (ms->windowPrivateIndex < 0)
	{
		free (ms);
		return FALSE;
	}

	ms->moreAdjust = FALSE;

	const BananaValue *
	option_shade_resistance = bananaGetOption (bananaIndex,
	                                           "shade_resistance",
	                                           s->screenNum);

	ms->shadeStep  = 100 - option_shade_resistance->i + 1;

	const BananaValue *
	option_window_match = bananaGetOption (bananaIndex,
	                                       "window_match",
	                                       s->screenNum);

	matchInit (&ms->match);
	matchAddFromString (&ms->match, option_window_match->s);
	matchUpdate (&ms->match);

	WRAP (ms, s, preparePaintScreen, minPreparePaintScreen);
	WRAP (ms, s, donePaintScreen, minDonePaintScreen);
	WRAP (ms, s, paintOutput, minPaintOutput);
	WRAP (ms, s, paintWindow, minPaintWindow);
	WRAP (ms, s, damageWindowRect, minDamageWindowRect);
	WRAP (ms, s, focusWindow, minFocusWindow);

	s->privates[md->screenPrivateIndex].ptr = ms;

	return TRUE;
}
Пример #15
0
static Bool
decorInitScreen (CompPlugin *p,
		 CompScreen *s)
{
    DecorScreen *ds;

    DECOR_DISPLAY (s->display);

    ds = malloc (sizeof (DecorScreen));
    if (!ds)
	return FALSE;

    ds->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (ds->windowPrivateIndex < 0)
    {
	free (ds);
	return FALSE;
    }

    memset (ds->decor, 0, sizeof (ds->decor));

    ds->dmWin                = None;
    ds->decoratorStartHandle = 0;

    WRAP (ds, s, drawWindow, decorDrawWindow);
    WRAP (ds, s, damageWindowRect, decorDamageWindowRect);
    WRAP (ds, s, getOutputExtentsForWindow, decorGetOutputExtentsForWindow);
    WRAP (ds, s, windowMoveNotify, decorWindowMoveNotify);
    WRAP (ds, s, windowResizeNotify, decorWindowResizeNotify);
    WRAP (ds, s, windowStateChangeNotify, decorWindowStateChangeNotify);
    WRAP (ds, s, addSupportedAtoms, decorAddSupportedAtoms);

    s->base.privates[dd->screenPrivateIndex].ptr = ds;

    decorCheckForDmOnScreen (s, FALSE);
    setSupportedWmHints (s);

    if (!ds->dmWin)
	ds->decoratorStartHandle = compAddTimeout (0, -1,
						   decorStartDecorator, s);

    return TRUE;
}
static Bool
colorFilterInitScreen (CompPlugin * p, CompScreen * s)
{
    ColorFilterScreen *cfs;

    FILTER_DISPLAY (s->display);

    if (!s->fragmentProgram)
    {
	compLogMessage ("colorfilter", CompLogLevelFatal,
			"Fragment program support missing.");
	return TRUE;
    }

    cfs = malloc (sizeof (ColorFilterScreen));
    if (!cfs)
	return FALSE;

    cfs->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (cfs->windowPrivateIndex < 0)
    {
	free (cfs);
	return FALSE;
    }

    cfs->isFiltered = FALSE;
    cfs->currentFilter = 0;

    cfs->filtersLoaded = FALSE;
    cfs->filtersFunctions = NULL;
    cfs->filtersCount = 0;

    colorfilterSetFilterMatchNotify (s, colorFilterMatchsChanged);
    colorfilterSetExcludeMatchNotify (s, colorFilterExcludeMatchsChanged);
    colorfilterSetFiltersNotify (s, colorFiltersChanged);
    colorfilterSetFilterDecorationsNotify (s, colorFilterDamageDecorations);

    WRAP (cfs, s, drawWindowTexture, colorFilterDrawWindowTexture);

    s->base.privates[cfd->screenPrivateIndex].ptr = cfs;

    return TRUE;
}
Пример #17
0
static Bool
opacifyInitScreen (CompPlugin *p,
                   CompScreen *s)
{
	OpacifyScreen *os;

	OPACIFY_DISPLAY (&display);

	os = malloc (sizeof (OpacifyScreen));
	if (!os)
		return FALSE;

	os->windowPrivateIndex = allocateWindowPrivateIndex (s);
	if (os->windowPrivateIndex < 0)
	{
		free (os);
		return FALSE;
	}

	WRAP (os, s, paintWindow, opacifyPaintWindow);

	const BananaValue *
	option_window_match = bananaGetOption (bananaIndex,
	                                       "window_match",
	                                       s->screenNum);

	matchInit (&os->window_match);
	matchAddFromString (&os->window_match, option_window_match->s);
	matchUpdate (&os->window_match);

	s->privates[od->screenPrivateIndex].ptr = os;

	os->intersect = XCreateRegion ();

	os->justMoved = FALSE;

	os->passiveNum = 0;

	os->active = 0;

	return TRUE;
}
Пример #18
0
static Bool minInitScreen(CompPlugin * p, CompScreen * s)
{
	MinScreen *ms;

	MIN_DISPLAY(s->display);

	ms = malloc(sizeof(MinScreen));
	if (!ms)
		return FALSE;

	if (!compInitScreenOptionsFromMetadata(s,
					       &minMetadata,
					       minScreenOptionInfo,
					       ms->opt,
					       MIN_SCREEN_OPTION_NUM)) {
		free(ms);
		return FALSE;
	}

	ms->windowPrivateIndex = allocateWindowPrivateIndex(s);
	if (ms->windowPrivateIndex < 0) {
		compFiniScreenOptions(s, ms->opt, MIN_SCREEN_OPTION_NUM);
		free(ms);
		return FALSE;
	}

	ms->moreAdjust = FALSE;
	ms->shadeStep = ms->opt[MIN_SCREEN_OPTION_SHADE_RESISTANCE].rest.i.max -
	    ms->opt[MIN_SCREEN_OPTION_SHADE_RESISTANCE].value.i + 1;

	WRAP(ms, s, preparePaintScreen, minPreparePaintScreen);
	WRAP(ms, s, donePaintScreen, minDonePaintScreen);
	WRAP(ms, s, paintOutput, minPaintOutput);
	WRAP(ms, s, paintWindow, minPaintWindow);
	WRAP(ms, s, damageWindowRect, minDamageWindowRect);
	WRAP(ms, s, focusWindow, minFocusWindow);

	s->base.privates[md->screenPrivateIndex].ptr = ms;

	return TRUE;
}
static Bool
scaleaddonInitScreen (CompPlugin *p,
                      CompScreen *s)
{
    ScaleAddonScreen *as;

    ADDON_DISPLAY (s->display);
    SCALE_SCREEN (s);

    as = malloc (sizeof (ScaleAddonScreen));
    if (!as)
        return FALSE;

    as->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (as->windowPrivateIndex < 0)
    {
        free (as);
        return FALSE;
    }

    as->scale = 1.0f;
    as->lastState = SCALE_STATE_NONE;

    WRAP (as, s, donePaintScreen, scaleaddonDonePaintScreen);
    WRAP (as, ss, scalePaintDecoration, scaleaddonScalePaintDecoration);
    WRAP (as, ss, selectWindow, scaleaddonSelectWindow);
    WRAP (as, ss, layoutSlotsAndAssignWindows,
          scaleaddonLayoutSlotsAndAssignWindows);

    scaleaddonSetWindowTitleNotify (s, scaleaddonScreenOptionChanged);
    scaleaddonSetTitleBoldNotify (s, scaleaddonScreenOptionChanged);
    scaleaddonSetTitleSizeNotify (s, scaleaddonScreenOptionChanged);
    scaleaddonSetBorderSizeNotify (s, scaleaddonScreenOptionChanged);
    scaleaddonSetFontColorNotify (s, scaleaddonScreenOptionChanged);
    scaleaddonSetBackColorNotify (s, scaleaddonScreenOptionChanged);

    s->base.privates[ad->screenPrivateIndex].ptr = as;

    return TRUE;
}
static Bool
NEGInitScreen (CompPlugin *p,
	       CompScreen *s)
{
    NEGScreen *ns;

    NEG_DISPLAY (s->display);

    ns = malloc (sizeof (NEGScreen));
    if (!ns)
	return FALSE;

    ns->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (ns->windowPrivateIndex < 0)
    {
	free (ns);
	return FALSE;
    }

    /* initialize the screen variables
     * you know what happens if you don't
     */
    ns->isNeg = FALSE;

    ns->negFunction      = 0;
    ns->negAlphaFunction = 0;

    negSetNegMatchNotify (s, NEGScreenOptionChanged);
    negSetExcludeMatchNotify (s, NEGScreenOptionChanged);

    /* wrap overloaded functions */
    WRAP (ns, s, drawWindowTexture, NEGDrawWindowTexture);

    s->base.privates[nd->screenPrivateIndex].ptr = ns;

    return TRUE;
}
Пример #21
0
/*
 * groupInitScreen
 *
 */
static Bool
groupInitScreen (CompPlugin *p,
                 CompScreen *s)
{
    GroupScreen       *gs;
    int glowType;

    GROUP_DISPLAY (&display);

    gs = malloc (sizeof (GroupScreen));
    if (!gs)
        return FALSE;

    gs->windowPrivateIndex = allocateWindowPrivateIndex (s);
    if (gs->windowPrivateIndex < 0)
    {
        free (gs);
        return FALSE;
    }

    WRAP (gs, s, windowMoveNotify, groupWindowMoveNotify);
    WRAP (gs, s, windowResizeNotify, groupWindowResizeNotify);
    WRAP (gs, s, getOutputExtentsForWindow, groupGetOutputExtentsForWindow);
    WRAP (gs, s, preparePaintScreen, groupPreparePaintScreen);
    WRAP (gs, s, paintOutput, groupPaintOutput);
    WRAP (gs, s, drawWindow, groupDrawWindow);
    WRAP (gs, s, paintWindow, groupPaintWindow);
    WRAP (gs, s, paintTransformedOutput, groupPaintTransformedOutput);
    WRAP (gs, s, donePaintScreen, groupDonePaintScreen);
    WRAP (gs, s, windowGrabNotify, groupWindowGrabNotify);
    WRAP (gs, s, windowUngrabNotify, groupWindowUngrabNotify);
    WRAP (gs, s, damageWindowRect, groupDamageWindowRect);
    WRAP (gs, s, windowStateChangeNotify, groupWindowStateChangeNotify);
    WRAP (gs, s, activateWindow, groupActivateWindow);

    s->privates[gd->screenPrivateIndex].ptr = gs;

    gs->groups = NULL;

    gs->tmpSel.windows = NULL;
    gs->tmpSel.nWins   = 0;

    gs->grabIndex = 0;
    gs->grabState = ScreenGrabNone;

    gs->lastHoveredGroup = NULL;

    gs->queued          = FALSE;
    gs->pendingMoves    = NULL;
    gs->pendingGrabs    = NULL;
    gs->pendingUngrabs  = NULL;

    gs->dequeueTimeoutHandle = 0;

    gs->draggedSlot            = NULL;
    gs->dragged                = FALSE;
    gs->dragHoverTimeoutHandle = 0;

    gs->prevX = 0;
    gs->prevY = 0;

    gs->showDelayTimeoutHandle = 0;

    /* one-shot timeout for stuff that needs to be initialized after
       all screens and windows are initialized */
    gs->initialActionsTimeoutHandle =
        compAddTimeout (0, 0, groupApplyInitialActions, (void *) s);

    initTexture (s, &gs->glowTexture);

    const BananaValue *
    option_glow_type = bananaGetOption (bananaIndex,
                                        "glow_type",
                                        s->screenNum);

    glowType = option_glow_type->i;
    imageDataToTexture (s, &gs->glowTexture,
                        glowTextureProperties[glowType].textureData,
                        glowTextureProperties[glowType].textureSize,
                        glowTextureProperties[glowType].textureSize,
                        GL_RGBA, GL_UNSIGNED_BYTE);

    const BananaValue *
    option_window_match = bananaGetOption (bananaIndex,
                                           "window_match",
                                           s->screenNum);

    matchInit (&gs->window_match);
    matchAddFromString (&gs->window_match, option_window_match->s);
    matchUpdate (&gs->window_match);

    const BananaValue *
    option_autotab_windows = bananaGetOption (bananaIndex,
                             "autotab_windows",
                             s->screenNum);

    gs->autotabCount = option_autotab_windows->list.nItem;
    gs->autotab = malloc (gs->autotabCount * sizeof (CompMatch));

    int i;
    for (i = 0; i <= gs->autotabCount - 1; i++)
    {
        matchInit (&gs->autotab[i]);
        matchAddFromString (&gs->autotab[i],
                            option_autotab_windows->list.item[i].s);
        matchUpdate (&gs->autotab[i]);
    }

    return TRUE;
}
Пример #22
0
static Bool
winrulesInitScreen (CompPlugin *p,
                    CompScreen *s)
{
	WinrulesScreen *ws;

	WINRULES_DISPLAY (&display);

	ws = malloc (sizeof (WinrulesScreen));
	if (!ws)
		return FALSE;

	ws->windowPrivateIndex = allocateWindowPrivateIndex (s);
	if (ws->windowPrivateIndex < 0)
	{
		free (ws);
		return FALSE;
	}

	WRAP (ws, s, getAllowedActionsForWindow,
	      winrulesGetAllowedActionsForWindow);

	const BananaValue *
	option_skiptaskbar_match = bananaGetOption (bananaIndex,
	                                            "skiptaskbar_match",
	                                            s->screenNum);

	matchInit (&ws->skiptaskbar_match);
	matchAddFromString (&ws->skiptaskbar_match, option_skiptaskbar_match->s);
	matchUpdate (&ws->skiptaskbar_match);

	const BananaValue *
	option_skippager_match = bananaGetOption (bananaIndex,
	                                          "skippager_match",
	                                          s->screenNum);

	matchInit (&ws->skippager_match);
	matchAddFromString (&ws->skippager_match, option_skippager_match->s);
	matchUpdate (&ws->skippager_match);

	const BananaValue *
	option_above_match = bananaGetOption (bananaIndex,
	                                      "above_match",
	                                      s->screenNum);

	matchInit (&ws->above_match);
	matchAddFromString (&ws->above_match, option_above_match->s);
	matchUpdate (&ws->above_match);

	const BananaValue *
	option_below_match = bananaGetOption (bananaIndex,
	                                      "below_match",
	                                      s->screenNum);

	matchInit (&ws->below_match);
	matchAddFromString (&ws->below_match, option_below_match->s);
	matchUpdate (&ws->below_match);

	const BananaValue *
	option_sticky_match = bananaGetOption (bananaIndex,
	                                       "sticky_match",
	                                       s->screenNum);

	matchInit (&ws->sticky_match);
	matchAddFromString (&ws->sticky_match, option_sticky_match->s);
	matchUpdate (&ws->sticky_match);

	const BananaValue *
	option_fullscreen_match = bananaGetOption (bananaIndex,
	                                           "fullscreen_match",
	                                           s->screenNum);

	matchInit (&ws->fullscreen_match);
	matchAddFromString (&ws->fullscreen_match, option_fullscreen_match->s);
	matchUpdate (&ws->fullscreen_match);

	const BananaValue *
	option_maximize_match = bananaGetOption (bananaIndex,
	                                         "maximize_match",
	                                         s->screenNum);

	matchInit (&ws->maximize_match);
	matchAddFromString (&ws->maximize_match, option_maximize_match->s);
	matchUpdate (&ws->maximize_match);

	const BananaValue *
	option_no_argb_match = bananaGetOption (bananaIndex,
	                                        "no_argb_match",
	                                         s->screenNum);

	matchInit (&ws->no_argb_match);
	matchAddFromString (&ws->no_argb_match, option_no_argb_match->s);
	matchUpdate (&ws->no_argb_match);

	const BananaValue *
	option_no_move_match = bananaGetOption (bananaIndex,
	                                        "no_move_match",
	                                        s->screenNum);

	matchInit (&ws->no_move_match);
	matchAddFromString (&ws->no_move_match, option_no_move_match->s);
	matchUpdate (&ws->no_move_match);

	const BananaValue *
	option_no_resize_match = bananaGetOption (bananaIndex,
	                                          "no_resize_match",
	                                          s->screenNum);

	matchInit (&ws->no_resize_match);
	matchAddFromString (&ws->no_resize_match, option_no_resize_match->s);
	matchUpdate (&ws->no_resize_match);

	const BananaValue *
	option_no_minimize_match = bananaGetOption (bananaIndex,
	                                            "no_minimize_match",
	                                            s->screenNum);

	matchInit (&ws->no_minimize_match);
	matchAddFromString (&ws->no_minimize_match, option_no_minimize_match->s);
	matchUpdate (&ws->no_minimize_match);

	const BananaValue *
	option_no_maximize_match = bananaGetOption (bananaIndex,
	                                            "no_maximize_match",
	                                            s->screenNum);

	matchInit (&ws->no_maximize_match);
	matchAddFromString (&ws->no_maximize_match, option_no_maximize_match->s);
	matchUpdate (&ws->no_maximize_match);

	const BananaValue *
	option_no_close_match = bananaGetOption (bananaIndex,
	                                         "no_close_match",
	                                         s->screenNum);

	matchInit (&ws->no_close_match);
	matchAddFromString (&ws->no_close_match, option_no_close_match->s);
	matchUpdate (&ws->no_close_match);

	const BananaValue *
	option_no_focus_match = bananaGetOption (bananaIndex,
	                                         "no_focus_match",
	                                         s->screenNum);

	matchInit (&ws->no_focus_match);
	matchAddFromString (&ws->no_focus_match, option_no_focus_match->s);
	matchUpdate (&ws->no_focus_match);

	const BananaValue *
	option_size_matches = bananaGetOption (bananaIndex,
	                                       "size_matches",
	                                       s->screenNum);

	ws->size_matches_count = option_size_matches->list.nItem;
	int i;
	for (i = 0; i < option_size_matches->list.nItem; i++)
	{
		matchInit (&ws->size_matches[i]);
		matchAddFromString (&ws->size_matches[i],
		                    option_size_matches->list.item[i].s);
		matchUpdate (&ws->size_matches[i]);
	}

	s->privates[wd->screenPrivateIndex].ptr = ws;

	return TRUE;
}