diff options
author | Javier Jardón <jjardon@gnome.org> | 2010-11-14 03:49:26 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2014-01-24 22:55:09 -0500 |
commit | 65ce9a523a13c9e6656cf4c3b015240c92fbceef (patch) | |
tree | 3ec5c4f0edcbb2f59ded23b66e946585b835b410 /gtk/gtkgrid.c | |
parent | a2637160e39400327999e481ae54b0ef4f25bcab (diff) | |
download | gtk+-65ce9a523a13c9e6656cf4c3b015240c92fbceef.tar.gz |
gtkgrid: Use g_object_class_install_properties() and g_object_notify_by_pspec()
https://bugzilla.gnome.org/show_bug.cgi?id=634793
Diffstat (limited to 'gtk/gtkgrid.c')
-rw-r--r-- | gtk/gtkgrid.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c index 23cbc5365d..1d14d02473 100644 --- a/gtk/gtkgrid.c +++ b/gtk/gtkgrid.c @@ -151,9 +151,12 @@ enum PROP_COLUMN_SPACING, PROP_ROW_HOMOGENEOUS, PROP_COLUMN_HOMOGENEOUS, - PROP_BASELINE_ROW + PROP_BASELINE_ROW, + N_PROPERTIES }; +static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, }; + enum { CHILD_PROP_0, @@ -1727,33 +1730,37 @@ gtk_grid_class_init (GtkGridClass *class) g_object_class_override_property (object_class, PROP_ORIENTATION, "orientation"); - g_object_class_install_property (object_class, PROP_ROW_SPACING, + obj_properties [PROP_ROW_SPACING] = g_param_spec_int ("row-spacing", P_("Row spacing"), P_("The amount of space between two consecutive rows"), 0, G_MAXINT16, 0, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE); - g_object_class_install_property (object_class, PROP_COLUMN_SPACING, + obj_properties [PROP_COLUMN_SPACING] = g_param_spec_int ("column-spacing", P_("Column spacing"), P_("The amount of space between two consecutive columns"), 0, G_MAXINT16, 0, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE); - g_object_class_install_property (object_class, PROP_ROW_HOMOGENEOUS, + obj_properties [PROP_ROW_HOMOGENEOUS] = g_param_spec_boolean ("row-homogeneous", P_("Row Homogeneous"), P_("If TRUE, the rows are all the same height"), FALSE, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE); - g_object_class_install_property (object_class, PROP_COLUMN_HOMOGENEOUS, + obj_properties [PROP_COLUMN_HOMOGENEOUS] = g_param_spec_boolean ("column-homogeneous", P_("Column Homogeneous"), P_("If TRUE, the columns are all the same width"), FALSE, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE); + + g_object_class_install_properties (object_class, + N_PROPERTIES, + obj_properties); g_object_class_install_property (object_class, PROP_BASELINE_ROW, g_param_spec_int ("baseline-row", @@ -2244,7 +2251,7 @@ gtk_grid_set_row_homogeneous (GtkGrid *grid, if (gtk_widget_get_visible (GTK_WIDGET (grid))) gtk_widget_queue_resize (GTK_WIDGET (grid)); - g_object_notify (G_OBJECT (grid), "row-homogeneous"); + g_object_notify_by_pspec (G_OBJECT (grid), obj_properties [PROP_ROW_HOMOGENEOUS]); } } @@ -2291,7 +2298,7 @@ gtk_grid_set_column_homogeneous (GtkGrid *grid, if (gtk_widget_get_visible (GTK_WIDGET (grid))) gtk_widget_queue_resize (GTK_WIDGET (grid)); - g_object_notify (G_OBJECT (grid), "column-homogeneous"); + g_object_notify_by_pspec (G_OBJECT (grid), obj_properties [PROP_COLUMN_HOMOGENEOUS]); } } @@ -2338,7 +2345,7 @@ gtk_grid_set_row_spacing (GtkGrid *grid, if (gtk_widget_get_visible (GTK_WIDGET (grid))) gtk_widget_queue_resize (GTK_WIDGET (grid)); - g_object_notify (G_OBJECT (grid), "row-spacing"); + g_object_notify_by_pspec (G_OBJECT (grid), obj_properties [PROP_ROW_SPACING]); } } @@ -2385,7 +2392,7 @@ gtk_grid_set_column_spacing (GtkGrid *grid, if (gtk_widget_get_visible (GTK_WIDGET (grid))) gtk_widget_queue_resize (GTK_WIDGET (grid)); - g_object_notify (G_OBJECT (grid), "column-spacing"); + g_object_notify_by_pspec (G_OBJECT (grid), obj_properties [PROP_COLUMN_SPACING]); } } |