Rewrite of LXAppearance.
authorHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Sun, 25 Jul 2010 19:50:17 +0000 (03:50 +0800)
committerHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Sun, 25 Jul 2010 19:50:17 +0000 (03:50 +0800)
22 files changed:
Makefile.am [new file with mode: 0644]
autogen.sh [new file with mode: 0755]
configure.ac [new file with mode: 0644]
data/Makefile.am [new file with mode: 0644]
data/lxappearance2.desktop.in [new file with mode: 0644]
data/ui/Makefile.am [new file with mode: 0644]
data/ui/about.glade.in [new file with mode: 0644]
data/ui/lxappearance.glade [new file with mode: 0644]
po/Makefile.in.in [new file with mode: 0644]
po/POTFILES.in [new file with mode: 0644]
po/POTFILES.skip [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/cursor-theme.c [new file with mode: 0644]
src/cursor-theme.h [new file with mode: 0644]
src/icon-theme.c [new file with mode: 0644]
src/icon-theme.h [new file with mode: 0644]
src/lxappearance2.c [new file with mode: 0644]
src/utils.c [new file with mode: 0644]
src/utils.h [new file with mode: 0644]
src/widget-theme.c [new file with mode: 0644]
src/widget-theme.h [new file with mode: 0644]
src/xml-purge.c [new file with mode: 0644]

diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..e5a3db4
--- /dev/null
@@ -0,0 +1,6 @@
+NULL=
+
+SUBDIRS=src po data
+
+EXTRA_DIST = \
+       $(NULL)
diff --git a/autogen.sh b/autogen.sh
new file mode 100755 (executable)
index 0000000..aaaed56
--- /dev/null
@@ -0,0 +1,29 @@
+#! /bin/sh
+AC_VERSION=
+
+AUTOMAKE=${AUTOMAKE:-automake}
+AM_INSTALLED_VERSION=$($AUTOMAKE --version | sed -e '2,$ d' -e 's/.* \([0-9]*\.[0-9]*\).*/\1/')
+
+if [ "$AM_INSTALLED_VERSION" != "1.10" \
+    -a "$AM_INSTALLED_VERSION" != "1.11" ];then
+       echo
+       echo "You must have automake > 1.10 or 1.11 installed to compile this program."
+       echo "Install the appropriate package for your distribution,"
+       echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/"
+       exit 1
+fi
+
+set -x
+
+if [ "x${ACLOCAL_DIR}" != "x" ]; then
+  ACLOCAL_ARG=-I ${ACLOCAL_DIR}
+fi
+
+${ACLOCAL:-aclocal$AM_VERSION} ${ACLOCAL_ARG}
+${AUTOHEADER:-autoheader$AC_VERSION} --force
+AUTOMAKE=$AUTOMAKE libtoolize -c --automake --force
+AUTOMAKE=$AUTOMAKE intltoolize -c --automake --force
+$AUTOMAKE --add-missing --copy --include-deps
+${AUTOCONF:-autoconf$AC_VERSION}
+
+rm -rf autom4te.cache
diff --git a/configure.ac b/configure.ac
new file mode 100644 (file)
index 0000000..81ec326
--- /dev/null
@@ -0,0 +1,108 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+prog_name = lxappearance2
+
+AC_PREREQ([2.63])
+AC_INIT([lxappearance2], [0.1.0], [http://lxde.org/])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+
+AC_CONFIG_HEADERS([config.h])
+
+# Checks for programs.
+AC_PROG_CC
+# AM_PROG_LIBTOOL
+
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_STDC
+
+# Checks for typedefs, structures, and compiler characteristics.
+
+# Checks for library functions.
+
+# intltool
+IT_PROG_INTLTOOL([0.40.0])
+
+# PKG_CHECK_MODULES(XLIB, "x11")
+# AC_SUBST(XLIB_CFLAGS)
+# AC_SUBST(XLIB_LIBS)
+
+pkg_modules="gtk+-2.0 >= 2.12.0"
+PKG_CHECK_MODULES(GTK, [$pkg_modules])
+AC_SUBST(GTK_CFLAGS)
+AC_SUBST(GTK_LIBS)
+
+# gio_modules="gthread-2.0 gio-unix-2.0 glib-2.0 >= 2.18.0"
+# PKG_CHECK_MODULES(GIO, [$gio_modules])
+# AC_SUBST(GIO_CFLAGS)
+# AC_SUBST(GIO_LIBS)
+
+# menu_modules="libmenu-cache >= 0.3.2"
+# PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules])
+# AC_SUBST(MENU_CACHE_CFLAGS)
+# AC_SUBST(MENU_CACHE_LIBS)
+
+AC_ARG_ENABLE(debug,
+       [AC_HELP_STRING([--enable-debug],
+               [build libfm with debug support @<:@default=no@:>@])],
+       [enable_debug="${enableval}"],
+       [enable_debug=no]
+)
+if test "$enable_debug" = "yes"; then
+    # turn on debug and disable optimization
+    CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
+else
+    # turn off glib debug checks
+    CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
+fi
+
+# Generate po/LINGUAS on the fly rather than relying on translators
+# to maintain it manually. This also overcome the problem that Transifex
+# cannot add a language to po/LINGUAS if a new po file is submitted.
+rm -f $srcdir/po/LINGUAS
+for po_file in `ls $srcdir/po/*.po | sort`;
+do
+    lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
+    echo $lang >> $srcdir/po/LINGUAS
+done
+
+GETTEXT_PACKAGE=lxappearance2
+AC_SUBST(GETTEXT_PACKAGE)
+AM_GLIB_GNU_GETTEXT
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
+
+AC_CONFIG_FILES([
+    Makefile
+    src/Makefile
+    data/Makefile
+    data/ui/Makefile
+    data/ui/about.glade
+    po/Makefile.in
+])
+
+AC_OUTPUT
+
+if test x"$sysconfdir" != x'/etc'; then
+    echo
+    echo
+    echo 'Error: sysconfdir is not /etc.'
+    echo 'Please consider passing --sysconfdir=/etc to configure.';
+    echo 'Otherwise default config files will be installed to wrong place.'
+    echo
+    echo
+else
+    echo
+    echo lxappearance2....................... : Version $VERSION
+    echo
+    echo Enable debug....................: "$enable_debug"
+    echo Prefix..........................: $prefix
+    echo
+    echo The binary will be installed in $prefix/bin
+    echo
+    echo http://lxde.org/
+    echo
+    echo "Ready to make lxappearance2. Type 'make' to continue."
+    echo
+fi
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644 (file)
index 0000000..43245fa
--- /dev/null
@@ -0,0 +1,16 @@
+NULL=
+
+SUBDIRS= \
+       ui \
+       $(NULL)
+
+desktopdir=$(datadir)/applications
+desktop_in_files = \
+       lxappearance2.desktop.in \
+       $(NULL)
+desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
+@INTLTOOL_DESKTOP_RULE@
+
+EXTRA_DIST= \
+       $(desktop_DATA) \
+       $(NULL)
diff --git a/data/lxappearance2.desktop.in b/data/lxappearance2.desktop.in
new file mode 100644 (file)
index 0000000..c2aabc0
--- /dev/null
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+_Name=LXAppearance
+_GenericName=LXAppearance
+_Comment=LXAppearance Description
+Icon=LXAppearance
+Exec=lxappearance2
+StartupNotify=true
+Categories=GTK;
diff --git a/data/ui/Makefile.am b/data/ui/Makefile.am
new file mode 100644 (file)
index 0000000..19ecc1a
--- /dev/null
@@ -0,0 +1,22 @@
+NULL=
+
+# GtkBuilder UI definition files
+uidir=$(datadir)/lxappearance2/ui
+ui_in_files= \
+       about.glade \
+       lxappearance.glade \
+       $(NULL)
+ui_DATA = $(ui_in_files:.glade=.ui)
+
+CLEANFILES = \
+       $(ui_DATA) \
+       $(NULL)
+
+# Purge GtkBuilder UI files
+%.ui: %.glade
+       cp $< $@
+       $(top_srcdir)/src/xml-purge $@
+
+EXTRA_DIST= \
+       $(ui_DATA) \
+       $(NULL)
diff --git a/data/ui/about.glade.in b/data/ui/about.glade.in
new file mode 100644 (file)
index 0000000..689aa5b
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<interface>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <object class="GtkAboutDialog" id="dlg">
+    <property name="border_width">5</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="type_hint">dialog</property>
+    <property name="has_separator">False</property>
+    <property name="program_name">LXAppearance</property>
+    <property name="version">@VERSION@</property>
+    <property name="copyright" translatable="yes">Copyright (C) 2010</property>
+    <property name="comments" translatable="yes">LXAppearance Description</property>
+    <property name="website">http://lxde.org/</property>
+    <property name="license">Copyright (C) 2010 LXDE Team
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.</property>
+    <property name="authors">LXDE Team</property>
+    <property name="translator_credits" translatable="yes" comments="Please replace this line with your own names, one name per line. ">translator-credits</property>
+    <property name="artists"></property>
+    <property name="wrap_license">True</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/data/ui/lxappearance.glade b/data/ui/lxappearance.glade
new file mode 100644 (file)
index 0000000..a76ee5b
--- /dev/null
@@ -0,0 +1,1248 @@
+<?xml version="1.0"?>
+<interface>
+  <requires lib="gtk+" version="2.16"/>
+  <!-- interface-naming-policy project-wide -->
+  <object class="GtkListStore" id="tb_style_store">
+    <columns>
+      <!-- column-name item -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">Icons only</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Text only</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Text below icons</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">Text beside icons</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkListStore" id="icon_theme_store"/>
+  <object class="GtkListStore" id="cursor_theme_store"/>
+  <object class="GtkListStore" id="cursor_demo_store"/>
+  <object class="GtkListStore" id="icon_demo_store">
+    <columns>
+      <!-- column-name icon-name -->
+      <column type="gchararray"/>
+    </columns>
+    <data>
+      <row>
+        <col id="0" translatable="yes">user-home</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">user-desktop</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">folder</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">folder-remote</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">user-trash</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">x-office-document</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">application-x-executable</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">image-x-generic</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">text-x-generic</col>
+      </row>
+      <row>
+        <col id="0" translatable="yes">text-html</col>
+      </row>
+    </data>
+  </object>
+  <object class="GtkDialog" id="dlg">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Look and Feels</property>
+    <property name="default_width">512</property>
+    <property name="icon_name">preferences-desktop-theme</property>
+    <property name="type_hint">normal</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkNotebook" id="notebook">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <child>
+              <object class="GtkHBox" id="hbox2">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkScrolledWindow" id="scrolledwindow2">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hscrollbar_policy">automatic</property>
+                    <property name="vscrollbar_policy">automatic</property>
+                    <property name="shadow_type">etched-in</property>
+                    <child>
+                      <object class="GtkTreeView" id="widget_theme_view">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="has_focus">True</property>
+                        <property name="headers_visible">False</property>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkVBox" id="vbox6">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label11">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Preview of the selected widget style</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkFrame" id="frame1">
+                        <property name="visible">True</property>
+                        <property name="label_xalign">0</property>
+                        <child>
+                          <object class="GtkEventBox" id="demo">
+                            <property name="visible">True</property>
+                            <child>
+                              <object class="GtkEventBox" id="eventbox1">
+                                <property name="visible">True</property>
+                                <property name="border_width">10</property>
+                                <child>
+                                  <object class="GtkVBox" id="demo_vbox">
+                                    <property name="visible">True</property>
+                                    <property name="border_width">2</property>
+                                    <child>
+                                      <object class="GtkMenuBar" id="menubar1">
+                                        <property name="visible">True</property>
+                                        <child>
+                                          <object class="GtkMenuItem" id="menuitem1">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">_File</property>
+                                            <property name="use_underline">True</property>
+                                            <child type="submenu">
+                                              <object class="GtkMenu" id="menuitem1_menu">
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="new1">
+                                                    <property name="label">gtk-new</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="open1">
+                                                    <property name="label">gtk-open</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="save1">
+                                                    <property name="label">gtk-save</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="save_as1">
+                                                    <property name="label">gtk-save-as</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
+                                                    <property name="visible">True</property>
+                                                  </object>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="quit1">
+                                                    <property name="label">gtk-quit</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                              </object>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkMenuItem" id="menuitem2">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">_Edit</property>
+                                            <property name="use_underline">True</property>
+                                            <child type="submenu">
+                                              <object class="GtkMenu" id="menuitem2_menu">
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="cut1">
+                                                    <property name="label">gtk-cut</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="copy1">
+                                                    <property name="label">gtk-copy</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="paste1">
+                                                    <property name="label">gtk-paste</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="delete1">
+                                                    <property name="label">gtk-delete</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                              </object>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child>
+                                          <object class="GtkMenuItem" id="menuitem4">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">_Help</property>
+                                            <property name="use_underline">True</property>
+                                            <child type="submenu">
+                                              <object class="GtkMenu" id="menuitem4_menu">
+                                                <child>
+                                                  <object class="GtkImageMenuItem" id="about1">
+                                                    <property name="label">gtk-about</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="use_underline">True</property>
+                                                    <property name="use_stock">True</property>
+                                                  </object>
+                                                </child>
+                                              </object>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkHandleBox" id="handlebox1">
+                                        <property name="visible">True</property>
+                                        <child>
+                                          <object class="GtkToolbar" id="toolbar">
+                                            <property name="visible">True</property>
+                                            <property name="toolbar_style">icons</property>
+                                            <property name="show_arrow">False</property>
+                                            <child>
+                                              <object class="GtkToolButton" id="toolbutton1">
+                                                <property name="visible">True</property>
+                                                <property name="is_important">True</property>
+                                                <property name="stock_id">gtk-go-back</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="homogeneous">True</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkToolButton" id="toolbutton2">
+                                                <property name="visible">True</property>
+                                                <property name="stock_id">gtk-go-forward</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="homogeneous">True</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkToolButton" id="toolbutton3">
+                                                <property name="visible">True</property>
+                                                <property name="is_important">True</property>
+                                                <property name="stock_id">gtk-stop</property>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">False</property>
+                                                <property name="homogeneous">True</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkToolItem" id="toolbutton4">
+                                                <property name="visible">True</property>
+                                                <child>
+                                                  <object class="GtkEntry" id="entry1">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">True</property>
+                                                    <property name="invisible_char">&#x25CF;</property>
+                                                  </object>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="expand">True</property>
+                                                <property name="homogeneous">True</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkNotebook" id="notebook2">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="border_width">5</property>
+                                        <child>
+                                          <object class="GtkHBox" id="hbox3">
+                                            <property name="visible">True</property>
+                                            <child>
+                                              <object class="GtkFrame" id="frame2">
+                                                <property name="visible">True</property>
+                                                <property name="border_width">4</property>
+                                                <property name="label_xalign">0</property>
+                                                <child>
+                                                  <object class="GtkAlignment" id="alignment2">
+                                                    <property name="visible">True</property>
+                                                    <property name="bottom_padding">4</property>
+                                                    <property name="left_padding">4</property>
+                                                    <child>
+                                                      <object class="GtkVBox" id="vbox7">
+                                                        <property name="visible">True</property>
+                                                        <property name="spacing">4</property>
+                                                        <child>
+                                                          <object class="GtkRadioButton" id="radiobutton1">
+                                                            <property name="label" translatable="yes">Radio Button</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">False</property>
+                                                            <property name="use_underline">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                          </object>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <object class="GtkCheckButton" id="checkbutton1">
+                                                            <property name="label" translatable="yes">Check Button</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">False</property>
+                                                            <property name="use_underline">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                          </object>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                          </packing>
+                                                        </child>
+                                                        <child>
+                                                          <object class="GtkHBox" id="hbox4">
+                                                            <property name="visible">True</property>
+                                                            <child>
+                                                            <object class="GtkSpinButton" id="spinbutton1">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="invisible_char">&#x25CF;</property>
+                                                            <property name="climb_rate">1</property>
+                                                            </object>
+                                                            <packing>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <object class="GtkButton" id="button1">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="receives_default">True</property>
+                                                            <child>
+                                                            <object class="GtkAlignment" id="alignment3">
+                                                            <property name="visible">True</property>
+                                                            <property name="xscale">0</property>
+                                                            <property name="yscale">0</property>
+                                                            <child>
+                                                            <object class="GtkHBox" id="hbox6">
+                                                            <property name="visible">True</property>
+                                                            <property name="spacing">2</property>
+                                                            <child>
+                                                            <object class="GtkImage" id="image1">
+                                                            <property name="visible">True</property>
+                                                            <property name="stock">gtk-find</property>
+                                                            </object>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <object class="GtkLabel" id="label18">
+                                                            <property name="visible">True</property>
+                                                            <property name="label" translatable="yes">button</property>
+                                                            <property name="use_underline">True</property>
+                                                            </object>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </object>
+                                                            </child>
+                                                            </object>
+                                                            </child>
+                                                            </object>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                          </object>
+                                                          <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="position">2</property>
+                                                          </packing>
+                                                        </child>
+                                                      </object>
+                                                    </child>
+                                                  </object>
+                                                </child>
+                                                <child type="label">
+                                                  <object class="GtkLabel" id="label16">
+                                                    <property name="visible">True</property>
+                                                    <property name="label" translatable="yes">Demo</property>
+                                                    <property name="use_markup">True</property>
+                                                  </object>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="position">0</property>
+                                              </packing>
+                                            </child>
+                                            <child>
+                                              <object class="GtkVBox" id="vbox9">
+                                                <property name="visible">True</property>
+                                                <property name="border_width">4</property>
+                                                <child>
+                                                  <object class="GtkProgressBar" id="progressbar1">
+                                                    <property name="visible">True</property>
+                                                    <property name="show_text">True</property>
+                                                    <property name="fraction">0.60000002384200002</property>
+                                                    <property name="pulse_step">0.10000000149</property>
+                                                    <property name="text">60 %</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="fill">False</property>
+                                                    <property name="position">0</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkHScale" id="hscale1">
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">True</property>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">1</property>
+                                                  </packing>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkComboBox" id="combobox2">
+                                                    <property name="visible">True</property>
+                                                    <child>
+                                                      <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                                                      <attributes>
+                                                        <attribute name="text">0</attribute>
+                                                      </attributes>
+                                                    </child>
+                                                  </object>
+                                                  <packing>
+                                                    <property name="expand">False</property>
+                                                    <property name="position">2</property>
+                                                  </packing>
+                                                </child>
+                                              </object>
+                                              <packing>
+                                                <property name="position">1</property>
+                                              </packing>
+                                            </child>
+                                          </object>
+                                        </child>
+                                        <child type="tab">
+                                          <object class="GtkLabel" id="label13">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">Page1</property>
+                                          </object>
+                                          <packing>
+                                            <property name="tab_fill">False</property>
+                                          </packing>
+                                        </child>
+                                        <child>
+                                          <object class="GtkScrolledWindow" id="scrolledwindow6">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="hscrollbar_policy">never</property>
+                                            <property name="shadow_type">in</property>
+                                            <child>
+                                              <object class="GtkTreeView" id="demo_treeview">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">True</property>
+                                                <property name="model">icon_demo_store</property>
+                                                <property name="headers_clickable">False</property>
+                                                <property name="rules_hint">True</property>
+                                                <child>
+                                                  <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+                                                    <property name="title">column</property>
+                                                  </object>
+                                                </child>
+                                                <child>
+                                                  <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                                                    <property name="title">column</property>
+                                                  </object>
+                                                </child>
+                                              </object>
+                                            </child>
+                                          </object>
+                                          <packing>
+                                            <property name="position">1</property>
+                                          </packing>
+                                        </child>
+                                        <child type="tab">
+                                          <object class="GtkLabel" id="label14">
+                                            <property name="visible">True</property>
+                                            <property name="label" translatable="yes">Page2</property>
+                                          </object>
+                                          <packing>
+                                            <property name="position">1</property>
+                                            <property name="tab_fill">False</property>
+                                          </packing>
+                                        </child>
+                                      </object>
+                                      <packing>
+                                        <property name="position">2</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <object class="GtkStatusbar" id="statusbar1">
+                                        <property name="visible">True</property>
+                                        <property name="spacing">2</property>
+                                      </object>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="position">3</property>
+                                      </packing>
+                                    </child>
+                                  </object>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label_item">
+                          <placeholder/>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox" id="hbox8">
+                        <property name="visible">True</property>
+                        <property name="spacing">12</property>
+                        <child>
+                          <object class="GtkLabel" id="label12">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Default font:</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkFontButton" id="fontbutton1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Widget</property>
+              </object>
+              <packing>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox5">
+                <property name="visible">True</property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label9">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Color</property>
+              </object>
+              <packing>
+                <property name="position">1</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox1">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkVBox" id="vbox10">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkScrolledWindow" id="scrolledwindow1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hscrollbar_policy">automatic</property>
+                        <property name="vscrollbar_policy">automatic</property>
+                        <property name="shadow_type">etched-in</property>
+                        <child>
+                          <object class="GtkTreeView" id="icon_theme_view">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="model">icon_theme_store</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="install_icon_theme">
+                        <property name="label" translatable="yes">Install</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="image">image2</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="remove_icon_theme">
+                        <property name="label" translatable="yes">Remove</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="image">image3</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkVBox" id="vbox2">
+                    <property name="visible">True</property>
+                    <property name="spacing">18</property>
+                    <child>
+                      <object class="GtkVBox" id="vbox4">
+                        <property name="visible">True</property>
+                        <child>
+                          <object class="GtkLabel" id="label6">
+                            <property name="visible">True</property>
+                            <property name="xalign">0</property>
+                            <property name="label" translatable="yes">Preview of the selected icon theme</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkScrolledWindow" id="scrolledwindow3">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hscrollbar_policy">automatic</property>
+                            <property name="vscrollbar_policy">automatic</property>
+                            <property name="shadow_type">etched-in</property>
+                            <child>
+                              <object class="GtkIconView" id="icon_demo_view">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="model">icon_demo_store</property>
+                                <child>
+                                  <object class="GtkCellRendererPixbuf" id="cellrenderertext3">
+                                    <property name="stock_size">6</property>
+                                  </object>
+                                  <attributes>
+                                    <attribute name="icon-name">0</attribute>
+                                  </attributes>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                          <packing>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkFrame" id="frame3">
+                        <property name="visible">True</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">none</property>
+                        <child>
+                          <object class="GtkAlignment" id="alignment1">
+                            <property name="visible">True</property>
+                            <property name="left_padding">12</property>
+                            <child>
+                              <object class="GtkTable" id="table1">
+                                <property name="visible">True</property>
+                                <property name="n_rows">3</property>
+                                <property name="n_columns">4</property>
+                                <property name="column_spacing">12</property>
+                                <property name="row_spacing">6</property>
+                                <child>
+                                  <object class="GtkLabel" id="label8">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Menu:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkSpinButton" id="spinbutton2">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">&#x25CF;</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label15">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Button:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label17">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Dialog:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">2</property>
+                                    <property name="bottom_attach">3</property>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkSpinButton" id="spinbutton3">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">&#x25CF;</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkSpinButton" id="spinbutton4">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">&#x25CF;</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                    <property name="top_attach">2</property>
+                                    <property name="bottom_attach">3</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label20">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Small Toolbar:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">2</property>
+                                    <property name="right_attach">3</property>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="label21">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Large Toolbar:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">2</property>
+                                    <property name="right_attach">3</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                    <property name="x_options">GTK_FILL</property>
+                                    <property name="y_options">GTK_FILL</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkSpinButton" id="spinbutton5">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">&#x25CF;</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">3</property>
+                                    <property name="right_attach">4</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkSpinButton" id="spinbutton6">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="invisible_char">&#x25CF;</property>
+                                  </object>
+                                  <packing>
+                                    <property name="left_attach">3</property>
+                                    <property name="right_attach">4</property>
+                                    <property name="top_attach">1</property>
+                                    <property name="bottom_attach">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                                <child>
+                                  <placeholder/>
+                                </child>
+                              </object>
+                            </child>
+                          </object>
+                        </child>
+                        <child type="label">
+                          <object class="GtkLabel" id="label3">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">&lt;b&gt;Icon Sizes&lt;/b&gt;</property>
+                            <property name="use_markup">True</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Icon</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkHBox" id="hbox7">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkVBox" id="vbox3">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkScrolledWindow" id="scrolledwindow4">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hscrollbar_policy">automatic</property>
+                        <property name="vscrollbar_policy">automatic</property>
+                        <property name="shadow_type">etched-in</property>
+                        <child>
+                          <object class="GtkTreeView" id="cursor_theme_view">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="model">cursor_theme_store</property>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="install_icon_theme1">
+                        <property name="label" translatable="yes">Install</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="image">image4</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="remove_icon_theme1">
+                        <property name="label" translatable="yes">Remove</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="image">image5</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkVBox" id="vbox11">
+                    <property name="visible">True</property>
+                    <child>
+                      <object class="GtkLabel" id="label7">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Preview of the selected icon theme</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkScrolledWindow" id="scrolledwindow5">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hscrollbar_policy">automatic</property>
+                        <property name="vscrollbar_policy">automatic</property>
+                        <property name="shadow_type">etched-in</property>
+                        <child>
+                          <object class="GtkIconView" id="cursor_demo_view">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="model">cursor_demo_store</property>
+                            <child>
+                              <object class="GtkCellRendererPixbuf" id="cellrenderertext4">
+                                <property name="stock_size">6</property>
+                              </object>
+                              <attributes>
+                                <attribute name="icon-name">0</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <placeholder/>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label5">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Mouse Cursor</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox8">
+                <property name="visible">True</property>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">4</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label10">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Window Border</property>
+              </object>
+              <packing>
+                <property name="position">4</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkVBox" id="vbox1">
+                <property name="visible">True</property>
+                <property name="border_width">12</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkHBox" id="hbox5">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkLabel" id="label19">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Toolbar Style: </property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="tb_style">
+                        <property name="visible">True</property>
+                        <property name="model">tb_style_store</property>
+                        <child>
+                          <object class="GtkCellRendererText" id="cellrenderertext2"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">5</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label4">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Other</property>
+              </object>
+              <packing>
+                <property name="position">5</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="about">
+                <property name="label">gtk-about</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+                <property name="secondary">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="apply">
+                <property name="label">gtk-apply</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="close">
+                <property name="label">gtk-close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">about</action-widget>
+      <action-widget response="-5">apply</action-widget>
+      <action-widget response="-6">close</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkImage" id="image2">
+    <property name="visible">True</property>
+    <property name="stock">gtk-add</property>
+  </object>
+  <object class="GtkImage" id="image3">
+    <property name="visible">True</property>
+    <property name="stock">gtk-remove</property>
+  </object>
+  <object class="GtkImage" id="image4">
+    <property name="visible">True</property>
+    <property name="stock">gtk-add</property>
+  </object>
+  <object class="GtkImage" id="image5">
+    <property name="visible">True</property>
+    <property name="stock">gtk-remove</property>
+  </object>
+</interface>
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644 (file)
index 0000000..cc8a222
--- /dev/null
@@ -0,0 +1,217 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 2004-2008 Rodney Dawes <dobey.pwns@gmail.com>
+#
+# This file may be copied and used freely without restrictions.  It may
+# be used in projects which are not available under a GNU Public License,
+# but which still want to provide support for the GNU gettext functionality.
+#
+# - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE
+#   instead of PACKAGE and to look for po2tbl in ./ not in intl/
+#
+# - Modified by jacob berkman <jacob@ximian.com> to install
+#   Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey.pwns@gmail.com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
+
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+datarootdir = @datarootdir@
+libdir = @libdir@
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po
+install_sh = @install_sh@
+# Automake >= 1.8 provides @mkdir_p@.
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
+
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; else echo "$(ALL_LINGUAS)"; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep \^$$lang$$ $(srcdir)/LINGUAS 2>/dev/null`" -o -n "`echo $$ALINGUAS|tr ' ' '\n'|grep \^$$lang$$`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)" -o -n "$(LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
+
+POTFILES = \
+# This comment gets stripped out
+
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+
+.SUFFIXES:
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
+
+.po.pox:
+       $(MAKE) $(GETTEXT_PACKAGE).pot
+       $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
+
+.po.mo:
+       $(MSGFMT) -o $@ $<
+
+.po.gmo:
+       file=`echo $* | sed 's,.*/,,'`.gmo \
+         && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+       sed -f ../intl/po2msg.sed < $< > $*.msg \
+         && rm -f $@ && gencat $@ $*.msg
+
+
+all: all-@USE_NLS@
+
+all-yes: $(CATALOGS)
+all-no:
+
+$(GETTEXT_PACKAGE).pot: $(POTFILES)
+       $(GENPOT)
+
+install: install-data
+install-data: install-data-@USE_NLS@
+install-data-no: all
+install-data-yes: all
+       linguas="$(USE_LINGUAS)"; \
+       for lang in $$linguas; do \
+         dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+         $(mkdir_p) $$dir; \
+         if test -r $$lang.gmo; then \
+           $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+           echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
+         else \
+           $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+           echo "installing $(srcdir)/$$lang.gmo as" \
+                "$$dir/$(GETTEXT_PACKAGE).mo"; \
+         fi; \
+         if test -r $$lang.gmo.m; then \
+           $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+           echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
+         else \
+           if test -r $(srcdir)/$$lang.gmo.m ; then \
+             $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+               $$dir/$(GETTEXT_PACKAGE).mo.m; \
+             echo "installing $(srcdir)/$$lang.gmo.m as" \
+                  "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
+           else \
+             true; \
+           fi; \
+         fi; \
+       done
+
+# Empty stubs to satisfy archaic automake needs
+dvi info ctags tags CTAGS TAGS ID:
+
+# Define this as empty until I found a useful application.
+install-exec installcheck:
+
+uninstall:
+       linguas="$(USE_LINGUAS)"; \
+       for lang in $$linguas; do \
+         rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+         rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+       done
+
+check: all $(GETTEXT_PACKAGE).pot
+       rm -f missing notexist
+       srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+       if [ -r missing -o -r notexist ]; then \
+         exit 1; \
+       fi
+
+mostlyclean:
+       rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
+       rm -f .intltool-merge-cache
+
+clean: mostlyclean
+
+distclean: clean
+       rm -f Makefile Makefile.in POTFILES stamp-it
+       rm -f *.mo *.msg *.cat *.cat.m *.gmo
+
+maintainer-clean: distclean
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
+       rm -f Makefile.in.in
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
+       dists="$(DISTFILES)"; \
+       extra_dists="$(EXTRA_DISTFILES)"; \
+       for file in $$extra_dists; do \
+         test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+       done; \
+       for file in $$dists; do \
+         test -f $$file || file="$(srcdir)/$$file"; \
+         ln $$file $(distdir) 2> /dev/null \
+           || cp -p $$file $(distdir); \
+       done
+
+update-po: Makefile
+       $(MAKE) $(GETTEXT_PACKAGE).pot
+       tmpdir=`pwd`; \
+       linguas="$(USE_LINGUAS)"; \
+       for lang in $$linguas; do \
+         echo "$$lang:"; \
+         result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
+         if $$result; then \
+           if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+             rm -f $$tmpdir/$$lang.new.po; \
+            else \
+             if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+               :; \
+             else \
+               echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+               rm -f $$tmpdir/$$lang.new.po; \
+               exit 1; \
+             fi; \
+           fi; \
+         else \
+           echo "msgmerge for $$lang.gmo failed!"; \
+           rm -f $$tmpdir/$$lang.new.po; \
+         fi; \
+       done
+
+Makefile POTFILES: stamp-it
+       @if test ! -f $@; then \
+         rm -f stamp-it; \
+         $(MAKE) stamp-it; \
+       fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+       cd $(top_builddir) \
+         && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
+              $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644 (file)
index 0000000..4c049b5
--- /dev/null
@@ -0,0 +1,5 @@
+# List of source files containing translatable strings.
+
+data/template.desktop.in
+data/ui/about.glade.in
+src/template.c
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
new file mode 100644 (file)
index 0000000..9686cfe
--- /dev/null
@@ -0,0 +1 @@
+# List of source files which should be skipped during translation
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..3fc2c3f
--- /dev/null
@@ -0,0 +1,38 @@
+NULL=
+
+AM_CPPFLAGS = \
+       -I$(srcdir) \
+       -DPACKAGE_DATA_DIR=\""$(datadir)/lxappearance2"\" \
+       -DPACKAGE_UI_DIR=\""$(datadir)/lxappearance2/ui"\" \
+       -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+       $(NULL)
+
+bin_PROGRAMS = lxappearance2
+lxappearance2_SOURCES = \
+       lxappearance2.c \
+       widget-theme.c \
+       widget-theme.h \
+       icon-theme.c \
+       icon-theme.h \
+       cursor-theme.c \
+       cursor-theme.h \
+       utils.c \
+       utils.h \
+       $(NULL)
+
+lxappearance2_CFLAGS = \
+       $(GTK_CFLAGS) \
+       -Werror-implicit-function-declaration \
+       $(NULL)
+
+lxappearance2_LDADD = \
+       $(GTK_LIBS) \
+       $(INTLLIBS) \
+       $(NULL)
+
+
+# Little program to optimize size of xml files
+noinst_PROGRAMS=xml-purge
+xml_purge_SOURCES=$(top_srcdir)/src/xml-purge.c
+xml_purge_CFLAGS=$(GTK_CFLAGS)
+xml_purge_LDADD=$(GTK_LIBS)
diff --git a/src/cursor-theme.c b/src/cursor-theme.c
new file mode 100644 (file)
index 0000000..5f56d29
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *      cursor-theme.c
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *      MA 02110-1301, USA.
+ */
+
+#include "cursor-theme.h"
+
+static GtkWidget* cursor_theme_view;
+
+void cursor_theme_init(GtkBuilder* b)
+{
+
+}
diff --git a/src/cursor-theme.h b/src/cursor-theme.h
new file mode 100644 (file)
index 0000000..5d5c567
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *      cursor-theme.h
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *      MA 02110-1301, USA.
+ */
+
+#ifndef _CURSOR_THEME_H_
+#define _CURSOR_THEME_H_
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+void cursor_theme_init(GtkBuilder* b);
+
+G_END_DECLS
+
+#endif
diff --git a/src/icon-theme.c b/src/icon-theme.c
new file mode 100644 (file)
index 0000000..c4b33da
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ *      icon-theme.c
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *      MA 02110-1301, USA.
+ */
+
+#include "icon-theme.h"
+
+static GtkWidget* icon_theme_view;
+
+void icon_theme_init(GtkBuilder* b)
+{
+    /* load icon themes */
+
+    /* load "gtk-icon-sizes" */
+    /*
+    gtk-menu,
+    gtk-button,
+    gtk-small-toolbar,
+    gtk-large-toolbar,
+    gtk-dnd,
+    gtk-dialog
+    */
+}
diff --git a/src/icon-theme.h b/src/icon-theme.h
new file mode 100644 (file)
index 0000000..0790aee
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *      icon-theme.h
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *      MA 02110-1301, USA.
+ */
+
+#ifndef _ICON_THEME_H_
+#define _ICON_THEME_H_
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+void icon_theme_init(GtkBuilder* b);
+
+G_END_DECLS
+
+#endif
diff --git a/src/lxappearance2.c b/src/lxappearance2.c
new file mode 100644 (file)
index 0000000..b6b9f03
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ *      lxappearance2.c
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *      MA 02110-1301, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include "widget-theme.h"
+#include "icon-theme.h"
+#include "cursor-theme.h"
+
+static GOptionEntry option_entries[] =
+{
+    { NULL }
+};
+
+int main(int argc, char** argv)
+{
+    GError* err = NULL;
+    GtkBuilder* b;
+    GtkWidget* win;
+
+    /* gettext support */
+#ifdef ENABLE_NLS
+    bindtextdomain ( GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR );
+    bind_textdomain_codeset ( GETTEXT_PACKAGE, "UTF-8" );
+    textdomain ( GETTEXT_PACKAGE );
+#endif
+
+    /* init threading support */
+    /*
+    g_thread_init(NULL);
+    gdk_threads_init();
+    */
+
+    /* initialize GTK+ and parse the command line arguments */
+    if( G_UNLIKELY( ! gtk_init_with_args( &argc, &argv, "", option_entries, GETTEXT_PACKAGE, &err ) ) )
+    {
+        g_print( "Error: %s\n", err->message );
+        return 1;
+    }
+
+    /* create GUI here */
+    b = gtk_builder_new();
+    if(!gtk_builder_add_from_file(b, PACKAGE_UI_DIR "/lxappearance.ui", NULL))
+        return 1;
+
+    widget_theme_init(b);
+    icon_theme_init(b);
+    cursor_theme_init(b);
+
+    win = gtk_builder_get_object(b, "dlg");
+
+    gtk_window_present(GTK_WINDOW(win));
+    g_object_unref(b);
+
+    gtk_main();
+
+    return 0;
+}
diff --git a/src/utils.c b/src/utils.c
new file mode 100644 (file)
index 0000000..5596ea7
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ *      utils.c
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *      MA 02110-1301, USA.
+ */
+
+#include "utils.h"
+
diff --git a/src/utils.h b/src/utils.h
new file mode 100644 (file)
index 0000000..10b1af9
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ *      utils.h
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *      MA 02110-1301, USA.
+ */
+
+#ifndef _UTILS_H_
+#define _UTILS_H_
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+
+G_END_DECLS
+
+#endif
diff --git a/src/widget-theme.c b/src/widget-theme.c
new file mode 100644 (file)
index 0000000..48b34d9
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ *      widget-theme.c
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *      MA 02110-1301, USA.
+ */
+
+#include "widget-theme.h"
+#include <string.h>
+
+static GtkWidget* widget_theme_view;
+static GtkListStore* store;
+
+static GSList* load_themes_in_dir(const char* theme_dir, GSList* themes)
+{
+    GDir* dir = g_dir_open(theme_dir, 0, NULL);
+    if(dir)
+    {
+        const char* name;
+        while(name = g_dir_read_name(dir))
+        {
+            /* test if we already have this in list */
+            if(!g_slist_find_custom(themes, name, (GCompareFunc)strcmp))
+            {
+                /* test if this is a gtk theme */
+                char* gtkrc = g_build_filename(theme_dir, name, "gtk-2.0/gtkrc", NULL);
+                if(g_file_test(gtkrc, G_FILE_TEST_EXISTS))
+                    themes = g_list_prepend(themes, g_strdup(name));
+                g_free(gtkrc);
+            }
+        }
+        g_dir_close(dir);
+    }
+    return themes;
+}
+
+static void on_sel_changed(GtkTreeSelection* sel, gpointer user_data)
+{
+    GtkTreeIter it;
+    GtkTreeModel* model;
+    if(gtk_tree_selection_get_selected(sel, &model, &it))
+    {
+        char* theme_name;
+        gtk_tree_model_get(model, &it, 0, &theme_name, -1);
+        g_object_set(gtk_settings_get_default(), "gtk-theme-name", theme_name, NULL);
+        g_free(theme_name);
+
+        /*
+        FIXME: check if current theme support color schemes.
+
+        char* color_scheme;
+        g_object_get(gtk_settings_get_default(), "gtk-color-scheme", &color_scheme, NULL);
+        g_debug("gtk-color-scheme:%s", color_scheme);
+        g_free(color_scheme);
+        */
+    }
+}
+
+static void load_themes()
+{
+    char* dir;
+    GSList* themes = NULL, *l;
+    GtkTreeViewColumn* col;
+    char* current;
+    GtkTreeIter sel_it = {0};
+    GtkTreeSelection* tree_sel;
+
+    g_object_get(gtk_settings_get_default(), "gtk-theme-name", &current, NULL);
+
+    /* load user dir */
+    dir = g_build_filename(g_get_home_dir(), ".themes", NULL);
+    themes = load_themes_in_dir(dir, themes);
+    g_free(dir);
+
+    /* load system default */
+    dir = gtk_rc_get_theme_dir();
+    themes = load_themes_in_dir(dir, themes);
+    g_free(dir);
+
+    col = gtk_tree_view_column_new_with_attributes("", gtk_cell_renderer_text_new(), "text", 0, NULL);
+    gtk_tree_view_append_column(widget_theme_view, col);
+
+    themes = g_slist_sort(themes, (GCompareFunc)strcmp);
+    for(l = themes; l; l=l->next)
+    {
+        GtkTreeIter it;
+        char* name = (char*)l->data;
+        gtk_list_store_insert_with_values(store, &it, -1, 0, name, -1);
+        /* if this theme is the one currently in use */
+        if(!sel_it.user_data)
+        {
+            if(strcmp(name, current) == 0)
+                sel_it = it;
+        }
+        g_free(name);
+    }
+    g_free(current);
+
+    gtk_tree_view_set_model(widget_theme_view, GTK_TREE_MODEL(store));
+    tree_sel = gtk_tree_view_get_selection(widget_theme_view);
+    if(sel_it.user_data)
+        gtk_tree_selection_select_iter(tree_sel, &sel_it);
+
+    g_list_free(themes);
+
+    g_signal_connect(tree_sel, "changed", G_CALLBACK(on_sel_changed), NULL);
+
+    /* FIXME: we need to handle this, too. */
+    // g_signal_connect(gtk_settings_get_default(), "notify::gtk-theme-name", G_CALLBACK(on_sel_changed), NULL);
+}
+
+void widget_theme_init(GtkBuilder* b)
+{
+    GtkWidget* demo;
+    GdkColor black = {0, 0, 0, 0};
+
+    demo = GTK_WIDGET(gtk_builder_get_object(b, "demo"));
+    widget_theme_view = GTK_WIDGET(gtk_builder_get_object(b, "widget_theme_view"));
+
+    gtk_widget_modify_bg(demo, GTK_STATE_NORMAL, &black);
+
+    /* load available themes */
+    store = gtk_list_store_new(1, G_TYPE_STRING);
+    load_themes();
+}
diff --git a/src/widget-theme.h b/src/widget-theme.h
new file mode 100644 (file)
index 0000000..561ccc1
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *      widget-theme.h
+ *
+ *      Copyright 2010 PCMan <pcman.tw@gmail.com>
+ *
+ *      This program is free software; you can redistribute it and/or modify
+ *      it under the terms of the GNU General Public License as published by
+ *      the Free Software Foundation; either version 2 of the License, or
+ *      (at your option) any later version.
+ *
+ *      This program is distributed in the hope that it will be useful,
+ *      but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *      GNU General Public License for more details.
+ *
+ *      You should have received a copy of the GNU General Public License
+ *      along with this program; if not, write to the Free Software
+ *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ *      MA 02110-1301, USA.
+ */
+
+#ifndef _WIDGET_THEME_H_
+#define _WIDGET_THEME_H_
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+void widget_theme_init(GtkBuilder* b);
+
+G_END_DECLS
+
+#endif
diff --git a/src/xml-purge.c b/src/xml-purge.c
new file mode 100644 (file)
index 0000000..9fc8525
--- /dev/null
@@ -0,0 +1,102 @@
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <glib.h>
+
+#define IS_BLANK(ch)   strchr(" \t\n\r", ch)
+
+static void purge_file( const char* file )
+{
+       char* buf, *pbuf;
+       int in_tag = 0, in_quote = 0;
+       FILE* fo;
+
+    if(!g_file_get_contents(file, &buf, NULL, NULL))
+        exit(1);
+
+       fo = fopen( file, "w" );
+       if( ! fo )
+               goto error;
+
+       for( pbuf = buf; *pbuf; ++pbuf )
+       {
+               if( in_tag > 0 )
+               {
+                       if( in_quote )
+                       {
+                               if( *pbuf == '\"' )
+                                       in_quote = 0;
+                       }
+                       else
+                       {
+                               if( *pbuf == '\"' )
+                                       ++in_quote;
+                               if( ! in_quote && IS_BLANK(*pbuf) )     /* skip unnecessary blanks */
+                               {
+                                       do{
+                                               ++pbuf;
+                                       }while( IS_BLANK( *pbuf ) );
+
+                                       if( *pbuf != '>' )
+                                               fputc( ' ', fo );
+                                       --pbuf;
+                                       continue;
+                               }
+                       }
+                       if( *pbuf == '>' )
+                               --in_tag;
+                       fputc( *pbuf, fo );
+               }
+               else
+               {
+                       if( *pbuf == '<' )
+                       {
+                               if( 0 == strncmp( pbuf, "<!--", 4 ) )   /* skip comments */
+                               {
+                                       pbuf = strstr( pbuf, "-->" );
+                                       if( ! pbuf )
+                                               goto error;
+                                       pbuf += 2;
+                                       continue;
+                               }
+                               ++in_tag;
+                               fputc( '<', fo );
+                       }
+                       else
+                       {
+                               char* tmp = pbuf;
+                               while( *tmp && IS_BLANK( *tmp ) && *tmp != '<' )
+                                       ++tmp;
+                               if( *tmp == '<' )       /* all cdata are blank characters */
+                                       pbuf = tmp - 1;
+                               else /* not blank, keep the cdata */
+                               {
+                                       if( tmp == pbuf )
+                                               fputc( *pbuf, fo );
+                                       else
+                                       {
+                                               fwrite( pbuf, 1, tmp - pbuf, fo );
+                                               pbuf = tmp - 1;
+                                       }
+                               }
+                       }
+               }
+       }
+       
+       fclose( fo );
+
+error:
+       free( buf );
+}
+
+int main( int argc, char** argv )
+{
+       int i;
+       if( argc < 2 )
+               return 1;
+
+       for( i = 1; i < argc; ++i )
+               purge_file( argv[ i] );
+
+       return 0;
+}