GtkToolPalette: Use GtkToolItemGroup* instead of GtkWidget* for setter parameters.

See Bug #567729
This commit is contained in:
Murray Cumming 2010-01-14 10:26:49 +01:00 committed by Tristan Van Berkom
parent 27f81d8918
commit 18b7ad4182
2 changed files with 30 additions and 26 deletions

View File

@ -798,11 +798,13 @@ gtk_tool_palette_set_child_property (GtkContainer *container,
switch (prop_id) switch (prop_id)
{ {
case CHILD_PROP_EXCLUSIVE: case CHILD_PROP_EXCLUSIVE:
gtk_tool_palette_set_exclusive (palette, child, g_value_get_boolean (value)); gtk_tool_palette_set_exclusive (palette, GTK_TOOL_ITEM_GROUP (child),
g_value_get_boolean (value));
break; break;
case CHILD_PROP_EXPAND: case CHILD_PROP_EXPAND:
gtk_tool_palette_set_expand (palette, child, g_value_get_boolean (value)); gtk_tool_palette_set_expand (palette, GTK_TOOL_ITEM_GROUP (child),
g_value_get_boolean (value));
break; break;
default: default:
@ -823,11 +825,13 @@ gtk_tool_palette_get_child_property (GtkContainer *container,
switch (prop_id) switch (prop_id)
{ {
case CHILD_PROP_EXCLUSIVE: case CHILD_PROP_EXCLUSIVE:
g_value_set_boolean (value, gtk_tool_palette_get_exclusive (palette, child)); g_value_set_boolean (value,
gtk_tool_palette_get_exclusive (palette, GTK_TOOL_ITEM_GROUP (child)));
break; break;
case CHILD_PROP_EXPAND: case CHILD_PROP_EXPAND:
g_value_set_boolean (value, gtk_tool_palette_get_expand (palette, child)); g_value_set_boolean (value,
gtk_tool_palette_get_expand (palette, GTK_TOOL_ITEM_GROUP (child)));
break; break;
default: default:
@ -1294,9 +1298,9 @@ _gtk_tool_palette_compare_groups (gconstpointer a,
* Since: 2.20 * Since: 2.20
*/ */
void void
gtk_tool_palette_set_group_position (GtkToolPalette *palette, gtk_tool_palette_set_group_position (GtkToolPalette *palette,
GtkWidget *group, GtkToolItemGroup *group,
gint position) gint position)
{ {
GtkToolItemGroupInfo *group_new; GtkToolItemGroupInfo *group_new;
GtkToolItemGroupInfo *group_old; GtkToolItemGroupInfo *group_old;
@ -1362,9 +1366,9 @@ gtk_tool_palette_group_notify_collapsed (GtkToolItemGroup *group,
* Since: 2.20 * Since: 2.20
*/ */
void void
gtk_tool_palette_set_exclusive (GtkToolPalette *palette, gtk_tool_palette_set_exclusive (GtkToolPalette *palette,
GtkWidget *group, GtkToolItemGroup *group,
gboolean exclusive) gboolean exclusive)
{ {
GtkToolItemGroupInfo *group_info; GtkToolItemGroupInfo *group_info;
gint position; gint position;
@ -1399,7 +1403,7 @@ gtk_tool_palette_set_exclusive (GtkToolPalette *palette,
} }
gtk_tool_palette_group_notify_collapsed (group_info->widget, NULL, palette); gtk_tool_palette_group_notify_collapsed (group_info->widget, NULL, palette);
gtk_widget_child_notify (group, "exclusive"); gtk_widget_child_notify (GTK_WIDGET (group), "exclusive");
} }
/** /**
@ -1413,8 +1417,8 @@ gtk_tool_palette_set_exclusive (GtkToolPalette *palette,
* Since: 2.20 * Since: 2.20
*/ */
void void
gtk_tool_palette_set_expand (GtkToolPalette *palette, gtk_tool_palette_set_expand (GtkToolPalette *palette,
GtkWidget *group, GtkToolItemGroup *group,
gboolean expand) gboolean expand)
{ {
GtkToolItemGroupInfo *group_info; GtkToolItemGroupInfo *group_info;
@ -1432,7 +1436,7 @@ gtk_tool_palette_set_expand (GtkToolPalette *palette,
{ {
group_info->expand = expand; group_info->expand = expand;
gtk_widget_queue_resize (GTK_WIDGET (palette)); gtk_widget_queue_resize (GTK_WIDGET (palette));
gtk_widget_child_notify (group, "expand"); gtk_widget_child_notify (GTK_WIDGET (group), "expand");
} }
} }
@ -1449,8 +1453,8 @@ gtk_tool_palette_set_expand (GtkToolPalette *palette,
* Since: 2.20 * Since: 2.20
*/ */
gint gint
gtk_tool_palette_get_group_position (GtkToolPalette *palette, gtk_tool_palette_get_group_position (GtkToolPalette *palette,
GtkWidget *group) GtkToolItemGroup *group)
{ {
guint i; guint i;
@ -1480,8 +1484,8 @@ gtk_tool_palette_get_group_position (GtkToolPalette *palette,
* Since: 2.20 * Since: 2.20
*/ */
gboolean gboolean
gtk_tool_palette_get_exclusive (GtkToolPalette *palette, gtk_tool_palette_get_exclusive (GtkToolPalette *palette,
GtkWidget *group) GtkToolItemGroup *group)
{ {
gint position; gint position;
GtkToolItemGroupInfo *info; GtkToolItemGroupInfo *info;
@ -1510,8 +1514,8 @@ gtk_tool_palette_get_exclusive (GtkToolPalette *palette,
* Since: 2.20 * Since: 2.20
*/ */
gboolean gboolean
gtk_tool_palette_get_expand (GtkToolPalette *palette, gtk_tool_palette_get_expand (GtkToolPalette *palette,
GtkWidget *group) GtkToolItemGroup *group)
{ {
gint position; gint position;
GtkToolItemGroupInfo *info; GtkToolItemGroupInfo *info;

View File

@ -89,21 +89,21 @@ GType gtk_tool_palette_get_type (void) G_G
GtkWidget* gtk_tool_palette_new (void); GtkWidget* gtk_tool_palette_new (void);
void gtk_tool_palette_set_group_position (GtkToolPalette *palette, void gtk_tool_palette_set_group_position (GtkToolPalette *palette,
GtkWidget *group, GtkToolItemGroup *group,
gint position); gint position);
void gtk_tool_palette_set_exclusive (GtkToolPalette *palette, void gtk_tool_palette_set_exclusive (GtkToolPalette *palette,
GtkWidget *group, GtkToolItemGroup *group,
gboolean exclusive); gboolean exclusive);
void gtk_tool_palette_set_expand (GtkToolPalette *palette, void gtk_tool_palette_set_expand (GtkToolPalette *palette,
GtkWidget *group, GtkToolItemGroup *group,
gboolean expand); gboolean expand);
gint gtk_tool_palette_get_group_position (GtkToolPalette *palette, gint gtk_tool_palette_get_group_position (GtkToolPalette *palette,
GtkWidget *group); GtkToolItemGroup *group);
gboolean gtk_tool_palette_get_exclusive (GtkToolPalette *palette, gboolean gtk_tool_palette_get_exclusive (GtkToolPalette *palette,
GtkWidget *group); GtkToolItemGroup *group);
gboolean gtk_tool_palette_get_expand (GtkToolPalette *palette, gboolean gtk_tool_palette_get_expand (GtkToolPalette *palette,
GtkWidget *group); GtkToolItemGroup *group);
void gtk_tool_palette_set_icon_size (GtkToolPalette *palette, void gtk_tool_palette_set_icon_size (GtkToolPalette *palette,
GtkIconSize icon_size); GtkIconSize icon_size);