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:
committed by
Michael Natterer
parent
0051a8599f
commit
a6dbb78dfa
@ -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,12 +91,14 @@ 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));
|
||||
dialog->image = gimp_item_get_image (GIMP_ITEM (drawable));
|
||||
|
||||
if (GIMP_IS_LAYER (drawable))
|
||||
title = _("Offset Layer");
|
||||
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user