From: salva Date: Sat, 5 Dec 2009 20:16:41 +0000 (+0200) Subject: Make -desktop a -module. X-Git-Tag: 0.0.1~1^2~38 X-Git-Url: http://git.maemo.org/git/?p=tweakr;a=commitdiff_plain;h=411ced49e906fe271320a08b71226cadb2cb57d3 Make -desktop a -module. --- diff --git a/maemo-tweaks-desktop.c b/maemo-tweaks-desktop.c index 7de99d9..a896a63 100644 --- a/maemo-tweaks-desktop.c +++ b/maemo-tweaks-desktop.c @@ -2,10 +2,12 @@ * 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) +GtkWidget * _build_snap_to_grid (void) { const gchar *options[] = {"Default", "Small grid", "Large grid", NULL}; gint i = 0; @@ -31,3 +33,44 @@ GtkWidget * maemo_tweaks_desktop_create_snap_to_grid (void) return button; } +static void _build (MaemoTweaksModule *self) +{ +} + +static void module_interface_init (gpointer g_iface, gpointer iface_data) +{ + MaemoTweaksModuleInterface *iface = + (MaemoTweaksModuleInterface *) g_iface; + iface->build = _build; +} + +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; +} + diff --git a/maemo-tweaks-desktop.h b/maemo-tweaks-desktop.h index 4a918ba..3e0f4f4 100644 --- a/maemo-tweaks-desktop.h +++ b/maemo-tweaks-desktop.h @@ -5,9 +5,41 @@ #ifndef __MAEMO_TWEAKS_DESKTOP_H__ #define __MAEMO_TWEAKS_DESKTOP_H__ +#include #include -GtkWidget * maemo_tweaks_desktop_create_snap_to_grid (void); +/* + * 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__ */