Commit 27ac2a3c authored by Martin Nordholts's avatar Martin Nordholts

app: Make GimpEditor instance members private

parent 1a3315fe
......@@ -99,8 +99,8 @@ gradient_editor_left_color_cmd_callback (GtkAction *action,
editor);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
gtk_window_present (GTK_WINDOW (editor->color_dialog));
}
......@@ -250,8 +250,8 @@ gradient_editor_right_color_cmd_callback (GtkAction *action,
editor);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
gtk_window_present (GTK_WINDOW (editor->color_dialog));
}
......@@ -512,8 +512,8 @@ gradient_editor_replicate_cmd_callback (GtkAction *action,
&editor->replicate_times);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
gtk_widget_show (dialog);
}
......@@ -615,8 +615,8 @@ gradient_editor_split_uniformly_cmd_callback (GtkAction *action,
&editor->split_parts);
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
gtk_widget_show (dialog);
}
......@@ -742,8 +742,8 @@ gradient_editor_left_color_update (GimpColorDialog *dialog,
gtk_widget_destroy (editor->color_dialog);
editor->color_dialog = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
break;
case GIMP_COLOR_DIALOG_CANCEL:
......@@ -754,8 +754,8 @@ gradient_editor_left_color_update (GimpColorDialog *dialog,
gtk_widget_destroy (editor->color_dialog);
editor->color_dialog = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
break;
}
}
......@@ -790,8 +790,8 @@ gradient_editor_right_color_update (GimpColorDialog *dialog,
gtk_widget_destroy (editor->color_dialog);
editor->color_dialog = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
break;
case GIMP_COLOR_DIALOG_CANCEL:
......@@ -802,8 +802,8 @@ gradient_editor_right_color_update (GimpColorDialog *dialog,
gtk_widget_destroy (editor->color_dialog);
editor->color_dialog = NULL;
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
break;
}
}
......@@ -889,8 +889,8 @@ gradient_editor_split_uniform_response (GtkWidget *widget,
{
gtk_widget_destroy (widget);
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
if (response_id == GTK_RESPONSE_OK)
{
......@@ -914,8 +914,8 @@ gradient_editor_replicate_response (GtkWidget *widget,
{
gtk_widget_destroy (widget);
gtk_widget_set_sensitive (GTK_WIDGET (editor), TRUE);
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
if (response_id == GTK_RESPONSE_OK)
{
......
......@@ -62,7 +62,7 @@ tool_options_save_new_preset_cmd_callback (GtkAction *action,
gpointer user_data)
{
GimpEditor *editor = GIMP_EDITOR (user_data);
GimpContext *context = gimp_get_user_context (editor->ui_manager->gimp);
GimpContext *context = gimp_get_user_context (gimp_editor_get_ui_manager (editor)->gimp);
GimpData *data;
data = gimp_data_factory_data_new (context->gimp->tool_preset_factory,
......@@ -77,7 +77,7 @@ tool_options_save_preset_cmd_callback (GtkAction *action,
gpointer data)
{
GimpEditor *editor = GIMP_EDITOR (data);
GimpContext *context = gimp_get_user_context (editor->ui_manager->gimp);
GimpContext *context = gimp_get_user_context (gimp_editor_get_ui_manager (editor)->gimp);
GimpToolInfo *tool_info = gimp_context_get_tool (context);
GimpToolPreset *preset;
......@@ -99,7 +99,7 @@ tool_options_restore_preset_cmd_callback (GtkAction *action,
gpointer data)
{
GimpEditor *editor = GIMP_EDITOR (data);
GimpContext *context = gimp_get_user_context (editor->ui_manager->gimp);
GimpContext *context = gimp_get_user_context (gimp_editor_get_ui_manager (editor)->gimp);
GimpToolInfo *tool_info = gimp_context_get_tool (context);
GimpToolPreset *preset;
......@@ -121,7 +121,7 @@ tool_options_edit_preset_cmd_callback (GtkAction *action,
gpointer data)
{
GimpEditor *editor = GIMP_EDITOR (data);
GimpContext *context = gimp_get_user_context (editor->ui_manager->gimp);
GimpContext *context = gimp_get_user_context (gimp_editor_get_ui_manager (editor)->gimp);
GimpToolInfo *tool_info = gimp_context_get_tool (context);
GimpToolPreset *preset;
......@@ -140,7 +140,7 @@ tool_options_delete_preset_cmd_callback (GtkAction *action,
gpointer data)
{
GimpEditor *editor = GIMP_EDITOR (data);
GimpContext *context = gimp_get_user_context (editor->ui_manager->gimp);
GimpContext *context = gimp_get_user_context (gimp_editor_get_ui_manager (editor)->gimp);
GimpToolInfo *tool_info = gimp_context_get_tool (context);
GimpToolPreset *preset;
......@@ -164,7 +164,7 @@ tool_options_reset_cmd_callback (GtkAction *action,
gpointer data)
{
GimpEditor *editor = GIMP_EDITOR (data);
GimpContext *context = gimp_get_user_context (editor->ui_manager->gimp);
GimpContext *context = gimp_get_user_context (gimp_editor_get_ui_manager (editor)->gimp);
GimpToolInfo *tool_info = gimp_context_get_tool (context);
gimp_tool_options_reset (tool_info->tool_options);
......@@ -205,7 +205,7 @@ tool_options_reset_all_cmd_callback (GtkAction *action,
if (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK)
{
Gimp *gimp = editor->ui_manager->gimp;
Gimp *gimp = gimp_editor_get_ui_manager (editor)->gimp;
GList *list;
for (list = gimp_get_tool_info_iter (gimp);
......
......@@ -490,9 +490,9 @@ gimp_navigation_editor_set_shell (GimpNavigationEditor *editor,
gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE);
}
if (GIMP_EDITOR (editor)->ui_manager)
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
if (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)))
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
}
static gboolean
......@@ -636,9 +636,9 @@ gimp_navigation_editor_shell_scaled (GimpDisplayShell *shell,
gimp_navigation_editor_update_marker (editor);
if (GIMP_EDITOR (editor)->ui_manager)
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
if (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)))
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
}
static void
......@@ -647,9 +647,9 @@ gimp_navigation_editor_shell_scrolled (GimpDisplayShell *shell,
{
gimp_navigation_editor_update_marker (editor);
if (GIMP_EDITOR (editor)->ui_manager)
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
if (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)))
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
}
static void
......@@ -661,9 +661,9 @@ gimp_navigation_editor_shell_reconnect (GimpDisplayShell *shell,
gimp_view_set_viewable (GIMP_VIEW (editor->view),
GIMP_VIEWABLE (image));
if (GIMP_EDITOR (editor)->ui_manager)
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
if (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)))
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
}
static void
......
......@@ -210,7 +210,8 @@ gimp_buffer_view_new (GimpViewType view_type,
GTK_BUTTON (buffer_view->delete_button),
GIMP_TYPE_BUFFER);
gimp_ui_manager_update (GIMP_EDITOR (editor->view)->ui_manager, editor);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor->view)),
editor);
return GTK_WIDGET (buffer_view);
}
......
......@@ -177,7 +177,7 @@ gimp_channel_tree_view_constructed (GObject *object)
gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (view),
GTK_BUTTON (view->priv->toselection_button),
GIMP_TYPE_CHANNEL);
gtk_box_reorder_child (GTK_BOX (GIMP_EDITOR (view)->button_box),
gtk_box_reorder_child (gimp_editor_get_button_box (GIMP_EDITOR (view)),
view->priv->toselection_button, 5);
}
......@@ -286,7 +286,7 @@ gimp_channel_tree_view_set_image (GimpItemTreeView *item_view,
channel_view->priv->component_editor =
gimp_component_editor_new (view_size,
GIMP_EDITOR (item_view)->menu_factory);
gimp_editor_get_menu_factory (GIMP_EDITOR (item_view)));
gimp_docked_set_context (GIMP_DOCKED (channel_view->priv->component_editor),
gimp_container_view_get_context (view));
gtk_box_pack_start (GTK_BOX (item_view), channel_view->priv->component_editor,
......
......@@ -592,7 +592,7 @@ gimp_colormap_editor_entry_activated (GimpPaletteView *view,
{
gimp_colormap_editor_set_index (editor, entry->position, NULL);
gimp_ui_manager_activate_action (GIMP_EDITOR (editor)->ui_manager,
gimp_ui_manager_activate_action (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
"colormap",
"colormap-edit-color");
}
......
......@@ -224,9 +224,9 @@ gimp_container_editor_select_item (GtkWidget *widget,
if (klass->select_item)
klass->select_item (editor, viewable);
if (GIMP_EDITOR (editor->view)->ui_manager)
gimp_ui_manager_update (GIMP_EDITOR (editor->view)->ui_manager,
GIMP_EDITOR (editor->view)->popup_data);
if (gimp_editor_get_ui_manager (GIMP_EDITOR (editor->view)))
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor->view)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor->view)));
return TRUE;
}
......
......@@ -495,9 +495,9 @@ gimp_data_editor_set_data (GimpDataEditor *editor,
g_object_notify (G_OBJECT (editor), "data");
if (GIMP_EDITOR (editor)->ui_manager)
gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager,
GIMP_EDITOR (editor)->popup_data);
if (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)))
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor)),
gimp_editor_get_popup_data (GIMP_EDITOR (editor)));
}
}
......
......@@ -337,7 +337,8 @@ gimp_data_factory_view_construct (GimpDataFactoryView *factory_view,
GTK_BUTTON (factory_view->priv->delete_button),
gimp_container_get_children_type (gimp_data_factory_get_container (factory)));
gimp_ui_manager_update (GIMP_EDITOR (editor->view)->ui_manager, editor);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor->view)),
editor);
return TRUE;
}
......
......@@ -137,7 +137,8 @@ gimp_document_view_new (GimpViewType view_type,
editor);
}
gimp_ui_manager_update (GIMP_EDITOR (editor->view)->ui_manager, editor);
gimp_ui_manager_update (gimp_editor_get_ui_manager (GIMP_EDITOR (editor->view)),
editor);
return GTK_WIDGET (document_view);
}
......
......@@ -54,6 +54,20 @@ enum
};
struct _GimpEditorPrivate
{
GimpMenuFactory *menu_factory;
gchar *menu_identifier;
GimpUIManager *ui_manager;
gchar *ui_path;
gpointer popup_data;
gboolean show_button_bar;
GtkWidget *name_label;
GtkWidget *button_box;
};
static void gimp_editor_docked_iface_init (GimpDockedInterface *iface);
static void gimp_editor_constructed (GObject *object);
......@@ -171,6 +185,8 @@ gimp_editor_class_init (GimpEditorClass *klass)
GTK_TYPE_RELIEF_STYLE,
DEFAULT_BUTTON_RELIEF,
GIMP_PARAM_READABLE));
g_type_class_add_private (klass, sizeof (GimpEditorPrivate));
}
static void
......@@ -188,23 +204,22 @@ gimp_editor_init (GimpEditor *editor)
gtk_orientable_set_orientation (GTK_ORIENTABLE (editor),
GTK_ORIENTATION_VERTICAL);
editor->menu_factory = NULL;
editor->menu_identifier = NULL;
editor->ui_manager = NULL;
editor->ui_path = NULL;
editor->popup_data = editor;
editor->button_box = NULL;
editor->show_button_bar = TRUE;
editor->priv = G_TYPE_INSTANCE_GET_PRIVATE (editor,
GIMP_TYPE_EDITOR,
GimpEditorPrivate);
editor->priv->popup_data = editor;
editor->priv->show_button_bar = TRUE;
editor->name_label = g_object_new (GTK_TYPE_LABEL,
editor->priv->name_label = g_object_new (GTK_TYPE_LABEL,
"xalign", 0.0,
"yalign", 0.5,
"ellipsize", PANGO_ELLIPSIZE_END,
NULL);
gimp_label_set_attributes (GTK_LABEL (editor->name_label),
gimp_label_set_attributes (GTK_LABEL (editor->priv->name_label),
PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
-1);
gtk_box_pack_start (GTK_BOX (editor), editor->name_label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (editor), editor->priv->name_label,
FALSE, FALSE, 0);
}
static void
......@@ -215,15 +230,15 @@ gimp_editor_constructed (GObject *object)
if (G_OBJECT_CLASS (parent_class)->constructed)
G_OBJECT_CLASS (parent_class)->constructed (object);
if (! editor->popup_data)
editor->popup_data = editor;
if (! editor->priv->popup_data)
editor->priv->popup_data = editor;
if (editor->menu_factory && editor->menu_identifier)
if (editor->priv->menu_factory && editor->priv->menu_identifier)
{
editor->ui_manager =
gimp_menu_factory_manager_new (editor->menu_factory,
editor->menu_identifier,
editor->popup_data,
editor->priv->ui_manager =
gimp_menu_factory_manager_new (editor->priv->menu_factory,
editor->priv->menu_identifier,
editor->priv->popup_data,
FALSE);
}
}
......@@ -233,28 +248,28 @@ gimp_editor_dispose (GObject *object)
{
GimpEditor *editor = GIMP_EDITOR (object);
if (editor->menu_factory)
if (editor->priv->menu_factory)
{
g_object_unref (editor->menu_factory);
editor->menu_factory = NULL;
g_object_unref (editor->priv->menu_factory);
editor->priv->menu_factory = NULL;
}
if (editor->menu_identifier)
if (editor->priv->menu_identifier)
{
g_free (editor->menu_identifier);
editor->menu_identifier = NULL;
g_free (editor->priv->menu_identifier);
editor->priv->menu_identifier = NULL;
}
if (editor->ui_manager)
if (editor->priv->ui_manager)
{
g_object_unref (editor->ui_manager);
editor->ui_manager = NULL;
g_object_unref (editor->priv->ui_manager);
editor->priv->ui_manager = NULL;
}
if (editor->ui_path)
if (editor->priv->ui_path)
{
g_free (editor->ui_path);
editor->ui_path = NULL;
g_free (editor->priv->ui_path);
editor->priv->ui_path = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
......@@ -271,23 +286,24 @@ gimp_editor_set_property (GObject *object,
switch (property_id)
{
case PROP_MENU_FACTORY:
editor->menu_factory = g_value_dup_object (value);
editor->priv->menu_factory = g_value_dup_object (value);
break;
case PROP_MENU_IDENTIFIER:
editor->menu_identifier = g_value_dup_string (value);
editor->priv->menu_identifier = g_value_dup_string (value);
break;
case PROP_UI_PATH:
editor->ui_path = g_value_dup_string (value);
editor->priv->ui_path = g_value_dup_string (value);
break;
case PROP_POPUP_DATA:
editor->popup_data = g_value_get_pointer (value);
editor->priv->popup_data = g_value_get_pointer (value);
break;
case PROP_SHOW_NAME:
g_object_set_property (G_OBJECT (editor->name_label), "visible", value);
g_object_set_property (G_OBJECT (editor->priv->name_label),
"visible", value);
break;
case PROP_NAME:
......@@ -311,23 +327,24 @@ gimp_editor_get_property (GObject *object,
switch (property_id)
{
case PROP_MENU_FACTORY:
g_value_set_object (value, editor->menu_factory);
g_value_set_object (value, editor->priv->menu_factory);
break;
case PROP_MENU_IDENTIFIER:
g_value_set_string (value, editor->menu_identifier);
g_value_set_string (value, editor->priv->menu_identifier);
break;
case PROP_UI_PATH:
g_value_set_string (value, editor->ui_path);
g_value_set_string (value, editor->priv->ui_path);
break;
case PROP_POPUP_DATA:
g_value_set_pointer (value, editor->popup_data);
g_value_set_pointer (value, editor->priv->popup_data);
break;
case PROP_SHOW_NAME:
g_object_get_property (G_OBJECT (editor->name_label), "visible", value);
g_object_get_property (G_OBJECT (editor->priv->name_label),
"visible", value);
break;
default:
......@@ -349,8 +366,8 @@ gimp_editor_style_set (GtkWidget *widget,
gtk_box_set_spacing (GTK_BOX (widget), content_spacing);
if (editor->button_box)
gimp_editor_set_box_style (editor, GTK_BOX (editor->button_box));
if (editor->priv->button_box)
gimp_editor_set_box_style (editor, GTK_BOX (editor->priv->button_box));
}
static GimpUIManager *
......@@ -360,10 +377,10 @@ gimp_editor_get_menu (GimpDocked *docked,
{
GimpEditor *editor = GIMP_EDITOR (docked);
*ui_path = editor->ui_path;
*popup_data = editor->popup_data;
*ui_path = editor->priv->ui_path;
*popup_data = editor->priv->popup_data;
return editor->ui_manager;
return editor->priv->ui_manager;
}
......@@ -372,7 +389,7 @@ gimp_editor_has_button_bar (GimpDocked *docked)
{
GimpEditor *editor = GIMP_EDITOR (docked);
return editor->button_box != NULL;
return editor->priv->button_box != NULL;
}
static void
......@@ -381,12 +398,12 @@ gimp_editor_set_show_button_bar (GimpDocked *docked,
{
GimpEditor *editor = GIMP_EDITOR (docked);
if (show != editor->show_button_bar)
if (show != editor->priv->show_button_bar)
{
editor->show_button_bar = show;
editor->priv->show_button_bar = show;
if (editor->button_box)
gtk_widget_set_visible (editor->button_box, show);
if (editor->priv->button_box)
gtk_widget_set_visible (editor->priv->button_box, show);
}
}
......@@ -395,7 +412,7 @@ gimp_editor_get_show_button_bar (GimpDocked *docked)
{
GimpEditor *editor = GIMP_EDITOR (docked);
return editor->show_button_bar;
return editor->priv->show_button_bar;
}
GtkWidget *
......@@ -416,25 +433,25 @@ gimp_editor_create_menu (GimpEditor *editor,
g_return_if_fail (menu_identifier != NULL);
g_return_if_fail (ui_path != NULL);
if (editor->menu_factory)
g_object_unref (editor->menu_factory);
if (editor->priv->menu_factory)
g_object_unref (editor->priv->menu_factory);
editor->menu_factory = g_object_ref (menu_factory);
editor->priv->menu_factory = g_object_ref (menu_factory);
if (editor->ui_manager)
g_object_unref (editor->ui_manager);
if (editor->priv->ui_manager)
g_object_unref (editor->priv->ui_manager);
editor->ui_manager = gimp_menu_factory_manager_new (menu_factory,
menu_identifier,
popup_data,
FALSE);
editor->priv->ui_manager = gimp_menu_factory_manager_new (menu_factory,
menu_identifier,
popup_data,
FALSE);
if (editor->ui_path)
g_free (editor->ui_path);
if (editor->priv->ui_path)
g_free (editor->priv->ui_path);
editor->ui_path = g_strdup (ui_path);
editor->priv->ui_path = g_strdup (ui_path);
editor->popup_data = popup_data;
editor->priv->popup_data = popup_data;
}
gboolean
......@@ -444,10 +461,10 @@ gimp_editor_popup_menu (GimpEditor *editor,
{
g_return_val_if_fail (GIMP_IS_EDITOR (editor), FALSE);
if (editor->ui_manager && editor->ui_path)
if (editor->priv->ui_manager && editor->priv->ui_path)
{
gimp_ui_manager_update (editor->ui_manager, editor->popup_data);
gimp_ui_manager_ui_popup (editor->ui_manager, editor->ui_path,
gimp_ui_manager_update (editor->priv->ui_manager, editor->priv->popup_data);
gimp_ui_manager_ui_popup (editor->priv->ui_manager, editor->priv->ui_path,
GTK_WIDGET (editor),
position_func, position_data,
NULL, NULL);
......@@ -480,7 +497,7 @@ gimp_editor_add_button (GimpEditor *editor,
"use-stock", TRUE,
NULL);
gtk_button_set_relief (GTK_BUTTON (button), button_relief);
gtk_box_pack_start (GTK_BOX (editor->button_box), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (editor->priv->button_box), button, TRUE, TRUE, 0);
gtk_widget_show (button);
if (tooltip || help_id)
......@@ -538,7 +555,7 @@ gimp_editor_add_stock_box (GimpEditor *editor,
gtk_button_set_relief (GTK_BUTTON (button), button_relief);
gtk_container_remove (GTK_CONTAINER (hbox), button);
gtk_box_pack_start (GTK_BOX (editor->button_box), button,
gtk_box_pack_start (GTK_BOX (editor->priv->button_box), button,
TRUE, TRUE, 0);
g_object_unref (button);
......@@ -612,9 +629,10 @@ gimp_editor_add_action_button (GimpEditor *editor,
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);
g_return_val_if_fail (editor->priv->ui_manager != NULL, NULL);
group = gimp_ui_manager_get_action_group (editor->ui_manager, group_name);
group = gimp_ui_manager_get_action_group (editor->priv->ui_manager,
group_name);
g_return_val_if_fail (group != NULL, NULL);
......@@ -645,7 +663,8 @@ gimp_editor_add_action_button (GimpEditor *editor,
gtk_widget_show (image);
gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), action);
gtk_box_pack_start (GTK_BOX (editor->button_box), button, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (editor->priv->button_box), button,
TRUE, TRUE, 0);
gtk_widget_show (button);
va_start (args, action_name);
......@@ -725,7 +744,7 @@ gimp_editor_set_name (GimpEditor *editor,
{
g_return_if_fail (GIMP_IS_EDITOR (editor));
gtk_label_set_text (GTK_LABEL (editor->name_label),
gtk_label_set_text (GTK_LABEL (editor->priv->name_label),
name ? name : _("(None)"));
}
......@@ -779,6 +798,47 @@ gimp_editor_set_box_style (GimpEditor *editor,
g_list_free (children);
}
GimpUIManager *
gimp_editor_get_ui_manager (GimpEditor *editor)
{
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
return editor->priv->ui_manager;
}
GtkBox *
gimp_editor_get_button_box (GimpEditor *editor)
{
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
return GTK_BOX (editor->priv->button_box);
}
GimpMenuFactory *
gimp_editor_get_menu_factory (GimpEditor *editor)
{
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
return editor->priv->menu_factory;
}
gpointer *
gimp_editor_get_popup_data (GimpEditor *editor)
{
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
return editor->priv->popup_data;
}
gchar *
gimp_editor_get_ui_path (GimpEditor *editor)
{
g_return_val_if_fail (GIMP_IS_EDITOR (editor), NULL);
return editor->priv->ui_path;
}
/* private functions */
......@@ -795,14 +855,14 @@ gimp_editor_ensure_button_box (GimpEditor *editor,
"button-relief", button_relief,
NULL);
if (! editor->button_box)
if (! editor->priv->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_box_reorder_child (GTK_BOX (editor), editor->button_box, 0);
editor->priv->button_box = gtk_hbox_new (TRUE, button_spacing);
gtk_box_pack_end (GTK_BOX (editor), editor->priv->button_box, FALSE, FALSE, 0);
gtk_box_reorder_child (GTK_BOX (editor), editor->priv->button_box, 0);
if (editor->show_button_bar)
gtk_widget_show (editor->button_box);