[gedit] tab label: use g_object_class_install_properties
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] tab label: use g_object_class_install_properties
- Date: Sun, 13 Sep 2015 19:16:49 +0000 (UTC)
commit 0c0a73cb84ada128a7a740d8aa8256c85833528b
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Sep 13 20:32:25 2015 +0200
tab label: use g_object_class_install_properties
gedit/gedit-tab-label.c | 47 +++++++++++++++++++++++++----------------------
1 files changed, 25 insertions(+), 22 deletions(-)
---
diff --git a/gedit/gedit-tab-label.c b/gedit/gedit-tab-label.c
index 51f4b9d..d24b2e5 100644
--- a/gedit/gedit-tab-label.c
+++ b/gedit/gedit-tab-label.c
@@ -21,18 +21,6 @@
#include "gedit-tab-label.h"
#include "gedit-tab-private.h"
-enum
-{
- CLOSE_CLICKED,
- LAST_SIGNAL
-};
-
-enum
-{
- PROP_0,
- PROP_TAB
-};
-
struct _GeditTabLabel
{
GtkBox parent_instance;
@@ -45,7 +33,22 @@ struct _GeditTabLabel
GtkWidget *close_button;
};
-static guint signals[LAST_SIGNAL] = { 0 };
+enum
+{
+ PROP_0,
+ PROP_TAB,
+ LAST_PROP
+};
+
+static GParamSpec *properties[LAST_PROP];
+
+enum
+{
+ CLOSE_CLICKED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE (GeditTabLabel, gedit_tab_label, GTK_TYPE_BOX)
@@ -235,6 +238,15 @@ gedit_tab_label_class_init (GeditTabLabelClass *klass)
object_class->get_property = gedit_tab_label_get_property;
object_class->constructed = gedit_tab_label_constructed;
+ properties[PROP_TAB] =
+ g_param_spec_object ("tab",
+ "Tab",
+ "The GeditTab",
+ GEDIT_TYPE_TAB,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
+
+ g_object_class_install_properties (object_class, LAST_PROP, properties);
+
signals[CLOSE_CLICKED] =
g_signal_new_class_handler ("close-clicked",
G_TYPE_FROM_CLASS (klass),
@@ -244,15 +256,6 @@ gedit_tab_label_class_init (GeditTabLabelClass *klass)
G_TYPE_NONE,
0);
- g_object_class_install_property (object_class,
- PROP_TAB,
- g_param_spec_object ("tab",
- "Tab",
- "The GeditTab",
- GEDIT_TYPE_TAB,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY));
-
/* Bind class to template */
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/gedit/ui/gedit-tab-label.ui");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]