summaryrefslogtreecommitdiff
path: root/plugins/xsettings
diff options
context:
space:
mode:
authorPerberos <[email protected]>2011-12-01 23:53:21 -0300
committerPerberos <[email protected]>2011-12-01 23:53:21 -0300
commit505cabbd3036081f26586cabc64c26e7769c0ec9 (patch)
tree09e0498bf572128f5c9ab551531cb28d6d75e992 /plugins/xsettings
downloadmate-settings-daemon-505cabbd3036081f26586cabc64c26e7769c0ec9.tar.bz2
mate-settings-daemon-505cabbd3036081f26586cabc64c26e7769c0ec9.tar.xz
moving from https://github.com/perberos/mate-desktop-environment
Diffstat (limited to 'plugins/xsettings')
-rw-r--r--plugins/xsettings/Makefile.am65
-rw-r--r--plugins/xsettings/Makefile.in718
-rw-r--r--plugins/xsettings/fontconfig-monitor.c192
-rw-r--r--plugins/xsettings/fontconfig-monitor.h44
-rw-r--r--plugins/xsettings/gsd-xsettings-manager.c1040
-rw-r--r--plugins/xsettings/gsd-xsettings-manager.h61
-rw-r--r--plugins/xsettings/gsd-xsettings-plugin.c104
-rw-r--r--plugins/xsettings/gsd-xsettings-plugin.h63
-rw-r--r--plugins/xsettings/xsettings-common.c264
-rw-r--r--plugins/xsettings/xsettings-common.h110
-rw-r--r--plugins/xsettings/xsettings-manager.c424
-rw-r--r--plugins/xsettings/xsettings-manager.h71
-rw-r--r--plugins/xsettings/xsettings.mate-settings-plugin.in8
13 files changed, 3164 insertions, 0 deletions
diff --git a/plugins/xsettings/Makefile.am b/plugins/xsettings/Makefile.am
new file mode 100644
index 0000000..8b861b9
--- /dev/null
+++ b/plugins/xsettings/Makefile.am
@@ -0,0 +1,65 @@
+NULL =
+
+plugin_LTLIBRARIES = \
+ libxsettings.la \
+ $(NULL)
+
+libxsettings_la_SOURCES = \
+ gsd-xsettings-plugin.h \
+ gsd-xsettings-plugin.c \
+ gsd-xsettings-manager.h \
+ gsd-xsettings-manager.c \
+ xsettings-common.h \
+ xsettings-common.c \
+ xsettings-manager.h \
+ xsettings-manager.c \
+ $(NULL)
+
+libxsettings_la_CPPFLAGS = \
+ -I$(top_srcdir)/mate-settings-daemon \
+ -DMATE_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
+ $(AM_CPPFLAGS)
+
+libxsettings_la_CFLAGS = \
+ $(SETTINGS_PLUGIN_CFLAGS) \
+ $(AM_CFLAGS)
+
+libxsettings_la_LDFLAGS = \
+ $(GSD_PLUGIN_LDFLAGS) \
+ $(NULL)
+
+libxsettings_la_LIBADD = \
+ $(SETTINGS_PLUGIN_LIBS) \
+ $(NULL)
+
+if HAVE_FONTCONFIG
+libxsettings_la_SOURCES += \
+ fontconfig-monitor.h \
+ fontconfig-monitor.c \
+ $(NULL)
+libxsettings_la_CFLAGS += \
+ $(FONTCONFIG_CFLAGS)
+libxsettings_la_LIBADD += \
+ $(FONTCONFIG_LIBS)
+endif
+
+
+plugin_in_files = \
+ xsettings.mate-settings-plugin.in \
+ $(NULL)
+
+plugin_DATA = $(plugin_in_files:.mate-settings-plugin.in=.mate-settings-plugin)
+
+EXTRA_DIST = \
+ $(plugin_in_files) \
+ $(NULL)
+
+CLEANFILES = \
+ $(plugin_DATA) \
+ $(NULL)
+
+DISTCLEANFILES = \
+ $(plugin_DATA) \
+ $(NULL)
+
+@GSD_INTLTOOL_PLUGIN_RULE@
diff --git a/plugins/xsettings/Makefile.in b/plugins/xsettings/Makefile.in
new file mode 100644
index 0000000..4f5f8ed
--- /dev/null
+++ b/plugins/xsettings/Makefile.in
@@ -0,0 +1,718 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@HAVE_FONTCONFIG_TRUE@am__append_1 = \
+@HAVE_FONTCONFIG_TRUE@ fontconfig-monitor.h \
+@HAVE_FONTCONFIG_TRUE@ fontconfig-monitor.c \
+@HAVE_FONTCONFIG_TRUE@ $(NULL)
+
+@HAVE_FONTCONFIG_TRUE@am__append_2 = \
+@HAVE_FONTCONFIG_TRUE@ $(FONTCONFIG_CFLAGS)
+
+@HAVE_FONTCONFIG_TRUE@am__append_3 = \
+@HAVE_FONTCONFIG_TRUE@ $(FONTCONFIG_LIBS)
+
+subdir = plugins/xsettings
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__installdirs = "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(plugindir)"
+LTLIBRARIES = $(plugin_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+@HAVE_FONTCONFIG_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
+libxsettings_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
+am__libxsettings_la_SOURCES_DIST = gsd-xsettings-plugin.h \
+ gsd-xsettings-plugin.c gsd-xsettings-manager.h \
+ gsd-xsettings-manager.c xsettings-common.h xsettings-common.c \
+ xsettings-manager.h xsettings-manager.c fontconfig-monitor.h \
+ fontconfig-monitor.c
+am__objects_1 =
+@HAVE_FONTCONFIG_TRUE@am__objects_2 = \
+@HAVE_FONTCONFIG_TRUE@ libxsettings_la-fontconfig-monitor.lo \
+@HAVE_FONTCONFIG_TRUE@ $(am__objects_1)
+am_libxsettings_la_OBJECTS = libxsettings_la-gsd-xsettings-plugin.lo \
+ libxsettings_la-gsd-xsettings-manager.lo \
+ libxsettings_la-xsettings-common.lo \
+ libxsettings_la-xsettings-manager.lo $(am__objects_1) \
+ $(am__objects_2)
+libxsettings_la_OBJECTS = $(am_libxsettings_la_OBJECTS)
+libxsettings_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libxsettings_la_CFLAGS) \
+ $(CFLAGS) $(libxsettings_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(libxsettings_la_SOURCES)
+DIST_SOURCES = $(am__libxsettings_la_SOURCES_DIST)
+DATA = $(plugin_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALL_LINGUAS = @ALL_LINGUAS@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
+DBUS_SYS_DIR = @DBUS_SYS_DIR@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@
+FONTCONFIG_LIBS = @FONTCONFIG_LIBS@
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+GIOUNIX_CFLAGS = @GIOUNIX_CFLAGS@
+GIOUNIX_LIBS = @GIOUNIX_LIBS@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GREP = @GREP@
+GSD_INTLTOOL_PLUGIN_RULE = @GSD_INTLTOOL_PLUGIN_RULE@
+GSD_PLUGIN_LDFLAGS = @GSD_PLUGIN_LDFLAGS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
+INTLLIBS = @INTLLIBS@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+INTLTOOL_MERGE = @INTLTOOL_MERGE@
+INTLTOOL_PERL = @INTLTOOL_PERL@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBEXECDIR = @LIBEXECDIR@
+LIBMATEKBDUI_CFLAGS = @LIBMATEKBDUI_CFLAGS@
+LIBMATEKBDUI_LIBS = @LIBMATEKBDUI_LIBS@
+LIBMATENOTIFY_CFLAGS = @LIBMATENOTIFY_CFLAGS@
+LIBMATENOTIFY_LIBS = @LIBMATENOTIFY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MATECONFTOOL = @MATECONFTOOL@
+MATECONF_SCHEMA_CONFIG_SOURCE = @MATECONF_SCHEMA_CONFIG_SOURCE@
+MATECONF_SCHEMA_FILE_DIR = @MATECONF_SCHEMA_FILE_DIR@
+MATE_KEYBINDINGS_KEYSDIR = @MATE_KEYBINDINGS_KEYSDIR@
+MKDIR_P = @MKDIR_P@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGFMT_OPTS = @MSGFMT_OPTS@
+MSGMERGE = @MSGMERGE@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NSS_CFLAGS = @NSS_CFLAGS@
+NSS_DATABASE = @NSS_DATABASE@
+NSS_LIBS = @NSS_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+POFILES = @POFILES@
+POLKIT_CFLAGS = @POLKIT_CFLAGS@
+POLKIT_LIBS = @POLKIT_LIBS@
+POSUB = @POSUB@
+PO_IN_DATADIR_FALSE = @PO_IN_DATADIR_FALSE@
+PO_IN_DATADIR_TRUE = @PO_IN_DATADIR_TRUE@
+PULSE_CFLAGS = @PULSE_CFLAGS@
+PULSE_LIBS = @PULSE_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SETTINGS_DAEMON_CFLAGS = @SETTINGS_DAEMON_CFLAGS@
+SETTINGS_DAEMON_LIBS = @SETTINGS_DAEMON_LIBS@
+SETTINGS_PLUGIN_CFLAGS = @SETTINGS_PLUGIN_CFLAGS@
+SETTINGS_PLUGIN_LIBS = @SETTINGS_PLUGIN_LIBS@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+X11_LIBS = @X11_LIBS@
+XF86MISC_LIBS = @XF86MISC_LIBS@
+XGETTEXT = @XGETTEXT@
+XINPUT_LIBS = @XINPUT_LIBS@
+XMKMF = @XMKMF@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+plugindir = @plugindir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+NULL =
+plugin_LTLIBRARIES = \
+ libxsettings.la \
+ $(NULL)
+
+libxsettings_la_SOURCES = gsd-xsettings-plugin.h \
+ gsd-xsettings-plugin.c gsd-xsettings-manager.h \
+ gsd-xsettings-manager.c xsettings-common.h xsettings-common.c \
+ xsettings-manager.h xsettings-manager.c $(NULL) \
+ $(am__append_1)
+libxsettings_la_CPPFLAGS = \
+ -I$(top_srcdir)/mate-settings-daemon \
+ -DMATE_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\" \
+ $(AM_CPPFLAGS)
+
+libxsettings_la_CFLAGS = $(SETTINGS_PLUGIN_CFLAGS) $(AM_CFLAGS) \
+ $(am__append_2)
+libxsettings_la_LDFLAGS = \
+ $(GSD_PLUGIN_LDFLAGS) \
+ $(NULL)
+
+libxsettings_la_LIBADD = $(SETTINGS_PLUGIN_LIBS) $(NULL) \
+ $(am__append_3)
+plugin_in_files = \
+ xsettings.mate-settings-plugin.in \
+ $(NULL)
+
+plugin_DATA = $(plugin_in_files:.mate-settings-plugin.in=.mate-settings-plugin)
+EXTRA_DIST = \
+ $(plugin_in_files) \
+ $(NULL)
+
+CLEANFILES = \
+ $(plugin_DATA) \
+ $(NULL)
+
+DISTCLEANFILES = \
+ $(plugin_DATA) \
+ $(NULL)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu plugins/xsettings/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu plugins/xsettings/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pluginLTLIBRARIES: $(plugin_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
+ @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(plugindir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(plugindir)"; \
+ }
+
+uninstall-pluginLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(plugin_LTLIBRARIES)'; test -n "$(plugindir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(plugindir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(plugindir)/$$f"; \
+ done
+
+clean-pluginLTLIBRARIES:
+ -test -z "$(plugin_LTLIBRARIES)" || rm -f $(plugin_LTLIBRARIES)
+ @list='$(plugin_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libxsettings.la: $(libxsettings_la_OBJECTS) $(libxsettings_la_DEPENDENCIES)
+ $(libxsettings_la_LINK) -rpath $(plugindir) $(libxsettings_la_OBJECTS) $(libxsettings_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsettings_la-fontconfig-monitor.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsettings_la-gsd-xsettings-manager.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsettings_la-gsd-xsettings-plugin.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsettings_la-xsettings-common.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxsettings_la-xsettings-manager.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libxsettings_la-gsd-xsettings-plugin.lo: gsd-xsettings-plugin.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -MT libxsettings_la-gsd-xsettings-plugin.lo -MD -MP -MF $(DEPDIR)/libxsettings_la-gsd-xsettings-plugin.Tpo -c -o libxsettings_la-gsd-xsettings-plugin.lo `test -f 'gsd-xsettings-plugin.c' || echo '$(srcdir)/'`gsd-xsettings-plugin.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxsettings_la-gsd-xsettings-plugin.Tpo $(DEPDIR)/libxsettings_la-gsd-xsettings-plugin.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gsd-xsettings-plugin.c' object='libxsettings_la-gsd-xsettings-plugin.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -c -o libxsettings_la-gsd-xsettings-plugin.lo `test -f 'gsd-xsettings-plugin.c' || echo '$(srcdir)/'`gsd-xsettings-plugin.c
+
+libxsettings_la-gsd-xsettings-manager.lo: gsd-xsettings-manager.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -MT libxsettings_la-gsd-xsettings-manager.lo -MD -MP -MF $(DEPDIR)/libxsettings_la-gsd-xsettings-manager.Tpo -c -o libxsettings_la-gsd-xsettings-manager.lo `test -f 'gsd-xsettings-manager.c' || echo '$(srcdir)/'`gsd-xsettings-manager.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxsettings_la-gsd-xsettings-manager.Tpo $(DEPDIR)/libxsettings_la-gsd-xsettings-manager.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gsd-xsettings-manager.c' object='libxsettings_la-gsd-xsettings-manager.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -c -o libxsettings_la-gsd-xsettings-manager.lo `test -f 'gsd-xsettings-manager.c' || echo '$(srcdir)/'`gsd-xsettings-manager.c
+
+libxsettings_la-xsettings-common.lo: xsettings-common.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -MT libxsettings_la-xsettings-common.lo -MD -MP -MF $(DEPDIR)/libxsettings_la-xsettings-common.Tpo -c -o libxsettings_la-xsettings-common.lo `test -f 'xsettings-common.c' || echo '$(srcdir)/'`xsettings-common.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxsettings_la-xsettings-common.Tpo $(DEPDIR)/libxsettings_la-xsettings-common.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xsettings-common.c' object='libxsettings_la-xsettings-common.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -c -o libxsettings_la-xsettings-common.lo `test -f 'xsettings-common.c' || echo '$(srcdir)/'`xsettings-common.c
+
+libxsettings_la-xsettings-manager.lo: xsettings-manager.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -MT libxsettings_la-xsettings-manager.lo -MD -MP -MF $(DEPDIR)/libxsettings_la-xsettings-manager.Tpo -c -o libxsettings_la-xsettings-manager.lo `test -f 'xsettings-manager.c' || echo '$(srcdir)/'`xsettings-manager.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxsettings_la-xsettings-manager.Tpo $(DEPDIR)/libxsettings_la-xsettings-manager.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xsettings-manager.c' object='libxsettings_la-xsettings-manager.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -c -o libxsettings_la-xsettings-manager.lo `test -f 'xsettings-manager.c' || echo '$(srcdir)/'`xsettings-manager.c
+
+libxsettings_la-fontconfig-monitor.lo: fontconfig-monitor.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -MT libxsettings_la-fontconfig-monitor.lo -MD -MP -MF $(DEPDIR)/libxsettings_la-fontconfig-monitor.Tpo -c -o libxsettings_la-fontconfig-monitor.lo `test -f 'fontconfig-monitor.c' || echo '$(srcdir)/'`fontconfig-monitor.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libxsettings_la-fontconfig-monitor.Tpo $(DEPDIR)/libxsettings_la-fontconfig-monitor.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fontconfig-monitor.c' object='libxsettings_la-fontconfig-monitor.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libxsettings_la_CPPFLAGS) $(CPPFLAGS) $(libxsettings_la_CFLAGS) $(CFLAGS) -c -o libxsettings_la-fontconfig-monitor.lo `test -f 'fontconfig-monitor.c' || echo '$(srcdir)/'`fontconfig-monitor.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-pluginDATA: $(plugin_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(plugindir)" || $(MKDIR_P) "$(DESTDIR)$(plugindir)"
+ @list='$(plugin_DATA)'; test -n "$(plugindir)" || list=; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(plugindir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(plugindir)" || exit $$?; \
+ done
+
+uninstall-pluginDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(plugin_DATA)'; test -n "$(plugindir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ test -n "$$files" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(plugindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(plugindir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(plugindir)" "$(DESTDIR)$(plugindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pluginLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pluginDATA install-pluginLTLIBRARIES
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pluginDATA uninstall-pluginLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-pluginLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-pluginDATA \
+ install-pluginLTLIBRARIES install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-pluginDATA uninstall-pluginLTLIBRARIES
+
+
+@GSD_INTLTOOL_PLUGIN_RULE@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/plugins/xsettings/fontconfig-monitor.c b/plugins/xsettings/fontconfig-monitor.c
new file mode 100644
index 0000000..bfb15ed
--- /dev/null
+++ b/plugins/xsettings/fontconfig-monitor.c
@@ -0,0 +1,192 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Behdad Esfahbod, Red Hat, Inc.
+ */
+
+#include "fontconfig-monitor.h"
+
+#include <gio/gio.h>
+#include <fontconfig/fontconfig.h>
+
+#define TIMEOUT_SECONDS 2
+
+static void
+stuff_changed (GFileMonitor *monitor,
+ GFile *file,
+ GFile *other_file,
+ GFileMonitorEvent event_type,
+ gpointer handle);
+
+void
+fontconfig_cache_init (void)
+{
+ FcInit ();
+}
+
+gboolean
+fontconfig_cache_update (void)
+{
+ return !FcConfigUptoDate (NULL) && FcInitReinitialize ();
+}
+
+static void
+monitor_files (GPtrArray *monitors,
+ FcStrList *list,
+ gpointer data)
+{
+ const char *str;
+
+ while ((str = (const char *) FcStrListNext (list))) {
+ GFile *file;
+ GFileMonitor *monitor;
+
+ file = g_file_new_for_path (str);
+
+ monitor = g_file_monitor (file, G_FILE_MONITOR_NONE, NULL, NULL);
+
+ g_object_unref (file);
+
+ if (!monitor)
+ continue;
+
+ g_signal_connect (monitor, "changed", G_CALLBACK (stuff_changed), data);
+
+ g_ptr_array_add (monitors, monitor);
+ }
+
+ FcStrListDone (list);
+}
+
+
+struct _fontconfig_monitor_handle {
+ GPtrArray *monitors;
+
+ guint timeout;
+
+ GFunc notify_callback;
+ gpointer notify_data;
+};
+
+static GPtrArray *
+monitors_create (gpointer data)
+{
+ GPtrArray *monitors = g_ptr_array_new ();
+
+ monitor_files (monitors, FcConfigGetConfigFiles (NULL), data);
+ monitor_files (monitors, FcConfigGetFontDirs (NULL) , data);
+
+ return monitors;
+}
+
+static void
+monitors_free (GPtrArray *monitors)
+{
+ if (!monitors)
+ return;
+
+ g_ptr_array_foreach (monitors, (GFunc) g_object_unref, NULL);
+ g_ptr_array_free (monitors, TRUE);
+}
+
+static gboolean
+update (gpointer data)
+{
+ fontconfig_monitor_handle_t *handle = data;
+ gboolean notify = FALSE;
+
+ handle->timeout = 0;
+
+ if (fontconfig_cache_update ()) {
+ notify = TRUE;
+ monitors_free (handle->monitors);
+ handle->monitors = monitors_create (data);
+ }
+
+ /* we finish modifying handle before calling the notify callback,
+ * allowing the callback to free the monitor if it decides to. */
+
+ if (notify && handle->notify_callback)
+ handle->notify_callback (data, handle->notify_data);
+
+ return FALSE;
+}
+
+static void
+stuff_changed (GFileMonitor *monitor G_GNUC_UNUSED,
+ GFile *file G_GNUC_UNUSED,
+ GFile *other_file G_GNUC_UNUSED,
+ GFileMonitorEvent event_type G_GNUC_UNUSED,
+ gpointer data)
+{
+ fontconfig_monitor_handle_t *handle = data;
+
+ /* wait for quiescence */
+ if (handle->timeout)
+ g_source_remove (handle->timeout);
+
+ handle->timeout = g_timeout_add_seconds (TIMEOUT_SECONDS, update, data);
+}
+
+
+fontconfig_monitor_handle_t *
+fontconfig_monitor_start (GFunc notify_callback,
+ gpointer notify_data)
+{
+ fontconfig_monitor_handle_t *handle = g_slice_new0 (fontconfig_monitor_handle_t);
+
+ handle->notify_callback = notify_callback;
+ handle->notify_data = notify_data;
+ handle->monitors = monitors_create (handle);
+
+ return handle;
+}
+
+void
+fontconfig_monitor_stop (fontconfig_monitor_handle_t *handle)
+{
+ if (handle->timeout)
+ g_source_remove (handle->timeout);
+ handle->timeout = 0;
+
+ monitors_free (handle->monitors);
+ handle->monitors = NULL;
+}
+
+#ifdef FONTCONFIG_MONITOR_TEST
+static void
+yay (void)
+{
+ g_message ("yay");
+}
+
+int
+main (void)
+{
+ GMainLoop *loop;
+
+ g_type_init ();
+
+ fontconfig_monitor_start ((GFunc) yay, NULL);
+
+ loop = g_main_loop_new (NULL, TRUE);
+ g_main_loop_run (loop);
+
+ return 0;
+}
+#endif
diff --git a/plugins/xsettings/fontconfig-monitor.h b/plugins/xsettings/fontconfig-monitor.h
new file mode 100644
index 0000000..71256e4
--- /dev/null
+++ b/plugins/xsettings/fontconfig-monitor.h
@@ -0,0 +1,44 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2008 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Author: Behdad Esfahbod, Red Hat, Inc.
+ */
+#ifndef __FONTCONFIG_MONITOR_H
+#define __FONTCONFIG_MONITOR_H
+
+#include <glib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void fontconfig_cache_init (void);
+gboolean fontconfig_cache_update (void);
+
+typedef struct _fontconfig_monitor_handle fontconfig_monitor_handle_t;
+
+fontconfig_monitor_handle_t *
+fontconfig_monitor_start (GFunc notify_callback,
+ gpointer notify_data);
+void fontconfig_monitor_stop (fontconfig_monitor_handle_t *handle);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __FONTCONFIG_MONITOR_H */
diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c
new file mode 100644
index 0000000..e7b4f9a
--- /dev/null
+++ b/plugins/xsettings/gsd-xsettings-manager.c
@@ -0,0 +1,1040 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007 Rodrigo Moya
+ * Copyright (C) 2007 William Jon McCann <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "config.h"
+
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <time.h>
+
+#include <X11/Xatom.h>
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h>
+#include <mateconf/mateconf.h>
+#include <mateconf/mateconf-client.h>
+
+#include "mate-settings-profile.h"
+#include "gsd-xsettings-manager.h"
+#include "xsettings-manager.h"
+#ifdef HAVE_FONTCONFIG
+#include "fontconfig-monitor.h"
+#endif /* HAVE_FONTCONFIG */
+
+#define MATE_XSETTINGS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MATE_TYPE_XSETTINGS_MANAGER, MateXSettingsManagerPrivate))
+
+#define MOUSE_SETTINGS_DIR "/desktop/mate/peripherals/mouse"
+#define GTK_SETTINGS_DIR "/desktop/gtk"
+#define INTERFACE_SETTINGS_DIR "/desktop/mate/interface"
+#define SOUND_SETTINGS_DIR "/desktop/mate/sound"
+#define GTK_MODULES_DIR "/apps/mate_settings_daemon/gtk-modules"
+
+#ifdef HAVE_FONTCONFIG
+#define FONT_RENDER_DIR "/desktop/mate/font_rendering"
+#define FONT_ANTIALIASING_KEY FONT_RENDER_DIR "/antialiasing"
+#define FONT_HINTING_KEY FONT_RENDER_DIR "/hinting"
+#define FONT_RGBA_ORDER_KEY FONT_RENDER_DIR "/rgba_order"
+#define FONT_DPI_KEY FONT_RENDER_DIR "/dpi"
+
+/* X servers sometimes lie about the screen's physical dimensions, so we cannot
+ * compute an accurate DPI value. When this happens, the user gets fonts that
+ * are too huge or too tiny. So, we see what the server returns: if it reports
+ * something outside of the range [DPI_LOW_REASONABLE_VALUE,
+ * DPI_HIGH_REASONABLE_VALUE], then we assume that it is lying and we use
+ * DPI_FALLBACK instead.
+ *
+ * See get_dpi_from_mateconf_or_server() below, and also
+ * https://bugzilla.novell.com/show_bug.cgi?id=217790
+ */
+#define DPI_FALLBACK 96
+#define DPI_LOW_REASONABLE_VALUE 50
+#define DPI_HIGH_REASONABLE_VALUE 500
+
+#endif /* HAVE_FONTCONFIG */
+
+typedef struct _TranslationEntry TranslationEntry;
+typedef void (* TranslationFunc) (MateXSettingsManager *manager,
+ TranslationEntry *trans,
+ MateConfValue *value);
+
+struct _TranslationEntry {
+ const char *mateconf_key;
+ const char *xsetting_name;
+
+ MateConfValueType mateconf_type;
+ TranslationFunc translate;
+};
+
+struct MateXSettingsManagerPrivate
+{
+ XSettingsManager **managers;
+ guint notify[6];
+#ifdef HAVE_FONTCONFIG
+ fontconfig_monitor_handle_t *fontconfig_handle;
+#endif /* HAVE_FONTCONFIG */
+};
+
+#define GSD_XSETTINGS_ERROR gsd_xsettings_error_quark ()
+
+enum {
+ GSD_XSETTINGS_ERROR_INIT
+};
+
+static void mate_xsettings_manager_class_init (MateXSettingsManagerClass *klass);
+static void mate_xsettings_manager_init (MateXSettingsManager *xsettings_manager);
+static void mate_xsettings_manager_finalize (GObject *object);
+
+G_DEFINE_TYPE (MateXSettingsManager, mate_xsettings_manager, G_TYPE_OBJECT)
+
+static gpointer manager_object = NULL;
+
+static GQuark
+gsd_xsettings_error_quark (void)
+{
+ return g_quark_from_static_string ("gsd-xsettings-error-quark");
+}
+
+static void
+translate_bool_int (MateXSettingsManager *manager,
+ TranslationEntry *trans,
+ MateConfValue *value)
+{
+ int i;
+
+ g_assert (value->type == trans->mateconf_type);
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_set_int (manager->priv->managers [i], trans->xsetting_name,
+ mateconf_value_get_bool (value));
+ }
+}
+
+static void
+translate_int_int (MateXSettingsManager *manager,
+ TranslationEntry *trans,
+ MateConfValue *value)
+{
+ int i;
+
+ g_assert (value->type == trans->mateconf_type);
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_set_int (manager->priv->managers [i], trans->xsetting_name,
+ mateconf_value_get_int (value));
+ }
+}
+
+static void
+translate_string_string (MateXSettingsManager *manager,
+ TranslationEntry *trans,
+ MateConfValue *value)
+{
+ int i;
+
+ g_assert (value->type == trans->mateconf_type);
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_set_string (manager->priv->managers [i],
+ trans->xsetting_name,
+ mateconf_value_get_string (value));
+ }
+}
+
+static void
+translate_string_string_toolbar (MateXSettingsManager *manager,
+ TranslationEntry *trans,
+ MateConfValue *value)
+{
+ int i;
+ const char *tmp;
+
+ g_assert (value->type == trans->mateconf_type);
+
+ /* This is kind of a workaround since MATE expects the key value to be
+ * "both_horiz" and gtk+ wants the XSetting to be "both-horiz".
+ */
+ tmp = mateconf_value_get_string (value);
+ if (tmp && strcmp (tmp, "both_horiz") == 0) {
+ tmp = "both-horiz";
+ }
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_set_string (manager->priv->managers [i],
+ trans->xsetting_name,
+ tmp);
+ }
+}
+
+static TranslationEntry translations [] = {
+ { "/desktop/mate/peripherals/mouse/double_click", "Net/DoubleClickTime", MATECONF_VALUE_INT, translate_int_int },
+ { "/desktop/mate/peripherals/mouse/drag_threshold", "Net/DndDragThreshold", MATECONF_VALUE_INT, translate_int_int },
+ { "/desktop/mate/gtk-color-palette", "Gtk/ColorPalette", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/font_name", "Gtk/FontName", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/gtk_key_theme", "Gtk/KeyThemeName", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/toolbar_style", "Gtk/ToolbarStyle", MATECONF_VALUE_STRING, translate_string_string_toolbar },
+ { "/desktop/mate/interface/toolbar_icons_size", "Gtk/ToolbarIconSize", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/can_change_accels", "Gtk/CanChangeAccels", MATECONF_VALUE_BOOL, translate_bool_int },
+ { "/desktop/mate/interface/cursor_blink", "Net/CursorBlink", MATECONF_VALUE_BOOL, translate_bool_int },
+ { "/desktop/mate/interface/cursor_blink_time", "Net/CursorBlinkTime", MATECONF_VALUE_INT, translate_int_int },
+ { "/desktop/mate/interface/gtk_theme", "Net/ThemeName", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/gtk_color_scheme", "Gtk/ColorScheme", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/gtk-im-preedit-style", "Gtk/IMPreeditStyle", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/gtk-im-status-style", "Gtk/IMStatusStyle", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/gtk-im-module", "Gtk/IMModule", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/icon_theme", "Net/IconThemeName", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/file_chooser_backend", "Gtk/FileChooserBackend", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/interface/menus_have_icons", "Gtk/MenuImages", MATECONF_VALUE_BOOL, translate_bool_int },
+ { "/desktop/mate/interface/buttons_have_icons", "Gtk/ButtonImages", MATECONF_VALUE_BOOL, translate_bool_int },
+ { "/desktop/mate/interface/menubar_accel", "Gtk/MenuBarAccel", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/peripherals/mouse/cursor_theme", "Gtk/CursorThemeName", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/peripherals/mouse/cursor_size", "Gtk/CursorThemeSize", MATECONF_VALUE_INT, translate_int_int },
+ { "/desktop/mate/interface/show_input_method_menu", "Gtk/ShowInputMethodMenu", MATECONF_VALUE_BOOL, translate_bool_int },
+ { "/desktop/mate/interface/show_unicode_menu", "Gtk/ShowUnicodeMenu", MATECONF_VALUE_BOOL, translate_bool_int },
+ { "/desktop/mate/sound/theme_name", "Net/SoundThemeName", MATECONF_VALUE_STRING, translate_string_string },
+ { "/desktop/mate/sound/event_sounds", "Net/EnableEventSounds" , MATECONF_VALUE_BOOL, translate_bool_int },
+ { "/desktop/mate/sound/input_feedback_sounds", "Net/EnableInputFeedbackSounds", MATECONF_VALUE_BOOL, translate_bool_int }
+};
+
+#ifdef HAVE_FONTCONFIG
+static double
+dpi_from_pixels_and_mm (int pixels,
+ int mm)
+{
+ double dpi;
+
+ if (mm >= 1)
+ dpi = pixels / (mm / 25.4);
+ else
+ dpi = 0;
+
+ return dpi;
+}
+
+static double
+get_dpi_from_x_server (void)
+{
+ GdkScreen *screen;
+ double dpi;
+
+ screen = gdk_screen_get_default ();
+ if (screen != NULL) {
+ double width_dpi, height_dpi;
+
+ width_dpi = dpi_from_pixels_and_mm (gdk_screen_get_width (screen), gdk_screen_get_width_mm (screen));
+ height_dpi = dpi_from_pixels_and_mm (gdk_screen_get_height (screen), gdk_screen_get_height_mm (screen));
+
+ if (width_dpi < DPI_LOW_REASONABLE_VALUE || width_dpi > DPI_HIGH_REASONABLE_VALUE
+ || height_dpi < DPI_LOW_REASONABLE_VALUE || height_dpi > DPI_HIGH_REASONABLE_VALUE) {
+ dpi = DPI_FALLBACK;
+ } else {
+ dpi = (width_dpi + height_dpi) / 2.0;
+ }
+ } else {
+ /* Huh!? No screen? */
+
+ dpi = DPI_FALLBACK;
+ }
+
+ return dpi;
+}
+
+static double
+get_dpi_from_mateconf_or_x_server (MateConfClient *client)
+{
+ MateConfValue *value;
+ double dpi;
+
+ value = mateconf_client_get_without_default (client, FONT_DPI_KEY, NULL);
+
+ /* If the user has ever set the DPI preference in MateConf, we use that.
+ * Otherwise, we see if the X server reports a reasonable DPI value: some X
+ * servers report completely bogus values, and the user gets huge or tiny
+ * fonts which are unusable.
+ */
+
+ if (value != NULL) {
+ dpi = mateconf_value_get_float (value);
+ mateconf_value_free (value);
+ } else {
+ dpi = get_dpi_from_x_server ();
+ }
+
+ return dpi;
+}
+
+typedef struct
+{
+ gboolean antialias;
+ gboolean hinting;
+ int dpi;
+ const char *rgba;
+ const char *hintstyle;
+} MateXftSettings;
+
+static const char *rgba_types[] = { "rgb", "bgr", "vbgr", "vrgb" };
+
+/* Read MateConf settings and determine the appropriate Xft settings based on them
+ * This probably could be done a bit more cleanly with mateconf_string_to_enum
+ */
+static void
+xft_settings_get (MateConfClient *client,
+ MateXftSettings *settings)
+{
+ char *antialiasing;
+ char *hinting;
+ char *rgba_order;
+ double dpi;
+
+ antialiasing = mateconf_client_get_string (client, FONT_ANTIALIASING_KEY, NULL);
+ hinting = mateconf_client_get_string (client, FONT_HINTING_KEY, NULL);
+ rgba_order = mateconf_client_get_string (client, FONT_RGBA_ORDER_KEY, NULL);
+ dpi = get_dpi_from_mateconf_or_x_server (client);
+
+ settings->antialias = TRUE;
+ settings->hinting = TRUE;
+ settings->hintstyle = "hintfull";
+ settings->dpi = dpi * 1024; /* Xft wants 1/1024ths of an inch */
+ settings->rgba = "rgb";
+
+ if (rgba_order) {
+ int i;
+ gboolean found = FALSE;
+
+ for (i = 0; i < G_N_ELEMENTS (rgba_types) && !found; i++) {
+ if (strcmp (rgba_order, rgba_types[i]) == 0) {
+ settings->rgba = rgba_types[i];
+ found = TRUE;
+ }
+ }
+
+ if (!found) {
+ g_warning ("Invalid value for " FONT_RGBA_ORDER_KEY ": '%s'",
+ rgba_order);
+ }
+ }
+
+ if (hinting) {
+ if (strcmp (hinting, "none") == 0) {
+ settings->hinting = 0;
+ settings->hintstyle = "hintnone";
+ } else if (strcmp (hinting, "slight") == 0) {
+ settings->hinting = 1;
+ settings->hintstyle = "hintslight";
+ } else if (strcmp (hinting, "medium") == 0) {
+ settings->hinting = 1;
+ settings->hintstyle = "hintmedium";
+ } else if (strcmp (hinting, "full") == 0) {
+ settings->hinting = 1;
+ settings->hintstyle = "hintfull";
+ } else {
+ g_warning ("Invalid value for " FONT_HINTING_KEY ": '%s'",
+ hinting);
+ }
+ }
+
+ if (antialiasing) {
+ gboolean use_rgba = FALSE;
+
+ if (strcmp (antialiasing, "none") == 0) {
+ settings->antialias = 0;
+ } else if (strcmp (antialiasing, "grayscale") == 0) {
+ settings->antialias = 1;
+ } else if (strcmp (antialiasing, "rgba") == 0) {
+ settings->antialias = 1;
+ use_rgba = TRUE;
+ } else {
+ g_warning ("Invalid value for " FONT_ANTIALIASING_KEY " : '%s'",
+ antialiasing);
+ }
+
+ if (!use_rgba) {
+ settings->rgba = "none";
+ }
+ }
+
+ g_free (rgba_order);
+ g_free (hinting);
+ g_free (antialiasing);
+}
+
+static void
+xft_settings_set_xsettings (MateXSettingsManager *manager,
+ MateXftSettings *settings)
+{
+ int i;
+
+ mate_settings_profile_start (NULL);
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_set_int (manager->priv->managers [i], "Xft/Antialias", settings->antialias);
+ xsettings_manager_set_int (manager->priv->managers [i], "Xft/Hinting", settings->hinting);
+ xsettings_manager_set_string (manager->priv->managers [i], "Xft/HintStyle", settings->hintstyle);
+ xsettings_manager_set_int (manager->priv->managers [i], "Xft/DPI", settings->dpi);
+ xsettings_manager_set_string (manager->priv->managers [i], "Xft/RGBA", settings->rgba);
+ }
+ mate_settings_profile_end (NULL);
+}
+
+static void
+update_property (GString *props, const gchar* key, const gchar* value)
+{
+ gchar* needle;
+ size_t needle_len;
+ gchar* found = NULL;
+
+ /* update an existing property */
+ needle = g_strconcat (key, ":", NULL);
+ needle_len = strlen (needle);
+ if (g_str_has_prefix (props->str, needle))
+ found = props->str;
+ else
+ found = strstr (props->str, needle);
+
+ if (found) {
+ size_t value_index;
+ gchar* end;
+
+ end = strchr (found, '\n');
+ value_index = (found - props->str) + needle_len + 1;
+ g_string_erase (props, value_index, end ? (end - found - needle_len) : -1);
+ g_string_insert (props, value_index, "\n");
+ g_string_insert (props, value_index, value);
+ } else {
+ g_string_append_printf (props, "%s:\t%s\n", key, value);
+ }
+}
+
+static void
+xft_settings_set_xresources (MateXftSettings *settings)
+{
+ GString *add_string;
+ char dpibuf[G_ASCII_DTOSTR_BUF_SIZE];
+ Display *dpy;
+
+ mate_settings_profile_start (NULL);
+
+ /* get existing properties */
+ dpy = XOpenDisplay (NULL);
+ g_return_if_fail (dpy != NULL);
+ add_string = g_string_new (XResourceManagerString (dpy));
+
+ g_debug("xft_settings_set_xresources: orig res '%s'", add_string->str);
+
+ update_property (add_string, "Xft.dpi",
+ g_ascii_dtostr (dpibuf, sizeof (dpibuf), (double) settings->dpi / 1024.0));
+ update_property (add_string, "Xft.antialias",
+ settings->antialias ? "1" : "0");
+ update_property (add_string, "Xft.hinting",
+ settings->hinting ? "1" : "0");
+ update_property (add_string, "Xft.hintstyle",
+ settings->hintstyle);
+ update_property (add_string, "Xft.rgba",
+ settings->rgba);
+
+ g_debug("xft_settings_set_xresources: new res '%s'", add_string->str);
+
+ /* Set the new X property */
+ XChangeProperty(dpy, RootWindow (dpy, 0),
+ XA_RESOURCE_MANAGER, XA_STRING, 8, PropModeReplace, add_string->str, add_string->len);
+ XCloseDisplay (dpy);
+
+ g_string_free (add_string, TRUE);
+
+ mate_settings_profile_end (NULL);
+}
+
+/* We mirror the Xft properties both through XSETTINGS and through
+ * X resources
+ */
+static void
+update_xft_settings (MateXSettingsManager *manager,
+ MateConfClient *client)
+{
+ MateXftSettings settings;
+
+ mate_settings_profile_start (NULL);
+
+ xft_settings_get (client, &settings);
+ xft_settings_set_xsettings (manager, &settings);
+ xft_settings_set_xresources (&settings);
+
+ mate_settings_profile_end (NULL);
+}
+
+static void
+xft_callback (MateConfClient *client,
+ guint cnxn_id,
+ MateConfEntry *entry,
+ MateXSettingsManager *manager)
+{
+ int i;
+
+ update_xft_settings (manager, client);
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_notify (manager->priv->managers [i]);
+ }
+}
+
+static void
+fontconfig_callback (fontconfig_monitor_handle_t *handle,
+ MateXSettingsManager *manager)
+{
+ int i;
+ int timestamp = time (NULL);
+
+ mate_settings_profile_start (NULL);
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_set_int (manager->priv->managers [i], "Fontconfig/Timestamp", timestamp);
+ xsettings_manager_notify (manager->priv->managers [i]);
+ }
+ mate_settings_profile_end (NULL);
+}
+
+static gboolean
+start_fontconfig_monitor_idle_cb (MateXSettingsManager *manager)
+{
+ mate_settings_profile_start (NULL);
+
+ manager->priv->fontconfig_handle = fontconfig_monitor_start ((GFunc) fontconfig_callback, manager);
+
+ mate_settings_profile_end (NULL);
+
+ return FALSE;
+}
+
+static void
+start_fontconfig_monitor (MateXSettingsManager *manager)
+{
+ mate_settings_profile_start (NULL);
+
+ fontconfig_cache_init ();
+
+ g_idle_add ((GSourceFunc) start_fontconfig_monitor_idle_cb, manager);
+
+ mate_settings_profile_end (NULL);
+}
+
+static void
+stop_fontconfig_monitor (MateXSettingsManager *manager)
+{
+ if (manager->priv->fontconfig_handle) {
+ fontconfig_monitor_stop (manager->priv->fontconfig_handle);
+ manager->priv->fontconfig_handle = NULL;
+ }
+}
+#endif /* HAVE_FONTCONFIG */
+
+static const char *
+type_to_string (MateConfValueType type)
+{
+ switch (type) {
+ case MATECONF_VALUE_INT:
+ return "int";
+ case MATECONF_VALUE_STRING:
+ return "string";
+ case MATECONF_VALUE_FLOAT:
+ return "float";
+ case MATECONF_VALUE_BOOL:
+ return "bool";
+ case MATECONF_VALUE_SCHEMA:
+ return "schema";
+ case MATECONF_VALUE_LIST:
+ return "list";
+ case MATECONF_VALUE_PAIR:
+ return "pair";
+ case MATECONF_VALUE_INVALID:
+ return "*invalid*";
+ default:
+ g_assert_not_reached();
+ return NULL; /* for warnings */
+ }
+}
+
+static void
+process_value (MateXSettingsManager *manager,
+ TranslationEntry *trans,
+ MateConfValue *val)
+{
+ if (val == NULL) {
+ int i;
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_delete_setting (manager->priv->managers [i], trans->xsetting_name);
+ }
+ } else {
+ if (val->type == trans->mateconf_type) {
+ (* trans->translate) (manager, trans, val);
+ } else {
+ g_warning (_("MateConf key %s set to type %s but its expected type was %s\n"),
+ trans->mateconf_key,
+ type_to_string (val->type),
+ type_to_string (trans->mateconf_type));
+ }
+ }
+}
+
+static TranslationEntry *
+find_translation_entry (const char *mateconf_key)
+{
+ int i;
+
+ for (i = 0; i < G_N_ELEMENTS (translations); ++i) {
+ if (strcmp (translations[i].mateconf_key, mateconf_key) == 0) {
+ return &translations[i];
+ }
+ }
+
+ return NULL;
+}
+
+static void
+xsettings_callback (MateConfClient *client,
+ guint cnxn_id,
+ MateConfEntry *entry,
+ MateXSettingsManager *manager)
+{
+ TranslationEntry *trans;
+ int i;
+
+ trans = find_translation_entry (entry->key);
+ if (trans == NULL) {
+ return;
+ }
+
+ process_value (manager, trans, entry->value);
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_set_string (manager->priv->managers [i],
+ "Net/FallbackIconTheme",
+ "mate");
+ }
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_notify (manager->priv->managers [i]);
+ }
+}
+
+static gchar *
+get_gtk_modules (MateConfClient *client)
+{
+ GSList *entries, *l;
+ GString *mods = g_string_new (NULL);
+
+ entries = mateconf_client_all_entries (client, GTK_MODULES_DIR, NULL);
+
+ for (l = entries; l != NULL; l = g_slist_next (l)) {
+ MateConfEntry *e = l->data;
+ MateConfValue *v = mateconf_entry_get_value (e);
+
+ if (v != NULL) {
+ gboolean enabled = FALSE;
+ const gchar *key;
+
+ switch (v->type) {
+ case MATECONF_VALUE_BOOL:
+ /* simple enabled/disabled */
+ enabled = mateconf_value_get_bool (v);
+ break;
+
+ /* due to limitations in MateConf (or the client libraries,
+ * anyway), it is currently impossible to monitor
+ * arbitrary keys for changes, so these won't update at
+ * runtime */
+ case MATECONF_VALUE_STRING:
+ /* linked to another MateConf key of type bool */
+ key = mateconf_value_get_string (v);
+ if (key != NULL && mateconf_valid_key (key, NULL)) {
+ enabled = mateconf_client_get_bool (client, key, NULL);
+ }
+ break;
+
+ default:
+ g_warning ("MateConf entry %s has invalid type %s",
+ mateconf_entry_get_key (e), type_to_string (v->type));
+ }
+
+ if (enabled) {
+ const gchar *name;
+ name = strrchr (mateconf_entry_get_key (e), '/') + 1;
+
+ if (mods->len > 0) {
+ g_string_append_c (mods, ':');
+ }
+ g_string_append (mods, name);
+ }
+ }
+
+ mateconf_entry_free (e);
+ }
+
+ g_slist_free (entries);
+
+ return g_string_free (mods, mods->len == 0);
+}
+
+static void
+gtk_modules_callback (MateConfClient *client,
+ guint cnxn_id,
+ MateConfEntry *entry,
+ MateXSettingsManager *manager)
+{
+ gchar *modules = get_gtk_modules (client);
+ int i;
+
+ if (modules == NULL) {
+ for (i = 0; manager->priv->managers [i]; ++i) {
+ xsettings_manager_delete_setting (manager->priv->managers [i], "Gtk/Modules");
+ }
+ } else {
+ g_debug ("Setting GTK modules '%s'", modules);
+ for (i = 0; manager->priv->managers [i]; ++i) {
+ xsettings_manager_set_string (manager->priv->managers [i],
+ "Gtk/Modules",
+ modules);
+ }
+ g_free (modules);
+ }
+
+ for (i = 0; manager->priv->managers [i]; ++i) {
+ xsettings_manager_notify (manager->priv->managers [i]);
+ }
+}
+
+static guint
+register_config_callback (MateXSettingsManager *manager,
+ MateConfClient *client,
+ const char *path,
+ MateConfClientNotifyFunc func)
+{
+ return mateconf_client_notify_add (client, path, func, manager, NULL, NULL);
+}
+
+static void
+terminate_cb (void *data)
+{
+ gboolean *terminated = data;
+
+ if (*terminated) {
+ return;
+ }
+
+ *terminated = TRUE;
+
+ gtk_main_quit ();
+}
+
+static gboolean
+setup_xsettings_managers (MateXSettingsManager *manager)
+{
+ GdkDisplay *display;
+ int i;
+ int n_screens;
+ gboolean res;
+ gboolean terminated;
+
+ display = gdk_display_get_default ();
+ n_screens = gdk_display_get_n_screens (display);
+
+ res = xsettings_manager_check_running (gdk_x11_display_get_xdisplay (display),
+ gdk_screen_get_number (gdk_screen_get_default ()));
+ if (res) {
+ g_warning ("You can only run one xsettings manager at a time; exiting");
+ return FALSE;
+ }
+
+ manager->priv->managers = g_new0 (XSettingsManager *, n_screens + 1);
+
+ terminated = FALSE;
+ for (i = 0; i < n_screens; i++) {
+ GdkScreen *screen;
+
+ screen = gdk_display_get_screen (display, i);
+
+ manager->priv->managers [i] = xsettings_manager_new (gdk_x11_display_get_xdisplay (display),
+ gdk_screen_get_number (screen),
+ terminate_cb,
+ &terminated);
+ if (! manager->priv->managers [i]) {
+ g_warning ("Could not create xsettings manager for screen %d!", i);
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+}
+
+gboolean
+mate_xsettings_manager_start (MateXSettingsManager *manager,
+ GError **error)
+{
+ MateConfClient *client;
+ int i;
+
+ g_debug ("Starting xsettings manager");
+ mate_settings_profile_start (NULL);
+
+ if (!setup_xsettings_managers (manager)) {
+ g_set_error (error, GSD_XSETTINGS_ERROR,
+ GSD_XSETTINGS_ERROR_INIT,
+ "Could not initialize xsettings manager.");
+ return FALSE;
+ }
+
+ client = mateconf_client_get_default ();
+
+ mateconf_client_add_dir (client, MOUSE_SETTINGS_DIR, MATECONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ mateconf_client_add_dir (client, GTK_SETTINGS_DIR, MATECONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ mateconf_client_add_dir (client, INTERFACE_SETTINGS_DIR, MATECONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ mateconf_client_add_dir (client, SOUND_SETTINGS_DIR, MATECONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ mateconf_client_add_dir (client, GTK_MODULES_DIR, MATECONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+ mateconf_client_add_dir (client, FONT_RENDER_DIR, MATECONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+
+ for (i = 0; i < G_N_ELEMENTS (translations); i++) {
+ MateConfValue *val;
+ GError *err;
+
+ err = NULL;
+ val = mateconf_client_get (client,
+ translations[i].mateconf_key,
+ &err);
+
+ if (err != NULL) {
+ g_warning ("Error getting value for %s: %s",
+ translations[i].mateconf_key,
+ err->message);
+ g_error_free (err);
+ } else {
+ process_value (manager, &translations[i], val);
+ if (val != NULL) {
+ mateconf_value_free (val);
+ }
+ }
+ }
+
+ manager->priv->notify[0] =
+ register_config_callback (manager, client,
+ MOUSE_SETTINGS_DIR,
+ (MateConfClientNotifyFunc) xsettings_callback);
+ manager->priv->notify[1] =
+ register_config_callback (manager, client,
+ GTK_SETTINGS_DIR,
+ (MateConfClientNotifyFunc) xsettings_callback);
+ manager->priv->notify[2] =
+ register_config_callback (manager, client,
+ INTERFACE_SETTINGS_DIR,
+ (MateConfClientNotifyFunc) xsettings_callback);
+ manager->priv->notify[3] =
+ register_config_callback (manager, client,
+ SOUND_SETTINGS_DIR,
+ (MateConfClientNotifyFunc) xsettings_callback);
+
+ manager->priv->notify[4] =
+ register_config_callback (manager, client,
+ GTK_MODULES_DIR,
+ (MateConfClientNotifyFunc) gtk_modules_callback);
+ gtk_modules_callback (client, 0, NULL, manager);
+
+#ifdef HAVE_FONTCONFIG
+ manager->priv->notify[5] =
+ register_config_callback (manager, client,
+ FONT_RENDER_DIR,
+ (MateConfClientNotifyFunc) xft_callback);
+ update_xft_settings (manager, client);
+
+ start_fontconfig_monitor (manager);
+#endif /* HAVE_FONTCONFIG */
+
+ g_object_unref (client);
+
+ for (i = 0; manager->priv->managers [i]; i++)
+ xsettings_manager_set_string (manager->priv->managers [i],
+ "Net/FallbackIconTheme",
+ "mate");
+
+ for (i = 0; manager->priv->managers [i]; i++) {
+ xsettings_manager_notify (manager->priv->managers [i]);
+ }
+
+
+ mate_settings_profile_end (NULL);
+
+ return TRUE;
+}
+
+void
+mate_xsettings_manager_stop (MateXSettingsManager *manager)
+{
+ MateXSettingsManagerPrivate *p = manager->priv;
+ MateConfClient *client;
+ int i;
+
+ g_debug ("Stopping xsettings manager");
+
+ if (p->managers != NULL) {
+ for (i = 0; p->managers [i]; ++i)
+ xsettings_manager_destroy (p->managers [i]);
+
+ g_free (p->managers);
+ p->managers = NULL;
+ }
+
+ client = mateconf_client_get_default ();
+
+ mateconf_client_remove_dir (client, MOUSE_SETTINGS_DIR, NULL);
+ mateconf_client_remove_dir (client, GTK_SETTINGS_DIR, NULL);
+ mateconf_client_remove_dir (client, INTERFACE_SETTINGS_DIR, NULL);
+ mateconf_client_remove_dir (client, SOUND_SETTINGS_DIR, NULL);
+ mateconf_client_remove_dir (client, GTK_MODULES_DIR, NULL);
+#ifdef HAVE_FONTCONFIG
+ mateconf_client_remove_dir (client, FONT_RENDER_DIR, NULL);
+
+ stop_fontconfig_monitor (manager);
+#endif /* HAVE_FONTCONFIG */
+
+ for (i = 0; i < G_N_ELEMENTS (p->notify); ++i) {
+ if (p->notify[i] != 0) {
+ mateconf_client_notify_remove (client, p->notify[i]);
+ p->notify[i] = 0;
+ }
+ }
+
+ g_object_unref (client);
+}
+
+static void
+mate_xsettings_manager_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ MateXSettingsManager *self;
+
+ self = MATE_XSETTINGS_MANAGER (object);
+
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+mate_xsettings_manager_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ MateXSettingsManager *self;
+
+ self = MATE_XSETTINGS_MANAGER (object);
+
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static GObject *
+mate_xsettings_manager_constructor (GType type,
+ guint n_construct_properties,
+ GObjectConstructParam *construct_properties)
+{
+ MateXSettingsManager *xsettings_manager;
+ MateXSettingsManagerClass *klass;
+
+ klass = MATE_XSETTINGS_MANAGER_CLASS (g_type_class_peek (MATE_TYPE_XSETTINGS_MANAGER));
+
+ xsettings_manager = MATE_XSETTINGS_MANAGER (G_OBJECT_CLASS (mate_xsettings_manager_parent_class)->constructor (type,
+ n_construct_properties,
+ construct_properties));
+
+ return G_OBJECT (xsettings_manager);
+}
+
+static void
+mate_xsettings_manager_dispose (GObject *object)
+{
+ MateXSettingsManager *xsettings_manager;
+
+ xsettings_manager = MATE_XSETTINGS_MANAGER (object);
+
+ G_OBJECT_CLASS (mate_xsettings_manager_parent_class)->dispose (object);
+}
+
+static void
+mate_xsettings_manager_class_init (MateXSettingsManagerClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->get_property = mate_xsettings_manager_get_property;
+ object_class->set_property = mate_xsettings_manager_set_property;
+ object_class->constructor = mate_xsettings_manager_constructor;
+ object_class->dispose = mate_xsettings_manager_dispose;
+ object_class->finalize = mate_xsettings_manager_finalize;
+
+ g_type_class_add_private (klass, sizeof (MateXSettingsManagerPrivate));
+}
+
+static void
+mate_xsettings_manager_init (MateXSettingsManager *manager)
+{
+ manager->priv = MATE_XSETTINGS_MANAGER_GET_PRIVATE (manager);
+}
+
+static void
+mate_xsettings_manager_finalize (GObject *object)
+{
+ MateXSettingsManager *xsettings_manager;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (MATE_IS_XSETTINGS_MANAGER (object));
+
+ xsettings_manager = MATE_XSETTINGS_MANAGER (object);
+
+ g_return_if_fail (xsettings_manager->priv != NULL);
+
+ G_OBJECT_CLASS (mate_xsettings_manager_parent_class)->finalize (object);
+}
+
+MateXSettingsManager *
+mate_xsettings_manager_new (void)
+{
+ if (manager_object != NULL) {
+ g_object_ref (manager_object);
+ } else {
+ manager_object = g_object_new (MATE_TYPE_XSETTINGS_MANAGER, NULL);
+ g_object_add_weak_pointer (manager_object,
+ (gpointer *) &manager_object);
+ }
+
+ return MATE_XSETTINGS_MANAGER (manager_object);
+}
diff --git a/plugins/xsettings/gsd-xsettings-manager.h b/plugins/xsettings/gsd-xsettings-manager.h
new file mode 100644
index 0000000..b97afbf
--- /dev/null
+++ b/plugins/xsettings/gsd-xsettings-manager.h
@@ -0,0 +1,61 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007 William Jon McCann <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __MATE_XSETTINGS_MANAGER_H
+#define __MATE_XSETTINGS_MANAGER_H
+
+#include <glib-object.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MATE_TYPE_XSETTINGS_MANAGER (mate_xsettings_manager_get_type ())
+#define MATE_XSETTINGS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MATE_TYPE_XSETTINGS_MANAGER, MateXSettingsManager))
+#define MATE_XSETTINGS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MATE_TYPE_XSETTINGS_MANAGER, MateXSettingsManagerClass))
+#define MATE_IS_XSETTINGS_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MATE_TYPE_XSETTINGS_MANAGER))
+#define MATE_IS_XSETTINGS_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MATE_TYPE_XSETTINGS_MANAGER))
+#define MATE_XSETTINGS_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MATE_TYPE_XSETTINGS_MANAGER, MateXSettingsManagerClass))
+
+typedef struct MateXSettingsManagerPrivate MateXSettingsManagerPrivate;
+
+typedef struct
+{
+ GObject parent;
+ MateXSettingsManagerPrivate *priv;
+} MateXSettingsManager;
+
+typedef struct
+{
+ GObjectClass parent_class;
+} MateXSettingsManagerClass;
+
+GType mate_xsettings_manager_get_type (void);
+
+MateXSettingsManager * mate_xsettings_manager_new (void);
+gboolean mate_xsettings_manager_start (MateXSettingsManager *manager,
+ GError **error);
+void mate_xsettings_manager_stop (MateXSettingsManager *manager);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MATE_XSETTINGS_MANAGER_H */
diff --git a/plugins/xsettings/gsd-xsettings-plugin.c b/plugins/xsettings/gsd-xsettings-plugin.c
new file mode 100644
index 0000000..2280589
--- /dev/null
+++ b/plugins/xsettings/gsd-xsettings-plugin.c
@@ -0,0 +1,104 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007 William Jon McCann <[email protected]>
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "config.h"
+
+#include <glib/gi18n-lib.h>
+#include <gmodule.h>
+
+#include "mate-settings-plugin.h"
+#include "gsd-xsettings-plugin.h"
+#include "gsd-xsettings-manager.h"
+
+struct MateXSettingsPluginPrivate {
+ MateXSettingsManager *manager;
+};
+
+#define MATE_XSETTINGS_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), MATE_TYPE_XSETTINGS_PLUGIN, MateXSettingsPluginPrivate))
+
+MATE_SETTINGS_PLUGIN_REGISTER (MateXSettingsPlugin, mate_xsettings_plugin)
+
+static void
+mate_xsettings_plugin_init (MateXSettingsPlugin *plugin)
+{
+ plugin->priv = MATE_XSETTINGS_PLUGIN_GET_PRIVATE (plugin);
+
+ g_debug ("MateXSettingsPlugin initializing");
+
+ plugin->priv->manager = mate_xsettings_manager_new ();
+}
+
+static void
+mate_xsettings_plugin_finalize (GObject *object)
+{
+ MateXSettingsPlugin *plugin;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (MATE_IS_XSETTINGS_PLUGIN (object));
+
+ g_debug ("MateXSettingsPlugin finalizing");
+
+ plugin = MATE_XSETTINGS_PLUGIN (object);
+
+ g_return_if_fail (plugin->priv != NULL);
+
+ if (plugin->priv->manager != NULL) {
+ g_object_unref (plugin->priv->manager);
+ }
+
+ G_OBJECT_CLASS (mate_xsettings_plugin_parent_class)->finalize (object);
+}
+
+static void
+impl_activate (MateSettingsPlugin *plugin)
+{
+ gboolean res;
+ GError *error;
+
+ g_debug ("Activating xsettings plugin");
+
+ error = NULL;
+ res = mate_xsettings_manager_start (MATE_XSETTINGS_PLUGIN (plugin)->priv->manager, &error);
+ if (! res) {
+ g_warning ("Unable to start xsettings manager: %s", error->message);
+ g_error_free (error);
+ }
+}
+
+static void
+impl_deactivate (MateSettingsPlugin *plugin)
+{
+ g_debug ("Deactivating xsettings plugin");
+ mate_xsettings_manager_stop (MATE_XSETTINGS_PLUGIN (plugin)->priv->manager);
+}
+
+static void
+mate_xsettings_plugin_class_init (MateXSettingsPluginClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ MateSettingsPluginClass *plugin_class = MATE_SETTINGS_PLUGIN_CLASS (klass);
+
+ object_class->finalize = mate_xsettings_plugin_finalize;
+
+ plugin_class->activate = impl_activate;
+ plugin_class->deactivate = impl_deactivate;
+
+ g_type_class_add_private (klass, sizeof (MateXSettingsPluginPrivate));
+}
diff --git a/plugins/xsettings/gsd-xsettings-plugin.h b/plugins/xsettings/gsd-xsettings-plugin.h
new file mode 100644
index 0000000..88c8331
--- /dev/null
+++ b/plugins/xsettings/gsd-xsettings-plugin.h
@@ -0,0 +1,63 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2007 William Jon McCann <[email protected]>
+ *
+ * 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, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __MATE_XSETTINGS_PLUGIN_H__
+#define __MATE_XSETTINGS_PLUGIN_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gmodule.h>
+
+#include "mate-settings-plugin.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define MATE_TYPE_XSETTINGS_PLUGIN (mate_xsettings_plugin_get_type ())
+#define MATE_XSETTINGS_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MATE_TYPE_XSETTINGS_PLUGIN, MateXSettingsPlugin))
+#define MATE_XSETTINGS_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MATE_TYPE_XSETTINGS_PLUGIN, MateXSettingsPluginClass))
+#define MATE_IS_XSETTINGS_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MATE_TYPE_XSETTINGS_PLUGIN))
+#define MATE_IS_XSETTINGS_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MATE_TYPE_XSETTINGS_PLUGIN))
+#define MATE_XSETTINGS_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MATE_TYPE_XSETTINGS_PLUGIN, MateXSettingsPluginClass))
+
+typedef struct MateXSettingsPluginPrivate MateXSettingsPluginPrivate;
+
+typedef struct
+{
+ MateSettingsPlugin parent;
+ MateXSettingsPluginPrivate *priv;
+} MateXSettingsPlugin;
+
+typedef struct
+{
+ MateSettingsPluginClass parent_class;
+} MateXSettingsPluginClass;
+
+GType mate_xsettings_plugin_get_type (void) G_GNUC_CONST;
+
+/* All the plugins must implement this function */
+G_MODULE_EXPORT GType register_mate_settings_plugin (GTypeModule *module);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MATE_XSETTINGS_PLUGIN_H__ */
diff --git a/plugins/xsettings/xsettings-common.c b/plugins/xsettings/xsettings-common.c
new file mode 100644
index 0000000..992175a
--- /dev/null
+++ b/plugins/xsettings/xsettings-common.c
@@ -0,0 +1,264 @@
+/*
+ * Copyright © 2001 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Red Hat makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Owen Taylor, Red Hat, Inc.
+ */
+#include "string.h"
+#include "stdlib.h"
+
+#include <X11/Xlib.h>
+#include <X11/Xmd.h> /* For CARD32 */
+
+#include "xsettings-common.h"
+
+XSettingsSetting *
+xsettings_setting_copy (XSettingsSetting *setting)
+{
+ XSettingsSetting *result;
+ size_t str_len;
+
+ result = malloc (sizeof *result);
+ if (!result)
+ return NULL;
+
+ str_len = strlen (setting->name);
+ result->name = malloc (str_len + 1);
+ if (!result->name)
+ goto err;
+
+ memcpy (result->name, setting->name, str_len + 1);
+
+ result->type = setting->type;
+
+ switch (setting->type)
+ {
+ case XSETTINGS_TYPE_INT:
+ result->data.v_int = setting->data.v_int;
+ break;
+ case XSETTINGS_TYPE_COLOR:
+ result->data.v_color = setting->data.v_color;
+ break;
+ case XSETTINGS_TYPE_STRING:
+ str_len = strlen (setting->data.v_string);
+ result->data.v_string = malloc (str_len + 1);
+ if (!result->data.v_string)
+ goto err;
+
+ memcpy (result->data.v_string, setting->data.v_string, str_len + 1);
+ break;
+ }
+
+ result->last_change_serial = setting->last_change_serial;
+
+ return result;
+
+ err:
+ if (result->name)
+ free (result->name);
+ free (result);
+
+ return NULL;
+}
+
+XSettingsList *
+xsettings_list_copy (XSettingsList *list)
+{
+ XSettingsList *new = NULL;
+ XSettingsList *old_iter = list;
+ XSettingsList *new_iter = NULL;
+
+ while (old_iter)
+ {
+ XSettingsList *new_node;
+
+ new_node = malloc (sizeof *new_node);
+ if (!new_node)
+ goto error;
+
+ new_node->setting = xsettings_setting_copy (old_iter->setting);
+ if (!new_node->setting)
+ {
+ free (new_node);
+ goto error;
+ }
+
+ if (new_iter)
+ new_iter->next = new_node;
+ else
+ new = new_node;
+
+ new_iter = new_node;
+
+ old_iter = old_iter->next;
+ }
+
+ return new;
+
+ error:
+ xsettings_list_free (new);
+ return NULL;
+}
+
+int
+xsettings_setting_equal (XSettingsSetting *setting_a,
+ XSettingsSetting *setting_b)
+{
+ if (setting_a->type != setting_b->type)
+ return 0;
+
+ if (strcmp (setting_a->name, setting_b->name) != 0)
+ return 0;
+
+ switch (setting_a->type)
+ {
+ case XSETTINGS_TYPE_INT:
+ return setting_a->data.v_int == setting_b->data.v_int;
+ case XSETTINGS_TYPE_COLOR:
+ return (setting_a->data.v_color.red == setting_b->data.v_color.red &&
+ setting_a->data.v_color.green == setting_b->data.v_color.green &&
+ setting_a->data.v_color.blue == setting_b->data.v_color.blue &&
+ setting_a->data.v_color.alpha == setting_b->data.v_color.alpha);
+ case XSETTINGS_TYPE_STRING:
+ return strcmp (setting_a->data.v_string, setting_b->data.v_string) == 0;
+ }
+
+ return 0;
+}
+
+void
+xsettings_setting_free (XSettingsSetting *setting)
+{
+ if (setting->type == XSETTINGS_TYPE_STRING)
+ free (setting->data.v_string);
+
+ if (setting->name)
+ free (setting->name);
+
+ free (setting);
+}
+
+void
+xsettings_list_free (XSettingsList *list)
+{
+ while (list)
+ {
+ XSettingsList *next = list->next;
+
+ xsettings_setting_free (list->setting);
+ free (list);
+
+ list = next;
+ }
+}
+
+XSettingsResult
+xsettings_list_insert (XSettingsList **list,
+ XSettingsSetting *setting)
+{
+ XSettingsList *node;
+ XSettingsList *iter;
+ XSettingsList *last = NULL;
+
+ node = malloc (sizeof *node);
+ if (!node)
+ return XSETTINGS_NO_MEM;
+ node->setting = setting;
+
+ iter = *list;
+ while (iter)
+ {
+ int cmp = strcmp (setting->name, iter->setting->name);
+
+ if (cmp < 0)
+ break;
+ else if (cmp == 0)
+ {
+ free (node);
+ return XSETTINGS_DUPLICATE_ENTRY;
+ }
+
+ last = iter;
+ iter = iter->next;
+ }
+
+ if (last)
+ last->next = node;
+ else
+ *list = node;
+
+ node->next = iter;
+
+ return XSETTINGS_SUCCESS;
+}
+
+XSettingsResult
+xsettings_list_delete (XSettingsList **list,
+ const char *name)
+{
+ XSettingsList *iter;
+ XSettingsList *last = NULL;
+
+ iter = *list;
+ while (iter)
+ {
+ if (strcmp (name, iter->setting->name) == 0)
+ {
+ if (last)
+ last->next = iter->next;
+ else
+ *list = iter->next;
+
+ xsettings_setting_free (iter->setting);
+ free (iter);
+
+ return XSETTINGS_SUCCESS;
+ }
+
+ last = iter;
+ iter = iter->next;
+ }
+
+ return XSETTINGS_FAILED;
+}
+
+XSettingsSetting *
+xsettings_list_lookup (XSettingsList *list,
+ const char *name)
+{
+ XSettingsList *iter;
+
+ iter = list;
+ while (iter)
+ {
+ if (strcmp (name, iter->setting->name) == 0)
+ return iter->setting;
+
+ iter = iter->next;
+ }
+
+ return NULL;
+}
+
+char
+xsettings_byte_order (void)
+{
+ CARD32 myint = 0x01020304;
+ return (*(char *)&myint == 1) ? MSBFirst : LSBFirst;
+}
diff --git a/plugins/xsettings/xsettings-common.h b/plugins/xsettings/xsettings-common.h
new file mode 100644
index 0000000..e3af4a6
--- /dev/null
+++ b/plugins/xsettings/xsettings-common.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright © 2001 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Red Hat makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Owen Taylor, Red Hat, Inc.
+ */
+#ifndef XSETTINGS_COMMON_H
+#define XSETTINGS_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef struct _XSettingsBuffer XSettingsBuffer;
+typedef struct _XSettingsColor XSettingsColor;
+typedef struct _XSettingsList XSettingsList;
+typedef struct _XSettingsSetting XSettingsSetting;
+
+/* Types of settings possible. Enum values correspond to
+ * protocol values.
+ */
+typedef enum
+{
+ XSETTINGS_TYPE_INT = 0,
+ XSETTINGS_TYPE_STRING = 1,
+ XSETTINGS_TYPE_COLOR = 2
+} XSettingsType;
+
+typedef enum
+{
+ XSETTINGS_SUCCESS,
+ XSETTINGS_NO_MEM,
+ XSETTINGS_ACCESS,
+ XSETTINGS_FAILED,
+ XSETTINGS_NO_ENTRY,
+ XSETTINGS_DUPLICATE_ENTRY
+} XSettingsResult;
+
+struct _XSettingsBuffer
+{
+ char byte_order;
+ size_t len;
+ unsigned char *data;
+ unsigned char *pos;
+};
+
+struct _XSettingsColor
+{
+ unsigned short red, green, blue, alpha;
+};
+
+struct _XSettingsList
+{
+ XSettingsSetting *setting;
+ XSettingsList *next;
+};
+
+struct _XSettingsSetting
+{
+ char *name;
+ XSettingsType type;
+
+ union {
+ int v_int;
+ char *v_string;
+ XSettingsColor v_color;
+ } data;
+
+ unsigned long last_change_serial;
+};
+
+XSettingsSetting *xsettings_setting_copy (XSettingsSetting *setting);
+void xsettings_setting_free (XSettingsSetting *setting);
+int xsettings_setting_equal (XSettingsSetting *setting_a,
+ XSettingsSetting *setting_b);
+
+void xsettings_list_free (XSettingsList *list);
+XSettingsList *xsettings_list_copy (XSettingsList *list);
+XSettingsResult xsettings_list_insert (XSettingsList **list,
+ XSettingsSetting *setting);
+XSettingsSetting *xsettings_list_lookup (XSettingsList *list,
+ const char *name);
+XSettingsResult xsettings_list_delete (XSettingsList **list,
+ const char *name);
+
+char xsettings_byte_order (void);
+
+#define XSETTINGS_PAD(n,m) ((n + m - 1) & (~(m-1)))
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* XSETTINGS_COMMON_H */
diff --git a/plugins/xsettings/xsettings-manager.c b/plugins/xsettings/xsettings-manager.c
new file mode 100644
index 0000000..6578ce1
--- /dev/null
+++ b/plugins/xsettings/xsettings-manager.c
@@ -0,0 +1,424 @@
+/*
+ * Copyright © 2001 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Red Hat makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Owen Taylor, Red Hat, Inc.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xmd.h> /* For CARD16 */
+
+#include "xsettings-manager.h"
+
+struct _XSettingsManager
+{
+ Display *display;
+ int screen;
+
+ Window window;
+ Atom manager_atom;
+ Atom selection_atom;
+ Atom xsettings_atom;
+
+ XSettingsTerminateFunc terminate;
+ void *cb_data;
+
+ XSettingsList *settings;
+ unsigned long serial;
+};
+
+static XSettingsList *settings;
+
+typedef struct
+{
+ Window window;
+ Atom timestamp_prop_atom;
+} TimeStampInfo;
+
+static Bool
+timestamp_predicate (Display *display,
+ XEvent *xevent,
+ XPointer arg)
+{
+ TimeStampInfo *info = (TimeStampInfo *)arg;
+
+ if (xevent->type == PropertyNotify &&
+ xevent->xproperty.window == info->window &&
+ xevent->xproperty.atom == info->timestamp_prop_atom)
+ return True;
+
+ return False;
+}
+
+/**
+ * get_server_time:
+ * @display: display from which to get the time
+ * @window: a #Window, used for communication with the server.
+ * The window must have PropertyChangeMask in its
+ * events mask or a hang will result.
+ *
+ * Routine to get the current X server time stamp.
+ *
+ * Return value: the time stamp.
+ **/
+static Time
+get_server_time (Display *display,
+ Window window)
+{
+ unsigned char c = 'a';
+ XEvent xevent;
+ TimeStampInfo info;
+
+ info.timestamp_prop_atom = XInternAtom (display, "_TIMESTAMP_PROP", False);
+ info.window = window;
+
+ XChangeProperty (display, window,
+ info.timestamp_prop_atom, info.timestamp_prop_atom,
+ 8, PropModeReplace, &c, 1);
+
+ XIfEvent (display, &xevent,
+ timestamp_predicate, (XPointer)&info);
+
+ return xevent.xproperty.time;
+}
+
+Bool
+xsettings_manager_check_running (Display *display,
+ int screen)
+{
+ char buffer[256];
+ Atom selection_atom;
+
+ sprintf(buffer, "_XSETTINGS_S%d", screen);
+ selection_atom = XInternAtom (display, buffer, False);
+
+ if (XGetSelectionOwner (display, selection_atom))
+ return True;
+ else
+ return False;
+}
+
+XSettingsManager *
+xsettings_manager_new (Display *display,
+ int screen,
+ XSettingsTerminateFunc terminate,
+ void *cb_data)
+{
+ XSettingsManager *manager;
+ Time timestamp;
+ XClientMessageEvent xev;
+
+ char buffer[256];
+
+ manager = malloc (sizeof *manager);
+ if (!manager)
+ return NULL;
+
+ manager->display = display;
+ manager->screen = screen;
+
+ sprintf(buffer, "_XSETTINGS_S%d", screen);
+ manager->selection_atom = XInternAtom (display, buffer, False);
+ manager->xsettings_atom = XInternAtom (display, "_XSETTINGS_SETTINGS", False);
+ manager->manager_atom = XInternAtom (display, "MANAGER", False);
+
+ manager->terminate = terminate;
+ manager->cb_data = cb_data;
+
+ manager->settings = NULL;
+ manager->serial = 0;
+
+ manager->window = XCreateSimpleWindow (display,
+ RootWindow (display, screen),
+ 0, 0, 10, 10, 0,
+ WhitePixel (display, screen),
+ WhitePixel (display, screen));
+
+ XSelectInput (display, manager->window, PropertyChangeMask);
+ timestamp = get_server_time (display, manager->window);
+
+ XSetSelectionOwner (display, manager->selection_atom,
+ manager->window, timestamp);
+
+ /* Check to see if we managed to claim the selection. If not,
+ * we treat it as if we got it then immediately lost it
+ */
+
+ if (XGetSelectionOwner (display, manager->selection_atom) ==
+ manager->window)
+ {
+ xev.type = ClientMessage;
+ xev.window = RootWindow (display, screen);
+ xev.message_type = manager->manager_atom;
+ xev.format = 32;
+ xev.data.l[0] = timestamp;
+ xev.data.l[1] = manager->selection_atom;
+ xev.data.l[2] = manager->window;
+ xev.data.l[3] = 0; /* manager specific data */
+ xev.data.l[4] = 0; /* manager specific data */
+
+ XSendEvent (display, RootWindow (display, screen),
+ False, StructureNotifyMask, (XEvent *)&xev);
+ }
+ else
+ {
+ manager->terminate (manager->cb_data);
+ }
+
+ return manager;
+}
+
+void
+xsettings_manager_destroy (XSettingsManager *manager)
+{
+ XDestroyWindow (manager->display, manager->window);
+
+ xsettings_list_free (manager->settings);
+ free (manager);
+}
+
+Window
+xsettings_manager_get_window (XSettingsManager *manager)
+{
+ return manager->window;
+}
+
+Bool
+xsettings_manager_process_event (XSettingsManager *manager,
+ XEvent *xev)
+{
+ if (xev->xany.window == manager->window &&
+ xev->xany.type == SelectionClear &&
+ xev->xselectionclear.selection == manager->selection_atom)
+ {
+ manager->terminate (manager->cb_data);
+ return True;
+ }
+
+ return False;
+}
+
+XSettingsResult
+xsettings_manager_delete_setting (XSettingsManager *manager,
+ const char *name)
+{
+ return xsettings_list_delete (&settings, name);
+}
+
+XSettingsResult
+xsettings_manager_set_setting (XSettingsManager *manager,
+ XSettingsSetting *setting)
+{
+ XSettingsSetting *old_setting = xsettings_list_lookup (settings, setting->name);
+ XSettingsSetting *new_setting;
+ XSettingsResult result;
+
+ if (old_setting)
+ {
+ if (xsettings_setting_equal (old_setting, setting))
+ return XSETTINGS_SUCCESS;
+
+ xsettings_list_delete (&settings, setting->name);
+ }
+
+ new_setting = xsettings_setting_copy (setting);
+ if (!new_setting)
+ return XSETTINGS_NO_MEM;
+
+ new_setting->last_change_serial = manager->serial;
+
+ result = xsettings_list_insert (&settings, new_setting);
+
+ if (result != XSETTINGS_SUCCESS)
+ xsettings_setting_free (new_setting);
+
+ return result;
+}
+
+XSettingsResult
+xsettings_manager_set_int (XSettingsManager *manager,
+ const char *name,
+ int value)
+{
+ XSettingsSetting setting;
+
+ setting.name = (char *)name;
+ setting.type = XSETTINGS_TYPE_INT;
+ setting.data.v_int = value;
+
+ return xsettings_manager_set_setting (manager, &setting);
+}
+
+XSettingsResult
+xsettings_manager_set_string (XSettingsManager *manager,
+ const char *name,
+ const char *value)
+{
+ XSettingsSetting setting;
+
+ setting.name = (char *)name;
+ setting.type = XSETTINGS_TYPE_STRING;
+ setting.data.v_string = (char *)value;
+
+ return xsettings_manager_set_setting (manager, &setting);
+}
+
+XSettingsResult
+xsettings_manager_set_color (XSettingsManager *manager,
+ const char *name,
+ XSettingsColor *value)
+{
+ XSettingsSetting setting;
+
+ setting.name = (char *)name;
+ setting.type = XSETTINGS_TYPE_COLOR;
+ setting.data.v_color = *value;
+
+ return xsettings_manager_set_setting (manager, &setting);
+}
+
+static size_t
+setting_length (XSettingsSetting *setting)
+{
+ size_t length = 8; /* type + pad + name-len + last-change-serial */
+ length += XSETTINGS_PAD (strlen (setting->name), 4);
+
+ switch (setting->type)
+ {
+ case XSETTINGS_TYPE_INT:
+ length += 4;
+ break;
+ case XSETTINGS_TYPE_STRING:
+ length += 4 + XSETTINGS_PAD (strlen (setting->data.v_string), 4);
+ break;
+ case XSETTINGS_TYPE_COLOR:
+ length += 8;
+ break;
+ }
+
+ return length;
+}
+
+static void
+setting_store (XSettingsSetting *setting,
+ XSettingsBuffer *buffer)
+{
+ size_t string_len;
+ size_t length;
+
+ *(buffer->pos++) = setting->type;
+ *(buffer->pos++) = 0;
+
+ string_len = strlen (setting->name);
+ *(CARD16 *)(buffer->pos) = string_len;
+ buffer->pos += 2;
+
+ length = XSETTINGS_PAD (string_len, 4);
+ memcpy (buffer->pos, setting->name, string_len);
+ length -= string_len;
+ buffer->pos += string_len;
+
+ while (length > 0)
+ {
+ *(buffer->pos++) = 0;
+ length--;
+ }
+
+ *(CARD32 *)(buffer->pos) = setting->last_change_serial;
+ buffer->pos += 4;
+
+ switch (setting->type)
+ {
+ case XSETTINGS_TYPE_INT:
+ *(CARD32 *)(buffer->pos) = setting->data.v_int;
+ buffer->pos += 4;
+ break;
+ case XSETTINGS_TYPE_STRING:
+ string_len = strlen (setting->data.v_string);
+ *(CARD32 *)(buffer->pos) = string_len;
+ buffer->pos += 4;
+
+ length = XSETTINGS_PAD (string_len, 4);
+ memcpy (buffer->pos, setting->data.v_string, string_len);
+ length -= string_len;
+ buffer->pos += string_len;
+
+ while (length > 0)
+ {
+ *(buffer->pos++) = 0;
+ length--;
+ }
+ break;
+ case XSETTINGS_TYPE_COLOR:
+ *(CARD16 *)(buffer->pos) = setting->data.v_color.red;
+ *(CARD16 *)(buffer->pos + 2) = setting->data.v_color.green;
+ *(CARD16 *)(buffer->pos + 4) = setting->data.v_color.blue;
+ *(CARD16 *)(buffer->pos + 6) = setting->data.v_color.alpha;
+ buffer->pos += 8;
+ break;
+ }
+}
+
+XSettingsResult
+xsettings_manager_notify (XSettingsManager *manager)
+{
+ XSettingsBuffer buffer;
+ XSettingsList *iter;
+ int n_settings = 0;
+
+ buffer.len = 12; /* byte-order + pad + SERIAL + N_SETTINGS */
+
+ iter = settings;
+ while (iter)
+ {
+ buffer.len += setting_length (iter->setting);
+ n_settings++;
+ iter = iter->next;
+ }
+
+ buffer.data = buffer.pos = malloc (buffer.len);
+ if (!buffer.data)
+ return XSETTINGS_NO_MEM;
+
+ *buffer.pos = xsettings_byte_order ();
+
+ buffer.pos += 4;
+ *(CARD32 *)buffer.pos = manager->serial++;
+ buffer.pos += 4;
+ *(CARD32 *)buffer.pos = n_settings;
+ buffer.pos += 4;
+
+ iter = settings;
+ while (iter)
+ {
+ setting_store (iter->setting, &buffer);
+ iter = iter->next;
+ }
+
+ XChangeProperty (manager->display, manager->window,
+ manager->xsettings_atom, manager->xsettings_atom,
+ 8, PropModeReplace, buffer.data, buffer.len);
+
+ free (buffer.data);
+
+ return XSETTINGS_SUCCESS;
+}
+
diff --git a/plugins/xsettings/xsettings-manager.h b/plugins/xsettings/xsettings-manager.h
new file mode 100644
index 0000000..f309768
--- /dev/null
+++ b/plugins/xsettings/xsettings-manager.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright © 2001 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Red Hat makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Owen Taylor, Red Hat, Inc.
+ */
+#ifndef XSETTINGS_MANAGER_H
+#define XSETTINGS_MANAGER_H
+
+#include <X11/Xlib.h>
+#include "xsettings-common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+typedef struct _XSettingsManager XSettingsManager;
+
+typedef void (*XSettingsTerminateFunc) (void *cb_data);
+
+Bool xsettings_manager_check_running (Display *display,
+ int screen);
+
+XSettingsManager *xsettings_manager_new (Display *display,
+ int screen,
+ XSettingsTerminateFunc terminate,
+ void *cb_data);
+
+void xsettings_manager_destroy (XSettingsManager *manager);
+Window xsettings_manager_get_window (XSettingsManager *manager);
+Bool xsettings_manager_process_event (XSettingsManager *manager,
+ XEvent *xev);
+
+XSettingsResult xsettings_manager_delete_setting (XSettingsManager *manager,
+ const char *name);
+XSettingsResult xsettings_manager_set_setting (XSettingsManager *manager,
+ XSettingsSetting *setting);
+XSettingsResult xsettings_manager_set_int (XSettingsManager *manager,
+ const char *name,
+ int value);
+XSettingsResult xsettings_manager_set_string (XSettingsManager *manager,
+ const char *name,
+ const char *value);
+XSettingsResult xsettings_manager_set_color (XSettingsManager *manager,
+ const char *name,
+ XSettingsColor *value);
+XSettingsResult xsettings_manager_notify (XSettingsManager *manager);
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* XSETTINGS_MANAGER_H */
diff --git a/plugins/xsettings/xsettings.mate-settings-plugin.in b/plugins/xsettings/xsettings.mate-settings-plugin.in
new file mode 100644
index 0000000..6747dc1
--- /dev/null
+++ b/plugins/xsettings/xsettings.mate-settings-plugin.in
@@ -0,0 +1,8 @@
+[MATE Settings Plugin]
+Module=xsettings
+IAge=0
+_Name=X Settings
+_Description=Manage X Settings
+Authors=William Jon McCann
+Copyright=Copyright © 2007 William Jon McCann
+Website=