summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPal Dorogi <pal.dorogi@gmail.com>2010-10-11 10:53:02 +1000
committerPal Dorogi <pal.dorogi@gmail.com>2010-10-11 10:53:02 +1000
commiteeda5bf2e1c5713ad370ca87f6e6857d22e3427d (patch)
treebffd0a76aa8f5f78d968c58b2a0a557879b4dccf
parentd651eb3167dffbb967a2104b3ee7f6dd60b240b4 (diff)
downloadcompiz-plugins-livewallpapers-eeda5bf2e1c5713ad370ca87f6e6857d22e3427d.tar.gz
compiz-plugins-livewallpapers-eeda5bf2e1c5713ad370ca87f6e6857d22e3427d.tar.bz2
Initial import
-rw-r--r--AUTHORS1
-rw-r--r--COPYING340
-rw-r--r--ChangeLog1
-rw-r--r--INSTALL365
-rw-r--r--Makefile.am9
-rw-r--r--NEWS0
-rw-r--r--README0
-rw-r--r--TODO0
-rw-r--r--VERSION1
-rwxr-xr-xautogen.sh10
-rw-r--r--configure.ac164
-rw-r--r--debian/changelog23
-rw-r--r--debian/compat1
-rw-r--r--debian/control13
-rw-r--r--debian/copyright23
-rw-r--r--debian/docs3
-rwxr-xr-xdebian/rules17
-rw-r--r--images/Makefile.am14
-rw-r--r--images/Space_by_ilap.jpgbin0 -> 444136 bytes
-rw-r--r--images/galaxy-light.jpgbin0 -> 160196 bytes
-rw-r--r--images/galaxy-light.xcfbin0 -> 3399941 bytes
-rw-r--r--images/space.xcfbin0 -> 284679 bytes
-rw-r--r--metadata/Makefile.am32
-rw-r--r--metadata/galaxy.xml88
-rw-r--r--metadata/galaxy.xml.in89
-rw-r--r--po/LINGUAS2
-rw-r--r--po/Makefile.in.in217
-rw-r--r--po/Makevars42
-rw-r--r--po/POTFILES1
-rw-r--r--po/POTFILES.in1
-rw-r--r--po/en_GB.po86
-rw-r--r--src/Makefile.am2
-rw-r--r--src/galaxy/Makefile.am33
-rw-r--r--src/galaxy/galaxy.c428
-rw-r--r--src/galaxy/galaxy.h71
-rw-r--r--src/galaxy/particle.c434
-rw-r--r--src/galaxy/particle.h77
37 files changed, 2588 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..41f5d4e
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+Pal Dorogi <pal.dorogi@gmail.com>
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..d60c31a
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1 @@
+
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..7d1c323
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,365 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+
+ Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved. This file is offered as-is,
+without warranty of any kind.
+
+Basic Installation
+==================
+
+ Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package. Some packages provide this
+`INSTALL' file but do not implement all of the features documented
+below. The lack of an optional feature in a given package is not
+necessarily a bug. More recommendations for GNU packages can be found
+in *note Makefile Conventions: (standards)Makefile Conventions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+ The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package, generally using the just-built uninstalled binaries.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation. When installing into a prefix owned by root, it is
+ recommended that the package be configured and built as a regular
+ user, and only the `make install' phase executed with root
+ privileges.
+
+ 5. Optionally, type `make installcheck' to repeat any self-tests, but
+ this time using the binaries in their final installed location.
+ This target does not install anything. Running this target as a
+ regular user, particularly if the prior `make install' required
+ root privileges, verifies that the installation completed
+ correctly.
+
+ 6. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+ 7. Often, you can also type `make uninstall' to remove the installed
+ files again. In practice, not all packages have tested that
+ uninstallation works correctly, even though it is required by the
+ GNU Coding Standards.
+
+ 8. Some packages, particularly those that use Automake, provide `make
+ distcheck', which can by used by developers to test that all other
+ targets like `make install' and `make uninstall' work correctly.
+ This target is generally not run by end users.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'. This
+is known as a "VPATH" build.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+ On MacOS X 10.5 and later systems, you can create libraries and
+executables that work on multiple system types--known as "fat" or
+"universal" binaries--by specifying multiple `-arch' options to the
+compiler but only a single `-arch' option to the preprocessor. Like
+this:
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
+ CPP="gcc -E" CXXCPP="g++ -E"
+
+ This is not guaranteed to produce working output in all cases, you
+may have to build one architecture at a time and combine the results
+using the `lipo' tool if you have problems.
+
+Installation Names
+==================
+
+ By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX', where PREFIX must be an
+absolute file name.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them. In general, the
+default for these options is expressed in terms of `${prefix}', so that
+specifying just `--prefix' will affect all of the other directory
+specifications that were not explicitly provided.
+
+ The most portable way to affect installation locations is to pass the
+correct locations to `configure'; however, many packages provide one or
+both of the following shortcuts of passing variable assignments to the
+`make install' command line to change installation locations without
+having to reconfigure or recompile.
+
+ The first method involves providing an override variable for each
+affected directory. For example, `make install
+prefix=/alternate/directory' will choose an alternate location for all
+directory configuration variables that were expressed in terms of
+`${prefix}'. Any directories that were specified during `configure',
+but not in terms of `${prefix}', must each be overridden at install
+time for the entire installation to be relocated. The approach of
+makefile variable overrides for each directory variable is required by
+the GNU Coding Standards, and ideally causes no recompilation.
+However, some platforms have known limitations with the semantics of
+shared libraries that end up requiring recompilation when using this
+method, particularly noticeable in packages that use GNU Libtool.
+
+ The second method involves providing the `DESTDIR' variable. For
+example, `make install DESTDIR=/alternate/directory' will prepend
+`/alternate/directory' before all installation names. The approach of
+`DESTDIR' overrides is not required by the GNU Coding Standards, and
+does not work on platforms that have drive letters. On the other hand,
+it does better at avoiding recompilation issues, and works well even
+when some directory options were not specified in terms of `${prefix}'
+at `configure' time.
+
+Optional Features
+=================
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+ Some packages offer the ability to configure how verbose the
+execution of `make' will be. For these packages, running `./configure
+--enable-silent-rules' sets the default to minimal output, which can be
+overridden with `make V=1'; while running `./configure
+--disable-silent-rules' sets the default to verbose, which can be
+overridden with `make V=0'.
+
+Particular systems
+==================
+
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU
+CC is not installed, it is recommended to use the following options in
+order to use an ANSI C compiler:
+
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
+
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
+
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
+parse its `<wchar.h>' header file. The option `-nodtk' can be used as
+a workaround. If GNU CC is not installed, it is therefore recommended
+to try
+
+ ./configure CC="cc"
+
+and if that doesn't work, try
+
+ ./configure CC="cc -nodtk"
+
+ On Solaris, don't put `/usr/ucb' early in your `PATH'. This
+directory contains several dysfunctional programs; working variants of
+these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
+in your `PATH', put it _after_ `/usr/bin'.
+
+ On Haiku, software installed for all users goes in `/boot/common',
+not `/usr/local'. It is recommended to use the following options:
+
+ ./configure --prefix=/boot/common
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS
+ KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+ Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+ Print a summary of all of the options to `configure', and exit.
+
+`--help=short'
+`--help=recursive'
+ Print a summary of the options unique to this package's
+ `configure', and exit. The `short' variant lists options used
+ only in the top level, while the `recursive' variant lists options
+ also present in any nested packages.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--prefix=DIR'
+ Use DIR as the installation prefix. *note Installation Names::
+ for more details, including other options available for fine-tuning
+ the installation locations.
+
+`--no-create'
+`-n'
+ Run the configure checks, but stop before creating any output
+ files.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..6ae2ded
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,9 @@
+## Process this file with automake to produce Makefile.in
+SUBDIRS = metadata src po images
+
+EXTRA_DIST = \
+ VERSION
+
+DISTCLEANFILES = \
+ po/stamp-it \
+ po/.intltool-merge-cache
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/NEWS
diff --git a/README b/README
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/README
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TODO
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..8303ced
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+VERSION=0.0.1
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..f3fd7df
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+autoreconf -f -i -Wno-portability \
+&& libtoolize \
+&& autoheader \
+&& aclocal \
+&& autoconf \
+&& touch AUTHORS NEWS README ChangeLog \
+&& automake --add-missing -a -Wno-portability
+
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..4d79321
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,164 @@
+AC_PREREQ(2.57)
+
+m4_define([plugins_livewallpapers_version], [esyscmd(. ./VERSION;echo -n $VERSION)])
+
+AC_INIT([compiz-plugins-livewallpapers], [plugins_livewallpapers_version], [pal.dorogi@gmail.com])
+
+#AC_CONFIG_AUX_DIR(config)
+
+AM_INIT_AUTOMAKE([1.9 dist-bzip2])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADER([config.h])
+AM_MAINTAINER_MODE
+
+AC_ISC_POSIX
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_LIBTOOL
+AC_HEADER_STDC
+AC_CHECK_HEADERS([stdlib.h sys/time.h unistd.h])
+IT_PROG_INTLTOOL([0.35.0])
+AC_SUBST(ALL_LINGUAS)
+AM_GLIB_GNU_GETTEXT
+GETTEXT_PACKAGE=compiz-plugins-livewallpapers
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
+AC_SUBST(GETTEXT_PACKAGE)
+
+if test "x$GCC" = "xyes"; then
+ case " $CFLAGS " in
+ *[[\ \ ]]-Wall[[\ \ ]]*) ;;
+ *) CFLAGS="$CFLAGS -Wall" ;;
+ esac
+
+ case " $CFLAGS " in
+ *[[\ \ ]]-Wpointer-arith[[\ \ ]]*) ;;
+ *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
+ esac
+
+ case " $CFLAGS " in
+ *[[\ \ ]]-Wstrict-prototypes[[\ \ ]]*) ;;
+ *) CFLAGS="$CFLAGS -Wstrict-prototypes" ;;
+ esac
+
+ case " $CFLAGS " in
+ *[[\ \ ]]-Wmissing-prototypes[[\ \ ]]*) ;;
+ *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
+ esac
+
+ case " $CFLAGS " in
+ *[[\ \ ]]-Wmissing-declarations[[\ \ ]]*) ;;
+ *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
+ esac
+
+ case " $CFLAGS " in
+ *[[\ \ ]]-Wnested-externs[[\ \ ]]*) ;;
+ *) CFLAGS="$CFLAGS -Wnested-externs" ;;
+ esac
+
+ case " $CFLAGS " in
+ *[[\ \ ]]-fno-strict-aliasing[[\ \ ]]*) ;;
+ *) CFLAGS="$CFLAGS -fno-strict-aliasing" ;;
+ esac
+
+ if test "x$enable_ansi" = "xyes"; then
+ case " $CFLAGS " in
+ *[[\ \ ]]-ansi[[\ \ ]]*) ;;
+ *) CFLAGS="$CFLAGS -ansi" ;;
+ esac
+
+ case " $CFLAGS " in
+ *[[\ \ ]]-pedantic[[\ \ ]]*) ;;
+ *) CFLAGS="$CFLAGS -pedantic" ;;
+ esac
+ fi
+fi
+
+AC_C_BIGENDIAN
+
+plugindir=$libdir/compiz
+AC_SUBST(plugindir)
+
+imagedir=$datadir/compiz
+AC_SUBST(imagedir)
+
+metadatadir=$datadir/compiz
+AC_SUBST(metadatadir)
+
+compdatadir=$datadir/compiz
+AC_SUBST(compdatadir)
+
+backgrounddir=$datadir/backgrounds
+AC_SUBST(backgrounddir)
+
+dnl ============================================================
+dnl Check for the pkg-config path.
+if test x"$PKG_CONFIG_PATH" = x; then
+ PKG_CONFIG_PATH=${prefix}/lib/pkgconfig
+ else
+ PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH}
+fi
+export PKG_CONFIG_PATH
+AC_SUBST(PKG_CONFIG_PATH)
+AC_MSG_NOTICE([Using PKG_CONFIG_PATH=$PKG_CONFIG_PATH])
+
+PKG_CHECK_MODULES(COMPIZ, compiz)
+PKG_CHECK_MODULES(BCOP, bcop >= 0.8.0, [bcop_found=yes])
+if test "$bcop_found" = yes; then
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
+ if test "$PKG_CONFIG" != "no" ; then
+ BCOP_BIN=`$PKG_CONFIG --variable=bin bcop`
+ AC_SUBST(BCOP_BIN)
+ fi
+fi
+
+AC_MSG_CHECKING(for GL_CFLAGS)
+AC_ARG_WITH(gl-cflags, [ --with-gl-cflags=CFLAGS ],
+ [GL_CFLAGS="$withval"],
+ [GL_CFLAGS=""])
+
+AC_MSG_RESULT($GL_CFLAGS)
+AC_MSG_CHECKING(for GL_LIBS)
+AC_ARG_WITH(gl-libs, [ --with-gl-libs=LIBS ],
+ [GL_LIBS="$withval"],
+ [GL_LIBS="-lGL"])
+AC_MSG_RESULT($GL_LIBS)
+
+AC_SUBST(GL_CFLAGS)
+AC_SUBST(GL_LIBS)
+
+AC_ARG_ENABLE(schemas,
+ [ --enable-schemas Build gconf schemas],
+ [use_schemas=$enableval], [use_schemas=no])
+
+if test x"$use_schemas" = x"yes"; then
+ AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
+ PKG_CHECK_MODULES(SCHEMAS, compiz-gconf, [use_schemas=yes], [use_schemas=no])
+ if test x"$GCONFTOOL" = xno; then
+ AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
+ fi
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ if test x"$PKG_CONFIG" = xno ; then
+ AC_MSG_ERROR([pkg-config executable not found in your path, unable to determine schema directory])
+ fi
+ xsltdir=`$PKG_CONFIG --variable=xsltdir compiz-gconf`
+ AC_SUBST(xsltdir)
+fi
+
+AM_GCONF_SOURCE_2
+
+AM_CONDITIONAL(USE_SCHEMAS, test "x$use_schemas" = "xyes")
+if test "$use_schemas" = yes; then
+ AC_DEFINE(USE_SCHEMAS, 1, [Build gconf schemas])
+fi
+
+AC_OUTPUT([
+Makefile
+images/Makefile
+metadata/Makefile
+src/Makefile
+src/galaxy/Makefile
+po/Makefile.in
+])
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..028b258
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,23 @@
+compiz-plugins-livewallpapers (0.0.1-0ubuntu1~ppa4) maverick; urgency=low
+
+ * Updated control file.
+
+ -- Pal Dorogi <pal.dorogi@gmail.com> Sat, 09 Oct 2010 13:50:16 +1100
+
+compiz-plugins-livewallpapers (0.0.1-0ubuntu1~ppa3) maverick; urgency=low
+
+ * Updated control file.
+
+ -- Pal Dorogi <pal.dorogi@gmail.com> Sat, 09 Oct 2010 13:03:48 +1100
+
+compiz-plugins-livewallpapers (0.0.1-0ubuntu1~ppa2) maverick; urgency=low
+
+ * Updated rules file.
+
+ -- Pal Dorogi <pal.dorogi@gmail.com> Fri, 08 Oct 2010 23:19:15 +1100
+
+compiz-plugins-livewallpapers (0.0.1-0ubuntu1~ppa1) maverick; urgency=low
+
+ * Initial package.
+
+ -- Pal Dorogi <pal.dorogi@gmail.com> Fri, 08 Oct 2010 19:45:43 +1100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..85a3920
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,13 @@
+Source: compiz-plugins-livewallpapers
+Section: x11
+Priority: extra
+Maintainer: ilap <pal.dorogi@gmail.com>
+Build-Depends: debhelper (>= 7.0.50~), autotools-dev, intltool, libgconf2-4, libglib2.0-0, mime-support, gettext, intltool, gconf2, libcroco3, libxml-parser-perl, locales, liborbit2, libpopt0, compiz-fusion-bcop, libgl1-mesa-glx, compiz-dev, libunistring0, libasound2, libexpat1, libpcre3, gawk, libtool, libgconf2-dev, libglib2.0-dev
+Standards-Version: 3.8.4
+Homepage: https://launchpad.net/ilap/compiz-plugins-livewallpapers/devel
+
+Package: compiz-plugins-livewallpapers
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Live Wallpaper like plugin(s) for Compiz.
+ This package contains the Android's Live Wallpaper like plugin(s) for Compiz.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..f99720d
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,23 @@
+This package was debianized by Pal Dorogi <pal.dorogi@gmail.com> on
+Thu, 07 Oct 2010 23:27:16 +1100
+
+It was downloaded from
+https://code.launchpad.net/~ilap/compiz-plugins-livewallpapers
+by bzr branch lp:~ilap/compiz-plugins-livewallpapers
+
+Copyright © 2010 : Pal Dorogi <pal.dorogi@gmail.com>
+
+License: GPL
+
+ 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.
+
+On Debian systems, the full text of the LGPL can be found in
+/usr/share/common-licenses/GPL-3
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..5502ed8
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,3 @@
+NEWS
+README
+TODO
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..d46ade9
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,17 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+override_dh_auto_configure:
+ [ -e dh_auto_configure ] || ./autogen.sh && dh_auto_configure
+
+%:
+ dh $@
+
diff --git a/images/Makefile.am b/images/Makefile.am
new file mode 100644
index 0000000..5e4897c
--- /dev/null
+++ b/images/Makefile.am
@@ -0,0 +1,14 @@
+imagesdir = $(imagedir)
+images_DATA = \
+ galaxy-light.jpg
+
+EXTRA_DIST = \
+ galaxy-light.jpg
+bacgkroundsdir = $(backgrounddir)
+
+background_DATA = \
+ Space_by_ilap.jpg
+
+EXTRA_DIST = \
+ Space_by_ilap.jpg
+
diff --git a/images/Space_by_ilap.jpg b/images/Space_by_ilap.jpg
new file mode 100644
index 0000000..2b2ac2c
--- /dev/null
+++ b/images/Space_by_ilap.jpg
Binary files differ
diff --git a/images/galaxy-light.jpg b/images/galaxy-light.jpg
new file mode 100644
index 0000000..f905dba
--- /dev/null
+++ b/images/galaxy-light.jpg
Binary files differ
diff --git a/images/galaxy-light.xcf b/images/galaxy-light.xcf
new file mode 100644
index 0000000..5986548
--- /dev/null
+++ b/images/galaxy-light.xcf
Binary files differ
diff --git a/images/space.xcf b/images/space.xcf
new file mode 100644
index 0000000..272fdd9
--- /dev/null
+++ b/images/space.xcf
Binary files differ
diff --git a/metadata/Makefile.am b/metadata/Makefile.am
new file mode 100644
index 0000000..c68f11e
--- /dev/null
+++ b/metadata/Makefile.am
@@ -0,0 +1,32 @@
+xmldir = $(metadatadir)
+xml_in_files = \
+ galaxy.xml.in
+
+xml_files = $(xml_in_files:.xml.in=.xml)
+xml_DATA = $(xml_files)
+
+@INTLTOOL_XML_RULE@
+
+if USE_SCHEMAS
+schemadir = $(GCONF_SCHEMA_FILE_DIR)
+schema_files = $(patsubst %.xml.in,compiz-%.schemas,$(xml_in_files))
+schema_DATA = $(schema_files)
+
+%.schemas: $(xml_files)
+ xsltproc -o $@ $(xsltdir)/schemas.xslt $(subst compiz-,,$*).xml;
+
+if GCONF_SCHEMAS_INSTALL
+install-data-local:
+ if test -z "$(DESTDIR)" ; then \
+ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schema_DATA); \
+ fi
+endif
+endif
+
+EXTRA_DIST = \
+ $(xml_in_files)
+
+DISTCLEANFILES = \
+ $(xml_files) \
+ $(schema_files)
+
diff --git a/metadata/galaxy.xml b/metadata/galaxy.xml
new file mode 100644
index 0000000..045823e
--- /dev/null
+++ b/metadata/galaxy.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<compiz>
+ <plugin useBcop="true" name="galaxy">
+ <short>Galaxy Live Wallpaper</short>
+ <long>Galaxy Live Wallpaper for Compiz</long>
+ <category>Live Wallpapers</category>
+ <deps>
+ <relation type="after">
+ <plugin>png</plugin>
+ <plugin>svg</plugin>
+ <plugin>jpeg</plugin>
+ <plugin>imgjpeg</plugin>
+ </relation>
+ </deps>
+ <display>
+ <group>
+ <short>Settings</short>
+ <option type="int" name="particles_count">
+ <short>Number Of Stars</short>
+ <long>Number of stars (This has not been implemented yet)</long>
+ <default>12500</default>
+ <min>0</min>
+ <max>25000</max>
+ </option>
+ <option type="float" name="particles_size">
+ <short>Size Of Stars</short>
+ <long>Size of stars</long>
+ <default>13.5</default>
+ <min>0.0</min>
+ <max>64.0</max>
+ <precision>0.5</precision>
+ </option>
+ <option type="int" name="update_delay">
+ <short>Update Delay</short>
+ <long>Delay in ms between screen updates. Example 1000ms/40ms = 25/sec</long>
+ <default>40</default>
+ <min>20</min>
+ <max>200</max>
+ </option>
+ <option type="bool" name="draw_streaks">
+ <short>Draw Star streaks</short>
+ <long>Draw a Star with streaks</long>
+ <default>true</default>
+ </option>
+ </group>
+ <group>
+ <short>Rotation</short>
+ <option type="int" name="rotate_x">
+ <short>Rotate X</short>
+ <long>Rotate Galaxy through X coordinate</long>
+ <default>-60</default>
+ <min>-90</min>
+ <max>90</max>
+ </option>
+ <option type="int" name="rotate_y">
+ <short>Rotate Y</short>
+ <long>Rotate Galaxy through Y coordinate</long>
+ <default>15</default>
+ <min>-90</min>
+ <max>90</max>
+ </option>
+ <option type="int" name="rotate_z">
+ <short>Rotate Z</short>
+ <long>Rotate Galaxy through Z coordinate</long>
+ <default>0</default>
+ <min>0</min>
+ <max>360</max>
+ </option>
+ <option type="float" name="zoom">
+ <short>Zoom in/out</short>
+ <long>Zoom in and out</long>
+ <default>2.0</default>
+ <min>0.0</min>
+ <max>10</max>
+ <precision>0.1</precision>
+ </option>
+ </group>
+ <group>
+ <short>Key Bindings</short>
+ <option type="key" name="toggle_key">
+ <short>Galaxy Live Wallpaper Toggle</short>
+ <long>Galaxy Live Wallpaper toggle key</long>
+ <default>&lt;Super&gt;F4</default>
+ </option>
+ </group>
+ </display>
+ </plugin>
+</compiz> \ No newline at end of file
diff --git a/metadata/galaxy.xml.in b/metadata/galaxy.xml.in
new file mode 100644
index 0000000..084e4c8
--- /dev/null
+++ b/metadata/galaxy.xml.in
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<compiz>
+ <plugin name="galaxy" useBcop="true">
+ <_short>Galaxy Live Wallpaper</_short>
+ <_long>Galaxy Live Wallpaper for Compiz</_long>
+ <category>Live Wallpapers</category>
+ <deps>
+ <relation type="after">
+ <plugin>png</plugin>
+ <plugin>svg</plugin>
+ <plugin>jpeg</plugin>
+ <plugin>imgjpeg</plugin>
+ </relation>
+ </deps>
+ <display>
+ <group>
+ <_short>Settings</_short>
+ <option name="particles_count" type="int">
+ <_short>Number Of Stars</_short>
+ <_long>Number of stars (This has not been implemented yet)</_long>
+ <default>12500</default>
+ <min>0</min>
+ <max>25000</max>
+ </option>
+ <option name="particles_size" type="float">
+ <_short>Size Of Stars</_short>
+ <_long>Size of stars</_long>
+ <default>13.5</default>
+ <min>0.0</min>
+ <max>64.0</max>
+ <precision>0.5</precision>
+ </option>
+ <option name="update_delay" type="int">
+ <_short>Update Delay</_short>
+ <_long>Delay in ms between screen updates. Example 1000ms/40ms = 25/sec</_long>
+ <default>40</default>
+ <min>20</min>
+ <max>200</max>
+ </option>
+ <option name="draw_streaks" type="bool">
+ <_short>Draw Star streaks</_short>
+ <_long>Draw a Star with streaks</_long>
+ <default>true</default>
+ </option>
+ </group>
+ <group>
+ <_short>Rotation</_short>
+ <option name="rotate_x" type="int">
+ <_short>Rotate X</_short>
+ <_long>Rotate Galaxy through X coordinate</_long>
+ <default>-60</default>
+ <min>-90</min>
+ <max>90</max>
+ </option>
+ <option name="rotate_y" type="int">
+ <_short>Rotate Y</_short>
+ <_long>Rotate Galaxy through Y coordinate</_long>
+ <default>15</default>
+ <min>-90</min>
+ <max>90</max>
+ </option>
+ <option name="rotate_z" type="int">
+ <_short>Rotate Z</_short>
+ <_long>Rotate Galaxy through Z coordinate</_long>
+ <default>0</default>
+ <min>0</min>
+ <max>360</max>
+ </option>
+ <option name="zoom" type="float">
+ <_short>Zoom in/out</_short>
+ <_long>Zoom in and out</_long>
+ <default>2.0</default>
+ <min>0.0</min>
+ <max>10</max>
+ <precision>0.1</precision>
+ </option>
+ </group>
+ <group>
+ <_short>Key Bindings</_short>
+ <option name="toggle_key" type="key">
+ <_short>Galaxy Live Wallpaper Toggle</_short>
+ <_long>Galaxy Live Wallpaper toggle key</_long>
+ <default>&lt;Super&gt;F4</default>
+ </option>
+ </group>
+ </display>
+ </plugin>
+</compiz>
+
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644
index 0000000..99a7255
--- /dev/null
+++ b/po/LINGUAS
@@ -0,0 +1,2 @@
+# Set of available languages. Keep it alphabatical. One lingua per line.
+en_GB
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 0000000..c7e8302
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,217 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 2004-2008 Rodney Dawes <dobey.pwns@gmail.com>
+#
+# This file may be copied and used freely without restrictions. It may
+# be used in projects which are not available under a GNU Public License,
+# but which still want to provide support for the GNU gettext functionality.
+#
+# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
+# instead of PACKAGE and to look for po2tbl in ./ not in intl/
+#
+# - Modified by jacob berkman <jacob@ximian.com> to install
+# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey.pwns@gmail.com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
+
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+datarootdir = @datarootdir@
+libdir = @libdir@
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po
+install_sh = @install_sh@
+# Automake >= 1.8 provides @mkdir_p@.
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
+GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
+
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep '^$$lang$$' $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep '^$$lang$$'`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
+
+POTFILES = \
+# This comment gets stripped out
+
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+
+.SUFFIXES:
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
+
+.po.pox:
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+.po.gmo:
+ file=`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+ sed -f ../intl/po2msg.sed < $< > $*.msg \
+ && rm -f $@ && gencat $@ $*.msg
+
+
+all: all-@USE_NLS@
+
+all-yes: $(CATALOGS)
+all-no:
+
+$(GETTEXT_PACKAGE).pot: $(POTFILES)
+ $(GENPOT)
+
+install: install-data
+install-data: install-data-@USE_NLS@
+install-data-no: all
+install-data-yes: all
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $$dir; \
+ if test -r $$lang.gmo; then \
+ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+ echo "installing $(srcdir)/$$lang.gmo as" \
+ "$$dir/$(GETTEXT_PACKAGE).mo"; \
+ fi; \
+ if test -r $$lang.gmo.m; then \
+ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
+ else \
+ if test -r $(srcdir)/$$lang.gmo.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+ $$dir/$(GETTEXT_PACKAGE).mo.m; \
+ echo "installing $(srcdir)/$$lang.gmo.m as" \
+ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
+
+# Define this as empty until I found a useful application.
+install-exec installcheck:
+
+uninstall:
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+ done
+
+check: all $(GETTEXT_PACKAGE).pot
+ rm -f missing notexist
+ srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+ if [ -r missing -o -r notexist ]; then \
+ exit 1; \
+ fi
+
+mostlyclean:
+ rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
+ rm -f .intltool-merge-cache
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES stamp-it
+ rm -f *.mo *.msg *.cat *.cat.m *.gmo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f Makefile.in.in
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ extra_dists="$(EXTRA_DISTFILES)"; \
+ for file in $$extra_dists; do \
+ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+ done; \
+ for file in $$dists; do \
+ test -f $$file || file="$(srcdir)/$$file"; \
+ ln $$file $(distdir) 2> /dev/null \
+ || cp -p $$file $(distdir); \
+ done
+
+update-po: Makefile
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ tmpdir=`pwd`; \
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ echo "$$lang:"; \
+ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
+ if $$result; then \
+ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.gmo failed!"; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi; \
+ done
+
+Makefile POTFILES: stamp-it
+ @if test ! -f $@; then \
+ rm -f stamp-it; \
+ $(MAKE) stamp-it; \
+ fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
+ $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/Makevars b/po/Makevars
new file mode 100644
index 0000000..8329ec2
--- /dev/null
+++ b/po/Makevars
@@ -0,0 +1,42 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = compiz-plugins-livewallpapers
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --no-location
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
+# package. (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.) Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright. The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Pal Dorogi <pal.dorogi@gmail.com>
+CHARSET = UTF-8
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+# in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+# understood.
+# - Strings which make invalid assumptions about notation of date, time or
+# money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = http://launchpad.net/~ilap
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used. It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/po/POTFILES b/po/POTFILES
new file mode 100644
index 0000000..2705707
--- /dev/null
+++ b/po/POTFILES
@@ -0,0 +1 @@
+ ../metadata/galaxy.xml.in
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 0000000..a8fc599
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1 @@
+metadata/galaxy.xml.in
diff --git a/po/en_GB.po b/po/en_GB.po
new file mode 100644
index 0000000..105bc02
--- /dev/null
+++ b/po/en_GB.po
@@ -0,0 +1,86 @@
+# compiz-plugins-livewallpapers plugins translations.
+# Copyright (C) 2010 Pal Dorogi
+# This file is distributed under the same license as the compiz-plugins-livewallpapers package.
+# Pal Dorogi <pal.dorogi@gmail.com>.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: compiz-plugins-livewallpapers 0.1\n"
+"Report-Msgid-Bugs-To:https://bugs.launchpad.net/~ilap\n"
+"POT-Creation-Date: 2010-10-07 18:10+1100\n"
+"PO-Revision-Date: 2010-10-07 19:33+1100\n"
+"Last-Translator: Pal Dorogi <pal.dorogi@gmail.com>\n"
+"Language-Team: en_GB <pal.dorogi@gmail.com>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Pootle 1.1.0\n"
+
+msgid "Galaxy Live Wallpaper"
+msgstr "Galaxy Live Wallpaper"
+
+msgid "Galaxy Live Wallpaper for Compiz"
+msgstr "Galaxy Live Wallpaper for Compiz"
+
+msgid "Settings"
+msgstr "Settings"
+
+msgid "Number Of Stars"
+msgstr "Number Of Stars"
+
+msgid "Number of stars (This has not been implemented yet)"
+msgstr "Number of stars (This has not been implemented yet)"
+
+msgid "Size Of Stars"
+msgstr "Size Of Stars"
+
+msgid "Size of stars"
+msgstr "Size of stars"
+
+msgid "Update Delay"
+msgstr "Update Delay"
+
+msgid "Delay in ms between screen updates. Example 1000ms/40ms = 25/sec"
+msgstr "Delay in ms between screen updates. Example 1000ms/40ms = 25/sec"
+
+msgid "Draw Star streaks"
+msgstr "Draw Star streaks"
+
+msgid "Draw a Star with streaks"
+msgstr "Draw a Star with streaks"
+
+msgid "Rotation"
+msgstr "Rotation"
+
+msgid "Rotate X"
+msgstr "Rotate X"
+
+msgid "Rotate Galaxy through X coordinate"
+msgstr "Rotate Galaxy through X coordinate"
+
+msgid "Rotate Y"
+msgstr "Rotate Y"
+
+msgid "Rotate Galaxy through Y coordinate"
+msgstr "Rotate Galaxy through Y coordinate"
+
+msgid "Rotate Z"
+msgstr "Rotate Z"
+
+msgid "Rotate Galaxy through Z coordinate"
+msgstr "Rotate Galaxy through Z coordinate"
+
+msgid "Zoom in/out"
+msgstr "Zoom in/out"
+
+msgid "Zoom in and out"
+msgstr "Zoom in and out"
+
+msgid "Key Bindings"
+msgstr "Key Bindings"
+
+msgid "Galaxy Live Wallpaper Toggle"
+msgstr "Galaxy Live Wallpaper Toggle"
+
+msgid "Galaxy Live Wallpaper toggle key"
+msgstr "Galaxy Live Wallpaper toggle key"
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..1978a01
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,2 @@
+## Process this file with automake to produce Makefile.in
+SUBDIRS = galaxy
diff --git a/src/galaxy/Makefile.am b/src/galaxy/Makefile.am
new file mode 100644
index 0000000..c86fe97
--- /dev/null
+++ b/src/galaxy/Makefile.am
@@ -0,0 +1,33 @@
+## Process this file with automake to produce Makefile.in
+PFLAGS=-module -avoid-version -no-undefined
+
+libgalaxy_la_LDFLAGS = $(PFLAGS)
+libgalaxy_la_LIBADD = @COMPIZ_LIBS@
+nodist_libgalaxy_la_SOURCES = galaxy_options.c \
+ galaxy_options.h
+dist_libgalaxy_la_SOURCES = \
+ galaxy.c \
+ particle.c
+
+BUILT_SOURCES = $(nodist_libgalaxy_la_SOURCES)
+
+INCLUDES = \
+ @COMPIZ_CFLAGS@ \
+ -DDATADIR='"$(compdatadir)"' \
+ -DLIBDIR='"$(libdir)"' \
+ -DLOCALEDIR="\"@datadir@/locale\"" \
+ -DIMAGEDIR='"$(imagedir)"' \
+ -I$(top_srcdir)/include
+
+moduledir = $(plugindir)
+
+
+module_LTLIBRARIES = libgalaxy.la
+
+CLEANFILES = *_options.c *_options.h
+
+galaxy_options.h: ../../metadata/galaxy.xml.in
+ $(BCOP_BIN) --header $@ $<
+
+galaxy_options.c: ../../metadata/galaxy.xml.in galaxy_options.h
+ $(BCOP_BIN) --source $@ $<
diff --git a/src/galaxy/galaxy.c b/src/galaxy/galaxy.c
new file mode 100644
index 0000000..2a9c354
--- /dev/null
+++ b/src/galaxy/galaxy.c
@@ -0,0 +1,428 @@
+/**
+ *
+ * Compiz galaxy livewallpaper plugin
+ *
+ * galaxy.c
+ *
+ * Copyright (c) 2010 Pal Dorogi <pal.dorogi@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ **/
+
+#include <compiz-core.h>
+
+#include "galaxy_options.h"
+
+#include "particle.h"
+#include "galaxy.h"
+
+static int displayPrivateIndex = 0;
+
+static Bool
+updateGalaxy (void *closure)
+{
+ CompScreen *s = closure;
+
+ GALAXY_SCREEN (s);
+
+ if (!gs->active)
+ return TRUE;
+
+ if (gs->ps)
+ updateParticles (gs->ps);
+
+ CompWindow *w;
+
+ for (w = s->windows; w; w = w->next)
+ {
+ if (w->type & CompWindowTypeDesktopMask)
+ addWindowDamage (w);
+ }
+ return TRUE;
+}
+
+static GLboolean
+initParticleSystem (CompScreen *s)
+{
+ GALAXY_SCREEN (s);
+
+ gs->ps = (ParticleSystem *) calloc (1, sizeof (ParticleSystem));
+ if (!gs->ps)
+ return FALSE;
+
+ ParticleSystem *ps = gs->ps;
+
+ ps->particlesCount = galaxyGetParticlesCount (s->display);
+ ps->particlesSize = galaxyGetParticlesSize (s->display);
+
+ ps->particles = NULL;
+ ps->vertices = NULL;
+ ps->colors = NULL;
+
+ ps->rotateX = galaxyGetRotateX (s->display);
+ ps->rotateY = galaxyGetRotateY (s->display);
+ ps->rotateZ = galaxyGetRotateZ (s->display);
+ ps->zoom = galaxyGetZoom (s->display);
+
+
+ ps->lightTexture = 0;
+ ps->flareTexture = 0;
+ ps->draw_streaks = galaxyGetDrawStreaks (s->display);
+
+ ps->fovy = FOVY; /* THETA */
+ ps->nearClip = NEAR;
+ ps->farClip = FAR;
+
+ ps->screenWidth = s->width;
+ ps->screenHeight = s->height;
+
+
+
+ /* FIXME: The loadLightTexture should need to be cleaned */
+ if (loadLightTexture (s))
+ {
+ /* Pass the texture to the ParticleSystem */
+ ps->lightTexture = gs->lightTexture.name;
+ }
+ else
+ return FALSE;
+
+ buildParticles (gs->ps);
+
+ return TRUE;
+}
+
+/*
+ * FIXME: Find a better solution for loading Light and pass to ParticleSystem.
+ */
+Bool
+loadLightTexture (CompScreen *s)
+{
+ GALAXY_SCREEN (s);
+
+ if (!readImageToTexture (s, &gs->lightTexture, "galaxy-light.jpg",
+ &gs->lightWidth, &gs->lightHeight))
+ {
+ finiTexture (s, &gs->lightTexture);
+ initTexture (s, &gs->lightTexture);
+
+ return FALSE;
+ }
+
+ return TRUE;
+
+}
+
+static Bool
+galaxyDrawWindow (CompWindow *w,
+ const CompTransform *transform,
+ const FragmentAttrib *attrib,
+ Region region,
+ unsigned int mask)
+{
+ Bool status;
+
+ GALAXY_SCREEN (w->screen);
+
+ /* First draw Window as usual */
+ UNWRAP (gs, w->screen, drawWindow);
+ status = (*w->screen->drawWindow) (w, transform, attrib, region, mask);
+ WRAP (gs, w->screen, drawWindow, galaxyDrawWindow);
+
+ if (gs->active && (w->type & CompWindowTypeDesktopMask))
+ {
+ /* TODO: Try to find a solution to use a custom background */
+ /* clearTargetOutput (w->screen->display, GL_COLOR_BUFFER_BIT); */
+ drawGalaxy (gs->ps);
+ }
+
+ return status;
+}
+
+static void
+galaxyDisplayOptionChanged (CompDisplay *d,
+ CompOption *opt,
+ GalaxyDisplayOptions num)
+{
+ CompScreen *s;
+
+ s = d->screens;
+ if (!s)
+ return;
+
+ GALAXY_SCREEN (s);
+
+ switch (num)
+ {
+ case GalaxyDisplayOptionParticlesCount:
+ {
+ /* TODO: Add dynamic particles recreation functions. */
+ }
+ case GalaxyDisplayOptionToggleKey:
+ {
+ /* TODO: Handle or get rid of it. */
+ }
+ case GalaxyDisplayOptionNum:
+ {
+ /* TODO: Handle or get rid of it. */
+ }
+ break;
+ case GalaxyDisplayOptionParticlesSize:
+ {
+ if (gs->ps)
+ gs->ps->particlesSize = galaxyGetParticlesSize (d);
+ }
+ break;
+ case GalaxyDisplayOptionUpdateDelay:
+ {
+ if (gs->compTimeout)
+ compRemoveTimeout (gs->compTimeout);
+
+ gs->compTimeout = compAddTimeout (galaxyGetUpdateDelay(d),
+ (float) galaxyGetUpdateDelay(d) *
+ 1.2,
+ updateGalaxy, s);
+ }
+ break;
+ case GalaxyDisplayOptionDrawStreaks:
+ {
+ if (gs->ps)
+ {
+ /* FIXME: Get rid of this variable. */
+ gs->ps->draw_streaks = galaxyGetDrawStreaks (d);
+ generateFlare (gs->ps, gs->ps->draw_streaks);
+ }
+ }
+ break;
+ case GalaxyDisplayOptionRotateX:
+ {
+ if (gs->ps)
+ gs->ps->rotateX = galaxyGetRotateX (d);
+ }
+ break;
+ case GalaxyDisplayOptionRotateY:
+ {
+ if (gs->ps)
+ gs->ps->rotateY = galaxyGetRotateY (d);
+ }
+ break;
+ case GalaxyDisplayOptionRotateZ:
+ {
+ if (gs->ps)
+ gs->ps->rotateZ = galaxyGetRotateZ (d);
+ }
+ break;
+ case GalaxyDisplayOptionZoom:
+ {
+ if (gs->ps)
+ gs->ps->zoom = galaxyGetZoom (d);
+ }
+ break;
+ }
+}
+
+static Bool
+galaxyDisplayToggleChanged (CompDisplay *d,
+ CompAction *action,
+ CompActionState state,
+ CompOption *option,
+ int nOption)
+{
+ CompScreen *s;
+ Window xid;
+
+ xid = getIntOptionNamed (option, nOption, "root", 0);
+
+ s = findScreenAtDisplay (d, xid);
+ if (s)
+ {
+ GALAXY_SCREEN (s);
+
+ gs->active = !gs->active;
+ if (!gs->active)
+ damageScreen (s);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static Bool
+galaxyInitDisplay (CompPlugin *p,
+ CompDisplay *d)
+{
+ GalaxyDisplay *gd;
+
+ if (!checkPluginABI ("core", CORE_ABIVERSION))
+ return FALSE;
+
+ gd = (GalaxyDisplay *) malloc (sizeof (GalaxyDisplay));
+ if (!gd)
+ return FALSE;
+
+ gd->screenPrivateIndex = allocateScreenPrivateIndex (d);
+ if (gd->screenPrivateIndex < 0) {
+ free (gd);
+ return FALSE;
+ }
+
+ galaxySetParticlesCountNotify (d, galaxyDisplayOptionChanged);
+ galaxySetParticlesSizeNotify (d, galaxyDisplayOptionChanged);
+ galaxySetUpdateDelayNotify (d, galaxyDisplayOptionChanged);
+ galaxySetDrawStreaksNotify (d, galaxyDisplayOptionChanged);
+ galaxySetRotateXNotify (d, galaxyDisplayOptionChanged);
+ galaxySetRotateYNotify (d, galaxyDisplayOptionChanged);
+ galaxySetRotateZNotify (d, galaxyDisplayOptionChanged);
+ galaxySetZoomNotify (d, galaxyDisplayOptionChanged);
+
+ galaxySetToggleKeyInitiate (d, galaxyDisplayToggleChanged);
+
+ d->base.privates[displayPrivateIndex].ptr = gd;
+
+ return TRUE;
+}
+
+static Bool
+galaxyInitScreen (CompPlugin *p,
+ CompScreen *s)
+{
+ GALAXY_DISPLAY (s->display);
+
+ GalaxyScreen *gs = (GalaxyScreen *) calloc (1, sizeof (GalaxyScreen));
+ if (!gs)
+ return FALSE;
+
+ gs->active = FALSE;
+
+ s->base.privates[gd->screenPrivateIndex].ptr = gs;
+
+ if (!initParticleSystem (s))
+ return FALSE;
+
+ WRAP (gs, s, drawWindow, galaxyDrawWindow);
+
+ gs->compTimeout = compAddTimeout (galaxyGetUpdateDelay (s->display),
+ (float) galaxyGetUpdateDelay (s->display) *
+ 1.2,
+ updateGalaxy, s);
+
+ initTexture (s, &gs->lightTexture);
+
+ return TRUE;
+}
+
+static void
+galaxyFiniDisplay (CompPlugin *p,
+ CompDisplay *d)
+{
+ GALAXY_DISPLAY (d);
+
+ freeScreenPrivateIndex (d, gd->screenPrivateIndex);
+ free (gd);
+}
+
+static void
+galaxyFiniScreen (CompPlugin *p,
+ CompScreen *s)
+{
+ GALAXY_SCREEN (s);
+
+ if (!gs) return;
+
+ if (gs->compTimeout)
+ compRemoveTimeout (gs->compTimeout);
+
+ if (gs->ps)
+ {
+ ParticleSystem *ps;
+
+ ps = gs->ps;
+ if (ps->particles)
+ free (ps->particles);
+
+ if (ps->vertices)
+ free (ps->vertices);
+
+ if (ps->colors)
+ free (ps->colors);
+
+ free (ps);
+ }
+
+ UNWRAP (gs, s, drawWindow);
+
+ finiTexture (s, &gs->lightTexture);
+
+ free (gs);
+}
+
+static Bool
+galaxyInit (CompPlugin *p)
+{
+ displayPrivateIndex = allocateDisplayPrivateIndex ();
+
+ if (displayPrivateIndex < 0)
+ return FALSE;
+
+ return TRUE;
+}
+
+static void
+galaxyFini (CompPlugin *p)
+{
+ if (displayPrivateIndex >= 0)
+ freeDisplayPrivateIndex (displayPrivateIndex);
+}
+
+static CompBool
+galaxyInitObject (CompPlugin *p,
+ CompObject *o)
+{
+ static InitPluginObjectProc dispTab[] = {
+ (InitPluginObjectProc) 0, /* InitCore */
+ (InitPluginObjectProc) galaxyInitDisplay,
+ (InitPluginObjectProc) galaxyInitScreen
+ };
+
+ RETURN_DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), TRUE, (p, o));
+}
+
+static void
+galaxyFiniObject (CompPlugin *p,
+ CompObject *o)
+{
+ static FiniPluginObjectProc dispTab[] = {
+ (FiniPluginObjectProc) 0, /* FiniCore */
+ (FiniPluginObjectProc) galaxyFiniDisplay,
+ (FiniPluginObjectProc) galaxyFiniScreen
+ };
+
+ DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), (p, o));
+}
+
+CompPluginVTable galaxyVTable = {
+ "galaxy",
+ 0,
+ galaxyInit,
+ galaxyFini,
+ galaxyInitObject,
+ galaxyFiniObject,
+ 0,
+ 0
+};
+
+CompPluginVTable*
+getCompPluginInfo (void)
+{
+ return &galaxyVTable;
+} \ No newline at end of file
diff --git a/src/galaxy/galaxy.h b/src/galaxy/galaxy.h
new file mode 100644
index 0000000..a1eeb4f
--- /dev/null
+++ b/src/galaxy/galaxy.h
@@ -0,0 +1,71 @@
+/**
+ *
+ * Compiz galaxy livewallpaper plugin
+ *
+ * galaxy.h
+ *
+ * Copyright (c) 2010 Pal Dorogi <pal.dorogi@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ **/
+
+#ifndef _GALAXY_H
+#define _GALAXY_H
+
+COMPIZ_BEGIN_DECLS
+
+extern GLvoid generateFlare (ParticleSystem *ps, GLboolean drawStreaks);
+
+extern GLboolean buildParticles (ParticleSystem *ps);
+extern GLboolean updateParticles (ParticleSystem *ps);
+
+extern GLvoid drawParticles (ParticleSystem *ps);
+extern GLvoid drawGalaxy (ParticleSystem *ps);
+
+
+typedef struct _GalaxyDisplay {
+ int screenPrivateIndex;
+} GalaxyDisplay;
+
+typedef struct _GalaxyScreen
+{
+ Bool active;
+
+ ParticleSystem *ps;
+
+ /* This texture comes from Options */
+ /* TODO: Get rid off these. */
+ CompTexture lightTexture;
+ unsigned int lightWidth;
+ unsigned int lightHeight;
+
+ CompTimeoutHandle compTimeout;
+
+ DrawWindowProc drawWindow;
+
+} GalaxyScreen;
+
+#define GET_GALAXY_DISPLAY(d) \
+ ((GalaxyDisplay *) (d)->base.privates[displayPrivateIndex].ptr)
+
+#define GALAXY_DISPLAY(d) \
+ GalaxyDisplay *gd = GET_GALAXY_DISPLAY (d)
+
+#define GET_GALAXY_SCREEN(s, gd) \
+ ((GalaxyScreen *) (s)->base.privates[(gd)->screenPrivateIndex].ptr)
+
+#define GALAXY_SCREEN(s) \
+ GalaxyScreen *gs = GET_GALAXY_SCREEN (s, GET_GALAXY_DISPLAY (s->display))
+
+COMPIZ_END_DECLS
+
+#endif /* _GALAXY_H */ \ No newline at end of file
diff --git a/src/galaxy/particle.c b/src/galaxy/particle.c
new file mode 100644
index 0000000..6d87d87
--- /dev/null
+++ b/src/galaxy/particle.c
@@ -0,0 +1,434 @@
+/**
+ *
+ * Compiz galaxy livewallpaper plugin
+ *
+ * particle.c
+ *
+ * Copyright (c) 2010 Pal Dorogi <pal.dorogi@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ **/
+
+#include <math.h>
+
+#include <compiz-core.h>
+
+#include "particle.h"
+
+/*
+ * Set the color
+ *
+ * O 155 176 255 #9bb0ff Blue
+ * B 170 191 255 #aabfff Blue-White
+ * A 202 215 255 #cad7ff White
+ * F 248 247 255 #f8f7ff White
+ * G 255 244 234 #fff4ea Yellow-White
+ * K 255 210 161 #ffd2a1 Orange
+ * M 255 204 111 #ffcc6f Red
+ * Reference: http://www.vendian.org/mncharity/dir3/starcolor/
+ * Use my personal favorite mneomnic:
+ * Only Bored Astronomers Find Gratification Knowing Mnemonics:)
+ */
+unsigned char star_colors[7][3] =
+{
+ {155, 176, 255},
+ {170, 191, 255},
+ {202, 215, 255},
+ {248, 247, 255},
+ {255, 244, 234},
+ {255, 210, 161},
+ {255, 204, 111}
+};
+
+enum _star_type {O, B, A, F, G, K, M} star_type;
+
+#define RED 0
+#define GREEN 1
+#define BLUE 2
+
+#define FLARE_SIZE 32
+
+static inline float
+randf (void)
+{
+ return rand () / (GLfloat) RAND_MAX;
+}
+
+static inline float
+rand1f (float num)
+{
+ return num * randf ();
+}
+
+static inline float
+rand2f (float min, float max)
+{
+ return min + (max - min) * randf ();
+}
+
+static inline float
+clampf (float num, float min, float max)
+{
+ if(num > max)
+ {
+ num = max;
+ } else if (num < min)
+ {
+ num = min;
+ }
+
+ return num;
+}
+
+/*
+ * Gaussian random generator
+ * Using the polar form of the Box-Muller transformation
+ */
+static float
+randng (void)
+{
+ static float y1, y2;
+ static int have_next = FALSE;
+
+ if (have_next)
+ {
+ have_next = FALSE;
+ return y2;
+ }
+
+ float x1, x2, w;
+ do
+ {
+ x1 = 2.0 * randf () - 1.0;
+ x2 = 2.0 * randf () - 1.0;
+ w = x1 * x1 + x2 * x2;
+ } while (w >= 1.0);
+
+ w = sqrt(-2.0 * log (w) / w);
+ y1 = x1 * w;
+ y2 = x2 * w;
+ have_next = TRUE;
+
+ return y1;
+}
+
+GLvoid
+generateFlare (ParticleSystem *ps, GLboolean drawStreaks)
+{
+ GLint w, h;
+ GLint i, x, y;
+ GLfloat dx, dy, r, R;
+ GLfloat fa; /* flare alpha */
+
+ w = FLARE_SIZE;
+ h = FLARE_SIZE;
+ R = (w + h) / 4;
+ GLubyte *data;
+
+ data = (GLubyte *) malloc (w * h * 4);
+ if (!data)
+ return;
+
+ for (x = 0; x < w; ++x)
+ {
+ for (y = 0; y < h; ++y)
+ {
+
+ dx = (R - x) / R;
+ dy = (R - y) / R;
+ r = sqrt(dx * dx + dy * dy);
+ /* r = exp(-(r));
+ r *= r; */
+ r = 1 - r; /* Comment out when you uncomment the 2 lines above */
+
+ /* Draw flare */
+ fa = r * r;
+ if (r > 1)
+ fa = 1;
+
+ /* Draw streaks */
+ if (drawStreaks && ((dx == 0.f) || (dy == 0.f)))
+ {
+ fa += r * 0.5;
+ if (fa > 1) fa = 1;
+ }
+
+ if ((x == 0) || (x == (FLARE_SIZE - 1)) ||
+ (y == 0) || (y == (FLARE_SIZE - 1)))
+ {
+ fa = 0;
+ }
+
+ i = (x + y * w) * 4;
+ data[i + 0] = 255; /* Red */
+ data[i + 1] = 255; /* Ggreen */
+ data[i + 2] = 255; /* Blue */
+ data[i + 3] = (GLubyte)(255.0f * fa); /* Alpha */
+ }
+ }
+
+ if (&ps->flareTexture)
+ {
+ glDeleteTextures (1, &ps->flareTexture);
+ ps->flareTexture = 0;
+ }
+
+ glGenTextures (1, &ps->flareTexture);
+ glBindTexture (GL_TEXTURE_2D, ps->flareTexture);
+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, data);
+ if (data)
+ free (data);
+}
+
+GLvoid
+initParticle (Particle *p)
+{
+ float gauss;
+ float distance;
+
+ p->angle = rand1f (_2PI);
+
+ gauss = randng ();
+ distance = fabs (gauss) * 0.5f;
+ p->distance = distance;
+
+ p->x = cosf (distance * _2PI);
+ p->y = sinf (distance * _2PI);
+
+ /* z is based on the mix of Normal and Standard Cauchy distributions */
+ p->z = (1 - distance) * 0.25 * randng () /
+ (_PI * (1 + (2 * distance * distance)));
+ if (distance < 0.2)
+ {
+ p->z *= 0.8f;
+ }
+
+ /*
+ * Velocity is based on the Sun's angular velocity (360 degree / 250m yrs)
+ * and -+50m yrs (reduced to 300k and 200k to slow down) and the distance.
+ */
+ /* FIXME: Need a proper speed calculation */
+ p->speed = rand2f (0.0012f, 0.0018f) / distance * 0.5f;
+
+ /* Color is based on the Star colors. See above */
+ if (distance < 0.15f)
+ {
+ star_type = B;
+ }
+ else if (distance < 0.25f)
+ {
+ star_type = A;
+ }
+ else if (distance < 0.35f)
+ {
+ star_type = F;
+ }
+ else
+ {
+ star_type = G;
+ }
+
+
+ p->r = star_colors[star_type][RED];
+ p->g = star_colors[star_type][GREEN];
+ p->b = star_colors[star_type][BLUE];
+
+ p->a = (GLubyte) clampf (255 - (1 - distance) * 100, 155, 255);
+
+}
+
+GLboolean
+buildParticles (ParticleSystem *ps)
+{
+
+ if (ps->particles)
+ free (ps->particles);
+
+ ps->particles = calloc (1, sizeof (Particle) * ps->particlesCount);
+ if (!ps->particles)
+ return FALSE;
+
+ if (ps->vertices)
+ free (ps->vertices);
+ ps->vertices = calloc (1, ps->particlesCount * 3 * sizeof (GLfloat));
+ if (!ps->vertices)
+ return FALSE;
+
+ if (ps->colors)
+ free (ps->colors);
+ ps->colors = calloc (1, ps->particlesCount * 4 * sizeof (GLubyte));
+ if (!ps->colors)
+ return FALSE;
+
+ /* TRUE: Draw Streaks, FALSE: do not */
+ generateFlare (ps, ps->draw_streaks);
+
+ int i;
+ for (i = 0; i < ps->particlesCount; i++)
+ {
+ initParticle (&ps->particles[i]);
+ }
+
+ return TRUE;
+}
+
+GLvoid
+updateParticles (ParticleSystem *ps)
+{
+ static float x, y, xi, yi, zi;
+ static int i;
+
+ Particle *particles = ps->particles;
+ GLfloat *vertices = ps->vertices;
+ GLubyte *colors = ps->colors;
+
+ for (i = 0; i < ps->particlesCount; i++)
+ {
+ particles[i].angle = particles[i].angle + particles[i].speed;
+
+ x = particles[i].distance * cosf (particles[i].angle);
+ y = particles[i].distance * sinf (particles[i].angle) * -ELLIPSE_RATIO;
+
+ xi = particles[i].x * y + particles[i].y * x;
+ yi = particles[i].y * y - particles[i].x * x;
+
+ zi = particles[i].z;
+
+ colors[0] = particles[i].r;
+ colors[1] = particles[i].g;
+ colors[2] = particles[i].b;
+ colors[3] = particles[i].a;
+ colors += 4;
+
+ vertices[0] = xi;
+ vertices[1] = yi;
+ vertices[2] = zi;
+ vertices += 3;
+ }
+}
+
+static GLvoid
+drawLight (ParticleSystem *ps)
+{
+ glBindTexture (GL_TEXTURE_2D, ps->lightTexture);
+ glBegin(GL_QUADS); // Draw Texture Mapped Quad
+ glTexCoord2d(0.0f, 0.0f); // First Texture Coord
+ glVertex2f(-1.0f, -1.0f); // First Vertex
+ glTexCoord2d(1.0f, 0.0f); // Second Texture Coord
+ glVertex2f(1.0f, -1.0f); // Second Vertex
+ glTexCoord2d(1.0f, 1.0f); // Third Texture Coord
+ glVertex2f(1.0f, 1.0f); // Third Vertex
+ glTexCoord2d(0.0f, 1.0f); // Fourth Texture Coord
+ glVertex2f(-1.0f, 1.0f); // Fourth Vertex
+ glEnd();
+}
+
+GLvoid
+drawParticles (ParticleSystem *ps)
+{
+ /* FIXME: Find a proper qudratic attenuation */
+ static GLfloat quadratic[] = { 1.f, .0f, .050f };
+ static GLfloat max_size = .0f;
+
+ glBindTexture (GL_TEXTURE_2D, ps->flareTexture);
+
+ glPointParameterfv (GL_POINT_DISTANCE_ATTENUATION, quadratic);
+ glPointParameterf (GL_POINT_FADE_THRESHOLD_SIZE, 60.0f);
+
+ glGetFloatv (GL_POINT_SIZE_MAX, &max_size);
+ glPointParameterf (GL_POINT_SIZE_MIN, .1f);
+ #ifdef POINT_SIZE_MAX_WORKS
+ /* FIXME: This does not work with my Intel's DRI driver. */
+ glPointParameterf(GL_POINT_SIZE_MAX, max_size);
+ #endif
+
+ glDepthMask(GL_FALSE);
+ glPointSize (ps->particlesSize); /* It's faster than call the get func */
+
+ glTexEnvf (GL_POINT_SPRITE_ARB, GL_COORD_REPLACE, GL_TRUE);
+ glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+ glEnable (GL_POINT_SPRITE);
+
+ /* Draw the Array */
+ glEnableClientState (GL_COLOR_ARRAY);
+ glVertexPointer (3, GL_FLOAT, 3 * sizeof (GLfloat), ps->vertices);
+ glColorPointer (4, GL_UNSIGNED_BYTE, 4 * sizeof (GLubyte), ps->colors);
+ glDrawArrays (GL_POINTS, 0, ps->particlesCount);
+ glDisableClientState (GL_COLOR_ARRAY);
+
+ glDisable (GL_POINT_SPRITE);
+}
+
+GLvoid
+drawGalaxy (ParticleSystem *ps)
+{
+
+ glEnable (GL_TEXTURE_2D);
+ glEnable (GL_BLEND);
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE); /* Additive */
+
+ /* Reset and save the coordinate system before touching. */
+ glMatrixMode (GL_PROJECTION);
+ glPushMatrix ();
+ glLoadIdentity ();
+
+ /* Set the viewport to be the entire window. */
+ glViewport (0, 0, ps->screenWidth, ps->screenHeight);
+
+ /**
+ * Using glFrustum instead of gluPrespective.
+ * http://www.opengl.org/wiki/GluPerspective_code
+ */
+ double ymax, xmax;
+ ymax = ps->nearClip * tanf (ps->fovy * M_PI / 360.0);
+ xmax = ymax * ((double) ps->screenWidth / (double) ps->screenHeight);
+ /* Set the correct Galaxy perspective. */
+ glFrustum(-xmax, xmax, -ymax, ymax, ps->nearClip, ps->farClip);
+
+ glMatrixMode (GL_MODELVIEW);
+ glPushMatrix ();
+ glLoadIdentity();
+ /*
+ * FIXME: Find a solution for proper background/wallpaper drawing
+ drawBackground (ps);
+ */
+
+ glTranslatef (0.0f, 0.0f, -ps->zoom);
+
+ glRotatef (ps->rotateX, 1.0f, 0.0f, 0.0f); /* Rotate on X axis */
+ glRotatef (ps->rotateY, 0.0f, 1.0f, 0.0f); /* Rotate on Y axis */
+ glRotatef (ps->rotateZ, 0.0f, 0.0f, 1.0f); /* Rotate on Z axis */
+
+ /* Draw particles. */
+ drawParticles (ps);
+ /* Draw light. */
+ drawLight (ps);
+
+ /* Restore the coordinate system. */
+ glMatrixMode (GL_PROJECTION);
+ glPopMatrix ();
+ /* Restore the original perspective. */
+ glMatrixMode (GL_MODELVIEW);
+ glPopMatrix ();
+
+ /* Restore blendig and other stuffs */
+ glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+ glDisable (GL_TEXTURE_2D);
+ glDisable (GL_BLEND);
+ glColor4usv (defaultColor);
+}
diff --git a/src/galaxy/particle.h b/src/galaxy/particle.h
new file mode 100644
index 0000000..6965622
--- /dev/null
+++ b/src/galaxy/particle.h
@@ -0,0 +1,77 @@
+/**
+ *
+ * Compiz galaxy livewallpaper plugin
+ *
+ * particle.h
+ *
+ * Copyright (c) 2010 Pal Dorogi <pal.dorogi@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ **/
+
+#ifndef _PARTICLE_H
+#define _PARTICLE_H
+
+COMPIZ_BEGIN_DECLS
+
+#define _PI (float) 3.141593
+#define _2PI (float) (2 * _PI)
+
+#define ELLIPSE_RATIO .885f /* 0 (line) -> 1.0f (circle) */
+#define ELLIPSE_TWIST _2PI
+
+/* Fovy angle a.k.a theta */
+#define FOVY 45.0f
+#define NEAR 0.1f
+#define FAR 20.0f
+
+typedef struct _Particle {
+ GLfloat x, y, z;
+ GLfloat angle;
+
+ GLfloat distance;
+ GLfloat size;
+ GLfloat speed;
+
+ GLubyte r, g, b, a;
+} Particle;
+
+typedef struct _ParticleSystem {
+ GLint particlesCount;
+ GLint particlesSize;
+
+ Particle *particles;
+ GLfloat *vertices;
+ GLubyte *colors;
+
+ GLint rotateX;
+ GLint rotateY;
+ GLint rotateZ;
+ GLfloat zoom;
+
+ GLuint lightTexture;
+ GLuint flareTexture;
+
+ GLboolean draw_streaks;
+
+ GLfloat fovy; /* theta */
+ GLfloat nearClip;
+ GLfloat farClip;
+
+ GLint screenWidth;
+ GLint screenHeight;
+
+} ParticleSystem;
+
+COMPIZ_BEGIN_DECLS
+
+#endif /* _PARTICLE_H */