[libpeas] Update DemoWindow to use peas_engine_get_default()
- From: Steve Frécinaux <sfre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpeas] Update DemoWindow to use peas_engine_get_default()
- Date: Mon, 17 Jan 2011 13:34:29 +0000 (UTC)
commit 64e3e9bbfd5ff8380a993b28bfa69b042fc2a06f
Author: Garrett Regier <alias301 gmail com>
Date: Sun Jan 16 18:33:18 2011 -0800
Update DemoWindow to use peas_engine_get_default()
peas-demo/peas-demo-window.c | 41 +++++++++++++++--------------------------
peas-demo/peas-demo-window.h | 2 +-
peas-demo/peas-demo.c | 2 +-
3 files changed, 17 insertions(+), 28 deletions(-)
---
diff --git a/peas-demo/peas-demo-window.c b/peas-demo/peas-demo-window.c
index 35cc2cb..097a81b 100644
--- a/peas-demo/peas-demo-window.c
+++ b/peas-demo/peas-demo-window.c
@@ -28,20 +28,6 @@
G_DEFINE_TYPE (DemoWindow, demo_window, GTK_TYPE_WINDOW);
static void
-demo_window_init (DemoWindow *dw)
-{
- DemoWindowClass *klass = DEMO_WINDOW_GET_CLASS (dw);
- gchar *label;
-
- dw->box = gtk_vbox_new (TRUE, 6);
- gtk_container_add (GTK_CONTAINER (dw), dw->box);
-
- label = g_strdup_printf ("Peas Window %d", ++(klass->n_windows));
- gtk_window_set_title (GTK_WINDOW (dw), label);
- g_free (label);
-}
-
-static void
on_extension_added (PeasExtensionSet *set,
PeasPluginInfo *info,
PeasExtension *exten,
@@ -71,13 +57,21 @@ on_delete_event (GtkWidget *window,
}
static void
-demo_window_set_data (DemoWindow *dw,
- PeasEngine *engine)
+demo_window_init (DemoWindow *dw)
{
- dw->engine = engine;
- g_object_ref (dw->engine);
+ DemoWindowClass *klass = DEMO_WINDOW_GET_CLASS (dw);
+ gchar *label;
- dw->exten_set = peas_extension_set_new (engine, PEAS_TYPE_ACTIVATABLE,
+ dw->box = gtk_vbox_new (TRUE, 6);
+ gtk_container_add (GTK_CONTAINER (dw), dw->box);
+
+ label = g_strdup_printf ("Peas Window %d", ++(klass->n_windows));
+ gtk_window_set_title (GTK_WINDOW (dw), label);
+ g_free (label);
+
+ dw->engine = g_object_ref (peas_engine_get_default ());
+
+ dw->exten_set = peas_extension_set_new (dw->engine, PEAS_TYPE_ACTIVATABLE,
"object", dw,
NULL);
@@ -110,12 +104,7 @@ demo_window_class_init (DemoWindowClass *klass)
}
GtkWidget *
-demo_window_new (PeasEngine *engine)
+demo_window_new (void)
{
- DemoWindow *dw;
-
- dw = DEMO_WINDOW (g_object_new (DEMO_TYPE_WINDOW, NULL));
- demo_window_set_data (dw, engine);
-
- return GTK_WIDGET (dw);
+ return GTK_WIDGET (g_object_new (DEMO_TYPE_WINDOW, NULL));
}
diff --git a/peas-demo/peas-demo-window.h b/peas-demo/peas-demo-window.h
index a0d09ca..3b5fcfe 100644
--- a/peas-demo/peas-demo-window.h
+++ b/peas-demo/peas-demo-window.h
@@ -58,7 +58,7 @@ struct _DemoWindowClass
};
GType demo_window_get_type (void) G_GNUC_CONST;
-GtkWidget *demo_window_new (PeasEngine *engine);
+GtkWidget *demo_window_new (void);
G_END_DECLS
diff --git a/peas-demo/peas-demo.c b/peas-demo/peas-demo.c
index a97d91a..34d7e61 100644
--- a/peas-demo/peas-demo.c
+++ b/peas-demo/peas-demo.c
@@ -74,7 +74,7 @@ create_new_window (void)
{
GtkWidget *window;
- window = demo_window_new (peas_engine_get_default ());
+ window = demo_window_new ();
gtk_widget_show_all (window);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]