| author | OasisGames <klange@ogunderground.com> | 2008-01-13 19:19:09 (GMT) |
|---|---|---|
| committer | OasisGames <klange@ogunderground.com> | 2008-01-13 19:19:09 (GMT) |
| commit | bfa726e7135796564dcab2c2d928683ad54384da (patch) (side-by-side diff) | |
| tree | 36841c43e49e46f6825f5aeadef9ac37090dd546 | |
| parent | d9445a0f124d7e998120682cf932ee2289f399dc (diff) | |
| download | wiitrack-bfa726e7135796564dcab2c2d928683ad54384da.tar.gz wiitrack-bfa726e7135796564dcab2c2d928683ad54384da.tar.bz2 | |
Initial commit
| -rw-r--r-- | Makefile | 463 | ||||
| -rw-r--r-- | plugin.info | 1 | ||||
| -rw-r--r-- | wiitrack.c | 602 | ||||
| -rw-r--r-- | wiitrack.xml.in | 164 |
4 files changed, 1230 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e1835ab --- a/dev/null +++ b/Makefile @@ -0,0 +1,463 @@ +## +# +# Compiz plugin Makefile +# +# Copyright : (C) 2007 by Dennis Kasprzyk +# E-mail : onestone@deltatauchi.de +# +# +# 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. +# +## + +# plugin.info file contents +# +# PLUGIN = foo +# PKG_DEP = pango +# LDFLAGS_ADD = -lGLU +# CFLAGS_ADD = -I/usr/include/foo +# + +#load config file +include plugin.info + + +ifeq ($(BUILD_GLOBAL),true) + PREFIX = $(shell pkg-config --variable=prefix compiz) + CLIBDIR = $(shell pkg-config --variable=libdir compiz) + CINCDIR = $(shell pkg-config --variable=includedir compiz) + PKGDIR = $(CLIBDIR)/pkgconfig + DESTDIR = $(shell pkg-config --variable=libdir compiz)/compiz + XMLDIR = $(shell pkg-config --variable=prefix compiz)/share/compiz + IMAGEDIR = $(shell pkg-config --variable=prefix compiz)/share/compiz + DATADIR = $(shell pkg-config --variable=prefix compiz)/share/compiz +else + DESTDIR = $(HOME)/.compiz/plugins + XMLDIR = $(HOME)/.compiz/metadata + IMAGEDIR = $(HOME)/.compiz/images + DATADIR = $(HOME)/.compiz/data +endif + +BUILDDIR = build + +ECHO = `which echo` + +CC = gcc +CPP = g++ +LIBTOOL = libtool +INSTALL = install + +BCOP = `pkg-config --variable=bin bcop` + +CFLAGS = -g -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing `pkg-config --cflags $(PKG_DEP) compiz ` $(CFLAGS_ADD) +LDFLAGS = `pkg-config --libs $(PKG_DEP) compiz ` $(LDFLAGS_ADD) + +DEFINES = -DIMAGEDIR=$(IMAGEDIR) -DDATADIR=$(DATADIR) + +POFILEDIR = $(shell if [ -n "$(PODIR)" ]; then $(ECHO) $(PODIR); else $(ECHO) ./po;fi ) + +is-bcop-target := $(shell if [ -e $(PLUGIN).xml.in ]; then cat $(PLUGIN).xml.in | grep "useBcop=\"true\""; \ + else if [ -e $(PLUGIN).xml ]; then cat $(PLUGIN).xml | grep "useBcop=\"true\""; fi; fi) + +trans-target := $(shell if [ -e $(PLUGIN).xml.in -o -e $(PLUGIN).xml ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN).xml;fi ) + +bcop-target := $(shell if [ -n "$(is-bcop-target)" ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN).xml; fi ) +bcop-target-src := $(shell if [ -n "$(is-bcop-target)" ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN)_options.c; fi ) +bcop-target-hdr := $(shell if [ -n "$(is-bcop-target)" ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN)_options.h; fi ) + +gen-schemas := $(shell if [ -e $(PLUGIN).xml.in -o -e $(PLUGIN).xml -a -n "`pkg-config --variable=xsltdir compiz-gconf`" ]; then $(ECHO) true; fi ) +schema-target := $(shell if [ -n "$(gen-schemas)" ]; then $(ECHO) $(BUILDDIR)/$(PLUGIN).xml; fi ) +schema-output := $(shell if [ -n "$(gen-schemas)" ]; then $(ECHO) $(BUILDDIR)/compiz-$(PLUGIN).schema; fi ) + +ifeq ($(BUILD_GLOBAL),true) + pkg-target := $(shell if [ -e compiz-$(PLUGIN).pc.in -a -n "$(PREFIX)" -a -d "$(PREFIX)" ]; then $(ECHO) "$(BUILDDIR)/compiz-$(PLUGIN).pc"; fi ) + hdr-install-target := $(shell if [ -e compiz-$(PLUGIN).pc.in -a -n "$(PREFIX)" -a -d "$(PREFIX)" -a -e $(PLUGIN).h ]; then $(ECHO) "$(PLUGIN).h"; fi ) +endif + +# find all the object files + +c-objs := $(patsubst %.c,%.lo,$(shell find -name '*.c' 2> /dev/null | grep -v "$(BUILDDIR)/" | sed -e 's/^.\///')) +c-objs += $(patsubst %.cpp,%.lo,$(shell find -name '*.cpp' 2> /dev/null | grep -v "$(BUILDDIR)/" | sed -e 's/^.\///')) +c-objs += $(patsubst %.cxx,%.lo,$(shell find -name '*.cxx' 2> /dev/null | grep -v "$(BUILDDIR)/" | sed -e 's/^.\///')) +c-objs := $(filter-out $(bcop-target-src:.c=.lo),$(c-objs)) + +h-files := $(shell find -name '*.h' 2> /dev/null | grep -v "$(BUILDDIR)/" | sed -e 's/^.\///') +h-files += $(bcop-target-hdr) +h-files += $(shell pkg-config --variable=includedir compiz)/compiz/compiz.h + +all-c-objs := $(addprefix $(BUILDDIR)/,$(c-objs)) +all-c-objs += $(bcop-target-src:.c=.lo) + +# additional files + +data-files := $(shell find data/ -name '*' -type f 2> /dev/null | sed -e 's/data\///') +image-files := $(shell find images/ -name '*' -type f 2> /dev/null | sed -e 's/images\///') + +# system include path parameter, -isystem doesn't work on old gcc's +inc-path-param = $(shell if [ -z "`gcc --version | head -n 1 | grep ' 3'`" ]; then $(ECHO) "-isystem"; else $(ECHO) "-I"; fi) + +# default color settings +color := $(shell if [ $$TERM = "dumb" ]; then $(ECHO) "no"; else $(ECHO) "yes"; fi) + +# +# Do it. +# + +.PHONY: $(BUILDDIR) build-dir trans-target bcop-build pkg-creation schema-creation c-build-objs c-link-plugin + +all: $(BUILDDIR) build-dir trans-target bcop-build pkg-creation schema-creation c-build-objs c-link-plugin + +trans-build: $(trans-target) + +bcop-build: $(bcop-target-hdr) $(bcop-target-src) + +schema-creation: $(schema-output) + +c-build-objs: $(all-c-objs) + +c-link-plugin: $(BUILDDIR)/lib$(PLUGIN).la + +pkg-creation: $(pkg-target) + +# +# Create build directory +# + +$(BUILDDIR) : + @mkdir -p $(BUILDDIR) + +$(DESTDIR) : + @mkdir -p $(DESTDIR) + +# +# fallback if xml.in doesn't exists +# +$(BUILDDIR)/%.xml: %.xml + @cp $< $@ + +# +# Translating +# +$(BUILDDIR)/%.xml: %.xml.in + @if [ -d $(POFILEDIR) ]; then \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e -n "\033[0;1;5mtranslate \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "translate $< -> $@"; \ + fi; \ + intltool-merge -x -u $(POFILEDIR) $< $@ > /dev/null; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mtranslate : \033[34m$< -> $@\033[0m"; \ + fi; \ + else \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e -n "\033[0;1;5mconvert \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "convert $< -> $@"; \ + fi; \ + cat $< | sed -e 's;<_;<;g' -e 's;</_;</;g' > $@; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mconvert : \033[34m$< -> $@\033[0m"; \ + fi; \ + fi + +# +# BCOP'ing + +$(BUILDDIR)/%_options.h: $(BUILDDIR)/%.xml + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e -n "\033[0;1;5mbcop'ing \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "bcop'ing $< -> $@"; \ + fi + @$(BCOP) --header=$@ $< + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mbcop'ing : \033[34m$< -> $@\033[0m"; \ + fi + +$(BUILDDIR)/%_options.c: $(BUILDDIR)/%.xml + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e -n "\033[0;1;5mbcop'ing \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "bcop'ing $< -> $@"; \ + fi + @$(BCOP) --source=$@ $< + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mbcop'ing : \033[34m$< -> $@\033[0m"; \ + fi + +# +# Schema generation + +$(BUILDDIR)/compiz-%.schema: $(BUILDDIR)/%.xml + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e -n "\033[0;1;5mschema'ing\033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "schema'ing $< -> $@"; \ + fi + @xsltproc `pkg-config --variable=xsltdir compiz-gconf`/schemas.xslt $< > $@ + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mschema : \033[34m$< -> $@\033[0m"; \ + fi + +# +# pkg config file generation + +$(BUILDDIR)/compiz-%.pc: compiz-%.pc.in + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e -n "\033[0;1;5mpkgconfig \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "pkgconfig $< -> $@"; \ + fi + @COMPIZREQUIRES=`cat $(PKGDIR)/compiz.pc | grep Requires | sed -e 's;Requires: ;;g'`; \ + COMPIZCFLAGS=`cat $(PKGDIR)/compiz.pc | grep Cflags | sed -e 's;Cflags: ;;g'`; \ + sed -e 's;@prefix@;$(PREFIX);g' -e 's;\@libdir@;$(CLIBDIR);g' \ + -e 's;@includedir@;$(CINCDIR);g' -e 's;\@VERSION@;0.0.1;g' \ + -e "s;@COMPIZ_REQUIRES@;$$COMPIZREQUIRES;g" \ + -e "s;@COMPIZ_CFLAGS@;$$COMPIZCFLAGS;g" $< > $@; + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mpkgconfig : \033[34m$< -> $@\033[0m"; \ + fi + +# +# Compiling +# + +$(BUILDDIR)/%.lo: %.c $(h-files) + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5mcompiling \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "compiling $< -> $@"; \ + fi + @$(LIBTOOL) --quiet --mode=compile $(CC) $(CFLAGS) $(DEFINES) -I$(BUILDDIR) -c -o $@ $< + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mcompiling : \033[34m$< -> $@\033[0m"; \ + fi + +$(BUILDDIR)/%.lo: $(BUILDDIR)/%.c $(h-files) + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5mcompiling \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "compiling $< -> $@"; \ + fi + @$(LIBTOOL) --quiet --mode=compile $(CC) $(CFLAGS) $(DEFINES) -I$(BUILDDIR) -c -o $@ $< + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mcompiling : \033[34m$< -> $@\033[0m"; \ + fi + +$(BUILDDIR)/%.lo: %.cpp $(h-files) + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5mcompiling \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "compiling $< -> $@"; \ + fi + @$(LIBTOOL) --quiet --mode=compile $(CPP) $(CFLAGS) $(DEFINES) -I$(BUILDDIR) -c -o $@ $< + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mcompiling : \033[34m$< -> $@\033[0m"; \ + fi + +$(BUILDDIR)/%.lo: %.cxx $(h-files) + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5mcompiling \033[0m: \033[0;32m$< \033[0m-> \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "compiling $< -> $@"; \ + fi + @$(LIBTOOL) --quiet --mode=compile $(CPP) $(CFLAGS) $(DEFINES) -I$(BUILDDIR) -c -o $@ $< + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mcompiling : \033[34m$< -> $@\033[0m"; \ + fi + +# +# Linking +# + +cxx-rpath-prefix := -Wl,-rpath, + +$(BUILDDIR)/lib$(PLUGIN).la: $(all-c-objs) + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e -n "\033[0;1;5mlinking \033[0m: \033[0;31m$@\033[0m"; \ + else \ + $(ECHO) "linking : $@"; \ + fi + @$(LIBTOOL) --quiet --mode=link $(CC) $(LDFLAGS) -rpath $(DESTDIR) -o $@ $(all-c-objs) + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mlinking : \033[34m$@\033[0m"; \ + fi + + +clean: + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e -n "\033[0;1;5mremoving \033[0m: \033[0;31m./$(BUILDDIR)\033[0m"; \ + else \ + $(ECHO) "removing : ./$(BUILDDIR)"; \ + fi + @rm -rf $(BUILDDIR) + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0mremoving : \033[34m./$(BUILDDIR)\033[0m"; \ + fi + + +install: $(DESTDIR) all + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5minstall \033[0m: \033[0;31m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \ + else \ + $(ECHO) "install : $(DESTDIR)/lib$(PLUGIN).so"; \ + fi + @mkdir -p $(DESTDIR) + @$(INSTALL) $(BUILDDIR)/.libs/lib$(PLUGIN).so $(DESTDIR)/lib$(PLUGIN).so + @if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0minstall : \033[34m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \ + fi + @if [ -e $(BUILDDIR)/$(PLUGIN).xml ]; then \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5minstall \033[0m: \033[0;31m$(XMLDIR)/$(PLUGIN).xml\033[0m"; \ + else \ + $(ECHO) "install : $(XMLDIR)/$(PLUGIN).xml"; \ + fi; \ + mkdir -p $(XMLDIR); \ + cp $(BUILDDIR)/$(PLUGIN).xml $(XMLDIR)/$(PLUGIN).xml; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0minstall : \033[34m$(XMLDIR)/$(PLUGIN).xml\033[0m"; \ + fi; \ + fi + @if [ -n "$(hdr-install-target)" ]; then \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5minstall \033[0m: \033[0;31m$(CINCDIR)/compiz/$(hdr-install-target)\033[0m"; \ + else \ + $(ECHO) "install : $(CINCDIR)/compiz/$(hdr-install-target)"; \ + fi; \ + cp $(hdr-install-target) $(CINCDIR)/compiz/$(hdr-install-target); \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0minstall : \033[34m$(CINCDIR)/compiz/$(hdr-install-target)\033[0m"; \ + fi; \ + fi + @if [ -n "$(pkg-target)" ]; then \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5minstall \033[0m: \033[0;31m$(PKGDIR)/compiz-$(PLUGIN).pc\033[0m"; \ + else \ + $(ECHO) "install : $(PKGDIR)/compiz-$(PLUGIN).pc"; \ + fi; \ + cp $(pkg-target) $(PKGDIR)/compiz-$(PLUGIN).pc; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0minstall : \033[34m$(PKGDIR)/compiz-$(PLUGIN).pc\033[0m"; \ + fi; \ + fi + @if [ -n "$(schema-output)" -a -e "$(schema-output)" ]; then \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5minstall \033[0m: \033[0;31m$(schema-output)\033[0m"; \ + else \ + $(ECHO) "install : $(schema-output)"; \ + fi; \ + gconftool-2 --install-schema-file=$(schema-output) > /dev/null; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0minstall : \033[34m$(schema-output)\033[0m"; \ + fi; \ + fi + @if [ -n "$(data-files)" ]; then \ + mkdir -p $(DATADIR); \ + for FILE in $(data-files); do \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5minstall \033[0m: \033[0;31m$(DATADIR)/$$FILE\033[0m"; \ + else \ + $(ECHO) "install : $(DATADIR)/$$FILE"; \ + fi; \ + cp data/$$FILE $(DATADIR)/$$FILE; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0minstall : \033[34m$(DATADIR)/$$FILE\033[0m"; \ + fi; \ + done \ + fi + @if [ -n "$(image-files)" ]; then \ + mkdir -p $(IMAGEDIR); \ + for FILE in $(image-files); do \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5minstall \033[0m: \033[0;31m$(IMAGEDIR)/$$FILE\033[0m"; \ + else \ + $(ECHO) "install : $(IMAGEDIR)/$$FILE"; \ + fi; \ + cp images/$$FILE $(IMAGEDIR)/$$FILE; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0minstall : \033[34m$(IMAGEDIR)/$$FILE\033[0m"; \ + fi; \ + done \ + fi + +uninstall: + @if [ -e $(DESTDIR)/lib$(PLUGIN).so ]; then \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \ + else \ + $(ECHO) "uninstall : $(DESTDIR)/lib$(PLUGIN).so"; \ + fi; \ + rm -f $(DESTDIR)/lib$(PLUGIN).so; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0muninstall : \033[34m$(DESTDIR)/lib$(PLUGIN).so\033[0m"; \ + fi; \ + fi + @if [ -e $(XMLDIR)/$(PLUGIN).xml ]; then \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(XMLDIR)/$(PLUGIN).xml\033[0m"; \ + else \ + $(ECHO) "uninstall : $(XMLDIR)/$(PLUGIN).xml"; \ + fi; \ + rm -f $(XMLDIR)/$(PLUGIN).xml; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0muninstall : \033[34m$(XMLDIR)/$(PLUGIN).xml\033[0m"; \ + fi; \ + fi + @if [ -n "$(hdr-install-target)" -a -e $(CINCDIR)/compiz/$(hdr-install-target) ]; then \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(CINCDIR)/compiz/$(hdr-install-target)\033[0m"; \ + else \ + $(ECHO) "uninstall : $(CINCDIR)/compiz/$(hdr-install-target)"; \ + fi; \ + rm -f $(CINCDIR)/compiz/$(hdr-install-target); \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0muninstall : \033[34m$(CINCDIR)/compiz/$(hdr-install-target)\033[0m"; \ + fi; \ + fi + @if [ -n "$(pkg-target)" -a -e $(PKGDIR)/compiz-$(PLUGIN).pc ]; then \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(PKGDIR)/compiz-$(PLUGIN).pc\033[0m"; \ + else \ + $(ECHO) "uninstall : $(PKGDIR)/compiz-$(PLUGIN).pc"; \ + fi; \ + rm -f $(PKGDIR)/compiz-$(PLUGIN).pc; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0muninstall : \033[34m$(PKGDIR)/compiz-$(PLUGIN).pc\033[0m"; \ + fi; \ + fi + @if [ -n "$(data-files)" ]; then \ + for FILE in $(data-files); do \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(DATADIR)/$$FILE\033[0m"; \ + else \ + $(ECHO) "uninstall : $(DATADIR)/$$FILE"; \ + fi; \ + rm -f $(DATADIR)/$$FILE; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0muninstall : \033[34m$(DATADIR)/$$FILE\033[0m"; \ + fi; \ + done \ + fi + @if [ -n "$(image-files)" ]; then \ + for FILE in $(image-files); do \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(IMAGEDIR)/$$FILE\033[0m"; \ + else \ + $(ECHO) "uninstall : $(IMAGEDIR)/$$FILE"; \ + fi; \ + rm -f $(IMAGEDIR)/$$FILE; \ + if [ '$(color)' != 'no' ]; then \ + $(ECHO) -e "\r\033[0muninstall : \033[34m$(IMAGEDIR)/$$FILE\033[0m"; \ + fi; \ + done \ + fi diff --git a/plugin.info b/plugin.info new file mode 100644 index 0000000..9526a54 --- a/dev/null +++ b/plugin.info @@ -0,0 +1 @@ +PLUGIN = wiitrack diff --git a/wiitrack.c b/wiitrack.c new file mode 100644 index 0000000..f84b234 --- a/dev/null +++ b/wiitrack.c @@ -0,0 +1,602 @@ +/* + * Compiz Fusion Wiimote Head Tracking Plugin + * + * Some of this code is based on Freewins + * Portions were inspired and tested on a modified + * Zoom plugin, but no code from Zoom has been taken. + * + * Plugin designed and written by: + * Kevin L. <klange@ogunderground.com> + * + */ + +#include <compiz-core.h> +#include <math.h> +#include <stdio.h> + +#include <X11/extensions/shape.h> +#include "wiitrack_options.h" + +// Macros/*{{{*/ +#define GET_WIITRACK_DISPLAY(d) \ + ((WTDisplay *) (d)->base.privates[displayPrivateIndex].ptr) + +#define WIITRACK_DISPLAY(d) \ + WTDisplay *wtd = GET_WIITRACK_DISPLAY (d) + +#define GET_WIITRACK_SCREEN(s, wtd) \ + ((WTScreen *) (s)->base.privates[(wtd)->screenPrivateIndex].ptr) + +#define WIITRACK_SCREEN(s) \ + WTScreen *wts = GET_WIITRACK_SCREEN (s, GET_WIITRACK_DISPLAY (s->display)) + +#define GET_WIITRACK_WINDOW(w, wts) \ + ((WTWindow *) (w)->base.privates[(wts)->windowPrivateIndex].ptr) + +#define WIITRACK_WINDOW(w) \ + WTWindow *wtw = GET_WIITRACK_WINDOW (w, \ + GET_WIITRACK_SCREEN (w->screen, \ + GET_WIITRACK_DISPLAY (w->screen->display))) + + +#define WIN_REAL_X(w) (w->attrib.x - w->input.left) +#define WIN_REAL_Y(w) (w->attrib.y - w->input.top) + +#define WIN_REAL_W(w) (w->width + w->input.left + w->input.right) +#define WIN_REAL_H(w) (w->height + w->input.top + w->input.bottom) + +/*}}}*/ + +typedef struct _WTDisplay{ + int screenPrivateIndex; + + HandleEventProc handleEvent; + + CompWindow *grabWindow; + CompWindow *focusWindow; + +} WTDisplay; + +typedef struct _WTHead { + float x; + float y; + float z; +} WTHead; + +typedef struct _WTScreen { + PreparePaintScreenProc preparePaintScreen; + PaintOutputProc paintOutput; + PaintWindowProc paintWindow; + CompTimeoutHandle mouseIntervalTimeoutHandle; + int mouseX; + int mouseY; + int grabIndex; + int rotatedWindows; + int windowPrivateIndex; + + DamageWindowRectProc damageWindowRect; + WTHead head; +} WTScreen; + +typedef struct _WTWindow{ + float depth; + float manualDepth; + float zDepth; + int zIndex; + Bool isAnimating; + Bool isManualDepth; + Bool grabbed; +} WTWindow; + +int displayPrivateIndex; +static CompMetadata wiitrackMetadata; + +static void WTHandleEvent(CompDisplay *d, XEvent *ev){ + + WIITRACK_DISPLAY(d); + UNWRAP(wtd, d, handleEvent); + (*d->handleEvent)(d, ev); + WRAP(wtd, d, handleEvent, WTHandleEvent); + +} +static Bool +windowIs3D (CompWindow *w) +{ + if (w->attrib.override_redirect) + return FALSE; + + if (!(w->shaded || w->attrib.map_state == IsViewable)) + return FALSE; + + if (w->state & (CompWindowStateSkipPagerMask | + CompWindowStateSkipTaskbarMask)) + return FALSE; + + if (w->state & (CompWindowStateStickyMask)) + return FALSE; + + if (w->type & (NO_FOCUS_MASK)) + return FALSE; + return TRUE; +} + +static void WTPreparePaintScreen (CompScreen *s, int msSinceLastPaint) { + CompWindow *w; + WIITRACK_SCREEN (s); + int maxDepth = 0; + for (w = s->windows; w; w = w->next) + { + WIITRACK_WINDOW (w); + if (!(WIN_REAL_X(w) + WIN_REAL_W(w) <= 0.0 || WIN_REAL_X(w) >= w->screen->width)) { + if (!(wtw->isManualDepth)) { + if (!windowIs3D (w)) + continue; + maxDepth++; }} + } + for (w = s->windows; w; w = w->next) + { + WIITRACK_WINDOW (w); + wtw->zDepth = 0.0f; + if (!(WIN_REAL_X(w) + WIN_REAL_W(w) <= 0.0 || WIN_REAL_X(w) >= w->screen->width)) { + if (!(wtw->isManualDepth)) { + if (!windowIs3D (w)) + continue; + maxDepth--; + wtw->zDepth = 0.0f - ((float)maxDepth * wiitrackGetWindowDepth(s)); + } else { + wtw->zDepth = wtw->depth; + }} + } + UNWRAP (wts, s, preparePaintScreen); + (*s->preparePaintScreen) (s, msSinceLastPaint); + WRAP (wts, s, preparePaintScreen, WTPreparePaintScreen); +} + +static Bool WTPaintWindow(CompWindow *w, const WindowPaintAttrib *attrib, + const CompTransform *transform, Region region, unsigned int mask){ + CompTransform wTransform = *transform; + Bool status; + Bool wasCulled = glIsEnabled(GL_CULL_FACE); + WIITRACK_SCREEN(w->screen); + WIITRACK_WINDOW(w); + if (!(w->type == CompWindowTypeDesktopMask)) { + if (!(WIN_REAL_X(w) + WIN_REAL_W(w) <= 0.0 || WIN_REAL_X(w) >= w->screen->width)) { + mask |= PAINT_WINDOW_TRANSFORMED_MASK; + matrixTranslate(&wTransform, 0.0, 0.0, wtw->zDepth); + } + } else { + mask |= PAINT_WINDOW_TRANSFORMED_MASK; + matrixTranslate(&wTransform, 0.0, 0.0, 0.0); + } + if(wasCulled) + glDisable(GL_CULL_FACE); + damageScreen(w->screen); + UNWRAP(wts, w->screen, paintWindow); + status = (*w->screen->paintWindow)(w, attrib, &wTransform, region, mask); + WRAP(wts, w->screen, paintWindow, WTPaintWindow); + + if(wasCulled) + glEnable(GL_CULL_FACE); + + return status; +} + +static Bool WTPaintOutput(CompScreen *s, const ScreenPaintAttrib *sAttrib, + const CompTransform *transform, Region region, CompOutput *output, unsigned int mask){ + + Bool status; + WIITRACK_SCREEN(s); + CompTransform zTransform = *transform; + mask |= PAINT_SCREEN_CLEAR_MASK; + + float nearPlane = 0.05; + float screenAspect = 1.0; + if (wiitrackGetFixAspect(s)) + screenAspect = wiitrackGetScreenAspect (s); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + glFrustum( nearPlane*(-0.5 * screenAspect + wts->head.x), + nearPlane*(0.5 * screenAspect + wts->head.x), + nearPlane*(-0.5 + wts->head.y), + nearPlane*(0.5 + wts->head.y), + nearPlane, 100.0); + glMatrixMode(GL_MODELVIEW); + matrixScale(&zTransform, 1.0 , 1.0, 1.0 / wts->head.z); + matrixTranslate (&zTransform, + wts->head.x, + wts->head.y, + -0.134 + 1 - wts->head.z); + glDisable (GL_CULL_FACE); + glEnable (GL_DEPTH_TEST); + + mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK; + UNWRAP (wts, s, paintOutput); + status = (*s->paintOutput) (s, sAttrib, &zTransform, region, output, mask); + WRAP (wts, s, paintOutput, WTPaintOutput); + return status; +} + +static Bool WTDamageWindowRect(CompWindow *w, Bool initial, BoxPtr rect){ + + Bool status = TRUE; + WIITRACK_SCREEN(w->screen); + if (!initial) { + REGION region; + region.rects = ®ion.extents; + region.numRects = region.size = 1; + region.extents.x1 = w->serverX; + region.extents.y1 = w->serverY; + region.extents.x2 = w->serverX + w->serverWidth; + region.extents.y2 = w->serverY + w->serverHeight; + damageScreenRegion (w->screen, ®ion); + return TRUE; + } + UNWRAP(wts, w->screen, damageWindowRect); + status = (*w->screen->damageWindowRect)(w, initial, rect); + WRAP(wts, w->screen, damageWindowRect, WTDamageWindowRect); + damagePendingOnScreen (w->screen); + if (initial) { + damagePendingOnScreen(w->screen); + } + return status; +} + +/// Manual Movement Keybindings + +// Move window away from viewer +static Bool WTManualMoveAway (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + CompWindow* w; + Window xid; + + xid = getIntOptionNamed (option, nOption, "window", 0); + w = findWindowAtDisplay (d, xid); + WIITRACK_WINDOW(w); + wtw->isManualDepth = TRUE; + wtw->depth = wtw->depth - wiitrackGetWindowDepth (w->screen); + damagePendingOnScreen (w->screen); + return TRUE; +} + +// Move window closer to viewer +static Bool WTManualMoveCloser (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + CompWindow* w; + Window xid; + + xid = getIntOptionNamed (option, nOption, "window", 0); + w = findWindowAtDisplay (d, xid); + WIITRACK_WINDOW(w); + wtw->isManualDepth = TRUE; + wtw->depth = wtw->depth + wiitrackGetWindowDepth (w->screen); + damagePendingOnScreen (w->screen); + return TRUE; +} + +// Reset window +static Bool WTManualReset (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + CompWindow* w; + Window xid; + + xid = getIntOptionNamed (option, nOption, "window", 0); + w = findWindowAtDisplay (d, xid); + WIITRACK_WINDOW(w); + wtw->depth = 0.0f; + wtw->isManualDepth = FALSE; + damagePendingOnScreen (w->screen); + return TRUE; +} + +/// Head Movement (Debug) +static Bool WTDebugCameraForward (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + if (wiitrackGetDebugEnabled (d)) { + CompScreen *s; + Window xid; + xid = getIntOptionNamed (option, nOption, "root", 0); + s = findScreenAtDisplay (d, xid); + if (s){ + WIITRACK_SCREEN (s); + wts->head.z = wts->head.z - wiitrackGetCameraMove (s); + } + } + return TRUE; +} +static Bool WTDebugCameraBack (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + if (wiitrackGetDebugEnabled (d)) { + CompScreen *s; + Window xid; + xid = getIntOptionNamed (option, nOption, "root", 0); + s = findScreenAtDisplay (d, xid); + if (s){ + WIITRACK_SCREEN (s); + wts->head.z = wts->head.z + wiitrackGetCameraMove (s); + } + } + return TRUE; +} +static Bool WTDebugCameraLeft (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + if (wiitrackGetDebugEnabled (d)) { + CompScreen *s; + Window xid; + xid = getIntOptionNamed (option, nOption, "root", 0); + s = findScreenAtDisplay (d, xid); + if (s){ + WIITRACK_SCREEN (s); + wts->head.x = wts->head.x + wiitrackGetCameraMove (s); + } + } + return TRUE; +} +static Bool WTDebugCameraRight (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + if (wiitrackGetDebugEnabled (d)) { + CompScreen *s; + Window xid; + xid = getIntOptionNamed (option, nOption, "root", 0); + s = findScreenAtDisplay (d, xid); + if (s){ + WIITRACK_SCREEN (s); + wts->head.x = wts->head.x - wiitrackGetCameraMove (s); + } + } + return TRUE; +} +static Bool WTDebugCameraUp (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + if (wiitrackGetDebugEnabled (d)) { + CompScreen *s; + Window xid; + xid = getIntOptionNamed (option, nOption, "root", 0); + s = findScreenAtDisplay (d, xid); + if (s){ + WIITRACK_SCREEN (s); + wts->head.y = wts->head.y - wiitrackGetCameraMove (s); + } + } + return TRUE; +} +static Bool WTDebugCameraDown (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + if (wiitrackGetDebugEnabled (d)) { + CompScreen *s; + Window xid; + xid = getIntOptionNamed (option, nOption, "root", 0); + s = findScreenAtDisplay (d, xid); + if (s){ + WIITRACK_SCREEN (s); + wts->head.y = wts->head.y + wiitrackGetCameraMove (s); + } + } + return TRUE; +} +static Bool WTDebugCameraReset (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption) { + if (wiitrackGetDebugEnabled (d)) { + CompScreen *s; + Window xid; + xid = getIntOptionNamed (option, nOption, "root", 0); + s = findScreenAtDisplay (d, xid); + if (s){ + WIITRACK_SCREEN (s); + wts->head.y = 0.0f; + wts->head.x = 0.0f; + wts->head.z = 1.0f; + } + } + return TRUE; +} + +static Bool WTSetHeadPosition (CompDisplay *d, CompAction *action, + CompActionState state, CompOption *option, int nOption, + float x, float y, float z) { + if (wiitrackGetDebugEnabled (d)) { + CompScreen *s; + Window xid; + xid = getIntOptionNamed (option, nOption, "root", 0); + s = findScreenAtDisplay (d, xid); + if (s){ + WIITRACK_SCREEN (s); + wts->head.y = y; + wts->head.x = x; + wts->head.z = z; + } + } + return TRUE; +} + + + + + +static Bool wiitrackInitWindow(CompPlugin *p, CompWindow *w){ + WTWindow *wtw; + WIITRACK_SCREEN(w->screen); + + if( !(wtw = (WTWindow*)malloc( sizeof(WTWindow) )) ) + return FALSE; + + wtw->depth = 0.0; + wtw->zDepth = 0.0; + wtw->isManualDepth = FALSE; + wtw->manualDepth = 0.0; + wtw->grabbed = 0; + + w->base.privates[wts->windowPrivateIndex].ptr = wtw; + + return TRUE; +} + +static void wiitrackFiniWindow(CompPlugin *p, CompWindow *w){ + + WIITRACK_WINDOW(w); + WIITRACK_DISPLAY(w->screen->display); + + wtw->depth = 0.0; + + + if(wtd->grabWindow == w){ + wtd->grabWindow = NULL; + } + + free(wtw); +} +/*}}}*/ + +// Screen init / clean/*{{{*/ +static Bool wiitrackInitScreen(CompPlugin *p, CompScreen *s){ + WTScreen *wts; + + WIITRACK_DISPLAY(s->display); + + if( !(wts = (WTScreen*)malloc( sizeof(WTScreen) )) ) + return FALSE; + + if( (wts->windowPrivateIndex = allocateWindowPrivateIndex(s)) < 0){ + free(wts); + return FALSE; + } + + wts->grabIndex = 0; + wts->head.x = 0.0; + wts->head.y = 0.0; + wts->head.z = 1.0; + + + s->base.privates[wtd->screenPrivateIndex].ptr = wts; + WRAP(wts, s, preparePaintScreen, WTPreparePaintScreen); + WRAP(wts, s, paintWindow, WTPaintWindow); + WRAP(wts, s, paintOutput, WTPaintOutput); + + WRAP(wts, s, damageWindowRect, WTDamageWindowRect); + + return TRUE; +} + +static void wiitrackFiniScreen(CompPlugin *p, CompScreen *s){ + + WIITRACK_SCREEN(s); + + freeWindowPrivateIndex(s, wts->windowPrivateIndex); + + UNWRAP(wts, s, preparePaintScreen); + UNWRAP(wts, s, paintWindow); + UNWRAP(wts, s, paintOutput); + + + UNWRAP(wts, s, damageWindowRect); + + free(wts); +} +/*}}}*/ + +// Display init / clean/*{{{*/ +static Bool wiitrackInitDisplay(CompPlugin *p, CompDisplay *d){ + + WTDisplay *wtd; + + if( !(wtd = (WTDisplay*)malloc( sizeof(WTDisplay) )) ) + return FALSE; + + // Set variables correctly + wtd->grabWindow = 0; + wtd->focusWindow = 0; + + if( (wtd->screenPrivateIndex = allocateScreenPrivateIndex(d)) < 0 ){ + free(wtd); + return FALSE; + } + + /* BCOP Action initiation + wiitrackSetResetKeyInitiate(d, resetWTRotation); + + // Rotate / Scale Up Down Left Right + wiitrackSetScaleUpKeyInitiate(d, WTScaleUp); + wiitrackSetScaleDownKeyInitiate(d, WTScaleDown); + + */ + wiitrackSetManualOutInitiate(d, WTManualMoveAway); + wiitrackSetManualInInitiate(d, WTManualMoveCloser); + wiitrackSetManualResetInitiate(d, WTManualReset); + wiitrackSetCameraInInitiate(d, WTDebugCameraForward); + wiitrackSetCameraOutInitiate(d, WTDebugCameraBack); + wiitrackSetCameraLeftInitiate(d, WTDebugCameraLeft); + wiitrackSetCameraRightInitiate(d, WTDebugCameraRight); + wiitrackSetCameraUpInitiate(d, WTDebugCameraUp); + wiitrackSetCameraDownInitiate(d, WTDebugCameraDown); + wiitrackSetCameraResetInitiate(d, WTDebugCameraReset); + d->base.privates[displayPrivateIndex].ptr = wtd; + WRAP(wtd, d, handleEvent, WTHandleEvent); + + return TRUE; +} + +static void wiitrackFiniDisplay(CompPlugin *p, CompDisplay *d){ + + WIITRACK_DISPLAY(d); + + freeScreenPrivateIndex(d, wtd->screenPrivateIndex); + + UNWRAP(wtd, d, handleEvent); + + free(wtd); +} +/*}}}*/ + +// Object init / clean +static CompBool wiitrackInitObject(CompPlugin *p, CompObject *o){ + + static InitPluginObjectProc dispTab[] = { + (InitPluginObjectProc) 0, // InitCore + (InitPluginObjectProc) wiitrackInitDisplay, + (InitPluginObjectProc) wiitrackInitScreen, + (InitPluginObjectProc) wiitrackInitWindow + }; + + RETURN_DISPATCH(o, dispTab, ARRAY_SIZE(dispTab), TRUE, (p, o)); +} + +static void wiitrackFiniObject(CompPlugin *p, CompObject *o){ + + static FiniPluginObjectProc dispTab[] = { + (FiniPluginObjectProc) 0, // FiniCore + (FiniPluginObjectProc) wiitrackFiniDisplay, + (FiniPluginObjectProc) wiitrackFiniScreen, + (FiniPluginObjectProc) wiitrackFiniWindow + }; + + DISPATCH(o, dispTab, ARRAY_SIZE(dispTab), (p, o)); +} + +// Plugin init / clean +static Bool wiitrackInit(CompPlugin *p){ + if( (displayPrivateIndex = allocateDisplayPrivateIndex()) < 0 ) + return FALSE; + + compAddMetadataFromFile (&wiitrackMetadata, p->vTable->name); + + return TRUE; +} + +static void wiitrackFini(CompPlugin *p){ + if(displayPrivateIndex >= 0) + freeDisplayPrivateIndex( displayPrivateIndex ); +} + +// Plugin implementation export +CompPluginVTable wiitrackVTable = { + "wiitrack", + 0, + wiitrackInit, + wiitrackFini, + wiitrackInitObject, + wiitrackFiniObject, + 0, + 0 +}; + +CompPluginVTable *getCompPluginInfo (void){ return &wiitrackVTable; } + diff --git a/wiitrack.xml.in b/wiitrack.xml.in new file mode 100644 index 0000000..55a9d7e --- a/dev/null +++ b/wiitrack.xml.in @@ -0,0 +1,164 @@ +<?xml version="1.0" encoding="UTF-8"?> +<compiz> + <plugin name="wiitrack" useBcop="true"> + <_short>WiiTrack</_short> + <_long>Create a true 3d desktop with a Wiimote some IR-enabled shades.</_long> + <category>Effects</category> + <deps> + <relation type="after"> + <plugin>cube</plugin> + </relation> + </deps> + <display> + <group> + <_short>WiiTrack</_short> + <subgroup> + <_short>Keybindings</_short> + <option type="key" name="toggle_projection"> + <_short>Toggle Projection</_short> + <_long>Enable/disable 3d projection on the fly</_long> + <default><Alt><Super>n</default> + </option> + <option type="key" name="toggle_depth"> + <_short>Toggle Depth</_short> + <_long>Enable/disable Z-based window depth</_long> + <default><Alt><Super>m</default> + </option> + <option type="key" name="manual_in"> + <_short>Move Window Closer</_short> + <_long>Manually move a window closer. Z-depth is ignored</_long> + <default><Alt><Super>Page_Down</default> + </option> + <option type="key" name="manual_out"> + <_short>Move Window Away</_short> + <_long>Manually move a window further out. Z-depth is ignored</_long> + <default><Alt><Super>Page_Up</default> + </option> + <option type="key" name="manual_reset"> + <_short>Reset Window Depth</_short> + <_long>Reset the window's depth so it uses Z level</_long> + <default><Alt><Super>Home</default> + </option> + </subgroup> + <subgroup> + <_short>Debugging</_short> + <option type="bool" name="debug_enabled"> + <_short>Enable debugging keys</_short> + <_long>Enable the debugging key combinations</_long> + <default>false</default> + </option> + <option type="key" name="camera_up"> + <_short>Camera up</_short> + <_long>Manually move camera up</_long> + <default><Alt><Super>w</default> + </option> + <option type="key" name="camera_down"> + <_short>Camera down</_short> + <_long>Manually move camera down</_long> + <default><Alt><Super>s</default> + </option> + <option type="key" name="camera_left"> + <_short>Camera left</_short> + <_long>Manually move camera left</_long> + <default><Alt><Super>a</default> + </option> + <option type="key" name="camera_right"> + <_short>Camera right</_short> + <_long>Manually move camera right</_long> + <default><Alt><Super>d</default> + </option> + <option type="key" name="camera_in"> + <_short>Camera in</_short> + <_long>Manually move camera closer to screen</_long> + <default><Alt><Super>e</default> + </option> + <option type="key" name="camera_out"> + <_short>Camera out</_short> + <_long>Manually move camera away from screen</_long> + <default><Alt><Super>q</default> + </option> + <option type="key" name="camera_reset"> + <_short>Camera reset</_short> + <_long>Reset camera to default head position</_long> + <default><Alt><Super>r</default> + </option> + </subgroup> + </group> + <group> + <_short>Wiimote Setup</_short> + <option type="key" name="random_leds"> + <_short>Active LEDs</_short> + <_long>Active the Wiimote's LEDs</_long> + <default><Alt><Super>z</default> + </option> + </group> + </display> + <screen> + <group> + <_short>WiiTrack</_short> + <option type="float" name="window_depth"> + <_short>Window depth</_short> + <_long>How far apart windows are when stacked based on Z level</_long> + <default>0.1</default> + <min>0.001</min> + <max>1.0</max> + </option> + <subgroup> + <_short>Debugging</_short> + <option type="float" name="camera_move"> + <_short>Camera move increment</_short> + <_long>How far to move the camera on one key press</_long> + <default>0.1</default> + <min>0.001</min> + <max>0.5</max> + </option> + </subgroup> + <subgroup> + <_short>Aspect Ratio</_short> + <option type="bool" name="fix_aspect"> + <_short>Fix aspect ratio</_short> + <_long>Stretch the screen to fix the aspect ration</_long> + <default>false</default> + </option> + <option type="float" name="screen_aspect"> + <_short>Aspect ratio</_short> + <_long>This should be less than one. 16:9 is 0.5625</_long> + <default>0.5625</default> + <min>0.1</min> + <max>2.0</max> + </option> + </subgroup> + </group> + <group> + <_short>Wiimote Setup</_short> + <option type="bool" name="enable_wiimote"> + <_short>Enable Wiimote tracking</_short> + <_long>Enable interaction with Wiimote</_long> + <default>false</default> + </option> + <option type="string" name="wiimote_id"> + <_short>Wiimote Bluetooth ID</_short> + <_long>Wiimote unique BT ID</_long> + <default>00:00:00:00:00</default> + </option> + <subgroup> + <_short>Wiimote Configurator Values</_short> + <option type="float" name="screen_size"> + <_short>Screen Size</_short> + <_long>Returned by Wiimote Configurator</_long> + <default>0.5</default> + <min>0.1</min> + <max>1.0</max> + </option> + <option type="float" name="default_depth"> + <_short>Default Depth</_short> + <_long>Default head depth as returned by Wiimote Configurator</_long> + <default>1.0</default> + <min>0.1</min> + <max>100.0</max> + </option> + </subgroup> + </group> + </screen> +</plugin> +</compiz> |
