summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam <Sam@XPS-SUSE.XPS>2008-05-22 19:12:40 +0800
committerSam <Sam@XPS-SUSE.XPS>2008-05-22 19:12:40 +0800
commit615b500bb4b9a48cd20d82392be62808a8b577a8 (patch)
treef2a4f28dc59db86a4d4da88549c1031fa41dce76
parentbc6205ccdc222a677431d787ab73edec79f947ea (diff)
downloadfloatingobjects-master.tar.gz
floatingobjects-master.tar.bz2
* Split structs into fobjects-internal.hHEADmaster
-rw-r--r--fobjects-internal.h74
-rw-r--r--fobjects.c77
2 files changed, 76 insertions, 75 deletions
diff --git a/fobjects-internal.h b/fobjects-internal.h
new file mode 100644
index 0000000..8eeab7d
--- /dev/null
+++ b/fobjects-internal.h
@@ -0,0 +1,74 @@
+#include <math.h>
+
+#include <compiz-core.h>
+#include "fobjects_options.h"
+
+#define GET_SNOW_DISPLAY(d) \
+ ((FObjectsDisplay *) (d)->base.privates[displayPrivateIndex].ptr)
+
+#define SNOW_DISPLAY(d) \
+ FObjectsDisplay *sd = GET_SNOW_DISPLAY (d)
+
+#define GET_SNOW_SCREEN(s, sd) \
+ ((FObjectsScreen *) (s)->base.privates[(sd)->screenPrivateIndex].ptr)
+
+#define SNOW_SCREEN(s) \
+ FObjectsScreen *ss = GET_SNOW_SCREEN (s, GET_SNOW_DISPLAY (s->display))
+
+static int displayPrivateIndex = 0;
+
+/* ------------------- STRUCTS ----------------------------- */
+typedef struct _FObjectsDisplay
+{
+ int screenPrivateIndex;
+
+ Bool useTextures;
+
+ int fobjectsTexNFiles;
+ CompOptionValue *fobjectsTexFiles;
+} FObjectsDisplay;
+
+typedef struct _FObjectsTexture
+{
+ CompTexture tex;
+
+ unsigned int width;
+ unsigned int height;
+
+ Bool loaded;
+ GLuint dList;
+} FObjectsTexture;
+
+typedef struct _FObjectsObject
+{
+ float x, y, z;
+ float xs, ys, zs;
+ float ra; /* rotation angle */
+ float rs; /* rotation speed */
+
+ FObjectsTexture *tex;
+} FObjectsObject;
+
+typedef struct _FObjectsScreen
+{
+ CompScreen *s;
+
+ Bool active;
+
+ CompTimeoutHandle timeoutHandle;
+
+ PaintOutputProc paintOutput;
+ DrawWindowProc drawWindow;
+
+ FObjectsTexture *fobjectsTex;
+ int fobjectsTexturesLoaded;
+
+ GLuint displayList;
+ Bool displayListNeedsUpdate;
+
+ FObjectsObject *allObjects;
+} FObjectsScreen;
+
+/* some forward declarations */
+static void initiateFObjectsObject (FObjectsScreen * ss, FObjectsObject * sf);
+static void fobjectsMove (CompDisplay *d, FObjectsObject * sf);
diff --git a/fobjects.c b/fobjects.c
index acd8bac..793b636 100644
--- a/fobjects.c
+++ b/fobjects.c
@@ -32,81 +32,8 @@
* movement profiles (I'll have to write some documentation and/or find
* a parser) and the third is a set of options that moves an object based on
* what the parser finds */
-
-#include <math.h>
-
-#include <compiz-core.h>
-#include "fobjects_options.h"
-
-#define GET_SNOW_DISPLAY(d) \
- ((FObjectsDisplay *) (d)->base.privates[displayPrivateIndex].ptr)
-
-#define SNOW_DISPLAY(d) \
- FObjectsDisplay *sd = GET_SNOW_DISPLAY (d)
-
-#define GET_SNOW_SCREEN(s, sd) \
- ((FObjectsScreen *) (s)->base.privates[(sd)->screenPrivateIndex].ptr)
-
-#define SNOW_SCREEN(s) \
- FObjectsScreen *ss = GET_SNOW_SCREEN (s, GET_SNOW_DISPLAY (s->display))
-
-static int displayPrivateIndex = 0;
-
-/* ------------------- STRUCTS ----------------------------- */
-typedef struct _FObjectsDisplay
-{
- int screenPrivateIndex;
-
- Bool useTextures;
-
- int fobjectsTexNFiles;
- CompOptionValue *fobjectsTexFiles;
-} FObjectsDisplay;
-
-typedef struct _FObjectsTexture
-{
- CompTexture tex;
-
- unsigned int width;
- unsigned int height;
-
- Bool loaded;
- GLuint dList;
-} FObjectsTexture;
-
-typedef struct _FObjectsObject
-{
- float x, y, z;
- float xs, ys, zs;
- float ra; /* rotation angle */
- float rs; /* rotation speed */
-
- FObjectsTexture *tex;
-} FObjectsObject;
-
-typedef struct _FObjectsScreen
-{
- CompScreen *s;
-
- Bool active;
-
- CompTimeoutHandle timeoutHandle;
-
- PaintOutputProc paintOutput;
- DrawWindowProc drawWindow;
-
- FObjectsTexture *fobjectsTex;
- int fobjectsTexturesLoaded;
-
- GLuint displayList;
- Bool displayListNeedsUpdate;
-
- FObjectsObject *allObjects;
-} FObjectsScreen;
-
-/* some forward declarations */
-static void initiateFObjectsObject (FObjectsScreen * ss, FObjectsObject * sf);
-static void fobjectsMove (CompDisplay *d, FObjectsObject * sf);
+
+#include "fobjects-internal.h"
static void
fobjectsThink (FObjectsScreen *ss,