Commit 1bf84999 authored by Martin Nordholts's avatar Martin Nordholts

Move the Image Selection Menu to GimpDockWindow

Move the Image Selection Menu from GimpMenuDock to
GimpDockWindow. That is, if a dock window contains many docks then
they will share the same Image Selection Menu.

To do this we need to move around quite a bit of code. Move the
"context", "dialog-factory" and "ui-manager" properties from GimpDock
to GimpToolbox, GimpMenuDock doesn't need it any longer. Turn the
GimpDock getters for these properties into wrappers that go to the
GimpDockWindow properties. In some places, most notably GimpToolbox
construction, we use the GimpToolbox values of these properties, but
most of the time it works fine to just use the GimpDockWindow
properties. GimpDock::setup() and set/get_aux_info() have also been
moved to GimpDockWindow since the only aux info for docks was for the
image selection menu.

Also, we don't bother porting gimp_menu_dock_destroy() to
GimpDockWindow, but we leave the code around. If this is a problem, it
will show.
parent cb854e6a
......@@ -106,13 +106,13 @@ dock_actions_update (GimpActionGroup *group,
if (GIMP_IS_MENU_DOCK (dock))
{
GimpMenuDock *menu_dock = GIMP_MENU_DOCK (dock);
GimpDockWindow *dock_window = gimp_dock_window_from_dock (dock);
SET_VISIBLE ("dock-show-image-menu", TRUE);
SET_VISIBLE ("dock-auto-follow-active", TRUE);
SET_ACTIVE ("dock-show-image-menu", gimp_menu_dock_get_show_image_menu (menu_dock));
SET_ACTIVE ("dock-auto-follow-active", gimp_menu_dock_get_auto_follow_active (menu_dock));
SET_ACTIVE ("dock-show-image-menu", gimp_dock_window_get_show_image_menu (dock_window));
SET_ACTIVE ("dock-auto-follow-active", gimp_dock_window_get_auto_follow_active (dock_window));
}
else
{
......
......@@ -24,27 +24,22 @@
#include "actions-types.h"
#include "widgets/gimpdockwindow.h"
#include "widgets/gimpmenudock.h"
#include "widgets/gimpdockwindow.h"
#include "actions.h"
#include "dock-commands.h"
static GimpMenuDock *
dock_commands_get_menudock_from_widget (GtkWidget *widget)
static GimpDockWindow *
dock_commands_get_dock_window_from_widget (GtkWidget *widget)
{
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
GimpMenuDock *menu_dock = NULL;
GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
GimpDockWindow *dock_window = NULL;
if (GIMP_IS_DOCK_WINDOW (toplevel))
{
GimpDock *dock = gimp_dock_window_get_dock (GIMP_DOCK_WINDOW (toplevel));
if (GIMP_IS_MENU_DOCK (dock))
menu_dock = GIMP_MENU_DOCK (dock);
}
dock_window = GIMP_DOCK_WINDOW (toplevel);
return menu_dock;
return dock_window;
}
......@@ -54,16 +49,16 @@ void
dock_toggle_image_menu_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget = NULL;
GimpMenuDock *menu_dock = NULL;
GtkWidget *widget = NULL;
GimpDockWindow *dock_window = NULL;
return_if_no_widget (widget, data);
menu_dock = dock_commands_get_menudock_from_widget (widget);
dock_window = dock_commands_get_dock_window_from_widget (widget);
if (menu_dock)
if (dock_window)
{
gboolean active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
gimp_menu_dock_set_show_image_menu (menu_dock, active);
gimp_dock_window_set_show_image_menu (dock_window, active);
}
}
......@@ -71,15 +66,15 @@ void
dock_toggle_auto_cmd_callback (GtkAction *action,
gpointer data)
{
GtkWidget *widget = NULL;
GimpMenuDock *menu_dock = NULL;
GtkWidget *widget = NULL;
GimpDockWindow *dock_window = NULL;
return_if_no_widget (widget, data);
menu_dock = dock_commands_get_menudock_from_widget (widget);
dock_window = dock_commands_get_dock_window_from_widget (widget);
if (menu_dock)
if (dock_window)
{
gboolean active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
gimp_menu_dock_set_auto_follow_active (menu_dock, active);
gimp_dock_window_set_auto_follow_active (dock_window, active);
}
}
......@@ -248,9 +248,7 @@ dialogs_dock_new (GimpDialogFactory *factory,
GimpContext *context,
GimpUIManager *ui_manager)
{
return gimp_menu_dock_new (factory,
context->gimp->images,
context->gimp->displays);
return gimp_menu_dock_new ();
}
GtkWidget *
......
......@@ -34,6 +34,7 @@
#include "gimpdock.h"
#include "gimpdockable.h"
#include "gimpdockbook.h"
#include "gimpdockwindow.h"
#include "gimppanedbox.h"
#include "gimpuimanager.h"
#include "gimpwidgets-utils.h"
......@@ -44,14 +45,6 @@
#define DEFAULT_DOCK_FONT_SCALE PANGO_SCALE_SMALL
enum
{
PROP_0,
PROP_CONTEXT,
PROP_DIALOG_FACTORY,
PROP_UI_MANAGER
};
enum
{
BOOK_ADDED,
......@@ -64,10 +57,6 @@ enum
struct _GimpDockPrivate
{
GimpDialogFactory *dialog_factory;
GimpContext *context;
GimpUIManager *ui_manager;
GtkWidget *main_vbox;
GtkWidget *paned_vbox;
......@@ -77,14 +66,6 @@ struct _GimpDockPrivate
};
static void gimp_dock_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_dock_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_dock_style_set (GtkWidget *widget,
GtkStyle *prev_style);
......@@ -109,7 +90,6 @@ static guint dock_signals[LAST_SIGNAL] = { 0 };
static void
gimp_dock_class_init (GimpDockClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
......@@ -151,40 +131,16 @@ gimp_dock_class_init (GimpDockClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->set_property = gimp_dock_set_property;
object_class->get_property = gimp_dock_get_property;
gtk_object_class->destroy = gimp_dock_destroy;
widget_class->style_set = gimp_dock_style_set;
klass->setup = NULL;
klass->set_host_geometry_hints = NULL;
klass->book_added = gimp_dock_real_book_added;
klass->book_removed = gimp_dock_real_book_removed;
klass->title_invalidated = NULL;
klass->geometry_invalidated = NULL;
g_object_class_install_property (object_class, PROP_CONTEXT,
g_param_spec_object ("context", NULL, NULL,
GIMP_TYPE_CONTEXT,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_DIALOG_FACTORY,
g_param_spec_object ("dialog-factory",
NULL, NULL,
GIMP_TYPE_DIALOG_FACTORY,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (object_class, PROP_UI_MANAGER,
g_param_spec_object ("ui-manager",
NULL, NULL,
GIMP_TYPE_UI_MANAGER,
GIMP_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_double ("font-scale",
NULL, NULL,
......@@ -205,8 +161,6 @@ gimp_dock_init (GimpDock *dock)
dock->p = G_TYPE_INSTANCE_GET_PRIVATE (dock,
GIMP_TYPE_DOCK,
GimpDockPrivate);
dock->p->context = NULL;
dock->p->dialog_factory = NULL;
dock->p->ID = dock_ID++;
name = g_strdup_printf ("gimp-internal-dock-%d", dock->p->ID);
......@@ -225,62 +179,6 @@ gimp_dock_init (GimpDock *dock)
gtk_widget_show (dock->p->paned_vbox);
}
static void
gimp_dock_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpDock *dock = GIMP_DOCK (object);
switch (property_id)
{
case PROP_CONTEXT:
dock->p->context = g_value_dup_object (value);
break;
case PROP_DIALOG_FACTORY:
dock->p->dialog_factory = g_value_get_object (value);
break;
case PROP_UI_MANAGER:
dock->p->ui_manager = g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_dock_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpDock *dock = GIMP_DOCK (object);
switch (property_id)
{
case PROP_CONTEXT:
g_value_set_object (value, dock->p->context);
break;
case PROP_DIALOG_FACTORY:
g_value_set_object (value, dock->p->dialog_factory);
break;
case PROP_UI_MANAGER:
g_value_set_object (value, dock->p->ui_manager);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_dock_style_set (GtkWidget *widget,
GtkStyle *prev_style)
......@@ -338,18 +236,6 @@ gimp_dock_destroy (GtkObject *object)
while (dock->p->dockbooks)
gimp_dock_remove_book (dock, GIMP_DOCKBOOK (dock->p->dockbooks->data));
if (dock->p->ui_manager)
{
g_object_unref (dock->p->ui_manager);
dock->p->ui_manager = NULL;
}
if (dock->p->context)
{
g_object_unref (dock->p->context);
dock->p->context = NULL;
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
......@@ -413,38 +299,6 @@ gimp_dock_dropped_cb (GtkWidget *source,
/* public functions */
void
gimp_dock_setup (GimpDock *dock,
const GimpDock *template)
{
g_return_if_fail (GIMP_IS_DOCK (dock));
g_return_if_fail (GIMP_IS_DOCK (template));
if (GIMP_DOCK_GET_CLASS (dock)->setup)
GIMP_DOCK_GET_CLASS (dock)->setup (dock, template);
}
void
gimp_dock_set_aux_info (GimpDock *dock,
GList *aux_info)
{
g_return_if_fail (GIMP_IS_DOCK (dock));
if (GIMP_DOCK_GET_CLASS (dock)->set_aux_info)
GIMP_DOCK_GET_CLASS (dock)->set_aux_info (dock, aux_info);
}
GList *
gimp_dock_get_aux_info (GimpDock *dock)
{
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
if (GIMP_DOCK_GET_CLASS (dock)->get_aux_info)
return GIMP_DOCK_GET_CLASS (dock)->get_aux_info (dock);
return NULL;
}
gchar *
gimp_dock_get_title (GimpDock *dock)
{
......@@ -499,28 +353,60 @@ gimp_dock_invalidate_geometry (GimpDock *dock)
g_signal_emit (dock, dock_signals[GEOMETRY_INVALIDATED], 0);
}
/**
* gimp_dock_get_context:
* @dock:
*
* Returns: The #GimpContext for the #GimpDockWindow the @dock is in.
**/
GimpContext *
gimp_dock_get_context (GimpDock *dock)
{
GimpDockWindow *dock_window = NULL;
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
return dock->p->context;
dock_window = gimp_dock_window_from_dock (dock);
return gimp_dock_window_get_context (dock_window);
}
/**
* gimp_dock_get_dialog_factory:
* @dock:
*
* Returns: The #GimpDialogFactory for the #GimpDockWindow the @dock
* is in.
**/
GimpDialogFactory *
gimp_dock_get_dialog_factory (GimpDock *dock)
{
GimpDockWindow *dock_window = NULL;
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
return dock->p->dialog_factory;
dock_window = gimp_dock_window_from_dock (dock);
return gimp_dock_window_get_dialog_factory (dock_window);
}
/**
* gimp_dock_get_ui_manager:
* @dock:
*
* Returns: The #GimpUIManager for the #GimpDockWindow the @dock is
* in.
**/
GimpUIManager *
gimp_dock_get_ui_manager (GimpDock *dock)
{
GimpDockWindow *dock_window = NULL;
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
return dock->p->ui_manager;
dock_window = gimp_dock_window_from_dock (dock);
return gimp_dock_window_get_ui_manager (dock_window);
}
GList *
......@@ -633,4 +519,3 @@ gimp_dock_remove_book (GimpDock *dock,
g_object_unref (dockbook);
}
......@@ -50,11 +50,6 @@ struct _GimpDockClass
GtkVBoxClass parent_class;
/* virtual functions */
void (* setup) (GimpDock *dock,
const GimpDock *template);
void (* set_aux_info) (GimpDock *dock,
GList *aux_info);
GList * (* get_aux_info) (GimpDock *dock);
gchar * (* get_title) (GimpDock *dock);
void (* set_host_geometry_hints) (GimpDock *dock,
GtkWindow *window);
......@@ -71,11 +66,6 @@ struct _GimpDockClass
GType gimp_dock_get_type (void) G_GNUC_CONST;
void gimp_dock_setup (GimpDock *dock,
const GimpDock *template);
void gimp_dock_set_aux_info (GimpDock *dock,
GList *aux_info);
GList * gimp_dock_get_aux_info (GimpDock *dock);
gchar * gimp_dock_get_title (GimpDock *dock);
void gimp_dock_invalidate_title (GimpDock *dock);
void gimp_dock_set_host_geometry_hints (GimpDock *dock,
......
......@@ -1075,21 +1075,23 @@ gimp_dockable_set_drag_handler (GimpDockable *dockable,
void
gimp_dockable_detach (GimpDockable *dockable)
{
GimpDock *src_dock = NULL;
GtkWidget *dock = NULL;
GtkWidget *dockbook = NULL;
GimpDockWindow *dock_window = NULL;
GimpDockWindow *src_dock_window = NULL;
GimpDock *src_dock = NULL;
GtkWidget *dock = NULL;
GimpDockWindow *dock_window = NULL;
GtkWidget *dockbook = NULL;
g_return_if_fail (GIMP_IS_DOCKABLE (dockable));
g_return_if_fail (GIMP_IS_DOCKBOOK (dockable->dockbook));
src_dock = gimp_dockbook_get_dock (dockable->dockbook);
src_dock_window = gimp_dock_window_from_dock (src_dock);
dock = gimp_dialog_factory_dock_with_window_new (gimp_dock_get_dialog_factory (src_dock),
gtk_widget_get_screen (GTK_WIDGET (dockable)));
dock_window = gimp_dock_window_from_dock (GIMP_DOCK (dock));
gtk_window_set_position (GTK_WINDOW (dock_window), GTK_WIN_POS_MOUSE);
gimp_dock_setup (GIMP_DOCK (dock), src_dock);
gimp_dock_window_setup (dock_window, src_dock_window);
dockbook = gimp_dockbook_new (gimp_dock_get_dialog_factory (GIMP_DOCK (dock))->menu_factory);
......
......@@ -134,9 +134,7 @@ gimp_dock_columns_dropped_cb (GtkWidget *source,
return FALSE;
/* Create and insert new dock into columns */
dock = gimp_menu_dock_new (global_dock_factory,
global_dock_factory->context->gimp->images,
global_dock_factory->context->gimp->displays);
dock = gimp_menu_dock_new ();
gimp_dock_columns_add_dock (dock_columns, GIMP_DOCK (dock), insert_index);
/* Put a now dockbook in the dock */
......
This diff is collapsed.
......@@ -55,18 +55,31 @@ struct _GimpDockWindowClass
};
GType gimp_dock_window_get_type (void) G_GNUC_CONST;
gint gimp_dock_window_get_id (GimpDockWindow *dock_window);
void gimp_dock_window_add_dock (GimpDockWindow *dock_window,
GimpDock *dock,
gint index);
void gimp_dock_window_remove_dock (GimpDockWindow *dock_window,
GimpDock *dock);
GimpUIManager * gimp_dock_window_get_ui_manager (GimpDockWindow *dock_window);
GList * gimp_dock_window_get_docks (GimpDockWindow *dock_window);
GimpDock * gimp_dock_window_get_dock (GimpDockWindow *dock_window);
GType gimp_dock_window_get_type (void) G_GNUC_CONST;
gint gimp_dock_window_get_id (GimpDockWindow *dock_window);
void gimp_dock_window_add_dock (GimpDockWindow *dock_window,
GimpDock *dock,
gint index);
void gimp_dock_window_remove_dock (GimpDockWindow *dock_window,
GimpDock *dock);
GimpUIManager * gimp_dock_window_get_ui_manager (GimpDockWindow *dock_window);
GimpContext * gimp_dock_window_get_context (GimpDockWindow *dock);
GimpDialogFactory * gimp_dock_window_get_dialog_factory (GimpDockWindow *dock);
GList * gimp_dock_window_get_docks (GimpDockWindow *dock_window);
GimpDock * gimp_dock_window_get_dock (GimpDockWindow *dock_window);
gboolean gimp_dock_window_get_auto_follow_active (GimpDockWindow *menu_dock);
void gimp_dock_window_set_auto_follow_active (GimpDockWindow *menu_dock,
gboolean show);
gboolean gimp_dock_window_get_show_image_menu (GimpDockWindow *menu_dock);
void gimp_dock_window_set_show_image_menu (GimpDockWindow *menu_dock,
gboolean show);
void gimp_dock_window_setup (GimpDockWindow *dock_window,
GimpDockWindow *template);
void gimp_dock_window_set_aux_info (GimpDockWindow *dock,
GList *aux_info);
GList * gimp_dock_window_get_aux_info (GimpDockWindow *dock);
GimpDockWindow * gimp_dock_window_from_dock (GimpDock *dock);
GimpDockWindow * gimp_dock_window_from_dock (GimpDock *dock);
#endif /* __GIMP_DOCK_WINDOW_H__ */
This diff is collapsed.
......@@ -50,16 +50,8 @@ struct _GimpMenuDockClass
GType gimp_menu_dock_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_menu_dock_new (GimpDialogFactory *dialog_factory,
GimpContainer *image_container,
GimpContainer *display_container);
GtkWidget * gimp_menu_dock_new (void);
gboolean gimp_menu_dock_get_auto_follow_active (GimpMenuDock *menu_dock);
void gimp_menu_dock_set_auto_follow_active (GimpMenuDock *menu_dock,
gboolean show);
gboolean gimp_menu_dock_get_show_image_menu (GimpMenuDock *menu_dock);
void gimp_menu_dock_set_show_image_menu (GimpMenuDock *menu_dock,
gboolean show);
#endif /* __GIMP_MENU_DOCK_H__ */
......@@ -289,7 +289,7 @@ gimp_session_info_aux_set_list (GtkWidget *dialog,
/* FIXME: make the aux-info stuff generic */
if (GIMP_IS_DOCK_WINDOW (dialog))
gimp_dock_set_aux_info (gimp_dock_window_get_dock (GIMP_DOCK_WINDOW (dialog)), aux_list);
gimp_dock_window_set_aux_info (GIMP_DOCK_WINDOW (dialog), aux_list);
else if (GIMP_IS_DOCKABLE (dialog))
gimp_dockable_set_aux_info (GIMP_DOCKABLE (dialog), aux_list);
}
......@@ -300,7 +300,7 @@ gimp_session_info_aux_get_list (GtkWidget *dialog)
/* FIXME: make the aux-info stuff generic */
if (GIMP_IS_DOCK_WINDOW (dialog))
return gimp_dock_get_aux_info (gimp_dock_window_get_dock (GIMP_DOCK_WINDOW (dialog)));
return gimp_dock_window_get_aux_info (GIMP_DOCK_WINDOW (dialog));
else if (GIMP_IS_DOCKABLE (dialog))
return gimp_dockable_get_aux_info (GIMP_DOCKABLE (dialog));
......
......@@ -26,13 +26,14 @@
#include "widgets-types.h"
#include "gimpcontainerview.h"
#include "gimpcontainerview-utils.h"
#include "gimpcontainerview.h"
#include "gimpdialogfactory.h"
#include "gimpdock.h"
#include "gimpdockable.h"
#include "gimpsessioninfo-aux.h"
#include "gimpsessioninfo-dockable.h"
#include "gimptoolbox.h"
enum
......@@ -281,11 +282,12 @@ gimp_session_info_dockable_restore (GimpSessionInfoDockable *info,
info->view_size > GIMP_VIEW_SIZE_GIGANTIC)
info->view_size = -1;
/* use the new dock's dialog factory to create dockables
* because it may be different from the dialog factory
* the dock was created from.
/* FIXME: Merge global_dock_factory and global_toolbox_factory
* somehow so we don't need this hack
*/
dockable = gimp_dialog_factory_dockable_new (gimp_dock_get_dialog_factory (dock),
dockable = gimp_dialog_factory_dockable_new ((GIMP_IS_TOOLBOX (dock) ?
gimp_toolbox_get_dialog_factory (GIMP_TOOLBOX (dock)) :
gimp_dock_get_dialog_factory (dock)),
dock,
info->identifier,
info->view_size);
......
......@@ -67,7 +67,7 @@ gimp_toolbox_color_area_create (GimpToolbox *toolbox,
g_return_val_if_fail (GIMP_IS_TOOLBOX (toolbox), NULL);
context = gimp_dock_get_context (GIMP_DOCK (toolbox));
context = gimp_toolbox_get_context (toolbox);
color_area = gimp_fg_bg_editor_new (context);
gtk_widget_set_size_request (color_area, width, height);
......
......@@ -87,46 +87,46 @@ static void gimp_toolbox_drop_pixbuf (GtkWidget *widget,
void
gimp_toolbox_dnd_init (GimpToolbox *toolbox)
{
GimpDock *dock;
GimpContext *context = NULL;
g_return_if_fail (GIMP_IS_TOOLBOX (toolbox));
dock = GIMP_DOCK (toolbox);
context = gimp_toolbox_get_context (toolbox);
gimp_dnd_uri_list_dest_add (GTK_WIDGET (toolbox),
gimp_toolbox_drop_uri_list,
gimp_dock_get_context (dock));
context);
gimp_dnd_uri_list_dest_add (gimp_toolbox_get_vbox (toolbox),
gimp_toolbox_drop_uri_list,
gimp_dock_get_context (dock));
context);
gimp_dnd_viewable_dest_add (gimp_toolbox_get_vbox (toolbox),
GIMP_TYPE_LAYER,
gimp_toolbox_drop_drawable,
gimp_dock_get_context (dock));
context);
gimp_dnd_viewable_dest_add (gimp_toolbox_get_vbox (toolbox),
GIMP_TYPE_LAYER_MASK,
gimp_toolbox_drop_drawable,
gimp_dock_get_context (dock));
context);
gimp_dnd_viewable_dest_add (gimp_toolbox_get_vbox (toolbox),
GIMP_TYPE_CHANNEL,
gimp_toolbox_drop_drawable,
gimp_dock_get_context (dock));
context);
gimp_dnd_viewable_dest_add (gimp_toolbox_get_vbox (toolbox),
GIMP_TYPE_TOOL_INFO,
gimp_toolbox_drop_tool,
gimp_dock_get_context (dock));
context);
gimp_dnd_viewable_dest_add (gimp_toolbox_get_vbox (toolbox),
GIMP_TYPE_BUFFER,
gimp_toolbox_drop_buffer,
gimp_dock_get_context (dock));
context);
gimp_dnd_component_dest_add (gimp_toolbox_get_vbox (toolbox),
gimp_toolbox_drop_component,
gimp_dock_get_context (dock));
context);
gimp_dnd_pixbuf_dest_add (gimp_toolbox_get_vbox (toolbox),
gimp_toolbox_drop_pixbuf,
gimp_dock_get_context (dock));
context);
}
......
......@@ -91,7 +91,7 @@ gimp_toolbox_image_area_create (GimpToolbox *toolbox,
g_return_val_if_fail (GIMP_IS_TOOLBOX (toolbox), NULL);
context = gimp_dock_get_context (GIMP_DOCK (toolbox));
context = gimp_toolbox_get_context (toolbox);
image_view = gimp_view_new_full_by_types (context,
GIMP_TYPE_VIEW, GIMP_TYPE_IMAGE,
......
......@@ -51,7 +51,7 @@ brush_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gimp_dialog_factory_dialog_raise (gimp_toolbox_get_dialog_factory (toolbox),
gtk_widget_get_screen (widget),
"gimp-brush-grid|gimp-brush-list", -1);
}
......@@ -73,7 +73,7 @@ pattern_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gimp_dialog_factory_dialog_raise (gimp_toolbox_get_dialog_factory (toolbox),
gtk_widget_get_screen (widget),
"gimp-pattern-grid|gimp-pattern-list", -1);
}
......@@ -95,7 +95,7 @@ gradient_preview_clicked (GtkWidget *widget,
GdkModifierType state,
GimpToolbox *toolbox)
{
gimp_dialog_factory_dialog_raise (gimp_dock_get_dialog_factory (GIMP_DOCK (toolbox)),
gimp_dialog_factory_dialog_raise (gimp_toolbox_get_dialog_factory (toolbox),
gtk_widget_get_screen (widget),
"gimp-gradient-list|gimp-gradient-grid", -1);
}
......@@ -126,7 +126,7 @@ gimp_toolbox_indicator_area_create (GimpToolbox *toolbox)
g_return_val_if_fail (GIMP_IS_TOOLBOX (toolbox), NULL);
context = gimp_dock_get_context (GIMP_DOCK (toolbox));
context = gimp_toolbox_get_context (toolbox);
indicator_table = gtk_table_new (2, 2, FALSE);
gtk_table_set_row_spacings (GTK_TABLE (indicator_table), CELL_SPACING);
......
......@@ -62,29 +62,49 @@
#define TOOL_BUTTON_DATA_KEY "gimp-tool-button"
#define TOOL_INFO_DATA_KEY "gimp-tool-info"
enum
{
PROP_0,
PROP_CONTEXT,
PROP_DIALOG_FACTORY,
PROP_UI_MANAGER
};
struct _GimpToolboxPrivate
{
GtkWidget *vbox;
GimpContext *context;
GimpDialogFactory *dialog_factory;
GimpUIManager *ui_manager;
GtkWidget *header;
GtkWidget *tool_wbox;
GtkWidget *vbox;
GtkWidget *area_wbox;
GtkWidget *color_area;
GtkWidget *foo_area;
GtkWidget *image_area;
GtkWidget *header;
GtkWidget *tool_wbox;
GtkWidget *area_wbox;
GtkWidget *color_area;
GtkWidget *foo_area;
GtkWidget *image_area;
gint tool_rows;
gint tool_columns;
gint area_rows;