[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

compiz-fusion-plugins-unsupported: Changes to 'upstream-unstable'



 CMakeLists.txt                     |    4 
 Makefile.am                        |   13 
 VERSION                            |    2 
 cmake/CompizFusion.cmake           |   30 
 cmake/addons.cmake                 |    3 
 compiz-elements.pc.in              |   12 
 configure.ac                       |    7 
 images/autumn1.png                 |binary
 images/autumn2.png                 |binary
 images/bubbles1.png                |binary
 images/bubbles2.png                |binary
 images/fireflies1.svg              |   75 
 images/fireflies2.svg              |   75 
 images/plugin-elements.png         |binary
 images/snow1.png                   |binary
 images/snow2.png                   |binary
 images/stars1.png                  |binary
 include/Makefile.am                |    4 
 include/compiz-elements.h          |  147 
 metadata/Makefile.am               |    6 
 metadata/atlantis.xml.in           |  348 +-
 metadata/cubemodel.xml.in          |  196 +
 metadata/elements.xml.in           |  306 ++
 po/LINGUAS                         |    6 
 po/POTFILES.in                     |    1 
 po/ar.po                           | 1789 ++++++++----
 po/bn.po                           | 1716 ++++++++---
 po/ca.po                           | 1953 +++++++++----
 po/cs.po                           | 5240 +++++++++++++++++++++++++++++++++++
 po/de.po                           | 2096 +++++++++-----
 po/el.po                           | 2429 ++++++++++------
 po/en_GB.po                        | 2058 +++++++++----
 po/es.po                           | 2974 ++++++++++++-------
 po/eu.po                           | 3083 +++++++++++++-------
 po/fa.po                           | 1517 +++++++---
 po/fi.po                           | 3014 +++++++++++++-------
 po/fr.po                           | 2131 +++++++++-----
 po/gl.po                           | 2375 ++++++++++-----
 po/gu.po                           | 1979 +++++++++----
 po/he.po                           | 5509 +++++++++++++++++++++++++++++++++++++
 po/hi.po                           | 1976 +++++++++----
 po/hu.po                           | 1959 +++++++++----
 po/it.po                           | 2103 +++++++++-----
 po/ja.po                           | 1943 ++++++++-----
 po/ko.po                           | 2216 +++++++++-----
 po/nb.po                           | 1974 +++++++++----
 po/nl.po                           | 1991 +++++++++----
 po/pl.po                           | 3096 ++++++++++++--------
 po/pt.po                           | 2164 ++++++--------
 po/pt_BR.po                        | 2016 +++++++++----
 po/ru.po                           | 2423 ++++++++++------
 po/sv.po                           | 2263 ++++++++++-----
 po/tr.po                           | 1930 +++++++++---
 po/zh_CN.po                        | 4292 ++++++++++++++++------------
 src/Makefile.am                    |    2 
 src/atlantis/Makefile.am           |   48 
 src/atlantis/atlantis-internal.h   |  396 ++
 src/atlantis/atlantis.c            |  919 ++++--
 src/atlantis/bfish.c               |  226 +
 src/atlantis/bfish.h               |  536 +++
 src/atlantis/bubble.c              |   74 
 src/atlantis/chromis.c             |  200 +
 src/atlantis/chromis.h             |  293 +
 src/atlantis/coral.c               |   75 
 src/atlantis/coral.h               | 4559 ++++++++++++++++++++++++++++++
 src/atlantis/coral2.c              |   75 
 src/atlantis/coral2.h              | 5305 +++++++++++++++++++++++++++++++++++
 src/atlantis/coral2_low.h          |  306 ++
 src/atlantis/coral_low.h           |  431 ++
 src/atlantis/crab.c                |   63 
 src/atlantis/crab.h                |  283 +
 src/atlantis/dolphin.c             | 2122 --------------
 src/atlantis/dolphin.h             | 1847 ++++++++++++
 src/atlantis/fish.c                |  314 ++
 src/atlantis/fish.h                | 1750 +++++++++++
 src/atlantis/fish2.c               |  230 +
 src/atlantis/fish2.h               | 1293 ++++++++
 src/atlantis/float.c               |  110 
 src/atlantis/scuttle.c             |  144 
 src/atlantis/shark.c               | 1485 +--------
 src/atlantis/shark.h               | 1159 +++++++
 src/atlantis/swim.c                |  550 ++-
 src/atlantis/util.c                |  243 +
 src/atlantis/water.c               | 1184 ++++++-
 src/atlantis/whale.c               | 1948 -------------
 src/atlantis/whale.h               | 1674 +++++++++++
 src/cubemodel/CMakeLists.txt       |    3 
 src/cubemodel/Makefile.am          |   35 
 src/cubemodel/cubemodel-internal.h |  246 +
 src/cubemodel/cubemodel.c          |  768 +++++
 src/cubemodel/fileParser.c         |  524 +++
 src/cubemodel/loadModel.c          | 1826 ++++++++++++
 src/elements/CMakeLists.txt        |    3 
 src/elements/Makefile.am           |   38 
 src/elements/autumn.c              |   91 
 src/elements/bubbles.c             |   78 
 src/elements/elements-internal.h   |  157 +
 src/elements/elements.c            | 1786 +++++++++++
 src/elements/fireflies.c           |   98 
 src/elements/snow.c                |   61 
 src/elements/stars.c               |   57 
 src/fakeargb/Makefile.am           |    9 
 src/mswitch/Makefile.am            |    9 
 src/snow/Makefile.am               |    9 
 src/snow/snow.c                    |    8 
 src/tile/Makefile.am               |    9 
 106 files changed, 82292 insertions(+), 26811 deletions(-)

New commits:
commit 16d22a791c668e4b8475af3d9ac0dbae3977e8b0
Author: Guillaume Seguin <guillaume@segu.in>
Date:   Mon Mar 9 15:44:05 2009 +0100

    * Bump version to 0.8.2

diff --git a/VERSION b/VERSION
index 1357b31..2dcc312 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-VERSION=0.7.9
+VERSION=0.8.2

commit a6e34d6347e59236b393213322f1423f4614064b
Author: Guillaume Seguin <guillaume@segu.in>
Date:   Fri Mar 6 03:19:21 2009 +0100

    Fix .pc files tarball inclusion

diff --git a/cmake/addons.cmake b/cmake/addons.cmake
index 4590610..b5b2efb 100644
--- a/cmake/addons.cmake
+++ b/cmake/addons.cmake
@@ -144,7 +144,7 @@ macro (cf_add_package_generation description)
     list (APPEND CPACK_SOURCE_IGNORE_FILES "/autom4te.cache")
     list (APPEND CPACK_SOURCE_IGNORE_FILES "/aclocal.m4")
     list (APPEND CPACK_SOURCE_IGNORE_FILES "/autogen.sh")
-    list (APPEND CPACK_SOURCE_IGNORE_FILES "/*.pc")
+    list (APPEND CPACK_SOURCE_IGNORE_FILES "/\\\\*.pc")
     list (APPEND CPACK_SOURCE_IGNORE_FILES "/config*")
     list (APPEND CPACK_SOURCE_IGNORE_FILES "/depcomp")
     list (APPEND CPACK_SOURCE_IGNORE_FILES "/install-sh")
@@ -168,4 +168,4 @@ macro (cf_add_package_generation description)
     include(CPack)
 
     file (REMOVE "${CMAKE_BINARY_DIR}/CPackConfig.cmake")
-endmacro (cf_add_package_generation)
\ No newline at end of file
+endmacro (cf_add_package_generation)

commit 5ea4a5f95e23f1c85c2cb9b6d253eba00516f7bb
Author: Guillaume Seguin <guillaume@segu.in>
Date:   Fri Mar 6 03:19:07 2009 +0100

    Remove more fusion

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8fb7e0d..f4c41b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,4 +24,4 @@ cf_install_plugin_data_files (images)
 cf_install_plugin_data_files (data)
 cf_print_plugin_configure_results (src)
 
-cf_add_package_generation ("Compiz Fusion Plugins Unsupported")
+cf_add_package_generation ("Compiz Plugins Unsupported")

commit 1a2c38655abd5882cab14bce2c48a89e24bac871
Author: Guillaume Seguin <guillaume@segu.in>
Date:   Thu Mar 5 05:06:06 2009 +0100

    Fix POTFILES.in

diff --git a/po/POTFILES.in b/po/POTFILES.in
index 1021063..94c916d 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,4 +1,5 @@
 metadata/atlantis.xml.in
+metadata/elements.xml.in
 metadata/fakeargb.xml.in
 metadata/mswitch.xml.in
 metadata/snow.xml.in

commit 11e1ea2b26d35b23f7cfaa6cc0027336a70cd009
Author: Guillaume Seguin <guillaume@segu.in>
Date:   Thu Mar 5 04:04:17 2009 +0100

    Drop -fusion- bits

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 725d81c..8fb7e0d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-project (compiz-fusion-plugins-unsupported)
+project (compiz-plugins-unsupported)
 
 cmake_minimum_required (VERSION 2.4)
 
diff --git a/configure.ac b/configure.ac
index cf35efe..d61cb14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ(2.57)
 
 m4_define([plugins_unsupported_version], [esyscmd(. ./VERSION;echo -n $VERSION)])
 
-AC_INIT([compiz-fusion-plugins-unsupported], [plugins_unsupported_version], [maniac@opencompositing.org])
+AC_INIT([compiz-plugins-unsupported], [plugins_unsupported_version], [maniac@opencompositing.org])
 
 #AC_CONFIG_AUX_DIR(config)
 
@@ -19,7 +19,7 @@ AC_CHECK_HEADERS([stdlib.h sys/time.h unistd.h])
 IT_PROG_INTLTOOL([0.35.0])
 AC_SUBST(ALL_LINGUAS)
 AM_GLIB_GNU_GETTEXT
-GETTEXT_PACKAGE=compiz-fusion-plugins-unsupported
+GETTEXT_PACKAGE=compiz-plugins-unsupported
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
 AC_SUBST(GETTEXT_PACKAGE)
 

commit b134e7930ce4cb42a7510c5614985eeebc3eb1bb
Author: Sam Spilsbury <Sam@XPS-SUSE.site>
Date:   Tue Feb 17 23:50:20 2009 +0100

    Merge branch 'master' of ../elements-extendable
    
    Sam Spilsbury
    Sam@XPS-SUSE.site
    Sam Spilsbury
    Sam@XPS-SUSE.site
    Remove the setupbuild file, it was only for personal use
    
    Danny Baumann
    dannybaumann@web.de
    Danny Baumann
    dannybaumann@web.de
    Added CMake build file.
    
    Danny Baumann
    dannybaumann@web.de
    Danny Baumann
    dannybaumann@web.de
    Build fix.
    
    Danny Baumann
    dannybaumann@web.de
    Danny Baumann
    dannybaumann@web.de
    Adapt for text plugin interface changes.
    
    Danny Baumann
    dannybaumann@web.de
    Danny Baumann
    dannybaumann@web.de
    Header file cleanup.

diff --git a/include/compiz-elements.h b/include/compiz-elements.h
index 831bcc2..3099f40 100644
--- a/include/compiz-elements.h
+++ b/include/compiz-elements.h
@@ -4,7 +4,11 @@
 
 #include <compiz-core.h>
 
-#define BIG_NUMBER		20000			/* This is the number used to make sure that elements don't get all created in one place. 									Bigger number, more distance. Possibly fixable later.*/ /*s->width?*/
+/* This is the number used to make sure that elements don't get all
+   created in one place. Bigger number, more distance.
+   Possibly fixable later. -> s->width? */
+#define BIG_NUMBER		20000
+
 #define ELEMENTS_ABIVERSION     20081215
 
 typedef struct _ElementTypeInfo  ElementTypeInfo;
@@ -15,10 +19,10 @@ typedef struct _ElementTexture   ElementTexture;
 typedef void (*ElementInitiateProc) (CompScreen *s,
 				     Element    *e);
 
-typedef void (*ElementMoveProc) (CompScreen *s,
+typedef void (*ElementMoveProc) (CompScreen       *s,
 				 ElementAnimation *anim,
-				 Element     *e,
-				 int         updateDelay);
+				 Element          *e,
+				 int              updateDelay);
 
 typedef void (*ElementFiniProc) (CompScreen *s,
 				 Element    *e);
@@ -35,84 +39,98 @@ typedef void (*ElementFiniProc) (CompScreen *s,
 
 typedef struct _ElementsBaseFunctions
 {
-    Bool (*newElementType) (CompDisplay *d,
-			    char *name,
-			    char *desc,
+    Bool (*newElementType) (CompDisplay         *d,
+			    char                *name,
+			    char                *desc,
 			    ElementInitiateProc initiate,
 			    ElementMoveProc	move,
 			    ElementFiniProc     fini);
 
     void (*removeElementType) (CompScreen *s,
-			       char *name);
+			       char       *name);
+
     int (*getRand) (int min, int max);
     float (*mmRand) (int min, int max, float divisor);
+
     int (*boxing) (CompScreen *s);
     int (*depth) (CompScreen *s);
 } ElementsBaseFunctions;
 
 struct _ElementTypeInfo
 {
-	char *name;
-	char *desc;
-	ElementInitiateProc initiate;
-	ElementMoveProc     move;
-	ElementFiniProc     fini;
-	struct _ElementTypeInfo *next;
+    char *name;
+    char *desc;
+
+    ElementInitiateProc initiate;
+    ElementMoveProc     move;
+    ElementFiniProc     fini;
+
+    struct _ElementTypeInfo *next;
 };
 
 struct _ElementTexture
 {
-	CompTexture tex;
-	unsigned int width;
-	unsigned int height;
-	Bool loaded;
-	GLuint dList;		
+    CompTexture tex;
+
+    unsigned int width;
+    unsigned int height;
+
+    Bool   loaded;
+    GLuint dList;		
 };
 
 struct _Element
 {
-	char* type;				//Follows the usual pattern, alphabetic except for bubbles, which is 4.
-	float x, y, z;
-	float dx, dy, dz;
-	float rSpeed;
-	int rDirection;
-	int rAngle;
-	float opacity;
-	float glowAlpha;			// Needs to be painted
-	int nTexture;
-	void	  *ptr; // Extensions latch on to this
+    char *type;		/* Follows the usual pattern, alphabetic
+			   except for bubbles, which is 4. */
+    float x, y, z;
+    float dx, dy, dz;
+    float rSpeed;
+    int   rDirection;
+    int   rAngle;
+
+    float opacity;
+    float glowAlpha;	/* Needs to be painted */
+    int   nTexture;
+
+    void *ptr;		/* Extensions latch on to this */
 };
 
 struct _ElementAnimation
 {
-	char* type;
-	char* desc;
-	int nElement;
-	int size;
-	int speed;
-	int id; // Uniquely idenitifies this animation
-	Bool active;
-	ElementTexture *texture;
-	int nTextures;
-	Element *elements;
-	ElementTypeInfo *properties;
-	struct _ElementAnimation *next;
+    char *type;
+    char *desc;
+
+    int nElement;
+    int size;
+    int speed;
+    int id;		/* Uniquely idenitifies this animation */
+
+    Bool active;
+
+    ElementTexture *texture;
+    int            nTextures;
+
+    Element         *elements;
+    ElementTypeInfo *properties;
+
+    struct _ElementAnimation *next;
 };	
 
 /* Resets an animation to defaults */
-void initiateElement (CompScreen *s,
+void initiateElement (CompScreen       *s,
 		      ElementAnimation *anim,
-		      Element *ele);
+		      Element          *ele);
 
 /* Calls the movement function pointer for an element in an element animation */
-void elementMove (CompScreen *s,
-		  Element *e,
+void elementMove (CompScreen       *s,
+		  Element          *e,
 		  ElementAnimation *anim,
-		  int updateDelay);
+		  int              updateDelay);
 
 /* Used to update all element textures and settings */
 void updateElementTextures (CompScreen *s,
-			    Bool changeTextures);
+			    Bool       changeTextures);
 
 /* Utility Functions */
 int elementsGetRand (int min, int max);
@@ -122,8 +140,8 @@ int elementsGetEDepth (CompScreen *s);
 
 /* Management of ElementAnimations */
 ElementAnimation* elementsCreateAnimation (CompScreen *s,
-					   char *name);
-void elementsDeleteAnimation (CompScreen *s,
+					   char       *name);
+void elementsDeleteAnimation (CompScreen       *s,
 			      ElementAnimation *anim);
 
 #endif
diff --git a/src/elements/elements-internal.h b/src/elements/elements-internal.h
index 9d017cb..f5b9be6 100644
--- a/src/elements/elements-internal.h
+++ b/src/elements/elements-internal.h
@@ -1,17 +1,19 @@
 #include "compiz-elements.h"
 #include "elements_options.h"
+#include <compiz-text.h>
 
 #define GET_ELEMENTS_DISPLAY(d)                            \
-	((ElementsDisplay *) (d)->base.privates[displayPrivateIndex].ptr)
+    ((ElementsDisplay *) (d)->base.privates[displayPrivateIndex].ptr)
 
 #define ELEMENTS_DISPLAY(d)                                \
-	ElementsDisplay *ed = GET_ELEMENTS_DISPLAY (d)
+    ElementsDisplay *ed = GET_ELEMENTS_DISPLAY (d)
 
 #define GET_ELEMENTS_SCREEN(s, ed)                         \
-	((ElementsScreen *) (s)->base.privates[(ed)->privateIndex].ptr)
+    ((ElementsScreen *) (s)->base.privates[(ed)->screenPrivateIndex].ptr)
 
 #define ELEMENTS_SCREEN(s)                                 \
-	ElementsScreen *es = GET_ELEMENTS_SCREEN (s, GET_ELEMENTS_DISPLAY (s->display))
+    ElementsScreen *es = GET_ELEMENTS_SCREEN (s,           \
+			 GET_ELEMENTS_DISPLAY (s->display))
 
 #define GLOW_STAGES		5
 #define MAX_AUTUMN_AGE		100
@@ -20,54 +22,60 @@ extern int displayPrivateIndex;
 
 typedef struct _ElementsDisplay
 {
-	int privateIndex;
-	Bool textAvailable;
-	ElementTypeInfo *elementTypes;
+    int screenPrivateIndex;
+
+    TextFunc *textFunc;
+
+    ElementTypeInfo *elementTypes;
 } ElementsDisplay;
 
 typedef struct _ElementsScreen
 {
-	CompTimeoutHandle timeoutHandle;
-	PaintOutputProc paintOutput;
-	DrawWindowProc  drawWindow;
-	/* text display support */
-	CompTexture textTexture;
-	Pixmap      textPixmap;
-	int         textWidth;
-	int         textHeight;
-	Bool        renderText;
-	/* Information texture rendering */
-	ElementTexture *eTexture;
-	int            ntTextures;
-	int	       nTexture;
-	Bool	    renderTexture;
-	CompTimeoutHandle renderTimeout;
-	CompTimeoutHandle switchTimeout;
-	/* position in list */
-	int listIter;
-	/* animation number according to user set option */
-	int animIter;
-	GLuint displayList;
-	Bool   needUpdate;
-	ElementAnimation *animations;
+    PaintOutputProc paintOutput;
+    DrawWindowProc  drawWindow;
+
+    CompTimeoutHandle timeoutHandle;
+
+    /* text display support */
+    CompTextData *textData;
+    Bool         renderText;
+
+    /* Information texture rendering */
+    ElementTexture    *eTexture;
+    int               ntTextures;
+    int	              nTexture;
+    Bool	      renderTexture;
+    CompTimeoutHandle renderTimeout;
+    CompTimeoutHandle switchTimeout;
+
+    /* position in list */
+    int listIter;
+
+    /* animation number according to user set option */
+    int animIter;
+
+    GLuint displayList;
+    Bool   needUpdate;
+
+    ElementAnimation *animations;
 } ElementsScreen;
 
 /* autumn.c */
 typedef struct _AutumnElement
 {
-	float autumnFloat[2][MAX_AUTUMN_AGE];
-	int   autumnAge[2];
-	int   autumnChange;
+    float autumnFloat[2][MAX_AUTUMN_AGE];
+    int   autumnAge[2];
+    int   autumnChange;
 } AutumnElement;
 
 void
 initiateAutumnElement (CompScreen *s,
-		       Element *e);
+		       Element    *e);
 void
-autumnMove (CompScreen *s,
+autumnMove (CompScreen       *s,
 	    ElementAnimation *anim,
-	    Element *e,
-	    int     updateDelay);
+	    Element          *e,
+	    int              updateDelay);
 
 void
 autumnFini (CompScreen *s,
@@ -76,21 +84,21 @@ autumnFini (CompScreen *s,
 /* fireflies.c */
 typedef struct _FireflyElement
 {
-	float lifespan;
-	float age;
-	float lifecycle;
-	float dx[4], dy[4], dz[4];
+    float lifespan;
+    float age;
+    float lifecycle;
+    float dx[4], dy[4], dz[4];
 } FireflyElement;
 
 void
 initiateFireflyElement (CompScreen *s,
-		       Element *e);
+		       Element     *e);
 
 void
-fireflyMove (CompScreen *s,
+fireflyMove (CompScreen      *s,
 	    ElementAnimation *anim,
-	    Element *e,
-	    int     updateDelay);
+	    Element          *e,
+	    int              updateDelay);
 
 void
 fireflyFini (CompScreen *s,
@@ -99,13 +107,13 @@ fireflyFini (CompScreen *s,
 /* snow.c */
 void
 initiateSnowElement (CompScreen *s,
-		     Element *e);
+		     Element    *e);
 
 void
-snowMove   (CompScreen *s,
-	    ElementAnimation *anim,
-	    Element *e,
-	    int     updateDelay);
+snowMove (CompScreen       *s,
+	  ElementAnimation *anim,
+	  Element          *e,
+	  int              updateDelay);
 
 void
 snowFini (CompScreen *s,
@@ -114,13 +122,13 @@ snowFini (CompScreen *s,
 /* stars.c */
 void
 initiateStarElement (CompScreen *s,
-		     Element *e);
+		     Element    *e);
 
 void
-starMove   (CompScreen *s,
-	    ElementAnimation *anim,
-	    Element *e,
-	    int     updateDelay);
+starMove (CompScreen       *s,
+	  ElementAnimation *anim,
+	  Element          *e,
+	  int              updateDelay);
 
 void
 starFini (CompScreen *s,
@@ -129,21 +137,21 @@ starFini (CompScreen *s,
 /* bubbles.c */
 typedef struct _BubbleElement
 {
-	float bubbleFloat[2][MAX_AUTUMN_AGE];
-	int   bubbleAge[2];
-	int   bubbleChange;
+    float bubbleFloat[2][MAX_AUTUMN_AGE];
+    int   bubbleAge[2];
+    int   bubbleChange;
 } BubbleElement;
 
 void
 initiateBubbleElement (CompScreen *s,
-		       Element *e);
+		       Element    *e);
 
 void
-bubbleMove (CompScreen *s,
+bubbleMove (CompScreen       *s,
 	    ElementAnimation *anim,
-	    Element *e,
-	    int     updateDelay);
+	    Element          *e,
+	    int              updateDelay);
 
 void
 bubbleFini (CompScreen *s,
-	    Element *e);
+	    Element    *e);
diff --git a/src/elements/elements.c b/src/elements/elements.c
index 57355a8..7cf402c 100644
--- a/src/elements/elements.c
+++ b/src/elements/elements.c
@@ -45,7 +45,6 @@
  **/
 
 #include <compiz-core.h>
-#include <compiz-text.h>
 #include <string.h>
 #include <math.h>
 #include "elements-internal.h"
@@ -161,14 +160,14 @@ static void
 elementsFreeTitle (CompScreen *s)
 {
     ELEMENTS_SCREEN (s);
+    ELEMENTS_DISPLAY (s->display);
 
-    if (!es->textPixmap)
+    if (!es->textData)
 	return;
 
-    releasePixmapFromTexture (s, &es->textTexture);
-    initTexture (s, &es->textTexture);
-    XFreePixmap (s->display->display, es->textPixmap);
-    es->textPixmap = None;
+    (ed->textFunc->finiTextData) (s, es->textData);
+    es->textData = NULL;
+
     damageScreen (s);
 }
 
@@ -177,11 +176,10 @@ elementsRenderTitle (CompScreen *s,
 		     char       *stringData)
 {
     CompTextAttrib tA;
-    int            stride;
-    void           *data;
     int            ox1, ox2, oy1, oy2;
 
     ELEMENTS_SCREEN (s);
+    ELEMENTS_DISPLAY (s->display);
 
     elementsFreeTitle (s);
 
@@ -190,43 +188,24 @@ elementsRenderTitle (CompScreen *s,
     /* 75% of the output device es maximum width */
     tA.maxWidth = (ox2 - ox1) * 3 / 4;
     tA.maxHeight = 100;
-    tA.screen = s;
+
+    tA.family = "Sans";
     tA.size = elementsGetTitleFontSize (s);
     tA.color[0] = elementsGetTitleFontColorRed (s);
     tA.color[1] = elementsGetTitleFontColorGreen (s);
     tA.color[2] = elementsGetTitleFontColorBlue (s);
     tA.color[3] = elementsGetTitleFontColorAlpha (s);
 
-    tA.style = TEXT_STYLE_NORMAL | TEXT_STYLE_BACKGROUND;
-    tA.backgroundHMargin = 10.0f;
-    tA.backgroundVMargin = 10.0f;
-    tA.backgroundColor[0] = elementsGetTitleBackColorRed (s);
-    tA.backgroundColor[1] = elementsGetTitleBackColorGreen (s);
-    tA.backgroundColor[2] = elementsGetTitleBackColorBlue (s);
-    tA.backgroundColor[3] = elementsGetTitleBackColorAlpha (s);
-    tA.family = "Sans";
-    tA.ellipsize = FALSE;
-
-    tA.renderMode = TextRenderNormal;
+    tA.flags = CompTextFlagWithBackground | CompTextFlagEllipsized;
 
-    tA.data = (void *) stringData;
+    tA.bgHMargin = 10.0f;
+    tA.bgVMargin = 10.0f;
+    tA.bgColor[0] = elementsGetTitleBackColorRed (s);
+    tA.bgColor[1] = elementsGetTitleBackColorGreen (s);
+    tA.bgColor[2] = elementsGetTitleBackColorBlue (s);
+    tA.bgColor[3] = elementsGetTitleBackColorAlpha (s);
 
-    initTexture (s, &es->textTexture);
-
-    if ((*s->display->fileToImage) (s->display, TEXT_ID, (char *)&tA,
-			 	    &es->textWidth, &es->textHeight,
-				    &stride, &data))
-    {
-	es->textPixmap = (Pixmap)data;
-	bindPixmapToTexture (s, &es->textTexture, es->textPixmap,
-			     es->textWidth, es->textHeight, 32);
-    }
-    else 
-    {
-	es->textPixmap = None;
-	es->textWidth  = 0;
-	es->textHeight = 0;
-    }
+    es->textData = (ed->textFunc->renderText) (s, stringData, &tA);
 }
 
 /* Taken from ring.c */
@@ -242,8 +221,8 @@ elementsDrawTitle (CompScreen *s)
 
     ELEMENTS_SCREEN(s);
 
-    width  = es->textWidth;
-    height = es->textHeight;
+    width  = es->textData->width;
+    height = es->textData->height;
 
     getCurrentOutputExtents (s, &ox1, &oy1, &ox2, &oy2);
 
@@ -260,9 +239,9 @@ elementsDrawTitle (CompScreen *s)
 
     glColor4f(1.0f, 1.0f, 1.0f, 0.7f);
 
-    enableTexture (s, &es->textTexture, COMP_TEXTURE_FILTER_GOOD);
+    enableTexture (s, es->textData->texture, COMP_TEXTURE_FILTER_GOOD);
 
-    m = &es->textTexture.matrix;
+    m = &es->textData->texture->matrix;
 
     if (es->renderTexture && es->eTexture)
     {
@@ -296,7 +275,7 @@ elementsDrawTitle (CompScreen *s)
 
 	glEnd ();
     }
-    disableTexture (s, &es->textTexture);
+    disableTexture (s, es->textData->texture);
 
     if (es->renderTexture && es->eTexture)
     {
@@ -311,7 +290,7 @@ elementsDrawTitle (CompScreen *s)
 		   (float) elementsGetTitleBackColorBlue (s) / OPAQUE,
 		   (float) elementsGetTitleBackColorAlpha (s) / OPAQUE);
 
-	glTranslatef (x + es->textWidth - width,
+	glTranslatef (x + es->textData->width - width,
 		      y - height + (border / 2),
 		      0.0f);
 	glRectf (0.0f, height, width, 0.0f);
@@ -947,7 +926,7 @@ elementsNextElement (CompDisplay     *d,
 	    es->animIter = lowest;
 	}
 
-	if (ed->textAvailable && cType->nValue > 0)
+	if (ed->textFunc && cType->nValue > 0)
 	{
 	    for (info = ed->elementTypes; info; info = info->next)
 	    {
@@ -960,16 +939,21 @@ elementsNextElement (CompDisplay     *d,
 
 	    if (string)
 	    {
+		int height;
+
 		elementsRenderTitle (s, string);
+
+		height = es->textData ? es->textData->height : 0;
+
 		es->renderText    = TRUE;
 		es->renderTexture =
 		    createTemporaryTexture (s, cPath, cIter,
-					    es->animIter, es->textHeight);
+					    es->animIter, height);
 		addDisplayTimeouts (s, es->ntTextures > 1);
 		damageScreen (s);
 	    }
 	}
-	else if (ed->textAvailable)
+	else if (ed->textFunc)
 	{
 	    elementsRenderTitle (s, "No elements have been defined");
 	    es->renderText = TRUE;
@@ -1044,7 +1028,7 @@ elementsPrevElement (CompDisplay     *d,
 	    es->listIter = i;
 	}
 
-	if (ed->textAvailable && cType->nValue > 0)
+	if (ed->textFunc && cType->nValue > 0)
 	{
 	    for (info = ed->elementTypes; info; info = info->next)
 	    {
@@ -1057,17 +1041,22 @@ elementsPrevElement (CompDisplay     *d,
 
 	    if (string)
 	    {
+		int height;
+
 		elementsRenderTitle (s, string);
+
+		height = es->textData ? es->textData->height : 0;
+
 		es->renderText    = TRUE;
 		es->renderTexture =
 		    createTemporaryTexture (s, cPath, cIter,
-					    es->animIter, es->textHeight);
+					    es->animIter, height);
 		addDisplayTimeouts (s, es->ntTextures > 1);
 		damageScreen (s);
 		
 	    }
 	}
-	else if (ed->textAvailable)
+	else if (ed->textFunc)
 	{
 	    elementsRenderTitle (s, "No elements have been defined");
 	    es->renderText = TRUE;
@@ -1122,7 +1111,7 @@ elementsToggleSelected (CompDisplay     *d,
 
 	if (cType->nValue < 1)
 	{
-	    if (ed->textAvailable)
+	    if (ed->textFunc)
 	    {
 		elementsRenderTitle (s, "No elements have been defined\n");
 		es->renderText = TRUE;
@@ -1149,7 +1138,7 @@ elementsToggleSelected (CompDisplay     *d,
 					      es->animIter);
 	}
 	
-	if (ed->textAvailable && elementsGetTitleOnToggle (s) && success)
+	if (ed->textFunc && elementsGetTitleOnToggle (s) && success)
 	{
 	    for (info = ed->elementTypes; info; info = info->next)
 	    {
@@ -1162,17 +1151,22 @@ elementsToggleSelected (CompDisplay     *d,
 
 	    if (string)
 	    {
+		int height;
+
 		elementsRenderTitle (s, string);
+
+		height = es->textData ? es->textData->height : 0;
+
 		es->renderText    = TRUE;
 		es->renderTexture =
 		    createTemporaryTexture (s, cPath, cIter,
-					    es->animIter, es->textHeight);
+					    es->animIter, height);
 		addDisplayTimeouts (s, es->ntTextures > 1);
 		damageScreen (s);
 		
 	    }
 	}
-	else if (ed->textAvailable && elementsGetTitleOnToggle (s) && anim)
+	else if (ed->textFunc && elementsGetTitleOnToggle (s) && anim)
 	{
 	    elementsRenderTitle (s, "Error - Element image was not found"
 				    " or is invalid");
@@ -1563,9 +1557,7 @@ elementsInitScreen (CompPlugin *p,
     es->needUpdate    = FALSE;
     es->listIter      = 0;
     es->animations    = NULL;
-    es->textPixmap    = None;
-    es->textWidth     = 0;
-    es->textHeight    = 0;
+    es->textData      = NULL;
     es->renderText    = FALSE;
     es->renderTexture = FALSE;
     es->renderTimeout = 0;
@@ -1585,8 +1577,6 @@ elementsInitScreen (CompPlugin *p,
     elementsSetElementRotateNotify (s, elementsScreenOptionChanged);
     elementsSetUpdateDelayNotify (s, elementsScreenOptionChanged);
 
-    initTexture (s, &es->textTexture);
-
     es->displayList = setupDisplayList ();
 
     delay             = elementsGetUpdateDelay (s);
@@ -1596,7 +1586,7 @@ elementsInitScreen (CompPlugin *p,
     WRAP (es, s, paintOutput, elementsPaintOutput);
     WRAP (es, s, drawWindow, elementsDrawWindow);
 
-    s->base.privates[ed->privateIndex].ptr = es;
+    s->base.privates[ed->screenPrivateIndex].ptr = es;
 
     updateElementTextures (s, TRUE);
 
@@ -1646,6 +1636,7 @@ elementsInitDisplay (CompPlugin  *p,
 {
     ElementsDisplay *ed;
     CompOption      *abi, *index;
+    int             idx;
 
     if (!checkPluginABI ("core", CORE_ABIVERSION))
 	return FALSE;
@@ -1654,17 +1645,24 @@ elementsInitDisplay (CompPlugin  *p,
     if (!ed)
 	return FALSE;
 
-    ed->privateIndex = allocateScreenPrivateIndex (d);
-    if (ed->privateIndex < 0)
+    ed->screenPrivateIndex = allocateScreenPrivateIndex (d);
+    if (ed->screenPrivateIndex < 0)
     {
 	free (ed);
 	return FALSE;
     }
 
-    ed->textAvailable = checkPluginABI ("text", TEXT_ABIVERSION);
-    if (!ed->textAvailable)
+    if (checkPluginABI ("text", TEXT_ABIVERSION) &&
+	getPluginDisplayIndex (d, "text", &idx))
+    {
+	ed->textFunc = d->base.privates[idx].ptr;
+    }
+    else
+    {
 	compLogMessage ("elements", CompLogLevelWarn,
 			"No compatible text plugin found.");
+	ed->textFunc = NULL;
+    }
 
     ed->elementTypes = NULL;
 
@@ -1716,7 +1714,7 @@ elementsFiniDisplay (CompPlugin  *p,
 {
     ELEMENTS_DISPLAY (d);
 
-    freeScreenPrivateIndex (d, ed->privateIndex);
+    freeScreenPrivateIndex (d, ed->screenPrivateIndex);
     free (ed);
 }
 

commit bb3ac8c7763d1d1c3747a9409d178f0ce85fa00e
Author: Sam Spilsbury <Sam@XPS-SUSE.site>
Date:   Thu Feb 12 10:07:40 2009 +0100

    Add more meaningful defaults

diff --git a/include/compiz-elements.h b/include/compiz-elements.h
index 3099f40..831bcc2 100644
--- a/include/compiz-elements.h
+++ b/include/compiz-elements.h
@@ -4,11 +4,7 @@


Reply to: