GtkToolItemGroup: Rename the name property. GtkToolPalette: Added class padding.

* gtk/gtktoolitemgroup.[h|c]: Rename the name property to item-group-name
and rename get/set_name() to get/set_item_group_name(), to avoid a clash with
GtkWidget::name.
* gtk/gtktoolpalette.h: GtkToolPaletteClass: Add padding for future use.
This commit is contained in:
Murray Cumming 2009-07-14 19:53:28 +02:00
parent ac7b0c91ae
commit fc226767eb
5 changed files with 41 additions and 23 deletions

View File

@ -4,6 +4,12 @@
* gtk/gtk-sections.txt:
2009-07-14 Murray Cumming <murrayc@murrayc.com>
reviewed by: <delete if not using a buddy>
* gtk/gtk-sections.txt:
2009-07-13 Murray Cumming <murrayc@murrayc.com>
reviewed by: <delete if not using a buddy>

View File

@ -4480,14 +4480,14 @@ gtk_tool_item_group_get_drop_item
gtk_tool_item_group_get_ellipsize
gtk_tool_item_group_get_item_position
gtk_tool_item_group_get_n_items
gtk_tool_item_group_get_name
gtk_tool_item_group_get_item_group_name
gtk_tool_item_group_get_nth_item
gtk_tool_item_group_insert
gtk_tool_item_group_new
gtk_tool_item_group_set_collapsed
gtk_tool_item_group_set_ellipsize
gtk_tool_item_group_set_item_position
gtk_tool_item_group_set_name
gtk_tool_item_group_set_item_group_name
<SUBSECTION Standard>
GtkToolItemGroupClass
GTK_TOOL_ITEM_GROUP

View File

@ -52,7 +52,7 @@
enum
{
PROP_NONE,
PROP_NAME,
PROP_ITEM_GROUP_NAME,
PROP_COLLAPSED,
PROP_ELLIPSIZE,
PROP_RELIEF
@ -431,8 +431,8 @@ gtk_tool_item_group_set_property (GObject *object,
switch (prop_id)
{
case PROP_NAME:
gtk_tool_item_group_set_name (group, g_value_get_string (value));
case PROP_ITEM_GROUP_NAME:
gtk_tool_item_group_set_item_group_name (group, g_value_get_string (value));
break;
case PROP_COLLAPSED:
@ -461,8 +461,8 @@ gtk_tool_item_group_get_property (GObject *object,
switch (prop_id)
{
case PROP_NAME:
g_value_set_string (value, gtk_tool_item_group_get_name (group));
case PROP_ITEM_GROUP_NAME:
g_value_set_string (value, gtk_tool_item_group_get_item_group_name (group));
break;
case PROP_COLLAPSED:
@ -539,7 +539,7 @@ gtk_tool_item_group_size_request (GtkWidget *widget,
GtkRequisition item_size;
gint requested_rows;
if (group->priv->children && gtk_tool_item_group_get_name (group))
if (group->priv->children && gtk_tool_item_group_get_item_group_name (group))
{
gtk_widget_size_request (group->priv->header, requisition);
gtk_widget_show (group->priv->header);
@ -1512,8 +1512,11 @@ gtk_tool_item_group_class_init (GtkToolItemGroupClass *cls)
cclass->set_child_property = gtk_tool_item_group_set_child_property;
cclass->get_child_property = gtk_tool_item_group_get_child_property;
g_object_class_install_property (oclass, PROP_NAME,
g_param_spec_string ("name",
/* Note that this property is not just called "name" because that would
* conflict with GtkWidget::"name".
*/
g_object_class_install_property (oclass, PROP_ITEM_GROUP_NAME,
g_param_spec_string ("item-group-name",
P_("Name"),
P_("The name of this item group"),
DEFAULT_NAME,
@ -1536,9 +1539,9 @@ gtk_tool_item_group_class_init (GtkToolItemGroupClass *cls)
G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
g_object_class_install_property (oclass, PROP_ELLIPSIZE,
g_object_class_install_property (oclass, PROP_RELIEF,
g_param_spec_enum ("header-relief",
P_("header-relif"),
P_("Header Relief"),
P_("Relief of the group header button"),
GTK_TYPE_RELIEF_STYLE, GTK_RELIEF_NORMAL,
G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
@ -1620,13 +1623,14 @@ gtk_tool_item_group_class_init (GtkToolItemGroupClass *cls)
* Since: 2.18
*/
GtkWidget*
gtk_tool_item_group_new (const gchar *name)
gtk_tool_item_group_new (const gchar *item_group_name)
{
return g_object_new (GTK_TYPE_TOOL_ITEM_GROUP, "name", name, NULL);
return g_object_new (GTK_TYPE_TOOL_ITEM_GROUP, "item-group-name",
item_group_name, NULL);
}
/**
* gtk_tool_item_group_set_name:
* gtk_tool_item_group_set_item_group_name:
* @group: an #GtkToolItemGroup.
* @name: the new name of of the group.
*
@ -1636,14 +1640,14 @@ gtk_tool_item_group_new (const gchar *name)
* Since: 2.18
*/
void
gtk_tool_item_group_set_name (GtkToolItemGroup *group,
gtk_tool_item_group_set_item_group_name (GtkToolItemGroup *group,
const gchar *name)
{
const gchar *current_name;
GtkWidget *label;
g_return_if_fail (GTK_IS_TOOL_ITEM_GROUP (group));
current_name = gtk_tool_item_group_get_name (group);
current_name = gtk_tool_item_group_get_item_group_name (group);
if (current_name != name && (!current_name || !name || strcmp (current_name, name)))
{
@ -1655,7 +1659,7 @@ gtk_tool_item_group_set_name (GtkToolItemGroup *group,
else
gtk_widget_hide (group->priv->header);
g_object_notify (G_OBJECT (group), "name");
g_object_notify (G_OBJECT (group), "item-group-name");
}
}
@ -1843,7 +1847,7 @@ gtk_tool_item_group_set_ellipsize (GtkToolItemGroup *group,
}
/**
* gtk_tool_item_group_get_name:
* gtk_tool_item_group_get_item_group_name:
* @group: an #GtkToolItemGroup.
*
* Gets the name of @group.
@ -1853,7 +1857,7 @@ gtk_tool_item_group_set_ellipsize (GtkToolItemGroup *group,
* Since: 2.18
*/
G_CONST_RETURN gchar*
gtk_tool_item_group_get_name (GtkToolItemGroup *group)
gtk_tool_item_group_get_item_group_name (GtkToolItemGroup *group)
{
GtkWidget *label;

View File

@ -55,9 +55,9 @@ struct _GtkToolItemGroupClass
};
GType gtk_tool_item_group_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_tool_item_group_new (const gchar *name);
GtkWidget* gtk_tool_item_group_new (const gchar *item_group_name);
void gtk_tool_item_group_set_name (GtkToolItemGroup *group,
void gtk_tool_item_group_set_item_group_name (GtkToolItemGroup *group,
const gchar *name);
void gtk_tool_item_group_set_collapsed (GtkToolItemGroup *group,
gboolean collapsed);
@ -66,7 +66,7 @@ void gtk_tool_item_group_set_ellipsize (GtkToolItemGroup
void gtk_tool_item_group_set_header_relief (GtkToolItemGroup *group,
GtkReliefStyle style);
G_CONST_RETURN gchar* gtk_tool_item_group_get_name (GtkToolItemGroup *group);
G_CONST_RETURN gchar* gtk_tool_item_group_get_item_group_name (GtkToolItemGroup *group);
gboolean gtk_tool_item_group_get_collapsed (GtkToolItemGroup *group);
PangoEllipsizeMode gtk_tool_item_group_get_ellipsize (GtkToolItemGroup *group);
GtkReliefStyle gtk_tool_item_group_get_header_relief (GtkToolItemGroup *group);

View File

@ -71,6 +71,14 @@ struct _GtkToolPaletteClass
void (*set_scroll_adjustments) (GtkWidget *widget,
GtkAdjustment *hadjustment,
GtkAdjustment *vadjustment);
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
void (*_gtk_reserved5) (void);
void (*_gtk_reserved6) (void);
};
GType gtk_tool_palette_get_type (void) G_GNUC_CONST;