GtkWidget *parent = gtk_widget_get_parent (GTK_WIDGET (shell));
if (GTK_IS_TOOL_PALETTE (parent))
- return gtk_tool_palette_get_orientation (GTK_TOOL_PALETTE (parent));
+ return gtk_orientable_get_orientation (GTK_ORIENTABLE (parent));
return GTK_ORIENTATION_VERTICAL;
}
if (GTK_IS_TOOL_PALETTE (parent))
{
- GtkOrientation orientation = gtk_tool_palette_get_orientation (GTK_TOOL_PALETTE (parent));
+ GtkOrientation orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (parent));
if (GTK_ORIENTATION_HORIZONTAL == orientation &&
(GTK_TOOLBAR_TEXT == gtk_tool_item_group_get_style (shell)/* ||
GTK_TOOLBAR_BOTH_HORIZ == gtk_tool_item_group_get_style (shell)*/))
{ "application/x-GTK-tool-palette-group", GTK_TARGET_SAME_APP, 0 },
};
-G_DEFINE_TYPE (GtkToolPalette,
+G_DEFINE_TYPE_WITH_CODE (GtkToolPalette,
gtk_tool_palette,
- GTK_TYPE_CONTAINER);
+ GTK_TYPE_CONTAINER,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL));
static void
gtk_tool_palette_init (GtkToolPalette *palette)
break;
case PROP_ORIENTATION:
- g_value_set_enum (value, gtk_tool_palette_get_orientation (palette));
+ g_value_set_enum (value, palette->priv->orientation);
break;
case PROP_TOOLBAR_STYLE:
G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
- g_object_class_install_property (oclass, PROP_ORIENTATION,
- g_param_spec_enum ("orientation",
- P_("Orientation"),
- P_("Orientation of the tool palette"),
- GTK_TYPE_ORIENTATION,
- DEFAULT_ORIENTATION,
- G_PARAM_READWRITE | G_PARAM_STATIC_NAME |
- G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB));
+ g_object_class_override_property (oclass, PROP_ORIENTATION,
+ "orientation");
g_object_class_install_property (oclass, PROP_TOOLBAR_STYLE,
g_param_spec_enum ("toolbar-style",
g_object_set (palette, "icon-size", icon_size, NULL);
}
-/**
- * gtk_tool_palette_set_orientation:
- * @palette: an #GtkToolPalette.
- * @orientation: the #GtkOrientation that the tool palette shall have.
- *
- * Sets the orientation (horizontal or vertical) of the tool palette.
- *
- * Since: 2.18
- */
-void
-gtk_tool_palette_set_orientation (GtkToolPalette *palette,
- GtkOrientation orientation)
-{
- g_return_if_fail (GTK_IS_TOOL_PALETTE (palette));
-
- if (orientation != palette->priv->orientation)
- g_object_set (palette, "orientation", orientation, NULL);
-}
-
/**
* gtk_tool_palette_set_style:
* @palette: an #GtkToolPalette.
return palette->priv->icon_size;
}
-/**
- * gtk_tool_palette_get_orientation:
- * @palette: an #GtkToolPalette.
- *
- * Gets the orientation (horizontal or vertical) of the tool palette. See gtk_tool_palette_set_orientation().
- *
- * Returns the #GtkOrientation of the tool palette.
- */
-GtkOrientation
-gtk_tool_palette_get_orientation (GtkToolPalette *palette)
-{
- g_return_val_if_fail (GTK_IS_TOOL_PALETTE (palette), DEFAULT_ORIENTATION);
- return palette->priv->orientation;
-}
-
/**
* gtk_tool_palette_get_style:
* @palette: an #GtkToolPalette.
void gtk_tool_palette_set_icon_size (GtkToolPalette *palette,
GtkIconSize icon_size);
-void gtk_tool_palette_set_orientation (GtkToolPalette *palette,
- GtkOrientation orientation);
void gtk_tool_palette_set_style (GtkToolPalette *palette,
GtkToolbarStyle style);
GtkIconSize gtk_tool_palette_get_icon_size (GtkToolPalette *palette);
-GtkOrientation gtk_tool_palette_get_orientation (GtkToolPalette *palette);
GtkToolbarStyle gtk_tool_palette_get_style (GtkToolPalette *palette);
GtkToolItem* gtk_tool_palette_get_drop_item (GtkToolPalette *palette,