Set setuid bit from debian/rules.
[tweakr] / maemo-tweaks-desktop.c
index 7de99d9..981e8d6 100644 (file)
@@ -2,32 +2,56 @@
  * vim:ts=4:sw=4:et:cindent:cino=(0
  */ 
 
-#include <gtk/gtk.h>
+#include "maemo-tweaks-module.h"
+#include "maemo-tweaks-desktop.h"
+
 #include <hildon/hildon-picker-button.h>
 
-GtkWidget * maemo_tweaks_desktop_create_snap_to_grid (void)
+static void _build (MaemoTweaksModule *self)
 {
-    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);
+static GtkWidget * _get_widget (MaemoTweaksModule *self)
+{
+    return NULL;
+}
 
-    hildon_button_set_title (HILDON_BUTTON (button),
-                             "Snap desktop icons to grid");
+static void module_interface_init (gpointer g_iface, gpointer iface_data)
+{
+    MaemoTweaksModuleInterface *iface =
+        (MaemoTweaksModuleInterface *) g_iface;
 
-    hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
-                                       HILDON_TOUCH_SELECTOR (selector));
+    iface->build = _build;
+    iface->get_widget = _get_widget;
+}
 
-    gtk_widget_show (button);
-    return button;
+GType maemo_tweaks_desktop_get_type (void)
+{
+    static GType type = 0;
+    if (type == 0) {
+        static const GTypeInfo info = {
+            sizeof (MaemoTweaksModuleInterface),
+            NULL,   /* base_init */
+            NULL,   /* base_finalize */
+            NULL,   /* class_init */
+            NULL,   /* class_finalize */
+            NULL,   /* class_data */
+            sizeof (MaemoTweaksDesktop),
+            0,      /* n_preallocs */
+            NULL    /* instance_init */
+        };
+        static const GInterfaceInfo maemo_tweaks_module_info = {
+            (GInterfaceInitFunc) module_interface_init, /* interface_init */
+            NULL,         /* interface_finalize */
+            NULL          /* interface_data */
+        };
+        type = g_type_register_static (G_TYPE_OBJECT,
+                                       "MaemoTweaksDesktopType",
+                                       &info, 0);
+        g_type_add_interface_static (type,
+                                     MAEMO_TWEAKS_MODULE_TYPE,
+                                     &maemo_tweaks_module_info);
+    }
+    return type;
 }