[epiphany/wip/modern_gobject: 15/31] EphyDialog: Use g_object_class_install_properties
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/modern_gobject: 15/31] EphyDialog: Use g_object_class_install_properties
- Date: Wed, 16 Sep 2015 02:16:52 +0000 (UTC)
commit 2446f46420db1e7a95d14d089990fb3d91faca8d
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Tue Sep 15 19:58:51 2015 -0500
EphyDialog: Use g_object_class_install_properties
lib/ephy-dialog.c | 88 ++++++++++++++++++++++++++---------------------------
1 files changed, 43 insertions(+), 45 deletions(-)
---
diff --git a/lib/ephy-dialog.c b/lib/ephy-dialog.c
index 084c7a3..0ce639b 100644
--- a/lib/ephy-dialog.c
+++ b/lib/ephy-dialog.c
@@ -36,15 +36,6 @@
* A customized #GtkDialog for Epiphany.
*/
-enum
-{
- PROP_0,
- PROP_PARENT_WINDOW,
- PROP_PERSIST_POSITION,
- PROP_DEFAULT_WIDTH,
- PROP_DEFAULT_HEIGHT
-};
-
typedef struct
{
char *name;
@@ -66,6 +57,18 @@ G_DEFINE_TYPE_WITH_PRIVATE (EphyDialog, ephy_dialog, GTK_TYPE_DIALOG)
enum
{
+ PROP_0,
+ PROP_PARENT_WINDOW,
+ PROP_PERSIST_POSITION,
+ PROP_DEFAULT_WIDTH,
+ PROP_DEFAULT_HEIGHT,
+ LAST_PROP
+};
+
+static GParamSpec *obj_properties[LAST_PROP];
+
+enum
+{
CHANGED,
LAST_SIGNAL
};
@@ -423,7 +426,7 @@ ephy_dialog_set_parent (EphyDialog *dialog,
priv->parent = parent;
- g_object_notify (G_OBJECT (dialog), "parent-window");
+ g_object_notify_by_pspec (G_OBJECT (dialog), obj_properties[PROP_PARENT_WINDOW]);
}
static void
@@ -515,59 +518,54 @@ ephy_dialog_class_init (EphyDialogClass *klass)
*
* Dialog's parent window.
*/
- g_object_class_install_property (object_class,
- PROP_PARENT_WINDOW,
- g_param_spec_object ("parent-window",
- "Parent window",
- "Parent window",
- GTK_TYPE_WINDOW,
- G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+ obj_properties[PROP_PARENT_WINDOW] =
+ g_param_spec_object ("parent-window",
+ "Parent window",
+ "Parent window",
+ GTK_TYPE_WINDOW,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* EphyDialog:persist-position:
*
* If dialog position should be persistent.
*/
- g_object_class_install_property (object_class,
- PROP_PERSIST_POSITION,
- g_param_spec_boolean ("persist-position",
- "Persist position",
- "Persist dialog position",
- FALSE,
- G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
- G_PARAM_CONSTRUCT_ONLY));
+ obj_properties[PROP_PERSIST_POSITION] =
+ g_param_spec_boolean ("persist-position",
+ "Persist position",
+ "Persist dialog position",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
/**
* EphyDialog:default-width:
*
* The dialog default width.
*/
- g_object_class_install_property (object_class,
- PROP_DEFAULT_WIDTH,
- g_param_spec_int ("default-width",
- "Default width",
- "Default dialog width",
- -1,
- G_MAXINT,
- -1,
- G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
- G_PARAM_CONSTRUCT_ONLY));
+ obj_properties[PROP_DEFAULT_WIDTH] =
+ g_param_spec_int ("default-width",
+ "Default width",
+ "Default dialog width",
+ -1,
+ G_MAXINT,
+ -1,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
/**
* EphyDialog:default-height:
*
* The dialog default height.
*/
- g_object_class_install_property (object_class,
- PROP_DEFAULT_HEIGHT,
- g_param_spec_int ("default-height",
- "Default height",
- "Default dialog height",
- -1,
- G_MAXINT,
- -1,
- G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB |
- G_PARAM_CONSTRUCT_ONLY));
+ obj_properties[PROP_DEFAULT_HEIGHT] =
+ g_param_spec_int ("default-height",
+ "Default height",
+ "Default dialog height",
+ -1,
+ G_MAXINT,
+ -1,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+
+ g_object_class_install_properties (object_class, LAST_PROP, obj_properties);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]