summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam <Sam@XPS-SUSE.XPS>2008-05-22 19:07:19 +0800
committerSam <Sam@XPS-SUSE.XPS>2008-05-22 19:07:19 +0800
commitcbbe1513cad70807baf4abe6366b1d1b94c81939 (patch)
tree96ac3362b403df06f76f4f85571144476b17872f
parentf7f22226ddd9b78915f28241bd51dca8f7d53610 (diff)
downloadfloatingobjects-cbbe1513cad70807baf4abe6366b1d1b94c81939.tar.gz
floatingobjects-cbbe1513cad70807baf4abe6366b1d1b94c81939.tar.bz2
* Options renaming in the XML file
-rw-r--r--fobjects.c86
-rw-r--r--fobjects.xml.in16
2 files changed, 51 insertions, 51 deletions
diff --git a/fobjects.c b/fobjects.c
index f1fe8d3..acd8bac 100644
--- a/fobjects.c
+++ b/fobjects.c
@@ -131,8 +131,8 @@ static void
fobjectsMove (CompDisplay *d,
FObjectsObject *sf)
{
- float tmp = 1.0f / (101.0f - fobjectsGetSnowSpeed (d));
- int fobjectsUpdateDelay = fobjectsGetSnowUpdateDelay (d);
+ float tmp = 1.0f / (101.0f - fobjectsGetObjectSpeed (d));
+ int fobjectsUpdateDelay = fobjectsGetObjectUpdateDelay (d);
sf->x += (sf->xs * (float) fobjectsUpdateDelay) * tmp;
sf->y += (sf->ys * (float) fobjectsUpdateDelay) * tmp;
@@ -141,7 +141,7 @@ fobjectsMove (CompDisplay *d,
}
static Bool
-stepSnowPositions (void *closure)
+stepObjectPositions (void *closure)
{
CompScreen *s = closure;
int i, numObjects;
@@ -154,8 +154,8 @@ stepSnowPositions (void *closure)
return TRUE;
fobjectsObject = ss->allObjects;
- numObjects = fobjectsGetNumSnowflakes (s->display);
- onTop = fobjectsGetSnowOverWindows (s->display);
+ numObjects = fobjectsGetNumObjects (s->display);
+ onTop = fobjectsGetObjectOverWindows (s->display);
for (i = 0; i < numObjects; i++)
fobjectsThink(ss, fobjectsObject++);
@@ -221,7 +221,7 @@ mmRand (int min,
static void
setupDisplayList (FObjectsScreen *ss)
{
- float fobjectsSize = fobjectsGetSnowSize (ss->s->display);
+ float fobjectsSize = fobjectsGetObjectSize (ss->s->display);
ss->displayList = glGenLists (1);
@@ -264,8 +264,8 @@ beginRendering (FObjectsScreen *ss,
for (j = 0; j < ss->fobjectsTexturesLoaded; j++)
{
FObjectsObject *fobjectsObject = ss->allObjects;
- int i, numObjects = fobjectsGetNumSnowflakes (s->display);
- Bool fobjectsRotate = fobjectsGetSnowRotation (s->display);
+ int i, numObjects = fobjectsGetNumObjects (s->display);
+ Bool fobjectsRotate = fobjectsGetObjectRotation (s->display);
enableTexture (ss->s, &ss->fobjectsTex[j].tex,
COMP_TEXTURE_FILTER_GOOD);
@@ -290,7 +290,7 @@ beginRendering (FObjectsScreen *ss,
else
{
FObjectsObject *fobjectsObject = ss->allObjects;
- int i, numObjects = fobjectsGetNumSnowflakes (s->display);
+ int i, numObjects = fobjectsGetNumObjects (s->display);
for (i = 0; i < numObjects; i++)
{
@@ -325,14 +325,14 @@ fobjectsPaintOutput (CompScreen *s,
SNOW_SCREEN (s);
- if (ss->active && !fobjectsGetSnowOverWindows (s->display))
+ if (ss->active && !fobjectsGetObjectOverWindows (s->display))
mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
UNWRAP (ss, s, paintOutput);
status = (*s->paintOutput) (s, sa, transform, region, output, mask);
WRAP (ss, s, paintOutput, fobjectsPaintOutput);
- if (ss->active && fobjectsGetSnowOverWindows (s->display))
+ if (ss->active && fobjectsGetObjectOverWindows (s->display))
{
CompTransform sTransform = *transform;
@@ -365,7 +365,7 @@ fobjectsDrawWindow (CompWindow *w,
/* Check whether this is the Desktop Window */
if (ss->active && (w->type & CompWindowTypeDesktopMask) &&
- !fobjectsGetSnowOverWindows (w->screen->display))
+ !fobjectsGetObjectOverWindows (w->screen->display))
{
beginRendering (ss, w->screen);
}
@@ -380,27 +380,27 @@ initiateFObjectsObject (FObjectsScreen *ss,
/* TODO: possibly place objects based on FOV, instead of a cube. */
int boxing = fobjectsGetScreenBoxing (ss->s->display);
- switch (fobjectsGetSnowDirection (ss->s->display))
+ switch (fobjectsGetObjectDirection (ss->s->display))
{
- case SnowDirectionTopToBottom:
+ case ObjectDirectionTopToBottom:
sf->x = mmRand (-boxing, ss->s->width + boxing, 1);
sf->xs = mmRand (-1, 1, 500);
sf->y = mmRand (-300, 0, 1);
sf->ys = mmRand (1, 3, 1);
break;
- case SnowDirectionBottomToTop:
+ case ObjectDirectionBottomToTop:
sf->x = mmRand (-boxing, ss->s->width + boxing, 1);
sf->xs = mmRand (-1, 1, 500);
sf->y = mmRand (ss->s->height, ss->s->height + 300, 1);
sf->ys = -mmRand (1, 3, 1);
break;
- case SnowDirectionRightToLeft:
+ case ObjectDirectionRightToLeft:
sf->x = mmRand (ss->s->width, ss->s->width + 300, 1);
sf->xs = -mmRand (1, 3, 1);
sf->y = mmRand (-boxing, ss->s->height + boxing, 1);
sf->ys = mmRand (-1, 1, 500);
break;
- case SnowDirectionLeftToRight:
+ case ObjectDirectionLeftToRight:
sf->x = mmRand (-300, 0, 1);
sf->xs = mmRand (1, 3, 1);
sf->y = mmRand (-boxing, ss->s->height + boxing, 1);
@@ -417,7 +417,7 @@ initiateFObjectsObject (FObjectsScreen *ss,
}
static void
-setSnowflakeTexture (FObjectsScreen *ss,
+setObjectTexture (FObjectsScreen *ss,
FObjectsObject *sf)
{
if (ss->fobjectsTexturesLoaded)
@@ -425,11 +425,11 @@ setSnowflakeTexture (FObjectsScreen *ss,
}
static void
-updateSnowTextures (CompScreen *s)
+updateObjectTextures (CompScreen *s)
{
int i, count = 0;
- float fobjectsSize = fobjectsGetSnowSize(s->display);
- int numObjects = fobjectsGetNumSnowflakes(s->display);
+ float fobjectsSize = fobjectsGetObjectSize(s->display);
+ int numObjects = fobjectsGetNumObjects(s->display);
FObjectsObject *fobjectsObject;
SNOW_SCREEN (s);
@@ -499,7 +499,7 @@ updateSnowTextures (CompScreen *s)
ss->fobjectsTex = realloc (ss->fobjectsTex, sizeof (FObjectsTexture) * count);
for (i = 0; i < numObjects; i++)
- setSnowflakeTexture (ss, fobjectsObject++);
+ setObjectTexture (ss, fobjectsObject++);
}
static Bool
@@ -507,7 +507,7 @@ fobjectsInitScreen (CompPlugin *p,
CompScreen *s)
{
FObjectsScreen *ss;
- int i, numObjects = fobjectsGetNumSnowflakes (s->display);
+ int i, numObjects = fobjectsGetNumObjects (s->display);
FObjectsObject *fobjectsObject;
SNOW_DISPLAY (s->display);
@@ -534,18 +534,18 @@ fobjectsInitScreen (CompPlugin *p,
for (i = 0; i < numObjects; i++)
{
initiateFObjectsObject (ss, fobjectsObject);
- setSnowflakeTexture (ss, fobjectsObject);
+ setObjectTexture (ss, fobjectsObject);
fobjectsObject++;
}
- updateSnowTextures (s);
+ updateObjectTextures (s);
setupDisplayList (ss);
WRAP (ss, s, paintOutput, fobjectsPaintOutput);
WRAP (ss, s, drawWindow, fobjectsDrawWindow);
- ss->timeoutHandle = compAddTimeout (fobjectsGetSnowUpdateDelay (s->display),
- stepSnowPositions, s);
+ ss->timeoutHandle = compAddTimeout (fobjectsGetObjectUpdateDelay (s->display),
+ stepObjectPositions, s);
return TRUE;
}
@@ -588,7 +588,7 @@ fobjectsDisplayOptionChanged (CompDisplay *d,
switch (num)
{
- case FobjectsDisplayOptionSnowSize:
+ case FobjectsDisplayOptionObjectSize:
{
CompScreen *s;
@@ -596,11 +596,11 @@ fobjectsDisplayOptionChanged (CompDisplay *d,
{
SNOW_SCREEN (s);
ss->displayListNeedsUpdate = TRUE;
- updateSnowTextures (s);
+ updateObjectTextures (s);
}
}
break;
- case FobjectsDisplayOptionSnowUpdateDelay:
+ case FobjectsDisplayOptionObjectUpdateDelay:
{
CompScreen *s;
@@ -611,18 +611,18 @@ fobjectsDisplayOptionChanged (CompDisplay *d,
if (ss->timeoutHandle)
compRemoveTimeout (ss->timeoutHandle);
ss->timeoutHandle =
- compAddTimeout (fobjectsGetSnowUpdateDelay (d),
- stepSnowPositions, s);
+ compAddTimeout (fobjectsGetObjectUpdateDelay (d),
+ stepObjectPositions, s);
}
}
break;
- case FobjectsDisplayOptionNumSnowflakes:
+ case FobjectsDisplayOptionNumObjects:
{
CompScreen *s;
int i, numObjects;
FObjectsObject *fobjectsObject;
- numObjects = fobjectsGetNumSnowflakes (d);
+ numObjects = fobjectsGetNumObjects (d);
for (s = d->screens; s; s = s->next)
{
SNOW_SCREEN (s);
@@ -633,24 +633,24 @@ fobjectsDisplayOptionChanged (CompDisplay *d,
for (i = 0; i < numObjects; i++)
{
initiateFObjectsObject (ss, fobjectsObject);
- setSnowflakeTexture (ss, fobjectsObject);
+ setObjectTexture (ss, fobjectsObject);
fobjectsObject++;
}
}
}
break;
- case FobjectsDisplayOptionSnowTextures:
+ case FobjectsDisplayOptionObjectTextures:
{
CompScreen *s;
CompOption *texOpt;
- texOpt = fobjectsGetSnowTexturesOption (d);
+ texOpt = fobjectsGetObjectTexturesOption (d);
sd->fobjectsTexFiles = texOpt->value.list.value;
sd->fobjectsTexNFiles = texOpt->value.list.nValue;
for (s = d->screens; s; s = s->next)
- updateSnowTextures (s);
+ updateObjectTextures (s);
}
break;
default:
@@ -680,12 +680,12 @@ fobjectsInitDisplay (CompPlugin *p,
}
fobjectsSetToggleKeyInitiate (d, fobjectsToggle);
- fobjectsSetNumSnowflakesNotify (d, fobjectsDisplayOptionChanged);
- fobjectsSetSnowSizeNotify (d, fobjectsDisplayOptionChanged);
- fobjectsSetSnowUpdateDelayNotify (d, fobjectsDisplayOptionChanged);
- fobjectsSetSnowTexturesNotify (d, fobjectsDisplayOptionChanged);
+ fobjectsSetNumObjectsNotify (d, fobjectsDisplayOptionChanged);
+ fobjectsSetObjectSizeNotify (d, fobjectsDisplayOptionChanged);
+ fobjectsSetObjectUpdateDelayNotify (d, fobjectsDisplayOptionChanged);
+ fobjectsSetObjectTexturesNotify (d, fobjectsDisplayOptionChanged);
- texOpt = fobjectsGetSnowTexturesOption (d);
+ texOpt = fobjectsGetObjectTexturesOption (d);
sd->fobjectsTexFiles = texOpt->value.list.value;
sd->fobjectsTexNFiles = texOpt->value.list.nValue;
diff --git a/fobjects.xml.in b/fobjects.xml.in
index 89113cf..935d83b 100644
--- a/fobjects.xml.in
+++ b/fobjects.xml.in
@@ -14,14 +14,14 @@
<display>
<group>
<_short>Settings</_short>
- <option name="num_snowflakes" type="int">
+ <option name="num_objects" type="int">
<_short>Number Of Snowflakes</_short>
<_long>Number of snowflakes</_long>
<default>1500</default>
<min>0</min>
<max>10000</max>
</option>
- <option name="snow_size" type="float">
+ <option name="object_size" type="float">
<_short>Size Of Snowflakes</_short>
<_long>Size of snowflakes</_long>
<default>10.0</default>
@@ -29,14 +29,14 @@
<max>50.0</max>
<precision>0.1</precision>
</option>
- <option name="snow_speed" type="int">
+ <option name="object_speed" type="int">
<_short>Snow Speed</_short>
<_long>Speed of falling snow</_long>
<default>85</default>
<min>1</min>
<max>100</max>
</option>
- <option name="snow_update_delay" type="int">
+ <option name="object_update_delay" type="int">
<_short>Update Delay</_short>
<_long>Delay (in ms) between screen updates. Decreasing this value may make snow fall more smoothly, but will also increase CPU usage.</_long>
<default>40</default>
@@ -57,17 +57,17 @@
<min>0</min>
<max>2000</max>
</option>
- <option name="snow_over_windows" type="bool">
+ <option name="object_over_windows" type="bool">
<_short>Snow Over Windows</_short>
<_long>Snow is drawn above windows</_long>
<default>false</default>
</option>
- <option name="snow_rotation" type="bool">
+ <option name="object_rotation" type="bool">
<_short>Rotate Flakes</_short>
<_long>Flakes rotate if checked.</_long>
<default>true</default>
</option>
- <option name="snow_direction" type="int">
+ <option name="object_direction" type="int">
<_short>Snow Direction</_short>
<_long>Select snow flake movement direction</_long>
<default>0</default>
@@ -93,7 +93,7 @@
</group>
<group>
<_short>Textures</_short>
- <option name="snow_textures" type="list">
+ <option name="object_textures" type="list">
<_short>Snow Textures</_short>
<_long>Snow textures</_long>
<hints>file;image;</hints>