summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--Makefile533
-rw-r--r--animationsim.h252
-rw-r--r--animationsim.xml.in6
-rw-r--r--bounce.c128
-rw-r--r--explode3d.c116
-rw-r--r--flyin.c133
-rw-r--r--plugin.info2
-rw-r--r--rotatein.c293
-rwxr-xr-xsetupbuild8
-rw-r--r--sheet.c295
-rw-r--r--src/animationsim.cpp (renamed from animationsim.c)137
-rw-r--r--src/animationsim.h315
-rw-r--r--src/bounce.cpp76
-rw-r--r--src/expand-piecewise.cpp (renamed from expand-piecewise.c)81
-rw-r--r--src/expand.cpp (renamed from expand.c)70
-rw-r--r--src/flyin.cpp87
-rw-r--r--src/rotatein.cpp228
-rw-r--r--src/sheet.cpp277
19 files changed, 1161 insertions, 1882 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3cbbcaa..4396932 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,8 @@
+find_package (Compiz REQUIRED)
+
include (FindOpenGL)
-include (CompizFusion)
+include (CompizPlugin)
if (OPENGL_GLU_FOUND)
- compiz_fusion_plugin (animationsim PLUGINDEPS animationaddon LIBRARIES ${OPENGL_glu_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR})
+ compiz_plugin (animationsim PLUGINDEPS composite opengl animation LIBRARIES ${OPENGL_glu_LIBRARY} INCDIRS ${OPENGL_INCLUDE_DIR})
endif (OPENGL_GLU_FOUND)
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 7ef8a59..0000000
--- a/Makefile
+++ /dev/null
@@ -1,533 +0,0 @@
-##
-#
-# 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
-# CHK_HEADERS = compiz-cube.h
-#
-
-#load config file
-
-ECHO = `which echo`
-
-# default color settings
-color := $(shell if [ $$TERM = "dumb" ]; then $(ECHO) "no"; else $(ECHO) "yes"; fi)
-
-ifeq ($(shell if [ -f plugin.info ]; then $(ECHO) -n "found"; fi ),found)
-include plugin.info
-else
-$(error $(shell if [ '$(color)' != 'no' ]; then \
- $(ECHO) -e "\033[1;31m[ERROR]\033[0m \"plugin.info\" file not found"; \
- else \
- $(ECHO) "[ERROR] \"plugin.info\" file not found"; \
- fi;))
-endif
-
-ifneq ($(shell if pkg-config --exists compiz; then $(ECHO) -n "found"; fi ),found)
-$(error $(shell if [ '$(color)' != 'no' ]; then \
- $(ECHO) -e -n "\033[1;31m[ERROR]\033[0m Compiz not installed"; \
- else \
- $(ECHO) -n "[ERROR] Compiz not installed"; \
- fi))
-endif
-
-
-ifneq ($(shell if [ -n "$(PKG_DEP)" ]; then if pkg-config --exists $(PKG_DEP); then $(ECHO) -n "found"; fi; \
- else $(ECHO) -n "found"; fi ),found)
-$(error $(shell if [ '$(color)' != 'no' ]; then \
- $(ECHO) -e -n "\033[1;31m[ERROR]\033[0m "; \
- else \
- $(ECHO) -n "[ERROR] "; \
- fi; \
- pkg-config --print-errors --short-errors --errors-to-stdout $(PKG_DEP); ))
-endif
-
-
-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
-
-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 )
-
-COMPIZ_HEADERS = compiz.h compiz-core.h
-COMPIZ_INC = $(shell pkg-config --variable=includedir compiz)/compiz/
-
-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 compiz-$(PLUGIN).h ]; then $(ECHO) "compiz-$(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 += $(foreach file,$(COMPIZ_HEADERS) $(CHK_HEADERS),$(shell $(ECHO) -n "$(COMPIZ_INC)$(file)"))
-
-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)
-
-# Tests
-ifeq ($(shell if [ -n "$(is-bcop-target)" -a -z "$(BCOP)" ]; then $(ECHO) -n "error"; fi ),error)
-$(error $(shell if [ '$(color)' != 'no' ]; then \
- $(ECHO) -e -n "\033[1;31m[ERROR]\033[0m BCOP not installed but is needed to build plugin"; \
- else \
- $(ECHO) -n "[ERROR] BCOP not installed but is needed to build plugin"; \
- fi))
-endif
-
-ifeq ($(shell if [ "x$(BUILD_GLOBAL)" != "xtrue" -a -e compiz-$(PLUGIN).pc.in ]; then $(ECHO) -n "warn"; fi ),warn)
-$(warning $(shell if [ '$(color)' != 'no' ]; then \
- $(ECHO) -e -n "\033[1;31m[WARNING]\033[0m This plugin might be needed by other plugins. Install it with \"BUILD_GLOBAL=true sudo make install\" "; \
- else \
- $(ECHO) -n "[WARNING] This plugin might be needed by other plugins. Install it with \"BUILD_GLOBAL=true sudo make install\""; \
- fi))
-endif
-
-#
-# 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); \
- $(INSTALL) $(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; \
- $(INSTALL) --mode=u=rw,go=r,a-s $(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; \
- $(INSTALL) --mode=u=rw,go=r,a-s $(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; \
- if [ "x$(USER)" = "xroot" ]; then \
- GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
- gconftool-2 --makefile-install-rule $(schema-output) > /dev/null; \
- else \
- gconftool-2 --install-schema-file=$(schema-output) > /dev/null; \
- fi; \
- 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; \
- FILEDIR="$(DATADIR)/`dirname "$$FILE"`"; \
- mkdir -p "$$FILEDIR"; \
- $(INSTALL) --mode=u=rw,go=r,a-s 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; \
- FILEDIR="$(IMAGEDIR)/`dirname "$$FILE"`"; \
- mkdir -p "$$FILEDIR"; \
- $(INSTALL) --mode=u=rw,go=r,a-s 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 "$(schema-output)" -a -e "$(schema-output)" -a 'x$(USER)' = 'xroot' ]; then \
- if [ '$(color)' != 'no' ]; then \
- $(ECHO) -n -e "\033[0;1;5muninstall \033[0m: \033[0;31m$(schema-output)\033[0m"; \
- else \
- $(ECHO) "uninstall : $(schema-output)"; \
- fi; \
- GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
- gconftool-2 --makefile-uninstall-rule $(schema-output) > /dev/null; \
- if [ '$(color)' != 'no' ]; then \
- $(ECHO) -e "\r\033[0muninstall : \033[34m$(schema-output)\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/animationsim.h b/animationsim.h
deleted file mode 100644
index 80c1d20..0000000
--- a/animationsim.h
+++ /dev/null
@@ -1,252 +0,0 @@
-#define _GNU_SOURCE
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include <compiz-core.h>
-#include <compiz-animation.h>
-
-extern int animDisplayPrivateIndex;
-extern CompMetadata animMetadata;
-
-extern AnimEffect AnimEffectFlyIn;
-extern AnimEffect AnimEffectBounce;
-extern AnimEffect AnimEffectRotateIn;
-extern AnimEffect AnimEffectSheets;
-extern AnimEffect AnimEffectExpand;
-extern AnimEffect AnimEffectExpandPW;
-
-#define NUM_EFFECTS 6
-
-typedef enum
-{
- // Effect settings
- ANIMSIM_SCREEN_OPTION_BOUNCE_MAX_SIZE,
- ANIMSIM_SCREEN_OPTION_BOUNCE_MIN_SIZE,
- ANIMSIM_SCREEN_OPTION_BOUNCE_NUMBER,
- ANIMSIM_SCREEN_OPTION_BOUNCE_FADE,
- ANIMSIM_SCREEN_OPTION_FLYIN_DIRECTION,
- ANIMSIM_SCREEN_OPTION_FLYIN_DIRECTION_X,
- ANIMSIM_SCREEN_OPTION_FLYIN_DIRECTION_Y,
- ANIMSIM_SCREEN_OPTION_FLYIN_FADE,
- ANIMSIM_SCREEN_OPTION_FLYIN_DISTANCE,
- ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE,
- ANIMSIM_SCREEN_OPTION_ROTATEIN_DIRECTION,
- ANIMSIM_SCREEN_OPTION_SHEET_START_PERCENT,
- ANIMSIM_SCREEN_OPTION_EXPANDPW_HORIZ_FIRST,
- ANIMSIM_SCREEN_OPTION_EXPANDPW_INITIAL_HORIZ,
- ANIMSIM_SCREEN_OPTION_EXPANDPW_INITIAL_VERT,
- ANIMSIM_SCREEN_OPTION_EXPANDPW_DELAY,
-
- ANIMSIM_SCREEN_OPTION_NUM
-} AnimSimScreenOptions;
-
-// This must have the value of the first "effect setting" above
-// in AnimSimScreenOptions
-#define NUM_NONEFFECT_OPTIONS 0
-
-typedef enum _AnimSimDisplayOptions
-{
- ANIMSIM_DISPLAY_OPTION_ABI = 0,
- ANIMSIM_DISPLAY_OPTION_INDEX,
- ANIMSIM_DISPLAY_OPTION_NUM
-} AnimSimDisplayOptions;
-
-typedef struct _WaveParam
-{
- float halfWidth;
- float amp;
- float pos;
-} WaveParam;
-
-typedef struct _AnimSimDisplay
-{
- int screenPrivateIndex;
- AnimBaseFunctions *animBaseFunc;
-
- CompOption opt[ANIMSIM_DISPLAY_OPTION_NUM];
-} AnimSimDisplay;
-
-typedef struct _AnimSimScreen
-{
- int windowPrivateIndex;
-
- CompOutput *output;
-
- CompOption opt[ANIMSIM_SCREEN_OPTION_NUM];
-} AnimSimScreen;
-
-typedef struct _AnimSimWindow
-{
- AnimWindowCommon *com;
- /* bounce props */
- int bounceCount;
- int nBounce;
- float currBounceProgress;
- float targetScale;
- float currentScale;
- float lastProgressMax;
- Bool bounceNeg;
- /* rotatein props */
- int rotatinModAngle;
- int currentCull;
- /* sheets props */
- int sheetsWaveCount;
- WaveParam *sheetsWaves;
-
-} AnimSimWindow;
-
-#define GET_ANIMSIM_DISPLAY(d) \
- ((AnimSimDisplay *) (d)->base.privates[animDisplayPrivateIndex].ptr)
-
-#define ANIMSIM_DISPLAY(d) \
- AnimSimDisplay *ad = GET_ANIMSIM_DISPLAY (d)
-
-#define GET_ANIMSIM_SCREEN(s, ad) \
- ((AnimSimScreen *) (s)->base.privates[(ad)->screenPrivateIndex].ptr)
-
-#define ANIMSIM_SCREEN(s) \
- AnimSimScreen *as = GET_ANIMSIM_SCREEN (s, GET_ANIMSIM_DISPLAY (s->display))
-
-#define GET_ANIMSIM_WINDOW(w, as) \
- ((AnimSimWindow *) (w)->base.privates[(as)->windowPrivateIndex].ptr)
-
-#define ANIMSIM_WINDOW(w) \
- AnimSimWindow *aw = GET_ANIMSIM_WINDOW (w, \
- GET_ANIMSIM_SCREEN (w->screen, \
- GET_ANIMSIM_DISPLAY (w->screen->display)))
-
-// ratio of perceived length of animation compared to real duration
-// to make it appear to have the same speed with other animation effects
-
-#define EXPLODE_PERCEIVED_T 0.7f
-
-/*
- * Function prototypes
- *
- */
-
-OPTION_GETTERS_HDR
-
-/* flyin.c */
-
-Bool
-fxFlyinInit (CompWindow *w);
-
-void
-fxFlyinUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib *wAttrib);
-
-void
-fxFlyinAnimStep (CompWindow *w,
- float time);
-
-float
-fxFlyinAnimProgress (CompWindow *w);
-
-void
-fxFlyinUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform);
-
-/* rotatein.c */
-
-Bool
-fxRotateinInit (CompWindow *w);
-
-void
-fxRotateinUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib *wAttrib);
-
-void
-fxRotateinAnimStep (CompWindow *w,
- float time);
-
-float
-fxRotateinAnimProgress (CompWindow *w);
-
-void
-fxRotateinUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform);
-
-void
-fxRotateinPrePaintWindow (CompWindow * w);
-
-void
-fxRotateinPostPaintWindow (CompWindow * w);
-
-Bool
-fxRotateinZoomToIcon (CompWindow *w);
-
-/* bounce.c */
-
-Bool
-fxBounceInit (CompWindow *w);
-
-void
-fxBounceUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib *wAttrib);
-
-void
-fxBounceAnimStep (CompWindow *w,
- float time);
-
-float
-fxBounceAnimProgress (CompWindow *w);
-
-void
-fxBounceUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform);
-
-/* sheets.c */
-
-void
-fxSheetsInitGrid (CompWindow *w,
- int *gridWidth,
- int *gridHeight);
-
-Bool
-fxSheetsInit (CompWindow * w);
-
-void
-fxSheetsModelStep (CompWindow * w,
- float time);
-
-/* expand.c */
-
-Bool
-fxExpandInit (CompWindow *w);
-
-void
-fxExpandUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib *wAttrib);
-
-void
-fxExpandAnimStep (CompWindow *w,
- float time);
-
-float
-fxExpandAnimProgress (CompWindow *w);
-
-void
-fxExpandUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform);
-
-/* expandPW.c */
-
-Bool
-fxExpandPWInit (CompWindow *w);
-
-void
-fxExpandPWUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib *wAttrib);
-
-void
-fxExpandPWAnimStep (CompWindow *w,
- float time);
-
-float
-fxExpandPWAnimProgress (CompWindow *w);
-
-void
-fxExpandPWUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform);
diff --git a/animationsim.xml.in b/animationsim.xml.in
index 4a6f359..d651315 100644
--- a/animationsim.xml.in
+++ b/animationsim.xml.in
@@ -1,5 +1,5 @@
<compiz>
- <plugin name="animationsim">
+ <plugin name="animationsim" useBcop="true">
<_short>Simple Animations</_short>
<_long>Animations that are simple on the eye</_long>
<category>Effects</category>
@@ -11,7 +11,7 @@
<plugin>animation</plugin>
</relation>
</deps>
- <screen>
+ <options>
<group>
<_short>Effect Settings</_short>
@@ -179,7 +179,7 @@
</group>
- </screen>
+ </options>
<extension base_plugin="animation">
<base_option>open_effects</base_option>
diff --git a/bounce.c b/bounce.c
deleted file mode 100644
index a5d0a6e..0000000
--- a/bounce.c
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Animation plugin for compiz/beryl
- *
- * animation.c
- *
- * Copyright : (C) 2006 Erkin Bahceci
- * E-mail : erkinbah@gmail.com
- *
- * Based on Wobbly and Minimize plugins by
- * : David Reveman
- * E-mail : davidr@novell.com>
- *
- * Particle system added by : (C) 2006 Dennis Kasprzyk
- * E-mail : onestone@beryl-project.org
- *
- * Beam-Up added by : Florencio Guimaraes
- * E-mail : florencio@nexcorp.com.br
- *
- * Hexagon tessellator added by : Mike Slegeir
- * E-mail : mikeslegeir@mail.utexas.edu>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "animationsim.h"
-
-// ===================== Effect: Bounce =========================
-
-float
-fxBounceAnimProgress (CompWindow *w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- ANIMSIM_WINDOW (w);
- float forwardProgress = (*ad->animBaseFunc->defaultAnimProgress) (w);
- float forwardProgressInc = 1.0f / aw->bounceCount;
-
- /* last bounce, enure we are going for 0.0 */
- aw->currBounceProgress = (((1 - forwardProgress) - aw->lastProgressMax) / forwardProgressInc);
-
- if (aw->currBounceProgress > 1.0f)
- {
- aw->currentScale = aw->targetScale;
- aw->targetScale = -aw->targetScale + aw->targetScale / 2.0f;
- aw->lastProgressMax = 1.0f - forwardProgress;
- aw->currBounceProgress = 0.0f;
- aw->nBounce++;
- }
-
- return forwardProgress;
-}
-
-static void
-applyBounceTransform (CompWindow *w)
-{
- ANIMSIM_WINDOW (w);
- float scale = 1.0f - (aw->targetScale * (aw->currBounceProgress) + aw->currentScale * (1.0f - aw->currBounceProgress));
-
- CompTransform *transform = &aw->com->transform;
-
- matrixTranslate (transform, WIN_X (w) + WIN_W (w) / 2.0f,
- WIN_Y (w) + WIN_H (w) / 2.0f, 0.0f);
-
- matrixScale (transform, scale, scale, 1.0f);
-
- matrixTranslate (transform, -(WIN_X (w) + WIN_W (w) / 2.0f),
- -(WIN_Y (w) + WIN_H (w) / 2.0f), 0.0f);
-
-}
-
-void
-fxBounceAnimStep (CompWindow *w, float time)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- (*ad->animBaseFunc->defaultAnimStep) (w, time);
-
- applyBounceTransform (w);
-}
-
-void
-fxBounceUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib * wAttrib)
-{
- ANIMSIM_WINDOW(w);
-
- float forwardProgress = fxBounceAnimProgress (w);
-
- if (animGetB (w, ANIMSIM_SCREEN_OPTION_BOUNCE_FADE))
- wAttrib->opacity = aw->com->storedOpacity * (1 - forwardProgress);
-}
-
-void
-fxBounceUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform)
-{
- ANIMSIM_WINDOW(w);
-
- matrixMultiply (wTransform, wTransform, &aw->com->transform);
-}
-
-Bool
-fxBounceInit (CompWindow * w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- ANIMSIM_WINDOW (w);
-
- aw->bounceCount = animGetI (w, ANIMSIM_SCREEN_OPTION_BOUNCE_NUMBER);
- aw->nBounce = 1;
- aw->targetScale = animGetF (w, ANIMSIM_SCREEN_OPTION_BOUNCE_MIN_SIZE);
- aw->currentScale = animGetF (w, ANIMSIM_SCREEN_OPTION_BOUNCE_MAX_SIZE);
- aw->bounceNeg = FALSE;
- aw->currBounceProgress = 0.0f;
- aw->lastProgressMax = 0.0f;
-
- return (*ad->animBaseFunc->defaultAnimInit) (w);
-}
-
diff --git a/explode3d.c b/explode3d.c
deleted file mode 100644
index 6e9006f..0000000
--- a/explode3d.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Animation plugin for compiz/beryl
- *
- * animation.c
- *
- * Copyright : (C) 2006 Erkin Bahceci
- * E-mail : erkinbah@gmail.com
- *
- * Based on Wobbly and Minimize plugins by
- * : David Reveman
- * E-mail : davidr@novell.com>
- *
- * Particle system added by : (C) 2006 Dennis Kasprzyk
- * E-mail : onestone@beryl-project.org
- *
- * Beam-Up added by : Florencio Guimaraes
- * E-mail : florencio@nexcorp.com.br
- *
- * Hexagon tessellator added by : Mike Slegeir
- * E-mail : mikeslegeir@mail.utexas.edu>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "animationsim.h"
-
-/*Bool
-fxExplodeInit (CompWindow * w)
-{
- CompScreen *s = w->screen;
- ANIMEG_DISPLAY (s->display);
- ANIMEG_WINDOW (w);
-
- if (!ad->animAddonFunc->polygonsAnimInit (w))
- return FALSE;
-
- switch (animGetI (w, ANIMEG_SCREEN_OPTION_EXPLODE_TESS))
- {
- case PolygonTessRect:
- if (!ad->animAddonFunc->tessellateIntoRectangles
- (w,
- animGetI (w, ANIMEG_SCREEN_OPTION_EXPLODE_GRIDSIZE_X),
- animGetI (w, ANIMEG_SCREEN_OPTION_EXPLODE_GRIDSIZE_Y),
- animGetF (w, ANIMEG_SCREEN_OPTION_EXPLODE_THICKNESS)))
- return FALSE;
- break;
- case PolygonTessHex:
- if (!ad->animAddonFunc->tessellateIntoHexagons
- (w,
- animGetI (w, ANIMEG_SCREEN_OPTION_EXPLODE_GRIDSIZE_X),
- animGetI (w, ANIMEG_SCREEN_OPTION_EXPLODE_GRIDSIZE_Y),
- animGetF (w, ANIMEG_SCREEN_OPTION_EXPLODE_THICKNESS)))
- return FALSE;
- break;
- default:
- return FALSE;
- }
-
- PolygonSet *pset = aw->eng->polygonSet;
- PolygonObject *p = pset->polygons;
- double sqrt2 = sqrt (2);
-
- int i;
-
- for (i = 0; i < pset->nPolygons; i++, p++)
- {
- p->rotAxis.x = RAND_FLOAT ();
- p->rotAxis.y = RAND_FLOAT ();
- p->rotAxis.z = RAND_FLOAT ();
-
- float screenSizeFactor = (0.8 * DEFAULT_Z_CAMERA * s->width);
- float speed = screenSizeFactor / 10 * (0.2 + RAND_FLOAT ());
-
- float xx = 2 * (p->centerRelPos.x - 0.5);
- float yy = 2 * (p->centerRelPos.y - 0.5);
-
- float x = speed * 2 * (xx + 0.5 * (RAND_FLOAT () - 0.5));
- float y = speed * 2 * (yy + 0.5 * (RAND_FLOAT () - 0.5));
-
- float distToCenter = sqrt (xx * xx + yy * yy) / sqrt2;
- float moveMult = 1 - distToCenter;
- moveMult = moveMult < 0 ? 0 : moveMult;
- float zbias = 0.1;
- float z = speed * 10 *
- (zbias + RAND_FLOAT () *
- pow (moveMult, 0.5));
-
- p->finalRelPos.x = x;
- p->finalRelPos.y = y;
- p->finalRelPos.z = z;
- p->finalRotAng = RAND_FLOAT () * 540 - 270;
- }
- pset->allFadeDuration = 0.3f;
- pset->doDepthTest = TRUE;
- pset->doLighting = TRUE;
- pset->correctPerspective = CorrectPerspectivePolygon;
- pset->backAndSidesFadeDur = 0.2f;
-
- aw->com->animTotalTime /= EXPLODE_PERCEIVED_T;
- aw->com->animRemainingTime = aw->com->animTotalTime;
-
- return TRUE;
-}*/
-
diff --git a/flyin.c b/flyin.c
deleted file mode 100644
index 7320c49..0000000
--- a/flyin.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Animation plugin for compiz/beryl
- *
- * animation.c
- *
- * Copyright : (C) 2006 Erkin Bahceci
- * E-mail : erkinbah@gmail.com
- *
- * Based on Wobbly and Minimize plugins by
- * : David Reveman
- * E-mail : davidr@novell.com>
- *
- * Particle system added by : (C) 2006 Dennis Kasprzyk
- * E-mail : onestone@beryl-project.org
- *
- * Beam-Up added by : Florencio Guimaraes
- * E-mail : florencio@nexcorp.com.br
- *
- * Hexagon tessellator added by : Mike Slegeir
- * E-mail : mikeslegeir@mail.utexas.edu>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "animationsim.h"
-
-// ===================== Effect: Flyin =========================
-
-float
-fxFlyinAnimProgress (CompWindow *w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- float forwardProgress = (*ad->animBaseFunc->defaultAnimProgress) (w);
-
- return (*ad->animBaseFunc->decelerateProgress) (forwardProgress);
-}
-
-static void
-applyFlyinTransform (CompWindow *w)
-{
- ANIMSIM_WINDOW (w);
-
- CompTransform *transform = &aw->com->transform;
- float offsetX, offsetY;
- float xTrans, yTrans;
- float forwardProgress;
-
- int direction = animGetI (w, ANIMSIM_SCREEN_OPTION_FLYIN_DIRECTION);
-
- switch (direction)
- {
- case 0:
- offsetX = 0;
- offsetY = animGetF (w, ANIMSIM_SCREEN_OPTION_FLYIN_DISTANCE);
- break;
- case 1:
- offsetX = animGetF (w, ANIMSIM_SCREEN_OPTION_FLYIN_DISTANCE);
- offsetY = 0;
- break;
- case 2:
- offsetX = 0;
- offsetY = -animGetF (w, ANIMSIM_SCREEN_OPTION_FLYIN_DISTANCE);
- break;
- case 3:
- offsetX = -animGetF (w, ANIMSIM_SCREEN_OPTION_FLYIN_DISTANCE);
- offsetY = 0;
- break;
- case 4:
- offsetX = animGetF (w, ANIMSIM_SCREEN_OPTION_FLYIN_DIRECTION_X);
- offsetY = animGetF (w, ANIMSIM_SCREEN_OPTION_FLYIN_DIRECTION_Y);
- break;
- }
-
- forwardProgress = fxFlyinAnimProgress (w);
- xTrans = -(forwardProgress * offsetX);
- yTrans = -(forwardProgress * offsetY);
- Point3d translation = {xTrans, yTrans, 0};
-
- // animation movement
- matrixTranslate (transform, translation.x, translation.y, translation.z);
-
-}
-
-void
-fxFlyinAnimStep (CompWindow *w, float time)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- (*ad->animBaseFunc->defaultAnimStep) (w, time);
-
- applyFlyinTransform (w);
-}
-
-void
-fxFlyinUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib * wAttrib)
-{
- ANIMSIM_WINDOW(w);
-
- float forwardProgress = fxFlyinAnimProgress (w);
-
- if (animGetB (w, ANIMSIM_SCREEN_OPTION_FLYIN_FADE))
- wAttrib->opacity = aw->com->storedOpacity * (1 - forwardProgress);
-}
-
-void
-fxFlyinUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform)
-{
- ANIMSIM_WINDOW(w);
-
- matrixMultiply (wTransform, wTransform, &aw->com->transform);
-}
-
-Bool
-fxFlyinInit (CompWindow * w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
-
- return (*ad->animBaseFunc->defaultAnimInit) (w);
-}
-
diff --git a/plugin.info b/plugin.info
deleted file mode 100644
index ac2eb44..0000000
--- a/plugin.info
+++ /dev/null
@@ -1,2 +0,0 @@
-PLUGIN = animationsim
-LDFLAGS_ADD = -lGLU
diff --git a/rotatein.c b/rotatein.c
deleted file mode 100644
index efee65a..0000000
--- a/rotatein.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Animation plugin for compiz/beryl
- *
- * animation.c
- *
- * Copyright : (C) 2006 Erkin Bahceci
- * E-mail : erkinbah@gmail.com
- *
- * Based on Wobbly and Minimize plugins by
- * : David Reveman
- * E-mail : davidr@novell.com>
- *
- * Particle system added by : (C) 2006 Dennis Kasprzyk
- * E-mail : onestone@beryl-project.org
- *
- * Beam-Up added by : Florencio Guimaraes
- * E-mail : florencio@nexcorp.com.br
- *
- * Hexagon tessellator added by : Mike Slegeir
- * E-mail : mikeslegeir@mail.utexas.edu>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "animationsim.h"
-
-// ===================== Effect: Flyin =========================
-
-// Scales z by 0 and does perspective distortion so that it
-// looks the same wherever on the screen
-static void
-perspectiveDistortAndResetZ (CompScreen *s,
- CompTransform *transform)
-{
- float v = -1.0 / s->width;
- /*
- This does
- transform = M * transform, where M is
- 1, 0, 0, 0,
- 0, 1, 0, 0,
- 0, 0, 0, v,
- 0, 0, 0, 1
- */
- float *m = transform->m;
- m[8] = v * m[12];
- m[9] = v * m[13];
- m[10] = v * m[14];
- m[11] = v * m[15];
-}
-
-float
-fxRotateinAnimProgress (CompWindow *w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- float forwardProgress = (*ad->animBaseFunc->defaultAnimProgress) (w);
-
- return (*ad->animBaseFunc->decelerateProgress) (forwardProgress);
-}
-
-static void
-applyRotateinTransform (CompWindow *w)
-{
- ANIMSIM_WINDOW (w);
-
- CompTransform *transform = &aw->com->transform;
- float xRot, yRot;
- float angleX, angleY;
- float originX, originY;
- float forwardProgress;
-
- int direction = animGetI (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_DIRECTION);
-
- switch (direction)
- {
- case 1:
- angleX = 0;
- angleY = -animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- originX = WIN_X (w);
- originY = WIN_Y (w) + WIN_H (w);
- break;
- case 2:
- angleX = animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- angleY = 0;
- originX = WIN_X (w);
- originY = WIN_Y (w);
- break;
- case 3:
- angleX = 0;
- angleY = animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- originX = WIN_X (w);
- originY = WIN_Y (w);
- break;
- case 4:
- angleX = -animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- angleY = 0;
- originX = WIN_X (w) + WIN_W (w);
- originY = WIN_Y (w);
- break;
- }
-
- forwardProgress = fxRotateinAnimProgress (w);
- xRot = (forwardProgress * angleX);
- yRot = (forwardProgress * angleY);
-
- matrixTranslate (transform, WIN_X (w) + WIN_W (w) / 2.0f,
- WIN_Y (w) + WIN_H (w) / 2.0f,
- 0.0f);
-
- perspectiveDistortAndResetZ (w->screen, transform);
-
- matrixTranslate (transform, -(WIN_X (w) + WIN_W (w) / 2.0f),
- -(WIN_Y (w) + WIN_H (w) / 2.0f),
- 0.0f);
-
- // animation movement
- matrixTranslate (transform, originX, originY, 0.0f);
-
- matrixRotate (transform, yRot, 1.0f, 0.0f, 0.0f);
- matrixRotate (transform, xRot, 0.0f, 1.0f, 0.0f);
-
- matrixTranslate (transform, -originX, -originY, 0.0f);
-
-}
-
-void
-fxRotateinAnimStep (CompWindow *w, float time)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- (*ad->animBaseFunc->defaultAnimStep) (w, time);
-
- applyRotateinTransform (w);
-}
-
-void
-fxRotateinUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib * wAttrib)
-{
-}
-
-void
-fxRotateinUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform)
-{
- ANIMSIM_WINDOW(w);
-
- matrixMultiply (wTransform, wTransform, &aw->com->transform);
-}
-
-Bool
-fxRotateinInit (CompWindow * w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
-
- return (*ad->animBaseFunc->defaultAnimInit) (w);
-}
-
-void fxRotateinPrePaintWindow (CompWindow *w)
-{
- float forwardProgress = fxRotateinAnimProgress (w);
- float xRot, yRot;
- float angleX, angleY;
- float originX, originY;
- Bool xInvert = FALSE, yInvert = FALSE;
- int currentCull, invertCull;
-
- glGetIntegerv (GL_CULL_FACE_MODE, &currentCull);
- invertCull = (currentCull == GL_BACK) ? GL_FRONT : GL_BACK;
-
- int direction = animGetI (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_DIRECTION);
-
- switch (direction)
- {
- case 1:
- angleX = 0;
- angleY = -animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- originX = WIN_X (w);
- originY = WIN_Y (w) + WIN_H (w);
- break;
- case 2:
- angleX = animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- angleY = 0;
- originX = WIN_X (w);
- originY = WIN_Y (w);
- break;
- case 3:
- angleX = 0;
- angleY = animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- originX = WIN_X (w);
- originY = WIN_Y (w);
- break;
- case 4:
- angleX = -animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- angleY = 0;
- originX = WIN_X (w) + WIN_W (w);
- originY = WIN_Y (w);
- break;
- }
-
- /* FIXME: This could be fancy vectorial normal direction calculation */
-
- xRot = fabs(fmodf(forwardProgress * angleX, 360.0f));
- yRot = fabs(fmodf(forwardProgress * angleY, 360.0f));
-
- if (xRot > 90.0f && xRot > 270.0f)
- xInvert = TRUE;
-
- if (yRot > 90.0f && yRot > 270.0f)
- yInvert = TRUE;
-
- if ((xInvert || yInvert) && !(xInvert && yInvert))
- glCullFace (invertCull);
-}
-
-void fxRotateinPostPaintWindow (CompWindow * w)
-{
-
- float forwardProgress = fxRotateinAnimProgress (w);
- float xRot, yRot;
- float angleX, angleY;
- float originX, originY;
- Bool xInvert = FALSE, yInvert = FALSE;
- int currentCull, invertCull;
-
- glGetIntegerv (GL_CULL_FACE_MODE, &currentCull);
- invertCull = (currentCull == GL_BACK) ? GL_FRONT : GL_BACK;
-
- int direction = animGetI (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_DIRECTION);
-
- switch (direction)
- {
- case 1:
- angleX = 0;
- angleY = -animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- originX = WIN_X (w);
- originY = WIN_Y (w) + WIN_H (w);
- break;
- case 2:
- angleX = animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- angleY = 0;
- originX = WIN_X (w);
- originY = WIN_Y (w);
- break;
- case 3:
- angleX = 0;
- angleY = animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- originX = WIN_X (w);
- originY = WIN_Y (w);
- break;
- case 4:
- angleX = -animGetF (w, ANIMSIM_SCREEN_OPTION_ROTATEIN_ANGLE);
- angleY = 0;
- originX = WIN_X (w) + WIN_W (w);
- originY = WIN_Y (w);
- break;
- }
-
- /* FIXME: This could be fancy vectorial normal direction calculation */
-
- xRot = fabs(fmodf(forwardProgress * angleX, 360.0f));
- yRot = fabs(fmodf(forwardProgress * angleY, 360.0f));
-
- if (xRot > 90.0f && xRot > 270.0f)
- xInvert = TRUE;
-
- if (yRot > 90.0f && yRot > 270.0f)
- yInvert = TRUE;
-
- /* We have to assume that invertCull will be
- * the actual inversion of our previous cull
- */
-
- if ((xInvert || yInvert) && !(xInvert && yInvert))
- glCullFace (invertCull);
-}
-
-Bool
-fxRotateinZoomToIcon (CompWindow *w)
-{
- return FALSE;
-}
-
diff --git a/setupbuild b/setupbuild
deleted file mode 100755
index 1131aed..0000000
--- a/setupbuild
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-export PKG_CONFIG_PATH=/opt/xserver-xir-install/lib/pkgconfig:${PKG_CONFIG_PATH}
-export LD_LIBRARY_PATH=/opt/xserver-xir-install/lib/:${LD_LIBRARY_PATH}
-export LD_RUN_PATH=/opt/xserver-xir-install/lib/:${LD_RUN_PATH}
-export BUILD_GLOBAL=true
-make
-make install
diff --git a/sheet.c b/sheet.c
deleted file mode 100644
index 67403d5..0000000
--- a/sheet.c
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * Animation plugin for compiz/beryl
- *
- * animation.c
- *
- * Copyright : (C) 2006 Erkin Bahceci
- * E-mail : erkinbah@gmail.com
- *
- * Based on Wobbly and Minimize plugins by
- * : David Reveman
- * E-mail : davidr@novell.com>
- *
- * Particle system added by : (C) 2006 Dennis Kasprzyk
- * E-mail : onestone@beryl-project.org
- *
- * Beam-Up added by : Florencio Guimaraes
- * E-mail : florencio@nexcorp.com.br
- *
- * Hexagon tessellator added by : Mike Slegeir
- * E-mail : mikeslegeir@mail.utexas.edu>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#include "animationsim.h"
-
-void
-fxSheetsInitGrid (CompWindow *w,
- int *gridWidth, int *gridHeight)
-{
- *gridWidth = 30;
- *gridHeight = 30;
-}
-
-Bool
-fxSheetsInit (CompWindow * w)
-{
- ANIMSIM_WINDOW(w);
-
- XRectangle *icon = &aw->com->icon;
- int maxWaves;
- float waveAmpMin, waveAmpMax;
- float distance;
- CompWindow *parent;
-
- for (parent = w->screen->windows; parent; parent = parent->next)
- {
- if (parent->transientFor == w->id && parent->id != w->id)
- break;
- }
-
- if (parent)
- {
- icon->x = WIN_X (parent) + WIN_W (parent) / 2.0f;
- icon->y = WIN_Y (parent);
- icon->width = WIN_W (w);
- }
- else
- {
- icon->x = w->screen->width / 2.0f;
- icon->y = 0.0f;
- icon->width = WIN_W (w);
- }
-
- if (aw->com->curAnimEffect == AnimEffectSheets)
- {
- maxWaves = 0;
- waveAmpMin = 0.0f;
- waveAmpMax = 0.0f;
- }
-
- if (maxWaves == 0)
- {
- aw->sheetsWaveCount = 0;
- return TRUE;
- }
-
- // Initialize waves
-
- distance = WIN_Y(w) + WIN_H(w) - icon->y;
-
- aw->sheetsWaveCount =
- 1 + (float)maxWaves *distance;
-
- if (!(aw->sheetsWaves))
- {
- aw->sheetsWaves =
- calloc(aw->sheetsWaveCount, sizeof(WaveParam));
- if (!aw->sheetsWaves)
- {
- compLogMessage ("animationsim", CompLogLevelError,
- "Not enough memory");
- return FALSE;
- }
- }
- // Compute wave parameters
-
- int ampDirection = (RAND_FLOAT() < 0.5 ? 1 : -1);
- int i;
- float minHalfWidth = 0.22f;
- float maxHalfWidth = 0.38f;
-
- for (i = 0; i < aw->sheetsWaveCount; i++)
- {
- aw->sheetsWaves[i].amp =
- ampDirection * (waveAmpMax - waveAmpMin) *
- rand() / RAND_MAX + ampDirection * waveAmpMin;
- aw->sheetsWaves[i].halfWidth =
- RAND_FLOAT() * (maxHalfWidth -
- minHalfWidth) + minHalfWidth;
-
- // avoid offset at top and bottom part by added waves
- float availPos = 1 - 2 * aw->sheetsWaves[i].halfWidth;
- float posInAvailSegment = 0;
-
- if (i > 0)
- posInAvailSegment =
- (availPos / aw->sheetsWaveCount) * rand() / RAND_MAX;
-
- aw->sheetsWaves[i].pos =
- (posInAvailSegment +
- i * availPos / aw->sheetsWaveCount +
- aw->sheetsWaves[i].halfWidth);
-
- // switch wave direction
- ampDirection *= -1;
- }
-
- return TRUE;
-}
-
-void
-fxSheetsModelStep (CompWindow *w, float time)
-{
- ANIMSIM_DISPLAY (w->screen->display);
-
- (*ad->animBaseFunc->defaultAnimStep) (w, time);
-
- ANIMSIM_WINDOW(w);
-
- Model *model = aw->com->model;
- XRectangle *icon = &aw->com->icon;
- CompWindow *parent;
-
- for (parent = w->screen->windows; parent; parent = parent->next)
- {
- if (parent->transientFor == w->id && parent->id != w->id)
- break;
- }
-
- if (parent)
- {
- icon->x = WIN_X (parent) + WIN_W (parent) / 2.0f;
- icon->y = WIN_Y (parent);
- icon->width = WIN_W (w);
- }
- else
- {
- icon->x = w->screen->width / 2.0f;
- icon->y = 0.0f;
- icon->width = WIN_W (w);
- }
-
- float forwardProgress = (*ad->animBaseFunc->defaultAnimProgress) (w);
-
- if (aw->sheetsWaveCount > 0 && !aw->sheetsWaves)
- return;
-
- float iconCloseEndY;
- float iconFarEndY;
- float winFarEndY;
- float winVisibleCloseEndY;
- float winw = WIN_W(w);
- float winh = WIN_H(w);
-
-
- iconFarEndY = icon->y;
- iconCloseEndY = icon->y + icon->height;
- winFarEndY = WIN_Y(w) + winh;
- winVisibleCloseEndY = WIN_Y(w);
- if (winVisibleCloseEndY < iconCloseEndY)
- winVisibleCloseEndY = iconCloseEndY;
-
-
- float preShapePhaseEnd = 0.22f;
- float preShapeProgress = 0;
- float postStretchProgress = 0;
- float stretchProgress = 0;
- float stretchPhaseEnd =
- preShapePhaseEnd + (1 - preShapePhaseEnd) *
- (iconCloseEndY -
- winVisibleCloseEndY) / ((iconCloseEndY - winFarEndY) +
- (iconCloseEndY - winVisibleCloseEndY));
- if (stretchPhaseEnd < preShapePhaseEnd + 0.1)
- stretchPhaseEnd = preShapePhaseEnd + 0.1;
-
- if (forwardProgress < preShapePhaseEnd)
- {
- preShapeProgress = forwardProgress / preShapePhaseEnd;
-
- // Slow down "shaping" toward the end
- preShapeProgress = 1 - (*ad->animBaseFunc->decelerateProgress) (1 - preShapeProgress);
- }
-
- if (forwardProgress < preShapePhaseEnd)
- {
- stretchProgress = forwardProgress / stretchPhaseEnd;
- }
- else
- {
- if (forwardProgress < stretchPhaseEnd)
- {
- stretchProgress = forwardProgress / stretchPhaseEnd;
- }
- else
- {
- postStretchProgress =
- (forwardProgress - stretchPhaseEnd) / (1 - stretchPhaseEnd);
- }
- }
-
- Object *object = model->objects;
- int i;
- for (i = 0; i < model->numObjects; i++, object++)
- {
- float origx = w->attrib.x + (winw * object->gridPosition.x -
- w->output.left) * model->scale.x;
- float origy = w->attrib.y + (winh * object->gridPosition.y -
- w->output.top) * model->scale.y;
- float icony = icon->y + icon->height;
-
- float stretchedPos;
- stretchedPos =
- object->gridPosition.y * origy +
- (1 - object->gridPosition.y) * icony;
-
- // Compute current y position
- if (forwardProgress < preShapePhaseEnd)
- {
- object->position.y =
- (1 - stretchProgress) * origy +
- stretchProgress * stretchedPos;
- }
- else
- {
- if (forwardProgress < stretchPhaseEnd)
- {
- object->position.y =
- (1 - stretchProgress) * origy +
- stretchProgress * stretchedPos;
- }
- else
- {
- object->position.y =
- (1 - postStretchProgress) *
- stretchedPos +
- postStretchProgress *
- (stretchedPos + (iconCloseEndY - winFarEndY));
- }
- }
-
- // Compute "target shape" x position
- float yProgress = (iconCloseEndY - object->position.y ) / (iconCloseEndY - winFarEndY);
-
- //fprintf(stderr, "yProg is %f\n", yProgress);
- float targetx = yProgress * (origx - icon->x)
- + icon->x + icon->width * (object->gridPosition.x - 0.5);
-
- // Compute current x position
- if (forwardProgress < preShapePhaseEnd)
- object->position.x =
- (1 - preShapeProgress) * origx + preShapeProgress * targetx;
- else
- object->position.x = targetx;
-
- if (object->position.y < iconFarEndY)
- object->position.y = iconFarEndY;
-
- // No need to set object->position.z to 0, since they won't be used
- // due to modelAnimIs3D being FALSE for magic lamp.
- }
-}
-
diff --git a/animationsim.c b/src/animationsim.cpp
index dc07344..c35f9a7 100644
--- a/animationsim.c
+++ b/src/animationsim.cpp
@@ -19,6 +19,142 @@
#include "animationsim.h"
+COMPIZ_PLUGIN_20090315 (animationsim, AnimSimPluginVTable);
+
+AnimEffect animEffects[NUM_EFFECTS];
+
+ExtensionPluginAnimSim animSimExtPluginInfo (CompString ("animationsim"),
+ NUM_EFFECTS, animEffects, NULL,
+ NUM_NONEFFECT_OPTIONS);
+
+ExtensionPluginInfo *
+BaseSimAnim::getExtensionPluginInfo ()
+{
+ return &animSimExtPluginInfo;
+}
+
+BaseSimAnim::BaseSimAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
+ Animation::Animation (w, curWindowEvent, duration, info, icon),
+ mCScreen (CompositeScreen::get (::screen)),
+ mGScreen (GLScreen::get (::screen))
+{
+}
+
+AnimEffect AnimEffectFlyIn;
+AnimEffect AnimEffectRotateIn;
+AnimEffect AnimEffectExpand;
+AnimEffect AnimEffectExpandPW;
+AnimEffect AnimEffectBounce;
+AnimEffect AnimEffectSheet;
+
+void
+AnimSimScreen::initAnimationList ()
+{
+ int i = 0;
+
+ animEffects[i++] = AnimEffectFlyIn =
+ new AnimEffectInfo ("animationsim:Fly In",
+ true, true, true, false, false,
+ &createAnimation<FlyInAnim>);
+
+ animEffects[i++] = AnimEffectRotateIn =
+ new AnimEffectInfo ("animationsim:Rotate In",
+ true, true, true, false, false,
+ &createAnimation<RotateInAnim>);
+
+ animEffects[i++] = AnimEffectExpand =
+ new AnimEffectInfo ("animationsim:Expand",
+ true, true, true, false, false,
+ &createAnimation<ExpandAnim>);
+
+ animEffects[i++] = AnimEffectExpandPW =
+ new AnimEffectInfo ("animationsim:Expand Piecewise",
+ true, true, true, false, false,
+ &createAnimation<ExpandPWAnim>);
+
+ animEffects[i++] = AnimEffectBounce =
+ new AnimEffectInfo ("animationsim:Bounce",
+ true, true, true, false, false,
+ &createAnimation<BounceAnim>);
+
+ animEffects[i++] = AnimEffectSheet =
+ new AnimEffectInfo ("animationsim:Sheet",
+ true, true, true, false, false,
+ &createAnimation<SheetAnim>);
+
+ animSimExtPluginInfo.effectOptions = &getOptions ();
+
+ AnimScreen *as = AnimScreen::get (::screen);
+
+ // Extends animation plugin with this set of animation effects.
+ as->addExtension (&animSimExtPluginInfo);
+}
+
+AnimSimScreen::AnimSimScreen (CompScreen *s) :
+ //cScreen (CompositeScreen::get (s)),
+ //gScreen (GLScreen::get (s)),
+ //aScreen (as),
+ PluginClassHandler <AnimSimScreen, CompScreen> (s),
+ mOutput (s->fullscreenOutput ())
+{
+ initAnimationList ();
+}
+
+AnimSimScreen::~AnimSimScreen ()
+{
+ AnimScreen *as = AnimScreen::get (::screen);
+
+ as->removeExtension (&animSimExtPluginInfo);
+
+ for (int i = 0; i < NUM_EFFECTS; i++)
+ {
+ delete animEffects[i];
+ animEffects[i] = NULL;
+ }
+}
+
+AnimSimWindow::AnimSimWindow (CompWindow *w) :
+ PluginClassHandler<AnimSimWindow, CompWindow> (w),
+ mWindow (w),
+ aWindow (AnimWindow::get (w))
+{
+}
+
+AnimSimWindow::~AnimSimWindow ()
+{
+ Animation *curAnim = aWindow->curAnimation ();
+
+ if (!curAnim)
+ return;
+
+ // We need to interrupt and clean up the animation currently being played
+ // by animationsim for this window (if any)
+ if (curAnim->remainingTime () > 0 &&
+ curAnim->getExtensionPluginInfo ()->name ==
+ CompString ("animationsim"))
+ {
+ aWindow->postAnimationCleanUp ();
+ }
+}
+
+bool
+AnimSimPluginVTable::init ()
+{
+ if (!CompPlugin::checkPluginABI ("core", CORE_ABIVERSION) |
+ !CompPlugin::checkPluginABI ("composite", COMPIZ_COMPOSITE_ABI) |
+ !CompPlugin::checkPluginABI ("opengl", COMPIZ_OPENGL_ABI) |
+ !CompPlugin::checkPluginABI ("animation", ANIMATION_ABI))
+ return false;
+
+ return true;
+}
+#if 0
+
+
int animDisplayPrivateIndex;
CompMetadata animMetadata;
@@ -421,3 +557,4 @@ getCompPluginInfo20070830 (void)
return &animVTable;
}
+#endif
diff --git a/src/animationsim.h b/src/animationsim.h
new file mode 100644
index 0000000..b4f57cf
--- /dev/null
+++ b/src/animationsim.h
@@ -0,0 +1,315 @@
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include <core/core.h>
+#include <composite/composite.h>
+#include <opengl/opengl.h>
+#include <animation/animation.h>
+
+#include "animationsim_options.h"
+
+extern AnimEffect AnimEffectFlyIn;
+extern AnimEffect AnimEffectBounce;
+extern AnimEffect AnimEffectRotateIn;
+extern AnimEffect AnimEffectSheet;
+extern AnimEffect AnimEffectExpand;
+extern AnimEffect AnimEffectExpandPW;
+
+// TODO Update this for each added animation effect! (total: 10)
+#define NUM_EFFECTS 6
+
+// This must have the value of the first "effect setting" above
+// in AnimAddonScreenOptions
+#define NUM_NONEFFECT_OPTIONS AnimationsimOptions::FlyinDirection
+
+#define WIN_X(w) ((w)->x () - (w)->input ().left)
+#define WIN_Y(w) ((w)->y () - (w)->input ().top)
+#define WIN_W(w) ((w)->width () + (w)->input ().left + (w)->input ().right)
+#define WIN_H(w) ((w)->height () + (w)->input ().top + (w)->input ().bottom)
+
+class ExtensionPluginAnimSim : public ExtensionPluginInfo
+{
+public:
+ ExtensionPluginAnimSim (const CompString &name,
+ unsigned int nEffects,
+ AnimEffect *effects,
+ CompOption::Vector *effectOptions,
+ unsigned int firstEffectOptionIndex) :
+ ExtensionPluginInfo (name, nEffects, effects, effectOptions,
+ firstEffectOptionIndex) {}
+ ~ExtensionPluginAnimSim () {}
+
+ const CompOutput *output () { return mOutput; }
+
+private:
+ const CompOutput *mOutput;
+};
+
+/// Base class for all polygon- and particle-based animations
+class BaseSimAnim :
+virtual public Animation
+{
+public:
+ BaseSimAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+ ~BaseSimAnim () {}
+
+protected:
+ /// Gets info about the extension plugin that implements this animation.
+ ExtensionPluginInfo *getExtensionPluginInfo ();
+
+ CompositeScreen *mCScreen;
+ GLScreen *mGScreen;
+
+};
+
+
+class AnimSimScreen :
+ public PluginClassHandler <AnimSimScreen, CompScreen>,
+ public AnimationsimOptions
+{
+
+public:
+ AnimSimScreen (CompScreen *);
+ ~AnimSimScreen ();
+
+protected:
+ void initAnimationList ();
+
+ CompOutput &mOutput;
+};
+
+class AnimSimWindow :
+ public PluginClassHandler<AnimSimWindow, CompWindow>
+{
+public:
+ AnimSimWindow (CompWindow *);
+ ~AnimSimWindow ();
+
+protected:
+ CompWindow *mWindow; ///< Window being animated.
+ AnimWindow *aWindow;
+};
+
+/*
+typedef struct _WaveParam
+{
+ float halfWidth;
+ float amp;
+ float pos;
+} WaveParam;
+*/
+
+#define ANIMSIM_SCREEN(s) \
+ AnimSimScreen *ass = AnimSimScreen::get (s);
+
+#define ANIMSIM_WINDOW(w) \
+ AnimSimWindow *asw = AnimSimWindow::get (w);
+
+class FlyInAnim : public FadeAnim,
+ virtual public BaseSimAnim,
+ virtual public TransformAnim
+{
+ public:
+
+ FlyInAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
+ Animation::Animation (w, curWindowEvent, duration, info, icon),
+ BaseSimAnim::BaseSimAnim (w, curWindowEvent, duration, info, icon),
+ TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
+ FadeAnim::FadeAnim (w, curWindowEvent, duration, info, icon) {}
+
+ protected:
+ void step () { TransformAnim::step (); }
+ bool updateBBUsed () { return true; }
+ void updateBB (CompOutput &output) { TransformAnim::updateBB (output); }
+ void applyTransform ();
+
+ float getFadeProgress ()
+ {
+ return progressDecelerate (progressLinear ());
+ }
+};
+
+class RotateInAnim: public TransformAnim,
+ virtual public BaseSimAnim
+{
+ public:
+
+ RotateInAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
+ Animation::Animation (w, curWindowEvent, duration, info, icon),
+ BaseSimAnim::BaseSimAnim (w, curWindowEvent, duration, info, icon),
+ TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon) {}
+
+ protected:
+
+ void step () { TransformAnim::step (); }
+ bool updateBBUsed () { return true; }
+ void updateBB (CompOutput &output) { TransformAnim::updateBB (output); }
+ void applyTransform ();
+ void prePaintWindow ();
+ void postPaintWindow ();
+
+ inline float getProgress ()
+ {
+ return progressDecelerate (progressLinear ());
+ }
+};
+
+class ExpandAnim: public TransformAnim,
+ virtual public BaseSimAnim
+{
+ public:
+
+ ExpandAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
+ Animation::Animation (w, curWindowEvent, duration, info, icon),
+ BaseSimAnim::BaseSimAnim (w, curWindowEvent, duration, info, icon),
+ TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon) {}
+
+ protected:
+
+ inline float getProgress ()
+ {
+ return progressDecelerate (progressLinear ());
+ }
+
+ void applyTransform ();
+ bool updateBBUsed () { return true; }
+ void updateBB (CompOutput &output) { TransformAnim::updateBB (output); }
+};
+
+class ExpandPWAnim: public TransformAnim,
+ virtual public BaseSimAnim
+{
+ public:
+
+ ExpandPWAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
+ Animation::Animation (w, curWindowEvent, duration, info, icon),
+ BaseSimAnim::BaseSimAnim (w, curWindowEvent, duration, info, icon),
+ TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon)
+ {
+ }
+
+ protected:
+
+ inline float getProgress ()
+ {
+ return progressDecelerate (progressLinear ());
+ }
+
+ void applyTransform ();
+ bool updateBBUsed () { return true; }
+ void updateBB (CompOutput &output) { TransformAnim::updateBB (output); }
+};
+
+class BounceAnim: public FadeAnim,
+ virtual public TransformAnim,
+ virtual public BaseSimAnim
+{
+ public:
+
+ BounceAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon) :
+ Animation::Animation (w, curWindowEvent, duration, info, icon),
+ TransformAnim::TransformAnim (w, curWindowEvent, duration, info, icon),
+ BaseSimAnim::BaseSimAnim (w, curWindowEvent, duration, info, icon),
+ FadeAnim::FadeAnim (w, curWindowEvent, duration, info, icon)
+ {
+ ANIMSIM_SCREEN (screen);
+
+ bounceCount = ass->optionGetBounceNumber ();
+ nBounce = 1;
+ targetScale = ass->optionGetBounceMinSize ();
+ currentScale = ass->optionGetBounceMaxSize ();
+ bounceNeg = false;
+ currBounceProgress = 0.0f;
+ lastProgressMax = 0.0f;
+ }
+
+ protected:
+
+ void step () { TransformAnim::step (); }
+ void updateBB (CompOutput &output) { TransformAnim::updateBB (output); }
+ bool updateBBUsed () { return true; }
+
+ void applyTransform ();
+
+ float getProgress ();
+ float getFadeProgress ()
+ {
+ return progressDecelerate (progressLinear ());
+ }
+
+ int bounceCount;
+ int nBounce;
+ float targetScale;
+ float currentScale;
+ bool bounceNeg;
+ float currBounceProgress;
+ float lastProgressMax;
+};
+
+class SheetAnim : public GridAnim,
+ virtual public BaseSimAnim
+{
+ public:
+
+ SheetAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &icon);
+
+ class WaveParam
+ {
+ public:
+ float halfWidth;
+ float amp;
+ float pos;
+ };
+
+ protected:
+
+ void initGrid ()
+ {
+ mGridWidth = 30;
+ mGridHeight = 30;
+ }
+
+ void step ();
+ void updateBB (CompOutput &output);
+ bool updateBBUsed () { return true; }
+ bool stepRegionUsed () { return true; }
+
+ int sheetsWaveCount;
+ std::vector <WaveParam> sheetsWaves;
+};
+
+class AnimSimPluginVTable:
+ public CompPlugin::VTableForScreenAndWindow <AnimSimScreen, AnimSimWindow>
+{
+ public:
+ bool init ();
+};
diff --git a/src/bounce.cpp b/src/bounce.cpp
new file mode 100644
index 0000000..7fc8853
--- /dev/null
+++ b/src/bounce.cpp
@@ -0,0 +1,76 @@
+/*
+ * Animation plugin for compiz/beryl
+ *
+ * animation.c
+ *
+ * Copyright : (C) 2006 Erkin Bahceci
+ * E-mail : erkinbah@gmail.com
+ *
+ * Based on Wobbly and Minimize plugins by
+ * : David Reveman
+ * E-mail : davidr@novell.com>
+ *
+ * Particle system added by : (C) 2006 Dennis Kasprzyk
+ * E-mail : onestone@beryl-project.org
+ *
+ * Beam-Up added by : Florencio Guimaraes
+ * E-mail : florencio@nexcorp.com.br
+ *
+ * Hexagon tessellator added by : Mike Slegeir
+ * E-mail : mikeslegeir@mail.utexas.edu>
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "animationsim.h"
+
+// ===================== Effect: Bounce =========================
+
+float
+BounceAnim::getProgress ()
+{
+ return progressLinear ();
+}
+
+void
+BounceAnim::applyTransform ()
+{
+ float scale = 1.0f - (targetScale * (currBounceProgress) + currentScale * (1.0f - currBounceProgress));
+ float forwardProgress = getProgress ();;
+ float forwardProgressInc = 1.0f / bounceCount;
+
+ /* last bounce, enure we are going for 0.0 */
+ currBounceProgress = (((1 - forwardProgress) - lastProgressMax) / forwardProgressInc);
+
+ if (currBounceProgress > 1.0f)
+ {
+ currentScale = targetScale;
+ targetScale = -targetScale + targetScale / 2.0f;
+ lastProgressMax = 1.0f - forwardProgress;
+ currBounceProgress = 0.0f;
+ nBounce++;
+ }
+
+ GLMatrix *transform = &mTransform;
+
+ transform->translate (WIN_X (mWindow) + WIN_W (mWindow) / 2.0f,
+ WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f, 0.0f);
+
+ transform->scale (scale, scale, 1.0f);
+
+ transform->translate (-(WIN_X (mWindow) + WIN_W (mWindow) / 2.0f),
+ -(WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f), 0.0f);
+
+}
diff --git a/expand-piecewise.c b/src/expand-piecewise.cpp
index 96c6fc3..5c427f5 100644
--- a/expand-piecewise.c
+++ b/src/expand-piecewise.cpp
@@ -39,42 +39,33 @@
// ===================== Effect: ExpandPW =========================
-float
-fxExpandPWAnimProgress (CompWindow *w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- float forwardProgress = (*ad->animBaseFunc->defaultAnimProgress) (w);
-
- return forwardProgress;
-}
-
-static void
-applyExpandPWTransform (CompWindow *w)
+void
+ExpandPWAnim::applyTransform ()
{
- ANIMSIM_WINDOW (w);
+ ANIMSIM_SCREEN (screen);
- CompTransform *transform = &aw->com->transform;
+ GLMatrix *transform = &mTransform;
- float forwardProgress = 1.0f - fxExpandPWAnimProgress (w);
+ float forwardProgress = 1.0f - getProgress ();
- float initialXScale = animGetI (w, ANIMSIM_SCREEN_OPTION_EXPANDPW_INITIAL_HORIZ) / (float) w->width;
- float initialYScale = animGetI (w, ANIMSIM_SCREEN_OPTION_EXPANDPW_INITIAL_VERT) / (float) w->height;
+ float initialXScale = ass->optionGetExpandpwInitialHoriz () / (float) mWindow->width ();
+ float initialYScale = ass->optionGetExpandpwInitialVert () / (float) mWindow->height ();
// animation movement
- matrixTranslate (transform, WIN_X (w) + WIN_W (w) / 2.0f,
- WIN_Y (w) + WIN_H (w) / 2.0f,
- 0.0f);
+ transform->translate (WIN_X (mWindow) + WIN_W (mWindow) / 2.0f,
+ WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f,
+ 0.0f);
float xScale;
float yScale;
float switchPointP;
float switchPointN;
- float delay = animGetF (w, ANIMSIM_SCREEN_OPTION_EXPANDPW_DELAY);
+ float delay = ass->optionGetExpandpwDelay ();
- if(animGetB (w, ANIMSIM_SCREEN_OPTION_EXPANDPW_HORIZ_FIRST))
+ if (ass->optionGetExpandpwHorizFirst ())
{
- switchPointP = w->width / (float) (w->width + w->height) + w->height / (float) (w->width + w->height) * delay;
- switchPointN = w->width / (float) (w->width + w->height) - w->width / (float) (w->width + w->height) * delay;
+ switchPointP = mWindow->width () / (float) (mWindow->width () + mWindow->height ()) + mWindow->height () / (float) (mWindow->width () + mWindow->height ()) * delay;
+ switchPointN = mWindow->width () / (float) (mWindow->width () + mWindow->height ()) - mWindow->width () / (float) (mWindow->width () + mWindow->height ()) * delay;
if(switchPointP >= 1.0f) switchPointP = 1.0f - DELTA;
if(switchPointN <= 0.0f) switchPointN = 0.0f + DELTA;
xScale = initialXScale + (1.0f - initialXScale) * (forwardProgress < switchPointN ? 1.0f - (switchPointN - forwardProgress)/switchPointN : 1.0f);
@@ -82,50 +73,18 @@ applyExpandPWTransform (CompWindow *w)
}
else
{
- switchPointP = w->height / (float) (w->width + w->height) + w->width / (float) (w->width + w->height) * delay;
- switchPointN = w->height / (float) (w->width + w->height) - w->height / (float) (w->width + w->height) * delay;
+ switchPointP = mWindow->height () / (float) (mWindow->width () + mWindow->height ()) + mWindow->width () / (float) (mWindow->width () + mWindow->height ()) * delay;
+ switchPointN = mWindow->height () / (float) (mWindow->width () + mWindow->height ()) - mWindow->height () / (float) (mWindow->width () + mWindow->height ()) * delay;
if(switchPointP >= 1.0f) switchPointP = 1.0f - DELTA;
if(switchPointN <= 0.0f) switchPointN = 0.0f + DELTA;
xScale = initialXScale + (1.0f - initialXScale) * (forwardProgress > switchPointP ? (forwardProgress - switchPointP)/(1.0f-switchPointP) : 0.0f);
yScale = initialYScale + (1.0f - initialYScale) * (forwardProgress < switchPointN ? 1.0f - (switchPointN - forwardProgress)/switchPointN : 1.0f);
}
- matrixScale (transform, xScale, yScale, 0.0f);
-
- matrixTranslate (transform, -(WIN_X (w) + WIN_W (w) / 2.0f),
- -(WIN_Y (w) + WIN_H (w) / 2.0f),
- 0.0f);
+ transform->scale (xScale, yScale, 0.0f);
-}
-
-void
-fxExpandPWAnimStep (CompWindow *w, float time)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- (*ad->animBaseFunc->defaultAnimStep) (w, time);
-
- applyExpandPWTransform (w);
-}
-
-void
-fxExpandPWUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib * wAttrib)
-{
-}
-
-void
-fxExpandPWUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform)
-{
- ANIMSIM_WINDOW(w);
-
- matrixMultiply (wTransform, wTransform, &aw->com->transform);
-}
-
-Bool
-fxExpandPWInit (CompWindow * w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
+ transform->translate (-(WIN_X (mWindow) + WIN_W (mWindow) / 2.0f),
+ -(WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f),
+ 0.0f);
- return (*ad->animBaseFunc->defaultAnimInit) (w);
}
diff --git a/expand.c b/src/expand.cpp
index ccb9ec1..3c4e00a 100644
--- a/expand.c
+++ b/src/expand.cpp
@@ -38,27 +38,16 @@
// ===================== Effect: Expand =========================
-float
-fxExpandAnimProgress (CompWindow *w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- float forwardProgress = (*ad->animBaseFunc->defaultAnimProgress) (w);
-
- return (*ad->animBaseFunc->decelerateProgress) (forwardProgress);
-}
-
-static void
-applyExpandTransform (CompWindow *w)
+void
+ExpandAnim::applyTransform ()
{
- ANIMSIM_WINDOW (w);
-
- CompTransform *transform = &aw->com->transform;
+ GLMatrix *transform = &mTransform;
float defaultXScale = 0.3f;
float forwardProgress;
float expandProgress;
- float expandPhaseEnd = 0.5f;
+ const float expandPhaseEnd = 0.5f;
- forwardProgress = fxExpandAnimProgress (w);
+ forwardProgress = getProgress ();
if ((1 - forwardProgress) < expandPhaseEnd)
expandProgress = (1 - forwardProgress) / expandPhaseEnd;
@@ -66,48 +55,17 @@ applyExpandTransform (CompWindow *w)
expandProgress = 1.0f;
// animation movement
- matrixTranslate (transform, WIN_X (w) + WIN_W (w) / 2.0f,
- WIN_Y (w) + WIN_H (w) / 2.0f,
- 0.0f);
-
- matrixScale (transform, defaultXScale + (1.0f - defaultXScale) * expandProgress,
- (1 - forwardProgress), 0.0f);
-
- matrixTranslate (transform, -(WIN_X (w) + WIN_W (w) / 2.0f),
- -(WIN_Y (w) + WIN_H (w) / 2.0f),
- 0.0f);
-
-}
-
-void
-fxExpandAnimStep (CompWindow *w, float time)
-{
- ANIMSIM_DISPLAY (w->screen->display);
- (*ad->animBaseFunc->defaultAnimStep) (w, time);
-
- applyExpandTransform (w);
-}
-
-void
-fxExpandUpdateWindowAttrib (CompWindow * w,
- WindowPaintAttrib * wAttrib)
-{
-}
-
-void
-fxExpandUpdateWindowTransform (CompWindow *w,
- CompTransform *wTransform)
-{
- ANIMSIM_WINDOW(w);
+ transform->translate (WIN_X (mWindow) + WIN_W (mWindow) / 2.0f,
+ WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f,
+ 0.0f);
- matrixMultiply (wTransform, wTransform, &aw->com->transform);
-}
+ transform->scale (defaultXScale + (1.0f - defaultXScale) *
+ expandProgress,
+ (1 - forwardProgress), 0.0f);
-Bool
-fxExpandInit (CompWindow * w)
-{
- ANIMSIM_DISPLAY (w->screen->display);
+ transform->translate (-(WIN_X (mWindow) + WIN_W (mWindow) / 2.0f),
+ -(WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f),
+ 0.0f);
- return (*ad->animBaseFunc->defaultAnimInit) (w);
}
diff --git a/src/flyin.cpp b/src/flyin.cpp
new file mode 100644
index 0000000..aa57110
--- /dev/null
+++ b/src/flyin.cpp
@@ -0,0 +1,87 @@
+/*
+ * Animation plugin for compiz/beryl
+ *
+ * animation.c
+ *
+ * Copyright : (C) 2006 Erkin Bahceci
+ * E-mail : erkinbah@gmail.com
+ *
+ * Based on Wobbly and Minimize plugins by
+ * : David Reveman
+ * E-mail : davidr@novell.com>
+ *
+ * Particle system added by : (C) 2006 Dennis Kasprzyk
+ * E-mail : onestone@beryl-project.org
+ *
+ * Beam-Up added by : Florencio Guimaraes
+ * E-mail : florencio@nexcorp.com.br
+ *
+ * Hexagon tessellator added by : Mike Slegeir
+ * E-mail : mikeslegeir@mail.utexas.edu>
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "animationsim.h"
+
+// ===================== Effect: Flyin =========================
+
+void
+FlyInAnim::applyTransform ()
+{
+ GLMatrix *transform = &mTransform;
+ float offsetX, offsetY;
+ float xTrans, yTrans;
+ float forwardProgress;
+
+ ANIMSIM_SCREEN (screen);
+
+
+ int direction = ass->optionGetFlyinDirection ();
+ float distance = ass->optionGetFlyinDistance ();
+
+ switch (direction)
+ {
+ case 0:
+ offsetX = 0;
+ offsetY = distance;
+ break;
+ case 1:
+ offsetX = distance;
+ offsetY = 0;
+ break;
+ case 2:
+ offsetX = 0;
+ offsetY = -distance;
+ break;
+ case 3:
+ offsetX = -distance;
+ offsetY = 0;
+ break;
+ case 4:
+ offsetX = ass->optionGetFlyinDirectionX ();
+ offsetY = ass->optionGetFlyinDirectionY ();
+ break;
+ }
+
+ forwardProgress = progressLinear ();
+ xTrans = -(forwardProgress * offsetX);
+ yTrans = -(forwardProgress * offsetY);
+ Point3d translation = Point3d (xTrans, yTrans, 0);
+
+ // animation movement
+ transform->translate (translation.x (), translation.y (), translation.z ());
+
+}
diff --git a/src/rotatein.cpp b/src/rotatein.cpp
new file mode 100644
index 0000000..1fb40a0
--- /dev/null
+++ b/src/rotatein.cpp
@@ -0,0 +1,228 @@
+/*
+ * Animation plugin for compiz/beryl
+ *
+ * animation.c
+ *
+ * Copyright : (C) 2006 Erkin Bahceci
+ * E-mail : erkinbah@gmail.com
+ *
+ * Based on Wobbly and Minimize plugins by
+ * : David Reveman
+ * E-mail : davidr@novell.com>
+ *
+ * Particle system added by : (C) 2006 Dennis Kasprzyk
+ * E-mail : onestone@beryl-project.org
+ *
+ * Beam-Up added by : Florencio Guimaraes
+ * E-mail : florencio@nexcorp.com.br
+ *
+ * Hexagon tessellator added by : Mike Slegeir
+ * E-mail : mikeslegeir@mail.utexas.edu>
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "animationsim.h"
+
+// ===================== Effect: RotateIn =========================
+
+void
+RotateInAnim::applyTransform ()
+{
+ ANIMSIM_SCREEN (screen);
+
+ GLMatrix *transform = &mTransform;
+ float xRot, yRot;
+ float angleX, angleY;
+ float originX, originY;
+ float forwardProgress;
+
+ int direction = ass->optionGetRotateinDirection ();
+
+ switch (direction)
+ {
+ case 1:
+ angleX = 0;
+ angleY = -ass->optionGetRotateinAngle ();
+ originX = WIN_X (mWindow);
+ originY = WIN_Y (mWindow) + WIN_H (mWindow);
+ break;
+ case 2:
+ angleX = ass->optionGetRotateinAngle ();
+ angleY = 0;
+ originX = WIN_X (mWindow);
+ originY = WIN_Y (mWindow);
+ break;
+ case 3:
+ angleX = 0;
+ angleY = ass->optionGetRotateinAngle ();
+ originX = WIN_X (mWindow);
+ originY = WIN_Y (mWindow);
+ break;
+ case 4:
+ angleX = -ass->optionGetRotateinAngle ();
+ angleY = 0;
+ originX = WIN_X (mWindow) + WIN_W (mWindow);
+ originY = WIN_Y (mWindow);
+ break;
+ }
+
+ forwardProgress = getProgress ();
+ xRot = (forwardProgress * angleX);
+ yRot = (forwardProgress * angleY);
+
+ transform->translate (WIN_X (mWindow) + WIN_W (mWindow) / 2.0f,
+ WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f,
+ 0.0f);
+
+ perspectiveDistortAndResetZ (*transform);
+
+ transform->translate (-(WIN_X (mWindow) + WIN_W (mWindow) / 2.0f),
+ -(WIN_Y (mWindow) + WIN_H (mWindow) / 2.0f),
+ 0.0f);
+
+ // animation movement
+ transform->translate (originX, originY, 0.0f);
+
+ transform->rotate (yRot, 1.0f, 0.0f, 0.0f);
+ transform->rotate (xRot, 0.0f, 1.0f, 0.0f);
+
+ transform->translate (-originX, -originY, 0.0f);
+
+}
+
+void
+RotateInAnim::prePaintWindow ()
+{
+ float forwardProgress = getProgress ();
+ float xRot, yRot;
+ float angleX, angleY;
+ float originX, originY;
+ Bool xInvert = FALSE, yInvert = FALSE;
+ int currentCull, invertCull;
+
+ glGetIntegerv (GL_CULL_FACE_MODE, &currentCull);
+ invertCull = (currentCull == GL_BACK) ? GL_FRONT : GL_BACK;
+
+ ANIMSIM_SCREEN (screen);
+
+ int direction = ass->optionGetRotateinDirection ();
+
+ switch (direction)
+ {
+ case 1:
+ angleX = 0;
+ angleY = -ass->optionGetRotateinAngle ();
+ originX = WIN_X (mWindow);
+ originY = WIN_Y (mWindow) + WIN_H (mWindow);
+ break;
+ case 2:
+ angleX = ass->optionGetRotateinAngle ();
+ angleY = 0;
+ originX = WIN_X (mWindow);
+ originY = WIN_Y (mWindow);
+ break;
+ case 3:
+ angleX = 0;
+ angleY = ass->optionGetRotateinAngle ();
+ originX = WIN_X (mWindow);
+ originY = WIN_Y (mWindow);
+ break;
+ case 4:
+ angleX = -ass->optionGetRotateinAngle ();
+ angleY = 0;
+ originX = WIN_X (mWindow) + WIN_W (mWindow);
+ originY = WIN_Y (mWindow);
+ break;
+ }
+
+ /* FIXME: This could be fancy vectorial normal direction calculation */
+
+ xRot = fabs(fmodf(forwardProgress * angleX, 360.0f));
+ yRot = fabs(fmodf(forwardProgress * angleY, 360.0f));
+
+ if (xRot > 90.0f && xRot > 270.0f)
+ xInvert = TRUE;
+
+ if (yRot > 90.0f && yRot > 270.0f)
+ yInvert = TRUE;
+
+ if ((xInvert || yInvert) && !(xInvert && yInvert))
+ glCullFace (invertCull);
+}
+
+void
+RotateInAnim::postPaintWindow ()
+{
+ float forwardProgress = getProgress ();
+ float xRot, yRot;
+ float angleX, angleY;
+ float originX, originY;
+ Bool xInvert = FALSE, yInvert = FALSE;
+ int currentCull, invertCull;
+
+ glGetIntegerv (GL_CULL_FACE_MODE, &currentCull);
+ invertCull = (currentCull == GL_BACK) ? GL_FRONT : GL_BACK;
+
+ ANIMSIM_SCREEN (screen);
+
+ int direction = ass->optionGetRotateinDirection ();
+
+ switch (direction)
+ {
+ case 1:
+ angleX = 0;
+ angleY = -ass->optionGetRotateinAngle ();
+ originX = WIN_X (mWindow);
+ originY = WIN_Y (mWindow) + WIN_H (mWindow);
+ break;
+ case 2:
+ angleX = ass->optionGetRotateinAngle ();
+ angleY = 0;
+ originX = WIN_X (mWindow);
+ originY = WIN_Y (mWindow);
+ break;
+ case 3:
+ angleX = 0;
+ angleY = ass->optionGetRotateinAngle ();
+ originX = WIN_X (mWindow);
+ originY = WIN_Y (mWindow);
+ break;
+ case 4:
+ angleX = -ass->optionGetRotateinAngle ();
+ angleY = 0;
+ originX = WIN_X (mWindow) + WIN_W (mWindow);
+ originY = WIN_Y (mWindow);
+ break;
+ }
+
+ /* FIXME: This could be fancy vectorial normal direction calculation */
+
+ xRot = fabs(fmodf(forwardProgress * angleX, 360.0f));
+ yRot = fabs(fmodf(forwardProgress * angleY, 360.0f));
+
+ if (xRot > 90.0f && xRot > 270.0f)
+ xInvert = TRUE;
+
+ if (yRot > 90.0f && yRot > 270.0f)
+ yInvert = TRUE;
+
+ /* We have to assume that invertCull will be
+ * the actual inversion of our previous cull
+ */
+
+ if ((xInvert || yInvert) && !(xInvert && yInvert))
+ glCullFace (invertCull);
+}
diff --git a/src/sheet.cpp b/src/sheet.cpp
new file mode 100644
index 0000000..2554f0f
--- /dev/null
+++ b/src/sheet.cpp
@@ -0,0 +1,277 @@
+/*
+ * Animation plugin for compiz/beryl
+ *
+ * animation.c
+ *
+ * Copyright : (C) 2006 Erkin Bahceci
+ * E-mail : erkinbah@gmail.com
+ *
+ * Based on Wobbly and Minimize plugins by
+ * : David Reveman
+ * E-mail : davidr@novell.com>
+ *
+ * Particle system added by : (C) 2006 Dennis Kasprzyk
+ * E-mail : onestone@beryl-project.org
+ *
+ * Beam-Up added by : Florencio Guimaraes
+ * E-mail : florencio@nexcorp.com.br
+ *
+ * Hexagon tessellator added by : Mike Slegeir
+ * E-mail : mikeslegeir@mail.utexas.edu>
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "animationsim.h"
+
+SheetAnim::SheetAnim (CompWindow *w,
+ WindowEvent curWindowEvent,
+ float duration,
+ const AnimEffect info,
+ const CompRect &minIcon) :
+ Animation::Animation (w, curWindowEvent, duration, info, minIcon),
+ BaseSimAnim::BaseSimAnim (w, curWindowEvent, duration, info, minIcon),
+ GridAnim::GridAnim (w, curWindowEvent, duration, info, minIcon)
+{
+ int maxWaves;
+ float waveAmpMin, waveAmpMax;
+ float distance;
+ CompWindow *parent;
+ CompRect icon = minIcon;
+
+ foreach (parent, screen->windows ())
+ {
+ if (parent->transientFor () == w->id () && parent->id () != w->id ())
+ break;
+ }
+
+ if (parent)
+ {
+ icon.setX (WIN_X (parent) + WIN_W (parent) / 2.0f);
+ icon.setY (WIN_Y (parent));
+ icon.setWidth (WIN_W (w));
+ }
+ else
+ {
+ icon.setX (screen->width () / 2.0f);
+ icon.setY (0.0f);;
+ icon.setWidth (WIN_W (w));
+ }
+
+ maxWaves = 0;
+ waveAmpMin = 0.0f;
+ waveAmpMax = 0.0f;
+
+ if (maxWaves == 0)
+ {
+ sheetsWaveCount = 0;
+ }
+ else
+ {
+ // Initialize waves
+
+ distance = WIN_Y(w) + WIN_H(w) - icon.y ();
+
+ sheetsWaveCount =
+ 1 + (float)maxWaves *distance;
+
+ if (sheetsWaves.empty ())
+ {
+ sheetsWaves.resize (sheetsWaveCount);
+ }
+ // Compute wave parameters
+
+ int ampDirection = (RAND_FLOAT() < 0.5 ? 1 : -1);
+ float minHalfWidth = 0.22f;
+ float maxHalfWidth = 0.38f;
+
+ for (unsigned int i = 0; i < sheetsWaves.size (); i++)
+ {
+ sheetsWaves[i].amp =
+ ampDirection * (waveAmpMax - waveAmpMin) *
+ rand() / RAND_MAX + ampDirection * waveAmpMin;
+ sheetsWaves[i].halfWidth =
+ RAND_FLOAT() * (maxHalfWidth -
+ minHalfWidth) + minHalfWidth;
+
+ // avoid offset at top and bottom part by added waves
+ float availPos = 1 - 2 * sheetsWaves[i].halfWidth;
+ float posInAvailSegment = 0;
+
+ if (i > 0)
+ posInAvailSegment =
+ (availPos / sheetsWaveCount) * rand() / RAND_MAX;
+
+ sheetsWaves[i].pos =
+ (posInAvailSegment +
+ i * availPos / sheetsWaveCount +
+ sheetsWaves[i].halfWidth);
+
+ // switch wave direction
+ ampDirection *= -1;
+ }
+ }
+}
+
+void
+SheetAnim::updateBB (CompOutput &output)
+{
+ // TODO: Just consider the corner objects
+
+ CompositeScreen::get (screen)->damageScreen (); // XXX: *COUGH!!!!*
+}
+
+void
+SheetAnim::step ()
+{
+ GridModel *model = mModel;
+ CompRect &icon = mIcon;
+ CompWindow *parent;
+
+ foreach (parent, screen->windows ())
+ {
+ if (parent->transientFor () == mWindow->id () && parent->id () != mWindow->id ())
+ break;
+ }
+
+ if (parent)
+ {
+ icon.setX (WIN_X (parent) + WIN_W (parent) / 2.0f);
+ icon.setY (WIN_Y (parent));
+ icon.setWidth (WIN_W (mWindow));
+ }
+ else
+ {
+ icon.setX (screen->width () / 2.0f);
+ icon.setY (0.0f);;
+ icon.setWidth (WIN_W (mWindow));
+ }
+
+ float forwardProgress = progressLinear ();
+
+ if (sheetsWaveCount > 0 && sheetsWaves.empty ())
+ return;
+
+ float iconCloseEndY;
+ float iconFarEndY;
+ float winFarEndY;
+ float winVisibleCloseEndY;
+ float winw = WIN_W(mWindow);
+ float winh = WIN_H(mWindow);
+
+
+ iconFarEndY = icon.y ();
+ iconCloseEndY = icon.y () + icon.height ();
+ winFarEndY = WIN_Y(mWindow) + winh;
+ winVisibleCloseEndY = WIN_Y(mWindow);
+ if (winVisibleCloseEndY < iconCloseEndY)
+ winVisibleCloseEndY = iconCloseEndY;
+
+
+ float preShapePhaseEnd = 0.22f;
+ float preShapeProgress = 0;
+ float postStretchProgress = 0;
+ float stretchProgress = 0;
+ float stretchPhaseEnd =
+ preShapePhaseEnd + (1 - preShapePhaseEnd) *
+ (iconCloseEndY -
+ winVisibleCloseEndY) / ((iconCloseEndY - winFarEndY) +
+ (iconCloseEndY - winVisibleCloseEndY));
+ if (stretchPhaseEnd < preShapePhaseEnd + 0.1)
+ stretchPhaseEnd = preShapePhaseEnd + 0.1;
+
+ if (forwardProgress < preShapePhaseEnd)
+ {
+ preShapeProgress = forwardProgress / preShapePhaseEnd;
+
+ // Slow down "shaping" toward the end
+ preShapeProgress = 1 - progressDecelerate (1 - preShapeProgress);
+ }
+
+ if (forwardProgress < preShapePhaseEnd)
+ {
+ stretchProgress = forwardProgress / stretchPhaseEnd;
+ }
+ else
+ {
+ if (forwardProgress < stretchPhaseEnd)
+ {
+ stretchProgress = forwardProgress / stretchPhaseEnd;
+ }
+ else
+ {
+ postStretchProgress =
+ (forwardProgress - stretchPhaseEnd) / (1 - stretchPhaseEnd);
+ }
+ }
+
+ GridModel::GridObject *object = mModel->objects ();
+ unsigned int i;
+ for (i = 0; i < mModel->numObjects (); i++, object++)
+ {
+ float origx = mWindow->x () + (winw * object->gridPosition ().x () -
+ mWindow->output ().left) * model->scale ().x ();
+ float origy = mWindow->y () + (winh * object->gridPosition ().y () -
+ mWindow->output ().top) * model->scale ().y ();
+ float icony = icon.y () + icon.height ();
+
+ float stretchedPos;
+ Point3d &objPos = object->position ();
+ stretchedPos =
+ object->gridPosition ().y () * origy +
+ (1 - object->gridPosition ().y ()) * icony;
+
+ // Compute current y position
+ if (forwardProgress < preShapePhaseEnd)
+ {
+ objPos.setY ((1 - stretchProgress) * origy +
+ stretchProgress * stretchedPos);
+ }
+ else
+ {
+ if (forwardProgress < stretchPhaseEnd)
+ {
+ objPos.setY ((1 - stretchProgress) * origy +
+ stretchProgress * stretchedPos);
+ }
+ else
+ {
+ objPos.setY ((1 - postStretchProgress) *
+ stretchedPos +
+ postStretchProgress *
+ (stretchedPos + (iconCloseEndY - winFarEndY)));
+ }
+ }
+
+ // Compute "target shape" x position
+ float yProgress = (iconCloseEndY - object->position ().y () ) / (iconCloseEndY - winFarEndY);
+
+ float targetx = yProgress * (origx - icon.x ())
+ + icon.x () + icon.width () * (object->gridPosition ().x () - 0.5);
+
+ // Compute current x position
+ if (forwardProgress < preShapePhaseEnd)
+ objPos.setX ((1 - preShapeProgress) * origx + preShapeProgress * targetx);
+ else
+ objPos.setX (targetx);
+
+ if (object->position ().y () < iconFarEndY)
+ objPos.setY (iconFarEndY);
+
+ // No need to set object->position.z to 0, since they won't be used
+ // due to modelAnimIs3D being FALSE for magic lamp.
+ }
+}
+