Split the desktop code to new files.
authorsalva <salva@salva-desktop.(none)>
Sat, 5 Dec 2009 19:38:02 +0000 (21:38 +0200)
committersalva <salva@salva-desktop.(none)>
Sat, 5 Dec 2009 19:38:22 +0000 (21:38 +0200)
maemo-tweaks-desktop.c [new file with mode: 0644]
maemo-tweaks-desktop.h [new file with mode: 0644]
maemo-tweaks.c

diff --git a/maemo-tweaks-desktop.c b/maemo-tweaks-desktop.c
new file mode 100644 (file)
index 0000000..7de99d9
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * vim:ts=4:sw=4:et:cindent:cino=(0
+ */ 
+
+#include <gtk/gtk.h>
+#include <hildon/hildon-picker-button.h>
+
+GtkWidget * maemo_tweaks_desktop_create_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;
+}
+
diff --git a/maemo-tweaks-desktop.h b/maemo-tweaks-desktop.h
new file mode 100644 (file)
index 0000000..4a918ba
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * vim:ts=4:sw=4:et:cindent:cino=(0
+ */ 
+
+#ifndef __MAEMO_TWEAKS_DESKTOP_H__
+#define __MAEMO_TWEAKS_DESKTOP_H__
+
+#include <gtk/gtk.h>
+
+GtkWidget * maemo_tweaks_desktop_create_snap_to_grid (void);
+
+#endif /* __MAEMO_TWEAKS_DESKTOP_H__ */
+
index 8ad6505..58b2ea8 100644 (file)
@@ -4,33 +4,8 @@
 
 #include <hildon-cp-plugin/hildon-cp-plugin-interface.h>
 #include <gtk/gtk.h>
-#include <hildon/hildon-picker-button.h>
 
-GtkWidget * create_desktop_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;
-}
+#include "maemo-tweaks-desktop.h"
 
 GtkWidget *create_dialog (GtkWindow *parent)
 {
@@ -48,7 +23,8 @@ GtkWidget *create_dialog (GtkWindow *parent)
          NULL);
 
     box = GTK_DIALOG (dialog)->vbox;
-    gtk_box_pack_start (GTK_BOX (box), create_desktop_snap_to_grid (),
+    gtk_box_pack_start (GTK_BOX (box),
+                        maemo_tweaks_desktop_create_snap_to_grid (),
                         TRUE, TRUE, 0);
 
     return dialog;