summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-04-12 17:25:22 +0200
committerDanny Baumann <dannybaumann@web.de>2007-04-12 17:25:22 +0200
commit16a0409bc68b5621c1a9d56f4e30315a4b8ba352 (patch)
treed5d634b1a3b9a2f96bf0dc481982f68c58ac13bf
parent5e96153082d0612f398207baf0a9489289971456 (diff)
parent94dab7a85b591e76dc92d729abd6eb664ee913de (diff)
downloadberyl-premerge-16a0409bc68b5621c1a9d56f4e30315a4b8ba352.tar.gz
beryl-premerge-16a0409bc68b5621c1a9d56f4e30315a4b8ba352.tar.bz2
Merge branch 'master' of git+ssh://maniac@git.beryl-project.org/git/compiz/compiz-plugins-beryl-premerge
-rw-r--r--src/snow.c40
-rw-r--r--src/thumbnail.c50
-rw-r--r--src/thumbnail.options2
3 files changed, 60 insertions, 32 deletions
diff --git a/src/snow.c b/src/snow.c
index 7cde777..231cc58 100644
--- a/src/snow.c
+++ b/src/snow.c
@@ -37,8 +37,6 @@
#include <compiz.h>
#include "snow_options.h"
-#define MAX_SNOWFLAKES 1000
-
#define GET_SNOW_DISPLAY(d) \
((SnowDisplay *) (d)->privates[displayPrivateIndex].ptr)
@@ -114,7 +112,7 @@ struct _SnowScreen
Bool displayListNeedsUpdate;
- SnowFlake allSnowFlakes[MAX_SNOWFLAKES];
+ SnowFlake *allSnowFlakes;
};
@@ -153,7 +151,7 @@ static Bool stepSnowPositions(void *sc)
if (!ss->active)
return TRUE;
-
+
int i = 0;
SnowFlake *snowFlake = ss->allSnowFlakes;
int numFlakes = snowGetNumSnowflakes(s->display);
@@ -478,8 +476,9 @@ static void updateSnowTextures(CompScreen * s)
ss->snowTex = realloc(ss->snowTex, sizeof(SnowTexture) * count);
SnowFlake *snowFlake = ss->allSnowFlakes;
+ int numFlakes = snowGetNumSnowflakes(s->display);
- for (i = 0; i < MAX_SNOWFLAKES; i++)
+ for (i = 0; i < numFlakes; i++)
{
setSnowflakeTexture(ss, snowFlake++);
}
@@ -500,9 +499,12 @@ static Bool snowInitScreen(CompPlugin * p, CompScreen * s)
ss->displayListNeedsUpdate = FALSE;
int i = 0;
+ int numFlakes = snowGetNumSnowflakes(s->display);
+
+ ss->allSnowFlakes = malloc(numFlakes * sizeof(SnowFlake));
SnowFlake *snowFlake = ss->allSnowFlakes;
- for (i = 0; i < MAX_SNOWFLAKES; i++)
+ for (i = 0; i < numFlakes; i++)
{
InitiateSnowFlake(ss, snowFlake);
setSnowflakeTexture(ss, snowFlake);
@@ -537,6 +539,9 @@ static void snowFiniScreen(CompPlugin * p, CompScreen * s)
if (ss->snowTexturesLoaded)
free(ss->snowTex);
+ if (ss->allSnowFlakes)
+ free(ss->allSnowFlakes);
+
//Restore the original function
UNWRAP(ss, s, paintScreen);
UNWRAP(ss, s, drawWindow);
@@ -578,6 +583,28 @@ static void snowDisplayOptionChanged(CompDisplay *d, CompOption *opt, SnowDispla
}
}
break;
+ case SnowDisplayOptionNumSnowflakes:
+ {
+ CompScreen *s;
+ int i, numFlakes;
+ SnowFlake *snowFlake;
+
+ numFlakes = snowGetNumSnowflakes(d);
+ for (s = d->screens; s; s = s->next)
+ {
+ SNOW_SCREEN(s);
+ ss->allSnowFlakes = realloc(ss->allSnowFlakes, numFlakes * sizeof(SnowFlake));
+ snowFlake = ss->allSnowFlakes;
+
+ for (i = 0; i < numFlakes; i++)
+ {
+ InitiateSnowFlake(ss, snowFlake);
+ setSnowflakeTexture(ss, snowFlake);
+ snowFlake++;
+ }
+ }
+ }
+ break;
case SnowDisplayOptionSnowTextures:
{
CompScreen *s;
@@ -614,6 +641,7 @@ static Bool snowInitDisplay(CompPlugin * p, CompDisplay * d)
}
snowSetToggleInitiate(d, snowToggle);
+ snowSetNumSnowflakesNotify(d, snowDisplayOptionChanged);
snowSetSnowSizeNotify(d, snowDisplayOptionChanged);
snowSetSnowUpdateDelayNotify(d, snowDisplayOptionChanged);
snowSetSnowTexturesNotify(d, snowDisplayOptionChanged);
diff --git a/src/thumbnail.c b/src/thumbnail.c
index deb7d03..58c39ce 100644
--- a/src/thumbnail.c
+++ b/src/thumbnail.c
@@ -166,12 +166,12 @@ renderThumbText (CompScreen * s, Thumbnail * t, Bool freeThumb)
tA.maxwidth = t->width;
tA.maxheight = 100;
tA.screen = s;
- tA.size = thumbGetFontSize (s);
- tA.color[0] = thumbGetFontColorRed (s);
- tA.color[1] = thumbGetFontColorGreen (s);
- tA.color[2] = thumbGetFontColorBlue (s);
- tA.color[3] = thumbGetFontColorAlpha (s);
- tA.style = (thumbGetFontBold (s)) ? TEXT_STYLE_BOLD : TEXT_STYLE_NORMAL;
+ tA.size = thumbnailGetFontSize (s);
+ tA.color[0] = thumbnailGetFontColorRed (s);
+ tA.color[1] = thumbnailGetFontColorGreen (s);
+ tA.color[2] = thumbnailGetFontColorBlue (s);
+ tA.color[3] = thumbnailGetFontColorAlpha (s);
+ tA.style = (thumbnailGetFontBold (s)) ? TEXT_STYLE_BOLD : TEXT_STYLE_NORMAL;
tA.family = "Sans";
tA.ellipsize = TRUE;
@@ -277,7 +277,7 @@ thumbUpdateThumbnail (CompScreen * s)
if (!ts->thumb.win)
return;
- float maxSize = thumbGetThumbSize (s);
+ float maxSize = thumbnailGetThumbSize (s);
double scale = 1.0;
// do we nee to scale the window down?
if (WIN_W (ts->thumb.win) > maxSize || WIN_H (ts->thumb.win) > maxSize)
@@ -294,7 +294,7 @@ thumbUpdateThumbnail (CompScreen * s)
THUMB_WINDOW (ts->thumb.win);
- if (thumbGetTitleEnabled (s))
+ if (thumbnailGetTitleEnabled (s))
renderThumbText (s, &ts->thumb, FALSE);
else
freeThumbText (s, &ts->thumb);
@@ -307,7 +307,7 @@ thumbUpdateThumbnail (CompScreen * s)
int tPos[2];
int tmpPos[2];
float distance = 1000000;
- int off = thumbGetBorder (s);
+ int off = thumbnailGetBorder (s);
int oDev = outputDeviceForPoint (s, tw->ig.x + (tw->ig.width / 2),
tw->ig.y + (tw->ig.height / 2));
int ox1, oy1, ox2, oy2, ow, oh;
@@ -435,7 +435,7 @@ thumbShowThumbnail (void *vs)
static Bool
checkPosition (CompWindow * w)
{
- if (thumbGetCurrentViewport (w->screen))
+ if (thumbnailGetCurrentViewport (w->screen))
{
// TODO: We need a faster calculation here
Bool onViewport = FALSE;
@@ -521,14 +521,14 @@ thumbUpdateMouse (void *vs)
{
compRemoveTimeout (ts->displayTimeout);
ts->displayTimeout =
- compAddTimeout (thumbGetShowDelay (s),
+ compAddTimeout (thumbnailGetShowDelay (s),
thumbShowThumbnail, s);
}
}
else
{
ts->displayTimeout =
- compAddTimeout (thumbGetShowDelay (s),
+ compAddTimeout (thumbnailGetShowDelay (s),
thumbShowThumbnail, s);
}
}
@@ -673,17 +673,17 @@ thumbPaintThumb (CompScreen * s, Thumbnail * t,
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
- if (thumbGetWindowLike (s))
+ if (thumbnailGetWindowLike (s))
{
glColor4f (1.0, 1.0, 1.0, t->opacity);
enableTexture (s, &ts->windowTexture, COMP_TEXTURE_FILTER_GOOD);
}
else
{
- glColor4us (thumbGetThumbColorRed (s),
- thumbGetThumbColorGreen (s),
- thumbGetThumbColorBlue (s),
- thumbGetThumbColorAlpha (s) * t->opacity);
+ glColor4us (thumbnailGetThumbColorRed (s),
+ thumbnailGetThumbColorGreen (s),
+ thumbnailGetThumbColorBlue (s),
+ thumbnailGetThumbColorAlpha (s) * t->opacity);
enableTexture (s, &ts->glowTexture, COMP_TEXTURE_FILTER_GOOD);
}
@@ -770,7 +770,7 @@ thumbPaintThumb (CompScreen * s, Thumbnail * t,
glEnd ();
- if (thumbGetWindowLike (s))
+ if (thumbnailGetWindowLike (s))
{
disableTexture (s, &ts->windowTexture);
}
@@ -830,7 +830,7 @@ thumbPaintThumb (CompScreen * s, Thumbnail * t,
GLenum filter = s->display->textureFilter;
- if (thumbGetMipmap (s))
+ if (thumbnailGetMipmap (s))
s->display->textureFilter = GL_LINEAR_MIPMAP_LINEAR;
FragmentAttrib fragment;
@@ -864,7 +864,7 @@ thumbPreparePaintScreen (CompScreen * s, int ms)
float val = ms;
val /= 1000;
- val /= thumbGetFadeSpeed (s);
+ val /= thumbnailGetFadeSpeed (s);
if (otherScreenGrabExist (s, 0))
{
@@ -934,7 +934,7 @@ thumbPaintScreen (CompScreen * s,
(*s->paintScreen) (s, sAttrib, transform, region, output, newMask);
WRAP (ts, s, paintScreen, thumbPaintScreen);
- if (thumbGetAlwaysOnTop (s) && !ts->painted)
+ if (thumbnailGetAlwaysOnTop (s) && !ts->painted)
{
if (ts->oldThumb.opacity > 0.0 && ts->oldThumb.win)
{
@@ -979,7 +979,7 @@ thumbPaintTransformedScreen (CompScreen * s,
mask);
WRAP (ts, s, paintTransformedScreen, thumbPaintTransformedScreen);
- if (thumbGetAlwaysOnTop (s) && ts->x == s->x && ts->y == s->y)
+ if (thumbnailGetAlwaysOnTop (s) && ts->x == s->x && ts->y == s->y)
{
ts->painted = TRUE;
if (ts->oldThumb.opacity > 0.0 && ts->oldThumb.win)
@@ -1026,7 +1026,7 @@ thumbPaintWindow (CompWindow * w,
status = (*s->paintWindow) (w, attrib, transform, region, mask);
WRAP (ts, s, paintWindow, thumbPaintWindow);
- if (!thumbGetAlwaysOnTop (s) && ts->x == s->x && ts->y == s->y)
+ if (!thumbnailGetAlwaysOnTop (s) && ts->x == s->x && ts->y == s->y)
{
if (ts->oldThumb.opacity > 0.0 && ts->oldThumb.win &&
ts->oldThumb.dock == w)
@@ -1297,7 +1297,7 @@ thumbFini (CompPlugin * p)
}
static int
-thumbGetVersion (CompPlugin * plugin, int version)
+thumbnailGetVersion (CompPlugin * plugin, int version)
{
return ABIVERSION;
}
@@ -1307,7 +1307,7 @@ CompPluginVTable thumbVTable = {
"thumbnail",
N_("Window Previews"),
N_("Window thumbnails at the taskbar"),
- thumbGetVersion,
+ thumbnailGetVersion,
thumbInit,
thumbFini,
thumbInitDisplay,
diff --git a/src/thumbnail.options b/src/thumbnail.options
index c692342..7e5af72 100644
--- a/src/thumbnail.options
+++ b/src/thumbnail.options
@@ -1,4 +1,4 @@
-<plugin name="thumb">
+<plugin name="thumbnail">
<screen>
<group name="Settings">
<option name="thumb_size" type="int">