summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS18
-rw-r--r--CMakeLists.txt26
-rw-r--r--COPYING340
-rw-r--r--ChangeLog738
-rw-r--r--INSTALL236
-rw-r--r--NEWS4
-rw-r--r--README (renamed from dummy)0
-rw-r--r--VERSION1
-rw-r--r--org.freedesktop.compizconfig.gschema.xml22
-rw-r--r--src/gconf-integration.c954
-rw-r--r--src/gsettings.c1257
-rw-r--r--src/gsettings.h152
12 files changed, 3748 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..dd427ff
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,18 @@
+Christopher Williams <christopherw@verizon.net>
+Danny Baumann <dannybaumann@web.de>
+Dennis Kasprzyk <onestone@beryl-project.org>
+Dennis Kasprzyk <onestone@opencompositing.org>
+Didier Roche <didrocks@ubuntu.com>
+Erkin Bahceci <erkinbah@gmail.com>
+Guido Iribarren <guidoweb@guidoi.com.ar>
+Guillaume Seguin <guillaume@segu.in>
+Jigish Gohil <cyberorg@prime.(none)>
+Kristian Lyngstøl <kristian@albus.(none)>
+Robert Carr <racarr@gorbie.(none)>
+Sam Spilsbury <SmSpillaz@gmail.com>
+Sam Spilsbury <sam.spilsbury@canonical.com>
+Sam Spilsbury <smspillaz@XPS-FEDORA.(none)>
+Sam Spilsbury <smspillaz@XPS-UNITY.(none)>
+Sam Spilsbury <smspillaz@gmail.com>
+Scott Moreau <oreaus@gmail.com>
+maniac <maniac>
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..f372d38
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,26 @@
+project (compizconfig-backend-gsettings)
+
+find_package (CompizConfig REQUIRED)
+
+include (LibCompizConfigCommon)
+include (CompizGSettings)
+
+set (_deps glib-2.0>=2.20.0
+ gio-2.0>=2.25.0)
+
+option (USE_GCONF "Enable legacy GNOME 2.x option integration with GConf" ON)
+
+if (USE_GCONF)
+ list (APPEND _deps gconf-2.0>=2.31.1)
+
+ add_definitions (-DUSE_GCONF)
+endif (USE_GCONF)
+
+compizconfig_backend (gsettings PKGDEPS ${_deps})
+
+compiz_install_gsettings_schema (${CMAKE_SOURCE_DIR}/org.freedesktop.compizconfig.gschema.xml
+ ${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas)
+
+compiz_print_configure_header ("CompizConfig GSettings Storage Backend")
+compiz_print_configure_footer ()
+compiz_package_generation ("CompizConfig GSettings Storage Backend")
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..623b625
--- /dev/null
+++ b/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/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..fde4aa2
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,738 @@
+Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-13
+
+ Added some extended debugging info when failing to read keys
+
+Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-07
+
+ Add new release commands
+
+Sam Spilsbury <sam.spilsbury@canonical.com> 2011-07-07
+
+ Bump VERSION
+
+Scott Moreau <oreaus@gmail.com> 2011-05-13
+
+ * Bump version to 0.9.5
+
+Sam Spilsbury <sam.spilsbury@canonical.com> 2011-03-07
+
+ "Bump VERSION to 0.9.4"
+
+Sam Spilsbury <sam.spilsbury@canonical.com> 2011-03-07
+
+ "Update CMake Version"
+
+Sam Spilsbury <sam.spilsbury@canonical.com> 2011-03-07
+
+ "Update news for 0.9.4 release"
+
+Sam Spilsbury <smspillaz@XPS-UNITY.(none)> 2010-12-13
+
+ Fix branch confusion
+
+Merge: 9e2664b 55a267f
+Sam Spilsbury <sam.spilsbury@canonical.com> 2010-12-10
+
+ Merge branch 'master' of git+ssh://git.compiz.org/git/compiz/compizconfig/compizconfig-backend-gconf
+
+Sam Spilsbury <sam.spilsbury@canonical.com> 2010-12-10
+
+ Add multiscreen support
+
+Sam Spilsbury <sam.spilsbury@canonical.com> 2010-12-10
+
+ Fix setting /allscreens, we should set /screen%i (defaults to screen 0)
+
+Didier Roche <didrocks@ubuntu.com> 2010-11-26
+
+ fix schema owner and typo
+
+Sam Spilsbury <sam.spilsbury@canonical.com> 2010-11-23
+
+ Change paths so that old and new settings don't conflict
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-11-06
+
+ Update NEWS for 0.9.2.1 Release
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-11-06
+
+ Update NEWS for 0.9.2.1 Release
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-11-06
+
+ Set COMPIZCONFIG_GCONF_VERSION_MACRO and update to 0.9.2.1
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-11-06
+
+ Update to 0.9.2.1
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-10-24
+
+ Fix date on NEWS
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-10-24
+
+ Update NEWS for 0.9.2 release
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-07-04
+
+ Update NEWS for 0.9.0 release
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-07-04
+
+ Bump version
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-07-04
+
+ Set project definition in cmake file
+
+Sam Spilsbury <SmSpillaz@gmail.com> 2010-06-06
+
+ Typo
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-05-14
+
+ Add package generation
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-05-14
+
+ Update for libcompizconfig buildsystem changes
+ and add dist and uninstall targets
+
+Merge: 350e4d5 2adeb06
+Sam Spilsbury <smspillaz@XPS-FEDORA.(none)> 2010-05-07
+
+ Merge branch 'compiz++' of git+ssh://smspillaz@git.compiz.org/git/fusion/compizconfig/compizconfig-backend-gconf into compiz++
+
+Merge: 74c3fd4 091f2d0
+Danny Baumann <dannybaumann@web.de> 2010-05-03
+
+ Merge branch 'master' of git+ssh://git.compiz.org/git/fusion/compizconfig/compizconfig-backend-gconf
+
+Guido Iribarren <guidoweb@guidoi.com.ar> 2010-05-03
+
+ Integrate metacity's resize_with_right_button option.
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-04-27
+
+ Remove autotools builsystem
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-04-23
+
+ Add merged autotools / cmake buildsystem and adjust for compiz++
+
+ Please use cmake, autotools is deprecated
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-04-19
+
+ Remove dummy
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-04-19
+
+ Dummy commit
+
+Sam Spilsbury <smspillaz@gmail.com> 2010-04-19
+
+ Remove multiple-screen support for compiz++
+
+Guillaume Seguin <guillaume@segu.in> 2009-10-14
+
+ * Bump version to 0.8.5
+
+Guillaume Seguin <guillaume@segu.in> 2009-10-14
+
+ * Bump version to 0.8.4
+
+Erkin Bahceci <erkinbah@gmail.com> 2009-09-25
+
+ Sync metacity with staticswitcher instead of switcher.
+
+Erkin Bahceci <erkinbah@gmail.com> 2009-09-24
+
+ Fix crash (LP: #407020).
+
+Danny Baumann <dannybaumann@web.de> 2009-04-08
+
+ Fix warning.
+
+Danny Baumann <dannybaumann@web.de> 2009-04-08
+
+ Fix setting integration for screenshot and terminal commands.
+
+Guillaume Seguin <guillaume@segu.in> 2009-03-09
+
+ * Bump version to 0.8.3
+
+Guillaume Seguin <guillaume@segu.in> 2009-03-09
+
+ * Bump version to 0.8.2
+
+Danny Baumann <dannybaumann@web.de> 2009-02-05
+
+ Track option movements.
+
+Danny Baumann <dannybaumann@web.de> 2009-01-14
+
+ Improve readability.
+
+Danny Baumann <dannybaumann@web.de> 2009-01-14
+
+ Don't allow empty modifiers for mouse_button_modifier.
+ Fixes bug #1106.
+
+Guillaume Seguin <guillaume@segu.in> 2008-09-23
+
+ * Bump version to 0.7.9
+
+Guillaume Seguin <guillaume@segu.in> 2008-09-23
+
+ * Bump version to 0.7.8
+
+Danny Baumann <dannybaumann@web.de> 2008-07-16
+
+ Fix saving of float lists.
+
+Danny Baumann <dannybaumann@web.de> 2008-06-11
+
+ Compiz' click_to_focus disabled is the equivalent of Metacity's sloppy focus mode.
+
+Guillaume Seguin <guillaume@segu.in> 2008-05-31
+
+ * Bump version to 0.7.7
+
+Guillaume Seguin <guillaume@segu.in> 2008-05-31
+
+ * Bump version to 0.7.6
+
+Merge: fc1a518 ba560d5
+Danny Baumann <dannybaumann@web.de> 2008-04-23
+
+ Merge branch 'master' of git+ssh://maniac@git.opencompositing.org/git/fusion/compizconfig/compizconfig-backend-gconf
+
+Danny Baumann <dannybaumann@web.de> 2008-04-23
+
+ Fixed applying schemas to copied profiles.
+
+Danny Baumann <dannybaumann@web.de> 2008-04-18
+
+ Remove integration for plane plugin settings.
+
+Guillaume Seguin <guillaume@segu.in> 2008-04-04
+
+ * Bump version to 0.7.5
+
+Guillaume Seguin <guillaume@segu.in> 2008-04-04
+
+ * Bump version to 0.7.4
+
+Guillaume Seguin <guillaume@segu.in> 2008-03-06
+
+ * Bump version to 0.7.3
+
+Guillaume Seguin <guillaume@segu.in> 2008-03-06
+
+ * Bump version to 0.7.2
+
+Danny Baumann <dannybaumann@web.de> 2008-02-10
+
+ Fix move, resize & window menu initiate binding integration.
+
+Danny Baumann <dannybaumann@web.de> 2008-01-06
+
+ Don't define VERSION twice.
+
+Danny Baumann <dannybaumann@web.de> 2007-10-28
+
+ More * -> *_button renames.
+ Whitespace fixes.
+
+Christopher Williams <christopherw@verizon.net> 2007-10-27
+
+ Fix Mouse Button Modifier bindings (window menu, initiate move, initiate resize)
+
+Guillaume Seguin <guillaume@segu.in> 2007-10-21
+
+ * Bump version to 0.6.99
+
+Danny Baumann <dannybaumann@web.de> 2007-10-10
+
+ Fix integration of maximize horizontally/vertically keys.
+
+Danny Baumann <dannybaumann@web.de> 2007-10-10
+
+ Use gconf_value processing in integrated settings reading.
+
+Jigish Gohil <cyberorg@prime.(none)> 2007-10-03
+
+ bump version to 0.6.0
+
+Kristian Lyngstøl <kristian@albus.(none)> 2007-09-18
+
+ Ignore num_workspaces (Patch by Mirco Müller)
+
+Danny Baumann <dannybaumann@web.de> 2007-09-09
+
+ Metacity doesn't like the key binding "Disabled", it wants "disabled".
+
+Danny Baumann <dannybaumann@web.de> 2007-09-09
+
+ Revert "Integrate desktop layout option of workspace switcher applet."
+
+ This reverts commit b772db8b966ec5254d75dd6353799e08056818d0.
+
+ Reasoning:
+ While this conversion is correct in theory, and it works fine controling Metacity, it has the unwanted side effect of libwnck setting _NET_DESKTOP_GEOMETRY so that we e.g. get a 3 desktop, 3x3 viewport layout if we just wanted to have a 3x3 viewport layout.
+
+Danny Baumann <dannybaumann@web.de> 2007-09-08
+
+ Integrate desktop layout option of workspace switcher applet.
+
+Danny Baumann <dannybaumann@web.de> 2007-09-08
+
+ Integrate visual_bell and fullscreen_visual_bell options of the fade plugin.
+
+Dennis Kasprzyk <onestone@opencompositing.org> 2007-09-02
+
+ Support empty lists.
+
+Danny Baumann <dannybaumann@web.de> 2007-09-02
+
+ Remove cruft.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-21
+
+ Track option name changes.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-21
+
+ Track libcompizconfig changes.
+
+Merge: 192eb0d 91d3d63
+Danny Baumann <dannybaumann@web.de> 2007-08-14
+
+ Merge branch 'master' of git+ssh://maniac@git.opencompositing.org/git/fusion/compizconfig/compizconfig-backend-gconf
+
+Danny Baumann <dannybaumann@web.de> 2007-08-14
+
+ Integrate current_viewport option of thumbnail.
+
+Merge: 410e847 c75ac33
+Danny Baumann <dannybaumann@web.de> 2007-08-14
+
+ Merge branch 'master' of git+ssh://maniac@git.opencompositing.org/git/fusion/compizconfig/compizconfig-backend-gconf
+
+Danny Baumann <dannybaumann@web.de> 2007-08-14
+
+ Add VERSION to EXTRA_DIST.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-14
+
+ Add VERSION to EXTRA_DIST.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-14
+
+ gotovp -> vpswitch
+
+Danny Baumann <dannybaumann@web.de> 2007-08-13
+
+ Loop through all integrated options on Gconf value change notification to re-read all integrated options if multiple compiz options are integrated with a single metacity option.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-13
+
+ Integrate gotovp bindings.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-13
+
+ Revert "Use gotovp to integrate Metacity's switch_to_workspace_x bindings."
+
+ This reverts commit b1a761184b4fde669534b844f4926a2e19855eeb.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-13
+
+ Use gotovp to integrate Metacity's switch_to_workspace_x bindings.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-13
+
+ Added some more integrated bindings.
+ Thanks to Michael Vogt.
+
+Dennis Kasprzyk <onestone@opencompositing.org> 2007-08-12
+
+ Version update.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-07
+
+ Added more missing NULL pointer checks.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-06
+
+ Track lib changes.
+
+Danny Baumann <dannybaumann@web.de> 2007-08-03
+
+ Added missing NULL pointer checks.
+
+Danny Baumann <dannybaumann@web.de> 2007-07-10
+
+ Added integration for 'Run terminal' command and fixed integration for command options.
+
+Merge: 8dd17c0 6574f43
+Guillaume Seguin <guillaume@segu.in> 2007-07-10
+
+ Merge branch 'master' of git+ssh://guillaume@git.opencompositing.org/git/fusion/compizconfig/compizconfig-backend-gconf
+
+Guillaume Seguin <guillaume@segu.in> 2007-07-10
+
+ * Integrate run_terminal binding
+
+Danny Baumann <dannybaumann@web.de> 2007-07-10
+
+ Fix resetting screen edge options to default.
+
+Danny Baumann <dannybaumann@web.de> 2007-07-09
+
+ Fixed change notify handling for system bell action.
+
+Danny Baumann <dannybaumann@web.de> 2007-07-09
+
+ Fix resetting action values.
+
+Danny Baumann <dannybaumann@web.de> 2007-07-09
+
+ Reset settings to default if they could not be read.
+
+Danny Baumann <dannybaumann@web.de> 2007-07-09
+
+ Write integration value after integrated option has been changed outside of libcompizconfig.
+
+Danny Baumann <dannybaumann@web.de> 2007-07-09
+
+ Fix profile copying.
+ Only copy values which are actually set.
+
+Danny Baumann <dannybaumann@web.de> 2007-07-09
+
+ Explicitly pass schema path to prevent accidential deassociations.
+
+Guillaume Seguin <guillaume@segu.in> 2007-07-08
+
+ * Whitespace
+
+Guillaume Seguin <guillaume@segu.in> 2007-07-08
+
+ * Fix desktop horizontal size integration
+
+Danny Baumann <dannybaumann@web.de> 2007-07-07
+
+ Fix reading of gconf lists.
+
+Danny Baumann <dannybaumann@web.de> 2007-07-05
+
+ Compiz indention style.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-26
+
+ Remove unnecessary check.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-26
+
+ Plug minor memleak.
+
+Merge: 270b692 9944789
+Dennis Kasprzyk <onestone@opencompositing.org> 2007-06-20
+
+ Merge branch 'master' of git+ssh://git.beryl-project.org/git/compcomm/compiz-configuration-system/libraries/ccs-backend-gconf
+
+Dennis Kasprzyk <onestone@opencompositing.org> 2007-06-20
+
+ Package rename
+
+Danny Baumann <dannybaumann@web.de> 2007-06-20
+
+ Fix assigning of display settings when the corresponding metacity key is changed.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-17
+
+ Clear cache before unloading.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-17
+
+ Dispatch all pending glib events before unloading backend.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-15
+
+ Fix applying integrated values on mutliscreen setups.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-15
+
+ Fix notification listening after changing profiles.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-15
+
+ Whitespace fixes.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-15
+
+ Use proper macros for gconf paths.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-15
+
+ Fix warning.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-15
+
+ Fixed profile deletion and compiz tree reset.
+
+ Adapt to API changes.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-15
+
+ Another dummy.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-15
+
+ Dummy commit.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-15
+
+ Store all profiles in Gconf, keeping their schemas associated.
+ This code isn't 100% finished, that's why it's still currently disabled.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Don't reset "plugin enabled" options to defaults.
+
+Merge: db7e12c 6a4d643
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Merge branch 'master' of git+ssh://maniac@git.opencompositing.org/git/compcomm/compiz-configuration-system/libraries/ccs-backend-gconf
+
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Added sanity check for value type.
+
+Dennis Kasprzyk <onestone@opencompositing.org> 2007-06-14
+
+ Disable profile handling until it get fixed.
+
+Dennis Kasprzyk <onestone@opencompositing.org> 2007-06-14
+
+ Added functions to recursive copy gconf tree
+
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Properly fixed applying action settings and fixed edge setting reading.
+
+Merge: f039690 20ccbed
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Merge branch 'master' of git+ssh://maniac@git.opencompositing.org/git/compcomm/compiz-configuration-system/libraries/ccs-backend-gconf
+
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Fix immediate applying of actions.
+
+Merge: 8435740 e03df52
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Merge branch 'master' of git+ssh://maniac@git.opencompositing.org/git/compcomm/compiz-configuration-system/libraries/ccs-backend-gconf
+
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Properly set return value when reading integrated click_to_focus option.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Properly set return value when reading integrated click_to_focus option.
+
+Danny Baumann <dannybaumann@web.de> 2007-06-14
+
+ Don't run glib main loop if indicated by flag.
+
+Dennis Kasprzyk <onestone@opencompositing.org> 2007-06-13
+
+ Fixed profile path.
+
+Dennis Kasprzyk <onestone@beryl-project.org> 2007-06-12
+
+ Fixed email
+
+Dennis Kasprzyk <onestone@beryl-project.org> 2007-06-11
+
+ libccs -> libcompizconfig rename
+
+Danny Baumann <dannybaumann@web.de> 2007-05-15
+
+ Added some sanity checks.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-14
+
+ Remove debug statement.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-14
+
+ Implement profile support by exporting/importing to/from files and work directly on the Compiz settings.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-13
+
+ Prepare for working on Compiz settings tree.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-13
+
+ Fixed screen edge action handling.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-13
+
+ Fixed parsing of Gconf key names in value change notify callback.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-13
+
+ Mouse_button_modifier is now read back when Gconf value changes.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-13
+
+ The mouse_button_modifier option now works with one exception:
+ Changing the metacity value in gconf does nothing until the next Compiz restart.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-12
+
+ Reduce amount of C'n'P.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-12
+
+ Also fix writing the mouse_button_modifier setting.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-12
+
+ Next try of properly integrating the mouse_button_modifier option.
+ I will first think and then code next time.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-12
+
+ Completely integrate mouse_button_modifier option for reading.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-12
+
+ Fix integration of core options.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-11
+
+ Fix reading Metacity value for mouse button modifier.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-11
+
+ Optimizations (use the GConfValue* returned when checking for key existance where possible)
+
+Danny Baumann <dannybaumann@web.de> 2007-05-11
+
+ Fixed unset values being accidentially set.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-11
+
+ Distinguish between an unset value and an empty list when reading list values.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-10
+
+ Fix option storage path for core options.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-10
+
+ Fix returning of existing profiles.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-10
+
+ Never ever free the value returned by ccsGetProfile().
+
+Merge: 278dcd8 fb36497
+Danny Baumann <dannybaumann@web.de> 2007-05-10
+
+ Merge branch 'master' of git+ssh://maniac@git.beryl-project.org/git/compcomm/compiz-configuration-system/libraries/ccs-backend-gconf
+
+Danny Baumann <dannybaumann@web.de> 2007-05-10
+
+ Crash fix.
+
+Robert Carr <racarr@gorbie.(none)> 2007-05-10
+
+ Use wall instead of plane (for left/up/down/right) with gconf backend integration stuff.
+
+Danny Baumann <dannybaumann@web.de> 2007-05-10
+
+ Added integration for Metacity's mouse_button_modifier option.
+
+Dennis Kasprzyk <onestone@beryl-project.org> 2007-04-30
+
+ Applied new library name
+
+Danny Baumann <dannybaumann@web.de> 2007-04-25
+
+ Don't touch the changed settings list in the backend.
+
+Danny Baumann <dannybaumann@web.de> 2007-04-25
+
+ Don't return default profile.
+
+Danny Baumann <dannybaumann@web.de> 2007-04-23
+
+ Reset setting to default if it can't be found in Gconf.
+
+Danny Baumann <dannybaumann@web.de> 2007-04-19
+
+ Fixed default profile handling.
+
+Danny Baumann <dannybaumann@web.de> 2007-03-26
+
+ libbs-gconf: adapt for new action/color parsing interface
+
+Danny Baumann <dannybaumann@web.de> 2007-03-23
+
+ libbs-gconf: fixed action value writing
+
+maniac <maniac> 2007-03-16
+
+ libbs-gconf: allocate keyName and pathName on the stack to avoid heap fragmentation and simplify code
+
+maniac <maniac> 2007-03-16
+
+ libbs-gconf:
+ - implemented DE integrated setting read/write
+ - fixed authors section
+
+maniac <maniac> 2007-03-16
+
+ libbs-gconf:
+ - implemented list value reading
+ - properly store Bool and int directly in list->data
+
+maniac <maniac> 2007-03-16
+
+ libbs-gconf: implemented list value writing
+
+maniac <maniac> 2007-03-15
+
+ libbs-gconf: minor formatting fixes
+
+maniac <maniac> 2007-03-15
+
+ libbs-gconf:
+ - added option writing (lists are missing at the moment)
+ - fixed some warnings
+
+maniac <maniac> 2007-03-15
+
+ libbs-gconf: implemented action reading
+
+maniac <maniac> 2007-03-15
+
+ libbs-gconf:
+ - fixed plugin gconf path
+ - the plugin_enabled setting has 4 underscores, not 3
+
+maniac <maniac> 2007-03-15
+
+ libbs gconf backend: fix installation
+
+maniac <maniac> 2007-03-15
+
+ libbs: added first part of gconf backend - still a lot of work, though
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..23e5f25
--- /dev/null
+++ b/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/NEWS b/NEWS
new file mode 100644
index 0000000..6f30037
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,4 @@
+Release 0.9.5.0 ( 2011-07-14 Sam Spilsbury <sam.spilsbury@canonical.com> )
+===========================================================================
+Development Release (0.9.5.0)
+
diff --git a/dummy b/README
index e69de29..e69de29 100644
--- a/dummy
+++ b/README
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..945baad
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.9.5.2
diff --git a/org.freedesktop.compizconfig.gschema.xml b/org.freedesktop.compizconfig.gschema.xml
new file mode 100644
index 0000000..ac3701f
--- /dev/null
+++ b/org.freedesktop.compizconfig.gschema.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<schemalist>
+ <schema id="org.freedesktop.compizconfig" path="/org/freedesktop/compizconfig/" gettext-domain="compiz">
+ <key type="s" name="current-profile">
+ <default>'Default'</default>
+ <summary>Current Profile</summary>
+ <description>Describes the current profile</description>
+ </key>
+ <key type="as" name="existing-profiles">
+ <default>['Default']</default>
+ <summary>Existing Profiles</summary>
+ <description>Profiles available for the GSettings backend to use</description>
+ </key>
+ </schema>
+ <schema id="org.freedesktop.compizconfig.profile" gettext-domain="compiz">
+ <key type="as" name="plugins-with-set-keys">
+ <default>[]</default>
+ <summary>Plugins with set keys</summary>
+ <description>Plugins which have set keys</description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/src/gconf-integration.c b/src/gconf-integration.c
new file mode 100644
index 0000000..1e956f3
--- /dev/null
+++ b/src/gconf-integration.c
@@ -0,0 +1,954 @@
+/**
+ *
+ * GSettings libccs backend
+ *
+ * gconf-integration.c
+ *
+ * Copyright (c) 2011 Canonical Ltd
+ *
+ * Based on the original compizconfig-backend-gconf
+ *
+ * Copyright (c) 2007 Danny Baumann <maniac@opencompositing.org>
+ *
+ * Parts of this code are taken from libberylsettings
+ * gconf backend, written by:
+ *
+ * Copyright (c) 2006 Robert Carr <racarr@opencompositing.org>
+ * Copyright (c) 2007 Dennis Kasprzyk <onestone@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.
+ *
+ * Authored By:
+ * Sam Spilsbury <sam.spilsbury@canonical.com>
+ *
+ **/
+
+#include "gsettings.h"
+#ifdef USE_GCONF
+GConfClient *client = NULL;
+guint gnomeGConfNotifyIds[NUM_WATCHED_DIRS];
+
+const SpecialOptionGConf specialOptions[] = {
+ {"run_key", "gnomecompat", FALSE,
+ METACITY "/global_keybindings/panel_run_dialog", OptionKey},
+ {"main_menu_key", "gnomecompat", FALSE,
+ METACITY "/global_keybindings/panel_main_menu", OptionKey},
+ {"run_command_screenshot_key", "gnomecompat", FALSE,
+ METACITY "/global_keybindings/run_command_screenshot", OptionKey},
+ {"run_command_window_screenshot_key", "gnomecompat", FALSE,
+ METACITY "/global_keybindings/run_command_window_screenshot", OptionKey},
+ {"run_command_terminal_key", "gnomecompat", FALSE,
+ METACITY "/global_keybindings/run_command_terminal", OptionKey},
+
+ {"toggle_window_maximized_key", "core", FALSE,
+ METACITY "/window_keybindings/toggle_maximized", OptionKey},
+ {"minimize_window_key", "core", FALSE,
+ METACITY "/window_keybindings/minimize", OptionKey},
+ {"maximize_window_key", "core", FALSE,
+ METACITY "/window_keybindings/maximize", OptionKey},
+ {"unmaximize_window_key", "core", FALSE,
+ METACITY "/window_keybindings/unmaximize", OptionKey},
+ {"maximize_window_horizontally_key", "core", FALSE,
+ METACITY "/window_keybindings/maximize_horizontally", OptionKey},
+ {"maximize_window_vertically_key", "core", FALSE,
+ METACITY "/window_keybindings/maximize_vertically", OptionKey},
+ {"raise_window_key", "core", FALSE,
+ METACITY "/window_keybindings/raise", OptionKey},
+ {"lower_window_key", "core", FALSE,
+ METACITY "/window_keybindings/lower", OptionKey},
+ {"close_window_key", "core", FALSE,
+ METACITY "/window_keybindings/close", OptionKey},
+ {"toggle_window_shaded_key", "core", FALSE,
+ METACITY "/window_keybindings/toggle_shaded", OptionKey},
+
+ {"show_desktop_key", "core", FALSE,
+ METACITY "/global_keybindings/show_desktop", OptionKey},
+
+ {"initiate_key", "move", FALSE,
+ METACITY "/window_keybindings/begin_move", OptionKey},
+ {"initiate_key", "resize", FALSE,
+ METACITY "/window_keybindings/begin_resize", OptionKey},
+ {"window_menu_key", "core", FALSE,
+ METACITY "/window_keybindings/activate_window_menu", OptionKey},
+
+ /* integration of Metacity's mouse_button_modifier option */
+ {"initiate_button", "move", FALSE,
+ METACITY "/window_keybindings/begin_move", OptionSpecial},
+ {"initiate_button", "resize", FALSE,
+ METACITY "/window_keybindings/begin_resize", OptionSpecial},
+ {"window_menu_button", "core", FALSE,
+ METACITY "/window_keybindings/activate_window_menu", OptionSpecial},
+ {"mouse_button_modifier", NULL, FALSE,
+ METACITY "/general/mouse_button_modifier", OptionSpecial},
+ /* integration of the Metacity's option to swap mouse buttons */
+ {"resize_with_right_button", NULL, FALSE,
+ METACITY "/general/resize_with_right_button", OptionSpecial},
+
+ {"visual_bell", "fade", TRUE,
+ METACITY "/general/visual_bell", OptionBool},
+ {"fullscreen_visual_bell", "fade", TRUE,
+ METACITY "/general/visual_bell_type", OptionSpecial},
+
+ {"next_key", "staticswitcher", FALSE,
+ METACITY "/global_keybindings/switch_windows", OptionKey},
+ {"prev_key", "staticswitcher", FALSE,
+ METACITY "/global_keybindings/switch_windows_backward", OptionKey},
+
+ {"toggle_sticky_key", "extrawm", FALSE,
+ METACITY "/window_keybindings/toggle_on_all_workspaces", OptionKey},
+ {"toggle_fullscreen_key", "extrawm", FALSE,
+ METACITY "/window_keybindings/toggle_fullscreen", OptionKey},
+
+ {"command0", "commands", FALSE,
+ METACITY "/keybinding_commands/command_1", OptionString},
+ {"command1", "commands", FALSE,
+ METACITY "/keybinding_commands/command_2", OptionString},
+ {"command2", "commands", FALSE,
+ METACITY "/keybinding_commands/command_3", OptionString},
+ {"command3", "commands", FALSE,
+ METACITY "/keybinding_commands/command_4", OptionString},
+ {"command4", "commands", FALSE,
+ METACITY "/keybinding_commands/command_5", OptionString},
+ {"command5", "commands", FALSE,
+ METACITY "/keybinding_commands/command_6", OptionString},
+ {"command6", "commands", FALSE,
+ METACITY "/keybinding_commands/command_7", OptionString},
+ {"command7", "commands", FALSE,
+ METACITY "/keybinding_commands/command_8", OptionString},
+ {"command8", "commands", FALSE,
+ METACITY "/keybinding_commands/command_9", OptionString},
+ {"command9", "commands", FALSE,
+ METACITY "/keybinding_commands/command_10", OptionString},
+ {"command10", "commands", FALSE,
+ METACITY "/keybinding_commands/command_11", OptionString},
+ {"command11", "commands", FALSE,
+ METACITY "/keybinding_commands/command_12", OptionString},
+
+ {"run_command0_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_1", OptionKey},
+ {"run_command1_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_2", OptionKey},
+ {"run_command2_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_3", OptionKey},
+ {"run_command3_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_4", OptionKey},
+ {"run_command4_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_5", OptionKey},
+ {"run_command5_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_6", OptionKey},
+ {"run_command6_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_7", OptionKey},
+ {"run_command7_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_8", OptionKey},
+ {"run_command8_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_9", OptionKey},
+ {"run_command9_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_10", OptionKey},
+ {"run_command10_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_11", OptionKey},
+ {"run_command11_key", "commands", FALSE,
+ METACITY "/global_keybindings/run_command_12", OptionKey},
+
+ {"rotate_to_1_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_1", OptionKey},
+ {"rotate_to_2_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_2", OptionKey},
+ {"rotate_to_3_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_3", OptionKey},
+ {"rotate_to_4_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_4", OptionKey},
+ {"rotate_to_5_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_5", OptionKey},
+ {"rotate_to_6_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_6", OptionKey},
+ {"rotate_to_7_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_7", OptionKey},
+ {"rotate_to_8_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_8", OptionKey},
+ {"rotate_to_9_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_9", OptionKey},
+ {"rotate_to_10_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_10", OptionKey},
+ {"rotate_to_11_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_11", OptionKey},
+ {"rotate_to_12_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_12", OptionKey},
+
+ {"rotate_left_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_left", OptionKey},
+ {"rotate_right_key", "rotate", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_right", OptionKey},
+
+ {"switch_to_1_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_1", OptionKey},
+ {"switch_to_2_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_2", OptionKey},
+ {"switch_to_3_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_3", OptionKey},
+ {"switch_to_4_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_4", OptionKey},
+ {"switch_to_5_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_5", OptionKey},
+ {"switch_to_6_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_6", OptionKey},
+ {"switch_to_7_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_7", OptionKey},
+ {"switch_to_8_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_8", OptionKey},
+ {"switch_to_9_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_9", OptionKey},
+ {"switch_to_10_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_10", OptionKey},
+ {"switch_to_11_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_11", OptionKey},
+ {"switch_to_12_key", "vpswitch", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_12", OptionKey},
+
+ {"up_key", "wall", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_up", OptionKey},
+ {"down_key", "wall", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_down", OptionKey},
+ {"left_key", "wall", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_left", OptionKey},
+ {"right_key", "wall", FALSE,
+ METACITY "/global_keybindings/switch_to_workspace_right", OptionKey},
+ {"left_window_key", "wall", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_left", OptionKey},
+ {"right_window_key", "wall", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_right", OptionKey},
+ {"up_window_key", "wall", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_up", OptionKey},
+ {"down_window_key", "wall", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_down", OptionKey},
+
+ {"put_topleft_key", "put", FALSE,
+ METACITY "/window_keybindings/move_to_corner_nw", OptionKey},
+ {"put_topright_key", "put", FALSE,
+ METACITY "/window_keybindings/move_to_corner_ne", OptionKey},
+ {"put_bottomleft_key", "put", FALSE,
+ METACITY "/window_keybindings/move_to_corner_sw", OptionKey},
+ {"put_bottomright_key", "put", FALSE,
+ METACITY "/window_keybindings/move_to_corner_se", OptionKey},
+ {"put_left_key", "put", FALSE,
+ METACITY "/window_keybindings/move_to_side_w", OptionKey},
+ {"put_right_key", "put", FALSE,
+ METACITY "/window_keybindings/move_to_side_e", OptionKey},
+ {"put_top_key", "put", FALSE,
+ METACITY "/window_keybindings/move_to_side_n", OptionKey},
+ {"put_bottom_key", "put", FALSE,
+ METACITY "/window_keybindings/move_to_side_s", OptionKey},
+
+ {"rotate_to_1_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_1", OptionKey},
+ {"rotate_to_2_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_2", OptionKey},
+ {"rotate_to_3_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_3", OptionKey},
+ {"rotate_to_4_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_4", OptionKey},
+ {"rotate_to_5_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_5", OptionKey},
+ {"rotate_to_6_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_6", OptionKey},
+ {"rotate_to_7_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_7", OptionKey},
+ {"rotate_to_8_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_8", OptionKey},
+ {"rotate_to_9_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_9", OptionKey},
+ {"rotate_to_10_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_10", OptionKey},
+ {"rotate_to_11_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_11", OptionKey},
+ {"rotate_to_12_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_12", OptionKey},
+
+ {"rotate_left_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_left", OptionKey},
+ {"rotate_right_window_key", "rotate", FALSE,
+ METACITY "/window_keybindings/move_to_workspace_right", OptionKey},
+
+ {"command_screenshot", "gnomecompat", FALSE,
+ METACITY "/keybinding_commands/command_screenshot", OptionString},
+ {"command_window_screenshot", "gnomecompat", FALSE,
+ METACITY "/keybinding_commands/command_window_screenshot", OptionString},
+ {"command_terminal", "gnomecompat", FALSE,
+ "/desktop/gnome/applications/terminal/exec", OptionString},
+
+ {"current_viewport", "thumbnail", TRUE,
+ "/apps/panel/applets/window_list/prefs/display_all_workspaces",
+ OptionSpecial},
+
+ {"autoraise", "core", FALSE,
+ METACITY "/general/auto_raise", OptionBool},
+ {"autoraise_delay", "core", FALSE,
+ METACITY "/general/auto_raise_delay", OptionInt},
+ {"raise_on_click", "core", FALSE,
+ METACITY "/general/raise_on_click", OptionBool},
+ {"click_to_focus", "core", FALSE,
+ METACITY "/general/focus_mode", OptionSpecial},
+
+ {"audible_bell", "core", FALSE,
+ METACITY "/general/audible_bell", OptionBool},
+ /*{"hsize", "core", TRUE,
+ METACITY "/general/num_workspaces", OptionInt},*/
+};
+
+static const char* watchedGConfGnomeDirectories[] = {
+ METACITY,
+ "/desktop/gnome/applications/terminal",
+ "/apps/panel/applets/window_list/prefs"
+};
+
+#define N_SOPTIONS (sizeof (specialOptions) / sizeof (struct _SpecialOptionGConf))
+
+static CCSSetting *
+findDisplaySettingForPlugin (CCSContext *context,
+ const char *plugin,
+ const char *setting)
+{
+ CCSPlugin *p;
+ CCSSetting *s;
+
+ p = ccsFindPlugin (context, plugin);
+ if (!p)
+ return NULL;
+
+ s = ccsFindSetting (p, setting);
+ if (!s)
+ return NULL;
+
+ return s;
+}
+
+Bool
+isGConfIntegratedOption (CCSSetting *setting,
+ int *index)
+{
+ unsigned int i;
+
+ for (i = 0; i < N_SOPTIONS; i++)
+ {
+ const SpecialOptionGConf *opt = &specialOptions[i];
+
+ if (strcmp (setting->name, opt->settingName) != 0)
+ continue;
+
+ if (setting->parent->name)
+ {
+ if (!opt->pluginName)
+ continue;
+ if (strcmp (setting->parent->name, opt->pluginName) != 0)
+ continue;
+ }
+ else
+ {
+ if (opt->pluginName)
+ continue;
+ }
+
+ if (index)
+ *index = i;
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+void
+gnomeGConfValueChanged (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data)
+{
+ CCSContext *context = (CCSContext *)user_data;
+ char *keyName = (char*) gconf_entry_get_key (entry);
+ int i, last = 0, num = 0;
+ Bool needInit = TRUE;
+
+ if (!ccsGetIntegrationEnabled (context))
+ return;
+
+ /* we have to loop multiple times here, because one Gnome
+ option may be integrated with multiple Compiz options */
+
+ while (1)
+ {
+ for (i = last, num = -1; i < N_SOPTIONS; i++)
+ {
+ if (strcmp (specialOptions[i].gnomeName, keyName) == 0)
+ {
+ num = i;
+ last = i + 1;
+ break;
+ }
+ }
+
+ if (num < 0)
+ break;
+
+ if ((strcmp (specialOptions[num].settingName,
+ "mouse_button_modifier") == 0) ||
+ (strcmp (specialOptions[num].settingName,
+ "resize_with_right_button") == 0))
+ {
+ CCSSetting *s;
+
+ if (needInit)
+ {
+ readInit (context);
+ needInit = FALSE;
+ }
+
+ s = findDisplaySettingForPlugin (context, "core",
+ "window_menu_button");
+ if (s)
+ readSetting (context, s);
+
+ s = findDisplaySettingForPlugin (context, "move",
+ "initiate_button");
+ if (s)
+ readSetting (context, s);
+
+ s = findDisplaySettingForPlugin (context, "resize",
+ "initiate_button");
+ if (s)
+ readSetting (context, s);
+ }
+ else
+ {
+ CCSPlugin *plugin = NULL;
+ CCSSetting *setting;
+ SpecialOptionGConf *opt = (SpecialOptionGConf *) &specialOptions[num];
+
+ plugin = ccsFindPlugin (context, (char*) opt->pluginName);
+ if (plugin)
+ {
+ for (i = 0; i < 1; i++)
+ {
+ setting = ccsFindSetting (plugin, (char*) opt->settingName);
+
+ if (setting)
+ {
+ if (needInit)
+ {
+ readInit (context);
+ needInit = FALSE;
+ }
+ readSetting (context, setting);
+ }
+
+ /* do not read display settings multiple
+ times for multiscreen environments */
+ }
+ }
+ }
+ }
+}
+
+void
+initGConfClient (CCSContext *context)
+{
+ int i;
+
+ client = gconf_client_get_default ();
+
+ for (i = 0; i < NUM_WATCHED_DIRS; i++)
+ {
+ gnomeGConfNotifyIds[i] = gconf_client_notify_add (client,
+ watchedGConfGnomeDirectories[i],
+ gnomeGConfValueChanged, context,
+ NULL, NULL);
+ gconf_client_add_dir (client, watchedGConfGnomeDirectories[i],
+ GCONF_CLIENT_PRELOAD_NONE, NULL);
+ }
+}
+
+void
+finiGConfClient (void)
+{
+ int i;
+
+ for (i = 0; i < NUM_WATCHED_DIRS; i++)
+ {
+ if (gnomeGConfNotifyIds[i])
+ {
+ gconf_client_notify_remove (client, gnomeGConfNotifyIds[0]);
+ gnomeGConfNotifyIds[i] = 0;
+ }
+ gconf_client_remove_dir (client, watchedGConfGnomeDirectories[i], NULL);
+ }
+ gconf_client_suggest_sync (client, NULL);
+
+ g_object_unref (client);
+ client = NULL;
+}
+
+static unsigned int
+getGnomeMouseButtonModifier(void)
+{
+ unsigned int modMask = 0;
+ GError *err = NULL;
+ char *value;
+
+ value = gconf_client_get_string (client,
+ METACITY "/general/mouse_button_modifier",
+ &err);
+
+ if (err)
+ {
+ g_error_free (err);
+ return 0;
+ }
+
+ if (!value)
+ return 0;
+
+ modMask = ccsStringToModifiers (value);
+ g_free (value);
+
+ return modMask;
+}
+
+static unsigned int
+getButtonBindingForSetting (CCSContext *context,
+ const char *plugin,
+ const char *setting)
+{
+ CCSSetting *s;
+
+ s = findDisplaySettingForPlugin (context, plugin, setting);
+ if (!s)
+ return 0;
+
+ if (s->type != TypeButton)
+ return 0;
+
+ return s->value->value.asButton.button;
+}
+
+Bool
+readGConfIntegratedOption (CCSContext *context,
+ CCSSetting *setting,
+ int index)
+{
+ GConfValue *gconfValue;
+ GError *err = NULL;
+ Bool ret = FALSE;
+
+ ret = readOption (setting);
+
+ gconfValue = gconf_client_get (client,
+ specialOptions[index].gnomeName,
+ &err);
+
+ if (err)
+ {
+ g_error_free (err);
+ return FALSE;
+ }
+
+ if (!gconfValue)
+ return FALSE;
+
+ switch (specialOptions[index].type) {
+ case OptionInt:
+ if (gconfValue->type == GCONF_VALUE_INT)
+ {
+ guint value;
+
+ value = gconf_value_get_int (gconfValue);
+ ccsSetInt (setting, value, TRUE);
+ ret = TRUE;
+ }
+ break;
+ case OptionBool:
+ if (gconfValue->type == GCONF_VALUE_BOOL)
+ {
+ gboolean value;
+
+ value = gconf_value_get_bool (gconfValue);
+ ccsSetBool (setting, value ? TRUE : FALSE, TRUE);
+ ret = TRUE;
+ }
+ break;
+ case OptionString:
+ if (gconfValue->type == GCONF_VALUE_STRING)
+ {
+ const char *value;
+
+ value = gconf_value_get_string (gconfValue);
+ if (value)
+ {
+ ccsSetString (setting, value, TRUE);
+ ret = TRUE;
+ }
+ }
+ break;
+ case OptionKey:
+ if (gconfValue->type == GCONF_VALUE_STRING)
+ {
+ const char *value;
+
+ value = gconf_value_get_string (gconfValue);
+ if (value)
+ {
+ CCSSettingKeyValue key;
+
+ memset (&key, 0, sizeof (CCSSettingKeyValue));
+ ccsGetKey (setting, &key);
+ if (ccsStringToKeyBinding (value, &key))
+ {
+ ccsSetKey (setting, key, TRUE);
+ ret = TRUE;
+ }
+ }
+ }
+ break;
+ case OptionSpecial:
+ {
+ const char *settingName = specialOptions[index].settingName;
+ const char *pluginName = specialOptions[index].pluginName;
+
+ if (strcmp (settingName, "current_viewport") == 0)
+ {
+ if (gconfValue->type == GCONF_VALUE_BOOL)
+ {
+ gboolean showAll;
+
+ showAll = gconf_value_get_bool (gconfValue);
+ ccsSetBool (setting, !showAll, TRUE);
+ ret = TRUE;
+ }
+ }
+ else if (strcmp (settingName, "fullscreen_visual_bell") == 0)
+ {
+ if (gconfValue->type == GCONF_VALUE_STRING)
+ {
+ const char *value;
+
+ value = gconf_value_get_string (gconfValue);
+ if (value)
+ {
+ Bool fullscreen;
+
+ fullscreen = strcmp (value, "fullscreen") == 0;
+ ccsSetBool (setting, fullscreen, TRUE);
+ ret = TRUE;
+ }
+ }
+ }
+ else if (strcmp (settingName, "click_to_focus") == 0)
+ {
+ if (gconfValue->type == GCONF_VALUE_STRING)
+ {
+ const char *focusMode;
+
+ focusMode = gconf_value_get_string (gconfValue);
+
+ if (focusMode)
+ {
+ Bool clickToFocus = (strcmp (focusMode, "click") == 0);
+ ccsSetBool (setting, clickToFocus, TRUE);
+ ret = TRUE;
+ }
+ }
+ }
+ else if (((strcmp (settingName, "initiate_button") == 0) &&
+ ((strcmp (pluginName, "move") == 0) ||
+ (strcmp (pluginName, "resize") == 0))) ||
+ ((strcmp (settingName, "window_menu_button") == 0) &&
+ (strcmp (pluginName, "core") == 0)))
+ {
+ gboolean resizeWithRightButton;
+ CCSSettingButtonValue button;
+
+ memset (&button, 0, sizeof (CCSSettingButtonValue));
+ ccsGetButton (setting, &button);
+
+ button.buttonModMask = getGnomeMouseButtonModifier ();
+
+ resizeWithRightButton =
+ gconf_client_get_bool (client, METACITY
+ "/general/resize_with_right_button",
+ &err);
+
+ if (strcmp (settingName, "window_menu_button") == 0)
+ button.button = resizeWithRightButton ? 2 : 3;
+ else if (strcmp (pluginName, "resize") == 0)
+ button.button = resizeWithRightButton ? 3 : 2;
+ else
+ button.button = 1;
+
+ ccsSetButton (setting, button, TRUE);
+ ret = TRUE;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ gconf_value_free (gconfValue);
+
+ return ret;
+}
+
+static Bool
+setGnomeMouseButtonModifier (unsigned int modMask)
+{
+ char *modifiers, *currentValue;
+ GError *err = NULL;
+
+ modifiers = ccsModifiersToString (modMask);
+ if (!modifiers)
+ return FALSE;
+
+ currentValue = gconf_client_get_string (client,
+ METACITY
+ "/general/mouse_button_modifier",
+ &err);
+ if (err)
+ {
+ free (modifiers);
+ g_error_free (err);
+ return FALSE;
+ }
+
+ if (!currentValue || (strcmp (currentValue, modifiers) != 0))
+ gconf_client_set_string (client,
+ METACITY "/general/mouse_button_modifier",
+ modifiers, NULL);
+ if (currentValue)
+ g_free (currentValue);
+
+ free (modifiers);
+
+ return TRUE;
+}
+
+static void
+setButtonBindingForSetting (CCSContext *context,
+ const char *plugin,
+ const char *setting,
+ unsigned int button,
+ unsigned int buttonModMask)
+{
+ CCSSetting *s;
+ CCSSettingButtonValue value;
+
+ s = findDisplaySettingForPlugin (context, plugin, setting);
+ if (!s)
+ return;
+
+ if (s->type != TypeButton)
+ return;
+
+ value = s->value->value.asButton;
+
+ if ((value.button != button) || (value.buttonModMask != buttonModMask))
+ {
+ value.button = button;
+ value.buttonModMask = buttonModMask;
+
+ ccsSetButton (s, value, TRUE);
+ }
+}
+
+void
+writeGConfIntegratedOption (CCSContext *context,
+ CCSSetting *setting,
+ int index)
+{
+ GError *err = NULL;
+ const char *optionName = specialOptions[index].gnomeName;
+
+ switch (specialOptions[index].type)
+ {
+ case OptionInt:
+ {
+ int newValue, currentValue;
+ if (!ccsGetInt (setting, &newValue))
+ break;
+ currentValue = gconf_client_get_int (client, optionName, &err);
+
+ if (!err && (currentValue != newValue))
+ gconf_client_set_int(client, specialOptions[index].gnomeName,
+ newValue, NULL);
+ }
+ break;
+ case OptionBool:
+ {
+ Bool newValue;
+ gboolean currentValue;
+ if (!ccsGetBool (setting, &newValue))
+ break;
+ currentValue = gconf_client_get_bool (client, optionName, &err);
+
+ if (!err && ((currentValue && !newValue) ||
+ (!currentValue && newValue)))
+ gconf_client_set_bool (client, specialOptions[index].gnomeName,
+ newValue, NULL);
+ }
+ break;
+ case OptionString:
+ {
+ char *newValue;
+ gchar *currentValue;
+ if (!ccsGetString (setting, &newValue))
+ break;
+ currentValue = gconf_client_get_string (client, optionName, &err);
+
+ if (!err && currentValue)
+ {
+ if (strcmp (currentValue, newValue) != 0)
+ gconf_client_set_string (client, optionName,
+ newValue, NULL);
+ g_free (currentValue);
+ }
+ }
+ break;
+ case OptionKey:
+ {
+ char *newValue;
+ gchar *currentValue;
+
+ newValue = ccsKeyBindingToString (&setting->value->value.asKey);
+ if (newValue)
+ {
+ if (strcmp (newValue, "Disabled") == 0)
+ {
+ /* Metacity doesn't like "Disabled", it wants "disabled" */
+ newValue[0] = 'd';
+ }
+
+ currentValue = gconf_client_get_string (client,
+ optionName, &err);
+
+ if (!err && currentValue)
+ {
+ if (strcmp (currentValue, newValue) != 0)
+ gconf_client_set_string (client, optionName,
+ newValue, NULL);
+ g_free (currentValue);
+ }
+ free (newValue);
+ }
+ }
+ break;
+ case OptionSpecial:
+ {
+ const char *settingName = specialOptions[index].settingName;
+ const char *pluginName = specialOptions[index].pluginName;
+
+ if (strcmp (settingName, "current_viewport") == 0)
+ {
+ Bool currentViewport;
+
+ if (!ccsGetBool (setting, &currentViewport))
+ break;
+
+ gconf_client_set_bool (client, optionName,
+ !currentViewport, NULL);
+ }
+ else if (strcmp (settingName, "fullscreen_visual_bell") == 0)
+ {
+ Bool fullscreen;
+ gchar *currentValue, *newValue;
+ if (!ccsGetBool (setting, &fullscreen))
+ break;
+
+ newValue = fullscreen ? "fullscreen" : "frame_flash";
+ currentValue = gconf_client_get_string (client,
+ optionName, &err);
+ if (!err && currentValue)
+ {
+ if (strcmp (currentValue, newValue) != 0)
+ gconf_client_set_string (client, optionName,
+ newValue, NULL);
+ g_free (currentValue);
+ }
+ }
+ else if (strcmp (settingName, "click_to_focus") == 0)
+ {
+ Bool clickToFocus;
+ gchar *newValue, *currentValue;
+ if (!ccsGetBool (setting, &clickToFocus))
+ break;
+
+ newValue = clickToFocus ? "click" : "sloppy";
+ currentValue = gconf_client_get_string (client,
+ optionName, &err);
+
+ if (!err && currentValue)
+ {
+ if (strcmp (currentValue, newValue) != 0)
+ gconf_client_set_string (client, optionName,
+ newValue, NULL);
+ g_free (currentValue);
+ }
+ }
+ else if (((strcmp (settingName, "initiate_button") == 0) &&
+ ((strcmp (pluginName, "move") == 0) ||
+ (strcmp (pluginName, "resize") == 0))) ||
+ ((strcmp (settingName, "window_menu_button") == 0) &&
+ (strcmp (pluginName, "core") == 0)))
+ {
+ unsigned int modMask;
+ Bool resizeWithRightButton = FALSE;
+ gboolean currentValue;
+
+ if ((getButtonBindingForSetting (context, "resize",
+ "initiate_button") == 3) ||
+ (getButtonBindingForSetting (context, "core",
+ "window_menu_button") == 2))
+ {
+ resizeWithRightButton = TRUE;
+ }
+
+ currentValue =
+ gconf_client_get_bool (client, METACITY
+ "/general/resize_with_right_button",
+ &err);
+
+ if (!err && ((currentValue && !resizeWithRightButton) ||
+ (!currentValue && resizeWithRightButton)))
+ {
+ gconf_client_set_bool (client,
+ METACITY
+ "/general/resize_with_right_button",
+ resizeWithRightButton, NULL);
+ }
+
+ modMask = setting->value->value.asButton.buttonModMask;
+ if (setGnomeMouseButtonModifier (modMask))
+ {
+ setButtonBindingForSetting (context, "move",
+ "initiate_button", 1, modMask);
+ setButtonBindingForSetting (context, "resize",
+ "initiate_button",
+ resizeWithRightButton ? 3 : 2,
+ modMask);
+ setButtonBindingForSetting (context, "core",
+ "window_menu_button",
+ resizeWithRightButton ? 2 : 3,
+ modMask);
+ }
+ }
+ }
+ break;
+ }
+
+ if (err)
+ g_error_free (err);
+}
+#endif
diff --git a/src/gsettings.c b/src/gsettings.c
new file mode 100644
index 0000000..1af5a5a
--- /dev/null
+++ b/src/gsettings.c
@@ -0,0 +1,1257 @@
+/**
+ *
+ * GSettings libccs backend
+ *
+ * gsettings.c
+ *
+ * Copyright (c) 2011 Canonical Ltd
+ *
+ * Based on the original compizconfig-backend-gconf
+ *
+ * Copyright (c) 2007 Danny Baumann <maniac@opencompositing.org>
+ *
+ * Parts of this code are taken from libberylsettings
+ * gconf backend, written by:
+ *
+ * Copyright (c) 2006 Robert Carr <racarr@opencompositing.org>
+ * Copyright (c) 2007 Dennis Kasprzyk <onestone@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.
+ *
+ * Authored By:
+ * Sam Spilsbury <sam.spilsbury@canonical.com>
+ *
+ **/
+
+#include "gsettings.h"
+
+static void
+valueChanged (GSettings *settings,
+ gchar *keyname,
+ gpointer user_data);
+
+static void
+gnomeValueChanged (GSettings *settings,
+ gchar *keyname,
+ gpointer user_data);
+
+static GList *settingsList = NULL;
+static GSettings *compizconfigSettings = NULL;
+static GSettings *currentProfileSettings = NULL;
+static GList *watchedGnomeSettings = NULL;
+
+char *currentProfile = NULL;
+
+/* some forward declarations */
+static void writeIntegratedOption (CCSContext *context,
+ CCSSetting *setting,
+ int index);
+
+typedef struct _SpecialOptionGSettings {
+ const char* settingName;
+ const char* pluginName;
+ const char* schemaName;
+ const char* keyName;
+ const char* type;
+} SpecialOption;
+
+static gchar *
+getSchemaNameForPlugin (const char *plugin)
+{
+ gchar *schemaName = NULL;
+
+ schemaName = g_strconcat (COMPIZ_SCHEMA_ID, ".", plugin, NULL);
+
+ return schemaName;
+}
+
+static inline gchar *
+translateKeyForGSettings (char *gsettingName)
+{
+ gchar *clean = NULL;
+ gchar **delimited = NULL;
+ guint i = 0;
+
+ /* Replace underscores with dashes */
+ delimited = g_strsplit (gsettingName, "_", 0);
+
+ clean = g_strjoinv ("-", delimited);
+
+ /* It can't be more than 32 chars, warn if that's the case */
+ gchar *ret = g_strndup (clean, 31);
+
+ if (strlen (clean) > 31)
+ printf ("GSettings Backend: Warning: key name %s is not valid in GSettings, it was changed to %s, this may cause problems!\n", clean, ret);
+
+ /* Everything must be lowercase */
+ for (; i < strlen (ret); i++)
+ ret[i] = g_ascii_tolower (ret[i]);
+
+ g_free (clean);
+ g_strfreev (delimited);
+
+ return ret;
+}
+
+static inline gchar *
+translateKeyForCCS (char *gsettingName)
+{
+ gchar *clean = NULL;
+ gchar **delimited = NULL;
+
+ /* Replace dashes with underscores */
+ delimited = g_strsplit (gsettingName, "-", 0);
+
+ clean = g_strjoinv ("_", delimited);
+
+ /* FIXME: Truncated and lowercased settings aren't going to work */
+
+ g_strfreev (delimited);
+
+ return clean;
+}
+
+static GSettings *
+getSettingsObjectForPluginWithPath (const char *plugin,
+ const char *path,
+ CCSContext *context)
+{
+ GSettings *settingsObj = NULL;
+ GList *l = settingsList;
+ gchar *schemaName = getSchemaNameForPlugin (plugin);
+ GVariant *writtenPlugins;
+ char *plug;
+ GVariant *newWrittenPlugins;
+ GVariantBuilder *newWrittenPluginsBuilder;
+ GVariantIter *iter;
+ gboolean found = FALSE;
+
+ while (l)
+ {
+ settingsObj = (GSettings *) l->data;
+ gchar *name = NULL;
+
+ g_object_get (G_OBJECT (settingsObj),
+ "schema",
+ &name, NULL);
+ if (g_strcmp0 (name, schemaName) == 0)
+ {
+ g_free (name);
+ g_free (schemaName);
+
+ return settingsObj;
+ }
+
+ l = g_list_next (l);
+ }
+
+ /* No existing settings object found for this schema, create one */
+
+ settingsObj = g_settings_new_with_path (schemaName, path);
+
+ g_signal_connect (G_OBJECT (settingsObj), "changed", (GCallback) valueChanged, (gpointer) context);
+
+ settingsList = g_list_append (settingsList, (void *) settingsObj);
+
+ /* Also write the plugin name to the list of modified plugins so
+ * that when we delete the profile the keys for that profile are also
+ * unset FIXME: This could be a little more efficient, like we could
+ * store keys that have changed from their defaults ... though
+ * gsettings doesn't seem to give you a way to get all of the schemas */
+
+ writtenPlugins = g_settings_get_value (currentProfileSettings, "plugins-with-set-keys");
+
+ newWrittenPluginsBuilder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
+
+ iter = g_variant_iter_new (writtenPlugins);
+ while (g_variant_iter_loop (iter, "s", &plug))
+ {
+ g_variant_builder_add (newWrittenPluginsBuilder, "s", plug);
+
+ if (!found)
+ found = (g_strcmp0 (plug, plugin) == 0);
+ }
+
+ if (!found)
+ g_variant_builder_add (newWrittenPluginsBuilder, "s", plugin);
+
+ newWrittenPlugins = g_variant_new ("as", newWrittenPluginsBuilder);
+ g_settings_set_value (currentProfileSettings, "plugins-with-set-keys", newWrittenPlugins);
+
+ g_variant_iter_free (iter);
+ g_variant_unref (newWrittenPlugins);
+ g_variant_builder_unref (newWrittenPluginsBuilder);
+
+ return settingsObj;
+}
+
+static GSettings *
+getSettingsObjectForCCSSetting (CCSSetting *setting)
+{
+ KEYNAME(setting->parent->context->screenNum);
+ PATHNAME (setting->parent->name, keyName);
+
+ return getSettingsObjectForPluginWithPath (setting->parent->name, pathName, setting->parent->context);
+}
+
+static Bool
+isIntegratedOption (CCSSetting *setting,
+ int *index)
+{
+#ifdef USE_GCONF
+ return isGConfIntegratedOption (setting, index);
+#else
+ return FALSE;
+#endif
+}
+
+static void
+gnomeValueChanged (GSettings *settings,
+ gchar *keyName,
+ gpointer user_data)
+{
+}
+
+static void
+valueChanged (GSettings *settings,
+ gchar *keyName,
+ gpointer user_data)
+{
+ CCSContext *context = (CCSContext *)user_data;
+ char *uncleanKeyName;
+ char *path;
+ char *token;
+ int index;
+ unsigned int screenNum;
+ CCSPlugin *plugin;
+ CCSSetting *setting;
+
+ g_object_get (G_OBJECT (settings), "path", &path, NULL);
+
+ path += strlen (COMPIZ) + 1;
+
+ token = strsep (&path, "/"); /* Profile name */
+ if (!token)
+ return;
+
+ token = strsep (&path, "/"); /* plugins */
+ if (!token)
+ return;
+
+ token = strsep (&path, "/"); /* plugin */
+ if (!token)
+ return;
+
+ plugin = ccsFindPlugin (context, token);
+ if (!plugin)
+ return;
+
+ token = strsep (&path, "/"); /* screen%i */
+ if (!token)
+ return;
+
+ sscanf (token, "screen%d", &screenNum);
+
+ uncleanKeyName = translateKeyForCCS (keyName);
+
+ setting = ccsFindSetting (plugin, uncleanKeyName);
+ if (!setting)
+ {
+ printf ("GSettings Backend: unable to find setting %s, for path %s\n", uncleanKeyName, path);
+ free (uncleanKeyName);
+ return;
+ }
+
+ readInit (context);
+ if (!readOption (setting))
+ {
+ ccsResetToDefault (setting, TRUE);
+ }
+
+ if (ccsGetIntegrationEnabled (context) &&
+ isIntegratedOption (setting, &index))
+ {
+ writeInit (context);
+ writeIntegratedOption (context, setting, index);
+ }
+
+ free (uncleanKeyName);
+}
+
+static Bool
+readListValue (CCSSetting *setting)
+{
+ GSettings *settings = getSettingsObjectForCCSSetting (setting);
+ gchar *variantType;
+ unsigned int nItems, i = 0;
+ CCSSettingValueList list = NULL;
+ GVariant *value;
+ GVariantIter *iter;
+
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
+
+ switch (setting->info.forList.listType)
+ {
+ case TypeString:
+ case TypeMatch:
+ case TypeColor:
+ variantType = g_strdup ("s");
+ break;
+ case TypeBool:
+ variantType = g_strdup ("b");
+ break;
+ case TypeInt:
+ variantType = g_strdup ("i");
+ break;
+ case TypeFloat:
+ variantType = g_strdup ("d");
+ break;
+ default:
+ variantType = NULL;
+ break;
+ }
+
+ if (!variantType)
+ return FALSE;
+
+ value = g_settings_get_value (settings, cleanSettingName);
+ if (!value)
+ {
+ ccsSetList (setting, NULL, TRUE);
+ return TRUE;
+ }
+
+ iter = g_variant_iter_new (value);
+ nItems = g_variant_iter_n_children (iter);
+
+ switch (setting->info.forList.listType)
+ {
+ case TypeBool:
+ {
+ Bool *array = malloc (nItems * sizeof (Bool));
+ Bool *arrayCounter = array;
+
+ if (!array)
+ break;
+
+ /* Reads each item from the variant into the position pointed
+ * at by arrayCounter */
+ while (g_variant_iter_loop (iter, variantType, arrayCounter))
+ arrayCounter++;
+
+ list = ccsGetValueListFromBoolArray (array, nItems, setting);
+ free (array);
+ }
+ break;
+ case TypeInt:
+ {
+ int *array = malloc (nItems * sizeof (int));
+ int *arrayCounter = array;
+
+ if (!array)
+ break;
+
+ /* Reads each item from the variant into the position pointed
+ * at by arrayCounter */
+ while (g_variant_iter_loop (iter, variantType, arrayCounter))
+ arrayCounter++;
+
+ list = ccsGetValueListFromIntArray (array, nItems, setting);
+ free (array);
+ }
+ break;
+ case TypeFloat:
+ {
+ double *array = malloc (nItems * sizeof (double));
+ double *arrayCounter = array;
+
+ if (!array)
+ break;
+
+ /* Reads each item from the variant into the position pointed
+ * at by arrayCounter */
+ while (g_variant_iter_loop (iter, variantType, arrayCounter))
+ arrayCounter++;
+
+ list = ccsGetValueListFromFloatArray ((float *) array, nItems, setting);
+ free (array);
+ }
+ break;
+ case TypeString:
+ case TypeMatch:
+ {
+ char **array = calloc (1, (nItems + 1) * sizeof (char *));
+ char **arrayCounter = array;
+
+ if (!array)
+ {
+ break;
+ }
+
+ /* Reads each item from the variant into the position pointed
+ * at by arrayCounter */
+ while (g_variant_iter_loop (iter, variantType, arrayCounter))
+ arrayCounter++;
+
+ list = ccsGetValueListFromStringArray (array, nItems, setting);
+ for (i = 0; i < nItems; i++)
+ if (array[i])
+ free (array[i]);
+ free (array);
+ }
+ break;
+ case TypeColor:
+ {
+ CCSSettingColorValue *array;
+ char *colorValue;
+ array = malloc (nItems * sizeof (CCSSettingColorValue));
+ if (!array)
+ break;
+
+ while (g_variant_iter_loop (iter, variantType, &colorValue))
+ {
+ memset (&array[i], 0, sizeof (CCSSettingColorValue));
+ ccsStringToColor (colorValue,
+ &array[i]);
+ }
+ list = ccsGetValueListFromColorArray (array, nItems, setting);
+ free (array);
+ }
+ break;
+ default:
+ break;
+ }
+
+ free (cleanSettingName);
+ free (variantType);
+
+ if (list)
+ {
+ ccsSetList (setting, list, TRUE);
+ ccsSettingValueListFree (list, TRUE);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static Bool
+readIntegratedOption (CCSContext *context,
+ CCSSetting *setting,
+ int index)
+{
+#ifdef USE_GCONF
+ return readGConfIntegratedOption (context, setting, index);
+#else
+ return FALSE;
+#endif
+}
+
+Bool
+readOption (CCSSetting * setting)
+{
+ GSettings *settings = getSettingsObjectForCCSSetting (setting);
+ GVariant *gsettingsValue = NULL;
+ Bool ret = FALSE;
+ Bool valid = TRUE;
+
+ /* It is impossible for certain settings to have a schema,
+ * such as actions and read only settings, so in that case
+ * just return FALSE since compizconfig doesn't expect us
+ * to read them anyways */
+
+ if (setting->type == TypeAction ||
+ ccsSettingIsReadOnly (setting))
+ {
+ return FALSE;
+ }
+
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
+ KEYNAME(setting->parent->context->screenNum);
+ PATHNAME (setting->parent->name, keyName);
+
+ /* first check if the key is set */
+ gsettingsValue = g_settings_get_value (settings, cleanSettingName);
+
+ switch (setting->type)
+ {
+ case TypeString:
+ case TypeMatch:
+ case TypeColor:
+ case TypeKey:
+ case TypeButton:
+ case TypeEdge:
+ valid = (g_variant_type_is_subtype_of (G_VARIANT_TYPE_STRING, g_variant_get_type (gsettingsValue)));
+ break;
+ case TypeInt:
+ valid = (g_variant_type_is_subtype_of (G_VARIANT_TYPE_INT32, g_variant_get_type (gsettingsValue)));
+ break;
+ case TypeBool:
+ case TypeBell:
+ valid = (g_variant_type_is_subtype_of (G_VARIANT_TYPE_BOOLEAN, g_variant_get_type (gsettingsValue)));
+ break;
+ case TypeFloat:
+ valid = (g_variant_type_is_subtype_of (G_VARIANT_TYPE_DOUBLE, g_variant_get_type (gsettingsValue)));
+ break;
+ case TypeList:
+ valid = (g_variant_type_is_array (g_variant_get_type (gsettingsValue)));
+ break;
+ default:
+ break;
+ }
+
+ if (!valid)
+ {
+ printf ("GSettings backend: There is an unsupported value at path %s. "
+ "Settings from this path won't be read. Try to remove "
+ "that value so that operation can continue properly.\n",
+ pathName);
+ free (cleanSettingName);
+ g_variant_unref (gsettingsValue);
+ return FALSE;
+ }
+
+ switch (setting->type)
+ {
+ case TypeString:
+ {
+ const char *value;
+ value = g_variant_get_string (gsettingsValue, NULL);
+ if (value)
+ {
+ ccsSetString (setting, value, TRUE);
+ ret = TRUE;
+ }
+ }
+ break;
+ case TypeMatch:
+ {
+ const char * value;
+ value = g_variant_get_string (gsettingsValue, NULL);
+ if (value)
+ {
+ ccsSetMatch (setting, value, TRUE);
+ ret = TRUE;
+ }
+ }
+ break;
+ case TypeInt:
+ {
+ int value;
+ value = g_variant_get_int32 (gsettingsValue);
+
+ ccsSetInt (setting, value, TRUE);
+ ret = TRUE;
+ }
+ break;
+ case TypeBool:
+ {
+ gboolean value;
+ value = g_variant_get_boolean (gsettingsValue);
+
+ ccsSetBool (setting, value ? TRUE : FALSE, TRUE);
+ ret = TRUE;
+ }
+ break;
+ case TypeFloat:
+ {
+ double value;
+ value = g_variant_get_double (gsettingsValue);
+
+ ccsSetFloat (setting, (float)value, TRUE);
+ ret = TRUE;
+ }
+ break;
+ case TypeColor:
+ {
+ const char *value;
+ CCSSettingColorValue color;
+ value = g_variant_get_string (gsettingsValue, NULL);
+
+ if (value && ccsStringToColor (value, &color))
+ {
+ ccsSetColor (setting, color, TRUE);
+ ret = TRUE;
+ }
+ }
+ break;
+ case TypeKey:
+ {
+ const char *value;
+ CCSSettingKeyValue key;
+ value = g_variant_get_string (gsettingsValue, NULL);
+
+ if (value && ccsStringToKeyBinding (value, &key))
+ {
+ ccsSetKey (setting, key, TRUE);
+ ret = TRUE;
+ }
+ }
+ break;
+ case TypeButton:
+ {
+ const char *value;
+ CCSSettingButtonValue button;
+ value = g_variant_get_string (gsettingsValue, NULL);
+
+ if (value && ccsStringToButtonBinding (value, &button))
+ {
+ ccsSetButton (setting, button, TRUE);
+ ret = TRUE;
+ }
+ }
+ break;
+ case TypeEdge:
+ {
+ const char *value;
+ value = g_variant_get_string (gsettingsValue, NULL);
+
+ if (value)
+ {
+ unsigned int edges;
+ edges = ccsStringToEdges (value);
+ ccsSetEdge (setting, edges, TRUE);
+ ret = TRUE;
+ }
+ }
+ break;
+ case TypeBell:
+ {
+ gboolean value;
+ value = g_variant_get_boolean (gsettingsValue);
+
+ ccsSetBell (setting, value ? TRUE : FALSE, TRUE);
+ ret = TRUE;
+ }
+ break;
+ case TypeList:
+ ret = readListValue (setting);
+ break;
+ default:
+ printf("GSettings backend: attempt to read unsupported setting type %d!\n",
+ setting->type);
+ break;
+ }
+
+ free (cleanSettingName);
+ g_variant_unref (gsettingsValue);
+
+ return ret;
+}
+
+static void
+writeListValue (CCSSetting *setting,
+ char *pathName)
+{
+ GSettings *settings = getSettingsObjectForCCSSetting (setting);
+ GVariant *value;
+ gchar *variantType = NULL;
+ CCSSettingValueList list;
+
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
+
+ if (!ccsGetList (setting, &list))
+ return;
+
+ switch (setting->info.forList.listType)
+ {
+ case TypeBool:
+ {
+ variantType = "ab";
+ GVariantBuilder *builder = g_variant_builder_new (G_VARIANT_TYPE ("ab"));
+ while (list)
+ {
+ g_variant_builder_add (builder, "b", list->data->value.asBool);
+ list = list->next;
+ }
+ value = g_variant_new ("ab", builder);
+ g_variant_builder_unref (builder);
+ }
+ break;
+ case TypeInt:
+ {
+ variantType = "ai";
+ GVariantBuilder *builder = g_variant_builder_new (G_VARIANT_TYPE ("ai"));
+ while (list)
+ {
+ g_variant_builder_add (builder, "i", list->data->value.asInt);
+ list = list->next;
+ }
+ value = g_variant_new ("ai", builder);
+ g_variant_builder_unref (builder);
+ }
+ break;
+ case TypeFloat:
+ {
+ variantType = "ad";
+ GVariantBuilder *builder = g_variant_builder_new (G_VARIANT_TYPE ("ad"));
+ while (list)
+ {
+ g_variant_builder_add (builder, "d", (gdouble) list->data->value.asFloat);
+ list = list->next;
+ }
+ value = g_variant_new ("ad", builder);
+ g_variant_builder_unref (builder);
+ }
+ break;
+ case TypeString:
+ {
+ variantType = "as";
+ GVariantBuilder *builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
+ while (list)
+ {
+ g_variant_builder_add (builder, "s", list->data->value.asString);
+ list = list->next;
+ }
+ value = g_variant_new ("as", builder);
+ g_variant_builder_unref (builder);
+ }
+ break;
+ case TypeMatch:
+ {
+ variantType = "as";
+ GVariantBuilder *builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
+ while (list)
+ {
+ g_variant_builder_add (builder, "s", list->data->value.asMatch);
+ list = list->next;
+ }
+ value = g_variant_new ("as", builder);
+ g_variant_builder_unref (builder);
+ }
+ break;
+ case TypeColor:
+ {
+ variantType = "as";
+ GVariantBuilder *builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
+ char *item;
+ while (list)
+ {
+ item = ccsColorToString (&list->data->value.asColor);
+ g_variant_builder_add (builder, "s", item);
+ list = list->next;
+ }
+ value = g_variant_new ("as", builder);
+ g_variant_builder_unref (builder);
+ }
+ break;
+ default:
+ printf("GSettings backend: attempt to write unsupported list type %d!\n",
+ setting->info.forList.listType);
+ variantType = NULL;
+ break;
+ }
+
+ if (variantType != NULL)
+ {
+ g_settings_set_value (settings, cleanSettingName, value);
+ g_variant_unref (value);
+ }
+
+ free (cleanSettingName);
+}
+
+static void
+writeIntegratedOption (CCSContext *context,
+ CCSSetting *setting,
+ int index)
+{
+#ifdef USE_GCONF
+ writeGConfIntegratedOption (context, setting, index);
+#endif
+
+ return;
+}
+
+static void
+resetOptionToDefault (CCSSetting * setting)
+{
+ GSettings *settings = getSettingsObjectForCCSSetting (setting);
+
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
+ KEYNAME (setting->parent->context->screenNum);
+ PATHNAME (setting->parent->name, keyName);
+
+ g_settings_reset (settings, cleanSettingName);
+
+ free (cleanSettingName);
+}
+
+void
+writeOption (CCSSetting * setting)
+{
+ GSettings *settings = getSettingsObjectForCCSSetting (setting);
+ char *cleanSettingName = translateKeyForGSettings (setting->name);
+ KEYNAME (setting->parent->context->screenNum);
+ PATHNAME (setting->parent->name, keyName);
+
+ switch (setting->type)
+ {
+ case TypeString:
+ {
+ char *value;
+ if (ccsGetString (setting, &value))
+ {
+ g_settings_set (settings, cleanSettingName, "s", value, NULL);
+ }
+ }
+ break;
+ case TypeMatch:
+ {
+ char *value;
+ if (ccsGetMatch (setting, &value))
+ {
+ g_settings_set (settings, cleanSettingName, "s", value, NULL);
+ }
+ }
+ case TypeFloat:
+ {
+ float value;
+ if (ccsGetFloat (setting, &value))
+ {
+ g_settings_set (settings, cleanSettingName, "d", (double) value, NULL);
+ }
+ }
+ break;
+ case TypeInt:
+ {
+ int value;
+ if (ccsGetInt (setting, &value))
+ {
+ g_settings_set (settings, cleanSettingName, "i", value, NULL);
+ }
+ }
+ break;
+ case TypeBool:
+ {
+ Bool value;
+ if (ccsGetBool (setting, &value))
+ {
+ g_settings_set (settings, cleanSettingName, "b", value, NULL);
+ }
+ }
+ break;
+ case TypeColor:
+ {
+ CCSSettingColorValue value;
+ char *colString;
+
+ if (!ccsGetColor (setting, &value))
+ break;
+
+ colString = ccsColorToString (&value);
+ if (!colString)
+ break;
+
+ g_settings_set (settings, cleanSettingName, "s", colString, NULL);
+ free (colString);
+ }
+ break;
+ case TypeKey:
+ {
+ CCSSettingKeyValue key;
+ char *keyString;
+
+ if (!ccsGetKey (setting, &key))
+ break;
+
+ keyString = ccsKeyBindingToString (&key);
+ if (!keyString)
+ break;
+
+ g_settings_set (settings, cleanSettingName, "s", keyString, NULL);
+ free (keyString);
+ }
+ break;
+ case TypeButton:
+ {
+ CCSSettingButtonValue button;
+ char *buttonString;
+
+ if (!ccsGetButton (setting, &button))
+ break;
+
+ buttonString = ccsButtonBindingToString (&button);
+ if (!buttonString)
+ break;
+
+ g_settings_set (settings, cleanSettingName, "s", buttonString, NULL);
+ free (buttonString);
+ }
+ break;
+ case TypeEdge:
+ {
+ unsigned int edges;
+ char *edgeString;
+
+ if (!ccsGetEdge (setting, &edges))
+ break;
+
+ edgeString = ccsEdgesToString (edges);
+ if (!edgeString)
+ break;
+
+ g_settings_set (settings, cleanSettingName, "s", edgeString, NULL);
+ free (edgeString);
+ }
+ break;
+ case TypeBell:
+ {
+ Bool value;
+ if (ccsGetBell (setting, &value))
+ {
+ g_settings_set (settings, cleanSettingName, "s", value, NULL);
+ }
+ }
+ break;
+ case TypeList:
+ writeListValue (setting, pathName);
+ break;
+ default:
+ printf("GSettings backend: attempt to write unsupported setting type %d\n",
+ setting->type);
+ break;
+ }
+
+ free (cleanSettingName);
+}
+
+static void
+updateCurrentProfileName (char *profile)
+{
+ GVariant *profiles;
+ char *prof;
+ char *profilePath = COMPIZ_PROFILEPATH;
+ char *currentProfilePath;
+ GVariant *newProfiles;
+ GVariantBuilder *newProfilesBuilder;
+ GVariantIter *iter;
+ gboolean found = FALSE;
+
+ profiles = g_settings_get_value (compizconfigSettings, "existing-profiles");
+
+ newProfilesBuilder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
+
+ iter = g_variant_iter_new (profiles);
+ while (g_variant_iter_loop (iter, "s", &prof))
+ {
+ g_variant_builder_add (newProfilesBuilder, "s", prof);
+
+ if (!found)
+ found = (g_strcmp0 (prof, profile) == 0);
+ }
+
+ if (!found)
+ g_variant_builder_add (newProfilesBuilder, "s", profile);
+
+ newProfiles = g_variant_new ("as", newProfilesBuilder);
+ g_settings_set_value (compizconfigSettings, "existing-profiles", newProfiles);
+
+ g_variant_iter_free (iter);
+ g_variant_unref (newProfiles);
+ g_variant_builder_unref (newProfilesBuilder);
+
+ /* Change the current profile and current profile settings */
+ free (currentProfile);
+
+ currentProfile = strdup (profile);
+ currentProfilePath = g_strconcat (profilePath, profile, "/", NULL);
+ currentProfileSettings = g_settings_new_with_path (PROFILE_SCHEMA_ID, profilePath);
+
+ g_free (currentProfilePath);
+
+ g_settings_set (compizconfigSettings, "current-profile", "s", profile, NULL);
+}
+
+static gboolean
+updateProfile (CCSContext *context)
+{
+ char *profile = strdup (ccsGetProfile (context));
+
+ if (!profile || !strlen (profile))
+ profile = strdup (DEFAULTPROF);
+
+ if (g_strcmp0 (profile, currentProfile))
+ updateCurrentProfileName (profile);
+
+ free (profile);
+
+ return TRUE;
+}
+
+static char*
+getCurrentProfileName (void)
+{
+ GVariant *value;
+ char *ret = NULL;
+
+ value = g_settings_get_value (compizconfigSettings, "current-profile");
+
+ if (value)
+ ret = strdup (g_variant_get_string (value, NULL));
+ else
+ ret = strdup (DEFAULTPROF);
+
+ return ret;
+}
+
+static void
+processEvents (unsigned int flags)
+{
+ if (!(flags & ProcessEventsNoGlibMainLoopMask))
+ {
+ while (g_main_context_pending(NULL))
+ g_main_context_iteration(NULL, FALSE);
+ }
+}
+
+static Bool
+initBackend (CCSContext * context)
+{
+ const char *profilePath = PROFILEPATH;
+ char *currentProfilePath;
+
+ g_type_init ();
+
+ compizconfigSettings = g_settings_new (COMPIZCONFIG_SCHEMA_ID);
+
+#ifdef USE_GCONF
+ initGConfClient (context);
+#endif
+
+ currentProfile = getCurrentProfileName ();
+ currentProfilePath = g_strconcat (profilePath, currentProfile, "/", NULL);
+ currentProfileSettings = g_settings_new_with_path (PROFILE_SCHEMA_ID, currentProfilePath);
+
+ g_free (currentProfilePath);
+
+ return TRUE;
+}
+
+static Bool
+finiBackend (CCSContext * context)
+{
+ GList *l = settingsList;
+
+ processEvents (0);
+
+#ifdef USE_GCONF
+ gconf_client_clear_cache (client);
+ finiGConfClient ();
+#endif
+
+ if (currentProfile)
+ {
+ free (currentProfile);
+ currentProfile = NULL;
+ }
+
+ while (l)
+ {
+ g_object_unref (G_OBJECT (l->data));
+ l = g_list_next (l);
+ }
+
+ g_object_unref (G_OBJECT (compizconfigSettings));
+
+ processEvents (0);
+ return TRUE;
+}
+
+Bool
+readInit (CCSContext * context)
+{
+ return updateProfile (context);
+}
+
+void
+readSetting (CCSContext *context,
+ CCSSetting *setting)
+{
+ Bool status;
+ int index;
+
+ if (ccsGetIntegrationEnabled (context) &&
+ isIntegratedOption (setting, &index))
+ {
+ status = readIntegratedOption (context, setting, index);
+ }
+ else
+ status = readOption (setting);
+
+ if (!status)
+ ccsResetToDefault (setting, TRUE);
+}
+
+Bool
+writeInit (CCSContext * context)
+{
+ return updateProfile (context);
+}
+
+void
+writeSetting (CCSContext *context,
+ CCSSetting *setting)
+{
+ int index;
+
+ if (ccsGetIntegrationEnabled (context) &&
+ isIntegratedOption (setting, &index))
+ {
+ writeIntegratedOption (context, setting, index);
+ }
+ else if (setting->isDefault)
+ {
+ resetOptionToDefault (setting);
+ }
+ else
+ writeOption (setting);
+
+}
+
+static Bool
+getSettingIsIntegrated (CCSSetting * setting)
+{
+ if (!ccsGetIntegrationEnabled (setting->parent->context))
+ return FALSE;
+
+ if (!isIntegratedOption (setting, NULL))
+ return FALSE;
+
+ return TRUE;
+}
+
+static Bool
+getSettingIsReadOnly (CCSSetting * setting)
+{
+ /* FIXME */
+ return FALSE;
+}
+
+static CCSStringList
+getExistingProfiles (CCSContext *context)
+{
+ GVariant *value;
+ char *profile;
+ GVariantIter iter;
+ CCSStringList ret = NULL;
+
+ value = g_settings_get_value (compizconfigSettings, "existing-profiles");
+ g_variant_iter_init (&iter, value);
+ while (g_variant_iter_loop (&iter, "s", &profile))
+ {
+ CCSString *str = malloc (sizeof (CCSString));
+
+ str->value = strdup (profile);
+
+ ret = ccsStringListAppend (ret, str);
+ }
+
+ g_variant_unref (value);
+
+ return ret;
+}
+
+static Bool
+deleteProfile (CCSContext *context,
+ char *profile)
+{
+ GVariant *plugins;
+ GVariant *profiles;
+ GVariant *newProfiles;
+ GVariantBuilder *newProfilesBuilder;
+ char *plugin, *prof;
+ GVariantIter *iter;
+ char *profileSettingsPath = g_strconcat (PROFILEPATH, profile, "/", NULL);
+ GSettings *profileSettings = g_settings_new_with_path (PROFILE_SCHEMA_ID, profileSettingsPath);
+
+ plugins = g_settings_get_value (currentProfileSettings, "plugins-with-set-keys");
+ profiles = g_settings_get_value (compizconfigSettings, "existing-profiles");
+
+ iter = g_variant_iter_new (plugins);
+ while (g_variant_iter_loop (iter, "s", &plugin))
+ {
+ GSettings *settings;
+
+ KEYNAME (context->screenNum);
+ PATHNAME (plugin, keyName);
+
+ settings = getSettingsObjectForPluginWithPath (plugin, pathName, context);
+
+ /* The GSettings documentation says not to use this API
+ * because we should know our own schema ... though really
+ * we don't because we autogenerate schemas ... */
+ if (settings)
+ {
+ char **keys = g_settings_list_keys (settings);
+ char **key_ptr;
+
+ /* Unset all the keys */
+ for (key_ptr = keys; *key_ptr; key_ptr++)
+ g_settings_reset (settings, *key_ptr);
+
+ g_strfreev (keys);
+ }
+ }
+
+ /* Remove the profile from existing-profiles */
+ g_variant_iter_free (iter);
+ g_settings_reset (profileSettings, "plugins-with-set-values");
+
+ iter = g_variant_iter_new (profiles);
+ newProfilesBuilder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
+
+ while (g_variant_iter_loop (iter, "s", &prof))
+ {
+ if (g_strcmp0 (prof, profile))
+ g_variant_builder_add (newProfilesBuilder, "s", prof);
+ }
+
+ newProfiles = g_variant_new ("as", newProfilesBuilder);
+ g_settings_set_value (compizconfigSettings, "existing-profiles", newProfiles);
+
+ g_variant_unref (newProfiles);
+ g_variant_builder_unref (newProfilesBuilder);
+
+ free (profileSettingsPath);
+
+ updateProfile (context);
+
+ return TRUE;
+}
+
+static CCSBackendVTable gsettingsVTable = {
+ "gsettings",
+ "GSettings Configuration Backend",
+ "GSettings Configuration Backend for libccs",
+ TRUE,
+ TRUE,
+ processEvents,
+ initBackend,
+ finiBackend,
+ readInit,
+ readSetting,
+ 0,
+ writeInit,
+ writeSetting,
+ 0,
+ getSettingIsIntegrated,
+ getSettingIsReadOnly,
+ getExistingProfiles,
+ deleteProfile
+};
+
+CCSBackendVTable *
+getBackendInfo (void)
+{
+ return &gsettingsVTable;
+}
+
diff --git a/src/gsettings.h b/src/gsettings.h
new file mode 100644
index 0000000..ee0d51c
--- /dev/null
+++ b/src/gsettings.h
@@ -0,0 +1,152 @@
+/**
+ *
+ * GSettings libccs backend
+ *
+ * gconf-integration.c
+ *
+ * Copyright (c) 2011 Canonical Ltd
+ *
+ * Based on the original compizconfig-backend-gconf
+ *
+ * Copyright (c) 2007 Danny Baumann <maniac@opencompositing.org>
+ *
+ * Parts of this code are taken from libberylsettings
+ * gconf backend, written by:
+ *
+ * Copyright (c) 2006 Robert Carr <racarr@opencompositing.org>
+ * Copyright (c) 2007 Dennis Kasprzyk <onestone@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.
+ *
+ * Authored By:
+ * Sam Spilsbury <sam.spilsbury@canonical.com>
+ *
+ **/
+
+#ifndef _COMPIZCONFIG_BACKEND_GSETTINGS_GSETTINGS_H
+#define _COMPIZCONFIG_BACKEND_GSETTINGS_GSETTINGS_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <malloc.h>
+#include <string.h>
+#include <dirent.h>
+
+#include <ccs.h>
+#include <ccs-backend.h>
+
+#include <gio/gio.h>
+
+#include <X11/X.h>
+#include <X11/Xlib.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 COMPIZ_SCHEMA_ID "org.freedesktop.compiz"
+#define COMPIZCONFIG_SCHEMA_ID "org.freedesktop.compizconfig"
+#define PROFILE_SCHEMA_ID "org.freedesktop.compizconfig.profile"
+#define METACITY "/apps/metacity"
+#define COMPIZ "/apps/compiz-1"
+#define COMPIZ_PROFILEPATH COMPIZ "/profiles"
+#define COMPIZCONFIG "/org/freedesktop/compizconfig"
+#define PROFILEPATH COMPIZCONFIG "/profiles"
+#define DEFAULTPROF "Default"
+#define CORE_NAME "core"
+
+#define BUFSIZE 512
+
+#define NUM_WATCHED_DIRS 3
+
+#define KEYNAME(sn) char keyName[BUFSIZE]; \
+ snprintf (keyName, BUFSIZE, "screen%i", sn);
+
+#define PATHNAME(p,k) char pathName[BUFSIZE]; \
+ if (!p || \
+ strcmp (p, "core") == 0) \
+ snprintf (pathName, BUFSIZE, \
+ "%s/%s/plugins/%s/%s/options/", COMPIZ, currentProfile, \
+ p, k); \
+ else \
+ snprintf(pathName, BUFSIZE, \
+ "%s/%s/plugins/%s/%s/options/", COMPIZ, currentProfile, \
+ p, k);
+
+#define _GNU_SOURCE
+
+typedef enum {
+ OptionInt,
+ OptionBool,
+ OptionKey,
+ OptionString,
+ OptionSpecial,
+} SpecialOptionType;
+
+char *currentProfile;
+
+Bool readInit (CCSContext * context);
+void readSetting (CCSContext * context, CCSSetting * setting);
+Bool readOption (CCSSetting * setting);
+Bool writeInit (CCSContext * context);
+void writeOption (CCSSetting *setting);
+
+#ifdef USE_GCONF
+
+#include <gconf/gconf.h>
+#include <gconf/gconf-client.h>
+#include <gconf/gconf-value.h>
+
+GConfClient *client;
+guint gnomeGConfNotifyIds[NUM_WATCHED_DIRS];
+
+typedef struct _SpecialOptionGConf {
+ const char* settingName;
+ const char* pluginName;
+ Bool screen;
+ const char* gnomeName;
+ SpecialOptionType type;
+} SpecialOptionGConf;
+
+Bool
+isGConfIntegratedOption (CCSSetting *setting,
+ int *index);
+
+void
+gnomeGConfValueChanged (GConfClient *client,
+ guint cnxn_id,
+ GConfEntry *entry,
+ gpointer user_data);
+
+void
+initGConfClient (CCSContext *context);
+
+void
+finiGConfClient (void);
+
+Bool
+readGConfIntegratedOption (CCSContext *context,
+ CCSSetting *setting,
+ int index);
+
+void
+writeGConfIntegratedOption (CCSContext *context,
+ CCSSetting *setting,
+ int index);
+
+#endif
+
+#endif