2 * vim:ts=4:sw=4:et:cindent:cino=(0
5 #include "maemo-tweaks-module.h"
6 #include "maemo-tweaks-desktop.h"
8 #include <hildon/hildon-picker-button.h>
10 GtkWidget * _build_snap_to_grid (void)
12 const gchar *options[] = {"Default", "Small grid", "Large grid", NULL};
14 GtkWidget *button, *selector;
16 selector = hildon_touch_selector_new_text ();
17 while (options[i] && options[i] != '\0')
19 hildon_touch_selector_append_text (HILDON_TOUCH_SELECTOR (selector),
23 button = hildon_picker_button_new (HILDON_SIZE_AUTO,
24 HILDON_BUTTON_ARRANGEMENT_VERTICAL);
26 hildon_button_set_title (HILDON_BUTTON (button),
27 "Snap desktop icons to grid");
29 hildon_picker_button_set_selector (HILDON_PICKER_BUTTON (button),
30 HILDON_TOUCH_SELECTOR (selector));
32 gtk_widget_show (button);
36 static void _build (MaemoTweaksModule *self)
40 static GtkWidget * _get_widget (MaemoTweaksModule *self)
45 static void module_interface_init (gpointer g_iface, gpointer iface_data)
47 MaemoTweaksModuleInterface *iface =
48 (MaemoTweaksModuleInterface *) g_iface;
50 iface->build = _build;
51 iface->get_widget = _get_widget;
54 GType maemo_tweaks_desktop_get_type (void)
56 static GType type = 0;
58 static const GTypeInfo info = {
59 sizeof (MaemoTweaksModuleInterface),
61 NULL, /* base_finalize */
62 NULL, /* class_init */
63 NULL, /* class_finalize */
64 NULL, /* class_data */
65 sizeof (MaemoTweaksDesktop),
67 NULL /* instance_init */
69 static const GInterfaceInfo maemo_tweaks_module_info = {
70 (GInterfaceInitFunc) module_interface_init, /* interface_init */
71 NULL, /* interface_finalize */
72 NULL /* interface_data */
74 type = g_type_register_static (G_TYPE_OBJECT,
75 "MaemoTweaksDesktopType",
77 g_type_add_interface_static (type,
78 MAEMO_TWEAKS_MODULE_TYPE,
79 &maemo_tweaks_module_info);