[fusion-commits] Extra plugins: Changes to 'master' (787b8d41aff700427be39aa1766ff60fb9a7416d)

onestone at server.opencompositing.org onestone at server.opencompositing.org
Fri May 9 08:37:08 CEST 2008


New commits:
commit 787b8d41aff700427be39aa1766ff60fb9a7416d
Author: Dennis Kasprzyk <onestone at opencompositing.org>
Date:   Fri May 9 08:32:52 2008 +0200

    Removed cubecaps and added wallpaper to build system.


 configure.ac               |    2 +-
 metadata/Makefile.am       |    4 +-
 metadata/cubecaps.xml.in   |  150 --------
 metadata/cubereflex.xml.in |   88 -----
 po/POTFILES.in             |    4 +-
 src/Makefile.am            |    4 +-
 src/cubecaps/Makefile.am   |   31 --
 src/cubecaps/cubecaps.c    |  842 --------------------------------------------
 src/wallpaper/Makefile.am  |   27 ++
 9 files changed, 34 insertions(+), 1118 deletions(-)
 delete mode 100644 metadata/cubecaps.xml.in
 delete mode 100644 metadata/cubereflex.xml.in
 delete mode 100644 src/cubecaps/Makefile.am
 delete mode 100644 src/cubecaps/cubecaps.c
 create mode 100644 src/wallpaper/Makefile.am


Modified: fusion/plugins-extra/configure.ac
===================================================================
--- fusion/plugins-extra/configure.ac
+++ fusion/plugins-extra/configure.ac
@@ -180,7 +180,6 @@ src/bench/Makefile
 src/bicubic/Makefile
 src/crashhandler/Makefile
 src/cubeaddon/Makefile
-src/cubecaps/Makefile
 src/extrawm/Makefile
 src/fadedesktop/Makefile
 src/firepaint/Makefile
@@ -198,5 +197,6 @@ src/trailfocus/Makefile
 src/widget/Makefile
 src/showmouse/Makefile
 src/loginout/Makefile
+src/wallpaper/Makefile
 po/Makefile.in
 ])

Modified: fusion/plugins-extra/metadata/Makefile.am
===================================================================
--- fusion/plugins-extra/metadata/Makefile.am
+++ fusion/plugins-extra/metadata/Makefile.am
@@ -6,7 +6,6 @@ xml_in_files = 	         \
 	bicubic.xml.in \
 	crashhandler.xml.in \
 	cubeaddon.xml.in \
-	cubecaps.xml.in \
 	extrawm.xml.in \
 	fadedesktop.xml.in \
 	firepaint.xml.in \
@@ -23,7 +22,8 @@ xml_in_files = 	         \
 	showmouse.xml.in \
 	splash.xml.in \
 	trailfocus.xml.in \
-	widget.xml.in
+	widget.xml.in \
+	wallpaper.xml.in
 
 xml_files    = $(xml_in_files:.xml.in=.xml)
 xml_DATA     = $(xml_files)

Modified: fusion/plugins-extra/metadata/cubecaps.xml.in
deleted file mode 100644
===================================================================
--- fusion/plugins-extra/metadata/cubecaps.xml.in
+++ /dev/null
@@ -1,150 +0,0 @@
-<?xml version="1.0"?>
-<compiz>
-    <plugin name="cubecaps" useBcop="true">
-	<_short>Cube Caps</_short>
-	<_long>Render images on top and bottom of the cube</_long>
-	<category>Utility</category>
-	<feature>cubecaps</feature>
-	<deps>
-	    <relation type="after">
-		    <plugin>cube</plugin>
-		    <plugin>svg</plugin>
-		    <plugin>png</plugin>
-		    <plugin>imgjpeg</plugin>
-	    </relation>
-	    <requirement>
-		    <plugin>cube</plugin>
-	    </requirement>
-	</deps>
-	<display>
-	    <option name="top_next_key" type="key">
-		<_short>Next top image</_short>
-		<_long>Advance to next image for top face of the cube</_long>
-		<passive_grab>false</passive_grab>
-		<default>space</default>
-	    </option>
-	    <option name="top_next_button" type="button">
-		<_short>Next top image</_short>
-		<_long>Advance to next image for top face of the cube</_long>
-		<passive_grab>false</passive_grab>
-	    </option>
-	    <option name="top_prev_key" type="key">
-		<_short>Prev top image</_short>
-		<_long>Go back to previous image for top face of the cube</_long>
-		<passive_grab>false</passive_grab>
-		<default>Backspace</default>
-	    </option>
-	    <option name="top_prev_button" type="button">
-		<_short>Prev top image</_short>
-		<_long>Go back to previous image for top face of the cube</_long>
-		<passive_grab>false</passive_grab>
-	    </option>
-	    <option name="bottom_next_key" type="key">
-		<_short>Next bottom image</_short>
-		<_long>Advance to next image for bottom face of the cube</_long>
-		<passive_grab>false</passive_grab>
-	    </option>
-	    <option name="bottom_next_button" type="button">
-		<_short>Next bottom image</_short>
-		<_long>Advance to next image for bottom face of the cube</_long>
-		<passive_grab>false</passive_grab>
-	    </option>
-	    <option name="bottom_prev_key" type="key">
-		<_short>Prev bottom image</_short>
-		<_long>Go back to previous image for bottom face of the cube</_long>
-		<passive_grab>false</passive_grab>
-	    </option>
-	    <option name="bottom_prev_button" type="button">
-		<_short>Prev bottom image</_short>
-		<_long>Go back to previous image for bottom face of the cube</_long>
-		<passive_grab>false</passive_grab>
-	    </option>
-	</display>
-	<screen>
-	    <group>
-		<_short>Behaviour</_short>
-		<option name="draw_top" type="bool">
-		    <_short>Draw top face</_short>
-		    <_long>Draw top face of the cube</_long>
-		    <default>true</default>
-		</option>
-		<option name="draw_bottom" type="bool">
-		    <_short>Draw bottom face</_short>
-		    <_long>Draw bottom face of the cube</_long>
-		    <default>true</default>
-		</option>
-		<option name="adjust_top" type="bool">
-		    <_short>Adjust top image</_short>
-		    <_long>Adjust top face image to rotation</_long>
-		    <default>false</default>
-		</option>
-		<option name="adjust_bottom" type="bool">
-		    <_short>Adjust bottom image</_short>
-		    <_long>Adjust bottom face image to rotation</_long>
-		    <default>false</default>
-		</option>
-		<option name="scale_top_image" type="bool">
-		    <_short>Scale top image</_short>
-		    <_long>Scale image to cover top face of cube</_long>
-		    <default>false</default>
-		</option>
-		<option name="scale_bottom_image" type="bool">
-		    <_short>Scale bottom image</_short>
-		    <_long>Scale image to cover bottom face of cube</_long>
-		    <default>false</default>
-		</option>
-		<option name="clamp_top_to_border" type="bool">
-		    <_short>Clamp top face image to border</_short>
-		    <_long>Clamp top face image to border. This is often the best if your image doesn't fit the size of the cube or if it's transparent. It can lead to some ugly dotted lines when enabled (especially with large enough images) though.</_long>
-		    <default>true</default>
-		</option>
-		<option name="clamp_bottom_to_border" type="bool">
-		    <_short>Clamp bottom face image to border</_short>
-		    <_long>Clamp bottom face image to border. This is often the best if your image doesn't fit the size of the cube or if it's transparent. It can lead to some ugly dotted lines when enabled (especially with large enough images) though.</_long>
-		    <default>true</default>
-		</option>
-	    </group>
-	    <group>
-		<_short>Appearance</_short>
-		<option name="top_color" type="color">
-		    <_short>Cube Top Color</_short>
-		    <_long>Color of top face of the cube</_long>
-		    <default>
-			<red>0xffff</red>
-			<green>0xffff</green>
-			<blue>0xffff</blue>
-		    </default>
-		</option>
-		<option name="bottom_color" type="color">
-		    <_short>Cube Bottom Color</_short>
-		    <_long>Color of bottom face of the cube</_long>
-		    <default>
-			<red>0xffff</red>
-			<green>0xffff</green>
-			<blue>0xffff</blue>
-		    </default>
-		</option>
-		<option name="top_images" type="list">
-		    <_short>Top image files</_short>
-		    <_long>List of PNG and SVG files that should be rendered on top face of cube</_long>
-		    <type>string</type>
-		    <hints>file;image;</hints>
-		    <default>
-			<value>fusioncap.png</value>
-		    </default>
-		    <hints>file;image;</hints>
-		</option>
-		<option name="bottom_images" type="list">
-		    <_short>Bottom image files</_short>
-		    <_long>List of PNG and SVG files that should be rendered on bottom face of cube</_long>
-		    <type>string</type>
-		    <hints>file;image;</hints>
-		    <default>
-			<value>compizcap.png</value>
-		    </default>
-		    <hints>file;image;</hints>
-		</option>
-	    </group>
-	</screen>
-    </plugin>
-</compiz>

Modified: fusion/plugins-extra/metadata/cubereflex.xml.in
deleted file mode 100644
===================================================================
--- fusion/plugins-extra/metadata/cubereflex.xml.in
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0"?>
-<compiz>
-	<plugin name="cubereflex" useBcop="true">
-		<_short>Cube Reflection</_short>
-		<_long>Compiz cube reflection</_long>
-		<category>Effects</category>
-		<deps>
-		<relation type="after">
-			<plugin>cube</plugin>
-			<plugin>rotate</plugin>
-		</relation>
-		<requirement>
-			<plugin>cube</plugin>
-		</requirement>
-		</deps>
-		<screen>
-			<option name="ground_color1" type="color">
-				<_short>Ground color(near)</_short>
-				<_long>Color of the ground (near).</_long>
-				<default>
-					<red>0xb333</red>
-					<green>0xb333</green>
-					<blue>0xb333</blue>
-					<alpha>0xcccc</alpha>
-				</default>
-			</option>
-			<option name="ground_color2" type="color">
-				<_short>Ground color(far)</_short>
-				<_long>Color of the ground (far).</_long>
-				<default>
-					<red>0xb333</red>
-					<green>0xb333</green>
-					<blue>0xb333</blue>
-					<alpha>0x0000</alpha>
-				</default>
-			</option>
-			<option name="ground_size" type="float">
-				<_short>Reflection ground size</_short>
-				<_long>Reflection ground size.</_long>
-				<default>0.5</default>
-				<min>0.0</min>
-				<max>1.0</max>
-				<precision>0.01</precision>
-			</option>
-			<option name="intensity" type="float">
-				<_short>Intensity</_short>
-				<_long>Reflection intensity</_long>
-				<default>0.4</default>
-				<min>0.0</min>
-				<max>1.0</max>
-				<precision>0.01</precision>
-			</option>
-			<option name="auto_zoom" type="bool">
-				<_short>Auto zoom</_short>
-				<_long>Zoom out automatically to make the cube fit to the screen.</_long>
-				<default>true</default>
-			</option>
-			<option name="zoom_manual_only" type="bool">
-				<_short>Auto zoom only on Mouse Rotate</_short>
-				<_long>Zoom out automatically only on mouse rotate.</_long>
-				<default>true</default>
-			</option>
-			<option name="mode" type="int">
-				<_short>Reflection mode</_short>
-				<_long>Reflection mode.</_long>
-				<default>0</default>
-				<min>0</min>
-				<max>3</max>
-				<desc>
-					<value>0</value>
-					<_name>Jumpy</_name>
-				</desc>
-				<desc>
-					<value>1</value>
-					<_name>Jumpy reflection</_name>
-				</desc>
-				<desc>
-					<value>2</value>
-					<_name>Distance</_name>
-				</desc>
-				<desc>
-					<value>3</value>
-					<_name>Above</_name>
-				</desc>
-			</option>
-		</screen>
-	</plugin>
-</compiz>

Modified: fusion/plugins-extra/po/POTFILES.in
===================================================================
--- fusion/plugins-extra/po/POTFILES.in
+++ fusion/plugins-extra/po/POTFILES.in
@@ -2,8 +2,7 @@ metadata/addhelper.xml.in
 metadata/bench.xml.in
 metadata/bicubic.xml.in
 metadata/crashhandler.xml.in
-metadata/cubecaps.xml.in
-metadata/cubereflex.xml.in
+metadata/cubeaddon.xml.in
 metadata/extrawm.xml.in
 metadata/fadedesktop.xml.in
 metadata/firepaint.xml.in
@@ -22,3 +21,4 @@ metadata/shelf.xml.in
 metadata/maximumize.xml.in
 metadata/notification.xml.in
 metadata/3d.xml.in
+metadata/wallpaper.xml.in

Modified: fusion/plugins-extra/src/Makefile.am
===================================================================
--- fusion/plugins-extra/src/Makefile.am
+++ fusion/plugins-extra/src/Makefile.am
@@ -5,7 +5,6 @@ SUBDIRS = 3d \
 	  bicubic \
 	  crashhandler \
 	  cubeaddon \
-	  cubecaps \
 	  extrawm \
 	  fadedesktop \
 	  firepaint \
@@ -22,4 +21,5 @@ SUBDIRS = 3d \
 	  trailfocus \
 	  widget \
 	  showmouse \
-	  loginout
+	  loginout \
+	  wallpaper

Modified: fusion/plugins-extra/src/cubecaps/Makefile.am
deleted file mode 100644
===================================================================
--- fusion/plugins-extra/src/cubecaps/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-## Process this file with automake to produce Makefile.in
-PFLAGS=-module -avoid-version -no-undefined
-
-if CUBECAPS_PLUGIN
-libcubecaps_la_LDFLAGS = $(PFLAGS)
-libcubecaps_la_LIBADD = @COMPIZ_LIBS@ @COMPIZCUBE_LIBS@
-libcubecaps_la_SOURCES = cubecaps_options.c cubecaps_options.h cubecaps.c
-endif
-
-INCLUDES =                              \
-	@COMPIZ_CFLAGS@                  \
-	@COMPIZCUBE_CFLAGS@              \
-	-DDATADIR='"$(compdatadir)"'        \
-	-DLIBDIR='"$(libdir)"'              \
-	-DLOCALEDIR="\"@datadir@/locale\""  \
-	-DIMAGEDIR='"$(imagedir)"'          \
-	-I$(top_srcdir)/include
-
-moduledir = $(plugindir)
-
-if CUBECAPS_PLUGIN
-module_LTLIBRARIES = libcubecaps.la
-endif
-
-CLEANFILES = *_options.c *_options.h
-
-%_options.h: ../../metadata/%.xml
-		$(BCOP_BIN) --header $@ $<
-
-%_options.c: ../../metadata/%.xml %_options.h
-		$(BCOP_BIN) --source $@ $<

Modified: fusion/plugins-extra/src/cubecaps/cubecaps.c
deleted file mode 100644
===================================================================
--- fusion/plugins-extra/src/cubecaps/cubecaps.c
+++ /dev/null
@@ -1,842 +0,0 @@
-/*
- * Compiz Cube Caps plugin
- *
- * cubecaps.c
- *
- * Copyright : (C) 2007 Guillaume Seguin
- * E-mail    : guillaume at segu.in
- *
- * Modifications for proper handling of opacity added by:
- * Kevin Lange <klange at ogunderground.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <signal.h>
-#include <unistd.h>
-
-#include <compiz-core.h>
-#include <compiz-cube.h>
-#include "cubecaps_options.h"
-
-static int displayPrivateIndex;
-
-static int cubeDisplayPrivateIndex;
-
-typedef struct _CubeCapsDisplay
-{
-    int screenPrivateIndex;
-} CubeCapsDisplay;
-
-typedef struct _CubeCap
-{
-    int		    current;
-    CompListValue	    *files;
-
-    CompTexture	    texture;
-    GLfloat		    tc[12];
-
-    Bool		    scale;
-    int		    pw;
-    int		    ph;
-} CubeCap;
-
-typedef struct _CubeCapsScreen
-{
-    PreparePaintScreenProc  preparePaintScreen;
-    CubePaintTopProc	    paintTop;
-    CubePaintBottomProc	    paintBottom;
-
-    CubeCap		    topCap;
-    CubeCap		    bottomCap;
-} CubeCapsScreen;
-
-#define GET_CUBECAPS_DISPLAY(d)						\
-    ((CubeCapsDisplay *) (d)->base.privates[displayPrivateIndex].ptr)
-#define CUBECAPS_DISPLAY(d)						\
-    CubeCapsDisplay *ccd = GET_CUBECAPS_DISPLAY (d);
-
-#define GET_CUBECAPS_SCREEN(s, ccd)					\
-    ((CubeCapsScreen *) (s)->base.privates[(ccd)->screenPrivateIndex].ptr)
-#define CUBECAPS_SCREEN(s)						\
-    CubeCapsScreen *ccs = GET_CUBECAPS_SCREEN (s,			\
-			  GET_CUBECAPS_DISPLAY (s->display))
-
-/* Actual caps handling ----------------------------------------------------- */
-
-/*
- * Initiate a CubeCap
- */
-static void
-cubecapsInitCap (CompScreen *s, CubeCap *cap)
-{
-    memset (cap->tc, 0, sizeof (cap->tc));
-
-    initTexture (s, &cap->texture);
-
-    cap->current    = 0;
-    cap->files	    = NULL;
-
-    cap->scale	    = FALSE;
-    cap->pw	    = 0;
-    cap->ph	    = 0;
-}
-
-/*
- * Prepare cap texture coordinates
- */
-static void
-cubecapsInitTextureCoords (CompScreen * s, CubeCap * cap,
-			   unsigned int width, unsigned int height)
-{
-    float x1, x2, y1, y2;
-    CompMatrix *matrix;
-
-    if (!cap)
-	return;
-
-    matrix = &cap->texture.matrix;
-
-    if (cap->scale)
-    {
-	x1 = 0.0f;
-	y1 = 0.0f;
-	x2 = width;
-	y2 = height;
-    }
-    else
-    {
-	int bigscr, i;
-	int bigWidth, bigHeight;
-
-	CUBE_SCREEN(s);
-	bigWidth = s->width;
-	bigHeight = s->height;
-
-	/* Scale the texture in a sane way for multi head too */
-	if (s->nOutputDev > 1 && cs->moMode != CUBE_MOMODE_ONE)
-	{
-	    for (i = bigscr = 0; i < s->nOutputDev; i++)
-		if (s->outputDev[i].width > s->outputDev[bigscr].width)
-		    bigscr = i;
-	    bigWidth = s->outputDev[bigscr].width;
-	    bigHeight = s->outputDev[bigscr].height;
-	}
-
-	x1 = width / 2.0f - bigWidth / 2.0f;
-	y1 = height / 2.0f - bigHeight / 2.0f;
-	x2 = width / 2.0f + bigWidth / 2.0f;
-	y2 = height / 2.0f + bigHeight / 2.0f;
-    }
-
-    cap->tc[0] = COMP_TEX_COORD_X (matrix, width / 2.0f);
-    cap->tc[1] = COMP_TEX_COORD_Y (matrix, height / 2.0f);
-
-    cap->tc[2] = COMP_TEX_COORD_X (matrix, x2);
-    cap->tc[3] = COMP_TEX_COORD_Y (matrix, y1);
-
-    cap->tc[4] = COMP_TEX_COORD_X (matrix, x1);
-    cap->tc[5] = COMP_TEX_COORD_Y (matrix, y1);
-
-    cap->tc[6] = COMP_TEX_COORD_X (matrix, x1);
-    cap->tc[7] = COMP_TEX_COORD_Y (matrix, y2);
-
-    cap->tc[8] = COMP_TEX_COORD_X (matrix, x2);
-    cap->tc[9] = COMP_TEX_COORD_Y (matrix, y2);
-
-    cap->tc[10] = COMP_TEX_COORD_X (matrix, x2);
-    cap->tc[11] = COMP_TEX_COORD_Y (matrix, y1);
-}
-
-/*
- * Attempt to load current cap image (if any)
- */
-static void
-cubecapsLoadCap (CompScreen *s,
-		 CubeCap    *cap)
-{
-    unsigned int    width, height;
-    int		    pw, ph;
-
-    CUBE_SCREEN (s);
-
-    if (!cs->fullscreenOutput)
-    {
-	pw = s->width;
-	ph = s->height;
-    }
-    else
-    {
-	pw = s->outputDev[0].width;
-	ph = s->outputDev[0].height;
-    }
-
-    if (!cap->files || !cap->files->nValue || cap->pw != pw || cap->ph != ph)
-    {
-	finiTexture (s, &cap->texture);
-	initTexture (s, &cap->texture);
-
-	if (!cap->files || !cap->files->nValue)
-	    return;
-    }
-
-    cap->current = cap->current % cap->files->nValue;
-
-    if (!readImageToTexture (s, &cap->texture,
-			     cap->files->value[cap->current].s,
-			     &width, &height))
-    {
-	compLogMessage (s->display, "cubecaps", CompLogLevelWarn,
-			"Failed to load image: %s",
-			cap->files->value[cap->current].s);
-
-	finiTexture (s, &cap->texture);
-	initTexture (s, &cap->texture);
-
-	return;
-    }
-
-    cubecapsInitTextureCoords (s, cap, width, height);
-}
-
-/*
- * Paint a cap
- */
-static void
-cubecapsPaintCap (CompScreen	    *s,
-		  int		    offset,
-		  CubeCap	    *capOutside,
-		  CubeCap	    *capInside,
-		  unsigned short    *colorOutside,
-		  unsigned short    *colorInside,
-		  Bool		    clampToBorderOutside,
-		  Bool		    clampToBorderInside)
-{
-    CubeCap	    *cap;
-    unsigned short  opacity;
-    Bool	    clampToBorder;
-
-    CUBE_SCREEN(s);
-
-    opacity = cs->desktopOpacity;
-
-    if (cs->invert == 1)
-    {
-	cap = capOutside;
-	clampToBorder = clampToBorderOutside;
-	// Honor selected opacity AND cube opacity
-	opacity = (opacity * colorOutside[3]) / 0xffff;
-	glColor4us (colorOutside[0],
-		    colorOutside[1],
-		    colorOutside[2],
-		    opacity);
-    }
-    else if (cs->invert != 1)
-    {
-	cap = capInside;
-	clampToBorder = clampToBorderInside;
-	opacity = (opacity * colorInside[3]) / 0xffff;
-	glColor4us (colorInside[0],
-		    colorInside[1],
-		    colorInside[2],
-		    opacity);
-    }
-
-    glTranslatef (cs->outputXOffset, -cs->outputYOffset, 0.0f);
-    glScalef (cs->outputXScale, cs->outputYScale, 1.0f);
-
-    glVertexPointer (3, GL_FLOAT, 0, cs->vertices);
-
-    glEnable (GL_BLEND);
-    /* Draw cap once and reset color so that image will get correctly
-     * blended, and for non-4-horizontal-viewports setups */
-    if (opacity != OPAQUE)
-    {
-	screenTexEnvMode (s, GL_MODULATE);
-	glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-	glDrawArrays (GL_TRIANGLE_FAN, offset, cs->nVertices >> 1);
-	glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-    }
-    else
-	glDrawArrays (GL_TRIANGLE_FAN, offset, cs->nVertices >> 1);
-
-    glColor4usv (defaultColor);
-
-    /* It is not really a good idea to draw the cap texture when there are 
-     * only three viewports */
-    if (cap && cap->texture.name && s->hsize >= 4)
-    {
-	/* Apply blend strategy to blend correctly color and image */
-	
-	glColor4us (cs->desktopOpacity, cs->desktopOpacity,
-		    cs->desktopOpacity, cs->desktopOpacity);
-	enableTexture (s, &cap->texture, COMP_TEXTURE_FILTER_GOOD);
-
-	/* Use CLAMP_TO_BORDER if available to avoid weird looking clamping 
-	 * of non-scaled images (it also improves scaled images a bit but 
-	 * that's much less obvious) */
-	if (clampToBorder && s->textureBorderClamp)
-	{
-	    glTexParameteri (cap->texture.target, GL_TEXTURE_WRAP_S,
-			     GL_CLAMP_TO_BORDER);
-	    glTexParameteri (cap->texture.target, GL_TEXTURE_WRAP_T,
-			     GL_CLAMP_TO_BORDER);
-	}
-	else
-	{
-	    glTexParameteri (cap->texture.target, GL_TEXTURE_WRAP_S,
-			     GL_CLAMP_TO_EDGE);
-	    glTexParameteri (cap->texture.target, GL_TEXTURE_WRAP_T,
-			     GL_CLAMP_TO_EDGE);
-	}
-
-	if (s->hsize == 4)
-	{
-	    /* 4 viewports is pretty much straight forward ... */
-	    glTexCoordPointer (2, GL_FLOAT, 0, cap->tc - (offset << 1));
-	    glDrawArrays (GL_TRIANGLE_FAN, offset, cs->nVertices >> 1);
-	}
-	else if (s->hsize > 4)
-	{
-	    /* Paint image using custom vertexes */
-	    int centerx = *cs->vertices;
-	    int centery = *(cs->vertices + 1);
-	    int centerz = *(cs->vertices + 2);
-	    GLfloat x1, y1, x2, y2;
-	    x1 = cap->tc[4];
-	    x2 = cap->tc[2];
-	    y1 = cap->tc[3];
-	    y2 = cap->tc[9];
-
-	    glBegin (GL_QUADS);
-
-	    if (offset)
-		centery -= 1;
-
-	    if (offset)
-	    {
-		glTexCoord2f (x1, y1);
-		glVertex3f (centerx - 0.5, centery + 0.5, centerz + 0.5);
-		glTexCoord2f (x1, y2);
-		glVertex3f (centerx - 0.5, centery + 0.5, centerz - 0.5);
-		glTexCoord2f (x2, y2);
-		glVertex3f (centerx + 0.5, centery + 0.5, centerz - 0.5);
-		glTexCoord2f (x2, y1);
-		glVertex3f (centerx + 0.5, centery + 0.5, centerz + 0.5);
-	    }
-	    else
-	    {
-		glTexCoord2f (x2,y2);
-		glVertex3f (centerx + 0.5, centery + 0.5, centerz + 0.5);
-		glTexCoord2f (x2, y1);
-		glVertex3f (centerx + 0.5, centery + 0.5, centerz - 0.5);
-		glTexCoord2f (x1, y1);
-		glVertex3f (centerx - 0.5, centery + 0.5, centerz - 0.5);
-		glTexCoord2f (x1, y2);
-		glVertex3f (centerx - 0.5, centery + 0.5, centerz + 0.5);
-	    }
-
-	    glEnd ();
-	}
-	disableTexture (s, &cap->texture);
-    }
-
-    if (opacity != OPAQUE)
-	screenTexEnvMode (s, GL_REPLACE);
-
-    glDisable (GL_BLEND);
-}
-
-/* Core painting hooks ------------------------------------------------------ */
-
-/*
- * Force cube to paint all viewports if not drawing top or bottom cap(s)
- */
-static void
-cubecapsPreparePaintScreen (CompScreen *s,
-			    int	       msSinceLastPaint)
-{
-    CUBE_SCREEN (s);
-    CUBECAPS_SCREEN (s);
-
-    UNWRAP (ccs, s, preparePaintScreen);
-    (*s->preparePaintScreen) (s, msSinceLastPaint);
-    WRAP (ccs, s, preparePaintScreen, cubecapsPreparePaintScreen);
-
-    if (cs->rotationState == RotationNone ||
-	cs->rotationState != RotationManual)
-	return;
-
-    cs->paintAllViewports |= !cubecapsGetDrawTop (s)			|
-			     !cubecapsGetDrawBottom (s)			|
-			     (cubecapsGetTopColorAlpha (s) != OPAQUE)	|
-			     (cubecapsGetBottomColorAlpha (s) != OPAQUE);
-}
-
-/* Cube hooks --------------------------------------------------------------- */
-
-/*
- * Paint top cube face
- */
-static void
-cubecapsPaintTop (CompScreen		  *s,
-		  const ScreenPaintAttrib *sAttrib,
-		  const CompTransform     *transform,
-		  CompOutput		  *output,
-		  int			  size)
-{
-    ScreenPaintAttrib sa = *sAttrib;
-    CompTransform     sTransform = *transform;
-
-    CUBE_SCREEN (s);
-    CUBECAPS_SCREEN (s);
-
-    /* Only paint if required */
-    if (!cubecapsGetDrawTop (s))
-	return;
-
-    screenLighting (s, TRUE);
-
-    glPushMatrix ();
-
-    /* Readjust cap orientation ... */
-    if (cs->invert == 1)
-    {
-	sa.yRotate += (360.0f / size) * (cs->xRotations + 1);
-	if (!cubecapsGetAdjustTop (s)) /* ... Or not */
-	    sa.yRotate -= (360.0f / size) * s->x;
-    }
-    else
-    {
-	sa.yRotate -= (360.0f / size) * (cs->xRotations - 1);
-	if (!cubecapsGetAdjustTop (s)) /* ... Or not */
-	    sa.yRotate += (360.0f / size) * s->x;
-    }
-
-    (*s->applyScreenTransform) (s, &sa, output, &sTransform);
-
-    glLoadMatrixf (sTransform.m);
-
-    /* Actually paint the cap */
-    cubecapsPaintCap (s, 0, &ccs->topCap, &ccs->bottomCap,
-		      cubecapsGetTopColor (s), cubecapsGetBottomColor (s),
-		      cubecapsGetClampTopToBorder (s),
-		      cubecapsGetClampBottomToBorder (s));
-
-    glPopMatrix ();
-
-    glColor4usv (defaultColor);
-}
-
-/*
- * Paint bottom cube face
- */
-static void
-cubecapsPaintBottom (CompScreen		     *s,
-		     const ScreenPaintAttrib *sAttrib,
-		     const CompTransform     *transform,
-		     CompOutput		     *output,
-		     int		     size)
-{
-    ScreenPaintAttrib sa = *sAttrib;
-    CompTransform     sTransform = *transform;
-
-    CUBE_SCREEN (s);
-    CUBECAPS_SCREEN (s);
-
-    /* Only paint if required */
-    if (!cubecapsGetDrawBottom (s))
-	return;
-
-    screenLighting (s, TRUE);
-
-    glPushMatrix ();
-
-    /* Readjust cap orientation ... */
-    if (cs->invert == 1)
-    {
-	sa.yRotate += (360.0f / size) * cs->xRotations;
-	if (!cubecapsGetAdjustBottom (s)) /* ... Or not */
-	    sa.yRotate -= (360.0f / size) * s->x;
-    }
-    else
-    {
-	sa.yRotate -= (360.0f / size) * cs->xRotations;
-	if (!cubecapsGetAdjustBottom (s)) /* ... Or not */
-	    sa.yRotate += (360.0f / size) * s->x;
-    }
-
-    (*s->applyScreenTransform) (s, &sa, output, &sTransform);
-
-    glLoadMatrixf (sTransform.m);
-
-    /* Actually paint the cap */
-    cubecapsPaintCap (s, cs->nVertices >> 1, &ccs->bottomCap, &ccs->topCap,
-		      cubecapsGetBottomColor (s), cubecapsGetTopColor (s),
-		      cubecapsGetClampBottomToBorder (s),
-		      cubecapsGetClampTopToBorder (s));
-
-    glPopMatrix ();
-
-    glColor4usv (defaultColor);
-}
-
-/* Settings handling -------------------------------------------------------- */
-
-/*
- * Switch cap, load it and damage screen if possible
- */
-static void
-cubecapsChangeCap (CompScreen *s,
-		   CubeCap    *cap,
-		   int	      change)
-{
-    if (cap->files && cap->files->nValue)
-    {
-	int count = cap->files->nValue;
-	cap->current = (cap->current + change + count) % count;
-	cubecapsLoadCap (s, cap);
-	damageScreen (s);
-    }
-}
-
-/*
- * Top images list changed, reload top cap if any
- */
-static void
-cubecapsTopImagesChanged (CompScreen		*s,
-			  CompOption		*opt,
-			  CubecapsScreenOptions num)
-{
-    CUBECAPS_SCREEN (s);
-
-    ccs->topCap.files = cubecapsGetTopImages (s);
-    cubecapsChangeCap (s, &ccs->topCap, 0);
-}
-
-/*
- * Bottom images list changed, reload bottom cap if any
- */
-static void
-cubecapsBottomImagesChanged (CompScreen		   *s,
-			     CompOption		   *opt,
-			     CubecapsScreenOptions num)
-{
-    CUBECAPS_SCREEN (s);
-
-    ccs->bottomCap.files = cubecapsGetBottomImages (s);
-    cubecapsChangeCap (s, &ccs->bottomCap, 0);
-}
-
-/*
- * scale_top_image setting changed, reload top cap if any to update texture
- * coordinates
- */
-static void
-cubecapsScaleTopImageChanged (CompScreen	    *s,
-			      CompOption	    *opt,
-			      CubecapsScreenOptions num)
-{
-    CUBECAPS_SCREEN (s);
-
-    ccs->topCap.scale = cubecapsGetScaleTopImage (s);
-    cubecapsChangeCap (s, &ccs->topCap, 0);
-}
-
-/*
- * scale_bottom_image setting changed, reload bottom cap if any to update
- * texture coordinates
- */
-static void
-cubecapsScaleBottomImageChanged (CompScreen		*s,
-				 CompOption		*opt,
-				 CubecapsScreenOptions	num)
-{
-    CUBECAPS_SCREEN (s);
-
-    ccs->bottomCap.scale = cubecapsGetScaleBottomImage (s);
-    cubecapsChangeCap (s, &ccs->bottomCap, 0);
-}
-
-/* Actions handling --------------------------------------------------------- */
-
-/*
- * Switch to next top image
- */
-static Bool
-cubecapsTopNext (CompDisplay     *d,
-		 CompAction      *action,
-		 CompActionState state,
-		 CompOption      *option,
-		 int		 nOption)
-{
-    CompScreen *s;
-    Window     xid;
-
-    xid = getIntOptionNamed (option, nOption, "root", 0);
-
-    s = findScreenAtDisplay (d, xid);
-
-    if (s)
-    {
-	CUBECAPS_SCREEN (s);
-	cubecapsChangeCap (s, &ccs->topCap, 1);
-    }
-
-    return FALSE;
-}
-
-/*
- * Switch to previous top image
- */
-static Bool
-cubecapsTopPrev (CompDisplay     *d,
-		 CompAction      *action,
-		 CompActionState state,
-		 CompOption      *option,
-		 int		 nOption)
-{
-    CompScreen *s;
-    Window     xid;
-
-    xid = getIntOptionNamed (option, nOption, "root", 0);
-
-    s = findScreenAtDisplay (d, xid);
-    if (s)
-    {
-	CUBECAPS_SCREEN (s);
-	cubecapsChangeCap (s, &ccs->topCap, -1);
-    }
-
-    return FALSE;
-}
-
-/*
- * Switch to next bottom image
- */
-static Bool
-cubecapsBottomNext (CompDisplay     *d,
-		    CompAction      *action,
-		    CompActionState state,
-		    CompOption      *option,
-		    int		    nOption)
-{
-    CompScreen *s;
-    Window     xid;
-
-    xid = getIntOptionNamed (option, nOption, "root", 0);
-
-    s = findScreenAtDisplay (d, xid);
-
-    if (s)
-    {
-	CUBECAPS_SCREEN (s);
-	cubecapsChangeCap (s, &ccs->bottomCap, 1);
-    }
-
-    return FALSE;
-}
-
-/*
- * Switch to previous bottom image
- */
-static Bool
-cubecapsBottomPrev (CompDisplay     *d,
-		    CompAction      *action,
-		    CompActionState state,
-		    CompOption      *option,
-		    int		    nOption)
-{
-    CompScreen *s;
-    Window     xid;
-
-    xid = getIntOptionNamed (option, nOption, "root", 0);
-
-    s = findScreenAtDisplay (d, xid);
-    if (s)
-    {
-	CUBECAPS_SCREEN (s);
-	cubecapsChangeCap (s, &ccs->bottomCap, -1);
-    }
-
-    return FALSE;
-}
-
-/* Internal stuff ----------------------------------------------------------- */
-
-static Bool
-cubecapsInitDisplay (CompPlugin  *p,
-		     CompDisplay *d)
-{
-    CubeCapsDisplay *ccd;
-
-    if (!checkPluginABI ("core", CORE_ABIVERSION))
-	return FALSE;
-
-    if (!checkPluginABI ("cube", CUBE_ABIVERSION))
-	return FALSE;
-
-    if (!getPluginDisplayIndex (d, "cube", &cubeDisplayPrivateIndex))
-	return FALSE;
-
-    ccd = malloc (sizeof (CubeCapsDisplay));
-
-    if (!ccd)
-	return FALSE;
-
-    ccd->screenPrivateIndex = allocateScreenPrivateIndex (d);
-
-    if (ccd->screenPrivateIndex < 0)
-    {
-	free (ccd);
-	return FALSE;
-    }
-
-    cubecapsSetTopNextKeyInitiate (d, cubecapsTopNext);
-    cubecapsSetTopPrevKeyInitiate (d, cubecapsTopPrev);
-    cubecapsSetBottomNextKeyInitiate (d, cubecapsBottomNext);
-    cubecapsSetBottomPrevKeyInitiate (d, cubecapsBottomPrev);
-
-    cubecapsSetTopNextButtonInitiate (d, cubecapsTopNext);
-    cubecapsSetTopPrevButtonInitiate (d, cubecapsTopPrev);
-    cubecapsSetBottomNextButtonInitiate (d, cubecapsBottomNext);
-    cubecapsSetBottomPrevButtonInitiate (d, cubecapsBottomPrev);
-
-    d->base.privates[displayPrivateIndex].ptr = ccd;
-
-    return TRUE;
-}
-
-static void
-cubecapsFiniDisplay (CompPlugin  *p,
-		     CompDisplay *d)
-{
-    CUBECAPS_DISPLAY (d);
-
-    freeScreenPrivateIndex (d, ccd->screenPrivateIndex);
-    free (ccd);
-}
-
-static Bool
-cubecapsInitScreen (CompPlugin *p,
-		    CompScreen *s)
-{
-    CubeCapsScreen *ccs;
-    CUBECAPS_DISPLAY (s->display);
-    CUBE_SCREEN (s);
-
-    ccs = malloc (sizeof (CubeCapsScreen));
-
-    if (!ccs)
-	return FALSE;
-
-    cubecapsInitCap (s, &ccs->topCap);
-    cubecapsInitCap (s, &ccs->bottomCap);
-
-    ccs->topCap.files = cubecapsGetTopImages (s);
-    ccs->bottomCap.files = cubecapsGetBottomImages (s);
-
-    cubecapsSetTopImagesNotify (s, cubecapsTopImagesChanged);
-    cubecapsSetBottomImagesNotify (s, cubecapsBottomImagesChanged);
-
-    cubecapsSetScaleTopImageNotify (s, cubecapsScaleTopImageChanged);
-    cubecapsSetScaleBottomImageNotify (s, cubecapsScaleBottomImageChanged);
-
-    WRAP (ccs, s, preparePaintScreen, cubecapsPreparePaintScreen);
-    WRAP (ccs, cs, paintTop, cubecapsPaintTop);
-    WRAP (ccs, cs, paintBottom, cubecapsPaintBottom);
-
-    s->base.privates[ccd->screenPrivateIndex].ptr = ccs;
-
-    cubecapsChangeCap (s, &ccs->topCap, 0);
-    cubecapsChangeCap (s, &ccs->bottomCap, 0);
-
-    return TRUE;
-}
-
-static void
-cubecapsFiniScreen (CompPlugin *p,
-		    CompScreen *s)
-{
-    CUBECAPS_SCREEN (s);
-    CUBE_SCREEN (s);
-
-    UNWRAP (ccs, cs, paintTop);
-    UNWRAP (ccs, cs, paintBottom);
-    UNWRAP (ccs, s, preparePaintScreen);
-
-    free (ccs);
-}
-
-static CompBool
-cubecapsInitObject (CompPlugin *p,
-		    CompObject *o)
-{
-    static InitPluginObjectProc dispTab[] = {
-	(InitPluginObjectProc) 0, /* InitCore */
-	(InitPluginObjectProc) cubecapsInitDisplay,
-	(InitPluginObjectProc) cubecapsInitScreen
-    };
-
-    RETURN_DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), TRUE, (p, o));
-}
-
-static void
-cubecapsFiniObject (CompPlugin *p,
-		    CompObject *o)
-{
-    static FiniPluginObjectProc dispTab[] = {
-	(FiniPluginObjectProc) 0, /* FiniCore */
-	(FiniPluginObjectProc) cubecapsFiniDisplay,
-	(FiniPluginObjectProc) cubecapsFiniScreen
-    };
-
-    DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), (p, o));
-}
-
-static Bool
-cubecapsInit (CompPlugin * p)
-{
-    displayPrivateIndex = allocateDisplayPrivateIndex();
-
-    if (displayPrivateIndex < 0)
-	return FALSE;
-
-    return TRUE;
-}
-
-static void
-cubecapsFini (CompPlugin * p)
-{
-    if (displayPrivateIndex >= 0)
-	freeDisplayPrivateIndex (displayPrivateIndex);
-}
-
-CompPluginVTable cubecapsVTable =
-{
-    "cubecaps",
-    0,
-    cubecapsInit,
-    cubecapsFini,
-    cubecapsInitObject,
-    cubecapsFiniObject,
-    NULL,
-    NULL
-};
-
-CompPluginVTable *
-getCompPluginInfo (void)
-{
-    return &cubecapsVTable;
-}

Modified: fusion/plugins-extra/src/wallpaper/Makefile.am
new file mode 100644
===================================================================
--- /dev/null
+++ fusion/plugins-extra/src/wallpaper/Makefile.am
@@ -0,0 +1,27 @@
+## Process this file with automake to produce Makefile.in
+PFLAGS=-module -avoid-version -no-undefined
+
+libwallpaper_la_LDFLAGS = $(PFLAGS)
+libwallpaper_la_LIBADD = @COMPIZ_LIBS@
+libwallpaper_la_SOURCES = wallpaper_options.c wallpaper_options.h wallpaper.c
+
+INCLUDES =                              \
+	@COMPIZ_CFLAGS@                  \
+	-DDATADIR='"$(compdatadir)"'        \
+	-DLIBDIR='"$(libdir)"'              \
+	-DLOCALEDIR="\"@datadir@/locale\""  \
+	-DIMAGEDIR='"$(imagedir)"'          \
+	-I$(top_srcdir)/include
+
+moduledir = $(plugindir)
+
+
+module_LTLIBRARIES = libwallpaper.la
+
+CLEANFILES = *_options.c *_options.h
+
+%_options.h: ../../metadata/%.xml
+		$(BCOP_BIN) --header $@ $<
+
+%_options.c: ../../metadata/%.xml %_options.h
+		$(BCOP_BIN) --source $@ $<


More information about the commits mailing list