Commit 3ebad746 authored by Martin Nordholts's avatar Martin Nordholts

app: Add GimpUIManager property to GimpDock

Add GimpUIManager property to GimpDock. We need it later when the
GimpDock stops being a GimpDockWindow.
parent ae39604a
......@@ -35,6 +35,7 @@
#include "gimpdockable.h"
#include "gimpdockbook.h"
#include "gimpdockseparator.h"
#include "gimpuimanager.h"
#include "gimp-intl.h"
......@@ -43,7 +44,8 @@ enum
{
PROP_0,
PROP_CONTEXT,
PROP_DIALOG_FACTORY
PROP_DIALOG_FACTORY,
PROP_UI_MANAGER
};
enum
......@@ -60,6 +62,7 @@ struct _GimpDockPrivate
{
GimpDialogFactory *dialog_factory;
GimpContext *context;
GimpUIManager *ui_manager;
GtkWidget *main_vbox;
GtkWidget *vbox;
......@@ -161,6 +164,13 @@ gimp_dock_class_init (GimpDockClass *klass)
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));
g_type_class_add_private (klass, sizeof (GimpDockPrivate));
}
......@@ -207,6 +217,10 @@ gimp_dock_set_property (GObject *object,
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;
......@@ -231,6 +245,10 @@ gimp_dock_get_property (GObject *object,
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;
......@@ -245,6 +263,12 @@ 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);
......@@ -373,6 +397,14 @@ gimp_dock_get_dialog_factory (GimpDock *dock)
return dock->p->dialog_factory;
}
GimpUIManager *
gimp_dock_get_ui_manager (GimpDock *dock)
{
g_return_val_if_fail (GIMP_IS_DOCK (dock), NULL);
return dock->p->ui_manager;
}
GList *
gimp_dock_get_dockbooks (GimpDock *dock)
{
......
......@@ -85,6 +85,7 @@ void gimp_dock_set_host_geometry_hints
void gimp_dock_invalidate_geometry(GimpDock *dock);
GimpContext * gimp_dock_get_context (GimpDock *dock);
GimpDialogFactory * gimp_dock_get_dialog_factory (GimpDock *dock);
GimpUIManager * gimp_dock_get_ui_manager (GimpDock *dock);
GList * gimp_dock_get_dockbooks (GimpDock *dock);
gint gimp_dock_get_n_dockables (GimpDock *dock);
GtkWidget * gimp_dock_get_main_vbox (GimpDock *dock);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment