2002-03-08 08:27:45 +08:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimpeditor.c
|
|
|
|
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "widgets-types.h"
|
|
|
|
|
2003-10-11 05:24:12 +08:00
|
|
|
#include "gimpdocked.h"
|
2002-03-08 08:27:45 +08:00
|
|
|
#include "gimpeditor.h"
|
|
|
|
#include "gimpdnd.h"
|
2004-04-18 23:12:42 +08:00
|
|
|
#include "gimpenumwidgets.h"
|
2003-03-21 19:47:37 +08:00
|
|
|
#include "gimpmenufactory.h"
|
2004-05-12 00:05:21 +08:00
|
|
|
#include "gimpuimanager.h"
|
2002-03-08 08:27:45 +08:00
|
|
|
|
|
|
|
|
2002-03-19 03:34:06 +08:00
|
|
|
#define DEFAULT_CONTENT_SPACING 2
|
|
|
|
#define DEFAULT_BUTTON_SPACING 2
|
2002-10-16 04:52:46 +08:00
|
|
|
#define DEFAULT_BUTTON_ICON_SIZE GTK_ICON_SIZE_MENU
|
2002-03-19 03:34:06 +08:00
|
|
|
|
|
|
|
|
2003-04-01 17:07:53 +08:00
|
|
|
static void gimp_editor_class_init (GimpEditorClass *klass);
|
2003-07-02 20:03:56 +08:00
|
|
|
static void gimp_editor_init (GimpEditor *editor);
|
2003-10-11 22:30:18 +08:00
|
|
|
static void gimp_editor_docked_iface_init (GimpDockedInterface *docked_iface);
|
2002-03-08 08:27:45 +08:00
|
|
|
|
2003-04-01 17:07:53 +08:00
|
|
|
static void gimp_editor_destroy (GtkObject *object);
|
|
|
|
static void gimp_editor_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *prev_style);
|
2003-07-02 20:03:56 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
static GimpUIManager * gimp_editor_get_menu (GimpDocked *docked,
|
|
|
|
const gchar **ui_path,
|
|
|
|
gpointer *popup_data);
|
2003-10-11 05:24:12 +08:00
|
|
|
|
2003-04-01 17:07:53 +08:00
|
|
|
static GtkIconSize gimp_editor_ensure_button_box (GimpEditor *editor);
|
2002-03-08 08:27:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
static GtkVBoxClass *parent_class = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
GType
|
|
|
|
gimp_editor_get_type (void)
|
|
|
|
{
|
|
|
|
static GType type = 0;
|
|
|
|
|
|
|
|
if (! type)
|
|
|
|
{
|
|
|
|
static const GTypeInfo info =
|
|
|
|
{
|
|
|
|
sizeof (GimpEditorClass),
|
|
|
|
NULL, /* base_init */
|
|
|
|
NULL, /* base_finalize */
|
|
|
|
(GClassInitFunc) gimp_editor_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpEditor),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_editor_init,
|
|
|
|
};
|
2003-10-11 05:24:12 +08:00
|
|
|
static const GInterfaceInfo docked_iface_info =
|
|
|
|
{
|
|
|
|
(GInterfaceInitFunc) gimp_editor_docked_iface_init,
|
|
|
|
NULL, /* iface_finalize */
|
|
|
|
NULL /* iface_data */
|
|
|
|
};
|
2002-03-08 08:27:45 +08:00
|
|
|
|
|
|
|
type = g_type_register_static (GTK_TYPE_VBOX,
|
|
|
|
"GimpEditor",
|
|
|
|
&info, 0);
|
2003-10-11 05:24:12 +08:00
|
|
|
|
|
|
|
g_type_add_interface_static (type, GIMP_TYPE_DOCKED,
|
|
|
|
&docked_iface_info);
|
2002-03-08 08:27:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_editor_class_init (GimpEditorClass *klass)
|
|
|
|
{
|
2003-03-21 19:47:37 +08:00
|
|
|
GtkObjectClass *object_class;
|
2002-03-08 08:27:45 +08:00
|
|
|
GtkWidgetClass *widget_class;
|
|
|
|
|
2003-03-21 19:47:37 +08:00
|
|
|
object_class = GTK_OBJECT_CLASS (klass);
|
2002-03-08 08:27:45 +08:00
|
|
|
widget_class = GTK_WIDGET_CLASS (klass);
|
|
|
|
|
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
2003-09-24 00:17:25 +08:00
|
|
|
object_class->destroy = gimp_editor_destroy;
|
2003-03-21 19:47:37 +08:00
|
|
|
|
2003-09-24 00:17:25 +08:00
|
|
|
widget_class->style_set = gimp_editor_style_set;
|
2002-03-08 08:27:45 +08:00
|
|
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
|
|
|
g_param_spec_int ("content_spacing",
|
|
|
|
NULL, NULL,
|
|
|
|
0,
|
|
|
|
G_MAXINT,
|
2002-03-19 03:34:06 +08:00
|
|
|
DEFAULT_CONTENT_SPACING,
|
2002-03-08 08:27:45 +08:00
|
|
|
G_PARAM_READABLE));
|
|
|
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
|
|
|
g_param_spec_int ("button_spacing",
|
|
|
|
NULL, NULL,
|
|
|
|
0,
|
|
|
|
G_MAXINT,
|
2002-03-19 03:34:06 +08:00
|
|
|
DEFAULT_BUTTON_SPACING,
|
2002-03-08 08:27:45 +08:00
|
|
|
G_PARAM_READABLE));
|
2002-03-19 03:34:06 +08:00
|
|
|
|
|
|
|
gtk_widget_class_install_style_property (widget_class,
|
|
|
|
g_param_spec_enum ("button_icon_size",
|
|
|
|
NULL, NULL,
|
|
|
|
GTK_TYPE_ICON_SIZE,
|
|
|
|
DEFAULT_BUTTON_ICON_SIZE,
|
|
|
|
G_PARAM_READABLE));
|
2002-03-08 08:27:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_editor_init (GimpEditor *editor)
|
|
|
|
{
|
2004-04-29 20:52:29 +08:00
|
|
|
editor->menu_factory = NULL;
|
|
|
|
editor->ui_manager = NULL;
|
|
|
|
editor->ui_path = NULL;
|
|
|
|
editor->popup_data = NULL;
|
|
|
|
editor->button_box = NULL;
|
2003-03-21 19:47:37 +08:00
|
|
|
}
|
|
|
|
|
2003-10-11 05:24:12 +08:00
|
|
|
static void
|
2003-10-11 22:30:18 +08:00
|
|
|
gimp_editor_docked_iface_init (GimpDockedInterface *docked_iface)
|
2003-10-11 05:24:12 +08:00
|
|
|
{
|
|
|
|
docked_iface->get_menu = gimp_editor_get_menu;
|
|
|
|
}
|
|
|
|
|
2003-03-21 19:47:37 +08:00
|
|
|
static void
|
|
|
|
gimp_editor_destroy (GtkObject *object)
|
|
|
|
{
|
2004-04-22 00:33:17 +08:00
|
|
|
GimpEditor *editor = GIMP_EDITOR (object);
|
2003-03-21 19:47:37 +08:00
|
|
|
|
2004-04-22 00:33:17 +08:00
|
|
|
if (editor->ui_manager)
|
|
|
|
{
|
|
|
|
g_object_unref (editor->ui_manager);
|
|
|
|
editor->ui_manager = NULL;
|
|
|
|
}
|
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
if (editor->ui_path)
|
2004-04-23 01:14:22 +08:00
|
|
|
{
|
2004-04-29 20:52:29 +08:00
|
|
|
g_free (editor->ui_path);
|
|
|
|
editor->ui_path = NULL;
|
2004-04-23 01:14:22 +08:00
|
|
|
}
|
|
|
|
|
2003-03-21 19:47:37 +08:00
|
|
|
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
2002-03-08 08:27:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_editor_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *prev_style)
|
|
|
|
{
|
2003-11-12 08:21:58 +08:00
|
|
|
GimpEditor *editor = GIMP_EDITOR (widget);
|
2003-04-01 17:07:53 +08:00
|
|
|
gint content_spacing;
|
2002-03-08 08:27:45 +08:00
|
|
|
|
2003-11-12 08:21:58 +08:00
|
|
|
if (GTK_WIDGET_CLASS (parent_class)->style_set)
|
|
|
|
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
|
2002-03-08 08:27:45 +08:00
|
|
|
|
2003-11-12 08:21:58 +08:00
|
|
|
gtk_widget_style_get (widget, "content_spacing", &content_spacing, NULL);
|
2002-03-08 08:27:45 +08:00
|
|
|
|
|
|
|
gtk_box_set_spacing (GTK_BOX (widget), content_spacing);
|
|
|
|
|
|
|
|
if (editor->button_box)
|
2003-11-12 08:21:58 +08:00
|
|
|
gimp_editor_set_box_style (editor, GTK_BOX (editor->button_box));
|
2002-03-08 08:27:45 +08:00
|
|
|
}
|
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
static GimpUIManager *
|
|
|
|
gimp_editor_get_menu (GimpDocked *docked,
|
|
|
|
const gchar **ui_path,
|
|
|
|
gpointer *popup_data)
|
2003-10-11 05:24:12 +08:00
|
|
|
{
|
|
|
|
GimpEditor *editor = GIMP_EDITOR (docked);
|
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
*ui_path = editor->ui_path;
|
|
|
|
*popup_data = editor->popup_data;
|
2003-10-11 05:24:12 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
return editor->ui_manager;
|
2003-10-11 05:24:12 +08:00
|
|
|
}
|
|
|
|
|
2002-03-15 23:09:58 +08:00
|
|
|
GtkWidget *
|
|
|
|
gimp_editor_new (void)
|
|
|
|
{
|
|
|
|
GimpEditor *editor;
|
|
|
|
|
|
|
|
editor = g_object_new (GIMP_TYPE_EDITOR, NULL);
|
|
|
|
|
|
|
|
return GTK_WIDGET (editor);
|
|
|
|
}
|
|
|
|
|
2003-03-21 19:47:37 +08:00
|
|
|
void
|
|
|
|
gimp_editor_create_menu (GimpEditor *editor,
|
|
|
|
GimpMenuFactory *menu_factory,
|
|
|
|
const gchar *menu_identifier,
|
2004-04-29 20:52:29 +08:00
|
|
|
const gchar *ui_path,
|
2003-03-21 19:47:37 +08:00
|
|
|
gpointer callback_data)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GIMP_IS_EDITOR (editor));
|
|
|
|
g_return_if_fail (GIMP_IS_MENU_FACTORY (menu_factory));
|
|
|
|
g_return_if_fail (menu_identifier != NULL);
|
2004-04-29 20:52:29 +08:00
|
|
|
g_return_if_fail (ui_path != NULL);
|
2003-03-21 19:47:37 +08:00
|
|
|
|
|
|
|
editor->menu_factory = menu_factory;
|
2004-04-29 20:52:29 +08:00
|
|
|
|
2004-04-22 00:33:17 +08:00
|
|
|
if (editor->ui_manager)
|
|
|
|
g_object_unref (editor->ui_manager);
|
|
|
|
|
|
|
|
editor->ui_manager = gimp_menu_factory_manager_new (menu_factory,
|
|
|
|
menu_identifier,
|
|
|
|
callback_data,
|
|
|
|
FALSE);
|
2004-04-23 01:14:22 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
if (editor->ui_path)
|
|
|
|
g_free (editor->ui_path);
|
2004-04-23 01:14:22 +08:00
|
|
|
|
2004-04-29 20:52:29 +08:00
|
|
|
editor->ui_path = g_strdup (ui_path);
|
2004-04-23 01:14:22 +08:00
|
|
|
|
|
|
|
editor->popup_data = callback_data;
|
2003-03-21 19:47:37 +08:00
|
|
|
}
|
|
|
|
|
2002-03-08 08:27:45 +08:00
|
|
|
GtkWidget *
|
|
|
|
gimp_editor_add_button (GimpEditor *editor,
|
|
|
|
const gchar *stock_id,
|
|
|
|
const gchar *tooltip,
|
2003-08-24 21:52:51 +08:00
|
|
|
const gchar *help_id,
|
2002-03-08 08:27:45 +08:00
|
|
|
GCallback callback,
|
|
|
|
GCallback extended_callback,
|
|
|
|
gpointer callback_data)
|
|
|
|
{
|
2002-03-19 03:34:06 +08:00
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *image;
|
|
|
|
GtkIconSize button_icon_size;
|
2002-03-08 08:27:45 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
|
|
|
|
g_return_val_if_fail (stock_id != NULL, NULL);
|
|
|
|
|
2003-04-01 17:07:53 +08:00
|
|
|
button_icon_size = gimp_editor_ensure_button_box (editor);
|
2002-03-08 08:27:45 +08:00
|
|
|
|
|
|
|
button = gimp_button_new ();
|
|
|
|
gtk_box_pack_start (GTK_BOX (editor->button_box), button, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
2003-08-24 21:52:51 +08:00
|
|
|
if (tooltip || help_id)
|
|
|
|
gimp_help_set_help_data (button, tooltip, help_id);
|
2002-03-08 08:27:45 +08:00
|
|
|
|
|
|
|
if (callback)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (button, "clicked",
|
2002-03-08 08:27:45 +08:00
|
|
|
callback,
|
|
|
|
callback_data);
|
|
|
|
|
|
|
|
if (extended_callback)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (button, "extended_clicked",
|
2002-03-08 08:27:45 +08:00
|
|
|
extended_callback,
|
|
|
|
callback_data);
|
|
|
|
|
2002-03-19 03:34:06 +08:00
|
|
|
image = gtk_image_new_from_stock (stock_id, button_icon_size);
|
2002-03-08 08:27:45 +08:00
|
|
|
gtk_container_add (GTK_CONTAINER (button), image);
|
|
|
|
gtk_widget_show (image);
|
|
|
|
|
|
|
|
return button;
|
|
|
|
}
|
2003-03-31 20:09:09 +08:00
|
|
|
|
|
|
|
GtkWidget *
|
|
|
|
gimp_editor_add_stock_box (GimpEditor *editor,
|
|
|
|
GType enum_type,
|
|
|
|
const gchar *stock_prefix,
|
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data)
|
|
|
|
{
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *first_button;
|
|
|
|
GtkIconSize button_icon_size;
|
|
|
|
GList *children;
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
|
|
|
|
g_return_val_if_fail (g_type_is_a (enum_type, G_TYPE_ENUM), NULL);
|
|
|
|
g_return_val_if_fail (stock_prefix != NULL, NULL);
|
|
|
|
|
2003-04-01 17:07:53 +08:00
|
|
|
button_icon_size = gimp_editor_ensure_button_box (editor);
|
2003-03-31 20:09:09 +08:00
|
|
|
|
|
|
|
hbox = gimp_enum_stock_box_new (enum_type, stock_prefix, button_icon_size,
|
|
|
|
callback, callback_data,
|
|
|
|
&first_button);
|
|
|
|
|
|
|
|
children = gtk_container_get_children (GTK_CONTAINER (hbox));
|
|
|
|
|
|
|
|
for (list = children; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
GtkWidget *button = list->data;
|
|
|
|
|
|
|
|
g_object_ref (button);
|
|
|
|
|
|
|
|
gtk_container_remove (GTK_CONTAINER (hbox), button);
|
|
|
|
gtk_box_pack_start (GTK_BOX (editor->button_box), button,
|
|
|
|
TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
g_object_unref (button);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free (children);
|
2004-02-18 04:17:49 +08:00
|
|
|
|
|
|
|
gtk_object_sink (GTK_OBJECT (hbox));
|
2003-03-31 20:09:09 +08:00
|
|
|
|
|
|
|
return first_button;
|
|
|
|
}
|
2003-04-01 17:07:53 +08:00
|
|
|
|
2004-05-12 00:05:21 +08:00
|
|
|
GtkWidget *
|
|
|
|
gimp_editor_add_action_button (GimpEditor *editor,
|
|
|
|
const gchar *group_name,
|
|
|
|
const gchar *action_name)
|
|
|
|
{
|
|
|
|
GimpActionGroup *group;
|
|
|
|
GtkAction *action;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *old_child;
|
|
|
|
GtkWidget *image;
|
|
|
|
GtkIconSize button_icon_size;
|
|
|
|
gchar *stock_id;
|
|
|
|
gchar *tooltip;
|
|
|
|
const gchar *help_id;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
|
|
|
|
g_return_val_if_fail (action_name != NULL, NULL);
|
|
|
|
g_return_val_if_fail (editor->ui_manager != NULL, NULL);
|
|
|
|
|
|
|
|
group = gimp_ui_manager_get_action_group (editor->ui_manager, group_name);
|
|
|
|
|
|
|
|
g_return_val_if_fail (group != NULL, NULL);
|
|
|
|
|
|
|
|
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
|
|
|
|
action_name);
|
|
|
|
|
|
|
|
g_return_val_if_fail (action != NULL, NULL);
|
|
|
|
|
|
|
|
button_icon_size = gimp_editor_ensure_button_box (editor);
|
|
|
|
|
|
|
|
button = gimp_button_new ();
|
|
|
|
gtk_action_connect_proxy (action, button);
|
|
|
|
gtk_box_pack_start (GTK_BOX (editor->button_box), button, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
g_object_get (action,
|
|
|
|
"stock-id", &stock_id,
|
|
|
|
"tooltip", &tooltip,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
help_id = g_object_get_qdata (G_OBJECT (action), GIMP_HELP_ID);
|
|
|
|
|
|
|
|
if (tooltip || help_id)
|
|
|
|
gimp_help_set_help_data (button, tooltip, help_id);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
if (extended_callback)
|
|
|
|
g_signal_connect (button, "extended_clicked",
|
|
|
|
extended_callback,
|
|
|
|
callback_data);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
old_child = gtk_bin_get_child (GTK_BIN (button));
|
|
|
|
|
|
|
|
if (old_child)
|
|
|
|
gtk_container_remove (GTK_CONTAINER (button), old_child);
|
|
|
|
|
|
|
|
image = gtk_image_new_from_stock (stock_id, button_icon_size);
|
|
|
|
gtk_container_add (GTK_CONTAINER (button), image);
|
|
|
|
gtk_widget_show (image);
|
|
|
|
|
|
|
|
g_free (stock_id);
|
|
|
|
g_free (tooltip);
|
|
|
|
|
|
|
|
return button;
|
|
|
|
}
|
|
|
|
|
2003-11-12 08:21:58 +08:00
|
|
|
void
|
|
|
|
gimp_editor_set_box_style (GimpEditor *editor,
|
|
|
|
GtkBox *box)
|
|
|
|
{
|
|
|
|
GtkIconSize button_icon_size;
|
|
|
|
gint button_spacing;
|
|
|
|
GList *children;
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
g_return_if_fail (GIMP_IS_EDITOR (editor));
|
|
|
|
g_return_if_fail (GTK_IS_BOX (box));
|
|
|
|
|
|
|
|
gtk_widget_style_get (GTK_WIDGET (editor),
|
|
|
|
"button_icon_size", &button_icon_size,
|
|
|
|
"button_spacing", &button_spacing,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gtk_box_set_spacing (box, button_spacing);
|
|
|
|
|
|
|
|
children = gtk_container_get_children (GTK_CONTAINER (box));
|
|
|
|
|
|
|
|
for (list = children; list; list = g_list_next (list))
|
|
|
|
{
|
|
|
|
if (GTK_IS_BUTTON (list->data))
|
|
|
|
{
|
|
|
|
GtkWidget *child;
|
|
|
|
|
|
|
|
child = gtk_bin_get_child (GTK_BIN (list->data));
|
|
|
|
|
|
|
|
if (GTK_IS_IMAGE (child))
|
|
|
|
{
|
|
|
|
gchar *stock_id;
|
|
|
|
|
|
|
|
gtk_image_get_stock (GTK_IMAGE (child), &stock_id, NULL);
|
|
|
|
gtk_image_set_from_stock (GTK_IMAGE (child),
|
|
|
|
stock_id, button_icon_size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free (children);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* private functions */
|
|
|
|
|
2003-04-01 17:07:53 +08:00
|
|
|
static GtkIconSize
|
|
|
|
gimp_editor_ensure_button_box (GimpEditor *editor)
|
|
|
|
{
|
|
|
|
GtkIconSize button_icon_size;
|
|
|
|
gint button_spacing;
|
|
|
|
|
|
|
|
gtk_widget_style_get (GTK_WIDGET (editor),
|
|
|
|
"button_icon_size", &button_icon_size,
|
|
|
|
"button_spacing", &button_spacing,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (! editor->button_box)
|
|
|
|
{
|
|
|
|
editor->button_box = gtk_hbox_new (TRUE, button_spacing);
|
|
|
|
gtk_box_pack_end (GTK_BOX (editor), editor->button_box, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (editor->button_box);
|
|
|
|
}
|
|
|
|
|
|
|
|
return button_icon_size;
|
|
|
|
}
|