mirror of https://github.com/GNOME/gimp.git
added GimpContext parameters and create the GimpView with that context.
2006-09-01 Michael Natterer <mitch@gimp.org> * app/widgets/gimpviewabledialog.[ch]: added GimpContext parameters and create the GimpView with that context. * app/widgets/gimpcolordialog.[ch] * app/dialogs/convert-dialog.[ch] * app/dialogs/desaturate-dialog.[ch] * app/dialogs/grid-dialog.[ch] * app/dialogs/image-properties-dialog.[ch] * app/dialogs/layer-add-mask-dialog.[ch] * app/dialogs/offset-dialog.[ch] * app/dialogs/print-size-dialog.[ch] * app/dialogs/resize-dialog.[ch] * app/dialogs/scale-dialog.[ch] * app/dialogs/stroke-dialog.[ch] * app/dialogs/template-options-dialog.[ch] * app/dialogs/vectors-options-dialog.[ch]: added GimpContext parameters here too and pass them to gimp_viewable_dialog_new(). * app/actions/colormap-editor-commands.c * app/actions/drawable-commands.c * app/actions/gradient-editor-commands.c * app/actions/image-commands.c * app/actions/layers-commands.c * app/actions/palette-editor-commands.c * app/actions/select-commands.c * app/actions/vectors-commands.c * app/actions/view-commands.c * app/dialogs/channel-options-dialog.c * app/dialogs/dialogs-constructors.c * app/dialogs/image-merge-layers-dialog.c * app/dialogs/image-scale-dialog.c * app/dialogs/layer-options-dialog.c * app/display/gimpdisplayshell-filter-dialog.c * app/display/gimpdisplayshell-scale.c * app/tools/gimpcolorpickertool.c * app/tools/gimpimagemaptool.c * app/tools/gimpmeasuretool.c * app/tools/gimptexttool.c * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpcontrollereditor.c * app/widgets/gimpcontrollerlist.c * app/widgets/gimptoolbox-color-area.c: pass contexts to above dialog constructors.
This commit is contained in:
parent
0051a8599f
commit
a6dbb78dfa
48
ChangeLog
48
ChangeLog
|
@ -1,3 +1,51 @@
|
|||
2006-09-01 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/widgets/gimpviewabledialog.[ch]: added GimpContext
|
||||
parameters and create the GimpView with that context.
|
||||
|
||||
* app/widgets/gimpcolordialog.[ch]
|
||||
* app/dialogs/convert-dialog.[ch]
|
||||
* app/dialogs/desaturate-dialog.[ch]
|
||||
* app/dialogs/grid-dialog.[ch]
|
||||
* app/dialogs/image-properties-dialog.[ch]
|
||||
* app/dialogs/layer-add-mask-dialog.[ch]
|
||||
* app/dialogs/offset-dialog.[ch]
|
||||
* app/dialogs/print-size-dialog.[ch]
|
||||
* app/dialogs/resize-dialog.[ch]
|
||||
* app/dialogs/scale-dialog.[ch]
|
||||
* app/dialogs/stroke-dialog.[ch]
|
||||
* app/dialogs/template-options-dialog.[ch]
|
||||
* app/dialogs/vectors-options-dialog.[ch]: added GimpContext
|
||||
parameters here too and pass them to gimp_viewable_dialog_new().
|
||||
|
||||
* app/actions/colormap-editor-commands.c
|
||||
* app/actions/drawable-commands.c
|
||||
* app/actions/gradient-editor-commands.c
|
||||
* app/actions/image-commands.c
|
||||
* app/actions/layers-commands.c
|
||||
* app/actions/palette-editor-commands.c
|
||||
* app/actions/select-commands.c
|
||||
* app/actions/vectors-commands.c
|
||||
* app/actions/view-commands.c
|
||||
* app/dialogs/channel-options-dialog.c
|
||||
* app/dialogs/dialogs-constructors.c
|
||||
* app/dialogs/image-merge-layers-dialog.c
|
||||
* app/dialogs/image-scale-dialog.c
|
||||
* app/dialogs/layer-options-dialog.c
|
||||
* app/display/gimpdisplayshell-filter-dialog.c
|
||||
* app/display/gimpdisplayshell-scale.c
|
||||
* app/tools/gimpcolorpickertool.c
|
||||
* app/tools/gimpimagemaptool.c
|
||||
* app/tools/gimpmeasuretool.c
|
||||
* app/tools/gimptexttool.c
|
||||
* app/tools/gimptransformtool.c
|
||||
* app/tools/gimpvectortool.c
|
||||
* app/widgets/gimpcolorpanel.c
|
||||
* app/widgets/gimpcontrollereditor.c
|
||||
* app/widgets/gimpcontrollerlist.c
|
||||
* app/widgets/gimptoolbox-color-area.c: pass contexts to above
|
||||
dialog constructors.
|
||||
|
||||
2006-09-01 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/widgets/gimpviewrendererdrawable.c: fixed includes for
|
||||
|
|
|
@ -77,9 +77,8 @@ channels_edit_attributes_cmd_callback (GtkAction *action,
|
|||
return_if_no_channel (image, channel, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
options = channel_options_dialog_new (image,
|
||||
options = channel_options_dialog_new (image, channel,
|
||||
action_data_get_context (data),
|
||||
channel,
|
||||
widget,
|
||||
&channel->color,
|
||||
gimp_object_get_name (GIMP_OBJECT (channel)),
|
||||
|
@ -109,9 +108,8 @@ channels_new_cmd_callback (GtkAction *action,
|
|||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
options = channel_options_dialog_new (image,
|
||||
options = channel_options_dialog_new (image, NULL,
|
||||
action_data_get_context (data),
|
||||
NULL,
|
||||
widget,
|
||||
&channel_color,
|
||||
channel_name ? channel_name :
|
||||
|
|
|
@ -73,6 +73,7 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action,
|
|||
{
|
||||
editor->color_dialog =
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (image),
|
||||
action_data_get_context (data),
|
||||
_("Edit Colormap Entry"),
|
||||
GIMP_STOCK_COLORMAP,
|
||||
desc,
|
||||
|
@ -93,7 +94,8 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action,
|
|||
else
|
||||
{
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (editor->color_dialog),
|
||||
GIMP_VIEWABLE (image));
|
||||
GIMP_VIEWABLE (image),
|
||||
action_data_get_context (data));
|
||||
g_object_set (editor->color_dialog, "description", desc, NULL);
|
||||
gimp_color_dialog_set_color (GIMP_COLOR_DIALOG (editor->color_dialog),
|
||||
&color);
|
||||
|
|
|
@ -73,6 +73,7 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action,
|
|||
{
|
||||
editor->color_dialog =
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (image),
|
||||
action_data_get_context (data),
|
||||
_("Edit Colormap Entry"),
|
||||
GIMP_STOCK_COLORMAP,
|
||||
desc,
|
||||
|
@ -93,7 +94,8 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action,
|
|||
else
|
||||
{
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (editor->color_dialog),
|
||||
GIMP_VIEWABLE (image));
|
||||
GIMP_VIEWABLE (image),
|
||||
action_data_get_context (data));
|
||||
g_object_set (editor->color_dialog, "description", desc, NULL);
|
||||
gimp_color_dialog_set_color (GIMP_COLOR_DIALOG (editor->color_dialog),
|
||||
&color);
|
||||
|
|
|
@ -75,7 +75,9 @@ drawable_desaturate_cmd_callback (GtkAction *action,
|
|||
return;
|
||||
}
|
||||
|
||||
dialog = desaturate_dialog_new (drawable, widget, desaturate_mode);
|
||||
dialog = desaturate_dialog_new (drawable,
|
||||
action_data_get_context (data),
|
||||
widget, desaturate_mode);
|
||||
|
||||
g_signal_connect (dialog->dialog, "response",
|
||||
G_CALLBACK (desaturate_response),
|
||||
|
@ -151,7 +153,8 @@ drawable_offset_cmd_callback (GtkAction *action,
|
|||
return_if_no_drawable (image, drawable, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = offset_dialog_new (drawable, widget);
|
||||
dialog = offset_dialog_new (drawable, action_data_get_context (data),
|
||||
widget);
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ gradient_editor_left_color_cmd_callback (GtkAction *action,
|
|||
|
||||
editor->color_dialog =
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (gradient),
|
||||
GIMP_DATA_EDITOR (editor)->context,
|
||||
_("Left Endpoint Color"),
|
||||
GIMP_STOCK_GRADIENT,
|
||||
_("Gradient Segment's Left Endpoint Color"),
|
||||
|
@ -232,6 +233,7 @@ gradient_editor_right_color_cmd_callback (GtkAction *action,
|
|||
|
||||
editor->color_dialog =
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (gradient),
|
||||
GIMP_DATA_EDITOR (editor)->context,
|
||||
_("Right Endpoint Color"),
|
||||
GIMP_STOCK_GRADIENT,
|
||||
_("Gradient Segment's Right Endpoint Color"),
|
||||
|
@ -437,6 +439,7 @@ gradient_editor_replicate_cmd_callback (GtkAction *action,
|
|||
gpointer data)
|
||||
{
|
||||
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
|
||||
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *label;
|
||||
|
@ -457,7 +460,8 @@ gradient_editor_replicate_cmd_callback (GtkAction *action,
|
|||
}
|
||||
|
||||
dialog =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (GIMP_DATA_EDITOR (editor)->data),
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (data_editor->data),
|
||||
data_editor->context,
|
||||
title, "gimp-gradient-segment-replicate",
|
||||
GIMP_STOCK_GRADIENT, desc,
|
||||
GTK_WIDGET (editor),
|
||||
|
@ -536,6 +540,7 @@ gradient_editor_split_uniformly_cmd_callback (GtkAction *action,
|
|||
gpointer data)
|
||||
{
|
||||
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
|
||||
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *label;
|
||||
|
@ -556,7 +561,8 @@ gradient_editor_split_uniformly_cmd_callback (GtkAction *action,
|
|||
}
|
||||
|
||||
dialog =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (GIMP_DATA_EDITOR (editor)->data),
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (data_editor->data),
|
||||
data_editor->context,
|
||||
title, "gimp-gradient-segment-split-uniformly",
|
||||
GIMP_STOCK_GRADIENT, desc,
|
||||
GTK_WIDGET (editor),
|
||||
|
|
|
@ -185,7 +185,9 @@ image_convert_cmd_callback (GtkAction *action,
|
|||
|
||||
if (! dialog)
|
||||
{
|
||||
dialog = convert_dialog_new (image, widget,
|
||||
dialog = convert_dialog_new (image,
|
||||
action_data_get_context (data),
|
||||
widget,
|
||||
GIMP_PROGRESS (display));
|
||||
|
||||
g_object_set_data (G_OBJECT (widget),
|
||||
|
@ -229,6 +231,7 @@ image_resize_cmd_callback (GtkAction *action,
|
|||
unit = GIMP_DISPLAY_SHELL (display->shell)->unit;
|
||||
|
||||
dialog = resize_dialog_new (GIMP_VIEWABLE (image),
|
||||
action_data_get_context (data),
|
||||
_("Set Image Canvas Size"), "gimp-image-resize",
|
||||
widget,
|
||||
gimp_standard_help_func, GIMP_HELP_IMAGE_RESIZE,
|
||||
|
@ -278,6 +281,7 @@ image_print_size_cmd_callback (GtkAction *action,
|
|||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = print_size_dialog_new (display->image,
|
||||
action_data_get_context (data),
|
||||
_("Set Image Print Resolution"),
|
||||
"gimp-image-print-size",
|
||||
widget,
|
||||
|
@ -446,7 +450,9 @@ image_configure_grid_cmd_callback (GtkAction *action,
|
|||
|
||||
if (! shell->grid_dialog)
|
||||
{
|
||||
shell->grid_dialog = grid_dialog_new (display->image, display->shell);
|
||||
shell->grid_dialog = grid_dialog_new (display->image,
|
||||
action_data_get_context (data),
|
||||
display->shell);
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog),
|
||||
GTK_WINDOW (display->shell));
|
||||
|
@ -473,7 +479,9 @@ image_properties_cmd_callback (GtkAction *action,
|
|||
shell = GIMP_DISPLAY_SHELL (display->shell);
|
||||
image = display->image;
|
||||
|
||||
dialog = image_properties_dialog_new (display->image, display->shell);
|
||||
dialog = image_properties_dialog_new (display->image,
|
||||
action_data_get_context (data),
|
||||
display->shell);
|
||||
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog),
|
||||
GTK_WINDOW (display->shell));
|
||||
|
|
|
@ -195,8 +195,9 @@ layers_edit_attributes_cmd_callback (GtkAction *action,
|
|||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = layer_options_dialog_new (gimp_item_get_image (GIMP_ITEM (layer)),
|
||||
layer,
|
||||
action_data_get_context (data),
|
||||
layer, widget,
|
||||
widget,
|
||||
gimp_object_get_name (GIMP_OBJECT (layer)),
|
||||
layer_fill_type,
|
||||
_("Layer Attributes"),
|
||||
|
@ -233,8 +234,9 @@ layers_new_cmd_callback (GtkAction *action,
|
|||
return;
|
||||
}
|
||||
|
||||
dialog = layer_options_dialog_new (image, action_data_get_context (data),
|
||||
NULL, widget,
|
||||
dialog = layer_options_dialog_new (image, NULL,
|
||||
action_data_get_context (data),
|
||||
widget,
|
||||
layer_name ? layer_name : _("New Layer"),
|
||||
layer_fill_type,
|
||||
_("New Layer"),
|
||||
|
@ -532,6 +534,7 @@ layers_resize_cmd_callback (GtkAction *action,
|
|||
unit = display ? GIMP_DISPLAY_SHELL (display->shell)->unit : GIMP_UNIT_PIXEL;
|
||||
|
||||
dialog = resize_dialog_new (GIMP_VIEWABLE (layer),
|
||||
action_data_get_context (data),
|
||||
_("Set Layer Boundary Size"), "gimp-layer-resize",
|
||||
widget,
|
||||
gimp_standard_help_func, GIMP_HELP_LAYER_RESIZE,
|
||||
|
@ -575,6 +578,7 @@ layers_scale_cmd_callback (GtkAction *action,
|
|||
unit = display ? GIMP_DISPLAY_SHELL (display->shell)->unit : GIMP_UNIT_PIXEL;
|
||||
|
||||
dialog = scale_dialog_new (GIMP_VIEWABLE (layer),
|
||||
action_data_get_context (data),
|
||||
_("Scale Layer"), "gimp-layer-scale",
|
||||
widget,
|
||||
gimp_standard_help_func, GIMP_HELP_LAYER_SCALE,
|
||||
|
@ -629,7 +633,8 @@ layers_mask_add_cmd_callback (GtkAction *action,
|
|||
return_if_no_layer (image, layer, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
dialog = layer_add_mask_dialog_new (layer, widget,
|
||||
dialog = layer_add_mask_dialog_new (layer, action_data_get_context (data),
|
||||
widget,
|
||||
layer_add_mask_type, layer_mask_invert);
|
||||
|
||||
g_signal_connect (dialog->dialog, "response",
|
||||
|
|
|
@ -65,6 +65,7 @@ palette_editor_edit_color_cmd_callback (GtkAction *action,
|
|||
{
|
||||
editor->color_dialog =
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (palette),
|
||||
data_editor->context,
|
||||
_("Edit Palette Color"),
|
||||
GIMP_STOCK_PALETTE,
|
||||
_("Edit Color Palette Entry"),
|
||||
|
@ -85,7 +86,8 @@ palette_editor_edit_color_cmd_callback (GtkAction *action,
|
|||
else
|
||||
{
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (editor->color_dialog),
|
||||
GIMP_VIEWABLE (palette));
|
||||
GIMP_VIEWABLE (palette),
|
||||
data_editor->context);
|
||||
gimp_color_dialog_set_color (GIMP_COLOR_DIALOG (editor->color_dialog),
|
||||
&editor->color->color);
|
||||
}
|
||||
|
|
|
@ -97,9 +97,8 @@ quick_mask_configure_cmd_callback (GtkAction *action,
|
|||
|
||||
gimp_image_get_quick_mask_color (image, &color);
|
||||
|
||||
options = channel_options_dialog_new (image,
|
||||
options = channel_options_dialog_new (image, NULL,
|
||||
action_data_get_context (data),
|
||||
NULL,
|
||||
widget,
|
||||
&color,
|
||||
NULL,
|
||||
|
|
|
@ -291,6 +291,7 @@ select_stroke_cmd_callback (GtkAction *action,
|
|||
}
|
||||
|
||||
dialog = stroke_dialog_new (GIMP_ITEM (gimp_image_get_mask (image)),
|
||||
action_data_get_context (data),
|
||||
_("Stroke Selection"),
|
||||
GIMP_STOCK_SELECTION_STROKE,
|
||||
GIMP_HELP_SELECTION_STROKE,
|
||||
|
|
|
@ -117,7 +117,7 @@ templates_new_cmd_callback (GtkAction *action,
|
|||
|
||||
context = gimp_container_view_get_context (editor->view);
|
||||
|
||||
options = template_options_dialog_new (context->gimp, NULL,
|
||||
options = template_options_dialog_new (NULL, context,
|
||||
GTK_WIDGET (editor),
|
||||
_("New Template"),
|
||||
"gimp-template-new",
|
||||
|
@ -179,7 +179,7 @@ templates_edit_cmd_callback (GtkAction *action,
|
|||
{
|
||||
TemplateOptionsDialog *options;
|
||||
|
||||
options = template_options_dialog_new (context->gimp, template,
|
||||
options = template_options_dialog_new (template, context,
|
||||
GTK_WIDGET (editor),
|
||||
_("Edit Template"),
|
||||
"gimp-template-edit",
|
||||
|
|
|
@ -135,8 +135,8 @@ vectors_edit_attributes_cmd_callback (GtkAction *action,
|
|||
return_if_no_vectors (image, vectors, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
options = vectors_options_dialog_new (image,
|
||||
vectors,
|
||||
options = vectors_options_dialog_new (image, vectors,
|
||||
action_data_get_context (data),
|
||||
widget,
|
||||
gimp_object_get_name (GIMP_OBJECT (vectors)),
|
||||
_("Path Attributes"),
|
||||
|
@ -162,8 +162,8 @@ vectors_new_cmd_callback (GtkAction *action,
|
|||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
options = vectors_options_dialog_new (image,
|
||||
NULL,
|
||||
options = vectors_options_dialog_new (image, NULL,
|
||||
action_data_get_context (data),
|
||||
widget,
|
||||
vectors_name ? vectors_name :
|
||||
_("New Path"),
|
||||
|
@ -365,6 +365,7 @@ vectors_stroke_cmd_callback (GtkAction *action,
|
|||
}
|
||||
|
||||
dialog = stroke_dialog_new (GIMP_ITEM (vectors),
|
||||
action_data_get_context (data),
|
||||
_("Stroke Path"),
|
||||
GIMP_STOCK_PATH_STROKE,
|
||||
GIMP_HELP_PATH_STROKE,
|
||||
|
|
|
@ -565,7 +565,9 @@ view_padding_color_cmd_callback (GtkAction *action,
|
|||
|
||||
if (! color_dialog)
|
||||
{
|
||||
color_dialog = gimp_color_dialog_new (GIMP_VIEWABLE (display->image),
|
||||
color_dialog =
|
||||
gimp_color_dialog_new (GIMP_VIEWABLE (display->image),
|
||||
action_data_get_context (data),
|
||||
_("Set Canvas Padding Color"),
|
||||
GTK_STOCK_SELECT_COLOR,
|
||||
_("Set Custom Canvas Padding Color"),
|
||||
|
|
|
@ -49,8 +49,8 @@ static void channel_options_color_changed (GimpColorButton *button,
|
|||
|
||||
ChannelOptionsDialog *
|
||||
channel_options_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GimpChannel *channel,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
const GimpRGB *channel_color,
|
||||
const gchar *channel_name,
|
||||
|
@ -71,8 +71,8 @@ channel_options_dialog_new (GimpImage *image,
|
|||
GtkObject *opacity_adj;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (channel == NULL || GIMP_IS_CHANNEL (channel), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
g_return_val_if_fail (channel_color != NULL, NULL);
|
||||
g_return_val_if_fail (title != NULL, NULL);
|
||||
|
@ -102,7 +102,7 @@ channel_options_dialog_new (GimpImage *image,
|
|||
viewable = GIMP_VIEWABLE (image);
|
||||
|
||||
options->dialog =
|
||||
gimp_viewable_dialog_new (viewable,
|
||||
gimp_viewable_dialog_new (viewable, context,
|
||||
title, role, stock_id, desc,
|
||||
parent,
|
||||
gimp_standard_help_func, help_id,
|
||||
|
|
|
@ -36,8 +36,8 @@ struct _ChannelOptionsDialog
|
|||
|
||||
|
||||
ChannelOptionsDialog * channel_options_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GimpChannel *channel,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
const GimpRGB *channel_color,
|
||||
const gchar *channel_name,
|
||||
|
|
|
@ -85,6 +85,7 @@ static GimpPalette *saved_palette = NULL;
|
|||
|
||||
GtkWidget *
|
||||
convert_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
GimpProgress *progress)
|
||||
{
|
||||
|
@ -102,6 +103,7 @@ convert_dialog_new (GimpImage *image,
|
|||
GtkWidget *combo;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
|
||||
|
||||
|
@ -116,7 +118,7 @@ convert_dialog_new (GimpImage *image,
|
|||
dialog->palette_type = saved_palette_type;
|
||||
|
||||
dialog->dialog =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (image),
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (image), context,
|
||||
_("Indexed Color Conversion"),
|
||||
"gimp-image-convert-indexed",
|
||||
GIMP_STOCK_CONVERT_INDEXED,
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
|
||||
GtkWidget * convert_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
GimpProgress *progress);
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "dialogs-types.h"
|
||||
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimplayer.h"
|
||||
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
@ -38,6 +39,7 @@
|
|||
|
||||
DesaturateDialog *
|
||||
desaturate_dialog_new (GimpDrawable *drawable,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
GimpDesaturateMode mode)
|
||||
{
|
||||
|
@ -47,6 +49,7 @@ desaturate_dialog_new (GimpDrawable *drawable,
|
|||
GtkWidget *button;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
dialog = g_new0 (DesaturateDialog, 1);
|
||||
|
@ -55,7 +58,7 @@ desaturate_dialog_new (GimpDrawable *drawable,
|
|||
dialog->mode = mode;
|
||||
|
||||
dialog->dialog =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable),
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable), context,
|
||||
_("Desaturate"), "gimp-drawable-desaturate",
|
||||
GIMP_STOCK_CONVERT_GRAYSCALE,
|
||||
_("Remove Colors"),
|
||||
|
|
|
@ -32,6 +32,7 @@ struct _DesaturateDialog
|
|||
|
||||
|
||||
DesaturateDialog * desaturate_dialog_new (GimpDrawable *drawable,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
GimpDesaturateMode mode);
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ dialogs_image_new_new (GimpDialogFactory *factory,
|
|||
GimpContext *context,
|
||||
gint view_size)
|
||||
{
|
||||
return image_new_dialog_new (context->gimp);
|
||||
return image_new_dialog_new (context);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "config/gimpcoreconfig.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-grid.h"
|
||||
#include "core/gimpimage-undo.h"
|
||||
|
@ -63,6 +64,7 @@ static void grid_dialog_response (GtkWidget *widget,
|
|||
|
||||
GtkWidget *
|
||||
grid_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent)
|
||||
{
|
||||
GimpGrid *grid;
|
||||
|
@ -71,12 +73,13 @@ grid_dialog_new (GimpImage *image,
|
|||
GtkWidget *editor;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (parent == NULL || GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
grid = gimp_image_get_grid (GIMP_IMAGE (image));
|
||||
grid_backup = gimp_config_duplicate (GIMP_CONFIG (grid));
|
||||
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (image),
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (image), context,
|
||||
_("Configure Grid"), "gimp-grid-configure",
|
||||
GIMP_STOCK_GRID, _("Configure Image Grid"),
|
||||
parent,
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
|
||||
GtkWidget * grid_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent);
|
||||
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ image_merge_layers_dialog_new (GimpImage *image,
|
|||
dialog->merge_type = GIMP_EXPAND_AS_NECESSARY;
|
||||
|
||||
dialog->dialog =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (image),
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (image), context,
|
||||
_("Merge Layers"), "gimp-image-merge-layers",
|
||||
GIMP_STOCK_MERGE_DOWN,
|
||||
_("Layers Merge Options"),
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "config/gimpguiconfig.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpimage-new.h"
|
||||
#include "core/gimptemplate.h"
|
||||
|
@ -57,7 +58,7 @@ typedef struct
|
|||
GtkWidget *combo;
|
||||
GtkWidget *editor;
|
||||
|
||||
Gimp *gimp;
|
||||
GimpContext *context;
|
||||
GimpTemplate *template;
|
||||
} ImageNewDialog;
|
||||
|
||||
|
@ -78,18 +79,18 @@ static void image_new_create_image (ImageNewDialog *dialog);
|
|||
/* public functions */
|
||||
|
||||
GtkWidget *
|
||||
image_new_dialog_new (Gimp *gimp)
|
||||
image_new_dialog_new (GimpContext *context)
|
||||
{
|
||||
ImageNewDialog *dialog;
|
||||
GtkWidget *main_vbox;
|
||||
GtkWidget *table;
|
||||
GimpSizeEntry *entry;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
|
||||
dialog = g_new0 (ImageNewDialog, 1);
|
||||
|
||||
dialog->gimp = gimp;
|
||||
dialog->context = context;
|
||||
dialog->template = g_object_new (GIMP_TYPE_TEMPLATE, NULL);
|
||||
|
||||
dialog->dialog = gimp_dialog_new (_("Create a New Image"),
|
||||
|
@ -131,7 +132,7 @@ image_new_dialog_new (Gimp *gimp)
|
|||
gtk_widget_show (table);
|
||||
|
||||
dialog->combo = g_object_new (GIMP_TYPE_CONTAINER_COMBO_BOX,
|
||||
"container", gimp->templates,
|
||||
"container", context->gimp->templates,
|
||||
"view-size", 16,
|
||||
"view-border-width", 0,
|
||||
"ellipsize", PANGO_ELLIPSIZE_NONE,
|
||||
|
@ -147,7 +148,8 @@ image_new_dialog_new (Gimp *gimp)
|
|||
dialog);
|
||||
|
||||
/* Template editor */
|
||||
dialog->editor = gimp_template_editor_new (dialog->template, gimp, FALSE);
|
||||
dialog->editor = gimp_template_editor_new (dialog->template, context->gimp,
|
||||
FALSE);
|
||||
gtk_box_pack_start (GTK_BOX (main_vbox), dialog->editor, FALSE, FALSE, 0);
|
||||
gtk_widget_show (dialog->editor);
|
||||
|
||||
|
@ -180,7 +182,8 @@ image_new_dialog_set (GtkWidget *widget,
|
|||
}
|
||||
else
|
||||
{
|
||||
template = gimp_image_new_get_last_template (dialog->gimp, image);
|
||||
template = gimp_image_new_get_last_template (dialog->context->gimp,
|
||||
image);
|
||||
|
||||
gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template), 0);
|
||||
|
||||
|
@ -199,7 +202,7 @@ image_new_response (GtkWidget *widget,
|
|||
switch (response_id)
|
||||
{
|
||||
case RESPONSE_RESET:
|
||||
gimp_config_sync (G_OBJECT (dialog->gimp->config->default_image),
|
||||
gimp_config_sync (G_OBJECT (dialog->context->gimp->config->default_image),
|
||||
G_OBJECT (dialog->template), 0);
|
||||
gimp_container_view_select_item (GIMP_CONTAINER_VIEW (dialog->combo),
|
||||
NULL);
|
||||
|
@ -207,7 +210,7 @@ image_new_response (GtkWidget *widget,
|
|||
|
||||
case GTK_RESPONSE_OK:
|
||||
if (dialog->template->initial_size >
|
||||
GIMP_GUI_CONFIG (dialog->gimp->config)->max_new_image_size)
|
||||
GIMP_GUI_CONFIG (dialog->context->gimp->config)->max_new_image_size)
|
||||
image_new_confirm_dialog (dialog);
|
||||
else
|
||||
image_new_create_image (dialog);
|
||||
|
@ -303,7 +306,7 @@ image_new_confirm_dialog (ImageNewDialog *data)
|
|||
"with a size of %s."), size);
|
||||
g_free (size);
|
||||
|
||||
config = GIMP_GUI_CONFIG (data->gimp->config);
|
||||
config = GIMP_GUI_CONFIG (data->context->gimp->config);
|
||||
size = gimp_memsize_to_string (config->max_new_image_size);
|
||||
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
|
||||
_("An image of the chosen size will use more "
|
||||
|
@ -324,11 +327,11 @@ image_new_create_image (ImageNewDialog *dialog)
|
|||
Gimp *gimp;
|
||||
|
||||
template = g_object_ref (dialog->template);
|
||||
gimp = dialog->gimp;
|
||||
gimp = dialog->context->gimp;
|
||||
|
||||
gtk_widget_destroy (dialog->dialog);
|
||||
|
||||
gimp_template_create_image (gimp, template, gimp_get_user_context (gimp));
|
||||
gimp_template_create_image (gimp, template, dialog->context);
|
||||
gimp_image_new_set_last_template (gimp, template);
|
||||
|
||||
g_object_unref (template);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#define __IMAGE_NEW_DIALOG_H__
|
||||
|
||||
|
||||
GtkWidget * image_new_dialog_new (Gimp *gimp);
|
||||
GtkWidget * image_new_dialog_new (GimpContext *context);
|
||||
|
||||
void image_new_dialog_set (GtkWidget *widget,
|
||||
GimpImage *image,
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "dialogs-types.h"
|
||||
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
@ -42,15 +43,17 @@
|
|||
|
||||
GtkWidget *
|
||||
image_properties_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *view;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (parent == NULL || GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (image),
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (image), context,
|
||||
_("Image Properties"),
|
||||
"gimp-image-properties",
|
||||
GTK_STOCK_INFO,
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
|
||||
GtkWidget * image_properties_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent);
|
||||
|
||||
|
||||
|
|
|
@ -93,8 +93,9 @@ image_scale_dialog_new (GimpImage *image,
|
|||
dialog->image = image;
|
||||
dialog->display = display;
|
||||
dialog->context = context;
|
||||
dialog->dialog = scale_dialog_new (GIMP_VIEWABLE (display->image),
|
||||
Q_("dialog-title|Scale Image"), "gimp-image-scale",
|
||||
dialog->dialog = scale_dialog_new (GIMP_VIEWABLE (display->image), context,
|
||||
Q_("dialog-title|Scale Image"),
|
||||
"gimp-image-scale",
|
||||
parent,
|
||||
gimp_standard_help_func,
|
||||
GIMP_HELP_IMAGE_SCALE,
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpcontainer.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
|
||||
|
@ -52,6 +53,7 @@ static gboolean layer_add_mask_dialog_channel_selected (GimpContainerView *vi
|
|||
|
||||
LayerAddMaskDialog *
|
||||
layer_add_mask_dialog_new (GimpLayer *layer,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
GimpAddMaskType add_mask_type,
|
||||
gboolean invert)
|
||||
|
@ -65,6 +67,7 @@ layer_add_mask_dialog_new (GimpLayer *layer,
|
|||
|
||||
g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
|
||||
dialog = g_new0 (LayerAddMaskDialog, 1);
|
||||
|
||||
|
@ -73,7 +76,7 @@ layer_add_mask_dialog_new (GimpLayer *layer,
|
|||
dialog->invert = invert;
|
||||
|
||||
dialog->dialog =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer),
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (layer), context,
|
||||
_("Add Layer Mask"), "gimp-layer-add-mask",
|
||||
GIMP_STOCK_LAYER_MASK,
|
||||
_("Add a Mask to the Layer"),
|
||||
|
@ -114,7 +117,7 @@ layer_add_mask_dialog_new (GimpLayer *layer,
|
|||
gtk_widget_show (frame);
|
||||
|
||||
combo = gimp_container_combo_box_new (GIMP_ITEM (layer)->image->channels,
|
||||
NULL,
|
||||
context,
|
||||
GIMP_VIEW_SIZE_SMALL, 1);
|
||||
gimp_enum_radio_frame_add (GTK_FRAME (frame), combo, GIMP_ADD_CHANNEL_MASK);
|
||||
gtk_widget_show (combo);
|
||||
|
|
|
@ -34,6 +34,7 @@ struct _LayerAddMaskDialog
|
|||
|
||||
|
||||
LayerAddMaskDialog * layer_add_mask_dialog_new (GimpLayer *layer,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
GimpAddMaskType add_mask_type,
|
||||
gboolean invert);
|
||||
|
|
|
@ -49,8 +49,8 @@ static void layer_options_dialog_toggle_rename (GtkWidget *widget,
|
|||
|
||||
LayerOptionsDialog *
|
||||
layer_options_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GimpLayer *layer,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
const gchar *layer_name,
|
||||
GimpFillType layer_fill_type,
|
||||
|
@ -70,6 +70,11 @@ layer_options_dialog_new (GimpImage *image,
|
|||
GtkWidget *frame;
|
||||
GtkWidget *button;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (layer == NULL || GIMP_IS_LAYER (layer), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
options = g_new0 (LayerOptionsDialog, 1);
|
||||
|
||||
options->image = image;
|
||||
|
@ -83,7 +88,8 @@ layer_options_dialog_new (GimpImage *image,
|
|||
viewable = GIMP_VIEWABLE (image);
|
||||
|
||||
options->dialog =
|
||||
gimp_viewable_dialog_new (viewable, title, role, stock_id, desc,
|
||||
gimp_viewable_dialog_new (viewable, context,
|
||||
title, role, stock_id, desc,
|
||||
parent,
|
||||
gimp_standard_help_func, help_id,
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ struct _LayerOptionsDialog
|
|||
|
||||
|
||||
LayerOptionsDialog * layer_options_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
GimpLayer *layer,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
const gchar *layer_name,
|
||||
GimpFillType layer_fill_type,
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpchannel.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpdrawable-offset.h"
|
||||
#include "core/gimplayer.h"
|
||||
|
@ -51,6 +52,8 @@ typedef struct _OffsetDialog OffsetDialog;
|
|||
|
||||
struct _OffsetDialog
|
||||
{
|
||||
GimpContext *context;
|
||||
|
||||
GtkWidget *dialog;
|
||||
GtkWidget *off_se;
|
||||
|
||||
|
@ -73,6 +76,7 @@ static void offset_halfheight_callback (GtkWidget *widget,
|
|||
|
||||
GtkWidget *
|
||||
offset_dialog_new (GimpDrawable *drawable,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent)
|
||||
{
|
||||
OffsetDialog *dialog;
|
||||
|
@ -87,10 +91,12 @@ offset_dialog_new (GimpDrawable *drawable,
|
|||
const gchar *title = NULL;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
dialog = g_new0 (OffsetDialog, 1);
|
||||
|
||||
dialog->context = context;
|
||||
dialog->fill_type = gimp_drawable_has_alpha (drawable) | WRAP_AROUND;
|
||||
dialog->image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
|
@ -104,7 +110,7 @@ offset_dialog_new (GimpDrawable *drawable,
|
|||
g_warning ("%s: unexpected drawable type", G_STRFUNC);
|
||||
|
||||
dialog->dialog =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable),
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (drawable), context,
|
||||
_("Offset"), "gimp-drawable-offset",
|
||||
GIMP_STOCK_TOOL_MOVE,
|
||||
title,
|
||||
|
@ -259,7 +265,7 @@ offset_response (GtkWidget *widget,
|
|||
1));
|
||||
|
||||
gimp_drawable_offset (drawable,
|
||||
gimp_get_user_context (image->gimp),
|
||||
dialog->context,
|
||||
dialog->fill_type & WRAP_AROUND ? TRUE : FALSE,
|
||||
dialog->fill_type & FILL_MASK,
|
||||
offset_x, offset_y);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
|
||||
GtkWidget * offset_dialog_new (GimpDrawable *drawable,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent);
|
||||
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "dialogs-types.h"
|
||||
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimp-utils.h"
|
||||
|
||||
|
@ -74,6 +75,7 @@ static void print_size_dialog_set_resolution (PrintSizeDialog *private,
|
|||
|
||||
GtkWidget *
|
||||
print_size_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
GtkWidget *parent,
|
||||
|
@ -96,9 +98,10 @@ print_size_dialog_new (GimpImage *image,
|
|||
GList *focus_chain = NULL;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (callback != NULL, NULL);
|
||||
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (image),
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (image), context,
|
||||
title, role,
|
||||
GIMP_STOCK_PRINT_RESOLUTION, title,
|
||||
parent,
|
||||
|
|
|
@ -29,6 +29,7 @@ typedef void (* GimpResolutionCallback) (GtkWidget *dialog,
|
|||
|
||||
|
||||
GtkWidget * print_size_dialog_new (GimpImage *image,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
GtkWidget *parent,
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "dialogs-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimplayer.h"
|
||||
|
||||
|
@ -79,6 +79,7 @@ static void offset_center_clicked (GtkWidget *widget,
|
|||
|
||||
GtkWidget *
|
||||
resize_dialog_new (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
GtkWidget *parent,
|
||||
|
@ -105,6 +106,7 @@ resize_dialog_new (GimpViewable *viewable,
|
|||
gdouble xres, yres;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_VIEWABLE (viewable), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (callback != NULL, NULL);
|
||||
|
||||
if (GIMP_IS_IMAGE (viewable))
|
||||
|
@ -132,7 +134,7 @@ resize_dialog_new (GimpViewable *viewable,
|
|||
g_return_val_if_reached (NULL);
|
||||
}
|
||||
|
||||
dialog = gimp_viewable_dialog_new (viewable,
|
||||
dialog = gimp_viewable_dialog_new (viewable, context,
|
||||
title, role, GIMP_STOCK_RESIZE, title,
|
||||
parent,
|
||||
help_func, help_id,
|
||||
|
@ -260,8 +262,7 @@ resize_dialog_new (GimpViewable *viewable,
|
|||
gtk_widget_show (private->area);
|
||||
|
||||
gimp_viewable_get_preview_size (viewable, 200, FALSE, TRUE, &width, &height);
|
||||
pixbuf = gimp_viewable_get_pixbuf (viewable,
|
||||
gimp_get_user_context (image->gimp),
|
||||
pixbuf = gimp_viewable_get_pixbuf (viewable, context,
|
||||
width, height);
|
||||
|
||||
if (pixbuf)
|
||||
|
|
|
@ -32,6 +32,7 @@ typedef void (* GimpResizeCallback) (GtkWidget *dialog,
|
|||
|
||||
|
||||
GtkWidget * resize_dialog_new (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
GtkWidget *parent,
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "dialogs-types.h"
|
||||
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpitem.h"
|
||||
|
||||
|
@ -62,6 +63,7 @@ static void scale_dialog_reset (ScaleDialog *private);
|
|||
|
||||
GtkWidget *
|
||||
scale_dialog_new (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
GtkWidget *parent,
|
||||
|
@ -84,6 +86,7 @@ scale_dialog_new (GimpViewable *viewable,
|
|||
gdouble xres, yres;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_VIEWABLE (viewable), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (callback != NULL, NULL);
|
||||
|
||||
if (GIMP_IS_IMAGE (viewable))
|
||||
|
@ -111,7 +114,7 @@ scale_dialog_new (GimpViewable *viewable,
|
|||
g_return_val_if_reached (NULL);
|
||||
}
|
||||
|
||||
dialog = gimp_viewable_dialog_new (viewable,
|
||||
dialog = gimp_viewable_dialog_new (viewable, context,
|
||||
title, role, GIMP_STOCK_SCALE, title,
|
||||
parent,
|
||||
help_func, help_id,
|
||||
|
|
|
@ -33,6 +33,7 @@ typedef void (* GimpScaleCallback) (GtkWidget *dialog,
|
|||
|
||||
|
||||
GtkWidget * scale_dialog_new (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
GtkWidget *parent,
|
||||
|
|
|
@ -64,12 +64,12 @@ static void stroke_dialog_paint_info_selected (GimpContainerView *view,
|
|||
|
||||
GtkWidget *
|
||||
stroke_dialog_new (GimpItem *item,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *stock_id,
|
||||
const gchar *help_id,
|
||||
GtkWidget *parent)
|
||||
{
|
||||
GimpContext *context;
|
||||
GimpStrokeDesc *desc;
|
||||
GimpStrokeDesc *saved_desc;
|
||||
GimpImage *image;
|
||||
|
@ -82,12 +82,12 @@ stroke_dialog_new (GimpItem *item,
|
|||
GtkWidget *frame;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_ITEM (item), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (stock_id != NULL, NULL);
|
||||
g_return_val_if_fail (help_id != NULL, NULL);
|
||||
g_return_val_if_fail (parent == NULL || GTK_IS_WIDGET (parent), NULL);
|
||||
|
||||
image = gimp_item_get_image (item);
|
||||
context = gimp_get_user_context (image->gimp);
|
||||
|
||||
desc = gimp_stroke_desc_new (context->gimp, context);
|
||||
|
||||
|
@ -96,7 +96,7 @@ stroke_dialog_new (GimpItem *item,
|
|||
if (saved_desc)
|
||||
gimp_config_sync (G_OBJECT (saved_desc), G_OBJECT (desc), 0);
|
||||
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (item),
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (item), context,
|
||||
title, "gimp-stroke-options",
|
||||
stock_id,
|
||||
_("Choose Stroke Style"),
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
|
||||
GtkWidget * stroke_dialog_new (GimpItem *item,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *stock_id,
|
||||
const gchar *help_id,
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "config/gimpcoreconfig.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimptemplate.h"
|
||||
|
||||
#include "widgets/gimptemplateeditor.h"
|
||||
|
@ -41,8 +42,8 @@
|
|||
/* public functions */
|
||||
|
||||
TemplateOptionsDialog *
|
||||
template_options_dialog_new (Gimp *gimp,
|
||||
GimpTemplate *template,
|
||||
template_options_dialog_new (GimpTemplate *template,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
|
@ -54,8 +55,8 @@ template_options_dialog_new (Gimp *gimp,
|
|||
GimpViewable *viewable = NULL;
|
||||
GtkWidget *vbox;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
|
||||
g_return_val_if_fail (template == NULL || GIMP_IS_TEMPLATE (template), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
g_return_val_if_fail (title != NULL, NULL);
|
||||
g_return_val_if_fail (role != NULL, NULL);
|
||||
|
@ -65,7 +66,7 @@ template_options_dialog_new (Gimp *gimp,
|
|||
|
||||
options = g_new0 (TemplateOptionsDialog, 1);
|
||||
|
||||
options->gimp = gimp;
|
||||
options->gimp = context->gimp;
|
||||
options->template = template;
|
||||
|
||||
if (template)
|
||||
|
@ -76,13 +77,13 @@ template_options_dialog_new (Gimp *gimp,
|
|||
else
|
||||
{
|
||||
template =
|
||||
gimp_config_duplicate (GIMP_CONFIG (gimp->config->default_image));
|
||||
gimp_config_duplicate (GIMP_CONFIG (options->gimp->config->default_image));
|
||||
|
||||
gimp_object_set_static_name (GIMP_OBJECT (template), _("Unnamed"));
|
||||
}
|
||||
|
||||
options->dialog =
|
||||
gimp_viewable_dialog_new (viewable,
|
||||
gimp_viewable_dialog_new (viewable, context,
|
||||
title, role, stock_id, desc,
|
||||
parent,
|
||||
gimp_standard_help_func, help_id,
|
||||
|
@ -105,7 +106,7 @@ template_options_dialog_new (Gimp *gimp,
|
|||
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (options->dialog)->vbox), vbox);
|
||||
gtk_widget_show (vbox);
|
||||
|
||||
options->editor = gimp_template_editor_new (template, gimp, TRUE);
|
||||
options->editor = gimp_template_editor_new (template, options->gimp, TRUE);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), options->editor, FALSE, FALSE, 0);
|
||||
gtk_widget_show (options->editor);
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ struct _TemplateOptionsDialog
|
|||
};
|
||||
|
||||
|
||||
TemplateOptionsDialog * template_options_dialog_new (Gimp *gimp,
|
||||
GimpTemplate *template,
|
||||
TemplateOptionsDialog * template_options_dialog_new (GimpTemplate *template,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "dialogs-types.h"
|
||||
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "vectors/gimpvectors.h"
|
||||
|
@ -42,6 +43,7 @@
|
|||
VectorsOptionsDialog *
|
||||
vectors_options_dialog_new (GimpImage *image,
|
||||
GimpVectors *vectors,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
const gchar *vectors_name,
|
||||
const gchar *title,
|
||||
|
@ -58,6 +60,7 @@ vectors_options_dialog_new (GimpImage *image,
|
|||
|
||||
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (vectors == NULL || GIMP_IS_VECTORS (vectors), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
g_return_val_if_fail (title != NULL, NULL);
|
||||
g_return_val_if_fail (role != NULL, NULL);
|
||||
|
@ -76,7 +79,7 @@ vectors_options_dialog_new (GimpImage *image,
|
|||
viewable = GIMP_VIEWABLE (image);
|
||||
|
||||
options->dialog =
|
||||
gimp_viewable_dialog_new (viewable,
|
||||
gimp_viewable_dialog_new (viewable, context,
|
||||
title, role, stock_id, desc,
|
||||
parent,
|
||||
gimp_standard_help_func,
|
||||
|
|
|
@ -34,6 +34,7 @@ struct _VectorsOptionsDialog
|
|||
|
||||
VectorsOptionsDialog * vectors_options_dialog_new (GimpImage *image,
|
||||
GimpVectors *vectors,
|
||||
GimpContext *context,
|
||||
GtkWidget *parent,
|
||||
const gchar *vectors_name,
|
||||
const gchar *title,
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
#include "display-types.h"
|
||||
|
||||
#include "core/gimpviewable.h"
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "widgets/gimpcolordisplayeditor.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
@ -62,14 +63,18 @@ GtkWidget *
|
|||
gimp_display_shell_filter_dialog_new (GimpDisplayShell *shell)
|
||||
{
|
||||
ColorDisplayDialog *cdd;
|
||||
GimpImage *image;
|
||||
GtkWidget *editor;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), NULL);
|
||||
|
||||
image = shell->display->image;
|
||||
|
||||
cdd = g_new0 (ColorDisplayDialog, 1);
|
||||
|
||||
cdd->shell = shell;
|
||||
cdd->dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->display->image),
|
||||
cdd->dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (image),
|
||||
gimp_get_user_context (image->gimp),
|
||||
_("Color Display Filters"),
|
||||
"gimp-display-filters",
|
||||
GIMP_STOCK_DISPLAY_FILTER,
|
||||
|
|
|
@ -444,6 +444,7 @@ void
|
|||
gimp_display_shell_scale_dialog (GimpDisplayShell *shell)
|
||||
{
|
||||
ScaleDialogData *data;
|
||||
GimpImage *image;
|
||||
GtkWidget *hbox;
|
||||
GtkWidget *table;
|
||||
GtkWidget *spin;
|
||||
|
@ -464,6 +465,8 @@ gimp_display_shell_scale_dialog (GimpDisplayShell *shell)
|
|||
shell->other_scale = gimp_zoom_model_get_factor (shell->zoom);
|
||||
}
|
||||
|
||||
image = shell->display->image;
|
||||
|
||||
data = g_new (ScaleDialogData, 1);
|
||||
|
||||
data->shell = shell;
|
||||
|
@ -472,7 +475,8 @@ gimp_display_shell_scale_dialog (GimpDisplayShell *shell)
|
|||
NULL);
|
||||
|
||||
shell->scale_dialog =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->display->image),
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (image),
|
||||
gimp_get_user_context (image->gimp),
|
||||
_("Zoom Ratio"), "display_scale",
|
||||
GTK_STOCK_ZOOM_100,
|
||||
_("Select Zoom Ratio"),
|
||||
|
|
|
@ -283,7 +283,8 @@ gimp_color_picker_tool_info_create (GimpColorPickerTool *picker_tool)
|
|||
gtk_window_set_focus_on_map (GTK_WINDOW (picker_tool->dialog), FALSE);
|
||||
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (picker_tool->dialog),
|
||||
GIMP_VIEWABLE (tool->drawable));
|
||||
GIMP_VIEWABLE (tool->drawable),
|
||||
GIMP_CONTEXT (tool->tool_info->tool_options));
|
||||
|
||||
g_signal_connect (picker_tool->dialog, "response",
|
||||
G_CALLBACK (gimp_color_picker_tool_info_response),
|
||||
|
|
|
@ -307,7 +307,8 @@ gimp_image_map_tool_initialize (GimpTool *tool,
|
|||
drawable = gimp_image_active_drawable (display->image);
|
||||
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (image_map_tool->shell),
|
||||
GIMP_VIEWABLE (drawable));
|
||||
GIMP_VIEWABLE (drawable),
|
||||
GIMP_CONTEXT (tool_info->tool_options));
|
||||
|
||||
gtk_widget_show (image_map_tool->shell);
|
||||
|
||||
|
|
|
@ -329,7 +329,8 @@ gimp_measure_tool_button_press (GimpTool *tool,
|
|||
|
||||
if (mtool->dialog)
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (mtool->dialog),
|
||||
GIMP_VIEWABLE (tool->display->image));
|
||||
GIMP_VIEWABLE (tool->display->image),
|
||||
GIMP_CONTEXT (options));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -867,6 +867,7 @@ gimp_text_tool_confirm_dialog (GimpTextTool *text_tool)
|
|||
}
|
||||
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (text_tool->layer),
|
||||
GIMP_CONTEXT (tool->tool_info->tool_options),
|
||||
_("Confirm Text Editing"),
|
||||
"gimp-text-tool-confirm",
|
||||
GIMP_STOCK_TEXT_LAYER,
|
||||
|
|
|
@ -1584,7 +1584,8 @@ gimp_transform_tool_prepare (GimpTransformTool *tr_tool,
|
|||
if (tr_tool->dialog)
|
||||
{
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (tr_tool->dialog),
|
||||
GIMP_VIEWABLE (gimp_image_active_drawable (display->image)));
|
||||
GIMP_VIEWABLE (gimp_image_active_drawable (display->image)),
|
||||
GIMP_CONTEXT (options));
|
||||
|
||||
gtk_widget_set_sensitive (tr_tool->dialog, TRUE);
|
||||
}
|
||||
|
|
|
@ -1902,6 +1902,7 @@ gimp_vector_tool_stroke_vectors (GimpVectorTool *vector_tool,
|
|||
}
|
||||
|
||||
dialog = stroke_dialog_new (GIMP_ITEM (vector_tool->vectors),
|
||||
GIMP_CONTEXT (GIMP_TOOL (vector_tool)->tool_info->tool_options),
|
||||
_("Stroke Path"),
|
||||
GIMP_STOCK_PATH_STROKE,
|
||||
GIMP_HELP_PATH_STROKE,
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "widgets-types.h"
|
||||
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpmarshal.h"
|
||||
#include "core/gimpviewable.h"
|
||||
|
||||
|
@ -234,6 +235,7 @@ gimp_color_dialog_response (GtkDialog *gtk_dialog,
|
|||
|
||||
GtkWidget *
|
||||
gimp_color_dialog_new (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
|
@ -248,6 +250,7 @@ gimp_color_dialog_new (GimpViewable *viewable,
|
|||
const gchar *role;
|
||||
|
||||
g_return_val_if_fail (viewable == NULL || GIMP_IS_VIEWABLE (viewable), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL);
|
||||
g_return_val_if_fail (dialog_factory == NULL ||
|
||||
GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL);
|
||||
|
@ -269,7 +272,7 @@ gimp_color_dialog_new (GimpViewable *viewable,
|
|||
|
||||
if (viewable)
|
||||
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (dialog),
|
||||
viewable);
|
||||
viewable, context);
|
||||
else
|
||||
gtk_widget_hide (GIMP_VIEWABLE_DIALOG (dialog)->icon->parent->parent);
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@ struct _GimpColorDialogClass
|
|||
GType gimp_color_dialog_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget * gimp_color_dialog_new (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *stock_id,
|
||||
const gchar *desc,
|
||||
|
|
|
@ -157,7 +157,7 @@ gimp_color_panel_clicked (GtkButton *button)
|
|||
if (! panel->color_dialog)
|
||||
{
|
||||
panel->color_dialog =
|
||||
gimp_color_dialog_new (NULL,
|
||||
gimp_color_dialog_new (NULL, NULL,
|
||||
GIMP_COLOR_BUTTON (button)->title,
|
||||
NULL, NULL,
|
||||
GTK_WIDGET (button),
|
||||
|
|
|
@ -664,7 +664,7 @@ gimp_controller_editor_edit_clicked (GtkWidget *button,
|
|||
event_blurb);
|
||||
|
||||
editor->edit_dialog =
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (editor->info),
|
||||
gimp_viewable_dialog_new (GIMP_VIEWABLE (editor->info), NULL, /* FIXME */
|
||||
_("Select Controller Event Action"),
|
||||
"gimp-controller-action-dialog",
|
||||
GTK_STOCK_EDIT,
|
||||
|
|
|
@ -629,7 +629,7 @@ gimp_controller_list_edit_clicked (GtkWidget *button,
|
|||
return;
|
||||
}
|
||||
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (list->dest_info),
|
||||
dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (list->dest_info), NULL, /* FIXME */
|
||||
_("Configure Controller"),
|
||||
"gimp-controller-editor-dialog",
|
||||
GTK_STOCK_EDIT,
|
||||
|
|
|
@ -148,7 +148,7 @@ color_area_color_clicked (GimpFgBgEditor *editor,
|
|||
|
||||
toplevel_factory = gimp_dialog_factory_from_name ("toplevel");
|
||||
|
||||
color_dialog = gimp_color_dialog_new (NULL, NULL, NULL, NULL,
|
||||
color_dialog = gimp_color_dialog_new (NULL, NULL, NULL, NULL, NULL,
|
||||
GTK_WIDGET (editor),
|
||||
toplevel_factory,
|
||||
"gimp-toolbox-color-dialog",
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include "widgets-types.h"
|
||||
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimage.h"
|
||||
#include "core/gimpitem.h"
|
||||
|
||||
|
@ -34,12 +35,14 @@
|
|||
|
||||
#include "gimpview.h"
|
||||
#include "gimpviewabledialog.h"
|
||||
#include "gimpviewrenderer.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_VIEWABLE,
|
||||
PROP_CONTEXT,
|
||||
PROP_STOCK_ID,
|
||||
PROP_DESC,
|
||||
PROP_PARENT
|
||||
|
@ -82,6 +85,10 @@ gimp_viewable_dialog_class_init (GimpViewableDialogClass *klass)
|
|||
g_param_spec_object ("viewable", NULL, NULL,
|
||||
GIMP_TYPE_VIEWABLE,
|
||||
GIMP_PARAM_READWRITE));
|
||||
g_object_class_install_property (object_class, PROP_CONTEXT,
|
||||
g_param_spec_object ("context", NULL, NULL,
|
||||
GIMP_TYPE_CONTEXT,
|
||||
GIMP_PARAM_READWRITE));
|
||||
g_object_class_install_property (object_class, PROP_STOCK_ID,
|
||||
g_param_spec_string ("stock-id", NULL, NULL,
|
||||
NULL,
|
||||
|
@ -158,7 +165,16 @@ gimp_viewable_dialog_set_property (GObject *object,
|
|||
switch (property_id)
|
||||
{
|
||||
case PROP_VIEWABLE:
|
||||
gimp_viewable_dialog_set_viewable (dialog, g_value_get_object (value));
|
||||
gimp_viewable_dialog_set_viewable (dialog,
|
||||
g_value_get_object (value),
|
||||
dialog->context);
|
||||
break;
|
||||
case PROP_CONTEXT:
|
||||
gimp_viewable_dialog_set_viewable (dialog,
|
||||
dialog->view ?
|
||||
GIMP_VIEW (dialog->view)->viewable :
|
||||
NULL,
|
||||
g_value_get_object (value));
|
||||
break;
|
||||
case PROP_STOCK_ID:
|
||||
gtk_image_set_from_stock (GTK_IMAGE (dialog->icon),
|
||||
|
@ -205,6 +221,9 @@ gimp_viewable_dialog_get_property (GObject *object,
|
|||
dialog->view ?
|
||||
GIMP_VIEW (dialog->view)->viewable : NULL);
|
||||
break;
|
||||
case PROP_CONTEXT:
|
||||
g_value_set_object (value, dialog->context);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
|
@ -217,13 +236,14 @@ gimp_viewable_dialog_destroy (GtkObject *object)
|
|||
GimpViewableDialog *dialog = GIMP_VIEWABLE_DIALOG (object);
|
||||
|
||||
if (dialog->view)
|
||||
gimp_viewable_dialog_set_viewable (dialog, NULL);
|
||||
gimp_viewable_dialog_set_viewable (dialog, NULL, NULL);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gimp_viewable_dialog_new (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
const gchar *stock_id,
|
||||
|
@ -237,6 +257,7 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
|
|||
va_list args;
|
||||
|
||||
g_return_val_if_fail (viewable == NULL || GIMP_IS_VIEWABLE (viewable), NULL);
|
||||
g_return_val_if_fail (context == NULL || GIMP_IS_CONTEXT (context), NULL);
|
||||
g_return_val_if_fail (title != NULL, NULL);
|
||||
g_return_val_if_fail (role != NULL, NULL);
|
||||
g_return_val_if_fail (parent == NULL || GTK_IS_WIDGET (parent), NULL);
|
||||
|
@ -246,6 +267,7 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
|
|||
|
||||
dialog = g_object_new (GIMP_TYPE_VIEWABLE_DIALOG,
|
||||
"viewable", viewable,
|
||||
"context", context,
|
||||
"title", title,
|
||||
"role", role,
|
||||
"help-func", help_func,
|
||||
|
@ -264,17 +286,25 @@ gimp_viewable_dialog_new (GimpViewable *viewable,
|
|||
|
||||
void
|
||||
gimp_viewable_dialog_set_viewable (GimpViewableDialog *dialog,
|
||||
GimpViewable *viewable)
|
||||
GimpViewable *viewable,
|
||||
GimpContext *context)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_VIEWABLE_DIALOG (dialog));
|
||||
g_return_if_fail (viewable == NULL || GIMP_IS_VIEWABLE (viewable));
|
||||
g_return_if_fail (context == NULL || GIMP_IS_CONTEXT (context));
|
||||
|
||||
dialog->context = context;
|
||||
|
||||
if (dialog->view)
|
||||
{
|
||||
GimpViewable *old_viewable = GIMP_VIEW (dialog->view)->viewable;
|
||||
|
||||
if (viewable == old_viewable)
|
||||
{
|
||||
gimp_view_renderer_set_context (GIMP_VIEW (dialog->view)->renderer,
|
||||
context);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_destroy (dialog->view);
|
||||
|
||||
|
@ -298,8 +328,7 @@ gimp_viewable_dialog_set_viewable (GimpViewableDialog *dialog,
|
|||
dialog,
|
||||
0);
|
||||
|
||||
dialog->view = gimp_view_new (NULL, /* FIXME */
|
||||
viewable, 32, 1, TRUE);
|
||||
dialog->view = gimp_view_new (context, viewable, 32, 1, TRUE);
|
||||
gtk_box_pack_end (GTK_BOX (dialog->icon->parent), dialog->view,
|
||||
FALSE, FALSE, 2);
|
||||
gtk_widget_show (dialog->view);
|
||||
|
|
|
@ -41,6 +41,8 @@ struct _GimpViewableDialog
|
|||
{
|
||||
GimpDialog parent_instance;
|
||||
|
||||
GimpContext *context;
|
||||
|
||||
GtkWidget *icon;
|
||||
GtkWidget *view;
|
||||
GtkWidget *desc_label;
|
||||
|
@ -56,6 +58,7 @@ struct _GimpViewableDialogClass
|
|||
GType gimp_viewable_dialog_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkWidget * gimp_viewable_dialog_new (GimpViewable *viewable,
|
||||
GimpContext *context,
|
||||
const gchar *title,
|
||||
const gchar *role,
|
||||
const gchar *stock_id,
|
||||
|
@ -66,7 +69,8 @@ GtkWidget * gimp_viewable_dialog_new (GimpViewable *viewable,
|
|||
...) G_GNUC_NULL_TERMINATED;
|
||||
|
||||
void gimp_viewable_dialog_set_viewable (GimpViewableDialog *dialog,
|
||||
GimpViewable *viewable);
|
||||
GimpViewable *viewable,
|
||||
GimpContext *context);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
|
Loading…
Reference in New Issue