diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-09-11 14:38:47 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2020-09-11 14:38:47 +0900 |
commit | 884c8093d63402a1ad0b502244b791e3c6782be3 (patch) | |
tree | a600d4ab0d431a2bdfe4c15b70df43c14fbd8dd0 /debian/libcompizconfig-trinity | |
parent | 14e1aa2006796f147f3f4811fb908a6b01e79253 (diff) | |
download | extra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.tar.gz extra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.zip |
Added debian extra dependency packages.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/libcompizconfig-trinity')
59 files changed, 16013 insertions, 0 deletions
diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/AUTHORS b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/AUTHORS new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/AUTHORS @@ -0,0 +1,2 @@ + + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/COPYING b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/COPYING new file mode 100644 index 00000000..623b6258 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/ChangeLog b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/ChangeLog new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/ChangeLog diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/INSTALL b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/INSTALL new file mode 100644 index 00000000..23e5f25d --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/INSTALL @@ -0,0 +1,236 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free +Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +These are generic installation instructions. + + 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 only 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. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. 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. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. 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. + +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=c89 CFLAGS=-O2 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 must use a version of `make' that +supports the `VPATH' variable, such as 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 `..'. + + If you have to use a `make' that does not support the `VPATH' +variable, you have 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. + +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'. + + 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. + + 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'. + +Optional Features +================= + +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. + +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). Here is a another example: + + /bin/bash ./configure CONFIG_SHELL=/bin/bash + +Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent +configuration-related scripts to be executed by `/bin/bash'. + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--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. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/LICENSE.gpl b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/LICENSE.gpl new file mode 100644 index 00000000..d511905c --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/LICENSE.gpl @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser General +Public License instead of this License. diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/LICENSE.lgpl b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/LICENSE.lgpl new file mode 100644 index 00000000..5ab7695a --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/LICENSE.lgpl @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +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 and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, 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 library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete 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 distribute a copy of this License along with the +Library. + + 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 Library or any portion +of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +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 Library, 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 Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you 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. + + If distribution of 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 satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be 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. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library 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. + + 9. 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 Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +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 with +this License. + + 11. 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 Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library 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 Library. + +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. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library 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. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser 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 Library +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 Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +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 + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "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 +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. 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 LIBRARY 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 +LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. 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 library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/Makefile.am b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/Makefile.am new file mode 100644 index 00000000..c2e6a73b --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/Makefile.am @@ -0,0 +1,25 @@ +## Process this file with automake to produce Makefile.in + +ALL_SUBDIRS = \ + include \ + po \ + src \ + backend \ + plugin \ + metadata \ + config + +SUBDIRS = $(ALL_SUBDIRS) + +EXTRA_DIST = \ + VERSION \ + COPYING \ + libcompizconfig.pc.in + +clean: + for sdir in $(SUBDIRS) ; do \ + cd $$sdir; make clean; cd .. ; \ + done + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libcompizconfig.pc diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/NEWS b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/NEWS new file mode 100644 index 00000000..94941cc7 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/NEWS @@ -0,0 +1 @@ +There is nothing here yet. diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/README b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/README new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/README diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/TODO b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/TODO new file mode 100644 index 00000000..6fe58fa5 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/TODO @@ -0,0 +1,7 @@ + +- write a simple ini file implementation to read/write general options without + glib (maybe for inport/export of setting too) +- python bindings (and beryl-settings then) +- port ini, gconf backend +- settings plugin + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/VERSION b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/VERSION new file mode 100644 index 00000000..e4184f46 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/VERSION @@ -0,0 +1 @@ +VERSION=0.8.4 diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/autogen.sh b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/autogen.sh new file mode 100755 index 00000000..e9ae46e6 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/autogen.sh @@ -0,0 +1,16 @@ +#! /bin/sh + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir + +autoreconf -v --install || exit 1 +glib-gettextize --copy --force || exit 1 +intltoolize --automake --copy --force || exit 1 + +cd $ORIGDIR || exit $? + +$srcdir/configure --enable-debug=full --enable-maintainer-mode "$@" + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/backend/Makefile.am b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/backend/Makefile.am new file mode 100644 index 00000000..bc38a3ca --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/backend/Makefile.am @@ -0,0 +1,18 @@ +## Process this file with automake to produce Makefile.in + +INCLUDES = \ + @COMPIZ_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -DPLUGINDIR=\"$(PLUGINDIR)\" \ + -DLIBDIR=\"$(libdir)\" + +libini_la_LDFLAGS = -module -avoid-version -no-undefined $(all_libraries) +libini_la_LIBADD = $(top_builddir)/src/libcompizconfig.la +libini_la_SOURCES = ini.c +backenddir = $(libdir)/compizconfig/backends + +METASOURCES = AUTO + +backend_LTLIBRARIES = libini.la + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/backend/ini.c b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/backend/ini.c new file mode 100644 index 00000000..82094e68 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/backend/ini.c @@ -0,0 +1,727 @@ +/** + * + * INI libccs backend + * + * ini.c + * + * Copyright (c) 2007 Danny Baumann <maniac@opencompositing.org> + * + * 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. + * + **/ + +#define _GNU_SOURCE +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <malloc.h> +#include <string.h> + +#include <sys/types.h> +#include <sys/stat.h> +#include <dirent.h> +#include <unistd.h> +#include <errno.h> + +#include <ccs.h> +#include <ccs-backend.h> + +#include <X11/X.h> +#include <X11/Xlib.h> + +#define DEFAULTPROF "Default" +#define SETTINGPATH "compiz/compizconfig" + +typedef struct _IniPrivData +{ + CCSContext *context; + char * lastProfile; + IniDictionary * iniFile; + unsigned int iniWatchId; +} + +IniPrivData; + +static IniPrivData *privData = NULL; + +static int privDataSize = 0; + +/* forward declaration */ +static void setProfile (IniPrivData *data, char *profile); + +static IniPrivData* +findPrivFromContext (CCSContext *context) +{ + int i; + IniPrivData *data; + + for (i = 0, data = privData; i < privDataSize; i++, data++) + if (data->context == context) + break; + + if (i == privDataSize) + return NULL; + + return data; +} + +static char* +getIniFileName (char *profile) +{ + char *configDir = NULL; + char *fileName = NULL; + + configDir = getenv ("XDG_CONFIG_HOME"); + if (configDir && strlen (configDir)) + { + asprintf (&fileName, "%s/%s/%s.ini", configDir, SETTINGPATH, profile); + return fileName; + } + + configDir = getenv ("HOME"); + if (configDir && strlen (configDir)) + { + asprintf (&fileName, "%s/.config/%s/%s.ini", configDir, SETTINGPATH, + profile); + return fileName; + } + + return NULL; +} + +static void +processFileEvent (unsigned int watchId, + void *closure) +{ + IniPrivData *data = (IniPrivData *) closure; + char *fileName; + + /* our ini file has been modified, reload it */ + + if (data->iniFile) + ccsIniClose (data->iniFile); + + fileName = getIniFileName (data->lastProfile); + + if (!fileName) + return; + + data->iniFile = ccsIniOpen (fileName); + + ccsReadSettings (data->context); + + free (fileName); +} + +static void +setProfile (IniPrivData *data, + char *profile) +{ + char *fileName; + struct stat fileStat; + + if (data->iniFile) + ccsIniClose (data->iniFile); + + if (data->iniWatchId) + ccsRemoveFileWatch (data->iniWatchId); + + data->iniFile = NULL; + + data->iniWatchId = 0; + + /* first we need to find the file name */ + fileName = getIniFileName (profile); + + if (!fileName) + return; + + /* if the file does not exist, we have to create it */ + if (stat (fileName, &fileStat) == -1) + { + if (errno == ENOENT) + { + FILE *file; + file = fopen (fileName, "w"); + + if (!file) + { + free (fileName); + return; + } + fclose (file); + } + else + { + free (fileName); + return; + } + } + + data->iniWatchId = ccsAddFileWatch (fileName, TRUE, + processFileEvent, data); + + /* load the data from the file */ + data->iniFile = ccsIniOpen (fileName); + + free (fileName); +} + +static Bool +initBackend (CCSContext * context) +{ + IniPrivData *newData; + + privData = realloc (privData, (privDataSize + 1) * sizeof (IniPrivData)); + newData = privData + privDataSize; + + /* initialize the newly allocated part */ + memset (newData, 0, sizeof (IniPrivData)); + newData->context = context; + + privDataSize++; + + return TRUE; +} + +static Bool +finiBackend (CCSContext * context) +{ + IniPrivData *data; + + data = findPrivFromContext (context); + + if (!data) + return FALSE; + + if (data->iniFile) + ccsIniClose (data->iniFile); + + if (data->iniWatchId) + ccsRemoveFileWatch (data->iniWatchId); + + if (data->lastProfile) + free (data->lastProfile); + + privDataSize--; + + if (privDataSize) + privData = realloc (privData, privDataSize * sizeof (IniPrivData)); + else + { + free (privData); + privData = NULL; + } + + return TRUE; +} + +static Bool +readInit (CCSContext * context) +{ + char *currentProfile; + IniPrivData *data; + + data = findPrivFromContext (context); + + if (!data) + return FALSE; + + currentProfile = ccsGetProfile (context); + + if (!currentProfile || !strlen (currentProfile)) + currentProfile = strdup (DEFAULTPROF); + else + currentProfile = strdup (currentProfile); + + if (!data->lastProfile || (strcmp (data->lastProfile, currentProfile) != 0)) + setProfile (data, currentProfile); + + if (data->lastProfile) + free (data->lastProfile); + + data->lastProfile = currentProfile; + + return (data->iniFile != NULL); +} + +static void +readSetting (CCSContext *context, + CCSSetting *setting) +{ + Bool status = FALSE; + char *keyName; + IniPrivData *data; + + data = findPrivFromContext (context); + if (!data) + return; + + if (setting->isScreen) + asprintf (&keyName, "s%d_%s", setting->screenNum, setting->name); + else + asprintf (&keyName, "as_%s", setting->name); + + switch (setting->type) + { + case TypeString: + { + char *value; + if (ccsIniGetString (data->iniFile, setting->parent->name, + keyName, &value)) + { + ccsSetString (setting, value); + free (value); + status = TRUE; + } + } + break; + case TypeMatch: + { + char *value; + if (ccsIniGetString (data->iniFile, setting->parent->name, + keyName, &value)) + { + ccsSetMatch (setting, value); + free (value); + status = TRUE; + } + } + break; + case TypeInt: + { + int value; + if (ccsIniGetInt (data->iniFile, setting->parent->name, + keyName, &value)) + { + ccsSetInt (setting, value); + status = TRUE; + } + } + break; + case TypeBool: + { + Bool value; + if (ccsIniGetBool (data->iniFile, setting->parent->name, + keyName, &value)) + { + ccsSetBool (setting, (value != 0)); + status = TRUE; + } + } + break; + case TypeFloat: + { + float value; + if (ccsIniGetFloat (data->iniFile, setting->parent->name, + keyName, &value)) + { + ccsSetFloat (setting, value); + status = TRUE; + } + } + break; + case TypeColor: + { + CCSSettingColorValue color; + + if (ccsIniGetColor (data->iniFile, setting->parent->name, + keyName, &color)) + { + ccsSetColor (setting, color); + status = TRUE; + } + } + break; + case TypeKey: + { + CCSSettingKeyValue key; + if (ccsIniGetKey (data->iniFile, setting->parent->name, + keyName, &key)) + { + ccsSetKey (setting, key); + status = TRUE; + } + } + break; + case TypeButton: + { + CCSSettingButtonValue button; + if (ccsIniGetButton (data->iniFile, setting->parent->name, + keyName, &button)) + { + ccsSetButton (setting, button); + status = TRUE; + } + } + break; + case TypeEdge: + { + unsigned int edges; + if (ccsIniGetEdge (data->iniFile, setting->parent->name, + keyName, &edges)) + { + ccsSetEdge (setting, edges); + status = TRUE; + } + } + break; + case TypeBell: + { + Bool bell; + if (ccsIniGetBell (data->iniFile, setting->parent->name, + keyName, &bell)) + { + ccsSetBell (setting, bell); + status = TRUE; + } + } + break; + case TypeList: + { + CCSSettingValueList value; + if (ccsIniGetList (data->iniFile, setting->parent->name, + keyName, &value, setting)) + { + ccsSetList (setting, value); + ccsSettingValueListFree (value, TRUE); + status = TRUE; + } + } + break; + default: + break; + } + + if (!status) + { + /* reset setting to default if it could not be read */ + ccsResetToDefault (setting); + } + + if (keyName) + free (keyName); +} + +static void +readDone (CCSContext * context) +{ +} + +static Bool +writeInit (CCSContext * context) +{ + char *currentProfile; + IniPrivData *data; + + data = findPrivFromContext (context); + + if (!data) + return FALSE; + + currentProfile = ccsGetProfile (context); + + if (!currentProfile || !strlen (currentProfile)) + currentProfile = strdup (DEFAULTPROF); + else + currentProfile = strdup (currentProfile); + + if (!data->lastProfile || (strcmp (data->lastProfile, currentProfile) != 0)) + setProfile (data, currentProfile); + + if (data->lastProfile) + free (data->lastProfile); + + ccsDisableFileWatch (data->iniWatchId); + + data->lastProfile = currentProfile; + + return (data->iniFile != NULL); +} + +static void +writeSetting (CCSContext *context, + CCSSetting *setting) +{ + char *keyName; + IniPrivData *data; + + data = findPrivFromContext (context); + if (!data) + return; + + if (setting->isScreen) + asprintf (&keyName, "s%d_%s", setting->screenNum, setting->name); + else + asprintf (&keyName, "as_%s", setting->name); + + if (setting->isDefault) + { + ccsIniRemoveEntry (data->iniFile, setting->parent->name, keyName); + free (keyName); + return; + } + + switch (setting->type) + { + case TypeString: + { + char *value; + if (ccsGetString (setting, &value)) + ccsIniSetString (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeMatch: + { + char *value; + if (ccsGetMatch (setting, &value)) + ccsIniSetString (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeInt: + { + int value; + if (ccsGetInt (setting, &value)) + ccsIniSetInt (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeFloat: + { + float value; + if (ccsGetFloat (setting, &value)) + ccsIniSetFloat (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeBool: + { + Bool value; + if (ccsGetBool (setting, &value)) + ccsIniSetBool (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeColor: + { + CCSSettingColorValue value; + if (ccsGetColor (setting, &value)) + ccsIniSetColor (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeKey: + { + CCSSettingKeyValue value; + if (ccsGetKey (setting, &value)) + ccsIniSetKey (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeButton: + { + CCSSettingButtonValue value; + if (ccsGetButton (setting, &value)) + ccsIniSetButton (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeEdge: + { + unsigned int value; + if (ccsGetEdge (setting, &value)) + ccsIniSetEdge (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeBell: + { + Bool value; + if (ccsGetBell (setting, &value)) + ccsIniSetBell (data->iniFile, setting->parent->name, + keyName, value); + } + break; + case TypeList: + { + CCSSettingValueList value; + if (ccsGetList (setting, &value)) + ccsIniSetList (data->iniFile, setting->parent->name, + keyName, value, setting->info.forList.listType); + } + break; + default: + break; + } + + if (keyName) + free (keyName); +} + +static void +writeDone (CCSContext * context) +{ + /* export the data to ensure the changes are on disk */ + char *fileName; + char *currentProfile; + IniPrivData *data; + + data = findPrivFromContext (context); + if (!data) + return; + + currentProfile = ccsGetProfile (context); + + if (!currentProfile || !strlen (currentProfile)) + currentProfile = strdup (DEFAULTPROF); + else + currentProfile = strdup (currentProfile); + + fileName = getIniFileName (currentProfile); + + free (currentProfile); + + ccsIniSave (data->iniFile, fileName); + + ccsEnableFileWatch (data->iniWatchId); + + free (fileName); +} + +static Bool +getSettingIsReadOnly (CCSSetting * setting) +{ + /* FIXME */ + return FALSE; +} + +static int +profileNameFilter (const struct dirent *name) +{ + int length = strlen (name->d_name); + + if (strncmp (name->d_name + length - 4, ".ini", 4)) + return 0; + + return 1; +} + +static CCSStringList +scanConfigDir (char * filePath) +{ + CCSStringList ret = NULL; + struct dirent **nameList; + char *pos; + int nFile, i; + + nFile = scandir (filePath, &nameList, profileNameFilter, NULL); + if (nFile <= 0) + return NULL; + + for (i = 0; i < nFile; i++) + { + pos = strrchr (nameList[i]->d_name, '.'); + if (pos) + { + *pos = 0; + + if (strcmp (nameList[i]->d_name, DEFAULTPROF) != 0) + ret = ccsStringListAppend (ret, strdup (nameList[i]->d_name)); + } + + free (nameList[i]); + } + + free (nameList); + + return ret; +} + +static CCSStringList +getExistingProfiles (CCSContext * context) +{ + CCSStringList ret = NULL; + char *filePath = NULL; + char *homeDir = NULL; + char *configDir = NULL; + + configDir = getenv ("XDG_CONFIG_HOME"); + if (configDir && strlen (configDir)) + { + asprintf (&filePath, "%s/%s", configDir, SETTINGPATH); + + ret = scanConfigDir(filePath); + free(filePath); + + if (ret) + return ret; + } + + homeDir = getenv ("HOME"); + if (!homeDir) + return NULL; + + asprintf (&filePath, "%s/.config/%s", homeDir, SETTINGPATH); + if (!filePath) + return NULL; + + ret = scanConfigDir(filePath); + free(filePath); + + return ret; +} + +static Bool +deleteProfile (CCSContext * context, char * profile) +{ + char *fileName; + + fileName = getIniFileName (profile); + + if (!fileName) + return FALSE; + + remove (fileName); + free (fileName); + + return TRUE; +} + + +static CCSBackendVTable iniVTable = { + "ini", + "Flat-file Configuration Backend", + "Flat file Configuration Backend for libccs", + FALSE, + TRUE, + NULL, + initBackend, + finiBackend, + readInit, + readSetting, + readDone, + writeInit, + writeSetting, + writeDone, + NULL, + getSettingIsReadOnly, + getExistingProfiles, + deleteProfile +}; + +CCSBackendVTable * +getBackendInfo (void) +{ + return &iniVTable; +} + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/config/Makefile.am b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/config/Makefile.am new file mode 100644 index 00000000..e89f2d50 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/config/Makefile.am @@ -0,0 +1,6 @@ +globalconfigdir = $(sysconfdir)/compizconfig +globalconfig_DATA = \ + config + +EXTRA_DIST = \ + config
\ No newline at end of file diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/config/config b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/config/config new file mode 100644 index 00000000..f9027bfb --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/config/config @@ -0,0 +1,21 @@ +[kde4_session] +backend = kconfig4 +integration = true +plugin_list_autosort = true + +[kde_session] +backend = kconfig +integration = true +plugin_list_autosort = true + +[gnome_session] +backend = gconf +integration = true +plugin_list_autosort = true + +[general] +backend = ini +plugin_list_autosort = true + + + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/configure.ac b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/configure.ac new file mode 100644 index 00000000..4dde0849 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/configure.ac @@ -0,0 +1,156 @@ +AC_PREREQ(2.57) + +AC_INIT([libcompizconfig],esyscmd(. ./VERSION;echo -n $VERSION), [dev@opencompositing.org]) + +#AC_CONFIG_AUX_DIR(config) + +AM_INIT_AUTOMAKE([1.9 dist-bzip2]) + +AC_PROG_CXX + +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=libcompizconfig +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 + +PKG_CHECK_MODULES(LIBX11, "x11") +PKG_CHECK_MODULES(COMPIZ, "compiz") + +if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) +fi +if test "$PKG_CONFIG" != "no" ; then + PLUGINDIR=`$PKG_CONFIG --variable=libdir compiz`/compiz + AC_SUBST(PLUGINDIR) + METADATADIR=`$PKG_CONFIG --variable=prefix compiz`/share/compiz + AC_SUBST(METADATADIR) +fi + +plugindir=$libdir/compiz +AC_SUBST(plugindir) + +PKG_CHECK_MODULES(LIBXML2, "libxml-2.0") +AC_SUBST(LIBXML2_REQUIRES) + +AC_ARG_ENABLE(protobuf, + [ --disable-protobuf Disable Protocol Buffers], + [use_protobuf=$enableval], [use_protobuf=yes]) + +if test "x$use_protobuf" = "xyes"; then + protobuf_error_msg="\nWARNING: You need to install Protocol Buffers to get faster program startup.\n Sources are available at http://code.google.com/p/protobuf/downloads/list\n Package names for Ubuntu/Debian: libprotobuf0, libprotobuf-dev, protobuf-compiler\n Package names for other distributions: protobuf, protobuf-devel\n Disabling protobuf.\n" + AC_CHECK_PROG(have_protoc, protoc, yes, no) + if test "x$have_protoc" = "xno"; then + echo -e $protobuf_error_msg; use_protobuf=no + else + AC_CHECK_LIB(protobuf, _ZN6google8protobuf7MessageD2Ev, [], [ + echo -e $protobuf_error_msg; use_protobuf=no ], -lpthread) + if test "x$use_protobuf" = "xyes"; then + AC_LANG([C++]) + AC_CHECK_HEADER([google/protobuf/message.h],,[ + echo -e $protobuf_error_msg; use_protobuf=no ]) + AC_LANG([C]) + fi + fi +fi +AM_CONDITIONAL([USE_PROTOBUF], [test "x$use_protobuf" = "xyes"]) + +AC_CHECK_HEADERS([sys/inotify.h], [have_inotify=yes], [have_inotify=no]) + +AC_ARG_ENABLE(debug, + [ --enable-debug[=none,normal,full] Enable output of debug messages], + [enable_debug=$enableval], [enable_debug=none]) + +if test "x$enable_debug" = "xnone"; then + AC_DEFINE(DEBUGLEVEL, 0, [Debug level]) +elif test "x$enable_debug" = "xfull"; then + AC_DEFINE(DEBUGLEVEL, 2, [Debug level]) +else + AC_DEFINE(DEBUGLEVEL, 1, [Debug level]) +fi + +AC_CONFIG_FILES([ +libcompizconfig.pc +Makefile +src/Makefile +backend/Makefile +plugin/Makefile +include/Makefile +metadata/Makefile +po/Makefile.in +config/Makefile +]) + +AC_OUTPUT + +if test "x$have_inotify" = xno; then + echo "" + echo "NOTE: " + echo "======" + echo "" + echo "Inotify header files not found. While this library might work" \ + "without them, user experience is degraded as settings won't be" \ + "applied instantly. We strongly suggest installing the inotify" \ + "header files." +fi diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/changelog b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/changelog new file mode 100644 index 00000000..9b2bdc93 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/changelog @@ -0,0 +1,323 @@ +libcompizconfig-trinity (0.8.4-3debian11.0.0+5~a) bullseye; urgency=low + + * Change debhelper compatibility level to 9 + + -- Slávek Banko <slavek.banko@axis.cz> Wed, 08 Apr 2020 01:26:40 +0200 + +libcompizconfig-trinity (0.8.4-3ubuntu20.04.0+4~a) focal; urgency=low + + * Change debhelper compatibility level to 7 + + -- Slávek Banko <slavek.banko@axis.cz> Sat, 13 Aug 2016 18:53:28 +0200 + +libcompizconfig-trinity (0.8.4-3ubuntu16.10.0+3~a) yakkety; urgency=low + + * Fix FTBFS on libxslt include + + -- Slávek Banko <slavek.banko@axis.cz> Sun, 07 Jun 2015 12:02:32 +0200 + +libcompizconfig-trinity (0.8.4-3ubuntu15.10.0+2~a) wily; urgency=low + + * Trinity changes pulled into a separate patch + + -- Slávek Banko <slavek.banko@axis.cz> Wed, 13 Mar 2013 23:10:03 +0100 + +libcompizconfig-trinity (0.8.4-1ubuntu4) maverick; urgency=low + + * Karmic rebuild + + -- Timothy Pearson <kb9vqf@pearsoncomputing.net> Thu, 02 July 2009 16:08:00 -0600 + +libcompizconfig-trinity (0.7.4-0ubuntu9) intrepid; urgency=low + + * Moved KDE3 to /opt/trinity + * Integrated properly with KDE4.2+ + + -- Timothy Pearson <kb9vqf@pearsoncomputing.net> Fri, 06 March 2009 01:35:00 -0600 + +libcompizconfig-trinity (0.7.4-0ubuntu6) intrepid; urgency=low + + * Added link for libcompizconfig.so.0 to /usr/lib + + -- Timothy Pearson <kb9vqf@pearsoncomputing.net> Mon, 03 Dec 2008 12:51:00 -0600 + +libcompizconfig-trinity (0.7.4-0ubuntu5) intrepid; urgency=low + + * Added -trinity prefix + + -- Timothy Pearson <kb9vqf@pearsoncomputing.net> Mon, 01 Dec 2008 09:34:00 -0600 + +libcompizconfig (0.7.4-0ubuntu1) hardy; urgency=low + + * new upstream release: + + Minor bug fixes + + -- Michael Vogt <michael.vogt@ubuntu.com> Sat, 05 Apr 2008 12:50:02 +0200 + +libcompizconfig (0.7.2+git20080403-0ubuntu1) hardy; urgency=low + + * new git snapshot + * updated build-depends + * debian/libcompizconfig0.install: + - install missing ccp.xml metadata + + -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 03 Apr 2008 14:29:56 +0200 + +libcompizconfig (0.7.2-0ubuntu1) hardy; urgency=low + + * new upstream release + * bump Standards-Version to 3.7.3 + * use ${binary:Version} + * set section 'libdevel' for libcompizconfig0-dev + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 07 Mar 2008 14:27:27 +0100 + +libcompizconfig (0.6.99+git20080223-0ubuntu1) hardy; urgency=low + + * new git snapshot with fixes for floats and conflicts handling + * add session to the default plugins + * rebuild against latest compiz abi + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 29 Feb 2008 20:19:02 +0100 + +libcompizconfig (0.6.99+git20080215-0ubuntu1) hardy; urgency=low + + * new git snapshot with important fixes for the profile support + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 15 Feb 2008 17:14:08 +0100 + +libcompizconfig (0.6.99+git20080214-0ubuntu1) hardy; urgency=low + + [ Mirco Müller ] + * added normal.profile and extra.profile in order to implement part of the + spec https://wiki.ubuntu.com/DesktopTeam/Specs/HardyDesktopEffectsProfiles + these will be placed in /usr/share/compizconfig and work in combination + with the the new version of gnome-control-center, furthermore this + obsoletes the 01_default_options.patch + + [ Michael Vogt ] + * new git snapshot with fixes for the autosave feature + + -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 14 Feb 2008 16:59:33 +0100 + +libcompizconfig (0.6.99+git20080213-0ubuntu1) hardy; urgency=low + + * new git snapshot that fixes a bug in the profile code + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 13 Feb 2008 14:43:44 +0100 + +libcompizconfig (0.6.99+git20080123-0ubuntu1) hardy; urgency=low + + * new git snapshot + * debian/patches/01_default_options.patch: + - add scaleaddon and scalefilter + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 23 Jan 2008 14:21:39 +0000 + +libcompizconfig (0.6.99+git20071127-0ubuntu1) hardy; urgency=low + + * new git HEAD snapshot + * debian/patches/01_default_options.patch: + - updated to latest global.xml + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 05 Dec 2007 22:10:15 +0100 + +libcompizconfig (0.5.2+git20070919-0ubuntu3) gutsy; urgency=low + + [Travis Watkins] + * debian/patches/01_default_options.patch: + - Disable vsync (LP: #144732) + - Use smart placement instead of cascade (LP: #124026) + - Disable zoom on alt-tab (LP: #146220) + - Move fade down in plugin list to stop fighting + with animation (LP: #147141) + + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 01 Oct 2007 03:15:07 -0500 + +libcompizconfig (0.5.2+git20070919-0ubuntu2) gutsy; urgency=low + + * debian/patches/01_default_options.patch: + - fix shadow_radius value (LP: #141361) + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 21 Sep 2007 21:08:37 +0200 + +libcompizconfig (0.5.2+git20070919-0ubuntu1) gutsy; urgency=low + + * new 0.6 snapshot: + - Prevent binding key combinations with invalid key names + * debian/patches/01_default_options.patch: + - do not set a default for the terminal command, this is + taken from gnome (LP: #135484) + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 19 Sep 2007 12:25:53 +0100 + +libcompizconfig (0.5.2+git20070912-0ubuntu2) gutsy; urgency=low + + * rebuild against latest compiz (ABI change) + * rename debian/patches/01_default_options.patch: + - renamed from 01_default_plugins + + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 17 Sep 2007 14:17:25 +0100 + +libcompizconfig (0.5.2+git20070912-0ubuntu1) gutsy; urgency=low + + * new 0.6 snapshot + * fix memory leak + * allow empty lists in configuration + * debian/patches/01_default_plugins: + - set default resize mode to rectangle + - set switcher opaquity to 95% + - enable edge resistance for window borders + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 12 Sep 2007 18:26:51 +0200 + +libcompizconfig (0.5.2+git20070829-0ubuntu1) gutsy; urgency=low + + * debian/patches/01_default_plugins.patch: + - replace gotovp with vpswitch + * rebuild against compiz-dev + * updated to the latest 0.6.0 git branch + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 28 Aug 2007 16:09:48 +0200 + +libcompizconfig (0.5.2-0ubuntu1) gutsy; urgency=low + + * updated for 0.5.2 release + * debian/patches/01_default_plugins.patch: + - added "extrawm" and "gotovp" to default plugin list + + -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 13 Aug 2007 18:44:00 +0200 + +libcompizconfig (0.0+git20070810-0ubuntu1) gutsy; urgency=low + + * new git snapshot + * debian/patches/02_fix_crash_at_exit.patch: + - dropped, part of upstream now + * debian/patches/01_default_plugins.patch: + - updated for new active_plugins list + - added ezoom to default plugins + * debian/libcompizconfig0-dev.install: + - updated to include the missing ccs-backend.h + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 10 Aug 2007 15:11:05 +0200 + +libcompizconfig (0.0+git20070725-0ubuntu2) gutsy; urgency=low + + * debian/patches/02_fix_crash_at_exit.patch: + - Fix compiz crash caused by ccp when compiz exits (LP: #122941) + + -- Travis Watkins <amaranth@ubuntu.com> Wed, 08 Aug 2007 10:02:05 -0500 + +libcompizconfig (0.0+git20070725-0ubuntu1) gutsy; urgency=low + + * new git snapshot + * tighten build-depends + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 25 Jul 2007 12:34:43 +0200 + +libcompizconfig (0.0+git20070711-0ubuntu3) gutsy; urgency=low + + * add missing epoch to build-depends + + -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 12 Jul 2007 14:13:28 +0100 + +libcompizconfig (0.0+git20070711-0ubuntu2) gutsy; urgency=low + + [Sebastien Bacher] + * debian/patches/01_default_plugins.patch: + - change the shadow_radius workaround again + + [Michael Vogt] + * bump build-depends to latest compiz + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 11 Jul 2007 18:25:21 +0100 + +libcompizconfig (0.0+git20070711-0ubuntu1) gutsy; urgency=low + + * New git snapshot + * debian/patches/01_default_plugins.patch: + - change shadow_radius value to workaround white border using dri + + -- Sebastien Bacher <seb128@canonical.com> Tue, 10 Jul 2007 23:49:15 +0100 + +libcompizconfig (0.0+git20070626-0ubuntu3) gutsy; urgency=low + + * debian/patches/01_default_plugins.patch: + - change default settings there rather than in compiz + + -- Sebastien Bacher <seb128@canonical.com> Tue, 10 Jul 2007 10:18:19 +0100 + +libcompizconfig (0.0+git20070626-0ubuntu2) gutsy; urgency=low + + * disable scale initiation on top-left click (thanks to + Sebastien Bacher) + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 27 Jun 2007 11:32:32 +0200 + +libcompizconfig (0.0+git20070626-0ubuntu1) gutsy; urgency=low + + * new git snapshot + * debian/patches/03_add_missing_include.patch: + - dropped, taken upstream + * debian/patches/03_add_missing_include.patch: + - enable resizeinfo plugin by default + - do not bind top-left edge to expo plugin + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 26 Jun 2007 13:22:29 +0200 + +libcompizconfig (0.0+git20070615-0ubuntu2) gutsy; urgency=low + + * debian/patches/01_default_plugins.patch: + - setup plugin list as described in CompositeByDefault spec + + -- Michael Vogt <michael.vogt@ubuntu.com> Thu, 21 Jun 2007 10:55:33 +0200 + +libcompizconfig (0.0+git20070615-0ubuntu1) gutsy; urgency=low + + * new git snapshot that will detect the runing session itself + + -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 15 Jun 2007 09:30:01 +0200 + +libcompizconfig (0.0+git20070614-0ubuntu1) gutsy; urgency=low + + * new git snapshot + * install global /etc/compizconfig/default config with the + backend to use + * libcompizconfig0-dev depends on compiz-dev + * debian/patches/03_add_missing_include.patch: + - add missing include to make it compile with -O0 -g + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 13 Jun 2007 21:37:46 +0200 + +libcompizconfig (0.0+git20070613-0ubuntu1) gutsy; urgency=low + + * update debian/copyright mail adresses + (thanks to Dennis Kasprzyk) + * new git snapshot: + - support for a global config file + - suport for glib module + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 13 Jun 2007 17:40:50 +0200 + +libcompizconfig (0.0+git20070612-0ubuntu3) gutsy; urgency=low + + * update debian/copyright (thanks to seb128) + * added XS-Vcs-Bzr header + + -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 13 Jun 2007 10:56:55 +0200 + +libcompizconfig (0.0+git20070612-0ubuntu2) gutsy; urgency=low + + * remove debian/docs, debian/dirs + * added depends on libcompizconfig0 for libcompizconfig0-dev + * fix debian/copyright + (thanks to seb128 for the review) + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 12 Jun 2007 17:01:22 +0200 + +libcompizconfig (0.0+git20070612-0ubuntu1) gutsy; urgency=low + + * Initial snapshot + + -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 12 Jun 2007 11:53:11 +0200 + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/compat b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/compizconfig/config b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/compizconfig/config new file mode 100644 index 00000000..5f5427e6 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/compizconfig/config @@ -0,0 +1,11 @@ +[general] +integration = true +backend = ini + +[gnome_session] +integration = true +backend = gconf + +[kde_session] +integration = true +backend = kconfig diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/control b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/control new file mode 100644 index 00000000..bff28896 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/control @@ -0,0 +1,29 @@ +Source: libcompizconfig-trinity +Section: deps-r14/libs +Priority: extra +Maintainer: Timothy Pearson <kb9vqf@pearsoncomputing.net> +Build-Depends: cdbs, debhelper (>= 9~), quilt, compiz-trinity-dev, pkg-config, intltool, libtool, libglib2.0-dev, libxml2-dev, libxslt1-dev +Standards-Version: 3.7.3 + +Package: libcompizconfig0-trinity +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, compiz-core-trinity +Description: Settings library for plugins - OpenCompositing Project [Trinity] + The OpenCompositing Project brings 3D desktop visual effects that improve + usability of the X Window System and provide increased productivity + through plugins and themes contributed by the community giving a + rich desktop experience to KDE3. + . + This package contains the library for plugins to configure settings. + +Package: libcompizconfig0-trinity-dev +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libcompizconfig0-trinity (= ${binary:Version}), compiz-trinity-dev +Description: Development file for plugin settings - OpenCompositing Project [Trinity] + The OpenCompositing Project brings 3D desktop visual effects that improve + usability of the X Window System and provide increased productivity + through plugins and themes contributed by the community giving a + rich desktop experience to KDE3. + . + This package contains the headers and development files needed to + build plugins with settings support. diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/copyright b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/copyright new file mode 100644 index 00000000..0a6c2e34 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/copyright @@ -0,0 +1,36 @@ +This package was debianized by Michael Vogt <michael.vogt@ubuntu.com> on +Sat, 9 Jun 2007 02:20:13 +0200. + +It was downloaded from git://anongit.opencompositing.org/compcomm/compiz-configuration-system/libraries/ccs-lib + +Upstream Authors: +Danny Baumann <maniac@beryl-project.org> +Dennis Kasprzyk <onestone@beryl-project.org> +Nicolas Devillard (ndevilla AT free DOT fr) +David Reveman <davidr@novell.com> + +This software is copyright: + +(C) 2007 Dennis Kasprzyk <onestone@opencompositing.org> +(c) 2007 Danny Baumann <maniac@opencompositing.org> +(c) 2000 Nicolas Devillard (ndevilla AT free DOT fr). +(c) 2005 Novell, Inc. + +License: + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + +For the full license text, see /usr/share/common-licenses/LGPL + +The Debian packaging is (C) 2007, Michael Vogt <michael.vogt@ubuntu.com> and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + + + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/extra.profile b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/extra.profile new file mode 100644 index 00000000..0442642d --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/extra.profile @@ -0,0 +1,909 @@ +[shelf] +as_trigger_key = <Super>l +as_dec_button = <Alt><Super>Button4 +as_inc_button = <Alt><Super>Button5 +as_animtime = 150 + +[expo] +as_expo_key = <Super>e +as_expo_button = Disabled +as_expo_edge = +as_double_click_time = 500 +as_dnd_button = Button1 +as_exit_button = Button3 +as_next_vp_button = Button5 +as_prev_vp_button = Button4 +as_rotate = true +as_expo_immediate_move = false +as_expo_animation = 0 +as_reflection = true +as_ground_color1 = #b3b3b3cc +as_ground_color2 = #b3b3b300 +as_mipmaps = false +as_multioutput_mode = 0 +as_hide_docks = true + +[winrules] +s0_skiptaskbar_match = +s0_skippager_match = +s0_above_match = +s0_below_match = +s0_sticky_match = +s0_fullscreen_match = +s0_no_argb_match = +s0_no_move_match = +s0_no_resize_match = +s0_no_minimize_match = +s0_no_maximize_match = +s0_no_close_match = +s0_no_focus_match = +s0_size_matches = +s0_size_width_values = +s0_size_height_values = + +[annotate] +as_initiate_button = <Alt><Super>Button1 +as_draw_button = Disabled +as_erase = <Alt><Super>Button3 +as_clear_key = <Alt><Super>k +as_clear_button = Disabled +as_fill_color = #ff0000ff +as_stroke_color = #00ff00ff + +[zoom] +as_initiate_button = <Super>Button3 +as_zoom_in_button = <Super>Button4 +as_zoom_out_button = <Super>Button5 +as_zoom_pan_button = <Super>Button2 +s0_filter_linear = false + +[vpswitch] +as_begin_key = Disabled +as_switch_to_1_key = Disabled +as_switch_to_2_key = Disabled +as_switch_to_3_key = Disabled +as_switch_to_4_key = Disabled +as_switch_to_5_key = Disabled +as_switch_to_6_key = Disabled +as_switch_to_7_key = Disabled +as_switch_to_8_key = Disabled +as_switch_to_9_key = Disabled +as_switch_to_10_key = Disabled +as_switch_to_11_key = Disabled +as_switch_to_12_key = Disabled +as_left_button = Disabled +as_right_button = Disabled +as_up_button = Disabled +as_down_button = Disabled +as_next_button = Button5 +as_prev_button = Button4 +as_initiate_button = Button2 +as_init_plugin = rotate +as_init_action = initiate_button + +[bench] +as_initiate_key = <Super>F12 +as_disable_limiter = true +as_output_screen = true +as_position_x = 0 +as_position_y = 0 +as_output_console = false +as_console_update_time = 5 + +[splash] +as_initiate_key = <Control>F11 +as_firststart = true +as_background = splash_background.png +as_logo = splash_logo.png + +[ring] +as_next_key = <Super>Tab +as_next_button = Disabled +as_prev_key = <Shift><Super>Tab +as_prev_button = Disabled +as_next_all_key = <Alt><Super>Tab +as_next_all_button = Disabled +as_prev_all_key = <Shift><Alt><Super>Tab +as_prev_all_button = Disabled +as_next_group_key = Disabled +as_next_group_button = Disabled +as_prev_group_key = Disabled +as_prev_group_button = Disabled +s0_inactive_opacity = 100 +s0_window_match = Normal | Dialog | ModalDialog | Utility | Unknown +s0_overlay_icon = 1 +s0_darken_back = true +s0_minimized = true +s0_select_with_mouse = false +s0_ring_clockwise = false +s0_ring_width = 70 +s0_ring_height = 60 +s0_thumb_width = 350 +s0_thumb_height = 250 +s0_window_title = true +s0_title_font_bold = false +s0_title_font_size = 16 +s0_title_back_color = #00000099 +s0_title_font_color = #ffffffff +s0_title_text_placement = 0 + +[water] +as_initiate_key = <Control><Super> +as_toggle_rain_key = <Shift>F9 +as_toggle_wiper_key = <Shift>F8 +as_rain_delay = 250 +as_title_wave = false + +[workarounds] +as_legacy_fullscreen = true +as_firefox_menu_fix = true +as_ooo_menu_fix = true +as_notification_daemon_fix = true +as_java_fix = true +as_qt_fix = true +as_aiglx_fragment_fix = true +as_fglrx_xgl_fix = false +as_sticky_alldesktops = false +as_alldesktop_sticky_match = any + +[group] +as_select_button = Disabled +as_select_single_key = <Super>s +as_group_key = <Super>g +as_ungroup_key = <Super>u +as_remove_key = <Super>r +as_close_key = <Super>c +as_ignore_key = <Super>x +as_tabmode_key = <Super>t +as_change_tab_left_key = <Super>Left +as_change_tab_right_key = <Super>Right +as_change_color_key = Disabled +s0_move_all = true +s0_resize_all = false +s0_raise_all = true +s0_maximize_unmaximize_all = false +s0_minimize_all = true +s0_shade_all = false +s0_auto_group = false +s0_auto_ungroup = true +s0_window_match = Toolbar | Utility | Dialog | Normal | Unknown +s0_select_opacity = 80 +s0_select_saturation = 20 +s0_select_brightness = 70 +s0_select_precision = 25 +s0_fill_color = #00000055 +s0_line_color = #000000ab +s0_mipmaps = false +s0_untab_on_close = false +s0_autotab_create = false +s0_bar_animations = true +s0_thumb_size = 96 +s0_thumb_space = 5 +s0_border_radius = 10 +s0_border_width = 1 +s0_tab_base_color = #00000099 +s0_tab_border_color = #000000ab +s0_tab_highlight_color = #ffffff99 +s0_tab_style = 0 +s0_tabbar_font_size = 12 +s0_tabbar_font_color = #ffffffff +s0_dnd_ungroup_window = true +s0_drag_y_distance = 400 +s0_drag_speed_limit = 800 +s0_glow = true +s0_glow_size = 64 +s0_glow_type = 0 + +[colorfilter] +as_toggle_window_key = <Super>f +as_toggle_screen_key = <Super>d +as_switch_filter_key = <Control><Super>s +s0_filters = negative;negative-green;blueish-filter;sepia;grayscale +s0_filter_decorations = false +s0_filter_match = any +s0_exclude_match = type=Desktop + +[cube] +as_unfold_key = <Control><Alt>Down +as_next_slide_key = space +as_prev_slide_key = Disabled +s0_color = #ffffffff +s0_in = false +s0_scale_image = false +s0_images = /usr/share/compiz/freedesktop.png +s0_skydome = false +s0_skydome_image = +s0_skydome_animated = false +s0_skydome_gradient_start_color = #0db1fdff +s0_skydome_gradient_end_color = #feffc7ff +s0_mipmap = true +s0_backgrounds = +s0_adjust_image = false +s0_transparent_manual_only = true +s0_multioutput_mode = 0 + +[minimize] +s0_window_match = toolbar | utility | dialog | normal +s0_shade_resistance = 75 + +[wobbly] +as_snap_key = <Shift> +as_snap_inverted = false +as_shiver = false +s0_grid_resolution = 32 +s0_min_grid_size = 64 +s0_map_effect = 0 +s0_focus_effect = 0 +s0_map_window_match = Splash | DropdownMenu | PopupMenu | Tooltip | Notification | Combo | Dnd | Unknown +s0_focus_window_match = +s0_grab_window_match = +s0_move_window_match = Toolbar | Menu | Utility | Dialog | Normal | Unknown +s0_maximize_effect = true + +[crashhandler] +as_enabled = true +as_directory = /tmp +as_start_wm = false +as_wm_cmd = + +[shift] +as_initiate_key = <Shift><Super>s +as_initiate_button = Disabled +as_initiate_edge = +as_initiate_all_key = Disabled +as_initiate_all_button = Disabled +as_initiate_all_edge = +as_terminate_button = Button3 +as_next_key = <Alt>Tab +as_next_button = Disabled +as_prev_key = <Shift><Alt>Tab +as_prev_button = Disabled +as_next_all_key = <Alt><Super>Tab +as_next_all_button = Disabled +as_prev_all_key = <Shift><Alt><Super>Tab +as_prev_all_button = Disabled +as_next_group_key = Disabled +as_next_group_button = Disabled +as_prev_group_key = Disabled +as_prev_group_button = Disabled +s0_window_match = Normal | Dialog | ModalDialog | Utility | Unknown +s0_minimized = true +s0_click_duration = 500 +s0_mode = 0 +s0_size = 40 +s0_hide_all = false +s0_reflection = true +s0_ground_color1 = #b3b3b3cc +s0_ground_color2 = #b3b3b300 +s0_flip_rotation = 30 +s0_overlay_icon = 1 +s0_mipmaps = true +s0_multioutput_mode = 0 +s0_window_title = true +s0_title_font_bold = false +s0_title_font_size = 16 +s0_title_back_color = #00000099 +s0_title_font_color = #ffffffff +s0_title_text_placement = 2 + +[clone] +as_initiate_button = <Shift><Super>Button1 + +[blur] +as_pulse = false +s0_focus_blur_match = toolbar | menu | utility | normal | dialog | modaldialog +s0_focus_blur = false +s0_alpha_blur_match = class=Gnome-termina | class=Xfce4-terminal +s0_alpha_blur = true +s0_filter = 0 +s0_gaussian_radius = 3 +s0_saturation = 100 +s0_occlusion = true + +[reflex] +s0_file = reflection.png +s0_match = any +s0_window = false +s0_decoration = true +s0_threshold = 1 +s0_moving = true + +[cubecaps] +as_top_next_key = space +as_top_next_button = Disabled +as_top_prev_key = Disabled +as_top_prev_button = Disabled +as_bottom_next_key = Disabled +as_bottom_next_button = Disabled +as_bottom_prev_key = Disabled +as_bottom_prev_button = Disabled +s0_draw_top = true +s0_draw_bottom = true +s0_adjust_top = false +s0_adjust_bottom = false +s0_scale_top_image = false +s0_scale_bottom_image = false +s0_clamp_top_to_border = true +s0_clamp_bottom_to_border = true +s0_top_color = #ffffffff +s0_bottom_color = #ffffffff +s0_top_images = fusioncap.png +s0_bottom_images = compizcap.png + +[scale] +as_initiate_edge = +as_initiate_key = <Shift><Alt>Up +as_initiate_button = Disabled +as_initiate_all_edge = +as_initiate_all_button = Disabled +as_initiate_all_key = Disabled +as_initiate_group_edge = +as_initiate_group_button = Disabled +as_initiate_group_key = Disabled +as_initiate_output_edge = +as_initiate_output_button = Disabled +as_initiate_output_key = Disabled +as_show_desktop = true +s0_spacing = 10 +s0_window_match = Toolbar | Utility | Dialog | Normal | Unknown +s0_darken_back = true +s0_opacity = 75 +s0_overlay_icon = 1 +s0_hover_time = 750 +s0_multioutput_mode = 0 + +[showdesktop] +s0_direction = 6 +s0_window_match = type=toolbar | type=utility | type=dialog | type=normal +s0_window_part_size = 20 + +[wall] +as_show_switcher = true +as_miniscreen = false +as_edge_radius = 5 +as_outline_color = #333333d9 +as_background_gradient_base_color = #cccce6d9 +as_background_gradient_highlight_color = #f3f3ffd9 +as_background_gradient_shadow_color = #f3f3ffd9 +as_thumb_gradient_base_color = #33333359 +as_thumb_gradient_highlight_color = #3f3f3f3f +as_thumb_highlight_gradient_base_color = #fffffff3 +as_thumb_highlight_gradient_shadow_color = #dfdfdfa6 +as_arrow_base_color = #e6e6e6d9 +as_arrow_shadow_color = #dcdcdcd9 +as_allow_wraparound = false +as_left_key = <Control><Alt>Left +as_left_button = Disabled +as_right_key = <Control><Alt>Right +as_right_button = Disabled +as_up_key = <Control><Alt>Up +as_up_button = Disabled +as_down_key = <Control><Alt>Down +as_down_button = Disabled +as_next_key = <Control><Alt>Next +as_next_button = Disabled +as_prev_key = <Control><Alt>Prior +as_prev_button = Disabled +as_left_window_key = <Shift><Control><Alt>Left +as_right_window_key = <Shift><Control><Alt>Right +as_up_window_key = <Shift><Control><Alt>Up +as_down_window_key = <Shift><Control><Alt>Down +as_flip_left_edge = Left +as_flip_right_edge = Right +as_flip_up_edge = Top +as_flip_down_edge = Bottom +s0_mmmode = 0 +s0_edgeflip_pointer = false +s0_edgeflip_move = true +s0_edgeflip_dnd = false + +[widget] +as_toggle_key = F9 +as_toggle_button = Disabled +as_toggle_edge = +s0_match = +s0_end_on_click = true +s0_bg_brightness = 50 +s0_bg_saturation = 100 + +[resizeinfo] +as_fade_time = 500 +as_always_show = false +as_text_color = #000000ff +as_gradient_1 = #cccce6cc +as_gradient_2 = #f3f3f3cc +as_gradient_3 = #d9d9d9cc + +[firepaint] +as_initiate_key = Disabled +as_initiate_button = <Shift><Super>Button1 +as_clear_key = <Shift><Super>c +as_clear_button = Disabled +s0_num_particles = 3000 +s0_fire_color = #ff3305ff +s0_fire_mystical = false +s0_bg_brightness = 50 + +[neg] +as_window_toggle_key = <Super>n +as_screen_toggle_key = <Super>m +s0_neg_match = any +s0_exclude_match = type=Desktop + +[video] +as_yv12 = true + +[fs] +as_mount_point = compiz + +[cubereflex] +s0_ground_color1 = #b3b3b3cc +s0_ground_color2 = #b3b3b300 +s0_auto_zoom = true +s0_zoom_manual_only = true +s0_mode = 0 + +[decoration] +as_shadow_color = #00000000 +as_shadow_x_offset = 1 +as_shadow_y_offset = 1 +as_command = +as_mipmap = false +as_decoration_match = any +as_shadow_match = any + +[plane] +as_plane_left_key = <Control><Alt>Left +as_plane_right_key = <Control><Alt>Right +as_plane_down_key = <Control><Alt>Down +as_plane_up_key = <Control><Alt>Up +as_plane_to_1_key = Disabled +as_plane_to_2_key = Disabled +as_plane_to_3_key = Disabled +as_plane_to_4_key = Disabled +as_plane_to_5_key = Disabled +as_plane_to_6_key = Disabled +as_plane_to_7_key = Disabled +as_plane_to_8_key = Disabled +as_plane_to_9_key = Disabled +as_plane_to_10_key = Disabled +as_plane_to_11_key = Disabled +as_plane_to_12_key = Disabled + +[animation] +s0_close_effects = 11;9;9 +s0_close_durations = 200;150;150 +s0_close_matches = ((type=Normal | Utility | Unknown) | name=sun-awt-X11-XFramePeer | name=sun-awt-X11-XDialogPeer) & !(role=toolTipTip | role=qtooltip_label) & !(type=Normal & override_redirect=1) & !(name=gnome-screensaver);(type=Menu | PopupMenu | DropdownMenu | Dialog | ModalDialog | Normal);(type=Tooltip | Notification) +s0_close_options = ;; +s0_close_random_effects = 0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19 +s0_open_effects = 12;9;9 +s0_open_durations = 200;150;150 +s0_open_matches = ((type=Normal | Utility | Unknown) | name=sun-awt-X11-XFramePeer | name=sun-awt-X11-XDialogPeer) & !(role=toolTipTip | role=qtooltip_label) & !(type=Normal & override_redirect=1) & !(name=gnome-screensaver);(type=Menu | PopupMenu | DropdownMenu | Dialog | ModalDialog | Normal);(type=Tooltip | Notification) +s0_open_options = ;; +s0_open_random_effects = 0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19 +s0_minimize_effects = 20 +s0_minimize_durations = 300 +s0_minimize_matches = (type=Normal | Dialog | ModalDialog | Utility | Unknown) +s0_minimize_options = +s0_minimize_random_effects = 0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17 +s0_shade_effects = 4 +s0_shade_durations = 200 +s0_shade_matches = (type=Normal | Dialog | ModalDialog | Utility | Unknown) +s0_shade_options = +s0_shade_random_effects = 0;1;2 +s0_focus_effects = 2 +s0_focus_durations = 200 +s0_focus_matches = (type=Normal | Dialog | ModalDialog | Utility | Unknown) +s0_focus_options = +s0_airplane_fly_to_taskbar = true +s0_fire_particles = 1000 +s0_fire_color = #ff3305ff +s0_fire_direction = 0 +s0_fire_constant_speed = false +s0_fire_smoke = false +s0_fire_mystical = false +s0_beam_spacing = 5 +s0_beam_color = #7f7f7fff +s0_glide1_zoom_to_taskbar = false +s0_glide2_zoom_to_taskbar = true +s0_zoom_from_center = 0 +s0_rollup_fixed_interior = false +s0_sidekick_zoom_from_center = 0 +s0_dream_zoom_to_taskbar = true +s0_magic_lamp_moving_end = true +s0_magic_lamp_grid_res = 100 +s0_magic_lamp_max_waves = 3 +s0_magic_lamp_open_start_width = 30 +s0_vacuum_moving_end = true +s0_vacuum_grid_res = 100 +s0_vacuum_open_start_width = 30 +s0_curved_fold_zoom_to_taskbar = true +s0_horizontal_folds_num_folds = 3 +s0_horizontal_folds_zoom_to_taskbar = true +s0_domino_direction = 5 +s0_razr_direction = 5 +s0_explode_gridx = 13 +s0_explode_gridy = 10 +s0_explode_tessellation = 0 +s0_fold_gridx = 3 +s0_fold_gridy = 3 +s0_fold_dir = 1 +s0_skewer_direction = 8 +s0_skewer_tessellation = 0 +s0_skewer_gridx = 6 +s0_skewer_gridy = 4 +s0_skewer_rotation = 0 +s0_all_random = false +s0_time_step = 10 +s0_time_step_intense = 30 + +[scaleaddon] +as_close_key = Disabled +as_close_button = Button2 +as_zoom_key = Disabled +as_zoom_button = Button3 +s0_window_title = 1 +s0_title_bold = true +s0_title_size = 18 +s0_border_size = 3 +s0_font_color = #ffffffff +s0_back_color = #00000099 +s0_window_highlight = false +s0_highlight_color = #ffffff96 +s0_layout_mode = 0 + +[addhelper] +as_toggle_key = <Super>p +as_window_types = Toolbar | Utility | Dialog | ModalDialog | Fullscreen | Normal +as_brightness = 30 +as_saturation = 50 +as_opacity = 100 + +[place] +s0_workarounds = true +s0_mode = 2 +s0_position_matches = +s0_position_x_values = +s0_position_y_values = +s0_viewport_matches = +s0_viewport_x_values = +s0_viewport_y_values = + +[thumbnail] +s0_thumb_size = 200 +s0_show_delay = 100 +s0_border = 16 +s0_thumb_color = #0000007f +s0_current_viewport = true +s0_always_on_top = true +s0_window_like = true +s0_mipmap = false +s0_title_enabled = true +s0_font_bold = true +s0_font_size = 12 +s0_font_color = #000000ff + +[rotate] +as_initiate_button = <Control><Alt>Button1 +as_rotate_left_key = <Control><Alt>Left +as_rotate_left_button = Disabled +as_rotate_right_key = <Control><Alt>Right +as_rotate_right_button = Disabled +as_rotate_left_window_key = <Shift><Control><Alt>Left +as_rotate_left_window_button = Disabled +as_rotate_right_window_key = <Shift><Control><Alt>Right +as_rotate_right_window_button = Disabled +as_edge_flip_pointer = false +as_edge_flip_window = true +as_edge_flip_dnd = true +as_flip_time = 350 +as_rotate_to_1_key = Disabled +as_rotate_to_2_key = Disabled +as_rotate_to_3_key = Disabled +as_rotate_to_4_key = Disabled +as_rotate_to_5_key = Disabled +as_rotate_to_6_key = Disabled +as_rotate_to_7_key = Disabled +as_rotate_to_8_key = Disabled +as_rotate_to_9_key = Disabled +as_rotate_to_10_key = Disabled +as_rotate_to_11_key = Disabled +as_rotate_to_12_key = Disabled +as_rotate_to_1_window_key = Disabled +as_rotate_to_2_window_key = Disabled +as_rotate_to_3_window_key = Disabled +as_rotate_to_4_window_key = Disabled +as_rotate_to_5_window_key = Disabled +as_rotate_to_6_window_key = Disabled +as_rotate_to_7_window_key = Disabled +as_rotate_to_8_window_key = Disabled +as_rotate_to_9_window_key = Disabled +as_rotate_to_10_window_key = Disabled +as_rotate_to_11_window_key = Disabled +as_rotate_to_12_window_key = Disabled +as_rotate_to_key = Disabled +as_rotate_window_key = Disabled +as_rotate_flip_left_edge = Left +as_rotate_flip_right_edge = Right +as_raise_on_rotate = false +s0_invert_y = false +s0_snap_top = true +s0_snap_bottom = false + +[ezoom] +as_zoom_in = <Super>Button4 +as_zoom_in_key = Disabled +as_zoom_out = <Super>Button5 +as_zoom_out_key = Disabled +as_center_mouse = <Super>c +as_zoom_specific_1 = <Super>1 +as_zoom_specific_2 = <Super>2 +as_zoom_specific_3 = <Super>3 +as_spec_target_focus = true +as_lock_zoom = <Super>l +as_pan_left = Disabled +as_pan_right = Disabled +as_pan_up = Disabled +as_pan_down = Disabled +as_fit_to_zoom = <Super>v +as_fit_to_window = <Super>r +s0_sync_mouse = true +s0_scale_mouse = false +s0_hide_original_mouse = false +s0_restrain_mouse = false +s0_mouse_pan = false +s0_restrain_margin = 5 +s0_mouse_poll_interval = 10 +s0_follow_focus = true +s0_focus_fit_window = false +s0_always_focus_fit_window = false +s0_follow_focus_delay = 1 +s0_filter_linear = true + +[mblur] +as_initiate_key = <Control>F12 +s0_mode = 0 +s0_on_transformed_screen = true + +[snap] +as_avoid_snap = 0 +s0_snap_type = 0 +s0_edges_categories = 0;1 +s0_resistance_distance = 30 +s0_attraction_distance = 20 + +[trailfocus] +s0_window_match = (type=toolbar | type=utility | type=dialog | type=normal) & !(state=skiptaskbar | state=skippager) +s0_windows_count = 5 +s0_windows_start = 2 +s0_max_opacity = 100 +s0_min_opacity = 70 +s0_max_brightness = 100 +s0_min_brightness = 100 +s0_max_saturation = 100 +s0_min_saturation = 100 + +[move] +as_initiate_button = <Alt>Button1 +as_initiate_key = <Alt>F7 +as_opacity = 85 +as_constrain_y = true +as_snapoff_maximized = false +as_lazy_positioning = true + +[screenshot] +as_initiate_button = <Super>Button1 +as_directory = Desktop +as_launch_app = + +[fade] +s0_window_match = any +s0_visual_bell = false +s0_fullscreen_visual_bell = false +s0_minimize_open_close = true + +[opacify] +as_toggle_key = <Super>o +as_toggle_reset = true +as_timeout = 700 +as_init_toggle = true +s0_only_if_block = false +s0_focus_instant = false +s0_no_delay_change = false +s0_window_match = Normal | Dialog | ModalDialog | Utility | Toolbar | Fullscreen +s0_active_opacity = 100 +s0_passive_opacity = 10 + +[put] +as_put_viewport_1_key = Disabled +as_put_viewport_2_key = Disabled +as_put_viewport_3_key = Disabled +as_put_viewport_4_key = Disabled +as_put_viewport_5_key = Disabled +as_put_viewport_6_key = Disabled +as_put_viewport_7_key = Disabled +as_put_viewport_8_key = Disabled +as_put_viewport_9_key = Disabled +as_put_viewport_10_key = Disabled +as_put_viewport_11_key = Disabled +as_put_viewport_12_key = Disabled +as_put_viewport_left_key = Disabled +as_put_viewport_right_key = Disabled +as_put_viewport_up_key = Disabled +as_put_viewport_down_key = Disabled +as_put_center_key = <Super>KP_Begin +as_put_center_button = Disabled +as_put_left_key = <Super>KP_Left +as_put_left_button = Disabled +as_put_right_key = <Super>KP_Right +as_put_right_button = Disabled +as_put_top_key = <Super>KP_Up +as_put_top_button = Disabled +as_put_bottom_key = <Super>KP_Down +as_put_bottom_button = Disabled +as_put_topleft_key = <Super>KP_Home +as_put_topleft_button = Disabled +as_put_topright_key = <Super>KP_Prior +as_put_topright_button = Disabled +as_put_bottomleft_key = <Super>KP_End +as_put_bottomleft_button = Disabled +as_put_bottomright_key = <Super>KP_Next +as_put_bottomright_button = Disabled +as_put_restore_key = <Super>KP_Insert +as_put_restore_button = Disabled +as_put_pointer_key = <Super>z +as_put_pointer_button = Disabled +s0_pad_left = 0 +s0_pad_right = 0 +s0_pad_top = 0 +s0_pad_bottom = 0 +s0_unfocus_window = false +s0_window_center = false +s0_avoid_offscreen = false + +[extrawm] +as_toggle_redirect_key = Disabled +as_toggle_fullscreen_key = Disabled +as_toggle_always_on_top_key = Disabled +as_toggle_sticky_key = Disabled + +[fadedesktop] +s0_fadetime = 500 +s0_window_match = Toolbar | Utility | Dialog | Normal | Unknown + +[core] +as_active_plugins = annotate;workarounds;text;colorfilter;regex;dbus;shift;svg;neg;video;decoration;animation;place;png;move;screenshot;core;imgjpeg;inotify;resize;expo;wall;ezoom;wobbly;scale;scaleaddon;scalefilter +as_texture_filter = 2 +as_click_to_focus = true +as_autoraise = true +as_autoraise_delay = 1000 +as_close_window_key = <Alt>F4 +as_close_window_button = Disabled +as_main_menu_key = <Alt>F1 +as_run_key = <Alt>F2 +as_command0 = gnome-terminal +as_command1 = gedit +as_command2 = firefox +as_command3 = xchat +as_command4 = +as_command5 = +as_command6 = +as_command7 = +as_command8 = +as_command9 = +as_command10 = +as_command11 = +as_run_command0_key = <Control><Alt>t +as_run_command1_key = <Control><Alt>e +as_run_command2_key = <Control><Alt>f +as_run_command3_key = <Control><Alt>c +as_run_command4_key = Disabled +as_run_command5_key = Disabled +as_run_command6_key = Disabled +as_run_command7_key = Disabled +as_run_command8_key = Disabled +as_run_command9_key = Disabled +as_run_command10_key = Disabled +as_run_command11_key = Disabled +as_slow_animations_key = Disabled +as_raise_window_key = Disabled +as_raise_window_button = <Control>Button6 +as_lower_window_key = Disabled +as_lower_window_button = <Alt>Button6 +as_unmaximize_window_key = <Alt>F5 +as_minimize_window_key = <Alt>F9 +as_minimize_window_button = Disabled +as_maximize_window_key = <Alt>F10 +as_maximize_window_horizontally_key = Disabled +as_maximize_window_vertically_key = Disabled +as_opacity_increase_button = <Alt>Button4 +as_opacity_decrease_button = <Alt>Button5 +as_command_screenshot = gnome-screenshot +as_run_command_screenshot_key = Print +as_command_window_screenshot = gnome-screenshot --window +as_run_command_window_screenshot_key = <Alt>Print +as_window_menu_button = <Alt>Button3 +as_window_menu_key = <Alt>space +as_show_desktop_key = <Control><Alt>d +as_show_desktop_edge = +as_raise_on_click = true +as_audible_bell = true +as_toggle_window_maximized_key = <Control><Alt>m +as_toggle_window_maximized_button = Disabled +as_toggle_window_maximized_horizontally_key = Disabled +as_toggle_window_maximized_vertically_key = Disabled +as_hide_skip_taskbar_windows = true +as_toggle_window_shaded_key = <Control><Alt>s +as_ignore_hints_when_maximized = true +as_command_terminal = gnome-terminal +as_run_command_terminal_key = Disabled +as_cursor_theme = default +as_cursor_size = 18 +as_ping_delay = 5000 +s0_detect_refresh_rate = true +s0_lighting = true +s0_refresh_rate = 50 +s0_hsize = 2 +s0_vsize = 1 +s0_opacity_step = 10 +s0_unredirect_fullscreen_windows = true +s0_default_icon = icon +s0_sync_to_vblank = false +s0_number_of_desktops = 1 +s0_detect_outputs = true +s0_outputs = 640x480+0+0 +s0_focus_prevention_match = any +s0_opacity_matches = +s0_opacity_values = + +[switcher] +as_next_button = Disabled +as_next_key = <Alt>Tab +as_prev_button = Disabled +as_prev_key = <Shift><Alt>Tab +as_next_all_button = Disabled +as_next_all_key = <Control><Alt>Tab +as_prev_all_button = Disabled +as_prev_all_key = <Shift><Control><Alt>Tab +as_next_no_popup_button = Disabled +as_next_no_popup_key = Disabled +as_prev_no_popup_button = Disabled +as_prev_no_popup_key = Disabled +s0_window_match = Toolbar | Utility | Dialog | Normal | Unknown +s0_mipmap = true +s0_saturation = 100 +s0_brightness = 65 +s0_opacity = 95 +s0_bring_to_front = true +s0_icon = true +s0_minimized = true +s0_auto_rotate = false + +[imgjpeg] +as_quality = 80 + +[scalefilter] +s0_timeout = 0 +s0_filter_case_insensitive = false +s0_filter_display = true +s0_font_bold = true +s0_font_size = 24 +s0_border_size = 5 +s0_font_color = #ffffffff +s0_back_color = #00000099 + +[resize] +as_initiate_normal_key = Disabled +as_initiate_outline_key = Disabled +as_initiate_rectangle_key = Disabled +as_initiate_stretch_key = Disabled +as_initiate_button = <Alt>Button2 +as_initiate_key = <Alt>F8 +as_mode = 0 +as_border_color = #2f2f4f9f +as_fill_color = #2f2f4f4f +as_normal_match = +as_outline_match = +as_rectangle_match = +as_stretch_match = + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity-dev.install b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity-dev.install new file mode 100644 index 00000000..1bc39356 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity-dev.install @@ -0,0 +1,5 @@ +debian/tmp/opt/trinity/lib/libcompizconfig.a +debian/tmp/opt/trinity/lib/libcompizconfig.so +debian/tmp/opt/trinity/include/compizconfig/*.h +debian/tmp/opt/trinity/lib/pkgconfig/libcompizconfig.pc +debian/tmp/opt/trinity/lib/compizconfig/backends/libini.a diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity.install b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity.install new file mode 100644 index 00000000..9dadafc1 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity.install @@ -0,0 +1,10 @@ +debian/tmp/opt/trinity/lib/libcompizconfig.so.0.0.0 +debian/tmp/opt/trinity/lib/libcompizconfig.so.0 +debian/tmp/opt/trinity/lib/compizconfig/backends/libini.so +# debian/tmp/opt/trinity/share/compizconfig/global.xml +debian/tmp/opt/trinity/share/compiz/ccp.xml +debian/tmp/opt/trinity/lib/compiz/libccp.so +#debian/compizconfig/config /etc/compizconfig +debian/tmp/etc/compizconfig/config +debian/normal.profile /opt/trinity/share/compizconfig +debian/extra.profile /opt/trinity/share/compizconfig diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity.postrm b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity.postrm new file mode 100644 index 00000000..e257381b --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity.postrm @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +package_name=libcompizconfig0-trinity + +case "$1" in + remove) + dpkg-divert --package $package_name \ + --remove /etc/compizconfig/config + ;; +esac + +exit 0 diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity.preinst b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity.preinst new file mode 100644 index 00000000..87730616 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/libcompizconfig0-trinity.preinst @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +package_name=libcompizconfig0-trinity + +case "$1" in + install) + dpkg-divert --package $package_name \ + /etc/compizconfig/config + ;; + + upgrade) + divert=`dpkg-divert --listpackage "/etc/compizconfig/config"` + if [ -z "$divert" ]; then + dpkg-divert --package $package_name \ + /etc/compizconfig/config + fi + ;; + +esac + +exit 0 diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/normal.profile b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/normal.profile new file mode 100644 index 00000000..eb223f65 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/normal.profile @@ -0,0 +1,909 @@ +[shelf] +as_trigger_key = <Super>l +as_dec_button = <Alt><Super>Button4 +as_inc_button = <Alt><Super>Button5 +as_animtime = 150 + +[expo] +as_expo_key = <Super>e +as_expo_button = Disabled +as_expo_edge = TopLeft +as_double_click_time = 500 +as_dnd_button = Button1 +as_exit_button = Button3 +as_next_vp_button = Button5 +as_prev_vp_button = Button4 +as_rotate = true +as_expo_immediate_move = false +as_expo_animation = 0 +as_reflection = true +as_ground_color1 = #b3b3b3cc +as_ground_color2 = #b3b3b300 +as_mipmaps = false +as_multioutput_mode = 0 +as_hide_docks = true + +[winrules] +s0_skiptaskbar_match = +s0_skippager_match = +s0_above_match = +s0_below_match = +s0_sticky_match = +s0_fullscreen_match = +s0_no_argb_match = +s0_no_move_match = +s0_no_resize_match = +s0_no_minimize_match = +s0_no_maximize_match = +s0_no_close_match = +s0_no_focus_match = +s0_size_matches = +s0_size_width_values = +s0_size_height_values = + +[annotate] +as_initiate_button = <Alt><Super>Button1 +as_draw_button = Disabled +as_erase = <Alt><Super>Button3 +as_clear_key = <Alt><Super>k +as_clear_button = Disabled +as_fill_color = #ff0000ff +as_stroke_color = #00ff00ff + +[zoom] +as_initiate_button = <Super>Button3 +as_zoom_in_button = <Super>Button4 +as_zoom_out_button = <Super>Button5 +as_zoom_pan_button = <Super>Button2 +s0_filter_linear = false + +[vpswitch] +as_begin_key = Disabled +as_switch_to_1_key = Disabled +as_switch_to_2_key = Disabled +as_switch_to_3_key = Disabled +as_switch_to_4_key = Disabled +as_switch_to_5_key = Disabled +as_switch_to_6_key = Disabled +as_switch_to_7_key = Disabled +as_switch_to_8_key = Disabled +as_switch_to_9_key = Disabled +as_switch_to_10_key = Disabled +as_switch_to_11_key = Disabled +as_switch_to_12_key = Disabled +as_left_button = Disabled +as_right_button = Disabled +as_up_button = Disabled +as_down_button = Disabled +as_next_button = Button5 +as_prev_button = Button4 +as_initiate_button = Button2 +as_init_plugin = rotate +as_init_action = initiate_button + +[bench] +as_initiate_key = <Super>F12 +as_disable_limiter = true +as_output_screen = true +as_position_x = 0 +as_position_y = 0 +as_output_console = false +as_console_update_time = 5 + +[splash] +as_initiate_key = <Control>F11 +as_firststart = true +as_background = splash_background.png +as_logo = splash_logo.png + +[ring] +as_next_key = <Super>Tab +as_next_button = Disabled +as_prev_key = <Shift><Super>Tab +as_prev_button = Disabled +as_next_all_key = <Alt><Super>Tab +as_next_all_button = Disabled +as_prev_all_key = <Shift><Alt><Super>Tab +as_prev_all_button = Disabled +as_next_group_key = Disabled +as_next_group_button = Disabled +as_prev_group_key = Disabled +as_prev_group_button = Disabled +s0_inactive_opacity = 100 +s0_window_match = Normal | Dialog | ModalDialog | Utility | Unknown +s0_overlay_icon = 1 +s0_darken_back = true +s0_minimized = true +s0_select_with_mouse = false +s0_ring_clockwise = false +s0_ring_width = 70 +s0_ring_height = 60 +s0_thumb_width = 350 +s0_thumb_height = 250 +s0_window_title = true +s0_title_font_bold = false +s0_title_font_size = 16 +s0_title_back_color = #00000099 +s0_title_font_color = #ffffffff +s0_title_text_placement = 0 + +[water] +as_initiate_key = <Control><Super> +as_toggle_rain_key = <Shift>F9 +as_toggle_wiper_key = <Shift>F8 +as_rain_delay = 250 +as_title_wave = false + +[workarounds] +as_legacy_fullscreen = true +as_firefox_menu_fix = true +as_ooo_menu_fix = true +as_notification_daemon_fix = true +as_java_fix = true +as_qt_fix = true +as_aiglx_fragment_fix = true +as_fglrx_xgl_fix = false +as_sticky_alldesktops = false +as_alldesktop_sticky_match = any + +[group] +as_select_button = Disabled +as_select_single_key = <Super>s +as_group_key = <Super>g +as_ungroup_key = <Super>u +as_remove_key = <Super>r +as_close_key = <Super>c +as_ignore_key = <Super>x +as_tabmode_key = <Super>t +as_change_tab_left_key = <Super>Left +as_change_tab_right_key = <Super>Right +as_change_color_key = Disabled +s0_move_all = true +s0_resize_all = false +s0_raise_all = true +s0_maximize_unmaximize_all = false +s0_minimize_all = true +s0_shade_all = false +s0_auto_group = false +s0_auto_ungroup = true +s0_window_match = Toolbar | Utility | Dialog | Normal | Unknown +s0_select_opacity = 80 +s0_select_saturation = 20 +s0_select_brightness = 70 +s0_select_precision = 25 +s0_fill_color = #00000055 +s0_line_color = #000000ab +s0_mipmaps = false +s0_untab_on_close = false +s0_autotab_create = false +s0_bar_animations = true +s0_thumb_size = 96 +s0_thumb_space = 5 +s0_border_radius = 10 +s0_border_width = 1 +s0_tab_base_color = #00000099 +s0_tab_border_color = #000000ab +s0_tab_highlight_color = #ffffff99 +s0_tab_style = 0 +s0_tabbar_font_size = 12 +s0_tabbar_font_color = #ffffffff +s0_dnd_ungroup_window = true +s0_drag_y_distance = 400 +s0_drag_speed_limit = 800 +s0_glow = true +s0_glow_size = 64 +s0_glow_type = 0 + +[colorfilter] +as_toggle_window_key = <Super>f +as_toggle_screen_key = <Super>d +as_switch_filter_key = <Control><Super>s +s0_filters = negative;negative-green;blueish-filter;sepia;grayscale +s0_filter_decorations = false +s0_filter_match = any +s0_exclude_match = type=Desktop + +[cube] +as_unfold_key = <Control><Alt>Down +as_next_slide_key = space +as_prev_slide_key = Disabled +s0_color = #ffffffff +s0_in = false +s0_scale_image = false +s0_images = /usr/share/compiz/freedesktop.png +s0_skydome = false +s0_skydome_image = +s0_skydome_animated = false +s0_skydome_gradient_start_color = #0db1fdff +s0_skydome_gradient_end_color = #feffc7ff +s0_mipmap = true +s0_backgrounds = +s0_adjust_image = false +s0_transparent_manual_only = true +s0_multioutput_mode = 0 + +[minimize] +s0_window_match = toolbar | utility | dialog | normal +s0_shade_resistance = 75 + +[wobbly] +as_snap_key = <Shift> +as_snap_inverted = false +as_shiver = false +s0_grid_resolution = 24 +s0_min_grid_size = 32 +s0_map_effect = 0 +s0_focus_effect = 0 +s0_map_window_match = Splash | DropdownMenu | PopupMenu | Tooltip | Notification | Combo | Dnd | Unknown +s0_focus_window_match = +s0_grab_window_match = +s0_move_window_match = Toolbar | Menu | Utility | Dialog | Normal | Unknown +s0_maximize_effect = true + +[crashhandler] +as_enabled = true +as_directory = /tmp +as_start_wm = false +as_wm_cmd = + +[shift] +as_initiate_key = <Shift><Super>s +as_initiate_button = Disabled +as_initiate_edge = +as_initiate_all_key = Disabled +as_initiate_all_button = Disabled +as_initiate_all_edge = +as_terminate_button = Button3 +as_next_key = <Alt>Tab +as_next_button = Disabled +as_prev_key = <Shift><Alt>Tab +as_prev_button = Disabled +as_next_all_key = <Alt><Super>Tab +as_next_all_button = Disabled +as_prev_all_key = <Shift><Alt><Super>Tab +as_prev_all_button = Disabled +as_next_group_key = Disabled +as_next_group_button = Disabled +as_prev_group_key = Disabled +as_prev_group_button = Disabled +s0_window_match = Normal | Dialog | ModalDialog | Utility | Unknown +s0_minimized = true +s0_click_duration = 500 +s0_mode = 1 +s0_size = 50 +s0_hide_all = false +s0_reflection = true +s0_ground_color1 = #b3b3b3cc +s0_ground_color2 = #b3b3b300 +s0_flip_rotation = 30 +s0_overlay_icon = 1 +s0_mipmaps = false +s0_multioutput_mode = 0 +s0_window_title = true +s0_title_font_bold = false +s0_title_font_size = 16 +s0_title_back_color = #00000099 +s0_title_font_color = #ffffffff +s0_title_text_placement = 2 + +[clone] +as_initiate_button = <Shift><Super>Button1 + +[blur] +as_pulse = false +s0_focus_blur_match = toolbar | menu | utility | normal | dialog | modaldialog +s0_focus_blur = false +s0_alpha_blur_match = class=Gnome-termina | class=Xfce4-terminal +s0_alpha_blur = true +s0_filter = 0 +s0_gaussian_radius = 3 +s0_saturation = 100 +s0_occlusion = true + +[reflex] +s0_file = reflection.png +s0_match = any +s0_window = false +s0_decoration = true +s0_threshold = 1 +s0_moving = true + +[cubecaps] +as_top_next_key = space +as_top_next_button = Disabled +as_top_prev_key = Disabled +as_top_prev_button = Disabled +as_bottom_next_key = Disabled +as_bottom_next_button = Disabled +as_bottom_prev_key = Disabled +as_bottom_prev_button = Disabled +s0_draw_top = true +s0_draw_bottom = true +s0_adjust_top = false +s0_adjust_bottom = false +s0_scale_top_image = false +s0_scale_bottom_image = false +s0_clamp_top_to_border = true +s0_clamp_bottom_to_border = true +s0_top_color = #ffffffff +s0_bottom_color = #ffffffff +s0_top_images = fusioncap.png +s0_bottom_images = compizcap.png + +[scale] +as_initiate_edge = +as_initiate_key = <Shift><Alt>Up +as_initiate_button = Disabled +as_initiate_all_edge = +as_initiate_all_button = Disabled +as_initiate_all_key = Disabled +as_initiate_group_edge = +as_initiate_group_button = Disabled +as_initiate_group_key = Disabled +as_initiate_output_edge = +as_initiate_output_button = Disabled +as_initiate_output_key = Disabled +as_show_desktop = true +s0_spacing = 10 +s0_window_match = Toolbar | Utility | Dialog | Normal | Unknown +s0_darken_back = true +s0_opacity = 75 +s0_overlay_icon = 1 +s0_hover_time = 750 +s0_multioutput_mode = 0 + +[showdesktop] +s0_direction = 6 +s0_window_match = type=toolbar | type=utility | type=dialog | type=normal +s0_window_part_size = 20 + +[wall] +as_show_switcher = true +as_miniscreen = false +as_edge_radius = 5 +as_outline_color = #333333d9 +as_background_gradient_base_color = #cccce6d9 +as_background_gradient_highlight_color = #f3f3ffd9 +as_background_gradient_shadow_color = #f3f3ffd9 +as_thumb_gradient_base_color = #33333359 +as_thumb_gradient_highlight_color = #3f3f3f3f +as_thumb_highlight_gradient_base_color = #fffffff3 +as_thumb_highlight_gradient_shadow_color = #dfdfdfa6 +as_arrow_base_color = #e6e6e6d9 +as_arrow_shadow_color = #dcdcdcd9 +as_allow_wraparound = false +as_left_key = <Control><Alt>Left +as_left_button = Disabled +as_right_key = <Control><Alt>Right +as_right_button = Disabled +as_up_key = <Control><Alt>Up +as_up_button = Disabled +as_down_key = <Control><Alt>Down +as_down_button = Disabled +as_next_key = <Control><Alt>Next +as_next_button = Disabled +as_prev_key = <Control><Alt>Prior +as_prev_button = Disabled +as_left_window_key = <Shift><Control><Alt>Left +as_right_window_key = <Shift><Control><Alt>Right +as_up_window_key = <Shift><Control><Alt>Up +as_down_window_key = <Shift><Control><Alt>Down +as_flip_left_edge = Left +as_flip_right_edge = Right +as_flip_up_edge = Top +as_flip_down_edge = Bottom +s0_mmmode = 0 +s0_edgeflip_pointer = false +s0_edgeflip_move = true +s0_edgeflip_dnd = false + +[widget] +as_toggle_key = F9 +as_toggle_button = Disabled +as_toggle_edge = +s0_match = +s0_end_on_click = true +s0_bg_brightness = 50 +s0_bg_saturation = 100 + +[resizeinfo] +as_fade_time = 500 +as_always_show = false +as_text_color = #000000ff +as_gradient_1 = #cccce6cc +as_gradient_2 = #f3f3f3cc +as_gradient_3 = #d9d9d9cc + +[firepaint] +as_initiate_key = Disabled +as_initiate_button = <Shift><Super>Button1 +as_clear_key = <Shift><Super>c +as_clear_button = Disabled +s0_num_particles = 3000 +s0_fire_color = #ff3305ff +s0_fire_mystical = false +s0_bg_brightness = 50 + +[neg] +as_window_toggle_key = <Super>n +as_screen_toggle_key = <Super>m +s0_neg_match = any +s0_exclude_match = type=Desktop + +[video] +as_yv12 = true + +[fs] +as_mount_point = compiz + +[cubereflex] +s0_ground_color1 = #b3b3b3cc +s0_ground_color2 = #b3b3b300 +s0_auto_zoom = true +s0_zoom_manual_only = true +s0_mode = 0 + +[decoration] +as_shadow_color = #00000000 +as_shadow_x_offset = 1 +as_shadow_y_offset = 1 +as_command = +as_mipmap = false +as_decoration_match = any +as_shadow_match = any + +[plane] +as_plane_left_key = <Control><Alt>Left +as_plane_right_key = <Control><Alt>Right +as_plane_down_key = <Control><Alt>Down +as_plane_up_key = <Control><Alt>Up +as_plane_to_1_key = Disabled +as_plane_to_2_key = Disabled +as_plane_to_3_key = Disabled +as_plane_to_4_key = Disabled +as_plane_to_5_key = Disabled +as_plane_to_6_key = Disabled +as_plane_to_7_key = Disabled +as_plane_to_8_key = Disabled +as_plane_to_9_key = Disabled +as_plane_to_10_key = Disabled +as_plane_to_11_key = Disabled +as_plane_to_12_key = Disabled + +[animation] +s0_close_effects = 11;9;9 +s0_close_durations = 200;150;150 +s0_close_matches = ((type=Normal | Utility | Unknown) | name=sun-awt-X11-XFramePeer | name=sun-awt-X11-XDialogPeer) & !(role=toolTipTip | role=qtooltip_label) & !(type=Normal & override_redirect=1) & !(name=gnome-screensaver);(type=Menu | PopupMenu | DropdownMenu | Dialog | ModalDialog | Normal);(type=Tooltip | Notification) +s0_close_options = ;; +s0_close_random_effects = 0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19 +s0_open_effects = 12;9;9 +s0_open_durations = 200;150;150 +s0_open_matches = ((type=Normal | Utility | Unknown) | name=sun-awt-X11-XFramePeer | name=sun-awt-X11-XDialogPeer) & !(role=toolTipTip | role=qtooltip_label) & !(type=Normal & override_redirect=1) & !(name=gnome-screensaver);(type=Menu | PopupMenu | DropdownMenu | Dialog | ModalDialog | Normal);(type=Tooltip | Notification) +s0_open_options = ;; +s0_open_random_effects = 0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19 +s0_minimize_effects = 20 +s0_minimize_durations = 300 +s0_minimize_matches = (type=Normal | Dialog | ModalDialog | Utility | Unknown) +s0_minimize_options = +s0_minimize_random_effects = 0;1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17 +s0_shade_effects = 4 +s0_shade_durations = 200 +s0_shade_matches = (type=Normal | Dialog | ModalDialog | Utility | Unknown) +s0_shade_options = +s0_shade_random_effects = 0;1;2 +s0_focus_effects = 2 +s0_focus_durations = 200 +s0_focus_matches = (type=Normal | Dialog | ModalDialog | Utility | Unknown) +s0_focus_options = +s0_airplane_fly_to_taskbar = true +s0_fire_particles = 1000 +s0_fire_color = #ff3305ff +s0_fire_direction = 0 +s0_fire_constant_speed = false +s0_fire_smoke = false +s0_fire_mystical = false +s0_beam_spacing = 5 +s0_beam_color = #7f7f7fff +s0_glide1_zoom_to_taskbar = false +s0_glide2_zoom_to_taskbar = true +s0_zoom_from_center = 0 +s0_rollup_fixed_interior = false +s0_sidekick_zoom_from_center = 0 +s0_dream_zoom_to_taskbar = true +s0_magic_lamp_moving_end = true +s0_magic_lamp_grid_res = 100 +s0_magic_lamp_max_waves = 3 +s0_magic_lamp_open_start_width = 30 +s0_vacuum_moving_end = true +s0_vacuum_grid_res = 100 +s0_vacuum_open_start_width = 30 +s0_curved_fold_zoom_to_taskbar = true +s0_horizontal_folds_num_folds = 3 +s0_horizontal_folds_zoom_to_taskbar = true +s0_domino_direction = 5 +s0_razr_direction = 5 +s0_explode_gridx = 13 +s0_explode_gridy = 10 +s0_explode_tessellation = 0 +s0_fold_gridx = 3 +s0_fold_gridy = 3 +s0_fold_dir = 1 +s0_skewer_direction = 8 +s0_skewer_tessellation = 0 +s0_skewer_gridx = 6 +s0_skewer_gridy = 4 +s0_skewer_rotation = 0 +s0_all_random = false +s0_time_step = 10 +s0_time_step_intense = 30 + +[scaleaddon] +as_close_key = Disabled +as_close_button = Button2 +as_zoom_key = Disabled +as_zoom_button = Button3 +s0_window_title = 1 +s0_title_bold = true +s0_title_size = 18 +s0_border_size = 3 +s0_font_color = #ffffffff +s0_back_color = #00000099 +s0_window_highlight = false +s0_highlight_color = #ffffff96 +s0_layout_mode = 0 + +[addhelper] +as_toggle_key = <Super>p +as_window_types = Toolbar | Utility | Dialog | ModalDialog | Fullscreen | Normal +as_brightness = 30 +as_saturation = 50 +as_opacity = 100 + +[place] +s0_workarounds = true +s0_mode = 2 +s0_position_matches = +s0_position_x_values = +s0_position_y_values = +s0_viewport_matches = +s0_viewport_x_values = +s0_viewport_y_values = + +[thumbnail] +s0_thumb_size = 200 +s0_show_delay = 100 +s0_border = 16 +s0_thumb_color = #0000007f +s0_current_viewport = true +s0_always_on_top = true +s0_window_like = true +s0_mipmap = false +s0_title_enabled = true +s0_font_bold = true +s0_font_size = 12 +s0_font_color = #000000ff + +[rotate] +as_initiate_button = <Control><Alt>Button1 +as_rotate_left_key = <Control><Alt>Left +as_rotate_left_button = Disabled +as_rotate_right_key = <Control><Alt>Right +as_rotate_right_button = Disabled +as_rotate_left_window_key = <Shift><Control><Alt>Left +as_rotate_left_window_button = Disabled +as_rotate_right_window_key = <Shift><Control><Alt>Right +as_rotate_right_window_button = Disabled +as_edge_flip_pointer = false +as_edge_flip_window = true +as_edge_flip_dnd = true +as_flip_time = 350 +as_rotate_to_1_key = Disabled +as_rotate_to_2_key = Disabled +as_rotate_to_3_key = Disabled +as_rotate_to_4_key = Disabled +as_rotate_to_5_key = Disabled +as_rotate_to_6_key = Disabled +as_rotate_to_7_key = Disabled +as_rotate_to_8_key = Disabled +as_rotate_to_9_key = Disabled +as_rotate_to_10_key = Disabled +as_rotate_to_11_key = Disabled +as_rotate_to_12_key = Disabled +as_rotate_to_1_window_key = Disabled +as_rotate_to_2_window_key = Disabled +as_rotate_to_3_window_key = Disabled +as_rotate_to_4_window_key = Disabled +as_rotate_to_5_window_key = Disabled +as_rotate_to_6_window_key = Disabled +as_rotate_to_7_window_key = Disabled +as_rotate_to_8_window_key = Disabled +as_rotate_to_9_window_key = Disabled +as_rotate_to_10_window_key = Disabled +as_rotate_to_11_window_key = Disabled +as_rotate_to_12_window_key = Disabled +as_rotate_to_key = Disabled +as_rotate_window_key = Disabled +as_rotate_flip_left_edge = Left +as_rotate_flip_right_edge = Right +as_raise_on_rotate = false +s0_invert_y = false +s0_snap_top = true +s0_snap_bottom = false + +[ezoom] +as_zoom_in = <Super>Button4 +as_zoom_in_key = Disabled +as_zoom_out = <Super>Button5 +as_zoom_out_key = Disabled +as_center_mouse = <Super>c +as_zoom_specific_1 = <Super>1 +as_zoom_specific_2 = <Super>2 +as_zoom_specific_3 = <Super>3 +as_spec_target_focus = true +as_lock_zoom = <Super>l +as_pan_left = Disabled +as_pan_right = Disabled +as_pan_up = Disabled +as_pan_down = Disabled +as_fit_to_zoom = <Super>v +as_fit_to_window = <Super>r +s0_sync_mouse = true +s0_scale_mouse = false +s0_hide_original_mouse = false +s0_restrain_mouse = false +s0_mouse_pan = false +s0_restrain_margin = 5 +s0_mouse_poll_interval = 10 +s0_follow_focus = true +s0_focus_fit_window = false +s0_always_focus_fit_window = false +s0_follow_focus_delay = 1 +s0_filter_linear = true + +[mblur] +as_initiate_key = <Control>F12 +s0_mode = 0 +s0_on_transformed_screen = true + +[snap] +as_avoid_snap = 0 +s0_snap_type = 0 +s0_edges_categories = 0;1 +s0_resistance_distance = 30 +s0_attraction_distance = 20 + +[trailfocus] +s0_window_match = (type=toolbar | type=utility | type=dialog | type=normal) & !(state=skiptaskbar | state=skippager) +s0_windows_count = 5 +s0_windows_start = 2 +s0_max_opacity = 100 +s0_min_opacity = 70 +s0_max_brightness = 100 +s0_min_brightness = 100 +s0_max_saturation = 100 +s0_min_saturation = 100 + +[move] +as_initiate_button = <Alt>Button1 +as_initiate_key = <Alt>F7 +as_opacity = 84 +as_constrain_y = true +as_snapoff_maximized = false +as_lazy_positioning = true + +[screenshot] +as_initiate_button = <Super>Button1 +as_directory = Desktop +as_launch_app = + +[fade] +s0_window_match = any +s0_visual_bell = false +s0_fullscreen_visual_bell = false +s0_minimize_open_close = true + +[opacify] +as_toggle_key = <Super>o +as_toggle_reset = true +as_timeout = 700 +as_init_toggle = true +s0_only_if_block = false +s0_focus_instant = false +s0_no_delay_change = false +s0_window_match = Normal | Dialog | ModalDialog | Utility | Toolbar | Fullscreen +s0_active_opacity = 100 +s0_passive_opacity = 10 + +[put] +as_put_viewport_1_key = Disabled +as_put_viewport_2_key = Disabled +as_put_viewport_3_key = Disabled +as_put_viewport_4_key = Disabled +as_put_viewport_5_key = Disabled +as_put_viewport_6_key = Disabled +as_put_viewport_7_key = Disabled +as_put_viewport_8_key = Disabled +as_put_viewport_9_key = Disabled +as_put_viewport_10_key = Disabled +as_put_viewport_11_key = Disabled +as_put_viewport_12_key = Disabled +as_put_viewport_left_key = Disabled +as_put_viewport_right_key = Disabled +as_put_viewport_up_key = Disabled +as_put_viewport_down_key = Disabled +as_put_center_key = <Super>KP_Begin +as_put_center_button = Disabled +as_put_left_key = <Super>KP_Left +as_put_left_button = Disabled +as_put_right_key = <Super>KP_Right +as_put_right_button = Disabled +as_put_top_key = <Super>KP_Up +as_put_top_button = Disabled +as_put_bottom_key = <Super>KP_Down +as_put_bottom_button = Disabled +as_put_topleft_key = <Super>KP_Home +as_put_topleft_button = Disabled +as_put_topright_key = <Super>KP_Prior +as_put_topright_button = Disabled +as_put_bottomleft_key = <Super>KP_End +as_put_bottomleft_button = Disabled +as_put_bottomright_key = <Super>KP_Next +as_put_bottomright_button = Disabled +as_put_restore_key = <Super>KP_Insert +as_put_restore_button = Disabled +as_put_pointer_key = <Super>z +as_put_pointer_button = Disabled +s0_pad_left = 0 +s0_pad_right = 0 +s0_pad_top = 0 +s0_pad_bottom = 0 +s0_unfocus_window = false +s0_window_center = false +s0_avoid_offscreen = false + +[extrawm] +as_toggle_redirect_key = Disabled +as_toggle_fullscreen_key = Disabled +as_toggle_always_on_top_key = Disabled +as_toggle_sticky_key = Disabled + +[fadedesktop] +s0_fadetime = 500 +s0_window_match = Toolbar | Utility | Dialog | Normal | Unknown + +[core] +as_active_plugins = annotate;workarounds;text;colorfilter;regex;dbus;svg;neg;video;decoration;animation;place;ezoom;png;move;screenshot;core;switcher;imgjpeg;inotify;resize;scale;wall;scaleaddon;scalefilter +as_texture_filter = 2 +as_click_to_focus = true +as_autoraise = true +as_autoraise_delay = 1000 +as_close_window_key = <Alt>F4 +as_close_window_button = Disabled +as_main_menu_key = <Alt>F1 +as_run_key = <Alt>F2 +as_command0 = gnome-terminal +as_command1 = gedit +as_command2 = firefox +as_command3 = xchat +as_command4 = +as_command5 = +as_command6 = +as_command7 = +as_command8 = +as_command9 = +as_command10 = +as_command11 = +as_run_command0_key = <Control><Alt>t +as_run_command1_key = <Control><Alt>e +as_run_command2_key = <Control><Alt>f +as_run_command3_key = <Control><Alt>c +as_run_command4_key = Disabled +as_run_command5_key = Disabled +as_run_command6_key = Disabled +as_run_command7_key = Disabled +as_run_command8_key = Disabled +as_run_command9_key = Disabled +as_run_command10_key = Disabled +as_run_command11_key = Disabled +as_slow_animations_key = Disabled +as_raise_window_key = Disabled +as_raise_window_button = <Control>Button6 +as_lower_window_key = Disabled +as_lower_window_button = <Alt>Button6 +as_unmaximize_window_key = <Alt>F5 +as_minimize_window_key = <Alt>F9 +as_minimize_window_button = Disabled +as_maximize_window_key = <Alt>F10 +as_maximize_window_horizontally_key = Disabled +as_maximize_window_vertically_key = Disabled +as_opacity_increase_button = <Alt>Button4 +as_opacity_decrease_button = <Alt>Button5 +as_command_screenshot = gnome-screenshot +as_run_command_screenshot_key = Print +as_command_window_screenshot = gnome-screenshot --window +as_run_command_window_screenshot_key = <Alt>Print +as_window_menu_button = <Alt>Button3 +as_window_menu_key = <Alt>space +as_show_desktop_key = <Control><Alt>d +as_show_desktop_edge = +as_raise_on_click = true +as_audible_bell = true +as_toggle_window_maximized_key = <Control><Alt>m +as_toggle_window_maximized_button = Disabled +as_toggle_window_maximized_horizontally_key = Disabled +as_toggle_window_maximized_vertically_key = Disabled +as_hide_skip_taskbar_windows = true +as_toggle_window_shaded_key = <Control><Alt>s +as_ignore_hints_when_maximized = true +as_command_terminal = gnome-terminal +as_run_command_terminal_key = Disabled +as_cursor_theme = default +as_cursor_size = 18 +as_ping_delay = 5000 +s0_detect_refresh_rate = true +s0_lighting = true +s0_refresh_rate = 50 +s0_hsize = 2 +s0_vsize = 1 +s0_opacity_step = 10 +s0_unredirect_fullscreen_windows = true +s0_default_icon = icon +s0_sync_to_vblank = false +s0_number_of_desktops = 1 +s0_detect_outputs = true +s0_outputs = 640x480+0+0 +s0_focus_prevention_match = any +s0_opacity_matches = +s0_opacity_values = + +[switcher] +as_next_button = Disabled +as_next_key = <Alt>Tab +as_prev_button = Disabled +as_prev_key = <Shift><Alt>Tab +as_next_all_button = Disabled +as_next_all_key = <Control><Alt>Tab +as_prev_all_button = Disabled +as_prev_all_key = <Shift><Control><Alt>Tab +as_next_no_popup_button = Disabled +as_next_no_popup_key = Disabled +as_prev_no_popup_button = Disabled +as_prev_no_popup_key = Disabled +s0_window_match = Toolbar | Utility | Dialog | Normal | Unknown +s0_mipmap = true +s0_saturation = 100 +s0_brightness = 65 +s0_opacity = 95 +s0_bring_to_front = true +s0_icon = true +s0_minimized = true +s0_auto_rotate = false + +[imgjpeg] +as_quality = 80 + +[scalefilter] +s0_timeout = 0 +s0_filter_case_insensitive = false +s0_filter_display = true +s0_font_bold = true +s0_font_size = 24 +s0_border_size = 5 +s0_font_color = #ffffffff +s0_back_color = #00000099 + +[resize] +as_initiate_normal_key = Disabled +as_initiate_outline_key = Disabled +as_initiate_rectangle_key = Disabled +as_initiate_stretch_key = Disabled +as_initiate_button = <Alt>Button2 +as_initiate_key = <Alt>F8 +as_mode = 0 +as_border_color = #2f2f4f9f +as_fill_color = #2f2f4f4f +as_normal_match = +as_outline_match = +as_rectangle_match = +as_stretch_match = + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/fix-ftbfs-on-libxslt-include.diff b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/fix-ftbfs-on-libxslt-include.diff new file mode 100644 index 00000000..e7fc88d7 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/fix-ftbfs-on-libxslt-include.diff @@ -0,0 +1,20 @@ +Index: b/src/compiz.cpp +=================================================================== +--- a/src/compiz.cpp ++++ b/src/compiz.cpp +@@ -35,6 +35,7 @@ + #include <dirent.h> + #include <sys/stat.h> + #include <errno.h> ++} + + #include <libxslt/transform.h> + #include <libxslt/xsltutils.h> +@@ -44,7 +45,6 @@ + #include <compiz-core.h> + #include <ccs.h> + #include "ccs-private.h" +-} + + extern int xmlLoadExtDtdDefaultValue; + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/kubuntu_01_configure.patch b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/kubuntu_01_configure.patch new file mode 100644 index 00000000..85eaf262 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/kubuntu_01_configure.patch @@ -0,0 +1,13 @@ +--- configure ++++ configure +@@ -6,6 +6,10 @@ + # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. ++ ++# Alter PKG_CONFIG_PATH to contain compiz pkgconfig directory ++PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/opt/trinity/lib/pkgconfig/ ++export PKG_CONFIG_PATH=/opt/trinity/lib/pkgconfig/ + ## --------------------- ## + ## M4sh Initialization. ## + ## --------------------- ## diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/kubuntu_01_trinity.diff b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/kubuntu_01_trinity.diff new file mode 100644 index 00000000..584f17b3 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/kubuntu_01_trinity.diff @@ -0,0 +1,26 @@ +--- src/config.c ++++ src/config.c +@@ -27,7 +27,7 @@ + + #include "ccs-private.h" + +-#define SETTINGPATH "compiz/compizconfig" ++#define SETTINGPATH "compiz/compizconfig-trinity" + + static char* + getConfigFileName (void) +@@ -124,12 +124,12 @@ + + /* check if the global config file exists - if it doesn't, exit + to avoid it being created by ccsIniOpen */ +- fp = fopen (SYSCONFDIR "/compizconfig/config", "r"); ++ fp = fopen (SYSCONFDIR "/compizconfig-trinity/config", "r"); + if (!fp) + return FALSE; + fclose (fp); + +- iniFile = ccsIniOpen (SYSCONFDIR "/compizconfig/config"); ++ iniFile = ccsIniOpen (SYSCONFDIR "/compizconfig-trinity/config"); + if (!iniFile) + return FALSE; + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/kubuntu_02_trinity.diff b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/kubuntu_02_trinity.diff new file mode 100644 index 00000000..af6addc2 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/kubuntu_02_trinity.diff @@ -0,0 +1,11 @@ +--- backend/ini.c ++++ backend/ini.c +@@ -38,7 +38,7 @@ + #include <X11/Xlib.h> + + #define DEFAULTPROF "Default" +-#define SETTINGPATH "compiz/compizconfig" ++#define SETTINGPATH "compiz/compizconfig-trinity" + + typedef struct _IniPrivData + { diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/series b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/series new file mode 100644 index 00000000..48012746 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/patches/series @@ -0,0 +1 @@ +fix-ftbfs-on-libxslt-include.diff diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/rules b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/rules new file mode 100755 index 00000000..bf02723e --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/rules @@ -0,0 +1,23 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +#include /usr/share/cdbs/1/rules/simple-patchsys.mk + +DEB_CONFIGURE_INCLUDEDIR := /opt/trinity/include +DEB_CONFIGURE_MANDIR := /opt/trinity/share/man +DEB_CONFIGURE_PREFIX := /opt/trinity +DEB_CONFIGURE_INFODIR := /opt/trinity/share/info + +cdbs_configure_flags := --with-qt-dir=/usr/share/qt3 --disable-rpath --with-xinerama $(cdbs_kde_enable_final) $(cdbs_kde_enable_debug) + +DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/opt/trinity --with-extra-libs=/opt/trinity/lib --with-extra-includes=/opt/trinity/include + +export PKG_CONFIG_PATH := /opt/trinity/lib/pkgconfig:/opt/trinity/share/pkgconfig:$(PKG_CONFIG_PATH) + +makebuilddir:: debian/stamp-autoreconf +debian/stamp-autoreconf: + dh_testdir + autoreconf -vi + intltoolize --automake --copy --force + touch debian/stamp-autoreconf diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/source/format b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/source/options b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/source/options new file mode 100644 index 00000000..72f1f545 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/debian/source/options @@ -0,0 +1,6 @@ +# Use xz instead of gzip +compression = "xz" +compression-level = 9 + +# Don't run differences +diff-ignore = .* diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/include/Makefile.am b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/include/Makefile.am new file mode 100644 index 00000000..1f4ebc44 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/include/Makefile.am @@ -0,0 +1,3 @@ +## Process this file with automake to produce Makefile.in +ccsincludedir = $(includedir)/compizconfig +ccsinclude_HEADERS = ccs.h ccs-backend.h diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/include/ccs-backend.h b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/include/ccs-backend.h new file mode 100644 index 00000000..1377a64d --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/include/ccs-backend.h @@ -0,0 +1,93 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Dennis Kasprzyk <onestone@opencompositing.org> + * Copyright (C) 2007 Danny Baumann <maniac@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CCS_BACKEND_H +#define CCS_BACKEND_H + +#include <ccs.h> + +typedef struct _CCSBackend CCSBackend; +typedef struct _CCSBackendVTable CCSBackendVTable; + +struct _CCSBackend +{ + void *dlhand; + CCSBackendVTable *vTable; +}; + +typedef CCSBackendVTable * (*BackendGetInfoProc) (void); + +typedef void (*CCSExecuteEventsFunc) (unsigned int flags); + +typedef Bool (*CCSInitBackendFunc) (CCSContext * context); +typedef Bool (*CCSFiniBackendFunc) (CCSContext * context); + +typedef Bool (*CCSContextReadInitFunc) (CCSContext * context); +typedef void (*CCSContextReadSettingFunc) +(CCSContext * context, CCSSetting * setting); +typedef void (*CCSContextReadDoneFunc) (CCSContext * context); + +typedef Bool (*CCSContextWriteInitFunc) (CCSContext * context); +typedef void (*CCSContextWriteSettingFunc) +(CCSContext * context, CCSSetting * setting); +typedef void (*CCSContextWriteDoneFunc) (CCSContext * context); + +typedef Bool (*CCSGetIsIntegratedFunc) (CCSSetting * setting); +typedef Bool (*CCSGetIsReadOnlyFunc) (CCSSetting * setting); + +typedef CCSStringList (*CCSGetExistingProfilesFunc) (CCSContext * context); +typedef Bool (*CCSDeleteProfileFunc) (CCSContext * context, char * name); + +struct _CCSBackendVTable +{ + char *name; + char *shortDesc; + char *longDesc; + Bool integrationSupport; + Bool profileSupport; + + /* something like a event loop call for the backend, + so it can check for file changes (gconf changes in the gconf backend) + no need for reload settings signals anymore */ + CCSExecuteEventsFunc executeEvents; + + CCSInitBackendFunc backendInit; + CCSFiniBackendFunc backendFini; + + CCSContextReadInitFunc readInit; + CCSContextReadSettingFunc readSetting; + CCSContextReadDoneFunc readDone; + + CCSContextWriteInitFunc writeInit; + CCSContextWriteSettingFunc writeSetting; + CCSContextWriteDoneFunc writeDone; + + + CCSGetIsIntegratedFunc getSettingIsIntegrated; + CCSGetIsReadOnlyFunc getSettingIsReadOnly; + + CCSGetExistingProfilesFunc getExistingProfiles; + CCSDeleteProfileFunc deleteProfile; +}; + +CCSBackendVTable* getBackendInfo (void); + +#endif diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/include/ccs.h b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/include/ccs.h new file mode 100644 index 00000000..9d886d59 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/include/ccs.h @@ -0,0 +1,837 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Dennis Kasprzyk <onestone@beryl-project.org> + * Copyright (C) 2007 Danny Baumann <maniac@beryl-project.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +#ifndef _CSS_H +#define _CSS_H + +#define D_NONE 0 +#define D_NORMAL 1 +#define D_FULL 2 + +#ifndef DEBUGLEVEL +# define DEBUGLEVEL D_NONE +#endif +#define D(x, fmt, args...) { if (x <= DEBUGLEVEL) printf(fmt, ##args); } + +#ifndef Bool +#define Bool int +#endif + +#ifndef TRUE +#define TRUE ~0 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +/** + * list functions: + * for each list there is a set of functions, explained using String as example + * + * ccsStringListAppend (list, item) + * Adds an item at the end of the list. Returns the new list. + * + * ccsStringListPrepend (list, item) + * Adds an item at the beginning of the list. Returns the new list. + * + * ccsStringListInsert (list, item, position) + * Adds an item at a given position. Position is 0-based. If position is + * larger than the amount of items in the list, the item is inserted at the + * end of the list. Returns the new list. + * + * ccsStringListInsertBefore (list, sibling, item) + * Inserts item before sibling into the list. If sibling is no list member, + * item is inserted at the end. Returns the new list. + * + * ccsStringListLength (list) + * Returns the amount of items in list. + * + * ccsStringListFind (list, item) + * Finds and returns an item matching <item>. If nothing is found, returns NULL. + * + * ccsStringListGetItem (list, index) + * Returns the list item at position <index>. If index is larger than the + * amount of items in the list, returns NULL. + * + * ccsStringListRemove (list, item, freeObj) + * Removes item from the list. If freeObj is TRUE, also frees the data item. + * Returns the new list. + * + * ccsStringListFree (list, freeObj) + * Frees the complete list. If freeObj is TRUE, also frees the data items. + * Returns the new list (NULL). + */ +#define CCSLIST_HDR(type,dtype) \ + typedef struct _CCS##type##List * CCS##type##List;\ + struct _CCS##type##List \ + { \ + dtype * data; \ + CCS##type##List next; \ + }; \ + CCS##type##List ccs##type##ListAppend (CCS##type##List list, dtype *data); \ + CCS##type##List ccs##type##ListPrepend (CCS##type##List list, dtype *data); \ + CCS##type##List ccs##type##ListInsert (CCS##type##List list, dtype *data, int position); \ + CCS##type##List ccs##type##ListInsertBefore (CCS##type##List list, CCS##type##List sibling, dtype *data); \ + unsigned int ccs##type##ListLength (CCS##type##List list); \ + CCS##type##List ccs##type##ListFind (CCS##type##List list, dtype *data); \ + CCS##type##List ccs##type##ListGetItem (CCS##type##List list, unsigned int index); \ + CCS##type##List ccs##type##ListRemove (CCS##type##List list, dtype *data, Bool freeObj); \ + CCS##type##List ccs##type##ListFree (CCS##type##List list, Bool freeObj); + +typedef struct _CCSContext CCSContext; +typedef struct _CCSPlugin CCSPlugin; +typedef struct _CCSSetting CCSSetting; +typedef struct _CCSGroup CCSGroup; +typedef struct _CCSSubGroup CCSSubGroup; +typedef struct _CCSPluginCategory CCSPluginCategory; +typedef struct _CCSSettingValue CCSSettingValue; +typedef struct _CCSPluginConflict CCSPluginConflict; +typedef struct _CCSBackendInfo CCSBackendInfo; +typedef struct _CCSIntDesc CCSIntDesc; +typedef struct _CCSStrRestriction CCSStrRestriction; +typedef struct _CCSStrExtension CCSStrExtension; + +CCSLIST_HDR (Plugin, CCSPlugin) +CCSLIST_HDR (Setting, CCSSetting) +CCSLIST_HDR (String, char) +CCSLIST_HDR (Group, CCSGroup) +CCSLIST_HDR (SubGroup, CCSSubGroup) +CCSLIST_HDR (SettingValue, CCSSettingValue) +CCSLIST_HDR (PluginConflict, CCSPluginConflict) +CCSLIST_HDR (BackendInfo, CCSBackendInfo) +CCSLIST_HDR (IntDesc, CCSIntDesc) +CCSLIST_HDR (StrRestriction, CCSStrRestriction) +CCSLIST_HDR (StrExtension, CCSStrExtension) + +struct _CCSContext +{ + CCSPluginList plugins; /* list of plugins settings + were loaded for */ + CCSPluginCategory *categories; /* list of plugin categories */ + void *privatePtr; /* private pointer that can be used + by the caller */ + void *ccsPrivate; /* private pointer for compizconfig + internal usage */ + + CCSSettingList changedSettings; /* list of settings changed since last + settings write */ + + unsigned int *screens; /* numbers of the available screens */ + unsigned int numScreens; /* number of screens */ +}; + +struct _CCSBackendInfo +{ + char *name; /* name of the backend */ + char *shortDesc; /* backend's short description */ + char *longDesc; /* backend's long description */ + Bool integrationSupport; /* does the backend support DE integration? */ + Bool profileSupport; /* does the backend support profiles? */ +}; + +struct _CCSPlugin +{ + char *name; /* plugin name */ + char *shortDesc; /* plugin short description */ + char *longDesc; /* plugin long description */ + char *hints; /* currently unused */ + char *category; /* plugin category name */ + + CCSStringList loadAfter; /* list of plugin names this plugin needs to + be loaded after */ + CCSStringList loadBefore; /* list of plugin names this plugin needs to + be loaded before */ + CCSStringList requiresPlugin; /* list of plugin names this plugin + requires */ + CCSStringList conflictPlugin; /* list of plugin names this plugin + conflicts with */ + CCSStringList conflictFeature; /* list of feature names this plugin + conflicts with */ + CCSStringList providesFeature; /* list of feature names this plugin + provides */ + CCSStringList requiresFeature; /* list of feature names this plugin + requires */ + + void *privatePtr; /* private pointer that can be used + by the caller */ + CCSContext *context; /* context this plugin belongs to */ + + void *ccsPrivate; /* private pointer for compizconfig + internal usage */ +}; + +typedef enum _CCSSettingType +{ + /* This needs to be in the same order as CompOptionType for consistency */ + TypeBool, + TypeInt, + TypeFloat, + TypeString, + TypeColor, + TypeAction, + TypeKey, + TypeButton, + TypeEdge, + TypeBell, + TypeMatch, + TypeList, + TypeNum +} CCSSettingType; + +struct _CCSSubGroup +{ + char *name; /* sub group name in current locale */ + CCSSettingList settings; /* list of settings in this sub group */ +}; + +struct _CCSGroup +{ + char *name; /* group name in current locale */ + CCSSubGroupList subGroups; /* list of sub groups in this group */ +}; + +typedef enum _CCSPluginConflictType +{ + /* produced on plugin activation */ + ConflictRequiresPlugin, + ConflictRequiresFeature, + ConflictFeature, + ConflictPlugin, + /* produced on plugin deactivation */ + ConflictFeatureNeeded, + ConflictPluginNeeded, + ConflictPluginError, +} CCSPluginConflictType; + +struct _CCSPluginConflict +{ + char * value; /* item (plugin / feature) name that + caused the conflict */ + CCSPluginConflictType type; /* type of the conflict */ + CCSPluginList plugins; /* list of conflicting plugins */ +}; + +union _CCSSettingInfo; + +struct _CCSIntDesc +{ + int value; /* value the description is assigned to */ + char *name; /* description */ +}; + +struct _CCSStrRestriction +{ + char *value; /* value the restriction is assigned to */ + char *name; /* description */ +}; + +struct _CCSStrExtension +{ + char *basePlugin; /* plugin this extension extends */ + CCSStringList baseSettings; /* list of settings this extension extends */ + CCSStrRestrictionList restriction; /* list of added restriction items */ + + Bool isScreen; /* is this extension a screen setting extension? */ +}; + +typedef struct _CCSSettingIntInfo +{ + int min; /* minimum value for this setting */ + int max; /* maximum value */ + CCSIntDescList desc; /* list of item descriptions */ +} CCSSettingIntInfo; + +typedef struct _CCSSettingFloatInfo +{ + float min; /* minimum value for this setting */ + float max; /* maximum value */ + float precision; /* precision (allowed increment) */ +} CCSSettingFloatInfo; + +typedef struct _CCSSettingStringInfo +{ + CCSStrRestrictionList restriction; /* list of restriction items */ + int sortStartsAt; /* the restriction index to start sorting + at (defaults to -1 for no sorting) */ + Bool extensible; /* whether extension is allowed for + this setting */ +} CCSSettingStringInfo; + +typedef struct _CCSSettingListInfo +{ + CCSSettingType listType; /* type of setting this list contains */ + union _CCSSettingInfo *listInfo; /* list of settings */ +} CCSSettingListInfo; + +typedef struct _CCSSettingActionInfo +{ + Bool internal; /* is this binding global or plugin internal*/ +} CCSSettingActionInfo; + +typedef union _CCSSettingInfo +{ + CCSSettingIntInfo forInt; + CCSSettingFloatInfo forFloat; + CCSSettingStringInfo forString; + CCSSettingListInfo forList; + CCSSettingActionInfo forAction; +} CCSSettingInfo; + +typedef struct _CCSSettingColorValueColor +{ + unsigned short red; + unsigned short green; + unsigned short blue; + unsigned short alpha; +} + +CCSSettingColorValueColor; + +typedef struct _CCSSettingColorValueArray +{ + unsigned short array[4]; +} + +CCSSettingColorValueArray; + +typedef union _CCSSettingColorValue +{ + CCSSettingColorValueColor color; + CCSSettingColorValueArray array; +} CCSSettingColorValue; + + +typedef struct _CCSSettingKeyValue +{ + int keysym; + unsigned int keyModMask; +} CCSSettingKeyValue; + +typedef struct _CCSSettingButtonValue +{ + int button; + unsigned int buttonModMask; + unsigned int edgeMask; +} CCSSettingButtonValue; + +typedef union _CCSSettingValueUnion +{ + Bool asBool; + int asInt; + float asFloat; + char * asString; + char * asMatch; + CCSSettingColorValue asColor; + CCSSettingValueList asList; + CCSSettingKeyValue asKey; + CCSSettingButtonValue asButton; + unsigned int asEdge; + Bool asBell; +} CCSSettingValueUnion; + +struct _CCSSettingValue +{ + CCSSettingValueUnion value; + CCSSetting * parent; + Bool isListChild; +}; + +struct _CCSSetting +{ + char *name; /* setting name */ + char *shortDesc; /* setting short description in current locale */ + char *longDesc; /* setting long description in current locale */ + + CCSSettingType type; /* setting type */ + + Bool isScreen; /* is this setting a screen setting? */ + unsigned int screenNum; /* screen number this setting is assigned to, valid + if isScreen is TRUE */ + + CCSSettingInfo info; /* information assigned to this setting, + valid if the setting is an int, float, string + or list setting */ + + char *group; /* group name in current locale */ + char *subGroup; /* sub group name in current locale */ + char *hints; /* hints in current locale */ + + CCSSettingValue defaultValue; /* default value of this setting */ + CCSSettingValue *value; /* actual value of this setting */ + Bool isDefault; /* does the actual value match the default + value? */ + + CCSPlugin *parent; /* plugin this setting belongs to */ + void *privatePtr; /* private pointer for usage by the caller */ +}; + +struct _CCSPluginCategory +{ + const char *name; /* plugin category name */ + const char *shortDesc; /* plugin category short description */ + const char *longDesc; /* plugin category long description */ + + CCSStringList plugins; /* list of plugins in this category */ +}; + +/* set basic metadata to TRUE and no additional + metadata informations will be parsed */ +void ccsSetBasicMetadata (Bool value); + +/* Creates a new context for the screens given in screens and numScreens. + Set numScreens to 0 to initialize for all screens. + All plugin settings are automatically enumerated. */ +CCSContext* ccsContextNew (unsigned int *screens, + unsigned int numScreens); + +/* Creates a new context without auto-enumerating any plugin or setting. + Behaves otherwise exactly like ccsContextNew. */ +CCSContext* ccsEmptyContextNew (unsigned int *screens, + unsigned int numScreens); + +/* Destroys the allocated context. */ +void ccsContextDestroy (CCSContext * context); + +/* Load the plugin and setting metadata for a given plugin. + Returns TRUE on success, FALSE otherwise. */ +Bool ccsLoadPlugin (CCSContext *context, + char *name); + +/* Searches for a plugin identified by its name in the context. + Returns the plugin struct if it could be found, NULL otherwise. */ +CCSPlugin* ccsFindPlugin (CCSContext *context, + const char *name); + +/* Searches for a setting in a plugin. screenNum is only valid if isScreen is + TRUE. Returns the setting struct if the search was successful (setting with + name <name> found and isScreen and screenNum matched the values of the + setting), NULL otherwise. */ +CCSSetting* ccsFindSetting (CCSPlugin *plugin, + const char *name, + Bool isScreen, + unsigned int screenNum); + +/* Returns TRUE if the named plugin is in the context and marked as currently + active in Compiz, FALSE otherwise. */ +Bool ccsPluginIsActive (CCSContext *context, + char *name); + +void ccsFreeContext (CCSContext *context); +void ccsFreePlugin (CCSPlugin *plugin); +void ccsFreeSetting (CCSSetting *setting); +void ccsFreeGroup (CCSGroup *group); +void ccsFreeSubGroup (CCSSubGroup *subGroup); +void ccsFreeSettingValue (CCSSettingValue *value); +void ccsFreePluginConflict (CCSPluginConflict *value); +void ccsFreeBackendInfo (CCSBackendInfo *value); +void ccsFreeIntDesc (CCSIntDesc *value); +void ccsFreeStrRestriction (CCSStrRestriction *restriction); +void ccsFreeStrExtension (CCSStrExtension *extension); + +#define ccsFreeString(val) free(val) + +/* Setting setters. Set <setting> to value <data>. Return TRUE if new value + matches data. If the new value doesn't match the old value, the setting + is added to the context's changedSettings list. */ +Bool ccsSetInt (CCSSetting *setting, + int data); +Bool ccsSetFloat (CCSSetting *setting, + float data); +Bool ccsSetBool (CCSSetting *setting, + Bool data); +Bool ccsSetString (CCSSetting *setting, + const char *data); +Bool ccsSetColor (CCSSetting *setting, + CCSSettingColorValue data); +Bool ccsSetMatch (CCSSetting *setting, + const char *data); +Bool ccsSetKey (CCSSetting *setting, + CCSSettingKeyValue data); +Bool ccsSetButton (CCSSetting *setting, + CCSSettingButtonValue data); +Bool ccsSetEdge (CCSSetting *setting, + unsigned int data); +Bool ccsSetBell (CCSSetting *setting, + Bool data); +Bool ccsSetList (CCSSetting *setting, + CCSSettingValueList data); +Bool ccsSetValue (CCSSetting *setting, + CCSSettingValue *data); + +/* Compares two setting values. Returns TRUE if values match, + FALSE otherwise. */ +Bool ccsIsEqualColor (CCSSettingColorValue c1, + CCSSettingColorValue c2); +Bool ccsIsEqualKey (CCSSettingKeyValue c1, + CCSSettingKeyValue c2); +Bool ccsIsEqualButton (CCSSettingButtonValue c1, + CCSSettingButtonValue c2); + +/* Setting getters. Returns TRUE if the setting value was successfully + copied into <data>, FALSE otherwise. */ +Bool ccsGetInt (CCSSetting *setting, + int *data); +Bool ccsGetFloat (CCSSetting *setting, + float *data); +Bool ccsGetBool (CCSSetting *setting, + Bool *data); +Bool ccsGetString (CCSSetting *setting, + char **data); +Bool ccsGetColor (CCSSetting *setting, + CCSSettingColorValue *data); +Bool ccsGetMatch (CCSSetting *setting, + char **data); +Bool ccsGetKey (CCSSetting *setting, + CCSSettingKeyValue *data); +Bool ccsGetButton (CCSSetting *setting, + CCSSettingButtonValue *data); +Bool ccsGetEdge (CCSSetting *setting, + unsigned int *data); +Bool ccsGetBell (CCSSetting *setting, + Bool *data); +Bool ccsGetList (CCSSetting *setting, + CCSSettingValueList *data); + +/* Retrieves a list of settings in a plugin */ +CCSSettingList ccsGetPluginSettings (CCSPlugin *plugin); + +/* Retrieves a list of setting groups in a plugin */ +CCSGroupList ccsGetPluginGroups (CCSPlugin *plugin); + +/* Converts a string list into a list of string settings. + Return value needs to be freed by the caller. */ +CCSSettingValueList ccsGetValueListFromStringList (CCSStringList list, + CCSSetting *parent); +/* Converts a string setting value list into a string list. + Return value needs to be freed by the caller. */ +CCSStringList ccsGetStringListFromValueList (CCSSettingValueList list); + +/* Converts a string list into a string array. If the return value is not + NULL, the item count is copied into <num>. Return value needs to be freed + by the caller. */ +char** ccsGetStringArrayFromList (CCSStringList list, + int *num); +/* Converts a string array with <num> items into a string list. Return value + needs to be freed by the caller. */ +CCSStringList ccsGetListFromStringArray (char **array, + int num); + +/* Converts a setting value list into an array of the setting item data type. + Behaves similar to ccsGetStringArrayFromList. */ +char** ccsGetStringArrayFromValueList (CCSSettingValueList list, + int *num); +char** ccsGetMatchArrayFromValueList (CCSSettingValueList list, + int *num); + +int* ccsGetIntArrayFromValueList (CCSSettingValueList list, + int *num); +float* ccsGetFloatArrayFromValueList (CCSSettingValueList list, + int *num); +Bool * ccsGetBoolArrayFromValueList (CCSSettingValueList list, + int *num); +CCSSettingColorValue* ccsGetColorArrayFromValueList (CCSSettingValueList list, + int *num); + +/* Converts an array of data items to a setting value list. Behaves similar + to ccsGetListFromStringArray */ +CCSSettingValueList ccsGetValueListFromStringArray (char **array, + int num, + CCSSetting *parent); +CCSSettingValueList ccsGetValueListFromMatchArray (char **array, + int num, + CCSSetting *parent); +CCSSettingValueList ccsGetValueListFromIntArray (int *array, + int num, + CCSSetting *parent); +CCSSettingValueList ccsGetValueListFromFloatArray (float *array, + int num, + CCSSetting *parent); +CCSSettingValueList ccsGetValueListFromBoolArray (Bool *array, + int num, + CCSSetting *parent); +CCSSettingValueList ccsGetValueListFromColorArray (CCSSettingColorValue *array, + int num, + CCSSetting *parent); + +/* Retrieves a list of plugins marked as active in Compiz for this context */ +CCSPluginList ccsGetActivePluginList (CCSContext *context); + +/* Retrieves a list of plugin names which are active in Compiz for a given + context, sorted as needed according to load after/before/etc. rules */ +CCSStringList ccsGetSortedPluginStringList (CCSContext *context); + +/* Switches the backend for a context. Returns TRUE on successful switch, + FALSE otherwise. */ +Bool ccsSetBackend (CCSContext *context, + char *name); +/* Retrieves the name of the backend active for the context. */ +char * ccsGetBackend (CCSContext *context); + +/* Enable/disable DE integration for a context. */ +void ccsSetIntegrationEnabled (CCSContext *context, + Bool value); + +/* Sets the profile for a context. */ +void ccsSetProfile (CCSContext *context, + char *name); + +/* Set plugin list autosort for a context. */ +void ccsSetPluginListAutoSort (CCSContext *context, + Bool value); + +/* Retrieve current profile of the context. */ +char * ccsGetProfile (CCSContext *context); + +/* Retrieves current DE integration status for a context */ +Bool ccsGetIntegrationEnabled (CCSContext *context); + +/* Retrieves the autosort setting for a context. */ +Bool ccsGetPluginListAutoSort (CCSContext *context); + +/* Changes the plugin activeness status in compiz. If plugin list autosort + is enabled, automatically writes a new sorted plugin list to the + active_plugins setting. If autosort is disabled, it's up to the caller + to do that. */ +Bool ccsPluginSetActive (CCSPlugin *plugin, + Bool value); + +/* functions parsing/creating an action string - + the returned strings must be free'd after usage! */ + +char * ccsModifiersToString (unsigned int modMask); + +char * ccsEdgesToString (unsigned int edge); + +char * ccsEdgesToModString (unsigned int edge); + +char * ccsKeyBindingToString (CCSSettingKeyValue *key); + +char * ccsButtonBindingToString (CCSSettingButtonValue *button); + +char * ccsColorToString (CCSSettingColorValue *color); + +unsigned int ccsStringToModifiers (const char *binding); + +unsigned int ccsStringToEdges (const char *edge); + +unsigned int ccsModStringToEdges (const char *edge); + +Bool ccsStringToKeyBinding (const char *binding, + CCSSettingKeyValue *key); + +Bool ccsStringToButtonBinding (const char *binding, + CCSSettingButtonValue *button); + +Bool ccsStringToColor (const char *value, + CCSSettingColorValue *color); + +/* flag values for ccsProcessEvents */ +#define ProcessEventsNoGlibMainLoopMask (1 << 0) + +void ccsProcessEvents (CCSContext *context, + unsigned int flags); + +/* Read all setting values from disk */ +void ccsReadSettings (CCSContext *context); + +/* Read setting values for a given plugin */ +void ccsReadPluginSettings (CCSPlugin *plugin); + +/* Write all settings to disk */ +void ccsWriteSettings (CCSContext *context); + +/* Write changed settings to disk */ +void ccsWriteChangedSettings (CCSContext *context); + +/* Reset all settings to defaults. Settings that were non-default + previously are added to the changedSettings list of the context. */ +void ccsResetToDefault (CCSSetting * setting); + +/* Exports a profile to a file. If skipDefaults is TRUE, only exports + non-default settings. Returns TRUE on successful export, FALSE otherwise. */ +Bool ccsExportToFile (CCSContext *context, + const char *fileName, + Bool skipDefaults); + +/* Imports a profile from a file. If overwriteNonDefault is TRUE, also + overwrites settings that were non-default before. Returns TRUE on success, + FALSE otherwise. */ +Bool ccsImportFromFile (CCSContext *context, + const char *fileName, + Bool overwriteNonDefault); + +/* File watch stuff */ + +typedef void (*FileWatchCallbackProc) (unsigned int watchId, void *closure); + +unsigned int ccsAddFileWatch (const char *fileName, + Bool enable, + FileWatchCallbackProc callback, + void *closure); + +void ccsRemoveFileWatch (unsigned int watchId); +void ccsDisableFileWatch (unsigned int watchId); +void ccsEnableFileWatch (unsigned int watchId); + +/* INI file stuff */ + +typedef struct _dictionary_ +{ + /** Number of entries in dictionary */ + int n; + /** Storage size */ + int size; + /** List of string values */ + char **val; + /** List of string keys */ + char **key ; + /** List of hash values for keys */ + unsigned *hash; +} IniDictionary; + +IniDictionary* ccsIniNew (void); +IniDictionary* ccsIniOpen (const char *fileName); +void ccsIniClose (IniDictionary *dictionary); +void ccsIniSave (IniDictionary *dictionary, + const char *fileName); + +Bool ccsCreateDirFor (const char *fileName); + +Bool ccsIniGetString (IniDictionary *dictionary, + const char *section, + const char *entry, + char **value); +Bool ccsIniGetInt (IniDictionary *dictionary, + const char *section, + const char *entry, + int *value); +Bool ccsIniGetFloat (IniDictionary *dictionary, + const char *section, + const char *entry, + float *value); +Bool ccsIniGetBool (IniDictionary *dictionary, + const char *section, + const char *entry, + Bool *value); +Bool ccsIniGetColor (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingColorValue *value); +Bool ccsIniGetKey (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingKeyValue *value); +Bool ccsIniGetButton (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingButtonValue *value); +Bool ccsIniGetEdge (IniDictionary *dictionary, + const char *section, + const char *entry, + unsigned int *value); +Bool ccsIniGetBell (IniDictionary *dictionary, + const char *section, + const char *entry, + Bool *value); +Bool ccsIniGetList (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingValueList *value, + CCSSetting *parent); + +void ccsIniSetString (IniDictionary *dictionary, + const char *section, + const char *entry, + char *value); +void ccsIniSetInt (IniDictionary *dictionary, + const char *section, + const char *entry, + int value); +void ccsIniSetFloat (IniDictionary *dictionary, + const char *section, + const char *entry, + float value); +void ccsIniSetBool (IniDictionary *dictionary, + const char *section, + const char *entry, + Bool value); +void ccsIniSetColor (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingColorValue value); +void ccsIniSetKey (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingKeyValue value); +void ccsIniSetButton (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingButtonValue value); +void ccsIniSetEdge (IniDictionary *dictionary, + const char *section, + const char *entry, + unsigned int value); +void ccsIniSetBell (IniDictionary *dictionary, + const char *section, + const char *entry, + Bool value); +void ccsIniSetList (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingValueList value, + CCSSettingType listType); + +void ccsIniRemoveEntry (IniDictionary *dictionary, + const char *section, + const char *entry); + +/* Checks if a plugin can be enabled. Returns a list of conflicts that + would occur when loading the plugin. A return value of NULL means that + the plugin can be enabled without problems. */ +CCSPluginConflictList ccsCanEnablePlugin (CCSContext *context, + CCSPlugin *plugin); + +/* Checks if a plugin can be disabled. The meaning of the return value is the + same as for ccsCanEnablePlugin */ +CCSPluginConflictList ccsCanDisablePlugin (CCSContext *context, + CCSPlugin *plugin); + +/* Enumerates the available profiles for the current backend. */ +CCSStringList ccsGetExistingProfiles (CCSContext * context); + +/* Deletes the profile with the given name. */ +void ccsDeleteProfile (CCSContext *context, + char *name); + +/* Enumerates the available backends. */ +CCSBackendInfoList ccsGetExistingBackends (void); + +/* Checks if a given setting is integrated in the desktop environment. */ +Bool ccsSettingIsIntegrated (CCSSetting *setting); + +/* Checks if a given setting is read-only. */ +Bool ccsSettingIsReadOnly (CCSSetting *setting); + +CCSStrExtensionList ccsGetPluginStrExtensions (CCSPlugin *plugin); + +#endif diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/libcompizconfig.pc.in b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/libcompizconfig.pc.in new file mode 100644 index 00000000..ffa82ae3 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/libcompizconfig.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libcompizconfig +Description: Compiz configuration system +Version: @VERSION@ + +Requires: compiz +Libs: -L@libdir@ -lcompizconfig +Cflags: -I@includedir@/compizconfig + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/metadata/Makefile.am b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/metadata/Makefile.am new file mode 100644 index 00000000..a7f5e343 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/metadata/Makefile.am @@ -0,0 +1,5 @@ +metadir = $(datadir)/compiz +meta_DATA = ccp.xml + +EXTRA_DIST = \ + ccp.xml diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/metadata/ccp.xml b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/metadata/ccp.xml new file mode 100644 index 00000000..f0da4561 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/metadata/ccp.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<compiz> + <plugin name="ccp"> + <short>CCP</short> + <long>Compizconfig Settings Plugins</long> + </plugin> +</compiz> diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/plugin/Makefile.am b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/plugin/Makefile.am new file mode 100644 index 00000000..c99cf68f --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/plugin/Makefile.am @@ -0,0 +1,15 @@ +INCLUDES = \ + @COMPIZ_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -DPLUGINDIR=\"$(plugindir)\" \ + -DLIBDIR=\"$(libdir)\" + +libccp_la_LDFLAGS = -module -avoid-version -no-undefined +libccp_la_LIBADD = $(top_builddir)/src/libcompizconfig.la +libccp_la_SOURCES = ccp.c + +moduledir = $(plugindir) + +module_LTLIBRARIES = libccp.la + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/plugin/ccp.c b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/plugin/ccp.c new file mode 100644 index 00000000..8088b181 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/plugin/ccp.c @@ -0,0 +1,844 @@ +/* + * Compiz configuration system library plugin + * + * Copyright (C) 2007 Dennis Kasprzyk <onestone@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define _GNU_SOURCE + +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif + +#include <string.h> +#include <stdio.h> +#include <stdlib.h> +#include <ctype.h> + +#include <compiz-core.h> + +#include <ccs.h> + +static int corePrivateIndex; +static CompMetadata ccpMetadata; + +typedef struct _CCPCore +{ + CCSContext *context; + Bool applyingSettings; + + CompTimeoutHandle timeoutHandle; + CompTimeoutHandle reloadHandle; + + InitPluginForObjectProc initPluginForObject; + SetOptionForPluginProc setOptionForPlugin; +} +CCPCore; + +#define GET_CCP_CORE(c) \ + ((CCPCore *) (c)->base.privates[corePrivateIndex].ptr) + +#define CCP_CORE(c) \ + CCPCore *cc = GET_CCP_CORE (c) + +#define CCP_UPDATE_MIN_TIMEOUT 250 +#define CCP_UPDATE_MAX_TIMEOUT 4000 +#define CORE_VTABLE_NAME "core" + +static void +ccpSetValueToValue (CompObject *object, + CCSSettingValue *sv, + CompOptionValue *v, + CCSSettingType type) +{ + switch (type) + { + case TypeInt: + v->i = sv->value.asInt; + break; + case TypeFloat: + v->f = sv->value.asFloat; + break; + case TypeBool: + v->b = sv->value.asBool; + break; + case TypeColor: + { + int i; + + for (i = 0; i < 4; i++) + v->c[i] = sv->value.asColor.array.array[i]; + } + break; + case TypeString: + v->s = strdup (sv->value.asString); + break; + case TypeMatch: + matchInit (&v->match); + matchAddFromString (&v->match, sv->value.asMatch); + break; + case TypeKey: + { + CompDisplay *d; + + while (object && object->type != COMP_OBJECT_TYPE_DISPLAY) + object = object->parent; + + if (!object) + return; + + d = GET_CORE_DISPLAY (object); + + v->action.key.keycode = + (sv->value.asKey.keysym != NoSymbol) ? + XKeysymToKeycode (d->display, sv->value.asKey.keysym) : 0; + + v->action.key.modifiers = sv->value.asKey.keyModMask; + + if (v->action.key.keycode || v->action.key.modifiers) + v->action.type = CompBindingTypeKey; + else + v->action.type = CompBindingTypeNone; + } + break; + case TypeButton: + { + v->action.button.button = sv->value.asButton.button; + v->action.button.modifiers = sv->value.asButton.buttonModMask; + v->action.edgeMask = sv->value.asButton.edgeMask; + + if (v->action.button.button || v->action.button.modifiers) + { + if (sv->value.asButton.edgeMask) + v->action.type = CompBindingTypeEdgeButton; + else + v->action.type = CompBindingTypeButton; + } + else + v->action.type = CompBindingTypeNone; + } + break; + case TypeEdge: + { + v->action.edgeMask = sv->value.asEdge; + } + break; + case TypeBell: + { + v->action.bell = sv->value.asBell; + } + break; + default: + break; + } +} + +static CompOptionType +ccpCCSTypeToCompizType (CCSSettingType st, CompOptionType *ct) +{ + switch (st) { + case TypeBool: + *ct = CompOptionTypeBool; + break; + case TypeInt: + *ct = CompOptionTypeInt; + break; + case TypeFloat: + *ct = CompOptionTypeFloat; + break; + case TypeColor: + *ct = CompOptionTypeColor; + break; + case TypeString: + *ct = CompOptionTypeString; + break; + case TypeMatch: + *ct = CompOptionTypeMatch; + break; + case TypeKey: + *ct = CompOptionTypeKey; + break; + case TypeButton: + *ct = CompOptionTypeButton; + break; + case TypeEdge: + *ct = CompOptionTypeEdge; + break; + case TypeBell: + *ct = CompOptionTypeBell; + break; + case TypeList: + *ct = CompOptionTypeList; + break; + default: + return FALSE; + } + + return TRUE; +} + +static void +ccpConvertPluginList (CCSSetting *s, + CCSSettingValueList list, + CompOptionValue *v) +{ + CCSStringList sl, l; + int i; + + sl = ccsGetStringListFromValueList (list); + + while (ccsStringListFind(sl,"ccp")) + sl = ccsStringListRemove (sl, "ccp", TRUE); + + while (ccsStringListFind(sl,"core")) + sl = ccsStringListRemove (sl, "core", TRUE); + + sl = ccsStringListPrepend (sl, strdup ("ccp")); + sl = ccsStringListPrepend (sl, strdup ("core")); + + v->list.nValue = ccsStringListLength (sl); + v->list.value = calloc (v->list.nValue, sizeof (CompOptionValue)); + if (!v->list.value) + { + v->list.nValue = 0; + return; + } + + for (l = sl, i = 0; l; l = l->next) + { + if (l->data) + v->list.value[i].s = strdup (l->data); + i++; + } + + ccsStringListFree (sl, TRUE); +} + +static void +ccpSettingToValue (CompObject *object, + CCSSetting *s, + CompOptionValue *v) +{ + if (s->type != TypeList) + ccpSetValueToValue (object, s->value, v, s->type); + else + { + CCSSettingValueList list; + int i = 0; + + ccsGetList (s, &list); + + if (!ccpCCSTypeToCompizType (s->info.forList.listType, &v->list.type)) + v->list.type = CompOptionTypeBool; + + if ((strcmp (s->name, "active_plugins") == 0) && + (strcmp (s->parent->name, CORE_VTABLE_NAME) == 0)) + { + ccpConvertPluginList (s, list, v); + } + else + { + v->list.nValue = ccsSettingValueListLength (list); + v->list.value = calloc (v->list.nValue, sizeof (CompOptionValue)); + + while (list) + { + ccpSetValueToValue (object, list->data, + &v->list.value[i], + s->info.forList.listType); + list = list->next; + i++; + } + } + } +} + +static void +ccpInitValue (CompObject *object, + CCSSettingValue *value, + CompOptionValue *from, + CCSSettingType type) +{ + switch (type) + { + case TypeInt: + value->value.asInt = from->i; + break; + case TypeFloat: + value->value.asFloat = from->f; + break; + case TypeBool: + value->value.asBool = from->b; + break; + case TypeColor: + { + int i; + + for (i = 0; i < 4; i++) + value->value.asColor.array.array[i] = from->c[i]; + } + break; + case TypeString: + value->value.asString = strdup (from->s); + break; + case TypeMatch: + value->value.asMatch = matchToString (&from->match); + break; + case TypeKey: + if (from->action.type & CompBindingTypeKey) + { + CompDisplay *d; + + while (object && object->type != COMP_OBJECT_TYPE_DISPLAY) + object = object->parent; + + if (!object) + return; + + d = GET_CORE_DISPLAY (object); + + value->value.asKey.keysym = + XKeycodeToKeysym (d->display, from->action.key.keycode, 0); + value->value.asKey.keyModMask = from->action.key.modifiers; + } + else + { + value->value.asKey.keysym = 0; + value->value.asKey.keyModMask = 0; + } + case TypeButton: + if (from->action.type & CompBindingTypeButton) + { + value->value.asButton.button = from->action.button.button; + value->value.asButton.buttonModMask = + from->action.button.modifiers; + value->value.asButton.edgeMask = 0; + } + else if (from->action.type & CompBindingTypeEdgeButton) + { + value->value.asButton.button = from->action.button.button; + value->value.asButton.buttonModMask = + from->action.button.modifiers; + value->value.asButton.edgeMask = from->action.edgeMask; + } + else + { + value->value.asButton.button = 0; + value->value.asButton.buttonModMask = 0; + value->value.asButton.edgeMask = 0; + } + break; + case TypeEdge: + value->value.asEdge = from->action.edgeMask; + break; + case TypeBell: + value->value.asBell = from->action.bell; + break; + default: + break; + } +} + +static void +ccpValueToSetting (CompObject *object, + CCSSetting *s, + CompOptionValue *v) +{ + CCSSettingValue *value; + + value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + return; + + value->parent = s; + + if (s->type == TypeList) + { + int i; + + for (i = 0; i < v->list.nValue; i++) + { + CCSSettingValue *val; + + val = calloc (1, sizeof (CCSSettingValue)); + if (val) + { + val->parent = s; + val->isListChild = TRUE; + ccpInitValue (object, val, &v->list.value[i], + s->info.forList.listType); + value->value.asList = + ccsSettingValueListAppend (value->value.asList, val); + } + } + } + else + ccpInitValue (object, value, v, s->type); + + ccsSetValue (s, value); + ccsFreeSettingValue (value); +} + +static Bool +ccpTypeCheck (CCSSetting *s, CompOption *o) +{ + CompOptionType ot; + + switch (s->type) + { + case TypeList: + return ccpCCSTypeToCompizType (s->type, &ot) && (ot == o->type) && + ccpCCSTypeToCompizType (s->info.forList.listType, &ot) && + (ot == o->value.list.type); + break; + default: + return ccpCCSTypeToCompizType (s->type, &ot) && (ot == o->type); + break; + } + + return FALSE; +} + +static void +ccpSetOptionFromContext (CompObject *object, + CompOption *o, + const char *plugin) +{ + CCP_CORE (&core); + + CCSPlugin *bsp; + CCSSetting *setting; + CompOptionValue value; + + Bool screen = (object->type == COMP_OBJECT_TYPE_SCREEN); + int screenNum = 0; + + /* we currently only support screen and display opton types */ + if (object->type != COMP_OBJECT_TYPE_SCREEN && + object->type != COMP_OBJECT_TYPE_DISPLAY) + return; + + if (screen) + { + char *name = compObjectName (object); + if (name) + { + screenNum = atoi (name); + free (name); + } + } + + bsp = ccsFindPlugin (cc->context, (plugin) ? plugin : CORE_VTABLE_NAME); + if (!bsp) + return; + + setting = ccsFindSetting (bsp, o->name, screen, screenNum); + if (!setting) + return; + + if (!ccpTypeCheck (setting, o)) + return; + + compInitOptionValue (&value); + ccpSettingToValue (object, setting, &value); + + cc->applyingSettings = TRUE; + (*core.setOptionForPlugin) (object, plugin, o->name, &value); + cc->applyingSettings = FALSE; + + compFiniOptionValue (&value, o->type); +} + +static void +ccpSetContextFromOption (CompObject *object, + CompOption *o, + const char *plugin) +{ + CCP_CORE (&core); + + CCSPlugin *bsp; + CCSSetting *setting; + + Bool screen = (object->type == COMP_OBJECT_TYPE_SCREEN); + int screenNum = 0; + + /* we currently only support screen and display opton types */ + if (object->type != COMP_OBJECT_TYPE_SCREEN && + object->type != COMP_OBJECT_TYPE_DISPLAY) + return; + + if (screen) + { + char *name = compObjectName (object); + if (name) + { + screenNum = atoi (name); + free (name); + } + } + + bsp = ccsFindPlugin (cc->context, (plugin) ? plugin : CORE_VTABLE_NAME); + if (!bsp) + return; + + setting = ccsFindSetting (bsp, o->name, screen, screenNum); + if (!setting) + return; + + if (!ccpTypeCheck (setting, o)) + return; + + ccpValueToSetting (object, setting, &o->value); + ccsWriteChangedSettings (cc->context); +} + + +static CompBool +ccpReloadObjectTree (CompObject *object, + void *closure); + +static CompBool +ccpReloadObjectsWithType (CompObjectType type, + CompObject *parent, + void *closure) +{ + compObjectForEach (parent, type, ccpReloadObjectTree, closure); + + return TRUE; +} + +static CompBool +ccpReloadObjectTree (CompObject *object, + void *closure) +{ + CompPlugin *p = (CompPlugin *) closure; + CompOption *option; + int nOption; + + option = (*p->vTable->getObjectOptions) (p, object, &nOption); + while (nOption--) + ccpSetOptionFromContext (object, option++, p->vTable->name); + + compObjectForEachType (object, ccpReloadObjectsWithType, closure); + + return TRUE; +} + +static Bool +ccpReload (void *closure) +{ + CompPlugin *p; + + CCP_CORE (&core); + + for (p = getPlugins (); p; p = p->next) + { + if (!p->vTable->getObjectOptions) + continue; + + ccpReloadObjectTree (&core.base, (void *) p); + } + cc->reloadHandle = 0; + + return FALSE; +} + +static Bool +ccpTimeout (void *closure) +{ + unsigned int flags = 0; + + CCP_CORE (&core); + + if (findActivePlugin ("glib")) + flags |= ProcessEventsNoGlibMainLoopMask; + + ccsProcessEvents (cc->context, flags); + + if (ccsSettingListLength (cc->context->changedSettings)) + { + CCSSettingList list = cc->context->changedSettings; + CCSSettingList l = list; + CCSSetting *s; + CompObject *object; + CompPlugin *p; + CompOption *option; + int nOption; + + char tmp[256]; + + cc->context->changedSettings = NULL; + + while (l) + { + s = l->data; + l = l->next; + + if (s->isScreen) + { + snprintf (tmp, 256, "%d", s->screenNum); + object = compObjectFind (&core.base, COMP_OBJECT_TYPE_DISPLAY, + NULL); + object = compObjectFind (object, COMP_OBJECT_TYPE_SCREEN, + tmp); + } + else + { + object = compObjectFind (&core.base, COMP_OBJECT_TYPE_DISPLAY, + NULL); + } + + if (!object) + continue; + + p = findActivePlugin (s->parent->name); + + if (!p) + continue; + + option = (*p->vTable->getObjectOptions) (p, object, &nOption); + option = compFindOption (option, nOption, s->name, 0); + if (option) + ccpSetOptionFromContext (object, option, s->parent->name); + D (D_FULL, "Setting Update \"%s\"\n", s->name); + } + + ccsSettingListFree (list, FALSE); + cc->context->changedSettings = + ccsSettingListFree (cc->context->changedSettings, FALSE); + } + + return TRUE; +} + +static CompBool +ccpSetOptionForPlugin (CompObject *object, + const char *plugin, + const char *name, + CompOptionValue *value) +{ + CompBool status; + + CCP_CORE (&core); + + UNWRAP (cc, &core, setOptionForPlugin); + status = (*core.setOptionForPlugin) (object, plugin, name, value); + WRAP (cc, &core, setOptionForPlugin, ccpSetOptionForPlugin); + + if (status && !cc->applyingSettings && !cc->reloadHandle) + { + CompPlugin *p; + + p = findActivePlugin (plugin); + if (p && p->vTable->getObjectOptions) + { + CompOption *option; + int nOption; + + option = (*p->vTable->getObjectOptions) (p, object, &nOption); + option = compFindOption (option, nOption, name, 0); + if (option) + ccpSetContextFromOption (object, option, p->vTable->name); + } + } + + return status; +} + +static CompBool +ccpInitPluginForObject (CompPlugin *p, + CompObject *o) +{ + CompBool status; + + CCP_CORE (&core); + + UNWRAP (cc, &core, initPluginForObject); + status = (*core.initPluginForObject) (p, o); + WRAP (cc, &core, initPluginForObject, ccpInitPluginForObject); + + if (status && p->vTable->getObjectOptions) + { + CompOption *option; + int nOption; + + option = (*p->vTable->getObjectOptions) (p, o, &nOption); + while (nOption--) + ccpSetOptionFromContext (o, option++, p->vTable->name); + } + + return status; +} + +static Bool +ccpInitCore (CompPlugin *p, + CompCore *c) +{ + CCPCore *cc; + CompObject *o; + + int i; + unsigned int *screens; + + if (!checkPluginABI ("core", CORE_ABIVERSION)) + return FALSE; + + cc = malloc (sizeof (CCPCore)); + if (!cc) + return FALSE; + + ccsSetBasicMetadata (TRUE); + + o = compObjectFind (&core.base, COMP_OBJECT_TYPE_DISPLAY, NULL); + + if (o) + { + CompScreen *s; + CORE_DISPLAY (o); + + for (s = d->screens, i = 0; s; s = s->next, i++); + + screens = calloc (i, sizeof (unsigned int)); + if (!screens) + { + free (cc); + return FALSE; + } + + for (s = d->screens, i = 0; s; s = s->next) + screens[i++] = s->screenNum; + + cc->context = ccsContextNew (screens, i); + + free (screens); + } + else + cc->context = ccsContextNew (NULL, 0); + + if (!cc->context) + { + free (cc); + return FALSE; + } + + ccsReadSettings (cc->context); + + cc->context->changedSettings = + ccsSettingListFree (cc->context->changedSettings, FALSE); + + cc->applyingSettings = FALSE; + + cc->reloadHandle = compAddTimeout (0, 0, ccpReload, 0); + cc->timeoutHandle = compAddTimeout (CCP_UPDATE_MIN_TIMEOUT, + CCP_UPDATE_MAX_TIMEOUT, + ccpTimeout, 0); + + core.base.privates[corePrivateIndex].ptr = cc; + + WRAP (cc, c, initPluginForObject, ccpInitPluginForObject); + WRAP (cc, c, setOptionForPlugin, ccpSetOptionForPlugin); + + return TRUE; +} + +static void +ccpFiniCore (CompPlugin *p, + CompCore *c) +{ + CCP_CORE (&core); + + UNWRAP (cc, c, initPluginForObject); + UNWRAP (cc, c, setOptionForPlugin); + + compRemoveTimeout (cc->timeoutHandle); + + ccsContextDestroy (cc->context); + + free (cc); +} + +static CompBool +ccpInitObject (CompPlugin *p, + CompObject *o) +{ + static InitPluginObjectProc dispTab[] = { + (InitPluginObjectProc) ccpInitCore, + }; + + RETURN_DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), TRUE, (p, o)); +} + +static void +ccpFiniObject (CompPlugin *p, + CompObject *o) +{ + static FiniPluginObjectProc dispTab[] = { + (FiniPluginObjectProc) ccpFiniCore, + }; + + DISPATCH (o, dispTab, ARRAY_SIZE (dispTab), (p, o)); +} + + +static Bool +ccpInit (CompPlugin *p) +{ + if (!compInitPluginMetadataFromInfo (&ccpMetadata, p->vTable->name, + 0, 0, 0, 0)) + return FALSE; + + corePrivateIndex = allocateCorePrivateIndex (); + if (corePrivateIndex < 0) + { + compFiniMetadata (&ccpMetadata); + return FALSE; + } + + compAddMetadataFromFile (&ccpMetadata, p->vTable->name); + + return TRUE; +} + +static void +ccpFini (CompPlugin *p) +{ + freeCorePrivateIndex (corePrivateIndex); + compFiniMetadata (&ccpMetadata); +} + +static CompMetadata* +ccpGetMetadata (CompPlugin *plugin) +{ + return &ccpMetadata; +} + +CompPluginVTable ccpVTable = { + "ccp", + ccpGetMetadata, + ccpInit, + ccpFini, + ccpInitObject, + ccpFiniObject, + 0, + 0 +}; + +CompPluginVTable * +getCompPluginInfo20070830 (void) +{ + return &ccpVTable; +} diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/po/ChangeLog b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/po/ChangeLog new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/po/ChangeLog diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/po/POTFILES.in b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/po/POTFILES.in new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/po/POTFILES.in @@ -0,0 +1,2 @@ + + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/Makefile.am b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/Makefile.am new file mode 100644 index 00000000..788bda20 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/Makefile.am @@ -0,0 +1,52 @@ +if USE_PROTOBUF + +PROTOBUF_LIB = -lprotobuf +PROTOBUF_DEFINES = \ + -DUSE_PROTOBUF=1 + +compizconfig.pb.cc: compizconfig.proto + protoc --cpp_out=. compizconfig.proto + +compizconfig.pb.h: compizconfig.pb.cc + +compiz.cpp: compizconfig.pb.h Makefile + +nodist_libcompizconfig_la_SOURCES = \ + compizconfig.pb.cc + +clean-local: + rm -f compizconfig.pb.cc compizconfig.pb.h + +endif + +EXTRA_DIST = compizconfig.proto + +INCLUDES = \ + @COMPIZ_CFLAGS@ \ + @LIBX11_CFLAGS@ \ + @LIBXML2_CFLAGS@ \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/src \ + -DPLUGINDIR=\"$(PLUGINDIR)\" \ + -DMETADATADIR=\"$(METADATADIR)\" \ + -DLIBDIR=\"$(libdir)\" \ + $(PROTOBUF_DEFINES) \ + -DSYSCONFDIR=\"$(sysconfdir)\" + + +libcompizconfig_la_SOURCES = \ + main.c \ + lists.c \ + compiz.cpp \ + config.c \ + iniparser.c \ + ini.c \ + bindings.c \ + filewatch.c \ + ccs-private.h \ + iniparser.h + +libcompizconfig_la_LIBADD = @LIBXML2_LIBS@ @LIBX11_LIBS@ $(PROTOBUF_LIB) + +lib_LTLIBRARIES=libcompizconfig.la + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/bindings.c b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/bindings.c new file mode 100644 index 00000000..84826684 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/bindings.c @@ -0,0 +1,423 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Danny Baumann <maniac@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/* + * Based on Compiz option.c + * Copyright © 2005 Novell, Inc. + * Author: David Reveman <davidr@novell.com> + */ + + +#define _GNU_SOURCE + +#include <stdlib.h> +#include <string.h> +#include <strings.h> +#include <stdio.h> +#include <ctype.h> +#include <math.h> + +#include <X11/X.h> +#include <X11/Xlib.h> + +#include <ccs.h> + +#define CompAltMask (1 << 16) +#define CompMetaMask (1 << 17) +#define CompSuperMask (1 << 18) +#define CompHyperMask (1 << 19) +#define CompModeSwitchMask (1 << 20) +#define CompNumLockMask (1 << 21) +#define CompScrollLockMask (1 << 22) + +#define SCREEN_EDGE_LEFT (1 << 0) +#define SCREEN_EDGE_RIGHT (1 << 1) +#define SCREEN_EDGE_TOP (1 << 2) +#define SCREEN_EDGE_BOTTOM (1 << 3) +#define SCREEN_EDGE_TOPLEFT (1 << 4) +#define SCREEN_EDGE_TOPRIGHT (1 << 5) +#define SCREEN_EDGE_BOTTOMLEFT (1 << 6) +#define SCREEN_EDGE_BOTTOMRIGHT (1 << 7) + +struct _Modifier +{ + char *name; + int modifier; +} + +modifierList[] = { + { "<Shift>", ShiftMask }, + { "<Control>", ControlMask }, + { "<Mod1>", Mod1Mask }, + { "<Mod2>", Mod2Mask }, + { "<Mod3>", Mod3Mask }, + { "<Mod4>", Mod4Mask }, + { "<Mod5>", Mod5Mask }, + { "<Alt>", CompAltMask }, + { "<Meta>", CompMetaMask }, + { "<Super>", CompSuperMask }, + { "<Hyper>", CompHyperMask }, + { "<ModeSwitch>", CompModeSwitchMask }, +}; + +#define N_MODIFIERS (sizeof (modifierList) / sizeof (struct _Modifier)) + +struct _Edge { + char *name; + char *modName; + int modifier; +} + +edgeList[] = { + { "Left", "<LeftEdge>", SCREEN_EDGE_LEFT }, + { "Right", "<RightEdge>", SCREEN_EDGE_RIGHT }, + { "Top", "<TopEdge>", SCREEN_EDGE_TOP }, + { "Bottom", "<BottomEdge>", SCREEN_EDGE_BOTTOM }, + { "TopLeft", "<TopLeftEdge>", SCREEN_EDGE_TOPLEFT }, + { "TopRight", "<TopRightEdge>", SCREEN_EDGE_TOPRIGHT }, + { "BottomLeft", "<BottomLeftEdge>", SCREEN_EDGE_BOTTOMLEFT }, + { "BottomRight", "<BottomRightEdge>", SCREEN_EDGE_BOTTOMRIGHT } +}; + +#define N_EDGES (sizeof (edgeList) / sizeof (edgeList[0])) + +static char * +stringAppend (char *s, + char *a) +{ + char *r; + int len; + + if (!a) + return s; + + len = strlen (a); + + if (s) + len += strlen (s); + + r = malloc (len + 1); + + if (r) + { + if (s) + { + sprintf (r, "%s%s", s, a); + free (s); + } + else + { + sprintf (r, "%s", a); + } + + s = r; + } + + return s; +} + +char * +ccsModifiersToString (unsigned int modMask) +{ + char *binding = NULL; + int i; + + for (i = 0; i < N_MODIFIERS; i++) + { + if (modMask & modifierList[i].modifier) + binding = stringAppend (binding, modifierList[i].name); + } + + return binding; +} + +char * +ccsEdgesToModString (unsigned int edgeMask) +{ + char *binding = NULL; + int i; + + for (i = 0; i < N_EDGES; i++) + { + if (edgeMask & edgeList[i].modifier) + binding = stringAppend (binding, edgeList[i].modName); + } + + return binding; +} + +char * +ccsEdgesToString (unsigned int edgeMask) +{ + char *binding = NULL; + int i; + + for (i = 0; i < N_EDGES; i++) + { + if (edgeMask & edgeList[i].modifier) + { + if (binding) + binding = stringAppend (binding, "|"); + binding = stringAppend (binding, edgeList[i].name); + } + } + + if (!binding) + return strdup (""); + + return binding; +} + +char * +ccsKeyBindingToString (CCSSettingKeyValue *key) +{ + char *binding; + + binding = ccsModifiersToString (key->keyModMask); + + if (key->keysym != NoSymbol) + { + char *keyname; + + keyname = XKeysymToString (key->keysym); + if (keyname) + { + binding = stringAppend (binding, keyname); + } + } + + if (!binding) + return strdup ("Disabled"); + return binding; +} + +char * +ccsButtonBindingToString (CCSSettingButtonValue *button) +{ + char *binding; + char *edges; + char buttonStr[256]; + + edges = ccsEdgesToModString (button->edgeMask); + binding = stringAppend (edges, ccsModifiersToString (button->buttonModMask)); + + if (button->button) + { + snprintf (buttonStr, 256, "Button%d", button->button); + binding = stringAppend (binding, buttonStr); + } + + if (!binding) + return strdup ("Disabled"); + return binding; +} + +unsigned int +ccsStringToModifiers (const char *binding) +{ + unsigned int mods = 0; + int i; + + for (i = 0; i < N_MODIFIERS; i++) + { + if (strcasestr (binding, modifierList[i].name)) + mods |= modifierList[i].modifier; + } + + return mods; +} + +unsigned int +ccsStringToEdges (const char *binding) +{ + unsigned int edgeMask = 0; + const char *needle; + int i; + + for (i = 0; i < N_EDGES; i++) + { + int edgeLen = strlen (edgeList[i].name); + + /* Look for all occurrences of edgeList[i].name in binding */ + needle = binding; + while ((needle = strstr (needle, edgeList[i].name)) != NULL) + { + if (needle != binding && isalnum (*(needle - 1))) + { + needle += edgeLen; + continue; + } + + needle += edgeLen; + + if (*needle && isalnum (*needle)) + continue; + + edgeMask |= 1 << i; + } + } + + return edgeMask; + +} + +unsigned int +ccsModStringToEdges (const char *binding) +{ + unsigned int mods = 0; + int i; + + for (i = 0; i < N_EDGES; i++) + { + if (strcasestr (binding, edgeList[i].modName)) + mods |= edgeList[i].modifier; + } + + return mods; +} + +Bool +ccsStringToKeyBinding (const char *binding, + CCSSettingKeyValue *value) +{ + char *ptr; + unsigned int mods; + KeySym keysym; + + if (!binding || !strlen(binding) || + strncasecmp (binding, "Disabled", strlen ("Disabled")) == 0) + { + value->keysym = 0; + value->keyModMask = 0; + return TRUE; + } + + mods = ccsStringToModifiers (binding); + + ptr = strrchr (binding, '>'); + + if (ptr) + binding = ptr + 1; + + while (*binding && !isalnum (*binding)) + binding++; + + if (!*binding) + { + if (mods) + { + value->keysym = 0; + value->keyModMask = mods; + + return TRUE; + } + + return FALSE; + } + + keysym = XStringToKeysym (binding); + + if (keysym != NoSymbol) + { + value->keysym = keysym; + value->keyModMask = mods; + + return TRUE; + } + + return FALSE; +} + +Bool +ccsStringToButtonBinding (const char *binding, + CCSSettingButtonValue *value) +{ + char *ptr; + unsigned int mods; + unsigned int edges; + + if (!binding || !strlen(binding) || + strncmp (binding, "Disabled", strlen ("Disabled")) == 0) + { + value->button = 0; + value->buttonModMask = 0; + value->edgeMask = 0; + return TRUE; + } + + mods = ccsStringToModifiers (binding); + edges = ccsModStringToEdges (binding); + + ptr = strrchr (binding, '>'); + + if (ptr) + binding = ptr + 1; + + while (*binding && !isalnum (*binding)) + binding++; + + if (strncmp (binding, "Button", strlen ("Button")) == 0) + { + int buttonNum; + + if (sscanf (binding + strlen ("Button"), "%d", &buttonNum) == 1) + { + value->button = buttonNum; + value->buttonModMask = mods; + value->edgeMask = edges; + + return TRUE; + } + } + + return FALSE; +} + +Bool +ccsStringToColor (const char *value, + CCSSettingColorValue *color) +{ + int c[4]; + + if (sscanf (value, "#%2x%2x%2x%2x", &c[0], &c[1], &c[2], &c[3]) == 4) + { + color->color.red = c[0] << 8 | c[0]; + color->color.green = c[1] << 8 | c[1]; + color->color.blue = c[2] << 8 | c[2]; + color->color.alpha = c[3] << 8 | c[3]; + + return TRUE; + } + + return FALSE; +} + +char * +ccsColorToString (CCSSettingColorValue *color) +{ + char tmp[256]; + + snprintf (tmp, 256, "#%.2x%.2x%.2x%.2x", + color->color.red >> 8, color->color.green >> 8, + color->color.blue >> 8, color->color.alpha >> 8); + + return strdup (tmp); +} + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/ccs-private.h b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/ccs-private.h new file mode 100644 index 00000000..49093796 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/ccs-private.h @@ -0,0 +1,81 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Dennis Kasprzyk <onestone@opencompositing.org> + * Copyright (C) 2007 Danny Baumann <maniac@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CCS_PRIVATE_H +#define CSS_PRIVATE_H + +#include <ccs.h> +#include <ccs-backend.h> + +#define CONTEXT_PRIV(c) \ + CCSContextPrivate *cPrivate = (CCSContextPrivate *) c->ccsPrivate; +#define PLUGIN_PRIV(p) \ + CCSPluginPrivate *pPrivate = (CCSPluginPrivate *) p->ccsPrivate; + +extern Bool basicMetadata; + +typedef struct _CCSContextPrivate +{ + CCSBackend *backend; + + char *profile; + Bool deIntegration; + Bool pluginListAutoSort; + + unsigned int configWatchId; +} CCSContextPrivate; + +typedef struct _CCSPluginPrivate +{ + CCSSettingList settings; + CCSGroupList groups; + Bool loaded; + Bool active; + char * xmlFile; + char * xmlPath; +#ifdef USE_PROTOBUF + char * pbFilePath; +#endif + + CCSStrExtensionList stringExtensions; +} CCSPluginPrivate; + +void ccsLoadPlugins (CCSContext * context); +void ccsLoadPluginSettings (CCSPlugin * plugin); +void collateGroups (CCSPluginPrivate * p); + +void ccsCheckFileWatches (void); + +typedef enum { + OptionProfile, + OptionBackend, + OptionIntegration, + OptionAutoSort +} ConfigOption; + +Bool ccsReadConfig (ConfigOption option, + char **value); +Bool ccsWriteConfig (ConfigOption option, + char *value); +unsigned int ccsAddConfigWatch (CCSContext *context, + FileWatchCallbackProc callback); + +#endif diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/compiz.cpp b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/compiz.cpp new file mode 100644 index 00000000..179a43aa --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/compiz.cpp @@ -0,0 +1,3142 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Dennis Kasprzyk <onestone@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef USE_PROTOBUF +#include "compizconfig.pb.h" +#include <google/protobuf/io/zero_copy_stream_impl.h> +#endif + +extern "C" +{ +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <dirent.h> +#include <sys/stat.h> +#include <errno.h> + +#include <libxslt/transform.h> +#include <libxslt/xsltutils.h> + +#include <locale.h> + +#include <compiz-core.h> +#include <ccs.h> +#include "ccs-private.h" +} + +extern int xmlLoadExtDtdDefaultValue; + + +#ifdef USE_PROTOBUF + +Bool usingProtobuf = TRUE; + +#define PB_ABI_VERSION 20090314 + +typedef metadata::PluginInfo PluginInfoMetadata; +typedef metadata::PluginBrief PluginBriefMetadata; +typedef metadata::Plugin PluginMetadata; + +typedef PluginInfoMetadata::Dependencies DependenciesMetadata; +typedef PluginMetadata::Screen ScreenMetadata; +typedef PluginMetadata::Option OptionMetadata; +typedef PluginMetadata::Extension ExtensionMetadata; +typedef OptionMetadata::GenericValue GenericValueMetadata; + +typedef google::protobuf::RepeatedPtrField< std::string > StringList; + +PluginBriefMetadata persistentPluginBriefPB; +PluginMetadata persistentPluginPB; // Made global so that it gets reused, + // for better performance (to avoid + // mem alloc/free for each plugin) + +std::string metadataCacheDir = ""; + +static char * +getLocale () +{ + char *lang = getenv ("LANG"); + + if (!lang || !strlen (lang)) + lang = getenv ("LC_ALL"); + + if (!lang || !strlen (lang)) + lang = getenv ("LC_MESSAGES"); + + return lang ? lang : (char *)""; +} + +std::string curLocale = std::string (getLocale ()); +std::string shortLocale = curLocale.find ('.') == std::string::npos ? + curLocale : curLocale.substr (0, curLocale.find ('.')); + +#endif + +static void +ccsAddRestrictionToStringInfo (CCSSettingStringInfo *forString, + const char *name, + const char *value) +{ + CCSStrRestriction *restriction; + + restriction = (CCSStrRestriction *) calloc (1, sizeof (CCSStrRestriction)); + if (restriction) + { + restriction->name = strdup (name); + restriction->value = strdup (value); + forString->restriction = + ccsStrRestrictionListAppend (forString->restriction, + restriction); + } +} + +static void +ccsAddRestrictionToStringExtension (CCSStrExtension *extension, + const char *name, + const char *value) +{ + CCSStrRestriction *restriction; + + restriction = (CCSStrRestriction *) calloc (1, sizeof (CCSStrRestriction)); + if (restriction) + { + restriction->name = strdup (name); + restriction->value = strdup (value); + extension->restriction = + ccsStrRestrictionListAppend (extension->restriction, restriction); + } +} + + +#ifdef USE_PROTOBUF + +static void +initBoolValuePB (CCSSettingValue * v, + const GenericValueMetadata & value) +{ + v->value.asBool = FALSE; + + if (value.has_bool_value ()) + { + v->value.asBool = value.bool_value (); + } +} + +static void +initIntValuePB (CCSSettingValue * v, + CCSSettingInfo * i, + const GenericValueMetadata & value) +{ + v->value.asInt = (i->forInt.min + i->forInt.max) / 2; + + if (value.has_int_value ()) + { + int val = value.int_value (); + if (val >= i->forInt.min && val <= i->forInt.max) + v->value.asInt = val; + } +} + +static void +initFloatValuePB (CCSSettingValue * v, + CCSSettingInfo * i, + const GenericValueMetadata & value) +{ + v->value.asFloat = (i->forFloat.min + i->forFloat.max) / 2; + + if (value.has_float_value ()) + { + float val = value.float_value (); + if (val >= i->forFloat.min && val <= i->forFloat.max) + v->value.asFloat = val; + } +} + +static void +initStringValuePB (CCSSettingValue * v, + CCSSettingInfo * i, + const GenericValueMetadata & value) +{ + free (v->value.asString); + + if (value.has_string_value ()) + v->value.asString = strdup (value.string_value ().c_str ()); + else + v->value.asString = strdup (""); +} + +static void +initColorValuePB (CCSSettingValue * v, + const GenericValueMetadata & value) +{ + memset (&v->value.asColor, 0, sizeof (v->value.asColor)); + v->value.asColor.color.alpha = 0xffff; + + if (!value.has_color_value ()) + return; + + const OptionMetadata::ColorValue &val = value.color_value (); + + if (val.has_red ()) + { + int color = strtol ((char *) val.red ().c_str (), NULL, 0); + + v->value.asColor.color.red = MAX (0, MIN (0xffff, color)); + } + + if (val.has_green ()) + { + int color = strtol ((char *) val.green ().c_str (), NULL, 0); + + v->value.asColor.color.green = MAX (0, MIN (0xffff, color)); + } + + if (val.has_blue ()) + { + int color = strtol ((char *) val.blue ().c_str (), NULL, 0); + + v->value.asColor.color.blue = MAX (0, MIN (0xffff, color)); + } + + if (val.has_alpha ()) + { + int color = strtol ((char *) val.alpha ().c_str (), NULL, 0); + + v->value.asColor.color.alpha = MAX (0, MIN (0xffff, color)); + } +} + +static void +initMatchValuePB (CCSSettingValue * v, + const GenericValueMetadata & value) +{ + free (v->value.asMatch); + + if (value.has_string_value ()) + v->value.asMatch = strdup (value.string_value ().c_str ()); + else + v->value.asMatch = strdup (""); +} + +static void +initKeyValuePB (CCSSettingValue * v, + CCSSettingInfo * i, + const GenericValueMetadata & value) +{ + memset (&v->value.asKey, 0, sizeof (v->value.asKey)); + + if (value.has_string_value ()) + { + const char * val = value.string_value ().c_str (); + + if (strcasecmp (val, "disabled")) + { + ccsStringToKeyBinding (val, &v->value.asKey); + } + } +} + +static void +initButtonValuePB (CCSSettingValue * v, + CCSSettingInfo * i, + const GenericValueMetadata & value) +{ + memset (&v->value.asButton, 0, sizeof (v->value.asButton)); + + if (value.has_string_value ()) + { + const char * val = value.string_value ().c_str (); + + if (strcasecmp (val, "disabled")) + { + ccsStringToButtonBinding (val, &v->value.asButton); + } + } +} + +static void +initEdgeValuePB (CCSSettingValue * v, + CCSSettingInfo * i, + const GenericValueMetadata & value) +{ + v->value.asEdge = 0; + + if (value.has_edge_value ()) + v->value.asEdge = value.edge_value (); +} + +static void +initBellValuePB (CCSSettingValue * v, + CCSSettingInfo * i, + const GenericValueMetadata & value) +{ + v->value.asBell = FALSE; + + if (value.has_bool_value ()) + v->value.asBell = value.bool_value (); +} + +static void +initListValuePB (CCSSettingValue * v, + CCSSettingInfo * i, + const OptionMetadata & option) +{ + int num, j; + + num = option.default_value_size (); + + if (num) + { + for (j = 0; j < num; j++) + { + CCSSettingValue *val; + val = (CCSSettingValue *) calloc (1, sizeof (CCSSettingValue)); + if (!val) + continue; + + val->parent = v->parent; + val->isListChild = TRUE; + + switch (i->forList.listType) + { + case TypeBool: + initBoolValuePB (val, option.default_value (j)); + break; + case TypeInt: + initIntValuePB (val, i->forList.listInfo, + option.default_value (j)); + break; + case TypeFloat: + initFloatValuePB (val, i->forList.listInfo, + option.default_value (j)); + break; + case TypeString: + initStringValuePB (val, i->forList.listInfo, + option.default_value (j)); + break; + case TypeColor: + initColorValuePB (val, option.default_value (j)); + break; + case TypeKey: + initKeyValuePB (val, i->forList.listInfo, + option.default_value (j)); + break; + case TypeButton: + initButtonValuePB (val, i->forList.listInfo, + option.default_value (j)); + break; + case TypeEdge: + initEdgeValuePB (val, i->forList.listInfo, + option.default_value (j)); + break; + case TypeBell: + initBellValuePB (val, i->forList.listInfo, + option.default_value (j)); + break; + case TypeMatch: + initMatchValuePB (val, option.default_value (j)); + default: + break; + } + v->value.asList = ccsSettingValueListAppend (v->value.asList, val); + } + } +} + +static void +initIntInfoPB (CCSSettingInfo * i, const OptionMetadata & option) +{ + int num, j; + i->forInt.min = MINSHORT; + i->forInt.max = MAXSHORT; + i->forInt.desc = NULL; + + if (option.has_int_min ()) + i->forInt.min = option.int_min (); + + if (option.has_int_max ()) + i->forInt.max = option.int_max (); + + if (!basicMetadata) + { + num = option.int_desc_size (); + for (j = 0; j < num; j++) + { + const OptionMetadata::IntDescription & intDescMetadata = + option.int_desc (j); + + int val = intDescMetadata.value (); + + if (val >= i->forInt.min && val <= i->forInt.max) + { + CCSIntDesc *intDesc; + + intDesc = (CCSIntDesc *) calloc (1, sizeof (CCSIntDesc)); + if (intDesc) + { + intDesc->name = strdup (intDescMetadata.name ().c_str ()); + intDesc->value = val; + i->forInt.desc = + ccsIntDescListAppend (i->forInt.desc, intDesc); + } + } + } + } +} + +static void +initFloatInfoPB (CCSSettingInfo * i, const OptionMetadata & option) +{ + i->forFloat.min = MINSHORT; + i->forFloat.max = MAXSHORT; + i->forFloat.precision = 0.1f; + + if (option.has_float_min ()) + i->forFloat.min = option.float_min (); + + if (option.has_float_max ()) + i->forFloat.max = option.float_max (); + + if (option.precision ()) + i->forFloat.precision = option.precision (); +} + +static void +initStringInfoPB (CCSSettingInfo * i, const OptionMetadata & option) +{ + int num, j; + i->forString.restriction = NULL; + i->forString.sortStartsAt = -1; + i->forString.extensible = FALSE; + + if (!basicMetadata) + { + if (option.has_extensible () && option.extensible ()) + i->forString.extensible = TRUE; + + if (option.has_sort_start ()) + i->forString.sortStartsAt = option.sort_start (); + + num = option.str_restriction_size (); + for (j = 0; j < num; j++) + { + const OptionMetadata::StringRestriction & + restrictionMetadata = option.str_restriction (j); + + const char *value = restrictionMetadata.value ().c_str (); + const char *name = restrictionMetadata.name ().c_str (); + + ccsAddRestrictionToStringInfo (&i->forString, value, name); + } + } +} + +static void +initListInfoPB (CCSSettingInfo * i, const OptionMetadata & option) +{ + CCSSettingInfo *info; + + i->forList.listType = TypeBool; + i->forList.listInfo = NULL; + + if (option.has_list_type ()) + { + i->forList.listType = (CCSSettingType) option.list_type (); + } + switch (i->forList.listType) + { + case TypeInt: + { + info = (CCSSettingInfo *) calloc (1, sizeof (CCSSettingInfo)); + if (info) + initIntInfoPB (info, option); + i->forList.listInfo = info; + } + break; + case TypeFloat: + { + info = (CCSSettingInfo *) calloc (1, sizeof (CCSSettingInfo)); + if (info) + initFloatInfoPB (info, option); + i->forList.listInfo = info; + } + break; + case TypeString: + { + info = (CCSSettingInfo *) calloc (1, sizeof (CCSSettingInfo)); + if (info) + initStringInfoPB (info, option); + i->forList.listInfo = info; + } + break; + default: + break; + } +} + +static void +initActionInfoPB (CCSSettingInfo * i, const OptionMetadata & option) +{ + i->forAction.internal = FALSE; + + if (option.has_internal () && option.internal ()) + i->forAction.internal = TRUE; +} + +static void +addOptionForPluginPB (CCSPlugin * plugin, + const char * name, + Bool isScreen, + unsigned int screen, + const StringList & groups, + const StringList & subgroups, + const OptionMetadata & option) +{ + CCSSetting *setting; + + if (ccsFindSetting (plugin, name, isScreen, screen)) + { + fprintf (stderr, "[ERROR]: Option \"%s\" already defined\n", name); + return; + } + + setting = (CCSSetting *) calloc (1, sizeof (CCSSetting)); + if (!setting) + return; + + setting->parent = plugin; + setting->isScreen = isScreen; + setting->screenNum = screen; + setting->isDefault = TRUE; + setting->name = strdup (name); + + if (!basicMetadata) + { + setting->shortDesc = + strdup (option.has_short_desc () ? + option.short_desc ().c_str () : + name); + setting->longDesc = + strdup (option.has_long_desc () ? + option.long_desc ().c_str () : + name); + setting->hints = strdup (option.has_hints () ? + option.hints ().c_str () : + name); + setting->group = + strdup (option.group_id () >= 0 ? + groups.Get (option.group_id ()).c_str () : + ""); + setting->subGroup = + strdup (option.subgroup_id () >= 0 ? + subgroups.Get (option.subgroup_id ()).c_str () : + ""); + } + else + { + setting->shortDesc = strdup (name); + setting->longDesc = strdup (""); + setting->hints = strdup (""); + setting->group = strdup (""); + setting->subGroup = strdup (""); + } + + setting->type = (CCSSettingType) option.type (); + setting->value = &setting->defaultValue; + setting->defaultValue.parent = setting; + + switch (setting->type) + { + case TypeInt: + initIntInfoPB (&setting->info, option); + break; + case TypeFloat: + initFloatInfoPB (&setting->info, option); + break; + case TypeString: + initStringInfoPB (&setting->info, option); + break; + case TypeList: + initListInfoPB (&setting->info, option); + break; + case TypeKey: + case TypeButton: + case TypeEdge: + case TypeBell: + initActionInfoPB (&setting->info, option); + break; + case TypeAction: // do nothing and fall through + default: + break; + } + + if (option.default_value_size () > 0) + { + switch (setting->type) + { + case TypeInt: + initIntValuePB (&setting->defaultValue, &setting->info, + option.default_value (0)); + break; + case TypeBool: + initBoolValuePB (&setting->defaultValue, option.default_value (0)); + break; + case TypeFloat: + initFloatValuePB (&setting->defaultValue, &setting->info, + option.default_value (0)); + break; + case TypeString: + initStringValuePB (&setting->defaultValue, &setting->info, + option.default_value (0)); + break; + case TypeColor: + initColorValuePB (&setting->defaultValue, option.default_value (0)); + break; + case TypeKey: + initKeyValuePB (&setting->defaultValue, &setting->info, + option.default_value (0)); + break; + case TypeButton: + initButtonValuePB (&setting->defaultValue, &setting->info, + option.default_value (0)); + break; + case TypeEdge: + initEdgeValuePB (&setting->defaultValue, &setting->info, + option.default_value (0)); + break; + case TypeBell: + initBellValuePB (&setting->defaultValue, &setting->info, + option.default_value (0)); + break; + case TypeMatch: + initMatchValuePB (&setting->defaultValue, + option.default_value (0)); + break; + case TypeList: + initListValuePB (&setting->defaultValue, &setting->info, + option); + break; + case TypeAction: // do nothing and fall through + default: + break; + } + } + else + { + /* if we have no set defaults, we have at least to set + the string defaults to empty strings */ + switch (setting->type) + { + case TypeString: + setting->defaultValue.value.asString = strdup (""); + break; + case TypeMatch: + setting->defaultValue.value.asMatch = strdup (""); + break; + default: + break; + } + } + + PLUGIN_PRIV (plugin); + + pPrivate->settings = ccsSettingListAppend (pPrivate->settings, setting); +} + +static void +addOptionFromPB (CCSPlugin * plugin, + Bool isScreen, + const StringList & groups, + const StringList & subgroups, + const OptionMetadata & option) +{ + const char *name; + Bool readonly = FALSE; + + name = option.name ().c_str (); + + readonly = option.has_read_only () && option.read_only (); + + if (!strlen (name) || readonly) + return; + + if (isScreen) + { + for (unsigned i = 0; i < plugin->context->numScreens; i++) + addOptionForPluginPB (plugin, name, TRUE, + plugin->context->screens[i], + groups, subgroups, option); + } + else + addOptionForPluginPB (plugin, name, FALSE, 0, groups, subgroups, option); +} + +static void +initOptionsFromPB (CCSPlugin * plugin, + const PluginMetadata & pluginPB) +{ + int numOpt, i; + + if (pluginPB.has_display ()) + { + const ScreenMetadata &displayPB = pluginPB.display (); + + // Display options + numOpt = displayPB.option_size (); + for (i = 0; i < numOpt; i++) + addOptionFromPB (plugin, FALSE, + displayPB.group_desc (), + displayPB.subgroup_desc (), + displayPB.option (i)); + } + + if (pluginPB.has_screen ()) + { + const ScreenMetadata &screenPB = pluginPB.screen (); + + // Screen options + numOpt = screenPB.option_size (); + for (i = 0; i < numOpt; i++) + addOptionFromPB (plugin, TRUE, + screenPB.group_desc (), + screenPB.subgroup_desc (), + screenPB.option (i)); + } +} + +static void +addStringsFromPB (CCSStringList * list, + const StringList & strings) +{ + StringList::const_iterator it; + + for (it = strings.begin (); it != strings.end (); it++) + { + const char *value = (*it).c_str (); + + if (strlen (value)) + *list = ccsStringListAppend (*list, strdup (value)); + } +} + +static void +addStringExtensionFromPB (CCSPlugin * plugin, + const ExtensionMetadata & extensionPB) +{ + int j; + CCSStrExtension *extension; + + extension = (CCSStrExtension *) calloc (1, sizeof (CCSStrExtension)); + if (!extension) + return; + + extension->isScreen = !(extensionPB.has_display () && + extensionPB.display ()); + + extension->restriction = NULL; + + extension->basePlugin = strdup (extensionPB.base_plugin ().c_str ()); + + addStringsFromPB (&extension->baseSettings, + extensionPB.base_option ()); + + int numRestrictions = extensionPB.str_restriction_size (); + if (!numRestrictions) + { + free (extension); + return; + } + + for (j = 0; j < numRestrictions; j++) + { + const OptionMetadata::StringRestriction & restrictionPB = + extensionPB.str_restriction (j); + + const char *value = restrictionPB.value ().c_str (); + const char *name = restrictionPB.name ().c_str (); + + ccsAddRestrictionToStringExtension (extension, name, value); + } + + PLUGIN_PRIV (plugin); + + pPrivate->stringExtensions = + ccsStrExtensionListAppend (pPrivate->stringExtensions, extension); +} + +static void +initStringExtensionsFromPB (CCSPlugin * plugin, + const PluginMetadata & pluginPB) +{ + int numExtensions, i; + + numExtensions = pluginPB.extension_size (); + for (i = 0; i < numExtensions; i++) + addStringExtensionFromPB (plugin, pluginPB.extension (i)); +} + +static void +initRulesFromPB (CCSPlugin * plugin, const PluginInfoMetadata & pluginInfoPB) +{ + addStringsFromPB (&plugin->providesFeature, pluginInfoPB.feature ()); + + if (!pluginInfoPB.has_deps ()) + return; + + const DependenciesMetadata & deps = pluginInfoPB.deps (); + + addStringsFromPB (&plugin->loadAfter, deps.after_plugin ()); + addStringsFromPB (&plugin->loadBefore, deps.before_plugin ()); + addStringsFromPB (&plugin->requiresPlugin, deps.require_plugin ()); + addStringsFromPB (&plugin->requiresFeature, deps.require_feature ()); + addStringsFromPB (&plugin->conflictPlugin, deps.conflict_plugin ()); + addStringsFromPB (&plugin->conflictFeature, deps.conflict_feature ()); +} + +static void +addPluginFromPB (CCSContext * context, + const PluginInfoMetadata & pluginInfoPB, + char *file, + char *xmlFile) +{ + const char *name; + CCSPlugin *plugin; + CCSPluginPrivate *pPrivate; + + name = pluginInfoPB.name ().c_str (); + + if (!strlen (name)) + return; + + if (ccsFindPlugin (context, name)) + return; + + if (!strcmp (name, "ini") || !strcmp (name, "gconf") || + !strcmp (name, "ccp") || !strcmp (name, "kconfig")) + return; + + plugin = (CCSPlugin *) calloc (1, sizeof (CCSPlugin)); + if (!plugin) + return; + + pPrivate = (CCSPluginPrivate *) calloc (1, sizeof (CCSPluginPrivate)); + if (!pPrivate) + { + free (plugin); + return; + } + pPrivate->loaded = FALSE; + + plugin->ccsPrivate = (void *) pPrivate; + + if (file) + pPrivate->pbFilePath = strdup (file); + + if (xmlFile) + { + pPrivate->xmlFile = strdup (xmlFile); + asprintf (&pPrivate->xmlPath, "/compiz/plugin[@name = '%s']", name); + } + + plugin->context = context; + plugin->name = strdup (name); + + if (!basicMetadata) + { + plugin->shortDesc = + strdup (pluginInfoPB.has_short_desc () ? + pluginInfoPB.short_desc ().c_str () : + name); + plugin->longDesc = + strdup (pluginInfoPB.has_long_desc () ? + pluginInfoPB.long_desc ().c_str () : + name); + plugin->category = strdup (pluginInfoPB.has_category () ? + pluginInfoPB.category ().c_str () : + ""); + } + else + { + plugin->shortDesc = strdup (name); + plugin->longDesc = strdup (name); + plugin->category = strdup (""); + } + + initRulesFromPB (plugin, pluginInfoPB); + + context->plugins = ccsPluginListAppend (context->plugins, plugin); +} + +static void +addCoreSettingsFromPB (CCSContext * context, + const PluginInfoMetadata & pluginInfoPB, + char *file, + char *xmlFile) +{ + CCSPlugin *plugin; + CCSPluginPrivate *pPrivate; + + if (ccsFindPlugin (context, "core")) + return; + + plugin = (CCSPlugin*) calloc (1, sizeof (CCSPlugin)); + if (!plugin) + return; + + pPrivate = (CCSPluginPrivate *) calloc (1, sizeof (CCSPluginPrivate)); + if (!pPrivate) + { + free (plugin); + return; + } + + plugin->ccsPrivate = (void *) pPrivate; + + if (file) + pPrivate->pbFilePath = strdup (file); + + if (xmlFile) + { + pPrivate->xmlFile = strdup (xmlFile); + pPrivate->xmlPath = strdup ("/compiz/core"); + } + + plugin->context = context; + plugin->name = strdup ("core"); + plugin->category = strdup ("General"); + + if (!basicMetadata) + { + plugin->shortDesc = + strdup (pluginInfoPB.has_short_desc () ? + pluginInfoPB.short_desc ().c_str () : + "General Options"); + + plugin->longDesc = + strdup (pluginInfoPB.has_long_desc () ? + pluginInfoPB.long_desc ().c_str () : + "General Compiz Options"); + } + else + { + plugin->shortDesc = strdup ("General Options"); + plugin->longDesc = strdup ("General Compiz Options"); + } + + initRulesFromPB (plugin, pluginInfoPB); + context->plugins = ccsPluginListAppend (context->plugins, plugin); +} + +#endif + + +static int +pluginNameFilter (const struct dirent *name) +{ + int length = strlen (name->d_name); + + if (length < 7) + return 0; + + if (strncmp (name->d_name, "lib", 3) || + strncmp (name->d_name + length - 3, ".so", 3)) + return 0; + + return 1; +} + +static int +pluginXMLFilter (const struct dirent *name) +{ + int length = strlen (name->d_name); + + if (length < 5) + return 0; + + if (strncmp (name->d_name + length - 4, ".xml", 4)) + return 0; + + return 1; +} + + +/* XML parsing */ + +static CCSSettingType +getOptionType (const char *name) +{ + static struct _TypeMap + { + const char *name; + CCSSettingType type; + } map[] = { + { "bool", TypeBool }, + { "int", TypeInt }, + { "float", TypeFloat }, + { "string", TypeString }, + { "color", TypeColor }, + { "action", TypeAction }, + { "key", TypeKey }, + { "button", TypeButton }, + { "edge", TypeEdge }, + { "bell", TypeBell }, + { "match", TypeMatch }, + { "list", TypeList } + }; + for (unsigned i = 0; i < sizeof (map) / sizeof (map[0]); i++) + if (strcasecmp (name, map[i].name) == 0) + return map[i].type; + + return TypeNum; +} + +static char * +getStringFromXPath (xmlDoc * doc, xmlNode * base, const char *path) +{ + xmlXPathObjectPtr xpathObj; + xmlXPathContextPtr xpathCtx; + char *rv = NULL; + + xpathCtx = xmlXPathNewContext (doc); + if (!xpathCtx) + return NULL; + + if (base) + xpathCtx->node = base; + + xpathObj = xmlXPathEvalExpression (BAD_CAST path, xpathCtx); + + if (!xpathObj) + { + xmlXPathFreeContext (xpathCtx); + return NULL; + } + + xpathObj = xmlXPathConvertString (xpathObj); + + if (xpathObj->type == XPATH_STRING && xpathObj->stringval + && strlen ((char *) xpathObj->stringval)) + { + rv = strdup ((char *) xpathObj->stringval); + } + + xmlXPathFreeObject (xpathObj); + xmlXPathFreeContext (xpathCtx); + return rv; +} + +static xmlNode ** +getNodesFromXPath (xmlDoc * doc, xmlNode * base, const char *path, int *num) +{ + xmlXPathObjectPtr xpathObj; + xmlXPathContextPtr xpathCtx; + xmlNode **rv = NULL; + int size; + int i; + + *num = 0; + + xpathCtx = xmlXPathNewContext (doc); + if (!xpathCtx) + return NULL; + + if (base) + xpathCtx->node = base; + + xpathObj = xmlXPathEvalExpression (BAD_CAST path, xpathCtx); + if (!xpathObj) + { + xmlXPathFreeContext (xpathCtx); + return NULL; + } + + size = (xpathObj->nodesetval) ? xpathObj->nodesetval->nodeNr : 0; + if (!size) + { + xmlXPathFreeObject (xpathObj); + xmlXPathFreeContext (xpathCtx); + return NULL; + } + + rv = (xmlNode **) malloc (size * sizeof (xmlNode *)); + if (!rv) + { + xmlXPathFreeObject (xpathObj); + xmlXPathFreeContext (xpathCtx); + return NULL; + } + *num = size; + + for (i = 0; i < size; i++) + rv[i] = xpathObj->nodesetval->nodeTab[i]; + + xmlXPathFreeObject (xpathObj); + xmlXPathFreeContext (xpathCtx); + + return rv; +} + +static Bool +nodeExists (xmlNode * node, const char *path) +{ + xmlNode **nodes = NULL; + int num; + nodes = getNodesFromXPath (node->doc, node, path, &num); + + if (num) + { + free (nodes); + return TRUE; + } + + return FALSE; +} + +static char * +stringFromNodeDef (xmlNode * node, const char *path, const char *def) +{ + char *val; + char *rv = NULL; + + val = getStringFromXPath (node->doc, node, path); + + if (val) + { + rv = strdup (val); + free (val); + } + else if (def) + rv = strdup (def); + + return rv; +} + +static char * +stringFromNodeDefTrans (xmlNode * node, const char *path, const char *def) +{ + char *lang; + char newPath[1024]; + char *rv = NULL; + + lang = getenv ("LANG"); + + if (!lang || !strlen (lang)) + lang = getenv ("LC_ALL"); + + if (!lang || !strlen (lang)) + lang = getenv ("LC_MESSAGES"); + + if (!lang || !strlen (lang)) + return stringFromNodeDef (node, path, def); + + snprintf (newPath, 1023, "%s[lang('%s')]", path, lang); + rv = stringFromNodeDef (node, newPath, NULL); + if (rv) + return rv; + + snprintf (newPath, 1023, "%s[lang(substring-before('%s','.'))]", path, lang); + rv = stringFromNodeDef (node, newPath, NULL); + if (rv) + return rv; + + snprintf (newPath, 1023, "%s[lang(substring-before('%s','_'))]", path, lang); + rv = stringFromNodeDef (node, newPath, NULL); + if (rv) + return rv; + + snprintf (newPath, 1023, "%s[lang('C')]", path); + rv = stringFromNodeDef (node, newPath, NULL); + if (rv) + return rv; + + return stringFromNodeDef (node, path, def); +} + +static void +initBoolValue (CCSSettingValue * v, + xmlNode * node, + void * valuePBv) +{ + char *value; + + v->value.asBool = FALSE; + + value = getStringFromXPath (node->doc, node, "child::text()"); + + if (value) + { + if (strcasecmp ((char *) value, "true") == 0) + { + v->value.asBool = TRUE; +#ifdef USE_PROTOBUF + if (valuePBv) + ((GenericValueMetadata *) valuePBv)->set_bool_value (TRUE); +#endif + } + free (value); + } +} + +static void +initIntValue (CCSSettingValue * v, + CCSSettingInfo * i, + xmlNode * node, + void * valuePBv) +{ + char *value; + + v->value.asInt = (i->forInt.min + i->forInt.max) / 2; + + value = getStringFromXPath (node->doc, node, "child::text()"); + + if (value) + { + int val = strtol ((char *) value, NULL, 0); + + if (val >= i->forInt.min && val <= i->forInt.max) + { + v->value.asInt = val; +#ifdef USE_PROTOBUF + if (valuePBv) + ((GenericValueMetadata *) valuePBv)->set_int_value (val); +#endif + } + + free (value); + } +} + +static void +initFloatValue (CCSSettingValue * v, + CCSSettingInfo * i, + xmlNode * node, + void * valuePBv) +{ + char *value; + char *loc; + + v->value.asFloat = (i->forFloat.min + i->forFloat.max) / 2; + + loc = setlocale (LC_NUMERIC, NULL); + setlocale (LC_NUMERIC, "C"); + value = getStringFromXPath (node->doc, node, "child::text()"); + + if (value) + { + float val = strtod ((char *) value, NULL); + + if (val >= i->forFloat.min && val <= i->forFloat.max) + { + v->value.asFloat = val; +#ifdef USE_PROTOBUF + if (valuePBv) + ((GenericValueMetadata *) valuePBv)->set_float_value (val); +#endif + } + + free (value); + } + + setlocale (LC_NUMERIC, loc); +} + +static void +initStringValue (CCSSettingValue * v, + CCSSettingInfo * i, + xmlNode * node, + void * valuePBv) +{ + char *value; + + value = getStringFromXPath (node->doc, node, "child::text()"); + + if (value) + { + free (v->value.asString); + v->value.asString = strdup (value); + +#ifdef USE_PROTOBUF + if (valuePBv) + ((GenericValueMetadata *) valuePBv)->set_string_value (value); +#endif + free (value); + } + else + v->value.asString = strdup (""); +} + +static void +initColorValue (CCSSettingValue * v, xmlNode * node, void * valuePBv) +{ + char *value; + + memset (&v->value.asColor, 0, sizeof (v->value.asColor)); + v->value.asColor.color.alpha = 0xffff; + +#ifdef USE_PROTOBUF + OptionMetadata::ColorValue *colorPB = NULL; + if (valuePBv) + colorPB = ((GenericValueMetadata *) valuePBv)->mutable_color_value (); +#endif + + value = getStringFromXPath (node->doc, node, "red/child::text()"); + if (value) + { + int color = strtol ((char *) value, NULL, 0); + + v->value.asColor.color.red = MAX (0, MIN (0xffff, color)); +#ifdef USE_PROTOBUF + if (colorPB) + colorPB->set_red (value); +#endif + free (value); + } + + value = getStringFromXPath (node->doc, node, "green/child::text()"); + if (value) + { + int color = strtol ((char *) value, NULL, 0); + + v->value.asColor.color.green = MAX (0, MIN (0xffff, color)); +#ifdef USE_PROTOBUF + if (colorPB) + colorPB->set_green (value); +#endif + free (value); + } + + value = getStringFromXPath (node->doc, node, "blue/child::text()"); + if (value) + { + int color = strtol ((char *) value, NULL, 0); + + v->value.asColor.color.blue = MAX (0, MIN (0xffff, color)); +#ifdef USE_PROTOBUF + if (colorPB) + colorPB->set_blue (value); +#endif + free (value); + } + + value = getStringFromXPath (node->doc, node, "alpha/child::text()"); + if (value) + { + int color = strtol (value, NULL, 0); + + v->value.asColor.color.alpha = MAX (0, MIN (0xffff, color)); +#ifdef USE_PROTOBUF + if (colorPB) + colorPB->set_alpha (value); +#endif + free (value); + } +} + +static void +initMatchValue (CCSSettingValue * v, xmlNode * node, void * valuePBv) +{ + char *value; + + value = getStringFromXPath (node->doc, node, "child::text()"); + if (value) + { + free (v->value.asMatch); + v->value.asMatch = strdup (value); + +#ifdef USE_PROTOBUF + if (valuePBv) + ((GenericValueMetadata *) valuePBv)->set_string_value (value); +#endif + free (value); + } + else + v->value.asMatch = strdup (""); +} + +static void +initKeyValue (CCSSettingValue * v, + CCSSettingInfo * i, + xmlNode * node, + void * valuePBv) +{ + char *value; + + memset (&v->value.asKey, 0, sizeof (v->value.asKey)); + + value = getStringFromXPath (node->doc, node, "child::text()"); + if (value) + { +#ifdef USE_PROTOBUF + if (valuePBv) + ((GenericValueMetadata *) valuePBv)->set_string_value (value); +#endif + if (strcasecmp (value, "disabled")) + { + ccsStringToKeyBinding (value, &v->value.asKey); + } + free (value); + } +} + +static void +initButtonValue (CCSSettingValue * v, + CCSSettingInfo * i, + xmlNode * node, + void * valuePBv) +{ + char *value; + + memset (&v->value.asButton, 0, sizeof (v->value.asButton)); + + value = getStringFromXPath (node->doc, node, "child::text()"); + if (value) + { +#ifdef USE_PROTOBUF + if (valuePBv) + ((GenericValueMetadata *) valuePBv)->set_string_value (value); +#endif + if (strcasecmp (value, "disabled")) + { + ccsStringToButtonBinding (value, &v->value.asButton); + } + free (value); + } +} + +static void +initEdgeValue (CCSSettingValue * v, + CCSSettingInfo * i, + xmlNode * node, + void * valuePBv) +{ + xmlNode **nodes; + char *value; + int k, num; + + v->value.asEdge = 0; + + static const char *edge[] = { + "Left", + "Right", + "Top", + "Bottom", + "TopLeft", + "TopRight", + "BottomLeft", + "BottomRight" + }; + + nodes = getNodesFromXPath (node->doc, node, "edge", &num); + + for (k = 0; k < num; k++) + { + value = getStringFromXPath (node->doc, nodes[k], "@name"); + if (value) + { + for (unsigned j = 0; j < sizeof (edge) / sizeof (edge[0]); j++) + { + if (strcasecmp ((char *) value, edge[j]) == 0) + v->value.asEdge |= (1 << j); + } + free (value); + } + } + if (num) + free (nodes); + +#ifdef USE_PROTOBUF + if (valuePBv) + ((GenericValueMetadata *) valuePBv)->set_edge_value (v->value.asEdge); +#endif +} + +static void +initBellValue (CCSSettingValue * v, + CCSSettingInfo * i, + xmlNode * node, + void * valuePBv) +{ + char *value; + + v->value.asBell = FALSE; + + value = getStringFromXPath (node->doc, node, "child::text()"); + if (value) + { + if (!strcasecmp (value, "true")) + { + v->value.asBell = TRUE; +#ifdef USE_PROTOBUF + if (valuePBv) + ((GenericValueMetadata *) valuePBv)->set_bool_value (TRUE); +#endif + } + free (value); + } +} + +static void +initListValue (CCSSettingValue * v, + CCSSettingInfo * i, + xmlNode * node, + void * optionPBv) +{ + xmlNode **nodes; + int num, j; + + nodes = getNodesFromXPath (node->doc, node, "value", &num); + if (num) + { + for (j = 0; j < num; j++) + { + void *valuePBv = NULL; +#ifdef USE_PROTOBUF + if (optionPBv) + valuePBv = ((OptionMetadata *) optionPBv)->add_default_value (); +#endif + CCSSettingValue *val; + val = (CCSSettingValue *) calloc (1, sizeof (CCSSettingValue)); + if (!val) + continue; + + val->parent = v->parent; + val->isListChild = TRUE; + + switch (i->forList.listType) + { + case TypeBool: + initBoolValue (val, nodes[j], valuePBv); + break; + case TypeInt: + initIntValue (val, i->forList.listInfo, nodes[j], valuePBv); + break; + case TypeFloat: + initFloatValue (val, i->forList.listInfo, nodes[j], valuePBv); + break; + case TypeString: + initStringValue (val, i->forList.listInfo, nodes[j], valuePBv); + break; + case TypeColor: + initColorValue (val, nodes[j], valuePBv); + break; + case TypeKey: + initKeyValue (val, i->forList.listInfo, nodes[j], valuePBv); + break; + case TypeButton: + initButtonValue (val, i->forList.listInfo, nodes[j], valuePBv); + break; + case TypeEdge: + initEdgeValue (val, i->forList.listInfo, nodes[j], valuePBv); + break; + case TypeBell: + initBellValue (val, i->forList.listInfo, nodes[j], valuePBv); + break; + case TypeMatch: + initMatchValue (val, nodes[j], valuePBv); + default: + break; + } + v->value.asList = ccsSettingValueListAppend (v->value.asList, val); + } + free (nodes); + } +} + +static void +initIntInfo (CCSSettingInfo * i, xmlNode * node, void * optionPBv) +{ + xmlNode **nodes; + char *name; + char *value; + int num, j; + i->forInt.min = MINSHORT; + i->forInt.max = MAXSHORT; + i->forInt.desc = NULL; + + value = getStringFromXPath (node->doc, node, "min/child::text()"); + if (value) + { + int val = strtol (value, NULL, 0); + i->forInt.min = val; + free (value); +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_int_min (val); +#endif + } + + value = getStringFromXPath (node->doc, node, "max/child::text()"); + if (value) + { + int val = strtol (value, NULL, 0); + i->forInt.max = val; + free (value); +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_int_max (val); +#endif + } + + if (!basicMetadata) + { + nodes = getNodesFromXPath (node->doc, node, "desc", &num); + if (num) + { + for (j = 0; j < num; j++) + { + value = getStringFromXPath (node->doc, nodes[j], + "value/child::text()"); + if (value) + { + int val = strtol (value, NULL, 0); + free (value); + + if (val >= i->forInt.min && val <= i->forInt.max) + { + name = stringFromNodeDefTrans (nodes[j], + "name/child::text()", + NULL); + if (name) + { + CCSIntDesc *intDesc; + + intDesc = (CCSIntDesc *) calloc (1, sizeof (CCSIntDesc)); + if (intDesc) + { + intDesc->name = strdup (name); + intDesc->value = val; + i->forInt.desc = + ccsIntDescListAppend (i->forInt.desc, + intDesc); +#ifdef USE_PROTOBUF + if (optionPBv) + { + OptionMetadata::IntDescription *intDescPB = + ((OptionMetadata *) optionPBv)-> + add_int_desc (); + intDescPB->set_value (val); + intDescPB->set_name (name); + } +#endif + } + free (name); + } + } + } + } + free (nodes); + } + } +} + +static void +initFloatInfo (CCSSettingInfo * i, xmlNode * node, void * optionPBv) +{ + char *value; + char *loc; + + i->forFloat.min = MINSHORT; + i->forFloat.max = MAXSHORT; + i->forFloat.precision = 0.1f; + + loc = setlocale (LC_NUMERIC, NULL); + setlocale (LC_NUMERIC, "C"); + value = getStringFromXPath (node->doc, node, "min/child::text()"); + if (value) + { + float val = strtod (value, NULL); + i->forFloat.min = val; + free (value); +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_float_min (val); +#endif + } + + value = getStringFromXPath (node->doc, node, "max/child::text()"); + if (value) + { + float val = strtod (value, NULL); + i->forFloat.max = val; + free (value); +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_float_max (val); +#endif + } + + value = getStringFromXPath (node->doc, node, "precision/child::text()"); + if (value) + { + float val = strtod (value, NULL); + i->forFloat.precision = val; + free (value); +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_precision (val); +#endif + } + + setlocale (LC_NUMERIC, loc); +} + +static void +initStringInfo (CCSSettingInfo * i, xmlNode * node, void * optionPBv) +{ + xmlNode **nodes; + char *name; + char *value; + int num, j; + i->forString.restriction = NULL; + i->forString.sortStartsAt = -1; + i->forString.extensible = FALSE; + + if (!basicMetadata) + { + if (nodeExists (node, "extensible")) + { + i->forString.extensible = TRUE; +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_extensible (TRUE); +#endif + } + + nodes = getNodesFromXPath (node->doc, node, "sort", &num); + if (num) + { + int val = 0; /* Start sorting at 0 unless otherwise specified. */ + + value = getStringFromXPath (node->doc, nodes[0], "@start"); + if (value) + { + /* Custom starting value specified. */ + val = strtol (value, NULL, 0); + if (val < 0) + val = 0; + free (value); + } + i->forString.sortStartsAt = val; +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_sort_start (val); +#endif + free (nodes); + } + + nodes = getNodesFromXPath (node->doc, node, "restriction", &num); + if (num) + { + for (j = 0; j < num; j++) + { +#ifdef USE_PROTOBUF + OptionMetadata::StringRestriction * strRestrictionPB = NULL; + if (optionPBv) + strRestrictionPB = + ((OptionMetadata *) optionPBv)->add_str_restriction (); +#endif + value = getStringFromXPath (node->doc, nodes[j], + "value/child::text()"); + if (value) + { + name = stringFromNodeDefTrans (nodes[j], + "name/child::text()", + NULL); + if (name) + { + ccsAddRestrictionToStringInfo (&i->forString, + name, value); +#ifdef USE_PROTOBUF + if (strRestrictionPB) + { + strRestrictionPB->set_value (value); + strRestrictionPB->set_name (name); + } +#endif + free (name); + } + free (value); + } + } + free (nodes); + } + } +} + +static void +initListInfo (CCSSettingInfo * i, xmlNode * node, void * optionPBv) +{ + char *value; + CCSSettingInfo *info; + + i->forList.listType = TypeBool; + i->forList.listInfo = NULL; + + value = getStringFromXPath (node->doc, node, "type/child::text()"); + + if (!value) + return; + + i->forList.listType = getOptionType (value); +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_list_type + ((OptionMetadata::Type) i->forList.listType); +#endif + + free (value); + + switch (i->forList.listType) + { + case TypeInt: + { + info = (CCSSettingInfo *) calloc (1, sizeof (CCSSettingInfo)); + if (info) + initIntInfo (info, node, optionPBv); + i->forList.listInfo = info; + } + break; + case TypeFloat: + { + info = (CCSSettingInfo *) calloc (1, sizeof (CCSSettingInfo)); + if (info) + initFloatInfo (info, node, optionPBv); + i->forList.listInfo = info; + } + break; + case TypeString: + { + info = (CCSSettingInfo *) calloc (1, sizeof (CCSSettingInfo)); + if (info) + initStringInfo (info, node, optionPBv); + i->forList.listInfo = info; + } + break; + default: + break; + } +} + +static void +initActionInfo (CCSSettingInfo * i, xmlNode * node, void * optionPBv) +{ + char *value; + + i->forAction.internal = FALSE; + + value = getStringFromXPath (node->doc, node, "internal/child::text()"); + if (value) + { + if (strcasecmp (value, "true") == 0) + { + i->forAction.internal = TRUE; +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_internal (TRUE); +#endif + } + free (value); + return; + } + if (nodeExists (node, "internal")) + { + i->forAction.internal = TRUE; +#ifdef USE_PROTOBUF + if (optionPBv) + ((OptionMetadata *) optionPBv)->set_internal (TRUE); +#endif + } +} + +#ifdef USE_PROTOBUF +static void +checkAddGroupSubgroup (OptionMetadata *optPB, + StringList *descList, + char *name, + Bool isGroup) +{ + // Check if group has the same name as the last group in the groups list + int len = descList->size (); + if (len > 0 && + strcmp (name, descList->Get (len - 1).c_str ()) == 0) + { + if (isGroup) + optPB->set_group_id (len - 1); + else + optPB->set_subgroup_id (len - 1); + } + else + { + // Add new group to the list + descList->Add ()->assign (name); + + if (isGroup) + optPB->set_group_id (len); + else + optPB->set_subgroup_id (len); + } +} + +static Bool +createProtoBufCacheDir () +{ + if (metadataCacheDir.length () > 0) + { + // Cache dir must have been created already, since otherwise it would + // be "". So we can return here. + return TRUE; + } + char *cacheBaseDir = NULL; + char *cacheHome = getenv ("XDG_CACHE_HOME"); + + if (cacheHome && strlen (cacheHome)) + { + asprintf (&cacheBaseDir, "%s", cacheHome); + } + else + { + char *home = getenv ("HOME"); + if (home && strlen (home)) + { + asprintf (&cacheBaseDir, "%s/.cache", home); + } + } + + if (cacheBaseDir) + { + metadataCacheDir = cacheBaseDir; + if (metadataCacheDir[metadataCacheDir.length () - 1] != '/') + metadataCacheDir += "/"; + metadataCacheDir += "compizconfig"; + std::string metadataCacheFileDummy = metadataCacheDir + "/dummy"; + + // Create cache dir + Bool success = ccsCreateDirFor (metadataCacheFileDummy.c_str ()); + if (!success) + fprintf (stderr, "[ERROR]: Error creating directory \"%s\"\n", + metadataCacheDir.c_str ()); + free (cacheBaseDir); + + if (success) + return TRUE; // metadataCacheDir will be used later in this case + + metadataCacheDir = ""; // invalidate metadataCacheDir + } + + usingProtobuf = FALSE; // Disable protobuf if cache dir cannot be created + return FALSE; +} + +#endif + +static void +addOptionForPlugin (CCSPlugin * plugin, + char * name, + char * type, + Bool isReadonly, + Bool isScreen, + unsigned int screen, + xmlNode * node, + void * groupListPBv, + void * subgroupListPBv, + void * optionPBv) +{ + xmlNode **nodes; + int num = 0; + CCSSetting *setting; + + if (ccsFindSetting (plugin, name, isScreen, screen)) + { + fprintf (stderr, "[ERROR]: Option \"%s\" already defined\n", name); + return; + } + + if (getOptionType (type) == TypeNum) + return; + + setting = (CCSSetting *) calloc (1, sizeof (CCSSetting)); + if (!setting) + return; + + setting->parent = plugin; + setting->isScreen = isScreen; + setting->screenNum = screen; + setting->isDefault = TRUE; + setting->name = strdup (name); + + if (!basicMetadata) + { + setting->shortDesc = + stringFromNodeDefTrans (node, "short/child::text()", name); + setting->longDesc = + stringFromNodeDefTrans (node, "long/child::text()", ""); + setting->hints = stringFromNodeDef (node, "hints/child::text()", ""); + setting->group = + stringFromNodeDefTrans (node, "ancestor::group/short/child::text()", + ""); + setting->subGroup = + stringFromNodeDefTrans (node, + "ancestor::subgroup/short/child::text()", + ""); + } + else + { + setting->shortDesc = strdup (name); + setting->longDesc = strdup (""); + setting->hints = strdup (""); + setting->group = strdup (""); + setting->subGroup = strdup (""); + } + setting->type = getOptionType (type); + +#ifdef USE_PROTOBUF + OptionMetadata *optPB = NULL; + + if (optionPBv) + { + optPB = (OptionMetadata *) optionPBv; + + optPB->set_name (name); + optPB->set_type ((OptionMetadata::Type) setting->type); + if (isReadonly) + optPB->set_read_only (isReadonly); + + optPB->set_short_desc (setting->shortDesc); + optPB->set_long_desc (setting->longDesc); + + if (strlen (setting->hints) > 0) + optPB->set_hints (setting->hints); + + if (groupListPBv && strlen (setting->group) > 0) + checkAddGroupSubgroup (optPB, (StringList *) groupListPBv, + setting->group, TRUE); + if (subgroupListPBv && strlen (setting->subGroup) > 0) + checkAddGroupSubgroup (optPB, (StringList *) subgroupListPBv, + setting->subGroup, FALSE); + } +#endif + setting->value = &setting->defaultValue; + setting->defaultValue.parent = setting; + + switch (setting->type) + { + case TypeInt: + initIntInfo (&setting->info, node, optionPBv); + break; + case TypeFloat: + initFloatInfo (&setting->info, node, optionPBv); + break; + case TypeString: + initStringInfo (&setting->info, node, optionPBv); + break; + case TypeList: + initListInfo (&setting->info, node, optionPBv); + break; + case TypeKey: + case TypeButton: + case TypeEdge: + case TypeBell: + initActionInfo (&setting->info, node, optionPBv); + break; + default: + break; + } + + nodes = getNodesFromXPath (node->doc, node, "default", &num); + if (num) + { + void * valuePBv = NULL; +#ifdef USE_PROTOBUF + if (optPB && setting->type != TypeList) + valuePBv = optPB->add_default_value (); +#endif + switch (setting->type) + { + case TypeInt: + initIntValue (&setting->defaultValue, &setting->info, nodes[0], + valuePBv); + break; + case TypeBool: + initBoolValue (&setting->defaultValue, nodes[0], + valuePBv); + break; + case TypeFloat: + initFloatValue (&setting->defaultValue, &setting->info, nodes[0], + valuePBv); + break; + case TypeString: + initStringValue (&setting->defaultValue, &setting->info, nodes[0], + valuePBv); + break; + case TypeColor: + initColorValue (&setting->defaultValue, nodes[0], valuePBv); + break; + case TypeKey: + initKeyValue (&setting->defaultValue, &setting->info, nodes[0], + valuePBv); + break; + case TypeButton: + initButtonValue (&setting->defaultValue, &setting->info, nodes[0], + valuePBv); + break; + case TypeEdge: + initEdgeValue (&setting->defaultValue, &setting->info, nodes[0], + valuePBv); + break; + case TypeBell: + initBellValue (&setting->defaultValue, &setting->info, nodes[0], + valuePBv); + break; + case TypeMatch: + initMatchValue (&setting->defaultValue, nodes[0], + valuePBv); + break; + case TypeList: + initListValue (&setting->defaultValue, &setting->info, nodes[0], + optionPBv); + break; + default: + break; + } + } + else + { + /* if we have no set defaults, we have at least to set + the string defaults to empty strings */ + switch (setting->type) + { + case TypeString: + setting->defaultValue.value.asString = strdup (""); + break; + case TypeMatch: + setting->defaultValue.value.asMatch = strdup (""); + break; + default: + break; + } + } + + if (nodes) + free (nodes); + + if (isReadonly) + { + // Will come here only when protobuf is enabled + ccsFreeSetting (setting); + return; + } + // printSetting (setting); + PLUGIN_PRIV (plugin); + pPrivate->settings = ccsSettingListAppend (pPrivate->settings, setting); +} + +static void +addOptionFromXMLNode (CCSPlugin * plugin, + xmlNode * node, + Bool isScreen, + void * groupListPBv, + void * subgroupListPBv, + void * optionPBv) +{ + char *name; + char *type; + char *readonly; + Bool isReadonly; + + if (!node) + return; + + name = getStringFromXPath (node->doc, node, "@name"); + + type = getStringFromXPath (node->doc, node, "@type"); + + readonly = getStringFromXPath (node->doc, node, "@read_only"); + isReadonly = readonly && !strcmp (readonly, "true"); + + // If optionPBv is non-NULL, we still want to get the option info to write + // to .pb file, so we don't return immediately in that case. + + if (!name || !strlen (name) || !type || !strlen (type) || + (!optionPBv && isReadonly)) + { + if (name) + free (name); + if (type) + free (type); + if (readonly) + free (readonly); + + return; + } + + if (isScreen) + { + for (unsigned i = 0; i < plugin->context->numScreens; i++) + addOptionForPlugin (plugin, name, type, isReadonly, TRUE, + plugin->context->screens[i], node, + groupListPBv, subgroupListPBv, optionPBv); + } + else + { + addOptionForPlugin (plugin, name, type, isReadonly, FALSE, 0, node, + groupListPBv, subgroupListPBv, optionPBv); + } + free (name); + free (type); + + if (readonly) + free (readonly); +} + +static void +initDisplayScreenFromRootNode (CCSPlugin * plugin, + xmlNode * node, + Bool isScreen, + void * pluginPBv) +{ + xmlNode **nodes; + xmlNode **optNodes; + int num, i; + void *groupListPBv = NULL; + void *subgroupListPBv = NULL; + + nodes = getNodesFromXPath (node->doc, node, + (isScreen ? "screen" : "display"), &num); + if (!num) + return; + +#ifdef USE_PROTOBUF + ScreenMetadata *screenPB = NULL; + + if (pluginPBv) + { + PluginMetadata *pluginPB = (PluginMetadata *) pluginPBv; + screenPB = (isScreen ? + pluginPB->mutable_screen () : + pluginPB->mutable_display ()); + groupListPBv = screenPB->mutable_group_desc (); + subgroupListPBv = screenPB->mutable_subgroup_desc (); + } +#endif + optNodes = getNodesFromXPath + (node->doc, nodes[0], + "option | group/subgroup/option | group/option | subgroup/option", + &num); + if (num) + { + for (i = 0; i < num; i++) + { + void *optionPBv = NULL; + #ifdef USE_PROTOBUF + if (screenPB) + optionPBv = screenPB->add_option (); + #endif + addOptionFromXMLNode (plugin, optNodes[i], isScreen, + groupListPBv, subgroupListPBv, optionPBv); + } + + free (optNodes); + } + free (nodes); +} + +static inline void +initOptionsFromRootNode (CCSPlugin * plugin, + xmlNode * node, + void * pluginPBv) +{ + // For display + initDisplayScreenFromRootNode (plugin, node, FALSE, pluginPBv); + + // For screen + initDisplayScreenFromRootNode (plugin, node, TRUE, pluginPBv); +} + +static void +addStringsFromPath (CCSStringList * list, + const char * path, + xmlNode * node, + void * stringListPBv) +{ + xmlNode **nodes; + int num, i; + nodes = getNodesFromXPath (node->doc, node, path, &num); + + if (num) + { + for (i = 0; i < num; i++) + { + char *value = stringFromNodeDef (nodes[i], "child::text()", NULL); + + if (value && strlen (value)) + { + *list = ccsStringListAppend (*list, value); +#ifdef USE_PROTOBUF + if (stringListPBv) + ((StringList *) stringListPBv)->Add ()->assign (value); +#endif + } + if (value && !strlen (value)) + free (value); + } + + free (nodes); + } +} + +static void +addStringExtensionFromXMLNode (CCSPlugin * plugin, + xmlNode * node, + void * extensionPBv) +{ + xmlNode **nodes; + int num, j; + CCSStrExtension *extension; + char *name; + char *value; + char *isDisplay; + void * stringListPBv = NULL; + + extension = (CCSStrExtension *) calloc (1, sizeof (CCSStrExtension)); + if (!extension) + return; + + isDisplay = getStringFromXPath (node->doc, node, "@display"); + + extension->isScreen = !(isDisplay && !strcmp (isDisplay, "true")); + + if (isDisplay) + free (isDisplay); + + extension->restriction = NULL; + + extension->basePlugin = getStringFromXPath (node->doc, node, "@base_plugin"); + if (!extension->basePlugin) + extension->basePlugin = strdup (""); + +#ifdef USE_PROTOBUF + ExtensionMetadata * extensionPB = NULL; + if (extensionPBv) + { + extensionPB = (ExtensionMetadata *) extensionPBv; + extensionPB->set_display (!extension->isScreen); + extensionPB->set_base_plugin (extension->basePlugin); + stringListPBv = extensionPB->mutable_base_option (); + } +#endif + + addStringsFromPath (&extension->baseSettings, "base_option", node, + stringListPBv); + + nodes = getNodesFromXPath (node->doc, node, "restriction", &num); + if (!num) + { + free (extension); + return; + } + + for (j = 0; j < num; j++) + { + value = getStringFromXPath (node->doc, nodes[j], "value/child::text()"); + if (value) + { + name = stringFromNodeDefTrans (nodes[j], "name/child::text()", + NULL); + if (name) + { + ccsAddRestrictionToStringExtension (extension, name, value); +#ifdef USE_PROTOBUF + if (extensionPB) + { + OptionMetadata::StringRestriction *strRestrictionPB = + extensionPB->add_str_restriction (); + strRestrictionPB->set_value (value); + strRestrictionPB->set_name (name); + } +#endif + free (name); + } + free (value); + } + } + free (nodes); + + PLUGIN_PRIV (plugin); + + pPrivate->stringExtensions = + ccsStrExtensionListAppend (pPrivate->stringExtensions, extension); +} + +static void +initStringExtensionsFromRootNode (CCSPlugin * plugin, + xmlNode * node, + void * pluginPBv) +{ + xmlNode **nodes; + int num, i; + nodes = getNodesFromXPath (node->doc, node, "/compiz/*/extension", &num); + + for (i = 0; i < num; i++) + { + void *extensionPBv = NULL; +#ifdef USE_PROTOBUF + if (pluginPBv) + { + PluginMetadata *pluginPB = (PluginMetadata *) pluginPBv; + extensionPBv = pluginPB->add_extension (); + } +#endif + addStringExtensionFromXMLNode (plugin, nodes[i], extensionPBv); + } + free (nodes); +} + +static void +initRulesFromRootNode (CCSPlugin * plugin, xmlNode * node, void * pluginInfoPBv) +{ + void *featureListPBv = NULL; + void *pluginAfterListPBv = NULL; + void *pluginBeforeListPBv = NULL; + void *requirePluginListPBv = NULL; + void *requireFeatureListPBv = NULL; + void *conflictPluginListPBv = NULL; + void *conflictFeatureListPBv = NULL; +#ifdef USE_PROTOBUF + if (pluginInfoPBv) + { + PluginInfoMetadata *pluginInfoPB = (PluginInfoMetadata *) pluginInfoPBv; + featureListPBv = pluginInfoPB->mutable_feature (); + + DependenciesMetadata *deps = pluginInfoPB->mutable_deps (); + pluginAfterListPBv = deps->mutable_after_plugin (); + pluginBeforeListPBv = deps->mutable_before_plugin (); + requirePluginListPBv = deps->mutable_require_plugin (); + requireFeatureListPBv = deps->mutable_require_feature (); + conflictPluginListPBv = deps->mutable_conflict_plugin (); + conflictFeatureListPBv = deps->mutable_conflict_feature (); + } +#endif + + addStringsFromPath (&plugin->providesFeature, "feature", node, + featureListPBv); + + addStringsFromPath (&plugin->loadAfter, + "deps/relation[@type = 'after']/plugin", node, + pluginAfterListPBv); + addStringsFromPath (&plugin->loadBefore, + "deps/relation[@type = 'before']/plugin", node, + pluginBeforeListPBv); + addStringsFromPath (&plugin->requiresPlugin, + "deps/requirement/plugin", node, requirePluginListPBv); + addStringsFromPath (&plugin->requiresFeature, + "deps/requirement/feature", node, requireFeatureListPBv); + addStringsFromPath (&plugin->conflictPlugin, + "deps/conflict/plugin", node, conflictPluginListPBv); + addStringsFromPath (&plugin->conflictFeature, + "deps/conflict/feature", node, conflictFeatureListPBv); +} + +#ifdef USE_PROTOBUF +static void +fillBasicInfoIntoPB (CCSPlugin *plugin, PluginInfoMetadata *pluginInfoPB) +{ + if (!pluginInfoPB) + return; + + pluginInfoPB->set_name (plugin->name); + pluginInfoPB->set_short_desc (plugin->shortDesc); + pluginInfoPB->set_long_desc (plugin->longDesc); + pluginInfoPB->set_category (plugin->category); +} +#endif + +/* Returns TRUE on success. */ +static Bool +addPluginFromXMLNode (CCSContext * context, + xmlNode * node, + char * file, + void * pluginInfoPBv) +{ + char *name; + CCSPlugin *plugin; + CCSPluginPrivate *pPrivate; + + if (!node) + return FALSE; + + name = getStringFromXPath (node->doc, node, "@name"); + + if (!name || !strlen (name)) + { + if (name) + free (name); + return FALSE; + } + + if (!strcmp (name, "ini") || !strcmp (name, "gconf") || + !strcmp (name, "ccp") || !strcmp (name, "kconfig")) + { + free (name); + return FALSE; + } + + if (ccsFindPlugin (context, name)) + { + free (name); + return FALSE; + } + + plugin = (CCSPlugin *) calloc (1, sizeof (CCSPlugin)); + if (!plugin) + return FALSE; + + pPrivate = (CCSPluginPrivate *) calloc (1, sizeof (CCSPluginPrivate)); + if (!pPrivate) + { + free (plugin); + return FALSE; + } + + plugin->ccsPrivate = (void *) pPrivate; + + if (file) + pPrivate->xmlFile = strdup (file); + + asprintf (&pPrivate->xmlPath, "/compiz/plugin[@name = '%s']", name); + plugin->context = context; + plugin->name = strdup (name); + + if (!basicMetadata) + { + plugin->shortDesc = + stringFromNodeDefTrans (node, "short/child::text()", name); + plugin->longDesc = + stringFromNodeDefTrans (node, "long/child::text()", name); + plugin->category = + stringFromNodeDef (node, "category/child::text()", ""); + } + else + { + plugin->shortDesc = strdup (name); + plugin->longDesc = strdup (name); + plugin->category = strdup (""); + } +#ifdef USE_PROTOBUF + fillBasicInfoIntoPB (plugin, (PluginInfoMetadata *) pluginInfoPBv); +#endif + + initRulesFromRootNode (plugin, node, pluginInfoPBv); + + context->plugins = ccsPluginListAppend (context->plugins, plugin); + free (name); + + return TRUE; +} + +/* Returns TRUE on success. */ +static Bool +addCoreSettingsFromXMLNode (CCSContext * context, + xmlNode * node, + char *file, + void * pluginInfoPBv) +{ + CCSPlugin *plugin; + CCSPluginPrivate *pPrivate; + + if (!node) + return FALSE; + + if (ccsFindPlugin (context, "core")) + return FALSE; + + plugin = (CCSPlugin *) calloc (1, sizeof (CCSPlugin)); + if (!plugin) + return FALSE; + + pPrivate = (CCSPluginPrivate *) calloc (1, sizeof (CCSPluginPrivate)); + if (!pPrivate) + { + free (plugin); + return FALSE; + } + + plugin->ccsPrivate = (void *) pPrivate; + + if (file) + pPrivate->xmlFile = strdup (file); + + pPrivate->xmlPath = strdup ("/compiz/core"); + plugin->context = context; + plugin->name = strdup ("core"); + plugin->category = strdup ("General"); + + if (!basicMetadata) + { + plugin->shortDesc = + stringFromNodeDefTrans (node, "short/child::text()", + "General Options"); + plugin->longDesc = + stringFromNodeDefTrans (node, "long/child::text()", + "General Compiz Options"); + } + else + { + plugin->shortDesc = strdup ("General Options"); + plugin->longDesc = strdup ("General Compiz Options"); + } +#ifdef USE_PROTOBUF + fillBasicInfoIntoPB (plugin, (PluginInfoMetadata *) pluginInfoPBv); +#endif + + initRulesFromRootNode (plugin, node, pluginInfoPBv); + context->plugins = ccsPluginListAppend (context->plugins, plugin); + + return TRUE; +} + +/* End of XML parsing */ + +#ifdef USE_PROTOBUF + +// Either pluginMinMetadata or pluginMetadata should be non-NULL +static Bool +loadPluginMetadataFromProtoBuf (char *pbPath, + PluginBriefMetadata *pluginMinMetadata, + PluginMetadata *pluginMetadata) +{ + Bool success = FALSE; + + FILE *pbFile = fopen (pbPath, "rb"); + if (pbFile) + { + google::protobuf::io::FileInputStream inputStream (fileno (pbFile)); + if ((pluginMinMetadata && + pluginMinMetadata->ParseFromZeroCopyStream (&inputStream)) || + (pluginMetadata && + pluginMetadata->ParseFromZeroCopyStream (&inputStream))) + success = TRUE; + inputStream.Close (); + } + + return success; +} + +// Returns TRUE if successfully loads .pb file and .pb is up to date. +static Bool +checkAndLoadProtoBuf (char *pbPath, + struct stat *pbStat, + struct stat *xmlStat, + PluginBriefMetadata *pluginBriefPB) +{ + const PluginInfoMetadata &pluginInfoPB = pluginBriefPB->info (); + + if (pbStat->st_mtime < xmlStat->st_mtime || // is .pb older than .xml? + !loadPluginMetadataFromProtoBuf (pbPath, pluginBriefPB, NULL) || + (!basicMetadata && pluginBriefPB->info ().basic_metadata ()) || + pluginInfoPB.pb_abi_version () != PB_ABI_VERSION || + pluginInfoPB.time () != (unsigned long)xmlStat->st_mtime || + // xml modification time mismatch? + (pluginInfoPB.locale () != "NONE" && + pluginInfoPB.locale () != shortLocale)) + { + // .pb needs update + return FALSE; + } + return TRUE; +} + +// Write .pb data to .pb file +static void +writePBFile (char *pbFilePath, + PluginMetadata *pluginPB, + PluginBriefMetadata *pluginBriefPB, + struct stat *xmlStat) +{ + if (!createProtoBufCacheDir ()) + return; + + PluginInfoMetadata *pluginInfoPB; + + if (pluginPB) + { + pluginInfoPB = pluginPB->mutable_info (); + pluginInfoPB->set_brief_metadata (FALSE); + } + else + { + pluginInfoPB = pluginBriefPB->mutable_info (); + pluginInfoPB->set_pb_abi_version (PB_ABI_VERSION); + pluginInfoPB->set_locale (shortLocale); + pluginInfoPB->set_time ((unsigned long)xmlStat->st_mtime); + pluginInfoPB->set_brief_metadata (TRUE); + } + + pluginInfoPB->set_basic_metadata (basicMetadata); + + FILE *pbFile = fopen (pbFilePath, "wb"); + if (pbFile) + { + google::protobuf::io::FileOutputStream + outputStream (fileno (pbFile)); + if (pluginPB) + pluginPB->SerializeToZeroCopyStream (&outputStream); + else + pluginBriefPB->SerializeToZeroCopyStream (&outputStream); + outputStream.Close (); + } +} +#endif + +/* Returns TRUE on success. */ +static Bool +loadPluginFromXML (CCSContext * context, + xmlDoc * doc, + char *filename, + void * pluginInfoPBv) +{ + xmlNode **nodes; + int num; + Bool success = FALSE; + + nodes = getNodesFromXPath (doc, NULL, "/compiz/core", &num); + if (num) + { + success = addCoreSettingsFromXMLNode (context, nodes[0], filename, + pluginInfoPBv); + free (nodes); + return success; + } + + nodes = getNodesFromXPath (doc, NULL, "/compiz/plugin", &num); + if (num) + { + success = addPluginFromXMLNode (context, nodes[0], filename, + pluginInfoPBv); + free (nodes); + } + return success; +} + +#ifdef USE_PROTOBUF +static void +updatePBFilePath (CCSContext * context, char *name, char *pbFilePath) +{ + CCSPlugin *plugin = ccsFindPlugin (context, name); + if (plugin) + { + PLUGIN_PRIV (plugin); + + if (pPrivate->pbFilePath) + free (pPrivate->pbFilePath); + pPrivate->pbFilePath = strdup (pbFilePath); + } +} +#endif + +static void +loadPluginFromXMLFile (CCSContext * context, char *xmlName, char *xmlDirPath) +{ + char *xmlFilePath = NULL; + char *pbFilePath = NULL; + void *pluginInfoPBv = NULL; + + asprintf (&xmlFilePath, "%s/%s", xmlDirPath, xmlName); + if (!xmlFilePath) + { + fprintf (stderr, "[ERROR]: Can't allocate memory\n"); + return; + } + +#ifdef USE_PROTOBUF + char *name = NULL; + struct stat xmlStat; + Bool removePB = FALSE; + + if (usingProtobuf) + { + if (stat (xmlFilePath, &xmlStat)) + { + free (xmlFilePath); + return; + } + + // Check if the corresponding .pb exists in cache + Bool error = TRUE; + struct stat pbStat; + + name = strndup (xmlName, strlen (xmlName) - 4); + if (!name) + { + fprintf (stderr, "[ERROR]: Can't allocate memory\n"); + free (xmlFilePath); + return; + } + + if (createProtoBufCacheDir () && + metadataCacheDir.length () > 0) + { + asprintf (&pbFilePath, "%s/%s.pb", metadataCacheDir.c_str (), name); + if (!pbFilePath) + { + fprintf (stderr, "[ERROR]: Can't allocate memory\n"); + free (xmlFilePath); + free (name); + return; + } + error = stat (pbFilePath, &pbStat); + } + + if (!error) + { + if (checkAndLoadProtoBuf (pbFilePath, &pbStat, &xmlStat, + &persistentPluginBriefPB)) + { + // Found and loaded .pb + if (!strcmp (name, "core")) + addCoreSettingsFromPB (context, + persistentPluginBriefPB.info (), + pbFilePath, xmlFilePath); + else + addPluginFromPB (context, persistentPluginBriefPB.info (), + pbFilePath, xmlFilePath); + + updatePBFilePath (context, name, pbFilePath); + + free (xmlFilePath); + free (pbFilePath); + free (name); + return; + } + else + { + removePB = TRUE; + } + } + persistentPluginBriefPB.Clear (); + pluginInfoPBv = persistentPluginBriefPB.mutable_info (); + } +#endif + + // Load from .xml + FILE *fp = fopen (xmlFilePath, "r"); + Bool xmlLoaded = FALSE; + + if (fp) + { + fclose (fp); + xmlDoc *doc = xmlReadFile (xmlFilePath, NULL, 0); + if (doc) + { + xmlLoaded = loadPluginFromXML (context, doc, xmlFilePath, + pluginInfoPBv); + xmlFreeDoc (doc); + } + } + free (xmlFilePath); + +#ifdef USE_PROTOBUF + if (usingProtobuf && xmlLoaded) + { + if (removePB) + remove (pbFilePath); // Attempt to remove .pb + writePBFile (pbFilePath, NULL, &persistentPluginBriefPB, &xmlStat); + updatePBFilePath (context, name, pbFilePath); + } + + if (pbFilePath) + free (pbFilePath); + if (name) + free (name); +#endif +} + +static void +loadPluginsFromXMLFiles (CCSContext * context, char *path) +{ + struct dirent **nameList; + int nFile, i; + + if (!path) + return; + + nFile = scandir (path, &nameList, pluginXMLFilter, NULL); + + if (nFile <= 0) + return; + + for (i = 0; i < nFile; i++) + { + loadPluginFromXMLFile (context, nameList[i]->d_name, path); + free (nameList[i]); + } + free (nameList); +} + +static void +addPluginNamed (CCSContext * context, char *name) +{ + CCSPlugin *plugin; + CCSPluginPrivate *pPrivate; + + if (ccsFindPlugin (context, name)) + return; + + if (!strcmp (name, "ini") || !strcmp (name, "gconf") || + !strcmp (name, "ccp") || !strcmp (name, "kconfig")) + return; + + plugin = (CCSPlugin *) calloc (1, sizeof (CCSPlugin)); + if (!plugin) + return; + + pPrivate = (CCSPluginPrivate *) calloc (1, sizeof (CCSPluginPrivate)); + if (!pPrivate) + { + free (plugin); + return; + } + + plugin->ccsPrivate = (void *) pPrivate; + + plugin->context = context; + plugin->name = strdup (name); + + if (!plugin->shortDesc) + plugin->shortDesc = strdup (name); + if (!plugin->longDesc) + plugin->longDesc = strdup (name); + if (!plugin->category) + plugin->category = strdup (""); + + pPrivate->loaded = TRUE; + collateGroups (pPrivate); + context->plugins = ccsPluginListAppend (context->plugins, plugin); +} + +static void +loadPluginsFromName (CCSContext * context, char *path) +{ + struct dirent **nameList; + int nFile, i; + + if (!path) + return; + + nFile = scandir (path, &nameList, pluginNameFilter, NULL); + if (nFile <= 0) + return; + + for (i = 0; i < nFile; i++) + { + char name[1024]; + sscanf (nameList[i]->d_name, "lib%s", name); + if (strlen (name) > 3) + name[strlen (name) - 3] = 0; + free (nameList[i]); + addPluginNamed (context, name); + } + free (nameList); +} + +#ifdef USE_PROTOBUF +static inline void +initPBLoading () +{ + // Update usingProtobuf with the COMPIZ_NO_PROTOBUF environment variable + char *compizNoProtobuf = getenv ("COMPIZ_NO_PROTOBUF"); + usingProtobuf = !(compizNoProtobuf && + (strcasecmp (compizNoProtobuf, "1") == 0 || + strcasecmp (compizNoProtobuf, "yes") == 0 || + strcasecmp (compizNoProtobuf, "true") == 0)); + if (usingProtobuf) + { + // Verify that the version of the library that we linked against is + // compatible with the version of the headers we compiled against. + GOOGLE_PROTOBUF_VERIFY_VERSION; + } +} +#endif + +Bool +ccsLoadPlugin (CCSContext * context, char *name) +{ +#ifdef USE_PROTOBUF + initPBLoading (); +#endif + + char *xmlDirPath = NULL; + char *xmlName = NULL; + asprintf (&xmlName, "%s.xml", name); + + if (xmlName) + { + char *home = getenv ("HOME"); + if (home && strlen (home)) + { + char *home = getenv ("HOME"); + asprintf (&xmlDirPath, "%s/.compiz/metadata", home); + if (xmlDirPath) + { + loadPluginFromXMLFile (context, xmlName, xmlDirPath); + free (xmlDirPath); + } + } + + loadPluginFromXMLFile (context, xmlName, (char *) METADATADIR); + free (xmlName); + } + + return (ccsFindPlugin (context, name) != NULL); +} + +void +ccsLoadPlugins (CCSContext * context) +{ + D (D_FULL, "Adding plugins\n"); + +#ifdef USE_PROTOBUF + initPBLoading (); +#endif + + char *home = getenv ("HOME"); + if (home && strlen (home)) + { + char *homeplugins = NULL; + asprintf (&homeplugins, "%s/.compiz/metadata", home); + if (homeplugins) + { + loadPluginsFromXMLFiles (context, homeplugins); + free (homeplugins); + } + } + loadPluginsFromXMLFiles (context, (char *)METADATADIR); + + if (home && strlen (home)) + { + char *homeplugins = NULL; + asprintf (&homeplugins, "%s/.compiz/plugins", home); + if (homeplugins) + { + loadPluginsFromName (context, homeplugins); + free (homeplugins); + } + } + loadPluginsFromName (context, (char *)PLUGINDIR); +} + +static void +loadOptionsStringExtensionsFromXML (CCSPlugin * plugin, + void * pluginPBv, + struct stat *xmlStat) +{ + PLUGIN_PRIV (plugin); + + xmlDoc *doc = NULL; + xmlNode **nodes; + int num; + + if (stat (pPrivate->xmlFile, xmlStat)) + return; + + FILE *fp = fopen (pPrivate->xmlFile, "r"); + if (!fp) + return; + + fclose (fp); + doc = xmlReadFile (pPrivate->xmlFile, NULL, 0); + + nodes = getNodesFromXPath (doc, NULL, pPrivate->xmlPath, &num); + if (num) + { + initOptionsFromRootNode (plugin, nodes[0], pluginPBv); + if (!basicMetadata) + initStringExtensionsFromRootNode (plugin, nodes[0], pluginPBv); + free (nodes); + } + if (doc) + xmlFreeDoc (doc); +} + +void +ccsLoadPluginSettings (CCSPlugin * plugin) +{ + Bool ignoreXML = FALSE; + Bool loadedAtLeastBriefPB = FALSE; + void *pluginPBToWrite = NULL; + +#ifdef USE_PROTOBUF + initPBLoading (); +#endif + + PLUGIN_PRIV (plugin); + + if (pPrivate->loaded) + return; + + pPrivate->loaded = TRUE; + D (D_FULL, "Initializing %s options...", plugin->name); + +#ifdef USE_PROTOBUF + if (usingProtobuf && pPrivate->pbFilePath) + { + loadedAtLeastBriefPB = + loadPluginMetadataFromProtoBuf (pPrivate->pbFilePath, + NULL, &persistentPluginPB); + if (loadedAtLeastBriefPB) + { + if (!persistentPluginPB.info ().brief_metadata () && + (basicMetadata || + !persistentPluginPB.info ().basic_metadata ())) + { + initOptionsFromPB (plugin, persistentPluginPB); + if (!basicMetadata) + initStringExtensionsFromPB (plugin, persistentPluginPB); + ignoreXML = TRUE; + } + else + pluginPBToWrite = &persistentPluginPB; + } + else + pluginPBToWrite = &persistentPluginPB; + } +#endif + + struct stat xmlStat; + + // Load from .xml + if (!ignoreXML && pPrivate->xmlFile) + loadOptionsStringExtensionsFromXML (plugin, pluginPBToWrite, &xmlStat); + +#ifdef USE_PROTOBUF + if (pluginPBToWrite && pPrivate->pbFilePath && loadedAtLeastBriefPB) + writePBFile (pPrivate->pbFilePath, (PluginMetadata *) pluginPBToWrite, + NULL, &xmlStat); +#endif + D (D_FULL, "done\n"); + + collateGroups (pPrivate); + ccsReadPluginSettings (plugin); +} + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/compizconfig.proto b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/compizconfig.proto new file mode 100644 index 00000000..58348420 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/compizconfig.proto @@ -0,0 +1,165 @@ +package metadata; + +option optimize_for = SPEED; + + +message PluginInfo +{ + required sint32 pb_abi_version = 1; + required string locale = 2; + required uint64 time = 3; // modification time of source .xml file + + // true if container is missing options and extensions, and only includes + // plugin info + required bool brief_metadata = 4; + + // true if container is missing extensions, string restrictions, and + // short/long descriptions for the plugin and its options + required bool basic_metadata = 5; + + required string name = 6; + optional string short_desc = 7; + optional string long_desc = 8; + optional string category = 9; + + repeated string feature = 10; + + message Dependencies + { + repeated string after_plugin = 1; + repeated string before_plugin = 2; + + repeated string require_plugin = 3; + repeated string require_feature = 4; + + repeated string conflict_plugin = 5; + repeated string conflict_feature = 6; + } + + optional Dependencies deps = 11; +} + + +message PluginBrief +{ + required PluginInfo info = 1; +} + + +message Plugin +{ + required PluginInfo info = 1; + + message Option + { + enum Type // This needs to be in the same order as CCSSettingType. + { + BOOL = 0; + INT = 1; + FLOAT = 2; + STRING = 3; + COLOR = 4; + ACTION = 5; + KEY = 6; + BUTTON = 7; + EDGE = 8; + BELL = 9; + MATCH = 10; + LIST = 11; + } + + required string name = 1; + required Type type = 2; + optional Type list_type = 3; + + optional string short_desc = 4; + optional string long_desc = 5; + + optional sint32 group_id = 6 [default = -1]; + optional sint32 subgroup_id = 7 [default = -1]; + + optional bool read_only = 8; + + optional bool extensible = 9; + optional sint32 sort_start = 10 [default = -1]; + + + message ColorValue + { + optional string red = 1 [default = '0x0000']; + optional string green = 2 [default = '0x0000']; + optional string blue = 3 [default = '0x0000']; + optional string alpha = 4 [default = '0xffff']; + } + + message GenericValue + { + optional bool bool_value = 1; // for bool and bell types + optional sint32 int_value = 2; + optional float float_value = 3; + optional ColorValue color_value = 4; + optional uint32 edge_value = 5; + + // for all types other than bool/int/float/color/edge/bell + optional string string_value = 6; + } + + repeated GenericValue default_value = 11; + + // for int + optional sint32 int_min = 12; + optional sint32 int_max = 13; + + message IntDescription + { + required sint32 value = 1; + required string name = 2; + } + + repeated IntDescription int_desc = 14; + + // for float + optional float float_min = 15; + optional float float_max = 16; + optional float precision = 17; + + message StringRestriction + { + required string value = 1; + required string name = 2; + } + + repeated StringRestriction str_restriction = 18; + + optional string hints = 19; + + optional bool passive_grab = 20; + optional bool internal = 21; + optional bool nodelay = 22; + } + + + message Extension + { + required string base_plugin = 1; + repeated string base_option = 2; + optional bool display = 3; + + repeated Option.StringRestriction str_restriction = 4; + } + + + message Screen + { + repeated Option option = 1; + + repeated string group_desc = 2; + repeated string subgroup_desc = 3; + } + + optional Screen display = 2; + optional Screen screen = 3; + + repeated Extension extension = 4; +} + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/config.c b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/config.c new file mode 100644 index 00000000..62c457d2 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/config.c @@ -0,0 +1,289 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Dennis Kasprzyk <onestone@opencompositing.org> + * Copyright (C) 2007 Danny Baumann <maniac@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include <stdio.h> +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> + +#include "ccs-private.h" + +#define SETTINGPATH "compiz/compizconfig" + +static char* +getConfigFileName (void) +{ + char *configDir = NULL; + char *fileName = NULL; + + configDir = getenv ("XDG_CONFIG_HOME"); + if (configDir && strlen (configDir)) + { + asprintf (&fileName, "%s/%s/config", configDir, SETTINGPATH); + return fileName; + } + + configDir = getenv ("HOME"); + if (configDir && strlen (configDir)) + { + asprintf (&fileName, "%s/.config/%s/config", configDir, SETTINGPATH); + return fileName; + } + + return NULL; +} + +static char* +getSectionName (void) +{ + char *profile; + char *section; + + profile = getenv ("COMPIZ_CONFIG_PROFILE"); + if (profile && strlen (profile)) + { + asprintf (§ion, "general_%s", profile); + return section; + } + + profile = getenv ("GNOME_DESKTOP_SESSION_ID"); + if (profile && strlen (profile)) + return strdup ("gnome_session"); + + profile = getenv ("KDE_SESSION_VERSION"); + if (profile && strlen (profile) && strcasecmp (profile, "4") == 0) + return strdup ("kde4_session"); + + profile = getenv ("KDE_FULL_SESSION"); + if (profile && strlen (profile) && strcasecmp (profile, "true") == 0) + return strdup ("kde_session"); + + return strdup ("general"); +} + +static IniDictionary* +getConfigFile (void) +{ + char *fileName; + IniDictionary *iniFile; + + fileName = getConfigFileName(); + + if (!fileName) + return NULL; + + iniFile = ccsIniOpen (fileName); + + free (fileName); + + return iniFile; +} + +unsigned int +ccsAddConfigWatch (CCSContext *context, + FileWatchCallbackProc callback) + +{ + unsigned int ret; + char *fileName; + + fileName = getConfigFileName(); + if (!fileName) + return 0; + + ret = ccsAddFileWatch (fileName, TRUE, callback, context); + free (fileName); + + return ret; +} + +static Bool +ccsReadGlobalConfig (ConfigOption option, + char **value) +{ + IniDictionary *iniFile; + char *entry = NULL; + char *section; + Bool ret; + FILE *fp; + + /* check if the global config file exists - if it doesn't, exit + to avoid it being created by ccsIniOpen */ + fp = fopen (SYSCONFDIR "/compizconfig/config", "r"); + if (!fp) + return FALSE; + fclose (fp); + + iniFile = ccsIniOpen (SYSCONFDIR "/compizconfig/config"); + if (!iniFile) + return FALSE; + + switch (option) + { + case OptionProfile: + entry = "profile"; + break; + case OptionBackend: + entry = "backend"; + break; + case OptionIntegration: + entry = "integration"; + break; + case OptionAutoSort: + entry = "plugin_list_autosort"; + break; + default: + break; + } + + if (!entry) + { + ccsIniClose (iniFile); + return FALSE; + } + + *value = NULL; + section = getSectionName(); + ret = ccsIniGetString (iniFile, section, entry, value); + free (section); + ccsIniClose (iniFile); + + return ret; +} + +Bool +ccsReadConfig (ConfigOption option, + char **value) + +{ + IniDictionary *iniFile; + char *entry = NULL; + char *section; + Bool ret; + + iniFile = getConfigFile(); + if (!iniFile) + return ccsReadGlobalConfig (option, value); + + switch (option) + { + case OptionProfile: + entry = "profile"; + break; + case OptionBackend: + entry = "backend"; + break; + case OptionIntegration: + entry = "integration"; + break; + case OptionAutoSort: + entry = "plugin_list_autosort"; + break; + default: + break; + } + + if (!entry) + { + ccsIniClose (iniFile); + return FALSE; + } + + *value = NULL; + section = getSectionName(); + ret = ccsIniGetString (iniFile, section, entry, value); + free (section); + ccsIniClose (iniFile); + + if (!ret) + ret = ccsReadGlobalConfig (option, value); + + return ret; +} + +Bool +ccsWriteConfig (ConfigOption option, + char *value) +{ + IniDictionary *iniFile; + char *entry = NULL; + char *section; + char *fileName; + char *curVal; + Bool changed = TRUE; + + /* don't change config if nothing changed */ + if (ccsReadConfig (option, &curVal)) + { + changed = (strcmp (value, curVal) != 0); + free (curVal); + } + + if (!changed) + return TRUE; + + iniFile = getConfigFile(); + if (!iniFile) + return FALSE; + + switch (option) + { + case OptionProfile: + entry = "profile"; + break; + case OptionBackend: + entry = "backend"; + break; + case OptionIntegration: + entry = "integration"; + break; + case OptionAutoSort: + entry = "plugin_list_autosort"; + break; + default: + break; + } + + if (!entry) + { + ccsIniClose (iniFile); + return FALSE; + } + + section = getSectionName(); + ccsIniSetString (iniFile, section, entry, value); + free (section); + + fileName = getConfigFileName(); + if (!fileName) + { + ccsIniClose (iniFile); + return FALSE; + } + + ccsIniSave (iniFile, fileName); + ccsIniClose (iniFile); + free (fileName); + + return TRUE; +} + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/filewatch.c b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/filewatch.c new file mode 100644 index 00000000..1511b6ec --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/filewatch.c @@ -0,0 +1,227 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Danny Baumann <maniac@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif + +#define _GNU_SOURCE +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <malloc.h> + +#if HAVE_SYS_INOTIFY_H +#include <sys/inotify.h> +#endif + +#include <fcntl.h> + +#include <ccs.h> +#include "ccs-private.h" + +typedef struct _FilewatchData +{ + char *fileName; + int watchDesc; + unsigned int watchId; + FileWatchCallbackProc callback; + void *closure; +} + +FilewatchData; + +static FilewatchData *fwData = NULL; +static int fwDataSize = 0; +static int inotifyFd = 0; + +static inline int +findDataIndexById (unsigned int watchId) +{ + int i, index = -1; + + for (i = 0; i < fwDataSize; i++) + if (fwData[i].watchId == watchId) + { + index = i; + break; + } + + return index; +} + +void ccsCheckFileWatches (void) +{ +#if HAVE_SYS_INOTIFY_H + char buf[256 * (sizeof (struct inotify_event) + 16)]; + struct inotify_event *event; + int len, i = 0, j; + + if (!inotifyFd) + return; + + len = read (inotifyFd, buf, sizeof (buf)); + if (len < 0) + return; + + while (i < len) + { + event = (struct inotify_event *) & buf[i]; + + for (j = 0; j < fwDataSize; j++) + if ((fwData[j].watchDesc == event->wd) && fwData[j].callback) + (*fwData[j].callback) (fwData[j].watchId, fwData[j].closure); + + i += sizeof (*event) + event->len; + } +#endif +} + +unsigned int ccsAddFileWatch (const char *fileName, + Bool enable, + FileWatchCallbackProc callback, + void *closure) +{ + unsigned int i, maxWatchId = 0; + +#if HAVE_SYS_INOTIFY_H + if (!inotifyFd) + { + inotifyFd = inotify_init (); + fcntl (inotifyFd, F_SETFL, O_NONBLOCK); + } +#endif + + fwData = realloc (fwData, (fwDataSize + 1) * sizeof (FilewatchData)); + if (!fwData) + { + fwDataSize = 0; + return 0; + } + + fwData[fwDataSize].fileName = strdup (fileName); + +#if HAVE_SYS_INOTIFY_H + if (enable) + fwData[fwDataSize].watchDesc = + inotify_add_watch (inotifyFd, fileName, + IN_MODIFY | IN_MOVE | IN_MOVE_SELF | + IN_DELETE_SELF | IN_CREATE | IN_DELETE); + else +#endif + fwData[fwDataSize].watchDesc = 0; + + fwData[fwDataSize].callback = callback; + fwData[fwDataSize].closure = closure; + + /* determine current highest ID */ + for (i = 0; i < fwDataSize; i++) + if (fwData[i].watchId > maxWatchId) + maxWatchId = fwData[i].watchId; + + fwData[fwDataSize].watchId = maxWatchId + 1; + fwDataSize++; + + return (maxWatchId + 1); +} + +void +ccsRemoveFileWatch (unsigned int watchId) + +{ + int selectedIndex, i; + + selectedIndex = findDataIndexById (watchId); + /* not found */ + if (selectedIndex < 0) + return; + + /* clear entry */ + free (fwData[selectedIndex].fileName); + +#if HAVE_SYS_INOTIFY_H + if (fwData[selectedIndex].watchDesc) + inotify_rm_watch (inotifyFd, fwData[selectedIndex].watchDesc); +#endif + + /* shrink array */ + for (i = selectedIndex; i < (fwDataSize - 1); i++) + fwData[i] = fwData[i+1]; + + fwDataSize--; + + if (fwDataSize > 0) + { + fwData = realloc (fwData, fwDataSize * sizeof (FilewatchData)); + if (!fwData) + fwDataSize = 0; + } + else + { + free (fwData); + fwData = NULL; + } + + if (!fwDataSize) + { + if (inotifyFd) + close (inotifyFd); + inotifyFd = 0; + } +} + +void +ccsDisableFileWatch (unsigned int watchId) +{ + int index; + + index = findDataIndexById (watchId); + if (index < 0) + return; + +#if HAVE_SYS_INOTIFY_H + if (fwData[index].watchDesc) + { + inotify_rm_watch (inotifyFd, fwData[index].watchDesc); + fwData[index].watchDesc = 0; + } +#endif +} + +void +ccsEnableFileWatch (unsigned int watchId) +{ + int index; + + index = findDataIndexById (watchId); + if (index < 0) + return; + +#if HAVE_SYS_INOTIFY_H + if (!fwData[index].watchDesc) + fwData[index].watchDesc = + inotify_add_watch (inotifyFd, + fwData[index].fileName, + IN_MODIFY | IN_MOVE | IN_MOVE_SELF | + IN_DELETE_SELF | IN_CREATE | IN_DELETE); +#endif +} + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/ini.c b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/ini.c new file mode 100644 index 00000000..5f8e2bc3 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/ini.c @@ -0,0 +1,752 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Danny Baumann <maniac@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include <stdio.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <errno.h> + +#include <ccs.h> +#include "iniparser.h" + +/** + * Creates the parent directory for @fileName, recursively creating a directory + * tree if necessary. + * + * @param fileName: The absolute path to the desired file + * @return: True if the parent directory of the file now exists +**/ + +Bool +ccsCreateDirFor (const char *fileName) +{ + char *path, *delim; + Bool success; + + delim = strrchr (fileName, '/'); + if (!delim) + return FALSE; /* Input string is not a valid absolue path! */ + + path = malloc (delim - fileName + 1); + if (!path) + return FALSE; + + strncpy (path, fileName, delim - fileName); + path[delim - fileName] = '\0'; + + success = !mkdir (path, 0700); /* Mkdir returns 0 on success */ + success |= (errno == EEXIST); + + if (!success && (errno == ENOENT)) /* ENOENT means we must recursively */ + { /* create the parent's parent */ + if (ccsCreateDirFor (path)) + success = !mkdir (path, 0700); + } + + free (path); + return success; +} + +IniDictionary * ccsIniOpen (const char * fileName) +{ + FILE *file; + + if (!ccsCreateDirFor(fileName)) + return NULL; + + /* create file if it doesn't exist or is desired */ + file = fopen (fileName, "a+"); + if (file) + fclose (file); + + return iniparser_new ((char*) fileName); +} + +IniDictionary* +ccsIniNew (void) +{ + return dictionary_new (0); +} + +void +ccsIniClose (IniDictionary *dictionary) +{ + iniparser_free (dictionary); +} + +void +ccsIniSave (IniDictionary *dictionary, + const char *fileName) +{ + if (!ccsCreateDirFor (fileName)) + return; + + iniparser_dump_ini (dictionary, fileName); +} + +static char* +getIniString (IniDictionary *dictionary, + const char *section, + const char *entry) +{ + char *sectionName; + char *retValue; + + asprintf (§ionName, "%s:%s", section, entry); + + retValue = iniparser_getstring (dictionary, sectionName, NULL); + free (sectionName); + + return retValue; +} + +static void +setIniString (IniDictionary *dictionary, + const char *section, + const char *entry, + const char *value) +{ + char *sectionName; + + asprintf (§ionName, "%s:%s", section, entry); + + if (!iniparser_find_entry (dictionary, (char*) section)) + iniparser_add_entry (dictionary, (char*) section, NULL, NULL); + + iniparser_setstr (dictionary, sectionName, (char*) value); + + free (sectionName); +} + +Bool +ccsIniGetString (IniDictionary *dictionary, + const char *section, + const char *entry, + char **value) +{ + char *retValue; + + retValue = getIniString (dictionary, section, entry); + if (retValue) + { + *value = strdup (retValue); + return TRUE; + } + else + return FALSE; +} + +Bool +ccsIniGetInt (IniDictionary *dictionary, + const char *section, + const char *entry, + int *value) +{ + char *retValue; + + retValue = getIniString (dictionary, section, entry); + if (retValue) + { + *value = strtoul (retValue, NULL, 10); + return TRUE; + } + else + return FALSE; +} + +Bool +ccsIniGetFloat (IniDictionary *dictionary, + const char *section, + const char *entry, + float *value) +{ + char *retValue; + + retValue = getIniString (dictionary, section, entry); + if (retValue) + { + *value = (float) strtod (retValue, NULL); + return TRUE; + } + else + return FALSE; +} + +Bool +ccsIniGetBool (IniDictionary *dictionary, + const char *section, + const char *entry, + Bool *value) +{ + char *retValue; + + retValue = getIniString (dictionary, section, entry); + if (retValue) + { + if ((retValue[0] == 't') || (retValue[0] == 'T') || + (retValue[0] == 'y') || (retValue[0] == 'Y') || + (retValue[0] == '1')) + { + *value = TRUE; + } + else + *value = FALSE; + + return TRUE; + } + else + return FALSE; +} + +Bool +ccsIniGetColor (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingColorValue *value) +{ + char *retValue; + + retValue = getIniString (dictionary, section, entry); + if (retValue && ccsStringToColor (retValue, value)) + return TRUE; + else + return FALSE; +} + +Bool +ccsIniGetKey (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingKeyValue *value) +{ + char *retValue; + + retValue = getIniString (dictionary, section, entry); + if (retValue) + return ccsStringToKeyBinding (retValue, value); + else + return FALSE; +} + +Bool +ccsIniGetButton (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingButtonValue *value) +{ + char *retValue; + + retValue = getIniString (dictionary, section, entry); + if (retValue) + return ccsStringToButtonBinding (retValue, value); + else + return FALSE; +} + +Bool +ccsIniGetEdge (IniDictionary *dictionary, + const char *section, + const char *entry, + unsigned int *value) +{ + char *retValue; + + retValue = getIniString (dictionary, section, entry); + if (retValue) + { + *value = ccsStringToEdges (retValue); + return TRUE; + } + else + return FALSE; +} + +Bool +ccsIniGetBell (IniDictionary *dictionary, + const char *section, + const char *entry, + Bool *value) +{ + return ccsIniGetBool (dictionary, section, entry, value); +} + +static Bool +isEmptyString (char *value) +{ + int len, i = 0; + + len = strlen (value); + for (i = 0; i < len; i++) + { + if (!isblank (value[i])) + return FALSE; + } + return TRUE; +} + +Bool +ccsIniGetList (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingValueList *value, + CCSSetting *parent) +{ + CCSSettingValueList list = NULL; + char *valueString, *valueStart, *valString; + char *token; + int nItems = 1, i = 0, len; + + valString = getIniString (dictionary, section, entry); + if (!valString) + return FALSE; + + if (isEmptyString (valString)) + { + *value = NULL; + return TRUE; + } + + valueString = strdup (valString); + valueStart = valueString; + + /* remove trailing semicolon that we added to be able to differentiate + between an empty list and a list with one empty item */ + len = strlen (valueString); + if (valueString[len - 1] == ';') + valueString[len - 1] = 0; + + token = strchr (valueString, ';'); + while (token) + { + token = strchr (token + 1, ';'); + nItems++; + } + + token = strsep (&valueString, ";"); + switch (parent->info.forList.listType) + { + case TypeString: + case TypeMatch: + { + char **array = malloc (nItems * sizeof (char*)); + if (!array) + break; + + while (token) + { + array[i++] = strdup (token); + token = strsep (&valueString, ";"); + } + + list = ccsGetValueListFromStringArray (array, nItems, parent); + + for (i = 0; i < nItems; i++) + free (array[i]); + + free (array); + } + break; + case TypeColor: + { + CCSSettingColorValue *array; + array = malloc (nItems * sizeof (CCSSettingColorValue)); + if (!array) + break; + + while (token) + { + memset (&array[i], 0, sizeof (CCSSettingColorValue)); + ccsStringToColor (token, &array[i]); + token = strsep (&valueString, ";"); + i++; + } + + list = ccsGetValueListFromColorArray (array, nItems, parent); + free (array); + } + break; + case TypeBool: + { + Bool *array = malloc (nItems * sizeof (Bool)); + Bool isTrue; + if (!array) + break; + + while (token) + { + isTrue = (token[0] == 'y' || token[0] == 'Y' || + token[0] == '1' || + token[0] == 't' || token[0] == 'T'); + array[i++] = isTrue; + token = strsep (&valueString, ";"); + } + + list = ccsGetValueListFromBoolArray (array, nItems, parent); + free (array); + } + break; + case TypeInt: + { + int *array = malloc (nItems * sizeof (int)); + if (!array) + break; + + while (token) + { + array[i++] = strtoul (token, NULL, 10); + token = strsep (&valueString, ";"); + } + + list = ccsGetValueListFromIntArray (array, nItems, parent); + free (array); + } + break; + case TypeFloat: + { + float *array = malloc (nItems * sizeof (float)); + if (!array) + break; + + while (token) + { + array[i++] = strtod (token, NULL); + token = strsep (&valueString, ";"); + } + + list = ccsGetValueListFromFloatArray (array, nItems, parent); + free (array); + } + break; + case TypeKey: + { + CCSSettingValue *val = NULL; + list = NULL; + + while (token) + { + val = malloc (sizeof (CCSSettingValue)); + if (!val) + break; + if (ccsStringToKeyBinding (token, &val->value.asKey)) + list = ccsSettingValueListAppend (list, val); + else + free (val); + token = strsep (&valueString, ";"); + } + } + break; + case TypeButton: + { + CCSSettingValue *val = NULL; + list = NULL; + + while (token) + { + val = malloc (sizeof (CCSSettingValue)); + if (!val) + break; + if (ccsStringToButtonBinding (token, &val->value.asButton)) + list = ccsSettingValueListAppend (list, val); + else + free (val); + token = strsep (&valueString, ";"); + } + } + break; + case TypeEdge: + { + CCSSettingValue *val = NULL; + list = NULL; + + while (token) + { + val = malloc (sizeof (CCSSettingValue)); + if (!val) + break; + val->value.asEdge = ccsStringToEdges (token); + list = ccsSettingValueListAppend (list, val); + token = strsep (&valueString, ";"); + } + } + break; + case TypeBell: + { + CCSSettingValue *val = NULL; + list = NULL; + Bool isTrue; + + while (token) + { + val = malloc (sizeof (CCSSettingValue)); + if (!val) + break; + + isTrue = (token[0] == 'y' || token[0] == 'Y' || + token[0] == '1' || + token[0] == 't' || token[0] == 'T'); + + val->value.asBell = isTrue; + list = ccsSettingValueListAppend (list, val); + token = strsep (&valueString, ";"); + } + } + break; + default: + break; + } + + *value = list; + free (valueStart); + + return TRUE; +} + +void +ccsIniSetString (IniDictionary * dictionary, + const char * section, + const char * entry, + char * value) +{ + setIniString (dictionary, section, entry, value); +} + +void +ccsIniSetInt (IniDictionary *dictionary, + const char *section, + const char *entry, + int value) +{ + char *string = NULL; + + asprintf (&string, "%i", value); + if (string) + { + setIniString (dictionary, section, entry, string); + free (string); + } +} + +void +ccsIniSetFloat (IniDictionary *dictionary, + const char *section, + const char *entry, + float value) +{ + char *string = NULL; + + asprintf (&string, "%f", value); + if (string) + { + setIniString (dictionary, section, entry, string); + free (string); + } +} + +void +ccsIniSetBool (IniDictionary *dictionary, + const char *section, + const char *entry, + Bool value) +{ + setIniString (dictionary, section, entry, + value ? "true" : "false"); +} + +void +ccsIniSetColor (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingColorValue value) +{ + char *string; + + string = ccsColorToString (&value); + if (string) + { + setIniString (dictionary, section, entry, string); + free (string); + } +} + +void +ccsIniSetKey (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingKeyValue value) +{ + char *str; + + str = ccsKeyBindingToString (&value); + if (str) + { + setIniString (dictionary, section, entry, str); + free (str); + } +} + +void +ccsIniSetButton (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingButtonValue value) +{ + char *str; + + str = ccsButtonBindingToString (&value); + if (str) + { + setIniString (dictionary, section, entry, str); + free (str); + } +} + +void +ccsIniSetEdge (IniDictionary *dictionary, + const char *section, + const char *entry, + unsigned int value) +{ + char *str; + + str = ccsEdgesToString (value); + if (str) + { + setIniString (dictionary, section, entry, str); + free (str); + } +} + +void +ccsIniSetBell (IniDictionary *dictionary, + const char *section, + const char *entry, + Bool value) +{ + ccsIniSetBool (dictionary, section, entry, value); +} + +void +ccsIniSetList (IniDictionary *dictionary, + const char *section, + const char *entry, + CCSSettingValueList value, + CCSSettingType listType) +{ + char *stringBuffer, *valueString; + char valueBuffer[100]; + unsigned int bufferSize = 1024, fill; + + stringBuffer = calloc (1, bufferSize); + if (!stringBuffer) + return; + + while (value) + { + switch (listType) + { + case TypeString: + valueString = value->data->value.asString; + break; + case TypeMatch: + valueString = value->data->value.asMatch; + break; + case TypeInt: + snprintf (valueBuffer, 100, "%d", value->data->value.asInt); + valueString = valueBuffer; + break; + case TypeBool: + strncpy (valueBuffer, + (value->data->value.asBool) ? "true" : "false", 100); + valueString = valueBuffer; + break; + case TypeFloat: + snprintf (valueBuffer, 100, "%f", value->data->value.asFloat); + valueString = valueBuffer; + break; + case TypeColor: + valueString = ccsColorToString (&value->data->value.asColor); + break; + case TypeKey: + valueString = ccsKeyBindingToString (&value->data->value.asKey); + break; + case TypeButton: + valueString = + ccsButtonBindingToString (&value->data->value.asButton); + break; + case TypeEdge: + valueString = ccsEdgesToString (value->data->value.asEdge); + break; + case TypeBell: + strncpy (valueBuffer, + (value->data->value.asBell) ? "true" : "false", 100); + valueString = valueBuffer; + break; + default: + valueString = NULL; + break; + } + + if (!valueString) + return; + + fill = strlen (stringBuffer); + /* the + 1 is the semicolon we're going to add */ + if ((fill + strlen (valueString) + 1) >= bufferSize) + { + /* buffer is too small, make it larger */ + bufferSize *= 2; + stringBuffer = realloc (stringBuffer, bufferSize); + if (!stringBuffer) + return; + + /* properly NULL terminate it */ + stringBuffer[fill] = 0; + } + + /* we made sure that the buffer is large enough before, so + there is no need for strncat */ + strcat (stringBuffer, valueString); + strcat (stringBuffer, ";"); + + if (listType == TypeColor || listType == TypeKey || + listType == TypeButton || listType == TypeEdge) + { + free (valueString); + } + + value = value->next; + } + + setIniString (dictionary, section, entry, stringBuffer); + free (stringBuffer); +} + +void ccsIniRemoveEntry (IniDictionary * dictionary, + + const char * section, + const char * entry) +{ + char *sectionName; + + asprintf (§ionName, "%s:%s", section, entry); + iniparser_unset (dictionary, sectionName); + free (sectionName); +} diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/iniparser.c b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/iniparser.c new file mode 100644 index 00000000..35b526b5 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/iniparser.c @@ -0,0 +1,929 @@ +/* + Based upon libiniparser, by Nicolas Devillard + Hacked into 1 file (m-iniparser) by Freek/2005 + Original terms following: + + -- - + + Copyright (c) 2000 by Nicolas Devillard (ndevilla AT free DOT fr). + + Written by Nicolas Devillard. Not derived from licensed software. + + Permission is granted to anyone to use this software for any + purpose on any computer system, and to redistribute it freely, + subject to the following restrictions: + + 1. The author is not responsible for the consequences of use of + this software, no matter how awful, even if they arise + from defects in it. + + 2. The origin of this software must not be misrepresented, either + by explicit claim or by omission. + + 3. Altered versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 4. This notice may not be removed or altered. + + */ + + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <sys/file.h> + +#include "iniparser.h" + +#ifdef __cplusplus + +extern "C" +{ +#endif + +/* lock INI file access against concurrent access */ + +static FileLock* +ini_file_lock (const char *fileName, Bool exclusive) +{ + int fd; + FileLock *lock; + struct flock lockinfo; + + if (exclusive) + fd = open (fileName, O_WRONLY | O_CREAT | O_TRUNC, 0666); + else + fd = open (fileName, O_RDONLY | O_CREAT, 0666); + if (fd < 0) + return NULL; + + lock = malloc (sizeof (FileLock)); + if (!lock) + return NULL; + + lock->fd = fd; + memset (&lockinfo, 0, sizeof (struct flock)); + + if (exclusive) + lockinfo.l_type = F_WRLCK; + else + lockinfo.l_type = F_RDLCK; + lockinfo.l_pid = getpid(); + fcntl (fd, F_SETLKW, &lockinfo); + + return lock; +} + +static void +ini_file_unlock (FileLock *lock) +{ + struct flock lockinfo; + + memset (&lockinfo, 0, sizeof (struct flock)); + lockinfo.l_type = F_UNLCK; + lockinfo.l_pid = getpid(); + + fcntl (lock ->fd, F_SETLKW, &lockinfo); + close (lock ->fd); + free (lock ); +} + +/* strlib.c following */ + +#define ASCIILINESZ 1024 +/*-------------------------------------------------------------------------*/ +/** + @brief Convert a string to lowercase. + @param s String to convert. + @return ptr to statically allocated string. + + This function returns a pointer to a statically allocated string + containing a lowercased version of the input string. Do not free + or modify the returned string! Since the returned string is statically + allocated, it will be modified at each function call (not re-entrant). + */ +/*--------------------------------------------------------------------------*/ +static char* +strlwc (char * s) +{ + static char l[ASCIILINESZ+1]; + int i; + + if (!s) + return NULL; + + memset (l, 0, ASCIILINESZ + 1); + i = 0; + + while (s[i] && i < ASCIILINESZ) + { + l[i] = (char) tolower ((int) s[i]); + i++; + } + + l[ASCIILINESZ] = (char) 0; + + return l; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Skip blanks until the first non-blank character. + @param s String to parse. + @return Pointer to char inside given string. + + This function returns a pointer to the first non-blank character in the + given string. + */ +/*--------------------------------------------------------------------------*/ +static char* +strskp (char * s) +{ + char * skip = s; + + if (!s) + return NULL; + + while (isspace ((int) *skip) && *skip) + skip++; + + return skip; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Remove blanks at the end of a string. + @param s String to parse. + @return ptr to statically allocated string. + + This function returns a pointer to a statically allocated string, + which is identical to the input string, except that all blank + characters at the end of the string have been removed. + Do not free or modify the returned string! Since the returned string + is statically allocated, it will be modified at each function call + (not re-entrant). + */ +/*--------------------------------------------------------------------------*/ +static char* +strcrop (char * s) +{ + static char l[ASCIILINESZ+1]; + char *last; + + if (!s) + return NULL; + + memset (l, 0, ASCIILINESZ + 1); + strcpy (l, s); + + last = l + strlen (l); + while (last > l) + { + if (!isspace ((int) * (last - 1))) + break; + + last --; + } + + *last = (char) 0; + return l; +} + +/* dictionary.c.c following */ + +/** Maximum value size for integers and doubles. */ +#define MAXVALSZ 1024 + +/** Minimal allocated number of entries in a dictionary */ +#define DICTMINSZ 128 + +/** Invalid key token */ +#define DICT_INVALID_KEY ((char*)-1) + +/* + Doubles the allocated size associated to a pointer + 'size' is the current allocated size. + */ +static void* +mem_double (void * ptr, int size) +{ + void *newptr; + + newptr = calloc (2 * size, 1); + if (!newptr) + return NULL; + + memcpy (newptr, ptr, size); + free (ptr); + return newptr; +} + +/*--------------------------------------------------------------------------- + Function codes + ---------------------------------------------------------------------------*/ + +/*-------------------------------------------------------------------------*/ +/** + @brief Compute the hash key for a string. + @param key Character string to use for key. + @return 1 unsigned int on at least 32 bits. + + This hash function has been taken from an Article in Dr Dobbs Journal. + This is normally a collision-free function, distributing keys evenly. + The key is stored anyway in the struct so that collision can be avoided + by comparing the key itself in last resort. + */ +/*--------------------------------------------------------------------------*/ +static unsigned dictionary_hash (char * key) +{ + int len; + unsigned hash; + int i; + + len = strlen (key); + + for (hash = 0, i = 0; i < len; i++) + { + hash += (unsigned) key[i]; + hash += (hash << 10); + hash ^= (hash >> 6); + } + + hash += (hash << 3); + + hash ^= (hash >> 11); + hash += (hash << 15); + return hash; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Create a new dictionary object. + @param size Optional initial size of the dictionary. + @return 1 newly allocated dictionary objet. + + This function allocates a new dictionary object of given size and returns + it. If you do not know in advance (roughly) the number of entries in the + dictionary, give size=0. + */ +/*--------------------------------------------------------------------------*/ +dictionary* +dictionary_new (int size) +{ + dictionary *d; + + /* If no size was specified, allocate space for DICTMINSZ */ + if (size < DICTMINSZ) + size = DICTMINSZ; + + d = (dictionary *) calloc (1, sizeof (dictionary)); + if (!d) + return NULL; + + d->size = size; + d->val = (char **) calloc (size, sizeof (char*)); + if (!d->val) + { + free (d); + return NULL; + } + + d->key = (char **) calloc (size, sizeof (char*)); + if (!d->key) + { + free (d->val); + free (d); + return NULL; + } + + d->hash = (unsigned int *) calloc (size, sizeof (unsigned)); + if (!d->hash) + { + free (d->key); + free (d->val); + free (d); + return NULL; + } + + return d; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a dictionary object + @param d dictionary object to deallocate. + @return void + + Deallocate a dictionary object and all memory associated to it. + */ +/*--------------------------------------------------------------------------*/ +static void +dictionary_del (dictionary * d) +{ + int i; + + if (!d) + return; + + for (i = 0; i < d->size; i++) + { + if (d->key[i]) + free (d->key[i]); + + if (d->val[i]) + free (d->val[i]); + } + + free (d->val); + free (d->key); + free (d->hash); + free (d); + + return; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get a value from a dictionary. + @param d dictionary object to search. + @param key Key to look for in the dictionary. + @param def Default value to return if key not found. + @return 1 pointer to internally allocated character string. + + This function locates a key in a dictionary and returns a pointer to its + value, or the passed 'def' pointer if no such key can be found in + dictionary. The returned character pointer points to data internal to the + dictionary object, you should not try to free it or modify it. + */ +/*--------------------------------------------------------------------------*/ +static char* +dictionary_get (dictionary * d, char * key, char * def) +{ + unsigned hash; + int i; + + hash = dictionary_hash (key); + + for (i = 0; i < d->size; i++) + { + if (!d->key) + continue; + + /* Compare hash */ + if (hash == d->hash[i]) + { + /* Compare string, to avoid hash collisions */ + if (!strcmp (key, d->key[i])) + { + return d->val[i]; + } + } + } + + return def; +} + + +/*-------------------------------------------------------------------------*/ +/** + @brief Set a value in a dictionary. + @param d dictionary object to modify. + @param key Key to modify or add. + @param val Value to add. + @return void + + If the given key is found in the dictionary, the associated value is + replaced by the provided one. If the key cannot be found in the + dictionary, it is added to it. + + It is Ok to provide a NULL value for val, but NULL values for the dictionary + or the key are considered as errors: the function will return immediately + in such a case. + + Notice that if you dictionary_set a variable to NULL, a call to + dictionary_get will return a NULL value: the variable will be found, and + its value (NULL) is returned. In other words, setting the variable + content to NULL is equivalent to deleting the variable from the + dictionary. It is not possible (in this implementation) to have a key in + the dictionary without value. + */ +/*--------------------------------------------------------------------------*/ +static void +dictionary_set (dictionary * d, char * key, char * val) +{ + int i; + unsigned hash; + + if (!d || !key) + return; + + /* Compute hash for this key */ + hash = dictionary_hash (key); + + /* Find if value is already in blackboard */ + if (d->n > 0) + { + for (i = 0; i < d->size; i++) + { + if (!d->key[i]) + continue; + + if (hash == d->hash[i]) + { + /* Same hash value */ + if (!strcmp (key, d->key[i])) + { + /* Same key */ + /* Found a value: modify and return */ + if (d->val[i]) + free (d->val[i]); + + d->val[i] = val ? strdup (val) : NULL; + /* Value has been modified: return */ + return; + } + } + } + } + + /* Add a new value */ + /* See if dictionary needs to grow */ + if (d->n == d->size) + { + /* Reached maximum size: reallocate blackboard */ + d->val = (char **) mem_double (d->val, d->size * sizeof (char*)); + d->key = (char **) mem_double (d->key, d->size * sizeof (char*)); + d->hash = (unsigned int *) mem_double (d->hash, + d->size * sizeof (unsigned)); + + /* Double size */ + d->size *= 2; + } + + /* Insert key in the first empty slot */ + for (i = 0; i < d->size; i++) + { + if (!d->key[i]) + { + /* Add key here */ + break; + } + } + + /* Copy key */ + d->key[i] = strdup (key); + d->val[i] = val ? strdup (val) : NULL; + d->hash[i] = hash; + d->n++; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete a key in a dictionary + @param d dictionary object to modify. + @param key Key to remove. + @return void + + This function deletes a key in a dictionary. Nothing is done if the + key cannot be found. + */ +/*--------------------------------------------------------------------------*/ +static void +dictionary_unset (dictionary * d, char * key) +{ + unsigned hash; + int i; + + hash = dictionary_hash (key); + + for (i = 0; i < d->size; i++) + { + if (!d->key[i]) + continue; + + /* Compare hash */ + if (hash == d->hash[i]) + { + /* Compare string, to avoid hash collisions */ + if (!strcmp (key, d->key[i])) + { + /* Found key */ + break; + } + } + } + + if (i >= d->size) + /* Key not found */ + return; + + free (d->key[i]); + + d->key[i] = NULL; + if (d->val[i]) + { + free (d->val[i]); + d->val[i] = NULL; + } + + d->hash[i] = 0; + d->n --; +} + +/* iniparser.c.c following */ +#define ASCIILINESZ 1024 +#define INI_INVALID_KEY ((char*)-1) + +/* Private: add an entry to the dictionary */ +void +iniparser_add_entry (dictionary * d, + char * sec, + char * key, + char * val) +{ + char longkey[2*ASCIILINESZ+1]; + + /* Make a key as section:keyword */ + + if (key) + sprintf (longkey, "%s:%s", sec, key); + else + strcpy (longkey, sec); + + /* Add (key,val) to dictionary */ + dictionary_set (d, longkey, val); +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get number of sections in a dictionary + @param d Dictionary to examine + @return int Number of sections found in dictionary + + This function returns the number of sections found in a dictionary. + The test to recognize sections is done on the string stored in the + dictionary: a section name is given as "section" whereas a key is + stored as "section:key", thus the test looks for entries that do not + contain a colon. + + This clearly fails in the case a section name contains a colon, but + this should simply be avoided. + + This function returns -1 in case of error. + */ +/*--------------------------------------------------------------------------*/ +int +iniparser_getnsec (dictionary * d) +{ + int i; + int nsec; + + if (!d) + return -1; + + nsec = 0; + for (i = 0; i < d->size; i++) + { + if (!d->key[i]) + continue; + + if (!strchr (d->key[i], ':')) + nsec++; + } + + return nsec; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get name for section n in a dictionary. + @param d Dictionary to examine + @param n Section number (from 0 to nsec-1). + @return Pointer to char string + + This function locates the n-th section in a dictionary and returns + its name as a pointer to a string statically allocated inside the + dictionary. Do not free or modify the returned string! + + This function returns NULL in case of error. + */ +/*--------------------------------------------------------------------------*/ +char* +iniparser_getsecname (dictionary * d, int n) +{ + int i; + int foundsec; + + if (!d || n < 0) + return NULL; + + foundsec = 0; + for (i = 0; i < d->size; i++) + { + if (!d->key[i]) + continue; + + if (!strchr (d->key[i], ':')) + { + foundsec++; + if (foundsec > n) + break; + } + } + + if (foundsec <= n) + return NULL; + + return d->key[i]; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Save a dictionary to a loadable ini file + @param d Dictionary to dump + @param f Opened file pointer to dump to + @return void + + This function dumps a given dictionary into a loadable ini file. + It is Ok to specify @c stderr or @c stdout as output files. + */ +/*--------------------------------------------------------------------------*/ +void +iniparser_dump_ini (dictionary * d, const char * file_name) +{ + int i, j; + char keym[ASCIILINESZ+1]; + int nsec; + char * secname; + int seclen; + FILE * f; + FileLock *lock; + + if (!d) + return; + + lock = ini_file_lock (file_name, TRUE); + if (!lock) + return; + + f = fdopen (lock->fd, "w"); + if (!f) + { + ini_file_unlock (lock); + return; + } + + nsec = iniparser_getnsec (d); + if (nsec < 1) + { + /* No section in file: dump all keys as they are */ + for (i = 0; i < d->size; i++) + { + if (!d->key[i]) + continue; + fprintf (f, "%s = %s\n", d->key[i], d->val[i]); + } + + fflush (f); + ini_file_unlock (lock); + return; + } + + for (i = 0; i < nsec; i++) + { + secname = iniparser_getsecname (d, i); + seclen = (int) strlen (secname); + fprintf (f, "[%s]\n", secname); + sprintf (keym, "%s:", secname); + + for (j = 0; j < d->size; j++) + { + if (!d->key[j]) + continue; + + if (!strncmp (d->key[j], keym, seclen + 1)) + { + fprintf (f, "%s = %s\n", + d->key[j] + seclen + 1, + d->val[j] ? d->val[j] : ""); + } + } + + fprintf (f, "\n"); + } + + fflush (f); + ini_file_unlock (lock ); +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Get the string associated to a key + @param d Dictionary to search + @param key Key string to look for + @param def Default value to return if key not found. + @return pointer to statically allocated character string + + This function queries a dictionary for a key. A key as read from an + ini file is given as "section:key". If the key cannot be found, + the pointer passed as 'def' is returned. + The returned char pointer is pointing to a string allocated in + the dictionary, do not free or modify it. + */ +/*--------------------------------------------------------------------------*/ +char* +iniparser_getstring (dictionary * d, char * key, char * def) +{ + char * lc_key; + char * sval; + + if (!d || !key) + return def; + + lc_key = strdup (strlwc (key)); + sval = dictionary_get (d, lc_key, def); + free (lc_key); + + return sval; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Finds out if a given entry exists in a dictionary + @param ini Dictionary to search + @param entry Name of the entry to look for + @return integer 1 if entry exists, 0 otherwise + + Finds out if a given entry exists in the dictionary. Since sections + are stored as keys with NULL associated values, this is the only way + of querying for the presence of sections in a dictionary. + */ +/*--------------------------------------------------------------------------*/ +int +iniparser_find_entry (dictionary *ini, char *entry) +{ + int found = 0; + + if (iniparser_getstring (ini, entry, INI_INVALID_KEY) != INI_INVALID_KEY) + { + found = 1; + } + + return found; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Set an entry in a dictionary. + @param ini Dictionary to modify. + @param entry Entry to modify (entry name) + @param val New value to associate to the entry. + @return int 0 if Ok, -1 otherwise. + + If the given entry can be found in the dictionary, it is modified to + contain the provided value. If it cannot be found, -1 is returned. + It is Ok to set val to NULL. + */ +/*--------------------------------------------------------------------------*/ +int +iniparser_setstr (dictionary * ini, char * entry, char * val) +{ + dictionary_set (ini, strlwc (entry), val); + return 0; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Delete an entry in a dictionary + @param ini Dictionary to modify + @param entry Entry to delete (entry name) + @return void + + If the given entry can be found, it is deleted from the dictionary. + */ +/*--------------------------------------------------------------------------*/ +void +iniparser_unset (dictionary * ini, char * entry) +{ + dictionary_unset (ini, strlwc (entry)); +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Parse an ini file and return an allocated dictionary object + @param ininame Name of the ini file to read. + @return Pointer to newly allocated dictionary + + This is the parser for ini files. This function is called, providing + the name of the file to be read. It returns a dictionary object that + should not be accessed directly, but through accessor functions + instead. + + The returned dictionary must be freed using iniparser_free(). + */ +/*--------------------------------------------------------------------------*/ +dictionary* +iniparser_new (char *ininame) +{ + dictionary * d; + char lin[ASCIILINESZ+1]; + char sec[ASCIILINESZ+1]; + char key[ASCIILINESZ+1]; + char val[ASCIILINESZ+1]; + char * where; + FILE * ini; + int lineno; + FileLock * lock; + + lock = ini_file_lock (ininame, FALSE); + if (!lock) + return NULL; + + ini = fopen (ininame, "r"); + if (!ini) + { + ini_file_unlock (lock ); + return NULL; + } + + sec[0] = 0; + + /* + * Initialize a new dictionary entry + */ + d = dictionary_new (0); + lineno = 0; + + while (fgets (lin, ASCIILINESZ, ini) != NULL) + { + lineno++; + where = strskp (lin); /* Skip leading spaces */ + + if (*where == ';' || *where == '#' || *where == 0) + continue; /* Comment lines */ + else + { + val[0] = '\0'; + + if (sscanf (where, "[%[^]]", sec) == 1) + { + /* Valid section name */ + strcpy (sec, strlwc (sec)); + iniparser_add_entry (d, sec, NULL, NULL); + } + else if (sscanf (where, "%[^=] = \"%[^\"]\"", key, val) == 2 || + sscanf (where, "%[^=] = '%[^\']'", key, val) == 2 || + sscanf (where, "%[^=] = %[^\n]", key, val) >= 1) + { + strcpy (key, strlwc (strcrop (key))); + /* + * sscanf cannot handle "" or '' as empty value, + * this is done here + */ + + if (!strcmp (val, "\"\"") || !strcmp (val, "''")) + { + val[0] = (char) 0; + } + else + { + strcpy (val, strcrop (val)); + } + + iniparser_add_entry (d, sec, key, val); + } + } + } + + fclose (ini); + ini_file_unlock (lock ); + + return d; +} + +/*-------------------------------------------------------------------------*/ +/** + @brief Free all memory associated to an ini dictionary + @param d Dictionary to free + @return void + + Free all memory associated to an ini dictionary. + It is mandatory to call this function before the dictionary object + gets out of the current context. + */ +/*--------------------------------------------------------------------------*/ +void +iniparser_free (dictionary * d) +{ + dictionary_del (d); +} + +#ifdef __cplusplus +} + +#endif diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/iniparser.h b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/iniparser.h new file mode 100644 index 00000000..78dee5da --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/iniparser.h @@ -0,0 +1,65 @@ +/* + Based upon libiniparser, by Nicolas Devillard + Hacked into 1 file (m-iniparser) by Freek/2005 + Original terms following: + + -- - + + Copyright (c) 2000 by Nicolas Devillard (ndevilla AT free DOT fr). + + Written by Nicolas Devillard. Not derived from licensed software. + + Permission is granted to anyone to use this software for any + purpose on any computer system, and to redistribute it freely, + subject to the following restrictions: + + 1. The author is not responsible for the consequences of use of + this software, no matter how awful, even if they arise + from defects in it. + + 2. The origin of this software must not be misrepresented, either + by explicit claim or by omission. + + 3. Altered versions must be plainly marked as such, and must not + be misrepresented as being the original software. + + 4. This notice may not be removed or altered. + + */ + + +#ifndef _INIPARSER_H_ +#define _INIPARSER_H_ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <ctype.h> + +#include <ccs.h> + +typedef IniDictionary dictionary; + +typedef struct _FileLock +{ + int fd; +} FileLock; + +/* generated by genproto */ + +dictionary * iniparser_new(char *ininame); +dictionary * dictionary_new(int size); +void iniparser_free(dictionary * d); + + +int iniparser_getnsec(dictionary * d); +char * iniparser_getsecname(dictionary * d, int n); +void iniparser_dump_ini(dictionary * d, const char * file_name); +char * iniparser_getstring(dictionary * d, char * key, char * def); +void iniparser_add_entry(dictionary * d, char * sec, char * key, char * val); +int iniparser_find_entry(dictionary * ini, char * entry); +int iniparser_setstr(dictionary * ini, char * entry, char * val); +void iniparser_unset(dictionary * ini, char * entry); + +#endif + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/lists.c b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/lists.c new file mode 100644 index 00000000..5f58a2a5 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/lists.c @@ -0,0 +1,505 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Dennis Kasprzyk <onestone@opencompositing.org> + * Copyright (C) 2007 Danny Baumann <maniac@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#define _GNU_SOURCE +#include <stdlib.h> +#include <string.h> +#include <malloc.h> + +#include <ccs.h> + +#include "ccs-private.h" + +typedef void (*freeFunc) (void *ptr); + +#define CCSLIST(type,dtype,ocomp,compfunc) \ + \ + CCS##type##List ccs##type##ListAppend (CCS##type##List list, dtype *data) \ + { \ + CCS##type##List l = list; \ + CCS##type##List ne = malloc(sizeof(struct _CCS##type##List)); \ + if (!ne) \ + return list; \ + ne->data = data; \ + ne->next = NULL; \ + if (!list) \ + return ne; \ + while (l->next) l = l->next; \ + l->next = ne; \ + return list; \ + } \ + \ + CCS##type##List ccs##type##ListPrepend (CCS##type##List list, dtype *data) \ + { \ + CCS##type##List ne = malloc(sizeof(struct _CCS##type##List)); \ + if (!ne) \ + return list; \ + ne->data = data; \ + ne->next = list; \ + return ne; \ + } \ + \ + CCS##type##List ccs##type##ListInsert (CCS##type##List list, dtype *data, int position) \ + { \ + CCS##type##List l = list; \ + CCS##type##List ne = malloc(sizeof(struct _CCS##type##List)); \ + if (!ne) \ + return list; \ + ne->data = data; \ + ne->next = list; \ + if (!list || !position) \ + return ne; \ + position--; \ + while (l->next && position) \ + { \ + l = l->next; \ + position--; \ + } \ + ne->next = l->next; \ + l->next = ne; \ + return list; \ + } \ + \ + CCS##type##List ccs##type##ListInsertBefore (CCS##type##List list, CCS##type##List sibling, dtype *data) \ + { \ + CCS##type##List l = list; \ + CCS##type##List ne = malloc(sizeof(struct _CCS##type##List)); \ + if (!ne) \ + return list; \ + while (l && (l != sibling)) l = l->next; \ + ne->data = data; \ + ne->next = l; \ + return ne; \ + } \ + \ + unsigned int ccs##type##ListLength (CCS##type##List list) \ + { \ + unsigned int count = 0; \ + CCS##type##List l = list; \ + while (l) \ + { \ + l = l->next; \ + count++; \ + } \ + return count; \ + } \ + \ + CCS##type##List ccs##type##ListFind (CCS##type##List list, dtype *data) \ + { \ + CCS##type##List l = list; \ + while (l) \ + { \ + if (!data && !l->data) break; \ + if ((ocomp)?(compfunc):(memcmp(l->data, data, sizeof(dtype)) == 0)) break; \ + l = l->next; \ + } \ + return l; \ + } \ + \ + CCS##type##List ccs##type##ListGetItem (CCS##type##List list, unsigned int index) \ + { \ + CCS##type##List l = list; \ + while (l && index) \ + { \ + l = l->next; \ + index--; \ + } \ + return l; \ + } \ + \ + CCS##type##List ccs##type##ListRemove (CCS##type##List list, dtype *data, Bool freeObj) \ + { \ + CCS##type##List l = list; \ + CCS##type##List prev = NULL; \ + Bool found = FALSE; \ + if (!data) \ + return list; \ + while (l) \ + { \ + if (!l->data) continue; \ + if ((ocomp)?(compfunc):(memcmp(l->data, data, sizeof(dtype)) == 0)) \ + { \ + found = TRUE; \ + break; \ + } \ + prev = l; \ + l = l->next; \ + } \ + if (!found) \ + return list; \ + if (l) \ + { \ + if (prev) prev->next = l->next; \ + else list = l->next; \ + if (freeObj) \ + ccsFree##type (l->data); \ + free (l); \ + } \ + return list; \ + } \ + \ + CCS##type##List ccs##type##ListFree (CCS##type##List list, Bool freeObj) \ + { \ + CCS##type##List l = list; \ + CCS##type##List le = NULL; \ + while (l) \ + { \ + le = l; \ + l = l->next; \ + if (freeObj) \ + ccsFree##type (le->data); \ + free(le); \ + } \ + return NULL; \ + } + +CCSLIST (Plugin, CCSPlugin, FALSE, 0) +CCSLIST (Setting, CCSSetting, FALSE, 0) +CCSLIST (String, char, TRUE, strcmp (data, l->data) == 0) +CCSLIST (Group, CCSGroup, FALSE, 0) +CCSLIST (SubGroup, CCSSubGroup, FALSE, 0) +CCSLIST (SettingValue, CCSSettingValue, FALSE, 0) +CCSLIST (PluginConflict, CCSPluginConflict, FALSE, 0) +CCSLIST (BackendInfo, CCSBackendInfo, FALSE, 0) +CCSLIST (IntDesc, CCSIntDesc, FALSE, 0) +CCSLIST (StrRestriction, CCSStrRestriction, FALSE, 0) +CCSLIST (StrExtension, CCSStrExtension, FALSE, 0) + +CCSSettingValueList ccsGetValueListFromStringList (CCSStringList list, + CCSSetting *parent) +{ + CCSSettingValueList rv = NULL; + + while (list) + { + CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + return rv; + + value->isListChild = TRUE; + value->parent = parent; + value->value.asString = strdup (list->data); + rv = ccsSettingValueListAppend (rv, value); + list = list->next; + } + + return rv; +} + +CCSStringList ccsGetStringListFromValueList (CCSSettingValueList list) +{ + CCSStringList rv = NULL; + + while (list) + { + rv = ccsStringListAppend (rv, strdup (list->data->value.asString) ); + list = list->next; + } + + return rv; +} + +char ** ccsGetStringArrayFromList (CCSStringList list, int *num) +{ + char ** rv = NULL; + int length = ccsStringListLength (list); + int i; + + if (length) + { + rv = calloc (length, sizeof (char *)); + if (!rv) + return NULL; + } + + for (i = 0; i < length; i++, list = list->next) + rv[i] = strdup (list->data); + + *num = length; + + return rv; +} + +CCSStringList ccsGetListFromStringArray (char ** array, int num) +{ + CCSStringList rv = NULL; + int i; + + for (i = 0; i < num; i++) + rv = ccsStringListAppend (rv, strdup (array[i]) ); + + return rv; +} + +char ** ccsGetStringArrayFromValueList (CCSSettingValueList list, int *num) +{ + char ** rv = NULL; + int length = ccsSettingValueListLength (list); + int i; + + if (length) + { + rv = calloc (length, sizeof (char *)); + if (!rv) + return NULL; + } + + for (i = 0; i < length; i++, list = list->next) + rv[i] = strdup (list->data->value.asString); + + *num = length; + + return rv; +} + +char ** ccsGetMatchArrayFromValueList (CCSSettingValueList list, int *num) +{ + char ** rv = NULL; + int length = ccsSettingValueListLength (list); + int i; + + if (length) + { + rv = calloc (length, sizeof (char *)); + if (!rv) + return NULL; + } + + for (i = 0; i < length; i++, list = list->next) + rv[i] = strdup (list->data->value.asMatch); + + *num = length; + + return rv; +} + +int * ccsGetIntArrayFromValueList (CCSSettingValueList list, int *num) +{ + int * rv = NULL; + int length = ccsSettingValueListLength (list); + int i; + + if (length) + { + rv = calloc (length, sizeof (int)); + if (!rv) + return NULL; + } + + for (i = 0; i < length; i++, list = list->next) + rv[i] = list->data->value.asInt; + + *num = length; + + return rv; +} + +float * ccsGetFloatArrayFromValueList (CCSSettingValueList list, int *num) +{ + float * rv = NULL; + int length = ccsSettingValueListLength (list); + int i; + + if (length) + { + rv = calloc (length, sizeof (float)); + if (!rv) + return NULL; + } + + for (i = 0; i < length; i++, list = list->next) + rv[i] = list->data->value.asFloat; + + *num = length; + + return rv; +} + +Bool * ccsGetBoolArrayFromValueList (CCSSettingValueList list, int *num) +{ + Bool * rv = NULL; + int length = ccsSettingValueListLength (list); + int i; + + if (length) + { + rv = calloc (length, sizeof (Bool)); + if (!rv) + return NULL; + } + + for (i = 0; i < length; i++, list = list->next) + rv[i] = list->data->value.asBool; + + *num = length; + + return rv; +} + +CCSSettingColorValue * ccsGetColorArrayFromValueList (CCSSettingValueList list, + int *num) +{ + CCSSettingColorValue * rv = NULL; + int length = ccsSettingValueListLength (list); + int i; + + if (length) + { + rv = calloc (length, sizeof (CCSSettingColorValue)); + if (!rv) + return NULL; + } + + for (i = 0; i < length; i++, list = list->next) + memcpy (&rv[i], &list->data->value.asColor, + sizeof (CCSSettingColorValue)); + + *num = length; + + return rv; +} + +CCSSettingValueList ccsGetValueListFromStringArray (char ** array, int num, + CCSSetting *parent) +{ + CCSSettingValueList l = NULL; + int i; + + for (i = 0; i < num; i++) + { + CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + return l; + + value->isListChild = TRUE; + value->parent = parent; + value->value.asString = strdup (array[i]); + l = ccsSettingValueListAppend (l, value); + } + + return l; +} + +CCSSettingValueList ccsGetValueListFromMatchArray (char ** array, int num, + CCSSetting *parent) +{ + CCSSettingValueList l = NULL; + int i; + + for (i = 0; i < num; i++) + { + CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + return l; + + value->isListChild = TRUE; + value->parent = parent; + value->value.asMatch = strdup (array[i]); + l = ccsSettingValueListAppend (l, value); + } + + return l; +} + +CCSSettingValueList ccsGetValueListFromIntArray (int * array, int num, + CCSSetting *parent) +{ + CCSSettingValueList l = NULL; + int i; + + for (i = 0; i < num; i++) + { + CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + return l; + + value->isListChild = TRUE; + value->parent = parent; + value->value.asInt = array[i]; + l = ccsSettingValueListAppend (l, value); + } + + return l; +} + +CCSSettingValueList ccsGetValueListFromFloatArray (float * array, int num, + CCSSetting *parent) +{ + CCSSettingValueList l = NULL; + int i; + + for (i = 0; i < num; i++) + { + CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + return l; + + value->isListChild = TRUE; + value->parent = parent; + value->value.asFloat = array[i]; + l = ccsSettingValueListAppend (l, value); + } + + return l; +} + +CCSSettingValueList ccsGetValueListFromBoolArray (Bool * array, int num, + CCSSetting *parent) +{ + CCSSettingValueList l = NULL; + int i; + + for (i = 0; i < num; i++) + { + CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + return l; + + value->isListChild = TRUE; + value->parent = parent; + value->value.asBool = array[i]; + l = ccsSettingValueListAppend (l, value); + } + + return l; +} + +CCSSettingValueList ccsGetValueListFromColorArray (CCSSettingColorValue * array, + int num, CCSSetting *parent) +{ + CCSSettingValueList l = NULL; + int i; + + for (i = 0; i < num; i++) + { + CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + return l; + + value->isListChild = TRUE; + value->parent = parent; + value->value.asColor = array[i]; + l = ccsSettingValueListAppend (l, value); + } + + return l; +} + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/main.c b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/main.c new file mode 100644 index 00000000..2edc49d4 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity-0.8.4/src/main.c @@ -0,0 +1,2794 @@ +/* + * Compiz configuration system library + * + * Copyright (C) 2007 Dennis Kasprzyk <onestone@opencompositing.org> + * Copyright (C) 2007 Danny Baumann <maniac@opencompositing.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif + +#define _GNU_SOURCE +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <malloc.h> +#include <libintl.h> +#include <dlfcn.h> +#include <dirent.h> +#include <math.h> + +#include <ccs.h> + +#include "ccs-private.h" +#include "iniparser.h" + +Bool basicMetadata = FALSE; + +void +ccsSetBasicMetadata (Bool value) +{ + basicMetadata = value; +} + +static void +initGeneralOptions (CCSContext * context) +{ + char *val; + + if (ccsReadConfig (OptionBackend, &val)) + { + ccsSetBackend (context, val); + free (val); + } + else + ccsSetBackend (context, "ini"); + + if (ccsReadConfig (OptionProfile, &val)) + { + ccsSetProfile (context, val); + free (val); + } + else + ccsSetProfile (context, ""); + + if (ccsReadConfig (OptionIntegration, &val)) + { + ccsSetIntegrationEnabled (context, !strcasecmp (val, "true")); + free (val); + } + else + ccsSetIntegrationEnabled (context, TRUE); + + if (ccsReadConfig (OptionAutoSort, &val)) + { + ccsSetPluginListAutoSort (context, !strcasecmp (val, "true")); + free (val); + } + else + ccsSetPluginListAutoSort (context, TRUE); +} + +static void +configChangeNotify (unsigned int watchId, void *closure) +{ + CCSContext *context = (CCSContext *) closure; + + initGeneralOptions (context); + ccsReadSettings (context); +} + +CCSContext * +ccsEmptyContextNew (unsigned int *screens, unsigned int numScreens) +{ + CCSContext *context; + + context = calloc (1, sizeof (CCSContext)); + if (!context) + return NULL; + + context->ccsPrivate = calloc (1, sizeof (CCSContextPrivate)); + if (!context->ccsPrivate) + { + free (context); + return NULL; + } + + CONTEXT_PRIV (context); + + if (numScreens > 0 && screens) + { + int i; + + context->screens = calloc (1, sizeof (unsigned int) * numScreens); + if (!context->screens) + { + free (cPrivate); + free (context); + return NULL; + } + + context->numScreens = numScreens; + + for (i = 0; i < numScreens; i++) + context->screens[i] = screens[i]; + } + else + { + context->screens = calloc (1, sizeof (unsigned int)); + if (!context->screens) + { + free (cPrivate); + free (context); + return NULL; + } + context->screens[0] = 0; + context->numScreens = 1; + } + + initGeneralOptions (context); + cPrivate->configWatchId = ccsAddConfigWatch (context, configChangeNotify); + + if (cPrivate->backend) + D (D_NORMAL, "Backend : %s\n", cPrivate->backend->vTable->name); + D (D_NORMAL, "Integration : %s\n", cPrivate->deIntegration ? "true" : "false"); + D (D_NORMAL, "Profile : %s\n", + (cPrivate->profile && strlen (cPrivate->profile)) ? + cPrivate->profile : "default"); + + return context; +} + +static void +ccsSetActivePluginList (CCSContext * context, CCSStringList list) +{ + CCSPluginList l; + CCSPlugin *plugin; + + for (l = context->plugins; l; l = l->next) + { + PLUGIN_PRIV (l->data); + pPrivate->active = FALSE; + } + + for (; list; list = list->next) + { + plugin = ccsFindPlugin (context, list->data); + + if (plugin) + { + PLUGIN_PRIV (plugin); + pPrivate->active = TRUE; + } + } + + /* core plugin is always active */ + plugin = ccsFindPlugin (context, "core"); + if (plugin) + { + PLUGIN_PRIV (plugin); + pPrivate->active = TRUE; + } +} + +CCSContext * +ccsContextNew (unsigned int *screens, unsigned int numScreens) +{ + CCSPlugin *p; + CCSContext *context = ccsEmptyContextNew (screens, numScreens); + if (!context) + return NULL; + + ccsLoadPlugins (context); + + p = ccsFindPlugin (context, "core"); + if (p) + { + CCSSetting *s; + + ccsLoadPluginSettings (p); + + /* initialize plugin->active values */ + s = ccsFindSetting (p, "active_plugins", FALSE, 0); + if (s) + { + CCSStringList list; + CCSSettingValueList vl; + + ccsGetList (s, &vl); + list = ccsGetStringListFromValueList (vl); + ccsSetActivePluginList (context, list); + ccsStringListFree (list, TRUE); + } + } + + return context; +} + +CCSPlugin * +ccsFindPlugin (CCSContext * context, const char *name) +{ + if (!name) + name = ""; + + CCSPluginList l = context->plugins; + while (l) + { + if (!strcmp (l->data->name, name)) + return l->data; + + l = l->next; + } + + return NULL; +} + +CCSSetting * +ccsFindSetting (CCSPlugin * plugin, const char *name, + Bool isScreen, unsigned int screenNum) +{ + if (!plugin) + return NULL; + + PLUGIN_PRIV (plugin); + + if (!name) + name = ""; + + if (!pPrivate->loaded) + ccsLoadPluginSettings (plugin); + + CCSSettingList l = pPrivate->settings; + + while (l) + { + if (!strcmp (l->data->name, name) && + ((!l->data->isScreen && !isScreen) || + (l->data->isScreen && isScreen)) && + (!isScreen || (l->data->screenNum == screenNum))) + return l->data; + + l = l->next; + } + + return NULL; +} + +Bool +ccsPluginIsActive (CCSContext * context, char *name) +{ + CCSPlugin *plugin; + + plugin = ccsFindPlugin (context, name); + if (!plugin) + return FALSE; + + PLUGIN_PRIV (plugin); + + return pPrivate->active; +} + + +static void +subGroupAdd (CCSSetting * setting, CCSGroup * group) +{ + CCSSubGroupList l = group->subGroups; + CCSSubGroup *subGroup; + + while (l) + { + if (!strcmp (l->data->name, setting->subGroup)) + { + l->data->settings = ccsSettingListAppend (l->data->settings, + setting); + return; + } + + l = l->next; + } + + subGroup = calloc (1, sizeof (CCSSubGroup)); + if (subGroup) + { + group->subGroups = ccsSubGroupListAppend (group->subGroups, subGroup); + subGroup->name = strdup (setting->subGroup); + subGroup->settings = ccsSettingListAppend (subGroup->settings, setting); + } +} + +static void +groupAdd (CCSSetting * setting, CCSPluginPrivate * p) +{ + CCSGroupList l = p->groups; + CCSGroup *group; + + while (l) + { + if (!strcmp (l->data->name, setting->group)) + { + subGroupAdd (setting, l->data); + return; + } + + l = l->next; + } + + group = calloc (1, sizeof (CCSGroup)); + if (group) + { + p->groups = ccsGroupListAppend (p->groups, group); + group->name = strdup (setting->group); + subGroupAdd (setting, group); + } +} + +void +collateGroups (CCSPluginPrivate * p) +{ + CCSSettingList l = p->settings; + + while (l) + { + groupAdd (l->data, p); + l = l->next; + } +} + +void +ccsFreeContext (CCSContext * c) +{ + if (!c) + return; + + CONTEXT_PRIV (c); + + if (cPrivate->profile) + free (cPrivate->profile); + + if (cPrivate->configWatchId) + ccsRemoveFileWatch (cPrivate->configWatchId); + + if (c->changedSettings) + ccsSettingListFree (c->changedSettings, FALSE); + + if (c->screens) + free (c->screens); + + if (c->ccsPrivate) + free (c->ccsPrivate); + + ccsPluginListFree (c->plugins, TRUE); + + free (c); +} + +void +ccsFreePlugin (CCSPlugin * p) +{ + if (!p) + return; + + free (p->name); + free (p->shortDesc); + free (p->longDesc); + free (p->hints); + free (p->category); + + ccsStringListFree (p->loadAfter, TRUE); + ccsStringListFree (p->loadBefore, TRUE); + ccsStringListFree (p->requiresPlugin, TRUE); + ccsStringListFree (p->conflictPlugin, TRUE); + ccsStringListFree (p->conflictFeature, TRUE); + ccsStringListFree (p->providesFeature, TRUE); + ccsStringListFree (p->requiresFeature, TRUE); + + PLUGIN_PRIV (p); + + ccsSettingListFree (pPrivate->settings, TRUE); + ccsGroupListFree (pPrivate->groups, TRUE); + ccsStrExtensionListFree (pPrivate->stringExtensions, TRUE); + + if (pPrivate->xmlFile) + free (pPrivate->xmlFile); + + if (pPrivate->xmlPath) + free (pPrivate->xmlPath); + +#ifdef USE_PROTOBUF + if (pPrivate->pbFilePath) + free (pPrivate->pbFilePath); +#endif + + free (pPrivate); + free (p); +} + +void +ccsFreeSetting (CCSSetting * s) +{ + if (!s) + return; + + free (s->name); + free (s->shortDesc); + free (s->longDesc); + free (s->group); + free (s->subGroup); + free (s->hints); + + switch (s->type) + { + case TypeInt: + ccsIntDescListFree (s->info.forInt.desc, TRUE); + break; + case TypeString: + ccsStrRestrictionListFree (s->info.forString.restriction, TRUE); + break; + case TypeList: + if (s->info.forList.listType == TypeInt) + ccsIntDescListFree (s->info.forList.listInfo-> + forInt.desc, TRUE); + free (s->info.forList.listInfo); + break; + default: + break; + } + + if (&s->defaultValue != s->value) + ccsFreeSettingValue (s->value); + + ccsFreeSettingValue (&s->defaultValue); + free (s); +} + +void +ccsFreeGroup (CCSGroup * g) +{ + if (!g) + return; + + free (g->name); + ccsSubGroupListFree (g->subGroups, TRUE); + free (g); +} + +void +ccsFreeSubGroup (CCSSubGroup * s) +{ + if (!s) + return; + + free (s->name); + ccsSettingListFree (s->settings, FALSE); + free (s); +} + +void +ccsFreeSettingValue (CCSSettingValue * v) +{ + if (!v) + return; + + if (!v->parent) + return; + + CCSSettingType type = v->parent->type; + + if (v->isListChild) + type = v->parent->info.forList.listType; + + switch (type) + { + case TypeString: + free (v->value.asString); + break; + case TypeMatch: + free (v->value.asMatch); + break; + case TypeList: + if (!v->isListChild) + ccsSettingValueListFree (v->value.asList, TRUE); + break; + default: + break; + } + + if (v != &v->parent->defaultValue) + free (v); +} + +void +ccsFreePluginConflict (CCSPluginConflict * c) +{ + if (!c) + return; + + free (c->value); + + ccsPluginListFree (c->plugins, FALSE); + + free (c); +} + +void +ccsFreeBackendInfo (CCSBackendInfo * b) +{ + if (!b) + return; + + if (b->name) + free (b->name); + + if (b->shortDesc) + free (b->shortDesc); + + if (b->longDesc) + free (b->longDesc); + + free (b); +} + +void +ccsFreeIntDesc (CCSIntDesc * i) +{ + if (!i) + return; + + if (i->name) + free (i->name); + + free (i); +} + +void +ccsFreeStrRestriction (CCSStrRestriction * r) +{ + if (!r) + return; + + if (r->name) + free (r->name); + + if (r->value) + free (r->value); + + free (r); +} + +void +ccsFreeStrExtension (CCSStrExtension *e) +{ + if (!e) + return; + + if (e->basePlugin) + free (e->basePlugin); + + ccsStringListFree (e->baseSettings, TRUE); + ccsStrRestrictionListFree (e->restriction, TRUE); + + free (e); +} + +static void * +openBackend (char *backend) +{ + char *home = getenv ("HOME"); + void *dlhand = NULL; + char *dlname = NULL; + char *err = NULL; + + if (home && strlen (home)) + { + asprintf (&dlname, "%s/.compizconfig/backends/lib%s.so", + home, backend); + dlerror (); + dlhand = dlopen (dlname, RTLD_NOW | RTLD_NODELETE | RTLD_LOCAL); + err = dlerror (); + } + + if (!dlhand) + { + if (dlname) { + free (dlname); + } + asprintf (&dlname, "%s/compizconfig/backends/lib%s.so", + LIBDIR, backend); + dlhand = dlopen (dlname, RTLD_NOW | RTLD_NODELETE | RTLD_LOCAL); + err = dlerror (); + } + + free (dlname); + + if (err) + { + fprintf (stderr, "libccs: dlopen: %s\n", err); + } + + return dlhand; +} + +Bool +ccsSetBackend (CCSContext * context, char *name) +{ + CONTEXT_PRIV (context); + + if (cPrivate->backend) + { + /* no action needed if the backend is the same */ + + if (strcmp (cPrivate->backend->vTable->name, name) == 0) + return TRUE; + + if (cPrivate->backend->vTable->backendFini) + cPrivate->backend->vTable->backendFini (context); + + dlclose (cPrivate->backend->dlhand); + free (cPrivate->backend); + cPrivate->backend = NULL; + } + + void *dlhand = openBackend (name); + if (!dlhand) + { + name = "ini"; + dlhand = openBackend (name); + } + + if (!dlhand) + return FALSE; + + BackendGetInfoProc getInfo = dlsym (dlhand, "getBackendInfo"); + if (!getInfo) + { + dlclose (dlhand); + return FALSE; + } + + CCSBackendVTable *vt = getInfo (); + if (!vt) + { + dlclose (dlhand); + return FALSE; + } + + cPrivate->backend = calloc (1, sizeof (CCSBackend)); + if (!cPrivate->backend) + { + dlclose (dlhand); + return FALSE; + } + cPrivate->backend->dlhand = dlhand; + cPrivate->backend->vTable = vt; + + if (cPrivate->backend->vTable->backendInit) + cPrivate->backend->vTable->backendInit (context); + + ccsDisableFileWatch (cPrivate->configWatchId); + ccsWriteConfig (OptionBackend, name); + ccsEnableFileWatch (cPrivate->configWatchId); + + return TRUE; +} + +static void +copyValue (CCSSettingValue * from, CCSSettingValue * to) +{ + memcpy (to, from, sizeof (CCSSettingValue)); + CCSSettingType type = from->parent->type; + + if (from->isListChild) + type = from->parent->info.forList.listType; + + switch (type) + { + case TypeString: + to->value.asString = strdup (from->value.asString); + break; + case TypeMatch: + to->value.asMatch = strdup (from->value.asMatch); + break; + case TypeList: + to->value.asList = NULL; + CCSSettingValueList l = from->value.asList; + while (l) + { + CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + break; + + copyValue (l->data, value); + to->value.asList = ccsSettingValueListAppend (to->value.asList, + value); + l = l->next; + } + break; + default: + break; + } +} + +static void +copyFromDefault (CCSSetting * setting) +{ + CCSSettingValue *value; + + if (setting->value != &setting->defaultValue) + ccsFreeSettingValue (setting->value); + + value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + { + setting->value = &setting->defaultValue; + setting->isDefault = TRUE; + return; + } + + copyValue (&setting->defaultValue, value); + setting->value = value; + setting->isDefault = FALSE; +} + +void +ccsResetToDefault (CCSSetting * setting) +{ + if (setting->value != &setting->defaultValue) + { + ccsFreeSettingValue (setting->value); + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + } + + setting->value = &setting->defaultValue; + setting->isDefault = TRUE; +} + +Bool +ccsSetInt (CCSSetting * setting, int data) +{ + if (setting->type != TypeInt) + return FALSE; + + if (setting->isDefault && (setting->defaultValue.value.asInt == data)) + return TRUE; + + if (!setting->isDefault && (setting->defaultValue.value.asInt == data)) + { + ccsResetToDefault (setting); + return TRUE; + } + + if (setting->value->value.asInt == data) + return TRUE; + + if ((data < setting->info.forInt.min) || + (data > setting->info.forInt.max)) + return FALSE; + + if (setting->isDefault) + copyFromDefault (setting); + + setting->value->value.asInt = data; + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetFloat (CCSSetting * setting, float data) +{ + if (setting->type != TypeFloat) + return FALSE; + + if (setting->isDefault && (setting->defaultValue.value.asFloat == data)) + return TRUE; + + if (!setting->isDefault && (setting->defaultValue.value.asFloat == data)) + { + ccsResetToDefault (setting); + return TRUE; + } + + /* allow the values to differ a tiny bit because of + possible rounding / precision issues */ + if (fabs (setting->value->value.asFloat - data) < 1e-5) + return TRUE; + + if ((data < setting->info.forFloat.min) || + (data > setting->info.forFloat.max)) + return FALSE; + + if (setting->isDefault) + copyFromDefault (setting); + + setting->value->value.asFloat = data; + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetBool (CCSSetting * setting, Bool data) +{ + if (setting->type != TypeBool) + return FALSE; + + if (setting->isDefault + && ((setting->defaultValue.value.asBool && data) + || (!setting->defaultValue.value.asBool && !data))) + return TRUE; + + if (!setting->isDefault + && ((setting->defaultValue.value.asBool && data) + || (!setting->defaultValue.value.asBool && !data))) + { + ccsResetToDefault (setting); + return TRUE; + } + + if ((setting->value->value.asBool && data) + || (!setting->value->value.asBool && !data)) + return TRUE; + + if (setting->isDefault) + copyFromDefault (setting); + + setting->value->value.asBool = data; + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetString (CCSSetting * setting, const char *data) +{ + if (setting->type != TypeString) + return FALSE; + + if (!data) + return FALSE; + + Bool isDefault = strcmp (setting->defaultValue.value.asString, data) == 0; + + if (setting->isDefault && isDefault) + return TRUE; + + if (!setting->isDefault && isDefault) + { + ccsResetToDefault (setting); + return TRUE; + } + + if (!strcmp (setting->value->value.asString, data)) + return TRUE; + + if (setting->isDefault) + copyFromDefault (setting); + + free (setting->value->value.asString); + + setting->value->value.asString = strdup (data); + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetColor (CCSSetting * setting, CCSSettingColorValue data) +{ + if (setting->type != TypeColor) + return FALSE; + + CCSSettingColorValue defValue = setting->defaultValue.value.asColor; + + Bool isDefault = ccsIsEqualColor (defValue, data); + + if (setting->isDefault && isDefault) + return TRUE; + + if (!setting->isDefault && isDefault) + { + ccsResetToDefault (setting); + return TRUE; + } + + if (ccsIsEqualColor (setting->value->value.asColor, data)) + return TRUE; + + if (setting->isDefault) + copyFromDefault (setting); + + setting->value->value.asColor = data; + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetMatch (CCSSetting * setting, const char *data) +{ + if (setting->type != TypeMatch) + return FALSE; + + if (!data) + return FALSE; + + Bool isDefault = strcmp (setting->defaultValue.value.asMatch, data) == 0; + + if (setting->isDefault && isDefault) + return TRUE; + + if (!setting->isDefault && isDefault) + { + ccsResetToDefault (setting); + return TRUE; + } + + if (!strcmp (setting->value->value.asMatch, data)) + return TRUE; + + if (setting->isDefault) + copyFromDefault (setting); + + free (setting->value->value.asMatch); + + setting->value->value.asMatch = strdup (data); + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetKey (CCSSetting * setting, CCSSettingKeyValue data) +{ + if (setting->type != TypeKey) + return FALSE; + + CCSSettingKeyValue defValue = setting->defaultValue.value.asKey; + + Bool isDefault = ccsIsEqualKey (data, defValue); + + if (setting->isDefault && isDefault) + return TRUE; + + if (!setting->isDefault && isDefault) + { + ccsResetToDefault (setting); + return TRUE; + } + + if (ccsIsEqualKey (setting->value->value.asKey, data)) + return TRUE; + + if (setting->isDefault) + copyFromDefault (setting); + + setting->value->value.asKey.keysym = data.keysym; + setting->value->value.asKey.keyModMask = data.keyModMask; + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetButton (CCSSetting * setting, CCSSettingButtonValue data) +{ + if (setting->type != TypeButton) + return FALSE; + + CCSSettingButtonValue defValue = setting->defaultValue.value.asButton; + + Bool isDefault = ccsIsEqualButton (data, defValue); + + if (setting->isDefault && isDefault) + return TRUE; + + if (!setting->isDefault && isDefault) + { + ccsResetToDefault (setting); + return TRUE; + } + + if (ccsIsEqualButton (setting->value->value.asButton, data)) + return TRUE; + + if (setting->isDefault) + copyFromDefault (setting); + + setting->value->value.asButton.button = data.button; + setting->value->value.asButton.buttonModMask = data.buttonModMask; + setting->value->value.asButton.edgeMask = data.edgeMask; + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetEdge (CCSSetting * setting, unsigned int data) +{ + if (setting->type != TypeEdge) + return FALSE; + + Bool isDefault = (data == setting->defaultValue.value.asEdge); + + if (setting->isDefault && isDefault) + return TRUE; + + if (!setting->isDefault && isDefault) + { + ccsResetToDefault (setting); + return TRUE; + } + + if (setting->value->value.asEdge == data) + return TRUE; + + if (setting->isDefault) + copyFromDefault (setting); + + setting->value->value.asEdge = data; + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetBell (CCSSetting * setting, Bool data) +{ + if (setting->type != TypeBell) + return FALSE; + + Bool isDefault = (data == setting->defaultValue.value.asBool); + + if (setting->isDefault && isDefault) + return TRUE; + + if (!setting->isDefault && isDefault) + { + ccsResetToDefault (setting); + return TRUE; + } + + if (setting->value->value.asBell == data) + return TRUE; + + if (setting->isDefault) + copyFromDefault (setting); + + setting->value->value.asBell = data; + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +static Bool +ccsCompareLists (CCSSettingValueList l1, CCSSettingValueList l2, + CCSSettingListInfo info) +{ + while (l1 && l2) + { + switch (info.listType) + { + case TypeInt: + if (l1->data->value.asInt != l2->data->value.asInt) + return FALSE; + break; + case TypeBool: + if (l1->data->value.asBool != l2->data->value.asBool) + return FALSE; + break; + case TypeFloat: + if (l1->data->value.asFloat != l2->data->value.asFloat) + return FALSE; + break; + case TypeString: + if (strcmp (l1->data->value.asString, l2->data->value.asString)) + return FALSE; + break; + case TypeMatch: + if (strcmp (l1->data->value.asMatch, l2->data->value.asMatch)) + return FALSE; + break; + case TypeKey: + if (!ccsIsEqualKey + (l1->data->value.asKey, l2->data->value.asKey)) + return FALSE; + break; + case TypeButton: + if (!ccsIsEqualButton + (l1->data->value.asButton, l2->data->value.asButton)) + return FALSE; + break; + case TypeEdge: + if (l1->data->value.asEdge != l2->data->value.asEdge) + return FALSE; + break; + case TypeBell: + if (l1->data->value.asBell != l2->data->value.asBell) + return FALSE; + break; + case TypeColor: + if (!ccsIsEqualColor + (l1->data->value.asColor, l2->data->value.asColor)) + return FALSE; + break; + default: + return FALSE; + break; + } + + l1 = l1->next; + l2 = l2->next; + } + + if ((!l1 && l2) || (l1 && !l2)) + return FALSE; + + return TRUE; +} + +static CCSSettingValueList +ccsCopyList (CCSSettingValueList l1, CCSSetting * setting) +{ + CCSSettingValueList l2 = NULL; + + while (l1) + { + CCSSettingValue *value = calloc (1, sizeof (CCSSettingValue)); + if (!value) + return l2; + + value->parent = setting; + value->isListChild = TRUE; + + switch (setting->info.forList.listType) + { + case TypeInt: + value->value.asInt = l1->data->value.asInt; + break; + case TypeBool: + value->value.asBool = l1->data->value.asBool; + break; + case TypeFloat: + value->value.asFloat = l1->data->value.asFloat; + break; + case TypeString: + value->value.asString = strdup (l1->data->value.asString); + break; + case TypeMatch: + value->value.asMatch = strdup (l1->data->value.asMatch); + break; + case TypeKey: + memcpy (&value->value.asKey, &l1->data->value.asKey, + sizeof (CCSSettingKeyValue)); + break; + case TypeButton: + memcpy (&value->value.asButton, &l1->data->value.asButton, + sizeof (CCSSettingButtonValue)); + break; + case TypeEdge: + value->value.asEdge = l1->data->value.asEdge; + break; + case TypeBell: + value->value.asBell = l1->data->value.asBell; + break; + case TypeColor: + memcpy (&value->value.asColor, &l1->data->value.asColor, + sizeof (CCSSettingColorValue)); + break; + default: + /* FIXME If l2 != NULL, we leak l2 */ + free (value); + return FALSE; + break; + } + + l2 = ccsSettingValueListAppend (l2, value); + l1 = l1->next; + } + + return l2; +} + +Bool +ccsSetList (CCSSetting * setting, CCSSettingValueList data) +{ + if (setting->type != TypeList) + return FALSE; + + Bool isDefault = ccsCompareLists (setting->defaultValue.value.asList, data, + setting->info.forList); + + if (setting->isDefault && isDefault) + return TRUE; + + if (!setting->isDefault && isDefault) + { + ccsResetToDefault (setting); + return TRUE; + } + + if (ccsCompareLists (setting->value->value.asList, data, + setting->info.forList)) + return TRUE; + + if (setting->isDefault) + copyFromDefault (setting); + + ccsSettingValueListFree (setting->value->value.asList, TRUE); + + setting->value->value.asList = ccsCopyList (data, setting); + + if ((strcmp (setting->name, "active_plugins") == 0) && + (strcmp (setting->parent->name, "core") == 0)) + { + CCSStringList list; + + list = ccsGetStringListFromValueList (setting->value->value.asList); + ccsSetActivePluginList (setting->parent->context, list); + ccsStringListFree (list, TRUE); + } + + setting->parent->context->changedSettings = + ccsSettingListAppend (setting->parent->context->changedSettings, + setting); + + return TRUE; +} + +Bool +ccsSetValue (CCSSetting * setting, CCSSettingValue * data) +{ + switch (setting->type) + { + case TypeInt: + return ccsSetInt (setting, data->value.asInt); + break; + case TypeFloat: + return ccsSetFloat (setting, data->value.asFloat); + break; + case TypeBool: + return ccsSetBool (setting, data->value.asBool); + break; + case TypeColor: + return ccsSetColor (setting, data->value.asColor); + break; + case TypeString: + return ccsSetString (setting, data->value.asString); + break; + case TypeMatch: + return ccsSetMatch (setting, data->value.asMatch); + break; + case TypeKey: + return ccsSetKey (setting, data->value.asKey); + break; + case TypeButton: + return ccsSetButton (setting, data->value.asButton); + break; + case TypeEdge: + return ccsSetEdge (setting, data->value.asEdge); + break; + case TypeBell: + return ccsSetBell (setting, data->value.asBell); + break; + case TypeList: + return ccsSetList (setting, data->value.asList); + default: + break; + } + + return FALSE; +} + +Bool +ccsGetInt (CCSSetting * setting, int *data) +{ + if (setting->type != TypeInt) + return FALSE; + + *data = setting->value->value.asInt; + return TRUE; +} + +Bool +ccsGetFloat (CCSSetting * setting, float *data) +{ + if (setting->type != TypeFloat) + return FALSE; + + *data = setting->value->value.asFloat; + return TRUE; +} + +Bool +ccsGetBool (CCSSetting * setting, Bool * data) +{ + if (setting->type != TypeBool) + return FALSE; + + *data = setting->value->value.asBool; + return TRUE; +} + +Bool +ccsGetString (CCSSetting * setting, char **data) +{ + if (setting->type != TypeString) + return FALSE; + + *data = setting->value->value.asString; + return TRUE; +} + +Bool +ccsGetColor (CCSSetting * setting, CCSSettingColorValue * data) +{ + if (setting->type != TypeColor) + return TRUE; + + *data = setting->value->value.asColor; + return TRUE; +} + +Bool +ccsGetMatch (CCSSetting * setting, char **data) +{ + if (setting->type != TypeMatch) + return FALSE; + + *data = setting->value->value.asMatch; + return TRUE; +} + +Bool +ccsGetKey (CCSSetting * setting, CCSSettingKeyValue * data) +{ + if (setting->type != TypeKey) + return FALSE; + + *data = setting->value->value.asKey; + return TRUE; +} + +Bool +ccsGetButton (CCSSetting * setting, CCSSettingButtonValue * data) +{ + if (setting->type != TypeButton) + return FALSE; + + *data = setting->value->value.asButton; + return TRUE; +} + +Bool +ccsGetEdge (CCSSetting * setting, unsigned int * data) +{ + if (setting->type != TypeEdge) + return FALSE; + + *data = setting->value->value.asEdge; + return TRUE; +} + +Bool +ccsGetBell (CCSSetting * setting, Bool * data) +{ + if (setting->type != TypeBell) + return FALSE; + + *data = setting->value->value.asBell; + return TRUE; +} + +Bool +ccsGetList (CCSSetting * setting, CCSSettingValueList * data) +{ + if (setting->type != TypeList) + return FALSE; + + *data = setting->value->value.asList; + return TRUE; +} + +void +ccsContextDestroy (CCSContext * context) +{ + if (!context) + return; + + CONTEXT_PRIV (context); + + if (cPrivate->backend) + { + if (cPrivate->backend->vTable->backendFini) + cPrivate->backend->vTable->backendFini (context); + + dlclose (cPrivate->backend->dlhand); + free (cPrivate->backend); + cPrivate->backend = NULL; + } + + ccsFreeContext (context); +} + +CCSPluginList +ccsGetActivePluginList (CCSContext * context) +{ + CCSPluginList rv = NULL; + CCSPluginList l = context->plugins; + + while (l) + { + PLUGIN_PRIV (l->data); + if (pPrivate->active && strcmp (l->data->name, "ccp")) + { + rv = ccsPluginListAppend (rv, l->data); + } + + l = l->next; + } + + return rv; +} + +static CCSPlugin * +findPluginInList (CCSPluginList list, char *name) +{ + if (!name || !strlen (name)) + return NULL; + + while (list) + { + if (!strcmp (list->data->name, name)) + return list->data; + + list = list->next; + } + + return NULL; +} + +typedef struct _PluginSortHelper +{ + CCSPlugin *plugin; + CCSPluginList after; +} PluginSortHelper; + +CCSStringList +ccsGetSortedPluginStringList (CCSContext * context) +{ + CCSPluginList ap = ccsGetActivePluginList (context); + CCSPluginList list; + CCSPlugin *p = NULL; + CCSStringList rv = ccsStringListAppend (NULL, strdup ("core")); + PluginSortHelper *ph = NULL; + + p = findPluginInList (ap, "core"); + if (p) + ap = ccsPluginListRemove (ap, p, FALSE); + + int len = ccsPluginListLength (ap); + if (len == 0) + { + ccsStringListFree (rv, TRUE); + return NULL; + } + int i, j; + /* TODO: conflict handling */ + + PluginSortHelper *plugins = calloc (1, len * sizeof (PluginSortHelper)); + if (!plugins) + { + ccsStringListFree (rv, TRUE); + return NULL; + } + + for (i = 0, list = ap; i < len; i++, list = list->next) + { + plugins[i].plugin = list->data; + plugins[i].after = NULL; + } + + for (i = 0; i < len; i++) + { + CCSStringList l = plugins[i].plugin->loadAfter; + while (l) + { + p = findPluginInList (ap, l->data); + + if (p && !ccsPluginListFind (plugins[i].after, p)) + plugins[i].after = ccsPluginListAppend (plugins[i].after, p); + + l = l->next; + } + + l = plugins[i].plugin->requiresPlugin; + while (l) + { + Bool found = FALSE; + p = findPluginInList (ap, l->data); + + CCSStringList l2 = plugins[i].plugin->loadBefore; + while (l2) + { + if (strcmp (l2->data, l->data) == 0) + found = TRUE; + l2 = l2->next; + } + + if (p && !ccsPluginListFind (plugins[i].after, p) && !found) + plugins[i].after = ccsPluginListAppend (plugins[i].after, p); + + l = l->next; + } + + l = plugins[i].plugin->loadBefore; + while (l) + { + p = findPluginInList (ap, l->data); + + if (p) + { + ph = NULL; + + for (j = 0; j < len; j++) + if (p == plugins[j].plugin) + ph = &plugins[j]; + + if (ph && !ccsPluginListFind (ph->after, plugins[i].plugin)) + ph->after = ccsPluginListAppend (ph->after, + plugins[i].plugin); + } + + l = l->next; + } + } + + ccsPluginListFree (ap, FALSE); + + Bool error = FALSE; + int removed = 0; + Bool found; + + while (!error && removed < len) + { + found = FALSE; + + for (i = 0; i < len; i++) + { + if (!plugins[i].plugin) + continue; + if (plugins[i].after) + continue; + + /* This is a special case to ensure that bench is the last plugin */ + if (len - removed > 1 && + strcmp (plugins[i].plugin->name, "bench") == 0) + continue; + + found = TRUE; + removed++; + p = plugins[i].plugin; + plugins[i].plugin = NULL; + + for (j = 0; j < len; j++) + plugins[j].after = + ccsPluginListRemove (plugins[j].after, p, FALSE); + + rv = ccsStringListAppend (rv, strdup (p->name)); + } + + if (!found) + error = TRUE; + } + + if (error) + { + fprintf (stderr, + "libccs: unable to generate sorted plugin list\n"); + + for (i = 0; i < len; i++) + { + ccsPluginListFree (plugins[i].after, FALSE); + } + + ccsStringListFree (rv, TRUE); + + rv = NULL; + } + + free (plugins); + + return rv; +} + +char * +ccsGetBackend (CCSContext * context) +{ + if (!context) + return NULL; + + CONTEXT_PRIV (context); + + if (!cPrivate->backend) + return NULL; + + return cPrivate->backend->vTable->name; +} + +Bool +ccsGetIntegrationEnabled (CCSContext * context) +{ + if (!context) + return FALSE; + + CONTEXT_PRIV (context); + + return cPrivate->deIntegration; +} + +char * +ccsGetProfile (CCSContext * context) +{ + if (!context) + return NULL; + + CONTEXT_PRIV (context); + + return cPrivate->profile; +} + +Bool +ccsGetPluginListAutoSort (CCSContext * context) +{ + if (!context) + return FALSE; + + CONTEXT_PRIV (context); + + return cPrivate->pluginListAutoSort; +} + +void +ccsSetIntegrationEnabled (CCSContext * context, Bool value) +{ + CONTEXT_PRIV (context); + + /* no action required if nothing changed */ + if ((!cPrivate->deIntegration && !value) || + (cPrivate->deIntegration && value)) + return; + + cPrivate->deIntegration = value; + + ccsDisableFileWatch (cPrivate->configWatchId); + ccsWriteConfig (OptionIntegration, (value) ? "true" : "false"); + ccsEnableFileWatch (cPrivate->configWatchId); +} + +static void +ccsWriteAutoSortedPluginList (CCSContext *context) +{ + CCSStringList list; + CCSPlugin *p; + + list = ccsGetSortedPluginStringList (context); + p = ccsFindPlugin (context, "core"); + if (p) + { + CCSSetting *s; + + s = ccsFindSetting (p, "active_plugins", FALSE, 0); + if (s) + { + CCSSettingValueList vl; + + vl = ccsGetValueListFromStringList (list, s); + ccsSetList (s, vl); + ccsSettingValueListFree (vl, TRUE); + ccsWriteChangedSettings (context); + } + } + ccsStringListFree (list, TRUE); +} + +void +ccsSetPluginListAutoSort (CCSContext * context, Bool value) +{ + CONTEXT_PRIV (context); + + /* no action required if nothing changed */ + if ((!cPrivate->pluginListAutoSort && !value) || + (cPrivate->pluginListAutoSort && value)) + return; + + cPrivate->pluginListAutoSort = value; + + ccsDisableFileWatch (cPrivate->configWatchId); + ccsWriteConfig (OptionAutoSort, (value) ? "true" : "false"); + ccsEnableFileWatch (cPrivate->configWatchId); + + if (value) + ccsWriteAutoSortedPluginList (context); +} + +void +ccsSetProfile (CCSContext * context, char *name) +{ + if (!name) + name = ""; + + CONTEXT_PRIV (context); + + /* no action required if profile stays the same */ + if (cPrivate->profile && (strcmp (cPrivate->profile, name) == 0)) + return; + + if (cPrivate->profile) + free (cPrivate->profile); + + cPrivate->profile = strdup (name); + + ccsDisableFileWatch (cPrivate->configWatchId); + ccsWriteConfig (OptionProfile, cPrivate->profile); + ccsEnableFileWatch (cPrivate->configWatchId); +} + +void +ccsProcessEvents (CCSContext * context, unsigned int flags) +{ + if (!context) + return; + + CONTEXT_PRIV (context); + + ccsCheckFileWatches (); + + if (cPrivate->backend && cPrivate->backend->vTable->executeEvents) + (*cPrivate->backend->vTable->executeEvents) (flags); +} + +void +ccsReadSettings (CCSContext * context) +{ + if (!context) + return; + + CONTEXT_PRIV (context); + + if (!cPrivate->backend) + return; + + if (!cPrivate->backend->vTable->readSetting) + return; + + if (cPrivate->backend->vTable->readInit) + if (!(*cPrivate->backend->vTable->readInit) (context)) + return; + + CCSPluginList pl = context->plugins; + while (pl) + { + PLUGIN_PRIV (pl->data); + CCSSettingList sl = pPrivate->settings; + + while (sl) + { + (*cPrivate->backend->vTable->readSetting) (context, sl->data); + sl = sl->next; + } + + pl = pl->next; + } + + if (cPrivate->backend->vTable->readDone) + (*cPrivate->backend->vTable->readDone) (context); +} + +void +ccsReadPluginSettings (CCSPlugin * plugin) +{ + if (!plugin || !plugin->context) + return; + + CONTEXT_PRIV (plugin->context); + + if (!cPrivate->backend) + return; + + if (!cPrivate->backend->vTable->readSetting) + return; + + if (cPrivate->backend->vTable->readInit) + if (!(*cPrivate->backend->vTable->readInit) (plugin->context)) + return; + + PLUGIN_PRIV (plugin); + + CCSSettingList sl = pPrivate->settings; + while (sl) + { + (*cPrivate->backend->vTable->readSetting) (plugin->context, sl->data); + sl = sl->next; + } + + if (cPrivate->backend->vTable->readDone) + (*cPrivate->backend->vTable->readDone) (plugin->context); +} + +void +ccsWriteSettings (CCSContext * context) +{ + if (!context) + return; + + CONTEXT_PRIV (context); + + if (!cPrivate->backend) + return; + + if (!cPrivate->backend->vTable->writeSetting) + return; + + if (cPrivate->backend->vTable->writeInit) + if (!(*cPrivate->backend->vTable->writeInit) (context)) + return; + + CCSPluginList pl = context->plugins; + while (pl) + { + PLUGIN_PRIV (pl->data); + CCSSettingList sl = pPrivate->settings; + + while (sl) + { + (*cPrivate->backend->vTable->writeSetting) (context, sl->data); + sl = sl->next; + } + + pl = pl->next; + } + + if (cPrivate->backend->vTable->writeDone) + (*cPrivate->backend->vTable->writeDone) (context); + + context->changedSettings = + ccsSettingListFree (context->changedSettings, FALSE); +} + +void +ccsWriteChangedSettings (CCSContext * context) +{ + if (!context) + return; + + CONTEXT_PRIV (context); + + if (!cPrivate->backend) + return; + + if (!cPrivate->backend->vTable->writeSetting) + return; + + if (cPrivate->backend->vTable->writeInit) + if (!(*cPrivate->backend->vTable->writeInit) (context)) + return; + + if (ccsSettingListLength (context->changedSettings)) + { + CCSSettingList l = context->changedSettings; + + while (l) + { + (*cPrivate->backend->vTable->writeSetting) (context, l->data); + l = l->next; + } + } + + if (cPrivate->backend->vTable->writeDone) + (*cPrivate->backend->vTable->writeDone) (context); + + context->changedSettings = + ccsSettingListFree (context->changedSettings, FALSE); +} + +Bool +ccsIsEqualColor (CCSSettingColorValue c1, CCSSettingColorValue c2) +{ + if (c1.color.red == c2.color.red && + c1.color.green == c2.color.green && + c1.color.blue == c2.color.blue && + c1.color.alpha == c2.color.alpha) + { + return TRUE; + } + + return FALSE; +} + +Bool +ccsIsEqualKey (CCSSettingKeyValue c1, CCSSettingKeyValue c2) +{ + if (c1.keysym == c2.keysym && c1.keyModMask == c2.keyModMask) + return TRUE; + + return FALSE; +} + +Bool +ccsIsEqualButton (CCSSettingButtonValue c1, CCSSettingButtonValue c2) +{ + if (c1.button == c2.button && + c1.buttonModMask == c2.buttonModMask && + c1.edgeMask == c2.edgeMask) + return TRUE; + + return FALSE; +} + +Bool +ccsPluginSetActive (CCSPlugin * plugin, Bool value) +{ + if (!plugin) + return FALSE; + + PLUGIN_PRIV (plugin); + CONTEXT_PRIV (plugin->context); + + pPrivate->active = value; + + if (cPrivate->pluginListAutoSort) + ccsWriteAutoSortedPluginList (plugin->context); + + return TRUE; +} + +CCSPluginConflictList +ccsCanEnablePlugin (CCSContext * context, CCSPlugin * plugin) +{ + CCSPluginConflictList list = NULL; + CCSPluginList pl, pl2; + CCSStringList sl; + + /* look if the plugin to be loaded requires a plugin not present */ + sl = plugin->requiresPlugin; + + while (sl) + { + if (!ccsFindPlugin (context, sl->data)) + { + CCSPluginConflict *conflict = calloc (1, + sizeof (CCSPluginConflict)); + if (conflict) + { + conflict->value = strdup (sl->data); + conflict->type = ConflictPluginError; + conflict->plugins = NULL; + list = ccsPluginConflictListAppend (list, conflict); + } + } + else if (!ccsPluginIsActive (context, sl->data)) + { + /* we've not seen a matching plugin */ + CCSPluginConflict *conflict = calloc (1, + sizeof (CCSPluginConflict)); + if (conflict) + { + conflict->value = strdup (sl->data); + conflict->type = ConflictRequiresPlugin; + conflict->plugins = + ccsPluginListAppend (conflict->plugins, + ccsFindPlugin (context, sl->data)); + list = ccsPluginConflictListAppend (list, conflict); + } + } + + sl = sl->next; + } + + /* look if the new plugin wants a non-present feature */ + sl = plugin->requiresFeature; + + while (sl) + { + pl = context->plugins; + pl2 = NULL; + + while (pl) + { + CCSStringList featureList = pl->data->providesFeature; + + while (featureList) + { + if (strcmp (sl->data, featureList->data) == 0) + { + pl2 = ccsPluginListAppend (pl2, pl->data); + break; + } + featureList = featureList->next; + } + + pl = pl->next; + } + + pl = pl2; + + while (pl) + { + if (ccsPluginIsActive (context, pl->data->name)) + { + ccsPluginListFree (pl2, FALSE); + break; + } + pl = pl->next; + } + + if (!pl) + { + /* no plugin provides that feature */ + CCSPluginConflict *conflict = calloc (1, + sizeof (CCSPluginConflict)); + + if (conflict) + { + conflict->value = strdup (sl->data); + conflict->type = ConflictRequiresFeature; + conflict->plugins = pl2; + + list = ccsPluginConflictListAppend (list, conflict); + } + } + + sl = sl->next; + } + + /* look if another plugin provides the same feature */ + sl = plugin->providesFeature; + while (sl) + { + pl = context->plugins; + CCSPluginConflict *conflict = NULL; + + while (pl) + { + if (ccsPluginIsActive (context, pl->data->name)) + { + CCSStringList featureList = pl->data->providesFeature; + + while (featureList) + { + if (strcmp (sl->data, featureList->data) == 0) + { + if (!conflict) + { + conflict = calloc (1, sizeof (CCSPluginConflict)); + if (conflict) + { + conflict->value = strdup (sl->data); + conflict->type = ConflictFeature; + } + } + if (conflict) + conflict->plugins = + ccsPluginListAppend (conflict->plugins, + pl->data); + } + featureList = featureList->next; + } + } + pl = pl->next; + } + + if (conflict) + list = ccsPluginConflictListAppend (list, conflict); + + sl = sl->next; + } + + /* look if another plugin provides a conflicting feature*/ + sl = plugin->conflictFeature; + while (sl) + { + pl = context->plugins; + CCSPluginConflict *conflict = NULL; + + while (pl) + { + if (ccsPluginIsActive (context, pl->data->name)) + { + CCSStringList featureList = pl->data->providesFeature; + while (featureList) + { + if (strcmp (sl->data, featureList->data) == 0) + { + if (!conflict) + { + conflict = calloc (1, sizeof (CCSPluginConflict)); + if (conflict) + { + conflict->value = strdup (sl->data); + conflict->type = ConflictFeature; + } + } + if (conflict) + conflict->plugins = + ccsPluginListAppend (conflict->plugins, + pl->data); + } + featureList = featureList->next; + } + } + pl = pl->next; + } + + if (conflict) + list = ccsPluginConflictListAppend (list, conflict); + + sl = sl->next; + } + + /* look if the plugin to be loaded conflict with a loaded plugin */ + sl = plugin->conflictPlugin; + + while (sl) + { + if (ccsPluginIsActive (context, sl->data)) + { + CCSPluginConflict *conflict = calloc (1, + sizeof (CCSPluginConflict)); + if (conflict) + { + conflict->value = strdup (sl->data); + conflict->type = ConflictPlugin; + conflict->plugins = + ccsPluginListAppend (conflict->plugins, + ccsFindPlugin (context, sl->data)); + list = ccsPluginConflictListAppend (list, conflict); + } + } + + sl = sl->next; + } + + return list; +} + +CCSPluginConflictList +ccsCanDisablePlugin (CCSContext * context, CCSPlugin * plugin) +{ + CCSPluginConflictList list = NULL; + CCSPluginConflict *conflict = NULL; + CCSPluginList pl; + CCSStringList sl; + + /* look if the plugin to be unloaded is required by another plugin */ + pl = context->plugins; + + for (; pl; pl = pl->next) + { + CCSStringList pluginList; + + if (pl->data == plugin) + continue; + + if (!ccsPluginIsActive (context, pl->data->name)) + continue; + + pluginList = pl->data->requiresPlugin; + + while (pluginList) + { + if (strcmp (plugin->name, pluginList->data) == 0) + { + if (!conflict) + { + conflict = calloc (1, sizeof (CCSPluginConflict)); + if (conflict) + { + conflict->value = strdup (plugin->name); + conflict->type = ConflictPluginNeeded; + } + } + + if (conflict) + conflict->plugins = + ccsPluginListAppend (conflict->plugins, pl->data); + break; + } + pluginList = pluginList->next; + } + } + + if (conflict) + { + list = ccsPluginConflictListAppend (list, conflict); + conflict = NULL; + } + + /* look if a feature provided is required by another plugin */ + sl = plugin->providesFeature; + while (sl) + { + pl = context->plugins; + for (; pl; pl = pl->next) + { + CCSStringList pluginList; + + if (pl->data == plugin) + continue; + + if (!ccsPluginIsActive (context, pl->data->name)) + continue; + + pluginList = pl->data->requiresFeature; + + while (pluginList) + { + if (strcmp (sl->data, pluginList->data) == 0) + { + if (!conflict) + { + conflict = calloc (1, sizeof (CCSPluginConflict)); + + if (conflict) + { + conflict->value = strdup (sl->data); + conflict->type = ConflictFeatureNeeded; + } + } + if (conflict) + conflict->plugins = + ccsPluginListAppend (conflict->plugins, pl->data); + } + pluginList = pluginList->next; + } + + } + if (conflict) + list = ccsPluginConflictListAppend (list, conflict); + conflict = NULL; + sl = sl->next; + } + + return list; +} + +CCSStringList +ccsGetExistingProfiles (CCSContext * context) +{ + if (!context) + return NULL; + + CONTEXT_PRIV (context); + + if (!cPrivate->backend) + return NULL; + + if (cPrivate->backend->vTable->getExistingProfiles) + return (*cPrivate->backend->vTable->getExistingProfiles) (context); + + return NULL; +} + +void +ccsDeleteProfile (CCSContext * context, char *name) +{ + if (!context) + return; + + CONTEXT_PRIV (context); + + if (!cPrivate->backend) + return; + + /* never ever delete default profile */ + if (!name || !strlen (name)) + return; + + /* if the current profile should be deleted, + switch to default profile first */ + if (strcmp (cPrivate->profile, name) == 0) + ccsSetProfile (context, ""); + + if (cPrivate->backend->vTable->deleteProfile) + (*cPrivate->backend->vTable->deleteProfile) (context, name); +} + +static void +addBackendInfo (CCSBackendInfoList * bl, char *file) +{ + void *dlhand = NULL; + char *err = NULL; + Bool found = FALSE; + CCSBackendInfo *info; + + dlerror (); + + dlhand = dlopen (file, RTLD_LAZY | RTLD_LOCAL); + err = dlerror (); + if (err || !dlhand) + return; + + BackendGetInfoProc getInfo = dlsym (dlhand, "getBackendInfo"); + if (!getInfo) + { + dlclose (dlhand); + return; + } + + CCSBackendVTable *vt = getInfo (); + if (!vt) + { + dlclose (dlhand); + return; + } + + CCSBackendInfoList l = *bl; + while (l) + { + if (!strcmp (l->data->name, vt->name)) + { + found = TRUE; + break; + } + + l = l->next; + } + + if (found) + { + dlclose (dlhand); + return; + } + + info = calloc (1, sizeof (CCSBackendInfo)); + if (!info) + { + dlclose (dlhand); + return; + } + + info->name = strdup (vt->name); + info->shortDesc = (vt->shortDesc) ? strdup (vt->shortDesc) : strdup (""); + info->longDesc = (vt->longDesc) ? strdup (vt->longDesc) : strdup (""); + info->integrationSupport = vt->integrationSupport; + info->profileSupport = vt->profileSupport; + + *bl = ccsBackendInfoListAppend (*bl, info); + dlclose (dlhand); +} + +static int + +backendNameFilter (const struct dirent *name) +{ + int length = strlen (name->d_name); + + if (length < 7) + return 0; + + if (strncmp (name->d_name, "lib", 3) || + strncmp (name->d_name + length - 3, ".so", 3)) + return 0; + + return 1; +} + +static void +getBackendInfoFromDir (CCSBackendInfoList * bl, char *path) +{ + + struct dirent **nameList; + int nFile, i; + + if (!path) + return; + + nFile = scandir (path, &nameList, backendNameFilter, NULL); + if (nFile <= 0) + return; + + for (i = 0; i < nFile; i++) + { + char file[1024]; + sprintf (file, "%s/%s", path, nameList[i]->d_name); + addBackendInfo (bl, file); + free (nameList[i]); + } + + free (nameList); + +} + +CCSBackendInfoList +ccsGetExistingBackends () +{ + CCSBackendInfoList rv = NULL; + char *home = getenv ("HOME"); + char *backenddir; + + if (home && strlen (home)) + { + asprintf (&backenddir, "%s/.compizconfig/backends", home); + getBackendInfoFromDir (&rv, backenddir); + free (backenddir); + } + + asprintf (&backenddir, "%s/compizconfig/backends", LIBDIR); + + getBackendInfoFromDir (&rv, backenddir); + free (backenddir); + return rv; +} + +Bool +ccsExportToFile (CCSContext *context, + const char *fileName, + Bool skipDefaults) +{ + IniDictionary *exportFile; + CCSPluginList p; + CCSSettingList s; + CCSPlugin *plugin; + CCSSetting *setting; + char *keyName; + + exportFile = ccsIniNew (); + if (!exportFile) + return FALSE; + + for (p = context->plugins; p; p = p->next) + { + plugin = p->data; + PLUGIN_PRIV (plugin); + + if (!pPrivate->loaded) + ccsLoadPluginSettings (plugin); + + for (s = pPrivate->settings; s; s = s->next) + { + setting = s->data; + + if (skipDefaults && setting->isDefault) + continue; + + if (setting->isScreen) + asprintf (&keyName, "s%d_%s", + setting->screenNum, setting->name); + else + asprintf (&keyName, "as_%s", setting->name); + + switch (setting->type) + { + case TypeBool: + ccsIniSetBool (exportFile, plugin->name, keyName, + setting->value->value.asBool); + break; + case TypeInt: + ccsIniSetInt (exportFile, plugin->name, keyName, + setting->value->value.asInt); + break; + case TypeFloat: + ccsIniSetFloat (exportFile, plugin->name, keyName, + setting->value->value.asFloat); + break; + case TypeString: + ccsIniSetString (exportFile, plugin->name, keyName, + setting->value->value.asString); + break; + case TypeKey: + ccsIniSetKey (exportFile, plugin->name, keyName, + setting->value->value.asKey); + break; + case TypeButton: + ccsIniSetButton (exportFile, plugin->name, keyName, + setting->value->value.asButton); + break; + case TypeEdge: + ccsIniSetEdge (exportFile, plugin->name, keyName, + setting->value->value.asEdge); + break; + case TypeBell: + ccsIniSetBell (exportFile, plugin->name, keyName, + setting->value->value.asBell); + break; + case TypeColor: + ccsIniSetColor (exportFile, plugin->name, keyName, + setting->value->value.asColor); + break; + case TypeMatch: + ccsIniSetString (exportFile, plugin->name, keyName, + setting->value->value.asMatch); + break; + case TypeList: + ccsIniSetList (exportFile, plugin->name, keyName, + setting->value->value.asList, + setting->info.forList.listType); + break; + default: + break; + } + free (keyName); + } + } + + ccsIniSave (exportFile, fileName); + ccsIniClose (exportFile); + + return TRUE; +} + +Bool +ccsImportFromFile (CCSContext *context, + const char *fileName, + Bool overwriteNonDefault) +{ + IniDictionary *importFile; + CCSPluginList p; + CCSSettingList s; + CCSPlugin *plugin; + CCSSetting *setting; + char *keyName; + FILE *fp; + + /* check if the file exists first */ + fp = fopen (fileName, "r"); + if (!fp) + return FALSE; + fclose (fp); + + importFile = iniparser_new ((char *) fileName); + if (!importFile) + return FALSE; + + for (p = context->plugins; p; p = p->next) + { + plugin = p->data; + PLUGIN_PRIV (plugin); + + if (!pPrivate->loaded) + ccsLoadPluginSettings (plugin); + + for (s = pPrivate->settings; s; s = s->next) + { + setting = s->data; + if (!setting->isDefault && !overwriteNonDefault) + continue; + + if (setting->isScreen) + asprintf (&keyName, "s%d_%s", + setting->screenNum, setting->name); + else + asprintf (&keyName, "as_%s", setting->name); + + switch (setting->type) + { + case TypeBool: + { + Bool value; + + if (ccsIniGetBool (importFile, plugin->name, + keyName, &value)) + ccsSetBool (setting, value); + } + break; + case TypeInt: + { + int value; + + if (ccsIniGetInt (importFile, plugin->name, + keyName, &value)) + ccsSetInt (setting, value); + } + break; + case TypeFloat: + { + float value; + + if (ccsIniGetFloat (importFile, plugin->name, + keyName, &value)) + ccsSetFloat (setting, value); + } + break; + case TypeString: + { + char *value; + + if (ccsIniGetString (importFile, plugin->name, + keyName, &value)) + { + ccsSetString (setting, value); + free (value); + } + } + break; + case TypeKey: + { + CCSSettingKeyValue value; + + if (ccsIniGetKey (importFile, plugin->name, + keyName, &value)) + ccsSetKey (setting, value); + } + break; + case TypeButton: + { + CCSSettingButtonValue value; + + if (ccsIniGetButton (importFile, plugin->name, + keyName, &value)) + ccsSetButton (setting, value); + } + break; + case TypeEdge: + { + unsigned int value; + + if (ccsIniGetEdge (importFile, plugin->name, + keyName, &value)) + ccsSetEdge (setting, value); + } + break; + case TypeBell: + { + Bool value; + + if (ccsIniGetBell (importFile, plugin->name, + keyName, &value)) + ccsSetBell (setting, value); + } + break; + case TypeColor: + { + CCSSettingColorValue value; + + if (ccsIniGetColor (importFile, plugin->name, + keyName, &value)) + ccsSetColor (setting, value); + } + break; + case TypeMatch: + { + char *value; + if (ccsIniGetString (importFile, plugin->name, + keyName, &value)) + { + ccsSetMatch (setting, value); + free (value); + } + } + break; + case TypeList: + { + CCSSettingValueList value; + if (ccsIniGetList (importFile, plugin->name, + keyName, &value, setting)) + { + ccsSetList (setting, value); + ccsSettingValueListFree (value, TRUE); + } + } + break; + default: + break; + } + + free (keyName); + } + } + + ccsIniClose (importFile); + + return TRUE; +} + +CCSSettingList ccsGetPluginSettings (CCSPlugin *plugin) + +{ + PLUGIN_PRIV (plugin); + + if (!pPrivate->loaded) + ccsLoadPluginSettings (plugin); + + return pPrivate->settings; +} + +CCSGroupList ccsGetPluginGroups (CCSPlugin *plugin) +{ + PLUGIN_PRIV (plugin); + + if (!pPrivate->loaded) + ccsLoadPluginSettings (plugin); + + return pPrivate->groups; +} + +Bool ccsSettingIsIntegrated (CCSSetting *setting) +{ + if (!setting) + return FALSE; + + CONTEXT_PRIV (setting->parent->context); + + if (!cPrivate->backend) + return FALSE; + + if (cPrivate->backend->vTable->getSettingIsIntegrated) + return (*cPrivate->backend->vTable->getSettingIsIntegrated) (setting); + + return FALSE; +} + +Bool ccsSettingIsReadOnly (CCSSetting *setting) +{ + if (!setting) + return FALSE; + + CONTEXT_PRIV (setting->parent->context); + + if (!cPrivate->backend) + return FALSE; + + if (cPrivate->backend->vTable->getSettingIsReadOnly) + return (*cPrivate->backend->vTable->getSettingIsReadOnly) (setting); + + return FALSE; +} + +CCSStrExtensionList ccsGetPluginStrExtensions (CCSPlugin *plugin) +{ + PLUGIN_PRIV (plugin); + + if (!pPrivate->loaded) + ccsLoadPluginSettings (plugin); + + return pPrivate->stringExtensions; +} + diff --git a/debian/libcompizconfig-trinity/libcompizconfig-trinity_0.8.4.orig.tar.xz b/debian/libcompizconfig-trinity/libcompizconfig-trinity_0.8.4.orig.tar.xz Binary files differnew file mode 100644 index 00000000..3eb9fe79 --- /dev/null +++ b/debian/libcompizconfig-trinity/libcompizconfig-trinity_0.8.4.orig.tar.xz |