AC_OUTPUT([
Makefile
+ libmaemo-tweaks-section/Makefile
+ libmaemo-tweaks-section/maemo-tweaks-section.pc
+ modules/Makefile
])
Build-Depends: debhelper (>= 4.1.0), cdbs, libgtk2.0-dev, libhildon1-dev, libosso-dev
Standards-Version: 3.6.0
-Package: libmaemo-tweaks0
+Package: maemo-tweaks
Architecture: any
Section: libs
Depends: ${shlibs:Depends}, ${misc:depends}
Description: Control panel applet for tweaking various settings
An applet that tweaks various settings otherwise hardly accessible.
+Package: libmaemo-tweaks-section-dev
+Architecture: any
+Section: devel
+Depends: ${shlibs:Depends}, ${misc:depends}
+Description: Library needed to write maemo-tweaks modules
+ Development symbols for maemo-tweaks
+
+Package: maemo-tweaks-modules
+Architecture: any
+Section: libs
+Depends: ${shlibs:Depends}, ${misc:depends}
+Description: maemo-tweaks core modules
+ Contains all the core modules for maemo-tweaks
+
--- /dev/null
+usr/lib/libmaemo-tweaks-section.so*
+usr/lib/libmaemo-tweaks-section.a
+usr/lib/pkgconfig/maemo-tweaks-section.pc
+usr/include/maemo-tweaks/*
+++ /dev/null
-usr/lib/hildon-control-panel/libmaemo-tweaks.so.*
--- /dev/null
+usr/lib/maemo-tweaks/modules/*.so*
--- /dev/null
+usr/lib/hildon-control-panel/*so.*
+usr/share/applications/hildon-control-panel/*.desktop
--- /dev/null
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ $(GTK_CFLAGS)
+
+lib_LTLIBRARIES = libmaemo-tweaks-section.la
+
+libmaemo_tweaks_section_la_SOURCES = \
+ maemo-tweaks-section.c \
+ maemo-tweaks-section.h \
+ maemo-tweaks-module.c \
+ maemo-tweaks-module.h
+
+libmaemo_tweaks_section_la_LIBADD = \
+ $(GTK_LIBS)
+
+libmaemo_tweaks_section_la_include_HEADERS = \
+ maemo-tweaks-section.h \
+ maemo-tweaks-module.h
+
+libmaemo_tweaks_section_la_includedir = $(includedir)/maemo-tweaks
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = maemo-tweaks-section.pc
+
--- /dev/null
+/*
+ * vim:ts=4:sw=4:et:cindent:cino=(0
+ */
+
+#include <config.h>
+#include <gmodule.h>
+
+#include "maemo-tweaks-module.h"
+
+
+enum
+{
+ PROP_0,
+ PROP_FILENAME
+};
+
+
+static void maemo_tweaks_module_finalize (GObject *object);
+static void maemo_tweaks_module_get_property (GObject *object,
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec);
+static void maemo_tweaks_module_set_property (GObject *object,
+ guint param_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static gboolean maemo_tweaks_module_load_module (GTypeModule *gmodule);
+static void maemo_tweaks_module_unload_module (GTypeModule *gmodule);
+
+
+G_DEFINE_TYPE (MaemoTweaksModule, maemo_tweaks_module, G_TYPE_TYPE_MODULE);
+
+
+static void
+maemo_tweaks_module_class_init (MaemoTweaksModuleClass *class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+ GTypeModuleClass *type_module_class = G_TYPE_MODULE_CLASS (class);
+
+ object_class->finalize = maemo_tweaks_module_finalize;
+ object_class->get_property = maemo_tweaks_module_get_property;
+ object_class->set_property = maemo_tweaks_module_set_property;
+
+ type_module_class->load = maemo_tweaks_module_load_module;
+ type_module_class->unload = maemo_tweaks_module_unload_module;
+
+ g_object_class_install_property
+ (object_class, PROP_FILENAME,
+ g_param_spec_string ("filename",
+ "Filename",
+ "The filaname of the module",
+ NULL,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY));
+}
+
+static void
+maemo_tweaks_module_init (MaemoTweaksModule *module)
+{
+ module->filename = NULL;
+ module->library = NULL;
+ module->load = NULL;
+ module->unload = NULL;
+}
+
+static void
+maemo_tweaks_module_finalize (GObject *object)
+{
+ MaemoTweaksModule *module = MAEMO_TWEAKS_MODULE (object);
+
+ g_free (module->filename);
+
+ G_OBJECT_CLASS (maemo_tweaks_module_parent_class)->finalize (object);
+}
+
+static void
+maemo_tweaks_module_get_property (GObject *object,
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ MaemoTweaksModule *module = MAEMO_TWEAKS_MODULE (object);
+
+ switch (param_id)
+ {
+ case PROP_FILENAME:
+ g_value_set_string (value, module->filename);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ }
+}
+
+static void
+maemo_tweaks_module_set_property (GObject *object,
+ guint param_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ MaemoTweaksModule *module = MAEMO_TWEAKS_MODULE (object);
+
+ switch (param_id)
+ {
+ case PROP_FILENAME:
+ g_free (module->filename);
+ module->filename = g_value_dup_string (value);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ }
+}
+
+static gboolean
+maemo_tweaks_module_load_module (GTypeModule *gmodule)
+{
+ MaemoTweaksModule *module = MAEMO_TWEAKS_MODULE (gmodule);
+
+ if (!module->filename)
+ {
+ g_warning ("Module path not set");
+ return FALSE;
+ }
+
+ module->library = g_module_open (module->filename, 0);
+
+ if (!module->library)
+ {
+ g_printerr ("%s\n", g_module_error ());
+ return FALSE;
+ }
+
+ /* Make sure that the loaded library contains the required methods */
+ if (! g_module_symbol (module->library,
+ "maemo_tweaks_module_load",
+ (gpointer) &module->load) ||
+ ! g_module_symbol (module->library,
+ "maemo_tweaks_module_unload",
+ (gpointer) &module->unload))
+ {
+ g_printerr ("%s\n", g_module_error ());
+ g_module_close (module->library);
+
+ return FALSE;
+ }
+
+ /* Initialize the loaded module */
+ module->load (module);
+
+ return TRUE;
+}
+
+static void
+maemo_tweaks_module_unload_module (GTypeModule *gmodule)
+{
+ MaemoTweaksModule *module = MAEMO_TWEAKS_MODULE (gmodule);
+
+ module->unload (module);
+
+ g_module_close (module->library);
+ module->library = NULL;
+
+ module->load = NULL;
+ module->unload = NULL;
+}
+
+MaemoTweaksModule *
+maemo_tweaks_module_new (const gchar *filename)
+{
+ MaemoTweaksModule *module;
+
+ g_return_val_if_fail (filename != NULL, NULL);
+
+ module = g_object_new (MAEMO_TWEAKS_TYPE_MODULE,
+ "filename", filename,
+ NULL);
+
+ return module;
+}
+
--- /dev/null
+/*
+ * vim:ts=4:sw=4:et:cindent:cino=(0
+ */
+
+#ifndef __MAEMO_TWEAKS_MODULE_H__
+#define __MAEMO_TWEAKS_MODULE_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+
+#define MAEMO_TWEAKS_TYPE_MODULE \
+ (maemo_tweaks_module_get_type ())
+#define MAEMO_TWEAKS_MODULE(o) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((o), MAEMO_TWEAKS_TYPE_MODULE, \
+ MaemoTweaksModule))
+#define MAEMO_TWEAKS_MODULE_CLASS(k) \
+ (G_TYPE_CHECK_CLASS_CAST((k), MAEMO_TWEAKS_TYPE_MODULE, \
+ MaemoTweaksModuleClass))
+#define MAEMO_TWEAKS_IS_MODULE(o) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAEMO_TWEAKS_TYPE_MODULE))
+#define MAEMO_TWEAKS_IS_MODULE_CLASS(k) \
+ (G_TYPE_CHECK_CLASS_TYPE ((k), MAEMO_TWEAKS_TYPE_MODULE))
+#define MAEMO_TWEAKS_MODULE_GET_CLASS(o) \
+ (G_TYPE_INSTANCE_GET_CLASS ((o), MAEMO_TWEAKS_TYPE_MODULE, \
+ MaemoTweaksModuleClass))
+
+typedef struct _MaemoTweaksModule MaemoTweaksModule;
+typedef struct _MaemoTweaksModuleClass MaemoTweaksModuleClass;
+
+struct _MaemoTweaksModule
+{
+ GTypeModule parent_instance;
+
+ gchar *filename;
+ GModule *library;
+
+ /* module symbols */
+ void (* load) (MaemoTweaksModule *module);
+ void (* unload) (MaemoTweaksModule *module);
+};
+
+struct _MaemoTweaksModuleClass
+{
+ GTypeModuleClass parent_class;
+};
+
+GType maemo_tweaks_module_get_type (void) G_GNUC_CONST;
+
+MaemoTweaksModule * maemo_tweaks_module_new (const gchar *filename);
+
+
+/* API for the modules to implement */
+
+void maemo_tweaks_module_load (MaemoTweaksModule *module);
+void maemo_tweaks_module_unload (MaemoTweaksModule *module);
+
+
+G_END_DECLS
+
+#endif /* __MAEMO_TWEAKS_MODULE_H_ */
--- /dev/null
+/*
+ * vim:ts=4:sw=4:et:cindent:cino=(0
+ */
+
+#include <config.h>
+#include <gtk/gtk.h>
+
+#include "maemo-tweaks-section.h"
+
+
+G_DEFINE_TYPE (MaemoTweaksSection, maemo_tweaks_section, G_TYPE_OBJECT);
+
+
+static void
+maemo_tweaks_section_class_init (MaemoTweaksSectionClass *class)
+{
+}
+
+static void
+maemo_tweaks_section_init (MaemoTweaksSection *section)
+{
+}
+
+MaemoTweaksSection *
+maemo_tweaks_section_new (GType type)
+{
+ g_return_val_if_fail (g_type_is_a (type, MAEMO_TWEAKS_TYPE_SECTION),
+ NULL);
+
+ return g_object_new (type, NULL);
+}
+
+void
+maemo_tweaks_section_build (MaemoTweaksSection *section)
+{
+ g_return_if_fail (MAEMO_TWEAKS_IS_SECTION (section));
+
+ if (MAEMO_TWEAKS_SECTION_GET_CLASS (section)->build)
+ MAEMO_TWEAKS_SECTION_GET_CLASS (section)->build (section);
+ else
+ g_warning ("%s: section class %s doesn't implement "
+ "MaemoTweaksSection::filter ()\n",
+ G_STRFUNC, g_type_name (G_TYPE_FROM_INSTANCE (section)));
+}
+
--- /dev/null
+/*
+ * vim:ts=4:sw=4:et:cindent:cino=(0
+ */
+
+#ifndef __MAEMO_TWEAKS_SECTION_H__
+#define __MAEMO_TWEAKS_SECTION_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+
+#define MAEMO_TWEAKS_TYPE_SECTION \
+ (maemo_tweaks_section_get_type ())
+#define MAEMO_TWEAKS_SECTION(o) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((o), MAEMO_TWEAKS_TYPE_SECTION, \
+ MaemoTweaksSection))
+#define MAEMO_TWEAKS_SECTION_CLASS(k) \
+ (G_TYPE_CHECK_CLASS_CAST((k), MAEMO_TWEAKS_TYPE_SECTION, \
+ MaemoTweaksSectionClass))
+#define MAEMO_TWEAKS_IS_SECTION(o) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAEMO_TWEAKS_TYPE_SECTION))
+#define MAEMO_TWEAKS_IS_SECTION_CLASS(k) \
+ (G_TYPE_CHECK_CLASS_TYPE ((k), MAEMO_TWEAKS_TYPE_SECTION))
+#define MAEMO_TWEAKS_SECTION_GET_CLASS(o) \
+ (G_TYPE_INSTANCE_GET_CLASS ((o), MAEMO_TWEAKS_TYPE_SECTION, \
+ MaemoTweaksSectionClass))
+
+
+typedef struct _MaemoTweaksSection MaemoTweaksSection;
+typedef struct _MaemoTweaksSectionClass MaemoTweaksSectionClass;
+
+struct _MaemoTweaksSection
+{
+ GObject parent_instance;
+};
+
+struct _MaemoTweaksSectionClass
+{
+ GObjectClass parent_class;
+
+ const gchar *name;
+
+ void (*build) (MaemoTweaksSection *section);
+};
+
+
+GType maemo_tweaks_section_get_type (void) G_GNUC_CONST;
+
+MaemoTweaksSection * maemo_tweaks_section_new (GType type);
+
+void maemo_tweaks_section_build (MaemoTweaksSection *section);
+
+G_END_DECLS
+
+#endif /* __MAEMO_TWEAKS_SECTION_H_ */
+
#include <hildon/hildon-picker-button.h>
-GtkWidget * _build_snap_to_grid (void)
-{
- const gchar *options[] = {"Default", "Small grid", "Large grid", NULL};
- gint i = 0;
- GtkWidget *button, *selector;
-
- selector = hildon_touch_selector_new_text ();
- while (options[i] && options[i] != '\0')
- {
- hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector),
- options [i++]);
- }
-
- button = hildon_picker_button_new (HILDON_SIZE_AUTO,
- HILDON_BUTTON_ARRANGEMENT_VERTICAL);
-
- hildon_button_set_title (HILDON_BUTTON (button),
- "Snap desktop icons to grid");
-
- hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
- HILDON_TOUCH_SELECTOR (selector));
-
- gtk_widget_show (button);
- return button;
-}
-
static void _build (MaemoTweaksModule *self)
{
}
+++ /dev/null
-/*
- * vim:ts=4:sw=4:et:cindent:cino=(0
- */
-
-#ifndef __MAEMO_TWEAKS_DESKTOP_H__
-#define __MAEMO_TWEAKS_DESKTOP_H__
-
-#include <glib-object.h>
-#include <gtk/gtk.h>
-
-/*
- * Type macros.
- */
-#define MAEMO_TWEAKS_TYPE_DESKTOP \
- (maemo_tweaks_desktop_get_type ())
-#define MAEMO_TWEAKS_DESKTOP(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAEMO_TWEAKS_TYPE_DESKTOP, \
- MaemoTweaksDesktop))
-#define MAEMO_TWEAKS_IS_DESKTOP(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAEMO_TWEAKS_TYPE_DESKTOP))
-#define MAEMO_TWEAKS_DESKTOP_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), MAEMO_TWEAKS_TYPE_DESKTOP,\
- MaemoTweaksDesktopClass))
-#define MAEMO_TWEAKS_IS_DESKTOP_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), MAEMO_TWEAKS_TYPE_DESKTOP))
-#define MAEMO_TWEAKS_DESKTOP_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), MAEMO_TWEAKS_TYPE_DESKTOP, \
- MaemoTweaksDesktopClass))
-
-typedef struct _MaemoTweaksDesktop MaemoTweaksDesktop;
-struct _MaemoTweaksDesktop
-{
- GObject parent_instance;
-};
-
-typedef struct _MaemoTweaksDesktopClass MaemoTweaksDesktopClass;
-struct _MaemoTweaksDesktopClass
-{
- GObjectClass parent_class;
-};
-
-GType maemo_tweaks_desktop_get_type (void);
-
-#endif /* __MAEMO_TWEAKS_DESKTOP_H__ */
-
+++ /dev/null
-/*
- * vim:ts=4:sw=4:et:cindent:cino=(0
- */
-
-#include "maemo-tweaks-gkeyfile-backend.h"
-
-G_DEFINE_TYPE (MaemoTweaksGKeyFileBackend, maemo_tweaks_gkeyfile_backend,
- G_TYPE_OBJECT);
-#define GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), MAEMO_TWEAKS_TYPE_GKEYFILE_BACKEND, \
- MaemoTweaksGKeyFileBackendPrivate))
-
-typedef struct _MaemoTweaksGKeyFileBackendPrivate
- MaemoTweaksGKeyFileBackendPrivate;
-struct _MaemoTweaksGKeyFileBackendPrivate
-{
- GKeyFile *kf; /* Own configuration */
-};
-typedef struct _MaemoTweaksGKeyFileBackendPrivate* P;
-
-static void maemo_tweaks_gkeyfile_backend_class_init
- (MaemoTweaksGKeyFileBackendClass *klass)
-{
- g_type_class_add_private (klass,
- sizeof (MaemoTweaksGKeyFileBackendPrivate));
-}
-
-static void maemo_tweaks_gkeyfile_backend_init
- (MaemoTweaksGKeyFileBackend *self)
-{
-#if 0
- P priv = GET_PRIVATE (self);
- priv->kf = g_key_file_new ();
- if (!g_key_file_load_from_file (priv->kf, MAEMO_TWEAKS_GKEYFILE,
- G_KEY_FILE_NONE, NULL))
- {
- goto error;
- }
-
- goto end;
-
-error:
- g_warning ("Error initializing the GKeyFile backend.");
-end:
- g_key_file_free (priv->kf);
-#endif
-}
-
+++ /dev/null
-/*
- * vim:ts=4:sw=4:et:cindent:cino=(0
- */
-
-#ifndef __GKEYFILE_BACKEND_H__
-#define __GKEYFILE_BACKEND_H__
-
-#include <glib-object.h>
-
-/*
- * Type macros.
- */
-#define MAEMO_TWEAKS_TYPE_GKEYFILE_BACKEND \
- (maemo_tweaks_gkeyfile_backend_get_type ())
-#define MAEMO_TWEAKS_GKEYFILE_BACKEND(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAEMO_TWEAKS_TYPE_GKEYFILE_BACKEND, \
- MaemoTweaksGKeyFileBackend))
-#define MAEMO_TWEAKS_IS_GKEYFILE_BACKEND(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAEMO_TWEAKS_TYPE_GKEYFILE_BACKEND))
-#define MAEMO_TWEAKS_GKEYFILE_BACKEND_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), MAEMO_TWEAKS_TYPE_GKEYFILE_BACKEND,\
- MaemoTweaksGKeyFileBackendClass))
-#define MAEMO_TWEAKS_IS_GKEYFILE_BACKEND_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), MAEMO_TWEAKS_TYPE_GKEYFILE_BACKEND))
-#define MAEMO_TWEAKS_GKEYFILE_BACKEND_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), MAEMO_TWEAKS_TYPE_GKEYFILE_BACKEND, \
- MaemoTweaksGKeyFileBackendClass))
-
-typedef struct _MaemoTweaksGKeyFileBackend MaemoTweaksGKeyFileBackend;
-struct _MaemoTweaksGKeyFileBackend
-{
- GObject parent_instance;
-};
-
-typedef struct _MaemoTweaksGKeyFileBackendClass MaemoTweaksGKeyFileBackendClass;
-struct _MaemoTweaksGKeyFileBackendClass
-{
- GObjectClass parent_class;
-};
-
-GType maemo_tweaks_gkeyfile_backend_get_type (void);
-
-#endif /* __GKEYFILE_BACKEND_H__ */
-
+++ /dev/null
-/*
- * vim:ts=4:sw=4:et:cindent:cino=(0
- */
-
-#include "maemo-tweaks-module.h"
-
-void maemo_tweaks_module_build (MaemoTweaksModule *self)
-{
- MAEMO_TWEAKS_MODULE_GET_INTERFACE (self)->build (self);
-}
-
-GtkWidget * maemo_tweaks_module_get_widget (MaemoTweaksModule *self)
-{
- return MAEMO_TWEAKS_MODULE_GET_INTERFACE (self)->get_widget (self);
-}
-
+++ /dev/null
-/*
- * vim:ts=4:sw=4:et:cindent:cino=(0
- */
-
-#ifndef __MAEMO_TWEAKS_MODULE_H__
-#define __MAEMO_TWEAKS_MODULE_H__
-
-#include <glib-object.h>
-#include <gtk/gtk.h>
-
-#define MAEMO_TWEAKS_MODULE_TYPE (maemo_tweaks_module_get_type ())
-#define MAEMO_TWEAKS_MODULE(o) \
- (G_TYPE_CHECK_INSTANCE_CAST ((o), MAEMO_TWEAKS_MODULE_TYPE, \
- MaemoTweaksModule))
-#define MAEMO_TWEAKS_IS_MODULE(o) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAEMO_TWEAKS_MODULE_TYPE))
-#define MAEMO_TWEAKS_MODULE_GET_INTERFACE(i) \
- (G_TYPE_INSTANCE_GET_INTERFACE ((i), MAEMO_TWEAKS_MODULE_TYPE, \
- MaemoTweaksModuleInterface))
-
-typedef struct _MaemoTweaksModule MaemoTweaksModule;
-typedef struct _MaemoTweaksModuleInterface MaemoTweaksModuleInterface;
-
-struct _MaemoTweaksModuleInterface
-{
- GTypeInterface parent;
-
- void (*build) (MaemoTweaksModule *self);
- GtkWidget * (*get_widget) (MaemoTweaksModule *self);
-};
-
-GType maemo_tweaks_module_get_type (void);
-
-void maemo_tweaks_module_build (MaemoTweaksModule *self);
-GtkWidget *maemo_tweaks_module_get_widget (MaemoTweaksModule *self);
-
-#endif
-
#include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
#include <gtk/gtk.h>
-#include "maemo-tweaks-desktop.h"
-
GtkWidget *create_dialog (GtkWindow *parent)
{
GtkWidget *dialog;
- GtkWidget *box;
dialog = gtk_dialog_new_with_buttons
("Maemo 5 Tweaks",
GTK_RESPONSE_CANCEL,
NULL);
- box = GTK_DIALOG (dialog)->vbox;
- gtk_box_pack_start (GTK_BOX (box),
- maemo_tweaks_desktop_create_snap_to_grid (),
- TRUE, TRUE, 0);
-
return dialog;
}
--- /dev/null
+libmaemo_tweaks_section = \
+ $(top_builddir)/libmaemo-tweaks-section/libmaemo-tweaks-section.la
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ $(GTK_CFLAGS) \
+ $(HILDON_CFLAGS)
+
+modulesdir = $(libdir)/maemo-tweaks/modules
+
+modules_LTLIBRARIES = libmaemo-tweaks-desktop.la
+
+libmaemo_tweaks_desktop_la_SOURCES = maemo-tweaks-desktop.c
+libmaemo_tweaks_desktop_la_LDFLAGS = -avoid-version -module
+libmaemo_tweaks_desktop_la_LIBADD = \
+ $(libmaemo_tweaks_section) \
+ $(GTK_LIBS) \
+ $(HILDON_LIBS)
+
--- /dev/null
+/*
+ * vim:ts=4:sw=4:et:cindent:cino=(0
+ */
+
+#include <config.h>
+
+#include <gtk/gtk.h>
+#include <hildon/hildon-picker-button.h>
+#include <hildon/hildon-touch-selector.h>
+
+#include "libmaemo-tweaks-section/maemo-tweaks-section.h"
+#include "libmaemo-tweaks-section/maemo-tweaks-module.h"
+
+
+#define MAEMO_TWEAKS_TYPE_DESKTOP_SECTION \
+ (maemo_tweaks_desktop_section_type)
+#define MAEMO_TWEAKS_DESKTOP_SECTION(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ MAEMO_TWEAKS_TYPE_DESKTOP_SECTION, \
+ MaemoTweaksDesktopSection))
+#define MAEMO_TWEAKS_DESKTOP_SECTION_CLASS(k) \
+ (G_TYPE_CHECK_CLASS_CAST((k), \
+ MAEMO_TWEAKS_TYPE_DESKTOP_SECTION, \
+ MaemoTweaksDesktopSectionClass))
+#define MAEMO_TWEAKS_IS_DESKTOP_SECTION(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ MAEMO_TWEAKS_TYPE_DESKTOP_SECTION))
+
+
+typedef struct _MaemoTweaksDesktopSection MaemoTweaksDesktopSection;
+typedef struct _MaemoTweaksDesktopSectionClass
+ MaemoTweaksDesktopSectionClass;
+
+struct _MaemoTweaksDesktopSection
+{
+ MaemoTweaksSection parent_instance;
+};
+
+struct _MaemoTweaksDesktopSectionClass
+{
+ MaemoTweaksSectionClass parent_class;
+};
+
+
+static GType maemo_tweaks_desktop_section_get_type (GTypeModule *module);
+static void maemo_tweaks_desktop_section_class_init
+ (MaemoTweaksDesktopSectionClass *class);
+static void maemo_tweaks_desktop_section_init
+ (MaemoTweaksDesktopSection *section);
+
+static void maemo_tweaks_desktop_section_build (MaemoTweaksSection *section);
+
+static GType maemo_tweaks_desktop_section_type = 0;
+static MaemoTweaksSectionClass *
+ maemo_tweaks_desktop_section_parent_class = NULL;
+
+
+G_MODULE_EXPORT void
+maemo_tweaks_module_load (MaemoTweaksModule *module)
+{
+ maemo_tweaks_desktop_section_get_type (G_TYPE_MODULE (module));
+}
+
+G_MODULE_EXPORT void
+maemo_tweaks_module_unload (MaemoTweaksModule *module)
+{
+}
+
+static GType
+maemo_tweaks_desktop_section_get_type (GTypeModule *module)
+{
+ if (!maemo_tweaks_desktop_section_type)
+ {
+ static const GTypeInfo section_info =
+ {
+ sizeof (MaemoTweaksDesktopSectionClass),
+ (GBaseInitFunc) NULL,
+ (GBaseFinalizeFunc) NULL,
+ (GClassInitFunc) maemo_tweaks_desktop_section_class_init,
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (MaemoTweaksDesktopSection),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) maemo_tweaks_desktop_section_init
+ };
+
+ maemo_tweaks_desktop_section_type =
+ g_type_module_register_type (module, MAEMO_TWEAKS_TYPE_SECTION,
+ "MaemoTweaksDesktopSection",
+ §ion_info, 0);
+ }
+
+ return maemo_tweaks_desktop_section_type;
+}
+
+static void
+maemo_tweaks_desktop_section_class_init
+ (MaemoTweaksDesktopSectionClass *klass)
+{
+ MaemoTweaksSectionClass *section_class =
+ MAEMO_TWEAKS_SECTION_CLASS (klass);
+
+ maemo_tweaks_desktop_section_parent_class =
+ g_type_class_peek_parent (klass);
+
+ section_class->name = "_Desktop";
+ section_class->build = maemo_tweaks_desktop_section_build;
+}
+
+static void
+maemo_tweaks_desktop_section_init (MaemoTweaksDesktopSection *section)
+{
+}
+
+GtkWidget * _build_snap_to_grid (void)
+{
+ const gchar *options[] = {"Default", "Small grid", "Large grid", NULL};
+ gint i = 0;
+ GtkWidget *button, *selector;
+
+ selector = hildon_touch_selector_new_text ();
+ while (options[i] && options[i] != '\0')
+ {
+ hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector),
+ options [i++]);
+ }
+
+ button = hildon_picker_button_new (HILDON_SIZE_AUTO,
+ HILDON_BUTTON_ARRANGEMENT_VERTICAL);
+
+ hildon_button_set_title (HILDON_BUTTON (button),
+ "Snap desktop icons to grid");
+
+ hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
+ HILDON_TOUCH_SELECTOR (selector));
+
+ gtk_widget_show (button);
+ return button;
+}
+
+static void
+maemo_tweaks_desktop_section_build (MaemoTweaksSection *section)
+{
+}
+