X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=maemo-tweaks-desktop.c;h=981e8d6f0103cd25c54ea0553a8f6d8d95bcf570;hb=ff8c6eeec768aff4a333dbe47337cf68bb8806da;hp=7de99d990c63c003411b2cb52b3f1be7071a1a5f;hpb=d05f7f1070643d5212645a2fe6c147eb2dbd3b8d;p=tweakr diff --git a/maemo-tweaks-desktop.c b/maemo-tweaks-desktop.c index 7de99d9..981e8d6 100644 --- a/maemo-tweaks-desktop.c +++ b/maemo-tweaks-desktop.c @@ -2,32 +2,56 @@ * vim:ts=4:sw=4:et:cindent:cino=(0 */ -#include +#include "maemo-tweaks-module.h" +#include "maemo-tweaks-desktop.h" + #include -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; }