gpointing-device-settings r136 - in trunk: modules src test
- From: hiikezoe svn gnome org
- To: svn-commits-list gnome org
- Subject: gpointing-device-settings r136 - in trunk: modules src test
- Date: Fri, 6 Mar 2009 14:48:13 +0000 (UTC)
Author: hiikezoe
Date: Fri Mar 6 14:48:13 2009
New Revision: 136
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=136&view=rev
Log:
gpds_ui_new accepts now its propeties.
Modified:
trunk/modules/gpds-mouse-ui.c
trunk/modules/gpds-touchpad-ui.c
trunk/src/gpds-module-impl.h
trunk/src/gpds-module.c
trunk/src/gpds-module.h
trunk/src/gpds-ui.c
trunk/src/gpds-ui.h
trunk/src/gpointing-device-settings.c
trunk/test/test-ui.c
Modified: trunk/modules/gpds-mouse-ui.c
==============================================================================
--- trunk/modules/gpds-mouse-ui.c (original)
+++ trunk/modules/gpds-mouse-ui.c Fri Mar 6 14:48:13 2009
@@ -115,9 +115,9 @@
}
G_MODULE_EXPORT GObject *
-GPDS_MODULE_IMPL_INSTANTIATE (void)
+GPDS_MODULE_IMPL_INSTANTIATE (const gchar *first_property, va_list var_args)
{
- return g_object_new(GPDS_TYPE_MOUSE_UI, NULL);
+ return g_object_new_valist(GPDS_TYPE_MOUSE_UI, first_property, var_args);
}
static void
Modified: trunk/modules/gpds-touchpad-ui.c
==============================================================================
--- trunk/modules/gpds-touchpad-ui.c (original)
+++ trunk/modules/gpds-touchpad-ui.c Fri Mar 6 14:48:13 2009
@@ -114,9 +114,9 @@
}
G_MODULE_EXPORT GObject *
-GPDS_MODULE_IMPL_INSTANTIATE (void)
+GPDS_MODULE_IMPL_INSTANTIATE (const gchar *first_property, va_list var_args)
{
- return g_object_new(GPDS_TYPE_TOUCHPAD_UI, NULL);
+ return g_object_new_valist(GPDS_TYPE_TOUCHPAD_UI, first_property, var_args);
}
static void
Modified: trunk/src/gpds-module-impl.h
==============================================================================
--- trunk/src/gpds-module-impl.h (original)
+++ trunk/src/gpds-module-impl.h Fri Mar 6 14:48:13 2009
@@ -26,7 +26,7 @@
typedef void (*GpdsModuleInitFunc) (GTypeModule *module);
typedef void (*GpdsModuleExitFunc) (void);
-typedef GObject *(*GpdsModuleInstantiateFunc) (void);
+typedef GObject *(*GpdsModuleInstantiateFunc) (const gchar *first_property, ...);
#define GPDS_MODULE_IMPL_INIT gpds_module_impl_init
#define GPDS_MODULE_IMPL_EXIT gpds_module_impl_exit
@@ -34,12 +34,13 @@
void GPDS_MODULE_IMPL_INIT (GTypeModule *module);
void GPDS_MODULE_IMPL_EXIT (void);
-GObject *GPDS_MODULE_IMPL_INSTANTIATE (void);
+GObject *GPDS_MODULE_IMPL_INSTANTIATE (const gchar *first_property,
+ va_list var_args);
G_END_DECLS
#endif /* __GPDS_MODULE_IMPL_H__ */
/*
-vi:nowrap:ai:expandtab:sw=4
+vi:ts=4:nowrap:ai:expandtab:sw=4
*/
Modified: trunk/src/gpds-module.c
==============================================================================
--- trunk/src/gpds-module.c (original)
+++ trunk/src/gpds-module.c Fri Mar 6 14:48:13 2009
@@ -184,14 +184,15 @@
}
GObject *
-gpds_module_instantiate (GpdsModule *module)
+gpds_module_instantiate (GpdsModule *module,
+ const gchar *first_property, va_list var_args)
{
GObject *object = NULL;
GpdsModulePrivate *priv;
priv = GPDS_MODULE_GET_PRIVATE(module);
if (g_type_module_use(G_TYPE_MODULE(module))) {
- object = priv->instantiate();
+ object = priv->instantiate(first_property, var_args);
g_type_module_unuse(G_TYPE_MODULE(module));
}
Modified: trunk/src/gpds-module.h
==============================================================================
--- trunk/src/gpds-module.h (original)
+++ trunk/src/gpds-module.h Fri Mar 6 14:48:13 2009
@@ -57,8 +57,10 @@
GList *gpds_module_collect_names (GList *modules);
-GObject *gpds_module_instantiate (GpdsModule *module);
-void gpds_module_unload (GpdsModule *module);
+GObject *gpds_module_instantiate (GpdsModule *module,
+ const gchar *first_property,
+ va_list var_args);
+void gpds_module_unload (GpdsModule *module);
G_END_DECLS
Modified: trunk/src/gpds-ui.c
==============================================================================
--- trunk/src/gpds-ui.c (original)
+++ trunk/src/gpds-ui.c Fri Mar 6 14:48:13 2009
@@ -110,9 +110,11 @@
}
GpdsUI *
-gpds_ui_new (const gchar *name)
+gpds_ui_new (const gchar *name, const gchar *first_property, ...)
{
GpdsModule *module;
+ GObject *ui;
+ va_list var_args;
module = gpds_module_find(uis, name);
if (!module)
@@ -122,8 +124,11 @@
uis = g_list_prepend(uis, module);
}
+ va_start(var_args, first_property);
+ ui = gpds_module_instantiate(module, first_property, var_args);
+ va_end(var_args);
- return GPDS_UI(gpds_module_instantiate(module));
+ return GPDS_UI(ui);
}
gboolean
Modified: trunk/src/gpds-ui.h
==============================================================================
--- trunk/src/gpds-ui.h (original)
+++ trunk/src/gpds-ui.h Fri Mar 6 14:48:13 2009
@@ -64,7 +64,9 @@
GQuark gpds_ui_error_quark (void);
GType gpds_ui_get_type (void) G_GNUC_CONST;
-GpdsUI *gpds_ui_new (const gchar *name);
+GpdsUI *gpds_ui_new (const gchar *type_name,
+ const gchar *first_property,
+ ...);
gboolean gpds_ui_is_available (GpdsUI *ui, GError **error);
gboolean gpds_ui_build (GpdsUI *ui, GError **error);
GtkWidget *gpds_ui_get_content_widget (GpdsUI *ui, GError **error);
Modified: trunk/src/gpointing-device-settings.c
==============================================================================
--- trunk/src/gpointing-device-settings.c (original)
+++ trunk/src/gpointing-device-settings.c Fri Mar 6 14:48:13 2009
@@ -65,7 +65,7 @@
GtkWidget *label = NULL;
GError *error = NULL;
- ui = gpds_ui_new(name->data);
+ ui = gpds_ui_new(name->data, NULL);
uis = g_list_prepend(uis, ui);
if (!gpds_ui_is_available(ui, &error)) {
Modified: trunk/test/test-ui.c
==============================================================================
--- trunk/test/test-ui.c (original)
+++ trunk/test/test-ui.c Fri Mar 6 14:48:13 2009
@@ -59,7 +59,7 @@
void
test_new (void)
{
- ui = gpds_ui_new("touchpad");
+ ui = gpds_ui_new("touchpad", NULL);
cut_assert(ui);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]