[gnome-panel] libpanel-applet: use g_define_type_with_private
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel] libpanel-applet: use g_define_type_with_private
- Date: Thu, 6 Nov 2014 22:01:32 +0000 (UTC)
commit 330ce53f4abe5420e144497e7ccabcac8ccb5379
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Nov 6 18:40:59 2014 +0200
libpanel-applet: use g_define_type_with_private
libpanel-applet/panel-applet.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/libpanel-applet/panel-applet.c b/libpanel-applet/panel-applet.c
index 308a44e..2a41a97 100644
--- a/libpanel-applet/panel-applet.c
+++ b/libpanel-applet/panel-applet.c
@@ -74,8 +74,6 @@
* your binary.
*/
-#define PANEL_APPLET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PANEL_TYPE_APPLET,
PanelAppletPrivate))
-
struct _PanelAppletPrivate {
GtkWidget *plug;
GtkWidget *applet;
@@ -167,7 +165,7 @@ static const GActionEntry menu_entries[] = {
{ "move", panel_applet_menu_cmd_move, NULL, NULL, NULL }
};
-G_DEFINE_TYPE (PanelApplet, panel_applet, GTK_TYPE_EVENT_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (PanelApplet, panel_applet, GTK_TYPE_EVENT_BOX)
#define PANEL_APPLET_INTERFACE "org.gnome.panel.applet.Applet"
#define PANEL_APPLET_OBJECT_PATH "/org/gnome/panel/applet/%s/%d"
@@ -1808,7 +1806,7 @@ panel_applet_init (PanelApplet *applet)
{
GtkStyleContext *context;
- applet->priv = PANEL_APPLET_GET_PRIVATE (applet);
+ applet->priv = panel_applet_get_instance_private (applet);
applet->priv->flags = PANEL_APPLET_FLAGS_NONE;
applet->priv->orient = PANEL_APPLET_ORIENT_UP;
@@ -1881,8 +1879,6 @@ panel_applet_class_init (PanelAppletClass *klass)
widget_class->focus = panel_applet_focus;
widget_class->realize = panel_applet_realize;
- g_type_class_add_private (klass, sizeof (PanelAppletPrivate));
-
/**
* PanelApplet:out-of-process: (skip)
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]