From 905fdfcbed8acf38ac8fe53b0595aca5d8f355ff Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 28 Mar 2006 17:08:36 +0000 Subject: [PATCH] did a global gimage -> image substitution. 2006-03-28 Sven Neumann * app/*: did a global gimage -> image substitution. --- ChangeLog | 4 + app/actions/actions.c | 10 +- app/actions/actions.h | 30 +- app/actions/buffers-commands.c | 12 +- app/actions/channels-actions.c | 14 +- app/actions/channels-commands.c | 112 +- app/actions/colormap-actions.c | 14 +- app/actions/colormap-commands.c | 30 +- app/actions/colormap-editor-actions.c | 14 +- app/actions/colormap-editor-commands.c | 30 +- app/actions/documents-commands.c | 8 +- app/actions/drawable-actions.c | 8 +- app/actions/drawable-commands.c | 66 +- app/actions/edit-actions.c | 18 +- app/actions/edit-commands.c | 138 +- app/actions/file-actions.c | 18 +- app/actions/file-commands.c | 102 +- app/actions/image-actions.c | 50 +- app/actions/image-commands.c | 82 +- app/actions/images-commands.c | 2 +- app/actions/layers-actions.c | 20 +- app/actions/layers-commands.c | 242 +-- app/actions/plug-in-actions.c | 6 +- app/actions/plug-in-commands.c | 12 +- app/actions/quick-mask-actions.c | 18 +- app/actions/quick-mask-commands.c | 34 +- app/actions/select-actions.c | 10 +- app/actions/select-commands.c | 138 +- app/actions/vectors-actions.c | 26 +- app/actions/vectors-commands.c | 168 +- app/actions/view-actions.c | 4 +- app/actions/view-commands.c | 10 +- app/app_procs.c | 14 +- app/core/gimp-edit.c | 156 +- app/core/gimp-edit.h | 20 +- app/core/gimp-gui.c | 6 +- app/core/gimp-gui.h | 4 +- app/core/gimp-transform-region.c | 66 +- app/core/gimp.c | 10 +- app/core/gimpchannel.c | 42 +- app/core/gimpchannel.h | 8 +- app/core/gimpcontext.c | 8 +- app/core/gimpdrawable-blend.c | 24 +- app/core/gimpdrawable-bucket-fill.c | 22 +- app/core/gimpdrawable-combine.c | 16 +- app/core/gimpdrawable-equalize.c | 4 +- app/core/gimpdrawable-foreground-extract.c | 8 +- app/core/gimpdrawable-histogram.c | 6 +- app/core/gimpdrawable-preview.c | 20 +- app/core/gimpdrawable-stroke.c | 18 +- app/core/gimpdrawable-transform.c | 66 +- app/core/gimpdrawable.c | 68 +- app/core/gimpdrawable.h | 2 +- app/core/gimpimage-colorhash.c | 26 +- app/core/gimpimage-colorhash.h | 4 +- app/core/gimpimage-colormap.c | 86 +- app/core/gimpimage-colormap.h | 12 +- app/core/gimpimage-contiguous-region.c | 46 +- app/core/gimpimage-contiguous-region.h | 4 +- app/core/gimpimage-convert.c | 68 +- app/core/gimpimage-convert.h | 2 +- app/core/gimpimage-crop.c | 72 +- app/core/gimpimage-crop.h | 4 +- app/core/gimpimage-duplicate.c | 110 +- app/core/gimpimage-duplicate.h | 2 +- app/core/gimpimage-flip.c | 50 +- app/core/gimpimage-flip.h | 2 +- app/core/gimpimage-grid.c | 16 +- app/core/gimpimage-grid.h | 4 +- app/core/gimpimage-guides.c | 84 +- app/core/gimpimage-guides.h | 16 +- app/core/gimpimage-merge.c | 118 +- app/core/gimpimage-merge.h | 10 +- app/core/gimpimage-new.c | 8 +- app/core/gimpimage-new.h | 2 +- app/core/gimpimage-pick-color.c | 10 +- app/core/gimpimage-pick-color.h | 2 +- app/core/gimpimage-preview.c | 62 +- app/core/gimpimage-quick-mask.c | 82 +- app/core/gimpimage-quick-mask.h | 12 +- app/core/gimpimage-resize.c | 62 +- app/core/gimpimage-resize.h | 6 +- app/core/gimpimage-rotate.c | 120 +- app/core/gimpimage-rotate.h | 2 +- app/core/gimpimage-sample-points.c | 68 +- app/core/gimpimage-sample-points.h | 18 +- app/core/gimpimage-scale.c | 82 +- app/core/gimpimage-scale.h | 4 +- app/core/gimpimage-snap.c | 92 +- app/core/gimpimage-snap.h | 8 +- app/core/gimpimage-undo-push.c | 488 +++--- app/core/gimpimage-undo-push.h | 84 +- app/core/gimpimage-undo.c | 166 +- app/core/gimpimage-undo.h | 14 +- app/core/gimpimage.c | 1620 +++++++++--------- app/core/gimpimage.h | 270 +-- app/core/gimpimagefile.c | 26 +- app/core/gimpimagefile.h | 2 +- app/core/gimpimagemap.c | 34 +- app/core/gimpitem-align.c | 6 +- app/core/gimpitem-linked.c | 10 +- app/core/gimpitem-preview.c | 26 +- app/core/gimpitem.c | 132 +- app/core/gimpitem.h | 6 +- app/core/gimplayer-floating-sel.c | 84 +- app/core/gimplayer.c | 126 +- app/core/gimplayer.h | 8 +- app/core/gimplayermask.c | 14 +- app/core/gimplayermask.h | 2 +- app/core/gimppalette-import.c | 24 +- app/core/gimppalette-import.h | 4 +- app/core/gimpprojection-construct.c | 48 +- app/core/gimpprojection.c | 76 +- app/core/gimpprojection.h | 6 +- app/core/gimpselection.c | 66 +- app/core/gimpselection.h | 2 +- app/core/gimptemplate.c | 46 +- app/core/gimptemplate.h | 2 +- app/core/gimpundo.c | 14 +- app/core/gimpundo.h | 2 +- app/core/gimpundostack.c | 6 +- app/core/gimpundostack.h | 2 +- app/dialogs/channel-options-dialog.c | 8 +- app/dialogs/channel-options-dialog.h | 4 +- app/dialogs/convert-dialog.c | 18 +- app/dialogs/convert-dialog.h | 2 +- app/dialogs/dialogs-constructors.c | 4 +- app/dialogs/file-open-dialog.c | 46 +- app/dialogs/file-save-dialog.c | 14 +- app/dialogs/grid-dialog.c | 24 +- app/dialogs/grid-dialog.h | 2 +- app/dialogs/image-merge-layers-dialog.c | 2 +- app/dialogs/image-merge-layers-dialog.h | 2 +- app/dialogs/image-new-dialog.c | 6 +- app/dialogs/image-new-dialog.h | 2 +- app/dialogs/image-scale-dialog.c | 4 +- app/dialogs/image-scale-dialog.h | 2 +- app/dialogs/layer-options-dialog.c | 19 +- app/dialogs/layer-options-dialog.h | 4 +- app/dialogs/offset-dialog.c | 36 +- app/dialogs/palette-import-dialog.c | 38 +- app/dialogs/quit-dialog.c | 2 +- app/dialogs/vectors-options-dialog.c | 8 +- app/dialogs/vectors-options-dialog.h | 4 +- app/display/gimpdisplay-foreach.c | 8 +- app/display/gimpdisplay-handlers.c | 50 +- app/display/gimpdisplay-handlers.h | 2 +- app/display/gimpdisplay.c | 50 +- app/display/gimpdisplay.h | 8 +- app/display/gimpdisplayshell-appearance.c | 8 +- app/display/gimpdisplayshell-autoscroll.c | 4 +- app/display/gimpdisplayshell-callbacks.c | 62 +- app/display/gimpdisplayshell-close.c | 32 +- app/display/gimpdisplayshell-cursor.c | 8 +- app/display/gimpdisplayshell-dnd.c | 106 +- app/display/gimpdisplayshell-draw.c | 24 +- app/display/gimpdisplayshell-filter-dialog.c | 2 +- app/display/gimpdisplayshell-handlers.c | 172 +- app/display/gimpdisplayshell-layer-select.c | 36 +- app/display/gimpdisplayshell-preview.c | 4 +- app/display/gimpdisplayshell-render.c | 6 +- app/display/gimpdisplayshell-scale.c | 38 +- app/display/gimpdisplayshell-scroll.c | 4 +- app/display/gimpdisplayshell-selection.c | 8 +- app/display/gimpdisplayshell-title.c | 6 +- app/display/gimpdisplayshell-transform.c | 12 +- app/display/gimpdisplayshell.c | 50 +- app/display/gimpdisplayshell.h | 8 +- app/display/gimpnavigationeditor.c | 6 +- app/display/gimpstatusbar.c | 10 +- app/file/file-open.c | 40 +- app/file/file-save.c | 34 +- app/file/file-save.h | 2 +- app/gui/gui-vtable.c | 8 +- app/gui/gui.c | 8 +- app/paint/gimpclone.c | 20 +- app/paint/gimpconvolve.c | 6 +- app/paint/gimpdodgeburn.c | 8 +- app/paint/gimperaser.c | 8 +- app/paint/gimpink-undo.c | 8 +- app/paint/gimpink-undo.h | 2 +- app/paint/gimpink.c | 6 +- app/paint/gimppaintbrush.c | 12 +- app/paint/gimppaintcore-stroke.c | 4 +- app/paint/gimppaintcore-undo.c | 6 +- app/paint/gimppaintcore-undo.h | 2 +- app/paint/gimppaintcore.c | 36 +- app/paint/gimppaintcore.h | 2 +- app/paint/gimppaintoptions.c | 22 +- app/paint/gimppaintoptions.h | 6 +- app/paint/gimpsmudge.c | 10 +- app/paint/gimpsourcecore.c | 20 +- app/text/gimptext-compat.c | 16 +- app/text/gimptext-compat.h | 2 +- app/text/gimptextlayer-xcf.c | 4 +- app/text/gimptextlayer.c | 20 +- app/tools/gimpaligntool.c | 17 +- app/tools/gimpblendtool.c | 14 +- app/tools/gimpbrightnesscontrasttool.c | 2 +- app/tools/gimpbrushtool.c | 34 +- app/tools/gimpbucketfilltool.c | 10 +- app/tools/gimpbycolorselecttool.c | 16 +- app/tools/gimpclonetool.c | 4 +- app/tools/gimpcolorbalancetool.c | 2 +- app/tools/gimpcolorizetool.c | 2 +- app/tools/gimpcolorpickertool.c | 2 +- app/tools/gimpcolortool.c | 28 +- app/tools/gimpcroptool.c | 12 +- app/tools/gimpcurvestool.c | 4 +- app/tools/gimpdrawtool.c | 2 +- app/tools/gimpeditselectiontool.c | 76 +- app/tools/gimpellipseselecttool.c | 2 +- app/tools/gimpfliptool.c | 4 +- app/tools/gimpforegroundselecttool-undo.c | 6 +- app/tools/gimpforegroundselecttool-undo.h | 2 +- app/tools/gimpforegroundselecttool.c | 18 +- app/tools/gimpfreeselecttool.c | 10 +- app/tools/gimpfuzzyselecttool.c | 18 +- app/tools/gimphuesaturationtool.c | 2 +- app/tools/gimpimagemaptool.c | 10 +- app/tools/gimpiscissorstool.c | 76 +- app/tools/gimplevelstool.c | 2 +- app/tools/gimpmagnifytool.c | 4 +- app/tools/gimpmeasuretool.c | 22 +- app/tools/gimpmovetool.c | 66 +- app/tools/gimpnewrectselecttool.c | 18 +- app/tools/gimppainttool.c | 34 +- app/tools/gimpposterizetool.c | 2 +- app/tools/gimprectangleselecttool.c | 18 +- app/tools/gimprectangletool.c | 28 +- app/tools/gimprectselecttool.c | 30 +- app/tools/gimpregionselecttool.c | 18 +- app/tools/gimprotatetool.c | 8 +- app/tools/gimpscaletool.c | 8 +- app/tools/gimpselectiontool.c | 6 +- app/tools/gimpsourcetool.c | 4 +- app/tools/gimptexttool.c | 4 +- app/tools/gimpthresholdtool.c | 2 +- app/tools/gimptool.c | 2 +- app/tools/gimptransformtool-undo.c | 6 +- app/tools/gimptransformtool-undo.h | 2 +- app/tools/gimptransformtool.c | 42 +- app/tools/gimpvectortool.c | 56 +- app/tools/tool_manager.c | 12 +- app/vectors/gimpvectors-compat.c | 17 +- app/vectors/gimpvectors-compat.h | 4 +- app/vectors/gimpvectors-preview.c | 4 +- app/vectors/gimpvectors.c | 12 +- app/vectors/gimpvectors.h | 2 +- app/widgets/gimpchanneltreeview.c | 34 +- app/widgets/gimpcolormapeditor.c | 108 +- app/widgets/gimpcomponenteditor.c | 80 +- app/widgets/gimpdnd.c | 14 +- app/widgets/gimpdrawabletreeview.c | 38 +- app/widgets/gimpfiledialog.c | 12 +- app/widgets/gimpfiledialog.h | 4 +- app/widgets/gimphistogrameditor.c | 30 +- app/widgets/gimpimageeditor.c | 32 +- app/widgets/gimpimageeditor.h | 6 +- app/widgets/gimpimagepropview.c | 4 +- app/widgets/gimpitemtreeview.c | 106 +- app/widgets/gimpitemtreeview.h | 22 +- app/widgets/gimplayertreeview.c | 90 +- app/widgets/gimpmenudock.c | 40 +- app/widgets/gimpsamplepointeditor.c | 60 +- app/widgets/gimpselectiondata.c | 12 +- app/widgets/gimpselectiondata.h | 4 +- app/widgets/gimpselectioneditor.c | 46 +- app/widgets/gimptoolbox-dnd.c | 22 +- app/widgets/gimpundoeditor.c | 62 +- app/widgets/gimpvectorstreeview.c | 10 +- app/widgets/gimpviewrendererdrawable.c | 32 +- app/widgets/gimpviewrendererimage.c | 16 +- app/xcf/xcf-load.c | 202 +-- app/xcf/xcf-save.c | 232 +-- app/xcf/xcf-save.h | 4 +- app/xcf/xcf.c | 18 +- 277 files changed, 5129 insertions(+), 5134 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1babdfa7fc..6ec448a7df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-03-28 Sven Neumann + + * app/*: did a global gimage -> image substitution. + 2006-03-28 Michael Natterer * app/core/gimpparamspecs.[ch] (gimp_param_spec_string): reordered diff --git a/app/actions/actions.c b/app/actions/actions.c index 23a092df45..5b092f9279 100644 --- a/app/actions/actions.c +++ b/app/actions/actions.c @@ -251,7 +251,7 @@ action_data_get_gimp (gpointer data) return NULL; if (GIMP_IS_DISPLAY (data)) - return ((GimpDisplay *) data)->gimage->gimp; + return ((GimpDisplay *) data)->image->gimp; else if (GIMP_IS_GIMP (data)) return data; else if (GIMP_IS_DOCK (data)) @@ -280,7 +280,7 @@ action_data_get_context (gpointer data) return NULL; if (GIMP_IS_DISPLAY (data)) - return gimp_get_user_context (((GimpDisplay *) data)->gimage->gimp); + return gimp_get_user_context (((GimpDisplay *) data)->image->gimp); else if (GIMP_IS_GIMP (data)) return gimp_get_user_context (data); else if (GIMP_IS_DOCK (data)) @@ -308,15 +308,15 @@ action_data_get_image (gpointer data) return NULL; if (GIMP_IS_DISPLAY (data)) - return ((GimpDisplay *) data)->gimage; + return ((GimpDisplay *) data)->image; else if (GIMP_IS_GIMP (data)) context = gimp_get_user_context (data); else if (GIMP_IS_DOCK (data)) context = ((GimpDock *) data)->context; else if (GIMP_IS_ITEM_TREE_VIEW (data)) - return ((GimpItemTreeView *) data)->gimage; + return ((GimpItemTreeView *) data)->image; else if (GIMP_IS_IMAGE_EDITOR (data)) - return ((GimpImageEditor *) data)->gimage; + return ((GimpImageEditor *) data)->image; else if (GIMP_IS_NAVIGATION_EDITOR (data)) context = ((GimpNavigationEditor *) data)->context; diff --git a/app/actions/actions.h b/app/actions/actions.h index bb5d82cf00..29bc40da78 100644 --- a/app/actions/actions.h +++ b/app/actions/actions.h @@ -60,9 +60,9 @@ GimpObject * action_select_object (GimpActionSelectType select_type, if (! context) \ return -#define return_if_no_image(gimage,data) \ - gimage = action_data_get_image (data); \ - if (! gimage) \ +#define return_if_no_image(image,data) \ + image = action_data_get_image (data); \ + if (! image) \ return #define return_if_no_display(gdisp,data) \ @@ -76,27 +76,27 @@ GimpObject * action_select_object (GimpActionSelectType select_type, return -#define return_if_no_drawable(gimage,drawable,data) \ - return_if_no_image (gimage,data); \ - drawable = gimp_image_active_drawable (gimage); \ +#define return_if_no_drawable(image,drawable,data) \ + return_if_no_image (image,data); \ + drawable = gimp_image_active_drawable (image); \ if (! drawable) \ return -#define return_if_no_layer(gimage,layer,data) \ - return_if_no_image (gimage,data); \ - layer = gimp_image_get_active_layer (gimage); \ +#define return_if_no_layer(image,layer,data) \ + return_if_no_image (image,data); \ + layer = gimp_image_get_active_layer (image); \ if (! layer) \ return -#define return_if_no_channel(gimage,channel,data) \ - return_if_no_image (gimage,data); \ - channel = gimp_image_get_active_channel (gimage); \ +#define return_if_no_channel(image,channel,data) \ + return_if_no_image (image,data); \ + channel = gimp_image_get_active_channel (image); \ if (! channel) \ return -#define return_if_no_vectors(gimage,vectors,data) \ - return_if_no_image (gimage,data); \ - vectors = gimp_image_get_active_vectors (gimage); \ +#define return_if_no_vectors(image,vectors,data) \ + return_if_no_image (image,data); \ + vectors = gimp_image_get_active_vectors (image); \ if (! vectors) \ return diff --git a/app/actions/buffers-commands.c b/app/actions/buffers-commands.c index 91dcd2cbca..c4ce071ef0 100644 --- a/app/actions/buffers-commands.c +++ b/app/actions/buffers-commands.c @@ -136,7 +136,7 @@ buffers_paste (GimpBufferView *view, if (buffer && gimp_container_have (container, GIMP_OBJECT (buffer))) { GimpDisplay *gdisp = gimp_context_get_display (context); - GimpImage *gimage = NULL; + GimpImage *image = NULL; gint x = -1; gint y = -1; gint width = -1; @@ -149,19 +149,19 @@ buffers_paste (GimpBufferView *view, gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height); - gimage = gdisp->gimage; + image = gdisp->image; } else { - gimage = gimp_context_get_image (context); + image = gimp_context_get_image (context); } - if (gimage) + if (image) { - gimp_edit_paste (gimage, gimp_image_active_drawable (gimage), + gimp_edit_paste (image, gimp_image_active_drawable (image), buffer, paste_into, x, y, width, height); - gimp_image_flush (gimage); + gimp_image_flush (image); } } } diff --git a/app/actions/channels-actions.c b/app/actions/channels-actions.c index 4bb31b0256..6684fdc987 100644 --- a/app/actions/channels-actions.c +++ b/app/actions/channels-actions.c @@ -144,16 +144,16 @@ void channels_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); GimpChannel *channel = NULL; gboolean fs = FALSE; gboolean component = FALSE; GList *next = NULL; GList *prev = NULL; - if (gimage) + if (image) { - fs = (gimp_image_floating_sel (gimage) != NULL); + fs = (gimp_image_floating_sel (image) != NULL); if (GIMP_IS_COMPONENT_EDITOR (data)) { @@ -162,13 +162,13 @@ channels_actions_update (GimpActionGroup *group, } else { - channel = gimp_image_get_active_channel (gimage); + channel = gimp_image_get_active_channel (image); if (channel) { GList *list; - list = g_list_find (GIMP_LIST (gimage->channels)->list, channel); + list = g_list_find (GIMP_LIST (image->channels)->list, channel); if (list) { @@ -184,8 +184,8 @@ channels_actions_update (GimpActionGroup *group, SET_SENSITIVE ("channels-edit-attributes", !fs && channel); - SET_SENSITIVE ("channels-new", !fs && gimage); - SET_SENSITIVE ("channels-new-last-values", !fs && gimage); + SET_SENSITIVE ("channels-new", !fs && image); + SET_SENSITIVE ("channels-new-last-values", !fs && image); SET_SENSITIVE ("channels-duplicate", !fs && (channel || component)); SET_SENSITIVE ("channels-delete", !fs && channel); diff --git a/app/actions/channels-commands.c b/app/actions/channels-commands.c index 5cf736b297..8da72d531d 100644 --- a/app/actions/channels-commands.c +++ b/app/actions/channels-commands.c @@ -71,13 +71,13 @@ channels_edit_attributes_cmd_callback (GtkAction *action, gpointer data) { ChannelOptionsDialog *options; - GimpImage *gimage; + GimpImage *image; GimpChannel *channel; GtkWidget *widget; - return_if_no_channel (gimage, channel, data); + return_if_no_channel (image, channel, data); return_if_no_widget (widget, data); - options = channel_options_dialog_new (gimage, + options = channel_options_dialog_new (image, action_data_get_context (data), channel, widget, @@ -104,12 +104,12 @@ channels_new_cmd_callback (GtkAction *action, gpointer data) { ChannelOptionsDialog *options; - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); - options = channel_options_dialog_new (gimage, + options = channel_options_dialog_new (image, action_data_get_context (data), NULL, widget, @@ -136,11 +136,11 @@ void channels_new_last_vals_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpChannel *new_channel; gint width, height; GimpRGB color; - return_if_no_image (gimage, data); + return_if_no_image (image, data); if (GIMP_IS_CHANNEL (GIMP_ACTION (action)->viewable)) { @@ -152,15 +152,15 @@ channels_new_last_vals_cmd_callback (GtkAction *action, } else { - width = gimp_image_get_width (gimage); - height = gimp_image_get_height (gimage); + width = gimp_image_get_width (image); + height = gimp_image_get_height (image); color = channel_color; } - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, _("New Channel")); - new_channel = gimp_channel_new (gimage, width, height, + new_channel = gimp_channel_new (image, width, height, channel_name ? channel_name : _("New Channel"), &color); @@ -168,66 +168,66 @@ channels_new_last_vals_cmd_callback (GtkAction *action, action_data_get_context (data), GIMP_TRANSPARENT_FILL); - gimp_image_add_channel (gimage, new_channel, -1); + gimp_image_add_channel (image, new_channel, -1); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_image_flush (gimage); + gimp_image_flush (image); } void channels_raise_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpChannel *channel; - return_if_no_channel (gimage, channel, data); + return_if_no_channel (image, channel, data); - gimp_image_raise_channel (gimage, channel); - gimp_image_flush (gimage); + gimp_image_raise_channel (image, channel); + gimp_image_flush (image); } void channels_raise_to_top_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpChannel *channel; - return_if_no_channel (gimage, channel, data); + return_if_no_channel (image, channel, data); - gimp_image_raise_channel_to_top (gimage, channel); - gimp_image_flush (gimage); + gimp_image_raise_channel_to_top (image, channel); + gimp_image_flush (image); } void channels_lower_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpChannel *channel; - return_if_no_channel (gimage, channel, data); + return_if_no_channel (image, channel, data); - gimp_image_lower_channel (gimage, channel); - gimp_image_flush (gimage); + gimp_image_lower_channel (image, channel); + gimp_image_flush (image); } void channels_lower_to_bottom_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpChannel *channel; - return_if_no_channel (gimage, channel, data); + return_if_no_channel (image, channel, data); - gimp_image_lower_channel_to_bottom (gimage, channel); - gimp_image_flush (gimage); + gimp_image_lower_channel_to_bottom (image, channel); + gimp_image_flush (image); } void channels_duplicate_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpChannel *new_channel; if (GIMP_IS_COMPONENT_EDITOR (data)) @@ -235,7 +235,7 @@ channels_duplicate_cmd_callback (GtkAction *action, GimpChannelType component; const gchar *desc; gchar *name; - return_if_no_image (gimage, data); + return_if_no_image (image, data); component = GIMP_COMPONENT_EDITOR (data)->clicked_component; @@ -244,7 +244,7 @@ channels_duplicate_cmd_callback (GtkAction *action, name = g_strdup_printf (_("%s Channel Copy"), desc); - new_channel = gimp_channel_new_from_component (gimage, component, + new_channel = gimp_channel_new_from_component (image, component, name, NULL); /* copied components are invisible by default so subsequent copies @@ -257,7 +257,7 @@ channels_duplicate_cmd_callback (GtkAction *action, else { GimpChannel *channel; - return_if_no_channel (gimage, channel, data); + return_if_no_channel (image, channel, data); new_channel = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (channel), @@ -265,20 +265,20 @@ channels_duplicate_cmd_callback (GtkAction *action, TRUE)); } - gimp_image_add_channel (gimage, new_channel, -1); - gimp_image_flush (gimage); + gimp_image_add_channel (image, new_channel, -1); + gimp_image_flush (image); } void channels_delete_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpChannel *channel; - return_if_no_channel (gimage, channel, data); + return_if_no_channel (image, channel, data); - gimp_image_remove_channel (gimage, channel); - gimp_image_flush (gimage); + gimp_image_remove_channel (image, channel); + gimp_image_flush (image); } void @@ -287,32 +287,32 @@ channels_to_selection_cmd_callback (GtkAction *action, gpointer data) { GimpChannelOps op; - GimpImage *gimage; + GimpImage *image; op = (GimpChannelOps) value; if (GIMP_IS_COMPONENT_EDITOR (data)) { GimpChannelType component; - return_if_no_image (gimage, data); + return_if_no_image (image, data); component = GIMP_COMPONENT_EDITOR (data)->clicked_component; - gimp_channel_select_component (gimp_image_get_mask (gimage), component, + gimp_channel_select_component (gimp_image_get_mask (image), component, op, FALSE, 0.0, 0.0); } else { GimpChannel *channel; - return_if_no_channel (gimage, channel, data); + return_if_no_channel (image, channel, data); - gimp_channel_select_channel (gimp_image_get_mask (gimage), + gimp_channel_select_channel (gimp_image_get_mask (image), _("Channel to Selection"), channel, 0, 0, op, FALSE, 0.0, 0.0); } - gimp_image_flush (gimage); + gimp_image_flush (image); } @@ -337,7 +337,7 @@ channels_new_channel_response (GtkWidget *widget, if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (options->save_sel_checkbutton))) { - GimpChannel *selection = gimp_image_get_mask (options->gimage); + GimpChannel *selection = gimp_image_get_mask (options->image); new_channel = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection), @@ -349,9 +349,9 @@ channels_new_channel_response (GtkWidget *widget, } else { - new_channel = gimp_channel_new (options->gimage, - options->gimage->width, - options->gimage->height, + new_channel = gimp_channel_new (options->image, + options->image->width, + options->image->height, channel_name, &channel_color); @@ -360,8 +360,8 @@ channels_new_channel_response (GtkWidget *widget, GIMP_TRANSPARENT_FILL); } - gimp_image_add_channel (options->gimage, new_channel, -1); - gimp_image_flush (options->gimage); + gimp_image_add_channel (options->image, new_channel, -1); + gimp_image_flush (options->image); } gtk_widget_destroy (options->dialog); @@ -392,7 +392,7 @@ channels_edit_channel_response (GtkWidget *widget, color_changed = TRUE; if (name_changed && color_changed) - gimp_image_undo_group_start (options->gimage, + gimp_image_undo_group_start (options->image, GIMP_UNDO_GROUP_ITEM_PROPERTIES, _("Channel Attributes")); @@ -403,10 +403,10 @@ channels_edit_channel_response (GtkWidget *widget, gimp_channel_set_color (channel, &color, TRUE); if (name_changed && color_changed) - gimp_image_undo_group_end (options->gimage); + gimp_image_undo_group_end (options->image); if (name_changed || color_changed) - gimp_image_flush (options->gimage); + gimp_image_flush (options->image); } gtk_widget_destroy (options->dialog); diff --git a/app/actions/colormap-actions.c b/app/actions/colormap-actions.c index 2391610556..e707511505 100644 --- a/app/actions/colormap-actions.c +++ b/app/actions/colormap-actions.c @@ -83,17 +83,17 @@ void colormap_editor_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); GimpContext *context = action_data_get_context (data); gboolean indexed = FALSE; gint num_colors = 0; GimpRGB fg; GimpRGB bg; - if (gimage) + if (image) { - indexed = gimp_image_base_type (gimage) == GIMP_INDEXED; - num_colors = gimage->num_cols; + indexed = gimp_image_base_type (image) == GIMP_INDEXED; + num_colors = image->num_cols; } if (context) @@ -108,11 +108,11 @@ colormap_editor_actions_update (GimpActionGroup *group, gimp_action_group_set_action_color (group, action, color, FALSE); SET_SENSITIVE ("colormap-editor-edit-color", - gimage && indexed); + image && indexed); SET_SENSITIVE ("colormap-editor-add-color-from-fg", - gimage && indexed && num_colors < 256); + image && indexed && num_colors < 256); SET_SENSITIVE ("colormap-editor-add-color-from-bg", - gimage && indexed && num_colors < 256); + image && indexed && num_colors < 256); SET_COLOR ("colormap-editor-add-color-from-fg", context ? &fg : NULL); SET_COLOR ("colormap-editor-add-color-from-bg", context ? &bg : NULL); diff --git a/app/actions/colormap-commands.c b/app/actions/colormap-commands.c index dfc4eccde4..26ada2b7a5 100644 --- a/app/actions/colormap-commands.c +++ b/app/actions/colormap-commands.c @@ -54,17 +54,17 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action, gpointer data) { GimpColormapEditor *editor; - GimpImage *gimage; + GimpImage *image; GimpRGB color; gchar *desc; - return_if_no_image (gimage, data); + return_if_no_image (image, data); editor = GIMP_COLORMAP_EDITOR (data); gimp_rgba_set_uchar (&color, - gimage->cmap[editor->col_index * 3], - gimage->cmap[editor->col_index * 3 + 1], - gimage->cmap[editor->col_index * 3 + 2], + image->cmap[editor->col_index * 3], + image->cmap[editor->col_index * 3 + 1], + image->cmap[editor->col_index * 3 + 2], OPAQUE_OPACITY); desc = g_strdup_printf (_("Edit colormap entry #%d"), editor->col_index); @@ -72,7 +72,7 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action, if (! editor->color_dialog) { editor->color_dialog = - gimp_color_dialog_new (GIMP_VIEWABLE (gimage), + gimp_color_dialog_new (GIMP_VIEWABLE (image), _("Edit Colormap Entry"), GIMP_STOCK_INDEXED_PALETTE, desc, @@ -93,7 +93,7 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action, else { gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (editor->color_dialog), - GIMP_VIEWABLE (gimage)); + GIMP_VIEWABLE (image)); g_object_set (editor->color_dialog, "description", desc, NULL); gimp_color_dialog_set_color (GIMP_COLOR_DIALOG (editor->color_dialog), &color); @@ -110,11 +110,11 @@ colormap_editor_add_color_cmd_callback (GtkAction *action, gpointer data) { GimpContext *context; - GimpImage *gimage; + GimpImage *image; return_if_no_context (context, data); - return_if_no_image (gimage, data); + return_if_no_image (image, data); - if (gimage->num_cols < 256) + if (image->num_cols < 256) { GimpRGB color; @@ -123,8 +123,8 @@ colormap_editor_add_color_cmd_callback (GtkAction *action, else gimp_context_get_foreground (context, &color); - gimp_image_add_colormap_entry (gimage, &color); - gimp_image_flush (gimage); + gimp_image_add_colormap_entry (image, &color); + gimp_image_flush (image); } } @@ -137,7 +137,7 @@ colormap_editor_edit_color_update (GimpColorDialog *dialog, GimpColorDialogState state, GimpColormapEditor *editor) { - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; switch (state) { @@ -145,8 +145,8 @@ colormap_editor_edit_color_update (GimpColorDialog *dialog, break; case GIMP_COLOR_DIALOG_OK: - gimp_image_set_colormap_entry (gimage, editor->col_index, color, TRUE); - gimp_image_flush (gimage); + gimp_image_set_colormap_entry (image, editor->col_index, color, TRUE); + gimp_image_flush (image); /* Fall through */ case GIMP_COLOR_DIALOG_CANCEL: diff --git a/app/actions/colormap-editor-actions.c b/app/actions/colormap-editor-actions.c index 2391610556..e707511505 100644 --- a/app/actions/colormap-editor-actions.c +++ b/app/actions/colormap-editor-actions.c @@ -83,17 +83,17 @@ void colormap_editor_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); GimpContext *context = action_data_get_context (data); gboolean indexed = FALSE; gint num_colors = 0; GimpRGB fg; GimpRGB bg; - if (gimage) + if (image) { - indexed = gimp_image_base_type (gimage) == GIMP_INDEXED; - num_colors = gimage->num_cols; + indexed = gimp_image_base_type (image) == GIMP_INDEXED; + num_colors = image->num_cols; } if (context) @@ -108,11 +108,11 @@ colormap_editor_actions_update (GimpActionGroup *group, gimp_action_group_set_action_color (group, action, color, FALSE); SET_SENSITIVE ("colormap-editor-edit-color", - gimage && indexed); + image && indexed); SET_SENSITIVE ("colormap-editor-add-color-from-fg", - gimage && indexed && num_colors < 256); + image && indexed && num_colors < 256); SET_SENSITIVE ("colormap-editor-add-color-from-bg", - gimage && indexed && num_colors < 256); + image && indexed && num_colors < 256); SET_COLOR ("colormap-editor-add-color-from-fg", context ? &fg : NULL); SET_COLOR ("colormap-editor-add-color-from-bg", context ? &bg : NULL); diff --git a/app/actions/colormap-editor-commands.c b/app/actions/colormap-editor-commands.c index dfc4eccde4..26ada2b7a5 100644 --- a/app/actions/colormap-editor-commands.c +++ b/app/actions/colormap-editor-commands.c @@ -54,17 +54,17 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action, gpointer data) { GimpColormapEditor *editor; - GimpImage *gimage; + GimpImage *image; GimpRGB color; gchar *desc; - return_if_no_image (gimage, data); + return_if_no_image (image, data); editor = GIMP_COLORMAP_EDITOR (data); gimp_rgba_set_uchar (&color, - gimage->cmap[editor->col_index * 3], - gimage->cmap[editor->col_index * 3 + 1], - gimage->cmap[editor->col_index * 3 + 2], + image->cmap[editor->col_index * 3], + image->cmap[editor->col_index * 3 + 1], + image->cmap[editor->col_index * 3 + 2], OPAQUE_OPACITY); desc = g_strdup_printf (_("Edit colormap entry #%d"), editor->col_index); @@ -72,7 +72,7 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action, if (! editor->color_dialog) { editor->color_dialog = - gimp_color_dialog_new (GIMP_VIEWABLE (gimage), + gimp_color_dialog_new (GIMP_VIEWABLE (image), _("Edit Colormap Entry"), GIMP_STOCK_INDEXED_PALETTE, desc, @@ -93,7 +93,7 @@ colormap_editor_edit_color_cmd_callback (GtkAction *action, else { gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (editor->color_dialog), - GIMP_VIEWABLE (gimage)); + GIMP_VIEWABLE (image)); g_object_set (editor->color_dialog, "description", desc, NULL); gimp_color_dialog_set_color (GIMP_COLOR_DIALOG (editor->color_dialog), &color); @@ -110,11 +110,11 @@ colormap_editor_add_color_cmd_callback (GtkAction *action, gpointer data) { GimpContext *context; - GimpImage *gimage; + GimpImage *image; return_if_no_context (context, data); - return_if_no_image (gimage, data); + return_if_no_image (image, data); - if (gimage->num_cols < 256) + if (image->num_cols < 256) { GimpRGB color; @@ -123,8 +123,8 @@ colormap_editor_add_color_cmd_callback (GtkAction *action, else gimp_context_get_foreground (context, &color); - gimp_image_add_colormap_entry (gimage, &color); - gimp_image_flush (gimage); + gimp_image_add_colormap_entry (image, &color); + gimp_image_flush (image); } } @@ -137,7 +137,7 @@ colormap_editor_edit_color_update (GimpColorDialog *dialog, GimpColorDialogState state, GimpColormapEditor *editor) { - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; switch (state) { @@ -145,8 +145,8 @@ colormap_editor_edit_color_update (GimpColorDialog *dialog, break; case GIMP_COLOR_DIALOG_OK: - gimp_image_set_colormap_entry (gimage, editor->col_index, color, TRUE); - gimp_image_flush (gimage); + gimp_image_set_colormap_entry (image, editor->col_index, color, TRUE); + gimp_image_flush (image); /* Fall through */ case GIMP_COLOR_DIALOG_CANCEL: diff --git a/app/actions/documents-commands.c b/app/actions/documents-commands.c index 63ecf6c7fa..6993740daf 100644 --- a/app/actions/documents-commands.c +++ b/app/actions/documents-commands.c @@ -303,16 +303,16 @@ documents_open_image (GimpContext *context, GimpImagefile *imagefile) { const gchar *uri; - GimpImage *gimage; + GimpImage *image; GimpPDBStatusType status; GError *error = NULL; uri = gimp_object_get_name (GIMP_OBJECT (imagefile)); - gimage = file_open_with_display (context->gimp, context, NULL, + image = file_open_with_display (context->gimp, context, NULL, uri, &status, &error); - if (! gimage && status != GIMP_PDB_CANCEL) + if (! image && status != GIMP_PDB_CANCEL) { gchar *filename; @@ -333,7 +333,7 @@ documents_raise_display (gpointer data, RaiseClosure *closure = user_data; const gchar *uri; - uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage)); + uri = gimp_object_get_name (GIMP_OBJECT (gdisp->image)); if (uri && ! strcmp (closure->name, uri)) { diff --git a/app/actions/drawable-actions.c b/app/actions/drawable-actions.c index e7644e34b3..6a89a29ce4 100644 --- a/app/actions/drawable-actions.c +++ b/app/actions/drawable-actions.c @@ -152,7 +152,7 @@ void drawable_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable = NULL; gboolean is_rgb = FALSE; gboolean is_gray = FALSE; @@ -160,11 +160,11 @@ drawable_actions_update (GimpActionGroup *group, gboolean visible = FALSE; gboolean linked = FALSE; - gimage = action_data_get_image (data); + image = action_data_get_image (data); - if (gimage) + if (image) { - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); if (drawable) { diff --git a/app/actions/drawable-commands.c b/app/actions/drawable-commands.c index 3a10c9c223..23b956b6ec 100644 --- a/app/actions/drawable-commands.c +++ b/app/actions/drawable-commands.c @@ -63,10 +63,10 @@ drawable_desaturate_cmd_callback (GtkAction *action, gpointer data) { DesaturateDialog *dialog; - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; GtkWidget *widget; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); return_if_no_widget (widget, data); if (! gimp_drawable_is_rgb (drawable)) @@ -88,9 +88,9 @@ void drawable_equalize_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); if (gimp_drawable_is_indexed (drawable)) { @@ -99,16 +99,16 @@ drawable_equalize_cmd_callback (GtkAction *action, } gimp_drawable_equalize (drawable, TRUE); - gimp_image_flush (gimage); + gimp_image_flush (image); } void drawable_invert_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); if (gimp_drawable_is_indexed (drawable)) { @@ -117,17 +117,17 @@ drawable_invert_cmd_callback (GtkAction *action, } gimp_drawable_invert (drawable); - gimp_image_flush (gimage); + gimp_image_flush (image); } void drawable_levels_stretch_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; GimpContext *context; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); return_if_no_context (context, data); if (! gimp_drawable_is_rgb (drawable)) @@ -137,18 +137,18 @@ drawable_levels_stretch_cmd_callback (GtkAction *action, } gimp_drawable_levels_stretch (drawable, context); - gimp_image_flush (gimage); + gimp_image_flush (image); } void drawable_offset_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; GtkWidget *widget; GtkWidget *dialog; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); return_if_no_widget (widget, data); dialog = offset_dialog_new (drawable, widget); @@ -160,10 +160,10 @@ void drawable_linked_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; gboolean linked; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); linked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); @@ -176,14 +176,14 @@ drawable_linked_cmd_callback (GtkAction *action, GimpUndo *undo; gboolean push_undo = TRUE; - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_ITEM_LINKED); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable)) push_undo = FALSE; gimp_item_set_linked (GIMP_ITEM (drawable), linked, push_undo); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -191,10 +191,10 @@ void drawable_visible_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; gboolean visible; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); @@ -207,14 +207,14 @@ drawable_visible_cmd_callback (GtkAction *action, GimpUndo *undo; gboolean push_undo = TRUE; - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_ITEM_VISIBILITY); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable)) push_undo = FALSE; gimp_item_set_visible (GIMP_ITEM (drawable), visible, push_undo); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -224,13 +224,13 @@ drawable_flip_cmd_callback (GtkAction *action, gint value, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; GimpItem *item; GimpContext *context; gint off_x, off_y; gdouble axis = 0.0; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); return_if_no_context (context, data); item = GIMP_ITEM (drawable); @@ -252,7 +252,7 @@ drawable_flip_cmd_callback (GtkAction *action, } if (gimp_item_get_linked (item)) - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, GIMP_ITEM_GET_CLASS (item)->flip_desc); gimp_item_flip (item, context, (GimpOrientationType) value, axis, FALSE); @@ -261,10 +261,10 @@ drawable_flip_cmd_callback (GtkAction *action, { gimp_item_linked_flip (item, context, (GimpOrientationType) action, axis, FALSE); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } - gimp_image_flush (gimage); + gimp_image_flush (image); } void @@ -272,14 +272,14 @@ drawable_rotate_cmd_callback (GtkAction *action, gint value, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; GimpContext *context; GimpItem *item; gint off_x, off_y; gdouble center_x, center_y; gboolean clip_result = FALSE; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); return_if_no_context (context, data); item = GIMP_ITEM (drawable); @@ -290,7 +290,7 @@ drawable_rotate_cmd_callback (GtkAction *action, center_y = ((gdouble) off_y + (gdouble) gimp_item_height (item) / 2.0); if (gimp_item_get_linked (item)) - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, GIMP_ITEM_GET_CLASS (item)->rotate_desc); if (GIMP_IS_CHANNEL (item)) @@ -303,10 +303,10 @@ drawable_rotate_cmd_callback (GtkAction *action, { gimp_item_linked_rotate (item, context, (GimpRotationType) value, center_x, center_y, FALSE); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } - gimp_image_flush (gimage); + gimp_image_flush (image); } /* private functions */ @@ -319,14 +319,14 @@ desaturate_response (GtkWidget *widget, if (response_id == GTK_RESPONSE_OK) { GimpDrawable *drawable = dialog->drawable; - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable)); /* remember for next invocation of the dialog */ desaturate_mode = dialog->mode; gimp_drawable_desaturate (drawable, desaturate_mode); - gimp_image_flush (gimage); + gimp_image_flush (image); } gtk_widget_destroy (dialog->dialog); diff --git a/app/actions/edit-actions.c b/app/actions/edit-actions.c index 601c5e4470..f140ed7daa 100644 --- a/app/actions/edit-actions.c +++ b/app/actions/edit-actions.c @@ -220,25 +220,25 @@ void edit_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); GimpDrawable *drawable = NULL; gchar *undo_name = NULL; gchar *redo_name = NULL; gboolean undo_enabled = FALSE; - if (gimage) + if (image) { GimpUndo *undo; GimpUndo *redo; - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); - undo_enabled = gimp_image_undo_is_enabled (gimage); + undo_enabled = gimp_image_undo_is_enabled (image); if (undo_enabled) { - undo = gimp_undo_stack_peek (gimage->undo_stack); - redo = gimp_undo_stack_peek (gimage->redo_stack); + undo = gimp_undo_stack_peek (image->undo_stack); + redo = gimp_undo_stack_peek (image->redo_stack); if (undo) undo_name = @@ -270,14 +270,14 @@ edit_actions_update (GimpActionGroup *group, SET_SENSITIVE ("edit-cut", drawable); SET_SENSITIVE ("edit-copy", drawable); - SET_SENSITIVE ("edit-copy-visible", gimage); + SET_SENSITIVE ("edit-copy-visible", image); /* "edit-paste" is always enabled */ - SET_SENSITIVE ("edit-paste-into", gimage); + SET_SENSITIVE ("edit-paste-into", image); SET_SENSITIVE ("edit-named-cut", drawable); SET_SENSITIVE ("edit-named-copy", drawable); SET_SENSITIVE ("edit-named-copy-visible", drawable); - SET_SENSITIVE ("edit-named-paste", gimage); + SET_SENSITIVE ("edit-named-paste", image); SET_SENSITIVE ("edit-clear", drawable); SET_SENSITIVE ("edit-fill-fg", drawable); diff --git a/app/actions/edit-commands.c b/app/actions/edit-commands.c index f7cb74503f..35f9082ec8 100644 --- a/app/actions/edit-commands.c +++ b/app/actions/edit-commands.c @@ -76,35 +76,35 @@ void edit_undo_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; - return_if_no_image (gimage, data); + GimpImage *image; + return_if_no_image (image, data); - if (gimp_image_undo (gimage)) - gimp_image_flush (gimage); + if (gimp_image_undo (image)) + gimp_image_flush (image); } void edit_redo_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; - return_if_no_image (gimage, data); + GimpImage *image; + return_if_no_image (image, data); - if (gimp_image_redo (gimage)) - gimp_image_flush (gimage); + if (gimp_image_redo (image)) + gimp_image_flush (image); } void edit_undo_clear_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; GtkWidget *dialog; gchar *size; gint64 memsize; gint64 guisize; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); dialog = gimp_message_dialog_new (_("Clear Undo History"), GIMP_STOCK_WARNING, @@ -128,17 +128,17 @@ edit_undo_clear_cmd_callback (GtkAction *action, G_CALLBACK (gtk_widget_destroy), dialog, G_CONNECT_SWAPPED); - g_signal_connect_object (gimage, "disconnect", + g_signal_connect_object (image, "disconnect", G_CALLBACK (gtk_widget_destroy), dialog, G_CONNECT_SWAPPED); gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box, _("Really clear image's undo history?")); - memsize = gimp_object_get_memsize (GIMP_OBJECT (gimage->undo_stack), + memsize = gimp_object_get_memsize (GIMP_OBJECT (image->undo_stack), &guisize); memsize += guisize; - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->redo_stack), + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->redo_stack), &guisize); memsize += guisize; @@ -151,9 +151,9 @@ edit_undo_clear_cmd_callback (GtkAction *action, if (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK) { - gimp_image_undo_disable (gimage); - gimp_image_undo_enable (gimage); - gimp_image_flush (gimage); + gimp_image_undo_disable (image); + gimp_image_undo_enable (image); + gimp_image_flush (image); } gtk_widget_destroy (dialog); @@ -163,35 +163,35 @@ void edit_cut_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); - if (gimp_edit_cut (gimage, drawable, action_data_get_context (data))) - gimp_image_flush (gimage); + if (gimp_edit_cut (image, drawable, action_data_get_context (data))) + gimp_image_flush (image); } void edit_copy_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); - if (gimp_edit_copy (gimage, drawable, action_data_get_context (data))) - gimp_image_flush (gimage); + if (gimp_edit_copy (image, drawable, action_data_get_context (data))) + gimp_image_flush (image); } void edit_copy_visible_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; - return_if_no_image (gimage, data); + GimpImage *image; + return_if_no_image (image, data); - if (gimp_edit_copy_visible (gimage, action_data_get_context (data))) - gimp_image_flush (gimage); + if (gimp_edit_copy_visible (image, action_data_get_context (data))) + gimp_image_flush (image); } void @@ -247,10 +247,10 @@ void edit_named_cut_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; GtkWidget *dialog; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); dialog = gimp_query_string_box (_("Cut Named"), widget, @@ -258,8 +258,8 @@ edit_named_cut_cmd_callback (GtkAction *action, GIMP_HELP_BUFFER_CUT, _("Enter a name for this buffer"), NULL, - G_OBJECT (gimage), "disconnect", - cut_named_buffer_callback, gimage); + G_OBJECT (image), "disconnect", + cut_named_buffer_callback, image); gtk_widget_show (dialog); } @@ -267,10 +267,10 @@ void edit_named_copy_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; GtkWidget *dialog; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); dialog = gimp_query_string_box (_("Copy Named"), widget, @@ -278,8 +278,8 @@ edit_named_copy_cmd_callback (GtkAction *action, GIMP_HELP_BUFFER_COPY, _("Enter a name for this buffer"), NULL, - G_OBJECT (gimage), "disconnect", - copy_named_buffer_callback, gimage); + G_OBJECT (image), "disconnect", + copy_named_buffer_callback, image); gtk_widget_show (dialog); } @@ -287,10 +287,10 @@ void edit_named_copy_visible_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; GtkWidget *dialog; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); dialog = gimp_query_string_box (_("Copy Visible Named "), widget, @@ -298,8 +298,8 @@ edit_named_copy_visible_cmd_callback (GtkAction *action, GIMP_HELP_BUFFER_COPY, _("Enter a name for this buffer"), NULL, - G_OBJECT (gimage), "disconnect", - copy_named_visible_buffer_callback, gimage); + G_OBJECT (image), "disconnect", + copy_named_visible_buffer_callback, image); gtk_widget_show (dialog); } @@ -319,12 +319,12 @@ void edit_clear_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); - gimp_edit_clear (gimage, drawable, action_data_get_context (data)); - gimp_image_flush (gimage); + gimp_edit_clear (image, drawable, action_data_get_context (data)); + gimp_image_flush (image); } void @@ -332,16 +332,16 @@ edit_fill_cmd_callback (GtkAction *action, gint value, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; GimpFillType fill_type; - return_if_no_drawable (gimage, drawable, data); + return_if_no_drawable (image, drawable, data); fill_type = (GimpFillType) value; - gimp_edit_fill (gimage, drawable, action_data_get_context (data), + gimp_edit_fill (image, drawable, action_data_get_context (data), fill_type); - gimp_image_flush (gimage); + gimp_image_flush (image); } @@ -354,14 +354,14 @@ edit_paste (GimpDisplay *gdisp, gchar *svg; gsize svg_size; - svg = gimp_clipboard_get_svg (gdisp->gimage->gimp, &svg_size); + svg = gimp_clipboard_get_svg (gdisp->image->gimp, &svg_size); if (svg) { - if (gimp_vectors_import_buffer (gdisp->gimage, svg, svg_size, + if (gimp_vectors_import_buffer (gdisp->image, svg, svg_size, TRUE, TRUE, -1, NULL)) { - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } g_free (svg); @@ -370,7 +370,7 @@ edit_paste (GimpDisplay *gdisp, { GimpBuffer *buffer; - buffer = gimp_clipboard_get_buffer (gdisp->gimage->gimp); + buffer = gimp_clipboard_get_buffer (gdisp->image->gimp); if (buffer) { @@ -381,11 +381,11 @@ edit_paste (GimpDisplay *gdisp, gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height); - if (gimp_edit_paste (gdisp->gimage, - gimp_image_active_drawable (gdisp->gimage), + if (gimp_edit_paste (gdisp->image, + gimp_image_active_drawable (gdisp->image), buffer, paste_into, x, y, width, height)) { - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } g_object_unref (buffer); @@ -398,10 +398,10 @@ cut_named_buffer_callback (GtkWidget *widget, const gchar *name, gpointer data) { - GimpImage *gimage = GIMP_IMAGE (data); + GimpImage *image = GIMP_IMAGE (data); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); if (! drawable) { @@ -412,10 +412,10 @@ cut_named_buffer_callback (GtkWidget *widget, if (! (name && strlen (name))) name = _("(Unnamed Buffer)"); - if (gimp_edit_named_cut (gimage, name, drawable, - gimp_get_user_context (gimage->gimp))) + if (gimp_edit_named_cut (image, name, drawable, + gimp_get_user_context (image->gimp))) { - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -424,10 +424,10 @@ copy_named_buffer_callback (GtkWidget *widget, const gchar *name, gpointer data) { - GimpImage *gimage = GIMP_IMAGE (data); + GimpImage *image = GIMP_IMAGE (data); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); if (! drawable) { @@ -438,10 +438,10 @@ copy_named_buffer_callback (GtkWidget *widget, if (! (name && strlen (name))) name = _("(Unnamed Buffer)"); - if (gimp_edit_named_copy (gimage, name, drawable, - gimp_get_user_context (gimage->gimp))) + if (gimp_edit_named_copy (image, name, drawable, + gimp_get_user_context (image->gimp))) { - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -450,14 +450,14 @@ copy_named_visible_buffer_callback (GtkWidget *widget, const gchar *name, gpointer data) { - GimpImage *gimage = GIMP_IMAGE (data); + GimpImage *image = GIMP_IMAGE (data); if (! (name && strlen (name))) name = _("(Unnamed Buffer)"); - if (gimp_edit_named_copy_visible (gimage, name, - gimp_get_user_context (gimage->gimp))) + if (gimp_edit_named_copy_visible (image, name, + gimp_get_user_context (image->gimp))) { - gimp_image_flush (gimage); + gimp_image_flush (image); } } diff --git a/app/actions/file-actions.c b/app/actions/file-actions.c index 5c2466f63f..d6ad569ab1 100644 --- a/app/actions/file-actions.c +++ b/app/actions/file-actions.c @@ -206,21 +206,21 @@ void file_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); GimpDrawable *drawable = NULL; - if (gimage) - drawable = gimp_image_active_drawable (gimage); + if (image) + drawable = gimp_image_active_drawable (image); #define SET_SENSITIVE(action,condition) \ gimp_action_group_set_action_sensitive (group, action, (condition) != 0) - SET_SENSITIVE ("file-open-as-layer", gimage); - SET_SENSITIVE ("file-save", gimage && drawable); - SET_SENSITIVE ("file-save-as", gimage && drawable); - SET_SENSITIVE ("file-save-a-copy", gimage && drawable); - SET_SENSITIVE ("file-save-as-template", gimage); - SET_SENSITIVE ("file-revert", gimage && GIMP_OBJECT (gimage)->name); + SET_SENSITIVE ("file-open-as-layer", image); + SET_SENSITIVE ("file-save", image && drawable); + SET_SENSITIVE ("file-save-as", image && drawable); + SET_SENSITIVE ("file-save-a-copy", image && drawable); + SET_SENSITIVE ("file-save-as-template", image); + SET_SENSITIVE ("file-revert", image && GIMP_OBJECT (image)->name); #undef SET_SENSITIVE } diff --git a/app/actions/file-commands.c b/app/actions/file-commands.c index 8ab61406d3..7fc3cd66ef 100644 --- a/app/actions/file-commands.c +++ b/app/actions/file-commands.c @@ -62,15 +62,15 @@ /* local function prototypes */ static void file_open_dialog_show (GtkWidget *parent, - GimpImage *gimage, + GimpImage *image, const gchar *uri, gboolean open_as_layer); -static void file_save_dialog_show (GimpImage *gimage, +static void file_save_dialog_show (GimpImage *image, GtkWidget *parent, const gchar *title, gboolean save_a_copy); static void file_save_dialog_destroyed (GtkWidget *dialog, - GimpImage *gimage); + GimpImage *image); static void file_new_template_callback (GtkWidget *widget, const gchar *name, gpointer data); @@ -119,7 +119,7 @@ file_open_as_layer_cmd_callback (GtkAction *action, return_if_no_display (gdisp, data); return_if_no_widget (widget, data); - image = gdisp->gimage; + image = gdisp->image; uri = gimp_object_get_name (GIMP_OBJECT (image)); file_open_dialog_show (widget, image, uri, TRUE); @@ -157,16 +157,16 @@ file_last_opened_cmd_callback (GtkAction *action, if (imagefile) { - GimpImage *gimage; + GimpImage *image; GimpPDBStatusType status; GError *error = NULL; - gimage = file_open_with_display (gimp, action_data_get_context (data), + image = file_open_with_display (gimp, action_data_get_context (data), NULL, GIMP_OBJECT (imagefile)->name, &status, &error); - if (! gimage && status != GIMP_PDB_CANCEL) + if (! image && status != GIMP_PDB_CANCEL) { gchar *filename = file_utils_uri_display_name (GIMP_OBJECT (imagefile)->name); @@ -185,26 +185,26 @@ file_save_cmd_callback (GtkAction *action, gpointer data) { GimpDisplay *gdisp; - GimpImage *gimage; + GimpImage *image; return_if_no_display (gdisp, data); - gimage = gdisp->gimage; + image = gdisp->image; - if (! gimp_image_active_drawable (gimage)) + if (! gimp_image_active_drawable (image)) return; - /* Only save if the gimage has been modified */ - if (gimage->dirty || - ! GIMP_GUI_CONFIG (gimage->gimp->config)->trust_dirty_flag) + /* Only save if the image has been modified */ + if (image->dirty || + ! GIMP_GUI_CONFIG (image->gimp->config)->trust_dirty_flag) { const gchar *uri; PlugInProcDef *save_proc = NULL; - uri = gimp_object_get_name (GIMP_OBJECT (gimage)); - save_proc = gimp_image_get_save_proc (gimage); + uri = gimp_object_get_name (GIMP_OBJECT (image)); + save_proc = gimp_image_get_save_proc (image); if (uri && ! save_proc) - save_proc = file_utils_find_proc (gimage->gimp->save_procs, uri); + save_proc = file_utils_find_proc (image->gimp->save_procs, uri); if (! (uri && save_proc)) { @@ -224,7 +224,7 @@ file_save_cmd_callback (GtkAction *action, FALSE); } - status = file_save (gimage, action_data_get_context (data), + status = file_save (image, action_data_get_context (data), GIMP_PROGRESS (gdisp), uri, save_proc, GIMP_RUN_WITH_LAST_VALS, FALSE, &error); @@ -261,10 +261,10 @@ file_save_as_cmd_callback (GtkAction *action, return_if_no_display (gdisp, data); return_if_no_widget (widget, data); - if (! gimp_image_active_drawable (gdisp->gimage)) + if (! gimp_image_active_drawable (gdisp->image)) return; - file_save_dialog_show (gdisp->gimage, widget, + file_save_dialog_show (gdisp->image, widget, _("Save Image"), FALSE); } @@ -277,10 +277,10 @@ file_save_a_copy_cmd_callback (GtkAction *action, return_if_no_display (gdisp, data); return_if_no_widget (widget, data); - if (! gimp_image_active_drawable (gdisp->gimage)) + if (! gimp_image_active_drawable (gdisp->image)) return; - file_save_dialog_show (gdisp->gimage, widget, + file_save_dialog_show (gdisp->image, widget, _("Save a Copy of the Image"), TRUE); } @@ -298,8 +298,8 @@ file_save_template_cmd_callback (GtkAction *action, GIMP_HELP_FILE_SAVE_AS_TEMPLATE, _("Enter a name for this template"), NULL, - G_OBJECT (gdisp->gimage), "disconnect", - file_new_template_callback, gdisp->gimage); + G_OBJECT (gdisp->image), "disconnect", + file_new_template_callback, gdisp->image); gtk_widget_show (dialog); } @@ -312,9 +312,9 @@ file_revert_cmd_callback (GtkAction *action, const gchar *uri; return_if_no_display (gdisp, data); - uri = gimp_object_get_name (GIMP_OBJECT (gdisp->gimage)); + uri = gimp_object_get_name (GIMP_OBJECT (gdisp->image)); - dialog = g_object_get_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY); + dialog = g_object_get_data (G_OBJECT (gdisp->image), REVERT_DATA_KEY); if (! uri) { @@ -366,7 +366,7 @@ file_revert_cmd_callback (GtkAction *action, "on disk, you will lose all changes, " "including all undo information.")); - g_object_set_data (G_OBJECT (gdisp->gimage), REVERT_DATA_KEY, dialog); + g_object_set_data (G_OBJECT (gdisp->image), REVERT_DATA_KEY, dialog); gtk_widget_show (dialog); } @@ -417,7 +417,7 @@ file_file_open_dialog (Gimp *gimp, static void file_open_dialog_show (GtkWidget *parent, - GimpImage *gimage, + GimpImage *image, const gchar *uri, gboolean open_as_layer) { @@ -435,12 +435,12 @@ file_open_dialog_show (GtkWidget *parent, if (open_as_layer) { gtk_window_set_title (GTK_WINDOW (dialog), _("Open Image as Layer")); - GIMP_FILE_DIALOG (dialog)->gimage = gimage; + GIMP_FILE_DIALOG (dialog)->image = image; } else { gtk_window_set_title (GTK_WINDOW (dialog), _("Open Image")); - GIMP_FILE_DIALOG (dialog)->gimage = NULL; + GIMP_FILE_DIALOG (dialog)->image = NULL; } gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent)); @@ -450,14 +450,14 @@ file_open_dialog_show (GtkWidget *parent, } static void -file_save_dialog_show (GimpImage *gimage, +file_save_dialog_show (GimpImage *image, GtkWidget *parent, const gchar *title, gboolean save_a_copy) { GtkWidget *dialog; - dialog = g_object_get_data (G_OBJECT (gimage), "gimp-file-save-dialog"); + dialog = g_object_get_data (G_OBJECT (image), "gimp-file-save-dialog"); if (! dialog) { @@ -471,12 +471,12 @@ file_save_dialog_show (GimpImage *gimage, gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent)); - g_object_set_data_full (G_OBJECT (gimage), + g_object_set_data_full (G_OBJECT (image), "gimp-file-save-dialog", dialog, (GDestroyNotify) gtk_widget_destroy); g_signal_connect (dialog, "destroy", G_CALLBACK (file_save_dialog_destroyed), - gimage); + image); } } @@ -485,7 +485,7 @@ file_save_dialog_show (GimpImage *gimage, gtk_window_set_title (GTK_WINDOW (dialog), title); gimp_file_dialog_set_image (GIMP_FILE_DIALOG (dialog), - gimage, save_a_copy); + image, save_a_copy); gtk_window_present (GTK_WINDOW (dialog)); } @@ -493,10 +493,10 @@ file_save_dialog_show (GimpImage *gimage, static void file_save_dialog_destroyed (GtkWidget *dialog, - GimpImage *gimage) + GimpImage *image) { - if (GIMP_FILE_DIALOG (dialog)->gimage == gimage) - g_object_set_data (G_OBJECT (gimage), "gimp-file-save-dialog", NULL); + if (GIMP_FILE_DIALOG (dialog)->image == image) + g_object_set_data (G_OBJECT (image), "gimp-file-save-dialog", NULL); } static void @@ -505,16 +505,16 @@ file_new_template_callback (GtkWidget *widget, gpointer data) { GimpTemplate *template; - GimpImage *gimage; + GimpImage *image; - gimage = (GimpImage *) data; + image = (GimpImage *) data; if (! (name && strlen (name))) name = _("(Unnamed Template)"); template = gimp_template_new (name); - gimp_template_set_from_image (template, gimage); - gimp_container_add (gimage->gimp->templates, GIMP_OBJECT (template)); + gimp_template_set_from_image (template, image); + gimp_container_add (image->gimp->templates, GIMP_OBJECT (template)); g_object_unref (template); } @@ -523,35 +523,35 @@ file_revert_confirm_response (GtkWidget *dialog, gint response_id, GimpDisplay *gdisp) { - GimpImage *old_gimage = gdisp->gimage; + GimpImage *old_image = gdisp->image; gtk_widget_destroy (dialog); - g_object_set_data (G_OBJECT (old_gimage), REVERT_DATA_KEY, NULL); + g_object_set_data (G_OBJECT (old_image), REVERT_DATA_KEY, NULL); if (response_id == GTK_RESPONSE_OK) { - Gimp *gimp = old_gimage->gimp; - GimpImage *new_gimage; + Gimp *gimp = old_image->gimp; + GimpImage *new_image; const gchar *uri; GimpPDBStatusType status; GError *error = NULL; - uri = gimp_object_get_name (GIMP_OBJECT (old_gimage)); + uri = gimp_object_get_name (GIMP_OBJECT (old_image)); - new_gimage = file_open_image (gimp, gimp_get_user_context (gimp), + new_image = file_open_image (gimp, gimp_get_user_context (gimp), GIMP_PROGRESS (gdisp), uri, uri, NULL, GIMP_RUN_INTERACTIVE, &status, NULL, &error); - if (new_gimage) + if (new_image) { - gimp_displays_reconnect (gimp, old_gimage, new_gimage); - gimp_image_flush (new_gimage); + gimp_displays_reconnect (gimp, old_image, new_image); + gimp_image_flush (new_image); /* the displays own the image now */ - g_object_unref (new_gimage); + g_object_unref (new_image); } else if (status != GIMP_PDB_CANCEL) { diff --git a/app/actions/image-actions.c b/app/actions/image-actions.c index 43b742af1a..924f8b9b17 100644 --- a/app/actions/image-actions.c +++ b/app/actions/image-actions.c @@ -232,7 +232,7 @@ void image_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); gboolean is_rgb = FALSE; gboolean is_gray = FALSE; gboolean is_indexed = FALSE; @@ -241,45 +241,45 @@ image_actions_update (GimpActionGroup *group, gboolean lp = FALSE; gboolean sel = FALSE; - if (gimage) + if (image) { GimpImageBaseType base_type; - base_type = gimp_image_base_type (gimage); + base_type = gimp_image_base_type (image); is_rgb = (base_type == GIMP_RGB); is_gray = (base_type == GIMP_GRAY); is_indexed = (base_type == GIMP_INDEXED); - fs = (gimp_image_floating_sel (gimage) != NULL); - aux = (gimp_image_get_active_channel (gimage) != NULL); - lp = ! gimp_image_is_empty (gimage); - sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage)); + fs = (gimp_image_floating_sel (image) != NULL); + aux = (gimp_image_get_active_channel (image) != NULL); + lp = ! gimp_image_is_empty (image); + sel = ! gimp_channel_is_empty (gimp_image_get_mask (image)); } #define SET_SENSITIVE(action,condition) \ gimp_action_group_set_action_sensitive (group, action, (condition) != 0) - SET_SENSITIVE ("image-convert-rgb", gimage && ! is_rgb); - SET_SENSITIVE ("image-convert-grayscale", gimage && ! is_gray); - SET_SENSITIVE ("image-convert-indexed", gimage && ! is_indexed); + SET_SENSITIVE ("image-convert-rgb", image && ! is_rgb); + SET_SENSITIVE ("image-convert-grayscale", image && ! is_gray); + SET_SENSITIVE ("image-convert-indexed", image && ! is_indexed); - SET_SENSITIVE ("image-flip-horizontal", gimage); - SET_SENSITIVE ("image-flip-vertical", gimage); - SET_SENSITIVE ("image-rotate-90", gimage); - SET_SENSITIVE ("image-rotate-180", gimage); - SET_SENSITIVE ("image-rotate-270", gimage); + SET_SENSITIVE ("image-flip-horizontal", image); + SET_SENSITIVE ("image-flip-vertical", image); + SET_SENSITIVE ("image-rotate-90", image); + SET_SENSITIVE ("image-rotate-180", image); + SET_SENSITIVE ("image-rotate-270", image); - SET_SENSITIVE ("image-resize", gimage); - SET_SENSITIVE ("image-resize-to-layers", gimage); - SET_SENSITIVE ("image-print-size", gimage); - SET_SENSITIVE ("image-scale", gimage); - SET_SENSITIVE ("image-crop", gimage && sel); - SET_SENSITIVE ("image-duplicate", gimage); - SET_SENSITIVE ("image-merge-layers", gimage && !fs && !aux && lp); - SET_SENSITIVE ("image-flatten", gimage && !fs && !aux && lp); - SET_SENSITIVE ("image-configure-grid", gimage); - SET_SENSITIVE ("image-properties", gimage); + SET_SENSITIVE ("image-resize", image); + SET_SENSITIVE ("image-resize-to-layers", image); + SET_SENSITIVE ("image-print-size", image); + SET_SENSITIVE ("image-scale", image); + SET_SENSITIVE ("image-crop", image && sel); + SET_SENSITIVE ("image-duplicate", image); + SET_SENSITIVE ("image-merge-layers", image && !fs && !aux && lp); + SET_SENSITIVE ("image-flatten", image && !fs && !aux && lp); + SET_SENSITIVE ("image-configure-grid", image); + SET_SENSITIVE ("image-properties", image); #undef SET_SENSITIVE } diff --git a/app/actions/image-commands.c b/app/actions/image-commands.c index b36fa7a639..697ffe94a0 100644 --- a/app/actions/image-commands.c +++ b/app/actions/image-commands.c @@ -137,9 +137,9 @@ image_new_from_image_cmd_callback (GtkAction *action, if (dialog) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); - image_new_dialog_set (dialog, gimage, NULL); + image_new_dialog_set (dialog, image, NULL); gtk_window_present (GTK_WINDOW (dialog)); } @@ -150,10 +150,10 @@ image_convert_cmd_callback (GtkAction *action, gint value, gpointer data) { - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; GimpDisplay *gdisp; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); return_if_no_display (gdisp, data); @@ -161,13 +161,13 @@ image_convert_cmd_callback (GtkAction *action, { case GIMP_RGB: case GIMP_GRAY: - gimp_image_convert (gimage, (GimpImageBaseType) value, + gimp_image_convert (image, (GimpImageBaseType) value, 0, 0, FALSE, FALSE, 0, NULL, NULL); - gimp_image_flush (gimage); + gimp_image_flush (image); break; case GIMP_INDEXED: - gtk_widget_show (convert_dialog_new (gimage, widget, + gtk_widget_show (convert_dialog_new (image, widget, GIMP_PROGRESS (gdisp))); break; } @@ -227,14 +227,14 @@ image_resize_to_layers_cmd_callback (GtkAction *action, progress = gimp_progress_start (GIMP_PROGRESS (gdisp), _("Resizing"), FALSE); - gimp_image_resize_to_layers (gdisp->gimage, + gimp_image_resize_to_layers (gdisp->image, action_data_get_context (data), progress); if (progress) gimp_progress_end (progress); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } void @@ -247,7 +247,7 @@ image_print_size_cmd_callback (GtkAction *action, return_if_no_display (gdisp, data); return_if_no_widget (widget, data); - dialog = print_size_dialog_new (gdisp->gimage, + dialog = print_size_dialog_new (gdisp->image, _("Set Image Print Resolution"), "gimp-image-print-size", widget, @@ -273,7 +273,7 @@ image_scale_cmd_callback (GtkAction *action, return_if_no_display (gdisp, data); return_if_no_widget (widget, data); - dialog = image_scale_dialog_new (gdisp->gimage, gdisp, + dialog = image_scale_dialog_new (gdisp->image, gdisp, action_data_get_context (data), widget, image_scale_callback); @@ -297,13 +297,13 @@ image_flip_cmd_callback (GtkAction *action, progress = gimp_progress_start (GIMP_PROGRESS (gdisp), _("Flipping"), FALSE); - gimp_image_flip (gdisp->gimage, action_data_get_context (data), + gimp_image_flip (gdisp->image, action_data_get_context (data), (GimpOrientationType) value, progress); if (progress) gimp_progress_end (progress); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } void @@ -318,33 +318,33 @@ image_rotate_cmd_callback (GtkAction *action, progress = gimp_progress_start (GIMP_PROGRESS (gdisp), _("Rotating"), FALSE); - gimp_image_rotate (gdisp->gimage, action_data_get_context (data), + gimp_image_rotate (gdisp->image, action_data_get_context (data), (GimpRotationType) value, progress); if (progress) gimp_progress_end (progress); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } void image_crop_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; gint x1, y1, x2, y2; - return_if_no_image (gimage, data); + return_if_no_image (image, data); - if (! gimp_channel_bounds (gimp_image_get_mask (gimage), + if (! gimp_channel_bounds (gimp_image_get_mask (image), &x1, &y1, &x2, &y2)) { g_message (_("Cannot crop because the current selection is empty.")); return; } - gimp_image_crop (gimage, action_data_get_context (data), + gimp_image_crop (image, action_data_get_context (data), x1, y1, x2, y2, FALSE, TRUE); - gimp_image_flush (gimage); + gimp_image_flush (image); } void @@ -353,19 +353,19 @@ image_duplicate_cmd_callback (GtkAction *action, { GimpDisplay *gdisp; GimpDisplayShell *shell; - GimpImage *new_gimage; + GimpImage *new_image; return_if_no_display (gdisp, data); shell = GIMP_DISPLAY_SHELL (gdisp->shell); - new_gimage = gimp_image_duplicate (gdisp->gimage); + new_image = gimp_image_duplicate (gdisp->image); - gimp_create_display (new_gimage->gimp, - new_gimage, + gimp_create_display (new_image->gimp, + new_image, shell->unit, gimp_zoom_model_get_factor (shell->zoom)); - g_object_unref (new_gimage); + g_object_unref (new_image); } void @@ -373,12 +373,12 @@ image_merge_layers_cmd_callback (GtkAction *action, gpointer data) { ImageMergeLayersDialog *dialog; - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); - dialog = image_merge_layers_dialog_new (gimage, + dialog = image_merge_layers_dialog_new (image, action_data_get_context (data), widget, image_merge_layers_type); @@ -394,11 +394,11 @@ void image_flatten_image_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; - return_if_no_image (gimage, data); + GimpImage *image; + return_if_no_image (image, data); - gimp_image_flatten (gimage, action_data_get_context (data)); - gimp_image_flush (gimage); + gimp_image_flatten (image, action_data_get_context (data)); + gimp_image_flush (image); } void @@ -407,15 +407,15 @@ image_configure_grid_cmd_callback (GtkAction *action, { GimpDisplay *gdisp; GimpDisplayShell *shell; - GimpImage *gimage; + GimpImage *image; return_if_no_display (gdisp, data); shell = GIMP_DISPLAY_SHELL (gdisp->shell); - gimage = gdisp->gimage; + image = gdisp->image; if (! shell->grid_dialog) { - shell->grid_dialog = grid_dialog_new (gdisp->gimage, gdisp->shell); + shell->grid_dialog = grid_dialog_new (gdisp->image, gdisp->shell); gtk_window_set_transient_for (GTK_WINDOW (shell->grid_dialog), GTK_WINDOW (gdisp->shell)); @@ -435,14 +435,14 @@ image_properties_cmd_callback (GtkAction *action, { GimpDisplay *gdisp; GimpDisplayShell *shell; - GimpImage *gimage; + GimpImage *image; GtkWidget *dialog; return_if_no_display (gdisp, data); shell = GIMP_DISPLAY_SHELL (gdisp->shell); - gimage = gdisp->gimage; + image = gdisp->image; - dialog = image_properties_dialog_new (gdisp->gimage, gdisp->shell); + dialog = image_properties_dialog_new (gdisp->image, gdisp->shell); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (gdisp->shell)); @@ -535,7 +535,7 @@ image_print_size_callback (GtkWidget *dialog, static void image_scale_callback (ImageScaleDialog *dialog) { - GimpImage *image = dialog->gimage; + GimpImage *image = dialog->image; if (dialog->width == image->width && dialog->height == image->height && @@ -590,10 +590,10 @@ image_merge_layers_response (GtkWidget *widget, { image_merge_layers_type = dialog->merge_type; - gimp_image_merge_visible_layers (dialog->gimage, + gimp_image_merge_visible_layers (dialog->image, dialog->context, image_merge_layers_type); - gimp_image_flush (dialog->gimage); + gimp_image_flush (dialog->image); } gtk_widget_destroy (widget); diff --git a/app/actions/images-commands.c b/app/actions/images-commands.c index 16558116a9..6cbd8e9004 100644 --- a/app/actions/images-commands.c +++ b/app/actions/images-commands.c @@ -61,7 +61,7 @@ images_raise_views_cmd_callback (GtkAction *action, { GimpDisplay *display = list->data; - if (display->gimage == image) + if (display->image == image) gtk_window_present (GTK_WINDOW (display->shell)); } } diff --git a/app/actions/layers-actions.c b/app/actions/layers-actions.c index 277483a533..85951e6f1c 100644 --- a/app/actions/layers-actions.c +++ b/app/actions/layers-actions.c @@ -411,7 +411,7 @@ void layers_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); GimpLayer *layer = NULL; GimpLayerMask *mask = NULL; /* layer mask */ gboolean fs = FALSE; /* floating sel */ @@ -424,14 +424,14 @@ layers_actions_update (GimpActionGroup *group, GList *next = NULL; GList *prev = NULL; - if (gimage) + if (image) { - fs = (gimp_image_floating_sel (gimage) != NULL); - ac = (gimp_image_get_active_channel (gimage) != NULL); - sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage)); - indexed = (gimp_image_base_type (gimage) == GIMP_INDEXED); + fs = (gimp_image_floating_sel (image) != NULL); + ac = (gimp_image_get_active_channel (image) != NULL); + sel = ! gimp_channel_is_empty (gimp_image_get_mask (image)); + indexed = (gimp_image_base_type (image) == GIMP_INDEXED); - layer = gimp_image_get_active_layer (gimage); + layer = gimp_image_get_active_layer (image); if (layer) { @@ -441,7 +441,7 @@ layers_actions_update (GimpActionGroup *group, lock_alpha = gimp_layer_get_lock_alpha (layer); alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)); - list = g_list_find (GIMP_LIST (gimage->layers)->list, layer); + list = g_list_find (GIMP_LIST (image->layers)->list, layer); if (list) { @@ -464,8 +464,8 @@ layers_actions_update (GimpActionGroup *group, SET_VISIBLE ("layers-text-tool", text_layer && !ac); SET_SENSITIVE ("layers-edit-attributes", layer && !fs && !ac); - SET_SENSITIVE ("layers-new", gimage); - SET_SENSITIVE ("layers-new-last-values", gimage); + SET_SENSITIVE ("layers-new", image); + SET_SENSITIVE ("layers-new-last-values", image); SET_SENSITIVE ("layers-duplicate", layer && !fs && !ac); SET_SENSITIVE ("layers-delete", layer && !ac); diff --git a/app/actions/layers-commands.c b/app/actions/layers-commands.c index 7fe0d42e36..480ba01335 100644 --- a/app/actions/layers-commands.c +++ b/app/actions/layers-commands.c @@ -146,11 +146,11 @@ void layers_text_tool_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GtkWidget *widget; GimpTool *active_tool; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); return_if_no_widget (widget, data); if (! gimp_drawable_is_text_layer (GIMP_DRAWABLE (layer))) @@ -159,20 +159,20 @@ layers_text_tool_cmd_callback (GtkAction *action, return; } - active_tool = tool_manager_get_active (gimage->gimp); + active_tool = tool_manager_get_active (image->gimp); if (! GIMP_IS_TEXT_TOOL (active_tool)) { GimpToolInfo *tool_info; tool_info = (GimpToolInfo *) - gimp_container_get_child_by_name (gimage->gimp->tool_info_list, + gimp_container_get_child_by_name (image->gimp->tool_info_list, "gimp-text-tool"); if (GIMP_IS_TOOL_INFO (tool_info)) { gimp_context_set_tool (action_data_get_context (data), tool_info); - active_tool = tool_manager_get_active (gimage->gimp); + active_tool = tool_manager_get_active (image->gimp); } } @@ -185,10 +185,10 @@ layers_edit_attributes_cmd_callback (GtkAction *action, gpointer data) { LayerOptionsDialog *dialog; - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GtkWidget *widget; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); return_if_no_widget (widget, data); dialog = layer_options_dialog_new (gimp_item_get_image (GIMP_ITEM (layer)), @@ -214,23 +214,23 @@ layers_new_cmd_callback (GtkAction *action, gpointer data) { LayerOptionsDialog *dialog; - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; GimpLayer *floating_sel; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); /* If there is a floating selection, the new command transforms * the current fs into a new layer */ - if ((floating_sel = gimp_image_floating_sel (gimage))) + if ((floating_sel = gimp_image_floating_sel (image))) { floating_sel_to_layer (floating_sel); - gimp_image_flush (gimage); + gimp_image_flush (image); return; } - dialog = layer_options_dialog_new (gimage, action_data_get_context (data), + dialog = layer_options_dialog_new (image, action_data_get_context (data), NULL, widget, layer_name ? layer_name : _("New Layer"), layer_fill_type, @@ -251,22 +251,22 @@ void layers_new_last_vals_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *floating_sel; GimpLayer *new_layer; gint width, height; gint off_x, off_y; gdouble opacity; GimpLayerModeEffects mode; - return_if_no_image (gimage, data); + return_if_no_image (image, data); /* If there is a floating selection, the new command transforms * the current fs into a new layer */ - if ((floating_sel = gimp_image_floating_sel (gimage))) + if ((floating_sel = gimp_image_floating_sel (image))) { floating_sel_to_layer (floating_sel); - gimp_image_flush (gimage); + gimp_image_flush (image); return; } @@ -282,19 +282,19 @@ layers_new_last_vals_cmd_callback (GtkAction *action, } else { - width = gimp_image_get_width (gimage); - height = gimp_image_get_height (gimage); + width = gimp_image_get_width (image); + height = gimp_image_get_height (image); off_x = 0; off_y = 0; opacity = 1.0; mode = GIMP_NORMAL_MODE; } - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, _("New Layer")); - new_layer = gimp_layer_new (gimage, width, height, - gimp_image_base_type_with_alpha (gimage), + new_layer = gimp_layer_new (image, width, height, + gimp_image_base_type_with_alpha (image), layer_name ? layer_name : _("New Layer"), opacity, mode); @@ -303,11 +303,11 @@ layers_new_last_vals_cmd_callback (GtkAction *action, layer_fill_type); gimp_item_translate (GIMP_ITEM (new_layer), off_x, off_y, FALSE); - gimp_image_add_layer (gimage, new_layer, -1); + gimp_image_add_layer (image, new_layer, -1); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_image_flush (gimage); + gimp_image_flush (image); } void @@ -315,21 +315,21 @@ layers_select_cmd_callback (GtkAction *action, gint value, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpLayer *new_layer; - return_if_no_image (gimage, data); + return_if_no_image (image, data); - layer = gimp_image_get_active_layer (gimage); + layer = gimp_image_get_active_layer (image); new_layer = (GimpLayer *) action_select_object ((GimpActionSelectType) value, - gimage->layers, + image->layers, (GimpObject *) layer); if (new_layer && new_layer != layer) { - gimp_image_set_active_layer (gimage, new_layer); - gimp_image_flush (gimage); + gimp_image_set_active_layer (image, new_layer); + gimp_image_flush (image); } } @@ -337,80 +337,80 @@ void layers_raise_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); - gimp_image_raise_layer (gimage, layer); - gimp_image_flush (gimage); + gimp_image_raise_layer (image, layer); + gimp_image_flush (image); } void layers_raise_to_top_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); - gimp_image_raise_layer_to_top (gimage, layer); - gimp_image_flush (gimage); + gimp_image_raise_layer_to_top (image, layer); + gimp_image_flush (image); } void layers_lower_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); - gimp_image_lower_layer (gimage, layer); - gimp_image_flush (gimage); + gimp_image_lower_layer (image, layer); + gimp_image_flush (image); } void layers_lower_to_bottom_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); - gimp_image_lower_layer_to_bottom (gimage, layer); - gimp_image_flush (gimage); + gimp_image_lower_layer_to_bottom (image, layer); + gimp_image_flush (image); } void layers_duplicate_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpLayer *new_layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); new_layer = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (layer), G_TYPE_FROM_INSTANCE (layer), TRUE)); - gimp_image_add_layer (gimage, new_layer, -1); + gimp_image_add_layer (image, new_layer, -1); - gimp_image_flush (gimage); + gimp_image_flush (image); } void layers_anchor_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); if (gimp_layer_is_floating_sel (layer)) { floating_sel_anchor (layer); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -418,38 +418,38 @@ void layers_merge_down_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); - gimp_image_merge_down (gimage, layer, action_data_get_context (data), + gimp_image_merge_down (image, layer, action_data_get_context (data), GIMP_EXPAND_AS_NECESSARY); - gimp_image_flush (gimage); + gimp_image_flush (image); } void layers_delete_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); if (gimp_layer_is_floating_sel (layer)) floating_sel_remove (layer); else - gimp_image_remove_layer (gimage, layer); + gimp_image_remove_layer (image, layer); - gimp_image_flush (gimage); + gimp_image_flush (image); } void layers_text_discard_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); if (GIMP_IS_TEXT_LAYER (layer)) gimp_text_layer_discard (GIMP_TEXT_LAYER (layer)); @@ -490,12 +490,12 @@ void layers_resize_to_image_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); gimp_layer_resize_to_image (layer, action_data_get_context (data)); - gimp_image_flush (gimage); + gimp_image_flush (image); } void @@ -533,13 +533,13 @@ void layers_crop_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; gint x1, y1, x2, y2; gint off_x, off_y; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); - if (! gimp_channel_bounds (gimp_image_get_mask (gimage), + if (! gimp_channel_bounds (gimp_image_get_mask (image), &x1, &y1, &x2, &y2)) { g_message (_("Cannot crop because the current selection is empty.")); @@ -551,15 +551,15 @@ layers_crop_cmd_callback (GtkAction *action, off_x -= x1; off_y -= y1; - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE, _("Crop Layer")); gimp_item_resize (GIMP_ITEM (layer), action_data_get_context (data), x2 - x1, y2 - y1, off_x, off_y); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_image_flush (gimage); + gimp_image_flush (image); } void @@ -567,10 +567,10 @@ layers_mask_add_cmd_callback (GtkAction *action, gpointer data) { LayerAddMaskDialog *dialog; - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GtkWidget *widget; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); return_if_no_widget (widget, data); dialog = layer_add_mask_dialog_new (layer, widget, @@ -588,17 +588,17 @@ layers_mask_apply_cmd_callback (GtkAction *action, gint value, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpMaskApplyMode mode; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); mode = (GimpMaskApplyMode) value; if (gimp_layer_get_mask (layer)) { gimp_layer_apply_mask (layer, mode, TRUE); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -606,10 +606,10 @@ void layers_mask_edit_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpLayerMask *mask; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); mask = gimp_layer_get_mask (layer); @@ -620,7 +620,7 @@ layers_mask_edit_cmd_callback (GtkAction *action, active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); gimp_layer_mask_set_edit (mask, active); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -628,10 +628,10 @@ void layers_mask_show_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpLayerMask *mask; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); mask = gimp_layer_get_mask (layer); @@ -642,7 +642,7 @@ layers_mask_show_cmd_callback (GtkAction *action, active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); gimp_layer_mask_set_show (mask, active, TRUE); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -650,10 +650,10 @@ void layers_mask_disable_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpLayerMask *mask; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); mask = gimp_layer_get_mask (layer); @@ -664,7 +664,7 @@ layers_mask_disable_cmd_callback (GtkAction *action, active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); gimp_layer_mask_set_apply (mask, ! active, TRUE); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -674,10 +674,10 @@ layers_mask_to_selection_cmd_callback (GtkAction *action, gpointer data) { GimpChannelOps op; - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpLayerMask *mask; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); op = (GimpChannelOps) value; @@ -689,12 +689,12 @@ layers_mask_to_selection_cmd_callback (GtkAction *action, gimp_item_offsets (GIMP_ITEM (mask), &off_x, &off_y); - gimp_channel_select_channel (gimp_image_get_mask (gimage), + gimp_channel_select_channel (gimp_image_get_mask (image), _("Layer Mask to Selection"), GIMP_CHANNEL (mask), off_x, off_y, op, FALSE, 0.0, 0.0); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -702,14 +702,14 @@ void layers_alpha_add_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) { gimp_layer_add_alpha (layer); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -717,14 +717,14 @@ void layers_alpha_remove_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) { gimp_layer_flatten (layer, action_data_get_context (data)); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -734,16 +734,16 @@ layers_alpha_to_selection_cmd_callback (GtkAction *action, gpointer data) { GimpChannelOps op; - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); op = (GimpChannelOps) value; - gimp_channel_select_alpha (gimp_image_get_mask (gimage), + gimp_channel_select_alpha (gimp_image_get_mask (image), GIMP_DRAWABLE (layer), op, FALSE, 0.0, 0.0); - gimp_image_flush (gimage); + gimp_image_flush (image); } void @@ -751,14 +751,14 @@ layers_opacity_cmd_callback (GtkAction *action, gint value, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; gdouble opacity; GimpUndo *undo; gboolean push_undo = TRUE; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_LAYER_OPACITY); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer)) @@ -769,7 +769,7 @@ layers_opacity_cmd_callback (GtkAction *action, 0.0, 1.0, 0.01, 0.1, FALSE); gimp_layer_set_opacity (layer, opacity, push_undo); - gimp_image_flush (gimage); + gimp_image_flush (image); } void @@ -777,15 +777,15 @@ layers_mode_cmd_callback (GtkAction *action, gint value, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpLayerModeEffects layer_mode; gint index; GimpUndo *undo; gboolean push_undo = TRUE; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_LAYER_MODE); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer)) @@ -798,17 +798,17 @@ layers_mode_cmd_callback (GtkAction *action, 0, G_N_ELEMENTS (layer_modes) - 1, 1.0, 1.0, FALSE); gimp_layer_set_mode (layer, layer_modes[index], push_undo); - gimp_image_flush (gimage); + gimp_image_flush (image); } void layers_lock_alpha_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; gboolean lock_alpha; - return_if_no_layer (gimage, layer, data); + return_if_no_layer (image, layer, data); lock_alpha = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); @@ -817,14 +817,14 @@ layers_lock_alpha_cmd_callback (GtkAction *action, GimpUndo *undo; gboolean push_undo = TRUE; - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_LAYER_LOCK_ALPHA); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer)) push_undo = FALSE; gimp_layer_set_lock_alpha (layer, lock_alpha, push_undo); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -854,10 +854,10 @@ layers_new_layer_response (GtkWidget *widget, RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (dialog->size_se), 1)); - layer = gimp_layer_new (dialog->gimage, + layer = gimp_layer_new (dialog->image, dialog->xsize, dialog->ysize, - gimp_image_base_type_with_alpha (dialog->gimage), + gimp_image_base_type_with_alpha (dialog->image), layer_name, GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); @@ -866,9 +866,9 @@ layers_new_layer_response (GtkWidget *widget, gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer), dialog->context, layer_fill_type); - gimp_image_add_layer (dialog->gimage, layer, -1); + gimp_image_add_layer (dialog->image, layer, -1); - gimp_image_flush (dialog->gimage); + gimp_image_flush (dialog->image); } else { @@ -895,7 +895,7 @@ layers_edit_layer_response (GtkWidget *widget, if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (layer)))) { gimp_item_rename (GIMP_ITEM (layer), new_name); - gimp_image_flush (dialog->gimage); + gimp_image_flush (dialog->image); } if (dialog->rename_toggle && @@ -919,13 +919,13 @@ layers_add_mask_response (GtkWidget *widget, if (response_id == GTK_RESPONSE_OK) { GimpLayer *layer = dialog->layer; - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer)); GimpLayerMask *mask; layer_add_mask_type = dialog->add_mask_type; layer_mask_invert = dialog->invert; - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_ADD_MASK, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_LAYER_ADD_MASK, _("Add Layer Mask")); if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (layer))) @@ -938,9 +938,9 @@ layers_add_mask_response (GtkWidget *widget, gimp_layer_add_mask (layer, mask, TRUE); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_image_flush (gimage); + gimp_image_flush (image); } gtk_widget_destroy (dialog->dialog); diff --git a/app/actions/plug-in-actions.c b/app/actions/plug-in-actions.c index 9713ce6342..18f391aaea 100644 --- a/app/actions/plug-in-actions.c +++ b/app/actions/plug-in-actions.c @@ -189,14 +189,14 @@ void plug_in_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); GimpImageType type = -1; GSList *list; gint i; - if (gimage) + if (image) { - GimpDrawable *drawable = gimp_image_active_drawable (gimage); + GimpDrawable *drawable = gimp_image_active_drawable (image); if (drawable) type = gimp_drawable_type (drawable); diff --git a/app/actions/plug-in-commands.c b/app/actions/plug-in-commands.c index 43e5c2f4e5..cb088bb6b1 100644 --- a/app/actions/plug-in-commands.c +++ b/app/actions/plug-in-commands.c @@ -94,7 +94,7 @@ plug_in_run_cmd_callback (GtkAction *action, if (gdisp) { - args[n_args].value.pdb_int = gimp_image_get_ID (gdisp->gimage); + args[n_args].value.pdb_int = gimp_image_get_ID (gdisp->image); n_args++; if (proc_rec->num_args > n_args && @@ -102,7 +102,7 @@ plug_in_run_cmd_callback (GtkAction *action, { GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (drawable) { @@ -158,18 +158,18 @@ plug_in_repeat_cmd_callback (GtkAction *action, if (! gdisp) return; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (! drawable) return; if (strcmp (gtk_action_get_name (action), "plug-in-repeat") == 0) interactive = FALSE; - plug_in_repeat (gdisp->gimage->gimp, value, - gimp_get_user_context (gdisp->gimage->gimp), + plug_in_repeat (gdisp->image->gimp, value, + gimp_get_user_context (gdisp->image->gimp), GIMP_PROGRESS (gdisp), gimp_display_get_ID (gdisp), - gimp_image_get_ID (gdisp->gimage), + gimp_image_get_ID (gdisp->image), gimp_item_get_ID (GIMP_ITEM (drawable)), interactive); } diff --git a/app/actions/quick-mask-actions.c b/app/actions/quick-mask-actions.c index 9a078dacb5..3921d85572 100644 --- a/app/actions/quick-mask-actions.c +++ b/app/actions/quick-mask-actions.c @@ -94,7 +94,7 @@ void quick_mask_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); #define SET_SENSITIVE(action,sensitive) \ gimp_action_group_set_action_sensitive (group, action, (sensitive) != 0) @@ -103,21 +103,21 @@ quick_mask_actions_update (GimpActionGroup *group, #define SET_COLOR(action,color) \ gimp_action_group_set_action_color (group, action, (color), FALSE) - SET_SENSITIVE ("quick-mask-toggle", gimage); - SET_ACTIVE ("quick-mask-toggle", gimage && gimage->quick_mask_state); + SET_SENSITIVE ("quick-mask-toggle", image); + SET_ACTIVE ("quick-mask-toggle", image && image->quick_mask_state); - SET_SENSITIVE ("quick-mask-invert-on", gimage); - SET_SENSITIVE ("quick-mask-invert-off", gimage); + SET_SENSITIVE ("quick-mask-invert-on", image); + SET_SENSITIVE ("quick-mask-invert-off", image); - if (gimage && gimage->quick_mask_inverted) + if (image && image->quick_mask_inverted) SET_ACTIVE ("quick-mask-invert-on", TRUE); else SET_ACTIVE ("quick-mask-invert-off", TRUE); - SET_SENSITIVE ("quick-mask-configure", gimage); + SET_SENSITIVE ("quick-mask-configure", image); - if (gimage) - SET_COLOR ("quick-mask-configure", &gimage->quick_mask_color); + if (image) + SET_COLOR ("quick-mask-configure", &image->quick_mask_color); #undef SET_SENSITIVE #undef SET_ACTIVE diff --git a/app/actions/quick-mask-commands.c b/app/actions/quick-mask-commands.c index 248d7fb9d4..9c4f38f3ee 100644 --- a/app/actions/quick-mask-commands.c +++ b/app/actions/quick-mask-commands.c @@ -53,16 +53,16 @@ void quick_mask_toggle_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; gboolean active; - return_if_no_image (gimage, data); + return_if_no_image (image, data); active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); - if (active != gimp_image_get_quick_mask_state (gimage)) + if (active != gimp_image_get_quick_mask_state (image)) { - gimp_image_set_quick_mask_state (gimage, active); - gimp_image_flush (gimage); + gimp_image_set_quick_mask_state (image, active); + gimp_image_flush (image); } } @@ -71,16 +71,16 @@ quick_mask_invert_cmd_callback (GtkAction *action, GtkAction *current, gpointer data) { - GimpImage *gimage; + GimpImage *image; gint value; - return_if_no_image (gimage, data); + return_if_no_image (image, data); value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action)); - if (value != gimage->quick_mask_inverted) + if (value != image->quick_mask_inverted) { - gimp_image_quick_mask_invert (gimage); - gimp_image_flush (gimage); + gimp_image_quick_mask_invert (image); + gimp_image_flush (image); } } @@ -89,15 +89,15 @@ quick_mask_configure_cmd_callback (GtkAction *action, gpointer data) { ChannelOptionsDialog *options; - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; GimpRGB color; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); - gimp_image_get_quick_mask_color (gimage, &color); + gimp_image_get_quick_mask_color (image, &color); - options = channel_options_dialog_new (gimage, + options = channel_options_dialog_new (image, action_data_get_context (data), NULL, widget, @@ -132,15 +132,15 @@ quick_mask_configure_response (GtkWidget *widget, GimpRGB old_color; GimpRGB new_color; - gimp_image_get_quick_mask_color (options->gimage, &old_color); + gimp_image_get_quick_mask_color (options->image, &old_color); gimp_color_button_get_color (GIMP_COLOR_BUTTON (options->color_panel), &new_color); if (gimp_rgba_distance (&old_color, &new_color) > 0.0001) { - gimp_image_set_quick_mask_color (options->gimage, &new_color); + gimp_image_set_quick_mask_color (options->image, &new_color); - gimp_image_flush (options->gimage); + gimp_image_flush (options->image); } } diff --git a/app/actions/select-actions.c b/app/actions/select-actions.c index 01bc88a89a..1294312bfc 100644 --- a/app/actions/select-actions.c +++ b/app/actions/select-actions.c @@ -132,17 +132,17 @@ void select_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); GimpDrawable *drawable = NULL; gboolean fs = FALSE; gboolean sel = FALSE; - if (gimage) + if (image) { - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); - fs = (gimp_image_floating_sel (gimage) != NULL); - sel = ! gimp_channel_is_empty (gimp_image_get_mask (gimage)); + fs = (gimp_image_floating_sel (image) != NULL); + sel = ! gimp_channel_is_empty (gimp_image_get_mask (image)); } #define SET_SENSITIVE(action,condition) \ diff --git a/app/actions/select-commands.c b/app/actions/select-commands.c index 5b9d963fc2..23c86a4380 100644 --- a/app/actions/select-commands.c +++ b/app/actions/select-commands.c @@ -82,47 +82,47 @@ void select_invert_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; - return_if_no_image (gimage, data); + GimpImage *image; + return_if_no_image (image, data); - gimp_channel_invert (gimp_image_get_mask (gimage), TRUE); - gimp_image_flush (gimage); + gimp_channel_invert (gimp_image_get_mask (image), TRUE); + gimp_image_flush (image); } void select_all_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; - return_if_no_image (gimage, data); + GimpImage *image; + return_if_no_image (image, data); - gimp_channel_all (gimp_image_get_mask (gimage), TRUE); - gimp_image_flush (gimage); + gimp_channel_all (gimp_image_get_mask (image), TRUE); + gimp_image_flush (image); } void select_none_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; - return_if_no_image (gimage, data); + GimpImage *image; + return_if_no_image (image, data); - gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE); - gimp_image_flush (gimage); + gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE); + gimp_image_flush (image); } void select_float_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; - return_if_no_image (gimage, data); + GimpImage *image; + return_if_no_image (image, data); - gimp_selection_float (gimp_image_get_mask (gimage), - gimp_image_active_drawable (gimage), + gimp_selection_float (gimp_image_get_mask (image), + gimp_image_active_drawable (image), action_data_get_context (data), TRUE, 0, 0); - gimp_image_flush (gimage); + gimp_image_flush (image); } void @@ -140,11 +140,11 @@ select_feather_cmd_callback (GtkAction *action, _("Feather selection by"), select_feather_radius, 0, 32767, 3, GIMP_DISPLAY_SHELL (gdisp->shell)->unit, - MIN (gdisp->gimage->xresolution, - gdisp->gimage->yresolution), + MIN (gdisp->image->xresolution, + gdisp->image->yresolution), FALSE, - G_OBJECT (gdisp->gimage), "disconnect", - select_feather_callback, gdisp->gimage); + G_OBJECT (gdisp->image), "disconnect", + select_feather_callback, gdisp->image); gtk_widget_show (dialog); } @@ -152,11 +152,11 @@ void select_sharpen_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; - return_if_no_image (gimage, data); + GimpImage *image; + return_if_no_image (image, data); - gimp_channel_sharpen (gimp_image_get_mask (gimage), TRUE); - gimp_image_flush (gimage); + gimp_channel_sharpen (gimp_image_get_mask (image), TRUE); + gimp_image_flush (image); } void @@ -175,11 +175,11 @@ select_shrink_cmd_callback (GtkAction *action, _("Shrink selection by"), select_shrink_pixels, 1, 32767, 0, GIMP_DISPLAY_SHELL (gdisp->shell)->unit, - MIN (gdisp->gimage->xresolution, - gdisp->gimage->yresolution), + MIN (gdisp->image->xresolution, + gdisp->image->yresolution), FALSE, - G_OBJECT (gdisp->gimage), "disconnect", - select_shrink_callback, gdisp->gimage); + G_OBJECT (gdisp->image), "disconnect", + select_shrink_callback, gdisp->image); edge_lock = gtk_check_button_new_with_label (_("Shrink from image border")); @@ -209,11 +209,11 @@ select_grow_cmd_callback (GtkAction *action, _("Grow selection by"), select_grow_pixels, 1, 32767, 0, GIMP_DISPLAY_SHELL (gdisp->shell)->unit, - MIN (gdisp->gimage->xresolution, - gdisp->gimage->yresolution), + MIN (gdisp->image->xresolution, + gdisp->image->yresolution), FALSE, - G_OBJECT (gdisp->gimage), "disconnect", - select_grow_callback, gdisp->gimage); + G_OBJECT (gdisp->image), "disconnect", + select_grow_callback, gdisp->image); gtk_widget_show (dialog); } @@ -232,11 +232,11 @@ select_border_cmd_callback (GtkAction *action, _("Border selection by"), select_border_radius, 1, 32767, 0, GIMP_DISPLAY_SHELL (gdisp->shell)->unit, - MIN (gdisp->gimage->xresolution, - gdisp->gimage->yresolution), + MIN (gdisp->image->xresolution, + gdisp->image->yresolution), FALSE, - G_OBJECT (gdisp->gimage), "disconnect", - select_border_callback, gdisp->gimage); + G_OBJECT (gdisp->image), "disconnect", + select_border_callback, gdisp->image); gtk_widget_show (dialog); } @@ -244,13 +244,13 @@ void select_save_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); - gimp_selection_save (gimp_image_get_mask (gimage)); - gimp_image_flush (gimage); + gimp_selection_save (gimp_image_get_mask (image)); + gimp_image_flush (image); gimp_dialog_factory_dialog_raise (global_dock_factory, gtk_widget_get_screen (widget), @@ -261,14 +261,14 @@ void select_stroke_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; GtkWidget *widget; GtkWidget *dialog; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); if (! drawable) { @@ -276,7 +276,7 @@ select_stroke_cmd_callback (GtkAction *action, return; } - dialog = stroke_dialog_new (GIMP_ITEM (gimp_image_get_mask (gimage)), + dialog = stroke_dialog_new (GIMP_ITEM (gimp_image_get_mask (image)), _("Stroke Selection"), GIMP_STOCK_SELECTION_STROKE, GIMP_HELP_SELECTION_STROKE, @@ -328,7 +328,7 @@ select_feather_callback (GtkWidget *widget, GimpUnit unit, gpointer data) { - GimpImage *gimage = GIMP_IMAGE (data); + GimpImage *image = GIMP_IMAGE (data); gdouble radius_x; gdouble radius_y; @@ -340,17 +340,17 @@ select_feather_callback (GtkWidget *widget, { gdouble factor; - factor = (MAX (gimage->xresolution, gimage->yresolution) / - MIN (gimage->xresolution, gimage->yresolution)); + factor = (MAX (image->xresolution, image->yresolution) / + MIN (image->xresolution, image->yresolution)); - if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution)) + if (image->xresolution == MIN (image->xresolution, image->yresolution)) radius_y *= factor; else radius_x *= factor; } - gimp_channel_feather (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE); - gimp_image_flush (gimage); + gimp_channel_feather (gimp_image_get_mask (image), radius_x, radius_y, TRUE); + gimp_image_flush (image); } static void @@ -359,7 +359,7 @@ select_border_callback (GtkWidget *widget, GimpUnit unit, gpointer data) { - GimpImage *gimage = GIMP_IMAGE (data); + GimpImage *image = GIMP_IMAGE (data); gdouble radius_x; gdouble radius_y; @@ -371,17 +371,17 @@ select_border_callback (GtkWidget *widget, { gdouble factor; - factor = (MAX (gimage->xresolution, gimage->yresolution) / - MIN (gimage->xresolution, gimage->yresolution)); + factor = (MAX (image->xresolution, image->yresolution) / + MIN (image->xresolution, image->yresolution)); - if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution)) + if (image->xresolution == MIN (image->xresolution, image->yresolution)) radius_y *= factor; else radius_x *= factor; } - gimp_channel_border (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE); - gimp_image_flush (gimage); + gimp_channel_border (gimp_image_get_mask (image), radius_x, radius_y, TRUE); + gimp_image_flush (image); } static void @@ -390,7 +390,7 @@ select_grow_callback (GtkWidget *widget, GimpUnit unit, gpointer data) { - GimpImage *gimage = GIMP_IMAGE (data); + GimpImage *image = GIMP_IMAGE (data); gdouble radius_x; gdouble radius_y; @@ -402,17 +402,17 @@ select_grow_callback (GtkWidget *widget, { gdouble factor; - factor = (MAX (gimage->xresolution, gimage->yresolution) / - MIN (gimage->xresolution, gimage->yresolution)); + factor = (MAX (image->xresolution, image->yresolution) / + MIN (image->xresolution, image->yresolution)); - if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution)) + if (image->xresolution == MIN (image->xresolution, image->yresolution)) radius_y *= factor; else radius_x *= factor; } - gimp_channel_grow (gimp_image_get_mask (gimage), radius_x, radius_y, TRUE); - gimp_image_flush (gimage); + gimp_channel_grow (gimp_image_get_mask (image), radius_x, radius_y, TRUE); + gimp_image_flush (image); } static void @@ -421,7 +421,7 @@ select_shrink_callback (GtkWidget *widget, GimpUnit unit, gpointer data) { - GimpImage *gimage = GIMP_IMAGE (data); + GimpImage *image = GIMP_IMAGE (data); gint radius_x; gint radius_y; @@ -437,16 +437,16 @@ select_shrink_callback (GtkWidget *widget, { gdouble factor; - factor = (MAX (gimage->xresolution, gimage->yresolution) / - MIN (gimage->xresolution, gimage->yresolution)); + factor = (MAX (image->xresolution, image->yresolution) / + MIN (image->xresolution, image->yresolution)); - if (gimage->xresolution == MIN (gimage->xresolution, gimage->yresolution)) + if (image->xresolution == MIN (image->xresolution, image->yresolution)) radius_y *= factor; else radius_x *= factor; } - gimp_channel_shrink (gimp_image_get_mask (gimage), radius_x, radius_y, + gimp_channel_shrink (gimp_image_get_mask (image), radius_x, radius_y, select_shrink_edge_lock, TRUE); - gimp_image_flush (gimage); + gimp_image_flush (image); } diff --git a/app/actions/vectors-actions.c b/app/actions/vectors-actions.c index dd22046ed7..19fe7971c6 100644 --- a/app/actions/vectors-actions.c +++ b/app/actions/vectors-actions.c @@ -235,7 +235,7 @@ void vectors_actions_update (GimpActionGroup *group, gpointer data) { - GimpImage *gimage = action_data_get_image (data); + GimpImage *image = action_data_get_image (data); GimpVectors *vectors = NULL; gint n_vectors = 0; gboolean mask_empty = TRUE; @@ -245,13 +245,13 @@ vectors_actions_update (GimpActionGroup *group, GList *next = NULL; GList *prev = NULL; - if (gimage) + if (image) { - n_vectors = gimp_container_num_children (gimage->vectors); - mask_empty = gimp_channel_is_empty (gimp_image_get_mask (gimage)); + n_vectors = gimp_container_num_children (image->vectors); + mask_empty = gimp_channel_is_empty (gimp_image_get_mask (image)); global_buf = FALSE; - vectors = gimp_image_get_active_vectors (gimage); + vectors = gimp_image_get_active_vectors (image); if (vectors) { @@ -261,7 +261,7 @@ vectors_actions_update (GimpActionGroup *group, visible = gimp_item_get_visible (item); linked = gimp_item_get_linked (item); - list = g_list_find (GIMP_LIST (gimage->vectors)->list, vectors); + list = g_list_find (GIMP_LIST (image->vectors)->list, vectors); if (list) { @@ -279,8 +279,8 @@ vectors_actions_update (GimpActionGroup *group, SET_SENSITIVE ("vectors-path-tool", vectors); SET_SENSITIVE ("vectors-edit-attributes", vectors); - SET_SENSITIVE ("vectors-new", gimage); - SET_SENSITIVE ("vectors-new-last-values", gimage); + SET_SENSITIVE ("vectors-new", image); + SET_SENSITIVE ("vectors-new-last-values", image); SET_SENSITIVE ("vectors-duplicate", vectors); SET_SENSITIVE ("vectors-delete", vectors); SET_SENSITIVE ("vectors-merge-visible", n_vectors > 1); @@ -291,9 +291,9 @@ vectors_actions_update (GimpActionGroup *group, SET_SENSITIVE ("vectors-lower-to-bottom", vectors && next); SET_SENSITIVE ("vectors-copy", vectors); - SET_SENSITIVE ("vectors-paste", gimage); + SET_SENSITIVE ("vectors-paste", image); SET_SENSITIVE ("vectors-export", vectors); - SET_SENSITIVE ("vectors-import", gimage); + SET_SENSITIVE ("vectors-import", image); SET_SENSITIVE ("vectors-visible", vectors); SET_SENSITIVE ("vectors-linked", vectors); @@ -301,9 +301,9 @@ vectors_actions_update (GimpActionGroup *group, SET_ACTIVE ("vectors-visible", visible); SET_ACTIVE ("vectors-linked", linked); - SET_SENSITIVE ("vectors-selection-to-vectors", gimage && !mask_empty); - SET_SENSITIVE ("vectors-selection-to-vectors-short", gimage && !mask_empty); - SET_SENSITIVE ("vectors-selection-to-vectors-advanced", gimage && !mask_empty); + SET_SENSITIVE ("vectors-selection-to-vectors", image && !mask_empty); + SET_SENSITIVE ("vectors-selection-to-vectors-short", image && !mask_empty); + SET_SENSITIVE ("vectors-selection-to-vectors-advanced", image && !mask_empty); SET_SENSITIVE ("vectors-stroke", vectors); SET_SENSITIVE ("vectors-stroke-last-values", vectors); diff --git a/app/actions/vectors-commands.c b/app/actions/vectors-commands.c index c5416d602b..6299b40a65 100644 --- a/app/actions/vectors-commands.c +++ b/app/actions/vectors-commands.c @@ -97,25 +97,25 @@ void vectors_vectors_tool_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; GimpTool *active_tool; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); - active_tool = tool_manager_get_active (gimage->gimp); + active_tool = tool_manager_get_active (image->gimp); if (! GIMP_IS_VECTOR_TOOL (active_tool)) { GimpToolInfo *tool_info; tool_info = (GimpToolInfo *) - gimp_container_get_child_by_name (gimage->gimp->tool_info_list, + gimp_container_get_child_by_name (image->gimp->tool_info_list, "gimp-vector-tool"); if (GIMP_IS_TOOL_INFO (tool_info)) { gimp_context_set_tool (action_data_get_context (data), tool_info); - active_tool = tool_manager_get_active (gimage->gimp); + active_tool = tool_manager_get_active (image->gimp); } } @@ -128,13 +128,13 @@ vectors_edit_attributes_cmd_callback (GtkAction *action, gpointer data) { VectorsOptionsDialog *options; - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; GtkWidget *widget; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); return_if_no_widget (widget, data); - options = vectors_options_dialog_new (gimage, + options = vectors_options_dialog_new (image, vectors, widget, gimp_object_get_name (GIMP_OBJECT (vectors)), @@ -156,12 +156,12 @@ vectors_new_cmd_callback (GtkAction *action, gpointer data) { VectorsOptionsDialog *options; - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); - options = vectors_options_dialog_new (gimage, + options = vectors_options_dialog_new (image, NULL, widget, vectors_name ? vectors_name : @@ -183,105 +183,105 @@ void vectors_new_last_vals_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *new_vectors; - return_if_no_image (gimage, data); + return_if_no_image (image, data); - new_vectors = gimp_vectors_new (gimage, + new_vectors = gimp_vectors_new (image, vectors_name ? vectors_name : _("New Path")); - gimp_image_add_vectors (gimage, new_vectors, -1); + gimp_image_add_vectors (image, new_vectors, -1); - gimp_image_flush (gimage); + gimp_image_flush (image); } void vectors_raise_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); - gimp_image_raise_vectors (gimage, vectors); - gimp_image_flush (gimage); + gimp_image_raise_vectors (image, vectors); + gimp_image_flush (image); } void vectors_raise_to_top_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); - gimp_image_raise_vectors_to_top (gimage, vectors); - gimp_image_flush (gimage); + gimp_image_raise_vectors_to_top (image, vectors); + gimp_image_flush (image); } void vectors_lower_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); - gimp_image_lower_vectors (gimage, vectors); - gimp_image_flush (gimage); + gimp_image_lower_vectors (image, vectors); + gimp_image_flush (image); } void vectors_lower_to_bottom_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); - gimp_image_lower_vectors_to_bottom (gimage, vectors); - gimp_image_flush (gimage); + gimp_image_lower_vectors_to_bottom (image, vectors); + gimp_image_flush (image); } void vectors_duplicate_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; GimpVectors *new_vectors; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); new_vectors = GIMP_VECTORS (gimp_item_duplicate (GIMP_ITEM (vectors), G_TYPE_FROM_INSTANCE (vectors), TRUE)); - gimp_image_add_vectors (gimage, new_vectors, -1); - gimp_image_flush (gimage); + gimp_image_add_vectors (image, new_vectors, -1); + gimp_image_flush (image); } void vectors_delete_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); - gimp_image_remove_vectors (gimage, vectors); - gimp_image_flush (gimage); + gimp_image_remove_vectors (image, vectors); + gimp_image_flush (image); } void vectors_merge_visible_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); - gimp_image_merge_visible_vectors (gimage); - gimp_image_flush (gimage); + gimp_image_merge_visible_vectors (image); + gimp_image_flush (image); } void @@ -290,17 +290,17 @@ vectors_to_selection_cmd_callback (GtkAction *action, gpointer data) { GimpChannelOps op; - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); op = (GimpChannelOps) value; - gimp_channel_select_vectors (gimp_image_get_mask (gimage), + gimp_channel_select_vectors (gimp_image_get_mask (image), _("Path to Selection"), vectors, op, TRUE, FALSE, 0, 0); - gimp_image_flush (gimage); + gimp_image_flush (image); } void @@ -308,17 +308,17 @@ vectors_selection_to_vectors_cmd_callback (GtkAction *action, gint value, gpointer data) { - GimpImage *gimage; + GimpImage *image; ProcRecord *proc_rec; Argument *args; GimpDisplay *gdisp; - return_if_no_image (gimage, data); + return_if_no_image (image, data); if (value) - proc_rec = procedural_db_lookup (gimage->gimp, + proc_rec = procedural_db_lookup (image->gimp, "plug-in-sel2path-advanced"); else - proc_rec = procedural_db_lookup (gimage->gimp, + proc_rec = procedural_db_lookup (image->gimp, "plug-in-sel2path"); if (! proc_rec) @@ -333,10 +333,10 @@ vectors_selection_to_vectors_cmd_callback (GtkAction *action, args = procedural_db_arguments (proc_rec); args[0].value.pdb_int = GIMP_RUN_INTERACTIVE; - args[1].value.pdb_int = (gint32) gimp_image_get_ID (gimage); + args[1].value.pdb_int = (gint32) gimp_image_get_ID (image); args[2].value.pdb_int = -1; /* unused */ - plug_in_run (gimage->gimp, action_data_get_context (data), + plug_in_run (image->gimp, action_data_get_context (data), GIMP_PROGRESS (gdisp), proc_rec, args, 3 /* not proc_rec->num_args */, FALSE, TRUE, gdisp ? gimp_display_get_ID (gdisp) : 0); @@ -348,15 +348,15 @@ void vectors_stroke_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; GimpDrawable *drawable; GtkWidget *widget; GtkWidget *dialog; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); return_if_no_widget (widget, data); - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); if (! drawable) { @@ -411,16 +411,16 @@ void vectors_copy_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; gchar *svg; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); - svg = gimp_vectors_export_string (gimage, vectors); + svg = gimp_vectors_export_string (image, vectors); if (svg) { - gimp_clipboard_set_svg (gimage->gimp, svg); + gimp_clipboard_set_svg (image->gimp, svg); g_free (svg); } } @@ -429,18 +429,18 @@ void vectors_paste_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; gchar *svg; gsize svg_size; - return_if_no_image (gimage, data); + return_if_no_image (image, data); - svg = gimp_clipboard_get_svg (gimage->gimp, &svg_size); + svg = gimp_clipboard_get_svg (image->gimp, &svg_size); if (svg) { GError *error = NULL; - if (! gimp_vectors_import_buffer (gimage, svg, svg_size, + if (! gimp_vectors_import_buffer (image, svg, svg_size, TRUE, TRUE, -1, &error)) { g_message (error->message); @@ -448,7 +448,7 @@ vectors_paste_cmd_callback (GtkAction *action, } else { - gimp_image_flush (gimage); + gimp_image_flush (image); } g_free (svg); @@ -460,13 +460,13 @@ vectors_export_cmd_callback (GtkAction *action, gpointer data) { VectorsExportDialog *dialog; - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; GtkWidget *widget; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); return_if_no_widget (widget, data); - dialog = vectors_export_dialog_new (gimage, widget, + dialog = vectors_export_dialog_new (image, widget, vectors_export_active_only); g_signal_connect (dialog->dialog, "response", @@ -481,12 +481,12 @@ vectors_import_cmd_callback (GtkAction *action, gpointer data) { VectorsImportDialog *dialog; - GimpImage *gimage; + GimpImage *image; GtkWidget *widget; - return_if_no_image (gimage, data); + return_if_no_image (image, data); return_if_no_widget (widget, data); - dialog = vectors_import_dialog_new (gimage, widget, + dialog = vectors_import_dialog_new (image, widget, vectors_import_merge, vectors_import_scale); @@ -501,10 +501,10 @@ void vectors_visible_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; gboolean visible; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); visible = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); @@ -513,14 +513,14 @@ vectors_visible_cmd_callback (GtkAction *action, GimpUndo *undo; gboolean push_undo = TRUE; - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_ITEM_VISIBILITY); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (vectors)) push_undo = FALSE; gimp_item_set_visible (GIMP_ITEM (vectors), visible, push_undo); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -528,10 +528,10 @@ void vectors_linked_cmd_callback (GtkAction *action, gpointer data) { - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; gboolean linked; - return_if_no_vectors (gimage, vectors, data); + return_if_no_vectors (image, vectors, data); linked = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); @@ -540,14 +540,14 @@ vectors_linked_cmd_callback (GtkAction *action, GimpUndo *undo; gboolean push_undo = TRUE; - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_ITEM_LINKED); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (vectors)) push_undo = FALSE; gimp_item_set_linked (GIMP_ITEM (vectors), linked, push_undo); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -569,11 +569,11 @@ vectors_new_vectors_response (GtkWidget *widget, vectors_name = g_strdup (gtk_entry_get_text (GTK_ENTRY (options->name_entry))); - new_vectors = gimp_vectors_new (options->gimage, vectors_name); + new_vectors = gimp_vectors_new (options->image, vectors_name); - gimp_image_add_vectors (options->gimage, new_vectors, -1); + gimp_image_add_vectors (options->image, new_vectors, -1); - gimp_image_flush (options->gimage); + gimp_image_flush (options->image); } gtk_widget_destroy (options->dialog); @@ -594,7 +594,7 @@ vectors_edit_vectors_response (GtkWidget *widget, if (strcmp (new_name, gimp_object_get_name (GIMP_OBJECT (vectors)))) { gimp_item_rename (GIMP_ITEM (vectors), new_name); - gimp_image_flush (options->gimage); + gimp_image_flush (options->image); } } diff --git a/app/actions/view-actions.c b/app/actions/view-actions.c index fe74ea64c9..3b7c294d75 100644 --- a/app/actions/view-actions.c +++ b/app/actions/view-actions.c @@ -500,13 +500,11 @@ view_actions_update (GimpActionGroup *group, GimpDisplay *gdisp = action_data_get_display (data); GimpDisplayShell *shell = NULL; GimpDisplayOptions *options = NULL; - GimpImage *gimage = NULL; gboolean fullscreen = FALSE; if (gdisp) { - shell = GIMP_DISPLAY_SHELL (gdisp->shell); - gimage = gdisp->gimage; + shell = GIMP_DISPLAY_SHELL (gdisp->shell); fullscreen = gimp_display_shell_get_fullscreen (shell); diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c index 615153565b..bcf97b8eff 100644 --- a/app/actions/view-commands.c +++ b/app/actions/view-commands.c @@ -60,7 +60,7 @@ #define IS_ACTIVE_DISPLAY(gdisp) \ ((gdisp) == \ - gimp_context_get_display (gimp_get_user_context ((gdisp)->gimage->gimp))) + gimp_context_get_display (gimp_get_user_context ((gdisp)->image->gimp))) /* local function prototypes */ @@ -83,8 +83,8 @@ view_new_cmd_callback (GtkAction *action, shell = GIMP_DISPLAY_SHELL (gdisp->shell); - gimp_create_display (gdisp->gimage->gimp, - gdisp->gimage, + gimp_create_display (gdisp->image->gimp, + gdisp->image, shell->unit, gimp_zoom_model_get_factor (shell->zoom)); } @@ -565,7 +565,7 @@ view_padding_color_cmd_callback (GtkAction *action, if (! color_dialog) { - color_dialog = gimp_color_dialog_new (GIMP_VIEWABLE (gdisp->gimage), + color_dialog = gimp_color_dialog_new (GIMP_VIEWABLE (gdisp->image), _("Set Canvas Padding Color"), GTK_STOCK_SELECT_COLOR, _("Set Custom Canvas Padding Color"), @@ -594,7 +594,7 @@ view_padding_color_cmd_callback (GtkAction *action, GimpDisplayConfig *config; GimpDisplayOptions *default_options; - config = GIMP_DISPLAY_CONFIG (gdisp->gimage->gimp->config); + config = GIMP_DISPLAY_CONFIG (gdisp->image->gimp->config); options->padding_mode_set = FALSE; diff --git a/app/app_procs.c b/app/app_procs.c index c9585fc660..8ab8dee6f9 100644 --- a/app/app_procs.c +++ b/app/app_procs.c @@ -318,16 +318,16 @@ app_run (const gchar *full_prog_name, } else { - GimpImage *gimage; + GimpImage *image; GimpPDBStatusType status; - gimage = file_open_with_display (gimp, - gimp_get_user_context (gimp), - NULL, - uri, - &status, &error); + image = file_open_with_display (gimp, + gimp_get_user_context (gimp), + NULL, + uri, + &status, &error); - if (! gimage && status != GIMP_PDB_CANCEL) + if (! image && status != GIMP_PDB_CANCEL) { gchar *filename = file_utils_uri_to_utf8_filename (uri); diff --git a/app/core/gimp-edit.c b/app/core/gimp-edit.c index 75b0b5a874..70b0417410 100644 --- a/app/core/gimp-edit.c +++ b/app/core/gimp-edit.c @@ -51,16 +51,16 @@ /* local function protypes */ -static GimpBuffer * gimp_edit_extract (GimpImage *gimage, +static GimpBuffer * gimp_edit_extract (GimpImage *image, GimpDrawable *drawable, GimpContext *context, gboolean cut_pixels); -static GimpBuffer * gimp_edit_extract_visible (GimpImage *gimage, +static GimpBuffer * gimp_edit_extract_visible (GimpImage *image, GimpContext *context); static GimpBuffer * gimp_edit_make_buffer (Gimp *gimp, TileManager *tiles, gboolean mask_empty); -static gboolean gimp_edit_fill_internal (GimpImage *gimage, +static gboolean gimp_edit_fill_internal (GimpImage *image, GimpDrawable *drawable, GimpContext *context, GimpFillType fill_type, @@ -72,79 +72,79 @@ static gboolean gimp_edit_fill_internal (GimpImage *gimage, /* public functions */ const GimpBuffer * -gimp_edit_cut (GimpImage *gimage, +gimp_edit_cut (GimpImage *image, GimpDrawable *drawable, GimpContext *context) { GimpBuffer *buffer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - buffer = gimp_edit_extract (gimage, drawable, context, TRUE); + buffer = gimp_edit_extract (image, drawable, context, TRUE); if (buffer) { - gimp_set_global_buffer (gimage->gimp, buffer); + gimp_set_global_buffer (image->gimp, buffer); g_object_unref (buffer); - return gimage->gimp->global_buffer; + return image->gimp->global_buffer; } return NULL; } const GimpBuffer * -gimp_edit_copy (GimpImage *gimage, +gimp_edit_copy (GimpImage *image, GimpDrawable *drawable, GimpContext *context) { GimpBuffer *buffer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - buffer = gimp_edit_extract (gimage, drawable, context, FALSE); + buffer = gimp_edit_extract (image, drawable, context, FALSE); if (buffer) { - gimp_set_global_buffer (gimage->gimp, buffer); + gimp_set_global_buffer (image->gimp, buffer); g_object_unref (buffer); - return gimage->gimp->global_buffer; + return image->gimp->global_buffer; } return NULL; } const GimpBuffer * -gimp_edit_copy_visible (GimpImage *gimage, +gimp_edit_copy_visible (GimpImage *image, GimpContext *context) { GimpBuffer *buffer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - buffer = gimp_edit_extract_visible (gimage, context); + buffer = gimp_edit_extract_visible (image, context); if (buffer) { - gimp_set_global_buffer (gimage->gimp, buffer); + gimp_set_global_buffer (image->gimp, buffer); g_object_unref (buffer); - return gimage->gimp->global_buffer; + return image->gimp->global_buffer; } return NULL; } GimpLayer * -gimp_edit_paste (GimpImage *gimage, +gimp_edit_paste (GimpImage *image, GimpDrawable *drawable, GimpBuffer *paste, gboolean paste_into, @@ -162,7 +162,7 @@ gimp_edit_paste (GimpImage *gimage, gint width; gint height; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), NULL); g_return_val_if_fail (drawable == NULL || gimp_item_is_attached (GIMP_ITEM (drawable)), NULL); @@ -175,9 +175,9 @@ gimp_edit_paste (GimpImage *gimage, if (drawable) type = gimp_drawable_type_with_alpha (drawable); else - type = gimp_image_base_type_with_alpha (gimage); + type = gimp_image_base_type_with_alpha (image); - layer = gimp_layer_new_from_tiles (paste->tiles, gimage, type, + layer = gimp_layer_new_from_tiles (paste->tiles, image, type, _("Pasted Layer"), GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); @@ -227,8 +227,8 @@ gimp_edit_paste (GimpImage *gimage, { /* otherwise the offsets to the center of the image */ - center_x = gimage->width / 2; - center_y = gimage->height / 2; + center_x = image->width / 2; + center_y = image->height / 2; } width = gimp_item_width (GIMP_ITEM (layer)); @@ -240,8 +240,8 @@ gimp_edit_paste (GimpImage *gimage, /* Ensure that the pasted layer is always within the image, if it * fits and aligned at top left if it doesn't. (See bug #142944). */ - offset_x = MIN (offset_x, gimage->width - width); - offset_y = MIN (offset_y, gimage->height - height); + offset_x = MIN (offset_x, image->width - width); + offset_y = MIN (offset_y, image->height - height); offset_x = MAX (offset_x, 0); offset_y = MAX (offset_y, 0); @@ -249,24 +249,24 @@ gimp_edit_paste (GimpImage *gimage, GIMP_ITEM (layer)->offset_y = offset_y; /* Start a group undo */ - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, _("Paste")); /* If there is a selection mask clear it-- * this might not always be desired, but in general, * it seems like the correct behavior. */ - if (! gimp_channel_is_empty (gimp_image_get_mask (gimage)) && ! paste_into) - gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE); + if (! gimp_channel_is_empty (gimp_image_get_mask (image)) && ! paste_into) + gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE); /* if there's a drawable, add a new floating selection */ if (drawable) floating_sel_attach (layer, drawable); else - gimp_image_add_layer (gimage, layer, 0); + gimp_image_add_layer (image, layer, 0); /* end the group undo */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return layer; } @@ -276,7 +276,7 @@ gimp_edit_paste_as_new (Gimp *gimp, GimpImage *invoke, GimpBuffer *paste) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpImageType type; @@ -296,58 +296,58 @@ gimp_edit_paste_as_new (Gimp *gimp, } /* create a new image (always of type GIMP_RGB) */ - gimage = gimp_create_image (gimp, + image = gimp_create_image (gimp, gimp_buffer_get_width (paste), gimp_buffer_get_height (paste), GIMP_IMAGE_TYPE_BASE_TYPE (type), TRUE); - gimp_image_undo_disable (gimage); + gimp_image_undo_disable (image); if (invoke) { - gimp_image_set_resolution (gimage, + gimp_image_set_resolution (image, invoke->xresolution, invoke->yresolution); - gimp_image_set_unit (gimage, + gimp_image_set_unit (image, gimp_image_get_unit (invoke)); } - layer = gimp_layer_new_from_tiles (paste->tiles, gimage, type, + layer = gimp_layer_new_from_tiles (paste->tiles, image, type, _("Pasted Layer"), GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); if (! layer) { - g_object_unref (gimage); + g_object_unref (image); return NULL; } - gimp_image_add_layer (gimage, layer, 0); + gimp_image_add_layer (image, layer, 0); - gimp_image_undo_enable (gimage); + gimp_image_undo_enable (image); - return gimage; + return image; } const gchar * -gimp_edit_named_cut (GimpImage *gimage, +gimp_edit_named_cut (GimpImage *image, const gchar *name, GimpDrawable *drawable, GimpContext *context) { GimpBuffer *buffer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - buffer = gimp_edit_extract (gimage, drawable, context, TRUE); + buffer = gimp_edit_extract (image, drawable, context, TRUE); if (buffer) { gimp_object_set_name (GIMP_OBJECT (buffer), name); - gimp_container_add (gimage->gimp->named_buffers, GIMP_OBJECT (buffer)); + gimp_container_add (image->gimp->named_buffers, GIMP_OBJECT (buffer)); g_object_unref (buffer); return gimp_object_get_name (GIMP_OBJECT (buffer)); @@ -357,25 +357,25 @@ gimp_edit_named_cut (GimpImage *gimage, } const gchar * -gimp_edit_named_copy (GimpImage *gimage, +gimp_edit_named_copy (GimpImage *image, const gchar *name, GimpDrawable *drawable, GimpContext *context) { GimpBuffer *buffer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - buffer = gimp_edit_extract (gimage, drawable, context, FALSE); + buffer = gimp_edit_extract (image, drawable, context, FALSE); if (buffer) { gimp_object_set_name (GIMP_OBJECT (buffer), name); - gimp_container_add (gimage->gimp->named_buffers, GIMP_OBJECT (buffer)); + gimp_container_add (image->gimp->named_buffers, GIMP_OBJECT (buffer)); g_object_unref (buffer); return gimp_object_get_name (GIMP_OBJECT (buffer)); @@ -385,22 +385,22 @@ gimp_edit_named_copy (GimpImage *gimage, } const gchar * -gimp_edit_named_copy_visible (GimpImage *gimage, +gimp_edit_named_copy_visible (GimpImage *image, const gchar *name, GimpContext *context) { GimpBuffer *buffer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - buffer = gimp_edit_extract_visible (gimage, context); + buffer = gimp_edit_extract_visible (image, context); if (buffer) { gimp_object_set_name (GIMP_OBJECT (buffer), name); - gimp_container_add (gimage->gimp->named_buffers, GIMP_OBJECT (buffer)); + gimp_container_add (image->gimp->named_buffers, GIMP_OBJECT (buffer)); g_object_unref (buffer); return gimp_object_get_name (GIMP_OBJECT (buffer)); @@ -410,30 +410,30 @@ gimp_edit_named_copy_visible (GimpImage *gimage, } gboolean -gimp_edit_clear (GimpImage *gimage, +gimp_edit_clear (GimpImage *image, GimpDrawable *drawable, GimpContext *context) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE); - return gimp_edit_fill_internal (gimage, drawable, context, + return gimp_edit_fill_internal (image, drawable, context, GIMP_TRANSPARENT_FILL, GIMP_OPACITY_OPAQUE, GIMP_ERASE_MODE, _("Clear")); } gboolean -gimp_edit_fill (GimpImage *gimage, +gimp_edit_fill (GimpImage *image, GimpDrawable *drawable, GimpContext *context, GimpFillType fill_type) { const gchar *undo_desc; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE); @@ -465,10 +465,10 @@ gimp_edit_fill (GimpImage *gimage, default: g_warning ("%s: unknown fill type", G_STRFUNC); - return gimp_edit_fill (gimage, drawable, context, GIMP_BACKGROUND_FILL); + return gimp_edit_fill (image, drawable, context, GIMP_BACKGROUND_FILL); } - return gimp_edit_fill_internal (gimage, drawable, context, + return gimp_edit_fill_internal (image, drawable, context, fill_type, GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE, undo_desc); @@ -478,7 +478,7 @@ gimp_edit_fill (GimpImage *gimage, /* private functions */ static GimpBuffer * -gimp_edit_extract (GimpImage *gimage, +gimp_edit_extract (GimpImage *image, GimpDrawable *drawable, GimpContext *context, gboolean cut_pixels) @@ -486,24 +486,24 @@ gimp_edit_extract (GimpImage *gimage, TileManager *tiles; gboolean empty; - /* See if the gimage mask is empty */ - empty = gimp_channel_is_empty (gimp_image_get_mask (gimage)); + /* See if the image mask is empty */ + empty = gimp_channel_is_empty (gimp_image_get_mask (image)); if (cut_pixels) - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_CUT, _("Cut")); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_CUT, _("Cut")); - /* Cut/copy the mask portion from the gimage */ - tiles = gimp_selection_extract (gimp_image_get_mask (gimage), + /* Cut/copy the mask portion from the image */ + tiles = gimp_selection_extract (gimp_image_get_mask (image), drawable, context, cut_pixels, FALSE, FALSE); if (cut_pixels) - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - return gimp_edit_make_buffer (gimage->gimp, tiles, empty); + return gimp_edit_make_buffer (image->gimp, tiles, empty); } static GimpBuffer * -gimp_edit_extract_visible (GimpImage *gimage, +gimp_edit_extract_visible (GimpImage *image, GimpContext *context) { GimpPickable *pickable; @@ -512,7 +512,7 @@ gimp_edit_extract_visible (GimpImage *gimage, gboolean non_empty; gint x1, y1, x2, y2; - non_empty = gimp_channel_bounds (gimp_image_get_mask (gimage), + non_empty = gimp_channel_bounds (gimp_image_get_mask (image), &x1, &y1, &x2, &y2); if ((x1 == x2) || (y1 == y2)) { @@ -521,7 +521,7 @@ gimp_edit_extract_visible (GimpImage *gimage, return NULL; } - pickable = GIMP_PICKABLE (gimage->projection); + pickable = GIMP_PICKABLE (image->projection); gimp_pickable_flush (pickable); @@ -544,7 +544,7 @@ gimp_edit_extract_visible (GimpImage *gimage, */ copy_region_nocow (&srcPR, &destPR); - return gimp_edit_make_buffer (gimage->gimp, tiles, ! non_empty); + return gimp_edit_make_buffer (image->gimp, tiles, ! non_empty); } static GimpBuffer * @@ -552,7 +552,7 @@ gimp_edit_make_buffer (Gimp *gimp, TileManager *tiles, gboolean mask_empty) { - /* Only crop if the gimage mask wasn't empty */ + /* Only crop if the image mask wasn't empty */ if (tiles && ! mask_empty) { TileManager *crop = tile_manager_crop (tiles, 0); @@ -571,7 +571,7 @@ gimp_edit_make_buffer (Gimp *gimp, } static gboolean -gimp_edit_fill_internal (GimpImage *gimage, +gimp_edit_fill_internal (GimpImage *image, GimpDrawable *drawable, GimpContext *context, GimpFillType fill_type, @@ -595,12 +595,12 @@ gimp_edit_fill_internal (GimpImage *gimage, switch (fill_type) { case GIMP_FOREGROUND_FILL: - gimp_image_get_foreground (gimage, drawable, context, col); + gimp_image_get_foreground (image, drawable, context, col); break; case GIMP_BACKGROUND_FILL: case GIMP_TRANSPARENT_FILL: - gimp_image_get_background (gimage, drawable, context, col); + gimp_image_get_background (image, drawable, context, col); break; case GIMP_WHITE_FILL: @@ -610,7 +610,7 @@ gimp_edit_fill_internal (GimpImage *gimage, tmp_col[RED_PIX] = 255; tmp_col[GREEN_PIX] = 255; tmp_col[BLUE_PIX] = 255; - gimp_image_transform_color (gimage, drawable, col, GIMP_RGB, tmp_col); + gimp_image_transform_color (image, drawable, col, GIMP_RGB, tmp_col); } break; @@ -618,7 +618,7 @@ gimp_edit_fill_internal (GimpImage *gimage, { GimpPattern *pattern = gimp_context_get_pattern (context); - pat_buf = gimp_image_transform_temp_buf (gimage, drawable, + pat_buf = gimp_image_transform_temp_buf (image, drawable, pattern->mask, &new_buf); if (! gimp_drawable_has_alpha (drawable) && diff --git a/app/core/gimp-edit.h b/app/core/gimp-edit.h index 5451aacb6d..cc7aea1ad0 100644 --- a/app/core/gimp-edit.h +++ b/app/core/gimp-edit.h @@ -20,15 +20,15 @@ #define __GIMP_EDIT_H__ -const GimpBuffer * gimp_edit_cut (GimpImage *gimage, +const GimpBuffer * gimp_edit_cut (GimpImage *image, GimpDrawable *drawable, GimpContext *context); -const GimpBuffer * gimp_edit_copy (GimpImage *gimage, +const GimpBuffer * gimp_edit_copy (GimpImage *image, GimpDrawable *drawable, GimpContext *context); -const GimpBuffer * gimp_edit_copy_visible (GimpImage *gimage, +const GimpBuffer * gimp_edit_copy_visible (GimpImage *image, GimpContext *context); -GimpLayer * gimp_edit_paste (GimpImage *gimage, +GimpLayer * gimp_edit_paste (GimpImage *image, GimpDrawable *drawable, GimpBuffer *paste, gboolean paste_into, @@ -37,25 +37,25 @@ GimpLayer * gimp_edit_paste (GimpImage *gimage, gint viewport_width, gint viewport_height); GimpImage * gimp_edit_paste_as_new (Gimp *gimp, - GimpImage *gimage, + GimpImage *image, GimpBuffer *paste); -const gchar * gimp_edit_named_cut (GimpImage *gimage, +const gchar * gimp_edit_named_cut (GimpImage *image, const gchar *name, GimpDrawable *drawable, GimpContext *context); -const gchar * gimp_edit_named_copy (GimpImage *gimage, +const gchar * gimp_edit_named_copy (GimpImage *image, const gchar *name, GimpDrawable *drawable, GimpContext *context); -const gchar * gimp_edit_named_copy_visible (GimpImage *gimage, +const gchar * gimp_edit_named_copy_visible (GimpImage *image, const gchar *name, GimpContext *context); -gboolean gimp_edit_clear (GimpImage *gimage, +gboolean gimp_edit_clear (GimpImage *image, GimpDrawable *drawable, GimpContext *context); -gboolean gimp_edit_fill (GimpImage *gimage, +gboolean gimp_edit_fill (GimpImage *image, GimpDrawable *drawable, GimpContext *context, GimpFillType fill_type); diff --git a/app/core/gimp-gui.c b/app/core/gimp-gui.c index 86eeb7e6ff..a7b5f19f36 100644 --- a/app/core/gimp-gui.c +++ b/app/core/gimp-gui.c @@ -253,18 +253,18 @@ gimp_get_display_window (Gimp *gimp, GimpObject * gimp_create_display (Gimp *gimp, - GimpImage *gimage, + GimpImage *image, GimpUnit unit, gdouble scale) { GimpObject *display = NULL; g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); if (gimp->gui.display_create) { - display = gimp->gui.display_create (gimage, unit, scale); + display = gimp->gui.display_create (image, unit, scale); gimp_container_add (gimp->displays, display); } diff --git a/app/core/gimp-gui.h b/app/core/gimp-gui.h index 76a2088f98..16ac57280a 100644 --- a/app/core/gimp-gui.h +++ b/app/core/gimp-gui.h @@ -47,7 +47,7 @@ struct _GimpGui gint ID); gint (* display_get_id) (GimpObject *display); guint32 (* display_get_window) (GimpObject *display); - GimpObject * (* display_create) (GimpImage *gimage, + GimpObject * (* display_create) (GimpImage *image, GimpUnit unit, gdouble scale); void (* display_delete) (GimpObject *display); @@ -104,7 +104,7 @@ gint gimp_get_display_ID (Gimp *gimp, guint32 gimp_get_display_window (Gimp *gimp, GimpObject *display); GimpObject * gimp_create_display (Gimp *gimp, - GimpImage *gimage, + GimpImage *image, GimpUnit unit, gdouble scale); void gimp_delete_display (Gimp *gimp, diff --git a/app/core/gimp-transform-region.c b/app/core/gimp-transform-region.c index 32f1c58abb..aa4cf1fcd0 100644 --- a/app/core/gimp-transform-region.c +++ b/app/core/gimp-transform-region.c @@ -124,7 +124,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, gboolean clip_result, GimpProgress *progress) { - GimpImage *gimage; + GimpImage *image; PixelRegion destPR; TileManager *new_tiles; GimpMatrix3 m; @@ -164,7 +164,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, g_return_val_if_fail (matrix != NULL, NULL); g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); m = *matrix; inv = *matrix; @@ -176,7 +176,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, interpolation_type = GIMP_INTERPOLATION_NONE; /* Get the background color */ - gimp_image_get_background (gimage, drawable, context, bg_color); + gimp_image_get_background (image, drawable, context, bg_color); switch (GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (drawable))) { @@ -191,7 +191,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, case GIMP_INDEXED: bg_color[ALPHA_I_PIX] = TRANSPARENT_OPACITY; alpha = ALPHA_I_PIX; - /* If the gimage is indexed color, ignore interpolation value */ + /* If the image is indexed color, ignore interpolation value */ interpolation_type = GIMP_INTERPOLATION_NONE; break; default: @@ -511,7 +511,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable, gdouble axis, gboolean clip_result) { - GimpImage *gimage; + GimpImage *image; TileManager *new_tiles; PixelRegion srcPR, destPR; gint orig_x, orig_y; @@ -526,7 +526,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable, g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (orig_tiles != NULL, NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); orig_width = tile_manager_width (orig_tiles); orig_height = tile_manager_height (orig_tiles); @@ -564,7 +564,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable, tile_manager_set_offsets (new_tiles, orig_x, orig_y); - gimp_image_get_background (gimage, drawable, context, bg_color); + gimp_image_get_background (image, drawable, context, bg_color); /* "Outside" a channel is transparency, not the bg color */ if (GIMP_IS_CHANNEL (drawable)) @@ -672,7 +672,7 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable, gdouble center_y, gboolean clip_result) { - GimpImage *gimage; + GimpImage *image; TileManager *new_tiles; PixelRegion srcPR, destPR; guchar *buf = NULL; @@ -688,7 +688,7 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable, g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (orig_tiles != NULL, NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); orig_width = tile_manager_width (orig_tiles); orig_height = tile_manager_height (orig_tiles); @@ -741,7 +741,7 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable, tile_manager_set_offsets (new_tiles, orig_x, orig_y); - gimp_image_get_background (gimage, drawable, context, bg_color); + gimp_image_get_background (image, drawable, context, bg_color); /* "Outside" a channel is transparency, not the bg color */ if (GIMP_IS_CHANNEL (drawable)) @@ -893,7 +893,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable, gboolean clip_result, GimpProgress *progress) { - GimpImage *gimage; + GimpImage *image; TileManager *orig_tiles; gboolean new_layer; gboolean success = FALSE; @@ -904,10 +904,10 @@ gimp_drawable_transform_affine (GimpDrawable *drawable, g_return_val_if_fail (matrix != NULL, FALSE); g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* Start a transform undo group */ - gimp_image_undo_group_start (gimage, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, _("Transform")); /* Cut/Copy from the specified drawable */ @@ -944,7 +944,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable, } /* push the undo group end */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return success; } @@ -957,7 +957,7 @@ gimp_drawable_transform_flip (GimpDrawable *drawable, gdouble axis, gboolean clip_result) { - GimpImage *gimage; + GimpImage *image; TileManager *orig_tiles; gboolean new_layer; gboolean success = FALSE; @@ -966,10 +966,10 @@ gimp_drawable_transform_flip (GimpDrawable *drawable, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* Start a transform undo group */ - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM, _("Flip")); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, _("Flip")); /* Cut/Copy from the specified drawable */ orig_tiles = gimp_drawable_transform_cut (drawable, context, &new_layer); @@ -1027,7 +1027,7 @@ gimp_drawable_transform_flip (GimpDrawable *drawable, } /* push the undo group end */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return success; } @@ -1041,7 +1041,7 @@ gimp_drawable_transform_rotate (GimpDrawable *drawable, gdouble center_y, gboolean clip_result) { - GimpImage *gimage; + GimpImage *image; TileManager *orig_tiles; gboolean new_layer; gboolean success = FALSE; @@ -1050,10 +1050,10 @@ gimp_drawable_transform_rotate (GimpDrawable *drawable, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* Start a transform undo group */ - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM, _("Rotate")); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, _("Rotate")); /* Cut/Copy from the specified drawable */ orig_tiles = gimp_drawable_transform_cut (drawable, context, &new_layer); @@ -1098,7 +1098,7 @@ gimp_drawable_transform_rotate (GimpDrawable *drawable, } /* push the undo group end */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return success; } @@ -1108,7 +1108,7 @@ gimp_drawable_transform_cut (GimpDrawable *drawable, GimpContext *context, gboolean *new_layer) { - GimpImage *gimage; + GimpImage *image; TileManager *tiles; g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); @@ -1116,10 +1116,10 @@ gimp_drawable_transform_cut (GimpDrawable *drawable, g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (new_layer != NULL, NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* extract the selected mask if there is a selection */ - if (! gimp_channel_is_empty (gimp_image_get_mask (gimage))) + if (! gimp_channel_is_empty (gimp_image_get_mask (image))) { gint x, y, w, h; @@ -1129,7 +1129,7 @@ gimp_drawable_transform_cut (GimpDrawable *drawable, */ if (gimp_drawable_mask_intersect (drawable, &x, &y, &w, &h)) { - tiles = gimp_selection_extract (gimp_image_get_mask (gimage), + tiles = gimp_selection_extract (gimp_image_get_mask (image), drawable, context, TRUE, FALSE, TRUE); *new_layer = TRUE; @@ -1143,10 +1143,10 @@ gimp_drawable_transform_cut (GimpDrawable *drawable, else /* otherwise, just copy the layer */ { if (GIMP_IS_LAYER (drawable)) - tiles = gimp_selection_extract (gimp_image_get_mask (gimage), + tiles = gimp_selection_extract (gimp_image_get_mask (image), drawable, context, FALSE, TRUE, TRUE); else - tiles = gimp_selection_extract (gimp_image_get_mask (gimage), + tiles = gimp_selection_extract (gimp_image_get_mask (image), drawable, context, FALSE, TRUE, FALSE); *new_layer = FALSE; @@ -1160,7 +1160,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable, TileManager *tiles, gboolean new_layer) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer = NULL; const gchar *undo_desc = NULL; gint offset_x; @@ -1170,7 +1170,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (tiles != NULL, FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); if (GIMP_IS_LAYER (drawable)) undo_desc = _("Transform Layer"); @@ -1181,12 +1181,12 @@ gimp_drawable_transform_paste (GimpDrawable *drawable, tile_manager_get_offsets (tiles, &offset_x, &offset_y); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE, undo_desc); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, undo_desc); if (new_layer) { layer = - gimp_layer_new_from_tiles (tiles, gimage, + gimp_layer_new_from_tiles (tiles, image, gimp_drawable_type_with_alpha (drawable), _("Transformation"), GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); @@ -1215,7 +1215,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable, offset_x, offset_y); } - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return TRUE; } diff --git a/app/core/gimp.c b/app/core/gimp.c index cde6c64bee..76489db09c 100644 --- a/app/core/gimp.c +++ b/app/core/gimp.c @@ -948,13 +948,13 @@ gimp_create_image (Gimp *gimp, GimpImageBaseType type, gboolean attach_comment) { - GimpImage *gimage; + GimpImage *image; g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); - gimage = gimp_image_new (gimp, width, height, type); + image = gimp_image_new (gimp, width, height, type); - gimp_container_add (gimp->images, GIMP_OBJECT (gimage)); + gimp_container_add (gimp->images, GIMP_OBJECT (image)); if (attach_comment) { @@ -966,12 +966,12 @@ gimp_create_image (Gimp *gimp, GIMP_PARASITE_PERSISTENT, strlen (comment) + 1, comment); - gimp_image_parasite_attach (gimage, parasite); + gimp_image_parasite_attach (image, parasite); gimp_parasite_free (parasite); } } - return gimage; + return image; } void diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c index ca7dce8f40..1826f28c32 100644 --- a/app/core/gimpchannel.c +++ b/app/core/gimpchannel.c @@ -367,8 +367,8 @@ gimp_channel_get_description (GimpViewable *viewable, static gboolean gimp_channel_is_attached (GimpItem *item) { - return (GIMP_IS_IMAGE (item->gimage) && - gimp_container_have (item->gimage->channels, GIMP_OBJECT (item))); + return (GIMP_IS_IMAGE (item->image) && + gimp_container_have (item->image->channels, GIMP_OBJECT (item))); } static GimpItem * @@ -1465,7 +1465,7 @@ gimp_channel_validate (TileManager *tm, /* public functions */ GimpChannel * -gimp_channel_new (GimpImage *gimage, +gimp_channel_new (GimpImage *image, gint width, gint height, const gchar *name, @@ -1473,12 +1473,12 @@ gimp_channel_new (GimpImage *gimage, { GimpChannel *channel; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); channel = g_object_new (GIMP_TYPE_CHANNEL, NULL); gimp_drawable_configure (GIMP_DRAWABLE (channel), - gimage, + image, 0, 0, width, height, GIMP_GRAY_IMAGE, name); @@ -1495,7 +1495,7 @@ gimp_channel_new (GimpImage *gimage, } GimpChannel * -gimp_channel_new_from_alpha (GimpImage *gimage, +gimp_channel_new_from_alpha (GimpImage *image, GimpDrawable *drawable, const gchar *name, const GimpRGB *color) @@ -1505,14 +1505,14 @@ gimp_channel_new_from_alpha (GimpImage *gimage, gint height; PixelRegion srcPR, destPR; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); g_return_val_if_fail (gimp_drawable_has_alpha (drawable), NULL); width = gimp_item_width (GIMP_ITEM (drawable)); height = gimp_item_height (GIMP_ITEM (drawable)); - channel = gimp_channel_new (gimage, width, height, name, color); + channel = gimp_channel_new (image, width, height, name, color); gimp_channel_clear (channel, NULL, FALSE); @@ -1529,7 +1529,7 @@ gimp_channel_new_from_alpha (GimpImage *gimage, } GimpChannel * -gimp_channel_new_from_component (GimpImage *gimage, +gimp_channel_new_from_component (GimpImage *image, GimpChannelType type, const gchar *name, const GimpRGB *color) @@ -1542,19 +1542,19 @@ gimp_channel_new_from_component (GimpImage *gimage, gint height; gint pixel; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - pixel = gimp_image_get_component_index (gimage, type); + pixel = gimp_image_get_component_index (image, type); g_return_val_if_fail (pixel != -1, NULL); - gimp_pickable_flush (GIMP_PICKABLE (gimage->projection)); + gimp_pickable_flush (GIMP_PICKABLE (image->projection)); - projection = gimp_pickable_get_tiles (GIMP_PICKABLE (gimage->projection)); + projection = gimp_pickable_get_tiles (GIMP_PICKABLE (image->projection)); width = tile_manager_width (projection); height = tile_manager_height (projection); - channel = gimp_channel_new (gimage, width, height, name, color); + channel = gimp_channel_new (image, width, height, name, color); pixel_region_init (&src, projection, 0, 0, width, height, FALSE); @@ -1578,9 +1578,9 @@ gimp_channel_set_color (GimpChannel *channel, { if (push_undo && gimp_item_is_attached (GIMP_ITEM (channel))) { - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (channel)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (channel)); - gimp_image_undo_push_channel_color (gimage, _("Set Channel Color"), + gimp_image_undo_push_channel_color (image, _("Set Channel Color"), channel); } @@ -1626,9 +1626,9 @@ gimp_channel_set_opacity (GimpChannel *channel, { if (push_undo && gimp_item_is_attached (GIMP_ITEM (channel))) { - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (channel)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (channel)); - gimp_image_undo_push_channel_color (gimage, _("Set Channel Opacity"), + gimp_image_undo_push_channel_color (image, _("Set Channel Opacity"), channel); } @@ -1687,15 +1687,15 @@ gimp_channel_push_undo (GimpChannel *channel, /******************************/ GimpChannel * -gimp_channel_new_mask (GimpImage *gimage, +gimp_channel_new_mask (GimpImage *image, gint width, gint height) { GimpChannel *new_channel; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - new_channel = gimp_channel_new (gimage, width, height, + new_channel = gimp_channel_new (image, width, height, _("Selection Mask"), NULL); tile_manager_set_validate_proc (GIMP_DRAWABLE (new_channel)->tiles, diff --git a/app/core/gimpchannel.h b/app/core/gimpchannel.h index 6d76d1879a..09df244efe 100644 --- a/app/core/gimpchannel.h +++ b/app/core/gimpchannel.h @@ -118,17 +118,17 @@ struct _GimpChannelClass GType gimp_channel_get_type (void) G_GNUC_CONST; -GimpChannel * gimp_channel_new (GimpImage *gimage, +GimpChannel * gimp_channel_new (GimpImage *image, gint width, gint height, const gchar *name, const GimpRGB *color); -GimpChannel * gimp_channel_new_from_alpha (GimpImage *gimage, +GimpChannel * gimp_channel_new_from_alpha (GimpImage *image, GimpDrawable *drawable, const gchar *name, const GimpRGB *color); -GimpChannel * gimp_channel_new_from_component (GimpImage *gimage, +GimpChannel * gimp_channel_new_from_component (GimpImage *image, GimpChannelType type, const gchar *name, const GimpRGB *color); @@ -154,7 +154,7 @@ void gimp_channel_push_undo (GimpChannel *mask, /* selection mask functions */ -GimpChannel * gimp_channel_new_mask (GimpImage *gimage, +GimpChannel * gimp_channel_new_mask (GimpImage *image, gint width, gint height); diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index 23701f5cba..ca31bd2357 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -1811,13 +1811,13 @@ gimp_context_real_set_display (GimpContext *context, if (context->display) { - GimpImage *gimage; + GimpImage *image; - g_object_get (display, "image", &gimage, NULL); + g_object_get (display, "image", &image, NULL); - gimp_context_real_set_image (context, gimage); + gimp_context_real_set_image (context, image); - g_object_unref (gimage); + g_object_unref (image); } g_object_notify (G_OBJECT (context), "display"); diff --git a/app/core/gimpdrawable-blend.c b/app/core/gimpdrawable-blend.c index 756f60f9a2..4624027d1b 100644 --- a/app/core/gimpdrawable-blend.c +++ b/app/core/gimpdrawable-blend.c @@ -115,7 +115,7 @@ static gdouble gradient_calc_shapeburst_spherical_factor (gdouble x, static gdouble gradient_calc_shapeburst_dimpled_factor (gdouble x, gdouble y); -static void gradient_precalc_shapeburst (GimpImage *gimage, +static void gradient_precalc_shapeburst (GimpImage *image, GimpDrawable *drawable, PixelRegion *PR, gdouble dist, @@ -130,7 +130,7 @@ static void gradient_put_pixel (gint x, GimpRGB *color, gpointer put_pixel_data); -static void gradient_fill_region (GimpImage *gimage, +static void gradient_fill_region (GimpImage *image, GimpDrawable *drawable, GimpContext *context, PixelRegion *PR, @@ -200,7 +200,7 @@ gimp_drawable_blend (GimpDrawable *drawable, gdouble endy, GimpProgress *progress) { - GimpImage *gimage; + GimpImage *image; TileManager *buf_tiles; PixelRegion bufPR; gint bytes; @@ -211,12 +211,12 @@ gimp_drawable_blend (GimpDrawable *drawable, g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); if (! gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height)) return; - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); bytes = gimp_drawable_bytes (drawable); @@ -227,7 +227,7 @@ gimp_drawable_blend (GimpDrawable *drawable, buf_tiles = tile_manager_new (width, height, bytes); pixel_region_init (&bufPR, buf_tiles, 0, 0, width, height, TRUE); - gradient_fill_region (gimage, drawable, context, + gradient_fill_region (image, drawable, context, &bufPR, width, height, blend_mode, gradient_type, offset, repeat, reverse, supersample, max_depth, threshold, dither, @@ -253,7 +253,7 @@ gimp_drawable_blend (GimpDrawable *drawable, /* free the temporary buffer */ tile_manager_unref (buf_tiles); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); } static gdouble @@ -568,7 +568,7 @@ gradient_calc_shapeburst_dimpled_factor (gdouble x, } static void -gradient_precalc_shapeburst (GimpImage *gimage, +gradient_precalc_shapeburst (GimpImage *image, GimpDrawable *drawable, PixelRegion *PR, gdouble dist, @@ -589,9 +589,9 @@ gradient_precalc_shapeburst (GimpImage *gimage, tempR.tiles = tile_manager_new (PR->w, PR->h, 1); pixel_region_init (&tempR, tempR.tiles, 0, 0, PR->w, PR->h, TRUE); - mask = gimp_image_get_mask (gimage); + mask = gimp_image_get_mask (image); - /* If the gimage mask is not empty, use it as the shape burst source */ + /* If the image mask is not empty, use it as the shape burst source */ if (! gimp_channel_is_empty (mask)) { PixelRegion maskR; @@ -843,7 +843,7 @@ gradient_put_pixel (gint x, } static void -gradient_fill_region (GimpImage *gimage, +gradient_fill_region (GimpImage *image, GimpDrawable *drawable, GimpContext *context, PixelRegion *PR, @@ -938,7 +938,7 @@ gradient_fill_region (GimpImage *gimage, case GIMP_GRADIENT_SHAPEBURST_SPHERICAL: case GIMP_GRADIENT_SHAPEBURST_DIMPLED: rbd.dist = sqrt (SQR (ex - sx) + SQR (ey - sy)); - gradient_precalc_shapeburst (gimage, drawable, PR, rbd.dist, progress); + gradient_precalc_shapeburst (image, drawable, PR, rbd.dist, progress); break; default: diff --git a/app/core/gimpdrawable-bucket-fill.c b/app/core/gimpdrawable-bucket-fill.c index b73a2ce40b..01bd320724 100644 --- a/app/core/gimpdrawable-bucket-fill.c +++ b/app/core/gimpdrawable-bucket-fill.c @@ -58,7 +58,7 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable, gdouble x, gdouble y) { - GimpImage *gimage; + GimpImage *image; GimpRGB color; GimpPattern *pattern = NULL; @@ -66,7 +66,7 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable, g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); g_return_if_fail (GIMP_IS_CONTEXT (context)); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); if (fill_mode == GIMP_FG_BUCKET_FILL) { @@ -116,7 +116,7 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable, const GimpRGB *color, GimpPattern *pattern) { - GimpImage *gimage; + GimpImage *image; TileManager *buf_tiles; PixelRegion bufPR, maskPR; GimpChannel *mask = NULL; @@ -134,7 +134,7 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable, g_return_if_fail (fill_mode == GIMP_PATTERN_BUCKET_FILL || color != NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); bytes = gimp_drawable_bytes (drawable); selection = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); @@ -152,12 +152,12 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable, &tmp_col[GREEN_PIX], &tmp_col[BLUE_PIX]); - gimp_image_transform_color (gimage, drawable, col, GIMP_RGB, tmp_col); + gimp_image_transform_color (image, drawable, col, GIMP_RGB, tmp_col); col[gimp_drawable_bytes_with_alpha (drawable) - 1] = OPAQUE_OPACITY; } else if (fill_mode == GIMP_PATTERN_BUCKET_FILL) { - pat_buf = gimp_image_transform_temp_buf (gimage, drawable, + pat_buf = gimp_image_transform_temp_buf (image, drawable, pattern->mask, &new_buf); } else @@ -166,7 +166,7 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable, return; } - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); /* Do a seed bucket fill...To do this, calculate a new * contiguous region. If there is a selection, calculate the @@ -174,7 +174,7 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable, */ if (do_seed_fill) { - mask = gimp_image_contiguous_region_by_seed (gimage, drawable, + mask = gimp_image_contiguous_region_by_seed (image, drawable, sample_merged, TRUE, (gint) threshold, @@ -190,7 +190,7 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable, if (! sample_merged) gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y); - gimp_channel_combine_mask (mask, gimp_image_get_mask (gimage), + gimp_channel_combine_mask (mask, gimp_image_get_mask (image), GIMP_CHANNEL_OP_INTERSECT, -off_x, -off_y); } @@ -228,7 +228,7 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable, x1, y1, (x2 - x1), (y2 - y1), TRUE); } - /* if the gimage doesn't have an alpha channel, make sure that + /* if the image doesn't have an alpha channel, make sure that * the buf_tiles have. We need the alpha channel to fill with * the region calculated above */ @@ -284,5 +284,5 @@ gimp_drawable_bucket_fill_full (GimpDrawable *drawable, if (new_buf) temp_buf_free (pat_buf); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); } diff --git a/app/core/gimpdrawable-combine.c b/app/core/gimpdrawable-combine.c index ab36ee2ca2..f1341d44e2 100644 --- a/app/core/gimpdrawable-combine.c +++ b/app/core/gimpdrawable-combine.c @@ -42,7 +42,7 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, gint x, gint y) { - GimpImage *gimage; + GimpImage *image; GimpItem *item; GimpChannel *mask; gint x1, y1, x2, y2; @@ -53,9 +53,9 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, item = GIMP_ITEM (drawable); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - mask = gimp_image_get_mask (gimage); + mask = gimp_image_get_mask (image); /* don't apply the mask to itself and don't apply an empty mask */ if (GIMP_DRAWABLE (mask) == drawable || gimp_channel_is_empty (mask)) @@ -78,7 +78,7 @@ gimp_drawable_real_apply_region (GimpDrawable *drawable, /* get the layer offsets */ gimp_item_offsets (item, &offset_x, &offset_y); - /* make sure the image application coordinates are within gimage bounds */ + /* make sure the image application coordinates are within image bounds */ x1 = CLAMP (x, 0, gimp_item_width (item)); y1 = CLAMP (y, 0, gimp_item_height (item)); x2 = CLAMP (x + src2PR->w, 0, gimp_item_width (item)); @@ -164,7 +164,7 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable, gint x, gint y) { - GimpImage *gimage; + GimpImage *image; GimpItem *item; GimpChannel *mask; gint x1, y1, x2, y2; @@ -175,9 +175,9 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable, item = GIMP_ITEM (drawable); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - mask = gimp_image_get_mask (gimage); + mask = gimp_image_get_mask (image); /* don't apply the mask to itself and don't apply an empty mask */ if (GIMP_DRAWABLE (mask) == drawable || gimp_channel_is_empty (mask)) @@ -200,7 +200,7 @@ gimp_drawable_real_replace_region (GimpDrawable *drawable, /* get the layer offsets */ gimp_item_offsets (item, &offset_x, &offset_y); - /* make sure the image application coordinates are within gimage bounds */ + /* make sure the image application coordinates are within image bounds */ x1 = CLAMP (x, 0, gimp_item_width (item)); y1 = CLAMP (y, 0, gimp_item_height (item)); x2 = CLAMP (x + src2PR->w, 0, gimp_item_width (item)); diff --git a/app/core/gimpdrawable-equalize.c b/app/core/gimpdrawable-equalize.c index 4be1ef87d5..2ba23365a5 100644 --- a/app/core/gimpdrawable-equalize.c +++ b/app/core/gimpdrawable-equalize.c @@ -46,12 +46,12 @@ gimp_drawable_equalize (GimpDrawable *drawable, gint x, y, width, height; GimpHistogram *hist; GimpLut *lut; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); bytes = gimp_drawable_bytes (drawable); if (! gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height)) diff --git a/app/core/gimpdrawable-foreground-extract.c b/app/core/gimpdrawable-foreground-extract.c index 1f8b138a5e..f72f09336d 100644 --- a/app/core/gimpdrawable-foreground-extract.c +++ b/app/core/gimpdrawable-foreground-extract.c @@ -79,7 +79,7 @@ gimp_drawable_foreground_extract_siox_init (GimpDrawable *drawable, gint width, gint height) { - GimpImage *gimage; + GimpImage *image; const guchar *colormap = NULL; gboolean intersect; gint offset_x; @@ -88,10 +88,10 @@ gimp_drawable_foreground_extract_siox_init (GimpDrawable *drawable, g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - if (gimp_image_base_type (gimage) == GIMP_INDEXED) - colormap = gimp_image_get_colormap (gimage); + if (gimp_image_base_type (image) == GIMP_INDEXED) + colormap = gimp_image_get_colormap (image); gimp_item_offsets (GIMP_ITEM (drawable), &offset_x, &offset_y); diff --git a/app/core/gimpdrawable-histogram.c b/app/core/gimpdrawable-histogram.c index 2b36bf3d05..d17350d302 100644 --- a/app/core/gimpdrawable-histogram.c +++ b/app/core/gimpdrawable-histogram.c @@ -55,11 +55,11 @@ gimp_drawable_calculate_histogram (GimpDrawable *drawable, if (have_mask) { GimpChannel *sel_mask; - GimpImage *gimage; + GimpImage *image; gint off_x, off_y; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); - sel_mask = gimp_image_get_mask (gimage); + image = gimp_item_get_image (GIMP_ITEM (drawable)); + sel_mask = gimp_image_get_mask (image); gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y); pixel_region_init (&mask, gimp_drawable_data (GIMP_DRAWABLE (sel_mask)), diff --git a/app/core/gimpdrawable-preview.c b/app/core/gimpdrawable-preview.c index 8829f39ed7..93d933af5e 100644 --- a/app/core/gimpdrawable-preview.c +++ b/app/core/gimpdrawable-preview.c @@ -62,21 +62,21 @@ gimp_drawable_get_preview (GimpViewable *viewable, gint height) { GimpDrawable *drawable; - GimpImage *gimage; + GimpImage *image; drawable = GIMP_DRAWABLE (viewable); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - if (! gimage->gimp->config->layer_previews) + if (! image->gimp->config->layer_previews) return NULL; /* Ok prime the cache with a large preview if the cache is invalid */ if (! drawable->preview_valid && width <= PREVIEW_CACHE_PRIME_WIDTH && height <= PREVIEW_CACHE_PRIME_HEIGHT && - gimage && - gimage->width > PREVIEW_CACHE_PRIME_WIDTH && - gimage->height > PREVIEW_CACHE_PRIME_HEIGHT) + image && + image->width > PREVIEW_CACHE_PRIME_WIDTH && + image->height > PREVIEW_CACHE_PRIME_HEIGHT) { TempBuf *tb = gimp_drawable_preview_private (drawable, PREVIEW_CACHE_PRIME_WIDTH, @@ -127,7 +127,7 @@ gimp_drawable_get_sub_preview (GimpDrawable *drawable, gint dest_height) { GimpItem *item; - GimpImage *gimage; + GimpImage *image; TempBuf *preview_buf; PixelRegion srcPR; PixelRegion destPR; @@ -147,9 +147,9 @@ gimp_drawable_get_sub_preview (GimpDrawable *drawable, g_return_val_if_fail ((src_x + src_width) <= gimp_item_width (item), NULL); g_return_val_if_fail ((src_y + src_height) <= gimp_item_height (item), NULL); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - if (! gimage->gimp->config->layer_previews) + if (! image->gimp->config->layer_previews) return NULL; bytes = gimp_drawable_preview_bytes (drawable); @@ -173,7 +173,7 @@ gimp_drawable_get_sub_preview (GimpDrawable *drawable, if (GIMP_IS_LAYER (drawable)) { gimp_drawable_preview_scale (gimp_drawable_type (drawable), - gimp_image_get_colormap (gimage), + gimp_image_get_colormap (image), &srcPR, &destPR, subsample); } diff --git a/app/core/gimpdrawable-stroke.c b/app/core/gimpdrawable-stroke.c index 6b5ee0e274..8750eb690d 100644 --- a/app/core/gimpdrawable-stroke.c +++ b/app/core/gimpdrawable-stroke.c @@ -208,7 +208,7 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, GimpScanConvert *scan_convert) { GimpContext *context = GIMP_CONTEXT (options); - GimpImage *gimage; + GimpImage *image; gdouble width; TileManager *base; TileManager *mask; @@ -218,13 +218,13 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, guchar bg[1] = { 0, }; PixelRegion maskPR, basePR; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* must call gimp_channel_is_empty() instead of relying on * gimp_drawable_mask_intersect() because the selection pretends to * be empty while it is being stroked, to prevent masking itself. */ - if (gimp_channel_is_empty (gimp_image_get_mask (gimage))) + if (gimp_channel_is_empty (gimp_image_get_mask (image))) { x = 0; y = 0; @@ -243,11 +243,11 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, if (options->unit != GIMP_UNIT_PIXEL) { gimp_scan_convert_set_pixel_ratio (scan_convert, - gimage->yresolution / - gimage->xresolution); + image->yresolution / + image->xresolution); - width *= (gimage->yresolution / - _gimp_unit_get_factor (gimage->gimp, options->unit)); + width *= (image->yresolution / + _gimp_unit_get_factor (image->gimp, options->unit)); } gimp_scan_convert_stroke (scan_convert, width, @@ -287,7 +287,7 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, &tmp_col[GREEN_PIX], &tmp_col[BLUE_PIX]); - gimp_image_transform_color (gimage, drawable, + gimp_image_transform_color (image, drawable, col, GIMP_RGB, tmp_col); col[bytes - 1] = OPAQUE_OPACITY; @@ -302,7 +302,7 @@ gimp_drawable_stroke_scan_convert (GimpDrawable *drawable, gboolean new_buf; pattern = gimp_context_get_pattern (context); - pat_buf = gimp_image_transform_temp_buf (gimage, drawable, + pat_buf = gimp_image_transform_temp_buf (image, drawable, pattern->mask, &new_buf); pattern_region (&basePR, &maskPR, pat_buf, x, y); diff --git a/app/core/gimpdrawable-transform.c b/app/core/gimpdrawable-transform.c index 32f1c58abb..aa4cf1fcd0 100644 --- a/app/core/gimpdrawable-transform.c +++ b/app/core/gimpdrawable-transform.c @@ -124,7 +124,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, gboolean clip_result, GimpProgress *progress) { - GimpImage *gimage; + GimpImage *image; PixelRegion destPR; TileManager *new_tiles; GimpMatrix3 m; @@ -164,7 +164,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, g_return_val_if_fail (matrix != NULL, NULL); g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); m = *matrix; inv = *matrix; @@ -176,7 +176,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, interpolation_type = GIMP_INTERPOLATION_NONE; /* Get the background color */ - gimp_image_get_background (gimage, drawable, context, bg_color); + gimp_image_get_background (image, drawable, context, bg_color); switch (GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (drawable))) { @@ -191,7 +191,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, case GIMP_INDEXED: bg_color[ALPHA_I_PIX] = TRANSPARENT_OPACITY; alpha = ALPHA_I_PIX; - /* If the gimage is indexed color, ignore interpolation value */ + /* If the image is indexed color, ignore interpolation value */ interpolation_type = GIMP_INTERPOLATION_NONE; break; default: @@ -511,7 +511,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable, gdouble axis, gboolean clip_result) { - GimpImage *gimage; + GimpImage *image; TileManager *new_tiles; PixelRegion srcPR, destPR; gint orig_x, orig_y; @@ -526,7 +526,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable, g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (orig_tiles != NULL, NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); orig_width = tile_manager_width (orig_tiles); orig_height = tile_manager_height (orig_tiles); @@ -564,7 +564,7 @@ gimp_drawable_transform_tiles_flip (GimpDrawable *drawable, tile_manager_set_offsets (new_tiles, orig_x, orig_y); - gimp_image_get_background (gimage, drawable, context, bg_color); + gimp_image_get_background (image, drawable, context, bg_color); /* "Outside" a channel is transparency, not the bg color */ if (GIMP_IS_CHANNEL (drawable)) @@ -672,7 +672,7 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable, gdouble center_y, gboolean clip_result) { - GimpImage *gimage; + GimpImage *image; TileManager *new_tiles; PixelRegion srcPR, destPR; guchar *buf = NULL; @@ -688,7 +688,7 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable, g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (orig_tiles != NULL, NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); orig_width = tile_manager_width (orig_tiles); orig_height = tile_manager_height (orig_tiles); @@ -741,7 +741,7 @@ gimp_drawable_transform_tiles_rotate (GimpDrawable *drawable, tile_manager_set_offsets (new_tiles, orig_x, orig_y); - gimp_image_get_background (gimage, drawable, context, bg_color); + gimp_image_get_background (image, drawable, context, bg_color); /* "Outside" a channel is transparency, not the bg color */ if (GIMP_IS_CHANNEL (drawable)) @@ -893,7 +893,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable, gboolean clip_result, GimpProgress *progress) { - GimpImage *gimage; + GimpImage *image; TileManager *orig_tiles; gboolean new_layer; gboolean success = FALSE; @@ -904,10 +904,10 @@ gimp_drawable_transform_affine (GimpDrawable *drawable, g_return_val_if_fail (matrix != NULL, FALSE); g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* Start a transform undo group */ - gimp_image_undo_group_start (gimage, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, _("Transform")); /* Cut/Copy from the specified drawable */ @@ -944,7 +944,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable, } /* push the undo group end */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return success; } @@ -957,7 +957,7 @@ gimp_drawable_transform_flip (GimpDrawable *drawable, gdouble axis, gboolean clip_result) { - GimpImage *gimage; + GimpImage *image; TileManager *orig_tiles; gboolean new_layer; gboolean success = FALSE; @@ -966,10 +966,10 @@ gimp_drawable_transform_flip (GimpDrawable *drawable, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* Start a transform undo group */ - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM, _("Flip")); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, _("Flip")); /* Cut/Copy from the specified drawable */ orig_tiles = gimp_drawable_transform_cut (drawable, context, &new_layer); @@ -1027,7 +1027,7 @@ gimp_drawable_transform_flip (GimpDrawable *drawable, } /* push the undo group end */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return success; } @@ -1041,7 +1041,7 @@ gimp_drawable_transform_rotate (GimpDrawable *drawable, gdouble center_y, gboolean clip_result) { - GimpImage *gimage; + GimpImage *image; TileManager *orig_tiles; gboolean new_layer; gboolean success = FALSE; @@ -1050,10 +1050,10 @@ gimp_drawable_transform_rotate (GimpDrawable *drawable, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* Start a transform undo group */ - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM, _("Rotate")); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, _("Rotate")); /* Cut/Copy from the specified drawable */ orig_tiles = gimp_drawable_transform_cut (drawable, context, &new_layer); @@ -1098,7 +1098,7 @@ gimp_drawable_transform_rotate (GimpDrawable *drawable, } /* push the undo group end */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return success; } @@ -1108,7 +1108,7 @@ gimp_drawable_transform_cut (GimpDrawable *drawable, GimpContext *context, gboolean *new_layer) { - GimpImage *gimage; + GimpImage *image; TileManager *tiles; g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); @@ -1116,10 +1116,10 @@ gimp_drawable_transform_cut (GimpDrawable *drawable, g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); g_return_val_if_fail (new_layer != NULL, NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* extract the selected mask if there is a selection */ - if (! gimp_channel_is_empty (gimp_image_get_mask (gimage))) + if (! gimp_channel_is_empty (gimp_image_get_mask (image))) { gint x, y, w, h; @@ -1129,7 +1129,7 @@ gimp_drawable_transform_cut (GimpDrawable *drawable, */ if (gimp_drawable_mask_intersect (drawable, &x, &y, &w, &h)) { - tiles = gimp_selection_extract (gimp_image_get_mask (gimage), + tiles = gimp_selection_extract (gimp_image_get_mask (image), drawable, context, TRUE, FALSE, TRUE); *new_layer = TRUE; @@ -1143,10 +1143,10 @@ gimp_drawable_transform_cut (GimpDrawable *drawable, else /* otherwise, just copy the layer */ { if (GIMP_IS_LAYER (drawable)) - tiles = gimp_selection_extract (gimp_image_get_mask (gimage), + tiles = gimp_selection_extract (gimp_image_get_mask (image), drawable, context, FALSE, TRUE, TRUE); else - tiles = gimp_selection_extract (gimp_image_get_mask (gimage), + tiles = gimp_selection_extract (gimp_image_get_mask (image), drawable, context, FALSE, TRUE, FALSE); *new_layer = FALSE; @@ -1160,7 +1160,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable, TileManager *tiles, gboolean new_layer) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer = NULL; const gchar *undo_desc = NULL; gint offset_x; @@ -1170,7 +1170,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); g_return_val_if_fail (tiles != NULL, FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); if (GIMP_IS_LAYER (drawable)) undo_desc = _("Transform Layer"); @@ -1181,12 +1181,12 @@ gimp_drawable_transform_paste (GimpDrawable *drawable, tile_manager_get_offsets (tiles, &offset_x, &offset_y); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE, undo_desc); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, undo_desc); if (new_layer) { layer = - gimp_layer_new_from_tiles (tiles, gimage, + gimp_layer_new_from_tiles (tiles, image, gimp_drawable_type_with_alpha (drawable), _("Transformation"), GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); @@ -1215,7 +1215,7 @@ gimp_drawable_transform_paste (GimpDrawable *drawable, offset_x, offset_y); } - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return TRUE; } diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index 160b9a4150..83962bb015 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -359,16 +359,16 @@ gimp_drawable_translate (GimpItem *item, gboolean push_undo) { GimpDrawable *drawable = GIMP_DRAWABLE (item); - GimpImage *gimage = gimp_item_get_image (item); + GimpImage *image = gimp_item_get_image (item); if (gimp_drawable_has_floating_sel (drawable)) - floating_sel_relax (gimp_image_floating_sel (gimage), FALSE); + floating_sel_relax (gimp_image_floating_sel (image), FALSE); GIMP_ITEM_CLASS (parent_class)->translate (item, offset_x, offset_y, push_undo); if (gimp_drawable_has_floating_sel (drawable)) - floating_sel_rigor (gimp_image_floating_sel (gimage), FALSE); + floating_sel_rigor (gimp_image_floating_sel (image), FALSE); } static void @@ -592,7 +592,7 @@ gimp_drawable_get_color_at (GimpPickable *pickable, gint y) { GimpDrawable *drawable = GIMP_DRAWABLE (pickable); - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable)); Tile *tile; guchar *src; guchar *dest; @@ -608,7 +608,7 @@ gimp_drawable_get_color_at (GimpPickable *pickable, TRUE, FALSE); src = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT); - gimp_image_get_color (gimage, gimp_drawable_type (drawable), src, dest); + gimp_image_get_color (image, gimp_drawable_type (drawable), src, dest); if (gimp_drawable_is_indexed (drawable)) dest[4] = src[0]; @@ -782,7 +782,7 @@ gimp_drawable_real_swap_pixels (GimpDrawable *drawable, void gimp_drawable_configure (GimpDrawable *drawable, - GimpImage *gimage, + GimpImage *image, gint offset_x, gint offset_y, gint width, @@ -791,10 +791,10 @@ gimp_drawable_configure (GimpDrawable *drawable, const gchar *name) { g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (width > 0 && height > 0); - gimp_item_configure (GIMP_ITEM (drawable), gimage, + gimp_item_configure (GIMP_ITEM (drawable), image, offset_x, offset_y, width, height, name); drawable->type = type; @@ -934,14 +934,14 @@ gimp_drawable_set_tiles_full (GimpDrawable *drawable, gint offset_y) { GimpItem *item; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (tiles != NULL); g_return_if_fail (tile_manager_bpp (tiles) == GIMP_IMAGE_TYPE_BYTES (type)); - item = GIMP_ITEM (drawable); - gimage = gimp_item_get_image (item); + item = GIMP_ITEM (drawable); + image = gimp_item_get_image (item); if (! gimp_item_is_attached (GIMP_ITEM (drawable))) push_undo = FALSE; @@ -955,7 +955,7 @@ gimp_drawable_set_tiles_full (GimpDrawable *drawable, } if (gimp_drawable_has_floating_sel (drawable)) - floating_sel_relax (gimp_image_floating_sel (gimage), FALSE); + floating_sel_relax (gimp_image_floating_sel (image), FALSE); GIMP_DRAWABLE_GET_CLASS (drawable)->set_tiles (drawable, push_undo, undo_desc, @@ -963,7 +963,7 @@ gimp_drawable_set_tiles_full (GimpDrawable *drawable, offset_x, offset_y); if (gimp_drawable_has_floating_sel (drawable)) - floating_sel_rigor (gimp_image_floating_sel (gimage), FALSE); + floating_sel_rigor (gimp_image_floating_sel (image), FALSE); gimp_drawable_update (drawable, 0, 0, item->width, item->height); } @@ -1051,15 +1051,15 @@ gimp_drawable_merge_shadow (GimpDrawable *drawable, gboolean push_undo, const gchar *undo_desc) { - GimpImage *gimage; + GimpImage *image; gint x, y, width, height; g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - g_return_if_fail (gimage->shadow != NULL); + g_return_if_fail (image->shadow != NULL); /* A useful optimization here is to limit the update to the * extents of the selection mask, as it cannot extend beyond @@ -1069,7 +1069,7 @@ gimp_drawable_merge_shadow (GimpDrawable *drawable, { PixelRegion shadowPR; - pixel_region_init (&shadowPR, gimage->shadow, + pixel_region_init (&shadowPR, image->shadow, x, y, width, height, FALSE); gimp_drawable_apply_region (drawable, &shadowPR, push_undo, undo_desc, @@ -1084,7 +1084,7 @@ gimp_drawable_fill (GimpDrawable *drawable, const GimpPattern *pattern) { GimpItem *item; - GimpImage *gimage; + GimpImage *image; GimpImageType drawable_type; PixelRegion destPR; @@ -1093,7 +1093,7 @@ gimp_drawable_fill (GimpDrawable *drawable, g_return_if_fail (pattern == NULL || GIMP_IS_PATTERN (pattern)); item = GIMP_ITEM (drawable); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); drawable_type = gimp_drawable_type (drawable); @@ -1112,7 +1112,7 @@ gimp_drawable_fill (GimpDrawable *drawable, &tmp[BLUE_PIX], &tmp[ALPHA_PIX]); - gimp_image_transform_color (gimage, drawable, c, GIMP_RGB, tmp); + gimp_image_transform_color (image, drawable, c, GIMP_RGB, tmp); if (GIMP_IMAGE_TYPE_HAS_ALPHA (drawable_type)) c[GIMP_IMAGE_TYPE_BYTES (drawable_type) - 1] = tmp[ALPHA_PIX]; @@ -1126,7 +1126,7 @@ gimp_drawable_fill (GimpDrawable *drawable, TempBuf *pat_buf; gboolean new_buf; - pat_buf = gimp_image_transform_temp_buf (gimage, drawable, + pat_buf = gimp_image_transform_temp_buf (image, drawable, pattern->mask, &new_buf); pattern_region (&destPR, NULL, pat_buf, 0, 0); @@ -1192,7 +1192,7 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable, gint *y2) { GimpItem *item; - GimpImage *gimage; + GimpImage *image; GimpChannel *selection; g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); @@ -1210,8 +1210,8 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable, g_return_val_if_fail (gimp_item_is_attached (item), FALSE); - gimage = gimp_item_get_image (item); - selection = gimp_image_get_mask (gimage); + image = gimp_item_get_image (item); + selection = gimp_image_get_mask (image); if (GIMP_DRAWABLE (selection) != drawable && gimp_channel_bounds (selection, x1, y1, x2, y2)) @@ -1244,7 +1244,7 @@ gimp_drawable_mask_intersect (GimpDrawable *drawable, gint *height) { GimpItem *item; - GimpImage *gimage; + GimpImage *image; GimpChannel *selection; g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); @@ -1262,8 +1262,8 @@ gimp_drawable_mask_intersect (GimpDrawable *drawable, g_return_val_if_fail (gimp_item_is_attached (item), FALSE); - gimage = gimp_item_get_image (item); - selection = gimp_image_get_mask (gimage); + image = gimp_item_get_image (item); + selection = gimp_image_get_mask (image); if (GIMP_DRAWABLE (selection) != drawable && gimp_channel_bounds (selection, x, y, width, height)) @@ -1380,14 +1380,14 @@ gimp_drawable_bytes_without_alpha (const GimpDrawable *drawable) gboolean gimp_drawable_has_floating_sel (const GimpDrawable *drawable) { - GimpImage *gimage; + GimpImage *image; GimpLayer *floating_sel; g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - floating_sel = gimp_image_floating_sel (gimage); + floating_sel = gimp_image_floating_sel (image); return (floating_sel && floating_sel->fs.drawable == drawable); } @@ -1403,14 +1403,14 @@ gimp_drawable_data (const GimpDrawable *drawable) guchar * gimp_drawable_cmap (const GimpDrawable *drawable) { - GimpImage *gimage; + GimpImage *image; g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - if (gimage) - return gimage->cmap; + if (image) + return image->cmap; return NULL; } diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index 18a6a82205..8b16eeefc8 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -110,7 +110,7 @@ struct _GimpDrawableClass GType gimp_drawable_get_type (void) G_GNUC_CONST; void gimp_drawable_configure (GimpDrawable *drawable, - GimpImage *gimage, + GimpImage *image, gint offset_x, gint offset_y, gint width, diff --git a/app/core/gimpimage-colorhash.c b/app/core/gimpimage-colorhash.c index 6390e92bcc..708b63db2e 100644 --- a/app/core/gimpimage-colorhash.c +++ b/app/core/gimpimage-colorhash.c @@ -35,7 +35,7 @@ struct _ColorHash { gint pixel; /* R << 16 | G << 8 | B */ gint index; /* colormap index */ - GimpImage *gimage; + GimpImage *image; }; @@ -54,7 +54,7 @@ gimp_image_color_hash_init (void) { color_hash_table[i].pixel = 0; color_hash_table[i].index = 0; - color_hash_table[i].gimage = NULL; + color_hash_table[i].image = NULL; } color_hash_misses = 0; @@ -76,38 +76,38 @@ gimp_image_color_hash_exit (void) } void -gimp_image_color_hash_invalidate (GimpImage *gimage, +gimp_image_color_hash_invalidate (GimpImage *image, gint index) { gint i; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); if (index == -1) /* invalidate all entries */ { for (i = 0; i < HASH_TABLE_SIZE; i++) - if (color_hash_table[i].gimage == gimage) + if (color_hash_table[i].image == image) { color_hash_table[i].pixel = 0; color_hash_table[i].index = 0; - color_hash_table[i].gimage = NULL; + color_hash_table[i].image = NULL; } } else { for (i = 0; i < HASH_TABLE_SIZE; i++) - if (color_hash_table[i].gimage == gimage && + if (color_hash_table[i].image == image && color_hash_table[i].index == index) { color_hash_table[i].pixel = 0; color_hash_table[i].index = 0; - color_hash_table[i].gimage = NULL; + color_hash_table[i].image = NULL; } } } gint -gimp_image_color_hash_rgb_to_indexed (const GimpImage *gimage, +gimp_image_color_hash_rgb_to_indexed (const GimpImage *image, gint r, gint g, gint b) @@ -118,12 +118,12 @@ gimp_image_color_hash_rgb_to_indexed (const GimpImage *gimage, gint hash_index; gint cmap_index; - cmap = gimage->cmap; - num_cols = gimage->num_cols; + cmap = image->cmap; + num_cols = image->num_cols; pixel = (r << 16) | (g << 8) | b; hash_index = pixel % HASH_TABLE_SIZE; - if (color_hash_table[hash_index].gimage == gimage && + if (color_hash_table[hash_index].image == image && color_hash_table[hash_index].pixel == pixel) { /* Hash table lookup hit */ @@ -164,7 +164,7 @@ gimp_image_color_hash_rgb_to_indexed (const GimpImage *gimage, /* update the hash table */ color_hash_table[hash_index].pixel = pixel; color_hash_table[hash_index].index = cmap_index; - color_hash_table[hash_index].gimage = (GimpImage *) gimage; + color_hash_table[hash_index].image = (GimpImage *) image; color_hash_misses++; } diff --git a/app/core/gimpimage-colorhash.h b/app/core/gimpimage-colorhash.h index b8b9647b45..a470d057d9 100644 --- a/app/core/gimpimage-colorhash.h +++ b/app/core/gimpimage-colorhash.h @@ -23,10 +23,10 @@ void gimp_image_color_hash_init (void); void gimp_image_color_hash_exit (void); -void gimp_image_color_hash_invalidate (GimpImage *gimage, +void gimp_image_color_hash_invalidate (GimpImage *image, gint index); -gint gimp_image_color_hash_rgb_to_indexed (const GimpImage *gimage, +gint gimp_image_color_hash_rgb_to_indexed (const GimpImage *image, gint r, gint g, gint b); diff --git a/app/core/gimpimage-colormap.c b/app/core/gimpimage-colormap.c index 6a64d5ef1d..75668f6db4 100644 --- a/app/core/gimpimage-colormap.c +++ b/app/core/gimpimage-colormap.c @@ -34,112 +34,112 @@ const guchar * -gimp_image_get_colormap (const GimpImage *gimage) +gimp_image_get_colormap (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->cmap; + return image->cmap; } gint -gimp_image_get_colormap_size (const GimpImage *gimage) +gimp_image_get_colormap_size (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + g_return_val_if_fail (GIMP_IS_IMAGE (image), 0); - return gimage->num_cols; + return image->num_cols; } void -gimp_image_set_colormap (GimpImage *gimage, +gimp_image_set_colormap (GimpImage *image, const guchar *cmap, gint n_colors, gboolean push_undo) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (cmap != NULL || n_colors == 0); g_return_if_fail (n_colors >= 0 && n_colors <= 256); if (push_undo) - gimp_image_undo_push_image_colormap (gimage, _("Set Colormap")); + gimp_image_undo_push_image_colormap (image, _("Set Colormap")); if (cmap) { - if (! gimage->cmap) - gimage->cmap = g_new0 (guchar, GIMP_IMAGE_COLORMAP_SIZE); + if (! image->cmap) + image->cmap = g_new0 (guchar, GIMP_IMAGE_COLORMAP_SIZE); - memcpy (gimage->cmap, cmap, n_colors * 3); + memcpy (image->cmap, cmap, n_colors * 3); } else { - if (gimage->cmap) - g_free (gimage->cmap); + if (image->cmap) + g_free (image->cmap); - gimage->cmap = NULL; + image->cmap = NULL; } - gimage->num_cols = n_colors; + image->num_cols = n_colors; - gimp_image_colormap_changed (gimage, -1); + gimp_image_colormap_changed (image, -1); } void -gimp_image_get_colormap_entry (GimpImage *gimage, +gimp_image_get_colormap_entry (GimpImage *image, gint color_index, GimpRGB *color) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); - g_return_if_fail (gimage->cmap != NULL); - g_return_if_fail (color_index >= 0 && color_index < gimage->num_cols); + g_return_if_fail (GIMP_IS_IMAGE (image)); + g_return_if_fail (image->cmap != NULL); + g_return_if_fail (color_index >= 0 && color_index < image->num_cols); g_return_if_fail (color != NULL); gimp_rgba_set_uchar (color, - gimage->cmap[color_index * 3], - gimage->cmap[color_index * 3 + 1], - gimage->cmap[color_index * 3 + 2], + image->cmap[color_index * 3], + image->cmap[color_index * 3 + 1], + image->cmap[color_index * 3 + 2], OPAQUE_OPACITY); } void -gimp_image_set_colormap_entry (GimpImage *gimage, +gimp_image_set_colormap_entry (GimpImage *image, gint color_index, const GimpRGB *color, gboolean push_undo) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); - g_return_if_fail (gimage->cmap != NULL); - g_return_if_fail (color_index >= 0 && color_index < gimage->num_cols); + g_return_if_fail (GIMP_IS_IMAGE (image)); + g_return_if_fail (image->cmap != NULL); + g_return_if_fail (color_index >= 0 && color_index < image->num_cols); g_return_if_fail (color != NULL); if (push_undo) - gimp_image_undo_push_image_colormap (gimage, + gimp_image_undo_push_image_colormap (image, _("Change Colormap entry")); gimp_rgb_get_uchar (color, - &gimage->cmap[color_index * 3], - &gimage->cmap[color_index * 3 + 1], - &gimage->cmap[color_index * 3 + 2]); + &image->cmap[color_index * 3], + &image->cmap[color_index * 3 + 1], + &image->cmap[color_index * 3 + 2]); - gimp_image_colormap_changed (gimage, color_index); + gimp_image_colormap_changed (image, color_index); } void -gimp_image_add_colormap_entry (GimpImage *gimage, +gimp_image_add_colormap_entry (GimpImage *image, const GimpRGB *color) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); - g_return_if_fail (gimage->cmap != NULL); - g_return_if_fail (gimage->num_cols < 256); + g_return_if_fail (GIMP_IS_IMAGE (image)); + g_return_if_fail (image->cmap != NULL); + g_return_if_fail (image->num_cols < 256); g_return_if_fail (color != NULL); - gimp_image_undo_push_image_colormap (gimage, + gimp_image_undo_push_image_colormap (image, _("Add Color to Colormap")); gimp_rgb_get_uchar (color, - &gimage->cmap[gimage->num_cols * 3], - &gimage->cmap[gimage->num_cols * 3 + 1], - &gimage->cmap[gimage->num_cols * 3 + 2]); + &image->cmap[image->num_cols * 3], + &image->cmap[image->num_cols * 3 + 1], + &image->cmap[image->num_cols * 3 + 2]); - gimage->num_cols++; + image->num_cols++; - gimp_image_colormap_changed (gimage, -1); + gimp_image_colormap_changed (image, -1); } diff --git a/app/core/gimpimage-colormap.h b/app/core/gimpimage-colormap.h index f99809d6ac..a26e5531f7 100644 --- a/app/core/gimpimage-colormap.h +++ b/app/core/gimpimage-colormap.h @@ -23,22 +23,22 @@ #define GIMP_IMAGE_COLORMAP_SIZE 768 -const guchar * gimp_image_get_colormap (const GimpImage *gimage); -gint gimp_image_get_colormap_size (const GimpImage *gimage); -void gimp_image_set_colormap (GimpImage *gimage, +const guchar * gimp_image_get_colormap (const GimpImage *image); +gint gimp_image_get_colormap_size (const GimpImage *image); +void gimp_image_set_colormap (GimpImage *image, const guchar *cmap, gint n_colors, gboolean push_undo); -void gimp_image_get_colormap_entry (GimpImage *gimage, +void gimp_image_get_colormap_entry (GimpImage *image, gint color_index, GimpRGB *color); -void gimp_image_set_colormap_entry (GimpImage *gimage, +void gimp_image_set_colormap_entry (GimpImage *image, gint color_index, const GimpRGB *color, gboolean push_undo); -void gimp_image_add_colormap_entry (GimpImage *gimage, +void gimp_image_add_colormap_entry (GimpImage *image, const GimpRGB *color); diff --git a/app/core/gimpimage-contiguous-region.c b/app/core/gimpimage-contiguous-region.c index fd983c9d7d..34e875c051 100644 --- a/app/core/gimpimage-contiguous-region.c +++ b/app/core/gimpimage-contiguous-region.c @@ -39,7 +39,7 @@ typedef struct { - GimpImage *gimage; + GimpImage *image; GimpImageType type; gboolean sample_merged; gboolean antialias; @@ -71,7 +71,7 @@ static void ref_tiles (TileManager *src, gint y, guchar **s, guchar **m); -static gint find_contiguous_segment (GimpImage *gimage, +static gint find_contiguous_segment (GimpImage *image, guchar *col, PixelRegion *src, PixelRegion *mask, @@ -85,7 +85,7 @@ static gint find_contiguous_segment (GimpImage *gimage, gint initial, gint *start, gint *end); -static void find_contiguous_region_helper (GimpImage *gimage, +static void find_contiguous_region_helper (GimpImage *image, PixelRegion *mask, PixelRegion *src, GimpImageType src_type, @@ -101,7 +101,7 @@ static void find_contiguous_region_helper (GimpImage *gimage, /* public functions */ GimpChannel * -gimp_image_contiguous_region_by_seed (GimpImage *gimage, +gimp_image_contiguous_region_by_seed (GimpImage *image, GimpDrawable *drawable, gboolean sample_merged, gboolean antialias, @@ -119,11 +119,11 @@ gimp_image_contiguous_region_by_seed (GimpImage *gimage, gint bytes; Tile *tile; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); if (sample_merged) - pickable = GIMP_PICKABLE (gimage->projection); + pickable = GIMP_PICKABLE (image->projection); else pickable = GIMP_PICKABLE (drawable); @@ -140,7 +140,7 @@ gimp_image_contiguous_region_by_seed (GimpImage *gimage, tile_manager_height (tiles), FALSE); - mask = gimp_channel_new_mask (gimage, srcPR.w, srcPR.h); + mask = gimp_channel_new_mask (image, srcPR.w, srcPR.h); pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)), 0, 0, gimp_item_width (GIMP_ITEM (mask)), @@ -173,7 +173,7 @@ gimp_image_contiguous_region_by_seed (GimpImage *gimage, if (GIMP_IMAGE_TYPE_IS_INDEXED (src_type)) { - gimp_image_get_color (gimage, src_type, start, start_col); + gimp_image_get_color (image, src_type, start, start_col); } else { @@ -183,7 +183,7 @@ gimp_image_contiguous_region_by_seed (GimpImage *gimage, start_col[i] = start[i]; } - find_contiguous_region_helper (gimage, &maskPR, &srcPR, + find_contiguous_region_helper (image, &maskPR, &srcPR, src_type, has_alpha, select_transparent, antialias, threshold, x, y, start_col); @@ -195,7 +195,7 @@ gimp_image_contiguous_region_by_seed (GimpImage *gimage, } GimpChannel * -gimp_image_contiguous_region_by_color (GimpImage *gimage, +gimp_image_contiguous_region_by_color (GimpImage *image, GimpDrawable *drawable, gboolean sample_merged, gboolean antialias, @@ -203,10 +203,10 @@ gimp_image_contiguous_region_by_color (GimpImage *gimage, gboolean select_transparent, const GimpRGB *color) { - /* Scan over the gimage's active layer, finding pixels within the + /* Scan over the image's active layer, finding pixels within the * specified threshold from the given R, G, & B values. If * antialiasing is on, use the same antialiasing scheme as in - * fuzzy_select. Modify the gimage's mask to reflect the + * fuzzy_select. Modify the image's mask to reflect the * additional selection */ GimpPickable *pickable; @@ -217,7 +217,7 @@ gimp_image_contiguous_region_by_color (GimpImage *gimage, ContinuousRegionData cont; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); g_return_val_if_fail (color != NULL, NULL); @@ -228,7 +228,7 @@ gimp_image_contiguous_region_by_color (GimpImage *gimage, cont.color + 3); if (sample_merged) - pickable = GIMP_PICKABLE (gimage->projection); + pickable = GIMP_PICKABLE (image->projection); else pickable = GIMP_PICKABLE (drawable); @@ -258,12 +258,12 @@ gimp_image_contiguous_region_by_color (GimpImage *gimage, select_transparent = FALSE; } - cont.gimage = gimage; + cont.image = image; cont.antialias = antialias; cont.threshold = threshold; cont.select_transparent = select_transparent; - mask = gimp_channel_new_mask (gimage, width, height); + mask = gimp_channel_new_mask (image, width, height); pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)), 0, 0, width, height, @@ -298,7 +298,7 @@ contiguous_region_by_color (ContinuousRegionData *cont, guchar rgb[MAX_CHANNELS]; /* Get the rgb values for the color */ - gimp_image_get_color (cont->gimage, cont->type, i, rgb); + gimp_image_get_color (cont->image, cont->type, i, rgb); /* Find how closely the colors match */ *m++ = pixel_difference (cont->color, rgb, @@ -394,7 +394,7 @@ ref_tiles (TileManager *src, } static int -find_contiguous_segment (GimpImage *gimage, +find_contiguous_segment (GimpImage *image, guchar *col, PixelRegion *src, PixelRegion *mask, @@ -424,7 +424,7 @@ find_contiguous_segment (GimpImage *gimage, { col_bytes = has_alpha ? 4 : 3; - gimp_image_get_color (gimage, src_type, s, s_color); + gimp_image_get_color (image, src_type, s, s_color); diff = pixel_difference (col, s_color, antialias, threshold, col_bytes, has_alpha, select_transparent); @@ -455,7 +455,7 @@ find_contiguous_segment (GimpImage *gimage, if (GIMP_IMAGE_TYPE_IS_INDEXED (src_type)) { - gimp_image_get_color (gimage, src_type, s, s_color); + gimp_image_get_color (image, src_type, s, s_color); diff = pixel_difference (col, s_color, antialias, threshold, col_bytes, has_alpha, select_transparent); @@ -488,7 +488,7 @@ find_contiguous_segment (GimpImage *gimage, if (GIMP_IMAGE_TYPE_IS_INDEXED (src_type)) { - gimp_image_get_color (gimage, src_type, s, s_color); + gimp_image_get_color (image, src_type, s, s_color); diff = pixel_difference (col, s_color, antialias, threshold, col_bytes, has_alpha, select_transparent); @@ -513,7 +513,7 @@ find_contiguous_segment (GimpImage *gimage, } static void -find_contiguous_region_helper (GimpImage *gimage, +find_contiguous_region_helper (GimpImage *image, PixelRegion *mask, PixelRegion *src, GimpImageType src_type, @@ -561,7 +561,7 @@ find_contiguous_region_helper (GimpImage *gimage, src->x = x; src->y = y; - if (! find_contiguous_segment (gimage, col, src, mask, src->w, + if (! find_contiguous_segment (image, col, src, mask, src->w, src->bytes, src_type, has_alpha, select_transparent, antialias, threshold, x, &new_start, &new_end)) diff --git a/app/core/gimpimage-contiguous-region.h b/app/core/gimpimage-contiguous-region.h index 302da9f793..5f3c374a7f 100644 --- a/app/core/gimpimage-contiguous-region.h +++ b/app/core/gimpimage-contiguous-region.h @@ -20,7 +20,7 @@ #define __GIMP_IMAGE_CONTIGUOUS_REGION_H__ -GimpChannel * gimp_image_contiguous_region_by_seed (GimpImage *gimage, +GimpChannel * gimp_image_contiguous_region_by_seed (GimpImage *image, GimpDrawable *drawable, gboolean sample_merged, gboolean antialias, @@ -29,7 +29,7 @@ GimpChannel * gimp_image_contiguous_region_by_seed (GimpImage *gimage, gint x, gint y); -GimpChannel * gimp_image_contiguous_region_by_color (GimpImage *gimage, +GimpChannel * gimp_image_contiguous_region_by_color (GimpImage *image, GimpDrawable *drawable, gboolean sample_merged, gboolean antialias, diff --git a/app/core/gimpimage-convert.c b/app/core/gimpimage-convert.c index e7d6fd803c..c041f8a67f 100644 --- a/app/core/gimpimage-convert.c +++ b/app/core/gimpimage-convert.c @@ -760,7 +760,7 @@ color_quicksort (const void *c1, } void -gimp_image_convert (GimpImage *gimage, +gimp_image_convert (GimpImage *image, GimpImageBaseType new_type, /* The following are only used for new_type == GIMP_INDEXED */ @@ -781,8 +781,8 @@ gimp_image_convert (GimpImage *gimage, const gchar *undo_desc = NULL; gint nth_layer, n_layers; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); - g_return_if_fail (new_type != gimp_image_base_type (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); + g_return_if_fail (new_type != gimp_image_base_type (image)); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); if (palette_type == GIMP_CUSTOM_PALETTE) @@ -802,9 +802,9 @@ gimp_image_convert (GimpImage *gimage, theCustomPalette = custom_palette; - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); - n_layers = g_list_length (GIMP_LIST (gimage->layers)->list); + n_layers = g_list_length (GIMP_LIST (image->layers)->list); switch (new_type) { @@ -821,21 +821,21 @@ gimp_image_convert (GimpImage *gimage, break; } - g_object_freeze_notify (G_OBJECT (gimage)); + g_object_freeze_notify (G_OBJECT (image)); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_CONVERT, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_CONVERT, undo_desc); - if (gimp_image_floating_sel (gimage)) - floating_sel_relax (gimp_image_floating_sel (gimage), TRUE); + if (gimp_image_floating_sel (image)) + floating_sel_relax (gimp_image_floating_sel (image), TRUE); /* Push the image type to the stack */ - gimp_image_undo_push_image_type (gimage, NULL); + gimp_image_undo_push_image_type (image, NULL); /* Set the new base type */ - old_type = gimage->base_type; + old_type = image->base_type; - g_object_set (gimage, "base-type", new_type, NULL); + g_object_set (image, "base-type", new_type, NULL); /* initialize the colour conversion routines */ cpercep_init (); @@ -876,7 +876,7 @@ gimp_image_convert (GimpImage *gimage, num_found_cols = 0; /* Build the histogram */ - for (list = GIMP_LIST (gimage->layers)->list, nth_layer = 0; + for (list = GIMP_LIST (image->layers)->list, nth_layer = 0; list; list = g_list_next (list), nth_layer++) { @@ -961,7 +961,7 @@ gimp_image_convert (GimpImage *gimage, if (quantobj) quantobj->n_layers = n_layers; - for (list = GIMP_LIST (gimage->layers)->list, nth_layer = 0; + for (list = GIMP_LIST (image->layers)->list, nth_layer = 0; list; list = g_list_next (list), nth_layer++) { @@ -1010,13 +1010,13 @@ gimp_image_convert (GimpImage *gimage, case GIMP_RGB: case GIMP_GRAY: if (old_type == GIMP_INDEXED) - gimp_image_set_colormap (gimage, NULL, 0, TRUE); + gimp_image_set_colormap (image, NULL, 0, TRUE); break; case GIMP_INDEXED: - gimp_image_undo_push_image_colormap (gimage, NULL); + gimp_image_undo_push_image_colormap (image, NULL); - gimage->cmap = g_new0 (guchar, GIMP_IMAGE_COLORMAP_SIZE); + image->cmap = g_new0 (guchar, GIMP_IMAGE_COLORMAP_SIZE); if (remove_dups && ((palette_type == GIMP_WEB_PALETTE) || (palette_type == GIMP_CUSTOM_PALETTE))) @@ -1043,7 +1043,7 @@ gimp_image_convert (GimpImage *gimage, remap_table, &num_entries); /* Convert all layers */ - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -1055,12 +1055,12 @@ gimp_image_convert (GimpImage *gimage, for (i = 0, j = 0; i < num_entries; i++) { - gimage->cmap[j] = new_palette[j]; j++; - gimage->cmap[j] = new_palette[j]; j++; - gimage->cmap[j] = new_palette[j]; j++; + image->cmap[j] = new_palette[j]; j++; + image->cmap[j] = new_palette[j]; j++; + image->cmap[j] = new_palette[j]; j++; } - gimage->num_cols = num_entries; + image->num_cols = num_entries; } else { @@ -1068,15 +1068,15 @@ gimp_image_convert (GimpImage *gimage, for (i = 0, j = 0; i < quantobj->actual_number_of_colors; i++) { - gimage->cmap[j++] = quantobj->cmap[i].red; - gimage->cmap[j++] = quantobj->cmap[i].green; - gimage->cmap[j++] = quantobj->cmap[i].blue; + image->cmap[j++] = quantobj->cmap[i].red; + image->cmap[j++] = quantobj->cmap[i].green; + image->cmap[j++] = quantobj->cmap[i].blue; } - gimage->num_cols = quantobj->actual_number_of_colors; + image->num_cols = quantobj->actual_number_of_colors; } - gimp_image_colormap_changed (gimage, -1); + gimp_image_colormap_changed (image, -1); break; } @@ -1084,16 +1084,16 @@ gimp_image_convert (GimpImage *gimage, if (quantobj) quantobj->delete_func (quantobj); - if (gimp_image_floating_sel (gimage)) - floating_sel_rigor (gimp_image_floating_sel (gimage), TRUE); + if (gimp_image_floating_sel (image)) + floating_sel_rigor (gimp_image_floating_sel (image), TRUE); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_image_invalidate_layer_previews (gimage); - gimp_image_mode_changed (gimage); - g_object_thaw_notify (G_OBJECT (gimage)); + gimp_image_invalidate_layer_previews (image); + gimp_image_mode_changed (image); + g_object_thaw_notify (G_OBJECT (image)); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); } diff --git a/app/core/gimpimage-convert.h b/app/core/gimpimage-convert.h index 48d9816277..3a24a54be8 100644 --- a/app/core/gimpimage-convert.h +++ b/app/core/gimpimage-convert.h @@ -23,7 +23,7 @@ #define MAXNUMCOLORS 256 -void gimp_image_convert (GimpImage *gimage, +void gimp_image_convert (GimpImage *image, GimpImageBaseType new_type, /* The following params used only for * new_type == GIMP_INDEXED diff --git a/app/core/gimpimage-crop.c b/app/core/gimpimage-crop.c index 9bdfb2d495..03070d7b36 100644 --- a/app/core/gimpimage-crop.c +++ b/app/core/gimpimage-crop.c @@ -75,7 +75,7 @@ static gint gimp_image_crop_colors_alpha (guchar *col1, /* public functions */ void -gimp_image_crop (GimpImage *gimage, +gimp_image_crop (GimpImage *image, GimpContext *context, gint x1, gint y1, @@ -86,7 +86,7 @@ gimp_image_crop (GimpImage *gimage, { gint width, height; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_CONTEXT (context)); width = x2 - x1; @@ -96,14 +96,14 @@ gimp_image_crop (GimpImage *gimage, if (width < 1 || height < 1) return; - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); if (active_layer_only) { GimpLayer *layer; gint off_x, off_y; - layer = gimp_image_get_active_layer (gimage); + layer = gimp_image_get_active_layer (image); gimp_item_offsets (GIMP_ITEM (layer), &off_x, &off_y); @@ -117,26 +117,26 @@ gimp_image_crop (GimpImage *gimage, GimpItem *item; GList *list; - g_object_freeze_notify (G_OBJECT (gimage)); + g_object_freeze_notify (G_OBJECT (image)); if (crop_layers) - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_CROP, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_CROP, _("Crop Image")); else - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_RESIZE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_RESIZE, _("Resize Image")); /* Push the image size to the stack */ - gimp_image_undo_push_image_size (gimage, NULL); + gimp_image_undo_push_image_size (image, NULL); /* Set the new width and height */ - g_object_set (gimage, + g_object_set (image, "width", width, "height", height, NULL); /* Resize all channels */ - for (list = GIMP_LIST (gimage->channels)->list; + for (list = GIMP_LIST (image->channels)->list; list; list = g_list_next (list)) { @@ -146,7 +146,7 @@ gimp_image_crop (GimpImage *gimage, } /* Resize all vectors */ - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { @@ -156,11 +156,11 @@ gimp_image_crop (GimpImage *gimage, } /* Don't forget the selection mask! */ - gimp_item_resize (GIMP_ITEM (gimp_image_get_mask (gimage)), context, + gimp_item_resize (GIMP_ITEM (gimp_image_get_mask (image)), context, width, height, -x1, -y1); /* crop all layers */ - list = GIMP_LIST (gimage->layers)->list; + list = GIMP_LIST (image->layers)->list; while (list) { @@ -177,12 +177,12 @@ gimp_image_crop (GimpImage *gimage, gimp_item_offsets (item, &off_x, &off_y); - lx1 = CLAMP (off_x, 0, gimage->width); - ly1 = CLAMP (off_y, 0, gimage->height); + lx1 = CLAMP (off_x, 0, image->width); + ly1 = CLAMP (off_y, 0, image->height); lx2 = CLAMP (gimp_item_width (item) + off_x, - 0, gimage->width); + 0, image->width); ly2 = CLAMP (gimp_item_height (item) + off_y, - 0, gimage->height); + 0, image->height); width = lx2 - lx1; height = ly2 - ly1; @@ -192,12 +192,12 @@ gimp_image_crop (GimpImage *gimage, -(lx1 - off_x), -(ly1 - off_y)); else - gimp_image_remove_layer (gimage, GIMP_LAYER (item)); + gimp_image_remove_layer (image, GIMP_LAYER (item)); } } /* Reposition or remove all guides */ - list = gimage->guides; + list = image->guides; while (list) { GimpGuide *guide = list->data; @@ -225,13 +225,13 @@ gimp_image_crop (GimpImage *gimage, } if (remove_guide) - gimp_image_remove_guide (gimage, guide, TRUE); + gimp_image_remove_guide (image, guide, TRUE); else if (new_position != guide->position) - gimp_image_move_guide (gimage, guide, new_position, TRUE); + gimp_image_move_guide (image, guide, new_position, TRUE); } /* Reposition or remove sample points */ - list = gimage->sample_points; + list = image->sample_points; while (list) { GimpSamplePoint *sample_point = list->data; @@ -250,25 +250,25 @@ gimp_image_crop (GimpImage *gimage, remove_sample_point = TRUE; if (remove_sample_point) - gimp_image_remove_sample_point (gimage, sample_point, TRUE); + gimp_image_remove_sample_point (image, sample_point, TRUE); else if (new_x != sample_point->x || new_y != sample_point->y) - gimp_image_move_sample_point (gimage, sample_point, + gimp_image_move_sample_point (image, sample_point, new_x, new_y, TRUE); } - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_image_update (gimage, 0, 0, gimage->width, gimage->height); + gimp_image_update (image, 0, 0, image->width, image->height); - gimp_viewable_size_changed (GIMP_VIEWABLE (gimage)); - g_object_thaw_notify (G_OBJECT (gimage)); + gimp_viewable_size_changed (GIMP_VIEWABLE (image)); + g_object_thaw_notify (G_OBJECT (image)); } - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); } gboolean -gimp_image_crop_auto_shrink (GimpImage *gimage, +gimp_image_crop_auto_shrink (GimpImage *image, gint x1, gint y1, gint x2, @@ -292,14 +292,14 @@ gimp_image_crop_auto_shrink (GimpImage *gimage, gint x, y, abort; gboolean retval = FALSE; - g_return_val_if_fail (gimage != NULL, FALSE); - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (image != NULL, FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (shrunk_x1 != NULL, FALSE); g_return_val_if_fail (shrunk_y1 != NULL, FALSE); g_return_val_if_fail (shrunk_x2 != NULL, FALSE); g_return_val_if_fail (shrunk_y2 != NULL, FALSE); - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); /* You should always keep in mind that crop->tx2 and crop->ty2 are the NOT the coordinates of the bottomright corner of the area to be cropped. They point @@ -308,7 +308,7 @@ gimp_image_crop_auto_shrink (GimpImage *gimage, if (active_drawable_only) { - active_drawable = gimp_image_active_drawable (gimage); + active_drawable = gimp_image_active_drawable (image); if (! active_drawable) goto FINISH; @@ -317,7 +317,7 @@ gimp_image_crop_auto_shrink (GimpImage *gimage, } else { - pickable = GIMP_PICKABLE (gimage->projection); + pickable = GIMP_PICKABLE (image->projection); } gimp_pickable_flush (pickable); @@ -407,7 +407,7 @@ gimp_image_crop_auto_shrink (GimpImage *gimage, FINISH: g_free (buffer); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); return retval; } diff --git a/app/core/gimpimage-crop.h b/app/core/gimpimage-crop.h index 57a8223117..a48238fcd5 100644 --- a/app/core/gimpimage-crop.h +++ b/app/core/gimpimage-crop.h @@ -20,7 +20,7 @@ #define __GIMP_IMAGE_CROP_H__ -void gimp_image_crop (GimpImage *gimage, +void gimp_image_crop (GimpImage *image, GimpContext *context, gint x1, gint y1, @@ -29,7 +29,7 @@ void gimp_image_crop (GimpImage *gimage, gboolean active_layer_only, gboolean crop_layers); -gboolean gimp_image_crop_auto_shrink (GimpImage *gimage, +gboolean gimp_image_crop_auto_shrink (GimpImage *image, gint x1, gint y1, gint x2, diff --git a/app/core/gimpimage-duplicate.c b/app/core/gimpimage-duplicate.c index fbbcb3f7ba..257f895f1c 100644 --- a/app/core/gimpimage-duplicate.c +++ b/app/core/gimpimage-duplicate.c @@ -43,9 +43,9 @@ GimpImage * -gimp_image_duplicate (GimpImage *gimage) +gimp_image_duplicate (GimpImage *image) { - GimpImage *new_gimage; + GimpImage *new_image; GimpLayer *floating_layer; GList *list; GimpLayer *active_layer = NULL; @@ -55,31 +55,31 @@ gimp_image_duplicate (GimpImage *gimage) GimpDrawable *floating_sel_drawable = NULL; gint count; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - gimp_set_busy_until_idle (gimage->gimp); + gimp_set_busy_until_idle (image->gimp); /* Create a new image */ - new_gimage = gimp_create_image (gimage->gimp, - gimage->width, gimage->height, - gimage->base_type, + new_image = gimp_create_image (image->gimp, + image->width, image->height, + image->base_type, FALSE); - gimp_image_undo_disable (new_gimage); + gimp_image_undo_disable (new_image); /* Copy the colormap if necessary */ - if (new_gimage->base_type == GIMP_INDEXED) - gimp_image_set_colormap (new_gimage, - gimp_image_get_colormap (gimage), - gimp_image_get_colormap_size (gimage), + if (new_image->base_type == GIMP_INDEXED) + gimp_image_set_colormap (new_image, + gimp_image_get_colormap (image), + gimp_image_get_colormap_size (image), FALSE); /* Copy resolution information */ - new_gimage->xresolution = gimage->xresolution; - new_gimage->yresolution = gimage->yresolution; - new_gimage->resolution_unit = gimage->resolution_unit; + new_image->xresolution = image->xresolution; + new_image->yresolution = image->yresolution; + new_image->resolution_unit = image->resolution_unit; /* Copy floating layer */ - floating_layer = gimp_image_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (image); if (floating_layer) { floating_sel_relax (floating_layer, FALSE); @@ -89,7 +89,7 @@ gimp_image_duplicate (GimpImage *gimage) } /* Copy the layers */ - for (list = GIMP_LIST (gimage->layers)->list, count = 0; + for (list = GIMP_LIST (image->layers)->list, count = 0; list; list = g_list_next (list)) { @@ -97,7 +97,7 @@ gimp_image_duplicate (GimpImage *gimage) GimpLayer *new_layer; new_layer = GIMP_LAYER (gimp_item_convert (GIMP_ITEM (layer), - new_gimage, + new_image, G_TYPE_FROM_INSTANCE (layer), FALSE)); @@ -112,21 +112,21 @@ gimp_image_duplicate (GimpImage *gimage) gimp_object_set_name (GIMP_OBJECT (new_layer->mask), gimp_object_get_name (GIMP_OBJECT (layer->mask))); - if (gimp_image_get_active_layer (gimage) == layer) + if (gimp_image_get_active_layer (image) == layer) active_layer = new_layer; - if (gimage->floating_sel == layer) + if (image->floating_sel == layer) floating_layer = new_layer; if (floating_sel_drawable == GIMP_DRAWABLE (layer)) new_floating_sel_drawable = GIMP_DRAWABLE (new_layer); if (floating_layer != new_layer) - gimp_image_add_layer (new_gimage, new_layer, count++); + gimp_image_add_layer (new_image, new_layer, count++); } /* Copy the channels */ - for (list = GIMP_LIST (gimage->channels)->list, count = 0; + for (list = GIMP_LIST (image->channels)->list, count = 0; list; list = g_list_next (list)) { @@ -135,7 +135,7 @@ gimp_image_duplicate (GimpImage *gimage) new_channel = GIMP_CHANNEL (gimp_item_convert (GIMP_ITEM (channel), - new_gimage, + new_image, G_TYPE_FROM_INSTANCE (channel), FALSE)); @@ -143,17 +143,17 @@ gimp_image_duplicate (GimpImage *gimage) gimp_object_set_name (GIMP_OBJECT (new_channel), gimp_object_get_name (GIMP_OBJECT (channel))); - if (gimp_image_get_active_channel (gimage) == channel) + if (gimp_image_get_active_channel (image) == channel) active_channel = (new_channel); if (floating_sel_drawable == GIMP_DRAWABLE (channel)) new_floating_sel_drawable = GIMP_DRAWABLE (new_channel); - gimp_image_add_channel (new_gimage, new_channel, count++); + gimp_image_add_channel (new_image, new_channel, count++); } /* Copy any vectors */ - for (list = GIMP_LIST (gimage->vectors)->list, count = 0; + for (list = GIMP_LIST (image->vectors)->list, count = 0; list; list = g_list_next (list)) { @@ -162,7 +162,7 @@ gimp_image_duplicate (GimpImage *gimage) new_vectors = GIMP_VECTORS (gimp_item_convert (GIMP_ITEM (vectors), - new_gimage, + new_image, G_TYPE_FROM_INSTANCE (vectors), FALSE)); @@ -170,10 +170,10 @@ gimp_image_duplicate (GimpImage *gimage) gimp_object_set_name (GIMP_OBJECT (new_vectors), gimp_object_get_name (GIMP_OBJECT (vectors))); - if (gimp_image_get_active_vectors (gimage) == vectors) + if (gimp_image_get_active_vectors (image) == vectors) active_vectors = new_vectors; - gimp_image_add_vectors (new_gimage, new_vectors, count++); + gimp_image_add_vectors (new_image, new_vectors, count++); } /* Copy the selection mask */ @@ -182,18 +182,18 @@ gimp_image_duplicate (GimpImage *gimage) TileManager *dest_tiles; PixelRegion srcPR, destPR; - src_tiles = gimp_drawable_data (GIMP_DRAWABLE (gimage->selection_mask)); - dest_tiles = gimp_drawable_data (GIMP_DRAWABLE (new_gimage->selection_mask)); + src_tiles = gimp_drawable_data (GIMP_DRAWABLE (image->selection_mask)); + dest_tiles = gimp_drawable_data (GIMP_DRAWABLE (new_image->selection_mask)); pixel_region_init (&srcPR, src_tiles, - 0, 0, gimage->width, gimage->height, FALSE); + 0, 0, image->width, image->height, FALSE); pixel_region_init (&destPR, dest_tiles, - 0, 0, gimage->width, gimage->height, TRUE); + 0, 0, image->width, image->height, TRUE); copy_region (&srcPR, &destPR); - new_gimage->selection_mask->bounds_known = FALSE; - new_gimage->selection_mask->boundary_known = FALSE; + new_image->selection_mask->bounds_known = FALSE; + new_image->selection_mask->boundary_known = FALSE; } if (floating_layer) @@ -201,34 +201,34 @@ gimp_image_duplicate (GimpImage *gimage) /* Set active layer, active channel, active vectors */ if (active_layer) - gimp_image_set_active_layer (new_gimage, active_layer); + gimp_image_set_active_layer (new_image, active_layer); if (active_channel) - gimp_image_set_active_channel (new_gimage, active_channel); + gimp_image_set_active_channel (new_image, active_channel); if (active_vectors) - gimp_image_set_active_vectors (new_gimage, active_vectors); + gimp_image_set_active_vectors (new_image, active_vectors); /* Copy state of all color channels */ for (count = 0; count < MAX_CHANNELS; count++) { - new_gimage->visible[count] = gimage->visible[count]; - new_gimage->active[count] = gimage->active[count]; + new_image->visible[count] = image->visible[count]; + new_image->active[count] = image->active[count]; } /* Copy any guides */ - for (list = gimage->guides; list; list = g_list_next (list)) + for (list = image->guides; list; list = g_list_next (list)) { GimpGuide *guide = list->data; switch (guide->orientation) { case GIMP_ORIENTATION_HORIZONTAL: - gimp_image_add_hguide (new_gimage, guide->position, FALSE); + gimp_image_add_hguide (new_image, guide->position, FALSE); break; case GIMP_ORIENTATION_VERTICAL: - gimp_image_add_vguide (new_gimage, guide->position, FALSE); + gimp_image_add_vguide (new_image, guide->position, FALSE); break; default: @@ -237,33 +237,33 @@ gimp_image_duplicate (GimpImage *gimage) } /* Copy any sample points */ - for (list = gimage->sample_points; list; list = g_list_next (list)) + for (list = image->sample_points; list; list = g_list_next (list)) { GimpSamplePoint *sample_point = list->data; - gimp_image_add_sample_point_at_pos (new_gimage, + gimp_image_add_sample_point_at_pos (new_image, sample_point->x, sample_point->y, FALSE); } /* Copy the grid */ - if (gimage->grid) - gimp_image_set_grid (new_gimage, gimage->grid, FALSE); + if (image->grid) + gimp_image_set_grid (new_image, image->grid, FALSE); /* Copy the quick mask info */ - new_gimage->quick_mask_state = gimage->quick_mask_state; - new_gimage->quick_mask_inverted = gimage->quick_mask_inverted; - new_gimage->quick_mask_color = gimage->quick_mask_color; + new_image->quick_mask_state = image->quick_mask_state; + new_image->quick_mask_inverted = image->quick_mask_inverted; + new_image->quick_mask_color = image->quick_mask_color; /* Copy parasites */ - if (gimage->parasites) + if (image->parasites) { - g_object_unref (new_gimage->parasites); - new_gimage->parasites = gimp_parasite_list_copy (gimage->parasites); + g_object_unref (new_image->parasites); + new_image->parasites = gimp_parasite_list_copy (image->parasites); } - gimp_image_undo_enable (new_gimage); + gimp_image_undo_enable (new_image); - return new_gimage; + return new_image; } diff --git a/app/core/gimpimage-duplicate.h b/app/core/gimpimage-duplicate.h index c27260c180..136ef00e59 100644 --- a/app/core/gimpimage-duplicate.h +++ b/app/core/gimpimage-duplicate.h @@ -20,7 +20,7 @@ #define __GIMP_IMAGE_DUPLICATE_H__ -GimpImage * gimp_image_duplicate (GimpImage *gimage); +GimpImage * gimp_image_duplicate (GimpImage *image); #endif /* __GIMP_IMAGE_DUPLICATE_H__ */ diff --git a/app/core/gimpimage-flip.c b/app/core/gimpimage-flip.c index 88bf249cc5..e15484d4e7 100644 --- a/app/core/gimpimage-flip.c +++ b/app/core/gimpimage-flip.c @@ -36,7 +36,7 @@ void -gimp_image_flip (GimpImage *gimage, +gimp_image_flip (GimpImage *image, GimpContext *context, GimpOrientationType flip_type, GimpProgress *progress) @@ -47,20 +47,20 @@ gimp_image_flip (GimpImage *gimage, gdouble progress_max; gdouble progress_current = 1.0; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); switch (flip_type) { case GIMP_ORIENTATION_HORIZONTAL: - axis = (gdouble) gimage->width / 2.0; + axis = (gdouble) image->width / 2.0; break; case GIMP_ORIENTATION_VERTICAL: - axis = (gdouble) gimage->height / 2.0; + axis = (gdouble) image->height / 2.0; break; default: @@ -68,15 +68,15 @@ gimp_image_flip (GimpImage *gimage, return; } - progress_max = (gimage->channels->num_children + - gimage->layers->num_children + - gimage->vectors->num_children + + progress_max = (image->channels->num_children + + image->layers->num_children + + image->vectors->num_children + 1 /* selection */); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_FLIP, NULL); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_FLIP, NULL); /* Flip all channels */ - for (list = GIMP_LIST (gimage->channels)->list; + for (list = GIMP_LIST (image->channels)->list; list; list = g_list_next (list)) { @@ -89,7 +89,7 @@ gimp_image_flip (GimpImage *gimage, } /* Flip all vectors */ - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { @@ -102,14 +102,14 @@ gimp_image_flip (GimpImage *gimage, } /* Don't forget the selection mask! */ - gimp_item_flip (GIMP_ITEM (gimp_image_get_mask (gimage)), context, + gimp_item_flip (GIMP_ITEM (gimp_image_get_mask (image)), context, flip_type, axis, TRUE); if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); /* Flip all layers */ - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -122,7 +122,7 @@ gimp_image_flip (GimpImage *gimage, } /* Flip all Guides */ - for (list = gimage->guides; list; list = g_list_next (list)) + for (list = image->guides; list; list = g_list_next (list)) { GimpGuide *guide = list->data; @@ -130,14 +130,14 @@ gimp_image_flip (GimpImage *gimage, { case GIMP_ORIENTATION_HORIZONTAL: if (flip_type == GIMP_ORIENTATION_VERTICAL) - gimp_image_move_guide (gimage, guide, - gimage->height - guide->position, TRUE); + gimp_image_move_guide (image, guide, + image->height - guide->position, TRUE); break; case GIMP_ORIENTATION_VERTICAL: if (flip_type == GIMP_ORIENTATION_HORIZONTAL) - gimp_image_move_guide (gimage, guide, - gimage->width - guide->position, TRUE); + gimp_image_move_guide (image, guide, + image->width - guide->position, TRUE); break; default: @@ -146,24 +146,24 @@ gimp_image_flip (GimpImage *gimage, } /* Flip all sample points */ - for (list = gimage->sample_points; list; list = g_list_next (list)) + for (list = image->sample_points; list; list = g_list_next (list)) { GimpSamplePoint *sample_point = list->data; if (flip_type == GIMP_ORIENTATION_VERTICAL) - gimp_image_move_sample_point (gimage, sample_point, + gimp_image_move_sample_point (image, sample_point, sample_point->x, - gimage->height - sample_point->y, + image->height - sample_point->y, TRUE); if (flip_type == GIMP_ORIENTATION_HORIZONTAL) - gimp_image_move_sample_point (gimage, sample_point, - gimage->width - sample_point->x, + gimp_image_move_sample_point (image, sample_point, + image->width - sample_point->x, sample_point->y, TRUE); } - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); } diff --git a/app/core/gimpimage-flip.h b/app/core/gimpimage-flip.h index a107545eb4..dbb6b7020b 100644 --- a/app/core/gimpimage-flip.h +++ b/app/core/gimpimage-flip.h @@ -20,7 +20,7 @@ #define __GIMP_IMAGE_FLIP_H__ -void gimp_image_flip (GimpImage *gimage, +void gimp_image_flip (GimpImage *image, GimpContext *context, GimpOrientationType flip_type, GimpProgress *progress); diff --git a/app/core/gimpimage-grid.c b/app/core/gimpimage-grid.c index 7a8114474a..0efd9c80fa 100644 --- a/app/core/gimpimage-grid.c +++ b/app/core/gimpimage-grid.c @@ -36,26 +36,26 @@ GimpGrid * -gimp_image_get_grid (GimpImage *gimage) +gimp_image_get_grid (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->grid; + return image->grid; } void -gimp_image_set_grid (GimpImage *gimage, +gimp_image_set_grid (GimpImage *image, GimpGrid *grid, gboolean push_undo) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_GRID (grid)); - if (gimp_config_is_equal_to (GIMP_CONFIG (gimage->grid), GIMP_CONFIG (grid))) + if (gimp_config_is_equal_to (GIMP_CONFIG (image->grid), GIMP_CONFIG (grid))) return; if (push_undo) - gimp_image_undo_push_image_grid (gimage, _("Grid"), gimage->grid); + gimp_image_undo_push_image_grid (image, _("Grid"), image->grid); - gimp_config_sync (G_OBJECT (grid), G_OBJECT (gimage->grid), 0); + gimp_config_sync (G_OBJECT (grid), G_OBJECT (image->grid), 0); } diff --git a/app/core/gimpimage-grid.h b/app/core/gimpimage-grid.h index 8fac6a5098..920225562e 100644 --- a/app/core/gimpimage-grid.h +++ b/app/core/gimpimage-grid.h @@ -23,8 +23,8 @@ #define __GIMP_IMAGE_GRID_H__ -GimpGrid * gimp_image_get_grid (GimpImage *gimage); -void gimp_image_set_grid (GimpImage *gimage, +GimpGrid * gimp_image_get_grid (GimpImage *image); +void gimp_image_set_grid (GimpImage *image, GimpGrid *grid, gboolean push_undo); diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index 8b741017ef..de1ed57a69 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -33,54 +33,54 @@ /* public functions */ GimpGuide * -gimp_image_add_hguide (GimpImage *gimage, +gimp_image_add_hguide (GimpImage *image, gint position, gboolean push_undo) { GimpGuide *guide; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); - g_return_val_if_fail (position >= 0 && position <= gimage->height, NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); + g_return_val_if_fail (position >= 0 && position <= image->height, NULL); guide = g_new0 (GimpGuide, 1); guide->ref_count = 1; guide->position = -1; guide->orientation = GIMP_ORIENTATION_HORIZONTAL; - guide->guide_ID = gimage->gimp->next_guide_ID++; + guide->guide_ID = image->gimp->next_guide_ID++; if (push_undo) - gimp_image_undo_push_image_guide (gimage, _("Add Horizontal Guide"), + gimp_image_undo_push_image_guide (image, _("Add Horizontal Guide"), guide); - gimp_image_add_guide (gimage, guide, position); + gimp_image_add_guide (image, guide, position); gimp_image_guide_unref (guide); return guide; } GimpGuide * -gimp_image_add_vguide (GimpImage *gimage, +gimp_image_add_vguide (GimpImage *image, gint position, gboolean push_undo) { GimpGuide *guide; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); - g_return_val_if_fail (position >= 0 && position <= gimage->width, NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); + g_return_val_if_fail (position >= 0 && position <= image->width, NULL); guide = g_new0 (GimpGuide, 1); guide->ref_count = 1; guide->position = -1; guide->orientation = GIMP_ORIENTATION_VERTICAL; - guide->guide_ID = gimage->gimp->next_guide_ID++; + guide->guide_ID = image->gimp->next_guide_ID++; if (push_undo) - gimp_image_undo_push_image_guide (gimage, _("Add Vertical Guide"), + gimp_image_undo_push_image_guide (image, _("Add Vertical Guide"), guide); - gimp_image_add_guide (gimage, guide, position); + gimp_image_add_guide (image, guide, position); gimp_image_guide_unref (guide); return guide; @@ -108,78 +108,78 @@ gimp_image_guide_unref (GimpGuide *guide) } void -gimp_image_add_guide (GimpImage *gimage, +gimp_image_add_guide (GimpImage *image, GimpGuide *guide, gint position) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (guide != NULL); g_return_if_fail (position >= 0); if (guide->orientation == GIMP_ORIENTATION_HORIZONTAL) - g_return_if_fail (position <= gimage->height); + g_return_if_fail (position <= image->height); else - g_return_if_fail (position <= gimage->width); + g_return_if_fail (position <= image->width); - gimage->guides = g_list_prepend (gimage->guides, guide); + image->guides = g_list_prepend (image->guides, guide); guide->position = position; gimp_image_guide_ref (guide); - gimp_image_update_guide (gimage, guide); + gimp_image_update_guide (image, guide); } void -gimp_image_remove_guide (GimpImage *gimage, +gimp_image_remove_guide (GimpImage *image, GimpGuide *guide, gboolean push_undo) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (guide != NULL); - gimp_image_update_guide (gimage, guide); + gimp_image_update_guide (image, guide); if (push_undo) - gimp_image_undo_push_image_guide (gimage, _("Remove Guide"), guide); + gimp_image_undo_push_image_guide (image, _("Remove Guide"), guide); - gimage->guides = g_list_remove (gimage->guides, guide); + image->guides = g_list_remove (image->guides, guide); guide->position = -1; gimp_image_guide_unref (guide); } void -gimp_image_move_guide (GimpImage *gimage, +gimp_image_move_guide (GimpImage *image, GimpGuide *guide, gint position, gboolean push_undo) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (guide != NULL); g_return_if_fail (position >= 0); if (guide->orientation == GIMP_ORIENTATION_HORIZONTAL) - g_return_if_fail (position <= gimage->height); + g_return_if_fail (position <= image->height); else - g_return_if_fail (position <= gimage->width); + g_return_if_fail (position <= image->width); if (push_undo) - gimp_image_undo_push_image_guide (gimage, _("Move Guide"), guide); + gimp_image_undo_push_image_guide (image, _("Move Guide"), guide); - gimp_image_update_guide (gimage, guide); + gimp_image_update_guide (image, guide); guide->position = position; - gimp_image_update_guide (gimage, guide); + gimp_image_update_guide (image, guide); } GimpGuide * -gimp_image_get_guide (GimpImage *gimage, +gimp_image_get_guide (GimpImage *image, guint32 id) { GList *guides; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - for (guides = gimage->guides; guides; guides = g_list_next (guides)) + for (guides = image->guides; guides; guides = g_list_next (guides)) { GimpGuide *guide = guides->data; @@ -191,13 +191,13 @@ gimp_image_get_guide (GimpImage *gimage, } GimpGuide * -gimp_image_get_next_guide (GimpImage *gimage, +gimp_image_get_next_guide (GimpImage *image, guint32 id, gboolean *guide_found) { GList *guides; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (guide_found != NULL, NULL); if (id == 0) @@ -205,7 +205,7 @@ gimp_image_get_next_guide (GimpImage *gimage, else *guide_found = FALSE; - for (guides = gimage->guides; guides; guides = g_list_next (guides)) + for (guides = image->guides; guides; guides = g_list_next (guides)) { GimpGuide *guide = guides->data; @@ -223,7 +223,7 @@ gimp_image_get_next_guide (GimpImage *gimage, } GimpGuide * -gimp_image_find_guide (GimpImage *gimage, +gimp_image_find_guide (GimpImage *image, gdouble x, gdouble y, gdouble epsilon_x, @@ -235,18 +235,18 @@ gimp_image_find_guide (GimpImage *gimage, gdouble dist; gdouble mindist = G_MAXDOUBLE; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (epsilon_x > 0 && epsilon_y > 0, NULL); - if (x < 0 || x >= gimage->width || - y < 0 || y >= gimage->height) + if (x < 0 || x >= image->width || + y < 0 || y >= image->height) { return NULL; } - for (list = gimage->guides; list; list = g_list_next (list)) + for (list = image->guides; list; list = g_list_next (list)) { - guide = (GimpGuide *) list->data; + guide = list->data; if (guide->position < 0) continue; diff --git a/app/core/gimpimage-guides.h b/app/core/gimpimage-guides.h index 07c9924ff0..3f9ded6202 100644 --- a/app/core/gimpimage-guides.h +++ b/app/core/gimpimage-guides.h @@ -29,34 +29,34 @@ struct _GimpGuide }; -GimpGuide * gimp_image_add_hguide (GimpImage *gimage, +GimpGuide * gimp_image_add_hguide (GimpImage *image, gint position, gboolean push_undo); -GimpGuide * gimp_image_add_vguide (GimpImage *gimage, +GimpGuide * gimp_image_add_vguide (GimpImage *image, gint position, gboolean push_undo); GimpGuide * gimp_image_guide_ref (GimpGuide *guide); void gimp_image_guide_unref (GimpGuide *guide); -void gimp_image_add_guide (GimpImage *gimage, +void gimp_image_add_guide (GimpImage *image, GimpGuide *guide, gint position); -void gimp_image_remove_guide (GimpImage *gimage, +void gimp_image_remove_guide (GimpImage *image, GimpGuide *guide, gboolean push_undo); -void gimp_image_move_guide (GimpImage *gimage, +void gimp_image_move_guide (GimpImage *image, GimpGuide *guide, gint position, gboolean push_undo); -GimpGuide * gimp_image_get_guide (GimpImage *gimage, +GimpGuide * gimp_image_get_guide (GimpImage *image, guint32 id); -GimpGuide * gimp_image_get_next_guide (GimpImage *gimage, +GimpGuide * gimp_image_get_next_guide (GimpImage *image, guint32 id, gboolean *guide_found); -GimpGuide * gimp_image_find_guide (GimpImage *gimage, +GimpGuide * gimp_image_find_guide (GimpImage *image, gdouble x, gdouble y, gdouble epsilon_x, diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index ab99744a53..99b14d135b 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -54,7 +54,7 @@ /* public functions */ GimpLayer * -gimp_image_merge_visible_layers (GimpImage *gimage, +gimp_image_merge_visible_layers (GimpImage *image, GimpContext *context, GimpMergeType merge_type) { @@ -63,17 +63,17 @@ gimp_image_merge_visible_layers (GimpImage *gimage, gboolean had_floating_sel = FALSE; GimpLayer *layer = NULL; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); /* if there's a floating selection, anchor it */ - if (gimp_image_floating_sel (gimage)) + if (gimp_image_floating_sel (image)) { - floating_sel_anchor (gimage->floating_sel); + floating_sel_anchor (image->floating_sel); had_floating_sel = TRUE; } - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -85,13 +85,13 @@ gimp_image_merge_visible_layers (GimpImage *gimage, if (merge_list && merge_list->next) { - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); - layer = gimp_image_merge_layers (gimage, merge_list, context, merge_type, + layer = gimp_image_merge_layers (image, merge_list, context, merge_type, _("Merge Visible Layers")); g_slist_free (merge_list); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); return layer; } @@ -102,7 +102,7 @@ gimp_image_merge_visible_layers (GimpImage *gimage, /* If there was a floating selection, we have done something. No need to warn the user. Return the active layer instead */ if (had_floating_sel) - return gimage->active_layer; + return image->active_layer; else g_message (_("Not enough visible layers for a merge. " "There must be at least two.")); @@ -112,23 +112,23 @@ gimp_image_merge_visible_layers (GimpImage *gimage, } GimpLayer * -gimp_image_flatten (GimpImage *gimage, +gimp_image_flatten (GimpImage *image, GimpContext *context) { GList *list; GSList *merge_list = NULL; GimpLayer *layer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); /* if there's a floating selection, anchor it */ - if (gimp_image_floating_sel (gimage)) - floating_sel_anchor (gimage->floating_sel); + if (gimp_image_floating_sel (image)) + floating_sel_anchor (image->floating_sel); - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -138,19 +138,19 @@ gimp_image_flatten (GimpImage *gimage, merge_list = g_slist_append (merge_list, layer); } - layer = gimp_image_merge_layers (gimage, merge_list, context, + layer = gimp_image_merge_layers (image, merge_list, context, GIMP_FLATTEN_IMAGE, _("Flatten Image")); g_slist_free (merge_list); - gimp_image_alpha_changed (gimage); + gimp_image_alpha_changed (image); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); return layer; } GimpLayer * -gimp_image_merge_down (GimpImage *gimage, +gimp_image_merge_down (GimpImage *image, GimpLayer *current_layer, GimpContext *context, GimpMergeType merge_type) @@ -159,10 +159,10 @@ gimp_image_merge_down (GimpImage *gimage, GList *layer_list; GSList *merge_list; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - for (list = GIMP_LIST (gimage->layers)->list, layer_list = NULL; + for (list = GIMP_LIST (image->layers)->list, layer_list = NULL; list && !layer_list; list = g_list_next (list)) { @@ -188,13 +188,13 @@ gimp_image_merge_down (GimpImage *gimage, merge_list = g_slist_prepend (merge_list, current_layer); - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); - layer = gimp_image_merge_layers (gimage, merge_list, context, merge_type, + layer = gimp_image_merge_layers (image, merge_list, context, merge_type, _("Merge Down")); g_slist_free (merge_list); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); return layer; } @@ -206,7 +206,7 @@ gimp_image_merge_down (GimpImage *gimage, } GimpLayer * -gimp_image_merge_layers (GimpImage *gimage, +gimp_image_merge_layers (GimpImage *image, GSList *merge_list, GimpContext *context, GimpMergeType merge_type, @@ -230,7 +230,7 @@ gimp_image_merge_layers (GimpImage *gimage, gint off_x, off_y; gchar *name; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); layer = NULL; @@ -271,10 +271,10 @@ gimp_image_merge_layers (GimpImage *gimage, } if (merge_type == GIMP_CLIP_TO_IMAGE) { - x1 = CLAMP (x1, 0, gimage->width); - y1 = CLAMP (y1, 0, gimage->height); - x2 = CLAMP (x2, 0, gimage->width); - y2 = CLAMP (y2, 0, gimage->height); + x1 = CLAMP (x1, 0, image->width); + y1 = CLAMP (y1, 0, image->height); + x2 = CLAMP (x2, 0, image->width); + y2 = CLAMP (y2, 0, image->height); } break; @@ -293,8 +293,8 @@ gimp_image_merge_layers (GimpImage *gimage, { x1 = 0; y1 = 0; - x2 = gimage->width; - y2 = gimage->height; + x2 = image->width; + y2 = image->height; } break; } @@ -309,7 +309,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* Start a merge undo group. */ - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_LAYERS_MERGE, undo_desc); name = g_strdup (gimp_object_get_name (GIMP_OBJECT (layer))); @@ -317,9 +317,9 @@ gimp_image_merge_layers (GimpImage *gimage, if (merge_type == GIMP_FLATTEN_IMAGE || gimp_drawable_type (GIMP_DRAWABLE (layer)) == GIMP_INDEXED_IMAGE) { - type = GIMP_IMAGE_TYPE_FROM_BASE_TYPE (gimp_image_base_type (gimage)); + type = GIMP_IMAGE_TYPE_FROM_BASE_TYPE (gimp_image_base_type (image)); - merge_layer = gimp_layer_new (gimage, (x2 - x1), (y2 - y1), + merge_layer = gimp_layer_new (image, (x2 - x1), (y2 - y1), type, gimp_object_get_name (GIMP_OBJECT (layer)), GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); @@ -333,14 +333,14 @@ gimp_image_merge_layers (GimpImage *gimage, GIMP_ITEM (merge_layer)->offset_y = y1; /* get the background for compositing */ - gimp_image_get_background (gimage, GIMP_DRAWABLE (merge_layer), + gimp_image_get_background (image, GIMP_DRAWABLE (merge_layer), context, bg); /* init the pixel region */ pixel_region_init (&src1PR, gimp_drawable_data (GIMP_DRAWABLE (merge_layer)), 0, 0, - gimage->width, gimage->height, + image->width, image->height, TRUE); /* set the region to the background color */ @@ -357,7 +357,7 @@ gimp_image_merge_layers (GimpImage *gimage, */ merge_layer = - gimp_layer_new (gimage, (x2 - x1), (y2 - y1), + gimp_layer_new (image, (x2 - x1), (y2 - y1), gimp_drawable_type_with_alpha (GIMP_DRAWABLE (layer)), "merged layer", GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); @@ -386,8 +386,8 @@ gimp_image_merge_layers (GimpImage *gimage, */ layer = reverse_list->data; position = - gimp_container_num_children (gimage->layers) - - gimp_container_get_child_index (gimage->layers, GIMP_OBJECT (layer)); + gimp_container_num_children (image->layers) - + gimp_container_get_child_index (image->layers, GIMP_OBJECT (layer)); } bottom_layer = layer; @@ -465,7 +465,7 @@ gimp_image_merge_layers (GimpImage *gimage, active, operation); - gimp_image_remove_layer (gimage, layer); + gimp_image_remove_layer (image, layer); reverse_list = g_slist_next (reverse_list); } @@ -475,22 +475,22 @@ gimp_image_merge_layers (GimpImage *gimage, /* if the type is flatten, remove all the remaining layers */ if (merge_type == GIMP_FLATTEN_IMAGE) { - list = GIMP_LIST (gimage->layers)->list; + list = GIMP_LIST (image->layers)->list; while (list) { layer = list->data; list = g_list_next (list); - gimp_image_remove_layer (gimage, layer); + gimp_image_remove_layer (image, layer); } - gimp_image_add_layer (gimage, merge_layer, position); + gimp_image_add_layer (image, merge_layer, position); } else { - /* Add the layer to the gimage */ - gimp_image_add_layer (gimage, merge_layer, - gimp_container_num_children (gimage->layers) - position + 1); + /* Add the layer to the image */ + gimp_image_add_layer (image, merge_layer, + gimp_container_num_children (image->layers) - position + 1); } /* set the name after the original layers have been removed so we @@ -502,7 +502,7 @@ gimp_image_merge_layers (GimpImage *gimage, gimp_item_set_visible (GIMP_ITEM (merge_layer), TRUE, TRUE); /* End the merge undo group */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); gimp_drawable_update (GIMP_DRAWABLE (merge_layer), 0, 0, @@ -515,7 +515,7 @@ gimp_image_merge_layers (GimpImage *gimage, /* merging vectors */ GimpVectors * -gimp_image_merge_visible_vectors (GimpImage *gimage) +gimp_image_merge_visible_vectors (GimpImage *image) { GList *list = NULL; GSList *merge_list = NULL; @@ -525,9 +525,9 @@ gimp_image_merge_visible_vectors (GimpImage *gimage) gchar *name = NULL; gint pos = 0; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { @@ -539,9 +539,9 @@ gimp_image_merge_visible_vectors (GimpImage *gimage) if (merge_list && merge_list->next) { - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE, _("Merge Visible Paths")); cur_item = merge_list; @@ -552,15 +552,15 @@ gimp_image_merge_visible_vectors (GimpImage *gimage) gimp_item_duplicate (GIMP_ITEM (vectors), GIMP_TYPE_VECTORS, FALSE)); - pos = gimp_image_get_vectors_index (gimage, vectors); - gimp_image_remove_vectors (gimage, vectors); + pos = gimp_image_get_vectors_index (image, vectors); + gimp_image_remove_vectors (image, vectors); cur_item = cur_item->next; while (cur_item) { vectors = GIMP_VECTORS (cur_item->data); gimp_vectors_add_strokes (vectors, target_vectors); - gimp_image_remove_vectors (gimage, vectors); + gimp_image_remove_vectors (image, vectors); cur_item = g_slist_next (cur_item); } @@ -570,10 +570,10 @@ gimp_image_merge_visible_vectors (GimpImage *gimage) g_slist_free (merge_list); - gimp_image_add_vectors (gimage, target_vectors, pos); - gimp_unset_busy (gimage->gimp); + gimp_image_add_vectors (image, target_vectors, pos); + gimp_unset_busy (image->gimp); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return target_vectors; } diff --git a/app/core/gimpimage-merge.h b/app/core/gimpimage-merge.h index 7af5a4e710..0bb55fdcb0 100644 --- a/app/core/gimpimage-merge.h +++ b/app/core/gimpimage-merge.h @@ -20,21 +20,21 @@ #define __GIMP_IMAGE_MERGE_H__ -GimpLayer * gimp_image_merge_visible_layers (GimpImage *gimage, +GimpLayer * gimp_image_merge_visible_layers (GimpImage *image, GimpContext *context, GimpMergeType merge_type); -GimpLayer * gimp_image_merge_down (GimpImage *gimage, +GimpLayer * gimp_image_merge_down (GimpImage *image, GimpLayer *current_layer, GimpContext *context, GimpMergeType merge_type); -GimpLayer * gimp_image_flatten (GimpImage *gimage, +GimpLayer * gimp_image_flatten (GimpImage *image, GimpContext *context); -GimpLayer * gimp_image_merge_layers (GimpImage *gimage, +GimpLayer * gimp_image_merge_layers (GimpImage *image, GSList *merge_list, GimpContext *context, GimpMergeType merge_type, const gchar *undo_desc); -GimpVectors * gimp_image_merge_visible_vectors (GimpImage *gimage); +GimpVectors * gimp_image_merge_visible_vectors (GimpImage *image); #endif /* __GIMP_IMAGE_MERGE_H__ */ diff --git a/app/core/gimpimage-new.c b/app/core/gimpimage-new.c index a0c8c305df..bcdd5871ec 100644 --- a/app/core/gimpimage-new.c +++ b/app/core/gimpimage-new.c @@ -34,17 +34,17 @@ GimpTemplate * gimp_image_new_get_last_template (Gimp *gimp, - GimpImage *gimage) + GimpImage *image) { GimpTemplate *template; g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); - g_return_val_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (image == NULL || GIMP_IS_IMAGE (image), NULL); template = gimp_template_new ("image new values"); - if (gimage) - gimp_template_set_from_image (template, gimage); + if (image) + gimp_template_set_from_image (template, image); else gimp_config_sync (G_OBJECT (gimp->image_new_last_template), G_OBJECT (template), 0); diff --git a/app/core/gimpimage-new.h b/app/core/gimpimage-new.h index eb151f5b90..6bca970724 100644 --- a/app/core/gimpimage-new.h +++ b/app/core/gimpimage-new.h @@ -21,7 +21,7 @@ GimpTemplate * gimp_image_new_get_last_template (Gimp *gimp, - GimpImage *gimage); + GimpImage *image); void gimp_image_new_set_last_template (Gimp *gimp, GimpTemplate *template); diff --git a/app/core/gimpimage-pick-color.c b/app/core/gimpimage-pick-color.c index 8ebd4772d5..7fb9cc9c95 100644 --- a/app/core/gimpimage-pick-color.c +++ b/app/core/gimpimage-pick-color.c @@ -29,7 +29,7 @@ gboolean -gimp_image_pick_color (GimpImage *gimage, +gimp_image_pick_color (GimpImage *image, GimpDrawable *drawable, gint x, gint y, @@ -42,16 +42,16 @@ gimp_image_pick_color (GimpImage *gimage, { GimpPickable *pickable; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), FALSE); g_return_val_if_fail (drawable == NULL || - gimp_item_get_image (GIMP_ITEM (drawable)) == gimage, + gimp_item_get_image (GIMP_ITEM (drawable)) == image, FALSE); if (! sample_merged) { if (! drawable) - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); if (! drawable) return FALSE; @@ -59,7 +59,7 @@ gimp_image_pick_color (GimpImage *gimage, if (sample_merged) { - pickable = GIMP_PICKABLE (gimage->projection); + pickable = GIMP_PICKABLE (image->projection); } else { diff --git a/app/core/gimpimage-pick-color.h b/app/core/gimpimage-pick-color.h index 211f12dd58..887b7537ee 100644 --- a/app/core/gimpimage-pick-color.h +++ b/app/core/gimpimage-pick-color.h @@ -20,7 +20,7 @@ #define __GIMP_IMAGE_PICK_COLOR_H__ -gboolean gimp_image_pick_color (GimpImage *gimage, +gboolean gimp_image_pick_color (GimpImage *image, GimpDrawable *drawable, gint x, gint y, diff --git a/app/core/gimpimage-preview.c b/app/core/gimpimage-preview.c index 3f46f28046..7f7b83f8de 100644 --- a/app/core/gimpimage-preview.c +++ b/app/core/gimpimage-preview.c @@ -47,22 +47,22 @@ gimp_image_get_preview_size (GimpViewable *viewable, gint *width, gint *height) { - GimpImage *gimage = GIMP_IMAGE (viewable); + GimpImage *image = GIMP_IMAGE (viewable); - if (! gimage->gimp->config->layer_previews && ! is_popup) + if (! image->gimp->config->layer_previews && ! is_popup) { *width = size; *height = size; return; } - gimp_viewable_calc_preview_size (gimage->width, - gimage->height, + gimp_viewable_calc_preview_size (image->width, + image->height, size, size, dot_for_dot, - gimage->xresolution, - gimage->yresolution, + image->xresolution, + image->yresolution, width, height, NULL); @@ -76,17 +76,17 @@ gimp_image_get_popup_size (GimpViewable *viewable, gint *popup_width, gint *popup_height) { - GimpImage *gimage = GIMP_IMAGE (viewable); + GimpImage *image = GIMP_IMAGE (viewable); - if (! gimage->gimp->config->layer_previews) + if (! image->gimp->config->layer_previews) return FALSE; - if (gimage->width > width || gimage->height > height) + if (image->width > width || image->height > height) { gboolean scaling_up; - gimp_viewable_calc_preview_size (gimage->width, - gimage->height, + gimp_viewable_calc_preview_size (image->width, + image->height, width * 2, height * 2, dot_for_dot, 1.0, 1.0, @@ -96,8 +96,8 @@ gimp_image_get_popup_size (GimpViewable *viewable, if (scaling_up) { - *popup_width = gimage->width; - *popup_height = gimage->height; + *popup_width = image->width; + *popup_height = image->height; } return TRUE; @@ -111,34 +111,34 @@ gimp_image_get_preview (GimpViewable *viewable, gint width, gint height) { - GimpImage *gimage = GIMP_IMAGE (viewable); + GimpImage *image = GIMP_IMAGE (viewable); - if (! gimage->gimp->config->layer_previews) + if (! image->gimp->config->layer_previews) return NULL; - if (gimage->comp_preview_valid && - gimage->comp_preview->width == width && - gimage->comp_preview->height == height) + if (image->comp_preview_valid && + image->comp_preview->width == width && + image->comp_preview->height == height) { /* The easy way */ - return gimage->comp_preview; + return image->comp_preview; } else { /* The hard way */ - if (gimage->comp_preview) - temp_buf_free (gimage->comp_preview); + if (image->comp_preview) + temp_buf_free (image->comp_preview); /* Actually construct the composite preview from the layer previews! * This might seem ridiculous, but it's actually the best way, given * a number of unsavory alternatives. */ - gimage->comp_preview = gimp_image_get_new_preview (viewable, + image->comp_preview = gimp_image_get_new_preview (viewable, width, height); - gimage->comp_preview_valid = TRUE; + image->comp_preview_valid = TRUE; - return gimage->comp_preview; + return image->comp_preview; } } @@ -147,7 +147,7 @@ gimp_image_get_new_preview (GimpViewable *viewable, gint width, gint height) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpLayer *floating_sel; PixelRegion src1PR, src2PR, maskPR; @@ -165,14 +165,14 @@ gimp_image_get_new_preview (GimpViewable *viewable, gboolean visible_components[MAX_CHANNELS] = { TRUE, TRUE, TRUE, TRUE }; gint off_x, off_y; - gimage = GIMP_IMAGE (viewable); + image = GIMP_IMAGE (viewable); - if (! gimage->gimp->config->layer_previews) + if (! image->gimp->config->layer_previews) return NULL; - ratio = (gdouble) width / (gdouble) gimage->width; + ratio = (gdouble) width / (gdouble) image->width; - switch (gimp_image_base_type (gimage)) + switch (gimp_image_base_type (image)) { case GIMP_RGB: case GIMP_INDEXED: @@ -193,7 +193,7 @@ gimp_image_get_new_preview (GimpViewable *viewable, floating_sel = NULL; - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -238,7 +238,7 @@ gimp_image_get_new_preview (GimpViewable *viewable, gimp_item_width (GIMP_ITEM (layer)), gimp_item_height (GIMP_ITEM (layer)), -off_x, -off_y, - gimage->width, gimage->height, + image->width, image->height, &src_x, &src_y, &src_width, &src_height)) { diff --git a/app/core/gimpimage-quick-mask.c b/app/core/gimpimage-quick-mask.c index 8fb996ba54..90d30cac11 100644 --- a/app/core/gimpimage-quick-mask.c +++ b/app/core/gimpimage-quick-mask.c @@ -40,46 +40,46 @@ /* public functions */ void -gimp_image_set_quick_mask_state (GimpImage *gimage, +gimp_image_set_quick_mask_state (GimpImage *image, gboolean quick_mask_state) { GimpChannel *selection; GimpChannel *mask; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - if (quick_mask_state == gimage->quick_mask_state) + if (quick_mask_state == image->quick_mask_state) return; /* set image->quick_mask_state early so we can return early when * being called recursively */ - gimage->quick_mask_state = quick_mask_state ? TRUE : FALSE; + image->quick_mask_state = quick_mask_state ? TRUE : FALSE; - selection = gimp_image_get_mask (gimage); - mask = gimp_image_get_quick_mask (gimage); + selection = gimp_image_get_mask (image); + mask = gimp_image_get_quick_mask (image); if (quick_mask_state) { if (! mask) { - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, _("Enable Quick Mask")); if (gimp_channel_is_empty (selection)) { /* if no selection */ - GimpLayer *floating_sel = gimp_image_floating_sel (gimage); + GimpLayer *floating_sel = gimp_image_floating_sel (image); if (floating_sel) floating_sel_to_layer (floating_sel); - mask = gimp_channel_new (gimage, - gimage->width, - gimage->height, + mask = gimp_channel_new (image, + image->width, + image->height, GIMP_IMAGE_QUICK_MASK_NAME, - &gimage->quick_mask_color); + &image->quick_mask_color); /* Clear the mask */ gimp_channel_clear (mask, NULL, FALSE); @@ -95,97 +95,97 @@ gimp_image_set_quick_mask_state (GimpImage *gimage, /* Clear the selection */ gimp_channel_clear (selection, NULL, TRUE); - gimp_channel_set_color (mask, &gimage->quick_mask_color, FALSE); + gimp_channel_set_color (mask, &image->quick_mask_color, FALSE); gimp_item_rename (GIMP_ITEM (mask), GIMP_IMAGE_QUICK_MASK_NAME); } - if (gimage->quick_mask_inverted) + if (image->quick_mask_inverted) gimp_channel_invert (mask, FALSE); - gimp_image_add_channel (gimage, mask, 0); + gimp_image_add_channel (image, mask, 0); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } } else { if (mask) { - GimpLayer *floating_sel = gimp_image_floating_sel (gimage); + GimpLayer *floating_sel = gimp_image_floating_sel (image); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, _("Disable Quick Mask")); - if (gimage->quick_mask_inverted) + if (image->quick_mask_inverted) gimp_channel_invert (mask, TRUE); if (floating_sel && floating_sel->fs.drawable == GIMP_DRAWABLE (mask)) floating_sel_anchor (floating_sel); - gimp_selection_load (gimp_image_get_mask (gimage), mask); - gimp_image_remove_channel (gimage, mask); + gimp_selection_load (gimp_image_get_mask (image), mask); + gimp_image_remove_channel (image, mask); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } } - gimp_image_quick_mask_changed (gimage); + gimp_image_quick_mask_changed (image); } gboolean -gimp_image_get_quick_mask_state (const GimpImage *gimage) +gimp_image_get_quick_mask_state (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - return gimage->quick_mask_state; + return image->quick_mask_state; } void -gimp_image_set_quick_mask_color (GimpImage *gimage, +gimp_image_set_quick_mask_color (GimpImage *image, const GimpRGB *color) { GimpChannel *quick_mask; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (color != NULL); - gimage->quick_mask_color = *color; + image->quick_mask_color = *color; - quick_mask = gimp_image_get_quick_mask (gimage); + quick_mask = gimp_image_get_quick_mask (image); if (quick_mask) gimp_channel_set_color (quick_mask, color, TRUE); } void -gimp_image_get_quick_mask_color (const GimpImage *gimage, +gimp_image_get_quick_mask_color (const GimpImage *image, GimpRGB *color) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (color != NULL); - *color = gimage->quick_mask_color; + *color = image->quick_mask_color; } GimpChannel * -gimp_image_get_quick_mask (const GimpImage *gimage) +gimp_image_get_quick_mask (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimp_image_get_channel_by_name (gimage, GIMP_IMAGE_QUICK_MASK_NAME); + return gimp_image_get_channel_by_name (image, GIMP_IMAGE_QUICK_MASK_NAME); } void -gimp_image_quick_mask_invert (GimpImage *gimage) +gimp_image_quick_mask_invert (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - if (gimage->quick_mask_state) + if (image->quick_mask_state) { - GimpChannel *quick_mask = gimp_image_get_quick_mask (gimage); + GimpChannel *quick_mask = gimp_image_get_quick_mask (image); if (quick_mask) gimp_channel_invert (quick_mask, TRUE); } - gimage->quick_mask_inverted = ! gimage->quick_mask_inverted; + image->quick_mask_inverted = ! image->quick_mask_inverted; } diff --git a/app/core/gimpimage-quick-mask.h b/app/core/gimpimage-quick-mask.h index 4d07f834c2..2ab3812d99 100644 --- a/app/core/gimpimage-quick-mask.h +++ b/app/core/gimpimage-quick-mask.h @@ -26,18 +26,18 @@ #define GIMP_IMAGE_QUICK_MASK_NAME "Qmask" -void gimp_image_set_quick_mask_state (GimpImage *gimage, +void gimp_image_set_quick_mask_state (GimpImage *image, gboolean quick_mask_state); -gboolean gimp_image_get_quick_mask_state (const GimpImage *gimage); +gboolean gimp_image_get_quick_mask_state (const GimpImage *image); -void gimp_image_set_quick_mask_color (GimpImage *gimage, +void gimp_image_set_quick_mask_color (GimpImage *image, const GimpRGB *color); -void gimp_image_get_quick_mask_color (const GimpImage *gimage, +void gimp_image_get_quick_mask_color (const GimpImage *image, GimpRGB *color); -GimpChannel * gimp_image_get_quick_mask (const GimpImage *gimage); +GimpChannel * gimp_image_get_quick_mask (const GimpImage *image); -void gimp_image_quick_mask_invert (GimpImage *gimage); +void gimp_image_quick_mask_invert (GimpImage *image); #endif /* __GIMP_IMAGE_QUICK_MASK_H__ */ diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index 6833400b11..2355a33150 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -38,7 +38,7 @@ void -gimp_image_resize (GimpImage *gimage, +gimp_image_resize (GimpImage *image, GimpContext *context, gint new_width, gint new_height, @@ -46,14 +46,14 @@ gimp_image_resize (GimpImage *gimage, gint offset_y, GimpProgress *progress) { - gimp_image_resize_with_layers (gimage, context, + gimp_image_resize_with_layers (image, context, new_width, new_height, offset_x, offset_y, GIMP_IMAGE_RESIZE_LAYERS_NONE, progress); } void -gimp_image_resize_with_layers (GimpImage *gimage, +gimp_image_resize_with_layers (GimpImage *image, GimpContext *context, gint new_width, gint new_height, @@ -67,37 +67,37 @@ gimp_image_resize_with_layers (GimpImage *gimage, gdouble progress_current = 1.0; gint old_width, old_height; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (new_width > 0 && new_height > 0); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); - progress_max = (gimage->channels->num_children + - gimage->layers->num_children + - gimage->vectors->num_children + + progress_max = (image->channels->num_children + + image->layers->num_children + + image->vectors->num_children + 1 /* selection */); - g_object_freeze_notify (G_OBJECT (gimage)); + g_object_freeze_notify (G_OBJECT (image)); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_RESIZE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_RESIZE, _("Resize Image")); - old_width = gimage->width; - old_height = gimage->height; + old_width = image->width; + old_height = image->height; /* Push the image size to the stack */ - gimp_image_undo_push_image_size (gimage, NULL); + gimp_image_undo_push_image_size (image, NULL); /* Set the new width and height */ - g_object_set (gimage, + g_object_set (image, "width", new_width, "height", new_height, NULL); /* Resize all channels */ - for (list = GIMP_LIST (gimage->channels)->list; + for (list = GIMP_LIST (image->channels)->list; list; list = g_list_next (list)) { @@ -111,7 +111,7 @@ gimp_image_resize_with_layers (GimpImage *gimage, } /* Resize all vectors */ - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { @@ -125,14 +125,14 @@ gimp_image_resize_with_layers (GimpImage *gimage, } /* Don't forget the selection mask! */ - gimp_item_resize (GIMP_ITEM (gimp_image_get_mask (gimage)), context, + gimp_item_resize (GIMP_ITEM (gimp_image_get_mask (image)), context, new_width, new_height, offset_x, offset_y); if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); /* Reposition all layers */ - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -181,7 +181,7 @@ gimp_image_resize_with_layers (GimpImage *gimage, } /* Reposition or remove all guides */ - list = gimage->guides; + list = image->guides; while (list) { GimpGuide *guide = list->data; @@ -209,13 +209,13 @@ gimp_image_resize_with_layers (GimpImage *gimage, } if (remove_guide) - gimp_image_remove_guide (gimage, guide, TRUE); + gimp_image_remove_guide (image, guide, TRUE); else if (new_position != guide->position) - gimp_image_move_guide (gimage, guide, new_position, TRUE); + gimp_image_move_guide (image, guide, new_position, TRUE); } /* Reposition or remove sample points */ - list = gimage->sample_points; + list = image->sample_points; while (list) { GimpSamplePoint *sample_point = list->data; @@ -234,27 +234,27 @@ gimp_image_resize_with_layers (GimpImage *gimage, remove_sample_point = TRUE; if (remove_sample_point) - gimp_image_remove_sample_point (gimage, sample_point, TRUE); + gimp_image_remove_sample_point (image, sample_point, TRUE); else if (new_x != sample_point->x || new_y != sample_point->y) - gimp_image_move_sample_point (gimage, sample_point, + gimp_image_move_sample_point (image, sample_point, new_x, new_y, TRUE); } - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_viewable_size_changed (GIMP_VIEWABLE (gimage)); - g_object_thaw_notify (G_OBJECT (gimage)); + gimp_viewable_size_changed (GIMP_VIEWABLE (image)); + g_object_thaw_notify (G_OBJECT (image)); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); } void -gimp_image_resize_to_layers (GimpImage *gimage, +gimp_image_resize_to_layers (GimpImage *image, GimpContext *context, GimpProgress *progress) { gint min_x, max_x, min_y, max_y; - GList *list = GIMP_LIST (gimage->layers)->list; + GList *list = GIMP_LIST (image->layers)->list; GimpItem *item; if (!list) @@ -280,7 +280,7 @@ gimp_image_resize_to_layers (GimpImage *gimage, max_y = MAX (max_y, item->offset_y + item->height); } - gimp_image_resize (gimage, context, + gimp_image_resize (image, context, max_x - min_x, max_y - min_y, - min_x, - min_y, progress); diff --git a/app/core/gimpimage-resize.h b/app/core/gimpimage-resize.h index 630a7285bc..3e57ac74af 100644 --- a/app/core/gimpimage-resize.h +++ b/app/core/gimpimage-resize.h @@ -20,7 +20,7 @@ #define __GIMP_IMAGE_RESIZE_H__ -void gimp_image_resize (GimpImage *gimage, +void gimp_image_resize (GimpImage *image, GimpContext *context, gint new_width, gint new_height, @@ -28,7 +28,7 @@ void gimp_image_resize (GimpImage *gimage, gint offset_y, GimpProgress *progress); -void gimp_image_resize_with_layers (GimpImage *gimage, +void gimp_image_resize_with_layers (GimpImage *image, GimpContext *context, gint new_width, gint new_height, @@ -37,7 +37,7 @@ void gimp_image_resize_with_layers (GimpImage *gimage, GimpImageResizeLayers resize_layers, GimpProgress *progress); -void gimp_image_resize_to_layers (GimpImage *gimage, +void gimp_image_resize_to_layers (GimpImage *image, GimpContext *context, GimpProgress *progress); diff --git a/app/core/gimpimage-rotate.c b/app/core/gimpimage-rotate.c index 630e7d268f..6885cd21b1 100644 --- a/app/core/gimpimage-rotate.c +++ b/app/core/gimpimage-rotate.c @@ -35,19 +35,19 @@ #include "gimpprogress.h" -static void gimp_image_rotate_item_offset (GimpImage *gimage, +static void gimp_image_rotate_item_offset (GimpImage *image, GimpRotationType rotate_type, GimpItem *item, gint off_x, gint off_y); -static void gimp_image_rotate_guides (GimpImage *gimage, +static void gimp_image_rotate_guides (GimpImage *image, GimpRotationType rotate_type); -static void gimp_image_rotate_sample_points (GimpImage *gimage, +static void gimp_image_rotate_sample_points (GimpImage *image, GimpRotationType rotate_type); void -gimp_image_rotate (GimpImage *gimage, +gimp_image_rotate (GimpImage *image, GimpContext *context, GimpRotationType rotate_type, GimpProgress *progress) @@ -62,37 +62,37 @@ gimp_image_rotate (GimpImage *gimage, gint new_image_height; gboolean size_changed; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); - center_x = (gdouble) gimage->width / 2.0; - center_y = (gdouble) gimage->height / 2.0; + center_x = (gdouble) image->width / 2.0; + center_y = (gdouble) image->height / 2.0; - progress_max = (gimage->channels->num_children + - gimage->layers->num_children + - gimage->vectors->num_children + + progress_max = (image->channels->num_children + + image->layers->num_children + + image->vectors->num_children + 1 /* selection */); - g_object_freeze_notify (G_OBJECT (gimage)); + g_object_freeze_notify (G_OBJECT (image)); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_ROTATE, NULL); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ROTATE, NULL); /* Resize the image (if needed) */ switch (rotate_type) { case GIMP_ROTATE_90: case GIMP_ROTATE_270: - new_image_width = gimage->height; - new_image_height = gimage->width; + new_image_width = image->height; + new_image_height = image->width; size_changed = TRUE; break; case GIMP_ROTATE_180: - new_image_width = gimage->width; - new_image_height = gimage->height; + new_image_width = image->width; + new_image_height = image->height; size_changed = FALSE; break; @@ -102,7 +102,7 @@ gimp_image_rotate (GimpImage *gimage, } /* Rotate all channels */ - for (list = GIMP_LIST (gimage->channels)->list; + for (list = GIMP_LIST (image->channels)->list; list; list = g_list_next (list)) { @@ -118,7 +118,7 @@ gimp_image_rotate (GimpImage *gimage, } /* Rotate all vectors */ - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { @@ -132,8 +132,8 @@ gimp_image_rotate (GimpImage *gimage, item->offset_y = 0; gimp_item_translate (item, - (new_image_width - gimage->width) / 2, - (new_image_height - gimage->height) / 2, + (new_image_width - image->width) / 2, + (new_image_height - image->height) / 2, FALSE); if (progress) @@ -141,17 +141,17 @@ gimp_image_rotate (GimpImage *gimage, } /* Don't forget the selection mask! */ - gimp_item_rotate (GIMP_ITEM (gimp_image_get_mask (gimage)), context, + gimp_item_rotate (GIMP_ITEM (gimp_image_get_mask (image)), context, rotate_type, center_x, center_y, FALSE); - GIMP_ITEM (gimage->selection_mask)->offset_x = 0; - GIMP_ITEM (gimage->selection_mask)->offset_y = 0; + GIMP_ITEM (image->selection_mask)->offset_x = 0; + GIMP_ITEM (image->selection_mask)->offset_y = 0; if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); /* Rotate all layers */ - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -163,53 +163,53 @@ gimp_image_rotate (GimpImage *gimage, gimp_item_rotate (item, context, rotate_type, center_x, center_y, FALSE); - gimp_image_rotate_item_offset (gimage, rotate_type, item, off_x, off_y); + gimp_image_rotate_item_offset (image, rotate_type, item, off_x, off_y); if (progress) gimp_progress_set_value (progress, progress_current++ / progress_max); } /* Rotate all Guides */ - gimp_image_rotate_guides (gimage, rotate_type); + gimp_image_rotate_guides (image, rotate_type); /* Rotate all sample points */ - gimp_image_rotate_sample_points (gimage, rotate_type); + gimp_image_rotate_sample_points (image, rotate_type); /* Resize the image (if needed) */ if (size_changed) { - gimp_image_undo_push_image_size (gimage, NULL); + gimp_image_undo_push_image_size (image, NULL); - g_object_set (gimage, + g_object_set (image, "width", new_image_width, "height", new_image_height, NULL); - if (gimage->xresolution != gimage->yresolution) + if (image->xresolution != image->yresolution) { gdouble tmp; - gimp_image_undo_push_image_resolution (gimage, NULL); + gimp_image_undo_push_image_resolution (image, NULL); - tmp = gimage->xresolution; - gimage->yresolution = gimage->xresolution; - gimage->xresolution = tmp; + tmp = image->xresolution; + image->yresolution = image->xresolution; + image->xresolution = tmp; } } - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); if (size_changed) - gimp_viewable_size_changed (GIMP_VIEWABLE (gimage)); + gimp_viewable_size_changed (GIMP_VIEWABLE (image)); - g_object_thaw_notify (G_OBJECT (gimage)); + g_object_thaw_notify (G_OBJECT (image)); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); } static void -gimp_image_rotate_item_offset (GimpImage *gimage, +gimp_image_rotate_item_offset (GimpImage *image, GimpRotationType rotate_type, GimpItem *item, gint off_x, @@ -221,13 +221,13 @@ gimp_image_rotate_item_offset (GimpImage *gimage, switch (rotate_type) { case GIMP_ROTATE_90: - x = gimage->height - off_y - gimp_item_width (item); + x = image->height - off_y - gimp_item_width (item); y = off_x; break; case GIMP_ROTATE_270: x = off_y; - y = gimage->width - off_x - gimp_item_height (item); + y = image->width - off_x - gimp_item_height (item); break; case GIMP_ROTATE_180: @@ -244,13 +244,13 @@ gimp_image_rotate_item_offset (GimpImage *gimage, } static void -gimp_image_rotate_guides (GimpImage *gimage, +gimp_image_rotate_guides (GimpImage *image, GimpRotationType rotate_type) { GList *list; /* Rotate all Guides */ - for (list = gimage->guides; list; list = g_list_next (list)) + for (list = image->guides; list; list = g_list_next (list)) { GimpGuide *guide = list->data; @@ -260,13 +260,13 @@ gimp_image_rotate_guides (GimpImage *gimage, switch (guide->orientation) { case GIMP_ORIENTATION_HORIZONTAL: - gimp_image_undo_push_image_guide (gimage, NULL, guide); + gimp_image_undo_push_image_guide (image, NULL, guide); guide->orientation = GIMP_ORIENTATION_VERTICAL; - guide->position = gimage->height - guide->position; + guide->position = image->height - guide->position; break; case GIMP_ORIENTATION_VERTICAL: - gimp_image_undo_push_image_guide (gimage, NULL, guide); + gimp_image_undo_push_image_guide (image, NULL, guide); guide->orientation = GIMP_ORIENTATION_HORIZONTAL; break; @@ -279,13 +279,13 @@ gimp_image_rotate_guides (GimpImage *gimage, switch (guide->orientation) { case GIMP_ORIENTATION_HORIZONTAL: - gimp_image_move_guide (gimage, guide, - gimage->height - guide->position, TRUE); + gimp_image_move_guide (image, guide, + image->height - guide->position, TRUE); break; case GIMP_ORIENTATION_VERTICAL: - gimp_image_move_guide (gimage, guide, - gimage->width - guide->position, TRUE); + gimp_image_move_guide (image, guide, + image->width - guide->position, TRUE); break; default: @@ -297,14 +297,14 @@ gimp_image_rotate_guides (GimpImage *gimage, switch (guide->orientation) { case GIMP_ORIENTATION_HORIZONTAL: - gimp_image_undo_push_image_guide (gimage, NULL, guide); + gimp_image_undo_push_image_guide (image, NULL, guide); guide->orientation = GIMP_ORIENTATION_VERTICAL; break; case GIMP_ORIENTATION_VERTICAL: - gimp_image_undo_push_image_guide (gimage, NULL, guide); + gimp_image_undo_push_image_guide (image, NULL, guide); guide->orientation = GIMP_ORIENTATION_HORIZONTAL; - guide->position = gimage->width - guide->position; + guide->position = image->width - guide->position; break; default: @@ -317,13 +317,13 @@ gimp_image_rotate_guides (GimpImage *gimage, static void -gimp_image_rotate_sample_points (GimpImage *gimage, +gimp_image_rotate_sample_points (GimpImage *image, GimpRotationType rotate_type) { GList *list; /* Rotate all sample points */ - for (list = gimage->sample_points; list; list = g_list_next (list)) + for (list = image->sample_points; list; list = g_list_next (list)) { GimpSamplePoint *sample_point = list->data; gint old_x; @@ -336,16 +336,16 @@ gimp_image_rotate_sample_points (GimpImage *gimage, { case GIMP_ROTATE_90: sample_point->x = old_y; - sample_point->y = gimage->height - old_x; + sample_point->y = image->height - old_x; break; case GIMP_ROTATE_180: - sample_point->x = gimage->height - old_x; - sample_point->y = gimage->width - old_y; + sample_point->x = image->height - old_x; + sample_point->y = image->width - old_y; break; case GIMP_ROTATE_270: - sample_point->x = gimage->width - old_y; + sample_point->x = image->width - old_y; sample_point->y = old_x; break; } diff --git a/app/core/gimpimage-rotate.h b/app/core/gimpimage-rotate.h index 7ce174a2a3..b7adcea3a2 100644 --- a/app/core/gimpimage-rotate.h +++ b/app/core/gimpimage-rotate.h @@ -20,7 +20,7 @@ #define __GIMP_IMAGE_ROTATE_H__ -void gimp_image_rotate (GimpImage *gimage, +void gimp_image_rotate (GimpImage *image, GimpContext *context, GimpRotationType rotate_type, GimpProgress *progress); diff --git a/app/core/gimpimage-sample-points.c b/app/core/gimpimage-sample-points.c index 00b5d2aea4..c9a93be8dd 100644 --- a/app/core/gimpimage-sample-points.c +++ b/app/core/gimpimage-sample-points.c @@ -33,29 +33,29 @@ /* public functions */ GimpSamplePoint * -gimp_image_add_sample_point_at_pos (GimpImage *gimage, +gimp_image_add_sample_point_at_pos (GimpImage *image, gint x, gint y, gboolean push_undo) { GimpSamplePoint *sample_point; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); - g_return_val_if_fail (x >= 0 && x < gimage->width, NULL); - g_return_val_if_fail (y >= 0 && y < gimage->height, NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); + g_return_val_if_fail (x >= 0 && x < image->width, NULL); + g_return_val_if_fail (y >= 0 && y < image->height, NULL); sample_point = g_new0 (GimpSamplePoint, 1); sample_point->ref_count = 1; sample_point->x = -1; sample_point->y = -1; - sample_point->sample_point_ID = gimage->gimp->next_sample_point_ID++; + sample_point->sample_point_ID = image->gimp->next_sample_point_ID++; if (push_undo) - gimp_image_undo_push_image_sample_point (gimage, _("Add Sample_Point"), + gimp_image_undo_push_image_sample_point (image, _("Add Sample_Point"), sample_point); - gimp_image_add_sample_point (gimage, sample_point, x, y); + gimp_image_add_sample_point (image, sample_point, x, y); gimp_image_sample_point_unref (sample_point); return sample_point; @@ -83,51 +83,51 @@ gimp_image_sample_point_unref (GimpSamplePoint *sample_point) } void -gimp_image_add_sample_point (GimpImage *gimage, +gimp_image_add_sample_point (GimpImage *image, GimpSamplePoint *sample_point, gint x, gint y) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (sample_point != NULL); g_return_if_fail (x >= 0); g_return_if_fail (y >= 0); - g_return_if_fail (x < gimage->width); - g_return_if_fail (y < gimage->height); + g_return_if_fail (x < image->width); + g_return_if_fail (y < image->height); - gimage->sample_points = g_list_append (gimage->sample_points, sample_point); + image->sample_points = g_list_append (image->sample_points, sample_point); sample_point->x = x; sample_point->y = y; gimp_image_sample_point_ref (sample_point); - gimp_image_sample_point_added (gimage, sample_point); - gimp_image_update_sample_point (gimage, sample_point); + gimp_image_sample_point_added (image, sample_point); + gimp_image_update_sample_point (image, sample_point); } void -gimp_image_remove_sample_point (GimpImage *gimage, +gimp_image_remove_sample_point (GimpImage *image, GimpSamplePoint *sample_point, gboolean push_undo) { GList *list; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (sample_point != NULL); - gimp_image_update_sample_point (gimage, sample_point); + gimp_image_update_sample_point (image, sample_point); if (push_undo) - gimp_image_undo_push_image_sample_point (gimage, _("Remove Sample Point"), + gimp_image_undo_push_image_sample_point (image, _("Remove Sample Point"), sample_point); - list = g_list_find (gimage->sample_points, sample_point); + list = g_list_find (image->sample_points, sample_point); if (list) list = g_list_next (list); - gimage->sample_points = g_list_remove (gimage->sample_points, sample_point); + image->sample_points = g_list_remove (image->sample_points, sample_point); - gimp_image_sample_point_removed (gimage, sample_point); + gimp_image_sample_point_removed (image, sample_point); sample_point->x = -1; sample_point->y = -1; @@ -135,37 +135,37 @@ gimp_image_remove_sample_point (GimpImage *gimage, while (list) { - gimp_image_update_sample_point (gimage, list->data); + gimp_image_update_sample_point (image, list->data); list = g_list_next (list); } } void -gimp_image_move_sample_point (GimpImage *gimage, +gimp_image_move_sample_point (GimpImage *image, GimpSamplePoint *sample_point, gint x, gint y, gboolean push_undo) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (sample_point != NULL); g_return_if_fail (x >= 0); g_return_if_fail (y >= 0); - g_return_if_fail (x < gimage->width); - g_return_if_fail (y < gimage->height); + g_return_if_fail (x < image->width); + g_return_if_fail (y < image->height); if (push_undo) - gimp_image_undo_push_image_sample_point (gimage, _("Move Sample Point"), + gimp_image_undo_push_image_sample_point (image, _("Move Sample Point"), sample_point); - gimp_image_update_sample_point (gimage, sample_point); + gimp_image_update_sample_point (image, sample_point); sample_point->x = x; sample_point->y = y; - gimp_image_update_sample_point (gimage, sample_point); + gimp_image_update_sample_point (image, sample_point); } GimpSamplePoint * -gimp_image_find_sample_point (GimpImage *gimage, +gimp_image_find_sample_point (GimpImage *image, gdouble x, gdouble y, gdouble epsilon_x, @@ -175,16 +175,16 @@ gimp_image_find_sample_point (GimpImage *gimage, GimpSamplePoint *ret = NULL; gdouble mindist = G_MAXDOUBLE; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (epsilon_x > 0 && epsilon_y > 0, NULL); - if (x < 0 || x >= gimage->width || - y < 0 || y >= gimage->height) + if (x < 0 || x >= image->width || + y < 0 || y >= image->height) { return NULL; } - for (list = gimage->sample_points; list; list = g_list_next (list)) + for (list = image->sample_points; list; list = g_list_next (list)) { GimpSamplePoint *sample_point = list->data; gdouble dist; diff --git a/app/core/gimpimage-sample-points.h b/app/core/gimpimage-sample-points.h index 50666653cf..cf88c74997 100644 --- a/app/core/gimpimage-sample-points.h +++ b/app/core/gimpimage-sample-points.h @@ -30,31 +30,31 @@ struct _GimpSamplePoint }; -GimpSamplePoint * gimp_image_add_sample_point_at_pos (GimpImage *gimage, +GimpSamplePoint * gimp_image_add_sample_point_at_pos (GimpImage *image, gint x, gint y, gboolean push_undo); GimpSamplePoint * gimp_image_sample_point_ref (GimpSamplePoint *sample_point); void gimp_image_sample_point_unref (GimpSamplePoint *sample_point); -void gimp_image_add_sample_point (GimpImage *gimage, +void gimp_image_add_sample_point (GimpImage *image, GimpSamplePoint *sample_point, gint x, gint y); -void gimp_image_remove_sample_point (GimpImage *gimage, +void gimp_image_remove_sample_point (GimpImage *image, GimpSamplePoint *sample_point, gboolean push_undo); -void gimp_image_move_sample_point (GimpImage *gimage, +void gimp_image_move_sample_point (GimpImage *image, GimpSamplePoint *sample_point, gint x, gint y, gboolean push_undo); -GimpSamplePoint * gimp_image_find_sample_point (GimpImage *gimage, - gdouble x, - gdouble y, - gdouble epsilon_x, - gdouble epsilon_y); +GimpSamplePoint * gimp_image_find_sample_point (GimpImage *image, + gdouble x, + gdouble y, + gdouble epsilon_x, + gdouble epsilon_y); #endif /* __GIMP_IMAGE_SAMPLE_POINTS_H__ */ diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 14807cba57..2cac840b54 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -39,7 +39,7 @@ void -gimp_image_scale (GimpImage *gimage, +gimp_image_scale (GimpImage *image, gint new_width, gint new_height, GimpInterpolationType interpolation_type, @@ -55,38 +55,38 @@ gimp_image_scale (GimpImage *gimage, gdouble progress_max; gdouble progress_current = 1.0; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (new_width > 0 && new_height > 0); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); - progress_max = (gimage->channels->num_children + - gimage->layers->num_children + - gimage->vectors->num_children + + progress_max = (image->channels->num_children + + image->layers->num_children + + image->vectors->num_children + 1 /* selection */); - g_object_freeze_notify (G_OBJECT (gimage)); + g_object_freeze_notify (G_OBJECT (image)); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_SCALE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_SCALE, _("Scale Image")); /* Push the image size to the stack */ - gimp_image_undo_push_image_size (gimage, NULL); + gimp_image_undo_push_image_size (image, NULL); - old_width = gimage->width; - old_height = gimage->height; + old_width = image->width; + old_height = image->height; img_scale_w = (gdouble) new_width / (gdouble) old_width; img_scale_h = (gdouble) new_height / (gdouble) old_height; /* Set the new width and height */ - g_object_set (gimage, + g_object_set (image, "width", new_width, "height", new_height, NULL); /* Scale all channels */ - for (list = GIMP_LIST (gimage->channels)->list; + for (list = GIMP_LIST (image->channels)->list; list; list = g_list_next (list)) { @@ -101,7 +101,7 @@ gimp_image_scale (GimpImage *gimage, } /* Scale all vectors */ - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { @@ -116,7 +116,7 @@ gimp_image_scale (GimpImage *gimage, } /* Don't forget the selection mask! */ - gimp_item_scale (GIMP_ITEM (gimp_image_get_mask (gimage)), + gimp_item_scale (GIMP_ITEM (gimp_image_get_mask (image)), new_width, new_height, 0, 0, interpolation_type, NULL); @@ -124,7 +124,7 @@ gimp_image_scale (GimpImage *gimage, gimp_progress_set_value (progress, progress_current++ / progress_max); /* Scale all layers */ - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -147,7 +147,7 @@ gimp_image_scale (GimpImage *gimage, } /* We defer removing layers lost to scaling until now so as not to mix - * the operations of iterating over and removal from gimage->layers. + * the operations of iterating over and removal from image->layers. */ remove = g_list_reverse (remove); @@ -155,25 +155,25 @@ gimp_image_scale (GimpImage *gimage, { GimpLayer *layer = list->data; - gimp_image_remove_layer (gimage, layer); + gimp_image_remove_layer (image, layer); } g_list_free (remove); /* Scale all Guides */ - for (list = gimage->guides; list; list = g_list_next (list)) + for (list = image->guides; list; list = g_list_next (list)) { GimpGuide *guide = list->data; switch (guide->orientation) { case GIMP_ORIENTATION_HORIZONTAL: - gimp_image_undo_push_image_guide (gimage, NULL, guide); + gimp_image_undo_push_image_guide (image, NULL, guide); guide->position = (guide->position * new_height) / old_height; break; case GIMP_ORIENTATION_VERTICAL: - gimp_image_undo_push_image_guide (gimage, NULL, guide); + gimp_image_undo_push_image_guide (image, NULL, guide); guide->position = (guide->position * new_width) / old_width; break; @@ -183,32 +183,32 @@ gimp_image_scale (GimpImage *gimage, } /* Scale all sample points */ - for (list = gimage->sample_points; list; list = g_list_next (list)) + for (list = image->sample_points; list; list = g_list_next (list)) { GimpSamplePoint *sample_point = list->data; - gimp_image_undo_push_image_sample_point (gimage, NULL, sample_point); + gimp_image_undo_push_image_sample_point (image, NULL, sample_point); sample_point->x = sample_point->x * new_width / old_width; sample_point->y = sample_point->y * new_height / old_height; } - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_viewable_size_changed (GIMP_VIEWABLE (gimage)); - g_object_thaw_notify (G_OBJECT (gimage)); + gimp_viewable_size_changed (GIMP_VIEWABLE (image)); + g_object_thaw_notify (G_OBJECT (image)); - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); } /** * gimp_image_scale_check: - * @gimage: A #GimpImage. + * @image: A #GimpImage. * @new_width: The new width. * @new_height: The new height. * @max_memsize: The maximum new memory size. * @new_memsize: The new memory size. * - * Inventory the layer list in gimage and check that it may be + * Inventory the layer list in image and check that it may be * scaled to @new_height and @new_width without problems. * * Return value: #GIMP_IMAGE_SCALE_OK if scaling the image will shrink none @@ -220,7 +220,7 @@ gimp_image_scale (GimpImage *gimage, * exceed the maximum specified in the preferences. **/ GimpImageScaleCheckType -gimp_image_scale_check (const GimpImage *gimage, +gimp_image_scale_check (const GimpImage *image, gint new_width, gint new_height, gint64 max_memsize, @@ -234,20 +234,20 @@ gimp_image_scale_check (const GimpImage *gimage, gint64 fixed_size; gint64 new_size; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_IMAGE_SCALE_TOO_SMALL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), GIMP_IMAGE_SCALE_TOO_SMALL); g_return_val_if_fail (new_memsize != NULL, GIMP_IMAGE_SCALE_TOO_SMALL); - current_size = gimp_object_get_memsize (GIMP_OBJECT (gimage), NULL); + current_size = gimp_object_get_memsize (GIMP_OBJECT (image), NULL); /* the part of the image's memsize that scales linearly with the image */ scalable_size = - gimp_object_get_memsize (GIMP_OBJECT (gimage->layers), NULL) + - gimp_object_get_memsize (GIMP_OBJECT (gimage->channels), NULL) + - gimp_object_get_memsize (GIMP_OBJECT (gimage->selection_mask), NULL) + - gimp_object_get_memsize (GIMP_OBJECT (gimage->projection), NULL); + gimp_object_get_memsize (GIMP_OBJECT (image->layers), NULL) + + gimp_object_get_memsize (GIMP_OBJECT (image->channels), NULL) + + gimp_object_get_memsize (GIMP_OBJECT (image->selection_mask), NULL) + + gimp_object_get_memsize (GIMP_OBJECT (image->projection), NULL); - undo_size = gimp_object_get_memsize (GIMP_OBJECT (gimage->undo_stack), NULL); - redo_size = gimp_object_get_memsize (GIMP_OBJECT (gimage->redo_stack), NULL); + undo_size = gimp_object_get_memsize (GIMP_OBJECT (image->undo_stack), NULL); + redo_size = gimp_object_get_memsize (GIMP_OBJECT (image->redo_stack), NULL); /* the fixed part of the image's memsize w/o any undo information */ fixed_size = current_size - undo_size - redo_size - scalable_size; @@ -255,15 +255,15 @@ gimp_image_scale_check (const GimpImage *gimage, /* calculate the new size, which is: */ new_size = (fixed_size + /* the fixed part */ scalable_size * /* plus the part that scales... */ - ((gdouble) new_width / gimp_image_get_width (gimage)) * - ((gdouble) new_height / gimp_image_get_height (gimage))); + ((gdouble) new_width / gimp_image_get_width (image)) * + ((gdouble) new_height / gimp_image_get_height (image))); *new_memsize = new_size; if (new_size > current_size && new_size > max_memsize) return GIMP_IMAGE_SCALE_TOO_BIG; - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { diff --git a/app/core/gimpimage-scale.h b/app/core/gimpimage-scale.h index 80da9e6a06..f04e256e71 100644 --- a/app/core/gimpimage-scale.h +++ b/app/core/gimpimage-scale.h @@ -20,14 +20,14 @@ #define __GIMP_IMAGE_SCALE_H__ -void gimp_image_scale (GimpImage *gimage, +void gimp_image_scale (GimpImage *image, gint new_width, gint new_height, GimpInterpolationType interpolation_type, GimpProgress *progress); GimpImageScaleCheckType - gimp_image_scale_check (const GimpImage *gimage, + gimp_image_scale_check (const GimpImage *image, gint new_width, gint new_height, gint64 max_memsize, diff --git a/app/core/gimpimage-snap.c b/app/core/gimpimage-snap.c index ae975e0424..3acd34f895 100644 --- a/app/core/gimpimage-snap.c +++ b/app/core/gimpimage-snap.c @@ -38,7 +38,7 @@ gboolean -gimp_image_snap_x (GimpImage *gimage, +gimp_image_snap_x (GimpImage *image, gdouble x, gdouble *tx, gdouble epsilon_x, @@ -50,25 +50,25 @@ gimp_image_snap_x (GimpImage *gimage, gdouble dist; gboolean snapped = FALSE; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (tx != NULL, FALSE); *tx = x; - if (! gimage->guides) snap_to_guides = FALSE; - if (! gimage->grid) snap_to_grid = FALSE; + if (! image->guides) snap_to_guides = FALSE; + if (! image->grid) snap_to_grid = FALSE; if (! (snap_to_guides || snap_to_grid || snap_to_canvas)) return FALSE; - if (x < -epsilon_x || x >= (gimage->width + epsilon_x)) + if (x < -epsilon_x || x >= (image->width + epsilon_x)) return FALSE; if (snap_to_guides) { GList *list; - for (list = gimage->guides; list; list = g_list_next (list)) + for (list = image->guides; list; list = g_list_next (list)) { GimpGuide *guide = list->data; @@ -91,7 +91,7 @@ gimp_image_snap_x (GimpImage *gimage, if (snap_to_grid) { - GimpGrid *grid = gimp_image_get_grid (gimage); + GimpGrid *grid = gimp_image_get_grid (image); gdouble xspacing; gdouble xoffset; gdouble i; @@ -101,7 +101,7 @@ gimp_image_snap_x (GimpImage *gimage, "xoffset", &xoffset, NULL); - for (i = xoffset; i <= gimage->width; i += xspacing) + for (i = xoffset; i <= image->width; i += xspacing) { if (i < 0) continue; @@ -128,12 +128,12 @@ gimp_image_snap_x (GimpImage *gimage, snapped = TRUE; } - dist = ABS (gimage->width - x); + dist = ABS (image->width - x); if (dist < MIN (epsilon_x, mindist)) { mindist = dist; - *tx = gimage->width; + *tx = image->width; snapped = TRUE; } } @@ -142,7 +142,7 @@ gimp_image_snap_x (GimpImage *gimage, } gboolean -gimp_image_snap_y (GimpImage *gimage, +gimp_image_snap_y (GimpImage *image, gdouble y, gdouble *ty, gdouble epsilon_y, @@ -154,25 +154,25 @@ gimp_image_snap_y (GimpImage *gimage, gdouble dist; gboolean snapped = FALSE; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (ty != NULL, FALSE); *ty = y; - if (! gimage->guides) snap_to_guides = FALSE; - if (! gimage->grid) snap_to_grid = FALSE; + if (! image->guides) snap_to_guides = FALSE; + if (! image->grid) snap_to_grid = FALSE; if (! (snap_to_guides || snap_to_grid || snap_to_canvas)) return FALSE; - if (y < -epsilon_y || y >= (gimage->height + epsilon_y)) + if (y < -epsilon_y || y >= (image->height + epsilon_y)) return FALSE; if (snap_to_guides) { GList *list; - for (list = gimage->guides; list; list = g_list_next (list)) + for (list = image->guides; list; list = g_list_next (list)) { GimpGuide *guide = list->data; @@ -195,7 +195,7 @@ gimp_image_snap_y (GimpImage *gimage, if (snap_to_grid) { - GimpGrid *grid = gimp_image_get_grid (gimage); + GimpGrid *grid = gimp_image_get_grid (image); gdouble yspacing; gdouble yoffset; gdouble i; @@ -205,7 +205,7 @@ gimp_image_snap_y (GimpImage *gimage, "yoffset", &yoffset, NULL); - for (i = yoffset; i <= gimage->height; i += yspacing) + for (i = yoffset; i <= image->height; i += yspacing) { if (i < 0) continue; @@ -232,12 +232,12 @@ gimp_image_snap_y (GimpImage *gimage, snapped = TRUE; } - dist = ABS (gimage->height - y); + dist = ABS (image->height - y); if (dist < MIN (epsilon_y, mindist)) { mindist = dist; - *ty = gimage->height; + *ty = image->height; snapped = TRUE; } } @@ -246,7 +246,7 @@ gimp_image_snap_y (GimpImage *gimage, } gboolean -gimp_image_snap_point (GimpImage *gimage, +gimp_image_snap_point (GimpImage *image, gdouble x, gdouble y, gdouble *tx, @@ -263,22 +263,22 @@ gimp_image_snap_point (GimpImage *gimage, gdouble dist; gboolean snapped = FALSE; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (tx != NULL, FALSE); g_return_val_if_fail (ty != NULL, FALSE); *tx = x; *ty = y; - if (! gimage->guides) snap_to_guides = FALSE; - if (! gimage->grid) snap_to_grid = FALSE; - if (! gimage->active_vectors) snap_to_vectors = FALSE; + if (! image->guides) snap_to_guides = FALSE; + if (! image->grid) snap_to_grid = FALSE; + if (! image->active_vectors) snap_to_vectors = FALSE; if (! (snap_to_guides || snap_to_grid || snap_to_canvas || snap_to_vectors)) return FALSE; - if (x < -epsilon_x || x >= (gimage->width + epsilon_x) || - y < -epsilon_y || y >= (gimage->height + epsilon_y)) + if (x < -epsilon_x || x >= (image->width + epsilon_x) || + y < -epsilon_y || y >= (image->height + epsilon_y)) { return FALSE; } @@ -287,7 +287,7 @@ gimp_image_snap_point (GimpImage *gimage, { GList *list; - for (list = gimage->guides; list; list = g_list_next (list)) + for (list = image->guides; list; list = g_list_next (list)) { GimpGuide *guide = list->data; @@ -326,7 +326,7 @@ gimp_image_snap_point (GimpImage *gimage, if (snap_to_grid) { - GimpGrid *grid = gimp_image_get_grid (gimage); + GimpGrid *grid = gimp_image_get_grid (image); gdouble xspacing, yspacing; gdouble xoffset, yoffset; gdouble i; @@ -338,7 +338,7 @@ gimp_image_snap_point (GimpImage *gimage, "yoffset", &yoffset, NULL); - for (i = xoffset; i <= gimage->width; i += xspacing) + for (i = xoffset; i <= image->width; i += xspacing) { if (i < 0) continue; @@ -353,7 +353,7 @@ gimp_image_snap_point (GimpImage *gimage, } } - for (i = yoffset; i <= gimage->height; i += yspacing) + for (i = yoffset; i <= image->height; i += yspacing) { if (i < 0) continue; @@ -380,12 +380,12 @@ gimp_image_snap_point (GimpImage *gimage, snapped = TRUE; } - dist = ABS (gimage->width - x); + dist = ABS (image->width - x); if (dist < MIN (epsilon_x, mindist_x)) { mindist_x = dist; - *tx = gimage->width; + *tx = image->width; snapped = TRUE; } @@ -398,19 +398,19 @@ gimp_image_snap_point (GimpImage *gimage, snapped = TRUE; } - dist = ABS (gimage->height - y); + dist = ABS (image->height - y); if (dist < MIN (epsilon_y, mindist_y)) { mindist_y = dist; - *ty = gimage->height; + *ty = image->height; snapped = TRUE; } } if (snap_to_vectors) { - GimpVectors *vectors = gimp_image_get_active_vectors (gimage); + GimpVectors *vectors = gimp_image_get_active_vectors (image); GimpStroke *stroke = NULL; GimpCoords coords = { 0, 0, 0, 0, 0 }; @@ -450,7 +450,7 @@ gimp_image_snap_point (GimpImage *gimage, } gboolean -gimp_image_snap_rectangle (GimpImage *gimage, +gimp_image_snap_rectangle (GimpImage *image, gdouble x1, gdouble y1, gdouble x2, @@ -469,22 +469,22 @@ gimp_image_snap_rectangle (GimpImage *gimage, gdouble mindist_y = G_MAXDOUBLE; gboolean snapped = FALSE; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (tx1 != NULL, FALSE); g_return_val_if_fail (ty1 != NULL, FALSE); *tx1 = x1; *ty1 = y1; - if (! gimage->guides) snap_to_guides = FALSE; - if (! gimage->grid) snap_to_grid = FALSE; - if (! gimage->active_vectors) snap_to_vectors = FALSE; + if (! image->guides) snap_to_guides = FALSE; + if (! image->grid) snap_to_grid = FALSE; + if (! image->active_vectors) snap_to_vectors = FALSE; if (! (snap_to_guides || snap_to_grid || snap_to_canvas || snap_to_vectors)) return FALSE; /* left edge */ - if (gimp_image_snap_x (gimage, x1, &nx, + if (gimp_image_snap_x (image, x1, &nx, MIN (epsilon_x, mindist_x), snap_to_guides, snap_to_grid, @@ -496,7 +496,7 @@ gimp_image_snap_rectangle (GimpImage *gimage, } /* right edge */ - if (gimp_image_snap_x (gimage, x2, &nx, + if (gimp_image_snap_x (image, x2, &nx, MIN (epsilon_x, mindist_x), snap_to_guides, snap_to_grid, @@ -508,7 +508,7 @@ gimp_image_snap_rectangle (GimpImage *gimage, } /* top edge */ - if (gimp_image_snap_y (gimage, y1, &ny, + if (gimp_image_snap_y (image, y1, &ny, MIN (epsilon_y, mindist_y), snap_to_guides, snap_to_grid, @@ -520,7 +520,7 @@ gimp_image_snap_rectangle (GimpImage *gimage, } /* bottom edge */ - if (gimp_image_snap_y (gimage, y2, &ny, + if (gimp_image_snap_y (image, y2, &ny, MIN (epsilon_y, mindist_y), snap_to_guides, snap_to_grid, @@ -533,7 +533,7 @@ gimp_image_snap_rectangle (GimpImage *gimage, if (snap_to_vectors) { - GimpVectors *vectors = gimp_image_get_active_vectors (gimage); + GimpVectors *vectors = gimp_image_get_active_vectors (image); GimpStroke *stroke = NULL; GimpCoords coords1 = GIMP_COORDS_DEFAULT_VALUES; GimpCoords coords2 = GIMP_COORDS_DEFAULT_VALUES; diff --git a/app/core/gimpimage-snap.h b/app/core/gimpimage-snap.h index f274bef05d..cb5e7f09ff 100644 --- a/app/core/gimpimage-snap.h +++ b/app/core/gimpimage-snap.h @@ -20,21 +20,21 @@ #define __GIMP_IMAGE_SNAP_H__ -gboolean gimp_image_snap_x (GimpImage *gimage, +gboolean gimp_image_snap_x (GimpImage *image, gdouble x, gdouble *tx, gdouble epsilon_x, gboolean snap_to_guides, gboolean snap_to_grid, gboolean snap_to_canvas); -gboolean gimp_image_snap_y (GimpImage *gimage, +gboolean gimp_image_snap_y (GimpImage *image, gdouble y, gdouble *ty, gdouble epsilon_y, gboolean snap_to_guides, gboolean snap_to_grid, gboolean snap_to_canvas); -gboolean gimp_image_snap_point (GimpImage *gimage, +gboolean gimp_image_snap_point (GimpImage *image, gdouble x, gdouble y, gdouble *tx, @@ -45,7 +45,7 @@ gboolean gimp_image_snap_point (GimpImage *gimage, gboolean snap_to_grid, gboolean snap_to_canvas, gboolean snap_to_vectors); -gboolean gimp_image_snap_rectangle (GimpImage *gimage, +gboolean gimp_image_snap_rectangle (GimpImage *image, gdouble x1, gdouble y1, gdouble x2, diff --git a/app/core/gimpimage-undo-push.c b/app/core/gimpimage-undo-push.c index ba5b9c565c..732256d911 100644 --- a/app/core/gimpimage-undo-push.c +++ b/app/core/gimpimage-undo-push.c @@ -75,14 +75,14 @@ static void undo_free_image_type (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_image_type (GimpImage *gimage, +gimp_image_undo_push_image_type (GimpImage *image, const gchar *undo_desc) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (ImageTypeUndo), sizeof (ImageTypeUndo), GIMP_UNDO_IMAGE_TYPE, undo_desc, @@ -93,7 +93,7 @@ gimp_image_undo_push_image_type (GimpImage *gimage, { ImageTypeUndo *itu = new->data; - itu->base_type = gimage->base_type; + itu->base_type = image->base_type; return TRUE; } @@ -110,12 +110,12 @@ undo_pop_image_type (GimpUndo *undo, GimpImageBaseType tmp; tmp = itu->base_type; - itu->base_type = undo->gimage->base_type; - g_object_set (undo->gimage, "base-type", tmp, NULL); + itu->base_type = undo->image->base_type; + g_object_set (undo->image, "base-type", tmp, NULL); - gimp_image_colormap_changed (undo->gimage, -1); + gimp_image_colormap_changed (undo->image, -1); - if (itu->base_type != undo->gimage->base_type) + if (itu->base_type != undo->image->base_type) accum->mode_changed = TRUE; return TRUE; @@ -148,14 +148,14 @@ static void undo_free_image_size (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_image_size (GimpImage *gimage, +gimp_image_undo_push_image_size (GimpImage *image, const gchar *undo_desc) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (ImageSizeUndo), sizeof (ImageSizeUndo), GIMP_UNDO_IMAGE_SIZE, undo_desc, @@ -166,8 +166,8 @@ gimp_image_undo_push_image_size (GimpImage *gimage, { ImageSizeUndo *isu = new->data; - isu->width = gimage->width; - isu->height = gimage->height; + isu->width = image->width; + isu->height = image->height; return TRUE; } @@ -187,18 +187,18 @@ undo_pop_image_size (GimpUndo *undo, width = isu->width; height = isu->height; - isu->width = undo->gimage->width; - isu->height = undo->gimage->height; + isu->width = undo->image->width; + isu->height = undo->image->height; - g_object_set (undo->gimage, + g_object_set (undo->image, "width", width, "height", height, NULL); - gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (gimp_image_get_mask (undo->gimage))); + gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (gimp_image_get_mask (undo->image))); - if (undo->gimage->width != isu->width || - undo->gimage->height != isu->height) + if (undo->image->width != isu->width || + undo->image->height != isu->height) accum->size_changed = TRUE; return TRUE; @@ -232,14 +232,14 @@ static void undo_free_image_resolution (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_image_resolution (GimpImage *gimage, +gimp_image_undo_push_image_resolution (GimpImage *image, const gchar *undo_desc) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (ResolutionUndo), sizeof (ResolutionUndo), GIMP_UNDO_IMAGE_RESOLUTION, undo_desc, @@ -250,9 +250,9 @@ gimp_image_undo_push_image_resolution (GimpImage *gimage, { ResolutionUndo *ru = new->data; - ru->xres = gimage->xresolution; - ru->yres = gimage->yresolution; - ru->unit = gimage->resolution_unit; + ru->xres = image->xresolution; + ru->yres = image->yresolution; + ru->unit = image->resolution_unit; return TRUE; } @@ -267,17 +267,17 @@ undo_pop_image_resolution (GimpUndo *undo, { ResolutionUndo *ru = undo->data; - if (ABS (ru->xres - undo->gimage->xresolution) >= 1e-5 || - ABS (ru->yres - undo->gimage->yresolution) >= 1e-5) + if (ABS (ru->xres - undo->image->xresolution) >= 1e-5 || + ABS (ru->yres - undo->image->yresolution) >= 1e-5) { gdouble xres; gdouble yres; - xres = undo->gimage->xresolution; - yres = undo->gimage->yresolution; + xres = undo->image->xresolution; + yres = undo->image->yresolution; - undo->gimage->xresolution = ru->xres; - undo->gimage->yresolution = ru->yres; + undo->image->xresolution = ru->xres; + undo->image->yresolution = ru->yres; ru->xres = xres; ru->yres = yres; @@ -285,12 +285,12 @@ undo_pop_image_resolution (GimpUndo *undo, accum->resolution_changed = TRUE; } - if (ru->unit != undo->gimage->resolution_unit) + if (ru->unit != undo->image->resolution_unit) { GimpUnit unit; - unit = undo->gimage->resolution_unit; - undo->gimage->resolution_unit = ru->unit; + unit = undo->image->resolution_unit; + undo->image->resolution_unit = ru->unit; ru->unit = unit; accum->unit_changed = TRUE; @@ -327,16 +327,16 @@ static void undo_free_image_guide (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_image_guide (GimpImage *gimage, +gimp_image_undo_push_image_guide (GimpImage *image, const gchar *undo_desc, GimpGuide *guide) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (guide != NULL, FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (GuideUndo), sizeof (GuideUndo), GIMP_UNDO_IMAGE_GUIDE, undo_desc, @@ -377,20 +377,20 @@ undo_pop_image_guide (GimpUndo *undo, if (gu->guide->position == -1) { - undo->gimage->guides = g_list_prepend (undo->gimage->guides, gu->guide); + undo->image->guides = g_list_prepend (undo->image->guides, gu->guide); gu->guide->position = gu->position; gimp_image_guide_ref (gu->guide); - gimp_image_update_guide (undo->gimage, gu->guide); + gimp_image_update_guide (undo->image, gu->guide); } else if (gu->position == -1) { - gimp_image_remove_guide (undo->gimage, gu->guide, FALSE); + gimp_image_remove_guide (undo->image, gu->guide, FALSE); } else { - gimp_image_update_guide (undo->gimage, gu->guide); + gimp_image_update_guide (undo->image, gu->guide); gu->guide->position = gu->position; - gimp_image_update_guide (undo->gimage, gu->guide); + gimp_image_update_guide (undo->image, gu->guide); } gu->guide->orientation = gu->orientation; @@ -430,16 +430,16 @@ static void undo_free_image_grid (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_image_grid (GimpImage *gimage, +gimp_image_undo_push_image_grid (GimpImage *image, const gchar *undo_desc, GimpGrid *grid) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_GRID (grid), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (GridUndo), sizeof (GridUndo), GIMP_UNDO_IMAGE_GRID, undo_desc, @@ -466,9 +466,9 @@ undo_pop_image_grid (GimpUndo *undo, GridUndo *gu = undo->data; GimpGrid *grid; - grid = gimp_config_duplicate (GIMP_CONFIG (undo->gimage->grid)); + grid = gimp_config_duplicate (GIMP_CONFIG (undo->image->grid)); - gimp_image_set_grid (undo->gimage, gu->grid, FALSE); + gimp_image_set_grid (undo->image, gu->grid, FALSE); g_object_unref (gu->grid); gu->grid = grid; @@ -509,16 +509,16 @@ static void undo_free_image_sample_point (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_image_sample_point (GimpImage *gimage, +gimp_image_undo_push_image_sample_point (GimpImage *image, const gchar *undo_desc, GimpSamplePoint *sample_point) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (sample_point != NULL, FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (SamplePointUndo), sizeof (SamplePointUndo), GIMP_UNDO_IMAGE_SAMPLE_POINT, undo_desc, @@ -559,26 +559,26 @@ undo_pop_image_sample_point (GimpUndo *undo, if (spu->sample_point->x == -1) { - undo->gimage->sample_points = g_list_append (undo->gimage->sample_points, + undo->image->sample_points = g_list_append (undo->image->sample_points, spu->sample_point); spu->sample_point->x = spu->x; spu->sample_point->y = spu->y; gimp_image_sample_point_ref (spu->sample_point); - gimp_image_sample_point_added (undo->gimage, spu->sample_point); - gimp_image_update_sample_point (undo->gimage, spu->sample_point); + gimp_image_sample_point_added (undo->image, spu->sample_point); + gimp_image_update_sample_point (undo->image, spu->sample_point); } else if (spu->x == -1) { - gimp_image_remove_sample_point (undo->gimage, spu->sample_point, FALSE); + gimp_image_remove_sample_point (undo->image, spu->sample_point, FALSE); } else { - gimp_image_update_sample_point (undo->gimage, spu->sample_point); + gimp_image_update_sample_point (undo->image, spu->sample_point); spu->sample_point->x = spu->x; spu->sample_point->y = spu->y; - gimp_image_update_sample_point (undo->gimage, spu->sample_point); + gimp_image_update_sample_point (undo->image, spu->sample_point); } spu->x = old_x; @@ -617,14 +617,14 @@ static void undo_free_image_colormap (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_image_colormap (GimpImage *gimage, +gimp_image_undo_push_image_colormap (GimpImage *image, const gchar *undo_desc) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (ColormapUndo), sizeof (ColormapUndo), GIMP_UNDO_IMAGE_COLORMAP, undo_desc, @@ -635,8 +635,8 @@ gimp_image_undo_push_image_colormap (GimpImage *gimage, { ColormapUndo *cu = new->data; - cu->num_colors = gimp_image_get_colormap_size (gimage); - cu->cmap = g_memdup (gimp_image_get_colormap (gimage), + cu->num_colors = gimp_image_get_colormap_size (image); + cu->cmap = g_memdup (gimp_image_get_colormap (image), cu->num_colors * 3); return TRUE; @@ -654,11 +654,11 @@ undo_pop_image_colormap (GimpUndo *undo, guchar *cmap; gint num_colors; - num_colors = gimp_image_get_colormap_size (undo->gimage); - cmap = g_memdup (gimp_image_get_colormap (undo->gimage), + num_colors = gimp_image_get_colormap_size (undo->image); + cmap = g_memdup (gimp_image_get_colormap (undo->image), num_colors * 3); - gimp_image_set_colormap (undo->gimage, cu->cmap, cu->num_colors, FALSE); + gimp_image_set_colormap (undo->image, cu->cmap, cu->num_colors, FALSE); if (cu->cmap) g_free (cu->cmap); @@ -702,7 +702,7 @@ static void undo_free_drawable (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_drawable (GimpImage *gimage, +gimp_image_undo_push_drawable (GimpImage *image, const gchar *undo_desc, GimpDrawable *drawable, TileManager *tiles, @@ -716,7 +716,7 @@ gimp_image_undo_push_drawable (GimpImage *gimage, GimpUndo *new; gint64 size; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); g_return_val_if_fail (tiles != NULL, FALSE); g_return_val_if_fail (sparse == TRUE || @@ -736,7 +736,7 @@ gimp_image_undo_push_drawable (GimpImage *gimage, size = sizeof (DrawableUndo) + tile_manager_get_memsize (tiles, sparse); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (DrawableUndo), GIMP_UNDO_DRAWABLE, undo_desc, GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE, @@ -816,21 +816,21 @@ static void undo_free_drawable_mod (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_drawable_mod (GimpImage *gimage, +gimp_image_undo_push_drawable_mod (GimpImage *image, const gchar *undo_desc, GimpDrawable *drawable) { GimpUndo *new; gint64 size; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE); size = sizeof (DrawableModUndo) + tile_manager_get_memsize (drawable->tiles, FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (DrawableModUndo), GIMP_UNDO_DRAWABLE_MOD, undo_desc, GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE, @@ -914,7 +914,7 @@ static void undo_free_mask (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_mask (GimpImage *gimage, +gimp_image_undo_push_mask (GimpImage *image, const gchar *undo_desc, GimpChannel *mask) { @@ -923,7 +923,7 @@ gimp_image_undo_push_mask (GimpImage *gimage, GimpUndo *new; gint64 size; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (mask), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (mask)), FALSE); @@ -947,7 +947,7 @@ gimp_image_undo_push_mask (GimpImage *gimage, size += tile_manager_get_memsize (undo_tiles, FALSE); } - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (MaskUndo), GIMP_UNDO_MASK, undo_desc, GIMP_IS_SELECTION (mask) ? @@ -1096,7 +1096,7 @@ static void undo_free_item_rename (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_item_rename (GimpImage *gimage, +gimp_image_undo_push_item_rename (GimpImage *image, const gchar *undo_desc, GimpItem *item) { @@ -1104,7 +1104,7 @@ gimp_image_undo_push_item_rename (GimpImage *gimage, gint64 size; const gchar *name; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE); g_return_val_if_fail (gimp_item_is_attached (item), FALSE); @@ -1112,7 +1112,7 @@ gimp_image_undo_push_item_rename (GimpImage *gimage, size = sizeof (ItemRenameUndo) + strlen (name) + 1; - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (ItemRenameUndo), GIMP_UNDO_ITEM_RENAME, undo_desc, GIMP_DIRTY_ITEM_META, @@ -1182,17 +1182,17 @@ static void undo_free_item_displace (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_item_displace (GimpImage *gimage, +gimp_image_undo_push_item_displace (GimpImage *image, const gchar *undo_desc, GimpItem *item) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE); g_return_val_if_fail (gimp_item_is_attached (item), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, sizeof (ItemDisplaceUndo), sizeof (ItemDisplaceUndo), GIMP_UNDO_ITEM_DISPLACE, undo_desc, @@ -1263,17 +1263,17 @@ static void undo_free_item_visibility (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_item_visibility (GimpImage *gimage, +gimp_image_undo_push_item_visibility (GimpImage *image, const gchar *undo_desc, GimpItem *item) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE); g_return_val_if_fail (gimp_item_is_attached (item), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, sizeof (ItemVisibilityUndo), sizeof (ItemVisibilityUndo), GIMP_UNDO_ITEM_VISIBILITY, undo_desc, @@ -1335,17 +1335,17 @@ static void undo_free_item_linked (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_item_linked (GimpImage *gimage, +gimp_image_undo_push_item_linked (GimpImage *image, const gchar *undo_desc, GimpItem *item) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE); g_return_val_if_fail (gimp_item_is_attached (item), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, sizeof (ItemLinkedUndo), sizeof (ItemLinkedUndo), GIMP_UNDO_ITEM_LINKED, undo_desc, @@ -1401,7 +1401,7 @@ struct _LayerUndo GimpLayer *prev_layer; /* previous active layer */ }; -static gboolean undo_push_layer (GimpImage *gimage, +static gboolean undo_push_layer (GimpImage *image, const gchar *undo_desc, GimpUndoType type, GimpLayer *layer, @@ -1414,41 +1414,41 @@ static void undo_free_layer (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_layer_add (GimpImage *gimage, +gimp_image_undo_push_layer_add (GimpImage *image, const gchar *undo_desc, GimpLayer *layer, gint prev_position, GimpLayer *prev_layer) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); g_return_val_if_fail (! gimp_item_is_attached (GIMP_ITEM (layer)), FALSE); g_return_val_if_fail (prev_layer == NULL || GIMP_IS_LAYER (prev_layer), FALSE); - return undo_push_layer (gimage, undo_desc, GIMP_UNDO_LAYER_ADD, + return undo_push_layer (image, undo_desc, GIMP_UNDO_LAYER_ADD, layer, prev_position, prev_layer); } gboolean -gimp_image_undo_push_layer_remove (GimpImage *gimage, +gimp_image_undo_push_layer_remove (GimpImage *image, const gchar *undo_desc, GimpLayer *layer, gint prev_position, GimpLayer *prev_layer) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), FALSE); g_return_val_if_fail (prev_layer == NULL || GIMP_IS_LAYER (prev_layer), FALSE); - return undo_push_layer (gimage, undo_desc, GIMP_UNDO_LAYER_REMOVE, + return undo_push_layer (image, undo_desc, GIMP_UNDO_LAYER_REMOVE, layer, prev_position, prev_layer); } static gboolean -undo_push_layer (GimpImage *gimage, +undo_push_layer (GimpImage *image, const gchar *undo_desc, GimpUndoType type, GimpLayer *layer, @@ -1463,7 +1463,7 @@ undo_push_layer (GimpImage *gimage, if (type == GIMP_UNDO_LAYER_REMOVE) size += gimp_object_get_memsize (GIMP_OBJECT (layer), NULL); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (LayerUndo), type, undo_desc, GIMP_DIRTY_IMAGE_STRUCTURE, @@ -1492,7 +1492,7 @@ undo_pop_layer (GimpUndo *undo, GimpLayer *layer = GIMP_LAYER (GIMP_ITEM_UNDO (undo)->item); gboolean old_has_alpha; - old_has_alpha = gimp_image_has_alpha (undo->gimage); + old_has_alpha = gimp_image_has_alpha (undo->image); if ((undo_mode == GIMP_UNDO_MODE_UNDO && undo->undo_type == GIMP_UNDO_LAYER_ADD) || @@ -1504,10 +1504,10 @@ undo_pop_layer (GimpUndo *undo, undo->size += gimp_object_get_memsize (GIMP_OBJECT (layer), NULL); /* record the current position */ - lu->prev_position = gimp_image_get_layer_index (undo->gimage, layer); + lu->prev_position = gimp_image_get_layer_index (undo->image, layer); - gimp_container_remove (undo->gimage->layers, GIMP_OBJECT (layer)); - undo->gimage->layer_stack = g_slist_remove (undo->gimage->layer_stack, + gimp_container_remove (undo->image->layers, GIMP_OBJECT (layer)); + undo->image->layer_stack = g_slist_remove (undo->image->layer_stack, layer); if (gimp_layer_is_floating_sel (layer)) @@ -1519,27 +1519,27 @@ undo_pop_layer (GimpUndo *undo, */ gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (layer)); - undo->gimage->floating_sel = NULL; + undo->image->floating_sel = NULL; /* activate the underlying drawable */ floating_sel_activate_drawable (layer); - gimp_image_floating_selection_changed (undo->gimage); + gimp_image_floating_selection_changed (undo->image); } - else if (layer == gimp_image_get_active_layer (undo->gimage)) + else if (layer == gimp_image_get_active_layer (undo->image)) { if (lu->prev_layer) { - gimp_image_set_active_layer (undo->gimage, lu->prev_layer); + gimp_image_set_active_layer (undo->image, lu->prev_layer); } - else if (undo->gimage->layer_stack) + else if (undo->image->layer_stack) { - gimp_image_set_active_layer (undo->gimage, - undo->gimage->layer_stack->data); + gimp_image_set_active_layer (undo->image, + undo->image->layer_stack->data); } else { - gimp_image_set_active_layer (undo->gimage, NULL); + gimp_image_set_active_layer (undo->image, NULL); } } @@ -1552,18 +1552,18 @@ undo_pop_layer (GimpUndo *undo, undo->size -= gimp_object_get_memsize (GIMP_OBJECT (layer), NULL); /* record the active layer */ - lu->prev_layer = gimp_image_get_active_layer (undo->gimage); + lu->prev_layer = gimp_image_get_active_layer (undo->image); /* if this is a floating selection, set the fs pointer */ if (gimp_layer_is_floating_sel (layer)) - undo->gimage->floating_sel = layer; + undo->image->floating_sel = layer; - gimp_container_insert (undo->gimage->layers, + gimp_container_insert (undo->image->layers, GIMP_OBJECT (layer), lu->prev_position); - gimp_image_set_active_layer (undo->gimage, layer); + gimp_image_set_active_layer (undo->image, layer); if (gimp_layer_is_floating_sel (layer)) - gimp_image_floating_selection_changed (undo->gimage); + gimp_image_floating_selection_changed (undo->image); GIMP_ITEM (layer)->removed = FALSE; @@ -1571,7 +1571,7 @@ undo_pop_layer (GimpUndo *undo, GIMP_ITEM (layer->mask)->removed = FALSE; } - if (old_has_alpha != gimp_image_has_alpha (undo->gimage)) + if (old_has_alpha != gimp_image_has_alpha (undo->image)) accum->alpha_changed = TRUE; return TRUE; @@ -1603,17 +1603,17 @@ static void undo_free_layer_reposition (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_layer_reposition (GimpImage *gimage, +gimp_image_undo_push_layer_reposition (GimpImage *image, const gchar *undo_desc, GimpLayer *layer) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, sizeof (LayerRepositionUndo), sizeof (LayerRepositionUndo), GIMP_UNDO_LAYER_REPOSITION, undo_desc, @@ -1625,7 +1625,7 @@ gimp_image_undo_push_layer_reposition (GimpImage *gimage, { LayerRepositionUndo *lru = new->data; - lru->old_position = gimp_image_get_layer_index (gimage, layer); + lru->old_position = gimp_image_get_layer_index (image, layer); return TRUE; } @@ -1643,8 +1643,8 @@ undo_pop_layer_reposition (GimpUndo *undo, gint pos; /* what's the layer's current index? */ - pos = gimp_image_get_layer_index (undo->gimage, layer); - gimp_image_position_layer (undo->gimage, layer, lru->old_position, + pos = gimp_image_get_layer_index (undo->image, layer); + gimp_image_position_layer (undo->image, layer, lru->old_position, FALSE, NULL); lru->old_position = pos; @@ -1672,7 +1672,7 @@ struct _LayerPropertiesUndo gboolean old_lock_alpha; }; -static gboolean undo_push_layer_properties (GimpImage *gimage, +static gboolean undo_push_layer_properties (GimpImage *image, GimpUndoType undo_type, const gchar *undo_desc, GimpLayer *layer); @@ -1683,45 +1683,45 @@ static void undo_free_layer_properties (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_layer_mode (GimpImage *gimage, +gimp_image_undo_push_layer_mode (GimpImage *image, const gchar *undo_desc, GimpLayer *layer) { - return undo_push_layer_properties (gimage, GIMP_UNDO_LAYER_MODE, + return undo_push_layer_properties (image, GIMP_UNDO_LAYER_MODE, undo_desc, layer); } gboolean -gimp_image_undo_push_layer_opacity (GimpImage *gimage, +gimp_image_undo_push_layer_opacity (GimpImage *image, const gchar *undo_desc, GimpLayer *layer) { - return undo_push_layer_properties (gimage, GIMP_UNDO_LAYER_OPACITY, + return undo_push_layer_properties (image, GIMP_UNDO_LAYER_OPACITY, undo_desc, layer); } gboolean -gimp_image_undo_push_layer_lock_alpha (GimpImage *gimage, +gimp_image_undo_push_layer_lock_alpha (GimpImage *image, const gchar *undo_desc, GimpLayer *layer) { - return undo_push_layer_properties (gimage, GIMP_UNDO_LAYER_LOCK_ALPHA, + return undo_push_layer_properties (image, GIMP_UNDO_LAYER_LOCK_ALPHA, undo_desc, layer); } static gboolean -undo_push_layer_properties (GimpImage *gimage, +undo_push_layer_properties (GimpImage *image, GimpUndoType undo_type, const gchar *undo_desc, GimpLayer *layer) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, sizeof (LayerPropertiesUndo), sizeof (LayerPropertiesUndo), undo_type, undo_desc, @@ -1804,18 +1804,18 @@ undo_free_layer_properties (GimpUndo *undo, /*********************/ gboolean -gimp_image_undo_push_text_layer (GimpImage *gimage, +gimp_image_undo_push_text_layer (GimpImage *image, const gchar *undo_desc, GimpTextLayer *layer, const GParamSpec *pspec) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_TEXT_LAYER (layer), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_TEXT_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_TEXT_UNDO, 0, 0, GIMP_UNDO_TEXT_LAYER, undo_desc, GIMP_DIRTY_ITEM | GIMP_DIRTY_DRAWABLE, @@ -1850,17 +1850,17 @@ static void undo_free_text_layer_modified (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_text_layer_modified (GimpImage *gimage, +gimp_image_undo_push_text_layer_modified (GimpImage *image, const gchar *undo_desc, GimpTextLayer *layer) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_TEXT_LAYER (layer), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, sizeof (TextLayerModifiedUndo), sizeof (TextLayerModifiedUndo), GIMP_UNDO_TEXT_LAYER_MODIFIED, undo_desc, @@ -1925,7 +1925,7 @@ struct _LayerMaskUndo GimpLayerMask *mask; }; -static gboolean undo_push_layer_mask (GimpImage *gimage, +static gboolean undo_push_layer_mask (GimpImage *image, const gchar *undo_desc, GimpUndoType type, GimpLayer *layer, @@ -1937,28 +1937,28 @@ static void undo_free_layer_mask (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_layer_mask_add (GimpImage *gimage, +gimp_image_undo_push_layer_mask_add (GimpImage *image, const gchar *undo_desc, GimpLayer *layer, GimpLayerMask *mask) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), FALSE); g_return_val_if_fail (GIMP_IS_LAYER_MASK (mask), FALSE); g_return_val_if_fail (! gimp_item_is_attached (GIMP_ITEM (mask)), FALSE); - return undo_push_layer_mask (gimage, undo_desc, GIMP_UNDO_LAYER_MASK_ADD, + return undo_push_layer_mask (image, undo_desc, GIMP_UNDO_LAYER_MASK_ADD, layer, mask); } gboolean -gimp_image_undo_push_layer_mask_remove (GimpImage *gimage, +gimp_image_undo_push_layer_mask_remove (GimpImage *image, const gchar *undo_desc, GimpLayer *layer, GimpLayerMask *mask) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (layer)), FALSE); g_return_val_if_fail (GIMP_IS_LAYER_MASK (mask), FALSE); @@ -1966,13 +1966,13 @@ gimp_image_undo_push_layer_mask_remove (GimpImage *gimage, g_return_val_if_fail (mask->layer == layer, FALSE); g_return_val_if_fail (layer->mask == mask, FALSE); - return undo_push_layer_mask (gimage, undo_desc, GIMP_UNDO_LAYER_MASK_REMOVE, + return undo_push_layer_mask (image, undo_desc, GIMP_UNDO_LAYER_MASK_REMOVE, layer, mask); } static gboolean -undo_push_layer_mask (GimpImage *gimage, +undo_push_layer_mask (GimpImage *image, const gchar *undo_desc, GimpUndoType type, GimpLayer *layer, @@ -1986,7 +1986,7 @@ undo_push_layer_mask (GimpImage *gimage, if (type == GIMP_UNDO_LAYER_MASK_REMOVE) size += gimp_object_get_memsize (GIMP_OBJECT (mask), NULL); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (LayerMaskUndo), type, undo_desc, GIMP_DIRTY_IMAGE_STRUCTURE, @@ -2061,7 +2061,7 @@ struct _LayerMaskPropertyUndo gboolean old_show; }; -static gboolean undo_push_layer_mask_properties (GimpImage *gimage, +static gboolean undo_push_layer_mask_properties (GimpImage *image, GimpUndoType undo_type, const gchar *undo_desc, GimpLayerMask *mask); @@ -2072,25 +2072,25 @@ static void undo_free_layer_mask_properties (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_layer_mask_apply (GimpImage *gimage, +gimp_image_undo_push_layer_mask_apply (GimpImage *image, const gchar *undo_desc, GimpLayerMask *mask) { - return undo_push_layer_mask_properties (gimage, GIMP_UNDO_LAYER_MASK_APPLY, + return undo_push_layer_mask_properties (image, GIMP_UNDO_LAYER_MASK_APPLY, undo_desc, mask); } gboolean -gimp_image_undo_push_layer_mask_show (GimpImage *gimage, +gimp_image_undo_push_layer_mask_show (GimpImage *image, const gchar *undo_desc, GimpLayerMask *mask) { - return undo_push_layer_mask_properties (gimage, GIMP_UNDO_LAYER_MASK_SHOW, + return undo_push_layer_mask_properties (image, GIMP_UNDO_LAYER_MASK_SHOW, undo_desc, mask); } static gboolean -undo_push_layer_mask_properties (GimpImage *gimage, +undo_push_layer_mask_properties (GimpImage *image, GimpUndoType undo_type, const gchar *undo_desc, GimpLayerMask *mask) @@ -2098,13 +2098,13 @@ undo_push_layer_mask_properties (GimpImage *gimage, GimpUndo *new; gint64 size; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER_MASK (mask), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (mask)), FALSE); size = sizeof (LayerMaskPropertyUndo); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (LayerMaskPropertyUndo), undo_type, undo_desc, GIMP_DIRTY_ITEM_META, @@ -2177,7 +2177,7 @@ struct _ChannelUndo GimpChannel *prev_channel; /* previous active channel */ }; -static gboolean undo_push_channel (GimpImage *gimage, +static gboolean undo_push_channel (GimpImage *image, const gchar *undo_desc, GimpUndoType type, GimpChannel *channel, @@ -2190,41 +2190,41 @@ static void undo_free_channel (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_channel_add (GimpImage *gimage, +gimp_image_undo_push_channel_add (GimpImage *image, const gchar *undo_desc, GimpChannel *channel, gint prev_position, GimpChannel *prev_channel) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); g_return_val_if_fail (! gimp_item_is_attached (GIMP_ITEM (channel)), FALSE); g_return_val_if_fail (prev_channel == NULL || GIMP_IS_CHANNEL (prev_channel), FALSE); - return undo_push_channel (gimage, undo_desc, GIMP_UNDO_CHANNEL_ADD, + return undo_push_channel (image, undo_desc, GIMP_UNDO_CHANNEL_ADD, channel, prev_position, prev_channel); } gboolean -gimp_image_undo_push_channel_remove (GimpImage *gimage, +gimp_image_undo_push_channel_remove (GimpImage *image, const gchar *undo_desc, GimpChannel *channel, gint prev_position, GimpChannel *prev_channel) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (channel)), FALSE); g_return_val_if_fail (prev_channel == NULL || GIMP_IS_CHANNEL (prev_channel), FALSE); - return undo_push_channel (gimage, undo_desc, GIMP_UNDO_CHANNEL_REMOVE, + return undo_push_channel (image, undo_desc, GIMP_UNDO_CHANNEL_REMOVE, channel, prev_position, prev_channel); } static gboolean -undo_push_channel (GimpImage *gimage, +undo_push_channel (GimpImage *image, const gchar *undo_desc, GimpUndoType type, GimpChannel *channel, @@ -2239,7 +2239,7 @@ undo_push_channel (GimpImage *gimage, if (type == GIMP_UNDO_CHANNEL_REMOVE) size += gimp_object_get_memsize (GIMP_OBJECT (channel), NULL); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (ChannelUndo), type, undo_desc, GIMP_DIRTY_IMAGE_STRUCTURE, @@ -2277,18 +2277,18 @@ undo_pop_channel (GimpUndo *undo, undo->size += gimp_object_get_memsize (GIMP_OBJECT (channel), NULL); /* record the current position */ - cu->prev_position = gimp_image_get_channel_index (undo->gimage, + cu->prev_position = gimp_image_get_channel_index (undo->image, channel); - gimp_container_remove (undo->gimage->channels, GIMP_OBJECT (channel)); + gimp_container_remove (undo->image->channels, GIMP_OBJECT (channel)); gimp_item_removed (GIMP_ITEM (channel)); - if (channel == gimp_image_get_active_channel (undo->gimage)) + if (channel == gimp_image_get_active_channel (undo->image)) { if (cu->prev_channel) - gimp_image_set_active_channel (undo->gimage, cu->prev_channel); + gimp_image_set_active_channel (undo->image, cu->prev_channel); else - gimp_image_unset_active_channel (undo->gimage); + gimp_image_unset_active_channel (undo->image); } } else @@ -2298,11 +2298,11 @@ undo_pop_channel (GimpUndo *undo, undo->size -= gimp_object_get_memsize (GIMP_OBJECT (channel), NULL); /* record the active channel */ - cu->prev_channel = gimp_image_get_active_channel (undo->gimage); + cu->prev_channel = gimp_image_get_active_channel (undo->image); - gimp_container_insert (undo->gimage->channels, + gimp_container_insert (undo->image->channels, GIMP_OBJECT (channel), cu->prev_position); - gimp_image_set_active_channel (undo->gimage, channel); + gimp_image_set_active_channel (undo->image, channel); GIMP_ITEM (channel)->removed = FALSE; } @@ -2336,17 +2336,17 @@ static void undo_free_channel_reposition (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_channel_reposition (GimpImage *gimage, +gimp_image_undo_push_channel_reposition (GimpImage *image, const gchar *undo_desc, GimpChannel *channel) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (channel)), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, sizeof (ChannelRepositionUndo), sizeof (ChannelRepositionUndo), GIMP_UNDO_CHANNEL_REPOSITION, undo_desc, @@ -2358,7 +2358,7 @@ gimp_image_undo_push_channel_reposition (GimpImage *gimage, { ChannelRepositionUndo *cru = new->data; - cru->old_position = gimp_image_get_channel_index (gimage, channel); + cru->old_position = gimp_image_get_channel_index (image, channel); return TRUE; } @@ -2375,8 +2375,8 @@ undo_pop_channel_reposition (GimpUndo *undo, GimpChannel *channel = GIMP_CHANNEL (GIMP_ITEM_UNDO (undo)->item); gint pos; - pos = gimp_image_get_channel_index (undo->gimage, channel); - gimp_image_position_channel (undo->gimage, channel, cru->old_position, + pos = gimp_image_get_channel_index (undo->image, channel); + gimp_image_position_channel (undo->image, channel, cru->old_position, FALSE, NULL); cru->old_position = pos; @@ -2409,17 +2409,17 @@ static void undo_free_channel_color (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_channel_color (GimpImage *gimage, +gimp_image_undo_push_channel_color (GimpImage *image, const gchar *undo_desc, GimpChannel *channel) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (channel)), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, sizeof (ChannelColorUndo), sizeof (ChannelColorUndo), GIMP_UNDO_CHANNEL_COLOR, undo_desc, @@ -2475,7 +2475,7 @@ struct _VectorsUndo GimpVectors *prev_vectors; /* previous active vectors */ }; -static gboolean undo_push_vectors (GimpImage *gimage, +static gboolean undo_push_vectors (GimpImage *image, const gchar *undo_desc, GimpUndoType type, GimpVectors *vectors, @@ -2488,41 +2488,41 @@ static void undo_free_vectors (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_vectors_add (GimpImage *gimage, +gimp_image_undo_push_vectors_add (GimpImage *image, const gchar *undo_desc, GimpVectors *vectors, gint prev_position, GimpVectors *prev_vectors) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); g_return_val_if_fail (! gimp_item_is_attached (GIMP_ITEM (vectors)), FALSE); g_return_val_if_fail (prev_vectors == NULL || GIMP_IS_VECTORS (prev_vectors), FALSE); - return undo_push_vectors (gimage, undo_desc, GIMP_UNDO_VECTORS_ADD, + return undo_push_vectors (image, undo_desc, GIMP_UNDO_VECTORS_ADD, vectors, prev_position, prev_vectors); } gboolean -gimp_image_undo_push_vectors_remove (GimpImage *gimage, +gimp_image_undo_push_vectors_remove (GimpImage *image, const gchar *undo_desc, GimpVectors *vectors, gint prev_position, GimpVectors *prev_vectors) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (vectors)), FALSE); g_return_val_if_fail (prev_vectors == NULL || GIMP_IS_VECTORS (prev_vectors), FALSE); - return undo_push_vectors (gimage, undo_desc, GIMP_UNDO_VECTORS_REMOVE, + return undo_push_vectors (image, undo_desc, GIMP_UNDO_VECTORS_REMOVE, vectors, prev_position, prev_vectors); } static gboolean -undo_push_vectors (GimpImage *gimage, +undo_push_vectors (GimpImage *image, const gchar *undo_desc, GimpUndoType type, GimpVectors *vectors, @@ -2537,7 +2537,7 @@ undo_push_vectors (GimpImage *gimage, if (type == GIMP_UNDO_VECTORS_REMOVE) size += gimp_object_get_memsize (GIMP_OBJECT (vectors), NULL); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (VectorsUndo), type, undo_desc, GIMP_DIRTY_IMAGE_STRUCTURE, @@ -2575,14 +2575,14 @@ undo_pop_vectors (GimpUndo *undo, undo->size += gimp_object_get_memsize (GIMP_OBJECT (vectors), NULL); /* record the current position */ - vu->prev_position = gimp_image_get_vectors_index (undo->gimage, + vu->prev_position = gimp_image_get_vectors_index (undo->image, vectors); - gimp_container_remove (undo->gimage->vectors, GIMP_OBJECT (vectors)); + gimp_container_remove (undo->image->vectors, GIMP_OBJECT (vectors)); gimp_item_removed (GIMP_ITEM (vectors)); - if (vectors == gimp_image_get_active_vectors (undo->gimage)) - gimp_image_set_active_vectors (undo->gimage, vu->prev_vectors); + if (vectors == gimp_image_get_active_vectors (undo->image)) + gimp_image_set_active_vectors (undo->image, vu->prev_vectors); } else { @@ -2591,11 +2591,11 @@ undo_pop_vectors (GimpUndo *undo, undo->size -= gimp_object_get_memsize (GIMP_OBJECT (vectors), NULL); /* record the active vectors */ - vu->prev_vectors = gimp_image_get_active_vectors (undo->gimage); + vu->prev_vectors = gimp_image_get_active_vectors (undo->image); - gimp_container_insert (undo->gimage->vectors, + gimp_container_insert (undo->image->vectors, GIMP_OBJECT (vectors), vu->prev_position); - gimp_image_set_active_vectors (undo->gimage, vectors); + gimp_image_set_active_vectors (undo->image, vectors); GIMP_ITEM (vectors)->removed = FALSE; } @@ -2629,7 +2629,7 @@ static void undo_free_vectors_mod (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_vectors_mod (GimpImage *gimage, +gimp_image_undo_push_vectors_mod (GimpImage *image, const gchar *undo_desc, GimpVectors *vectors) { @@ -2637,7 +2637,7 @@ gimp_image_undo_push_vectors_mod (GimpImage *gimage, GimpUndo *new; gint64 size; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (vectors)), FALSE); @@ -2648,7 +2648,7 @@ gimp_image_undo_push_vectors_mod (GimpImage *gimage, size = (sizeof (VectorsModUndo) + gimp_object_get_memsize (GIMP_OBJECT (copy), NULL)); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, size, sizeof (VectorsModUndo), GIMP_UNDO_VECTORS_MOD, undo_desc, GIMP_DIRTY_ITEM | GIMP_DIRTY_VECTORS, @@ -2735,17 +2735,17 @@ static void undo_free_vectors_reposition (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_vectors_reposition (GimpImage *gimage, +gimp_image_undo_push_vectors_reposition (GimpImage *image, const gchar *undo_desc, GimpVectors *vectors) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (vectors)), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, sizeof (VectorsRepositionUndo), sizeof (VectorsRepositionUndo), GIMP_UNDO_VECTORS_REPOSITION, undo_desc, @@ -2757,7 +2757,7 @@ gimp_image_undo_push_vectors_reposition (GimpImage *gimage, { VectorsRepositionUndo *vru = new->data; - vru->old_position = gimp_image_get_vectors_index (gimage, vectors); + vru->old_position = gimp_image_get_vectors_index (image, vectors); return TRUE; } @@ -2775,8 +2775,8 @@ undo_pop_vectors_reposition (GimpUndo *undo, gint pos; /* what's the vectors's current index? */ - pos = gimp_image_get_vectors_index (undo->gimage, vectors); - gimp_image_position_vectors (undo->gimage, vectors, vru->old_position, + pos = gimp_image_get_vectors_index (undo->image, vectors); + gimp_image_position_vectors (undo->image, vectors, vru->old_position, FALSE, NULL); vru->old_position = pos; @@ -2810,18 +2810,18 @@ static void undo_free_fs_to_layer (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_fs_to_layer (GimpImage *gimage, +gimp_image_undo_push_fs_to_layer (GimpImage *image, const gchar *undo_desc, GimpLayer *floating_layer, GimpDrawable *drawable) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (floating_layer), FALSE); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (FStoLayerUndo), sizeof (FStoLayerUndo), GIMP_UNDO_FS_TO_LAYER, undo_desc, @@ -2858,8 +2858,8 @@ undo_pop_fs_to_layer (GimpUndo *undo, gimp_viewable_invalidate_preview (GIMP_VIEWABLE (fsu->floating_layer)); fsu->floating_layer->fs.drawable = fsu->drawable; - gimp_image_set_active_layer (undo->gimage, fsu->floating_layer); - undo->gimage->floating_sel = fsu->floating_layer; + gimp_image_set_active_layer (undo->image, fsu->floating_layer); + undo->image->floating_sel = fsu->floating_layer; /* store the contents of the drawable */ floating_sel_store (fsu->floating_layer, @@ -2889,7 +2889,7 @@ undo_pop_fs_to_layer (GimpUndo *undo, /* update the pointers */ fsu->floating_layer->fs.drawable = NULL; - undo->gimage->floating_sel = NULL; + undo->image->floating_sel = NULL; break; } @@ -2900,7 +2900,7 @@ undo_pop_fs_to_layer (GimpUndo *undo, GIMP_ITEM (fsu->floating_layer)->width, GIMP_ITEM (fsu->floating_layer)->height); - gimp_image_floating_selection_changed (undo->gimage); + gimp_image_floating_selection_changed (undo->image); return TRUE; } @@ -2930,16 +2930,16 @@ static gboolean undo_pop_fs_rigor (GimpUndo *undo, GimpUndoAccumulator *accum); gboolean -gimp_image_undo_push_fs_rigor (GimpImage *gimage, +gimp_image_undo_push_fs_rigor (GimpImage *image, const gchar *undo_desc, GimpLayer *floating_layer) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (floating_layer), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, 0, 0, GIMP_UNDO_FS_RIGOR, undo_desc, GIMP_DIRTY_NONE, @@ -2990,16 +2990,16 @@ static gboolean undo_pop_fs_relax (GimpUndo *undo, GimpUndoAccumulator *accum); gboolean -gimp_image_undo_push_fs_relax (GimpImage *gimage, +gimp_image_undo_push_fs_relax (GimpImage *image, const gchar *undo_desc, GimpLayer *floating_layer) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (floating_layer), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_ITEM_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_ITEM_UNDO, 0, 0, GIMP_UNDO_FS_RELAX, undo_desc, GIMP_DIRTY_NONE, @@ -3049,7 +3049,7 @@ typedef struct _ParasiteUndo ParasiteUndo; struct _ParasiteUndo { - GimpImage *gimage; + GimpImage *image; GimpItem *item; GimpParasite *parasite; gchar *name; @@ -3062,15 +3062,15 @@ static void undo_free_parasite (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_image_undo_push_image_parasite (GimpImage *gimage, +gimp_image_undo_push_image_parasite (GimpImage *image, const gchar *undo_desc, gpointer parasite) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (ParasiteUndo), sizeof (ParasiteUndo), GIMP_UNDO_PARASITE_ATTACH, undo_desc, @@ -3081,10 +3081,10 @@ gimp_image_undo_push_image_parasite (GimpImage *gimage, { ParasiteUndo *pu = new->data; - pu->gimage = gimage; + pu->image = image; pu->item = NULL; pu->name = g_strdup (gimp_parasite_name (parasite)); - pu->parasite = gimp_parasite_copy (gimp_image_parasite_find (gimage, + pu->parasite = gimp_parasite_copy (gimp_image_parasite_find (image, pu->name)); return TRUE; @@ -3094,15 +3094,15 @@ gimp_image_undo_push_image_parasite (GimpImage *gimage, } gboolean -gimp_image_undo_push_image_parasite_remove (GimpImage *gimage, +gimp_image_undo_push_image_parasite_remove (GimpImage *image, const gchar *undo_desc, const gchar *name) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (ParasiteUndo), sizeof (ParasiteUndo), GIMP_UNDO_PARASITE_REMOVE, undo_desc, @@ -3113,10 +3113,10 @@ gimp_image_undo_push_image_parasite_remove (GimpImage *gimage, { ParasiteUndo *pu = new->data; - pu->gimage = gimage; + pu->image = image; pu->item = NULL; pu->name = g_strdup (name); - pu->parasite = gimp_parasite_copy (gimp_image_parasite_find (gimage, + pu->parasite = gimp_parasite_copy (gimp_image_parasite_find (image, pu->name)); return TRUE; @@ -3126,18 +3126,18 @@ gimp_image_undo_push_image_parasite_remove (GimpImage *gimage, } gboolean -gimp_image_undo_push_item_parasite (GimpImage *gimage, +gimp_image_undo_push_item_parasite (GimpImage *image, const gchar *undo_desc, GimpItem *item, gpointer parasite) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE); g_return_val_if_fail (gimp_item_is_attached (item), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (ParasiteUndo), sizeof (ParasiteUndo), GIMP_UNDO_PARASITE_ATTACH, undo_desc, @@ -3148,7 +3148,7 @@ gimp_image_undo_push_item_parasite (GimpImage *gimage, { ParasiteUndo *pu = new->data; - pu->gimage = NULL; + pu->image = NULL; pu->item = item; pu->name = g_strdup (gimp_parasite_name (parasite)); pu->parasite = gimp_parasite_copy (gimp_item_parasite_find (item, @@ -3160,18 +3160,18 @@ gimp_image_undo_push_item_parasite (GimpImage *gimage, } gboolean -gimp_image_undo_push_item_parasite_remove (GimpImage *gimage, +gimp_image_undo_push_item_parasite_remove (GimpImage *image, const gchar *undo_desc, GimpItem *item, const gchar *name) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE); g_return_val_if_fail (gimp_item_is_attached (item), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (ParasiteUndo), sizeof (ParasiteUndo), GIMP_UNDO_PARASITE_REMOVE, undo_desc, @@ -3182,7 +3182,7 @@ gimp_image_undo_push_item_parasite_remove (GimpImage *gimage, { ParasiteUndo *pu = new->data; - pu->gimage = NULL; + pu->image = NULL; pu->item = item; pu->name = g_strdup (name); pu->parasite = gimp_parasite_copy (gimp_item_parasite_find (item, @@ -3203,14 +3203,14 @@ undo_pop_parasite (GimpUndo *undo, tmp = pu->parasite; - if (pu->gimage) + if (pu->image) { - pu->parasite = gimp_parasite_copy (gimp_image_parasite_find (undo->gimage, + pu->parasite = gimp_parasite_copy (gimp_image_parasite_find (undo->image, pu->name)); if (tmp) - gimp_parasite_list_add (pu->gimage->parasites, tmp); + gimp_parasite_list_add (pu->image->parasites, tmp); else - gimp_parasite_list_remove (pu->gimage->parasites, pu->name); + gimp_parasite_list_remove (pu->image->parasites, pu->name); } else if (pu->item) { @@ -3223,12 +3223,12 @@ undo_pop_parasite (GimpUndo *undo, } else { - pu->parasite = gimp_parasite_copy (gimp_parasite_find (undo->gimage->gimp, + pu->parasite = gimp_parasite_copy (gimp_parasite_find (undo->image->gimp, pu->name)); if (tmp) - gimp_parasite_attach (undo->gimage->gimp, tmp); + gimp_parasite_attach (undo->image->gimp, tmp); else - gimp_parasite_detach (undo->gimage->gimp, pu->name); + gimp_parasite_detach (undo->image->gimp, pu->name); } if (tmp) @@ -3261,19 +3261,19 @@ static gboolean undo_pop_cantundo (GimpUndo *undo, GimpUndoAccumulator *accum); gboolean -gimp_image_undo_push_cantundo (GimpImage *gimage, +gimp_image_undo_push_cantundo (GimpImage *image, const gchar *undo_desc) { GimpUndo *new; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); /* This is the sole purpose of this type of undo: the ability to * mark an image as having been mutated, without really providing * any adequate undo facility. */ - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, 0, 0, GIMP_UNDO_CANT, undo_desc, GIMP_DIRTY_ALL, diff --git a/app/core/gimpimage-undo-push.h b/app/core/gimpimage-undo-push.h index f5cff58bbe..374abafc2e 100644 --- a/app/core/gimpimage-undo-push.h +++ b/app/core/gimpimage-undo-push.h @@ -22,28 +22,28 @@ /* image undos */ -gboolean gimp_image_undo_push_image_type (GimpImage *gimage, +gboolean gimp_image_undo_push_image_type (GimpImage *image, const gchar *undo_desc); -gboolean gimp_image_undo_push_image_size (GimpImage *gimage, +gboolean gimp_image_undo_push_image_size (GimpImage *image, const gchar *undo_desc); -gboolean gimp_image_undo_push_image_resolution (GimpImage *gimage, +gboolean gimp_image_undo_push_image_resolution (GimpImage *image, const gchar *undo_desc); -gboolean gimp_image_undo_push_image_guide (GimpImage *gimage, +gboolean gimp_image_undo_push_image_guide (GimpImage *image, const gchar *undo_desc, GimpGuide *guide); -gboolean gimp_image_undo_push_image_grid (GimpImage *gimage, +gboolean gimp_image_undo_push_image_grid (GimpImage *image, const gchar *undo_desc, GimpGrid *grid); -gboolean gimp_image_undo_push_image_sample_point (GimpImage *gimage, +gboolean gimp_image_undo_push_image_sample_point (GimpImage *image, const gchar *undo_desc, GimpSamplePoint *sample_point); -gboolean gimp_image_undo_push_image_colormap (GimpImage *gimage, +gboolean gimp_image_undo_push_image_colormap (GimpImage *image, const gchar *undo_desc); /* drawable undo */ -gboolean gimp_image_undo_push_drawable (GimpImage *gimage, +gboolean gimp_image_undo_push_drawable (GimpImage *image, const gchar *undo_desc, GimpDrawable *drawable, TileManager *tiles, @@ -52,157 +52,157 @@ gboolean gimp_image_undo_push_drawable (GimpImage *gimage, gint y, gint width, gint height); -gboolean gimp_image_undo_push_drawable_mod (GimpImage *gimage, +gboolean gimp_image_undo_push_drawable_mod (GimpImage *image, const gchar *undo_desc, GimpDrawable *drawable); /* mask undo */ -gboolean gimp_image_undo_push_mask (GimpImage *gimage, +gboolean gimp_image_undo_push_mask (GimpImage *image, const gchar *undo_desc, GimpChannel *mask); /* item undos */ -gboolean gimp_image_undo_push_item_rename (GimpImage *gimage, +gboolean gimp_image_undo_push_item_rename (GimpImage *image, const gchar *undo_desc, GimpItem *item); -gboolean gimp_image_undo_push_item_displace (GimpImage *gimage, +gboolean gimp_image_undo_push_item_displace (GimpImage *image, const gchar *undo_desc, GimpItem *item); -gboolean gimp_image_undo_push_item_visibility (GimpImage *gimage, +gboolean gimp_image_undo_push_item_visibility (GimpImage *image, const gchar *undo_desc, GimpItem *item); -gboolean gimp_image_undo_push_item_linked (GimpImage *gimage, +gboolean gimp_image_undo_push_item_linked (GimpImage *image, const gchar *undo_desc, GimpItem *item); /* layer undos */ -gboolean gimp_image_undo_push_layer_add (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_add (GimpImage *image, const gchar *undo_desc, GimpLayer *layer, gint prev_position, GimpLayer *prev_layer); -gboolean gimp_image_undo_push_layer_remove (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_remove (GimpImage *image, const gchar *undo_desc, GimpLayer *layer, gint prev_position, GimpLayer *prev_layer); -gboolean gimp_image_undo_push_layer_reposition (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_reposition (GimpImage *image, const gchar *undo_desc, GimpLayer *layer); -gboolean gimp_image_undo_push_layer_mode (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_mode (GimpImage *image, const gchar *undo_desc, GimpLayer *layer); -gboolean gimp_image_undo_push_layer_opacity (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_opacity (GimpImage *image, const gchar *undo_desc, GimpLayer *layer); -gboolean gimp_image_undo_push_layer_lock_alpha (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_lock_alpha (GimpImage *image, const gchar *undo_desc, GimpLayer *layer); /* text layer undos */ -gboolean gimp_image_undo_push_text_layer (GimpImage *gimage, +gboolean gimp_image_undo_push_text_layer (GimpImage *image, const gchar *undo_desc, GimpTextLayer *layer, const GParamSpec *pspec); -gboolean gimp_image_undo_push_text_layer_modified (GimpImage *gimage, +gboolean gimp_image_undo_push_text_layer_modified (GimpImage *image, const gchar *undo_desc, GimpTextLayer *layer); /* layer mask undos */ -gboolean gimp_image_undo_push_layer_mask_add (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_mask_add (GimpImage *image, const gchar *undo_desc, GimpLayer *layer, GimpLayerMask *mask); -gboolean gimp_image_undo_push_layer_mask_remove (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_mask_remove (GimpImage *image, const gchar *undo_desc, GimpLayer *layer, GimpLayerMask *mask); -gboolean gimp_image_undo_push_layer_mask_apply (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_mask_apply (GimpImage *image, const gchar *undo_desc, GimpLayerMask *mask); -gboolean gimp_image_undo_push_layer_mask_show (GimpImage *gimage, +gboolean gimp_image_undo_push_layer_mask_show (GimpImage *image, const gchar *undo_desc, GimpLayerMask *mask); /* channel undos */ -gboolean gimp_image_undo_push_channel_add (GimpImage *gimage, +gboolean gimp_image_undo_push_channel_add (GimpImage *image, const gchar *undo_desc, GimpChannel *channel, gint prev_position, GimpChannel *prev_channel); -gboolean gimp_image_undo_push_channel_remove (GimpImage *gimage, +gboolean gimp_image_undo_push_channel_remove (GimpImage *image, const gchar *undo_desc, GimpChannel *channel, gint prev_position, GimpChannel *prev_channel); -gboolean gimp_image_undo_push_channel_reposition (GimpImage *gimage, +gboolean gimp_image_undo_push_channel_reposition (GimpImage *image, const gchar *undo_desc, GimpChannel *channel); -gboolean gimp_image_undo_push_channel_color (GimpImage *gimage, +gboolean gimp_image_undo_push_channel_color (GimpImage *image, const gchar *undo_desc, GimpChannel *channel); /* vectors undos */ -gboolean gimp_image_undo_push_vectors_add (GimpImage *gimage, +gboolean gimp_image_undo_push_vectors_add (GimpImage *image, const gchar *undo_desc, GimpVectors *vectors, gint prev_position, GimpVectors *prev_vectors); -gboolean gimp_image_undo_push_vectors_remove (GimpImage *gimage, +gboolean gimp_image_undo_push_vectors_remove (GimpImage *image, const gchar *undo_desc, GimpVectors *channel, gint prev_position, GimpVectors *prev_vectors); -gboolean gimp_image_undo_push_vectors_mod (GimpImage *gimage, +gboolean gimp_image_undo_push_vectors_mod (GimpImage *image, const gchar *undo_desc, GimpVectors *vectors); -gboolean gimp_image_undo_push_vectors_reposition (GimpImage *gimage, +gboolean gimp_image_undo_push_vectors_reposition (GimpImage *image, const gchar *undo_desc, GimpVectors *vectors); /* floating selection undos */ -gboolean gimp_image_undo_push_fs_to_layer (GimpImage *gimage, +gboolean gimp_image_undo_push_fs_to_layer (GimpImage *image, const gchar *undo_desc, GimpLayer *floating_layer, GimpDrawable *drawable); -gboolean gimp_image_undo_push_fs_rigor (GimpImage *gimage, +gboolean gimp_image_undo_push_fs_rigor (GimpImage *image, const gchar *undo_desc, GimpLayer *floating_layer); -gboolean gimp_image_undo_push_fs_relax (GimpImage *gimage, +gboolean gimp_image_undo_push_fs_relax (GimpImage *image, const gchar *undo_desc, GimpLayer *floating_layer); /* parasite undos */ -gboolean gimp_image_undo_push_image_parasite (GimpImage *gimage, +gboolean gimp_image_undo_push_image_parasite (GimpImage *image, const gchar *undo_desc, gpointer parasite); -gboolean gimp_image_undo_push_image_parasite_remove (GimpImage *gimage, +gboolean gimp_image_undo_push_image_parasite_remove (GimpImage *image, const gchar *undo_desc, const gchar *name); -gboolean gimp_image_undo_push_item_parasite (GimpImage *gimage, +gboolean gimp_image_undo_push_item_parasite (GimpImage *image, const gchar *undo_desc, GimpItem *item, gpointer parasite); -gboolean gimp_image_undo_push_item_parasite_remove (GimpImage *gimage, +gboolean gimp_image_undo_push_item_parasite_remove (GimpImage *image, const gchar *undo_desc, GimpItem *item, const gchar *name); @@ -210,7 +210,7 @@ gboolean gimp_image_undo_push_item_parasite_remove (GimpImage *gimage, /* EEK undo */ -gboolean gimp_image_undo_push_cantundo (GimpImage *gimage, +gboolean gimp_image_undo_push_cantundo (GimpImage *image, const gchar *undo_desc); diff --git a/app/core/gimpimage-undo.c b/app/core/gimpimage-undo.c index 153faa2ab3..03ae4af19a 100644 --- a/app/core/gimpimage-undo.c +++ b/app/core/gimpimage-undo.c @@ -36,12 +36,12 @@ /* local function prototypes */ -static void gimp_image_undo_pop_stack (GimpImage *gimage, +static void gimp_image_undo_pop_stack (GimpImage *image, GimpUndoStack *undo_stack, GimpUndoStack *redo_stack, GimpUndoMode undo_mode); -static void gimp_image_undo_free_space (GimpImage *gimage); -static void gimp_image_undo_free_redo (GimpImage *gimage); +static void gimp_image_undo_free_space (GimpImage *image); +static void gimp_image_undo_free_redo (GimpImage *image); static GimpDirtyMask gimp_image_undo_dirty_from_type (GimpUndoType undo_type); @@ -49,47 +49,47 @@ static GimpDirtyMask gimp_image_undo_dirty_from_type (GimpUndoType undo_type); /* public functions */ gboolean -gimp_image_undo (GimpImage *gimage) +gimp_image_undo (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); - g_return_val_if_fail (gimage->pushing_undo_group == GIMP_UNDO_GROUP_NONE, + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); + g_return_val_if_fail (image->pushing_undo_group == GIMP_UNDO_GROUP_NONE, FALSE); - gimp_image_undo_pop_stack (gimage, - gimage->undo_stack, - gimage->redo_stack, + gimp_image_undo_pop_stack (image, + image->undo_stack, + image->redo_stack, GIMP_UNDO_MODE_UNDO); return TRUE; } gboolean -gimp_image_redo (GimpImage *gimage) +gimp_image_redo (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); - g_return_val_if_fail (gimage->pushing_undo_group == GIMP_UNDO_GROUP_NONE, + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); + g_return_val_if_fail (image->pushing_undo_group == GIMP_UNDO_GROUP_NONE, FALSE); - gimp_image_undo_pop_stack (gimage, - gimage->redo_stack, - gimage->undo_stack, + gimp_image_undo_pop_stack (image, + image->redo_stack, + image->undo_stack, GIMP_UNDO_MODE_REDO); return TRUE; } void -gimp_image_undo_free (GimpImage *gimage) +gimp_image_undo_free (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); /* Emit the UNDO_FREE event before actually freeing everything * so the views can properly detach from the undo items */ - gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_FREE, NULL); + gimp_image_undo_event (image, GIMP_UNDO_EVENT_UNDO_FREE, NULL); - gimp_undo_free (GIMP_UNDO (gimage->undo_stack), GIMP_UNDO_MODE_UNDO); - gimp_undo_free (GIMP_UNDO (gimage->redo_stack), GIMP_UNDO_MODE_REDO); + gimp_undo_free (GIMP_UNDO (image->undo_stack), GIMP_UNDO_MODE_UNDO); + gimp_undo_free (GIMP_UNDO (image->redo_stack), GIMP_UNDO_MODE_REDO); /* If the image was dirty, but could become clean by redo-ing * some actions, then it should now become 'infinitely' dirty. @@ -97,8 +97,8 @@ gimp_image_undo_free (GimpImage *gimage) * the image to become clean again. The only hope for salvation * is to save the image now! -- austin */ - if (gimage->dirty < 0) - gimage->dirty = 10000; + if (image->dirty < 0) + image->dirty = 10000; /* The same applies to the case where the image would become clean * due to undo actions, but since user can't undo without an undo @@ -107,14 +107,14 @@ gimp_image_undo_free (GimpImage *gimage) } gboolean -gimp_image_undo_group_start (GimpImage *gimage, +gimp_image_undo_group_start (GimpImage *image, GimpUndoType undo_type, const gchar *name) { GimpUndoStack *undo_group; GimpDirtyMask dirty_mask; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (undo_type > GIMP_UNDO_GROUP_FIRST && undo_type <= GIMP_UNDO_GROUP_LAST, FALSE); @@ -124,20 +124,20 @@ gimp_image_undo_group_start (GimpImage *gimage, dirty_mask = gimp_image_undo_dirty_from_type (undo_type); /* Notify listeners that the image will be modified */ - if (gimage->group_count == 0 && dirty_mask != GIMP_DIRTY_NONE) - gimp_image_dirty (gimage, dirty_mask); + if (image->group_count == 0 && dirty_mask != GIMP_DIRTY_NONE) + gimp_image_dirty (image, dirty_mask); - if (gimage->undo_freeze_count > 0) + if (image->undo_freeze_count > 0) return FALSE; - gimage->group_count++; + image->group_count++; /* If we're already in a group...ignore */ - if (gimage->group_count > 1) + if (image->group_count > 1) return TRUE; /* nuke the redo stack */ - gimp_image_undo_free_redo (gimage); + gimp_image_undo_free_redo (image); /* If the image was dirty, but could become clean by redo-ing * some actions, then it should now become 'infinitely' dirty. @@ -145,52 +145,52 @@ gimp_image_undo_group_start (GimpImage *gimage, * the image to become clean again. The only hope for salvation * is to save the image now! -- austin */ - if (gimage->dirty < 0) - gimage->dirty = 10000; + if (image->dirty < 0) + image->dirty = 10000; - undo_group = gimp_undo_stack_new (gimage); + undo_group = gimp_undo_stack_new (image); gimp_object_set_name (GIMP_OBJECT (undo_group), name); GIMP_UNDO (undo_group)->undo_type = undo_type; GIMP_UNDO (undo_group)->dirty_mask = dirty_mask; - gimp_undo_stack_push_undo (gimage->undo_stack, GIMP_UNDO (undo_group)); + gimp_undo_stack_push_undo (image->undo_stack, GIMP_UNDO (undo_group)); - gimage->pushing_undo_group = undo_type; + image->pushing_undo_group = undo_type; return TRUE; } gboolean -gimp_image_undo_group_end (GimpImage *gimage) +gimp_image_undo_group_end (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - if (gimage->undo_freeze_count > 0) + if (image->undo_freeze_count > 0) return FALSE; - g_return_val_if_fail (gimage->group_count > 0, FALSE); + g_return_val_if_fail (image->group_count > 0, FALSE); - gimage->group_count--; + image->group_count--; - if (gimage->group_count == 0) + if (image->group_count == 0) { - gimage->pushing_undo_group = GIMP_UNDO_GROUP_NONE; + image->pushing_undo_group = GIMP_UNDO_GROUP_NONE; /* Do it here, since undo_push doesn't emit this event while in * the middle of a group */ - gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_PUSHED, - gimp_undo_stack_peek (gimage->undo_stack)); + gimp_image_undo_event (image, GIMP_UNDO_EVENT_UNDO_PUSHED, + gimp_undo_stack_peek (image->undo_stack)); - gimp_image_undo_free_space (gimage); + gimp_image_undo_free_space (image); } return TRUE; } GimpUndo * -gimp_image_undo_push (GimpImage *gimage, +gimp_image_undo_push (GimpImage *image, GType object_type, gint64 size, gsize struct_size, @@ -207,7 +207,7 @@ gimp_image_undo_push (GimpImage *gimage, GimpUndo *undo; gpointer undo_struct = NULL; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (g_type_is_a (object_type, GIMP_TYPE_UNDO), NULL); g_return_val_if_fail (undo_type > GIMP_UNDO_GROUP_LAST, NULL); @@ -215,9 +215,9 @@ gimp_image_undo_push (GimpImage *gimage, * image dirty, even if we can't actually push the undo. */ if (dirty_mask != GIMP_DIRTY_NONE) - gimp_image_dirty (gimage, dirty_mask); + gimp_image_dirty (image, dirty_mask); - if (gimage->undo_freeze_count > 0) + if (image->undo_freeze_count > 0) return NULL; if (! name) @@ -228,7 +228,7 @@ gimp_image_undo_push (GimpImage *gimage, params = gimp_parameters_append (object_type, params, &n_params, "name", name, - "image", gimage, + "image", image, "undo-type", undo_type, "dirty-mask", dirty_mask, "data", undo_struct, @@ -246,7 +246,7 @@ gimp_image_undo_push (GimpImage *gimage, gimp_parameters_free (params, n_params); /* nuke the redo stack */ - gimp_image_undo_free_redo (gimage); + gimp_image_undo_free_redo (image); /* If the image was dirty, but could become clean by redo-ing * some actions, then it should now become 'infinitely' dirty. @@ -254,26 +254,26 @@ gimp_image_undo_push (GimpImage *gimage, * the image to become clean again. The only hope for salvation * is to save the image now! -- austin */ - if (gimage->dirty < 0) - gimage->dirty = 10000; + if (image->dirty < 0) + image->dirty = 10000; - if (gimage->pushing_undo_group == GIMP_UNDO_GROUP_NONE) + if (image->pushing_undo_group == GIMP_UNDO_GROUP_NONE) { - gimp_undo_stack_push_undo (gimage->undo_stack, undo); + gimp_undo_stack_push_undo (image->undo_stack, undo); - gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_PUSHED, undo); + gimp_image_undo_event (image, GIMP_UNDO_EVENT_UNDO_PUSHED, undo); - gimp_image_undo_free_space (gimage); + gimp_image_undo_free_space (image); /* freeing undo space may have freed the newly pushed undo */ - if (gimp_undo_stack_peek (gimage->undo_stack) == undo) + if (gimp_undo_stack_peek (image->undo_stack) == undo) return undo; } else { GimpUndoStack *undo_group; - undo_group = GIMP_UNDO_STACK (gimp_undo_stack_peek (gimage->undo_stack)); + undo_group = GIMP_UNDO_STACK (gimp_undo_stack_peek (image->undo_stack)); gimp_undo_stack_push_undo (undo_group, undo); @@ -284,15 +284,15 @@ gimp_image_undo_push (GimpImage *gimage, } GimpUndo * -gimp_image_undo_can_compress (GimpImage *gimage, +gimp_image_undo_can_compress (GimpImage *image, GType object_type, GimpUndoType undo_type) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - if (gimage->dirty != 0 && ! gimp_undo_stack_peek (gimage->redo_stack)) + if (image->dirty != 0 && ! gimp_undo_stack_peek (image->redo_stack)) { - GimpUndo *undo = gimp_undo_stack_peek (gimage->undo_stack); + GimpUndo *undo = gimp_undo_stack_peek (image->undo_stack); if (undo && undo->undo_type == undo_type && g_type_is_a (G_TYPE_FROM_INSTANCE (undo), object_type)) @@ -308,7 +308,7 @@ gimp_image_undo_can_compress (GimpImage *gimage, /* private functions */ static void -gimp_image_undo_pop_stack (GimpImage *gimage, +gimp_image_undo_pop_stack (GimpImage *image, GimpUndoStack *undo_stack, GimpUndoStack *redo_stack, GimpUndoMode undo_mode) @@ -316,7 +316,7 @@ gimp_image_undo_pop_stack (GimpImage *gimage, GimpUndo *undo; GimpUndoAccumulator accum = { 0, }; - g_object_freeze_notify (G_OBJECT (gimage)); + g_object_freeze_notify (G_OBJECT (image)); undo = gimp_undo_stack_pop_undo (undo_stack, undo_mode, &accum); @@ -328,46 +328,46 @@ gimp_image_undo_pop_stack (GimpImage *gimage, gimp_undo_stack_push_undo (redo_stack, undo); if (accum.mode_changed) - gimp_image_mode_changed (gimage); + gimp_image_mode_changed (image); if (accum.size_changed) - gimp_viewable_size_changed (GIMP_VIEWABLE (gimage)); + gimp_viewable_size_changed (GIMP_VIEWABLE (image)); if (accum.resolution_changed) - gimp_image_resolution_changed (gimage); + gimp_image_resolution_changed (image); if (accum.unit_changed) - gimp_image_unit_changed (gimage); + gimp_image_unit_changed (image); if (accum.quick_mask_changed) - gimp_image_quick_mask_changed (gimage); + gimp_image_quick_mask_changed (image); if (accum.alpha_changed) - gimp_image_alpha_changed (gimage); + gimp_image_alpha_changed (image); /* let others know that we just popped an action */ - gimp_image_undo_event (gimage, + gimp_image_undo_event (image, (undo_mode == GIMP_UNDO_MODE_UNDO) ? GIMP_UNDO_EVENT_UNDO : GIMP_UNDO_EVENT_REDO, undo); } - g_object_thaw_notify (G_OBJECT (gimage)); + g_object_thaw_notify (G_OBJECT (image)); } static void -gimp_image_undo_free_space (GimpImage *gimage) +gimp_image_undo_free_space (GimpImage *image) { GimpContainer *container; gint min_undo_levels; gint max_undo_levels; gint64 undo_size; - container = gimage->undo_stack->undos; + container = image->undo_stack->undos; - min_undo_levels = gimage->gimp->config->levels_of_undo; + min_undo_levels = image->gimp->config->levels_of_undo; max_undo_levels = 1024; /* FIXME */ - undo_size = gimage->gimp->config->undo_size; + undo_size = image->gimp->config->undo_size; #ifdef DEBUG_IMAGE_UNDO g_printerr ("undo_steps: %d undo_bytes: %ld\n", @@ -382,7 +382,7 @@ gimp_image_undo_free_space (GimpImage *gimage) while ((gimp_object_get_memsize (GIMP_OBJECT (container), NULL) > undo_size) || (gimp_container_num_children (container) > max_undo_levels)) { - GimpUndo *freed = gimp_undo_stack_free_bottom (gimage->undo_stack, + GimpUndo *freed = gimp_undo_stack_free_bottom (image->undo_stack, GIMP_UNDO_MODE_UNDO); #ifdef DEBUG_IMAGE_UNDO @@ -392,7 +392,7 @@ gimp_image_undo_free_space (GimpImage *gimage) NULL)); #endif - gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_EXPIRED, freed); + gimp_image_undo_event (image, GIMP_UNDO_EVENT_UNDO_EXPIRED, freed); g_object_unref (freed); @@ -402,11 +402,11 @@ gimp_image_undo_free_space (GimpImage *gimage) } static void -gimp_image_undo_free_redo (GimpImage *gimage) +gimp_image_undo_free_redo (GimpImage *image) { GimpContainer *container; - container = gimage->redo_stack->undos; + container = image->redo_stack->undos; #ifdef DEBUG_IMAGE_UNDO g_printerr ("redo_steps: %d redo_bytes: %ld\n", @@ -416,7 +416,7 @@ gimp_image_undo_free_redo (GimpImage *gimage) while (gimp_container_num_children (container) > 0) { - GimpUndo *freed = gimp_undo_stack_free_bottom (gimage->redo_stack, + GimpUndo *freed = gimp_undo_stack_free_bottom (image->redo_stack, GIMP_UNDO_MODE_REDO); #ifdef DEBUG_IMAGE_UNDO @@ -426,7 +426,7 @@ gimp_image_undo_free_redo (GimpImage *gimage) NULL)); #endif - gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_REDO_EXPIRED, freed); + gimp_image_undo_event (image, GIMP_UNDO_EVENT_REDO_EXPIRED, freed); g_object_unref (freed); } diff --git a/app/core/gimpimage-undo.h b/app/core/gimpimage-undo.h index eeace761b0..eef42fae11 100644 --- a/app/core/gimpimage-undo.h +++ b/app/core/gimpimage-undo.h @@ -20,17 +20,17 @@ #define __GIMP_IMAGE_UNDO_H__ -gboolean gimp_image_undo (GimpImage *gimage); -gboolean gimp_image_redo (GimpImage *gimage); +gboolean gimp_image_undo (GimpImage *image); +gboolean gimp_image_redo (GimpImage *image); -void gimp_image_undo_free (GimpImage *gimage); +void gimp_image_undo_free (GimpImage *image); -gboolean gimp_image_undo_group_start (GimpImage *gimage, +gboolean gimp_image_undo_group_start (GimpImage *image, GimpUndoType undo_type, const gchar *name); -gboolean gimp_image_undo_group_end (GimpImage *gimage); +gboolean gimp_image_undo_group_end (GimpImage *image); -GimpUndo * gimp_image_undo_push (GimpImage *gimage, +GimpUndo * gimp_image_undo_push (GimpImage *image, GType object_type, gint64 size, gsize struct_size, @@ -41,7 +41,7 @@ GimpUndo * gimp_image_undo_push (GimpImage *gimage, GimpUndoFreeFunc free_func, ...) G_GNUC_NULL_TERMINATED; -GimpUndo * gimp_image_undo_can_compress (GimpImage *gimage, +GimpUndo * gimp_image_undo_can_compress (GimpImage *image, GType object_type, GimpUndoType undo_type); diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 44ffc50753..b741bf775b 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -141,42 +141,42 @@ static void gimp_image_invalidate_preview (GimpViewable *viewable); static void gimp_image_size_changed (GimpViewable *viewable); static gchar * gimp_image_get_description (GimpViewable *viewable, gchar **tooltip); -static void gimp_image_real_colormap_changed (GimpImage *gimage, +static void gimp_image_real_colormap_changed (GimpImage *image, gint color_index); -static void gimp_image_real_flush (GimpImage *gimage); +static void gimp_image_real_flush (GimpImage *image); static void gimp_image_mask_update (GimpDrawable *drawable, gint x, gint y, gint width, gint height, - GimpImage *gimage); + GimpImage *image); static void gimp_image_drawable_update (GimpDrawable *drawable, gint x, gint y, gint width, gint height, - GimpImage *gimage); + GimpImage *image); static void gimp_image_drawable_visibility (GimpItem *item, - GimpImage *gimage); + GimpImage *image); static void gimp_image_layer_alpha_changed (GimpDrawable *drawable, - GimpImage *gimage); + GimpImage *image); static void gimp_image_layer_add (GimpContainer *container, GimpLayer *layer, - GimpImage *gimage); + GimpImage *image); static void gimp_image_layer_remove (GimpContainer *container, GimpLayer *layer, - GimpImage *gimage); + GimpImage *image); static void gimp_image_channel_add (GimpContainer *container, GimpChannel *channel, - GimpImage *gimage); + GimpImage *image); static void gimp_image_channel_remove (GimpContainer *container, GimpChannel *channel, - GimpImage *gimage); + GimpImage *image); static void gimp_image_channel_name_changed (GimpChannel *channel, - GimpImage *gimage); + GimpImage *image); static void gimp_image_channel_color_changed (GimpChannel *channel, - GimpImage *gimage); + GimpImage *image); static gint valid_combinations[][MAX_CHANNELS + 1] = @@ -507,119 +507,119 @@ gimp_image_class_init (GimpImageClass *klass) } static void -gimp_image_init (GimpImage *gimage) +gimp_image_init (GimpImage *image) { gint i; - gimage->ID = 0; + image->ID = 0; - gimage->save_proc = NULL; + image->save_proc = NULL; - gimage->width = 0; - gimage->height = 0; - gimage->xresolution = 1.0; - gimage->yresolution = 1.0; - gimage->resolution_unit = GIMP_UNIT_INCH; - gimage->base_type = GIMP_RGB; + image->width = 0; + image->height = 0; + image->xresolution = 1.0; + image->yresolution = 1.0; + image->resolution_unit = GIMP_UNIT_INCH; + image->base_type = GIMP_RGB; - gimage->cmap = NULL; - gimage->num_cols = 0; + image->cmap = NULL; + image->num_cols = 0; - gimage->dirty = 1; - gimage->dirty_time = 0; - gimage->undo_freeze_count = 0; + image->dirty = 1; + image->dirty_time = 0; + image->undo_freeze_count = 0; - gimage->instance_count = 0; - gimage->disp_count = 0; + image->instance_count = 0; + image->disp_count = 0; - gimage->tattoo_state = 0; + image->tattoo_state = 0; - gimage->shadow = NULL; + image->shadow = NULL; - gimage->projection = gimp_projection_new (gimage); + image->projection = gimp_projection_new (image); - gimage->guides = NULL; - gimage->grid = NULL; - gimage->sample_points = NULL; + image->guides = NULL; + image->grid = NULL; + image->sample_points = NULL; - gimage->layers = gimp_list_new (GIMP_TYPE_LAYER, TRUE); - gimage->channels = gimp_list_new (GIMP_TYPE_CHANNEL, TRUE); - gimage->vectors = gimp_list_new (GIMP_TYPE_VECTORS, TRUE); - gimage->layer_stack = NULL; + image->layers = gimp_list_new (GIMP_TYPE_LAYER, TRUE); + image->channels = gimp_list_new (GIMP_TYPE_CHANNEL, TRUE); + image->vectors = gimp_list_new (GIMP_TYPE_VECTORS, TRUE); + image->layer_stack = NULL; - gimage->layer_update_handler = - gimp_container_add_handler (gimage->layers, "update", + image->layer_update_handler = + gimp_container_add_handler (image->layers, "update", G_CALLBACK (gimp_image_drawable_update), - gimage); - gimage->layer_visible_handler = - gimp_container_add_handler (gimage->layers, "visibility-changed", + image); + image->layer_visible_handler = + gimp_container_add_handler (image->layers, "visibility-changed", G_CALLBACK (gimp_image_drawable_visibility), - gimage); - gimage->layer_alpha_handler = - gimp_container_add_handler (gimage->layers, "alpha-changed", + image); + image->layer_alpha_handler = + gimp_container_add_handler (image->layers, "alpha-changed", G_CALLBACK (gimp_image_layer_alpha_changed), - gimage); + image); - gimage->channel_update_handler = - gimp_container_add_handler (gimage->channels, "update", + image->channel_update_handler = + gimp_container_add_handler (image->channels, "update", G_CALLBACK (gimp_image_drawable_update), - gimage); - gimage->channel_visible_handler = - gimp_container_add_handler (gimage->channels, "visibility-changed", + image); + image->channel_visible_handler = + gimp_container_add_handler (image->channels, "visibility-changed", G_CALLBACK (gimp_image_drawable_visibility), - gimage); - gimage->channel_name_changed_handler = - gimp_container_add_handler (gimage->channels, "name-changed", + image); + image->channel_name_changed_handler = + gimp_container_add_handler (image->channels, "name-changed", G_CALLBACK (gimp_image_channel_name_changed), - gimage); - gimage->channel_color_changed_handler = - gimp_container_add_handler (gimage->channels, "color-changed", + image); + image->channel_color_changed_handler = + gimp_container_add_handler (image->channels, "color-changed", G_CALLBACK (gimp_image_channel_color_changed), - gimage); + image); - g_signal_connect (gimage->layers, "add", + g_signal_connect (image->layers, "add", G_CALLBACK (gimp_image_layer_add), - gimage); - g_signal_connect (gimage->layers, "remove", + image); + g_signal_connect (image->layers, "remove", G_CALLBACK (gimp_image_layer_remove), - gimage); + image); - g_signal_connect (gimage->channels, "add", + g_signal_connect (image->channels, "add", G_CALLBACK (gimp_image_channel_add), - gimage); - g_signal_connect (gimage->channels, "remove", + image); + g_signal_connect (image->channels, "remove", G_CALLBACK (gimp_image_channel_remove), - gimage); + image); - gimage->active_layer = NULL; - gimage->active_channel = NULL; - gimage->active_vectors = NULL; + image->active_layer = NULL; + image->active_channel = NULL; + image->active_vectors = NULL; - gimage->floating_sel = NULL; - gimage->selection_mask = NULL; + image->floating_sel = NULL; + image->selection_mask = NULL; - gimage->parasites = gimp_parasite_list_new (); + image->parasites = gimp_parasite_list_new (); for (i = 0; i < MAX_CHANNELS; i++) { - gimage->visible[i] = TRUE; - gimage->active[i] = TRUE; + image->visible[i] = TRUE; + image->active[i] = TRUE; } - gimage->quick_mask_state = FALSE; - gimage->quick_mask_inverted = FALSE; - gimp_rgba_set (&gimage->quick_mask_color, 1.0, 0.0, 0.0, 0.5); + image->quick_mask_state = FALSE; + image->quick_mask_inverted = FALSE; + gimp_rgba_set (&image->quick_mask_color, 1.0, 0.0, 0.0, 0.5); - gimage->undo_stack = gimp_undo_stack_new (gimage); - gimage->redo_stack = gimp_undo_stack_new (gimage); - gimage->group_count = 0; - gimage->pushing_undo_group = GIMP_UNDO_GROUP_NONE; + image->undo_stack = gimp_undo_stack_new (image); + image->redo_stack = gimp_undo_stack_new (image); + image->group_count = 0; + image->pushing_undo_group = GIMP_UNDO_GROUP_NONE; - gimage->comp_preview = NULL; - gimage->comp_preview_valid = FALSE; + image->comp_preview = NULL; + image->comp_preview_valid = FALSE; - gimage->flush_accum.alpha_changed = FALSE; - gimage->flush_accum.mask_changed = FALSE; + image->flush_accum.alpha_changed = FALSE; + image->flush_accum.mask_changed = FALSE; } static GObject * @@ -628,63 +628,63 @@ gimp_image_constructor (GType type, GObjectConstructParam *params) { GObject *object; - GimpImage *gimage; + GimpImage *image; GimpCoreConfig *config; object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params); - gimage = GIMP_IMAGE (object); + image = GIMP_IMAGE (object); - g_assert (GIMP_IS_GIMP (gimage->gimp)); + g_assert (GIMP_IS_GIMP (image->gimp)); - config = gimage->gimp->config; + config = image->gimp->config; - gimage->ID = gimage->gimp->next_image_ID++; + image->ID = image->gimp->next_image_ID++; - g_hash_table_insert (gimage->gimp->image_table, - GINT_TO_POINTER (gimage->ID), - gimage); + g_hash_table_insert (image->gimp->image_table, + GINT_TO_POINTER (image->ID), + image); - gimage->xresolution = config->default_image->xresolution; - gimage->yresolution = config->default_image->yresolution; - gimage->resolution_unit = config->default_image->resolution_unit; + image->xresolution = config->default_image->xresolution; + image->yresolution = config->default_image->yresolution; + image->resolution_unit = config->default_image->resolution_unit; - gimage->grid = gimp_config_duplicate (GIMP_CONFIG (config->default_grid)); + image->grid = gimp_config_duplicate (GIMP_CONFIG (config->default_grid)); - switch (gimage->base_type) + switch (image->base_type) { case GIMP_RGB: case GIMP_GRAY: break; case GIMP_INDEXED: /* always allocate 256 colors for the colormap */ - gimage->num_cols = 0; - gimage->cmap = g_new0 (guchar, GIMP_IMAGE_COLORMAP_SIZE); + image->num_cols = 0; + image->cmap = g_new0 (guchar, GIMP_IMAGE_COLORMAP_SIZE); break; default: break; } /* create the selection mask */ - gimage->selection_mask = gimp_selection_new (gimage, - gimage->width, - gimage->height); - g_object_ref (gimage->selection_mask); - gimp_item_sink (GIMP_ITEM (gimage->selection_mask)); + image->selection_mask = gimp_selection_new (image, + image->width, + image->height); + g_object_ref (image->selection_mask); + gimp_item_sink (GIMP_ITEM (image->selection_mask)); - g_signal_connect (gimage->selection_mask, "update", + g_signal_connect (image->selection_mask, "update", G_CALLBACK (gimp_image_mask_update), - gimage); + image); g_signal_connect_object (config, "notify::transparency-type", G_CALLBACK (gimp_image_invalidate_layer_previews), - gimage, G_CONNECT_SWAPPED); + image, G_CONNECT_SWAPPED); g_signal_connect_object (config, "notify::transparency-size", G_CALLBACK (gimp_image_invalidate_layer_previews), - gimage, G_CONNECT_SWAPPED); + image, G_CONNECT_SWAPPED); g_signal_connect_object (config, "notify::layer-previews", G_CALLBACK (gimp_viewable_size_changed), - gimage, G_CONNECT_SWAPPED); + image, G_CONNECT_SWAPPED); return object; } @@ -695,24 +695,24 @@ gimp_image_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - GimpImage *gimage = GIMP_IMAGE (object); + GimpImage *image = GIMP_IMAGE (object); switch (property_id) { case PROP_GIMP: - gimage->gimp = g_value_get_object (value); + image->gimp = g_value_get_object (value); break; case PROP_ID: g_assert_not_reached (); break; case PROP_WIDTH: - gimage->width = g_value_get_int (value); + image->width = g_value_get_int (value); break; case PROP_HEIGHT: - gimage->height = g_value_get_int (value); + image->height = g_value_get_int (value); break; case PROP_BASE_TYPE: - gimage->base_type = g_value_get_enum (value); + image->base_type = g_value_get_enum (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -726,24 +726,24 @@ gimp_image_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - GimpImage *gimage = GIMP_IMAGE (object); + GimpImage *image = GIMP_IMAGE (object); switch (property_id) { case PROP_GIMP: - g_value_set_object (value, gimage->gimp); + g_value_set_object (value, image->gimp); break; case PROP_ID: - g_value_set_int (value, gimage->ID); + g_value_set_int (value, image->ID); break; case PROP_WIDTH: - g_value_set_int (value, gimage->width); + g_value_set_int (value, image->width); break; case PROP_HEIGHT: - g_value_set_int (value, gimage->height); + g_value_set_int (value, image->height); break; case PROP_BASE_TYPE: - g_value_set_enum (value, gimage->base_type); + g_value_set_enum (value, image->base_type); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -754,43 +754,43 @@ gimp_image_get_property (GObject *object, static void gimp_image_dispose (GObject *object) { - GimpImage *gimage = GIMP_IMAGE (object); + GimpImage *image = GIMP_IMAGE (object); - gimp_image_undo_free (gimage); + gimp_image_undo_free (image); - gimp_container_remove_handler (gimage->layers, - gimage->layer_update_handler); - gimp_container_remove_handler (gimage->layers, - gimage->layer_visible_handler); - gimp_container_remove_handler (gimage->layers, - gimage->layer_alpha_handler); + gimp_container_remove_handler (image->layers, + image->layer_update_handler); + gimp_container_remove_handler (image->layers, + image->layer_visible_handler); + gimp_container_remove_handler (image->layers, + image->layer_alpha_handler); - gimp_container_remove_handler (gimage->channels, - gimage->channel_update_handler); - gimp_container_remove_handler (gimage->channels, - gimage->channel_visible_handler); - gimp_container_remove_handler (gimage->channels, - gimage->channel_name_changed_handler); - gimp_container_remove_handler (gimage->channels, - gimage->channel_color_changed_handler); + gimp_container_remove_handler (image->channels, + image->channel_update_handler); + gimp_container_remove_handler (image->channels, + image->channel_visible_handler); + gimp_container_remove_handler (image->channels, + image->channel_name_changed_handler); + gimp_container_remove_handler (image->channels, + image->channel_color_changed_handler); - g_signal_handlers_disconnect_by_func (gimage->layers, + g_signal_handlers_disconnect_by_func (image->layers, gimp_image_layer_add, - gimage); - g_signal_handlers_disconnect_by_func (gimage->layers, + image); + g_signal_handlers_disconnect_by_func (image->layers, gimp_image_layer_remove, - gimage); + image); - g_signal_handlers_disconnect_by_func (gimage->channels, + g_signal_handlers_disconnect_by_func (image->channels, gimp_image_channel_add, - gimage); - g_signal_handlers_disconnect_by_func (gimage->channels, + image); + g_signal_handlers_disconnect_by_func (image->channels, gimp_image_channel_remove, - gimage); + image); - gimp_container_foreach (gimage->layers, (GFunc) gimp_item_removed, NULL); - gimp_container_foreach (gimage->channels, (GFunc) gimp_item_removed, NULL); - gimp_container_foreach (gimage->vectors, (GFunc) gimp_item_removed, NULL); + gimp_container_foreach (image->layers, (GFunc) gimp_item_removed, NULL); + gimp_container_foreach (image->channels, (GFunc) gimp_item_removed, NULL); + gimp_container_foreach (image->vectors, (GFunc) gimp_item_removed, NULL); G_OBJECT_CLASS (parent_class)->dispose (object); } @@ -798,99 +798,99 @@ gimp_image_dispose (GObject *object) static void gimp_image_finalize (GObject *object) { - GimpImage *gimage = GIMP_IMAGE (object); + GimpImage *image = GIMP_IMAGE (object); - if (gimage->projection) + if (image->projection) { - g_object_unref (gimage->projection); - gimage->projection = NULL; + g_object_unref (image->projection); + image->projection = NULL; } - if (gimage->shadow) - gimp_image_free_shadow (gimage); + if (image->shadow) + gimp_image_free_shadow (image); - if (gimage->cmap) + if (image->cmap) { - g_free (gimage->cmap); - gimage->cmap = NULL; + g_free (image->cmap); + image->cmap = NULL; } - if (gimage->layers) + if (image->layers) { - g_object_unref (gimage->layers); - gimage->layers = NULL; + g_object_unref (image->layers); + image->layers = NULL; } - if (gimage->channels) + if (image->channels) { - g_object_unref (gimage->channels); - gimage->channels = NULL; + g_object_unref (image->channels); + image->channels = NULL; } - if (gimage->vectors) + if (image->vectors) { - g_object_unref (gimage->vectors); - gimage->vectors = NULL; + g_object_unref (image->vectors); + image->vectors = NULL; } - if (gimage->layer_stack) + if (image->layer_stack) { - g_slist_free (gimage->layer_stack); - gimage->layer_stack = NULL; + g_slist_free (image->layer_stack); + image->layer_stack = NULL; } - if (gimage->selection_mask) + if (image->selection_mask) { - g_object_unref (gimage->selection_mask); - gimage->selection_mask = NULL; + g_object_unref (image->selection_mask); + image->selection_mask = NULL; } - if (gimage->comp_preview) + if (image->comp_preview) { - temp_buf_free (gimage->comp_preview); - gimage->comp_preview = NULL; + temp_buf_free (image->comp_preview); + image->comp_preview = NULL; } - if (gimage->parasites) + if (image->parasites) { - g_object_unref (gimage->parasites); - gimage->parasites = NULL; + g_object_unref (image->parasites); + image->parasites = NULL; } - if (gimage->guides) + if (image->guides) { - g_list_foreach (gimage->guides, (GFunc) gimp_image_guide_unref, NULL); - g_list_free (gimage->guides); - gimage->guides = NULL; + g_list_foreach (image->guides, (GFunc) gimp_image_guide_unref, NULL); + g_list_free (image->guides); + image->guides = NULL; } - if (gimage->grid) + if (image->grid) { - g_object_unref (gimage->grid); - gimage->grid = NULL; + g_object_unref (image->grid); + image->grid = NULL; } - if (gimage->sample_points) + if (image->sample_points) { - g_list_foreach (gimage->sample_points, + g_list_foreach (image->sample_points, (GFunc) gimp_image_sample_point_unref, NULL); - g_list_free (gimage->sample_points); - gimage->sample_points = NULL; + g_list_free (image->sample_points); + image->sample_points = NULL; } - if (gimage->undo_stack) + if (image->undo_stack) { - g_object_unref (gimage->undo_stack); - gimage->undo_stack = NULL; + g_object_unref (image->undo_stack); + image->undo_stack = NULL; } - if (gimage->redo_stack) + if (image->redo_stack) { - g_object_unref (gimage->redo_stack); - gimage->redo_stack = NULL; + g_object_unref (image->redo_stack); + image->redo_stack = NULL; } - if (gimage->gimp && gimage->gimp->image_table) + if (image->gimp && image->gimp->image_table) { - g_hash_table_remove (gimage->gimp->image_table, - GINT_TO_POINTER (gimage->ID)); - gimage->gimp = NULL; + g_hash_table_remove (image->gimp->image_table, + GINT_TO_POINTER (image->ID)); + image->gimp = NULL; } G_OBJECT_CLASS (parent_class)->finalize (object); @@ -917,49 +917,49 @@ static gint64 gimp_image_get_memsize (GimpObject *object, gint64 *gui_size) { - GimpImage *gimage = GIMP_IMAGE (object); + GimpImage *image = GIMP_IMAGE (object); gint64 memsize = 0; - if (gimage->cmap) + if (image->cmap) memsize += GIMP_IMAGE_COLORMAP_SIZE; - if (gimage->shadow) - memsize += tile_manager_get_memsize (gimage->shadow, FALSE); + if (image->shadow) + memsize += tile_manager_get_memsize (image->shadow, FALSE); - if (gimage->projection) - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->projection), + if (image->projection) + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->projection), gui_size); - memsize += gimp_g_list_get_memsize (gimage->guides, sizeof (GimpGuide)); - if (gimage->grid) - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->grid), gui_size); + memsize += gimp_g_list_get_memsize (image->guides, sizeof (GimpGuide)); + if (image->grid) + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->grid), gui_size); - memsize += gimp_g_list_get_memsize (gimage->sample_points, + memsize += gimp_g_list_get_memsize (image->sample_points, sizeof (GimpSamplePoint)); - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->layers), + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->layers), gui_size); - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->channels), + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->channels), gui_size); - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->vectors), + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->vectors), gui_size); - memsize += gimp_g_slist_get_memsize (gimage->layer_stack, 0); + memsize += gimp_g_slist_get_memsize (image->layer_stack, 0); - if (gimage->selection_mask) - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->selection_mask), + if (image->selection_mask) + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->selection_mask), gui_size); - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->parasites), + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->parasites), gui_size); - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->undo_stack), + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->undo_stack), gui_size); - memsize += gimp_object_get_memsize (GIMP_OBJECT (gimage->redo_stack), + memsize += gimp_object_get_memsize (GIMP_OBJECT (image->redo_stack), gui_size); - if (gimage->comp_preview) - *gui_size += temp_buf_get_memsize (gimage->comp_preview); + if (image->comp_preview) + *gui_size += temp_buf_get_memsize (image->comp_preview); return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object, gui_size); @@ -981,40 +981,40 @@ gimp_image_get_size (GimpViewable *viewable, static void gimp_image_invalidate_preview (GimpViewable *viewable) { - GimpImage *gimage = GIMP_IMAGE (viewable); + GimpImage *image = GIMP_IMAGE (viewable); if (GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview) GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview (viewable); - gimage->comp_preview_valid = FALSE; + image->comp_preview_valid = FALSE; - if (gimage->comp_preview) + if (image->comp_preview) { - temp_buf_free (gimage->comp_preview); - gimage->comp_preview = NULL; + temp_buf_free (image->comp_preview); + image->comp_preview = NULL; } } static void gimp_image_size_changed (GimpViewable *viewable) { - GimpImage *gimage = GIMP_IMAGE (viewable); + GimpImage *image = GIMP_IMAGE (viewable); GList *list; if (GIMP_VIEWABLE_CLASS (parent_class)->size_changed) GIMP_VIEWABLE_CLASS (parent_class)->size_changed (viewable); - gimp_container_foreach (gimage->layers, + gimp_container_foreach (image->layers, (GFunc) gimp_viewable_size_changed, NULL); - gimp_container_foreach (gimage->channels, + gimp_container_foreach (image->channels, (GFunc) gimp_viewable_size_changed, NULL); - gimp_container_foreach (gimage->vectors, + gimp_container_foreach (image->vectors, (GFunc) gimp_viewable_size_changed, NULL); - for (list = GIMP_LIST (gimage->layers)->list; list; list = g_list_next (list)) + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { GimpLayerMask *mask = gimp_layer_get_mask (GIMP_LAYER (list->data)); @@ -1022,26 +1022,26 @@ gimp_image_size_changed (GimpViewable *viewable) gimp_viewable_size_changed (GIMP_VIEWABLE (mask)); } - gimp_viewable_size_changed (GIMP_VIEWABLE (gimp_image_get_mask (gimage))); + gimp_viewable_size_changed (GIMP_VIEWABLE (gimp_image_get_mask (image))); } static gchar * gimp_image_get_description (GimpViewable *viewable, gchar **tooltip) { - GimpImage *gimage = GIMP_IMAGE (viewable); + GimpImage *image = GIMP_IMAGE (viewable); const gchar *uri; gchar *basename; gchar *retval; - uri = gimp_image_get_uri (GIMP_IMAGE (gimage)); + uri = gimp_image_get_uri (GIMP_IMAGE (image)); basename = file_utils_uri_display_basename (uri); if (tooltip) *tooltip = file_utils_uri_display_name (uri); - retval = g_strdup_printf ("%s-%d", basename, gimp_image_get_ID (gimage)); + retval = g_strdup_printf ("%s-%d", basename, gimp_image_get_ID (image)); g_free (basename); @@ -1049,34 +1049,34 @@ gimp_image_get_description (GimpViewable *viewable, } static void -gimp_image_real_colormap_changed (GimpImage *gimage, +gimp_image_real_colormap_changed (GimpImage *image, gint color_index) { - if (gimp_image_base_type (gimage) == GIMP_INDEXED) + if (gimp_image_base_type (image) == GIMP_INDEXED) { - gimp_image_color_hash_invalidate (gimage, color_index); + gimp_image_color_hash_invalidate (image, color_index); /* A colormap alteration affects the whole image */ - gimp_image_update (gimage, 0, 0, gimage->width, gimage->height); + gimp_image_update (image, 0, 0, image->width, image->height); - gimp_image_invalidate_layer_previews (gimage); - gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage)); + gimp_image_invalidate_layer_previews (image); + gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image)); } } static void -gimp_image_real_flush (GimpImage *gimage) +gimp_image_real_flush (GimpImage *image) { - if (gimage->flush_accum.alpha_changed) + if (image->flush_accum.alpha_changed) { - gimp_image_alpha_changed (gimage); - gimage->flush_accum.alpha_changed = FALSE; + gimp_image_alpha_changed (image); + image->flush_accum.alpha_changed = FALSE; } - if (gimage->flush_accum.mask_changed) + if (image->flush_accum.mask_changed) { - gimp_image_mask_changed (gimage); - gimage->flush_accum.mask_changed = FALSE; + gimp_image_mask_changed (image); + image->flush_accum.mask_changed = FALSE; } } @@ -1086,9 +1086,9 @@ gimp_image_mask_update (GimpDrawable *drawable, gint y, gint width, gint height, - GimpImage *gimage) + GimpImage *image) { - gimage->flush_accum.mask_changed = TRUE; + image->flush_accum.mask_changed = TRUE; } static void @@ -1097,7 +1097,7 @@ gimp_image_drawable_update (GimpDrawable *drawable, gint y, gint width, gint height, - GimpImage *gimage) + GimpImage *image) { GimpItem *item = GIMP_ITEM (drawable); @@ -1110,115 +1110,115 @@ gimp_image_drawable_update (GimpDrawable *drawable, x += offset_x; y += offset_y; - gimp_image_update (gimage, x, y, width, height); - gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage)); + gimp_image_update (image, x, y, width, height); + gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image)); } } static void gimp_image_drawable_visibility (GimpItem *item, - GimpImage *gimage) + GimpImage *image) { gint offset_x; gint offset_y; gimp_item_offsets (item, &offset_x, &offset_y); - gimp_image_update (gimage, + gimp_image_update (image, offset_x, offset_y, gimp_item_width (item), gimp_item_height (item)); - gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage)); + gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image)); } static void gimp_image_layer_alpha_changed (GimpDrawable *drawable, - GimpImage *gimage) + GimpImage *image) { - if (gimp_container_num_children (gimage->layers) == 1) - gimage->flush_accum.alpha_changed = TRUE; + if (gimp_container_num_children (image->layers) == 1) + image->flush_accum.alpha_changed = TRUE; } static void gimp_image_layer_add (GimpContainer *container, GimpLayer *layer, - GimpImage *gimage) + GimpImage *image) { GimpItem *item = GIMP_ITEM (layer); if (gimp_item_get_visible (item)) - gimp_image_drawable_visibility (item, gimage); + gimp_image_drawable_visibility (item, image); } static void gimp_image_layer_remove (GimpContainer *container, GimpLayer *layer, - GimpImage *gimage) + GimpImage *image) { GimpItem *item = GIMP_ITEM (layer); if (gimp_item_get_visible (item)) - gimp_image_drawable_visibility (item, gimage); + gimp_image_drawable_visibility (item, image); } static void gimp_image_channel_add (GimpContainer *container, GimpChannel *channel, - GimpImage *gimage) + GimpImage *image) { GimpItem *item = GIMP_ITEM (channel); if (gimp_item_get_visible (item)) - gimp_image_drawable_visibility (item, gimage); + gimp_image_drawable_visibility (item, image); if (! strcmp (GIMP_IMAGE_QUICK_MASK_NAME, gimp_object_get_name (GIMP_OBJECT (channel)))) { - gimp_image_set_quick_mask_state (gimage, TRUE); + gimp_image_set_quick_mask_state (image, TRUE); } } static void gimp_image_channel_remove (GimpContainer *container, GimpChannel *channel, - GimpImage *gimage) + GimpImage *image) { GimpItem *item = GIMP_ITEM (channel); if (gimp_item_get_visible (item)) - gimp_image_drawable_visibility (item, gimage); + gimp_image_drawable_visibility (item, image); if (! strcmp (GIMP_IMAGE_QUICK_MASK_NAME, gimp_object_get_name (GIMP_OBJECT (channel)))) { - gimp_image_set_quick_mask_state (gimage, FALSE); + gimp_image_set_quick_mask_state (image, FALSE); } } static void gimp_image_channel_name_changed (GimpChannel *channel, - GimpImage *gimage) + GimpImage *image) { if (! strcmp (GIMP_IMAGE_QUICK_MASK_NAME, gimp_object_get_name (GIMP_OBJECT (channel)))) { - gimp_image_set_quick_mask_state (gimage, TRUE); + gimp_image_set_quick_mask_state (image, TRUE); } - else if (gimp_image_get_quick_mask_state (gimage) && - ! gimp_image_get_quick_mask (gimage)) + else if (gimp_image_get_quick_mask_state (image) && + ! gimp_image_get_quick_mask (image)) { - gimp_image_set_quick_mask_state (gimage, FALSE); + gimp_image_set_quick_mask_state (image, FALSE); } } static void gimp_image_channel_color_changed (GimpChannel *channel, - GimpImage *gimage) + GimpImage *image) { if (! strcmp (GIMP_IMAGE_QUICK_MASK_NAME, gimp_object_get_name (GIMP_OBJECT (channel)))) { - gimage->quick_mask_color = channel->color; + image->quick_mask_color = channel->color; } } @@ -1242,19 +1242,19 @@ gimp_image_new (Gimp *gimp, } GimpImageBaseType -gimp_image_base_type (const GimpImage *gimage) +gimp_image_base_type (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); + g_return_val_if_fail (GIMP_IS_IMAGE (image), -1); - return gimage->base_type; + return image->base_type; } GimpImageType -gimp_image_base_type_with_alpha (const GimpImage *gimage) +gimp_image_base_type_with_alpha (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); + g_return_val_if_fail (GIMP_IS_IMAGE (image), -1); - switch (gimage->base_type) + switch (image->base_type) { case GIMP_RGB: return GIMP_RGBA_IMAGE; @@ -1275,11 +1275,11 @@ gimp_image_get_combination_mode (GimpImageType dest_type, } gint -gimp_image_get_ID (const GimpImage *gimage) +gimp_image_get_ID (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); + g_return_val_if_fail (GIMP_IS_IMAGE (image), -1); - return gimage->ID; + return image->ID; } GimpImage * @@ -1296,57 +1296,57 @@ gimp_image_get_by_ID (Gimp *gimp, } void -gimp_image_set_uri (GimpImage *gimage, +gimp_image_set_uri (GimpImage *image, const gchar *uri) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - gimp_object_set_name (GIMP_OBJECT (gimage), uri); + gimp_object_set_name (GIMP_OBJECT (image), uri); } const gchar * -gimp_image_get_uri (const GimpImage *gimage) +gimp_image_get_uri (const GimpImage *image) { const gchar *uri; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - uri = gimp_object_get_name (GIMP_OBJECT (gimage)); + uri = gimp_object_get_name (GIMP_OBJECT (image)); return uri ? uri : _("Untitled"); } void -gimp_image_set_filename (GimpImage *gimage, +gimp_image_set_filename (GimpImage *image, const gchar *filename) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); if (filename && strlen (filename)) { gchar *uri; - uri = file_utils_filename_to_uri (gimage->gimp->load_procs, filename, + uri = file_utils_filename_to_uri (image->gimp->load_procs, filename, NULL); - gimp_image_set_uri (gimage, uri); + gimp_image_set_uri (image, uri); g_free (uri); } else { - gimp_image_set_uri (gimage, NULL); + gimp_image_set_uri (image, NULL); } } gchar * -gimp_image_get_filename (const GimpImage *gimage) +gimp_image_get_filename (const GimpImage *image) { const gchar *uri; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - uri = gimp_object_get_name (GIMP_OBJECT (gimage)); + uri = gimp_object_get_name (GIMP_OBJECT (image)); if (! uri) return NULL; @@ -1355,175 +1355,175 @@ gimp_image_get_filename (const GimpImage *gimage) } void -gimp_image_set_save_proc (GimpImage *gimage, +gimp_image_set_save_proc (GimpImage *image, PlugInProcDef *proc) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - gimage->save_proc = proc; + image->save_proc = proc; } PlugInProcDef * -gimp_image_get_save_proc (const GimpImage *gimage) +gimp_image_get_save_proc (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->save_proc; + return image->save_proc; } void -gimp_image_set_resolution (GimpImage *gimage, +gimp_image_set_resolution (GimpImage *image, gdouble xresolution, gdouble yresolution) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); /* don't allow to set the resolution out of bounds */ if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION || yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION) return; - if ((ABS (gimage->xresolution - xresolution) >= 1e-5) || - (ABS (gimage->yresolution - yresolution) >= 1e-5)) + if ((ABS (image->xresolution - xresolution) >= 1e-5) || + (ABS (image->yresolution - yresolution) >= 1e-5)) { - gimp_image_undo_push_image_resolution (gimage, + gimp_image_undo_push_image_resolution (image, _("Change Image Resolution")); - gimage->xresolution = xresolution; - gimage->yresolution = yresolution; + image->xresolution = xresolution; + image->yresolution = yresolution; - gimp_image_resolution_changed (gimage); - gimp_viewable_size_changed (GIMP_VIEWABLE (gimage)); + gimp_image_resolution_changed (image); + gimp_viewable_size_changed (GIMP_VIEWABLE (image)); } } void -gimp_image_get_resolution (const GimpImage *gimage, +gimp_image_get_resolution (const GimpImage *image, gdouble *xresolution, gdouble *yresolution) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (xresolution && yresolution); - *xresolution = gimage->xresolution; - *yresolution = gimage->yresolution; + *xresolution = image->xresolution; + *yresolution = image->yresolution; } void -gimp_image_resolution_changed (GimpImage *gimage) +gimp_image_resolution_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[RESOLUTION_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[RESOLUTION_CHANGED], 0); } void -gimp_image_set_unit (GimpImage *gimage, +gimp_image_set_unit (GimpImage *image, GimpUnit unit) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (unit > GIMP_UNIT_PIXEL); - if (gimage->resolution_unit != unit) + if (image->resolution_unit != unit) { - gimp_image_undo_push_image_resolution (gimage, + gimp_image_undo_push_image_resolution (image, _("Change Image Unit")); - gimage->resolution_unit = unit; - gimp_image_unit_changed (gimage); + image->resolution_unit = unit; + gimp_image_unit_changed (image); } } GimpUnit -gimp_image_get_unit (const GimpImage *gimage) +gimp_image_get_unit (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_UNIT_INCH); + g_return_val_if_fail (GIMP_IS_IMAGE (image), GIMP_UNIT_INCH); - return gimage->resolution_unit; + return image->resolution_unit; } void -gimp_image_unit_changed (GimpImage *gimage) +gimp_image_unit_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[UNIT_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[UNIT_CHANGED], 0); } gint -gimp_image_get_width (const GimpImage *gimage) +gimp_image_get_width (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + g_return_val_if_fail (GIMP_IS_IMAGE (image), 0); - return gimage->width; + return image->width; } gint -gimp_image_get_height (const GimpImage *gimage) +gimp_image_get_height (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + g_return_val_if_fail (GIMP_IS_IMAGE (image), 0); - return gimage->height; + return image->height; } gboolean -gimp_image_has_alpha (const GimpImage *gimage) +gimp_image_has_alpha (const GimpImage *image) { GimpLayer *layer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), TRUE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), TRUE); - layer = (GimpLayer *) gimp_container_get_child_by_index (gimage->layers, 0); + layer = (GimpLayer *) gimp_container_get_child_by_index (image->layers, 0); - return ((gimp_container_num_children (gimage->layers) > 1) || + return ((gimp_container_num_children (image->layers) > 1) || (layer && gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))); } gboolean -gimp_image_is_empty (const GimpImage *gimage) +gimp_image_is_empty (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), TRUE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), TRUE); - return gimp_container_is_empty (gimage->layers); + return gimp_container_is_empty (image->layers); } GimpLayer * -gimp_image_floating_sel (const GimpImage *gimage) +gimp_image_floating_sel (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->floating_sel; + return image->floating_sel; } void -gimp_image_floating_selection_changed (GimpImage *gimage) +gimp_image_floating_selection_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[FLOATING_SELECTION_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[FLOATING_SELECTION_CHANGED], 0); } GimpChannel * -gimp_image_get_mask (const GimpImage *gimage) +gimp_image_get_mask (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->selection_mask; + return image->selection_mask; } void -gimp_image_mask_changed (GimpImage *gimage) +gimp_image_mask_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[MASK_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[MASK_CHANGED], 0); } gint -gimp_image_get_component_index (const GimpImage *gimage, +gimp_image_get_component_index (const GimpImage *image, GimpChannelType channel) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); + g_return_val_if_fail (GIMP_IS_IMAGE (image), -1); switch (channel) { @@ -1533,7 +1533,7 @@ gimp_image_get_component_index (const GimpImage *gimage, case GIMP_GRAY_CHANNEL: return GRAY_PIX; case GIMP_INDEXED_CHANNEL: return INDEXED_PIX; case GIMP_ALPHA_CHANNEL: - switch (gimp_image_base_type (gimage)) + switch (gimp_image_base_type (image)) { case GIMP_RGB: return ALPHA_PIX; case GIMP_GRAY: return ALPHA_G_PIX; @@ -1545,260 +1545,260 @@ gimp_image_get_component_index (const GimpImage *gimage, } void -gimp_image_set_component_active (GimpImage *gimage, +gimp_image_set_component_active (GimpImage *image, GimpChannelType channel, gboolean active) { gint index = -1; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - index = gimp_image_get_component_index (gimage, channel); + index = gimp_image_get_component_index (image, channel); - if (index != -1 && active != gimage->active[index]) + if (index != -1 && active != image->active[index]) { - gimage->active[index] = active ? TRUE : FALSE; + image->active[index] = active ? TRUE : FALSE; /* If there is an active channel and we mess with the components, * the active channel gets unset... */ - gimp_image_unset_active_channel (gimage); + gimp_image_unset_active_channel (image); - g_signal_emit (gimage, + g_signal_emit (image, gimp_image_signals[COMPONENT_ACTIVE_CHANGED], 0, channel); } } gboolean -gimp_image_get_component_active (const GimpImage *gimage, +gimp_image_get_component_active (const GimpImage *image, GimpChannelType channel) { gint index = -1; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - index = gimp_image_get_component_index (gimage, channel); + index = gimp_image_get_component_index (image, channel); if (index != -1) - return gimage->active[index]; + return image->active[index]; return FALSE; } void -gimp_image_set_component_visible (GimpImage *gimage, +gimp_image_set_component_visible (GimpImage *image, GimpChannelType channel, gboolean visible) { gint index = -1; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - index = gimp_image_get_component_index (gimage, channel); + index = gimp_image_get_component_index (image, channel); - if (index != -1 && visible != gimage->visible[index]) + if (index != -1 && visible != image->visible[index]) { - gimage->visible[index] = visible ? TRUE : FALSE; + image->visible[index] = visible ? TRUE : FALSE; - g_signal_emit (gimage, + g_signal_emit (image, gimp_image_signals[COMPONENT_VISIBILITY_CHANGED], 0, channel); - gimp_image_update (gimage, 0, 0, gimage->width, gimage->height); - gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage)); + gimp_image_update (image, 0, 0, image->width, image->height); + gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image)); } } gboolean -gimp_image_get_component_visible (const GimpImage *gimage, +gimp_image_get_component_visible (const GimpImage *image, GimpChannelType channel) { gint index = -1; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - index = gimp_image_get_component_index (gimage, channel); + index = gimp_image_get_component_index (image, channel); if (index != -1) - return gimage->visible[index]; + return image->visible[index]; return FALSE; } void -gimp_image_mode_changed (GimpImage *gimage) +gimp_image_mode_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[MODE_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[MODE_CHANGED], 0); } void -gimp_image_alpha_changed (GimpImage *gimage) +gimp_image_alpha_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[ALPHA_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[ALPHA_CHANGED], 0); } void -gimp_image_update (GimpImage *gimage, +gimp_image_update (GimpImage *image, gint x, gint y, gint width, gint height) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[UPDATE], 0, + g_signal_emit (image, gimp_image_signals[UPDATE], 0, x, y, width, height); } void -gimp_image_update_guide (GimpImage *gimage, +gimp_image_update_guide (GimpImage *image, GimpGuide *guide) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (guide != NULL); - g_signal_emit (gimage, gimp_image_signals[UPDATE_GUIDE], 0, guide); + g_signal_emit (image, gimp_image_signals[UPDATE_GUIDE], 0, guide); } void -gimp_image_update_sample_point (GimpImage *gimage, +gimp_image_update_sample_point (GimpImage *image, GimpSamplePoint *sample_point) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (sample_point != NULL); - g_signal_emit (gimage, gimp_image_signals[UPDATE_SAMPLE_POINT], 0, + g_signal_emit (image, gimp_image_signals[UPDATE_SAMPLE_POINT], 0, sample_point); } void -gimp_image_sample_point_added (GimpImage *gimage, +gimp_image_sample_point_added (GimpImage *image, GimpSamplePoint *sample_point) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (sample_point != NULL); - g_signal_emit (gimage, gimp_image_signals[SAMPLE_POINT_ADDED], 0, + g_signal_emit (image, gimp_image_signals[SAMPLE_POINT_ADDED], 0, sample_point); } void -gimp_image_sample_point_removed (GimpImage *gimage, +gimp_image_sample_point_removed (GimpImage *image, GimpSamplePoint *sample_point) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (sample_point != NULL); - g_signal_emit (gimage, gimp_image_signals[SAMPLE_POINT_REMOVED], 0, + g_signal_emit (image, gimp_image_signals[SAMPLE_POINT_REMOVED], 0, sample_point); } void -gimp_image_colormap_changed (GimpImage *gimage, +gimp_image_colormap_changed (GimpImage *image, gint color_index) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); - g_return_if_fail (color_index >= -1 && color_index < gimage->num_cols); + g_return_if_fail (GIMP_IS_IMAGE (image)); + g_return_if_fail (color_index >= -1 && color_index < image->num_cols); - g_signal_emit (gimage, gimp_image_signals[COLORMAP_CHANGED], 0, + g_signal_emit (image, gimp_image_signals[COLORMAP_CHANGED], 0, color_index); } void -gimp_image_selection_control (GimpImage *gimage, +gimp_image_selection_control (GimpImage *image, GimpSelectionControl control) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[SELECTION_CONTROL], 0, control); + g_signal_emit (image, gimp_image_signals[SELECTION_CONTROL], 0, control); } void -gimp_image_quick_mask_changed (GimpImage *gimage) +gimp_image_quick_mask_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[QUICK_MASK_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[QUICK_MASK_CHANGED], 0); } /* undo */ gboolean -gimp_image_undo_is_enabled (const GimpImage *gimage) +gimp_image_undo_is_enabled (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - return (gimage->undo_freeze_count == 0); + return (image->undo_freeze_count == 0); } gboolean -gimp_image_undo_enable (GimpImage *gimage) +gimp_image_undo_enable (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); /* Free all undo steps as they are now invalidated */ - gimp_image_undo_free (gimage); + gimp_image_undo_free (image); - return gimp_image_undo_thaw (gimage); + return gimp_image_undo_thaw (image); } gboolean -gimp_image_undo_disable (GimpImage *gimage) +gimp_image_undo_disable (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - return gimp_image_undo_freeze (gimage); + return gimp_image_undo_freeze (image); } gboolean -gimp_image_undo_freeze (GimpImage *gimage) +gimp_image_undo_freeze (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - gimage->undo_freeze_count++; + image->undo_freeze_count++; - if (gimage->undo_freeze_count == 1) - gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_FREEZE, NULL); + if (image->undo_freeze_count == 1) + gimp_image_undo_event (image, GIMP_UNDO_EVENT_UNDO_FREEZE, NULL); return TRUE; } gboolean -gimp_image_undo_thaw (GimpImage *gimage) +gimp_image_undo_thaw (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); - g_return_val_if_fail (gimage->undo_freeze_count > 0, FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); + g_return_val_if_fail (image->undo_freeze_count > 0, FALSE); - gimage->undo_freeze_count--; + image->undo_freeze_count--; - if (gimage->undo_freeze_count == 0) - gimp_image_undo_event (gimage, GIMP_UNDO_EVENT_UNDO_THAW, NULL); + if (image->undo_freeze_count == 0) + gimp_image_undo_event (image, GIMP_UNDO_EVENT_UNDO_THAW, NULL); return TRUE; } void -gimp_image_undo_event (GimpImage *gimage, +gimp_image_undo_event (GimpImage *image, GimpUndoEvent event, GimpUndo *undo) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (((event == GIMP_UNDO_EVENT_UNDO_FREE || event == GIMP_UNDO_EVENT_UNDO_FREEZE || event == GIMP_UNDO_EVENT_UNDO_THAW) && undo == NULL) || GIMP_IS_UNDO (undo)); - g_signal_emit (gimage, gimp_image_signals[UNDO_EVENT], 0, event, undo); + g_signal_emit (image, gimp_image_signals[UNDO_EVENT], 0, event, undo); } -/* NOTE about the gimage->dirty counter: +/* NOTE about the image->dirty counter: * If 0, then the image is clean (ie, copy on disk is the same as the one * in memory). * If positive, then that's the number of dirtying operations done @@ -1829,65 +1829,65 @@ gimp_image_undo_event (GimpImage *gimage, */ gint -gimp_image_dirty (GimpImage *gimage, +gimp_image_dirty (GimpImage *image, GimpDirtyMask dirty_mask) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - gimage->dirty++; + image->dirty++; - if (! gimage->dirty_time) - gimage->dirty_time = time (NULL); + if (! image->dirty_time) + image->dirty_time = time (NULL); - g_signal_emit (gimage, gimp_image_signals[DIRTY], 0, dirty_mask); + g_signal_emit (image, gimp_image_signals[DIRTY], 0, dirty_mask); - TRC (("dirty %d -> %d\n", gimage->dirty - 1, gimage->dirty)); + TRC (("dirty %d -> %d\n", image->dirty - 1, image->dirty)); - return gimage->dirty; + return image->dirty; } gint -gimp_image_clean (GimpImage *gimage, +gimp_image_clean (GimpImage *image, GimpDirtyMask dirty_mask) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - gimage->dirty--; + image->dirty--; - g_signal_emit (gimage, gimp_image_signals[CLEAN], 0, dirty_mask); + g_signal_emit (image, gimp_image_signals[CLEAN], 0, dirty_mask); - TRC (("clean %d -> %d\n", gimage->dirty + 1, gimage->dirty)); + TRC (("clean %d -> %d\n", image->dirty + 1, image->dirty)); - return gimage->dirty; + return image->dirty; } void -gimp_image_clean_all (GimpImage *gimage) +gimp_image_clean_all (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - gimage->dirty = 0; - gimage->dirty_time = 0; + image->dirty = 0; + image->dirty_time = 0; - g_signal_emit (gimage, gimp_image_signals[CLEAN], 0); + g_signal_emit (image, gimp_image_signals[CLEAN], 0); } /* flush this image's displays */ void -gimp_image_flush (GimpImage *gimage) +gimp_image_flush (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[FLUSH], 0); + g_signal_emit (image, gimp_image_signals[FLUSH], 0); } /* color transforms / utilities */ void -gimp_image_get_foreground (const GimpImage *gimage, +gimp_image_get_foreground (const GimpImage *image, const GimpDrawable *drawable, GimpContext *context, guchar *fg) @@ -1895,7 +1895,7 @@ gimp_image_get_foreground (const GimpImage *gimage, GimpRGB color; guchar pfg[3]; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (! drawable || GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (fg != NULL); @@ -1904,11 +1904,11 @@ gimp_image_get_foreground (const GimpImage *gimage, gimp_rgb_get_uchar (&color, &pfg[0], &pfg[1], &pfg[2]); - gimp_image_transform_color (gimage, drawable, fg, GIMP_RGB, pfg); + gimp_image_transform_color (image, drawable, fg, GIMP_RGB, pfg); } void -gimp_image_get_background (const GimpImage *gimage, +gimp_image_get_background (const GimpImage *image, const GimpDrawable *drawable, GimpContext *context, guchar *bg) @@ -1916,7 +1916,7 @@ gimp_image_get_background (const GimpImage *gimage, GimpRGB color; guchar pbg[3]; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (! drawable || GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (GIMP_IS_CONTEXT (context)); g_return_if_fail (bg != NULL); @@ -1925,18 +1925,18 @@ gimp_image_get_background (const GimpImage *gimage, gimp_rgb_get_uchar (&color, &pbg[0], &pbg[1], &pbg[2]); - gimp_image_transform_color (gimage, drawable, bg, GIMP_RGB, pbg); + gimp_image_transform_color (image, drawable, bg, GIMP_RGB, pbg); } void -gimp_image_get_color (const GimpImage *src_gimage, +gimp_image_get_color (const GimpImage *src_image, GimpImageType src_type, const guchar *src, guchar *rgba) { gboolean has_alpha = FALSE; - g_return_if_fail (GIMP_IS_IMAGE (src_gimage)); + g_return_if_fail (GIMP_IS_IMAGE (src_image)); switch (src_type) { @@ -1968,9 +1968,9 @@ gimp_image_get_color (const GimpImage *src_gimage, { gint index = *src++ * 3; - *rgba++ = src_gimage->cmap[index++]; - *rgba++ = src_gimage->cmap[index++]; - *rgba++ = src_gimage->cmap[index++]; + *rgba++ = src_image->cmap[index++]; + *rgba++ = src_image->cmap[index++]; + *rgba++ = src_image->cmap[index++]; } break; } @@ -1982,25 +1982,25 @@ gimp_image_get_color (const GimpImage *src_gimage, } void -gimp_image_transform_rgb (const GimpImage *dest_gimage, +gimp_image_transform_rgb (const GimpImage *dest_image, const GimpDrawable *dest_drawable, const GimpRGB *rgb, guchar *color) { guchar col[3]; - g_return_if_fail (GIMP_IS_IMAGE (dest_gimage)); + g_return_if_fail (GIMP_IS_IMAGE (dest_image)); g_return_if_fail (! dest_drawable || GIMP_IS_DRAWABLE (dest_drawable)); g_return_if_fail (rgb != NULL); g_return_if_fail (color != NULL); gimp_rgb_get_uchar (rgb, &col[0], &col[1], &col[2]); - gimp_image_transform_color (dest_gimage, dest_drawable, color, GIMP_RGB, col); + gimp_image_transform_color (dest_image, dest_drawable, color, GIMP_RGB, col); } void -gimp_image_transform_color (const GimpImage *dest_gimage, +gimp_image_transform_color (const GimpImage *dest_image, const GimpDrawable *dest_drawable, guchar *dest, GimpImageBaseType src_type, @@ -2008,12 +2008,12 @@ gimp_image_transform_color (const GimpImage *dest_gimage, { GimpImageType dest_type; - g_return_if_fail (GIMP_IS_IMAGE (dest_gimage)); + g_return_if_fail (GIMP_IS_IMAGE (dest_image)); g_return_if_fail (src_type != GIMP_INDEXED); dest_type = (dest_drawable ? gimp_drawable_type (dest_drawable) : - gimp_image_base_type_with_alpha (dest_gimage)); + gimp_image_base_type_with_alpha (dest_image)); switch (src_type) { @@ -2039,7 +2039,7 @@ gimp_image_transform_color (const GimpImage *dest_gimage, case GIMP_INDEXED_IMAGE: case GIMP_INDEXEDA_IMAGE: /* Least squares method */ - *dest = gimp_image_color_hash_rgb_to_indexed (dest_gimage, + *dest = gimp_image_color_hash_rgb_to_indexed (dest_image, src[RED_PIX], src[GREEN_PIX], src[BLUE_PIX]); @@ -2067,7 +2067,7 @@ gimp_image_transform_color (const GimpImage *dest_gimage, case GIMP_INDEXED_IMAGE: case GIMP_INDEXEDA_IMAGE: /* Least squares method */ - *dest = gimp_image_color_hash_rgb_to_indexed (dest_gimage, + *dest = gimp_image_color_hash_rgb_to_indexed (dest_image, src[GRAY_PIX], src[GRAY_PIX], src[GRAY_PIX]); @@ -2155,41 +2155,41 @@ gimp_image_transform_temp_buf (const GimpImage *dest_image, /* shadow tiles */ TileManager * -gimp_image_shadow (GimpImage *gimage, +gimp_image_shadow (GimpImage *image, gint width, gint height, gint bpp) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - if (gimage->shadow) + if (image->shadow) { - if ((width != tile_manager_width (gimage->shadow)) || - (height != tile_manager_height (gimage->shadow)) || - (bpp != tile_manager_bpp (gimage->shadow))) + if ((width != tile_manager_width (image->shadow)) || + (height != tile_manager_height (image->shadow)) || + (bpp != tile_manager_bpp (image->shadow))) { - gimp_image_free_shadow (gimage); + gimp_image_free_shadow (image); } else { - return gimage->shadow; + return image->shadow; } } - gimage->shadow = tile_manager_new (width, height, bpp); + image->shadow = tile_manager_new (width, height, bpp); - return gimage->shadow; + return image->shadow; } void -gimp_image_free_shadow (GimpImage *gimage) +gimp_image_free_shadow (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - if (gimage->shadow) + if (image->shadow) { - tile_manager_unref (gimage->shadow); - gimage->shadow = NULL; + tile_manager_unref (image->shadow); + image->shadow = NULL; } } @@ -2197,12 +2197,12 @@ gimp_image_free_shadow (GimpImage *gimage) /* parasites */ GimpParasite * -gimp_image_parasite_find (const GimpImage *gimage, +gimp_image_parasite_find (const GimpImage *image, const gchar *name) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimp_parasite_list_find (gimage->parasites, name); + return gimp_parasite_list_find (image->parasites, name); } static void @@ -2214,32 +2214,32 @@ list_func (gchar *key, } gchar ** -gimp_image_parasite_list (const GimpImage *gimage, +gimp_image_parasite_list (const GimpImage *image, gint *count) { gchar **list; gchar **cur; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - *count = gimp_parasite_list_length (gimage->parasites); + *count = gimp_parasite_list_length (image->parasites); cur = list = g_new (gchar*, *count); - gimp_parasite_list_foreach (gimage->parasites, (GHFunc) list_func, &cur); + gimp_parasite_list_foreach (image->parasites, (GHFunc) list_func, &cur); return list; } void -gimp_image_parasite_attach (GimpImage *gimage, +gimp_image_parasite_attach (GimpImage *image, GimpParasite *parasite) { - g_return_if_fail (GIMP_IS_IMAGE (gimage) && parasite != NULL); + g_return_if_fail (GIMP_IS_IMAGE (image) && parasite != NULL); /* only set the dirty bit manually if we can be saved and the new parasite differs from the current one and we aren't undoable */ if (gimp_parasite_is_undoable (parasite)) - gimp_image_undo_push_image_parasite (gimage, + gimp_image_undo_push_image_parasite (image, _("Attach Parasite to Image"), parasite); @@ -2250,71 +2250,71 @@ gimp_image_parasite_attach (GimpImage *gimage, undoable but does not block the undo system. --Sven */ - gimp_parasite_list_add (gimage->parasites, parasite); + gimp_parasite_list_add (image->parasites, parasite); if (gimp_parasite_has_flag (parasite, GIMP_PARASITE_ATTACH_PARENT)) { gimp_parasite_shift_parent (parasite); - gimp_parasite_attach (gimage->gimp, parasite); + gimp_parasite_attach (image->gimp, parasite); } } void -gimp_image_parasite_detach (GimpImage *gimage, +gimp_image_parasite_detach (GimpImage *image, const gchar *parasite) { GimpParasite *p; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (parasite != NULL); - if (!(p = gimp_parasite_list_find (gimage->parasites, parasite))) + if (!(p = gimp_parasite_list_find (image->parasites, parasite))) return; if (gimp_parasite_is_undoable (p)) - gimp_image_undo_push_image_parasite_remove (gimage, + gimp_image_undo_push_image_parasite_remove (image, _("Remove Parasite from Image"), gimp_parasite_name (p)); - gimp_parasite_list_remove (gimage->parasites, parasite); + gimp_parasite_list_remove (image->parasites, parasite); } /* tattoos */ GimpTattoo -gimp_image_get_new_tattoo (GimpImage *gimage) +gimp_image_get_new_tattoo (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + g_return_val_if_fail (GIMP_IS_IMAGE (image), 0); - gimage->tattoo_state++; + image->tattoo_state++; - if (gimage->tattoo_state <= 0) + if (image->tattoo_state <= 0) g_warning ("%s: Tattoo state corrupted (integer overflow).", G_STRFUNC); - return gimage->tattoo_state; + return image->tattoo_state; } GimpTattoo -gimp_image_get_tattoo_state (GimpImage *gimage) +gimp_image_get_tattoo_state (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + g_return_val_if_fail (GIMP_IS_IMAGE (image), 0); - return gimage->tattoo_state; + return image->tattoo_state; } gboolean -gimp_image_set_tattoo_state (GimpImage *gimage, +gimp_image_set_tattoo_state (GimpImage *image, GimpTattoo val) { GList *list; gboolean retval = TRUE; GimpTattoo maxval = 0; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); /* Check that the layer tatoos don't overlap with channel or vector ones */ - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -2324,15 +2324,15 @@ gimp_image_set_tattoo_state (GimpImage *gimage, if (ltattoo > maxval) maxval = ltattoo; - if (gimp_image_get_channel_by_tattoo (gimage, ltattoo)) + if (gimp_image_get_channel_by_tattoo (image, ltattoo)) retval = FALSE; /* Oopps duplicated tattoo in channel */ - if (gimp_image_get_vectors_by_tattoo (gimage, ltattoo)) + if (gimp_image_get_vectors_by_tattoo (image, ltattoo)) retval = FALSE; /* Oopps duplicated tattoo in vectors */ } /* Now check that the channel and vectors tattoos don't overlap */ - for (list = GIMP_LIST (gimage->channels)->list; + for (list = GIMP_LIST (image->channels)->list; list; list = g_list_next (list)) { @@ -2342,12 +2342,12 @@ gimp_image_set_tattoo_state (GimpImage *gimage, if (ctattoo > maxval) maxval = ctattoo; - if (gimp_image_get_vectors_by_tattoo (gimage, ctattoo)) + if (gimp_image_get_vectors_by_tattoo (image, ctattoo)) retval = FALSE; /* Oopps duplicated tattoo in vectors */ } /* Find the max tattoo value in the vectors */ - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { @@ -2363,7 +2363,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, /* Must check if the state is valid */ if (retval == TRUE) - gimage->tattoo_state = val; + image->tattoo_state = val; return retval; } @@ -2372,44 +2372,44 @@ gimp_image_set_tattoo_state (GimpImage *gimage, /* layers / channels / vectors */ GimpContainer * -gimp_image_get_layers (const GimpImage *gimage) +gimp_image_get_layers (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->layers; + return image->layers; } GimpContainer * -gimp_image_get_channels (const GimpImage *gimage) +gimp_image_get_channels (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->channels; + return image->channels; } GimpContainer * -gimp_image_get_vectors (const GimpImage *gimage) +gimp_image_get_vectors (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->vectors; + return image->vectors; } GimpDrawable * -gimp_image_active_drawable (const GimpImage *gimage) +gimp_image_active_drawable (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); /* If there is an active channel (a saved selection, etc.), * we ignore the active layer */ - if (gimage->active_channel) + if (image->active_channel) { - return GIMP_DRAWABLE (gimage->active_channel); + return GIMP_DRAWABLE (image->active_channel); } - else if (gimage->active_layer) + else if (image->active_layer) { - GimpLayer *layer = gimage->active_layer; + GimpLayer *layer = image->active_layer; if (layer->mask && layer->mask->edit_mask) return GIMP_DRAWABLE (layer->mask); @@ -2421,204 +2421,204 @@ gimp_image_active_drawable (const GimpImage *gimage) } GimpLayer * -gimp_image_get_active_layer (const GimpImage *gimage) +gimp_image_get_active_layer (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->active_layer; + return image->active_layer; } GimpChannel * -gimp_image_get_active_channel (const GimpImage *gimage) +gimp_image_get_active_channel (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->active_channel; + return image->active_channel; } GimpVectors * -gimp_image_get_active_vectors (const GimpImage *gimage) +gimp_image_get_active_vectors (const GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return gimage->active_vectors; + return image->active_vectors; } GimpLayer * -gimp_image_set_active_layer (GimpImage *gimage, +gimp_image_set_active_layer (GimpImage *image, GimpLayer *layer) { GimpLayer *floating_sel; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (layer == NULL || GIMP_IS_LAYER (layer), NULL); g_return_val_if_fail (layer == NULL || - gimp_container_have (gimage->layers, + gimp_container_have (image->layers, GIMP_OBJECT (layer)), NULL); - floating_sel = gimp_image_floating_sel (gimage); + floating_sel = gimp_image_floating_sel (image); /* Make sure the floating_sel always is the active layer */ if (floating_sel && layer != floating_sel) return floating_sel; - if (layer != gimage->active_layer) + if (layer != image->active_layer) { if (layer) { /* Configure the layer stack to reflect this change */ - gimage->layer_stack = g_slist_remove (gimage->layer_stack, layer); - gimage->layer_stack = g_slist_prepend (gimage->layer_stack, layer); + image->layer_stack = g_slist_remove (image->layer_stack, layer); + image->layer_stack = g_slist_prepend (image->layer_stack, layer); } /* Don't cache selection info for the previous active layer */ - if (gimage->active_layer) - gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (gimage->active_layer)); + if (image->active_layer) + gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (image->active_layer)); - gimage->active_layer = layer; + image->active_layer = layer; - g_signal_emit (gimage, gimp_image_signals[ACTIVE_LAYER_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[ACTIVE_LAYER_CHANGED], 0); - if (layer && gimage->active_channel) - gimp_image_set_active_channel (gimage, NULL); + if (layer && image->active_channel) + gimp_image_set_active_channel (image, NULL); } - return gimage->active_layer; + return image->active_layer; } GimpChannel * -gimp_image_set_active_channel (GimpImage *gimage, +gimp_image_set_active_channel (GimpImage *image, GimpChannel *channel) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (channel == NULL || GIMP_IS_CHANNEL (channel), NULL); g_return_val_if_fail (channel == NULL || - gimp_container_have (gimage->channels, + gimp_container_have (image->channels, GIMP_OBJECT (channel)), NULL); /* Not if there is a floating selection */ - if (channel && gimp_image_floating_sel (gimage)) + if (channel && gimp_image_floating_sel (image)) return NULL; - if (channel != gimage->active_channel) + if (channel != image->active_channel) { - gimage->active_channel = channel; + image->active_channel = channel; - g_signal_emit (gimage, gimp_image_signals[ACTIVE_CHANNEL_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[ACTIVE_CHANNEL_CHANGED], 0); - if (channel && gimage->active_layer) - gimp_image_set_active_layer (gimage, NULL); + if (channel && image->active_layer) + gimp_image_set_active_layer (image, NULL); } - return gimage->active_channel; + return image->active_channel; } GimpChannel * -gimp_image_unset_active_channel (GimpImage *gimage) +gimp_image_unset_active_channel (GimpImage *image) { GimpChannel *channel; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - channel = gimp_image_get_active_channel (gimage); + channel = gimp_image_get_active_channel (image); if (channel) { - gimp_image_set_active_channel (gimage, NULL); + gimp_image_set_active_channel (image, NULL); - if (gimage->layer_stack) - gimp_image_set_active_layer (gimage, gimage->layer_stack->data); + if (image->layer_stack) + gimp_image_set_active_layer (image, image->layer_stack->data); } return channel; } GimpVectors * -gimp_image_set_active_vectors (GimpImage *gimage, +gimp_image_set_active_vectors (GimpImage *image, GimpVectors *vectors) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + 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 (vectors == NULL || - gimp_container_have (gimage->vectors, + gimp_container_have (image->vectors, GIMP_OBJECT (vectors)), NULL); - if (vectors != gimage->active_vectors) + if (vectors != image->active_vectors) { - gimage->active_vectors = vectors; + image->active_vectors = vectors; - g_signal_emit (gimage, gimp_image_signals[ACTIVE_VECTORS_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[ACTIVE_VECTORS_CHANGED], 0); } - return gimage->active_vectors; + return image->active_vectors; } void -gimp_image_active_layer_changed (GimpImage *gimage) +gimp_image_active_layer_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[ACTIVE_LAYER_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[ACTIVE_LAYER_CHANGED], 0); } void -gimp_image_active_channel_changed (GimpImage *gimage) +gimp_image_active_channel_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[ACTIVE_CHANNEL_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[ACTIVE_CHANNEL_CHANGED], 0); } void -gimp_image_active_vectors_changed (GimpImage *gimage) +gimp_image_active_vectors_changed (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - g_signal_emit (gimage, gimp_image_signals[ACTIVE_VECTORS_CHANGED], 0); + g_signal_emit (image, gimp_image_signals[ACTIVE_VECTORS_CHANGED], 0); } gint -gimp_image_get_layer_index (const GimpImage *gimage, +gimp_image_get_layer_index (const GimpImage *image, const GimpLayer *layer) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); + g_return_val_if_fail (GIMP_IS_IMAGE (image), -1); g_return_val_if_fail (GIMP_IS_LAYER (layer), -1); - return gimp_container_get_child_index (gimage->layers, + return gimp_container_get_child_index (image->layers, GIMP_OBJECT (layer)); } gint -gimp_image_get_channel_index (const GimpImage *gimage, +gimp_image_get_channel_index (const GimpImage *image, const GimpChannel *channel) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); + g_return_val_if_fail (GIMP_IS_IMAGE (image), -1); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), -1); - return gimp_container_get_child_index (gimage->channels, + return gimp_container_get_child_index (image->channels, GIMP_OBJECT (channel)); } gint -gimp_image_get_vectors_index (const GimpImage *gimage, +gimp_image_get_vectors_index (const GimpImage *image, const GimpVectors *vectors) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), -1); + g_return_val_if_fail (GIMP_IS_IMAGE (image), -1); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), -1); - return gimp_container_get_child_index (gimage->vectors, + return gimp_container_get_child_index (image->vectors, GIMP_OBJECT (vectors)); } GimpLayer * -gimp_image_get_layer_by_tattoo (const GimpImage *gimage, +gimp_image_get_layer_by_tattoo (const GimpImage *image, GimpTattoo tattoo) { GList *list; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -2632,14 +2632,14 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, } GimpChannel * -gimp_image_get_channel_by_tattoo (const GimpImage *gimage, +gimp_image_get_channel_by_tattoo (const GimpImage *image, GimpTattoo tattoo) { GList *list; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - for (list = GIMP_LIST (gimage->channels)->list; + for (list = GIMP_LIST (image->channels)->list; list; list = g_list_next (list)) { @@ -2653,14 +2653,14 @@ gimp_image_get_channel_by_tattoo (const GimpImage *gimage, } GimpVectors * -gimp_image_get_vectors_by_tattoo (const GimpImage *gimage, +gimp_image_get_vectors_by_tattoo (const GimpImage *image, GimpTattoo tattoo) { GList *list; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { @@ -2674,37 +2674,37 @@ gimp_image_get_vectors_by_tattoo (const GimpImage *gimage, } GimpLayer * -gimp_image_get_layer_by_name (const GimpImage *gimage, +gimp_image_get_layer_by_name (const GimpImage *image, const gchar *name) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return (GimpLayer *) gimp_container_get_child_by_name (gimage->layers, + return (GimpLayer *) gimp_container_get_child_by_name (image->layers, name); } GimpChannel * -gimp_image_get_channel_by_name (const GimpImage *gimage, +gimp_image_get_channel_by_name (const GimpImage *image, const gchar *name) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return (GimpChannel *) gimp_container_get_child_by_name (gimage->channels, + return (GimpChannel *) gimp_container_get_child_by_name (image->channels, name); } GimpVectors * -gimp_image_get_vectors_by_name (const GimpImage *gimage, +gimp_image_get_vectors_by_name (const GimpImage *image, const gchar *name) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - return (GimpVectors *) gimp_container_get_child_by_name (gimage->vectors, + return (GimpVectors *) gimp_container_get_child_by_name (image->vectors, name); } gboolean -gimp_image_add_layer (GimpImage *gimage, +gimp_image_add_layer (GimpImage *image, GimpLayer *layer, gint position) { @@ -2712,23 +2712,23 @@ gimp_image_add_layer (GimpImage *gimage, GimpLayer *floating_sel; gboolean old_has_alpha; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); - if (GIMP_ITEM (layer)->gimage != NULL && - GIMP_ITEM (layer)->gimage != gimage) + if (GIMP_ITEM (layer)->image != NULL && + GIMP_ITEM (layer)->image != image) { g_warning ("%s: attempting to add layer to wrong image.", G_STRFUNC); return FALSE; } - if (gimp_container_have (gimage->layers, GIMP_OBJECT (layer))) + if (gimp_container_have (image->layers, GIMP_OBJECT (layer))) { g_warning ("%s: trying to add layer to image twice.", G_STRFUNC); return FALSE; } - floating_sel = gimp_image_floating_sel (gimage); + floating_sel = gimp_image_floating_sel (image); if (floating_sel && gimp_layer_is_floating_sel (layer)) { @@ -2737,27 +2737,27 @@ gimp_image_add_layer (GimpImage *gimage, return FALSE; } - active_layer = gimp_image_get_active_layer (gimage); + active_layer = gimp_image_get_active_layer (image); - old_has_alpha = gimp_image_has_alpha (gimage); + old_has_alpha = gimp_image_has_alpha (image); - gimp_image_undo_push_layer_add (gimage, _("Add Layer"), + gimp_image_undo_push_layer_add (image, _("Add Layer"), layer, 0, active_layer); - gimp_item_set_image (GIMP_ITEM (layer), gimage); + gimp_item_set_image (GIMP_ITEM (layer), image); if (layer->mask) - gimp_item_set_image (GIMP_ITEM (layer->mask), gimage); + gimp_item_set_image (GIMP_ITEM (layer->mask), image); /* If the layer is a floating selection, set the ID */ if (gimp_layer_is_floating_sel (layer)) - gimage->floating_sel = layer; + image->floating_sel = layer; /* add the layer to the list at the specified position */ if (position == -1) { if (active_layer) - position = gimp_container_get_child_index (gimage->layers, + position = gimp_container_get_child_index (image->layers, GIMP_OBJECT (active_layer)); else position = 0; @@ -2770,26 +2770,26 @@ gimp_image_add_layer (GimpImage *gimage, position = 1; /* Don't add at a non-existing index */ - if (position > gimp_container_num_children (gimage->layers)) - position = gimp_container_num_children (gimage->layers); + if (position > gimp_container_num_children (image->layers)) + position = gimp_container_num_children (image->layers); - gimp_container_insert (gimage->layers, GIMP_OBJECT (layer), position); + gimp_container_insert (image->layers, GIMP_OBJECT (layer), position); gimp_item_sink (GIMP_ITEM (layer)); /* notify the layers dialog of the currently active layer */ - gimp_image_set_active_layer (gimage, layer); + gimp_image_set_active_layer (image, layer); - if (old_has_alpha != gimp_image_has_alpha (gimage)) - gimp_image_alpha_changed (gimage); + if (old_has_alpha != gimp_image_has_alpha (image)) + gimp_image_alpha_changed (image); if (gimp_layer_is_floating_sel (layer)) - gimp_image_floating_selection_changed (gimage); + gimp_image_floating_selection_changed (image); return TRUE; } void -gimp_image_remove_layer (GimpImage *gimage, +gimp_image_remove_layer (GimpImage *image, GimpLayer *layer) { GimpLayer *active_layer; @@ -2797,28 +2797,28 @@ gimp_image_remove_layer (GimpImage *gimage, gboolean old_has_alpha; gboolean undo_group = FALSE; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_LAYER (layer)); - g_return_if_fail (gimp_container_have (gimage->layers, + g_return_if_fail (gimp_container_have (image->layers, GIMP_OBJECT (layer))); if (gimp_drawable_has_floating_sel (GIMP_DRAWABLE (layer))) { - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, _("Remove Layer")); undo_group = TRUE; - floating_sel_remove (gimp_image_floating_sel (gimage)); + floating_sel_remove (gimp_image_floating_sel (image)); } - active_layer = gimp_image_get_active_layer (gimage); + active_layer = gimp_image_get_active_layer (image); - index = gimp_container_get_child_index (gimage->layers, + index = gimp_container_get_child_index (image->layers, GIMP_OBJECT (layer)); - old_has_alpha = gimp_image_has_alpha (gimage); + old_has_alpha = gimp_image_has_alpha (image); - gimp_image_undo_push_layer_remove (gimage, _("Remove Layer"), + gimp_image_undo_push_layer_remove (image, _("Remove Layer"), layer, index, active_layer); g_object_ref (layer); @@ -2827,36 +2827,36 @@ gimp_image_remove_layer (GimpImage *gimage, if (layer == active_layer) gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (layer)); - gimp_container_remove (gimage->layers, GIMP_OBJECT (layer)); - gimage->layer_stack = g_slist_remove (gimage->layer_stack, layer); + gimp_container_remove (image->layers, GIMP_OBJECT (layer)); + image->layer_stack = g_slist_remove (image->layer_stack, layer); - if (gimage->floating_sel == layer) + if (image->floating_sel == layer) { /* If this was the floating selection, reset the fs pointer * and activate the underlying drawable */ - gimage->floating_sel = NULL; + image->floating_sel = NULL; floating_sel_activate_drawable (layer); - gimp_image_floating_selection_changed (gimage); + gimp_image_floating_selection_changed (image); } else if (layer == active_layer) { - if (gimage->layer_stack) + if (image->layer_stack) { - active_layer = gimage->layer_stack->data; + active_layer = image->layer_stack->data; } else { - gint n_children = gimp_container_num_children (gimage->layers); + gint n_children = gimp_container_num_children (image->layers); if (n_children > 0) { index = CLAMP (index, 0, n_children - 1); active_layer = (GimpLayer *) - gimp_container_get_child_by_index (gimage->layers, index); + gimp_container_get_child_by_index (image->layers, index); } else { @@ -2864,30 +2864,30 @@ gimp_image_remove_layer (GimpImage *gimage, } } - gimp_image_set_active_layer (gimage, active_layer); + gimp_image_set_active_layer (image, active_layer); } gimp_item_removed (GIMP_ITEM (layer)); g_object_unref (layer); - if (old_has_alpha != gimp_image_has_alpha (gimage)) - gimp_image_alpha_changed (gimage); + if (old_has_alpha != gimp_image_has_alpha (image)) + gimp_image_alpha_changed (image); if (undo_group) - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } gboolean -gimp_image_raise_layer (GimpImage *gimage, +gimp_image_raise_layer (GimpImage *image, GimpLayer *layer) { gint index; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); - index = gimp_container_get_child_index (gimage->layers, + index = gimp_container_get_child_index (image->layers, GIMP_OBJECT (layer)); if (index == 0) @@ -2896,60 +2896,60 @@ gimp_image_raise_layer (GimpImage *gimage, return FALSE; } - return gimp_image_position_layer (gimage, layer, index - 1, + return gimp_image_position_layer (image, layer, index - 1, TRUE, _("Raise Layer")); } gboolean -gimp_image_lower_layer (GimpImage *gimage, +gimp_image_lower_layer (GimpImage *image, GimpLayer *layer) { gint index; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); - index = gimp_container_get_child_index (gimage->layers, + index = gimp_container_get_child_index (image->layers, GIMP_OBJECT (layer)); - if (index == gimp_container_num_children (gimage->layers) - 1) + if (index == gimp_container_num_children (image->layers) - 1) { g_message (_("Layer cannot be lowered more.")); return FALSE; } - return gimp_image_position_layer (gimage, layer, index + 1, + return gimp_image_position_layer (image, layer, index + 1, TRUE, _("Lower Layer")); } gboolean -gimp_image_raise_layer_to_top (GimpImage *gimage, +gimp_image_raise_layer_to_top (GimpImage *image, GimpLayer *layer) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); - return gimp_image_position_layer (gimage, layer, 0, + return gimp_image_position_layer (image, layer, 0, TRUE, _("Raise Layer to Top")); } gboolean -gimp_image_lower_layer_to_bottom (GimpImage *gimage, +gimp_image_lower_layer_to_bottom (GimpImage *image, GimpLayer *layer) { gint length; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); - length = gimp_container_num_children (gimage->layers); + length = gimp_container_num_children (image->layers); - return gimp_image_position_layer (gimage, layer, length - 1, + return gimp_image_position_layer (image, layer, length - 1, TRUE, _("Lower Layer to Bottom")); } gboolean -gimp_image_position_layer (GimpImage *gimage, +gimp_image_position_layer (GimpImage *image, GimpLayer *layer, gint new_index, gboolean push_undo, @@ -2958,14 +2958,14 @@ gimp_image_position_layer (GimpImage *gimage, gint index; gint num_layers; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_LAYER (layer), FALSE); - index = gimp_container_get_child_index (gimage->layers, GIMP_OBJECT (layer)); + index = gimp_container_get_child_index (image->layers, GIMP_OBJECT (layer)); if (index < 0) return FALSE; - num_layers = gimp_container_num_children (gimage->layers); + num_layers = gimp_container_num_children (image->layers); new_index = CLAMP (new_index, 0, num_layers - 1); @@ -2973,9 +2973,9 @@ gimp_image_position_layer (GimpImage *gimage, return TRUE; if (push_undo) - gimp_image_undo_push_layer_reposition (gimage, undo_desc, layer); + gimp_image_undo_push_layer_reposition (image, undo_desc, layer); - gimp_container_reorder (gimage->layers, GIMP_OBJECT (layer), new_index); + gimp_container_reorder (image->layers, GIMP_OBJECT (layer), new_index); if (gimp_item_get_visible (GIMP_ITEM (layer))) { @@ -2983,139 +2983,139 @@ gimp_image_position_layer (GimpImage *gimage, gimp_item_offsets (GIMP_ITEM (layer), &off_x, &off_y); - gimp_image_update (gimage, + gimp_image_update (image, off_x, off_y, gimp_item_width (GIMP_ITEM (layer)), gimp_item_height (GIMP_ITEM (layer))); - gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage)); + gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image)); } return TRUE; } gboolean -gimp_image_add_channel (GimpImage *gimage, +gimp_image_add_channel (GimpImage *image, GimpChannel *channel, gint position) { GimpChannel *active_channel; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - if (GIMP_ITEM (channel)->gimage != NULL && - GIMP_ITEM (channel)->gimage != gimage) + if (GIMP_ITEM (channel)->image != NULL && + GIMP_ITEM (channel)->image != image) { g_warning ("%s: attempting to add channel to wrong image.", G_STRFUNC); return FALSE; } - if (gimp_container_have (gimage->channels, GIMP_OBJECT (channel))) + if (gimp_container_have (image->channels, GIMP_OBJECT (channel))) { g_warning ("%s: trying to add channel to image twice.", G_STRFUNC); return FALSE; } - active_channel = gimp_image_get_active_channel (gimage); + active_channel = gimp_image_get_active_channel (image); - gimp_image_undo_push_channel_add (gimage, _("Add Channel"), + gimp_image_undo_push_channel_add (image, _("Add Channel"), channel, 0, active_channel); - gimp_item_set_image (GIMP_ITEM (channel), gimage); + gimp_item_set_image (GIMP_ITEM (channel), image); /* add the layer to the list at the specified position */ if (position == -1) { if (active_channel) - position = gimp_container_get_child_index (gimage->channels, + position = gimp_container_get_child_index (image->channels, GIMP_OBJECT (active_channel)); else position = 0; } /* Don't add at a non-existing index */ - if (position > gimp_container_num_children (gimage->channels)) - position = gimp_container_num_children (gimage->channels); + if (position > gimp_container_num_children (image->channels)) + position = gimp_container_num_children (image->channels); - gimp_container_insert (gimage->channels, GIMP_OBJECT (channel), position); + gimp_container_insert (image->channels, GIMP_OBJECT (channel), position); gimp_item_sink (GIMP_ITEM (channel)); - /* notify this gimage of the currently active channel */ - gimp_image_set_active_channel (gimage, channel); + /* notify this image of the currently active channel */ + gimp_image_set_active_channel (image, channel); return TRUE; } void -gimp_image_remove_channel (GimpImage *gimage, +gimp_image_remove_channel (GimpImage *image, GimpChannel *channel) { GimpChannel *active_channel; gint index; gboolean undo_group = FALSE; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_CHANNEL (channel)); - g_return_if_fail (gimp_container_have (gimage->channels, + g_return_if_fail (gimp_container_have (image->channels, GIMP_OBJECT (channel))); if (gimp_drawable_has_floating_sel (GIMP_DRAWABLE (channel))) { - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_ITEM_REMOVE, _("Remove Channel")); undo_group = TRUE; - floating_sel_remove (gimp_image_floating_sel (gimage)); + floating_sel_remove (gimp_image_floating_sel (image)); } - active_channel = gimp_image_get_active_channel (gimage); + active_channel = gimp_image_get_active_channel (image); - index = gimp_container_get_child_index (gimage->channels, + index = gimp_container_get_child_index (image->channels, GIMP_OBJECT (channel)); - gimp_image_undo_push_channel_remove (gimage, _("Remove Channel"), + gimp_image_undo_push_channel_remove (image, _("Remove Channel"), channel, index, active_channel); g_object_ref (channel); - gimp_container_remove (gimage->channels, GIMP_OBJECT (channel)); + gimp_container_remove (image->channels, GIMP_OBJECT (channel)); gimp_item_removed (GIMP_ITEM (channel)); if (channel == active_channel) { - gint n_children = gimp_container_num_children (gimage->channels); + gint n_children = gimp_container_num_children (image->channels); if (n_children > 0) { index = CLAMP (index, 0, n_children - 1); active_channel = (GimpChannel *) - gimp_container_get_child_by_index (gimage->channels, index); + gimp_container_get_child_by_index (image->channels, index); - gimp_image_set_active_channel (gimage, active_channel); + gimp_image_set_active_channel (image, active_channel); } else { - gimp_image_unset_active_channel (gimage); + gimp_image_unset_active_channel (image); } } g_object_unref (channel); if (undo_group) - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } gboolean -gimp_image_raise_channel (GimpImage *gimage, +gimp_image_raise_channel (GimpImage *image, GimpChannel *channel) { gint index; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - index = gimp_container_get_child_index (gimage->channels, + index = gimp_container_get_child_index (image->channels, GIMP_OBJECT (channel)); if (index == 0) @@ -3124,20 +3124,20 @@ gimp_image_raise_channel (GimpImage *gimage, return FALSE; } - return gimp_image_position_channel (gimage, channel, index - 1, + return gimp_image_position_channel (image, channel, index - 1, TRUE, _("Raise Channel")); } gboolean -gimp_image_raise_channel_to_top (GimpImage *gimage, +gimp_image_raise_channel_to_top (GimpImage *image, GimpChannel *channel) { gint index; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - index = gimp_container_get_child_index (gimage->channels, + index = gimp_container_get_child_index (image->channels, GIMP_OBJECT (channel)); if (index == 0) @@ -3146,46 +3146,46 @@ gimp_image_raise_channel_to_top (GimpImage *gimage, return FALSE; } - return gimp_image_position_channel (gimage, channel, 0, + return gimp_image_position_channel (image, channel, 0, TRUE, _("Raise Channel to Top")); } gboolean -gimp_image_lower_channel (GimpImage *gimage, +gimp_image_lower_channel (GimpImage *image, GimpChannel *channel) { gint index; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - index = gimp_container_get_child_index (gimage->channels, + index = gimp_container_get_child_index (image->channels, GIMP_OBJECT (channel)); - if (index == gimp_container_num_children (gimage->channels) - 1) + if (index == gimp_container_num_children (image->channels) - 1) { g_message (_("Channel cannot be lowered more.")); return FALSE; } - return gimp_image_position_channel (gimage, channel, index + 1, + return gimp_image_position_channel (image, channel, index + 1, TRUE, _("Lower Channel")); } gboolean -gimp_image_lower_channel_to_bottom (GimpImage *gimage, +gimp_image_lower_channel_to_bottom (GimpImage *image, GimpChannel *channel) { gint index; gint length; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - index = gimp_container_get_child_index (gimage->channels, + index = gimp_container_get_child_index (image->channels, GIMP_OBJECT (channel)); - length = gimp_container_num_children (gimage->channels); + length = gimp_container_num_children (image->channels); if (index == length - 1) { @@ -3193,12 +3193,12 @@ gimp_image_lower_channel_to_bottom (GimpImage *gimage, return FALSE; } - return gimp_image_position_channel (gimage, channel, length - 1, + return gimp_image_position_channel (image, channel, length - 1, TRUE, _("Lower Channel to Bottom")); } gboolean -gimp_image_position_channel (GimpImage *gimage, +gimp_image_position_channel (GimpImage *image, GimpChannel *channel, gint new_index, gboolean push_undo, @@ -3207,15 +3207,15 @@ gimp_image_position_channel (GimpImage *gimage, gint index; gint num_channels; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_CHANNEL (channel), FALSE); - index = gimp_container_get_child_index (gimage->channels, + index = gimp_container_get_child_index (image->channels, GIMP_OBJECT (channel)); if (index < 0) return FALSE; - num_channels = gimp_container_num_children (gimage->channels); + num_channels = gimp_container_num_children (image->channels); new_index = CLAMP (new_index, 0, num_channels - 1); @@ -3223,9 +3223,9 @@ gimp_image_position_channel (GimpImage *gimage, return TRUE; if (push_undo) - gimp_image_undo_push_channel_reposition (gimage, undo_desc, channel); + gimp_image_undo_push_channel_reposition (image, undo_desc, channel); - gimp_container_reorder (gimage->channels, + gimp_container_reorder (image->channels, GIMP_OBJECT (channel), new_index); if (gimp_item_get_visible (GIMP_ITEM (channel))) @@ -3234,126 +3234,126 @@ gimp_image_position_channel (GimpImage *gimage, gimp_item_offsets (GIMP_ITEM (channel), &off_x, &off_y); - gimp_image_update (gimage, + gimp_image_update (image, off_x, off_y, gimp_item_width (GIMP_ITEM (channel)), gimp_item_height (GIMP_ITEM (channel))); - gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage)); + gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image)); } return TRUE; } gboolean -gimp_image_add_vectors (GimpImage *gimage, +gimp_image_add_vectors (GimpImage *image, GimpVectors *vectors, gint position) { GimpVectors *active_vectors; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); - if (GIMP_ITEM (vectors)->gimage != NULL && - GIMP_ITEM (vectors)->gimage != gimage) + if (GIMP_ITEM (vectors)->image != NULL && + GIMP_ITEM (vectors)->image != image) { g_warning ("%s: attempting to add vectors to wrong image.", G_STRFUNC); return FALSE; } - if (gimp_container_have (gimage->vectors, GIMP_OBJECT (vectors))) + if (gimp_container_have (image->vectors, GIMP_OBJECT (vectors))) { g_warning ("%s: trying to add vectors to image twice.", G_STRFUNC); return FALSE; } - active_vectors = gimp_image_get_active_vectors (gimage); + active_vectors = gimp_image_get_active_vectors (image); - gimp_image_undo_push_vectors_add (gimage, _("Add Path"), + gimp_image_undo_push_vectors_add (image, _("Add Path"), vectors, 0, active_vectors); - gimp_item_set_image (GIMP_ITEM (vectors), gimage); + gimp_item_set_image (GIMP_ITEM (vectors), image); /* add the layer to the list at the specified position */ if (position == -1) { if (active_vectors) - position = gimp_container_get_child_index (gimage->vectors, + position = gimp_container_get_child_index (image->vectors, GIMP_OBJECT (active_vectors)); else position = 0; } /* Don't add at a non-existing index */ - if (position > gimp_container_num_children (gimage->vectors)) - position = gimp_container_num_children (gimage->vectors); + if (position > gimp_container_num_children (image->vectors)) + position = gimp_container_num_children (image->vectors); - gimp_container_insert (gimage->vectors, GIMP_OBJECT (vectors), position); + gimp_container_insert (image->vectors, GIMP_OBJECT (vectors), position); gimp_item_sink (GIMP_ITEM (vectors)); - /* notify this gimage of the currently active vectors */ - gimp_image_set_active_vectors (gimage, vectors); + /* notify this image of the currently active vectors */ + gimp_image_set_active_vectors (image, vectors); return TRUE; } void -gimp_image_remove_vectors (GimpImage *gimage, +gimp_image_remove_vectors (GimpImage *image, GimpVectors *vectors) { GimpVectors *active_vectors; gint index; - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_return_if_fail (GIMP_IS_VECTORS (vectors)); - g_return_if_fail (gimp_container_have (gimage->vectors, + g_return_if_fail (gimp_container_have (image->vectors, GIMP_OBJECT (vectors))); - active_vectors = gimp_image_get_active_vectors (gimage); + active_vectors = gimp_image_get_active_vectors (image); - index = gimp_container_get_child_index (gimage->vectors, + index = gimp_container_get_child_index (image->vectors, GIMP_OBJECT (vectors)); - gimp_image_undo_push_vectors_remove (gimage, _("Remove Path"), + gimp_image_undo_push_vectors_remove (image, _("Remove Path"), vectors, index, active_vectors); g_object_ref (vectors); - gimp_container_remove (gimage->vectors, GIMP_OBJECT (vectors)); + gimp_container_remove (image->vectors, GIMP_OBJECT (vectors)); gimp_item_removed (GIMP_ITEM (vectors)); if (vectors == active_vectors) { - gint n_children = gimp_container_num_children (gimage->vectors); + gint n_children = gimp_container_num_children (image->vectors); if (n_children > 0) { index = CLAMP (index, 0, n_children - 1); active_vectors = (GimpVectors *) - gimp_container_get_child_by_index (gimage->vectors, index); + gimp_container_get_child_by_index (image->vectors, index); } else { active_vectors = NULL; } - gimp_image_set_active_vectors (gimage, active_vectors); + gimp_image_set_active_vectors (image, active_vectors); } g_object_unref (vectors); } gboolean -gimp_image_raise_vectors (GimpImage *gimage, +gimp_image_raise_vectors (GimpImage *image, GimpVectors *vectors) { gint index; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); - index = gimp_container_get_child_index (gimage->vectors, + index = gimp_container_get_child_index (image->vectors, GIMP_OBJECT (vectors)); if (index == 0) @@ -3362,20 +3362,20 @@ gimp_image_raise_vectors (GimpImage *gimage, return FALSE; } - return gimp_image_position_vectors (gimage, vectors, index - 1, + return gimp_image_position_vectors (image, vectors, index - 1, TRUE, _("Raise Path")); } gboolean -gimp_image_raise_vectors_to_top (GimpImage *gimage, +gimp_image_raise_vectors_to_top (GimpImage *image, GimpVectors *vectors) { gint index; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); - index = gimp_container_get_child_index (gimage->vectors, + index = gimp_container_get_child_index (image->vectors, GIMP_OBJECT (vectors)); if (index == 0) @@ -3384,46 +3384,46 @@ gimp_image_raise_vectors_to_top (GimpImage *gimage, return FALSE; } - return gimp_image_position_vectors (gimage, vectors, 0, + return gimp_image_position_vectors (image, vectors, 0, TRUE, _("Raise Path to Top")); } gboolean -gimp_image_lower_vectors (GimpImage *gimage, +gimp_image_lower_vectors (GimpImage *image, GimpVectors *vectors) { gint index; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); - index = gimp_container_get_child_index (gimage->vectors, + index = gimp_container_get_child_index (image->vectors, GIMP_OBJECT (vectors)); - if (index == gimp_container_num_children (gimage->vectors) - 1) + if (index == gimp_container_num_children (image->vectors) - 1) { g_message (_("Path cannot be lowered more.")); return FALSE; } - return gimp_image_position_vectors (gimage, vectors, index + 1, + return gimp_image_position_vectors (image, vectors, index + 1, TRUE, _("Lower Path")); } gboolean -gimp_image_lower_vectors_to_bottom (GimpImage *gimage, +gimp_image_lower_vectors_to_bottom (GimpImage *image, GimpVectors *vectors) { gint index; gint length; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); - index = gimp_container_get_child_index (gimage->vectors, + index = gimp_container_get_child_index (image->vectors, GIMP_OBJECT (vectors)); - length = gimp_container_num_children (gimage->vectors); + length = gimp_container_num_children (image->vectors); if (index == length - 1) { @@ -3431,12 +3431,12 @@ gimp_image_lower_vectors_to_bottom (GimpImage *gimage, return FALSE; } - return gimp_image_position_vectors (gimage, vectors, length - 1, + return gimp_image_position_vectors (image, vectors, length - 1, TRUE, _("Lower Path to Bottom")); } gboolean -gimp_image_position_vectors (GimpImage *gimage, +gimp_image_position_vectors (GimpImage *image, GimpVectors *vectors, gint new_index, gboolean push_undo, @@ -3445,15 +3445,15 @@ gimp_image_position_vectors (GimpImage *gimage, gint index; gint num_vectors; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (GIMP_IS_VECTORS (vectors), FALSE); - index = gimp_container_get_child_index (gimage->vectors, + index = gimp_container_get_child_index (image->vectors, GIMP_OBJECT (vectors)); if (index < 0) return FALSE; - num_vectors = gimp_container_num_children (gimage->vectors); + num_vectors = gimp_container_num_children (image->vectors); new_index = CLAMP (new_index, 0, num_vectors - 1); @@ -3461,29 +3461,29 @@ gimp_image_position_vectors (GimpImage *gimage, return TRUE; if (push_undo) - gimp_image_undo_push_vectors_reposition (gimage, undo_desc, vectors); + gimp_image_undo_push_vectors_reposition (image, undo_desc, vectors); - gimp_container_reorder (gimage->vectors, + gimp_container_reorder (image->vectors, GIMP_OBJECT (vectors), new_index); return TRUE; } gboolean -gimp_image_layer_boundary (const GimpImage *gimage, +gimp_image_layer_boundary (const GimpImage *image, BoundSeg **segs, gint *n_segs) { GimpLayer *layer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (segs != NULL, FALSE); g_return_val_if_fail (n_segs != NULL, FALSE); /* The second boundary corresponds to the active layer's * perimeter... */ - layer = gimp_image_get_active_layer (gimage); + layer = gimp_image_get_active_layer (image); if (layer) { @@ -3499,15 +3499,15 @@ gimp_image_layer_boundary (const GimpImage *gimage, } GimpLayer * -gimp_image_pick_correlate_layer (const GimpImage *gimage, +gimp_image_pick_correlate_layer (const GimpImage *image, gint x, gint y) { GList *list; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -3527,14 +3527,14 @@ gimp_image_pick_correlate_layer (const GimpImage *gimage, } gboolean -gimp_image_coords_in_active_drawable (GimpImage *gimage, +gimp_image_coords_in_active_drawable (GimpImage *image, const GimpCoords *coords) { GimpDrawable *drawable; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); if (drawable) { @@ -3559,21 +3559,21 @@ gimp_image_coords_in_active_drawable (GimpImage *gimage, } void -gimp_image_invalidate_layer_previews (GimpImage *gimage) +gimp_image_invalidate_layer_previews (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - gimp_container_foreach (gimage->layers, + gimp_container_foreach (image->layers, (GFunc) gimp_viewable_invalidate_preview, NULL); } void -gimp_image_invalidate_channel_previews (GimpImage *gimage) +gimp_image_invalidate_channel_previews (GimpImage *image) { - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - gimp_container_foreach (gimage->channels, + gimp_container_foreach (image->channels, (GFunc) gimp_viewable_invalidate_preview, NULL); } diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 6a2aeaab4c..cd650fe3d9 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -180,47 +180,47 @@ struct _GimpImageClass GimpViewableClass parent_class; /* signals */ - void (* mode_changed) (GimpImage *gimage); - void (* alpha_changed) (GimpImage *gimage); - void (* floating_selection_changed) (GimpImage *gimage); - void (* active_layer_changed) (GimpImage *gimage); - void (* active_channel_changed) (GimpImage *gimage); - void (* active_vectors_changed) (GimpImage *gimage); - void (* component_visibility_changed) (GimpImage *gimage, + void (* mode_changed) (GimpImage *image); + void (* alpha_changed) (GimpImage *image); + void (* floating_selection_changed) (GimpImage *image); + void (* active_layer_changed) (GimpImage *image); + void (* active_channel_changed) (GimpImage *image); + void (* active_vectors_changed) (GimpImage *image); + void (* component_visibility_changed) (GimpImage *image, GimpChannelType channel); - void (* component_active_changed) (GimpImage *gimage, + void (* component_active_changed) (GimpImage *image, GimpChannelType channel); - void (* mask_changed) (GimpImage *gimage); - void (* resolution_changed) (GimpImage *gimage); - void (* unit_changed) (GimpImage *gimage); - void (* quick_mask_changed) (GimpImage *gimage); - void (* selection_control) (GimpImage *gimage, + void (* mask_changed) (GimpImage *image); + void (* resolution_changed) (GimpImage *image); + void (* unit_changed) (GimpImage *image); + void (* quick_mask_changed) (GimpImage *image); + void (* selection_control) (GimpImage *image, GimpSelectionControl control); - void (* clean) (GimpImage *gimage, + void (* clean) (GimpImage *image, GimpDirtyMask dirty_mask); - void (* dirty) (GimpImage *gimage, + void (* dirty) (GimpImage *image, GimpDirtyMask dirty_mask); - void (* update) (GimpImage *gimage, + void (* update) (GimpImage *image, gint x, gint y, gint width, gint height); - void (* update_guide) (GimpImage *gimage, + void (* update_guide) (GimpImage *image, GimpGuide *guide); - void (* update_sample_point) (GimpImage *gimage, + void (* update_sample_point) (GimpImage *image, GimpSamplePoint *sample_point); - void (* sample_point_added) (GimpImage *gimage, + void (* sample_point_added) (GimpImage *image, GimpSamplePoint *sample_point); - void (* sample_point_removed) (GimpImage *gimage, + void (* sample_point_removed) (GimpImage *image, GimpSamplePoint *sample_point); - void (* colormap_changed) (GimpImage *gimage, + void (* colormap_changed) (GimpImage *image, gint color_index); - void (* undo_event) (GimpImage *gimage, + void (* undo_event) (GimpImage *image, GimpUndoEvent event, GimpUndo *undo); - void (* flush) (GimpImage *gimage); + void (* flush) (GimpImage *image); }; @@ -231,135 +231,135 @@ GimpImage * gimp_image_new (Gimp *gimp, gint height, GimpImageBaseType base_type); -GimpImageBaseType gimp_image_base_type (const GimpImage *gimage); -GimpImageType gimp_image_base_type_with_alpha (const GimpImage *gimage); +GimpImageBaseType gimp_image_base_type (const GimpImage *image); +GimpImageType gimp_image_base_type_with_alpha (const GimpImage *image); CombinationMode gimp_image_get_combination_mode (GimpImageType dest_type, gint src_bytes); -gint gimp_image_get_ID (const GimpImage *gimage); +gint gimp_image_get_ID (const GimpImage *image); GimpImage * gimp_image_get_by_ID (Gimp *gimp, gint id); -void gimp_image_set_uri (GimpImage *gimage, +void gimp_image_set_uri (GimpImage *image, const gchar *uri); -const gchar * gimp_image_get_uri (const GimpImage *gimage); +const gchar * gimp_image_get_uri (const GimpImage *image); -void gimp_image_set_filename (GimpImage *gimage, +void gimp_image_set_filename (GimpImage *image, const gchar *filename); -gchar * gimp_image_get_filename (const GimpImage *gimage); +gchar * gimp_image_get_filename (const GimpImage *image); -void gimp_image_set_save_proc (GimpImage *gimage, +void gimp_image_set_save_proc (GimpImage *image, PlugInProcDef *proc); -PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage); +PlugInProcDef * gimp_image_get_save_proc (const GimpImage *image); -void gimp_image_set_resolution (GimpImage *gimage, +void gimp_image_set_resolution (GimpImage *image, gdouble xres, gdouble yres); -void gimp_image_get_resolution (const GimpImage *gimage, +void gimp_image_get_resolution (const GimpImage *image, gdouble *xres, gdouble *yres); -void gimp_image_resolution_changed (GimpImage *gimage); +void gimp_image_resolution_changed (GimpImage *image); -void gimp_image_set_unit (GimpImage *gimage, +void gimp_image_set_unit (GimpImage *image, GimpUnit unit); -GimpUnit gimp_image_get_unit (const GimpImage *gimage); -void gimp_image_unit_changed (GimpImage *gimage); +GimpUnit gimp_image_get_unit (const GimpImage *image); +void gimp_image_unit_changed (GimpImage *image); -gint gimp_image_get_width (const GimpImage *gimage); -gint gimp_image_get_height (const GimpImage *gimage); +gint gimp_image_get_width (const GimpImage *image); +gint gimp_image_get_height (const GimpImage *image); -gboolean gimp_image_has_alpha (const GimpImage *gimage); -gboolean gimp_image_is_empty (const GimpImage *gimage); +gboolean gimp_image_has_alpha (const GimpImage *image); +gboolean gimp_image_is_empty (const GimpImage *image); -GimpLayer * gimp_image_floating_sel (const GimpImage *gimage); -void gimp_image_floating_selection_changed (GimpImage *gimage); +GimpLayer * gimp_image_floating_sel (const GimpImage *image); +void gimp_image_floating_selection_changed (GimpImage *image); -GimpChannel * gimp_image_get_mask (const GimpImage *gimage); -void gimp_image_mask_changed (GimpImage *gimage); +GimpChannel * gimp_image_get_mask (const GimpImage *image); +void gimp_image_mask_changed (GimpImage *image); -gint gimp_image_get_component_index (const GimpImage *gimage, +gint gimp_image_get_component_index (const GimpImage *image, GimpChannelType channel); -void gimp_image_set_component_active (GimpImage *gimage, +void gimp_image_set_component_active (GimpImage *image, GimpChannelType type, gboolean active); -gboolean gimp_image_get_component_active (const GimpImage *gimage, +gboolean gimp_image_get_component_active (const GimpImage *image, GimpChannelType type); -void gimp_image_set_component_visible (GimpImage *gimage, +void gimp_image_set_component_visible (GimpImage *image, GimpChannelType type, gboolean visible); -gboolean gimp_image_get_component_visible (const GimpImage *gimage, +gboolean gimp_image_get_component_visible (const GimpImage *image, GimpChannelType type); -void gimp_image_mode_changed (GimpImage *gimage); -void gimp_image_alpha_changed (GimpImage *gimage); -void gimp_image_update (GimpImage *gimage, +void gimp_image_mode_changed (GimpImage *image); +void gimp_image_alpha_changed (GimpImage *image); +void gimp_image_update (GimpImage *image, gint x, gint y, gint width, gint height); -void gimp_image_update_guide (GimpImage *gimage, +void gimp_image_update_guide (GimpImage *image, GimpGuide *guide); -void gimp_image_update_sample_point (GimpImage *gimage, +void gimp_image_update_sample_point (GimpImage *image, GimpSamplePoint *sample_point); -void gimp_image_sample_point_added (GimpImage *gimage, +void gimp_image_sample_point_added (GimpImage *image, GimpSamplePoint *sample_point); -void gimp_image_sample_point_removed (GimpImage *gimage, +void gimp_image_sample_point_removed (GimpImage *image, GimpSamplePoint *sample_point); -void gimp_image_colormap_changed (GimpImage *gimage, +void gimp_image_colormap_changed (GimpImage *image, gint col); -void gimp_image_selection_control (GimpImage *gimage, +void gimp_image_selection_control (GimpImage *image, GimpSelectionControl control); -void gimp_image_quick_mask_changed (GimpImage *gimage); +void gimp_image_quick_mask_changed (GimpImage *image); /* undo */ -gboolean gimp_image_undo_is_enabled (const GimpImage *gimage); -gboolean gimp_image_undo_enable (GimpImage *gimage); -gboolean gimp_image_undo_disable (GimpImage *gimage); -gboolean gimp_image_undo_freeze (GimpImage *gimage); -gboolean gimp_image_undo_thaw (GimpImage *gimage); -void gimp_image_undo_event (GimpImage *gimage, +gboolean gimp_image_undo_is_enabled (const GimpImage *image); +gboolean gimp_image_undo_enable (GimpImage *image); +gboolean gimp_image_undo_disable (GimpImage *image); +gboolean gimp_image_undo_freeze (GimpImage *image); +gboolean gimp_image_undo_thaw (GimpImage *image); +void gimp_image_undo_event (GimpImage *image, GimpUndoEvent event, GimpUndo *undo); -gint gimp_image_dirty (GimpImage *gimage, +gint gimp_image_dirty (GimpImage *image, GimpDirtyMask dirty_mask); -gint gimp_image_clean (GimpImage *gimage, +gint gimp_image_clean (GimpImage *image, GimpDirtyMask dirty_mask); -void gimp_image_clean_all (GimpImage *gimage); +void gimp_image_clean_all (GimpImage *image); /* flush this image's displays */ -void gimp_image_flush (GimpImage *gimage); +void gimp_image_flush (GimpImage *image); /* color transforms / utilities */ -void gimp_image_get_foreground (const GimpImage *gimage, +void gimp_image_get_foreground (const GimpImage *image, const GimpDrawable *drawable, GimpContext *context, guchar *fg); -void gimp_image_get_background (const GimpImage *gimage, +void gimp_image_get_background (const GimpImage *image, const GimpDrawable *drawable, GimpContext *context, guchar *bg); -void gimp_image_get_color (const GimpImage *src_gimage, +void gimp_image_get_color (const GimpImage *src_image, GimpImageType src_type, const guchar *src, guchar *rgba); -void gimp_image_transform_rgb (const GimpImage *dest_gimage, +void gimp_image_transform_rgb (const GimpImage *dest_image, const GimpDrawable *dest_drawable, const GimpRGB *rgb, guchar *color); -void gimp_image_transform_color (const GimpImage *dest_gimage, +void gimp_image_transform_color (const GimpImage *dest_image, const GimpDrawable *dest_drawable, guchar *dest, GimpImageBaseType src_type, const guchar *src); -TempBuf * gimp_image_transform_temp_buf (const GimpImage *dest_gimage, +TempBuf * gimp_image_transform_temp_buf (const GimpImage *dest_image, const GimpDrawable *dest_drawable, TempBuf *temp_buf, gboolean *new_buf); @@ -367,148 +367,148 @@ TempBuf * gimp_image_transform_temp_buf (const GimpImage *dest_gimag /* shadow tiles */ -TileManager * gimp_image_shadow (GimpImage *gimage, +TileManager * gimp_image_shadow (GimpImage *image, gint width, gint height, gint bpp); -void gimp_image_free_shadow (GimpImage *gimage); +void gimp_image_free_shadow (GimpImage *image); /* parasites */ -GimpParasite * gimp_image_parasite_find (const GimpImage *gimage, +GimpParasite * gimp_image_parasite_find (const GimpImage *image, const gchar *name); -gchar ** gimp_image_parasite_list (const GimpImage *gimage, +gchar ** gimp_image_parasite_list (const GimpImage *image, gint *count); -void gimp_image_parasite_attach (GimpImage *gimage, +void gimp_image_parasite_attach (GimpImage *image, GimpParasite *parasite); -void gimp_image_parasite_detach (GimpImage *gimage, +void gimp_image_parasite_detach (GimpImage *image, const gchar *parasite); /* tattoos */ -GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage); -gboolean gimp_image_set_tattoo_state (GimpImage *gimage, +GimpTattoo gimp_image_get_new_tattoo (GimpImage *image); +gboolean gimp_image_set_tattoo_state (GimpImage *image, GimpTattoo val); -GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage); +GimpTattoo gimp_image_get_tattoo_state (GimpImage *image); /* layers / channels / vectors */ -GimpContainer * gimp_image_get_layers (const GimpImage *gimage); -GimpContainer * gimp_image_get_channels (const GimpImage *gimage); -GimpContainer * gimp_image_get_vectors (const GimpImage *gimage); +GimpContainer * gimp_image_get_layers (const GimpImage *image); +GimpContainer * gimp_image_get_channels (const GimpImage *image); +GimpContainer * gimp_image_get_vectors (const GimpImage *image); -GimpDrawable * gimp_image_active_drawable (const GimpImage *gimage); -GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); -GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); -GimpVectors * gimp_image_get_active_vectors (const GimpImage *gimage); +GimpDrawable * gimp_image_active_drawable (const GimpImage *image); +GimpLayer * gimp_image_get_active_layer (const GimpImage *image); +GimpChannel * gimp_image_get_active_channel (const GimpImage *image); +GimpVectors * gimp_image_get_active_vectors (const GimpImage *image); -GimpLayer * gimp_image_set_active_layer (GimpImage *gimage, +GimpLayer * gimp_image_set_active_layer (GimpImage *image, GimpLayer *layer); -GimpChannel * gimp_image_set_active_channel (GimpImage *gimage, +GimpChannel * gimp_image_set_active_channel (GimpImage *image, GimpChannel *channel); -GimpChannel * gimp_image_unset_active_channel (GimpImage *gimage); -GimpVectors * gimp_image_set_active_vectors (GimpImage *gimage, +GimpChannel * gimp_image_unset_active_channel (GimpImage *image); +GimpVectors * gimp_image_set_active_vectors (GimpImage *image, GimpVectors *vectors); -void gimp_image_active_layer_changed (GimpImage *gimage); -void gimp_image_active_channel_changed (GimpImage *gimage); -void gimp_image_active_vectors_changed (GimpImage *gimage); +void gimp_image_active_layer_changed (GimpImage *image); +void gimp_image_active_channel_changed (GimpImage *image); +void gimp_image_active_vectors_changed (GimpImage *image); -gint gimp_image_get_layer_index (const GimpImage *gimage, +gint gimp_image_get_layer_index (const GimpImage *image, const GimpLayer *layer); -gint gimp_image_get_channel_index (const GimpImage *gimage, +gint gimp_image_get_channel_index (const GimpImage *image, const GimpChannel *channel); -gint gimp_image_get_vectors_index (const GimpImage *gimage, +gint gimp_image_get_vectors_index (const GimpImage *image, const GimpVectors *vectors); -GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, +GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *image, GimpTattoo tatoo); -GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, +GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *image, GimpTattoo tatoo); -GimpVectors * gimp_image_get_vectors_by_tattoo (const GimpImage *gimage, +GimpVectors * gimp_image_get_vectors_by_tattoo (const GimpImage *image, GimpTattoo tatoo); -GimpLayer * gimp_image_get_layer_by_name (const GimpImage *gimage, +GimpLayer * gimp_image_get_layer_by_name (const GimpImage *image, const gchar *name); -GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, +GimpChannel * gimp_image_get_channel_by_name (const GimpImage *image, const gchar *name); -GimpVectors * gimp_image_get_vectors_by_name (const GimpImage *gimage, +GimpVectors * gimp_image_get_vectors_by_name (const GimpImage *image, const gchar *name); -gboolean gimp_image_add_layer (GimpImage *gimage, +gboolean gimp_image_add_layer (GimpImage *image, GimpLayer *layer, gint position); -void gimp_image_remove_layer (GimpImage *gimage, +void gimp_image_remove_layer (GimpImage *image, GimpLayer *layer); -gboolean gimp_image_raise_layer (GimpImage *gimage, +gboolean gimp_image_raise_layer (GimpImage *image, GimpLayer *layer); -gboolean gimp_image_lower_layer (GimpImage *gimage, +gboolean gimp_image_lower_layer (GimpImage *image, GimpLayer *layer); -gboolean gimp_image_raise_layer_to_top (GimpImage *gimage, +gboolean gimp_image_raise_layer_to_top (GimpImage *image, GimpLayer *layer); -gboolean gimp_image_lower_layer_to_bottom (GimpImage *gimage, +gboolean gimp_image_lower_layer_to_bottom (GimpImage *image, GimpLayer *layer); -gboolean gimp_image_position_layer (GimpImage *gimage, +gboolean gimp_image_position_layer (GimpImage *image, GimpLayer *layer, gint new_index, gboolean push_undo, const gchar *undo_desc); -gboolean gimp_image_add_channel (GimpImage *gimage, +gboolean gimp_image_add_channel (GimpImage *image, GimpChannel *channel, gint position); -void gimp_image_remove_channel (GimpImage *gimage, +void gimp_image_remove_channel (GimpImage *image, GimpChannel *channel); -gboolean gimp_image_raise_channel (GimpImage *gimage, +gboolean gimp_image_raise_channel (GimpImage *image, GimpChannel *channel); -gboolean gimp_image_raise_channel_to_top (GimpImage *gimage, +gboolean gimp_image_raise_channel_to_top (GimpImage *image, GimpChannel *channel); -gboolean gimp_image_lower_channel (GimpImage *gimage, +gboolean gimp_image_lower_channel (GimpImage *image, GimpChannel *channel); -gboolean gimp_image_lower_channel_to_bottom (GimpImage *gimage, +gboolean gimp_image_lower_channel_to_bottom (GimpImage *image, GimpChannel *channel); -gboolean gimp_image_position_channel (GimpImage *gimage, +gboolean gimp_image_position_channel (GimpImage *image, GimpChannel *channel, gint new_index, gboolean push_undo, const gchar *undo_desc); -gboolean gimp_image_add_vectors (GimpImage *gimage, +gboolean gimp_image_add_vectors (GimpImage *image, GimpVectors *vectors, gint position); -void gimp_image_remove_vectors (GimpImage *gimage, +void gimp_image_remove_vectors (GimpImage *image, GimpVectors *vectors); -gboolean gimp_image_raise_vectors (GimpImage *gimage, +gboolean gimp_image_raise_vectors (GimpImage *image, GimpVectors *vectors); -gboolean gimp_image_raise_vectors_to_top (GimpImage *gimage, +gboolean gimp_image_raise_vectors_to_top (GimpImage *image, GimpVectors *vectors); -gboolean gimp_image_lower_vectors (GimpImage *gimage, +gboolean gimp_image_lower_vectors (GimpImage *image, GimpVectors *vectors); -gboolean gimp_image_lower_vectors_to_bottom (GimpImage *gimage, +gboolean gimp_image_lower_vectors_to_bottom (GimpImage *image, GimpVectors *vectors); -gboolean gimp_image_position_vectors (GimpImage *gimage, +gboolean gimp_image_position_vectors (GimpImage *image, GimpVectors *vectors, gint new_index, gboolean push_undo, const gchar *undo_desc); -gboolean gimp_image_layer_boundary (const GimpImage *gimage, +gboolean gimp_image_layer_boundary (const GimpImage *image, BoundSeg **segs, gint *n_segs); -GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *gimage, +GimpLayer * gimp_image_pick_correlate_layer (const GimpImage *image, gint x, gint y); -gboolean gimp_image_coords_in_active_drawable (GimpImage *gimage, +gboolean gimp_image_coords_in_active_drawable (GimpImage *image, const GimpCoords *coords); -void gimp_image_invalidate_layer_previews (GimpImage *gimage); -void gimp_image_invalidate_channel_previews (GimpImage *gimage); +void gimp_image_invalidate_layer_previews (GimpImage *image); +void gimp_image_invalidate_channel_previews (GimpImage *image); #endif /* __GIMP_IMAGE_H__ */ diff --git a/app/core/gimpimagefile.c b/app/core/gimpimagefile.c index 235bd7b826..684f84da76 100644 --- a/app/core/gimpimagefile.c +++ b/app/core/gimpimagefile.c @@ -70,7 +70,7 @@ static GdkPixbuf * gimp_imagefile_load_thumb (GimpImagefile *imagefile, gint width, gint height); static gboolean gimp_imagefile_save_thumb (GimpImagefile *imagefile, - GimpImage *gimage, + GimpImage *image, gint size, gboolean replace, GError **error); @@ -369,24 +369,24 @@ gimp_imagefile_check_thumbnail (GimpImagefile *imagefile) gboolean gimp_imagefile_save_thumbnail (GimpImagefile *imagefile, const gchar *mime_type, - GimpImage *gimage) + GimpImage *image) { gint size; gboolean success = TRUE; GError *error = NULL; g_return_val_if_fail (GIMP_IS_IMAGEFILE (imagefile), FALSE); - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); size = imagefile->gimp->config->thumbnail_size; if (size > 0) { gimp_thumbnail_set_info_from_image (imagefile->thumbnail, - mime_type, gimage); + mime_type, image); success = gimp_imagefile_save_thumb (imagefile, - gimage, size, FALSE, + image, size, FALSE, &error); if (! success) { @@ -724,7 +724,7 @@ gimp_imagefile_load_thumb (GimpImagefile *imagefile, static gboolean gimp_imagefile_save_thumb (GimpImagefile *imagefile, - GimpImage *gimage, + GimpImage *image, gint size, gboolean replace, GError **error) @@ -737,28 +737,28 @@ gimp_imagefile_save_thumb (GimpImagefile *imagefile, if (size < 1) return TRUE; - if (gimage->width <= size && gimage->height <= size) + if (image->width <= size && image->height <= size) { - width = gimage->width; - height = gimage->height; + width = image->width; + height = image->height; size = MAX (width, height); } else { - if (gimage->width < gimage->height) + if (image->width < image->height) { height = size; - width = MAX (1, (size * gimage->width) / gimage->height); + width = MAX (1, (size * image->width) / image->height); } else { width = size; - height = MAX (1, (size * gimage->height) / gimage->width); + height = MAX (1, (size * image->height) / image->width); } } - pixbuf = gimp_viewable_get_new_pixbuf (GIMP_VIEWABLE (gimage), width, height); + pixbuf = gimp_viewable_get_new_pixbuf (GIMP_VIEWABLE (image), width, height); /* when layer previews are disabled, we won't get a pixbuf */ if (! pixbuf) diff --git a/app/core/gimpimagefile.h b/app/core/gimpimagefile.h index 67ec8f4dcc..6dc032fdf3 100644 --- a/app/core/gimpimagefile.h +++ b/app/core/gimpimagefile.h @@ -78,7 +78,7 @@ void gimp_imagefile_create_thumbnail_weak (GimpImagefile *imagefile, gboolean gimp_imagefile_check_thumbnail (GimpImagefile *imagefile); gboolean gimp_imagefile_save_thumbnail (GimpImagefile *imagefile, const gchar *mime_type, - GimpImage *gimage); + GimpImage *image); const gchar * gimp_imagefile_get_desc_string (GimpImagefile *imagefile); diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c index 0fdaf26adc..c5b97ff012 100644 --- a/app/core/gimpimagemap.c +++ b/app/core/gimpimagemap.c @@ -226,13 +226,13 @@ gimp_image_map_new (GimpDrawable *drawable, const gchar *undo_desc) { GimpImageMap *image_map; - GimpImage *gimage; + GimpImage *image; g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); image_map = g_object_new (GIMP_TYPE_IMAGE_MAP, NULL); @@ -365,7 +365,7 @@ gimp_image_map_apply (GimpImageMap *image_map, void gimp_image_map_commit (GimpImageMap *image_map) { - GimpImage *gimage; + GimpImage *image; gint x1, y1, x2, y2; g_return_if_fail (GIMP_IS_IMAGE_MAP (image_map)); @@ -380,9 +380,9 @@ gimp_image_map_commit (GimpImageMap *image_map) } /* Make sure the drawable is still valid */ - gimage = gimp_item_get_image (GIMP_ITEM (image_map->drawable)); + image = gimp_item_get_image (GIMP_ITEM (image_map->drawable)); - if (! gimage) + if (! image) return; /* Register an undo step */ @@ -408,7 +408,7 @@ gimp_image_map_commit (GimpImageMap *image_map) void gimp_image_map_clear (GimpImageMap *image_map) { - GimpImage *gimage; + GimpImage *image; PixelRegion srcPR, destPR; g_return_if_fail (GIMP_IS_IMAGE_MAP (image_map)); @@ -423,9 +423,9 @@ gimp_image_map_clear (GimpImageMap *image_map) } /* Make sure the drawable is still valid */ - gimage = gimp_item_get_image (GIMP_ITEM (image_map->drawable)); + image = gimp_item_get_image (GIMP_ITEM (image_map->drawable)); - if (! gimage) + if (! image) return; /* restore the original image */ @@ -474,13 +474,13 @@ gimp_image_map_clear (GimpImageMap *image_map) void gimp_image_map_abort (GimpImageMap *image_map) { - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_IMAGE_MAP (image_map)); - gimage = gimp_item_get_image (GIMP_ITEM (image_map->drawable)); + image = gimp_item_get_image (GIMP_ITEM (image_map->drawable)); - if (! gimage) + if (! image) return; gimp_image_map_clear (image_map); @@ -494,13 +494,13 @@ gimp_image_map_abort (GimpImageMap *image_map) static gboolean gimp_image_map_do (GimpImageMap *image_map) { - GimpImage *gimage; + GimpImage *image; PixelRegion shadowPR; gint i; - gimage = gimp_item_get_image (GIMP_ITEM (image_map->drawable)); + image = gimp_item_get_image (GIMP_ITEM (image_map->drawable)); - if (! gimage) + if (! image) { image_map->idle_id = 0; @@ -523,7 +523,7 @@ gimp_image_map_do (GimpImageMap *image_map) w = image_map->destPR.w; h = image_map->destPR.h; - pixel_region_init (&shadowPR, gimage->shadow, x, y, w, h, FALSE); + pixel_region_init (&shadowPR, image->shadow, x, y, w, h, FALSE); gimp_drawable_apply_region (image_map->drawable, &shadowPR, FALSE, NULL, @@ -539,7 +539,7 @@ gimp_image_map_do (GimpImageMap *image_map) { image_map->idle_id = 0; - gimp_image_flush (gimage); + gimp_image_flush (image); return FALSE; } diff --git a/app/core/gimpitem-align.c b/app/core/gimpitem-align.c index 8881387278..b67759ed04 100644 --- a/app/core/gimpitem-align.c +++ b/app/core/gimpitem-align.c @@ -66,7 +66,7 @@ gimp_item_align (GimpItem *target, if (!target) return; - if (! (reference || target->gimage)) + if (! (reference || target->image)) return; if (reference) @@ -80,8 +80,8 @@ gimp_item_align (GimpItem *target, { reference_offset_x = 0; reference_offset_y = 0; - reference_height = gimp_image_get_height (target->gimage); - reference_width = gimp_image_get_width (target->gimage); + reference_height = gimp_image_get_height (target->image); + reference_width = gimp_image_get_width (target->image); } switch (reference_alignment) diff --git a/app/core/gimpitem-linked.c b/app/core/gimpitem-linked.c index 819e07ae43..f2cd061f83 100644 --- a/app/core/gimpitem-linked.c +++ b/app/core/gimpitem-linked.c @@ -160,7 +160,7 @@ GList * gimp_item_linked_get_list (GimpItem *item, GimpItemLinkedMask which) { - GimpImage *gimage; + GimpImage *image; GimpItem *linked_item; GList *list; GList *linked_list = NULL; @@ -169,11 +169,11 @@ gimp_item_linked_get_list (GimpItem *item, g_return_val_if_fail (gimp_item_get_linked (item), NULL); g_return_val_if_fail (gimp_item_is_attached (item), NULL); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); if (which & GIMP_ITEM_LINKED_LAYERS) { - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -186,7 +186,7 @@ gimp_item_linked_get_list (GimpItem *item, if (which & GIMP_ITEM_LINKED_CHANNELS) { - for (list = GIMP_LIST (gimage->channels)->list; + for (list = GIMP_LIST (image->channels)->list; list; list = g_list_next (list)) { @@ -199,7 +199,7 @@ gimp_item_linked_get_list (GimpItem *item, if (which & GIMP_ITEM_LINKED_VECTORS) { - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { diff --git a/app/core/gimpitem-preview.c b/app/core/gimpitem-preview.c index f318007101..4b7e837cf2 100644 --- a/app/core/gimpitem-preview.c +++ b/app/core/gimpitem-preview.c @@ -45,27 +45,27 @@ gimp_item_get_preview_size (GimpViewable *viewable, gint *height) { GimpItem *item; - GimpImage *gimage; + GimpImage *image; item = GIMP_ITEM (viewable); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - if (gimage && ! gimage->gimp->config->layer_previews && ! is_popup) + if (image && ! image->gimp->config->layer_previews && ! is_popup) { *width = size; *height = size; return; } - if (gimage && ! is_popup) + if (image && ! is_popup) { - gimp_viewable_calc_preview_size (gimage->width, - gimage->height, + gimp_viewable_calc_preview_size (image->width, + image->height, size, size, dot_for_dot, - gimage->xresolution, - gimage->yresolution, + image->xresolution, + image->yresolution, width, height, NULL); @@ -92,12 +92,12 @@ gimp_item_get_popup_size (GimpViewable *viewable, gint *popup_height) { GimpItem *item; - GimpImage *gimage; + GimpImage *image; item = GIMP_ITEM (viewable); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - if (gimage && ! gimage->gimp->config->layer_previews) + if (image && ! image->gimp->config->layer_previews) return FALSE; if (item->width > width || item->height > height) @@ -109,8 +109,8 @@ gimp_item_get_popup_size (GimpViewable *viewable, width * 2, height * 2, dot_for_dot, - gimage ? gimage->xresolution : 1.0, - gimage ? gimage->yresolution : 1.0, + image ? image->xresolution : 1.0, + image ? image->yresolution : 1.0, popup_width, popup_height, &scaling_up); diff --git a/app/core/gimpitem.c b/app/core/gimpitem.c index 5945a43e0b..a4e78b00dc 100644 --- a/app/core/gimpitem.c +++ b/app/core/gimpitem.c @@ -199,7 +199,7 @@ gimp_item_init (GimpItem *item) { item->ID = 0; item->tattoo = 0; - item->gimage = NULL; + item->image = NULL; item->parasites = gimp_parasite_list_new (); item->width = 0; item->height = 0; @@ -255,11 +255,11 @@ gimp_item_finalize (GObject *object) { GimpItem *item = GIMP_ITEM (object); - if (item->gimage && item->gimage->gimp) + if (item->image && item->image->gimp) { - g_hash_table_remove (item->gimage->gimp->item_table, + g_hash_table_remove (item->image->gimp->item_table, GINT_TO_POINTER (item->ID)); - item->gimage = NULL; + item->image = NULL; } if (item->parasites) @@ -293,7 +293,7 @@ gimp_item_real_duplicate (GimpItem *item, gchar *new_name; g_return_val_if_fail (GIMP_IS_ITEM (item), NULL); - g_return_val_if_fail (GIMP_IS_IMAGE (item->gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (item->image), NULL); g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_ITEM), NULL); /* formulate the new name */ @@ -355,7 +355,7 @@ gimp_item_real_rename (GimpItem *item, const gchar *undo_desc) { if (gimp_item_is_attached (item)) - gimp_image_undo_push_item_rename (item->gimage, undo_desc, item); + gimp_image_undo_push_item_rename (item->image, undo_desc, item); gimp_object_set_name (GIMP_OBJECT (item), new_name); @@ -477,7 +477,7 @@ gimp_item_is_removed (const GimpItem *item) /** * gimp_item_configure: * @item: The #GimpItem to configure. - * @gimage: The #GimpImage to which the item belongs. + * @image: The #GimpImage to which the item belongs. * @offset_x: The X offset to assign the item. * @offset_y: The Y offset to assign the item. * @width: The width to assign the item. @@ -491,7 +491,7 @@ gimp_item_is_removed (const GimpItem *item) */ void gimp_item_configure (GimpItem *item, - GimpImage *gimage, + GimpImage *image, gint offset_x, gint offset_y, gint width, @@ -499,19 +499,19 @@ gimp_item_configure (GimpItem *item, const gchar *name) { g_return_if_fail (GIMP_IS_ITEM (item)); - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); g_object_freeze_notify (G_OBJECT (item)); if (item->ID == 0) { - item->ID = gimage->gimp->next_item_ID++; + item->ID = image->gimp->next_item_ID++; - g_hash_table_insert (gimage->gimp->item_table, + g_hash_table_insert (image->gimp->item_table, GINT_TO_POINTER (item->ID), item); - gimp_item_set_image (item, gimage); + gimp_item_set_image (item, image); g_object_notify (G_OBJECT (item), "id"); } @@ -557,7 +557,7 @@ gimp_item_duplicate (GimpItem *item, gboolean add_alpha) { g_return_val_if_fail (GIMP_IS_ITEM (item), NULL); - g_return_val_if_fail (GIMP_IS_IMAGE (item->gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (item->image), NULL); g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_ITEM), NULL); return GIMP_ITEM_GET_CLASS (item)->duplicate (item, new_type, add_alpha); @@ -581,7 +581,7 @@ gimp_item_convert (GimpItem *item, GimpItem *new_item; g_return_val_if_fail (GIMP_IS_ITEM (item), NULL); - g_return_val_if_fail (GIMP_IS_IMAGE (item->gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (item->image), NULL); g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL); g_return_val_if_fail (g_type_is_a (new_type, GIMP_TYPE_ITEM), NULL); @@ -689,24 +689,24 @@ gimp_item_translate (GimpItem *item, gboolean push_undo) { GimpItemClass *item_class; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_ITEM (item)); item_class = GIMP_ITEM_GET_CLASS (item); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); if (! gimp_item_is_attached (item)) push_undo = FALSE; if (push_undo) - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_DISPLACE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_DISPLACE, item_class->translate_desc); item_class->translate (item, offset_x, offset_y, push_undo); if (push_undo) - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } /** @@ -725,7 +725,7 @@ gimp_item_check_scaling (const GimpItem *item, gint new_width, gint new_height) { - GimpImage *gimage; + GimpImage *image; gdouble img_scale_w; gdouble img_scale_h; gint new_item_width; @@ -733,10 +733,10 @@ gimp_item_check_scaling (const GimpItem *item, g_return_val_if_fail (GIMP_IS_ITEM (item), FALSE); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - img_scale_w = (gdouble) new_width / (gdouble) gimage->width; - img_scale_h = (gdouble) new_height / (gdouble) gimage->height; + img_scale_w = (gdouble) new_width / (gdouble) image->width; + img_scale_h = (gdouble) new_height / (gdouble) image->height; new_item_width = ROUND (img_scale_w * (gdouble) item->width); new_item_height = ROUND (img_scale_h * (gdouble) item->height); @@ -753,7 +753,7 @@ gimp_item_scale (GimpItem *item, GimpProgress *progress) { GimpItemClass *item_class; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); @@ -762,17 +762,17 @@ gimp_item_scale (GimpItem *item, return; item_class = GIMP_ITEM_GET_CLASS (item); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); if (gimp_item_is_attached (item)) - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_SCALE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_SCALE, item_class->scale_desc); item_class->scale (item, new_width, new_height, new_offset_x, new_offset_y, interpolation, progress); if (gimp_item_is_attached (item)) - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } /** @@ -919,7 +919,7 @@ gimp_item_resize (GimpItem *item, gint offset_y) { GimpItemClass *item_class; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (GIMP_IS_CONTEXT (context)); @@ -928,16 +928,16 @@ gimp_item_resize (GimpItem *item, return; item_class = GIMP_ITEM_GET_CLASS (item); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); if (gimp_item_is_attached (item)) - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE, item_class->resize_desc); item_class->resize (item, context, new_width, new_height, offset_x, offset_y); if (gimp_item_is_attached (item)) - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } void @@ -948,21 +948,21 @@ gimp_item_flip (GimpItem *item, gboolean clip_result) { GimpItemClass *item_class; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (gimp_item_is_attached (item)); g_return_if_fail (GIMP_IS_CONTEXT (context)); item_class = GIMP_ITEM_GET_CLASS (item); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, item_class->flip_desc); item_class->flip (item, context, flip_type, axis, clip_result); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } void @@ -974,22 +974,22 @@ gimp_item_rotate (GimpItem *item, gboolean clip_result) { GimpItemClass *item_class; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (gimp_item_is_attached (item)); g_return_if_fail (GIMP_IS_CONTEXT (context)); item_class = GIMP_ITEM_GET_CLASS (item); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, item_class->rotate_desc); item_class->rotate (item, context, rotate_type, center_x, center_y, clip_result); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } void @@ -1004,7 +1004,7 @@ gimp_item_transform (GimpItem *item, GimpProgress *progress) { GimpItemClass *item_class; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (gimp_item_is_attached (item)); @@ -1013,16 +1013,16 @@ gimp_item_transform (GimpItem *item, g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); item_class = GIMP_ITEM_GET_CLASS (item); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TRANSFORM, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM, item_class->transform_desc); item_class->transform (item, context, matrix, direction, interpolation, supersample, recursion_level, clip_result, progress); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } gboolean @@ -1046,16 +1046,16 @@ gimp_item_stroke (GimpItem *item, if (item_class->stroke) { - GimpImage *gimage = gimp_item_get_image (item); + GimpImage *image = gimp_item_get_image (item); gimp_stroke_desc_prepare (stroke_desc, context, use_default_values); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_PAINT, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT, item_class->stroke_desc); retval = item_class->stroke (item, drawable, stroke_desc); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); gimp_stroke_desc_finish (stroke_desc); } @@ -1106,27 +1106,27 @@ gimp_item_get_image (const GimpItem *item) { g_return_val_if_fail (GIMP_IS_ITEM (item), NULL); - return item->gimage; + return item->image; } void gimp_item_set_image (GimpItem *item, - GimpImage *gimage) + GimpImage *image) { g_return_if_fail (GIMP_IS_ITEM (item)); g_return_if_fail (! gimp_item_is_attached (item)); - g_return_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage)); + g_return_if_fail (image == NULL || GIMP_IS_IMAGE (image)); - if (gimage == NULL) + if (image == NULL) { item->tattoo = 0; } - else if (item->tattoo == 0 || item->gimage != gimage) + else if (item->tattoo == 0 || item->image != image) { - item->tattoo = gimp_image_get_new_tattoo (gimage); + item->tattoo = gimp_image_get_new_tattoo (image); } - item->gimage = gimage; + item->image = image; } void @@ -1143,11 +1143,11 @@ gimp_item_parasite_attach (GimpItem *item, if (gimp_parasite_is_undoable (parasite)) { /* do a group in case we have attach_parent set */ - gimp_image_undo_group_start (item->gimage, + gimp_image_undo_group_start (item->image, GIMP_UNDO_GROUP_PARASITE_ATTACH, _("Attach Parasite")); - gimp_image_undo_push_item_parasite (item->gimage, NULL, item, + gimp_image_undo_push_item_parasite (item->image, NULL, item, parasite); } else if (gimp_parasite_is_persistent (parasite) && @@ -1155,7 +1155,7 @@ gimp_item_parasite_attach (GimpItem *item, gimp_item_parasite_find (item, gimp_parasite_name (parasite)))) { - gimp_image_undo_push_cantundo (item->gimage, + gimp_image_undo_push_cantundo (item->image, _("Attach Parasite to Item")); } } @@ -1165,19 +1165,19 @@ gimp_item_parasite_attach (GimpItem *item, if (gimp_parasite_has_flag (parasite, GIMP_PARASITE_ATTACH_PARENT)) { gimp_parasite_shift_parent (parasite); - gimp_image_parasite_attach (item->gimage, parasite); + gimp_image_parasite_attach (item->image, parasite); } else if (gimp_parasite_has_flag (parasite, GIMP_PARASITE_ATTACH_GRANDPARENT)) { gimp_parasite_shift_parent (parasite); gimp_parasite_shift_parent (parasite); - gimp_parasite_attach (item->gimage->gimp, parasite); + gimp_parasite_attach (item->image->gimp, parasite); } if (gimp_item_is_attached (item) && gimp_parasite_is_undoable (parasite)) { - gimp_image_undo_group_end (item->gimage); + gimp_image_undo_group_end (item->image); } } @@ -1196,14 +1196,14 @@ gimp_item_parasite_detach (GimpItem *item, if (gimp_parasite_is_undoable (parasite)) { - gimp_image_undo_push_item_parasite_remove (item->gimage, + gimp_image_undo_push_item_parasite_remove (item->image, _("Remove Parasite from Item"), item, gimp_parasite_name (parasite)); } else if (gimp_parasite_is_persistent (parasite)) { - gimp_image_undo_push_cantundo (item->gimage, + gimp_image_undo_push_cantundo (item->image, _("Remove Parasite from Item")); } @@ -1267,10 +1267,10 @@ gimp_item_set_visible (GimpItem *item, { if (push_undo && gimp_item_is_attached (item)) { - GimpImage *gimage = gimp_item_get_image (item); + GimpImage *image = gimp_item_get_image (item); - if (gimage) - gimp_image_undo_push_item_visibility (gimage, NULL, item); + if (image) + gimp_image_undo_push_item_visibility (image, NULL, item); } item->visible = visible ? TRUE : FALSE; @@ -1290,10 +1290,10 @@ gimp_item_set_linked (GimpItem *item, { if (push_undo && gimp_item_is_attached (item)) { - GimpImage *gimage = gimp_item_get_image (item); + GimpImage *image = gimp_item_get_image (item); - if (gimage) - gimp_image_undo_push_item_linked (gimage, NULL, item); + if (image) + gimp_image_undo_push_item_linked (image, NULL, item); } item->linked = linked ? TRUE : FALSE; diff --git a/app/core/gimpitem.h b/app/core/gimpitem.h index c2cf9d66d3..de90390881 100644 --- a/app/core/gimpitem.h +++ b/app/core/gimpitem.h @@ -40,7 +40,7 @@ struct _GimpItem gint ID; /* provides a unique ID */ guint32 tattoo; /* provides a permanent ID */ - GimpImage *gimage; /* gimage owner */ + GimpImage *image; /* item owner */ GimpParasiteList *parasites; /* Plug-in parasite data */ @@ -137,7 +137,7 @@ gboolean gimp_item_is_removed (const GimpItem *item); gboolean gimp_item_is_attached (GimpItem *item); void gimp_item_configure (GimpItem *item, - GimpImage *gimage, + GimpImage *image, gint offset_x, gint offset_y, gint width, @@ -231,7 +231,7 @@ void gimp_item_set_tattoo (GimpItem *item, GimpImage * gimp_item_get_image (const GimpItem *item); void gimp_item_set_image (GimpItem *item, - GimpImage *gimage); + GimpImage *image); void gimp_item_parasite_attach (GimpItem *item, GimpParasite *parasite); diff --git a/app/core/gimplayer-floating-sel.c b/app/core/gimplayer-floating-sel.c index c88439f728..dbd262c49e 100644 --- a/app/core/gimplayer-floating-sel.c +++ b/app/core/gimplayer-floating-sel.c @@ -44,7 +44,7 @@ void floating_sel_attach (GimpLayer *layer, GimpDrawable *drawable) { - GimpImage *gimage; + GimpImage *image; GimpLayer *floating_sel; g_return_if_fail (GIMP_IS_LAYER (layer)); @@ -54,9 +54,9 @@ floating_sel_attach (GimpLayer *layer, g_return_if_fail (gimp_item_get_image (GIMP_ITEM (layer)) == gimp_item_get_image (GIMP_ITEM (drawable))); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - floating_sel = gimp_image_floating_sel (gimage); + floating_sel = gimp_image_floating_sel (image); /* If there is already a floating selection, anchor it */ if (floating_sel) @@ -67,7 +67,7 @@ floating_sel_attach (GimpLayer *layer, * to the drawable */ if (drawable == (GimpDrawable *) floating_sel) - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); } /* set the drawable and allocate a backing store */ @@ -77,8 +77,8 @@ floating_sel_attach (GimpLayer *layer, GIMP_ITEM (layer)->height, gimp_drawable_bytes (drawable)); - /* add the layer to the gimage */ - gimp_image_add_layer (gimage, layer, 0); + /* add the layer to the image */ + gimp_image_add_layer (image, layer, 0); /* store the affected area from the drawable in the backing store */ floating_sel_rigor (layer, TRUE); @@ -87,14 +87,14 @@ floating_sel_attach (GimpLayer *layer, void floating_sel_remove (GimpLayer *layer) { - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_LAYER (layer)); g_return_if_fail (gimp_layer_is_floating_sel (layer)); - gimage = gimp_item_get_image (GIMP_ITEM (layer->fs.drawable)); + image = gimp_item_get_image (GIMP_ITEM (layer->fs.drawable)); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_FS_REMOVE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_FS_REMOVE, _("Remove Floating Selection")); /* store the affected area from the drawable in the backing store */ @@ -107,22 +107,22 @@ floating_sel_remove (GimpLayer *layer) */ gimp_viewable_invalidate_preview (GIMP_VIEWABLE (layer)); - /* remove the layer from the gimage */ - gimp_image_remove_layer (gimage, layer); + /* remove the layer from the image */ + gimp_image_remove_layer (image, layer); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } void floating_sel_anchor (GimpLayer *layer) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; g_return_if_fail (GIMP_IS_LAYER (layer)); g_return_if_fail (gimp_layer_is_floating_sel (layer)); - gimage = gimp_item_get_image (GIMP_ITEM (layer)); + image = gimp_item_get_image (GIMP_ITEM (layer)); if (! gimp_layer_is_floating_sel (layer)) { @@ -132,7 +132,7 @@ floating_sel_anchor (GimpLayer *layer) } /* Start a floating selection anchoring undo */ - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_FS_ANCHOR, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_FS_ANCHOR, _("Anchor Floating Selection")); /* Invalidate the previews of the layer that will be composited @@ -153,39 +153,39 @@ floating_sel_anchor (GimpLayer *layer) drawable = layer->fs.drawable; /* remove the floating selection */ - gimp_image_remove_layer (gimage, layer); + gimp_image_remove_layer (image, layer); /* end the group undo */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); /* invalidate the boundaries */ - gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (gimp_image_get_mask (gimage))); + gimp_drawable_invalidate_boundary (GIMP_DRAWABLE (gimp_image_get_mask (image))); } void floating_sel_activate_drawable (GimpLayer *layer) { - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_LAYER (layer)); g_return_if_fail (gimp_layer_is_floating_sel (layer)); - gimage = gimp_item_get_image (GIMP_ITEM (layer)); + image = gimp_item_get_image (GIMP_ITEM (layer)); /* set the underlying drawable to active */ if (GIMP_IS_LAYER_MASK (layer->fs.drawable)) { GimpLayerMask *mask = GIMP_LAYER_MASK (layer->fs.drawable); - gimp_image_set_active_layer (gimage, gimp_layer_mask_get_layer (mask)); + gimp_image_set_active_layer (image, gimp_layer_mask_get_layer (mask)); } else if (GIMP_IS_CHANNEL (layer->fs.drawable)) { - gimp_image_set_active_channel (gimage, GIMP_CHANNEL (layer->fs.drawable)); + gimp_image_set_active_channel (image, GIMP_CHANNEL (layer->fs.drawable)); } else { - gimp_image_set_active_layer (gimage, GIMP_LAYER (layer->fs.drawable)); + gimp_image_set_active_layer (image, GIMP_LAYER (layer->fs.drawable)); } } @@ -193,14 +193,14 @@ void floating_sel_to_layer (GimpLayer *layer) { GimpItem *item; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_LAYER (layer)); g_return_if_fail (gimp_layer_is_floating_sel (layer)); item = GIMP_ITEM (layer); - if (! (gimage = gimp_item_get_image (item))) + if (! (image = gimp_item_get_image (item))) return; /* Check if the floating layer belongs to a channel... */ @@ -211,7 +211,7 @@ floating_sel_to_layer (GimpLayer *layer) return; } - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_FS_TO_LAYER, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_FS_TO_LAYER, _("Floating Selection to Layer")); /* restore the contents of the drawable */ @@ -221,7 +221,7 @@ floating_sel_to_layer (GimpLayer *layer) item->width, item->height); - gimp_image_undo_push_fs_to_layer (gimage, NULL, + gimp_image_undo_push_fs_to_layer (image, NULL, layer, layer->fs.drawable); /* clear the selection */ @@ -229,10 +229,10 @@ floating_sel_to_layer (GimpLayer *layer) /* Set pointers */ layer->fs.drawable = NULL; - gimage->floating_sel = NULL; + image->floating_sel = NULL; gimp_item_set_visible (GIMP_ITEM (layer), TRUE, TRUE); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); gimp_object_name_changed (GIMP_OBJECT (layer)); @@ -241,7 +241,7 @@ floating_sel_to_layer (GimpLayer *layer) GIMP_ITEM (layer)->width, GIMP_ITEM (layer)->height); - gimp_image_floating_selection_changed (gimage); + gimp_image_floating_selection_changed (image); } void @@ -281,7 +281,7 @@ floating_sel_store (GimpLayer *layer, */ gimp_item_offsets (GIMP_ITEM (layer->fs.drawable), &offx, &offy); - /* Find the minimum area we need to uncover -- in gimage space */ + /* Find the minimum area we need to uncover -- in image space */ x1 = MAX (GIMP_ITEM (layer)->offset_x, offx); y1 = MAX (GIMP_ITEM (layer)->offset_y, offy); x2 = MIN (GIMP_ITEM (layer)->offset_x + GIMP_ITEM (layer)->width, @@ -328,7 +328,7 @@ floating_sel_restore (GimpLayer *layer, * translated */ - /* Find the minimum area we need to uncover -- in gimage space */ + /* Find the minimum area we need to uncover -- in image space */ gimp_item_offsets (GIMP_ITEM (layer->fs.drawable), &offx, &offy); x1 = MAX (GIMP_ITEM (layer)->offset_x, offx); @@ -409,7 +409,7 @@ floating_sel_composite (GimpLayer *layer, gboolean push_undo) { PixelRegion fsPR; - GimpImage *gimage; + GimpImage *image; GimpLayer *d_layer = NULL; gint lock_alpha; gint active[MAX_CHANNELS]; @@ -420,11 +420,11 @@ floating_sel_composite (GimpLayer *layer, g_return_if_fail (GIMP_IS_LAYER (layer)); g_return_if_fail (gimp_layer_is_floating_sel (layer)); - if (! (gimage = gimp_item_get_image (GIMP_ITEM (layer)))) + if (! (image = gimp_item_get_image (GIMP_ITEM (layer)))) return; /* What this function does is composite the specified area of the - * drawble with the floating selection. We do this when the gimage + * drawble with the floating selection. We do this when the image * is constructed, before any other composition takes place. */ @@ -441,7 +441,7 @@ floating_sel_composite (GimpLayer *layer, */ if (gimp_item_get_visible (GIMP_ITEM (layer))) { - /* Find the minimum area we need to composite -- in gimage space */ + /* Find the minimum area we need to composite -- in image space */ gimp_item_offsets (GIMP_ITEM (layer->fs.drawable), &offx, &offy); x1 = MAX (GIMP_ITEM (layer)->offset_x, offx); @@ -479,15 +479,15 @@ floating_sel_composite (GimpLayer *layer, else lock_alpha = FALSE; - /* We need to set all gimage channels to active to make sure that + /* We need to set all image channels to active to make sure that * nothing strange happens while applying the floating selection. * It wouldn't make sense for the floating selection to be affected - * by the active gimage channels. + * by the active image channels. */ for (i = 0; i < MAX_CHANNELS; i++) { - active[i] = gimage->active[i]; - gimage->active[i] = 1; + active[i] = image->active[i]; + image->active[i] = 1; } /* apply the fs with the undo specified by the value @@ -504,9 +504,9 @@ floating_sel_composite (GimpLayer *layer, if (lock_alpha) gimp_layer_set_lock_alpha (d_layer, TRUE, FALSE); - /* restore gimage active channels */ + /* restore image active channels */ for (i = 0; i < MAX_CHANNELS; i++) - gimage->active[i] = active[i]; + image->active[i] = active[i]; } } } diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index 53f1ed4ec1..1811edea1c 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -151,7 +151,7 @@ static gint gimp_layer_get_opacity_at (GimpPickable *pickable, gint x, gint y); -static void gimp_layer_transform_color (GimpImage *gimage, +static void gimp_layer_transform_color (GimpImage *image, PixelRegion *layerPR, PixelRegion *bufPR, GimpDrawable *drawable, @@ -455,13 +455,13 @@ static void gimp_layer_get_active_components (const GimpDrawable *drawable, gboolean *active) { - GimpLayer *layer = GIMP_LAYER (drawable); - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + GimpLayer *layer = GIMP_LAYER (drawable); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable)); gint i; - /* first copy the gimage active channels */ + /* first copy the image active channels */ for (i = 0; i < MAX_CHANNELS; i++) - active[i] = gimage->active[i]; + active[i] = image->active[i]; if (gimp_drawable_has_alpha (drawable) && layer->lock_alpha) active[gimp_drawable_bytes (drawable) - 1] = FALSE; @@ -505,8 +505,8 @@ gimp_layer_removed (GimpItem *item) static gboolean gimp_layer_is_attached (GimpItem *item) { - return (GIMP_IS_IMAGE (item->gimage) && - gimp_container_have (item->gimage->layers, GIMP_OBJECT (item))); + return (GIMP_IS_IMAGE (item->image) && + gimp_container_have (item->image->layers, GIMP_OBJECT (item))); } static GimpItem * @@ -627,12 +627,10 @@ gimp_layer_rename (GimpItem *item, const gchar *undo_desc) { GimpLayer *layer = GIMP_LAYER (item); - GimpImage *gimage; + GimpImage *image = gimp_item_get_image (item); gboolean attached; gboolean floating_sel; - gimage = gimp_item_get_image (item); - attached = gimp_item_is_attached (item); floating_sel = gimp_layer_is_floating_sel (layer); @@ -643,7 +641,7 @@ gimp_layer_rename (GimpItem *item, if (attached) { - gimp_image_undo_group_start (gimage, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_PROPERTIES, undo_desc); @@ -654,7 +652,7 @@ gimp_layer_rename (GimpItem *item, GIMP_ITEM_CLASS (parent_class)->rename (item, new_name, undo_desc); if (attached && floating_sel) - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return TRUE; } @@ -803,20 +801,20 @@ static void gimp_layer_invalidate_boundary (GimpDrawable *drawable) { GimpLayer *layer = GIMP_LAYER (drawable); - GimpImage *gimage; + GimpImage *image; GimpChannel *mask; - if (! (gimage = gimp_item_get_image (GIMP_ITEM (layer)))) + if (! (image = gimp_item_get_image (GIMP_ITEM (layer)))) return; /* Turn the current selection off */ - gimp_image_selection_control (gimage, GIMP_SELECTION_OFF); + gimp_image_selection_control (image, GIMP_SELECTION_OFF); /* clear the affected region surrounding the layer */ - gimp_image_selection_control (gimage, GIMP_SELECTION_LAYER_OFF); + gimp_image_selection_control (image, GIMP_SELECTION_LAYER_OFF); /* get the selection mask channel */ - mask = gimp_image_get_mask (gimage); + mask = gimp_image_get_mask (image); /* Only bother with the bounds if there is a selection */ if (! gimp_channel_is_empty (mask)) @@ -876,7 +874,7 @@ gimp_layer_get_opacity_at (GimpPickable *pickable, } static void -gimp_layer_transform_color (GimpImage *gimage, +gimp_layer_transform_color (GimpImage *image, PixelRegion *layerPR, PixelRegion *bufPR, GimpDrawable *drawable, @@ -902,7 +900,7 @@ gimp_layer_transform_color (GimpImage *gimage, for (i = 0; i < layerPR->w; i++) { - gimp_image_transform_color (gimage, drawable, d, base_type, s); + gimp_image_transform_color (image, drawable, d, base_type, s); /* alpha channel */ d[layerPR->bytes - 1] = (alpha ? @@ -939,7 +937,7 @@ gimp_layer_layer_mask_update (GimpDrawable *drawable, /* public functions */ GimpLayer * -gimp_layer_new (GimpImage *gimage, +gimp_layer_new (GimpImage *image, gint width, gint height, GimpImageType type, @@ -949,14 +947,14 @@ gimp_layer_new (GimpImage *gimage, { GimpLayer *layer; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (width > 0, NULL); g_return_val_if_fail (height > 0, NULL); layer = g_object_new (GIMP_TYPE_LAYER, NULL); gimp_drawable_configure (GIMP_DRAWABLE (layer), - gimage, + image, 0, 0, width, height, type, name); @@ -972,7 +970,7 @@ gimp_layer_new (GimpImage *gimage, /** * gimp_layer_new_from_tiles: * @tiles: The buffer to make the new layer from. - * @dest_gimage: The image the new layer will be added to. + * @dest_image: The image the new layer will be added to. * @type: The #GimpImageType of the new layer. * @name: The new layer's name. * @opacity: The new layer's opacity. @@ -986,7 +984,7 @@ gimp_layer_new (GimpImage *gimage, **/ GimpLayer * gimp_layer_new_from_tiles (TileManager *tiles, - GimpImage *dest_gimage, + GimpImage *dest_image, GimpImageType type, const gchar *name, gdouble opacity, @@ -995,7 +993,7 @@ gimp_layer_new_from_tiles (TileManager *tiles, PixelRegion bufPR; g_return_val_if_fail (tiles != NULL, NULL); - g_return_val_if_fail (GIMP_IS_IMAGE (dest_gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL); g_return_val_if_fail (name != NULL, NULL); pixel_region_init (&bufPR, tiles, @@ -1004,14 +1002,14 @@ gimp_layer_new_from_tiles (TileManager *tiles, tile_manager_height (tiles), FALSE); - return gimp_layer_new_from_region (&bufPR, dest_gimage, type, + return gimp_layer_new_from_region (&bufPR, dest_image, type, name, opacity, mode); } /** * gimp_layer_new_from_pixbuf: * @pixbuf: The pixbuf to make the new layer from. - * @dest_gimage: The image the new layer will be added to. + * @dest_image: The image the new layer will be added to. * @type: The #GimpImageType of the new layer. * @name: The new layer's name. * @opacity: The new layer's opacity. @@ -1025,7 +1023,7 @@ gimp_layer_new_from_tiles (TileManager *tiles, **/ GimpLayer * gimp_layer_new_from_pixbuf (GdkPixbuf *pixbuf, - GimpImage *dest_gimage, + GimpImage *dest_image, GimpImageType type, const gchar *name, gdouble opacity, @@ -1034,7 +1032,7 @@ gimp_layer_new_from_pixbuf (GdkPixbuf *pixbuf, PixelRegion bufPR = { 0, }; g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); - g_return_val_if_fail (GIMP_IS_IMAGE (dest_gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL); g_return_val_if_fail (name != NULL, NULL); pixel_region_init_data (&bufPR, gdk_pixbuf_get_pixels (pixbuf), @@ -1044,14 +1042,14 @@ gimp_layer_new_from_pixbuf (GdkPixbuf *pixbuf, gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf)); - return gimp_layer_new_from_region (&bufPR, dest_gimage, type, + return gimp_layer_new_from_region (&bufPR, dest_image, type, name, opacity, mode); } /** * gimp_layer_new_from_region: * @region: A readable pixel region. - * @dest_gimage: The image the new layer will be added to. + * @dest_image: The image the new layer will be added to. * @type: The #GimpImageType of the new layer. * @name: The new layer's name. * @opacity: The new layer's opacity. @@ -1065,7 +1063,7 @@ gimp_layer_new_from_pixbuf (GdkPixbuf *pixbuf, **/ GimpLayer * gimp_layer_new_from_region (PixelRegion *region, - GimpImage *dest_gimage, + GimpImage *dest_image, GimpImageType type, const gchar *name, gdouble opacity, @@ -1078,7 +1076,7 @@ gimp_layer_new_from_region (PixelRegion *region, gint height; g_return_val_if_fail (region != NULL, NULL); - g_return_val_if_fail (GIMP_IS_IMAGE (dest_gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (dest_image), NULL); g_return_val_if_fail (name != NULL, NULL); width = region->w; @@ -1095,7 +1093,7 @@ gimp_layer_new_from_region (PixelRegion *region, break; } - new_layer = gimp_layer_new (dest_gimage, width, height, type, name, + new_layer = gimp_layer_new (dest_image, width, height, type, name, opacity, mode); if (! new_layer) @@ -1133,7 +1131,7 @@ gimp_layer_new_from_region (PixelRegion *region, break; case GIMP_GRAY_IMAGE: case GIMP_GRAYA_IMAGE: - gimp_layer_transform_color (dest_gimage, &layerPR, region, + gimp_layer_transform_color (dest_image, &layerPR, region, GIMP_DRAWABLE (new_layer), src_type); break; default: @@ -1159,7 +1157,7 @@ gimp_layer_new_from_region (PixelRegion *region, { case GIMP_RGB_IMAGE: case GIMP_RGBA_IMAGE: - gimp_layer_transform_color (dest_gimage, &layerPR, region, + gimp_layer_transform_color (dest_image, &layerPR, region, GIMP_DRAWABLE (new_layer), src_type); break; case GIMP_GRAYA_IMAGE: @@ -1183,12 +1181,12 @@ gimp_layer_new_from_region (PixelRegion *region, { case GIMP_RGB_IMAGE: case GIMP_RGBA_IMAGE: - gimp_layer_transform_color (dest_gimage, &layerPR, region, + gimp_layer_transform_color (dest_image, &layerPR, region, GIMP_DRAWABLE (new_layer), src_type); break; case GIMP_GRAY_IMAGE: case GIMP_GRAYA_IMAGE: - gimp_layer_transform_color (dest_gimage, &layerPR, region, + gimp_layer_transform_color (dest_image, &layerPR, region, GIMP_DRAWABLE (new_layer), src_type); break; default: @@ -1206,7 +1204,7 @@ gimp_layer_add_mask (GimpLayer *layer, GimpLayerMask *mask, gboolean push_undo) { - GimpImage *gimage; + GimpImage *image; g_return_val_if_fail (GIMP_IS_LAYER (layer), NULL); g_return_val_if_fail (GIMP_IS_LAYER_MASK (mask), NULL); @@ -1214,9 +1212,9 @@ gimp_layer_add_mask (GimpLayer *layer, if (! gimp_item_is_attached (GIMP_ITEM (layer))) push_undo = FALSE; - gimage = gimp_item_get_image (GIMP_ITEM (layer)); + image = gimp_item_get_image (GIMP_ITEM (layer)); - if (! gimage) + if (! image) { g_message (_("Cannot add layer mask to layer " "which is not part of an image.")); @@ -1248,7 +1246,7 @@ gimp_layer_add_mask (GimpLayer *layer, } if (push_undo) - gimp_image_undo_push_layer_mask_add (gimage, _("Add Layer Mask"), + gimp_image_undo_push_layer_mask_add (image, _("Add Layer Mask"), layer, mask); layer->mask = g_object_ref (mask); @@ -1282,7 +1280,7 @@ gimp_layer_create_mask (const GimpLayer *layer, PixelRegion srcPR; PixelRegion destPR; GimpLayerMask *mask; - GimpImage *gimage; + GimpImage *image; gchar *mask_name; GimpRGB black = { 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE }; @@ -1290,12 +1288,12 @@ gimp_layer_create_mask (const GimpLayer *layer, drawable = GIMP_DRAWABLE (layer); item = GIMP_ITEM (layer); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); mask_name = g_strdup_printf (_("%s mask"), gimp_object_get_name (GIMP_OBJECT (layer))); - mask = gimp_layer_mask_new (gimage, + mask = gimp_layer_mask_new (image, item->width, item->height, mask_name, &black); @@ -1387,10 +1385,10 @@ gimp_layer_create_mask (const GimpLayer *layer, gint copy_x, copy_y; gint copy_width, copy_height; - selection = gimp_image_get_mask (gimage); + selection = gimp_image_get_mask (image); selection_empty = gimp_channel_is_empty (selection); - gimp_rectangle_intersect (0, 0, gimage->width, gimage->height, + gimp_rectangle_intersect (0, 0, image->width, image->height, item->offset_x, item->offset_y, item->width, item->height, ©_x, ©_y, ©_width, ©_height); @@ -1482,7 +1480,7 @@ gimp_layer_apply_mask (GimpLayer *layer, gboolean push_undo) { GimpItem *item; - GimpImage *gimage; + GimpImage *image; PixelRegion srcPR, maskPR; gboolean view_changed = FALSE; @@ -1497,19 +1495,19 @@ gimp_layer_apply_mask (GimpLayer *layer, item = GIMP_ITEM (layer); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); - if (! gimage) + if (! image) return; if (push_undo) { - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_LAYER_APPLY_MASK, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_LAYER_APPLY_MASK, (mode == GIMP_MASK_APPLY) ? _("Apply Layer Mask") : _("Delete Layer Mask")); - gimp_image_undo_push_layer_mask_remove (gimage, NULL, layer, layer->mask); + gimp_image_undo_push_layer_mask_remove (image, NULL, layer, layer->mask); } /* check if applying the mask changes the projection */ @@ -1553,7 +1551,7 @@ gimp_layer_apply_mask (GimpLayer *layer, layer->mask = NULL; if (push_undo) - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); /* If applying actually changed the view */ if (view_changed) @@ -1670,7 +1668,7 @@ void gimp_layer_resize_to_image (GimpLayer *layer, GimpContext *context) { - GimpImage *gimage; + GimpImage *image; gint offset_x; gint offset_y; @@ -1678,16 +1676,16 @@ gimp_layer_resize_to_image (GimpLayer *layer, g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (layer))); g_return_if_fail (GIMP_IS_CONTEXT (context)); - gimage = gimp_item_get_image (GIMP_ITEM (layer)); + image = gimp_item_get_image (GIMP_ITEM (layer)); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_ITEM_RESIZE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE, _("Layer to Image Size")); gimp_item_offsets (GIMP_ITEM (layer), &offset_x, &offset_y); gimp_item_resize (GIMP_ITEM (layer), context, - gimage->width, gimage->height, offset_x, offset_y); + image->width, image->height, offset_x, offset_y); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } BoundSeg * @@ -1786,9 +1784,9 @@ gimp_layer_set_opacity (GimpLayer *layer, { if (push_undo && gimp_item_is_attached (GIMP_ITEM (layer))) { - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer)); - gimp_image_undo_push_layer_opacity (gimage, NULL, layer); + gimp_image_undo_push_layer_opacity (image, NULL, layer); } layer->opacity = opacity; @@ -1822,9 +1820,9 @@ gimp_layer_set_mode (GimpLayer *layer, { if (push_undo && gimp_item_is_attached (GIMP_ITEM (layer))) { - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer)); - gimp_image_undo_push_layer_mode (gimage, NULL, layer); + gimp_image_undo_push_layer_mode (image, NULL, layer); } layer->mode = mode; @@ -1860,9 +1858,9 @@ gimp_layer_set_lock_alpha (GimpLayer *layer, { if (push_undo && gimp_item_is_attached (GIMP_ITEM (layer))) { - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer)); - gimp_image_undo_push_layer_lock_alpha (gimage, NULL, layer); + gimp_image_undo_push_layer_lock_alpha (image, NULL, layer); } layer->lock_alpha = lock_alpha; diff --git a/app/core/gimplayer.h b/app/core/gimplayer.h index e71c2e8d06..ff7b5e42fe 100644 --- a/app/core/gimplayer.h +++ b/app/core/gimplayer.h @@ -71,7 +71,7 @@ struct _GimpLayerClass GType gimp_layer_get_type (void) G_GNUC_CONST; -GimpLayer * gimp_layer_new (GimpImage *gimage, +GimpLayer * gimp_layer_new (GimpImage *image, gint width, gint height, GimpImageType type, @@ -80,19 +80,19 @@ GimpLayer * gimp_layer_new (GimpImage *gimage, GimpLayerModeEffects mode); GimpLayer * gimp_layer_new_from_tiles (TileManager *tiles, - GimpImage *dest_gimage, + GimpImage *dest_image, GimpImageType type, const gchar *name, gdouble opacity, GimpLayerModeEffects mode); GimpLayer * gimp_layer_new_from_pixbuf (GdkPixbuf *pixbuf, - GimpImage *dest_gimage, + GimpImage *dest_image, GimpImageType type, const gchar *name, gdouble opacity, GimpLayerModeEffects mode); GimpLayer * gimp_layer_new_from_region (PixelRegion *region, - GimpImage *dest_gimage, + GimpImage *dest_image, GimpImageType type, const gchar *name, gdouble opacity, diff --git a/app/core/gimplayermask.c b/app/core/gimplayermask.c index 10c7e5339e..5c4b5378b4 100644 --- a/app/core/gimplayermask.c +++ b/app/core/gimplayermask.c @@ -117,7 +117,7 @@ gimp_layer_mask_is_attached (GimpItem *item) GimpLayerMask *mask = GIMP_LAYER_MASK (item); GimpLayer *layer = gimp_layer_mask_get_layer (mask); - return (GIMP_IS_IMAGE (item->gimage) && + return (GIMP_IS_IMAGE (item->image) && GIMP_IS_LAYER (layer) && gimp_layer_get_mask (layer) == mask && gimp_item_is_attached (GIMP_ITEM (layer))); @@ -159,7 +159,7 @@ gimp_layer_mask_rename (GimpItem *item, } GimpLayerMask * -gimp_layer_mask_new (GimpImage *gimage, +gimp_layer_mask_new (GimpImage *image, gint width, gint height, const gchar *name, @@ -170,7 +170,7 @@ gimp_layer_mask_new (GimpImage *gimage, layer_mask = g_object_new (GIMP_TYPE_LAYER_MASK, NULL); gimp_drawable_configure (GIMP_DRAWABLE (layer_mask), - gimage, + image, 0, 0, width, height, GIMP_GRAY_IMAGE, name); @@ -225,10 +225,10 @@ gimp_layer_mask_set_apply (GimpLayerMask *layer_mask, if (layer_mask->apply_mask != apply) { - GimpImage *gimage = GIMP_ITEM (layer_mask)->gimage; + GimpImage *image = GIMP_ITEM (layer_mask)->image; if (push_undo) - gimp_image_undo_push_layer_mask_apply (gimage, _("Apply Layer Mask"), + gimp_image_undo_push_layer_mask_apply (image, _("Apply Layer Mask"), layer_mask); layer_mask->apply_mask = apply ? TRUE : FALSE; @@ -286,10 +286,10 @@ gimp_layer_mask_set_show (GimpLayerMask *layer_mask, if (layer_mask->show_mask != show) { - GimpImage *gimage = GIMP_ITEM (layer_mask)->gimage; + GimpImage *image = GIMP_ITEM (layer_mask)->image; if (push_undo) - gimp_image_undo_push_layer_mask_show (gimage, _("Show Layer Mask"), + gimp_image_undo_push_layer_mask_show (image, _("Show Layer Mask"), layer_mask); layer_mask->show_mask = show ? TRUE : FALSE; diff --git a/app/core/gimplayermask.h b/app/core/gimplayermask.h index b6a2da1a50..0298933006 100644 --- a/app/core/gimplayermask.h +++ b/app/core/gimplayermask.h @@ -58,7 +58,7 @@ struct _GimpLayerMaskClass GType gimp_layer_mask_get_type (void) G_GNUC_CONST; -GimpLayerMask * gimp_layer_mask_new (GimpImage *gimage, +GimpLayerMask * gimp_layer_mask_new (GimpImage *image, gint width, gint height, const gchar *name, diff --git a/app/core/gimppalette-import.c b/app/core/gimppalette-import.c index 0034b005b5..d95fdcbc85 100644 --- a/app/core/gimppalette-import.c +++ b/app/core/gimppalette-import.c @@ -325,7 +325,7 @@ gimp_palette_import_extract (GimpImage *image, } GimpPalette * -gimp_palette_import_from_image (GimpImage *gimage, +gimp_palette_import_from_image (GimpImage *image, const gchar *palette_name, gint n_colors, gint threshold) @@ -333,19 +333,19 @@ gimp_palette_import_from_image (GimpImage *gimage, GimpPickable *pickable; GHashTable *colors; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (palette_name != NULL, NULL); g_return_val_if_fail (n_colors > 1, NULL); g_return_val_if_fail (threshold > 0, NULL); - pickable = GIMP_PICKABLE (gimage->projection); + pickable = GIMP_PICKABLE (image->projection); gimp_pickable_flush (pickable); - colors = gimp_palette_import_extract (gimage, + colors = gimp_palette_import_extract (image, gimp_pickable_get_tiles (pickable), gimp_pickable_get_image_type (pickable), - 0, 0, gimage->width, gimage->height, + 0, 0, image->width, image->height, n_colors, threshold); return gimp_palette_import_make_palette (colors, palette_name, n_colors); @@ -354,29 +354,29 @@ gimp_palette_import_from_image (GimpImage *gimage, /* create a palette from an indexed image **********************************/ GimpPalette * -gimp_palette_import_from_indexed_image (GimpImage *gimage, +gimp_palette_import_from_indexed_image (GimpImage *image, const gchar *palette_name) { GimpPalette *palette; gint count; GimpRGB color; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); - g_return_val_if_fail (gimp_image_base_type (gimage) == GIMP_INDEXED, NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); + g_return_val_if_fail (gimp_image_base_type (image) == GIMP_INDEXED, NULL); g_return_val_if_fail (palette_name != NULL, NULL); palette = GIMP_PALETTE (gimp_palette_new (palette_name)); - for (count = 0; count < gimage->num_cols; ++count) + for (count = 0; count < image->num_cols; ++count) { gchar name[256]; g_snprintf (name, sizeof (name), _("Index %d"), count); gimp_rgba_set_uchar (&color, - gimage->cmap[count * 3], - gimage->cmap[count * 3 + 1], - gimage->cmap[count * 3 + 2], + image->cmap[count * 3 + 0], + image->cmap[count * 3 + 1], + image->cmap[count * 3 + 2], 255); gimp_palette_add_entry (palette, -1, name, &color); diff --git a/app/core/gimppalette-import.h b/app/core/gimppalette-import.h index c41436327c..0396fb1ede 100644 --- a/app/core/gimppalette-import.h +++ b/app/core/gimppalette-import.h @@ -24,11 +24,11 @@ GimpPalette * gimp_palette_import_from_gradient (GimpGradient *gradient, gboolean reverse, const gchar *palette_name, gint n_colors); -GimpPalette * gimp_palette_import_from_image (GimpImage *gimage, +GimpPalette * gimp_palette_import_from_image (GimpImage *image, const gchar *palette_name, gint n_colors, gint treshold); -GimpPalette * gimp_palette_import_from_indexed_image (GimpImage *gimage, +GimpPalette * gimp_palette_import_from_indexed_image (GimpImage *image, const gchar *palette_name); GimpPalette * gimp_palette_import_from_drawable (GimpDrawable *drawable, const gchar *palette_name, diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index bd2b2a1987..8dd41088cb 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -94,20 +94,20 @@ gimp_projection_construct (GimpProjection *proj, g_return_if_fail (GIMP_IS_PROJECTION (proj)); #if 0 - GimpImage *gimage = proj->gimage; + GimpImage *image = proj->image; - if ((gimp_container_num_children (gimage->layers) == 1)) /* a single layer */ + if ((gimp_container_num_children (image->layers) == 1)) /* a single layer */ { GimpDrawable *layer; - layer = GIMP_DRAWABLE (gimp_container_get_child_by_index (gimage->layers, + layer = GIMP_DRAWABLE (gimp_container_get_child_by_index (image->layers, 0)); - if (gimp_drawable_has_alpha (layer) && - (gimp_item_get_visible (GIMP_ITEM (layer))) && - (gimp_item_width (GIMP_ITEM (layer)) == gimage->width) && - (gimp_item_height (GIMP_ITEM (layer)) == gimage->height) && - (! gimp_drawable_is_indexed (layer)) && + if (gimp_drawable_has_alpha (layer) && + (gimp_item_get_visible (GIMP_ITEM (layer))) && + (gimp_item_width (GIMP_ITEM (layer)) == image->width) && + (gimp_item_height (GIMP_ITEM (layer)) == image->height) && + (! gimp_drawable_is_indexed (layer)) && (gimp_layer_get_opacity (GIMP_LAYER (layer)) == GIMP_OPACITY_OPAQUE)) { gint xoff; @@ -172,12 +172,12 @@ gimp_projection_construct_layers (GimpProjection *proj, gint off_y; /* composite the floating selection if it exists */ - if ((layer = gimp_image_floating_sel (proj->gimage))) + if ((layer = gimp_image_floating_sel (proj->image))) floating_sel_composite (layer, x, y, w, h, FALSE); reverse_list = NULL; - for (list = GIMP_LIST (proj->gimage->layers)->list; + for (list = GIMP_LIST (proj->image->layers)->list; list; list = g_list_next (list)) { @@ -289,7 +289,7 @@ gimp_projection_construct_channels (GimpProjection *proj, GList *reverse_list = NULL; /* reverse the channel list */ - for (list = GIMP_LIST (proj->gimage->channels)->list; + for (list = GIMP_LIST (proj->image->channels)->list; list; list = g_list_next (list)) { @@ -340,7 +340,7 @@ gimp_projection_initialize (GimpProjection *proj, * the projection is initialized to transparent */ - for (list = GIMP_LIST (proj->gimage->layers)->list; + for (list = GIMP_LIST (proj->image->layers)->list; list; list = g_list_next (list)) { @@ -383,13 +383,13 @@ project_intensity (GimpProjection *proj, initial_region (src, dest, mask, NULL, layer->opacity * 255.999, layer->mode, - proj->gimage->visible, + proj->image->visible, INITIAL_INTENSITY); else combine_regions (dest, src, dest, mask, NULL, layer->opacity * 255.999, layer->mode, - proj->gimage->visible, + proj->image->visible, COMBINE_INTEN_A_INTEN); } @@ -404,13 +404,13 @@ project_intensity_alpha (GimpProjection *proj, initial_region (src, dest, mask, NULL, layer->opacity * 255.999, layer->mode, - proj->gimage->visible, + proj->image->visible, INITIAL_INTENSITY_ALPHA); else combine_regions (dest, src, dest, mask, NULL, layer->opacity * 255.999, layer->mode, - proj->gimage->visible, + proj->image->visible, COMBINE_INTEN_A_INTEN_A); } @@ -420,13 +420,13 @@ project_indexed (GimpProjection *proj, PixelRegion *src, PixelRegion *dest) { - g_return_if_fail (proj->gimage->cmap != NULL); + g_return_if_fail (proj->image->cmap != NULL); if (! proj->construct_flag) - initial_region (src, dest, NULL, proj->gimage->cmap, + initial_region (src, dest, NULL, proj->image->cmap, layer->opacity * 255.999, layer->mode, - proj->gimage->visible, + proj->image->visible, INITIAL_INDEXED); else g_warning ("%s: unable to project indexed image.", G_STRFUNC); @@ -439,19 +439,19 @@ project_indexed_alpha (GimpProjection *proj, PixelRegion *dest, PixelRegion *mask) { - g_return_if_fail (proj->gimage->cmap != NULL); + g_return_if_fail (proj->image->cmap != NULL); if (! proj->construct_flag) - initial_region (src, dest, mask, proj->gimage->cmap, + initial_region (src, dest, mask, proj->image->cmap, layer->opacity * 255.999, layer->mode, - proj->gimage->visible, + proj->image->visible, INITIAL_INDEXED_ALPHA); else - combine_regions (dest, src, dest, mask, proj->gimage->cmap, + combine_regions (dest, src, dest, mask, proj->image->cmap, layer->opacity * 255.999, layer->mode, - proj->gimage->visible, + proj->image->visible, COMBINE_INTEN_A_INDEXED_A); } diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c index bd2c2ac4b5..983ed280a2 100644 --- a/app/core/gimpprojection.c +++ b/app/core/gimpprojection.c @@ -83,17 +83,17 @@ static void gimp_projection_invalidate (GimpProjection *proj, static void gimp_projection_validate_tile (TileManager *tm, Tile *tile); -static void gimp_projection_image_update (GimpImage *gimage, +static void gimp_projection_image_update (GimpImage *image, gint x, gint y, gint w, gint h, GimpProjection *proj); -static void gimp_projection_image_size_changed (GimpImage *gimage, +static void gimp_projection_image_size_changed (GimpImage *image, GimpProjection *proj); -static void gimp_projection_image_mode_changed (GimpImage *gimage, +static void gimp_projection_image_mode_changed (GimpImage *image, GimpProjection *proj); -static void gimp_projection_image_flush (GimpImage *gimage, +static void gimp_projection_image_flush (GimpImage *image, GimpProjection *proj); @@ -134,7 +134,7 @@ gimp_projection_class_init (GimpProjectionClass *klass) static void gimp_projection_init (GimpProjection *proj) { - proj->gimage = NULL; + proj->image = NULL; proj->type = -1; proj->bytes = 0; @@ -219,14 +219,14 @@ gimp_projection_get_color_at (GimpPickable *pickable, guchar *src; guchar *dest; - if (x < 0 || y < 0 || x >= proj->gimage->width || y >= proj->gimage->height) + if (x < 0 || y < 0 || x >= proj->image->width || y >= proj->image->height) return NULL; dest = g_new (guchar, 5); tile = tile_manager_get_tile (gimp_projection_get_tiles (proj), x, y, TRUE, FALSE); src = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT); - gimp_image_get_color (proj->gimage, gimp_projection_get_image_type (proj), + gimp_image_get_color (proj->image, gimp_projection_get_image_type (proj), src, dest); dest[4] = 0; @@ -244,26 +244,26 @@ gimp_projection_get_opacity_at (GimpPickable *pickable, } GimpProjection * -gimp_projection_new (GimpImage *gimage) +gimp_projection_new (GimpImage *image) { GimpProjection *proj; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); proj = g_object_new (GIMP_TYPE_PROJECTION, NULL); - proj->gimage = gimage; + proj->image = image; - g_signal_connect_object (gimage, "update", + g_signal_connect_object (image, "update", G_CALLBACK (gimp_projection_image_update), proj, 0); - g_signal_connect_object (gimage, "size-changed", + g_signal_connect_object (image, "size-changed", G_CALLBACK (gimp_projection_image_size_changed), proj, 0); - g_signal_connect_object (gimage, "mode-changed", + g_signal_connect_object (image, "mode-changed", G_CALLBACK (gimp_projection_image_mode_changed), proj, 0); - g_signal_connect_object (gimage, "flush", + g_signal_connect_object (image, "flush", G_CALLBACK (gimp_projection_image_flush), proj, 0); @@ -276,8 +276,8 @@ gimp_projection_get_tiles (GimpProjection *proj) g_return_val_if_fail (GIMP_IS_PROJECTION (proj), NULL); if (proj->tiles == NULL || - tile_manager_width (proj->tiles) != proj->gimage->width || - tile_manager_height (proj->tiles) != proj->gimage->height) + tile_manager_width (proj->tiles) != proj->image->width || + tile_manager_height (proj->tiles) != proj->image->height) { gimp_projection_alloc_tiles (proj); } @@ -290,7 +290,7 @@ gimp_projection_get_image (const GimpProjection *proj) { g_return_val_if_fail (GIMP_IS_PROJECTION (proj), NULL); - return proj->gimage; + return proj->image; } GimpImageType @@ -368,7 +368,7 @@ gimp_projection_alloc_tiles (GimpProjection *proj) * This includes the intensity channels and an alpha channel * if one doesn't exist. */ - switch (gimp_image_base_type (proj->gimage)) + switch (gimp_image_base_type (proj->image)) { case GIMP_RGB: case GIMP_INDEXED: @@ -387,10 +387,10 @@ gimp_projection_alloc_tiles (GimpProjection *proj) if (proj->tiles) { - if (proj_type != proj->type || - proj_bytes != proj->bytes || - proj->gimage->width != tile_manager_width (proj->tiles) || - proj->gimage->height != tile_manager_height (proj->tiles)) + if (proj_type != proj->type || + proj_bytes != proj->bytes || + proj->image->width != tile_manager_width (proj->tiles) || + proj->image->height != tile_manager_height (proj->tiles)) { tile_manager_unref (proj->tiles); proj->tiles = NULL; @@ -402,8 +402,8 @@ gimp_projection_alloc_tiles (GimpProjection *proj) proj->type = proj_type; proj->bytes = proj_bytes; - proj->tiles = tile_manager_new (proj->gimage->width, - proj->gimage->height, + proj->tiles = tile_manager_new (proj->image->width, + proj->image->height, proj->bytes); tile_manager_set_user_data (proj->tiles, proj); tile_manager_set_validate_proc (proj->tiles, @@ -422,10 +422,10 @@ gimp_projection_add_update_area (GimpProjection *proj, g_return_if_fail (GIMP_IS_PROJECTION (proj)); - area = gimp_area_new (CLAMP (x, 0, proj->gimage->width), - CLAMP (y, 0, proj->gimage->height), - CLAMP (x + w, 0, proj->gimage->width), - CLAMP (y + h, 0, proj->gimage->height)); + area = gimp_area_new (CLAMP (x, 0, proj->image->width), + CLAMP (y, 0, proj->image->height), + CLAMP (x + w, 0, proj->image->width), + CLAMP (y + h, 0, proj->image->height)); proj->update_areas = gimp_area_list_process (proj->update_areas, area); } @@ -614,10 +614,10 @@ gimp_projection_paint_area (GimpProjection *proj, gint x1, y1, x2, y2; /* Bounds check */ - x1 = CLAMP (x, 0, proj->gimage->width); - y1 = CLAMP (y, 0, proj->gimage->height); - x2 = CLAMP (x + w, 0, proj->gimage->width); - y2 = CLAMP (y + h, 0, proj->gimage->height); + x1 = CLAMP (x, 0, proj->image->width); + y1 = CLAMP (y, 0, proj->image->height); + x2 = CLAMP (x + w, 0, proj->image->width); + y2 = CLAMP (y + h, 0, proj->image->height); x = x1; y = y1; w = (x2 - x1); @@ -671,7 +671,7 @@ gimp_projection_validate_tile (TileManager *tm, /* image callbacks */ static void -gimp_projection_image_update (GimpImage *gimage, +gimp_projection_image_update (GimpImage *image, gint x, gint y, gint w, @@ -682,23 +682,23 @@ gimp_projection_image_update (GimpImage *gimage, } static void -gimp_projection_image_size_changed (GimpImage *gimage, +gimp_projection_image_size_changed (GimpImage *image, GimpProjection *proj) { gimp_projection_alloc_tiles (proj); - gimp_projection_add_update_area (proj, 0, 0, gimage->width, gimage->height); + gimp_projection_add_update_area (proj, 0, 0, image->width, image->height); } static void -gimp_projection_image_mode_changed (GimpImage *gimage, +gimp_projection_image_mode_changed (GimpImage *image, GimpProjection *proj) { gimp_projection_alloc_tiles (proj); - gimp_projection_add_update_area (proj, 0, 0, gimage->width, gimage->height); + gimp_projection_add_update_area (proj, 0, 0, image->width, image->height); } static void -gimp_projection_image_flush (GimpImage *gimage, +gimp_projection_image_flush (GimpImage *image, GimpProjection *proj) { gimp_projection_flush (proj); diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index 906d0cca7b..6cfb9e603f 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -52,7 +52,7 @@ struct _GimpProjection { GimpObject parent_instance; - GimpImage *gimage; + GimpImage *image; GimpImageType type; gint bytes; @@ -68,7 +68,7 @@ struct _GimpProjectionClass { GimpObjectClass parent_class; - void (* update) (GimpProjection *gimage, + void (* update) (GimpProjection *image, gboolean now, gint x, gint y, @@ -79,7 +79,7 @@ struct _GimpProjectionClass GType gimp_projection_get_type (void) G_GNUC_CONST; -GimpProjection * gimp_projection_new (GimpImage *gimage); +GimpProjection * gimp_projection_new (GimpImage *image); TileManager * gimp_projection_get_tiles (GimpProjection *proj); GimpImage * gimp_projection_get_image (const GimpProjection *proj); diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c index 9651c3d7a8..c623299cad 100644 --- a/app/core/gimpselection.c +++ b/app/core/gimpselection.c @@ -181,8 +181,8 @@ gimp_selection_init (GimpSelection *selection) static gboolean gimp_selection_is_attached (GimpItem *item) { - return (GIMP_IS_IMAGE (item->gimage) && - gimp_image_get_mask (item->gimage) == GIMP_CHANNEL (item)); + return (GIMP_IS_IMAGE (item->image) && + gimp_image_get_mask (item->image) == GIMP_CHANNEL (item)); } static void @@ -283,11 +283,11 @@ gimp_selection_stroke (GimpItem *item, static void gimp_selection_invalidate_boundary (GimpDrawable *drawable) { - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable)); GimpLayer *layer; /* Turn the current selection off */ - gimp_image_selection_control (gimage, GIMP_SELECTION_OFF); + gimp_image_selection_control (image, GIMP_SELECTION_OFF); GIMP_DRAWABLE_CLASS (parent_class)->invalidate_boundary (drawable); @@ -295,7 +295,7 @@ gimp_selection_invalidate_boundary (GimpDrawable *drawable) * we need to do this since this selection mask can act as an additional * mask in the composition of the floating selection */ - layer = gimp_image_get_active_layer (gimage); + layer = gimp_image_get_active_layer (image); if (layer && gimp_layer_is_floating_sel (layer)) gimp_drawable_update (GIMP_DRAWABLE (layer), @@ -318,11 +318,11 @@ gimp_selection_boundary (GimpChannel *channel, gint unused3, gint unused4) { - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (channel)); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (channel)); GimpDrawable *drawable; GimpLayer *layer; - if ((layer = gimp_image_floating_sel (gimage))) + if ((layer = gimp_image_floating_sel (image))) { /* If there is a floating selection, then * we need to do some slightly different boundaries. @@ -344,7 +344,7 @@ gimp_selection_boundary (GimpChannel *channel, return TRUE; } - else if ((drawable = gimp_image_active_drawable (gimage)) && + else if ((drawable = gimp_image_active_drawable (image)) && GIMP_IS_CHANNEL (drawable)) { /* Otherwise, return the boundary...if a channel is active */ @@ -354,10 +354,10 @@ gimp_selection_boundary (GimpChannel *channel, num_segs_in, num_segs_out, 0, 0, - gimage->width, - gimage->height); + image->width, + image->height); } - else if ((layer = gimp_image_get_active_layer (gimage))) + else if ((layer = gimp_image_get_active_layer (image))) { /* If a layer is active, we return multiple boundaries based * on the extents @@ -369,12 +369,12 @@ gimp_selection_boundary (GimpChannel *channel, gimp_item_offsets (GIMP_ITEM (layer), &off_x, &off_y); - x1 = CLAMP (off_x, 0, gimage->width); - y1 = CLAMP (off_y, 0, gimage->height); + x1 = CLAMP (off_x, 0, image->width); + y1 = CLAMP (off_y, 0, image->height); x2 = CLAMP (off_x + gimp_item_width (GIMP_ITEM (layer)), 0, - gimage->width); + image->width); y2 = CLAMP (off_y + gimp_item_height (GIMP_ITEM (layer)), 0, - gimage->height); + image->height); return GIMP_CHANNEL_CLASS (parent_class)->boundary (channel, segs_in, segs_out, @@ -499,19 +499,19 @@ gimp_selection_validate (TileManager *tm, /* public functions */ GimpChannel * -gimp_selection_new (GimpImage *gimage, +gimp_selection_new (GimpImage *image, gint width, gint height) { GimpRGB black = { 0.0, 0.0, 0.0, 0.5 }; GimpChannel *channel; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); channel = g_object_new (GIMP_TYPE_SELECTION, NULL); gimp_drawable_configure (GIMP_DRAWABLE (channel), - gimage, + image, 0, 0, width, height, GIMP_GRAY_IMAGE, _("Selection Mask")); @@ -566,12 +566,12 @@ gimp_selection_load (GimpChannel *selection, GimpChannel * gimp_selection_save (GimpChannel *selection) { - GimpImage *gimage; + GimpImage *image; GimpChannel *new_channel; g_return_val_if_fail (GIMP_IS_SELECTION (selection), NULL); - gimage = gimp_item_get_image (GIMP_ITEM (selection)); + image = gimp_item_get_image (GIMP_ITEM (selection)); new_channel = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (selection), GIMP_TYPE_CHANNEL, @@ -580,7 +580,7 @@ gimp_selection_save (GimpChannel *selection) /* saved selections are not visible by default */ gimp_item_set_visible (GIMP_ITEM (new_channel), FALSE, FALSE); - gimp_image_add_channel (gimage, new_channel, -1); + gimp_image_add_channel (image, new_channel, -1); return new_channel; } @@ -593,7 +593,7 @@ gimp_selection_extract (GimpChannel *selection, gboolean keep_indexed, gboolean add_alpha) { - GimpImage *gimage; + GimpImage *image; TileManager *tiles; PixelRegion srcPR, destPR, maskPR; guchar bg_color[MAX_CHANNELS]; @@ -608,7 +608,7 @@ gimp_selection_extract (GimpChannel *selection, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - gimage = gimp_item_get_image (GIMP_ITEM (selection)); + image = gimp_item_get_image (GIMP_ITEM (selection)); /* If there are no bounds, then just extract the entire image * This may not be the correct behavior, but after getting rid @@ -662,7 +662,7 @@ gimp_selection_extract (GimpChannel *selection, break; } - gimp_image_get_background (gimage, drawable, context, bg_color); + gimp_image_get_background (image, drawable, context, bg_color); /* If a cut was specified, and the selection mask is not empty, * push an undo @@ -729,7 +729,7 @@ gimp_selection_extract (GimpChannel *selection, if (gimp_layer_is_floating_sel (GIMP_LAYER (drawable))) floating_sel_remove (GIMP_LAYER (drawable)); else - gimp_image_remove_layer (gimage, GIMP_LAYER (drawable)); + gimp_image_remove_layer (image, GIMP_LAYER (drawable)); } else if (GIMP_IS_LAYER_MASK (drawable)) { @@ -738,7 +738,7 @@ gimp_selection_extract (GimpChannel *selection, } else if (GIMP_IS_CHANNEL (drawable)) { - gimp_image_remove_channel (gimage, GIMP_CHANNEL (drawable)); + gimp_image_remove_channel (image, GIMP_CHANNEL (drawable)); } } } @@ -754,7 +754,7 @@ gimp_selection_float (GimpChannel *selection, gint off_x, gint off_y) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; TileManager *tiles; gint x1, y1, x2, y2; @@ -765,7 +765,7 @@ gimp_selection_float (GimpChannel *selection, g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - gimage = gimp_item_get_image (GIMP_ITEM (selection)); + image = gimp_item_get_image (GIMP_ITEM (selection)); /* Make sure there is a region to float... */ non_empty = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2); @@ -777,7 +777,7 @@ gimp_selection_float (GimpChannel *selection, } /* Start an undo group */ - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_FS_FLOAT, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_FS_FLOAT, _("Float Selection")); /* Cut or copy the selected region */ @@ -793,7 +793,7 @@ gimp_selection_float (GimpChannel *selection, * a channel or layer mask */ layer = gimp_layer_new_from_tiles (tiles, - gimage, + image, gimp_drawable_type_with_alpha (drawable), _("Floated Layer"), GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); @@ -806,13 +806,13 @@ gimp_selection_float (GimpChannel *selection, /* Free the temp buffer */ tile_manager_unref (tiles); - /* Add the floating layer to the gimage */ + /* Add the floating layer to the image */ floating_sel_attach (layer, drawable); /* End an undo group */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - /* invalidate the gimage's boundary variables */ + /* invalidate the image's boundary variables */ selection->boundary_known = FALSE; return layer; diff --git a/app/core/gimpselection.h b/app/core/gimpselection.h index cea6235624..30a867dc4b 100644 --- a/app/core/gimpselection.h +++ b/app/core/gimpselection.h @@ -48,7 +48,7 @@ struct _GimpSelectionClass GType gimp_selection_get_type (void) G_GNUC_CONST; -GimpChannel * gimp_selection_new (GimpImage *gimage, +GimpChannel * gimp_selection_new (GimpImage *image, gint width, gint height); diff --git a/app/core/gimptemplate.c b/app/core/gimptemplate.c index b784033f82..0c731e22c0 100644 --- a/app/core/gimptemplate.c +++ b/app/core/gimptemplate.c @@ -317,7 +317,7 @@ gimp_template_new (const gchar *name) void gimp_template_set_from_image (GimpTemplate *template, - GimpImage *gimage) + GimpImage *image) { gdouble xresolution; gdouble yresolution; @@ -326,26 +326,26 @@ gimp_template_set_from_image (GimpTemplate *template, gchar *comment = NULL; g_return_if_fail (GIMP_IS_TEMPLATE (template)); - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - gimp_image_get_resolution (gimage, &xresolution, &yresolution); + gimp_image_get_resolution (image, &xresolution, &yresolution); - image_type = gimp_image_base_type (gimage); + image_type = gimp_image_base_type (image); if (image_type == GIMP_INDEXED) image_type = GIMP_RGB; - parasite = gimp_image_parasite_find (gimage, "gimp-comment"); + parasite = gimp_image_parasite_find (image, "gimp-comment"); if (parasite) comment = g_strndup (gimp_parasite_data (parasite), gimp_parasite_data_size (parasite)); g_object_set (template, - "width", gimp_image_get_width (gimage), - "height", gimp_image_get_height (gimage), + "width", gimp_image_get_width (image), + "height", gimp_image_get_height (image), "xresolution", xresolution, "yresolution", yresolution, - "resolution-unit", gimp_image_get_unit (gimage), + "resolution-unit", gimp_image_get_unit (image), "image-type", image_type, "comment", comment, NULL); @@ -359,7 +359,7 @@ gimp_template_create_image (Gimp *gimp, GimpTemplate *template, GimpContext *context) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpImageType type; gint width, height; @@ -368,12 +368,12 @@ gimp_template_create_image (Gimp *gimp, g_return_val_if_fail (GIMP_IS_TEMPLATE (template), NULL); g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); - gimage = gimp_create_image (gimp, + image = gimp_create_image (gimp, template->width, template->height, template->image_type, FALSE); - gimp_image_undo_disable (gimage); + gimp_image_undo_disable (image); if (template->comment) { @@ -383,17 +383,17 @@ gimp_template_create_image (Gimp *gimp, GIMP_PARASITE_PERSISTENT, strlen (template->comment) + 1, template->comment); - gimp_image_parasite_attach (gimage, parasite); + gimp_image_parasite_attach (image, parasite); gimp_parasite_free (parasite); } - gimp_image_set_resolution (gimage, + gimp_image_set_resolution (image, template->xresolution, template->yresolution); - gimp_image_set_unit (gimage, template->resolution_unit); + gimp_image_set_unit (image, template->resolution_unit); - width = gimp_image_get_width (gimage); - height = gimp_image_get_height (gimage); + width = gimp_image_get_width (image); + height = gimp_image_get_height (image); switch (template->fill_type) { @@ -407,21 +407,21 @@ gimp_template_create_image (Gimp *gimp, break; } - layer = gimp_layer_new (gimage, width, height, type, + layer = gimp_layer_new (image, width, height, type, _("Background"), GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); gimp_drawable_fill_by_type (GIMP_DRAWABLE (layer), context, template->fill_type); - gimp_image_add_layer (gimage, layer, 0); + gimp_image_add_layer (image, layer, 0); - gimp_image_undo_enable (gimage); - gimp_image_clean_all (gimage); + gimp_image_undo_enable (image); + gimp_image_clean_all (image); - gimp_create_display (gimp, gimage, template->unit, 1.0); + gimp_create_display (gimp, image, template->unit, 1.0); - g_object_unref (gimage); + g_object_unref (image); - return gimage; + return image; } diff --git a/app/core/gimptemplate.h b/app/core/gimptemplate.h index e4b291c4bb..22f2451cb8 100644 --- a/app/core/gimptemplate.h +++ b/app/core/gimptemplate.h @@ -68,7 +68,7 @@ GType gimp_template_get_type (void) G_GNUC_CONST; GimpTemplate * gimp_template_new (const gchar *name); void gimp_template_set_from_image (GimpTemplate *template, - GimpImage *gimage); + GimpImage *image); GimpImage * gimp_template_create_image (Gimp *gimp, GimpTemplate *template, diff --git a/app/core/gimpundo.c b/app/core/gimpundo.c index 20b8a4acea..6f8ce4139d 100644 --- a/app/core/gimpundo.c +++ b/app/core/gimpundo.c @@ -205,7 +205,7 @@ gimp_undo_constructor (GType type, undo = GIMP_UNDO (object); - g_assert (GIMP_IS_IMAGE (undo->gimage)); + g_assert (GIMP_IS_IMAGE (undo->image)); return object; } @@ -242,7 +242,7 @@ gimp_undo_set_property (GObject *object, { case PROP_IMAGE: /* don't ref */ - undo->gimage = (GimpImage *) g_value_get_object (value); + undo->image = (GimpImage *) g_value_get_object (value); break; case PROP_UNDO_TYPE: undo->undo_type = g_value_get_enum (value); @@ -279,7 +279,7 @@ gimp_undo_get_property (GObject *object, switch (property_id) { case PROP_IMAGE: - g_value_set_object (value, undo->gimage); + g_value_set_object (value, undo->image); break; case PROP_UNDO_TYPE: g_value_set_enum (value, undo->undo_type); @@ -404,11 +404,11 @@ gimp_undo_pop (GimpUndo *undo, switch (undo_mode) { case GIMP_UNDO_MODE_UNDO: - gimp_image_clean (undo->gimage, undo->dirty_mask); + gimp_image_clean (undo->image, undo->dirty_mask); break; case GIMP_UNDO_MODE_REDO: - gimp_image_dirty (undo->gimage, undo->dirty_mask); + gimp_image_dirty (undo->image, undo->dirty_mask); break; } } @@ -445,7 +445,7 @@ gimp_undo_create_preview_idle (gpointer data) { GimpUndo *undo = GIMP_UNDO (data); - if (undo == gimp_undo_stack_peek (undo->gimage->undo_stack)) + if (undo == gimp_undo_stack_peek (undo->image->undo_stack)) { gimp_undo_create_preview_private (undo); } @@ -458,7 +458,7 @@ gimp_undo_create_preview_idle (gpointer data) static void gimp_undo_create_preview_private (GimpUndo *undo) { - GimpImage *image = undo->gimage; + GimpImage *image = undo->image; GimpViewable *preview_viewable; GimpViewSize preview_size; gint width; diff --git a/app/core/gimpundo.h b/app/core/gimpundo.h index 08b3bb1b23..e1232c137c 100644 --- a/app/core/gimpundo.h +++ b/app/core/gimpundo.h @@ -48,7 +48,7 @@ struct _GimpUndo { GimpViewable parent_instance; - GimpImage *gimage; /* the image this undo is part of */ + GimpImage *image; /* the image this undo is part of */ guint time; /* time of undo step construction */ GimpUndoType undo_type; /* undo type */ diff --git a/app/core/gimpundostack.c b/app/core/gimpundostack.c index a3f039b91f..0b5177c06c 100644 --- a/app/core/gimpundostack.c +++ b/app/core/gimpundostack.c @@ -135,12 +135,12 @@ gimp_undo_stack_free (GimpUndo *undo, } GimpUndoStack * -gimp_undo_stack_new (GimpImage *gimage) +gimp_undo_stack_new (GimpImage *image) { - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); return g_object_new (GIMP_TYPE_UNDO_STACK, - "image", gimage, + "image", image, NULL); } diff --git a/app/core/gimpundostack.h b/app/core/gimpundostack.h index d0dffaca13..670e5e39c1 100644 --- a/app/core/gimpundostack.h +++ b/app/core/gimpundostack.h @@ -48,7 +48,7 @@ struct _GimpUndoStackClass GType gimp_undo_stack_get_type (void) G_GNUC_CONST; -GimpUndoStack * gimp_undo_stack_new (GimpImage *gimage); +GimpUndoStack * gimp_undo_stack_new (GimpImage *image); void gimp_undo_stack_push_undo (GimpUndoStack *stack, GimpUndo *undo); diff --git a/app/dialogs/channel-options-dialog.c b/app/dialogs/channel-options-dialog.c index 9be7827283..cccc63fd5a 100644 --- a/app/dialogs/channel-options-dialog.c +++ b/app/dialogs/channel-options-dialog.c @@ -48,7 +48,7 @@ static void channel_options_color_changed (GimpColorButton *button, /* public functions */ ChannelOptionsDialog * -channel_options_dialog_new (GimpImage *gimage, +channel_options_dialog_new (GimpImage *image, GimpContext *context, GimpChannel *channel, GtkWidget *parent, @@ -70,7 +70,7 @@ channel_options_dialog_new (GimpImage *gimage, GtkWidget *table; GtkObject *opacity_adj; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + 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 (GTK_IS_WIDGET (parent), NULL); @@ -85,7 +85,7 @@ channel_options_dialog_new (GimpImage *gimage, options = g_new0 (ChannelOptionsDialog, 1); - options->gimage = gimage; + options->image = image; options->context = context; options->channel = channel; @@ -99,7 +99,7 @@ channel_options_dialog_new (GimpImage *gimage, if (channel) viewable = GIMP_VIEWABLE (channel); else - viewable = GIMP_VIEWABLE (gimage); + viewable = GIMP_VIEWABLE (image); options->dialog = gimp_viewable_dialog_new (viewable, diff --git a/app/dialogs/channel-options-dialog.h b/app/dialogs/channel-options-dialog.h index b079d5ce07..8ff6e6a4c5 100644 --- a/app/dialogs/channel-options-dialog.h +++ b/app/dialogs/channel-options-dialog.h @@ -29,13 +29,13 @@ struct _ChannelOptionsDialog GtkWidget *color_panel; GtkWidget *save_sel_checkbutton; - GimpImage *gimage; + GimpImage *image; GimpContext *context; GimpChannel *channel; }; -ChannelOptionsDialog * channel_options_dialog_new (GimpImage *gimage, +ChannelOptionsDialog * channel_options_dialog_new (GimpImage *image, GimpContext *context, GimpChannel *channel, GtkWidget *parent, diff --git a/app/dialogs/convert-dialog.c b/app/dialogs/convert-dialog.c index 4ec9c1ebe5..b027d7b80f 100644 --- a/app/dialogs/convert-dialog.c +++ b/app/dialogs/convert-dialog.c @@ -46,7 +46,7 @@ typedef struct { GtkWidget *dialog; - GimpImage *gimage; + GimpImage *image; GimpProgress *progress; GimpContext *context; GimpContainer *container; @@ -84,7 +84,7 @@ static GimpPalette *saved_palette = NULL; /* public functions */ GtkWidget * -convert_dialog_new (GimpImage *gimage, +convert_dialog_new (GimpImage *image, GtkWidget *parent, GimpProgress *progress) { @@ -101,13 +101,13 @@ convert_dialog_new (GimpImage *gimage, GtkWidget *palette_box; GtkWidget *combo; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GTK_IS_WIDGET (parent), NULL); g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL); dialog = g_new0 (IndexedDialog, 1); - dialog->gimage = gimage; + dialog->image = image; dialog->progress = progress; dialog->dither_type = saved_dither_type; dialog->alpha_dither = saved_alpha_dither; @@ -116,7 +116,7 @@ convert_dialog_new (GimpImage *gimage, dialog->palette_type = saved_palette_type; dialog->dialog = - gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), + gimp_viewable_dialog_new (GIMP_VIEWABLE (image), _("Indexed Color Conversion"), "gimp-image-convert-indexed", GIMP_STOCK_CONVERT_INDEXED, @@ -183,7 +183,7 @@ convert_dialog_new (GimpImage *gimage, gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_widget_show (label); - if (dialog->num_colors == 256 && gimp_image_has_alpha (gimage)) + if (dialog->num_colors == 256 && gimp_image_has_alpha (image)) dialog->num_colors = 255; spinbutton = gimp_spin_button_new (&adjustment, dialog->num_colors, @@ -277,7 +277,7 @@ convert_dialog_response (GtkWidget *widget, _("Converting to indexed"), FALSE); /* Convert the image to indexed color */ - gimp_image_convert (dialog->gimage, + gimp_image_convert (dialog->image, GIMP_INDEXED, dialog->num_colors, dialog->dither_type, @@ -290,7 +290,7 @@ convert_dialog_response (GtkWidget *widget, if (progress) gimp_progress_end (progress); - gimp_image_flush (dialog->gimage); + gimp_image_flush (dialog->image); /* Save defaults for next time */ saved_dither_type = dialog->dither_type; @@ -307,7 +307,7 @@ convert_dialog_response (GtkWidget *widget, static GtkWidget * convert_dialog_palette_box (IndexedDialog *dialog) { - Gimp *gimp = dialog->gimage->gimp; + Gimp *gimp = dialog->image->gimp; GList *list; GimpPalette *palette; GimpPalette *web_palette = NULL; diff --git a/app/dialogs/convert-dialog.h b/app/dialogs/convert-dialog.h index 62b4c386f1..d174fb1504 100644 --- a/app/dialogs/convert-dialog.h +++ b/app/dialogs/convert-dialog.h @@ -20,7 +20,7 @@ #define __CONVERT_DIALOG_H__ -GtkWidget * convert_dialog_new (GimpImage *gimage, +GtkWidget * convert_dialog_new (GimpImage *image, GtkWidget *parent, GimpProgress *progress); diff --git a/app/dialogs/dialogs-constructors.c b/app/dialogs/dialogs-constructors.c index 3a1cfeaeca..15cef20071 100644 --- a/app/dialogs/dialogs-constructors.c +++ b/app/dialogs/dialogs-constructors.c @@ -705,14 +705,14 @@ dialogs_indexed_palette_selected (GimpColormapEditor *editor, { GimpImageEditor *image_editor = GIMP_IMAGE_EDITOR (editor); - if (image_editor->gimage) + if (image_editor->image) { GimpRGB color; gint index; index = gimp_colormap_editor_col_index (editor); - gimp_image_get_colormap_entry (image_editor->gimage, index, &color); + gimp_image_get_colormap_entry (image_editor->image, index, &color); if (state & GDK_CONTROL_MASK) gimp_context_set_background (image_editor->context, &color); diff --git a/app/dialogs/file-open-dialog.c b/app/dialogs/file-open-dialog.c index b6ea8b0412..690196e8dd 100644 --- a/app/dialogs/file-open-dialog.c +++ b/app/dialogs/file-open-dialog.c @@ -54,7 +54,7 @@ static gboolean file_open_dialog_open_image (GtkWidget *open_dialog, const gchar *entered_filename, PlugInProcDef *load_proc); static gboolean file_open_dialog_open_layer (GtkWidget *open_dialog, - GimpImage *gimage, + GimpImage *image, const gchar *uri, const gchar *entered_filename, PlugInProcDef *load_proc); @@ -117,7 +117,7 @@ file_open_dialog_response (GtkWidget *open_dialog, /* open layers in reverse order so they appear in the same * order as in the file dialog */ - if (dialog->gimage) + if (dialog->image) uris = g_slist_reverse (uris); for (list = uris; list; list = g_slist_next (list)) @@ -134,10 +134,10 @@ file_open_dialog_response (GtkWidget *open_dialog, continue; } - if (dialog->gimage) + if (dialog->image) { if (file_open_dialog_open_layer (open_dialog, - dialog->gimage, + dialog->image, list->data, list->data, dialog->file_proc)) @@ -167,8 +167,8 @@ file_open_dialog_response (GtkWidget *open_dialog, { gtk_widget_hide (open_dialog); - if (dialog->gimage) - gimp_image_flush (dialog->gimage); + if (dialog->image) + gimp_image_flush (dialog->image); } gimp_file_dialog_set_sensitive (dialog, TRUE); @@ -184,20 +184,20 @@ file_open_dialog_open_image (GtkWidget *open_dialog, const gchar *entered_filename, PlugInProcDef *load_proc) { - GimpImage *gimage; + GimpImage *image; GimpPDBStatusType status; GError *error = NULL; - gimage = file_open_with_proc_and_display (gimp, - gimp_get_user_context (gimp), - GIMP_PROGRESS (open_dialog), - uri, - entered_filename, - load_proc, - &status, - &error); + image = file_open_with_proc_and_display (gimp, + gimp_get_user_context (gimp), + GIMP_PROGRESS (open_dialog), + uri, + entered_filename, + load_proc, + &status, + &error); - if (gimage) + if (image) { return TRUE; } @@ -217,7 +217,7 @@ file_open_dialog_open_image (GtkWidget *open_dialog, static gboolean file_open_dialog_open_layer (GtkWidget *open_dialog, - GimpImage *gimage, + GimpImage *image, const gchar *uri, const gchar *entered_filename, PlugInProcDef *load_proc) @@ -226,10 +226,10 @@ file_open_dialog_open_layer (GtkWidget *open_dialog, GimpPDBStatusType status; GError *error = NULL; - new_layer = file_open_layer (gimage->gimp, - gimp_get_user_context (gimage->gimp), + new_layer = file_open_layer (image->gimp, + gimp_get_user_context (image->gimp), GIMP_PROGRESS (open_dialog), - gimage, uri, GIMP_RUN_INTERACTIVE, load_proc, + image, uri, GIMP_RUN_INTERACTIVE, load_proc, &status, &error); if (new_layer) @@ -238,8 +238,8 @@ file_open_dialog_open_layer (GtkWidget *open_dialog, gint width, height; gint off_x, off_y; - width = gimp_image_get_width (gimage); - height = gimp_image_get_height (gimage); + width = gimp_image_get_width (image); + height = gimp_image_get_height (image); gimp_item_offsets (new_item, &off_x, &off_y); @@ -248,7 +248,7 @@ file_open_dialog_open_layer (GtkWidget *open_dialog, gimp_item_translate (new_item, off_x, off_y, FALSE); - gimp_image_add_layer (gimage, new_layer, -1); + gimp_image_add_layer (image, new_layer, -1); return TRUE; } diff --git a/app/dialogs/file-save-dialog.c b/app/dialogs/file-save-dialog.c index ab2cf21708..13cccd92de 100644 --- a/app/dialogs/file-save-dialog.c +++ b/app/dialogs/file-save-dialog.c @@ -60,7 +60,7 @@ static gboolean file_save_dialog_check_uri (GtkWidget *save_dialog, static gboolean file_save_dialog_use_extension (GtkWidget *save_dialog, const gchar *uri); static gboolean file_save_dialog_save_image (GtkWidget *save_dialog, - GimpImage *gimage, + GimpImage *image, const gchar *uri, PlugInProcDef *save_proc, gboolean save_a_copy); @@ -141,7 +141,7 @@ file_save_dialog_response (GtkWidget *save_dialog, &uri, &basename, &save_proc)) { if (file_save_dialog_save_image (save_dialog, - dialog->gimage, + dialog->image, uri, save_proc, dialog->save_a_copy)) @@ -427,7 +427,7 @@ file_save_dialog_use_extension (GtkWidget *save_dialog, static gboolean file_save_dialog_save_image (GtkWidget *save_dialog, - GimpImage *gimage, + GimpImage *image, const gchar *uri, PlugInProcDef *save_proc, gboolean save_a_copy) @@ -444,18 +444,18 @@ file_save_dialog_save_image (GtkWidget *save_dialog, gimp_action_group_set_action_sensitive (list->data, "file-quit", FALSE); } - g_object_ref (gimage); + g_object_ref (image); - status = file_save (gimage, gimp_get_user_context (gimage->gimp), + status = file_save (image, gimp_get_user_context (image->gimp), GIMP_PROGRESS (save_dialog), uri, save_proc, GIMP_RUN_INTERACTIVE, save_a_copy, &error); if (status == GIMP_PDB_SUCCESS) - g_object_set_data_full (G_OBJECT (gimage->gimp), "gimp-file-save-last-uri", + g_object_set_data_full (G_OBJECT (image->gimp), "gimp-file-save-last-uri", g_strdup (uri), (GDestroyNotify) g_free); - g_object_unref (gimage); + g_object_unref (image); if (status != GIMP_PDB_SUCCESS && status != GIMP_PDB_CANCEL) diff --git a/app/dialogs/grid-dialog.c b/app/dialogs/grid-dialog.c index d0b47e1dd6..1f3f88d178 100644 --- a/app/dialogs/grid-dialog.c +++ b/app/dialogs/grid-dialog.c @@ -62,7 +62,7 @@ static void grid_dialog_response (GtkWidget *widget, GtkWidget * -grid_dialog_new (GimpImage *gimage, +grid_dialog_new (GimpImage *image, GtkWidget *parent) { GimpGrid *grid; @@ -70,13 +70,13 @@ grid_dialog_new (GimpImage *gimage, GtkWidget *dialog; GtkWidget *editor; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (parent == NULL || GTK_IS_WIDGET (parent), NULL); - grid = gimp_image_get_grid (GIMP_IMAGE (gimage)); + grid = gimp_image_get_grid (GIMP_IMAGE (image)); grid_backup = gimp_config_duplicate (GIMP_CONFIG (grid)); - dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (gimage), + dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (image), _("Configure Grid"), "gimp-grid-configure", GIMP_STOCK_GRID, _("Configure Image Grid"), parent, @@ -102,15 +102,15 @@ grid_dialog_new (GimpImage *gimage, dialog); editor = gimp_grid_editor_new (grid, - gimage->xresolution, - gimage->yresolution); + image->xresolution, + image->yresolution); gtk_container_set_border_width (GTK_CONTAINER (editor), 12); gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), editor); gtk_widget_show (editor); - g_object_set_data (G_OBJECT (dialog), "gimage", gimage); + g_object_set_data (G_OBJECT (dialog), "image", image); g_object_set_data (G_OBJECT (dialog), "grid", grid); g_object_set_data_full (G_OBJECT (dialog), "grid-backup", grid_backup, @@ -127,18 +127,18 @@ grid_dialog_response (GtkWidget *widget, gint response_id, GtkWidget *dialog) { - GimpImage *gimage; + GimpImage *image; GimpImage *grid; GimpGrid *grid_backup; - gimage = g_object_get_data (G_OBJECT (dialog), "gimage"); + image = g_object_get_data (G_OBJECT (dialog), "image"); grid = g_object_get_data (G_OBJECT (dialog), "grid"); grid_backup = g_object_get_data (G_OBJECT (dialog), "grid-backup"); switch (response_id) { case GRID_RESPONSE_RESET: - gimp_config_sync (G_OBJECT (gimage->gimp->config->default_grid), + gimp_config_sync (G_OBJECT (image->gimp->config->default_grid), G_OBJECT (grid), 0); break; @@ -146,14 +146,14 @@ grid_dialog_response (GtkWidget *widget, if (! gimp_config_is_equal_to (GIMP_CONFIG (grid_backup), GIMP_CONFIG (grid))) { - gimp_image_undo_push_image_grid (gimage, _("Grid"), grid_backup); + gimp_image_undo_push_image_grid (image, _("Grid"), grid_backup); } gtk_widget_destroy (dialog); break; default: - gimp_image_set_grid (GIMP_IMAGE (gimage), grid_backup, FALSE); + gimp_image_set_grid (GIMP_IMAGE (image), grid_backup, FALSE); gtk_widget_destroy (dialog); } } diff --git a/app/dialogs/grid-dialog.h b/app/dialogs/grid-dialog.h index a81558a2d1..d90ba45ced 100644 --- a/app/dialogs/grid-dialog.h +++ b/app/dialogs/grid-dialog.h @@ -22,7 +22,7 @@ #define __GRID_DIALOG_H__ -GtkWidget * grid_dialog_new (GimpImage *gimage, +GtkWidget * grid_dialog_new (GimpImage *image, GtkWidget *parent); diff --git a/app/dialogs/image-merge-layers-dialog.c b/app/dialogs/image-merge-layers-dialog.c index 5c7602b4b5..4dddd2ab46 100644 --- a/app/dialogs/image-merge-layers-dialog.c +++ b/app/dialogs/image-merge-layers-dialog.c @@ -51,7 +51,7 @@ image_merge_layers_dialog_new (GimpImage *image, dialog = g_new0 (ImageMergeLayersDialog, 1); - dialog->gimage = image; + dialog->image = image; dialog->context = context; dialog->merge_type = GIMP_EXPAND_AS_NECESSARY; diff --git a/app/dialogs/image-merge-layers-dialog.h b/app/dialogs/image-merge-layers-dialog.h index 3b384ef1dd..dbc19c6c2a 100644 --- a/app/dialogs/image-merge-layers-dialog.h +++ b/app/dialogs/image-merge-layers-dialog.h @@ -26,7 +26,7 @@ struct _ImageMergeLayersDialog { GtkWidget *dialog; - GimpImage *gimage; + GimpImage *image; GimpContext *context; GimpMergeType merge_type; }; diff --git a/app/dialogs/image-new-dialog.c b/app/dialogs/image-new-dialog.c index aaf300b839..890ec8bfe3 100644 --- a/app/dialogs/image-new-dialog.c +++ b/app/dialogs/image-new-dialog.c @@ -159,13 +159,13 @@ image_new_dialog_new (Gimp *gimp) void image_new_dialog_set (GtkWidget *widget, - GimpImage *gimage, + GimpImage *image, GimpTemplate *template) { ImageNewDialog *dialog; g_return_if_fail (GTK_IS_WIDGET (widget)); - g_return_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage)); + g_return_if_fail (image == NULL || GIMP_IS_IMAGE (image)); g_return_if_fail (template == NULL || GIMP_IS_TEMPLATE (template)); dialog = g_object_get_data (G_OBJECT (widget), "gimp-image-new-dialog"); @@ -179,7 +179,7 @@ image_new_dialog_set (GtkWidget *widget, } else { - template = gimp_image_new_get_last_template (dialog->gimp, gimage); + template = gimp_image_new_get_last_template (dialog->gimp, image); gimp_config_sync (G_OBJECT (template), G_OBJECT (dialog->template), 0); diff --git a/app/dialogs/image-new-dialog.h b/app/dialogs/image-new-dialog.h index 82a642fa5e..c0fe4db4d9 100644 --- a/app/dialogs/image-new-dialog.h +++ b/app/dialogs/image-new-dialog.h @@ -23,7 +23,7 @@ GtkWidget * image_new_dialog_new (Gimp *gimp); void image_new_dialog_set (GtkWidget *widget, - GimpImage *gimage, + GimpImage *image, GimpTemplate *template); diff --git a/app/dialogs/image-scale-dialog.c b/app/dialogs/image-scale-dialog.c index 4877fe67fe..8941765099 100644 --- a/app/dialogs/image-scale-dialog.c +++ b/app/dialogs/image-scale-dialog.c @@ -90,10 +90,10 @@ image_scale_dialog_new (GimpImage *image, if (! unit) unit = GIMP_DISPLAY_SHELL (display->shell)->unit; - dialog->gimage = image; + dialog->image = image; dialog->gdisp = display; dialog->context = context; - dialog->dialog = scale_dialog_new (GIMP_VIEWABLE (display->gimage), + dialog->dialog = scale_dialog_new (GIMP_VIEWABLE (display->image), _("Scale Image"), "gimp-image-scale", parent, gimp_standard_help_func, diff --git a/app/dialogs/image-scale-dialog.h b/app/dialogs/image-scale-dialog.h index f87e8afe11..12dd4eafea 100644 --- a/app/dialogs/image-scale-dialog.h +++ b/app/dialogs/image-scale-dialog.h @@ -28,7 +28,7 @@ struct _ImageScaleDialog { GtkWidget *dialog; - GimpImage *gimage; + GimpImage *image; GimpDisplay *gdisp; GimpContext *context; diff --git a/app/dialogs/layer-options-dialog.c b/app/dialogs/layer-options-dialog.c index 293587800b..9d779c20c8 100644 --- a/app/dialogs/layer-options-dialog.c +++ b/app/dialogs/layer-options-dialog.c @@ -48,7 +48,7 @@ static void layer_options_dialog_toggle_rename (GtkWidget *widget, /* public functions */ LayerOptionsDialog * -layer_options_dialog_new (GimpImage *gimage, +layer_options_dialog_new (GimpImage *image, GimpContext *context, GimpLayer *layer, GtkWidget *parent, @@ -72,16 +72,15 @@ layer_options_dialog_new (GimpImage *gimage, options = g_new0 (LayerOptionsDialog, 1); - options->gimage = gimage; + options->image = image; options->context = context; options->layer = layer; - options->fill_type = layer_fill_type; if (layer) viewable = GIMP_VIEWABLE (layer); else - viewable = GIMP_VIEWABLE (gimage); + viewable = GIMP_VIEWABLE (image); options->dialog = gimp_viewable_dialog_new (viewable, title, role, stock_id, desc, @@ -163,9 +162,9 @@ layer_options_dialog_new (GimpImage *gimage, GIMP_UNIT_PIXEL); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (options->size_se), 0, - gimage->xresolution, FALSE); + image->xresolution, FALSE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (options->size_se), 1, - gimage->yresolution, FALSE); + image->yresolution, FALSE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (options->size_se), 0, GIMP_MIN_IMAGE_SIZE, @@ -175,14 +174,14 @@ layer_options_dialog_new (GimpImage *gimage, GIMP_MAX_IMAGE_SIZE); gimp_size_entry_set_size (GIMP_SIZE_ENTRY (options->size_se), 0, - 0, gimage->width); + 0, image->width); gimp_size_entry_set_size (GIMP_SIZE_ENTRY (options->size_se), 1, - 0, gimage->height); + 0, image->height); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (options->size_se), 0, - gimage->width); + image->width); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (options->size_se), 1, - gimage->height); + image->height); /* The radio frame */ frame = gimp_enum_radio_frame_new_with_range (GIMP_TYPE_FILL_TYPE, diff --git a/app/dialogs/layer-options-dialog.h b/app/dialogs/layer-options-dialog.h index 41d57a55e4..cb5bedfad2 100644 --- a/app/dialogs/layer-options-dialog.h +++ b/app/dialogs/layer-options-dialog.h @@ -33,13 +33,13 @@ struct _LayerOptionsDialog gint xsize; gint ysize; - GimpImage *gimage; + GimpImage *image; GimpContext *context; GimpLayer *layer; }; -LayerOptionsDialog * layer_options_dialog_new (GimpImage *gimage, +LayerOptionsDialog * layer_options_dialog_new (GimpImage *image, GimpContext *context, GimpLayer *layer, GtkWidget *parent, diff --git a/app/dialogs/offset-dialog.c b/app/dialogs/offset-dialog.c index f2180f472e..0af8ab9419 100644 --- a/app/dialogs/offset-dialog.c +++ b/app/dialogs/offset-dialog.c @@ -56,7 +56,7 @@ struct _OffsetDialog GimpOffsetType fill_type; - GimpImage *gimage; + GimpImage *image; }; @@ -92,7 +92,7 @@ offset_dialog_new (GimpDrawable *drawable, dialog = g_new0 (OffsetDialog, 1); dialog->fill_type = gimp_drawable_has_alpha (drawable) | WRAP_AROUND; - dialog->gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + dialog->image = gimp_item_get_image (GIMP_ITEM (drawable)); if (GIMP_IS_LAYER (drawable)) title = _("Offset Layer"); @@ -181,21 +181,21 @@ offset_dialog_new (GimpDrawable *drawable, gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (dialog->off_se), GIMP_UNIT_PIXEL); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (dialog->off_se), 0, - dialog->gimage->xresolution, FALSE); + dialog->image->xresolution, FALSE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (dialog->off_se), 1, - dialog->gimage->yresolution, FALSE); + dialog->image->yresolution, FALSE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (dialog->off_se), 0, - -dialog->gimage->width, - dialog->gimage->width); + -dialog->image->width, + dialog->image->width); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (dialog->off_se), 1, - -dialog->gimage->height, - dialog->gimage->height); + -dialog->image->height, + dialog->image->height); gimp_size_entry_set_size (GIMP_SIZE_ENTRY (dialog->off_se), 0, - 0, dialog->gimage->width); + 0, dialog->image->width); gimp_size_entry_set_size (GIMP_SIZE_ENTRY (dialog->off_se), 1, - 0, dialog->gimage->height); + 0, dialog->image->height); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se), 0, 0); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se), 1, 0); @@ -242,14 +242,14 @@ offset_response (GtkWidget *widget, { if (response_id == GTK_RESPONSE_OK) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *drawable; gint offset_x; gint offset_y; - if ((gimage = dialog->gimage) != NULL) + if ((image = dialog->image) != NULL) { - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); offset_x = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (dialog->off_se), @@ -259,11 +259,11 @@ offset_response (GtkWidget *widget, 1)); gimp_drawable_offset (drawable, - gimp_get_user_context (gimage->gimp), + gimp_get_user_context (image->gimp), dialog->fill_type & WRAP_AROUND ? TRUE : FALSE, dialog->fill_type & FILL_MASK, offset_x, offset_y); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -274,10 +274,10 @@ static void offset_halfheight_callback (GtkWidget *widget, OffsetDialog *dialog) { - GimpImage *gimage = dialog->gimage; + GimpImage *image = dialog->image; gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se), - 0, gimage->width / 2); + 0, image->width / 2); gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se), - 1, gimage->height / 2); + 1, image->height / 2); } diff --git a/app/dialogs/palette-import-dialog.c b/app/dialogs/palette-import-dialog.c index f43cd04446..70c1f4a5d7 100644 --- a/app/dialogs/palette-import-dialog.c +++ b/app/dialogs/palette-import-dialog.c @@ -95,7 +95,7 @@ static void palette_import_gradient_changed (GimpContext *context, GimpGradient *gradient, ImportDialog *dialog); static void palette_import_image_changed (GimpContext *context, - GimpImage *gimage, + GimpImage *image, ImportDialog *dialog); static void palette_import_filename_changed (GimpFileEntry *file_entry, ImportDialog *dialog); @@ -113,10 +113,10 @@ static void palette_import_file_callback (GtkWidget *widget, static void palette_import_columns_changed (GtkAdjustment *adjustment, ImportDialog *dialog); static void palette_import_image_add (GimpContainer *container, - GimpImage *gimage, + GimpImage *image, ImportDialog *dialog); static void palette_import_image_remove (GimpContainer *container, - GimpImage *gimage, + GimpImage *image, ImportDialog *dialog); static void palette_import_make_palette (ImportDialog *dialog); @@ -468,17 +468,17 @@ palette_import_gradient_changed (GimpContext *context, static void palette_import_image_changed (GimpContext *context, - GimpImage *gimage, + GimpImage *image, ImportDialog *dialog) { - if (gimage && dialog->import_type == IMAGE_IMPORT) + if (image && dialog->import_type == IMAGE_IMPORT) { gchar *basename; gchar *label; basename = - file_utils_uri_display_basename (gimp_image_get_uri (gimage)); - label = g_strdup_printf ("%s-%d", basename, gimp_image_get_ID (gimage)); + file_utils_uri_display_basename (gimp_image_get_uri (image)); + label = g_strdup_printf ("%s-%d", basename, gimp_image_get_ID (image)); g_free (basename); gtk_entry_set_text (GTK_ENTRY (dialog->entry), label); @@ -580,17 +580,17 @@ static void palette_import_image_callback (GtkWidget *widget, ImportDialog *dialog) { - GimpImage *gimage; + GimpImage *image; if (! gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) return; dialog->import_type = IMAGE_IMPORT; - gimage = gimp_context_get_image (dialog->context); + image = gimp_context_get_image (dialog->context); - if (! gimage) - gimage = (GimpImage *) + if (! image) + image = (GimpImage *) gimp_container_get_child_by_index (dialog->context->gimp->images, 0); @@ -598,7 +598,7 @@ palette_import_image_callback (GtkWidget *widget, gtk_widget_set_sensitive (dialog->image_combo, TRUE); gtk_widget_set_sensitive (dialog->filename_entry, FALSE); - palette_import_image_changed (dialog->context, gimage, dialog); + palette_import_image_changed (dialog->context, image, dialog); gimp_scale_entry_set_sensitive (GTK_OBJECT (dialog->threshold), TRUE); gimp_scale_entry_set_sensitive (GTK_OBJECT (dialog->num_colors), TRUE); @@ -654,19 +654,19 @@ palette_import_columns_changed (GtkAdjustment *adj, static void palette_import_image_add (GimpContainer *container, - GimpImage *gimage, + GimpImage *image, ImportDialog *dialog) { if (! GTK_WIDGET_IS_SENSITIVE (dialog->image_radio)) { gtk_widget_set_sensitive (dialog->image_radio, TRUE); - gimp_context_set_image (dialog->context, gimage); + gimp_context_set_image (dialog->context, image); } } static void palette_import_image_remove (GimpContainer *container, - GimpImage *gimage, + GimpImage *image, ImportDialog *dialog) { if (! gimp_container_num_children (dialog->context->gimp->images)) @@ -714,16 +714,16 @@ palette_import_make_palette (ImportDialog *dialog) case IMAGE_IMPORT: { - GimpImage *gimage = gimp_context_get_image (dialog->context); + GimpImage *image = gimp_context_get_image (dialog->context); - if (gimp_image_base_type (gimage) == GIMP_INDEXED) + if (gimp_image_base_type (image) == GIMP_INDEXED) { - palette = gimp_palette_import_from_indexed_image (gimage, + palette = gimp_palette_import_from_indexed_image (image, palette_name); } else { - palette = gimp_palette_import_from_image (gimage, + palette = gimp_palette_import_from_image (image, palette_name, n_colors, threshold); diff --git a/app/dialogs/quit-dialog.c b/app/dialogs/quit-dialog.c index 8c8a8ff25c..b12560fd36 100644 --- a/app/dialogs/quit-dialog.c +++ b/app/dialogs/quit-dialog.c @@ -252,7 +252,7 @@ quit_close_all_dialog_image_activated (GimpContainerView *view, { GimpDisplay *display = list->data; - if (display->gimage == image) + if (display->image == image) gtk_window_present (GTK_WINDOW (display->shell)); } } diff --git a/app/dialogs/vectors-options-dialog.c b/app/dialogs/vectors-options-dialog.c index 6b2b81b1da..2b32ca2d34 100644 --- a/app/dialogs/vectors-options-dialog.c +++ b/app/dialogs/vectors-options-dialog.c @@ -40,7 +40,7 @@ /* public functions */ VectorsOptionsDialog * -vectors_options_dialog_new (GimpImage *gimage, +vectors_options_dialog_new (GimpImage *image, GimpVectors *vectors, GtkWidget *parent, const gchar *vectors_name, @@ -56,7 +56,7 @@ vectors_options_dialog_new (GimpImage *gimage, GtkWidget *vbox; GtkWidget *table; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + 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 (GTK_IS_WIDGET (parent), NULL); g_return_val_if_fail (title != NULL, NULL); @@ -67,13 +67,13 @@ vectors_options_dialog_new (GimpImage *gimage, options = g_new0 (VectorsOptionsDialog, 1); - options->gimage = gimage; + options->image = image; options->vectors = vectors; if (vectors) viewable = GIMP_VIEWABLE (vectors); else - viewable = GIMP_VIEWABLE (gimage); + viewable = GIMP_VIEWABLE (image); options->dialog = gimp_viewable_dialog_new (viewable, diff --git a/app/dialogs/vectors-options-dialog.h b/app/dialogs/vectors-options-dialog.h index 7bc5236702..718e2576f7 100644 --- a/app/dialogs/vectors-options-dialog.h +++ b/app/dialogs/vectors-options-dialog.h @@ -27,12 +27,12 @@ struct _VectorsOptionsDialog GtkWidget *dialog; GtkWidget *name_entry; - GimpImage *gimage; + GimpImage *image; GimpVectors *vectors; }; -VectorsOptionsDialog * vectors_options_dialog_new (GimpImage *gimage, +VectorsOptionsDialog * vectors_options_dialog_new (GimpImage *image, GimpVectors *vectors, GtkWidget *parent, const gchar *vectors_name, diff --git a/app/display/gimpdisplay-foreach.c b/app/display/gimpdisplay-foreach.c index cc856c86f2..c0bcbb7dc9 100644 --- a/app/display/gimpdisplay-foreach.c +++ b/app/display/gimpdisplay-foreach.c @@ -46,7 +46,7 @@ gimp_displays_dirty (Gimp *gimp) { GimpDisplay *display = list->data; - if (display->gimage->dirty) + if (display->image->dirty) return TRUE; } @@ -167,7 +167,7 @@ gimp_displays_reconnect (Gimp *gimp, g_return_if_fail (GIMP_IS_IMAGE (old)); g_return_if_fail (GIMP_IS_IMAGE (new)); - /* remember which contexts refer to old_gimage */ + /* remember which contexts refer to old_image */ for (list = gimp->context_list; list; list = g_list_next (list)) { GimpContext *context = list->data; @@ -182,11 +182,11 @@ gimp_displays_reconnect (Gimp *gimp, { GimpDisplay *gdisp = list->data; - if (gdisp->gimage == old) + if (gdisp->image == old) gimp_display_reconnect (gdisp, new); } - /* set the new_gimage on the remembered contexts (in reverse + /* set the new_image on the remembered contexts (in reverse * order, since older contexts are usually the parents of * newer ones) */ diff --git a/app/display/gimpdisplay-handlers.c b/app/display/gimpdisplay-handlers.c index 12b4ed116e..3c7cd33d5b 100644 --- a/app/display/gimpdisplay-handlers.c +++ b/app/display/gimpdisplay-handlers.c @@ -40,7 +40,7 @@ static void gimp_display_update_handler (GimpProjection *projection, gint w, gint h, GimpDisplay *gdisp); -static void gimp_display_flush_handler (GimpImage *gimage, +static void gimp_display_flush_handler (GimpImage *image, GimpDisplay *gdisp); @@ -48,29 +48,29 @@ static void gimp_display_flush_handler (GimpImage *gimage, void gimp_display_connect (GimpDisplay *gdisp, - GimpImage *gimage) + GimpImage *image) { g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); - g_return_if_fail (GIMP_IS_IMAGE (gimage)); - g_return_if_fail (gdisp->gimage == NULL); + g_return_if_fail (GIMP_IS_IMAGE (image)); + g_return_if_fail (gdisp->image == NULL); - gdisp->gimage = gimage; - gdisp->instance = gimage->instance_count; + gdisp->image = image; + gdisp->instance = image->instance_count; - gimage->instance_count++; /* this is obsolete */ - gimage->disp_count++; + image->instance_count++; /* this is obsolete */ + image->disp_count++; #if 0 - g_print ("%s: gimage->ref_count before refing: %d\n", - G_STRFUNC, G_OBJECT (gdisp->gimage)->ref_count); + g_print ("%s: image->ref_count before refing: %d\n", + G_STRFUNC, G_OBJECT (gdisp->image)->ref_count); #endif - g_object_ref (gimage); + g_object_ref (image); - g_signal_connect (gimage->projection, "update", + g_signal_connect (image->projection, "update", G_CALLBACK (gimp_display_update_handler), gdisp); - g_signal_connect (gimage, "flush", + g_signal_connect (image, "flush", G_CALLBACK (gimp_display_flush_handler), gdisp); } @@ -78,33 +78,33 @@ gimp_display_connect (GimpDisplay *gdisp, void gimp_display_disconnect (GimpDisplay *gdisp) { - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); - g_return_if_fail (GIMP_IS_IMAGE (gdisp->gimage)); + g_return_if_fail (GIMP_IS_IMAGE (gdisp->image)); - g_signal_handlers_disconnect_by_func (gdisp->gimage, + g_signal_handlers_disconnect_by_func (gdisp->image, gimp_display_flush_handler, gdisp); - g_signal_handlers_disconnect_by_func (gdisp->gimage->projection, + g_signal_handlers_disconnect_by_func (gdisp->image->projection, gimp_display_update_handler, gdisp); - gdisp->gimage->disp_count--; + gdisp->image->disp_count--; #if 0 - g_print ("%s: gimage->ref_count before unrefing: %d\n", - G_STRFUNC, G_OBJECT (gdisp->gimage)->ref_count); + g_print ("%s: image->ref_count before unrefing: %d\n", + G_STRFUNC, G_OBJECT (gdisp->image)->ref_count); #endif - /* set gdisp->gimage to NULL before unrefing because there may be code + /* set gdisp->image to NULL before unrefing because there may be code * that listens for image removals and then iterates the display list * to find a valid display. */ - gimage = gdisp->gimage; - gdisp->gimage = NULL; + image = gdisp->image; + gdisp->image = NULL; - g_object_unref (gimage); + g_object_unref (image); } @@ -123,7 +123,7 @@ gimp_display_update_handler (GimpProjection *projection, } static void -gimp_display_flush_handler (GimpImage *gimage, +gimp_display_flush_handler (GimpImage *image, GimpDisplay *gdisp) { gimp_display_flush (gdisp); diff --git a/app/display/gimpdisplay-handlers.h b/app/display/gimpdisplay-handlers.h index 93ec8b136d..b44eebcd12 100644 --- a/app/display/gimpdisplay-handlers.h +++ b/app/display/gimpdisplay-handlers.h @@ -21,7 +21,7 @@ void gimp_display_connect (GimpDisplay *gdisp, - GimpImage *gimage); + GimpImage *image); void gimp_display_disconnect (GimpDisplay *gdisp); diff --git a/app/display/gimpdisplay.c b/app/display/gimpdisplay.c index 68c0cafb36..246c7a1305 100644 --- a/app/display/gimpdisplay.c +++ b/app/display/gimpdisplay.c @@ -130,7 +130,7 @@ gimp_display_init (GimpDisplay *gdisp) { gdisp->ID = 0; - gdisp->gimage = NULL; + gdisp->image = NULL; gdisp->instance = 0; gdisp->shell = NULL; @@ -188,7 +188,7 @@ gimp_display_get_property (GObject *object, g_value_set_int (value, gdisp->ID); break; case PROP_IMAGE: - g_value_set_object (value, gdisp->gimage); + g_value_set_object (value, gdisp->image); break; case PROP_SHELL: g_value_set_object (value, gdisp->shell); @@ -324,7 +324,7 @@ gimp_display_progress_canceled (GimpProgress *progress, /* public functions */ GimpDisplay * -gimp_display_new (GimpImage *gimage, +gimp_display_new (GimpImage *image, GimpUnit unit, gdouble scale, GimpMenuFactory *menu_factory, @@ -332,18 +332,18 @@ gimp_display_new (GimpImage *gimage, { GimpDisplay *gdisp; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); /* If there isn't an interface, never create a gdisplay */ - if (gimage->gimp->no_interface) + if (image->gimp->no_interface) return NULL; gdisp = g_object_new (GIMP_TYPE_DISPLAY, - "id", gimage->gimp->next_display_ID++, + "id", image->gimp->next_display_ID++, NULL); /* refs the image */ - gimp_display_connect (gdisp, gimage); + gimp_display_connect (gdisp, image); /* create the shell for the image */ gdisp->shell = gimp_display_shell_new (gdisp, unit, scale, @@ -365,18 +365,18 @@ gimp_display_delete (GimpDisplay *gdisp) g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); /* remove the display from the list */ - gimp_container_remove (gdisp->gimage->gimp->displays, + gimp_container_remove (gdisp->image->gimp->displays, GIMP_OBJECT (gdisp)); /* stop any active tool */ - tool_manager_control_active (gdisp->gimage->gimp, HALT, gdisp); + tool_manager_control_active (gdisp->image->gimp, HALT, gdisp); - active_tool = tool_manager_get_active (gdisp->gimage->gimp); + active_tool = tool_manager_get_active (gdisp->image->gimp); if (active_tool) { if (active_tool->focus_display == gdisp) - tool_manager_focus_display_active (gdisp->gimage->gimp, NULL); + tool_manager_focus_display_active (gdisp->image->gimp, NULL); /* clear out the pointer to this gdisp from the active tool */ if (active_tool->gdisp == gdisp) @@ -401,7 +401,7 @@ gimp_display_delete (GimpDisplay *gdisp) gtk_widget_destroy (shell); } - /* unrefs the gimage */ + /* unrefs the image */ gimp_display_disconnect (gdisp); g_object_unref (gdisp); @@ -438,22 +438,22 @@ gimp_display_get_by_ID (Gimp *gimp, void gimp_display_reconnect (GimpDisplay *gdisp, - GimpImage *gimage) + GimpImage *image) { GimpImage *old_image; g_return_if_fail (GIMP_IS_DISPLAY (gdisp)); - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); /* stop any active tool */ - tool_manager_control_active (gdisp->gimage->gimp, HALT, gdisp); + tool_manager_control_active (gdisp->image->gimp, HALT, gdisp); gimp_display_shell_disconnect (GIMP_DISPLAY_SHELL (gdisp->shell)); - old_image = g_object_ref (gdisp->gimage); + old_image = g_object_ref (gdisp->image); gimp_display_disconnect (gdisp); - gimp_display_connect (gdisp, gimage); + gimp_display_connect (gdisp, image); g_object_unref (old_image); @@ -476,10 +476,10 @@ gimp_display_update_area (GimpDisplay *gdisp, } else { - GimpArea *area = gimp_area_new (CLAMP (x, 0, gdisp->gimage->width), - CLAMP (y, 0, gdisp->gimage->height), - CLAMP (x + w, 0, gdisp->gimage->width), - CLAMP (y + h, 0, gdisp->gimage->height)); + GimpArea *area = gimp_area_new (CLAMP (x, 0, gdisp->image->width), + CLAMP (y, 0, gdisp->image->height), + CLAMP (x + w, 0, gdisp->image->width), + CLAMP (y + h, 0, gdisp->image->height)); gdisp->update_areas = gimp_area_list_process (gdisp->update_areas, area); } @@ -544,10 +544,10 @@ gimp_display_paint_area (GimpDisplay *gdisp, gdouble x1_f, y1_f, x2_f, y2_f; /* Bounds check */ - x1 = CLAMP (x, 0, gdisp->gimage->width); - y1 = CLAMP (y, 0, gdisp->gimage->height); - x2 = CLAMP (x + w, 0, gdisp->gimage->width); - y2 = CLAMP (y + h, 0, gdisp->gimage->height); + x1 = CLAMP (x, 0, gdisp->image->width); + y1 = CLAMP (y, 0, gdisp->image->height); + x2 = CLAMP (x + w, 0, gdisp->image->width); + y2 = CLAMP (y + h, 0, gdisp->image->height); x = x1; y = y1; w = (x2 - x1); diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h index 7d0e98d097..f8f31274bf 100644 --- a/app/display/gimpdisplay.h +++ b/app/display/gimpdisplay.h @@ -39,9 +39,9 @@ struct _GimpDisplay gint ID; /* unique identifier for this gdisplay */ - GimpImage *gimage; /* pointer to the associated gimage */ + GimpImage *image; /* pointer to the associated image */ gint instance; /* the instance # of this gdisplay as */ - /* taken from the gimage at creation */ + /* taken from the image at creation */ GtkWidget *shell; /* shell widget for this gdisplay */ @@ -56,7 +56,7 @@ struct _GimpDisplayClass GType gimp_display_get_type (void) G_GNUC_CONST; -GimpDisplay * gimp_display_new (GimpImage *gimage, +GimpDisplay * gimp_display_new (GimpImage *image, GimpUnit unit, gdouble scale, GimpMenuFactory *menu_factory, @@ -68,7 +68,7 @@ GimpDisplay * gimp_display_get_by_ID (Gimp *gimp, gint ID); void gimp_display_reconnect (GimpDisplay *gdisp, - GimpImage *gimage); + GimpImage *image); void gimp_display_update_area (GimpDisplay *gdisp, gboolean now, diff --git a/app/display/gimpdisplayshell-appearance.c b/app/display/gimpdisplayshell-appearance.c index d4100f4587..99cdcd2a36 100644 --- a/app/display/gimpdisplayshell-appearance.c +++ b/app/display/gimpdisplayshell-appearance.c @@ -60,7 +60,7 @@ #define IS_ACTIVE_DISPLAY(shell) \ ((shell)->gdisp == \ gimp_context_get_display (gimp_get_user_context \ - ((shell)->gdisp->gimage->gimp))) + ((shell)->gdisp->image->gimp))) void @@ -340,7 +340,7 @@ gimp_display_shell_set_show_guides (GimpDisplayShell *shell, g_object_set (options, "show-guides", show, NULL); - if (shell->gdisp->gimage->guides) + if (shell->gdisp->image->guides) gimp_display_shell_expose_full (shell); SET_ACTIVE (shell->menubar_manager, "view-show-guides", show); @@ -369,7 +369,7 @@ gimp_display_shell_set_show_grid (GimpDisplayShell *shell, g_object_set (options, "show-grid", show, NULL); - if (shell->gdisp->gimage->grid) + if (shell->gdisp->image->grid) gimp_display_shell_expose_full (shell); SET_ACTIVE (shell->menubar_manager, "view-show-grid", show); @@ -398,7 +398,7 @@ gimp_display_shell_set_show_sample_points (GimpDisplayShell *shell, g_object_set (options, "show-sample-points", show, NULL); - if (shell->gdisp->gimage->sample_points) + if (shell->gdisp->image->sample_points) gimp_display_shell_expose_full (shell); SET_ACTIVE (shell->menubar_manager, "view-show-sample-points", show); diff --git a/app/display/gimpdisplayshell-autoscroll.c b/app/display/gimpdisplayshell-autoscroll.c index cef0240f63..5841c9dd20 100644 --- a/app/display/gimpdisplayshell-autoscroll.c +++ b/app/display/gimpdisplayshell-autoscroll.c @@ -133,7 +133,7 @@ gimp_display_shell_autoscroll_timeout (gpointer data) if (dx || dy) { GimpDisplay *gdisp = shell->gdisp; - GimpTool *active_tool = tool_manager_get_active (gdisp->gimage->gimp); + GimpTool *active_tool = tool_manager_get_active (gdisp->image->gimp); info->time += AUTOSCROLL_DT; @@ -158,7 +158,7 @@ gimp_display_shell_autoscroll_timeout (gpointer data) x, y, width, height); } - tool_manager_motion_active (gdisp->gimage->gimp, + tool_manager_motion_active (gdisp->image->gimp, &image_coords, info->time, info->state, gdisp); diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index 872c8d89bd..e213395b42 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -101,14 +101,14 @@ gimp_display_shell_events (GtkWidget *widget, GdkEvent *event, GimpDisplayShell *shell) { - Gimp *gimp; - gboolean set_display = FALSE; + Gimp *gimp; + gboolean set_display = FALSE; /* are we in destruction? */ if (! shell->gdisp || ! shell->gdisp->shell) return TRUE; - gimp = shell->gdisp->gimage->gimp; + gimp = shell->gdisp->image->gimp; switch (event->type) { @@ -252,7 +252,7 @@ gimp_display_shell_events (GtkWidget *widget, if (set_display) { - Gimp *gimp = shell->gdisp->gimage->gimp; + Gimp *gimp = shell->gdisp->image->gimp; /* Setting the context's display automatically sets the image, too */ gimp_context_set_display (gimp_get_user_context (gimp), shell->gdisp); @@ -271,7 +271,7 @@ gimp_display_shell_canvas_realize (GtkWidget *canvas, GimpRGB padding_color; gdisp = shell->gdisp; - config = GIMP_DISPLAY_CONFIG (gdisp->gimage->gimp->config); + config = GIMP_DISPLAY_CONFIG (gdisp->image->gimp->config); gtk_widget_grab_focus (shell->canvas); @@ -438,7 +438,7 @@ gimp_display_shell_check_device_cursor (GimpDisplayShell *shell) { GdkDevice *current_device; - current_device = gimp_devices_get_current (shell->gdisp->gimage->gimp); + current_device = gimp_devices_get_current (shell->gdisp->image->gimp); shell->draw_cursor = ! current_device->has_cursor; } @@ -449,7 +449,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, GimpDisplayShell *shell) { GimpDisplay *gdisp; - GimpImage *gimage; + GimpImage *image; Gimp *gimp; GdkDisplay *gdk_display; GimpTool *active_tool; @@ -472,9 +472,9 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, if (gimp_display_shell_events (canvas, event, shell)) return TRUE; - gdisp = shell->gdisp; - gimage = gdisp->gimage; - gimp = gimage->gimp; + gdisp = shell->gdisp; + image = gdisp->image; + gimp = image->gimp; gdk_display = gtk_widget_get_display (canvas); @@ -638,7 +638,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, if (active_tool) { - if ((! gimp_image_is_empty (gimage) || + if ((! gimp_image_is_empty (image) || gimp_tool_control_get_handle_empty_image (active_tool->control)) && (bevent->button == 1 || bevent->button == 2 || @@ -648,7 +648,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, &image_coords, state, gdisp); } - else if (gimp_image_is_empty (gimage) && + else if (gimp_image_is_empty (image) && ! gimp_tool_control_get_handle_empty_image (active_tool->control)) { gimp_display_shell_set_cursor (shell, @@ -709,7 +709,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, gdk_keyboard_grab (canvas->window, FALSE, time); if (active_tool && - (! gimp_image_is_empty (gimage) || + (! gimp_image_is_empty (image) || gimp_tool_control_get_handle_empty_image (active_tool->control))) { gboolean initialized = TRUE; @@ -721,7 +721,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, initialized = tool_manager_initialize_active (gimp, gdisp); } else if ((active_tool->drawable != - gimp_image_active_drawable (gimage)) && + gimp_image_active_drawable (image)) && ! gimp_tool_control_get_preserve (active_tool->control)) { /* create a new one, deleting the current @@ -793,7 +793,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, gtk_grab_add (canvas); if (active_tool && - (! gimp_image_is_empty (gimage) || + (! gimp_image_is_empty (image) || gimp_tool_control_get_handle_empty_image (active_tool->control))) { if (gimp_tool_control_is_active (active_tool->control)) @@ -1035,7 +1035,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, { if (active_tool && gimp_tool_control_is_active (active_tool->control) && - (! gimp_image_is_empty (gimage) || + (! gimp_image_is_empty (image) || gimp_tool_control_get_handle_empty_image (active_tool->control))) { GdkTimeCoord **history_events; @@ -1149,7 +1149,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, case GDK_Right: case GDK_Up: case GDK_Down: - if (gimp_image_is_empty (gimage) || + if (gimp_image_is_empty (image) || ! tool_manager_key_press_active (gimp, kevent, gdisp)) @@ -1207,7 +1207,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, case GDK_ISO_Left_Tab: if (state & GDK_CONTROL_MASK) { - if (! gimp_image_is_empty (gimage)) + if (! gimp_image_is_empty (image)) { if (kevent->keyval == GDK_Tab) gimp_display_shell_layer_select_init (shell, @@ -1239,7 +1239,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, * oper_update method so tools can choose if they are interested * in the release itself or only in the resulting state */ - if (! gimp_image_is_empty (gimage)) + if (! gimp_image_is_empty (image)) tool_manager_modifier_state_active (gimp, state, gdisp); } @@ -1297,7 +1297,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, * oper_update method so tools can choose if they are interested * in the press itself or only in the resulting state */ - if (! gimp_image_is_empty (gimage)) + if (! gimp_image_is_empty (image)) tool_manager_modifier_state_active (gimp, state, gdisp); } @@ -1327,7 +1327,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, if (active_tool) { - if ((! gimp_image_is_empty (gimage) || + if ((! gimp_image_is_empty (image) || gimp_tool_control_get_handle_empty_image (active_tool->control)) && ! (state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | @@ -1337,7 +1337,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, &image_coords, state, gdisp); } - else if (gimp_image_is_empty (gimage) && + else if (gimp_image_is_empty (image) && ! gimp_tool_control_get_handle_empty_image (active_tool->control)) { gimp_display_shell_set_cursor (shell, @@ -1373,7 +1373,7 @@ gimp_display_shell_ruler_button_press (GtkWidget *widget, { GimpDisplay *gdisp = shell->gdisp; - if (gdisp->gimage->gimp->busy) + if (gdisp->image->gimp->busy) return TRUE; if (event->type == GDK_BUTTON_PRESS && event->button == 1) @@ -1381,7 +1381,7 @@ gimp_display_shell_ruler_button_press (GtkWidget *widget, GimpTool *active_tool; gboolean sample_point; - active_tool = tool_manager_get_active (gdisp->gimage->gimp); + active_tool = tool_manager_get_active (gdisp->image->gimp); sample_point = (event->state & GDK_CONTROL_MASK); if (! ((sample_point && GIMP_IS_COLOR_TOOL (active_tool)) || @@ -1390,17 +1390,17 @@ gimp_display_shell_ruler_button_press (GtkWidget *widget, GimpToolInfo *tool_info; tool_info = (GimpToolInfo *) - gimp_container_get_child_by_name (gdisp->gimage->gimp->tool_info_list, + gimp_container_get_child_by_name (gdisp->image->gimp->tool_info_list, sample_point ? "gimp-color-picker-tool" : "gimp-move-tool"); if (tool_info) - gimp_context_set_tool (gimp_get_user_context (gdisp->gimage->gimp), + gimp_context_set_tool (gimp_get_user_context (gdisp->image->gimp), tool_info); } - active_tool = tool_manager_get_active (gdisp->gimage->gimp); + active_tool = tool_manager_get_active (gdisp->image->gimp); if (active_tool) { @@ -1445,7 +1445,7 @@ gimp_display_shell_origin_button_press (GtkWidget *widget, GdkEventButton *event, GimpDisplayShell *shell) { - if (! shell->gdisp->gimage->gimp->busy) + if (! shell->gdisp->image->gimp->busy) { if (event->button == 1) { @@ -1483,12 +1483,12 @@ gimp_display_shell_quick_mask_toggled (GtkWidget *widget, GimpDisplayShell *shell) { if (GTK_TOGGLE_BUTTON (widget)->active != - gimp_image_get_quick_mask_state (shell->gdisp->gimage)) + gimp_image_get_quick_mask_state (shell->gdisp->image)) { - gimp_image_set_quick_mask_state (shell->gdisp->gimage, + gimp_image_set_quick_mask_state (shell->gdisp->image, GTK_TOGGLE_BUTTON (widget)->active); - gimp_image_flush (shell->gdisp->gimage); + gimp_image_flush (shell->gdisp->image); } } diff --git a/app/display/gimpdisplayshell-close.c b/app/display/gimpdisplayshell-close.c index 9e0f77a066..4b2e48481f 100644 --- a/app/display/gimpdisplayshell-close.c +++ b/app/display/gimpdisplayshell-close.c @@ -48,7 +48,7 @@ /* local function prototypes */ static void gimp_display_shell_close_dialog (GimpDisplayShell *shell, - GimpImage *gimage); + GimpImage *image); static void gimp_display_shell_close_name_changed (GimpImage *image, GimpMessageBox *box); static gboolean gimp_display_shell_close_time_changed (GimpMessageBox *box); @@ -65,28 +65,28 @@ void gimp_display_shell_close (GimpDisplayShell *shell, gboolean kill_it) { - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - gimage = shell->gdisp->gimage; + image = shell->gdisp->image; /* FIXME: gimp_busy HACK not really appropriate here because we only * want to prevent the busy image and display to be closed. --Mitch */ - if (gimage->gimp->busy) + if (image->gimp->busy) return; /* If the image has been modified, give the user a chance to save * it before nuking it--this only applies if its the last view - * to an image canvas. (a gimage with disp_count = 1) + * to an image canvas. (a image with disp_count = 1) */ - if (! kill_it && - gimage->disp_count == 1 && - gimage->dirty && - GIMP_DISPLAY_CONFIG (gimage->gimp->config)->confirm_on_close) + if (! kill_it && + image->disp_count == 1 && + image->dirty && + GIMP_DISPLAY_CONFIG (image->gimp->config)->confirm_on_close) { - gimp_display_shell_close_dialog (shell, gimage); + gimp_display_shell_close_dialog (shell, image); } else { @@ -102,7 +102,7 @@ gimp_display_shell_close (GimpDisplayShell *shell, static void gimp_display_shell_close_dialog (GimpDisplayShell *shell, - GimpImage *gimage) + GimpImage *image) { GtkWidget *dialog; GtkWidget *button; @@ -118,7 +118,7 @@ gimp_display_shell_close_dialog (GimpDisplayShell *shell, return; } - name = file_utils_uri_display_basename (gimp_image_get_uri (gimage)); + name = file_utils_uri_display_basename (gimp_image_get_uri (image)); title = g_strdup_printf (_("Close %s"), name); g_free (name); @@ -160,11 +160,11 @@ gimp_display_shell_close_dialog (GimpDisplayShell *shell, box = GIMP_MESSAGE_DIALOG (dialog)->box; - g_signal_connect_object (gimage, "name-changed", + g_signal_connect_object (image, "name-changed", G_CALLBACK (gimp_display_shell_close_name_changed), box, 0); - gimp_display_shell_close_name_changed (gimage, box); + gimp_display_shell_close_name_changed (image, box); closure = g_cclosure_new_object (G_CALLBACK (gimp_display_shell_close_time_changed), @@ -178,7 +178,7 @@ gimp_display_shell_close_dialog (GimpDisplayShell *shell, /* The dialog is destroyed with the shell, so it should be safe * to hold an image pointer for the lifetime of the dialog. */ - g_object_set_data (G_OBJECT (box), "gimp-image", gimage); + g_object_set_data (G_OBJECT (box), "gimp-image", image); gimp_display_shell_close_time_changed (box); @@ -257,7 +257,7 @@ gimp_display_shell_close_response (GtkWidget *widget, gtk_action_activate (action); - if (! shell->gdisp->gimage->dirty) + if (! shell->gdisp->image->dirty) gimp_display_delete (shell->gdisp); } break; diff --git a/app/display/gimpdisplayshell-cursor.c b/app/display/gimpdisplayshell-cursor.c index cd3644a319..90373ded2f 100644 --- a/app/display/gimpdisplayshell-cursor.c +++ b/app/display/gimpdisplayshell-cursor.c @@ -109,7 +109,7 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell, gint image_x, gint image_y) { - GimpImage *gimage; + GimpImage *image; gboolean new_cursor; gint t_x = -1; gint t_y = -1; @@ -120,7 +120,7 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell, g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - gimage = shell->gdisp->gimage; + image = shell->gdisp->image; new_cursor = (shell->draw_cursor && shell->proximity && @@ -164,7 +164,7 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell, if (cursor_view) gimp_cursor_view_update_cursor (GIMP_CURSOR_VIEW (cursor_view), - shell->gdisp->gimage, shell->unit, + shell->gdisp->image, shell->unit, t_x, t_y); } @@ -202,7 +202,7 @@ gimp_display_shell_real_set_cursor (GimpDisplayShell *shell, g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config); + config = GIMP_DISPLAY_CONFIG (shell->gdisp->image->gimp->config); if (cursor_type != GIMP_CURSOR_NONE && cursor_type != GIMP_CURSOR_BAD) diff --git a/app/display/gimpdisplayshell-dnd.c b/app/display/gimpdisplayshell-dnd.c index be477b4e36..f668030d7a 100644 --- a/app/display/gimpdisplayshell-dnd.c +++ b/app/display/gimpdisplayshell-dnd.c @@ -171,14 +171,14 @@ gimp_display_shell_drop_drawable (GtkWidget *widget, GimpViewable *viewable, gpointer data) { - GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); - GimpImage *gimage = shell->gdisp->gimage; + GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); + GimpImage *image = shell->gdisp->image; GType new_type; GimpItem *new_item; D (g_print ("drop drawable on canvas\n")); - if (gimage->gimp->busy) + if (image->gimp->busy) return; if (GIMP_IS_LAYER (viewable)) @@ -186,7 +186,7 @@ gimp_display_shell_drop_drawable (GtkWidget *widget, else new_type = GIMP_TYPE_LAYER; - new_item = gimp_item_convert (GIMP_ITEM (viewable), gimage, new_type, TRUE); + new_item = gimp_item_convert (GIMP_ITEM (viewable), image, new_type, TRUE); if (new_item) { @@ -196,7 +196,7 @@ gimp_display_shell_drop_drawable (GtkWidget *widget, new_layer = GIMP_LAYER (new_item); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, _("Drop New Layer")); gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height); @@ -208,13 +208,13 @@ gimp_display_shell_drop_drawable (GtkWidget *widget, gimp_item_translate (new_item, off_x, off_y, FALSE); - gimp_image_add_layer (gimage, new_layer, -1); + gimp_image_add_layer (image, new_layer, -1); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_image_flush (gimage); + gimp_image_flush (image); - gimp_context_set_display (gimp_get_user_context (gimage->gimp), + gimp_context_set_display (gimp_get_user_context (image->gimp), shell->gdisp); } } @@ -226,32 +226,32 @@ gimp_display_shell_drop_vectors (GtkWidget *widget, GimpViewable *viewable, gpointer data) { - GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); - GimpImage *gimage = shell->gdisp->gimage; + GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); + GimpImage *image = shell->gdisp->image; GimpItem *new_item; D (g_print ("drop vectors on canvas\n")); - if (gimage->gimp->busy) + if (image->gimp->busy) return; - new_item = gimp_item_convert (GIMP_ITEM (viewable), gimage, + new_item = gimp_item_convert (GIMP_ITEM (viewable), image, G_TYPE_FROM_INSTANCE (viewable), TRUE); if (new_item) { GimpVectors *new_vectors = GIMP_VECTORS (new_item); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, _("Drop New Path")); - gimp_image_add_vectors (gimage, new_vectors, -1); + gimp_image_add_vectors (image, new_vectors, -1); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_image_flush (gimage); + gimp_image_flush (image); - gimp_context_set_display (gimp_get_user_context (gimage->gimp), + gimp_context_set_display (gimp_get_user_context (image->gimp), shell->gdisp); } } @@ -264,16 +264,16 @@ gimp_display_shell_drop_svg (GtkWidget *widget, gsize svg_data_len, gpointer data) { - GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); - GimpImage *gimage = shell->gdisp->gimage; + GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); + GimpImage *image = shell->gdisp->image; GError *error = NULL; D (g_print ("drop SVG on canvas\n")); - if (gimage->gimp->busy) + if (image->gimp->busy) return; - if (! gimp_vectors_import_buffer (gimage, + if (! gimp_vectors_import_buffer (image, (const gchar *) svg_data, svg_data_len, TRUE, TRUE, -1, &error)) { @@ -282,9 +282,9 @@ gimp_display_shell_drop_svg (GtkWidget *widget, } else { - gimp_image_flush (gimage); + gimp_image_flush (image); - gimp_context_set_display (gimp_get_user_context (gimage->gimp), + gimp_context_set_display (gimp_get_user_context (image->gimp), shell->gdisp); } } @@ -295,13 +295,13 @@ gimp_display_shell_bucket_fill (GimpDisplayShell *shell, const GimpRGB *color, GimpPattern *pattern) { - GimpImage *gimage = shell->gdisp->gimage; + GimpImage *image = shell->gdisp->image; GimpDrawable *drawable; - if (gimage->gimp->busy) + if (image->gimp->busy) return; - drawable = gimp_image_active_drawable (gimage); + drawable = gimp_image_active_drawable (image); if (! drawable) return; @@ -326,9 +326,9 @@ gimp_display_shell_bucket_fill (GimpDisplayShell *shell, color, pattern); } - gimp_image_flush (gimage); + gimp_image_flush (image); - gimp_context_set_display (gimp_get_user_context (gimage->gimp), + gimp_context_set_display (gimp_get_user_context (image->gimp), shell->gdisp); } @@ -368,14 +368,14 @@ gimp_display_shell_drop_buffer (GtkWidget *widget, GimpViewable *viewable, gpointer data) { - GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); - GimpImage *gimage = shell->gdisp->gimage; + GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); + GimpImage *image = shell->gdisp->image; GimpBuffer *buffer; gint x, y, width, height; D (g_print ("drop buffer on canvas\n")); - if (gimage->gimp->busy) + if (image->gimp->busy) return; buffer = GIMP_BUFFER (viewable); @@ -384,13 +384,13 @@ gimp_display_shell_drop_buffer (GtkWidget *widget, /* FIXME: popup a menu for selecting "Paste Into" */ - gimp_edit_paste (gimage, gimp_image_active_drawable (gimage), + gimp_edit_paste (image, gimp_image_active_drawable (image), buffer, FALSE, x, y, width, height); - gimp_image_flush (gimage); + gimp_image_flush (image); - gimp_context_set_display (gimp_get_user_context (gimage->gimp), + gimp_context_set_display (gimp_get_user_context (image->gimp), shell->gdisp); } @@ -401,14 +401,14 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget, GList *uri_list, gpointer data) { - GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); - GimpImage *gimage = shell->gdisp->gimage; + GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); + GimpImage *image = shell->gdisp->image; GimpContext *context; GList *list; D (g_print ("drop uri list on canvas\n")); - context = gimp_get_user_context (gimage->gimp); + context = gimp_get_user_context (image->gimp); for (list = uri_list; list; list = g_list_next (list)) { @@ -417,9 +417,9 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget, GimpPDBStatusType status; GError *error = NULL; - new_layer = file_open_layer (gimage->gimp, context, + new_layer = file_open_layer (image->gimp, context, GIMP_PROGRESS (shell->statusbar), - gimage, uri, GIMP_RUN_INTERACTIVE, NULL, + image, uri, GIMP_RUN_INTERACTIVE, NULL, &status, &error); if (new_layer) @@ -439,7 +439,7 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget, gimp_item_translate (new_item, off_x, off_y, FALSE); - gimp_image_add_layer (gimage, new_layer, -1); + gimp_image_add_layer (image, new_layer, -1); } else if (status != GIMP_PDB_CANCEL) { @@ -453,7 +453,7 @@ gimp_display_shell_drop_uri_list (GtkWidget *widget, } } - gimp_image_flush (gimage); + gimp_image_flush (image); gimp_context_set_display (context, shell->gdisp); } @@ -467,7 +467,7 @@ gimp_display_shell_drop_component (GtkWidget *widget, gpointer data) { GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); - GimpImage *dest_image = shell->gdisp->gimage; + GimpImage *dest_image = shell->gdisp->image; GimpChannel *channel; GimpItem *new_item; const gchar *desc; @@ -527,18 +527,18 @@ gimp_display_shell_drop_pixbuf (GtkWidget *widget, GdkPixbuf *pixbuf, gpointer data) { - GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); - GimpImage *gimage = shell->gdisp->gimage; + GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (data); + GimpImage *image = shell->gdisp->image; GimpLayer *new_layer; D (g_print ("drop pixbuf on canvas\n")); - if (gimage->gimp->busy) + if (image->gimp->busy) return; new_layer = - gimp_layer_new_from_pixbuf (pixbuf, gimage, - gimp_image_base_type_with_alpha (gimage), + gimp_layer_new_from_pixbuf (pixbuf, image, + gimp_image_base_type_with_alpha (image), _("Dropped Buffer"), GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE); @@ -550,7 +550,7 @@ gimp_display_shell_drop_pixbuf (GtkWidget *widget, new_item = GIMP_ITEM (new_layer); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_EDIT_PASTE, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_EDIT_PASTE, _("Drop New Layer")); gimp_display_shell_untransform_viewport (shell, &x, &y, &width, &height); @@ -562,13 +562,13 @@ gimp_display_shell_drop_pixbuf (GtkWidget *widget, gimp_item_translate (new_item, off_x, off_y, FALSE); - gimp_image_add_layer (gimage, new_layer, -1); + gimp_image_add_layer (image, new_layer, -1); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); - gimp_image_flush (gimage); + gimp_image_flush (image); - gimp_context_set_display (gimp_get_user_context (gimage->gimp), + gimp_context_set_display (gimp_get_user_context (image->gimp), shell->gdisp); } } diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 47c273685b..aea4329fd3 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -74,8 +74,8 @@ gimp_display_shell_draw_guide (GimpDisplayShell *shell, gimp_display_shell_transform_xy (shell, 0, 0, &x1, &y1, FALSE); gimp_display_shell_transform_xy (shell, - shell->gdisp->gimage->width, - shell->gdisp->gimage->height, + shell->gdisp->image->width, + shell->gdisp->image->height, &x2, &y2, FALSE); gdk_drawable_get_size (shell->canvas->window, &w, &h); @@ -118,7 +118,7 @@ gimp_display_shell_draw_guides (GimpDisplayShell *shell) { GList *list; - for (list = shell->gdisp->gimage->guides; + for (list = shell->gdisp->image->guides; list; list = g_list_next (list)) { @@ -149,7 +149,7 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell, #define CROSSHAIR 2 - grid = GIMP_GRID (shell->gdisp->gimage->grid); + grid = GIMP_GRID (shell->gdisp->image->grid); if (! grid) return; @@ -160,8 +160,8 @@ gimp_display_shell_draw_grid (GimpDisplayShell *shell, x2 = area->x + area->width; y2 = area->y + area->height; - width = shell->gdisp->gimage->width; - height = shell->gdisp->gimage->height; + width = shell->gdisp->image->width; + height = shell->gdisp->image->height; x_offset = grid->xoffset; while (x_offset > 0) @@ -407,7 +407,7 @@ gimp_display_shell_draw_sample_point (GimpDisplayShell *shell, gimp_canvas_draw_text (GIMP_CANVAS (shell->canvas), style, x + 2, y + 2, "%d", - g_list_index (shell->gdisp->gimage->sample_points, + g_list_index (shell->gdisp->image->sample_points, sample_point) + 1); } @@ -420,7 +420,7 @@ gimp_display_shell_draw_sample_points (GimpDisplayShell *shell) { GList *list; - for (list = shell->gdisp->gimage->sample_points; + for (list = shell->gdisp->image->sample_points; list; list = g_list_next (list)) { @@ -487,7 +487,7 @@ gimp_display_shell_draw_vectors (GimpDisplayShell *shell) { GList *list; - for (list = GIMP_LIST (shell->gdisp->gimage->vectors)->list; + for (list = GIMP_LIST (shell->gdisp->image->vectors)->list; list; list = list->next) { @@ -524,8 +524,8 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell, /* the image's size in display coordinates */ sx = shell->disp_xoffset > 0 ? shell->disp_xoffset : - shell->offset_x; sy = shell->disp_yoffset > 0 ? shell->disp_yoffset : - shell->offset_y; - sw = SCALEX (shell, shell->gdisp->gimage->width); - sh = SCALEY (shell, shell->gdisp->gimage->height); + sw = SCALEX (shell, shell->gdisp->image->width); + sh = SCALEY (shell, shell->gdisp->image->height); /* check if the passed in area intersects with * both the display and the image @@ -572,7 +572,7 @@ gimp_display_shell_draw_area (GimpDisplayShell *shell, #ifdef STRESS_TEST /* Invalidate the projection just after we render it! */ - gimp_image_invalidate_without_render (shell->gdisp->gimage, + gimp_image_invalidate_without_render (shell->gdisp->image, j - shell->disp_xoffset, i - shell->disp_yoffset, dx, dy, diff --git a/app/display/gimpdisplayshell-filter-dialog.c b/app/display/gimpdisplayshell-filter-dialog.c index bafb8c8197..c197c26f5c 100644 --- a/app/display/gimpdisplayshell-filter-dialog.c +++ b/app/display/gimpdisplayshell-filter-dialog.c @@ -69,7 +69,7 @@ gimp_display_shell_filter_dialog_new (GimpDisplayShell *shell) cdd = g_new0 (ColorDisplayDialog, 1); cdd->shell = shell; - cdd->dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage), + cdd->dialog = gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->image), _("Color Display Filters"), "gimp-display-filters", GIMP_STOCK_DISPLAY_FILTER, diff --git a/app/display/gimpdisplayshell-handlers.c b/app/display/gimpdisplayshell-handlers.c index 3dc32ecdbc..339591327d 100644 --- a/app/display/gimpdisplayshell-handlers.c +++ b/app/display/gimpdisplayshell-handlers.c @@ -49,34 +49,34 @@ /* local function prototypes */ -static void gimp_display_shell_clean_dirty_handler (GimpImage *gimage, +static void gimp_display_shell_clean_dirty_handler (GimpImage *image, GimpDirtyMask dirty_mask, GimpDisplayShell *shell); -static void gimp_display_shell_undo_event_handler (GimpImage *gimage, +static void gimp_display_shell_undo_event_handler (GimpImage *image, GimpUndoEvent event, GimpUndo *undo, GimpDisplayShell *shell); static void gimp_display_shell_grid_notify_handler (GimpGrid *grid, GParamSpec *pspec, GimpDisplayShell *shell); -static void gimp_display_shell_name_changed_handler (GimpImage *gimage, +static void gimp_display_shell_name_changed_handler (GimpImage *image, GimpDisplayShell *shell); -static void gimp_display_shell_selection_control_handler (GimpImage *gimage, +static void gimp_display_shell_selection_control_handler (GimpImage *image, GimpSelectionControl control, GimpDisplayShell *shell); -static void gimp_display_shell_size_changed_handler (GimpImage *gimage, +static void gimp_display_shell_size_changed_handler (GimpImage *image, GimpDisplayShell *shell); -static void gimp_display_shell_resolution_changed_handler (GimpImage *gimage, +static void gimp_display_shell_resolution_changed_handler (GimpImage *image, GimpDisplayShell *shell); -static void gimp_display_shell_quick_mask_changed_handler (GimpImage *gimage, +static void gimp_display_shell_quick_mask_changed_handler (GimpImage *image, GimpDisplayShell *shell); -static void gimp_display_shell_update_guide_handler (GimpImage *gimage, +static void gimp_display_shell_update_guide_handler (GimpImage *image, GimpGuide *guide, GimpDisplayShell *shell); -static void gimp_display_shell_update_sample_point_handler(GimpImage *gimage, +static void gimp_display_shell_update_sample_point_handler(GimpImage *image, GimpSamplePoint *sample_point, GimpDisplayShell *shell); -static void gimp_display_shell_invalidate_preview_handler (GimpImage *gimage, +static void gimp_display_shell_invalidate_preview_handler (GimpImage *image, GimpDisplayShell *shell); static void gimp_display_shell_vectors_freeze_handler (GimpVectors *vectors, @@ -119,104 +119,104 @@ static gboolean gimp_display_shell_idle_update_icon (gpointer d void gimp_display_shell_connect (GimpDisplayShell *shell) { - GimpImage *gimage; + GimpImage *image; GimpDisplayConfig *display_config; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); g_return_if_fail (GIMP_IS_DISPLAY (shell->gdisp)); - g_return_if_fail (GIMP_IS_IMAGE (shell->gdisp->gimage)); + g_return_if_fail (GIMP_IS_IMAGE (shell->gdisp->image)); - gimage = shell->gdisp->gimage; + image = shell->gdisp->image; - display_config = GIMP_DISPLAY_CONFIG (gimage->gimp->config); + display_config = GIMP_DISPLAY_CONFIG (image->gimp->config); - g_signal_connect (gimage, "clean", + g_signal_connect (image, "clean", G_CALLBACK (gimp_display_shell_clean_dirty_handler), shell); - g_signal_connect (gimage, "dirty", + g_signal_connect (image, "dirty", G_CALLBACK (gimp_display_shell_clean_dirty_handler), shell); - g_signal_connect (gimage, "undo-event", + g_signal_connect (image, "undo-event", G_CALLBACK (gimp_display_shell_undo_event_handler), shell); - g_signal_connect (gimage->grid, "notify", + g_signal_connect (image->grid, "notify", G_CALLBACK (gimp_display_shell_grid_notify_handler), shell); - g_signal_connect (gimage, "name-changed", + g_signal_connect (image, "name-changed", G_CALLBACK (gimp_display_shell_name_changed_handler), shell); - g_signal_connect (gimage, "selection-control", + g_signal_connect (image, "selection-control", G_CALLBACK (gimp_display_shell_selection_control_handler), shell); - g_signal_connect (gimage, "size-changed", + g_signal_connect (image, "size-changed", G_CALLBACK (gimp_display_shell_size_changed_handler), shell); - g_signal_connect (gimage, "resolution-changed", + g_signal_connect (image, "resolution-changed", G_CALLBACK (gimp_display_shell_resolution_changed_handler), shell); - g_signal_connect (gimage, "quick-mask-changed", + g_signal_connect (image, "quick-mask-changed", G_CALLBACK (gimp_display_shell_quick_mask_changed_handler), shell); - g_signal_connect (gimage, "update-guide", + g_signal_connect (image, "update-guide", G_CALLBACK (gimp_display_shell_update_guide_handler), shell); - g_signal_connect (gimage, "update-sample-point", + g_signal_connect (image, "update-sample-point", G_CALLBACK (gimp_display_shell_update_sample_point_handler), shell); - g_signal_connect (gimage, "invalidate-preview", + g_signal_connect (image, "invalidate-preview", G_CALLBACK (gimp_display_shell_invalidate_preview_handler), shell); shell->vectors_freeze_handler = - gimp_container_add_handler (gimage->vectors, "freeze", + gimp_container_add_handler (image->vectors, "freeze", G_CALLBACK (gimp_display_shell_vectors_freeze_handler), shell); shell->vectors_thaw_handler = - gimp_container_add_handler (gimage->vectors, "thaw", + gimp_container_add_handler (image->vectors, "thaw", G_CALLBACK (gimp_display_shell_vectors_thaw_handler), shell); shell->vectors_visible_handler = - gimp_container_add_handler (gimage->vectors, "visibility-changed", + gimp_container_add_handler (image->vectors, "visibility-changed", G_CALLBACK (gimp_display_shell_vectors_visible_handler), shell); - g_signal_connect (gimage->vectors, "add", + g_signal_connect (image->vectors, "add", G_CALLBACK (gimp_display_shell_vectors_add_handler), shell); - g_signal_connect (gimage->vectors, "remove", + g_signal_connect (image->vectors, "remove", G_CALLBACK (gimp_display_shell_vectors_remove_handler), shell); - g_signal_connect (gimage->gimp->config, + g_signal_connect (image->gimp->config, "notify::transparency-size", G_CALLBACK (gimp_display_shell_check_notify_handler), shell); - g_signal_connect (gimage->gimp->config, + g_signal_connect (image->gimp->config, "notify::transparency-type", G_CALLBACK (gimp_display_shell_check_notify_handler), shell); - g_signal_connect (gimage->gimp->config, + g_signal_connect (image->gimp->config, "notify::image-title-format", G_CALLBACK (gimp_display_shell_title_notify_handler), shell); - g_signal_connect (gimage->gimp->config, + g_signal_connect (image->gimp->config, "notify::image-status-format", G_CALLBACK (gimp_display_shell_title_notify_handler), shell); - g_signal_connect (gimage->gimp->config, + g_signal_connect (image->gimp->config, "notify::navigation-preview-size", G_CALLBACK (gimp_display_shell_nav_size_notify_handler), shell); - g_signal_connect (gimage->gimp->config, + g_signal_connect (image->gimp->config, "notify::monitor-resolution-from-windowing-system", G_CALLBACK (gimp_display_shell_monitor_res_notify_handler), shell); - g_signal_connect (gimage->gimp->config, + g_signal_connect (image->gimp->config, "notify::monitor-xresolution", G_CALLBACK (gimp_display_shell_monitor_res_notify_handler), shell); - g_signal_connect (gimage->gimp->config, + g_signal_connect (image->gimp->config, "notify::monitor-yresolution", G_CALLBACK (gimp_display_shell_monitor_res_notify_handler), shell); @@ -238,28 +238,28 @@ gimp_display_shell_connect (GimpDisplayShell *shell) G_CALLBACK (gimp_display_shell_padding_notify_handler), shell); - g_signal_connect (gimage->gimp->config, + g_signal_connect (image->gimp->config, "notify::marching-ants-speed", G_CALLBACK (gimp_display_shell_ants_speed_notify_handler), shell); - gimp_display_shell_invalidate_preview_handler (gimage, shell); - gimp_display_shell_quick_mask_changed_handler (gimage, shell); + gimp_display_shell_invalidate_preview_handler (image, shell); + gimp_display_shell_quick_mask_changed_handler (image, shell); } void gimp_display_shell_disconnect (GimpDisplayShell *shell) { - GimpImage *gimage; + GimpImage *image; GimpDisplayConfig *display_config; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); g_return_if_fail (GIMP_IS_DISPLAY (shell->gdisp)); - g_return_if_fail (GIMP_IS_IMAGE (shell->gdisp->gimage)); + g_return_if_fail (GIMP_IS_IMAGE (shell->gdisp->image)); - gimage = shell->gdisp->gimage; + image = shell->gdisp->image; - display_config = GIMP_DISPLAY_CONFIG (gimage->gimp->config); + display_config = GIMP_DISPLAY_CONFIG (image->gimp->config); if (shell->icon_idle_id) { @@ -279,7 +279,7 @@ gimp_display_shell_disconnect (GimpDisplayShell *shell) shell->pen_gc = NULL; } - g_signal_handlers_disconnect_by_func (gimage->gimp->config, + g_signal_handlers_disconnect_by_func (image->gimp->config, gimp_display_shell_ants_speed_notify_handler, shell); g_signal_handlers_disconnect_by_func (display_config->default_fullscreen_view, @@ -288,64 +288,64 @@ gimp_display_shell_disconnect (GimpDisplayShell *shell) g_signal_handlers_disconnect_by_func (display_config->default_view, gimp_display_shell_padding_notify_handler, shell); - g_signal_handlers_disconnect_by_func (gimage->gimp->config, + g_signal_handlers_disconnect_by_func (image->gimp->config, gimp_display_shell_monitor_res_notify_handler, shell); - g_signal_handlers_disconnect_by_func (gimage->gimp->config, + g_signal_handlers_disconnect_by_func (image->gimp->config, gimp_display_shell_nav_size_notify_handler, shell); - g_signal_handlers_disconnect_by_func (gimage->gimp->config, + g_signal_handlers_disconnect_by_func (image->gimp->config, gimp_display_shell_title_notify_handler, shell); - g_signal_handlers_disconnect_by_func (gimage->gimp->config, + g_signal_handlers_disconnect_by_func (image->gimp->config, gimp_display_shell_check_notify_handler, shell); - g_signal_handlers_disconnect_by_func (gimage->vectors, + g_signal_handlers_disconnect_by_func (image->vectors, gimp_display_shell_vectors_remove_handler, shell); - g_signal_handlers_disconnect_by_func (gimage->vectors, + g_signal_handlers_disconnect_by_func (image->vectors, gimp_display_shell_vectors_add_handler, shell); - gimp_container_remove_handler (gimage->vectors, + gimp_container_remove_handler (image->vectors, shell->vectors_visible_handler); - gimp_container_remove_handler (gimage->vectors, + gimp_container_remove_handler (image->vectors, shell->vectors_thaw_handler); - gimp_container_remove_handler (gimage->vectors, + gimp_container_remove_handler (image->vectors, shell->vectors_freeze_handler); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_invalidate_preview_handler, shell); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_update_guide_handler, shell); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_update_sample_point_handler, shell); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_quick_mask_changed_handler, shell); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_resolution_changed_handler, shell); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_size_changed_handler, shell); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_selection_control_handler, shell); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_name_changed_handler, shell); - g_signal_handlers_disconnect_by_func (gimage->grid, + g_signal_handlers_disconnect_by_func (image->grid, gimp_display_shell_grid_notify_handler, shell); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_undo_event_handler, shell); - g_signal_handlers_disconnect_by_func (gimage, + g_signal_handlers_disconnect_by_func (image, gimp_display_shell_clean_dirty_handler, shell); } @@ -354,7 +354,7 @@ gimp_display_shell_disconnect (GimpDisplayShell *shell) /* private functions */ static void -gimp_display_shell_clean_dirty_handler (GimpImage *gimage, +gimp_display_shell_clean_dirty_handler (GimpImage *image, GimpDirtyMask dirty_mask, GimpDisplayShell *shell) { @@ -362,7 +362,7 @@ gimp_display_shell_clean_dirty_handler (GimpImage *gimage, } static void -gimp_display_shell_undo_event_handler (GimpImage *gimage, +gimp_display_shell_undo_event_handler (GimpImage *image, GimpUndoEvent event, GimpUndo *undo, GimpDisplayShell *shell) @@ -388,14 +388,14 @@ gimp_display_shell_grid_notify_handler (GimpGrid *grid, } static void -gimp_display_shell_name_changed_handler (GimpImage *gimage, +gimp_display_shell_name_changed_handler (GimpImage *image, GimpDisplayShell *shell) { gimp_display_shell_title_update (shell); } static void -gimp_display_shell_selection_control_handler (GimpImage *gimage, +gimp_display_shell_selection_control_handler (GimpImage *image, GimpSelectionControl control, GimpDisplayShell *shell) { @@ -403,16 +403,16 @@ gimp_display_shell_selection_control_handler (GimpImage *gimage, } static void -gimp_display_shell_size_changed_handler (GimpImage *gimage, +gimp_display_shell_size_changed_handler (GimpImage *image, GimpDisplayShell *shell) { gimp_display_shell_scale_resize (shell, - GIMP_DISPLAY_CONFIG (gimage->gimp->config)->resize_windows_on_resize, + GIMP_DISPLAY_CONFIG (image->gimp->config)->resize_windows_on_resize, TRUE); } static void -gimp_display_shell_resolution_changed_handler (GimpImage *gimage, +gimp_display_shell_resolution_changed_handler (GimpImage *image, GimpDisplayShell *shell) { if (shell->dot_for_dot) @@ -422,30 +422,28 @@ gimp_display_shell_resolution_changed_handler (GimpImage *gimage, } else { - gimp_display_shell_size_changed_handler (gimage, shell); + gimp_display_shell_size_changed_handler (image, shell); } } static void -gimp_display_shell_quick_mask_changed_handler (GimpImage *gimage, +gimp_display_shell_quick_mask_changed_handler (GimpImage *image, GimpDisplayShell *shell) { - GtkImage *image; - - image = GTK_IMAGE (GTK_BIN (shell->quick_mask_button)->child); + GtkImage *gtk_image = GTK_IMAGE (GTK_BIN (shell->quick_mask_button)->child); g_signal_handlers_block_by_func (shell->quick_mask_button, gimp_display_shell_quick_mask_toggled, shell); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (shell->quick_mask_button), - shell->gdisp->gimage->quick_mask_state); + shell->gdisp->image->quick_mask_state); - if (shell->gdisp->gimage->quick_mask_state) - gtk_image_set_from_stock (image, GIMP_STOCK_QUICK_MASK_ON, + if (shell->gdisp->image->quick_mask_state) + gtk_image_set_from_stock (gtk_image, GIMP_STOCK_QUICK_MASK_ON, GTK_ICON_SIZE_MENU); else - gtk_image_set_from_stock (image, GIMP_STOCK_QUICK_MASK_OFF, + gtk_image_set_from_stock (gtk_image, GIMP_STOCK_QUICK_MASK_OFF, GTK_ICON_SIZE_MENU); g_signal_handlers_unblock_by_func (shell->quick_mask_button, @@ -454,7 +452,7 @@ gimp_display_shell_quick_mask_changed_handler (GimpImage *gimage, } static void -gimp_display_shell_update_guide_handler (GimpImage *gimage, +gimp_display_shell_update_guide_handler (GimpImage *image, GimpGuide *guide, GimpDisplayShell *shell) { @@ -462,7 +460,7 @@ gimp_display_shell_update_guide_handler (GimpImage *gimage, } static void -gimp_display_shell_update_sample_point_handler (GimpImage *gimage, +gimp_display_shell_update_sample_point_handler (GimpImage *image, GimpSamplePoint *sample_point, GimpDisplayShell *shell) { @@ -470,7 +468,7 @@ gimp_display_shell_update_sample_point_handler (GimpImage *gimage, } static void -gimp_display_shell_invalidate_preview_handler (GimpImage *gimage, +gimp_display_shell_invalidate_preview_handler (GimpImage *image, GimpDisplayShell *shell) { if (shell->icon_idle_id) @@ -605,7 +603,7 @@ gimp_display_shell_padding_notify_handler (GObject *config, GimpCanvasPaddingMode padding_mode; GimpRGB padding_color; - display_config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config); + display_config = GIMP_DISPLAY_CONFIG (shell->gdisp->image->gimp->config); fullscreen = gimp_display_shell_get_fullscreen (shell); diff --git a/app/display/gimpdisplayshell-layer-select.c b/app/display/gimpdisplayshell-layer-select.c index e18b7af79b..169ed5140c 100644 --- a/app/display/gimpdisplayshell-layer-select.c +++ b/app/display/gimpdisplayshell-layer-select.c @@ -47,14 +47,14 @@ struct _LayerSelect GtkWidget *view; GtkWidget *label; - GimpImage *gimage; + GimpImage *image; GimpLayer *orig_layer; }; /* local function prototypes */ -static LayerSelect * layer_select_new (GimpImage *gimage, +static LayerSelect * layer_select_new (GimpImage *image, GimpLayer *layer, gint view_size); static void layer_select_destroy (LayerSelect *layer_select, @@ -74,20 +74,20 @@ gimp_display_shell_layer_select_init (GimpDisplayShell *shell, guint32 time) { LayerSelect *layer_select; - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - gimage = shell->gdisp->gimage; + image = shell->gdisp->image; - layer = gimp_image_get_active_layer (gimage); + layer = gimp_image_get_active_layer (image); if (! layer) return; - layer_select = layer_select_new (gimage, layer, - gimage->gimp->config->layer_preview_size); + layer_select = layer_select_new (image, layer, + image->gimp->config->layer_preview_size); layer_select_advance (layer_select, move); gtk_window_set_screen (GTK_WINDOW (layer_select->shell), @@ -102,7 +102,7 @@ gimp_display_shell_layer_select_init (GimpDisplayShell *shell, /* private functions */ static LayerSelect * -layer_select_new (GimpImage *gimage, +layer_select_new (GimpImage *image, GimpLayer *layer, gint view_size) { @@ -114,7 +114,7 @@ layer_select_new (GimpImage *gimage, layer_select = g_new0 (LayerSelect, 1); - layer_select->gimage = gimage; + layer_select->image = image; layer_select->orig_layer = layer; layer_select->shell = gtk_window_new (GTK_WINDOW_POPUP); @@ -176,9 +176,9 @@ layer_select_destroy (LayerSelect *layer_select, gtk_widget_destroy (layer_select->shell); if (layer_select->orig_layer != - gimp_image_get_active_layer (layer_select->gimage)) + gimp_image_get_active_layer (layer_select->image)) { - gimp_image_flush (layer_select->gimage); + gimp_image_flush (layer_select->image); } g_free (layer_select); @@ -196,27 +196,27 @@ layer_select_advance (LayerSelect *layer_select, return; /* If there is a floating selection, allow no advancement */ - if (gimp_image_floating_sel (layer_select->gimage)) + if (gimp_image_floating_sel (layer_select->image)) return; - current_layer = gimp_image_get_active_layer (layer_select->gimage); + current_layer = gimp_image_get_active_layer (layer_select->image); - index = gimp_container_get_child_index (layer_select->gimage->layers, + index = gimp_container_get_child_index (layer_select->image->layers, GIMP_OBJECT (current_layer)); index += move; if (index < 0) - index = gimp_container_num_children (layer_select->gimage->layers) - 1; - else if (index >= gimp_container_num_children (layer_select->gimage->layers)) + index = gimp_container_num_children (layer_select->image->layers) - 1; + else if (index >= gimp_container_num_children (layer_select->image->layers)) index = 0; next_layer = (GimpLayer *) - gimp_container_get_child_by_index (layer_select->gimage->layers, index); + gimp_container_get_child_by_index (layer_select->image->layers, index); if (next_layer && next_layer != current_layer) { - current_layer = gimp_image_set_active_layer (layer_select->gimage, + current_layer = gimp_image_set_active_layer (layer_select->image, next_layer); if (current_layer) diff --git a/app/display/gimpdisplayshell-preview.c b/app/display/gimpdisplayshell-preview.c index 1f4dcbd00c..923277f9fa 100644 --- a/app/display/gimpdisplayshell-preview.c +++ b/app/display/gimpdisplayshell-preview.c @@ -105,7 +105,7 @@ gimp_display_shell_preview_transform (GimpDisplayShell *shell) GimpTransformTool *tr_tool; gdouble z1, z2, z3, z4; - tool = tool_manager_get_active (shell->gdisp->gimage->gimp); + tool = tool_manager_get_active (shell->gdisp->image->gimp); if (! GIMP_IS_TRANSFORM_TOOL (tool) || ! GIMP_IS_DRAWABLE (tool->drawable)) @@ -150,7 +150,7 @@ gimp_display_shell_preview_transform (GimpDisplayShell *shell) &mask_x1, &mask_y1, &mask_x2, &mask_y2)) { - mask = gimp_image_get_mask (shell->gdisp->gimage); + mask = gimp_image_get_mask (shell->gdisp->image); gimp_item_offsets (GIMP_ITEM (tool->drawable), &mask_offx, &mask_offy); diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c index 8485ebdf86..74c18376c0 100644 --- a/app/display/gimpdisplayshell-render.c +++ b/app/display/gimpdisplayshell-render.c @@ -223,7 +223,7 @@ gimp_display_shell_render (GimpDisplayShell *shell, g_return_if_fail (w > 0 && h > 0); - projection = shell->gdisp->gimage->projection; + projection = shell->gdisp->image->projection; render_image_init_info_full (&info, shell, x, y, w, h, projection); @@ -437,7 +437,7 @@ render_image_indexed (RenderInfo *info) gint x, xe; gboolean initial = TRUE; - cmap = gimp_image_get_colormap (info->shell->gdisp->gimage); + cmap = gimp_image_get_colormap (info->shell->gdisp->image); y = info->y; ye = info->y + info->h; @@ -495,7 +495,7 @@ static void render_image_indexed_a (RenderInfo *info) { const guint *alpha = info->alpha; - const guchar *cmap = gimp_image_get_colormap (info->shell->gdisp->gimage); + const guchar *cmap = gimp_image_get_colormap (info->shell->gdisp->image); gint y, ye; gint x, xe; gboolean initial = TRUE; diff --git a/app/display/gimpdisplayshell-scale.c b/app/display/gimpdisplayshell-scale.c index 25fa238e53..3381bdb791 100644 --- a/app/display/gimpdisplayshell-scale.c +++ b/app/display/gimpdisplayshell-scale.c @@ -84,8 +84,8 @@ gimp_display_shell_scale_setup (GimpDisplayShell *shell) if (! shell->gdisp) return; - image_width = shell->gdisp->gimage->width; - image_height = shell->gdisp->gimage->height; + image_width = shell->gdisp->image->width; + image_height = shell->gdisp->image->height; sx = SCALEX (shell, image_width); sy = SCALEY (shell, image_height); @@ -192,7 +192,7 @@ gimp_display_shell_scale_set_dot_for_dot (GimpDisplayShell *shell, if (dot_for_dot != shell->dot_for_dot) { - Gimp *gimp = shell->gdisp->gimage->gimp; + Gimp *gimp = shell->gdisp->image->gimp; /* freeze the active tool */ gimp_display_shell_pause (shell); @@ -304,7 +304,7 @@ gimp_display_shell_scale_to (GimpDisplayShell *shell, offset_x *= scale; offset_y *= scale; - config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config); + config = GIMP_DISPLAY_CONFIG (shell->gdisp->image->gimp->config); gimp_display_shell_scale_by_values (shell, scale, offset_x - x, offset_y - y, @@ -314,24 +314,24 @@ gimp_display_shell_scale_to (GimpDisplayShell *shell, void gimp_display_shell_scale_fit_in (GimpDisplayShell *shell) { - GimpImage *gimage; + GimpImage *image; gint image_width; gint image_height; gdouble zoom_factor; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - gimage = shell->gdisp->gimage; + image = shell->gdisp->image; - image_width = gimage->width; - image_height = gimage->height; + image_width = image->width; + image_height = image->height; if (! shell->dot_for_dot) { image_width = ROUND (image_width * - shell->monitor_xres / gimage->xresolution); + shell->monitor_xres / image->xresolution); image_height = ROUND (image_height * - shell->monitor_yres / gimage->yresolution); + shell->monitor_yres / image->yresolution); } zoom_factor = MIN ((gdouble) shell->disp_width / (gdouble) image_width, @@ -343,24 +343,24 @@ gimp_display_shell_scale_fit_in (GimpDisplayShell *shell) void gimp_display_shell_scale_fit_to (GimpDisplayShell *shell) { - GimpImage *gimage; + GimpImage *image; gint image_width; gint image_height; gdouble zoom_factor; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - gimage = shell->gdisp->gimage; + image = shell->gdisp->image; - image_width = gimage->width; - image_height = gimage->height; + image_width = image->width; + image_height = image->height; if (! shell->dot_for_dot) { image_width = ROUND (image_width * - shell->monitor_xres / gimage->xresolution); + shell->monitor_xres / image->xresolution); image_height = ROUND (image_height * - shell->monitor_yres / gimage->yresolution); + shell->monitor_yres / image->yresolution); } zoom_factor = MAX ((gdouble) shell->disp_width / (gdouble) image_width, @@ -417,7 +417,7 @@ gimp_display_shell_scale_resize (GimpDisplayShell *shell, g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - gimp = shell->gdisp->gimage->gimp; + gimp = shell->gdisp->image->gimp; /* freeze the active tool */ gimp_display_shell_pause (shell); @@ -468,7 +468,7 @@ gimp_display_shell_scale_dialog (GimpDisplayShell *shell) NULL); shell->scale_dialog = - gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->gimage), + gimp_viewable_dialog_new (GIMP_VIEWABLE (shell->gdisp->image), _("Zoom Ratio"), "display_scale", GTK_STOCK_ZOOM_100, _("Select Zoom Ratio"), @@ -652,7 +652,7 @@ img2real (GimpDisplayShell *shell, gboolean xdir, gdouble len) { - GimpImage *image = shell->gdisp->gimage; + GimpImage *image = shell->gdisp->image; gdouble res; if (shell->unit == GIMP_UNIT_PIXEL) diff --git a/app/display/gimpdisplayshell-scroll.c b/app/display/gimpdisplayshell-scroll.c index 04f5557137..147fa1f072 100644 --- a/app/display/gimpdisplayshell-scroll.c +++ b/app/display/gimpdisplayshell-scroll.c @@ -92,8 +92,8 @@ gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell) g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - sx = SCALEX (shell, shell->gdisp->gimage->width); - sy = SCALEY (shell, shell->gdisp->gimage->height); + sx = SCALEX (shell, shell->gdisp->image->width); + sy = SCALEY (shell, shell->gdisp->image->height); shell->offset_x = CLAMP (shell->offset_x, 0, MAX (sx - shell->disp_width, 0)); diff --git a/app/display/gimpdisplayshell-selection.c b/app/display/gimpdisplayshell-selection.c index b01860eafd..e2bae7121d 100644 --- a/app/display/gimpdisplayshell-selection.c +++ b/app/display/gimpdisplayshell-selection.c @@ -515,10 +515,10 @@ selection_generate_segs (Selection *select) const BoundSeg *segs_out; BoundSeg *segs_layer; - /* Ask the gimage for the boundary of its selected region... + /* Ask the image for the boundary of its selected region... * Then transform that information into a new buffer of GdkSegments */ - gimp_channel_boundary (gimp_image_get_mask (select->shell->gdisp->gimage), + gimp_channel_boundary (gimp_image_get_mask (select->shell->gdisp->image), &segs_in, &segs_out, &select->num_segs_in, &select->num_segs_out, 0, 0, 0, 0); @@ -551,7 +551,7 @@ selection_generate_segs (Selection *select) } /* The active layer's boundary */ - gimp_image_layer_boundary (select->shell->gdisp->gimage, + gimp_image_layer_boundary (select->shell->gdisp->image, &segs_layer, &select->num_segs_layer); if (select->num_segs_layer) @@ -609,7 +609,7 @@ selection_start_marching (gpointer data) GimpDisplayConfig *config; canvas = GIMP_CANVAS (select->shell->canvas); - config = GIMP_DISPLAY_CONFIG (select->shell->gdisp->gimage->gimp->config); + config = GIMP_DISPLAY_CONFIG (select->shell->gdisp->image->gimp->config); /* if the RECALC bit is set, reprocess the boundaries */ if (select->recalc) diff --git a/app/display/gimpdisplayshell-title.c b/app/display/gimpdisplayshell-title.c index 4a2d8d4057..d18e37e14c 100644 --- a/app/display/gimpdisplayshell-title.c +++ b/app/display/gimpdisplayshell-title.c @@ -66,7 +66,7 @@ gimp_display_shell_title_init (GimpDisplayShell *shell) g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config); + config = GIMP_DISPLAY_CONFIG (shell->gdisp->image->gimp->config); gimp_display_shell_format_title (shell, title, sizeof (title), config->image_status_format); @@ -97,7 +97,7 @@ gimp_display_shell_update_title_idle (gpointer data) gchar title[MAX_TITLE_BUF]; shell = GIMP_DISPLAY_SHELL (data); - config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config); + config = GIMP_DISPLAY_CONFIG (shell->gdisp->image->gimp->config); shell->title_idle_id = 0; @@ -159,7 +159,7 @@ gimp_display_shell_format_title (GimpDisplayShell *shell, g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - image = shell->gdisp->gimage; + image = shell->gdisp->image; gimp = image->gimp; gimp_zoom_model_get_fraction (shell->zoom, &num, &denom); diff --git a/app/display/gimpdisplayshell-transform.c b/app/display/gimpdisplayshell-transform.c index aa56670005..073eb95adb 100644 --- a/app/display/gimpdisplayshell-transform.c +++ b/app/display/gimpdisplayshell-transform.c @@ -131,7 +131,7 @@ gimp_display_shell_transform_xy (GimpDisplayShell *shell, scaley = SCALEFACTOR_Y (shell); if (use_offsets) - gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (shell->gdisp->gimage)), + gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (shell->gdisp->image)), &offset_x, &offset_y); x = (scalex * (x + offset_x) - shell->offset_x); @@ -188,7 +188,7 @@ gimp_display_shell_untransform_xy (GimpDisplayShell *shell, scaley = SCALEFACTOR_Y (shell); if (use_offsets) - gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (shell->gdisp->gimage)), + gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (shell->gdisp->image)), &offset_x, &offset_y); if (round) @@ -238,7 +238,7 @@ gimp_display_shell_transform_xy_f (GimpDisplayShell *shell, scaley = SCALEFACTOR_Y (shell); if (use_offsets) - gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (shell->gdisp->gimage)), + gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (shell->gdisp->image)), &offset_x, &offset_y); *nx = scalex * (x + offset_x) - shell->offset_x; @@ -287,7 +287,7 @@ gimp_display_shell_untransform_xy_f (GimpDisplayShell *shell, scaley = SCALEFACTOR_Y (shell); if (use_offsets) - gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (shell->gdisp->gimage)), + gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (shell->gdisp->image)), &offset_x, &offset_y); *nx = (x + shell->offset_x) / scalex - offset_x; @@ -327,8 +327,8 @@ gimp_display_shell_untransform_viewport (GimpDisplayShell *shell, if (x1 < 0) x1 = 0; if (y1 < 0) y1 = 0; - if (x2 > shell->gdisp->gimage->width) x2 = shell->gdisp->gimage->width; - if (y2 > shell->gdisp->gimage->height) y2 = shell->gdisp->gimage->height; + if (x2 > shell->gdisp->image->width) x2 = shell->gdisp->image->width; + if (y2 > shell->gdisp->image->height) y2 = shell->gdisp->image->height; if (x) *x = x1; if (y) *y = y1; diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index cbfead5696..49caf66dbc 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -486,7 +486,7 @@ gimp_display_shell_screen_changed (GtkWidget *widget, if (GTK_WIDGET_CLASS (parent_class)->screen_changed) GTK_WIDGET_CLASS (parent_class)->screen_changed (widget, previous); - config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config); + config = GIMP_DISPLAY_CONFIG (shell->gdisp->image->gimp->config); if (GIMP_DISPLAY_CONFIG (config)->monitor_res_from_gdk) { @@ -517,7 +517,7 @@ gimp_display_shell_popup_menu (GtkWidget *widget) { GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (widget); - gimp_context_set_display (gimp_get_user_context (shell->gdisp->gimage->gimp), + gimp_context_set_display (gimp_get_user_context (shell->gdisp->image->gimp), shell->gdisp); gimp_ui_manager_ui_popup (shell->popup_manager, "/dummy-menubar/image-popup", @@ -542,7 +542,7 @@ gimp_display_shell_real_scaled (GimpDisplayShell *shell) /* update the /View/Zoom menu */ gimp_ui_manager_update (shell->menubar_manager, shell->gdisp); - user_context = gimp_get_user_context (shell->gdisp->gimage->gimp); + user_context = gimp_get_user_context (shell->gdisp->image->gimp); if (shell->gdisp == gimp_context_get_display (user_context)) gimp_ui_manager_update (shell->popup_manager, shell->gdisp); @@ -614,10 +614,10 @@ gimp_display_shell_new (GimpDisplay *gdisp, shell->gdisp = gdisp; - image_width = gdisp->gimage->width; - image_height = gdisp->gimage->height; + image_width = gdisp->image->width; + image_height = gdisp->image->height; - display_config = GIMP_DISPLAY_CONFIG (gdisp->gimage->gimp->config); + display_config = GIMP_DISPLAY_CONFIG (gdisp->image->gimp->config); shell->dot_for_dot = display_config->default_dot_for_dot; @@ -1049,7 +1049,7 @@ gimp_display_shell_new (GimpDisplay *gdisp, gtk_widget_show (main_vbox); - color_config = gdisp->gimage->gimp->config->color_management; + color_config = gdisp->image->gimp->config->color_management; gimp_display_shell_filter_set (shell, gimp_display_shell_filter_new (color_config)); @@ -1065,7 +1065,7 @@ gimp_display_shell_reconnect (GimpDisplayShell *shell) { g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); g_return_if_fail (GIMP_IS_DISPLAY (shell->gdisp)); - g_return_if_fail (GIMP_IS_IMAGE (shell->gdisp->gimage)); + g_return_if_fail (GIMP_IS_IMAGE (shell->gdisp->image)); gimp_display_shell_connect (shell); @@ -1139,13 +1139,13 @@ gimp_display_shell_snap_coords (GimpDisplayShell *shell, *snapped_coords = *coords; if (gimp_display_shell_get_snap_to_guides (shell) && - shell->gdisp->gimage->guides) + shell->gdisp->image->guides) { snap_to_guides = TRUE; } if (gimp_display_shell_get_snap_to_grid (shell) && - shell->gdisp->gimage->grid) + shell->gdisp->image->grid) { snap_to_grid = TRUE; } @@ -1153,7 +1153,7 @@ gimp_display_shell_snap_coords (GimpDisplayShell *shell, snap_to_canvas = gimp_display_shell_get_snap_to_canvas (shell); if (gimp_display_shell_get_snap_to_vectors (shell) && - gimp_image_get_active_vectors (shell->gdisp->gimage)) + gimp_image_get_active_vectors (shell->gdisp->image)) { snap_to_vectors = TRUE; } @@ -1164,11 +1164,11 @@ gimp_display_shell_snap_coords (GimpDisplayShell *shell, gint snap_distance; snap_distance = - GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config)->snap_distance; + GIMP_DISPLAY_CONFIG (shell->gdisp->image->gimp->config)->snap_distance; if (snap_width > 0 && snap_height > 0) { - snapped = gimp_image_snap_rectangle (shell->gdisp->gimage, + snapped = gimp_image_snap_rectangle (shell->gdisp->image, coords->x + snap_offset_x, coords->y + snap_offset_y, coords->x + snap_offset_x + @@ -1186,7 +1186,7 @@ gimp_display_shell_snap_coords (GimpDisplayShell *shell, } else { - snapped = gimp_image_snap_point (shell->gdisp->gimage, + snapped = gimp_image_snap_point (shell->gdisp->image, coords->x + snap_offset_x, coords->y + snap_offset_y, &tx, @@ -1225,14 +1225,14 @@ gimp_display_shell_mask_bounds (GimpDisplayShell *shell, g_return_val_if_fail (y2 != NULL, FALSE); /* If there is a floating selection, handle things differently */ - if ((layer = gimp_image_floating_sel (shell->gdisp->gimage))) + if ((layer = gimp_image_floating_sel (shell->gdisp->image))) { gint off_x; gint off_y; gimp_item_offsets (GIMP_ITEM (layer), &off_x, &off_y); - if (! gimp_channel_bounds (gimp_image_get_mask (shell->gdisp->gimage), + if (! gimp_channel_bounds (gimp_image_get_mask (shell->gdisp->image), x1, y1, x2, y2)) { *x1 = off_x; @@ -1248,7 +1248,7 @@ gimp_display_shell_mask_bounds (GimpDisplayShell *shell, *y2 = MAX (off_y + gimp_item_height (GIMP_ITEM (layer)), *y2); } } - else if (! gimp_channel_bounds (gimp_image_get_mask (shell->gdisp->gimage), + else if (! gimp_channel_bounds (gimp_image_get_mask (shell->gdisp->image), x1, y1, x2, y2)) { return FALSE; @@ -1372,7 +1372,7 @@ gimp_display_shell_flush (GimpDisplayShell *shell, gimp_ui_manager_update (shell->menubar_manager, shell->gdisp); - user_context = gimp_get_user_context (shell->gdisp->gimage->gimp); + user_context = gimp_get_user_context (shell->gdisp->image->gimp); if (shell->gdisp == gimp_context_get_display (user_context)) gimp_ui_manager_update (shell->popup_manager, shell->gdisp); @@ -1400,7 +1400,7 @@ gimp_display_shell_pause (GimpDisplayShell *shell) if (shell->paused_count == 1) { /* pause the currently active tool */ - tool_manager_control_active (shell->gdisp->gimage->gimp, PAUSE, + tool_manager_control_active (shell->gdisp->image->gimp, PAUSE, shell->gdisp); gimp_display_shell_draw_vectors (shell); @@ -1429,7 +1429,7 @@ gimp_display_shell_resume (GimpDisplayShell *shell) gimp_display_shell_draw_vectors (shell); /* start the currently active tool */ - tool_manager_control_active (shell->gdisp->gimage->gimp, RESUME, + tool_manager_control_active (shell->gdisp->image->gimp, RESUME, shell->gdisp); } } @@ -1443,8 +1443,8 @@ gimp_display_shell_update_icon (GimpDisplayShell *shell) g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell)); - factor = ((gdouble) gimp_image_get_height (shell->gdisp->gimage) / - (gdouble) gimp_image_get_width (shell->gdisp->gimage)); + factor = ((gdouble) gimp_image_get_height (shell->gdisp->image) / + (gdouble) gimp_image_get_width (shell->gdisp->image)); if (factor >= 1) { @@ -1457,7 +1457,7 @@ gimp_display_shell_update_icon (GimpDisplayShell *shell) width = MAX (shell->icon_size, 1); } - pixbuf = gimp_viewable_get_pixbuf (GIMP_VIEWABLE (shell->gdisp->gimage), + pixbuf = gimp_viewable_get_pixbuf (GIMP_VIEWABLE (shell->gdisp->image), width, height); gtk_window_set_icon (GTK_WINDOW (shell), pixbuf); @@ -1487,8 +1487,8 @@ gimp_display_shell_shrink_wrap (GimpDisplayShell *shell) monitor = gdk_screen_get_monitor_at_window (screen, widget->window); gdk_screen_get_monitor_geometry (screen, monitor, &rect); - width = SCALEX (shell, shell->gdisp->gimage->width); - height = SCALEY (shell, shell->gdisp->gimage->height); + width = SCALEX (shell, shell->gdisp->image->width); + height = SCALEY (shell, shell->gdisp->image->height); disp_width = shell->disp_width; disp_height = shell->disp_height; diff --git a/app/display/gimpdisplayshell.h b/app/display/gimpdisplayshell.h index b37bdbdf1e..13fc71969e 100644 --- a/app/display/gimpdisplayshell.h +++ b/app/display/gimpdisplayshell.h @@ -30,15 +30,15 @@ /* finding the effective screen resolution (double) */ #define SCREEN_XRES(s) ((s)->dot_for_dot ? \ - (s)->gdisp->gimage->xresolution : (s)->monitor_xres) + (s)->gdisp->image->xresolution : (s)->monitor_xres) #define SCREEN_YRES(s) ((s)->dot_for_dot ? \ - (s)->gdisp->gimage->yresolution : (s)->monitor_yres) + (s)->gdisp->image->yresolution : (s)->monitor_yres) /* calculate scale factors (double) */ #define SCALEFACTOR_X(s) (gimp_zoom_model_get_factor ((s)->zoom) \ - * SCREEN_XRES(s) / (s)->gdisp->gimage->xresolution) + * SCREEN_XRES(s) / (s)->gdisp->image->xresolution) #define SCALEFACTOR_Y(s) (gimp_zoom_model_get_factor ((s)->zoom) \ - * SCREEN_YRES(s) / (s)->gdisp->gimage->yresolution) + * SCREEN_YRES(s) / (s)->gdisp->image->yresolution) /* scale values */ #define SCALEX(s,x) PROJ_ROUND ((x) * SCALEFACTOR_X(s)) diff --git a/app/display/gimpnavigationeditor.c b/app/display/gimpnavigationeditor.c index eb3e7822a8..72eceb409a 100644 --- a/app/display/gimpnavigationeditor.c +++ b/app/display/gimpnavigationeditor.c @@ -324,7 +324,7 @@ gimp_navigation_editor_new_private (GimpMenuFactory *menu_factory, editor = g_object_new (GIMP_TYPE_NAVIGATION_EDITOR, NULL); - config = GIMP_DISPLAY_CONFIG (shell->gdisp->gimage->gimp->config); + config = GIMP_DISPLAY_CONFIG (shell->gdisp->image->gimp->config); view = GIMP_VIEW (editor->view); gimp_view_renderer_set_size (view->renderer, @@ -444,7 +444,7 @@ gimp_navigation_editor_set_shell (GimpNavigationEditor *editor, if (editor->shell) { gimp_view_set_viewable (GIMP_VIEW (editor->view), - GIMP_VIEWABLE (shell->gdisp->gimage)); + GIMP_VIEWABLE (shell->gdisp->image)); g_signal_connect (editor->shell, "scaled", G_CALLBACK (gimp_navigation_editor_shell_scaled), @@ -626,7 +626,7 @@ gimp_navigation_editor_shell_reconnect (GimpDisplayShell *shell, GimpNavigationEditor *editor) { gimp_view_set_viewable (GIMP_VIEW (editor->view), - GIMP_VIEWABLE (shell->gdisp->gimage)); + GIMP_VIEWABLE (shell->gdisp->image)); if (GIMP_EDITOR (editor)->ui_manager) gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager, diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c index 7c091f7ab5..94d02ae686 100644 --- a/app/display/gimpstatusbar.c +++ b/app/display/gimpstatusbar.c @@ -491,7 +491,7 @@ gimp_statusbar_push_coords (GimpStatusbar *statusbar, } else /* show real world units */ { - GimpImage *image = shell->gdisp->gimage; + GimpImage *image = shell->gdisp->image; gdouble unit_factor = _gimp_unit_get_factor (image->gimp, shell->unit); @@ -528,7 +528,7 @@ gimp_statusbar_push_length (GimpStatusbar *statusbar, } else /* show real world units */ { - GimpImage *image = shell->gdisp->gimage; + GimpImage *image = shell->gdisp->image; gdouble resolution; gdouble unit_factor = _gimp_unit_get_factor (image->gimp, shell->unit); @@ -675,8 +675,8 @@ gimp_statusbar_set_cursor (GimpStatusbar *statusbar, if (x < 0 || y < 0 || - x >= statusbar->shell->gdisp->gimage->width || - y >= statusbar->shell->gdisp->gimage->height) + x >= statusbar->shell->gdisp->image->width || + y >= statusbar->shell->gdisp->image->height) { gtk_widget_set_sensitive (statusbar->cursor_label, FALSE); } @@ -699,7 +699,7 @@ gimp_statusbar_shell_scaled (GimpDisplayShell *shell, { static PangoLayout *layout = NULL; - GimpImage *image = shell->gdisp->gimage; + GimpImage *image = shell->gdisp->image; GtkTreeModel *model; const gchar *text; gint width; diff --git a/app/file/file-open.c b/app/file/file-open.c index ed749698f7..cf9eb058ab 100644 --- a/app/file/file-open.c +++ b/app/file/file-open.c @@ -67,7 +67,7 @@ #include "gimp-intl.h" -static void file_open_sanitize_image (GimpImage *gimage); +static void file_open_sanitize_image (GimpImage *image); /* public functions */ @@ -158,14 +158,14 @@ file_open_image (Gimp *gimp, { if (image_id != -1) { - GimpImage *gimage = gimp_image_get_by_ID (gimp, image_id); + GimpImage *image = gimp_image_get_by_ID (gimp, image_id); - file_open_sanitize_image (gimage); + file_open_sanitize_image (image); if (mime_type) *mime_type = file_proc->mime_type; - return gimage; + return image; } else { @@ -288,7 +288,7 @@ file_open_with_proc_and_display (Gimp *gimp, GimpPDBStatusType *status, GError **error) { - GimpImage *gimage; + GimpImage *image; const gchar *mime_type = NULL; g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); @@ -296,7 +296,7 @@ file_open_with_proc_and_display (Gimp *gimp, g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL); g_return_val_if_fail (status != NULL, NULL); - gimage = file_open_image (gimp, context, progress, + image = file_open_image (gimp, context, progress, uri, entered_filename, file_proc, @@ -305,24 +305,24 @@ file_open_with_proc_and_display (Gimp *gimp, &mime_type, error); - if (gimage) + if (image) { GimpDocumentList *documents = GIMP_DOCUMENT_LIST (gimp->documents); GimpImagefile *imagefile; - gimp_create_display (gimage->gimp, gimage, GIMP_UNIT_PIXEL, 1.0); + gimp_create_display (image->gimp, image, GIMP_UNIT_PIXEL, 1.0); imagefile = gimp_document_list_add_uri (documents, uri, mime_type); /* can only create a thumbnail if the passed uri and the * resulting image's uri match. */ - if (strcmp (uri, gimp_image_get_uri (gimage)) == 0) + if (strcmp (uri, gimp_image_get_uri (image)) == 0) { /* no need to save a thumbnail if there's a good one already */ if (! gimp_imagefile_check_thumbnail (imagefile)) { - gimp_imagefile_save_thumbnail (imagefile, mime_type, gimage); + gimp_imagefile_save_thumbnail (imagefile, mime_type, image); } } @@ -330,10 +330,10 @@ file_open_with_proc_and_display (Gimp *gimp, gimp_recent_list_add_uri (uri, mime_type); /* the display owns the image now */ - g_object_unref (gimage); + g_object_unref (image); } - return gimage; + return image; } GimpLayer * @@ -429,19 +429,19 @@ file_open_layer (Gimp *gimp, /* private functions */ static void -file_open_sanitize_image (GimpImage *gimage) +file_open_sanitize_image (GimpImage *image) { /* clear all undo steps */ - gimp_image_undo_free (gimage); + gimp_image_undo_free (image); /* make sure that undo is enabled */ - while (gimage->undo_freeze_count) - gimp_image_undo_thaw (gimage); + while (image->undo_freeze_count) + gimp_image_undo_thaw (image); /* set the image to clean */ - gimp_image_clean_all (gimage); + gimp_image_clean_all (image); - gimp_image_invalidate_layer_previews (gimage); - gimp_image_invalidate_channel_previews (gimage); - gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage)); + gimp_image_invalidate_layer_previews (image); + gimp_image_invalidate_channel_previews (image); + gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image)); } diff --git a/app/file/file-save.c b/app/file/file-save.c index 00eb8024a4..d900dde4ec 100644 --- a/app/file/file-save.c +++ b/app/file/file-save.c @@ -68,7 +68,7 @@ /* public functions */ GimpPDBStatusType -file_save (GimpImage *gimage, +file_save (GimpImage *image, GimpContext *context, GimpProgress *progress, const gchar *uri, @@ -83,7 +83,7 @@ file_save (GimpImage *gimage, GimpPDBStatusType status; gchar *filename; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_PDB_CALLING_ERROR); + g_return_val_if_fail (GIMP_IS_IMAGE (image), GIMP_PDB_CALLING_ERROR); g_return_val_if_fail (GIMP_IS_CONTEXT (context), GIMP_PDB_CALLING_ERROR); g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), GIMP_PDB_CALLING_ERROR); @@ -92,7 +92,7 @@ file_save (GimpImage *gimage, g_return_val_if_fail (error == NULL || *error == NULL, GIMP_PDB_CALLING_ERROR); - if (! gimp_image_active_drawable (gimage)) + if (! gimp_image_active_drawable (image)) return GIMP_PDB_EXECUTION_ERROR; filename = file_utils_filename_from_uri (uri); @@ -125,17 +125,17 @@ file_save (GimpImage *gimage, } /* ref the image, so it can't get deleted during save */ - g_object_ref (gimage); + g_object_ref (image); proc = plug_in_proc_def_get_proc (file_proc); return_vals = - procedural_db_run_proc (gimage->gimp, context, progress, + procedural_db_run_proc (image->gimp, context, progress, proc->name, &n_return_vals, GIMP_PDB_INT32, run_mode, - GIMP_PDB_IMAGE, gimp_image_get_ID (gimage), - GIMP_PDB_DRAWABLE, gimp_item_get_ID (GIMP_ITEM (gimp_image_active_drawable (gimage))), + GIMP_PDB_IMAGE, gimp_image_get_ID (image), + GIMP_PDB_DRAWABLE, gimp_item_get_ID (GIMP_ITEM (gimp_image_active_drawable (image))), GIMP_PDB_STRING, filename, GIMP_PDB_STRING, uri, GIMP_PDB_END); @@ -152,30 +152,30 @@ file_save (GimpImage *gimage, if (save_a_copy) { /* remember the "save-a-copy" filename for the next invocation */ - g_object_set_data_full (G_OBJECT (gimage), "gimp-image-save-a-copy", + g_object_set_data_full (G_OBJECT (image), "gimp-image-save-a-copy", g_strdup (uri), (GDestroyNotify) g_free); } else { /* reset the "save-a-copy" filename when the image URI changes */ - if (strcmp (uri, gimp_image_get_uri (gimage))) - g_object_set_data (G_OBJECT (gimage), + if (strcmp (uri, gimp_image_get_uri (image))) + g_object_set_data (G_OBJECT (image), "gimp-image-save-a-copy", NULL); - gimp_image_set_uri (gimage, uri); - gimp_image_set_save_proc (gimage, file_proc); - gimp_image_clean_all (gimage); + gimp_image_set_uri (image, uri); + gimp_image_set_save_proc (image, file_proc); + gimp_image_clean_all (image); } - documents = GIMP_DOCUMENT_LIST (gimage->gimp->documents); + documents = GIMP_DOCUMENT_LIST (image->gimp->documents); imagefile = gimp_document_list_add_uri (documents, uri, file_proc->mime_type); - gimp_imagefile_save_thumbnail (imagefile, file_proc->mime_type, gimage); + gimp_imagefile_save_thumbnail (imagefile, file_proc->mime_type, image); - if (gimage->gimp->config->save_document_history) + if (image->gimp->config->save_document_history) gimp_recent_list_add_uri (uri, file_proc->mime_type); } else if (status != GIMP_PDB_CANCEL) @@ -184,7 +184,7 @@ file_save (GimpImage *gimage, _("Plug-In could not save image")); } - g_object_unref (gimage); + g_object_unref (image); out: g_free (filename); diff --git a/app/file/file-save.h b/app/file/file-save.h index 52d3833bab..46d67d6b89 100644 --- a/app/file/file-save.h +++ b/app/file/file-save.h @@ -22,7 +22,7 @@ #define __FILE_SAVE_H__ -GimpPDBStatusType file_save (GimpImage *gimage, +GimpPDBStatusType file_save (GimpImage *image, GimpContext *context, GimpProgress *progress, const gchar *uri, diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c index 6971bcdca0..692dc92cbf 100644 --- a/app/gui/gui-vtable.c +++ b/app/gui/gui-vtable.c @@ -95,7 +95,7 @@ static GimpObject * gui_display_get_by_ID (Gimp *gimp, gint ID); static gint gui_display_get_ID (GimpObject *display); static guint32 gui_display_get_window (GimpObject *display); -static GimpObject * gui_display_create (GimpImage *gimage, +static GimpObject * gui_display_create (GimpImage *image, GimpUnit unit, gdouble scale); static void gui_display_delete (GimpObject *display); @@ -343,7 +343,7 @@ gui_display_get_window (GimpObject *display) } static GimpObject * -gui_display_create (GimpImage *gimage, +gui_display_create (GimpImage *image, GimpUnit unit, gdouble scale) { @@ -352,11 +352,11 @@ gui_display_create (GimpImage *gimage, image_managers = gimp_ui_managers_from_name (""); - gdisp = gimp_display_new (gimage, unit, scale, + gdisp = gimp_display_new (image, unit, scale, global_menu_factory, image_managers->data); - gimp_context_set_display (gimp_get_user_context (gimage->gimp), gdisp); + gimp_context_set_display (gimp_get_user_context (image->gimp), gdisp); gimp_ui_manager_update (GIMP_DISPLAY_SHELL (gdisp->shell)->menubar_manager, gdisp); diff --git a/app/gui/gui.c b/app/gui/gui.c index 4fc0dd226d..114a7aff63 100644 --- a/app/gui/gui.c +++ b/app/gui/gui.c @@ -121,7 +121,7 @@ static void gui_menu_hide_tooltip (GimpUIManager *manager, static void gui_display_changed (GimpContext *context, GimpDisplay *display, Gimp *gimp); -static void gui_image_disconnect (GimpImage *gimage, +static void gui_image_disconnect (GimpImage *image, Gimp *gimp); @@ -653,7 +653,7 @@ gui_display_changed (GimpContext *context, { GimpDisplay *display2 = list->data; - if (display2->gimage == image) + if (display2->image == image) { gimp_context_set_display (context, display2); @@ -673,12 +673,12 @@ gui_display_changed (GimpContext *context, } static void -gui_image_disconnect (GimpImage *gimage, +gui_image_disconnect (GimpImage *image, Gimp *gimp) { /* check if this is the last image and if it had a display */ if (gimp_container_num_children (gimp->images) == 1 && - gimage->instance_count > 0) + image->instance_count > 0) { dialogs_show_toolbox (); } diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c index 7a987e16ee..05609817df 100644 --- a/app/paint/gimpclone.c +++ b/app/paint/gimpclone.c @@ -220,8 +220,8 @@ gimp_clone_motion (GimpPaintCore *paint_core, GimpCloneOptions *options = GIMP_CLONE_OPTIONS (paint_options); GimpContext *context = GIMP_CONTEXT (paint_options); GimpPressureOptions *pressure_options = paint_options->pressure_options; - GimpImage *gimage; - GimpImage *src_gimage = NULL; + GimpImage *image; + GimpImage *src_image = NULL; GimpPickable *src_pickable = NULL; guchar *s; guchar *d; @@ -236,9 +236,9 @@ gimp_clone_motion (GimpPaintCore *paint_core, gint offset_x; gint offset_y; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - opacity = gimp_paint_options_get_fade (paint_options, gimage, + opacity = gimp_paint_options_get_fade (paint_options, image, paint_core->pixel_dist); if (opacity == 0.0) return; @@ -254,13 +254,13 @@ gimp_clone_motion (GimpPaintCore *paint_core, return; src_pickable = GIMP_PICKABLE (clone->src_drawable); - src_gimage = gimp_pickable_get_image (src_pickable); + src_image = gimp_pickable_get_image (src_pickable); if (options->sample_merged) { gint off_x, off_y; - src_pickable = GIMP_PICKABLE (src_gimage->projection); + src_pickable = GIMP_PICKABLE (src_image->projection); gimp_item_offsets (GIMP_ITEM (clone->src_drawable), &off_x, &off_y); @@ -295,13 +295,13 @@ gimp_clone_motion (GimpPaintCore *paint_core, if (!(x2 - x1) || !(y2 - y1)) return; - /* If the source gimage is different from the destination, + /* If the source image is different from the destination, * then we should copy straight from the destination image * to the canvas. * Otherwise, we need a call to get_orig_image to make sure * we get a copy of the unblemished (offset) image */ - if (( options->sample_merged && (src_gimage != gimage)) || + if (( options->sample_merged && (src_image != image)) || (! options->sample_merged && (clone->src_drawable != drawable))) { pixel_region_init (&srcPR, src_tiles, @@ -359,7 +359,7 @@ gimp_clone_motion (GimpPaintCore *paint_core, switch (options->clone_type) { case GIMP_IMAGE_CLONE: - gimp_clone_line_image (gimage, src_gimage, + gimp_clone_line_image (image, src_image, drawable, src_pickable, s, d, srcPR.bytes, destPR.bytes, destPR.w); @@ -367,7 +367,7 @@ gimp_clone_motion (GimpPaintCore *paint_core, break; case GIMP_PATTERN_CLONE: - gimp_clone_line_pattern (gimage, drawable, + gimp_clone_line_pattern (image, drawable, pattern, d, area->x + offset_x, area->y + y + offset_y, diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c index 8b72d27be6..457b61ebe8 100644 --- a/app/paint/gimpconvolve.c +++ b/app/paint/gimpconvolve.c @@ -160,7 +160,7 @@ gimp_convolve_motion (GimpPaintCore *paint_core, GimpConvolveOptions *options = GIMP_CONVOLVE_OPTIONS (paint_options); GimpContext *context = GIMP_CONTEXT (paint_options); GimpPressureOptions *pressure_options = paint_options->pressure_options; - GimpImage *gimage; + GimpImage *image; TempBuf *area; guchar *temp_data; PixelRegion srcPR; @@ -172,7 +172,7 @@ gimp_convolve_motion (GimpPaintCore *paint_core, gint marginx = 0; gint marginy = 0; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); if (gimp_drawable_is_indexed (drawable)) return; @@ -182,7 +182,7 @@ gimp_convolve_motion (GimpPaintCore *paint_core, brush_core->brush->mask->height < matrix_size) return; - opacity = gimp_paint_options_get_fade (paint_options, gimage, + opacity = gimp_paint_options_get_fade (paint_options, image, paint_core->pixel_dist); if (opacity == 0.0) return; diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c index 7c435e088a..5f61df848d 100644 --- a/app/paint/gimpdodgeburn.c +++ b/app/paint/gimpdodgeburn.c @@ -165,19 +165,19 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core, GimpDodgeBurn *dodgeburn = GIMP_DODGE_BURN (paint_core); GimpContext *context = GIMP_CONTEXT (paint_options); GimpPressureOptions *pressure_options = paint_options->pressure_options; - GimpImage *gimage; + GimpImage *image; TempBuf *area; TempBuf *orig; PixelRegion srcPR, destPR, tempPR; guchar *temp_data; gdouble opacity; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); if (gimp_drawable_is_indexed (drawable)) return; - opacity = gimp_paint_options_get_fade (paint_options, gimage, + opacity = gimp_paint_options_get_fade (paint_options, image, paint_core->pixel_dist); if (opacity == 0.0) return; @@ -237,7 +237,7 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core, if (pressure_options->opacity) opacity *= PRESSURE_SCALE * paint_core->cur_coords.pressure; - /* Replace the newly dodgedburned area (canvas_buf) to the gimage */ + /* Replace the newly dodgedburned area (canvas_buf) to the image */ gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), drawable, MIN (opacity, GIMP_OPACITY_OPAQUE), gimp_context_get_opacity (context), diff --git a/app/paint/gimperaser.c b/app/paint/gimperaser.c index fde3b05390..0a2cff9ecd 100644 --- a/app/paint/gimperaser.c +++ b/app/paint/gimperaser.c @@ -105,14 +105,14 @@ gimp_eraser_motion (GimpPaintCore *paint_core, GimpEraserOptions *options = GIMP_ERASER_OPTIONS (paint_options); GimpContext *context = GIMP_CONTEXT (paint_options); GimpPressureOptions *pressure_options = paint_options->pressure_options; - GimpImage *gimage; + GimpImage *image; gdouble opacity; TempBuf *area; guchar col[MAX_CHANNELS]; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - opacity = gimp_paint_options_get_fade (paint_options, gimage, + opacity = gimp_paint_options_get_fade (paint_options, image, paint_core->pixel_dist); if (opacity == 0.0) return; @@ -121,7 +121,7 @@ gimp_eraser_motion (GimpPaintCore *paint_core, if (! area) return; - gimp_image_get_background (gimage, drawable, context, col); + gimp_image_get_background (image, drawable, context, col); /* set the alpha channel */ col[area->bytes - 1] = OPAQUE_OPACITY; diff --git a/app/paint/gimpink-undo.c b/app/paint/gimpink-undo.c index 1f51561121..3dfbd72387 100644 --- a/app/paint/gimpink-undo.c +++ b/app/paint/gimpink-undo.c @@ -66,18 +66,18 @@ static void undo_free_ink (GimpUndo *undo, gboolean gimp_ink_push_undo (GimpPaintCore *core, - GimpImage *gimage, + GimpImage *image, const gchar *undo_desc) { GimpUndo *new; g_return_val_if_fail (GIMP_IS_INK (core), FALSE); - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - if (! GIMP_PAINT_CORE_CLASS (g_type_class_peek_parent (GIMP_INK_GET_CLASS (core)))->push_undo (core, gimage, undo_desc)) + if (! GIMP_PAINT_CORE_CLASS (g_type_class_peek_parent (GIMP_INK_GET_CLASS (core)))->push_undo (core, image, undo_desc)) return FALSE; - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (InkUndo), sizeof (InkUndo), GIMP_UNDO_INK, undo_desc, diff --git a/app/paint/gimpink-undo.h b/app/paint/gimpink-undo.h index 44d428c8ff..6b954780ad 100644 --- a/app/paint/gimpink-undo.h +++ b/app/paint/gimpink-undo.h @@ -21,7 +21,7 @@ gboolean gimp_ink_push_undo (GimpPaintCore *core, - GimpImage *gimage, + GimpImage *image, const gchar *undo_desc); diff --git a/app/paint/gimpink.c b/app/paint/gimpink.c index 9b0065b539..050651e6f5 100644 --- a/app/paint/gimpink.c +++ b/app/paint/gimpink.c @@ -235,14 +235,14 @@ gimp_ink_motion (GimpPaintCore *paint_core, GimpInk *ink = GIMP_INK (paint_core); GimpInkOptions *options = GIMP_INK_OPTIONS (paint_options); GimpContext *context = GIMP_CONTEXT (paint_options); - GimpImage *gimage; + GimpImage *image; Blob *blob_union = NULL; Blob *blob_to_render; TempBuf *area; guchar col[MAX_CHANNELS]; PixelRegion blob_maskPR; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); if (! ink->last_blob) { @@ -329,7 +329,7 @@ gimp_ink_motion (GimpPaintCore *paint_core, if (! area) return; - gimp_image_get_foreground (gimage, drawable, context, col); + gimp_image_get_foreground (image, drawable, context, col); /* set the alpha channel */ col[paint_core->canvas_buf->bytes - 1] = OPAQUE_OPACITY; diff --git a/app/paint/gimppaintbrush.c b/app/paint/gimppaintbrush.c index 079a24036e..0dfce79a3c 100644 --- a/app/paint/gimppaintbrush.c +++ b/app/paint/gimppaintbrush.c @@ -108,15 +108,15 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core, GimpBrushCore *brush_core = GIMP_BRUSH_CORE (paint_core); GimpContext *context = GIMP_CONTEXT (paint_options); GimpPressureOptions *pressure_options = paint_options->pressure_options; - GimpImage *gimage; + GimpImage *image; GimpRGB gradient_color; TempBuf *area; guchar col[MAX_CHANNELS]; GimpPaintApplicationMode paint_appl_mode; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - opacity *= gimp_paint_options_get_fade (paint_options, gimage, + opacity *= gimp_paint_options_get_fade (paint_options, image, paint_core->pixel_dist); if (opacity == 0.0) return; @@ -127,7 +127,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core, if (! area) return; - if (gimp_paint_options_get_gradient_color (paint_options, gimage, + if (gimp_paint_options_get_gradient_color (paint_options, image, paint_core->cur_coords.pressure, paint_core->pixel_dist, &gradient_color)) @@ -149,7 +149,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core, else if (brush_core->brush && brush_core->brush->pixmap) { /* if it's a pixmap, do pixmap stuff */ - gimp_brush_core_color_area_with_pixmap (brush_core, gimage, drawable, + gimp_brush_core_color_area_with_pixmap (brush_core, image, drawable, area, brush_core->scale, gimp_paint_options_get_brush_mode (paint_options)); @@ -158,7 +158,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core, } else { - gimp_image_get_foreground (gimage, drawable, context, col); + gimp_image_get_foreground (image, drawable, context, col); col[area->bytes - 1] = OPAQUE_OPACITY; color_pixels (temp_buf_data (area), col, area->width * area->height, diff --git a/app/paint/gimppaintcore-stroke.c b/app/paint/gimppaintcore-stroke.c index a137213772..54ece6ed67 100644 --- a/app/paint/gimppaintcore-stroke.c +++ b/app/paint/gimppaintcore-stroke.c @@ -93,7 +93,7 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, gint offset_x, gint offset_y) { - GimpImage *gimage; + GimpImage *image; BoundSeg *stroke_segs; gint n_stroke_segs; gint off_x; @@ -110,7 +110,7 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), FALSE); g_return_val_if_fail (bound_segs != NULL && n_bound_segs > 0, FALSE); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); stroke_segs = boundary_sort (bound_segs, n_bound_segs, &n_stroke_segs); diff --git a/app/paint/gimppaintcore-undo.c b/app/paint/gimppaintcore-undo.c index f1bb18766f..44e751a375 100644 --- a/app/paint/gimppaintcore-undo.c +++ b/app/paint/gimppaintcore-undo.c @@ -49,15 +49,15 @@ static void undo_free_paint (GimpUndo *undo, gboolean gimp_paint_core_real_push_undo (GimpPaintCore *core, - GimpImage *gimage, + GimpImage *image, const gchar *undo_desc) { GimpUndo *new; g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), FALSE); - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (PaintUndo), sizeof (PaintUndo), GIMP_UNDO_PAINT, undo_desc, diff --git a/app/paint/gimppaintcore-undo.h b/app/paint/gimppaintcore-undo.h index e1e0eb02f3..706c2430db 100644 --- a/app/paint/gimppaintcore-undo.h +++ b/app/paint/gimppaintcore-undo.h @@ -21,7 +21,7 @@ gboolean gimp_paint_core_real_push_undo (GimpPaintCore *core, - GimpImage *gimage, + GimpImage *image, const gchar *undo_desc); diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c index 6e8615bd9a..5b66687107 100644 --- a/app/paint/gimppaintcore.c +++ b/app/paint/gimppaintcore.c @@ -313,13 +313,13 @@ gimp_paint_core_finish (GimpPaintCore *core, GimpDrawable *drawable) { GimpPaintInfo *paint_info; - GimpImage *gimage; + GimpImage *image; g_return_if_fail (GIMP_IS_PAINT_CORE (core)); g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* Determine if any part of the image has been altered-- * if nothing has, then just return... @@ -328,13 +328,13 @@ gimp_paint_core_finish (GimpPaintCore *core, return; paint_info = (GimpPaintInfo *) - gimp_container_get_child_by_name (gimage->gimp->paint_info_list, + gimp_container_get_child_by_name (image->gimp->paint_info_list, g_type_name (G_TYPE_FROM_INSTANCE (core))); - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_PAINT, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PAINT, paint_info ? paint_info->blurb : _("Paint")); - GIMP_PAINT_CORE_GET_CLASS (core)->push_undo (core, gimage, NULL); + GIMP_PAINT_CORE_GET_CLASS (core)->push_undo (core, image, NULL); gimp_drawable_push_undo (drawable, NULL, core->x1, core->y1, @@ -345,7 +345,7 @@ gimp_paint_core_finish (GimpPaintCore *core, tile_manager_unref (core->undo_tiles); core->undo_tiles = NULL; - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); if (core->saved_proj_tiles) { @@ -357,7 +357,7 @@ gimp_paint_core_finish (GimpPaintCore *core, * it is not done during the actual painting. */ gimp_viewable_invalidate_preview (GIMP_VIEWABLE (drawable)); - gimp_viewable_invalidate_preview (GIMP_VIEWABLE (gimage)); + gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image)); } static void @@ -695,13 +695,13 @@ gimp_paint_core_paste (GimpPaintCore *core, GimpLayerModeEffects paint_mode, GimpPaintApplicationMode mode) { - GimpImage *gimage; + GimpImage *image; PixelRegion srcPR; TileManager *alt = NULL; gint offx; gint offy; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* set undo blocks */ gimp_paint_core_validate_undo_tiles (core, drawable, @@ -712,7 +712,7 @@ gimp_paint_core_paste (GimpPaintCore *core, if (core->use_saved_proj) { - GimpPickable *pickable = GIMP_PICKABLE (gimage->projection); + GimpPickable *pickable = GIMP_PICKABLE (image->projection); gint off_x; gint off_y; @@ -762,7 +762,7 @@ gimp_paint_core_paste (GimpPaintCore *core, core->canvas_buf->width, core->canvas_buf->height); - /* apply the paint area to the gimage */ + /* apply the paint area to the image */ gimp_drawable_apply_region (drawable, &srcPR, FALSE, NULL, image_opacity, paint_mode, @@ -776,12 +776,12 @@ gimp_paint_core_paste (GimpPaintCore *core, core->x2 = MAX (core->x2, core->canvas_buf->x + core->canvas_buf->width); core->y2 = MAX (core->y2, core->canvas_buf->y + core->canvas_buf->height); - /* Update the gimage -- It is important to call gimp_image_update() + /* Update the image -- It is important to call gimp_image_update() * instead of gimp_drawable_update() because we don't want the * drawable and image previews to be constantly invalidated */ gimp_item_offsets (GIMP_ITEM (drawable), &offx, &offy); - gimp_image_update (gimage, + gimp_image_update (image, core->canvas_buf->x + offx, core->canvas_buf->y + offy, core->canvas_buf->width, @@ -804,7 +804,7 @@ gimp_paint_core_replace (GimpPaintCore *core, gdouble image_opacity, GimpPaintApplicationMode mode) { - GimpImage *gimage; + GimpImage *image; PixelRegion srcPR; gint offx; gint offy; @@ -818,7 +818,7 @@ gimp_paint_core_replace (GimpPaintCore *core, return; } - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); /* set undo blocks */ gimp_paint_core_validate_undo_tiles (core, drawable, @@ -864,7 +864,7 @@ gimp_paint_core_replace (GimpPaintCore *core, core->canvas_buf->width, core->canvas_buf->height); - /* apply the paint area to the gimage */ + /* apply the paint area to the image */ gimp_drawable_replace_region (drawable, &srcPR, FALSE, NULL, image_opacity, @@ -878,12 +878,12 @@ gimp_paint_core_replace (GimpPaintCore *core, core->x2 = MAX (core->x2, core->canvas_buf->x + core->canvas_buf->width) ; core->y2 = MAX (core->y2, core->canvas_buf->y + core->canvas_buf->height) ; - /* Update the gimage -- It is important to call gimp_image_update() + /* Update the image -- It is important to call gimp_image_update() * instead of gimp_drawable_update() because we don't want the * drawable and image previews to be constantly invalidated */ gimp_item_offsets (GIMP_ITEM (drawable), &offx, &offy); - gimp_image_update (gimage, + gimp_image_update (image, core->canvas_buf->x + offx, core->canvas_buf->y + offy, core->canvas_buf->width, diff --git a/app/paint/gimppaintcore.h b/app/paint/gimppaintcore.h index 851d38aea4..dc9f70fcb5 100644 --- a/app/paint/gimppaintcore.h +++ b/app/paint/gimppaintcore.h @@ -100,7 +100,7 @@ struct _GimpPaintCoreClass GimpPaintOptions *paint_options); gboolean (* push_undo) (GimpPaintCore *core, - GimpImage *gimage, + GimpImage *image, const gchar *undo_desc); }; diff --git a/app/paint/gimppaintoptions.c b/app/paint/gimppaintoptions.c index 81434b91c6..f9994ed73f 100644 --- a/app/paint/gimppaintoptions.c +++ b/app/paint/gimppaintoptions.c @@ -540,14 +540,14 @@ gimp_paint_options_new (GimpPaintInfo *paint_info) gdouble gimp_paint_options_get_fade (GimpPaintOptions *paint_options, - GimpImage *gimage, + GimpImage *image, gdouble pixel_dist) { GimpFadeOptions *fade_options; g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), GIMP_OPACITY_OPAQUE); - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), GIMP_OPACITY_OPAQUE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), GIMP_OPACITY_OPAQUE); fade_options = paint_options->fade_options; @@ -562,14 +562,14 @@ gimp_paint_options_get_fade (GimpPaintOptions *paint_options, fade_out = fade_options->fade_length; break; case GIMP_UNIT_PERCENT: - fade_out = (MAX (gimage->width, gimage->height) * + fade_out = (MAX (image->width, image->height) * fade_options->fade_length / 100); break; default: unit_factor = gimp_unit_get_factor (fade_options->fade_unit); fade_out = (fade_options->fade_length * - MAX (gimage->xresolution, - gimage->yresolution) / unit_factor); + MAX (image->xresolution, + image->yresolution) / unit_factor); break; } @@ -592,7 +592,7 @@ gimp_paint_options_get_fade (GimpPaintOptions *paint_options, gdouble gimp_paint_options_get_jitter (GimpPaintOptions *paint_options, - GimpImage *gimage) + GimpImage *image) { GimpJitterOptions *jitter_options; @@ -606,7 +606,7 @@ gimp_paint_options_get_jitter (GimpPaintOptions *paint_options, gboolean gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options, - GimpImage *gimage, + GimpImage *image, gdouble pressure, gdouble pixel_dist, GimpRGB *color) @@ -616,7 +616,7 @@ gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options, GimpGradient *gradient; g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), FALSE); - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE); + g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE); g_return_val_if_fail (color != NULL, FALSE); pressure_options = paint_options->pressure_options; @@ -644,14 +644,14 @@ gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options, gradient_length = gradient_options->gradient_length; break; case GIMP_UNIT_PERCENT: - gradient_length = (MAX (gimage->width, gimage->height) * + gradient_length = (MAX (image->width, image->height) * gradient_options->gradient_length / 100); break; default: unit_factor = gimp_unit_get_factor (gradient_options->gradient_unit); gradient_length = (gradient_options->gradient_length * - MAX (gimage->xresolution, - gimage->yresolution) / unit_factor); + MAX (image->xresolution, + image->yresolution) / unit_factor); break; } diff --git a/app/paint/gimppaintoptions.h b/app/paint/gimppaintoptions.h index ea8a0fdb8c..647bf6ab21 100644 --- a/app/paint/gimppaintoptions.h +++ b/app/paint/gimppaintoptions.h @@ -114,17 +114,17 @@ GType gimp_paint_options_get_type (void) G_GNUC_CONST; GimpPaintOptions * gimp_paint_options_new (GimpPaintInfo *paint_info); gdouble gimp_paint_options_get_fade (GimpPaintOptions *paint_options, - GimpImage *gimage, + GimpImage *image, gdouble pixel_dist); gboolean gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options, - GimpImage *gimage, + GimpImage *image, gdouble pressure, gdouble pixel_dist, GimpRGB *color); gdouble gimp_paint_options_get_jitter (GimpPaintOptions *paint_options, - GimpImage *gimage); + GimpImage *image); GimpBrushApplicationMode gimp_paint_options_get_brush_mode (GimpPaintOptions *paint_options); diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c index feb68ca0e9..2f2f6f2563 100644 --- a/app/paint/gimpsmudge.c +++ b/app/paint/gimpsmudge.c @@ -157,13 +157,13 @@ gimp_smudge_start (GimpPaintCore *paint_core, GimpPaintOptions *paint_options) { GimpSmudge *smudge = GIMP_SMUDGE (paint_core); - GimpImage *gimage; + GimpImage *image; TempBuf *area; PixelRegion srcPR; gint bytes; gint x, y, w, h; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); if (gimp_drawable_is_indexed (drawable)) return FALSE; @@ -233,19 +233,19 @@ gimp_smudge_motion (GimpPaintCore *paint_core, GimpSmudgeOptions *options = GIMP_SMUDGE_OPTIONS (paint_options); GimpContext *context = GIMP_CONTEXT (paint_options); GimpPressureOptions *pressure_options = paint_options->pressure_options; - GimpImage *gimage; + GimpImage *image; TempBuf *area; PixelRegion srcPR, destPR, tempPR; gdouble rate; gdouble opacity; gint x, y, w, h; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); if (gimp_drawable_is_indexed (drawable)) return; - opacity = gimp_paint_options_get_fade (paint_options, gimage, + opacity = gimp_paint_options_get_fade (paint_options, image, paint_core->pixel_dist); if (opacity == 0.0) return; diff --git a/app/paint/gimpsourcecore.c b/app/paint/gimpsourcecore.c index 7a987e16ee..05609817df 100644 --- a/app/paint/gimpsourcecore.c +++ b/app/paint/gimpsourcecore.c @@ -220,8 +220,8 @@ gimp_clone_motion (GimpPaintCore *paint_core, GimpCloneOptions *options = GIMP_CLONE_OPTIONS (paint_options); GimpContext *context = GIMP_CONTEXT (paint_options); GimpPressureOptions *pressure_options = paint_options->pressure_options; - GimpImage *gimage; - GimpImage *src_gimage = NULL; + GimpImage *image; + GimpImage *src_image = NULL; GimpPickable *src_pickable = NULL; guchar *s; guchar *d; @@ -236,9 +236,9 @@ gimp_clone_motion (GimpPaintCore *paint_core, gint offset_x; gint offset_y; - gimage = gimp_item_get_image (GIMP_ITEM (drawable)); + image = gimp_item_get_image (GIMP_ITEM (drawable)); - opacity = gimp_paint_options_get_fade (paint_options, gimage, + opacity = gimp_paint_options_get_fade (paint_options, image, paint_core->pixel_dist); if (opacity == 0.0) return; @@ -254,13 +254,13 @@ gimp_clone_motion (GimpPaintCore *paint_core, return; src_pickable = GIMP_PICKABLE (clone->src_drawable); - src_gimage = gimp_pickable_get_image (src_pickable); + src_image = gimp_pickable_get_image (src_pickable); if (options->sample_merged) { gint off_x, off_y; - src_pickable = GIMP_PICKABLE (src_gimage->projection); + src_pickable = GIMP_PICKABLE (src_image->projection); gimp_item_offsets (GIMP_ITEM (clone->src_drawable), &off_x, &off_y); @@ -295,13 +295,13 @@ gimp_clone_motion (GimpPaintCore *paint_core, if (!(x2 - x1) || !(y2 - y1)) return; - /* If the source gimage is different from the destination, + /* If the source image is different from the destination, * then we should copy straight from the destination image * to the canvas. * Otherwise, we need a call to get_orig_image to make sure * we get a copy of the unblemished (offset) image */ - if (( options->sample_merged && (src_gimage != gimage)) || + if (( options->sample_merged && (src_image != image)) || (! options->sample_merged && (clone->src_drawable != drawable))) { pixel_region_init (&srcPR, src_tiles, @@ -359,7 +359,7 @@ gimp_clone_motion (GimpPaintCore *paint_core, switch (options->clone_type) { case GIMP_IMAGE_CLONE: - gimp_clone_line_image (gimage, src_gimage, + gimp_clone_line_image (image, src_image, drawable, src_pickable, s, d, srcPR.bytes, destPR.bytes, destPR.w); @@ -367,7 +367,7 @@ gimp_clone_motion (GimpPaintCore *paint_core, break; case GIMP_PATTERN_CLONE: - gimp_clone_line_pattern (gimage, drawable, + gimp_clone_line_pattern (image, drawable, pattern, d, area->x + offset_x, area->y + y + offset_y, diff --git a/app/text/gimptext-compat.c b/app/text/gimptext-compat.c index 04a102d603..d5ab1f6cc2 100644 --- a/app/text/gimptext-compat.c +++ b/app/text/gimptext-compat.c @@ -47,7 +47,7 @@ GimpLayer * -text_render (GimpImage *gimage, +text_render (GimpImage *image, GimpDrawable *drawable, GimpContext *context, gint text_x, @@ -64,7 +64,7 @@ text_render (GimpImage *gimage, gchar *font; gdouble size; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), NULL); g_return_val_if_fail (drawable == NULL || gimp_item_is_attached (GIMP_ITEM (drawable)), NULL); @@ -96,7 +96,7 @@ text_render (GimpImage *gimage, g_free (font); - layer = gimp_text_layer_new (gimage, gtext); + layer = gimp_text_layer_new (image, gtext); g_object_unref (gtext); @@ -104,7 +104,7 @@ text_render (GimpImage *gimage, return NULL; /* Start a group undo */ - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_TEXT, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TEXT, _("Add Text Layer")); /* Set the layer offsets */ @@ -115,18 +115,18 @@ text_render (GimpImage *gimage, * this might not always be desired, but in general, * it seems like the correct behavior. */ - if (! gimp_channel_is_empty (gimp_image_get_mask (gimage))) - gimp_channel_clear (gimp_image_get_mask (gimage), NULL, TRUE); + if (! gimp_channel_is_empty (gimp_image_get_mask (image))) + gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE); /* If the drawable is NULL, create a new layer */ if (drawable == NULL) - gimp_image_add_layer (gimage, layer, -1); + gimp_image_add_layer (image, layer, -1); /* Otherwise, instantiate the text as the new floating selection */ else floating_sel_attach (layer, drawable); /* end the group undo */ - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); return layer; } diff --git a/app/text/gimptext-compat.h b/app/text/gimptext-compat.h index 94a9cbc85f..e5e2de44ba 100644 --- a/app/text/gimptext-compat.h +++ b/app/text/gimptext-compat.h @@ -25,7 +25,7 @@ /* convenience functions that provide the 1.2 API, only used by the PDB */ -GimpLayer * text_render (GimpImage *gimage, +GimpLayer * text_render (GimpImage *image, GimpDrawable *drawable, GimpContext *context, gint text_x, diff --git a/app/text/gimptextlayer-xcf.c b/app/text/gimptextlayer-xcf.c index aa29126f9b..470478c35d 100644 --- a/app/text/gimptextlayer-xcf.c +++ b/app/text/gimptextlayer-xcf.c @@ -190,10 +190,10 @@ gimp_text_layer_from_layer (GimpLayer *layer, item->ID = gimp_item_get_ID (GIMP_ITEM (layer)); item->tattoo = gimp_item_get_tattoo (GIMP_ITEM (layer)); - item->gimage = gimp_item_get_image (GIMP_ITEM (layer)); + item->image = gimp_item_get_image (GIMP_ITEM (layer)); gimp_item_set_image (GIMP_ITEM (layer), NULL); - g_hash_table_replace (item->gimage->gimp->item_table, + g_hash_table_replace (item->image->gimp->item_table, GINT_TO_POINTER (item->ID), item); diff --git a/app/text/gimptextlayer.c b/app/text/gimptextlayer.c index 704f8a9e2f..67b58faed0 100644 --- a/app/text/gimptextlayer.c +++ b/app/text/gimptextlayer.c @@ -300,11 +300,11 @@ gimp_text_layer_set_tiles (GimpDrawable *drawable, gint offset_x, gint offset_y) { - GimpTextLayer *layer = GIMP_TEXT_LAYER (drawable); - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); + GimpTextLayer *layer = GIMP_TEXT_LAYER (drawable); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer)); if (push_undo && ! layer->modified) - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_DRAWABLE_MOD, + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_DRAWABLE_MOD, undo_desc); GIMP_DRAWABLE_CLASS (parent_class)->set_tiles (drawable, @@ -314,11 +314,11 @@ gimp_text_layer_set_tiles (GimpDrawable *drawable, if (push_undo && ! layer->modified) { - gimp_image_undo_push_text_layer_modified (gimage, NULL, layer); + gimp_image_undo_push_text_layer_modified (image, NULL, layer); g_object_set (drawable, "modified", TRUE, NULL); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } } @@ -332,11 +332,11 @@ gimp_text_layer_push_undo (GimpDrawable *drawable, gint width, gint height) { - GimpTextLayer *layer = GIMP_TEXT_LAYER (drawable); - GimpImage *gimage = gimp_item_get_image (GIMP_ITEM (layer)); + GimpTextLayer *layer = GIMP_TEXT_LAYER (drawable); + GimpImage *image = gimp_item_get_image (GIMP_ITEM (layer)); if (! layer->modified) - gimp_image_undo_group_start (gimage, GIMP_UNDO_GROUP_DRAWABLE, undo_desc); + gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_DRAWABLE, undo_desc); GIMP_DRAWABLE_CLASS (parent_class)->push_undo (drawable, undo_desc, tiles, sparse, @@ -344,11 +344,11 @@ gimp_text_layer_push_undo (GimpDrawable *drawable, if (! layer->modified) { - gimp_image_undo_push_text_layer_modified (gimage, NULL, layer); + gimp_image_undo_push_text_layer_modified (image, NULL, layer); g_object_set (drawable, "modified", TRUE, NULL); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } } diff --git a/app/tools/gimpaligntool.c b/app/tools/gimpaligntool.c index 9c2f5078a1..c1c9055fb9 100644 --- a/app/tools/gimpaligntool.c +++ b/app/tools/gimpaligntool.c @@ -282,9 +282,8 @@ gimp_align_tool_button_press (GimpTool *tool, GimpLayer *layer; - if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, - coords->x, - coords->y))) + if ((layer = gimp_image_pick_correlate_layer (gdisp->image, + coords->x, coords->y))) { item = GIMP_ITEM (layer); } @@ -354,18 +353,18 @@ gimp_align_tool_cursor_update (GimpTool *tool, { GimpLayer *layer; - if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, - coords->x, coords->y))) + if ((layer = gimp_image_pick_correlate_layer (gdisp->image, + coords->x, coords->y))) { /* if there is a floating selection, and this aint it... */ - if (gimp_image_floating_sel (gdisp->gimage) && + if (gimp_image_floating_sel (gdisp->image) && ! gimp_layer_is_floating_sel (layer)) { cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_MOVE; modifier = GIMP_CURSOR_MODIFIER_ANCHOR; } - else if (layer == gimp_image_get_active_layer (gdisp->gimage)) + else if (layer == gimp_image_get_active_layer (gdisp->image)) { cursor = GIMP_CURSOR_MOUSE; } @@ -592,7 +591,7 @@ do_horizontal_alignment (GtkWidget *widget, align_tool->horz_offset); if (GIMP_TOOL (align_tool)->gdisp) - gimp_image_flush (GIMP_TOOL (align_tool)->gdisp->gimage); + gimp_image_flush (GIMP_TOOL (align_tool)->gdisp->image); gimp_draw_tool_resume (GIMP_DRAW_TOOL (align_tool)); } @@ -614,7 +613,7 @@ do_vertical_alignment (GtkWidget *widget, align_tool->vert_offset); if (GIMP_TOOL (align_tool)->gdisp) - gimp_image_flush (GIMP_TOOL (align_tool)->gdisp->gimage); + gimp_image_flush (GIMP_TOOL (align_tool)->gdisp->image); gimp_draw_tool_resume (GIMP_DRAW_TOOL (align_tool)); } diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c index 7d87c52e19..3a8dac7fac 100644 --- a/app/tools/gimpblendtool.c +++ b/app/tools/gimpblendtool.c @@ -140,7 +140,7 @@ gimp_blend_tool_button_press (GimpTool *tool, GimpDrawable *drawable; gint off_x, off_y; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); switch (gimp_drawable_type (drawable)) { @@ -180,13 +180,13 @@ gimp_blend_tool_button_release (GimpTool *tool, GimpPaintOptions *paint_options; GimpBlendOptions *options; GimpContext *context; - GimpImage *gimage; + GimpImage *image; paint_options = GIMP_PAINT_OPTIONS (tool->tool_info->tool_options); options = GIMP_BLEND_OPTIONS (paint_options); context = GIMP_CONTEXT (options); - gimage = gdisp->gimage; + image = gdisp->image; gimp_tool_pop_status (tool, gdisp); @@ -204,7 +204,7 @@ gimp_blend_tool_button_release (GimpTool *tool, progress = gimp_progress_start (GIMP_PROGRESS (gdisp), _("Blending"), FALSE); - gimp_drawable_blend (gimp_image_active_drawable (gimage), + gimp_drawable_blend (gimp_image_active_drawable (image), context, GIMP_CUSTOM_MODE, gimp_context_get_paint_mode (context), @@ -226,7 +226,7 @@ gimp_blend_tool_button_release (GimpTool *tool, if (progress) gimp_progress_end (progress); - gimp_image_flush (gimage); + gimp_image_flush (image); } } @@ -242,7 +242,7 @@ gimp_blend_tool_motion (GimpTool *tool, gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); - gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (gdisp->gimage)), + gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (gdisp->image)), &off_x, &off_y); /* Get the current coordinates */ @@ -272,7 +272,7 @@ gimp_blend_tool_cursor_update (GimpTool *tool, GdkModifierType state, GimpDisplay *gdisp) { - switch (gimp_drawable_type (gimp_image_active_drawable (gdisp->gimage))) + switch (gimp_drawable_type (gimp_image_active_drawable (gdisp->image))) { case GIMP_INDEXED_IMAGE: case GIMP_INDEXEDA_IMAGE: diff --git a/app/tools/gimpbrightnesscontrasttool.c b/app/tools/gimpbrightnesscontrasttool.c index 246e0eebf7..153649becd 100644 --- a/app/tools/gimpbrightnesscontrasttool.c +++ b/app/tools/gimpbrightnesscontrasttool.c @@ -154,7 +154,7 @@ gimp_brightness_contrast_tool_initialize (GimpTool *tool, GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (! drawable) return FALSE; diff --git a/app/tools/gimpbrushtool.c b/app/tools/gimpbrushtool.c index bc060797a0..1f77d94d67 100644 --- a/app/tools/gimpbrushtool.c +++ b/app/tools/gimpbrushtool.c @@ -265,7 +265,7 @@ gimp_paint_tool_control (GimpTool *tool, GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); switch (action) { @@ -290,7 +290,7 @@ gimp_paint_tool_control (GimpTool *tool, { GimpDisplay *tmp_disp = list->data; - if (tmp_disp != gdisp && tmp_disp->gimage == gdisp->gimage) + if (tmp_disp != gdisp && tmp_disp->image == gdisp->image) { tool->gdisp = tmp_disp; break; @@ -360,7 +360,7 @@ gimp_paint_tool_button_press (GimpTool *tool, core = paint_tool->core; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); curr_coords = *coords; @@ -374,7 +374,7 @@ gimp_paint_tool_button_press (GimpTool *tool, if (tool->gdisp && tool->gdisp != gdisp && - tool->gdisp->gimage == gdisp->gimage) + tool->gdisp->image == gdisp->image) { /* if this is a different display, but the same image, HACK around * in tool internals AFTER stopping the current draw_tool, so @@ -387,7 +387,7 @@ gimp_paint_tool_button_press (GimpTool *tool, gdk_display = gtk_widget_get_display (gdisp->shell); - core->use_pressure = (gimp_devices_get_current (gdisp->gimage->gimp) != + core->use_pressure = (gimp_devices_get_current (gdisp->image->gimp) != gdk_display_get_core_pointer (gdk_display)); if (! gimp_paint_core_start (core, drawable, paint_options, &curr_coords)) @@ -425,7 +425,7 @@ gimp_paint_tool_button_press (GimpTool *tool, return; /* pause the current selection */ - gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_PAUSE); + gimp_image_selection_control (gdisp->image, GIMP_SELECTION_PAUSE); /* Let the specific painting function initialize itself */ gimp_paint_core_paint (core, drawable, paint_options, @@ -442,7 +442,7 @@ gimp_paint_tool_button_press (GimpTool *tool, GIMP_PAINT_STATE_MOTION, time); } - gimp_projection_flush_now (gdisp->gimage->projection); + gimp_projection_flush_now (gdisp->image->projection); gimp_display_flush_now (gdisp); gimp_draw_tool_start (draw_tool, gdisp); @@ -464,7 +464,7 @@ gimp_paint_tool_button_release (GimpTool *tool, core = paint_tool->core; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); @@ -473,7 +473,7 @@ gimp_paint_tool_button_release (GimpTool *tool, GIMP_PAINT_STATE_FINISH, time); /* resume the current selection */ - gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_RESUME); + gimp_image_selection_control (gdisp->image, GIMP_SELECTION_RESUME); /* chain up to halt the tool */ GIMP_TOOL_CLASS (parent_class)->button_release (tool, @@ -484,7 +484,7 @@ gimp_paint_tool_button_release (GimpTool *tool, else gimp_paint_core_finish (core, drawable); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); } @@ -506,7 +506,7 @@ gimp_paint_tool_motion (GimpTool *tool, core = paint_tool->core; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); core->cur_coords = *coords; @@ -524,7 +524,7 @@ gimp_paint_tool_motion (GimpTool *tool, gimp_paint_core_interpolate (core, drawable, paint_options, time); - gimp_projection_flush_now (gdisp->gimage->projection); + gimp_projection_flush_now (gdisp->image->projection); gimp_display_flush_now (gdisp); paint_tool->brush_x = coords->x; @@ -553,7 +553,7 @@ gimp_paint_tool_modifier_key (GimpTool *tool, GimpContainer *tool_info_list; GimpToolInfo *info; - tool_info_list = gdisp->gimage->gimp->tool_info_list; + tool_info_list = gdisp->image->gimp->tool_info_list; info = (GimpToolInfo *) gimp_container_get_child_by_name (tool_info_list, @@ -610,7 +610,7 @@ gimp_paint_tool_oper_update (GimpTool *tool, if (tool->gdisp && tool->gdisp != gdisp && - tool->gdisp->gimage == gdisp->gimage) + tool->gdisp->image == gdisp->image) { /* if this is a different display, but the same image, HACK around * in tool internals AFTER stopping the current draw_tool, so @@ -621,7 +621,7 @@ gimp_paint_tool_oper_update (GimpTool *tool, tool->gdisp = gdisp; } - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (drawable && proximity) { @@ -660,7 +660,7 @@ gimp_paint_tool_oper_update (GimpTool *tool, } else { - GimpImage *image = gdisp->gimage; + GimpImage *image = gdisp->image; gchar format_str[64]; g_snprintf (format_str, sizeof (format_str), "%%.%df %s", @@ -852,7 +852,7 @@ gimp_paint_tool_color_picked (GimpColorTool *color_tool, if (tool->gdisp) { - GimpContext *context = gimp_get_user_context (tool->gdisp->gimage->gimp); + GimpContext *context = gimp_get_user_context (tool->gdisp->image->gimp); switch (color_tool->pick_mode) { diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c index b6c3c03813..a4775e17ea 100644 --- a/app/tools/gimpbucketfilltool.c +++ b/app/tools/gimpbucketfilltool.c @@ -138,7 +138,7 @@ gimp_bucket_fill_tool_button_press (GimpTool *tool, { gint off_x, off_y; - gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (gdisp->gimage)), + gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (gdisp->image)), &off_x, &off_y); bucket_tool->target_x -= off_x; @@ -166,7 +166,7 @@ gimp_bucket_fill_tool_button_release (GimpTool *tool, /* if the 3rd button isn't pressed, fill the selected region */ if (! (state & GDK_BUTTON3_MASK)) { - gimp_drawable_bucket_fill (gimp_image_active_drawable (gdisp->gimage), + gimp_drawable_bucket_fill (gimp_image_active_drawable (gdisp->image), context, options->fill_mode, gimp_context_get_paint_mode (context), @@ -178,7 +178,7 @@ gimp_bucket_fill_tool_button_release (GimpTool *tool, bucket_tool->target_x, bucket_tool->target_y); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } gimp_tool_control_halt (tool->control); @@ -228,9 +228,9 @@ gimp_bucket_fill_tool_cursor_update (GimpTool *tool, options = GIMP_BUCKET_FILL_OPTIONS (tool->tool_info->tool_options); - if (gimp_image_coords_in_active_drawable (gdisp->gimage, coords)) + if (gimp_image_coords_in_active_drawable (gdisp->image, coords)) { - GimpChannel *selection = gimp_image_get_mask (gdisp->gimage); + GimpChannel *selection = gimp_image_get_mask (gdisp->image); /* One more test--is there a selected region? * if so, is cursor inside? diff --git a/app/tools/gimpbycolorselecttool.c b/app/tools/gimpbycolorselecttool.c index 747fe9b68f..990e981a6d 100644 --- a/app/tools/gimpbycolorselecttool.c +++ b/app/tools/gimpbycolorselecttool.c @@ -116,7 +116,7 @@ gimp_by_color_select_tool_button_press (GimpTool *tool, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - tool->drawable = gimp_image_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->image); gimp_tool_control_activate (tool->control); tool->gdisp = gdisp; @@ -128,7 +128,7 @@ gimp_by_color_select_tool_button_press (GimpTool *tool, { gint off_x, off_y; - gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (gdisp->gimage)), + gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (gdisp->image)), &off_x, &off_y); by_color_sel->x -= off_x; @@ -149,7 +149,7 @@ gimp_by_color_select_tool_button_release (GimpTool *tool, GimpDrawable *drawable; options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); gimp_tool_control_halt (tool->control); @@ -166,7 +166,7 @@ gimp_by_color_select_tool_button_release (GimpTool *tool, guchar *col; if (options->sample_merged) - pickable = GIMP_PICKABLE (gdisp->gimage->projection); + pickable = GIMP_PICKABLE (gdisp->image->projection); else pickable = GIMP_PICKABLE (drawable); @@ -183,7 +183,7 @@ gimp_by_color_select_tool_button_release (GimpTool *tool, gimp_rgba_set_uchar (&color, col[0], col[1], col[2], col[3]); g_free (col); - gimp_channel_select_by_color (gimp_image_get_mask (gdisp->gimage), + gimp_channel_select_by_color (gimp_image_get_mask (gdisp->image), drawable, options->sample_merged, &color, @@ -194,7 +194,7 @@ gimp_by_color_select_tool_button_release (GimpTool *tool, options->feather, options->feather_radius, options->feather_radius); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } } } @@ -243,10 +243,10 @@ gimp_by_color_select_tool_cursor_update (GimpTool *tool, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - layer = gimp_image_pick_correlate_layer (gdisp->gimage, coords->x, coords->y); + layer = gimp_image_pick_correlate_layer (gdisp->image, coords->x, coords->y); if (! options->sample_merged && - layer && layer != gdisp->gimage->active_layer) + layer && layer != gdisp->image->active_layer) { gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD); } diff --git a/app/tools/gimpclonetool.c b/app/tools/gimpclonetool.c index 6e0667bf6f..00ca248423 100644 --- a/app/tools/gimpclonetool.c +++ b/app/tools/gimpclonetool.c @@ -197,9 +197,9 @@ gimp_clone_tool_cursor_update (GimpTool *tool, options = (GimpCloneOptions *) tool->tool_info->tool_options; - if (gimp_image_coords_in_active_drawable (gdisp->gimage, coords)) + if (gimp_image_coords_in_active_drawable (gdisp->image, coords)) { - GimpChannel *selection = gimp_image_get_mask (gdisp->gimage); + GimpChannel *selection = gimp_image_get_mask (gdisp->image); /* One more test--is there a selected region? * if so, is cursor inside? diff --git a/app/tools/gimpcolorbalancetool.c b/app/tools/gimpcolorbalancetool.c index 8b92d4d16c..c4dd8bb04b 100644 --- a/app/tools/gimpcolorbalancetool.c +++ b/app/tools/gimpcolorbalancetool.c @@ -146,7 +146,7 @@ gimp_color_balance_tool_initialize (GimpTool *tool, GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (! drawable) return FALSE; diff --git a/app/tools/gimpcolorizetool.c b/app/tools/gimpcolorizetool.c index db4ecf3b57..24ccc926f8 100644 --- a/app/tools/gimpcolorizetool.c +++ b/app/tools/gimpcolorizetool.c @@ -143,7 +143,7 @@ gimp_colorize_tool_initialize (GimpTool *tool, GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (! drawable) return FALSE; diff --git a/app/tools/gimpcolorpickertool.c b/app/tools/gimpcolorpickertool.c index a92de605fa..382911fbe1 100644 --- a/app/tools/gimpcolorpickertool.c +++ b/app/tools/gimpcolorpickertool.c @@ -262,7 +262,7 @@ gimp_color_picker_tool_picked (GimpColorTool *color_tool, gimp_color_picker_tool_info_update (picker_tool, sample_type, color, color_index); - user_context = gimp_get_user_context (tool->gdisp->gimage->gimp); + user_context = gimp_get_user_context (tool->gdisp->image->gimp); if ((options->pick_mode == GIMP_COLOR_PICK_MODE_FOREGROUND || options->pick_mode == GIMP_COLOR_PICK_MODE_BACKGROUND) && diff --git a/app/tools/gimpcolortool.c b/app/tools/gimpcolortool.c index 4fa26be086..cc951fef16 100644 --- a/app/tools/gimpcolortool.c +++ b/app/tools/gimpcolortool.c @@ -223,7 +223,7 @@ gimp_color_tool_button_press (GimpTool *tool, /* Make the tool active and set its gdisplay & drawable */ tool->gdisp = gdisp; - tool->drawable = gimp_image_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->image); gimp_tool_control_activate (tool->control); if (! color_tool->enabled) @@ -305,7 +305,7 @@ gimp_color_tool_button_release (GimpTool *tool, { if (color_tool->sample_point) { - gimp_image_remove_sample_point (gdisp->gimage, + gimp_image_remove_sample_point (gdisp->image, color_tool->sample_point, TRUE); color_tool->sample_point = NULL; } @@ -314,7 +314,7 @@ gimp_color_tool_button_release (GimpTool *tool, { if (color_tool->sample_point) { - gimp_image_move_sample_point (gdisp->gimage, + gimp_image_move_sample_point (gdisp->image, color_tool->sample_point, color_tool->sample_point_x, color_tool->sample_point_y, @@ -323,7 +323,7 @@ gimp_color_tool_button_release (GimpTool *tool, else { color_tool->sample_point = - gimp_image_add_sample_point_at_pos (gdisp->gimage, + gimp_image_add_sample_point_at_pos (gdisp->image, color_tool->sample_point_x, color_tool->sample_point_y, TRUE); @@ -331,7 +331,7 @@ gimp_color_tool_button_release (GimpTool *tool, } gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_RESUME); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); if (color_tool->sample_point) gimp_display_shell_draw_sample_point (shell, color_tool->sample_point, @@ -456,17 +456,17 @@ gimp_color_tool_oper_update (GimpTool *tool, gint snap_distance; snap_distance = - GIMP_DISPLAY_CONFIG (gdisp->gimage->gimp->config)->snap_distance; + GIMP_DISPLAY_CONFIG (gdisp->image->gimp->config)->snap_distance; sample_point = - gimp_image_find_sample_point (gdisp->gimage, + gimp_image_find_sample_point (gdisp->image, coords->x, coords->y, FUNSCALEX (shell, snap_distance), FUNSCALEY (shell, snap_distance)); } if (color_tool->sample_point && color_tool->sample_point != sample_point) - gimp_image_update_sample_point (shell->gdisp->gimage, + gimp_image_update_sample_point (shell->gdisp->image, color_tool->sample_point); color_tool->sample_point = sample_point; @@ -498,11 +498,11 @@ gimp_color_tool_cursor_update (GimpTool *tool, GimpCursorType cursor = GIMP_CURSOR_BAD; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; - if (coords->x > 0 && coords->x < gdisp->gimage->width && - coords->y > 0 && coords->y < gdisp->gimage->height && + if (coords->x > 0 && coords->x < gdisp->image->width && + coords->y > 0 && coords->y < gdisp->image->height && (color_tool->options->sample_merged || - gimp_image_coords_in_active_drawable (gdisp->gimage, coords))) + gimp_image_coords_in_active_drawable (gdisp->image, coords))) { cursor = GIMP_CURSOR_MOUSE; } @@ -549,13 +549,13 @@ gimp_color_tool_draw (GimpDrawTool *draw_tool) { gimp_draw_tool_draw_line (draw_tool, 0, color_tool->sample_point_y + 0.5, - draw_tool->gdisp->gimage->width, + draw_tool->gdisp->image->width, color_tool->sample_point_y + 0.5, FALSE); gimp_draw_tool_draw_line (draw_tool, color_tool->sample_point_x + 0.5, 0, color_tool->sample_point_x + 0.5, - draw_tool->gdisp->gimage->height, + draw_tool->gdisp->image->height, FALSE); } } @@ -589,7 +589,7 @@ gimp_color_tool_real_pick (GimpColorTool *color_tool, g_return_val_if_fail (tool->gdisp != NULL, FALSE); g_return_val_if_fail (tool->drawable != NULL, FALSE); - return gimp_image_pick_color (tool->gdisp->gimage, tool->drawable, x, y, + return gimp_image_pick_color (tool->gdisp->image, tool->drawable, x, y, color_tool->options->sample_merged, color_tool->options->sample_average, color_tool->options->average_radius, diff --git a/app/tools/gimpcroptool.c b/app/tools/gimpcroptool.c index cf05b3cc22..2ae70cb7df 100644 --- a/app/tools/gimpcroptool.c +++ b/app/tools/gimpcroptool.c @@ -244,7 +244,7 @@ gimp_crop_tool_execute (GimpRectangleTool *rectangle, { GimpTool *tool = GIMP_TOOL (rectangle); GimpCropOptions *options; - GimpImage *gimage; + GimpImage *image; gint max_x, max_y; gboolean rectangle_exists; @@ -252,9 +252,9 @@ gimp_crop_tool_execute (GimpRectangleTool *rectangle, gimp_tool_pop_status (tool, tool->gdisp); - gimage = tool->gdisp->gimage; - max_x = gimage->width; - max_y = gimage->height; + image = tool->gdisp->image; + max_x = image->width; + max_y = image->height; rectangle_exists = (x <= max_x && y <= max_y && x + w >= 0 && y + h >= 0 && @@ -281,12 +281,12 @@ gimp_crop_tool_execute (GimpRectangleTool *rectangle, /* if rectangle exists, crop it */ if (rectangle_exists) { - gimp_image_crop (gimage, GIMP_CONTEXT (options), + gimp_image_crop (image, GIMP_CONTEXT (options), x, y, w + x, h + y, options->layer_only, options->crop_mode == GIMP_CROP_MODE_CROP); - gimp_image_flush (gimage); + gimp_image_flush (image); return TRUE; } diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c index 508ff18739..6d5ad1992a 100644 --- a/app/tools/gimpcurvestool.c +++ b/app/tools/gimpcurvestool.c @@ -243,7 +243,7 @@ gimp_curves_tool_initialize (GimpTool *tool, GimpCurvesTool *c_tool = GIMP_CURVES_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (! drawable) return FALSE; @@ -302,7 +302,7 @@ gimp_curves_tool_button_release (GimpTool *tool, GimpCurvesTool *c_tool = GIMP_CURVES_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (state & GDK_SHIFT_MASK) { diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c index a3e46f8454..0a8d8de781 100644 --- a/app/tools/gimpdrawtool.c +++ b/app/tools/gimpdrawtool.c @@ -995,7 +995,7 @@ gimp_draw_tool_on_vectors (GimpDrawTool *draw_tool, if (ret_stroke) *ret_stroke = NULL; if (ret_vectors) *ret_vectors = NULL; - for (list = GIMP_LIST (gdisp->gimage->vectors)->list; + for (list = GIMP_LIST (gdisp->image->vectors)->list; list; list = g_list_next (list)) { diff --git a/app/tools/gimpeditselectiontool.c b/app/tools/gimpeditselectiontool.c index 19ba42931d..f67a26a074 100644 --- a/app/tools/gimpeditselectiontool.c +++ b/app/tools/gimpeditselectiontool.c @@ -198,14 +198,14 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool, /* Make a check to see if it should be a floating selection translation */ if (edit_mode == GIMP_TRANSLATE_MODE_MASK_TO_LAYER && - gimp_image_floating_sel (gdisp->gimage)) + gimp_image_floating_sel (gdisp->image)) { edit_mode = GIMP_TRANSLATE_MODE_FLOATING_SEL; } if (edit_mode == GIMP_TRANSLATE_MODE_LAYER) { - GimpLayer *layer = gimp_image_get_active_layer (gdisp->gimage); + GimpLayer *layer = gimp_image_get_active_layer (gdisp->image); if (gimp_layer_is_floating_sel (layer)) edit_mode = GIMP_TRANSLATE_MODE_FLOATING_SEL; @@ -214,9 +214,9 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool, edit_select->edit_mode = edit_mode; if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_VECTORS) - active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->image)); else - active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->image)); switch (edit_select->edit_mode) { @@ -236,7 +236,7 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool, break; } - gimp_image_undo_group_start (gdisp->gimage, + gimp_image_undo_group_start (gdisp->image, edit_select->edit_mode == GIMP_TRANSLATE_MODE_MASK ? GIMP_UNDO_GROUP_MASK : @@ -256,7 +256,7 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool, break; default: - channel = gimp_image_get_mask (gdisp->gimage); + channel = gimp_image_get_mask (gdisp->image); break; } @@ -277,8 +277,8 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool, { edit_select->x1 = 0; edit_select->y1 = 0; - edit_select->x2 = gdisp->gimage->width; - edit_select->y2 = gdisp->gimage->height; + edit_select->x2 = gdisp->image->width; + edit_select->y2 = gdisp->image->height; } else { @@ -316,7 +316,7 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool, break; case GIMP_TRANSLATE_MODE_MASK: - gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage), + gimp_channel_bounds (gimp_image_get_mask (gdisp->image), &x1, &y1, &x2, &y2); break; @@ -423,7 +423,7 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool, gimp_tool_control_activate (GIMP_TOOL (edit_select)->control); GIMP_TOOL (edit_select)->gdisp = gdisp; - tool_manager_push_tool (gdisp->gimage->gimp, GIMP_TOOL (edit_select)); + tool_manager_push_tool (gdisp->image->gimp, GIMP_TOOL (edit_select)); /* pause the current selection */ gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_PAUSE); @@ -455,12 +455,12 @@ gimp_edit_selection_tool_button_release (GimpTool *tool, /* Stop and free the selection core */ gimp_draw_tool_stop (GIMP_DRAW_TOOL (edit_select)); - tool_manager_pop_tool (gdisp->gimage->gimp); + tool_manager_pop_tool (gdisp->image->gimp); if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_VECTORS) - active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->image)); else - active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->image)); gimp_edit_selection_tool_calc_coords (edit_select, gdisp, coords->x, @@ -474,7 +474,7 @@ gimp_edit_selection_tool_button_release (GimpTool *tool, /* move the selection -- whether there has been movement or not! * (to ensure that there's something on the undo stack) */ - gimp_item_translate (GIMP_ITEM (gimp_image_get_mask (gdisp->gimage)), + gimp_item_translate (GIMP_ITEM (gimp_image_get_mask (gdisp->image)), edit_select->cumlx, edit_select->cumly, TRUE); @@ -524,15 +524,15 @@ gimp_edit_selection_tool_button_release (GimpTool *tool, } } - gimp_image_undo_group_end (gdisp->gimage); + gimp_image_undo_group_end (gdisp->image); if (state & GDK_BUTTON3_MASK) /* OPERATION CANCELLED */ { /* Operation cancelled - undo the undo-group! */ - gimp_image_undo (gdisp->gimage); + gimp_image_undo (gdisp->image); } - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); g_free (edit_select->segs_in); g_free (edit_select->segs_out); @@ -543,9 +543,9 @@ gimp_edit_selection_tool_button_release (GimpTool *tool, edit_select->num_segs_out = 0; if (edit_select->propagate_release && - tool_manager_get_active (gdisp->gimage->gimp)) + tool_manager_get_active (gdisp->image->gimp)) { - tool_manager_button_release_active (gdisp->gimage->gimp, + tool_manager_button_release_active (gdisp->image->gimp, coords, time, state, gdisp); } @@ -571,9 +571,9 @@ gimp_edit_selection_tool_motion (GimpTool *tool, gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_VECTORS) - active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->image)); else - active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->image)); gimp_item_offsets (active_item, &off_x, &off_y); @@ -652,9 +652,9 @@ gimp_edit_selection_tool_motion (GimpTool *tool, case GIMP_TRANSLATE_MODE_MASK_TO_LAYER: case GIMP_TRANSLATE_MODE_MASK_COPY_TO_LAYER: - if (! gimp_selection_float (gimp_image_get_mask (gdisp->gimage), + if (! gimp_selection_float (gimp_image_get_mask (gdisp->image), GIMP_DRAWABLE (active_item), - gimp_get_user_context (gdisp->gimage->gimp), + gimp_get_user_context (gdisp->image->gimp), edit_select->edit_mode == GIMP_TRANSLATE_MODE_MASK_TO_LAYER, 0, 0)) @@ -674,7 +674,7 @@ gimp_edit_selection_tool_motion (GimpTool *tool, edit_select->edit_mode = GIMP_TRANSLATE_MODE_FLOATING_SEL; - active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->image)); /* fall through */ @@ -690,7 +690,7 @@ gimp_edit_selection_tool_motion (GimpTool *tool, edit_select->first_move = FALSE; } - gimp_projection_flush (gdisp->gimage->projection); + gimp_projection_flush (gdisp->image->projection); } /********************************************************************/ /********************************************************************/ @@ -713,9 +713,9 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool) GimpItem *active_item; if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_VECTORS) - active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->image)); else - active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_active_drawable (gdisp->image)); switch (edit_select->edit_mode) { @@ -729,7 +729,7 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool) if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_MASK) { - GimpLayer *layer = gimp_image_get_active_layer (gdisp->gimage); + GimpLayer *layer = gimp_image_get_active_layer (gdisp->image); if (layer) floating_sel = gimp_layer_is_floating_sel (layer); @@ -785,7 +785,7 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool) GimpItem *active_item; gint x1, y1, x2, y2; - active_item = GIMP_ITEM (gimp_image_get_active_layer (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_get_active_layer (gdisp->image)); gimp_item_offsets (active_item, &x1, &y1); @@ -839,7 +839,7 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool) GimpItem *active_item; gdouble x1, y1, x2, y2; - active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->gimage)); + active_item = GIMP_ITEM (gimp_image_get_active_vectors (gdisp->image)); gimp_vectors_bounds (GIMP_VECTORS (active_item), &x1, &y1, &x2, &y2); @@ -1058,7 +1058,7 @@ gimp_edit_selection_tool_key_press (GimpTool *tool, if (inc_x != 0 || inc_y != 0) { - item = GIMP_ITEM (gimp_image_get_mask (gdisp->gimage)); + item = GIMP_ITEM (gimp_image_get_mask (gdisp->image)); edit_mode = GIMP_TRANSLATE_MODE_MASK; undo_type = GIMP_UNDO_GROUP_MASK; @@ -1097,7 +1097,7 @@ gimp_edit_selection_tool_key_press (GimpTool *tool, if (inc_x != 0 || inc_y != 0) { - item = (GimpItem *) gimp_image_get_active_vectors (gdisp->gimage); + item = (GimpItem *) gimp_image_get_active_vectors (gdisp->image); edit_mode = GIMP_TRANSLATE_MODE_VECTORS; undo_type = GIMP_UNDO_GROUP_ITEM_DISPLACE; @@ -1136,7 +1136,7 @@ gimp_edit_selection_tool_key_press (GimpTool *tool, if (inc_x != 0 || inc_y != 0) { - item = (GimpItem *) gimp_image_active_drawable (gdisp->gimage); + item = (GimpItem *) gimp_image_active_drawable (gdisp->image); if (item) { @@ -1178,7 +1178,7 @@ gimp_edit_selection_tool_key_press (GimpTool *tool, } /* compress undo */ - undo = gimp_image_undo_can_compress (gdisp->gimage, GIMP_TYPE_UNDO_STACK, + undo = gimp_image_undo_can_compress (gdisp->image, GIMP_TYPE_UNDO_STACK, undo_type); if (undo && @@ -1194,9 +1194,9 @@ gimp_edit_selection_tool_key_press (GimpTool *tool, if (push_undo) { - if (gimp_image_undo_group_start (gdisp->gimage, undo_type, undo_desc)) + if (gimp_image_undo_group_start (gdisp->image, undo_type, undo_desc)) { - undo = gimp_image_undo_can_compress (gdisp->gimage, + undo = gimp_image_undo_can_compress (gdisp->image, GIMP_TYPE_UNDO_STACK, undo_type); @@ -1240,11 +1240,11 @@ gimp_edit_selection_tool_key_press (GimpTool *tool, } if (push_undo) - gimp_image_undo_group_end (gdisp->gimage); + gimp_image_undo_group_end (gdisp->image); else gimp_undo_refresh_preview (undo); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); return TRUE; } diff --git a/app/tools/gimpellipseselecttool.c b/app/tools/gimpellipseselecttool.c index 4575c2698a..94a82ffafc 100644 --- a/app/tools/gimpellipseselecttool.c +++ b/app/tools/gimpellipseselecttool.c @@ -137,7 +137,7 @@ gimp_ellipse_select_tool_rect_select (GimpNewRectSelectTool *rect_tool, tool = GIMP_TOOL (rect_tool); options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - gimp_channel_select_ellipse (gimp_image_get_mask (tool->gdisp->gimage), + gimp_channel_select_ellipse (gimp_image_get_mask (tool->gdisp->image), x, y, w, h, options->operation, options->antialias, diff --git a/app/tools/gimpfliptool.c b/app/tools/gimpfliptool.c index 37bcd6497a..8cd1314a10 100644 --- a/app/tools/gimpfliptool.c +++ b/app/tools/gimpfliptool.c @@ -152,9 +152,9 @@ gimp_flip_tool_cursor_update (GimpTool *tool, options = GIMP_FLIP_OPTIONS (tool->tool_info->tool_options); - if (gimp_image_coords_in_active_drawable (gdisp->gimage, coords)) + if (gimp_image_coords_in_active_drawable (gdisp->image, coords)) { - GimpChannel *selection = gimp_image_get_mask (gdisp->gimage); + GimpChannel *selection = gimp_image_get_mask (gdisp->image); /* Is there a selected region? If so, is cursor inside? */ if (gimp_channel_is_empty (selection) || diff --git a/app/tools/gimpforegroundselecttool-undo.c b/app/tools/gimpforegroundselecttool-undo.c index 66edce5b5e..4c7764d2b0 100644 --- a/app/tools/gimpforegroundselecttool-undo.c +++ b/app/tools/gimpforegroundselecttool-undo.c @@ -48,13 +48,13 @@ static void undo_free_foreground_select (GimpUndo *undo, gboolean -gimp_foreground_select_tool_push_undo (GimpImage *gimage, +gimp_foreground_select_tool_push_undo (GimpImage *image, const gchar *undo_desc, gint tool_ID) { GimpUndo *new; - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (FgSelectUndo), sizeof (FgSelectUndo), GIMP_UNDO_FOREGROUND_SELECT, undo_desc, @@ -80,7 +80,7 @@ undo_pop_foreground_select (GimpUndo *undo, { GimpTool *active_tool; - active_tool = tool_manager_get_active (undo->gimage->gimp); + active_tool = tool_manager_get_active (undo->image->gimp); if (GIMP_IS_FOREGROUND_SELECT_TOOL (active_tool)) { diff --git a/app/tools/gimpforegroundselecttool-undo.h b/app/tools/gimpforegroundselecttool-undo.h index f15c4f3959..c7b6fa88ec 100644 --- a/app/tools/gimpforegroundselecttool-undo.h +++ b/app/tools/gimpforegroundselecttool-undo.h @@ -20,7 +20,7 @@ #define __GIMP_FOREGROUND_SELECT_TOOL_UNDO_H__ -gboolean gimp_foreground_select_tool_push_undo (GimpImage *gimage, +gboolean gimp_foreground_select_tool_push_undo (GimpImage *image, const gchar *undo_desc, gint tool_ID); diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c index 4d3474632d..123a0e1eb9 100644 --- a/app/tools/gimpforegroundselecttool.c +++ b/app/tools/gimpforegroundselecttool.c @@ -607,8 +607,8 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel, GimpForegroundSelectOptions *options; GimpTool *tool = GIMP_TOOL (free_sel); - GimpImage *gimage = gdisp->gimage; - GimpDrawable *drawable = gimp_image_active_drawable (gimage); + GimpImage *image = gdisp->image; + GimpDrawable *drawable = gimp_image_active_drawable (image); GimpScanConvert *scan_convert; GimpChannel *mask; @@ -629,9 +629,9 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel, gimp_scan_convert_add_polyline (scan_convert, free_sel->num_points, free_sel->points, TRUE); - mask = gimp_channel_new (gimage, - gimp_image_get_width (gimage), - gimp_image_get_height (gimage), + mask = gimp_channel_new (image, + gimp_image_get_width (image), + gimp_image_get_height (image), "foreground-extraction", NULL); gimp_scan_convert_render_value (scan_convert, @@ -643,7 +643,7 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel, { GList *list; - gimp_set_busy (gimage->gimp); + gimp_set_busy (image->gimp); /* apply foreground and background markers */ for (list = fg_select->strokes; list; list = list->next) @@ -660,7 +660,7 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel, fg_select->refinement = SIOX_REFINEMENT_NO_CHANGE; - gimp_unset_busy (gimage->gimp); + gimp_unset_busy (image->gimp); } else { @@ -748,7 +748,7 @@ gimp_foreground_select_tool_apply (GimpForegroundSelectTool *fg_select, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - gimp_channel_select_channel (gimp_image_get_mask (gdisp->gimage), + gimp_channel_select_channel (gimp_image_get_mask (gdisp->image), tool->tool_info->blurb, fg_select->mask, 0, 0, op, @@ -758,7 +758,7 @@ gimp_foreground_select_tool_apply (GimpForegroundSelectTool *fg_select, gimp_tool_control (tool, HALT, gdisp); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } static void diff --git a/app/tools/gimpfreeselecttool.c b/app/tools/gimpfreeselecttool.c index 7c25aa4392..f64037a8e6 100644 --- a/app/tools/gimpfreeselecttool.c +++ b/app/tools/gimpfreeselecttool.c @@ -212,14 +212,14 @@ gimp_free_select_tool_button_release (GimpTool *tool, if (free_sel->num_points == 1) { /* If there is a floating selection, anchor it */ - if (gimp_image_floating_sel (gdisp->gimage)) + if (gimp_image_floating_sel (gdisp->image)) { - floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); + floating_sel_anchor (gimp_image_floating_sel (gdisp->image)); } /* Otherwise, clear the selection mask */ else { - gimp_channel_clear (gimp_image_get_mask (gdisp->gimage), NULL, TRUE); + gimp_channel_clear (gimp_image_get_mask (gdisp->image), NULL, TRUE); } } else @@ -227,7 +227,7 @@ gimp_free_select_tool_button_release (GimpTool *tool, GIMP_FREE_SELECT_TOOL_GET_CLASS (free_sel)->select (free_sel, gdisp); } - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } static void @@ -314,7 +314,7 @@ gimp_free_select_tool_real_select (GimpFreeSelectTool *free_sel, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - gimp_channel_select_polygon (gimp_image_get_mask (gdisp->gimage), + gimp_channel_select_polygon (gimp_image_get_mask (gdisp->image), tool->tool_info->blurb, free_sel->num_points, free_sel->points, diff --git a/app/tools/gimpfuzzyselecttool.c b/app/tools/gimpfuzzyselecttool.c index 9998a49a19..b0b1a0d462 100644 --- a/app/tools/gimpfuzzyselecttool.c +++ b/app/tools/gimpfuzzyselecttool.c @@ -218,14 +218,14 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool, if (GIMP_SELECTION_TOOL (tool)->op == SELECTION_ANCHOR) { /* If there is a floating selection, anchor it */ - if (gimp_image_floating_sel (gdisp->gimage)) - floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); + if (gimp_image_floating_sel (gdisp->image)) + floating_sel_anchor (gimp_image_floating_sel (gdisp->image)); /* Otherwise, clear the selection mask */ else - gimp_channel_clear (gimp_image_get_mask (gdisp->gimage), NULL, + gimp_channel_clear (gimp_image_get_mask (gdisp->image), NULL, TRUE); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); return; } @@ -236,12 +236,12 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool, } else { - GimpDrawable *drawable = gimp_image_active_drawable (gdisp->gimage); + GimpDrawable *drawable = gimp_image_active_drawable (gdisp->image); gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y); } - gimp_channel_select_channel (gimp_image_get_mask (gdisp->gimage), + gimp_channel_select_channel (gimp_image_get_mask (gdisp->image), tool->tool_info->blurb, fuzzy_sel->fuzzy_mask, off_x, @@ -254,7 +254,7 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool, g_object_unref (fuzzy_sel->fuzzy_mask); fuzzy_sel->fuzzy_mask = NULL; - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } /* If the segment array is allocated, free it */ @@ -356,7 +356,7 @@ gimp_fuzzy_select_tool_calculate (GimpFuzzySelectTool *fuzzy_sel, shell = GIMP_DISPLAY_SHELL (gdisp->shell); - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); gimp_display_shell_set_override_cursor (shell, GDK_WATCH); @@ -373,7 +373,7 @@ gimp_fuzzy_select_tool_calculate (GimpFuzzySelectTool *fuzzy_sel, y -= off_y; } - new = gimp_image_contiguous_region_by_seed (gdisp->gimage, drawable, + new = gimp_image_contiguous_region_by_seed (gdisp->image, drawable, options->sample_merged, options->antialias, options->threshold, diff --git a/app/tools/gimphuesaturationtool.c b/app/tools/gimphuesaturationtool.c index 34ca659c23..eb903c8bfd 100644 --- a/app/tools/gimphuesaturationtool.c +++ b/app/tools/gimphuesaturationtool.c @@ -165,7 +165,7 @@ gimp_hue_saturation_tool_initialize (GimpTool *tool, GimpHueSaturationTool *hs_tool = GIMP_HUE_SATURATION_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (! drawable) return FALSE; diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c index d50a4b6c9c..ad8687d625 100644 --- a/app/tools/gimpimagemaptool.c +++ b/app/tools/gimpimagemaptool.c @@ -304,7 +304,7 @@ gimp_image_map_tool_initialize (GimpTool *tool, gtk_widget_show (vbox); } - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (image_map_tool->shell), GIMP_VIEWABLE (drawable)); @@ -448,7 +448,7 @@ gimp_image_map_tool_flush (GimpImageMap *image_map, { GimpTool *tool = GIMP_TOOL (image_map_tool); - gimp_projection_flush_now (tool->gdisp->gimage->projection); + gimp_projection_flush_now (tool->gdisp->image->projection); gimp_display_flush_now (tool->gdisp); } @@ -485,7 +485,7 @@ gimp_image_map_tool_response (GtkWidget *widget, gimp_tool_control_set_preserve (tool->control, FALSE); - gimp_image_flush (tool->gdisp->gimage); + gimp_image_flush (tool->gdisp->image); } tool->gdisp = NULL; @@ -504,7 +504,7 @@ gimp_image_map_tool_response (GtkWidget *widget, gimp_tool_control_set_preserve (tool->control, FALSE); - gimp_image_flush (tool->gdisp->gimage); + gimp_image_flush (tool->gdisp->image); } tool->gdisp = NULL; @@ -539,7 +539,7 @@ gimp_image_map_tool_notify_preview (GObject *config, gimp_tool_control_set_preserve (tool->control, FALSE); - gimp_image_flush (tool->gdisp->gimage); + gimp_image_flush (tool->gdisp->image); } } } diff --git a/app/tools/gimpiscissorstool.c b/app/tools/gimpiscissorstool.c index 860ddc5e5c..79212e5b9f 100644 --- a/app/tools/gimpiscissorstool.c +++ b/app/tools/gimpiscissorstool.c @@ -158,7 +158,7 @@ static void gimp_iscissors_tool_draw (GimpDrawTool *draw_tool); static void iscissors_convert (GimpIscissorsTool *iscissors, GimpDisplay *gdisp); -static TileManager * gradient_map_new (GimpImage *gimage); +static TileManager * gradient_map_new (GimpImage *image); static void find_optimal_path (TileManager *gradient_map, TempBuf *dp_buf, @@ -169,7 +169,7 @@ static void find_optimal_path (TileManager *gradient_map, gint xs, gint ys); static void find_max_gradient (GimpIscissorsTool *iscissors, - GimpImage *gimage, + GimpImage *image, gint *x, gint *y); static void calculate_curve (GimpTool *tool, @@ -421,12 +421,12 @@ gimp_iscissors_tool_button_press (GimpTool *tool, if (! (state & GDK_SHIFT_MASK)) find_max_gradient (iscissors, - gdisp->gimage, + gdisp->image, &iscissors->x, &iscissors->y); - iscissors->x = CLAMP (iscissors->x, 0, gdisp->gimage->width - 1); - iscissors->y = CLAMP (iscissors->y, 0, gdisp->gimage->height - 1); + iscissors->x = CLAMP (iscissors->x, 0, gdisp->image->width - 1); + iscissors->y = CLAMP (iscissors->y, 0, gdisp->image->height - 1); iscissors->ix = iscissors->x; iscissors->iy = iscissors->y; @@ -458,7 +458,7 @@ gimp_iscissors_tool_button_press (GimpTool *tool, iscissors->draw = DRAW_CURVE; gimp_draw_tool_stop (GIMP_DRAW_TOOL (tool)); - gimp_channel_select_channel (gimp_image_get_mask (gdisp->gimage), + gimp_channel_select_channel (gimp_image_get_mask (gdisp->image), tool->tool_info->blurb, iscissors->mask, 0, 0, @@ -469,7 +469,7 @@ gimp_iscissors_tool_button_press (GimpTool *tool, gimp_iscissors_tool_reset (iscissors); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } else if (! iscissors->connected) { @@ -536,9 +536,9 @@ iscissors_convert (GimpIscissorsTool *iscissors, if (iscissors->mask) g_object_unref (iscissors->mask); - iscissors->mask = gimp_channel_new_mask (gdisp->gimage, - gdisp->gimage->width, - gdisp->gimage->height); + iscissors->mask = gimp_channel_new_mask (gdisp->image, + gdisp->image->width, + gdisp->image->height); gimp_scan_convert_render (sc, GIMP_DRAWABLE (iscissors->mask)->tiles, 0, 0, options->antialias); gimp_scan_convert_free (sc); @@ -699,11 +699,11 @@ gimp_iscissors_tool_motion (GimpTool *tool, case SEED_PLACEMENT: /* Hold the shift key down to disable the auto-edge snap feature */ if (! (state & GDK_SHIFT_MASK)) - find_max_gradient (iscissors, gdisp->gimage, + find_max_gradient (iscissors, gdisp->image, &iscissors->x, &iscissors->y); - iscissors->x = CLAMP (iscissors->x, 0, gdisp->gimage->width - 1); - iscissors->y = CLAMP (iscissors->y, 0, gdisp->gimage->height - 1); + iscissors->x = CLAMP (iscissors->x, 0, gdisp->image->width - 1); + iscissors->y = CLAMP (iscissors->y, 0, gdisp->image->height - 1); if (iscissors->first_point) { @@ -715,11 +715,11 @@ gimp_iscissors_tool_motion (GimpTool *tool, case SEED_ADJUSTMENT: /* Move the current seed to the location of the cursor */ if (! (state & GDK_SHIFT_MASK)) - find_max_gradient (iscissors, gdisp->gimage, + find_max_gradient (iscissors, gdisp->image, &iscissors->x, &iscissors->y); - iscissors->x = CLAMP (iscissors->x, 0, gdisp->gimage->width - 1); - iscissors->y = CLAMP (iscissors->y, 0, gdisp->gimage->height - 1); + iscissors->x = CLAMP (iscissors->x, 0, gdisp->image->width - 1); + iscissors->y = CLAMP (iscissors->y, 0, gdisp->image->height - 1); iscissors->nx = iscissors->x; iscissors->ny = iscissors->y; @@ -1326,10 +1326,10 @@ calculate_curve (GimpTool *tool, gdisp = tool->gdisp; /* Get the bounding box */ - xs = CLAMP (curve->x1, 0, gdisp->gimage->width - 1); - ys = CLAMP (curve->y1, 0, gdisp->gimage->height - 1); - xe = CLAMP (curve->x2, 0, gdisp->gimage->width - 1); - ye = CLAMP (curve->y2, 0, gdisp->gimage->height - 1); + xs = CLAMP (curve->x1, 0, gdisp->image->width - 1); + ys = CLAMP (curve->y1, 0, gdisp->image->height - 1); + xe = CLAMP (curve->x2, 0, gdisp->image->width - 1); + ye = CLAMP (curve->y2, 0, gdisp->image->height - 1); x1 = MIN (xs, xe); y1 = MIN (ys, ye); x2 = MAX (xs, xe) + 1; /* +1 because if xe = 199 & xs = 0, x2 - x1, width = 200 */ @@ -1346,11 +1346,11 @@ calculate_curve (GimpTool *tool, eheight = (y2 - y1) * EXTEND_BY + FIXED; if (xe >= xs) - x2 += CLAMP (ewidth, 0, gdisp->gimage->width - x2); + x2 += CLAMP (ewidth, 0, gdisp->image->width - x2); else x1 -= CLAMP (ewidth, 0, x1); if (ye >= ys) - y2 += CLAMP (eheight, 0, gdisp->gimage->height - y2); + y2 += CLAMP (eheight, 0, gdisp->image->height - y2); else y1 -= CLAMP (eheight, 0, y1); @@ -1370,7 +1370,7 @@ calculate_curve (GimpTool *tool, /* Initialise the gradient map tile manager for this image if we * don't already have one. */ if (!iscissors->gradient_map) - iscissors->gradient_map = gradient_map_new (gdisp->gimage); + iscissors->gradient_map = gradient_map_new (gdisp->image); /* allocate the dynamic programming array */ iscissors->dp_buf = @@ -1690,9 +1690,9 @@ gradmap_tile_validate (TileManager *tm, GimpPickable *pickable; Tile *srctile; PixelRegion srcPR, destPR; - GimpImage *gimage; + GimpImage *image; - gimage = (GimpImage *) tile_manager_get_user_data (tm); + image = (GimpImage *) tile_manager_get_user_data (tm); if (first_gradient) { @@ -1711,11 +1711,11 @@ gradmap_tile_validate (TileManager *tm, dw = tile_ewidth (tile); dh = tile_eheight (tile); - pickable = GIMP_PICKABLE (gimage->projection); + pickable = GIMP_PICKABLE (image->projection); gimp_pickable_flush (pickable); - /* get corresponding tile in the gimage */ + /* get corresponding tile in the image */ srctile = tile_manager_get_tile (gimp_pickable_get_tiles (pickable), x, y, TRUE, FALSE); if (!srctile) @@ -1809,13 +1809,13 @@ contin: } static TileManager * -gradient_map_new (GimpImage *gimage) +gradient_map_new (GimpImage *image) { TileManager *tm; - tm = tile_manager_new (gimage->width, gimage->height, + tm = tile_manager_new (image->width, image->height, sizeof (guint8) * COST_WIDTH); - tile_manager_set_user_data (tm, gimage); + tile_manager_set_user_data (tm, image); tile_manager_set_validate_proc (tm, gradmap_tile_validate); return tm; @@ -1823,7 +1823,7 @@ gradient_map_new (GimpImage *gimage) static void find_max_gradient (GimpIscissorsTool *iscissors, - GimpImage *gimage, + GimpImage *image, gint *x, gint *y) { @@ -1840,19 +1840,19 @@ find_max_gradient (GimpIscissorsTool *iscissors, /* Initialise the gradient map tile manager for this image if we * don't already have one. */ if (!iscissors->gradient_map) - iscissors->gradient_map = gradient_map_new (gimage); + iscissors->gradient_map = gradient_map_new (image); radius = GRADIENT_SEARCH >> 1; /* calculate the extent of the search */ - cx = CLAMP (*x, 0, gimage->width); - cy = CLAMP (*y, 0, gimage->height); + cx = CLAMP (*x, 0, image->width); + cy = CLAMP (*y, 0, image->height); sx = cx - radius; sy = cy - radius; - x1 = CLAMP (cx - radius, 0, gimage->width); - y1 = CLAMP (cy - radius, 0, gimage->height); - x2 = CLAMP (cx + radius, 0, gimage->width); - y2 = CLAMP (cy + radius, 0, gimage->height); + x1 = CLAMP (cx - radius, 0, image->width); + y1 = CLAMP (cy - radius, 0, image->height); + x2 = CLAMP (cx + radius, 0, image->width); + y2 = CLAMP (cy + radius, 0, image->height); /* calculate the factor to multiply the distance from the cursor by */ max_gradient = 0; diff --git a/app/tools/gimplevelstool.c b/app/tools/gimplevelstool.c index 0aa2b0fa02..c09ee79326 100644 --- a/app/tools/gimplevelstool.c +++ b/app/tools/gimplevelstool.c @@ -229,7 +229,7 @@ gimp_levels_tool_initialize (GimpTool *tool, GimpLevelsTool *l_tool = GIMP_LEVELS_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (! drawable) return FALSE; diff --git a/app/tools/gimpmagnifytool.c b/app/tools/gimpmagnifytool.c index dd33435f5a..001621383a 100644 --- a/app/tools/gimpmagnifytool.c +++ b/app/tools/gimpmagnifytool.c @@ -230,11 +230,11 @@ gimp_magnify_tool_button_release (GimpTool *tool, } offset_x = (new_scale * ((x1 + x2) / 2) - * SCREEN_XRES (shell) / gdisp->gimage->xresolution + * SCREEN_XRES (shell) / gdisp->image->xresolution - (win_width / 2)); offset_y = (new_scale * ((y1 + y2) / 2) - * SCREEN_YRES (shell) / gdisp->gimage->yresolution + * SCREEN_YRES (shell) / gdisp->image->yresolution - (win_height / 2)); gimp_display_shell_scale_by_values (shell, diff --git a/app/tools/gimpmeasuretool.c b/app/tools/gimpmeasuretool.c index 5ffec6579e..d3d5f1fe14 100644 --- a/app/tools/gimpmeasuretool.c +++ b/app/tools/gimpmeasuretool.c @@ -221,40 +221,40 @@ gimp_measure_tool_button_press (GimpTool *tool, (mtool->y[i] == CLAMP (mtool->y[i], 0, - gdisp->gimage->height))); + gdisp->image->height))); create_vguide = ((state & GDK_MOD1_MASK) && (mtool->x[i] == CLAMP (mtool->x[i], 0, - gdisp->gimage->width))); + gdisp->image->width))); if (create_hguide && create_vguide) - gimp_image_undo_group_start (gdisp->gimage, + gimp_image_undo_group_start (gdisp->image, GIMP_UNDO_GROUP_IMAGE_GUIDE, _("Add Guides")); if (create_hguide) { - guide = gimp_image_add_hguide (gdisp->gimage, + guide = gimp_image_add_hguide (gdisp->image, mtool->y[i], TRUE); - gimp_image_update_guide (gdisp->gimage, guide); + gimp_image_update_guide (gdisp->image, guide); } if (create_vguide) { - guide = gimp_image_add_vguide (gdisp->gimage, + guide = gimp_image_add_vguide (gdisp->image, mtool->x[i], TRUE); - gimp_image_update_guide (gdisp->gimage, guide); + gimp_image_update_guide (gdisp->image, guide); } if (create_hguide && create_vguide) - gimp_image_undo_group_end (gdisp->gimage); + gimp_image_undo_group_end (gdisp->image); if (create_hguide || create_vguide) - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); mtool->function = GUIDING; break; @@ -332,7 +332,7 @@ gimp_measure_tool_button_press (GimpTool *tool, if (mtool->dialog) gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (mtool->dialog), - GIMP_VIEWABLE (tool->gdisp->gimage)); + GIMP_VIEWABLE (tool->gdisp->image)); } static void @@ -698,7 +698,7 @@ gimp_measure_tool_dialog_update (GimpMeasureTool *mtool, GimpDisplay *gdisp) { GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell); - GimpImage *image = gdisp->gimage; + GimpImage *image = gdisp->image; gint ax, ay; gint bx, by; gint pixel_width; diff --git a/app/tools/gimpmovetool.c b/app/tools/gimpmovetool.c index 3d7992fec3..bbf0909974 100644 --- a/app/tools/gimpmovetool.c +++ b/app/tools/gimpmovetool.c @@ -227,9 +227,9 @@ gimp_move_tool_button_press (GimpTool *tool, &vectors)) { move->old_active_vectors = - gimp_image_get_active_vectors (gdisp->gimage); + gimp_image_get_active_vectors (gdisp->image); - gimp_image_set_active_vectors (gdisp->gimage, vectors); + gimp_image_set_active_vectors (gdisp->image, vectors); } else { @@ -244,10 +244,10 @@ gimp_move_tool_button_press (GimpTool *tool, gint snap_distance; snap_distance = - GIMP_DISPLAY_CONFIG (gdisp->gimage->gimp->config)->snap_distance; + GIMP_DISPLAY_CONFIG (gdisp->image->gimp->config)->snap_distance; if (gimp_display_shell_get_show_guides (shell) && - (guide = gimp_image_find_guide (gdisp->gimage, + (guide = gimp_image_find_guide (gdisp->image, coords->x, coords->y, FUNSCALEX (shell, snap_distance), FUNSCALEY (shell, snap_distance)))) @@ -272,17 +272,17 @@ gimp_move_tool_button_press (GimpTool *tool, return; } - else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, + else if ((layer = gimp_image_pick_correlate_layer (gdisp->image, coords->x, coords->y))) { - if (gimp_image_floating_sel (gdisp->gimage) && + if (gimp_image_floating_sel (gdisp->image) && ! gimp_layer_is_floating_sel (layer)) { /* If there is a floating selection, and this aint it, * use the move tool to anchor it. */ - move->floating_layer = gimp_image_floating_sel (gdisp->gimage); + move->floating_layer = gimp_image_floating_sel (gdisp->image); gimp_tool_control_activate (tool->control); return; @@ -290,9 +290,9 @@ gimp_move_tool_button_press (GimpTool *tool, else { move->old_active_layer = - gimp_image_get_active_layer (gdisp->gimage); + gimp_image_get_active_layer (gdisp->image); - gimp_image_set_active_layer (gdisp->gimage, layer); + gimp_image_set_active_layer (gdisp->image, layer); } } else @@ -307,20 +307,20 @@ gimp_move_tool_button_press (GimpTool *tool, switch (options->move_type) { case GIMP_TRANSFORM_TYPE_PATH: - if (gimp_image_get_active_vectors (gdisp->gimage)) + if (gimp_image_get_active_vectors (gdisp->image)) gimp_edit_selection_tool_start (tool, gdisp, coords, GIMP_TRANSLATE_MODE_VECTORS, TRUE); break; case GIMP_TRANSFORM_TYPE_SELECTION: - if (! gimp_channel_is_empty (gimp_image_get_mask (gdisp->gimage))) + if (! gimp_channel_is_empty (gimp_image_get_mask (gdisp->image))) gimp_edit_selection_tool_start (tool, gdisp, coords, GIMP_TRANSLATE_MODE_MASK, TRUE); break; case GIMP_TRANSFORM_TYPE_LAYER: { - GimpDrawable *drawable = gimp_image_active_drawable (gdisp->gimage); + GimpDrawable *drawable = gimp_image_active_drawable (gdisp->image); if (GIMP_IS_LAYER_MASK (drawable)) gimp_edit_selection_tool_start (tool, gdisp, coords, @@ -345,7 +345,7 @@ gimp_move_tool_button_release (GimpTool *tool, { GimpMoveTool *move = GIMP_MOVE_TOOL (tool); GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell); - GimpGuiConfig *config = GIMP_GUI_CONFIG (gdisp->gimage->gimp->config); + GimpGuiConfig *config = GIMP_GUI_CONFIG (gdisp->image->gimp->config); if (gimp_tool_control_is_active (tool->control)) gimp_tool_control_halt (tool->control); @@ -395,7 +395,7 @@ gimp_move_tool_button_release (GimpTool *tool, { if (move->guide) { - gimp_image_remove_guide (gdisp->gimage, move->guide, TRUE); + gimp_image_remove_guide (gdisp->image, move->guide, TRUE); move->guide = NULL; } } @@ -403,7 +403,7 @@ gimp_move_tool_button_release (GimpTool *tool, { if (move->guide) { - gimp_image_move_guide (gdisp->gimage, move->guide, + gimp_image_move_guide (gdisp->image, move->guide, move->guide_position, TRUE); } else @@ -411,13 +411,13 @@ gimp_move_tool_button_release (GimpTool *tool, switch (move->guide_orientation) { case GIMP_ORIENTATION_HORIZONTAL: - move->guide = gimp_image_add_hguide (gdisp->gimage, + move->guide = gimp_image_add_hguide (gdisp->image, move->guide_position, TRUE); break; case GIMP_ORIENTATION_VERTICAL: - move->guide = gimp_image_add_vguide (gdisp->gimage, + move->guide = gimp_image_add_vguide (gdisp->image, move->guide_position, TRUE); break; @@ -429,7 +429,7 @@ gimp_move_tool_button_release (GimpTool *tool, } gimp_display_shell_selection_visibility (shell, GIMP_SELECTION_RESUME); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); if (move->guide) gimp_display_shell_draw_guide (shell, move->guide, TRUE); @@ -444,14 +444,14 @@ gimp_move_tool_button_release (GimpTool *tool, { if (move->old_active_layer) { - gimp_image_set_active_layer (gdisp->gimage, + gimp_image_set_active_layer (gdisp->image, move->old_active_layer); move->old_active_layer = NULL; } if (move->old_active_vectors) { - gimp_image_set_active_vectors (gdisp->gimage, + gimp_image_set_active_vectors (gdisp->image, move->old_active_vectors); move->old_active_vectors = NULL; } @@ -463,7 +463,7 @@ gimp_move_tool_button_release (GimpTool *tool, if (move->floating_layer) { floating_sel_anchor (move->floating_layer); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } } } @@ -626,9 +626,9 @@ gimp_move_tool_oper_update (GimpTool *tool, gint snap_distance; snap_distance = - GIMP_DISPLAY_CONFIG (gdisp->gimage->gimp->config)->snap_distance; + GIMP_DISPLAY_CONFIG (gdisp->image->gimp->config)->snap_distance; - guide = gimp_image_find_guide (gdisp->gimage, coords->x, coords->y, + guide = gimp_image_find_guide (gdisp->image, coords->x, coords->y, FUNSCALEX (shell, snap_distance), FUNSCALEY (shell, snap_distance)); } @@ -662,7 +662,7 @@ gimp_move_tool_cursor_update (GimpTool *tool, if (options->move_current) { - if (gimp_image_get_active_vectors (gdisp->gimage)) + if (gimp_image_get_active_vectors (gdisp->image)) cursor = GIMP_CURSOR_MOUSE; } else @@ -681,12 +681,12 @@ gimp_move_tool_cursor_update (GimpTool *tool, tool_cursor = GIMP_TOOL_CURSOR_RECT_SELECT; modifier = GIMP_CURSOR_MODIFIER_MOVE; - if (! gimp_channel_is_empty (gimp_image_get_mask (gdisp->gimage))) + if (! gimp_channel_is_empty (gimp_image_get_mask (gdisp->image))) cursor = GIMP_CURSOR_MOUSE; } else if (options->move_current) { - if (gimp_image_active_drawable (gdisp->gimage)) + if (gimp_image_active_drawable (gdisp->image)) cursor = GIMP_CURSOR_MOUSE; } else @@ -696,10 +696,10 @@ gimp_move_tool_cursor_update (GimpTool *tool, gint snap_distance; snap_distance = - GIMP_DISPLAY_CONFIG (gdisp->gimage->gimp->config)->snap_distance; + GIMP_DISPLAY_CONFIG (gdisp->image->gimp->config)->snap_distance; if (gimp_display_shell_get_show_guides (shell) && - (guide = gimp_image_find_guide (gdisp->gimage, coords->x, coords->y, + (guide = gimp_image_find_guide (gdisp->image, coords->x, coords->y, FUNSCALEX (shell, snap_distance), FUNSCALEY (shell, snap_distance)))) { @@ -707,18 +707,18 @@ gimp_move_tool_cursor_update (GimpTool *tool, tool_cursor = GIMP_TOOL_CURSOR_HAND; modifier = GIMP_CURSOR_MODIFIER_MOVE; } - else if ((layer = gimp_image_pick_correlate_layer (gdisp->gimage, + else if ((layer = gimp_image_pick_correlate_layer (gdisp->image, coords->x, coords->y))) { /* if there is a floating selection, and this aint it... */ - if (gimp_image_floating_sel (gdisp->gimage) && + if (gimp_image_floating_sel (gdisp->image) && ! gimp_layer_is_floating_sel (layer)) { cursor = GIMP_CURSOR_MOUSE; tool_cursor = GIMP_TOOL_CURSOR_MOVE; modifier = GIMP_CURSOR_MODIFIER_ANCHOR; } - else if (layer == gimp_image_get_active_layer (gdisp->gimage)) + else if (layer == gimp_image_get_active_layer (gdisp->image)) { cursor = GIMP_CURSOR_MOUSE; } @@ -750,7 +750,7 @@ gimp_move_tool_draw (GimpDrawTool *draw_tool) case GIMP_ORIENTATION_HORIZONTAL: gimp_draw_tool_draw_line (draw_tool, 0, move->guide_position, - draw_tool->gdisp->gimage->width, + draw_tool->gdisp->image->width, move->guide_position, FALSE); break; @@ -759,7 +759,7 @@ gimp_move_tool_draw (GimpDrawTool *draw_tool) gimp_draw_tool_draw_line (draw_tool, move->guide_position, 0, move->guide_position, - draw_tool->gdisp->gimage->height, + draw_tool->gdisp->image->height, FALSE); break; diff --git a/app/tools/gimpnewrectselecttool.c b/app/tools/gimpnewrectselecttool.c index 41f4ee4607..b37697f6ec 100644 --- a/app/tools/gimpnewrectselecttool.c +++ b/app/tools/gimpnewrectselecttool.c @@ -291,7 +291,7 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, GimpTool *tool = GIMP_TOOL (rectangle); GimpNewRectSelectTool *rect_select = GIMP_NEW_RECT_SELECT_TOOL (rectangle); GimpSelectionOptions *options; - GimpImage *gimage; + GimpImage *image; gint max_x, max_y; gboolean rectangle_exists; gboolean selected; @@ -306,10 +306,10 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, gimp_tool_pop_status (tool, tool->gdisp); - gimage = tool->gdisp->gimage; - max_x = gimage->width; - max_y = gimage->height; - selection_mask = gimp_image_get_mask (gimage); + image = tool->gdisp->image; + max_x = image->width; + max_y = image->height; + selection_mask = gimp_image_get_mask (image); rectangle_exists = (x <= max_x && y <= max_y && x + w >= 0 && y + h >= 0 && @@ -359,7 +359,7 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, /* edges of marching ants. */ if (selected) { - GimpChannel *selection_mask = gimp_image_get_mask (gimage); + GimpChannel *selection_mask = gimp_image_get_mask (image); const BoundSeg *segs_in; const BoundSeg *segs_out; gint n_segs_in; @@ -401,8 +401,8 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, g_object_set (rectangle, "x1", 0, "y1", 0, - "x2", gimage->width, - "y2", gimage->height, + "x2", image->width, + "y2", image->height, NULL); } @@ -429,7 +429,7 @@ gimp_new_rect_select_tool_real_rect_select (GimpNewRectSelectTool *rect_select, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - gimp_channel_select_rectangle (gimp_image_get_mask (tool->gdisp->gimage), + gimp_channel_select_rectangle (gimp_image_get_mask (tool->gdisp->image), x, y, w, h, options->operation, options->feather, diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c index bc060797a0..1f77d94d67 100644 --- a/app/tools/gimppainttool.c +++ b/app/tools/gimppainttool.c @@ -265,7 +265,7 @@ gimp_paint_tool_control (GimpTool *tool, GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); switch (action) { @@ -290,7 +290,7 @@ gimp_paint_tool_control (GimpTool *tool, { GimpDisplay *tmp_disp = list->data; - if (tmp_disp != gdisp && tmp_disp->gimage == gdisp->gimage) + if (tmp_disp != gdisp && tmp_disp->image == gdisp->image) { tool->gdisp = tmp_disp; break; @@ -360,7 +360,7 @@ gimp_paint_tool_button_press (GimpTool *tool, core = paint_tool->core; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); curr_coords = *coords; @@ -374,7 +374,7 @@ gimp_paint_tool_button_press (GimpTool *tool, if (tool->gdisp && tool->gdisp != gdisp && - tool->gdisp->gimage == gdisp->gimage) + tool->gdisp->image == gdisp->image) { /* if this is a different display, but the same image, HACK around * in tool internals AFTER stopping the current draw_tool, so @@ -387,7 +387,7 @@ gimp_paint_tool_button_press (GimpTool *tool, gdk_display = gtk_widget_get_display (gdisp->shell); - core->use_pressure = (gimp_devices_get_current (gdisp->gimage->gimp) != + core->use_pressure = (gimp_devices_get_current (gdisp->image->gimp) != gdk_display_get_core_pointer (gdk_display)); if (! gimp_paint_core_start (core, drawable, paint_options, &curr_coords)) @@ -425,7 +425,7 @@ gimp_paint_tool_button_press (GimpTool *tool, return; /* pause the current selection */ - gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_PAUSE); + gimp_image_selection_control (gdisp->image, GIMP_SELECTION_PAUSE); /* Let the specific painting function initialize itself */ gimp_paint_core_paint (core, drawable, paint_options, @@ -442,7 +442,7 @@ gimp_paint_tool_button_press (GimpTool *tool, GIMP_PAINT_STATE_MOTION, time); } - gimp_projection_flush_now (gdisp->gimage->projection); + gimp_projection_flush_now (gdisp->image->projection); gimp_display_flush_now (gdisp); gimp_draw_tool_start (draw_tool, gdisp); @@ -464,7 +464,7 @@ gimp_paint_tool_button_release (GimpTool *tool, core = paint_tool->core; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); @@ -473,7 +473,7 @@ gimp_paint_tool_button_release (GimpTool *tool, GIMP_PAINT_STATE_FINISH, time); /* resume the current selection */ - gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_RESUME); + gimp_image_selection_control (gdisp->image, GIMP_SELECTION_RESUME); /* chain up to halt the tool */ GIMP_TOOL_CLASS (parent_class)->button_release (tool, @@ -484,7 +484,7 @@ gimp_paint_tool_button_release (GimpTool *tool, else gimp_paint_core_finish (core, drawable); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); } @@ -506,7 +506,7 @@ gimp_paint_tool_motion (GimpTool *tool, core = paint_tool->core; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); core->cur_coords = *coords; @@ -524,7 +524,7 @@ gimp_paint_tool_motion (GimpTool *tool, gimp_paint_core_interpolate (core, drawable, paint_options, time); - gimp_projection_flush_now (gdisp->gimage->projection); + gimp_projection_flush_now (gdisp->image->projection); gimp_display_flush_now (gdisp); paint_tool->brush_x = coords->x; @@ -553,7 +553,7 @@ gimp_paint_tool_modifier_key (GimpTool *tool, GimpContainer *tool_info_list; GimpToolInfo *info; - tool_info_list = gdisp->gimage->gimp->tool_info_list; + tool_info_list = gdisp->image->gimp->tool_info_list; info = (GimpToolInfo *) gimp_container_get_child_by_name (tool_info_list, @@ -610,7 +610,7 @@ gimp_paint_tool_oper_update (GimpTool *tool, if (tool->gdisp && tool->gdisp != gdisp && - tool->gdisp->gimage == gdisp->gimage) + tool->gdisp->image == gdisp->image) { /* if this is a different display, but the same image, HACK around * in tool internals AFTER stopping the current draw_tool, so @@ -621,7 +621,7 @@ gimp_paint_tool_oper_update (GimpTool *tool, tool->gdisp = gdisp; } - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (drawable && proximity) { @@ -660,7 +660,7 @@ gimp_paint_tool_oper_update (GimpTool *tool, } else { - GimpImage *image = gdisp->gimage; + GimpImage *image = gdisp->image; gchar format_str[64]; g_snprintf (format_str, sizeof (format_str), "%%.%df %s", @@ -852,7 +852,7 @@ gimp_paint_tool_color_picked (GimpColorTool *color_tool, if (tool->gdisp) { - GimpContext *context = gimp_get_user_context (tool->gdisp->gimage->gimp); + GimpContext *context = gimp_get_user_context (tool->gdisp->image->gimp); switch (color_tool->pick_mode) { diff --git a/app/tools/gimpposterizetool.c b/app/tools/gimpposterizetool.c index e098c2e83d..bd10369adf 100644 --- a/app/tools/gimpposterizetool.c +++ b/app/tools/gimpposterizetool.c @@ -127,7 +127,7 @@ gimp_posterize_tool_initialize (GimpTool *tool, GimpPosterizeTool *posterize_tool = GIMP_POSTERIZE_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (! drawable) return FALSE; diff --git a/app/tools/gimprectangleselecttool.c b/app/tools/gimprectangleselecttool.c index 41f4ee4607..b37697f6ec 100644 --- a/app/tools/gimprectangleselecttool.c +++ b/app/tools/gimprectangleselecttool.c @@ -291,7 +291,7 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, GimpTool *tool = GIMP_TOOL (rectangle); GimpNewRectSelectTool *rect_select = GIMP_NEW_RECT_SELECT_TOOL (rectangle); GimpSelectionOptions *options; - GimpImage *gimage; + GimpImage *image; gint max_x, max_y; gboolean rectangle_exists; gboolean selected; @@ -306,10 +306,10 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, gimp_tool_pop_status (tool, tool->gdisp); - gimage = tool->gdisp->gimage; - max_x = gimage->width; - max_y = gimage->height; - selection_mask = gimp_image_get_mask (gimage); + image = tool->gdisp->image; + max_x = image->width; + max_y = image->height; + selection_mask = gimp_image_get_mask (image); rectangle_exists = (x <= max_x && y <= max_y && x + w >= 0 && y + h >= 0 && @@ -359,7 +359,7 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, /* edges of marching ants. */ if (selected) { - GimpChannel *selection_mask = gimp_image_get_mask (gimage); + GimpChannel *selection_mask = gimp_image_get_mask (image); const BoundSeg *segs_in; const BoundSeg *segs_out; gint n_segs_in; @@ -401,8 +401,8 @@ gimp_new_rect_select_tool_execute (GimpRectangleTool *rectangle, g_object_set (rectangle, "x1", 0, "y1", 0, - "x2", gimage->width, - "y2", gimage->height, + "x2", image->width, + "y2", image->height, NULL); } @@ -429,7 +429,7 @@ gimp_new_rect_select_tool_real_rect_select (GimpNewRectSelectTool *rect_select, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - gimp_channel_select_rectangle (gimp_image_get_mask (tool->gdisp->gimage), + gimp_channel_select_rectangle (gimp_image_get_mask (tool->gdisp->image), x, y, w, h, options->operation, options->feather, diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c index ce92573f0c..3e13c565cd 100644 --- a/app/tools/gimprectangletool.c +++ b/app/tools/gimprectangletool.c @@ -622,8 +622,8 @@ gimp_rectangle_tool_initialize (GimpTool *tool, if (gdisp != tool->gdisp) { - gint width = gimp_image_get_width (gdisp->gimage); - gint height = gimp_image_get_height (gdisp->gimage); + gint width = gimp_image_get_width (gdisp->image); + gint height = gimp_image_get_height (gdisp->image); GimpUnit unit; gdouble xres; gdouble yres; @@ -638,7 +638,7 @@ gimp_rectangle_tool_initialize (GimpTool *tool, gimp_size_entry_set_size (entry, 2, 0, width); gimp_size_entry_set_size (entry, 3, 0, height); - gimp_image_get_resolution (gdisp->gimage, &xres, &yres); + gimp_image_get_resolution (gdisp->image, &xres, &yres); gimp_size_entry_set_resolution (entry, 0, yres, TRUE); gimp_size_entry_set_resolution (entry, 1, xres, TRUE); @@ -786,8 +786,8 @@ gimp_rectangle_tool_motion (GimpTool *tool, gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); min_x = min_y = 0; - max_x = gdisp->gimage->width; - max_y = gdisp->gimage->height; + max_x = gdisp->image->width; + max_y = gdisp->image->height; g_object_get (options, "width", &width, @@ -1216,8 +1216,8 @@ gimp_rectangle_tool_key_press (GimpTool *tool, gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); min_x = min_y = 0; - max_x = gdisp->gimage->width; - max_y = gdisp->gimage->height; + max_x = gdisp->image->width; + max_y = gdisp->image->height; g_object_get (rectangle, "x1", &x1, @@ -1585,7 +1585,7 @@ gimp_rectangle_tool_response (GtkWidget *widget, if (gimp_tool_control_is_active (tool->control)) gimp_tool_control_halt (tool->control); - gimp_image_flush (tool->gdisp->gimage); + gimp_image_flush (tool->gdisp->image); tool->gdisp = NULL; tool->drawable = NULL; @@ -1605,7 +1605,7 @@ rectangle_selection_callback (GtkWidget *widget, gimp_draw_tool_pause (GIMP_DRAW_TOOL (rectangle)); - if (gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage), + if (gimp_channel_bounds (gimp_image_get_mask (gdisp->image), &x1, &y1, &x2, &y2)) { @@ -1621,8 +1621,8 @@ rectangle_selection_callback (GtkWidget *widget, g_object_set (rectangle, "x1", 0, "y1", 0, - "x2", gdisp->gimage->width, - "y2", gdisp->gimage->height, + "x2", gdisp->image->width, + "y2", gdisp->image->height, NULL); } @@ -1647,8 +1647,8 @@ rectangle_automatic_callback (GtkWidget *widget, gdisp = GIMP_TOOL (rectangle)->gdisp; - width = gdisp->gimage->width; - height = gdisp->gimage->height; + width = gdisp->image->width; + height = gdisp->image->height; offset_x = 0; offset_y = 0; @@ -1664,7 +1664,7 @@ rectangle_automatic_callback (GtkWidget *widget, y1 = ry1 - offset_y > 0 ? ry1 - offset_y : 0; y2 = ry2 - offset_y < height ? ry2 - offset_y : height; - if (gimp_image_crop_auto_shrink (gdisp->gimage, + if (gimp_image_crop_auto_shrink (gdisp->image, x1, y1, x2, y2, FALSE, &shrunk_x1, diff --git a/app/tools/gimprectselecttool.c b/app/tools/gimprectselecttool.c index 5060fe0971..e1c0538639 100644 --- a/app/tools/gimprectselecttool.c +++ b/app/tools/gimprectselecttool.c @@ -163,16 +163,16 @@ gimp_rect_select_tool_button_press (GimpTool *tool, break; case GIMP_UNIT_PERCENT: rect_sel->fixed_width = - gdisp->gimage->width * rect_sel->fixed_width / 100; + gdisp->image->width * rect_sel->fixed_width / 100; rect_sel->fixed_height = - gdisp->gimage->height * rect_sel->fixed_height / 100; + gdisp->image->height * rect_sel->fixed_height / 100; break; default: unit_factor = _gimp_unit_get_factor (tool->tool_info->gimp, unit); rect_sel->fixed_width = - rect_sel->fixed_width * gdisp->gimage->xresolution / unit_factor; + rect_sel->fixed_width * gdisp->image->xresolution / unit_factor; rect_sel->fixed_height = - rect_sel->fixed_height * gdisp->gimage->yresolution / unit_factor; + rect_sel->fixed_height * gdisp->image->yresolution / unit_factor; break; } @@ -209,14 +209,14 @@ gimp_rect_select_tool_button_release (GimpTool *tool, if (rect_sel->w == 0 || rect_sel->h == 0) { /* If there is a floating selection, anchor it */ - if (gimp_image_floating_sel (gdisp->gimage)) - floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); + if (gimp_image_floating_sel (gdisp->image)) + floating_sel_anchor (gimp_image_floating_sel (gdisp->image)); /* Otherwise, clear the selection mask */ else - gimp_channel_clear (gimp_image_get_mask (gdisp->gimage), NULL, + gimp_channel_clear (gimp_image_get_mask (gdisp->image), NULL, TRUE); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); return; } @@ -225,7 +225,7 @@ gimp_rect_select_tool_button_release (GimpTool *tool, rect_sel->w, rect_sel->h); /* show selection on all views */ - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } } @@ -388,7 +388,7 @@ gimp_rect_select_tool_real_rect_select (GimpRectSelectTool *rect_tool, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - gimp_channel_select_rectangle (gimp_image_get_mask (tool->gdisp->gimage), + gimp_channel_select_rectangle (gimp_image_get_mask (tool->gdisp->image), x, y, w, h, sel_tool->op, options->feather, @@ -419,8 +419,8 @@ gimp_rect_select_tool_rect_select (GimpRectSelectTool *rect_tool, if (! gimp_rectangle_intersect (x, y, w, h, 0, 0, - tool->gdisp->gimage->width, - tool->gdisp->gimage->height, + tool->gdisp->image->width, + tool->gdisp->image->height, &x, &y, &w, &h)) { return; @@ -431,7 +431,7 @@ gimp_rect_select_tool_rect_select (GimpRectSelectTool *rect_tool, GimpItem *item; gint width, height; - item = GIMP_ITEM (gimp_image_active_drawable (tool->gdisp->gimage)); + item = GIMP_ITEM (gimp_image_active_drawable (tool->gdisp->image)); gimp_item_offsets (item, &off_x, &off_y); width = gimp_item_width (item); @@ -448,7 +448,7 @@ gimp_rect_select_tool_rect_select (GimpRectSelectTool *rect_tool, y -= off_y; } - if (gimp_image_crop_auto_shrink (tool->gdisp->gimage, + if (gimp_image_crop_auto_shrink (tool->gdisp->image, x, y, x + w, y + h, ! options->shrink_merged, @@ -487,7 +487,7 @@ gimp_rect_select_tool_update_options (GimpRectSelectTool *rect_sel, } else { - GimpImage *image = gdisp->gimage; + GimpImage *image = gdisp->image; width = (rect_sel->w * _gimp_unit_get_factor (image->gimp, diff --git a/app/tools/gimpregionselecttool.c b/app/tools/gimpregionselecttool.c index 9998a49a19..b0b1a0d462 100644 --- a/app/tools/gimpregionselecttool.c +++ b/app/tools/gimpregionselecttool.c @@ -218,14 +218,14 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool, if (GIMP_SELECTION_TOOL (tool)->op == SELECTION_ANCHOR) { /* If there is a floating selection, anchor it */ - if (gimp_image_floating_sel (gdisp->gimage)) - floating_sel_anchor (gimp_image_floating_sel (gdisp->gimage)); + if (gimp_image_floating_sel (gdisp->image)) + floating_sel_anchor (gimp_image_floating_sel (gdisp->image)); /* Otherwise, clear the selection mask */ else - gimp_channel_clear (gimp_image_get_mask (gdisp->gimage), NULL, + gimp_channel_clear (gimp_image_get_mask (gdisp->image), NULL, TRUE); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); return; } @@ -236,12 +236,12 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool, } else { - GimpDrawable *drawable = gimp_image_active_drawable (gdisp->gimage); + GimpDrawable *drawable = gimp_image_active_drawable (gdisp->image); gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y); } - gimp_channel_select_channel (gimp_image_get_mask (gdisp->gimage), + gimp_channel_select_channel (gimp_image_get_mask (gdisp->image), tool->tool_info->blurb, fuzzy_sel->fuzzy_mask, off_x, @@ -254,7 +254,7 @@ gimp_fuzzy_select_tool_button_release (GimpTool *tool, g_object_unref (fuzzy_sel->fuzzy_mask); fuzzy_sel->fuzzy_mask = NULL; - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } /* If the segment array is allocated, free it */ @@ -356,7 +356,7 @@ gimp_fuzzy_select_tool_calculate (GimpFuzzySelectTool *fuzzy_sel, shell = GIMP_DISPLAY_SHELL (gdisp->shell); - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); gimp_display_shell_set_override_cursor (shell, GDK_WATCH); @@ -373,7 +373,7 @@ gimp_fuzzy_select_tool_calculate (GimpFuzzySelectTool *fuzzy_sel, y -= off_y; } - new = gimp_image_contiguous_region_by_seed (gdisp->gimage, drawable, + new = gimp_image_contiguous_region_by_seed (gdisp->image, drawable, options->sample_merged, options->antialias, options->threshold, diff --git a/app/tools/gimprotatetool.c b/app/tools/gimprotatetool.c index 1e69e25364..c57522d77b 100644 --- a/app/tools/gimprotatetool.c +++ b/app/tools/gimprotatetool.c @@ -197,16 +197,16 @@ gimp_rotate_tool_prepare (GimpTransformTool *tr_tool, GIMP_DISPLAY_SHELL (gdisp->shell)->unit); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (rotate->sizeentry), 0, - gdisp->gimage->xresolution, FALSE); + gdisp->image->xresolution, FALSE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (rotate->sizeentry), 1, - gdisp->gimage->yresolution, FALSE); + gdisp->image->yresolution, FALSE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (rotate->sizeentry), 0, -65536, - 65536 + gdisp->gimage->width); + 65536 + gdisp->image->width); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (rotate->sizeentry), 1, -65536, - 65536 + gdisp->gimage->height); + 65536 + gdisp->image->height); gimp_size_entry_set_size (GIMP_SIZE_ENTRY (rotate->sizeentry), 0, tr_tool->x1, tr_tool->x2); diff --git a/app/tools/gimpscaletool.c b/app/tools/gimpscaletool.c index 476631131a..d3fbbcaf15 100644 --- a/app/tools/gimpscaletool.c +++ b/app/tools/gimpscaletool.c @@ -205,9 +205,9 @@ gimp_scale_tool_dialog_update (GimpTransformTool *tr_tool) _gimp_unit_get_digits (gimp, label_unit) + 1, _gimp_unit_get_symbol (gimp, label_unit)); g_snprintf (scale->orig_width_buf, MAX_INFO_BUF, format_buf, - (x2 - x1) * unit_factor / tool->gdisp->gimage->xresolution); + (x2 - x1) * unit_factor / tool->gdisp->image->xresolution); g_snprintf (scale->orig_height_buf, MAX_INFO_BUF, format_buf, - (y2 - y1) * unit_factor / tool->gdisp->gimage->yresolution); + (y2 - y1) * unit_factor / tool->gdisp->image->yresolution); } else /* unit == GIMP_UNIT_PIXEL */ { @@ -276,9 +276,9 @@ gimp_scale_tool_prepare (GimpTransformTool *tr_tool, GIMP_DISPLAY_SHELL (gdisp->shell)->unit); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (scale->sizeentry), 0, - gdisp->gimage->xresolution, FALSE); + gdisp->image->xresolution, FALSE); gimp_size_entry_set_resolution (GIMP_SIZE_ENTRY (scale->sizeentry), 1, - gdisp->gimage->yresolution, FALSE); + gdisp->image->yresolution, FALSE); gimp_size_entry_set_refval_boundaries (GIMP_SIZE_ENTRY (scale->sizeentry), 0, GIMP_MIN_IMAGE_SIZE, diff --git a/app/tools/gimpselectiontool.c b/app/tools/gimpselectiontool.c index 4fe9c037fe..367f4a0a2e 100644 --- a/app/tools/gimpselectiontool.c +++ b/app/tools/gimpselectiontool.c @@ -167,10 +167,10 @@ gimp_selection_tool_oper_update (GimpTool *tool, options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options); - selection = gimp_image_get_mask (gdisp->gimage); - layer = gimp_image_pick_correlate_layer (gdisp->gimage, + selection = gimp_image_get_mask (gdisp->image); + layer = gimp_image_pick_correlate_layer (gdisp->image, coords->x, coords->y); - floating_sel = gimp_image_floating_sel (gdisp->gimage); + floating_sel = gimp_image_floating_sel (gdisp->image); if (layer) { diff --git a/app/tools/gimpsourcetool.c b/app/tools/gimpsourcetool.c index 6e0667bf6f..00ca248423 100644 --- a/app/tools/gimpsourcetool.c +++ b/app/tools/gimpsourcetool.c @@ -197,9 +197,9 @@ gimp_clone_tool_cursor_update (GimpTool *tool, options = (GimpCloneOptions *) tool->tool_info->tool_options; - if (gimp_image_coords_in_active_drawable (gdisp->gimage, coords)) + if (gimp_image_coords_in_active_drawable (gdisp->image, coords)) { - GimpChannel *selection = gimp_image_get_mask (gdisp->gimage); + GimpChannel *selection = gimp_image_get_mask (gdisp->image); /* One more test--is there a selected region? * if so, is cursor inside? diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c index 29ab54d4d3..87cc0cc5a4 100644 --- a/app/tools/gimptexttool.c +++ b/app/tools/gimptexttool.c @@ -270,7 +270,7 @@ gimp_text_tool_button_press (GimpTool *tool, text_tool->x1 = coords->x; text_tool->y1 = coords->y; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); gimp_text_tool_set_drawable (text_tool, drawable, FALSE); @@ -698,7 +698,7 @@ gimp_text_tool_create_layer (GimpTextTool *text_tool, text = gimp_config_duplicate (GIMP_CONFIG (text_tool->proxy)); } - image = tool->gdisp->gimage; + image = tool->gdisp->image; layer = gimp_text_layer_new (image, text); g_object_unref (text); diff --git a/app/tools/gimpthresholdtool.c b/app/tools/gimpthresholdtool.c index 2e81614bb0..d4b0fcbca2 100644 --- a/app/tools/gimpthresholdtool.c +++ b/app/tools/gimpthresholdtool.c @@ -147,7 +147,7 @@ gimp_threshold_tool_initialize (GimpTool *tool, GimpThresholdTool *t_tool = GIMP_THRESHOLD_TOOL (tool); GimpDrawable *drawable; - drawable = gimp_image_active_drawable (gdisp->gimage); + drawable = gimp_image_active_drawable (gdisp->image); if (! drawable) return FALSE; diff --git a/app/tools/gimptool.c b/app/tools/gimptool.c index 87c4a57d68..c8d32d8b69 100644 --- a/app/tools/gimptool.c +++ b/app/tools/gimptool.c @@ -222,7 +222,7 @@ gimp_tool_real_button_press (GimpTool *tool, GimpDisplay *gdisp) { tool->gdisp = gdisp; - tool->drawable = gimp_image_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->image); gimp_tool_control_activate (tool->control); } diff --git a/app/tools/gimptransformtool-undo.c b/app/tools/gimptransformtool-undo.c index f0987ae061..3b9c1a817b 100644 --- a/app/tools/gimptransformtool-undo.c +++ b/app/tools/gimptransformtool-undo.c @@ -58,7 +58,7 @@ static void undo_free_transform (GimpUndo *undo, GimpUndoMode undo_mode); gboolean -gimp_transform_tool_push_undo (GimpImage *gimage, +gimp_transform_tool_push_undo (GimpImage *image, const gchar *undo_desc, gint tool_ID, GType tool_type, @@ -67,7 +67,7 @@ gimp_transform_tool_push_undo (GimpImage *gimage, { GimpUndo *new; - if ((new = gimp_image_undo_push (gimage, GIMP_TYPE_UNDO, + if ((new = gimp_image_undo_push (image, GIMP_TYPE_UNDO, sizeof (TransformUndo), sizeof (TransformUndo), GIMP_UNDO_TRANSFORM, undo_desc, @@ -101,7 +101,7 @@ undo_pop_transform (GimpUndo *undo, { GimpTool *active_tool; - active_tool = tool_manager_get_active (undo->gimage->gimp); + active_tool = tool_manager_get_active (undo->image->gimp); if (GIMP_IS_TRANSFORM_TOOL (active_tool)) { diff --git a/app/tools/gimptransformtool-undo.h b/app/tools/gimptransformtool-undo.h index 71a05fb62b..eb99585557 100644 --- a/app/tools/gimptransformtool-undo.h +++ b/app/tools/gimptransformtool-undo.h @@ -20,7 +20,7 @@ #define __GIMP_TRANSFORM_TOOL_UNDO_H__ -gboolean gimp_transform_tool_push_undo (GimpImage *gimage, +gboolean gimp_transform_tool_push_undo (GimpImage *image, const gchar *undo_desc, gint tool_ID, GType tool_type, diff --git a/app/tools/gimptransformtool.c b/app/tools/gimptransformtool.c index c1bbbf5a27..ae84e083df 100644 --- a/app/tools/gimptransformtool.c +++ b/app/tools/gimptransformtool.c @@ -327,7 +327,7 @@ gimp_transform_tool_initialize (GimpTool *tool, /* Set the pointer to the active display */ tool->gdisp = gdisp; - tool->drawable = gimp_image_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->image); /* Initialize the transform tool dialog */ if (! tr_tool->info_dialog) @@ -622,14 +622,14 @@ gimp_transform_tool_cursor_update (GimpTool *tool, if (tr_tool->use_grid) { - GimpChannel *selection = gimp_image_get_mask (gdisp->gimage); + GimpChannel *selection = gimp_image_get_mask (gdisp->image); GimpCursorType cursor = GIMP_CURSOR_MOUSE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; switch (options->type) { case GIMP_TRANSFORM_TYPE_LAYER: - if (gimp_image_coords_in_active_drawable (gdisp->gimage, coords)) + if (gimp_image_coords_in_active_drawable (gdisp->image, coords)) { if (gimp_channel_is_empty (selection) || gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection), @@ -650,7 +650,7 @@ gimp_transform_tool_cursor_update (GimpTool *tool, break; case GIMP_TRANSFORM_TYPE_PATH: - if (gimp_image_get_active_vectors (gdisp->gimage)) + if (gimp_image_get_active_vectors (gdisp->image)) cursor = GIMP_CURSOR_MOUSE; else cursor = GIMP_CURSOR_BAD; @@ -779,7 +779,7 @@ gimp_transform_tool_draw (GimpDrawTool *draw_tool) GimpStroke *stroke = NULL; GimpMatrix3 matrix = tr_tool->transform; - vectors = gimp_image_get_active_vectors (tool->gdisp->gimage); + vectors = gimp_image_get_active_vectors (tool->gdisp->image); if (vectors) { @@ -933,22 +933,22 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool, switch (options->type) { case GIMP_TRANSFORM_TYPE_LAYER: - active_item = (GimpItem *) gimp_image_active_drawable (gdisp->gimage); + active_item = (GimpItem *) gimp_image_active_drawable (gdisp->image); break; case GIMP_TRANSFORM_TYPE_SELECTION: - active_item = (GimpItem *) gimp_image_get_mask (gdisp->gimage); + active_item = (GimpItem *) gimp_image_get_mask (gdisp->image); break; case GIMP_TRANSFORM_TYPE_PATH: - active_item = (GimpItem *) gimp_image_get_active_vectors (gdisp->gimage); + active_item = (GimpItem *) gimp_image_get_active_vectors (gdisp->image); break; } if (! active_item) return; - mask_empty = gimp_channel_is_empty (gimp_image_get_mask (gdisp->gimage)); + mask_empty = gimp_channel_is_empty (gimp_image_get_mask (gdisp->image)); if (gimp_display_shell_get_show_transform (GIMP_DISPLAY_SHELL (gdisp->shell))) { @@ -959,7 +959,7 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool, gimp_transform_tool_expose_preview (tr_tool); } - gimp_set_busy (gdisp->gimage->gimp); + gimp_set_busy (gdisp->image->gimp); /* undraw the tool before we muck around with the transform matrix */ gimp_draw_tool_stop (GIMP_DRAW_TOOL (tr_tool)); @@ -968,7 +968,7 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool, gimp_tool_control_set_preserve (tool->control, TRUE); /* Start a transform undo group */ - gimp_image_undo_group_start (gdisp->gimage, GIMP_UNDO_GROUP_TRANSFORM, + gimp_image_undo_group_start (gdisp->image, GIMP_UNDO_GROUP_TRANSFORM, tool->tool_info->blurb); /* With the old UI, if original is NULL, then this is the @@ -980,7 +980,7 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool, * selection pointer, so that the original source can be repeatedly * modified. */ - tool->drawable = gimp_image_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->image); switch (options->type) { @@ -1016,7 +1016,7 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool, case GIMP_TRANSFORM_TYPE_LAYER: if (new_tiles) { - /* paste the new transformed image to the gimage...also implement + /* paste the new transformed image to the image...also implement * undo... */ gimp_drawable_transform_paste (tool->drawable, @@ -1048,25 +1048,25 @@ gimp_transform_tool_doit (GimpTransformTool *tr_tool, /* Make a note of the new current drawable (since we may have * a floating selection, etc now. */ - tool->drawable = gimp_image_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->image); - gimp_transform_tool_push_undo (gdisp->gimage, NULL, + gimp_transform_tool_push_undo (gdisp->image, NULL, tool->ID, G_TYPE_FROM_INSTANCE (tool), tr_tool->old_trans_info, NULL); /* push the undo group end */ - gimp_image_undo_group_end (gdisp->gimage); + gimp_image_undo_group_end (gdisp->image); /* We're done dirtying the image, and would like to be restarted * if the image gets dirty while the tool exists */ gimp_tool_control_set_preserve (tool->control, FALSE); - gimp_unset_busy (gdisp->gimage->gimp); + gimp_unset_busy (gdisp->image->gimp); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); gimp_transform_tool_halt (tr_tool); } @@ -1259,7 +1259,7 @@ gimp_transform_tool_bounds (GimpTransformTool *tr_tool, { case GIMP_TRANSFORM_TYPE_LAYER: { - GimpDrawable *drawable = gimp_image_active_drawable (gdisp->gimage); + GimpDrawable *drawable = gimp_image_active_drawable (gdisp->image); gint offset_x; gint offset_y; @@ -1277,7 +1277,7 @@ gimp_transform_tool_bounds (GimpTransformTool *tr_tool, case GIMP_TRANSFORM_TYPE_SELECTION: case GIMP_TRANSFORM_TYPE_PATH: - gimp_channel_bounds (gimp_image_get_mask (gdisp->gimage), + gimp_channel_bounds (gimp_image_get_mask (gdisp->image), &tr_tool->x1, &tr_tool->y1, &tr_tool->x2, &tr_tool->y2); break; @@ -1462,7 +1462,7 @@ gimp_transform_tool_prepare (GimpTransformTool *tr_tool, if (tr_tool->info_dialog) { gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (tr_tool->info_dialog->shell), - GIMP_VIEWABLE (gimp_image_active_drawable (gdisp->gimage))); + GIMP_VIEWABLE (gimp_image_active_drawable (gdisp->image))); gtk_widget_set_sensitive (GTK_WIDGET (tr_tool->info_dialog->shell), TRUE); } diff --git a/app/tools/gimpvectortool.c b/app/tools/gimpvectortool.c index fcee1c0341..c9f9220b65 100644 --- a/app/tools/gimpvectortool.c +++ b/app/tools/gimpvectortool.c @@ -109,7 +109,7 @@ static void gimp_vector_tool_cursor_update (GimpTool *tool, static void gimp_vector_tool_draw (GimpDrawTool *draw_tool); -static void gimp_vector_tool_vectors_changed (GimpImage *gimage, +static void gimp_vector_tool_vectors_changed (GimpImage *image, GimpVectorTool *vector_tool); static void gimp_vector_tool_vectors_removed (GimpVectors *vectors, GimpVectorTool *vector_tool); @@ -288,7 +288,7 @@ gimp_vector_tool_button_press (GimpTool *tool, NULL, NULL, NULL, NULL, NULL, &vectors)) { gimp_vector_tool_set_vectors (vector_tool, vectors); - gimp_image_set_active_vectors (gdisp->gimage, vectors); + gimp_image_set_active_vectors (gdisp->image, vectors); } vector_tool->function = VECTORS_FINISHED; } @@ -297,15 +297,15 @@ gimp_vector_tool_button_press (GimpTool *tool, if (vector_tool->function == VECTORS_CREATE_VECTOR) { - vectors = gimp_vectors_new (gdisp->gimage, _("Unnamed")); + vectors = gimp_vectors_new (gdisp->image, _("Unnamed")); /* Undo step gets added implicitely */ vector_tool->have_undo = TRUE; vector_tool->undo_motion = TRUE; - gimp_image_add_vectors (gdisp->gimage, vectors, -1); - gimp_image_flush (gdisp->gimage); + gimp_image_add_vectors (gdisp->image, vectors, -1); + gimp_image_flush (gdisp->image); gimp_vector_tool_set_vectors (vector_tool, vectors); @@ -620,10 +620,10 @@ gimp_vector_tool_button_release (GimpTool *tool, GimpUndo *undo; GimpUndoAccumulator accum = { 0, }; - undo = gimp_undo_stack_pop_undo (gdisp->gimage->undo_stack, + undo = gimp_undo_stack_pop_undo (gdisp->image->undo_stack, GIMP_UNDO_MODE_UNDO, &accum); - gimp_image_undo_event (gdisp->gimage, GIMP_UNDO_EVENT_UNDO_EXPIRED, undo); + gimp_image_undo_event (gdisp->image, GIMP_UNDO_EVENT_UNDO_EXPIRED, undo); gimp_undo_free (undo, GIMP_UNDO_MODE_UNDO); g_object_unref (undo); @@ -633,7 +633,7 @@ gimp_vector_tool_button_release (GimpTool *tool, vector_tool->undo_motion = FALSE; gimp_tool_control_halt (tool->control); - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); } static void @@ -832,7 +832,7 @@ gimp_vector_tool_key_press (GimpTool *tool, return FALSE; } - gimp_image_flush (gdisp->gimage); + gimp_image_flush (gdisp->image); return TRUE; } @@ -1410,11 +1410,11 @@ gimp_vector_tool_draw (GimpDrawTool *draw_tool) } static void -gimp_vector_tool_vectors_changed (GimpImage *gimage, +gimp_vector_tool_vectors_changed (GimpImage *image, GimpVectorTool *vector_tool) { gimp_vector_tool_set_vectors (vector_tool, - gimp_image_get_active_vectors (gimage)); + gimp_image_get_active_vectors (image)); } static void @@ -1500,7 +1500,7 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool, gimp_draw_tool_pause (draw_tool); if (gimp_draw_tool_is_active (draw_tool) && - (! vectors || draw_tool->gdisp->gimage != item->gimage)) + (! vectors || draw_tool->gdisp->image != item->image)) { gimp_draw_tool_stop (draw_tool); } @@ -1512,11 +1512,11 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool, if (vector_tool->vectors) { - GimpImage *old_gimage; + GimpImage *old_image; - old_gimage = gimp_item_get_image (GIMP_ITEM (vector_tool->vectors)); + old_image = gimp_item_get_image (GIMP_ITEM (vector_tool->vectors)); - g_signal_handlers_disconnect_by_func (old_gimage, + g_signal_handlers_disconnect_by_func (old_image, gimp_vector_tool_vectors_changed, vector_tool); g_signal_handlers_disconnect_by_func (vector_tool->vectors, @@ -1571,7 +1571,7 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool, g_object_ref (vectors); - g_signal_connect_object (item->gimage, "active-vectors-changed", + g_signal_connect_object (item->image, "active-vectors-changed", G_CALLBACK (gimp_vector_tool_vectors_changed), vector_tool, 0); g_signal_connect_object (vectors, "removed", @@ -1608,7 +1608,7 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool, if (! gimp_draw_tool_is_active (draw_tool)) { - if (tool->gdisp && tool->gdisp->gimage == item->gimage) + if (tool->gdisp && tool->gdisp->image == item->image) { gimp_draw_tool_start (draw_tool, tool->gdisp); } @@ -1620,17 +1620,17 @@ gimp_vector_tool_set_vectors (GimpVectorTool *vector_tool, context = gimp_get_user_context (tool->tool_info->gimp); gdisp = gimp_context_get_display (context); - if (! gdisp || gdisp->gimage != item->gimage) + if (! gdisp || gdisp->image != item->image) { GList *list; gdisp = NULL; - for (list = GIMP_LIST (item->gimage->gimp->displays)->list; + for (list = GIMP_LIST (item->image->gimp->displays)->list; list; list = g_list_next (list)) { - if (((GimpDisplay *) list->data)->gimage == item->gimage) + if (((GimpDisplay *) list->data)->image == item->image) { gimp_context_set_display (context, (GimpDisplay *) list->data); @@ -1823,7 +1823,7 @@ gimp_vector_tool_undo_push (GimpVectorTool *vector_tool, if (vector_tool->have_undo) return; - gimp_image_undo_push_vectors_mod (GIMP_ITEM (vector_tool->vectors)->gimage, + gimp_image_undo_push_vectors_mod (GIMP_ITEM (vector_tool->vectors)->image, desc, vector_tool->vectors); vector_tool->have_undo = TRUE; } @@ -1840,13 +1840,13 @@ static void gimp_vector_tool_to_selection_extended (GimpVectorTool *vector_tool, gint state) { - GimpImage *gimage; + GimpImage *image; GimpChannelOps operation = GIMP_CHANNEL_OP_REPLACE; if (! vector_tool->vectors) return; - gimage = gimp_item_get_image (GIMP_ITEM (vector_tool->vectors)); + image = gimp_item_get_image (GIMP_ITEM (vector_tool->vectors)); if (state & GDK_SHIFT_MASK) { @@ -1860,12 +1860,12 @@ gimp_vector_tool_to_selection_extended (GimpVectorTool *vector_tool, operation = GIMP_CHANNEL_OP_SUBTRACT; } - gimp_channel_select_vectors (gimp_image_get_mask (gimage), + gimp_channel_select_vectors (gimp_image_get_mask (image), _("Path to selection"), vector_tool->vectors, operation, TRUE, FALSE, 0, 0); - gimp_image_flush (gimage); + gimp_image_flush (image); } @@ -1873,16 +1873,16 @@ static void gimp_vector_tool_stroke_vectors (GimpVectorTool *vector_tool, GtkWidget *button) { - GimpImage *gimage; + GimpImage *image; GimpDrawable *active_drawable; GtkWidget *dialog; if (! vector_tool->vectors) return; - gimage = gimp_item_get_image (GIMP_ITEM (vector_tool->vectors)); + image = gimp_item_get_image (GIMP_ITEM (vector_tool->vectors)); - active_drawable = gimp_image_active_drawable (gimage); + active_drawable = gimp_image_active_drawable (image); if (! active_drawable) { diff --git a/app/tools/tool_manager.c b/app/tools/tool_manager.c index 3f97755ea0..57f861cbbd 100644 --- a/app/tools/tool_manager.c +++ b/app/tools/tool_manager.c @@ -62,7 +62,7 @@ static void tool_manager_set (Gimp *gimp, static void tool_manager_tool_changed (GimpContext *user_context, GimpToolInfo *tool_info, gpointer data); -static void tool_manager_image_clean_dirty (GimpImage *gimage, +static void tool_manager_image_clean_dirty (GimpImage *image, GimpDirtyMask dirty_mask, GimpToolManager *tool_manager); @@ -226,7 +226,7 @@ tool_manager_initialize_active (Gimp *gimp, if (gimp_tool_initialize (tool, gdisp)) { - tool->drawable = gimp_image_active_drawable (gdisp->gimage); + tool->drawable = gimp_image_active_drawable (gdisp->image); return TRUE; } @@ -542,7 +542,7 @@ tool_manager_tool_changed (GimpContext *user_context, } static void -tool_manager_image_clean_dirty (GimpImage *gimage, +tool_manager_image_clean_dirty (GimpImage *image, GimpDirtyMask dirty_mask, GimpToolManager *tool_manager) { @@ -554,11 +554,11 @@ tool_manager_image_clean_dirty (GimpImage *gimage, { GimpDisplay *gdisp = active_tool->gdisp; - if (! gdisp || gdisp->gimage != gimage) + if (! gdisp || gdisp->image != image) if (GIMP_IS_DRAW_TOOL (active_tool)) gdisp = GIMP_DRAW_TOOL (active_tool)->gdisp; - if (gdisp && gdisp->gimage == gimage) - gimp_context_tool_changed (gimp_get_user_context (gimage->gimp)); + if (gdisp && gdisp->image == image) + gimp_context_tool_changed (gimp_get_user_context (image->gimp)); } } diff --git a/app/vectors/gimpvectors-compat.c b/app/vectors/gimpvectors-compat.c index 54e0bb48e4..e654ac56df 100644 --- a/app/vectors/gimpvectors-compat.c +++ b/app/vectors/gimpvectors-compat.c @@ -46,7 +46,7 @@ static const GimpCoords default_coords = GIMP_COORDS_DEFAULT_VALUES; GimpVectors * -gimp_vectors_compat_new (GimpImage *gimage, +gimp_vectors_compat_new (GimpImage *image, const gchar *name, GimpVectorsCompatPoint *points, gint n_points, @@ -59,12 +59,12 @@ gimp_vectors_compat_new (GimpImage *gimage, GimpCoords *curr_coord; gint i; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (points != NULL || n_points == 0, NULL); g_return_val_if_fail (n_points >= 0, NULL); - vectors = gimp_vectors_new (gimage, name); + vectors = gimp_vectors_new (image, name); coords = g_new0 (GimpCoords, n_points + 1); @@ -126,14 +126,15 @@ gimp_vectors_compat_new (GimpImage *gimage, } gboolean -gimp_vectors_compat_is_compatible (GimpImage *gimage) +gimp_vectors_compat_is_compatible (GimpImage *image) { - GList *list, *strokes; + GList *list; + GList *strokes; GimpVectors *vectors; - GimpStroke *stroke; - gint open_count; + GimpStroke *stroke; + gint open_count; - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { diff --git a/app/vectors/gimpvectors-compat.h b/app/vectors/gimpvectors-compat.h index 767291a333..5e95d4236d 100644 --- a/app/vectors/gimpvectors-compat.h +++ b/app/vectors/gimpvectors-compat.h @@ -33,13 +33,13 @@ struct _GimpVectorsCompatPoint }; -GimpVectors * gimp_vectors_compat_new (GimpImage *gimage, +GimpVectors * gimp_vectors_compat_new (GimpImage *image, const gchar *name, GimpVectorsCompatPoint *points, gint n_points, gboolean closed); -gboolean gimp_vectors_compat_is_compatible (GimpImage *gimage); +gboolean gimp_vectors_compat_is_compatible (GimpImage *image); GimpVectorsCompatPoint * gimp_vectors_compat_get_points (GimpVectors *vectors, gint32 *n_points, diff --git a/app/vectors/gimpvectors-preview.c b/app/vectors/gimpvectors-preview.c index 7ec550f3ce..33ce306ea3 100644 --- a/app/vectors/gimpvectors-preview.c +++ b/app/vectors/gimpvectors-preview.c @@ -51,8 +51,8 @@ gimp_vectors_get_new_preview (GimpViewable *viewable, vectors = GIMP_VECTORS (viewable); item = GIMP_ITEM (viewable); - xscale = ((gdouble) width) / gimp_image_get_width (item->gimage); - yscale = ((gdouble) height) / gimp_image_get_height (item->gimage); + xscale = ((gdouble) width) / gimp_image_get_width (item->image); + yscale = ((gdouble) height) / gimp_image_get_height (item->image); temp_buf = temp_buf_new (width, height, 1, 0, 0, white); data = temp_buf_data (temp_buf); diff --git a/app/vectors/gimpvectors.c b/app/vectors/gimpvectors.c index e726938441..446883d161 100644 --- a/app/vectors/gimpvectors.c +++ b/app/vectors/gimpvectors.c @@ -265,8 +265,8 @@ gimp_vectors_get_memsize (GimpObject *object, static gboolean gimp_vectors_is_attached (GimpItem *item) { - return (GIMP_IS_IMAGE (item->gimage) && - gimp_container_have (item->gimage->vectors, GIMP_OBJECT (item))); + return (GIMP_IS_IMAGE (item->image) && + gimp_container_have (item->image->vectors, GIMP_OBJECT (item))); } static GimpItem * @@ -541,17 +541,17 @@ gimp_vectors_real_thaw (GimpVectors *vectors) /* public functions */ GimpVectors * -gimp_vectors_new (GimpImage *gimage, +gimp_vectors_new (GimpImage *image, const gchar *name) { GimpVectors *vectors; - g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL); vectors = g_object_new (GIMP_TYPE_VECTORS, NULL); - gimp_item_configure (GIMP_ITEM (vectors), gimage, - 0, 0, gimage->width, gimage->height, + gimp_item_configure (GIMP_ITEM (vectors), image, + 0, 0, image->width, image->height, name); return vectors; diff --git a/app/vectors/gimpvectors.h b/app/vectors/gimpvectors.h index 2169e0d2d8..a44ceeb5c3 100644 --- a/app/vectors/gimpvectors.h +++ b/app/vectors/gimpvectors.h @@ -87,7 +87,7 @@ struct _GimpVectorsClass GType gimp_vectors_get_type (void) G_GNUC_CONST; -GimpVectors * gimp_vectors_new (GimpImage *gimage, +GimpVectors * gimp_vectors_new (GimpImage *image, const gchar *name); void gimp_vectors_freeze (GimpVectors *vectors); diff --git a/app/widgets/gimpchanneltreeview.c b/app/widgets/gimpchanneltreeview.c index b1dba41fdf..4a77fb4b4e 100644 --- a/app/widgets/gimpchanneltreeview.c +++ b/app/widgets/gimpchanneltreeview.c @@ -58,12 +58,12 @@ static void gimp_channel_tree_view_drop_viewable (GimpContainerTreeView *vi GimpViewable *dest_viewable, GtkTreeViewDropPosition drop_pos); static void gimp_channel_tree_view_drop_component (GimpContainerTreeView *tree_view, - GimpImage *gimage, + GimpImage *image, GimpChannelType component, GimpViewable *dest_viewable, GtkTreeViewDropPosition drop_pos); static void gimp_channel_tree_view_set_image (GimpItemTreeView *item_view, - GimpImage *gimage); + GimpImage *image); static GimpItem * gimp_channel_tree_view_item_new (GimpImage *image); static void gimp_channel_tree_view_set_view_size (GimpContainerView *view); @@ -202,7 +202,7 @@ gimp_channel_tree_view_drop_viewable (GimpContainerTreeView *tree_view, item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (item_view); if (GIMP_IS_DRAWABLE (src_viewable) && - (item_view->gimage != gimp_item_get_image (GIMP_ITEM (src_viewable)) || + (item_view->image != gimp_item_get_image (GIMP_ITEM (src_viewable)) || G_TYPE_FROM_INSTANCE (src_viewable) != item_view_class->item_type)) { GimpItem *new_item; @@ -210,7 +210,7 @@ gimp_channel_tree_view_drop_viewable (GimpContainerTreeView *tree_view, if (dest_viewable) { - index = gimp_image_get_channel_index (item_view->gimage, + index = gimp_image_get_channel_index (item_view->image, GIMP_CHANNEL (dest_viewable)); if (drop_pos == GTK_TREE_VIEW_DROP_AFTER) @@ -218,11 +218,11 @@ gimp_channel_tree_view_drop_viewable (GimpContainerTreeView *tree_view, } new_item = gimp_item_convert (GIMP_ITEM (src_viewable), - item_view->gimage, + item_view->image, item_view_class->item_type, FALSE); - item_view_class->add_item (item_view->gimage, new_item, index); - gimp_image_flush (item_view->gimage); + item_view_class->add_item (item_view->image, new_item, index); + gimp_image_flush (item_view->image); return; } @@ -247,7 +247,7 @@ gimp_channel_tree_view_drop_component (GimpContainerTreeView *tree_view, if (dest_viewable) { - index = gimp_image_get_channel_index (item_view->gimage, + index = gimp_image_get_channel_index (item_view->image, GIMP_CHANNEL (dest_viewable)); if (drop_pos == GTK_TREE_VIEW_DROP_AFTER) @@ -268,11 +268,11 @@ gimp_channel_tree_view_drop_component (GimpContainerTreeView *tree_view, g_free (name); - if (src_image != item_view->gimage) - GIMP_ITEM_GET_CLASS (new_item)->convert (new_item, item_view->gimage); + if (src_image != item_view->image) + GIMP_ITEM_GET_CLASS (new_item)->convert (new_item, item_view->image); - gimp_image_add_channel (item_view->gimage, GIMP_CHANNEL (new_item), index); - gimp_image_flush (item_view->gimage); + gimp_image_add_channel (item_view->image, GIMP_CHANNEL (new_item), index); + gimp_image_flush (item_view->image); } @@ -280,7 +280,7 @@ gimp_channel_tree_view_drop_component (GimpContainerTreeView *tree_view, static void gimp_channel_tree_view_set_image (GimpItemTreeView *item_view, - GimpImage *gimage) + GimpImage *image) { GimpChannelTreeView *channel_view = GIMP_CHANNEL_TREE_VIEW (item_view); @@ -302,15 +302,15 @@ gimp_channel_tree_view_set_image (GimpItemTreeView *item_view, channel_view->component_editor, 0); } - if (! gimage) + if (! image) gtk_widget_hide (channel_view->component_editor); gimp_image_editor_set_image (GIMP_IMAGE_EDITOR (channel_view->component_editor), - gimage); + image); - GIMP_ITEM_TREE_VIEW_CLASS (parent_class)->set_image (item_view, gimage); + GIMP_ITEM_TREE_VIEW_CLASS (parent_class)->set_image (item_view, image); - if (item_view->gimage) + if (item_view->image) gtk_widget_show (channel_view->component_editor); } diff --git a/app/widgets/gimpcolormapeditor.c b/app/widgets/gimpcolormapeditor.c index b456d74517..022a068449 100644 --- a/app/widgets/gimpcolormapeditor.c +++ b/app/widgets/gimpcolormapeditor.c @@ -64,10 +64,10 @@ enum }; -#define HAVE_COLORMAP(gimage) \ - (gimage != NULL && \ - gimp_image_base_type (gimage) == GIMP_INDEXED && \ - gimp_image_get_colormap (gimage) != NULL) +#define HAVE_COLORMAP(image) \ + (image != NULL && \ + gimp_image_base_type (image) == GIMP_INDEXED && \ + gimp_image_get_colormap (image) != NULL) static GObject * gimp_colormap_editor_constructor (GType type, @@ -78,7 +78,7 @@ static void gimp_colormap_editor_destroy (GtkObject *object); static void gimp_colormap_editor_unmap (GtkWidget *widget); static void gimp_colormap_editor_set_image (GimpImageEditor *editor, - GimpImage *gimage); + GimpImage *image); static void gimp_colormap_editor_draw (GimpColormapEditor *editor); static void gimp_colormap_editor_draw_cell (GimpColormapEditor *editor, @@ -110,9 +110,9 @@ static void gimp_colormap_adjustment_changed (GtkAdjustment *adjustme static void gimp_colormap_hex_entry_changed (GimpColorHexEntry *entry, GimpColormapEditor *editor); -static void gimp_colormap_image_mode_changed (GimpImage *gimage, +static void gimp_colormap_image_mode_changed (GimpImage *image, GimpColormapEditor *editor); -static void gimp_colormap_image_colormap_changed (GimpImage *gimage, +static void gimp_colormap_image_colormap_changed (GimpImage *image, gint ncol, GimpColormapEditor *editor); @@ -275,23 +275,23 @@ gimp_colormap_editor_unmap (GtkWidget *widget) static void gimp_colormap_editor_set_image (GimpImageEditor *image_editor, - GimpImage *gimage) + GimpImage *image) { GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (image_editor); - if (image_editor->gimage) + if (image_editor->image) { - g_signal_handlers_disconnect_by_func (image_editor->gimage, + g_signal_handlers_disconnect_by_func (image_editor->image, gimp_colormap_image_mode_changed, editor); - g_signal_handlers_disconnect_by_func (image_editor->gimage, + g_signal_handlers_disconnect_by_func (image_editor->image, gimp_colormap_image_colormap_changed, editor); if (editor->color_dialog) gtk_widget_hide (editor->color_dialog); - if (! HAVE_COLORMAP (gimage)) + if (! HAVE_COLORMAP (image)) { editor->index_adjustment->upper = 0; gtk_adjustment_changed (editor->index_adjustment); @@ -301,26 +301,26 @@ gimp_colormap_editor_set_image (GimpImageEditor *image_editor, } } - GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, gimage); + GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, image); editor->col_index = 0; editor->dnd_col_index = 0; - if (gimage) + if (image) { - g_signal_connect (gimage, "mode-changed", + g_signal_connect (image, "mode-changed", G_CALLBACK (gimp_colormap_image_mode_changed), editor); - g_signal_connect (gimage, "colormap-changed", + g_signal_connect (image, "colormap-changed", G_CALLBACK (gimp_colormap_image_colormap_changed), editor); - if (HAVE_COLORMAP (gimage)) + if (HAVE_COLORMAP (image)) { gimp_colormap_editor_draw (editor); editor->index_adjustment->upper = - gimp_image_get_colormap_size (gimage) - 1; + gimp_image_get_colormap_size (image) - 1; gtk_adjustment_changed (editor->index_adjustment); } @@ -369,7 +369,7 @@ gimp_colormap_editor_col_index (GimpColormapEditor *editor) static void gimp_colormap_editor_draw (GimpColormapEditor *editor) { - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; gint i, j, k, l, b; gint col; guchar *row; @@ -377,7 +377,7 @@ gimp_colormap_editor_draw (GimpColormapEditor *editor) width = editor->preview->allocation.width; height = editor->preview->allocation.height; - ncol = gimp_image_get_colormap_size (gimage); + ncol = gimp_image_get_colormap_size (image); if (! ncol) { @@ -420,7 +420,7 @@ gimp_colormap_editor_draw (GimpColormapEditor *editor) { for (k = 0; k < cellsize; k++) for (b = 0; b < 3; b++) - row[(j * cellsize + k) * 3 + b] = gimage->cmap[col * 3 + b]; + row[(j * cellsize + k) * 3 + b] = image->cmap[col * 3 + b]; } for (k = 0; k < cellsize; k++) @@ -451,7 +451,7 @@ static void gimp_colormap_editor_draw_cell (GimpColormapEditor *editor, gint col) { - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; gint cellsize = editor->cellsize; guchar *row = g_alloca (cellsize * 3); gint x, y, k; @@ -476,9 +476,9 @@ gimp_colormap_editor_draw_cell (GimpColormapEditor *editor, = 255 * (cellsize & 1); for (k = 1; k < cellsize - 1; k++) { - row[k*3] = gimage->cmap[col * 3]; - row[k*3+1] = gimage->cmap[col * 3 + 1]; - row[k*3+2] = gimage->cmap[col * 3 + 2]; + row[k*3] = image->cmap[col * 3]; + row[k*3+1] = image->cmap[col * 3 + 1]; + row[k*3+2] = image->cmap[col * 3 + 2]; } for (k = 1; k < cellsize - 1; k+=2) gtk_preview_draw_row (GTK_PREVIEW (editor->preview), row, @@ -495,9 +495,9 @@ gimp_colormap_editor_draw_cell (GimpColormapEditor *editor, { for (k = 0; k < cellsize; k++) { - row[k*3] = gimage->cmap[col * 3]; - row[k*3+1] = gimage->cmap[col * 3 + 1]; - row[k*3+2] = gimage->cmap[col * 3 + 2]; + row[k*3] = image->cmap[col * 3]; + row[k*3+1] = image->cmap[col * 3 + 1]; + row[k*3+2] = image->cmap[col * 3 + 2]; } for (k = 0; k < cellsize; k++) gtk_preview_draw_row (GTK_PREVIEW (editor->preview), row, @@ -569,9 +569,9 @@ gimp_colormap_editor_clear (GimpColormapEditor *editor, static void gimp_colormap_editor_update_entries (GimpColormapEditor *editor) { - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; - if (! HAVE_COLORMAP (gimage)) + if (! HAVE_COLORMAP (image)) { gtk_widget_set_sensitive (editor->index_spinbutton, FALSE); gtk_widget_set_sensitive (editor->color_entry, FALSE); @@ -586,7 +586,7 @@ gimp_colormap_editor_update_entries (GimpColormapEditor *editor) gtk_adjustment_set_value (editor->index_adjustment, editor->col_index); - col = gimage->cmap + editor->col_index * 3; + col = image->cmap + editor->col_index * 3; string = g_strdup_printf ("%02x%02x%02x", col[0], col[1], col[2]); gtk_entry_set_text (GTK_ENTRY (editor->color_entry), string); @@ -620,9 +620,9 @@ gimp_colormap_preview_size_allocate (GtkWidget *widget, GtkAllocation *alloc, GimpColormapEditor *editor) { - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; - if (HAVE_COLORMAP (gimage)) + if (HAVE_COLORMAP (image)) gimp_colormap_editor_draw (editor); else gimp_colormap_editor_clear (editor, -1); @@ -634,10 +634,10 @@ gimp_colormap_preview_button_press (GtkWidget *widget, GdkEventButton *bevent, GimpColormapEditor *editor) { - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; guint col; - if (! HAVE_COLORMAP (gimage)) + if (! HAVE_COLORMAP (image)) return TRUE; if (!(bevent->y < editor->cellsize * editor->yn @@ -647,7 +647,7 @@ gimp_colormap_preview_button_press (GtkWidget *widget, col = (editor->xn * ((gint) bevent->y / editor->cellsize) + ((gint) bevent->x / editor->cellsize)); - if (col >= gimp_image_get_colormap_size (gimage)) + if (col >= gimp_image_get_colormap_size (image)) return TRUE; switch (bevent->button) @@ -691,10 +691,10 @@ gimp_colormap_preview_drag_color (GtkWidget *widget, gpointer data) { GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data); - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; - if (HAVE_COLORMAP (gimage)) - gimp_image_get_colormap_entry (gimage, editor->dnd_col_index, color); + if (HAVE_COLORMAP (image)) + gimp_image_get_colormap_entry (image, editor->dnd_col_index, color); } static void @@ -705,11 +705,11 @@ gimp_colormap_preview_drop_color (GtkWidget *widget, gpointer data) { GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data); - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; - if (HAVE_COLORMAP (gimage) && gimp_image_get_colormap_size (gimage) < 256) + if (HAVE_COLORMAP (image) && gimp_image_get_colormap_size (image) < 256) { - gimp_image_add_colormap_entry (gimage, color); + gimp_image_add_colormap_entry (image, color); } } @@ -717,9 +717,9 @@ static void gimp_colormap_adjustment_changed (GtkAdjustment *adjustment, GimpColormapEditor *editor) { - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; - if (HAVE_COLORMAP (gimage)) + if (HAVE_COLORMAP (image)) { gimp_colormap_editor_set_index (editor, adjustment->value + 0.5); @@ -731,35 +731,35 @@ static void gimp_colormap_hex_entry_changed (GimpColorHexEntry *entry, GimpColormapEditor *editor) { - GimpImage *gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; - if (gimage) + if (image) { GimpRGB color; gimp_color_hex_entry_get_color (entry, &color); - gimp_image_set_colormap_entry (gimage, editor->col_index, &color, TRUE); - gimp_image_flush (gimage); + gimp_image_set_colormap_entry (image, editor->col_index, &color, TRUE); + gimp_image_flush (image); } } static void -gimp_colormap_image_mode_changed (GimpImage *gimage, +gimp_colormap_image_mode_changed (GimpImage *image, GimpColormapEditor *editor) { if (editor->color_dialog) gtk_widget_hide (editor->color_dialog); - gimp_colormap_image_colormap_changed (gimage, -1, editor); + gimp_colormap_image_colormap_changed (image, -1, editor); } static void -gimp_colormap_image_colormap_changed (GimpImage *gimage, +gimp_colormap_image_colormap_changed (GimpImage *image, gint ncol, GimpColormapEditor *editor) { - if (HAVE_COLORMAP (gimage)) + if (HAVE_COLORMAP (image)) { if (ncol < 0) { @@ -771,10 +771,10 @@ gimp_colormap_image_colormap_changed (GimpImage *gimage, } if (editor->index_adjustment->upper != - (gimp_image_get_colormap_size (gimage) - 1)) + (gimp_image_get_colormap_size (image) - 1)) { editor->index_adjustment->upper = - gimp_image_get_colormap_size (gimage) - 1; + gimp_image_get_colormap_size (image) - 1; gtk_adjustment_changed (editor->index_adjustment); } diff --git a/app/widgets/gimpcomponenteditor.c b/app/widgets/gimpcomponenteditor.c index 05afb993ac..1ac3fab5be 100644 --- a/app/widgets/gimpcomponenteditor.c +++ b/app/widgets/gimpcomponenteditor.c @@ -54,7 +54,7 @@ enum static void gimp_component_editor_unrealize (GtkWidget *widget); static void gimp_component_editor_set_image (GimpImageEditor *editor, - GimpImage *gimage); + GimpImage *image); static void gimp_component_editor_create_components (GimpComponentEditor *editor); static void gimp_component_editor_clear_components (GimpComponentEditor *editor); @@ -72,14 +72,14 @@ static gboolean gimp_component_editor_button_press (GtkWidget *widget GimpComponentEditor *editor); static void gimp_component_editor_renderer_update (GimpViewRenderer *renderer, GimpComponentEditor *editor); -static void gimp_component_editor_mode_changed (GimpImage *gimage, +static void gimp_component_editor_mode_changed (GimpImage *image, GimpComponentEditor *editor); -static void gimp_component_editor_alpha_changed (GimpImage *gimage, +static void gimp_component_editor_alpha_changed (GimpImage *image, GimpComponentEditor *editor); -static void gimp_component_editor_visibility_changed(GimpImage *gimage, +static void gimp_component_editor_visibility_changed(GimpImage *image, GimpChannelType channel, GimpComponentEditor *editor); -static void gimp_component_editor_active_changed (GimpImage *gimage, +static void gimp_component_editor_active_changed (GimpImage *image, GimpChannelType channel, GimpComponentEditor *editor); static GimpImage * gimp_component_editor_drag_component (GtkWidget *widget, @@ -199,46 +199,46 @@ gimp_component_editor_unrealize (GtkWidget *widget) static void gimp_component_editor_set_image (GimpImageEditor *editor, - GimpImage *gimage) + GimpImage *image) { GimpComponentEditor *component_editor; component_editor = GIMP_COMPONENT_EDITOR (editor); - if (editor->gimage) + if (editor->image) { gimp_component_editor_clear_components (component_editor); - g_signal_handlers_disconnect_by_func (editor->gimage, + g_signal_handlers_disconnect_by_func (editor->image, gimp_component_editor_mode_changed, component_editor); - g_signal_handlers_disconnect_by_func (editor->gimage, + g_signal_handlers_disconnect_by_func (editor->image, gimp_component_editor_alpha_changed, component_editor); - g_signal_handlers_disconnect_by_func (editor->gimage, + g_signal_handlers_disconnect_by_func (editor->image, gimp_component_editor_visibility_changed, component_editor); - g_signal_handlers_disconnect_by_func (editor->gimage, + g_signal_handlers_disconnect_by_func (editor->image, gimp_component_editor_active_changed, component_editor); } - GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (editor, gimage); + GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (editor, image); - if (editor->gimage) + if (editor->image) { gimp_component_editor_create_components (component_editor); - g_signal_connect (editor->gimage, "mode-changed", + g_signal_connect (editor->image, "mode-changed", G_CALLBACK (gimp_component_editor_mode_changed), component_editor); - g_signal_connect (editor->gimage, "alpha-changed", + g_signal_connect (editor->image, "alpha-changed", G_CALLBACK (gimp_component_editor_alpha_changed), component_editor); - g_signal_connect (editor->gimage, "component-visibility-changed", + g_signal_connect (editor->image, "component-visibility-changed", G_CALLBACK (gimp_component_editor_visibility_changed), component_editor); - g_signal_connect (editor->gimage, "component-active-changed", + g_signal_connect (editor->image, "component-active-changed", G_CALLBACK (gimp_component_editor_active_changed), component_editor); } @@ -314,15 +314,15 @@ gimp_component_editor_set_view_size (GimpComponentEditor *editor, static void gimp_component_editor_create_components (GimpComponentEditor *editor) { - GimpImage *gimage; + GimpImage *image; gint n_components = 0; GimpChannelType components[MAX_CHANNELS]; GEnumClass *enum_class; gint i; - gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + image = GIMP_IMAGE_EDITOR (editor)->image; - switch (gimp_image_base_type (gimage)) + switch (gimp_image_base_type (image)) { case GIMP_RGB: n_components = 3; @@ -342,7 +342,7 @@ gimp_component_editor_create_components (GimpComponentEditor *editor) break; } - if (gimp_image_has_alpha (gimage)) + if (gimp_image_has_alpha (image)) components[n_components++] = GIMP_ALPHA_CHANNEL; enum_class = g_type_class_ref (GIMP_TYPE_CHANNEL_TYPE); @@ -355,11 +355,11 @@ gimp_component_editor_create_components (GimpComponentEditor *editor) const gchar *desc; gboolean visible; - visible = gimp_image_get_component_visible (gimage, components[i]); + visible = gimp_image_get_component_visible (image, components[i]); - renderer = gimp_view_renderer_new (G_TYPE_FROM_INSTANCE (gimage), + renderer = gimp_view_renderer_new (G_TYPE_FROM_INSTANCE (image), editor->view_size, 1, FALSE); - gimp_view_renderer_set_viewable (renderer, GIMP_VIEWABLE (gimage)); + gimp_view_renderer_set_viewable (renderer, GIMP_VIEWABLE (image)); gimp_view_renderer_remove_idle (renderer); GIMP_VIEW_RENDERER_IMAGE (renderer)->channel = components[i]; @@ -382,7 +382,7 @@ gimp_component_editor_create_components (GimpComponentEditor *editor) g_object_unref (renderer); - if (gimp_image_get_component_active (gimage, components[i])) + if (gimp_image_get_component_active (image, components[i])) gtk_tree_selection_select_iter (editor->selection, &iter); } @@ -413,12 +413,10 @@ gimp_component_editor_clicked (GtkCellRendererToggle *cellrenderertoggle, if (gtk_tree_model_get_iter (editor->model, &iter, path)) { - GimpImage *gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; GimpChannelType channel; gboolean active; - gimage = GIMP_IMAGE_EDITOR (editor)->gimage; - gtk_tree_model_get (editor->model, &iter, COLUMN_CHANNEL, &channel, -1); @@ -426,8 +424,8 @@ gimp_component_editor_clicked (GtkCellRendererToggle *cellrenderertoggle, "active", &active, NULL); - gimp_image_set_component_visible (gimage, channel, !active); - gimp_image_flush (gimage); + gimp_image_set_component_visible (image, channel, !active); + gimp_image_flush (image); } gtk_tree_path_free (path); @@ -452,7 +450,7 @@ gimp_component_editor_select (GtkTreeSelection *selection, COLUMN_CHANNEL, &channel, -1); - active = gimp_image_get_component_active (GIMP_IMAGE_EDITOR (editor)->gimage, + active = gimp_image_get_component_active (GIMP_IMAGE_EDITOR (editor)->image, channel); return active != path_currently_selected; @@ -494,7 +492,7 @@ gimp_component_editor_button_press (GtkWidget *widget, case 1: if (column != editor->eye_column && bevent->type == GDK_BUTTON_PRESS) { - GimpImage *image = GIMP_IMAGE_EDITOR (editor)->gimage; + GimpImage *image = GIMP_IMAGE_EDITOR (editor)->image; gimp_image_set_component_active (image, channel, ! active); gimp_image_flush (image); @@ -523,7 +521,7 @@ gimp_component_editor_get_iter (GimpComponentEditor *editor, { gint index; - index = gimp_image_get_component_index (GIMP_IMAGE_EDITOR (editor)->gimage, + index = gimp_image_get_component_index (GIMP_IMAGE_EDITOR (editor)->image, channel); if (index != -1) @@ -550,7 +548,7 @@ gimp_component_editor_renderer_update (GimpViewRenderer *renderer, } static void -gimp_component_editor_mode_changed (GimpImage *gimage, +gimp_component_editor_mode_changed (GimpImage *image, GimpComponentEditor *editor) { gimp_component_editor_clear_components (editor); @@ -558,7 +556,7 @@ gimp_component_editor_mode_changed (GimpImage *gimage, } static void -gimp_component_editor_alpha_changed (GimpImage *gimage, +gimp_component_editor_alpha_changed (GimpImage *image, GimpComponentEditor *editor) { gimp_component_editor_clear_components (editor); @@ -566,7 +564,7 @@ gimp_component_editor_alpha_changed (GimpImage *gimage, } static void -gimp_component_editor_visibility_changed (GimpImage *gimage, +gimp_component_editor_visibility_changed (GimpImage *image, GimpChannelType channel, GimpComponentEditor *editor) { @@ -576,7 +574,7 @@ gimp_component_editor_visibility_changed (GimpImage *gimage, { gboolean visible; - visible = gimp_image_get_component_visible (gimage, channel); + visible = gimp_image_get_component_visible (image, channel); gtk_list_store_set (GTK_LIST_STORE (editor->model), &iter, COLUMN_VISIBLE, visible, @@ -585,7 +583,7 @@ gimp_component_editor_visibility_changed (GimpImage *gimage, } static void -gimp_component_editor_active_changed (GimpImage *gimage, +gimp_component_editor_active_changed (GimpImage *image, GimpChannelType channel, GimpComponentEditor *editor) { @@ -595,7 +593,7 @@ gimp_component_editor_active_changed (GimpImage *gimage, { gboolean active; - active = gimp_image_get_component_active (gimage, channel); + active = gimp_image_get_component_active (image, channel); if (gtk_tree_selection_iter_is_selected (editor->selection, &iter) != active) @@ -615,13 +613,13 @@ gimp_component_editor_drag_component (GtkWidget *widget, { GimpComponentEditor *editor = GIMP_COMPONENT_EDITOR (data); - if (GIMP_IMAGE_EDITOR (editor)->gimage && + if (GIMP_IMAGE_EDITOR (editor)->image && editor->clicked_component != -1) { if (channel) *channel = editor->clicked_component; - return GIMP_IMAGE_EDITOR (editor)->gimage; + return GIMP_IMAGE_EDITOR (editor)->image; } return NULL; diff --git a/app/widgets/gimpdnd.c b/app/widgets/gimpdnd.c index bb1a05b4b7..c62c77b3c5 100644 --- a/app/widgets/gimpdnd.c +++ b/app/widgets/gimpdnd.c @@ -1979,13 +1979,13 @@ gimp_dnd_get_image_data (GtkWidget *widget, gpointer get_image_data, GtkSelectionData *selection) { - GimpImage *gimage; + GimpImage *image; - gimage = (GimpImage *) + image = (GimpImage *) (* (GimpDndDragViewableFunc) get_image_func) (widget, get_image_data); - if (gimage) - gimp_selection_data_set_image (selection, gimage); + if (image) + gimp_selection_data_set_image (selection, image); } static gboolean @@ -1996,13 +1996,13 @@ gimp_dnd_set_image_data (GtkWidget *widget, gpointer set_image_data, GtkSelectionData *selection) { - GimpImage *gimage = gimp_selection_data_get_image (selection, the_dnd_gimp); + GimpImage *image = gimp_selection_data_get_image (selection, the_dnd_gimp); - if (! gimage) + if (! image) return FALSE; (* (GimpDndDropViewableFunc) set_image_func) (widget, x, y, - GIMP_VIEWABLE (gimage), + GIMP_VIEWABLE (image), set_image_data); return TRUE; diff --git a/app/widgets/gimpdrawabletreeview.c b/app/widgets/gimpdrawabletreeview.c index d5a4da5d72..3ecdbd4a85 100644 --- a/app/widgets/gimpdrawabletreeview.c +++ b/app/widgets/gimpdrawabletreeview.c @@ -69,10 +69,10 @@ static void gimp_drawable_tree_view_drop_color (GimpContainerTreeView *view, GtkTreeViewDropPosition drop_pos); static void gimp_drawable_tree_view_set_image (GimpItemTreeView *view, - GimpImage *gimage); + GimpImage *image); static void gimp_drawable_tree_view_floating_selection_changed - (GimpImage *gimage, + (GimpImage *image, GimpDrawableTreeView *view); static void gimp_drawable_tree_view_new_pattern_dropped @@ -172,12 +172,12 @@ gimp_drawable_tree_view_select_item (GimpContainerView *view, GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (view); gboolean success = TRUE; - if (item_view->gimage) + if (item_view->image) { GimpViewable *floating_sel; floating_sel = (GimpViewable *) - gimp_image_floating_sel (item_view->gimage); + gimp_image_floating_sel (item_view->image); success = (item == NULL || floating_sel == NULL || item == floating_sel); } @@ -244,7 +244,7 @@ gimp_drawable_tree_view_drop_viewable (GimpContainerTreeView *view, FALSE, 0.0, FALSE, /* fill params */ 0.0, 0.0, /* ignored */ NULL, GIMP_PATTERN (src_viewable)); - gimp_image_flush (GIMP_ITEM_TREE_VIEW (view)->gimage); + gimp_image_flush (GIMP_ITEM_TREE_VIEW (view)->image); return; } @@ -269,7 +269,7 @@ gimp_drawable_tree_view_drop_color (GimpContainerTreeView *view, FALSE, 0.0, FALSE, /* fill params */ 0.0, 0.0, /* ignored */ color, NULL); - gimp_image_flush (GIMP_ITEM_TREE_VIEW (view)->gimage); + gimp_image_flush (GIMP_ITEM_TREE_VIEW (view)->image); } } @@ -278,17 +278,17 @@ gimp_drawable_tree_view_drop_color (GimpContainerTreeView *view, static void gimp_drawable_tree_view_set_image (GimpItemTreeView *view, - GimpImage *gimage) + GimpImage *image) { - if (view->gimage) - g_signal_handlers_disconnect_by_func (view->gimage, + if (view->image) + g_signal_handlers_disconnect_by_func (view->image, gimp_drawable_tree_view_floating_selection_changed, view); - GIMP_ITEM_TREE_VIEW_CLASS (parent_class)->set_image (view, gimage); + GIMP_ITEM_TREE_VIEW_CLASS (parent_class)->set_image (view, image); - if (view->gimage) - g_signal_connect (view->gimage, + if (view->image) + g_signal_connect (view->image, "floating-selection-changed", G_CALLBACK (gimp_drawable_tree_view_floating_selection_changed), view); @@ -298,12 +298,12 @@ gimp_drawable_tree_view_set_image (GimpItemTreeView *view, /* callbacks */ static void -gimp_drawable_tree_view_floating_selection_changed (GimpImage *gimage, +gimp_drawable_tree_view_floating_selection_changed (GimpImage *image, GimpDrawableTreeView *view) { GimpItem *item; - item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (gimage); + item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image); /* update button states */ gimp_container_view_select_item (GIMP_CONTAINER_VIEW (view), @@ -320,10 +320,10 @@ gimp_drawable_tree_view_new_dropped (GimpItemTreeView *view, { GimpItem *item; - gimp_image_undo_group_start (view->gimage, GIMP_UNDO_GROUP_EDIT_PASTE, + gimp_image_undo_group_start (view->image, GIMP_UNDO_GROUP_EDIT_PASTE, _("New Layer")); - item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->new_item (view->gimage); + item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->new_item (view->image); if (item) { @@ -333,7 +333,7 @@ gimp_drawable_tree_view_new_dropped (GimpItemTreeView *view, /* Get the bucket fill context */ tool_info = (GimpToolInfo *) - gimp_container_get_child_by_name (view->gimage->gimp->tool_info_list, + gimp_container_get_child_by_name (view->image->gimp->tool_info_list, "gimp-bucket-fill-tool"); if (tool_info && tool_info->tool_options) @@ -350,9 +350,9 @@ gimp_drawable_tree_view_new_dropped (GimpItemTreeView *view, color, pattern); } - gimp_image_undo_group_end (view->gimage); + gimp_image_undo_group_end (view->image); - gimp_image_flush (view->gimage); + gimp_image_flush (view->image); } static void diff --git a/app/widgets/gimpfiledialog.c b/app/widgets/gimpfiledialog.c index 7777d6ffed..4d018151bf 100644 --- a/app/widgets/gimpfiledialog.c +++ b/app/widgets/gimpfiledialog.c @@ -361,23 +361,23 @@ gimp_file_dialog_set_file_proc (GimpFileDialog *dialog, void gimp_file_dialog_set_image (GimpFileDialog *dialog, - GimpImage *gimage, + GimpImage *image, gboolean save_a_copy) { const gchar *uri = NULL; gboolean uri_set = FALSE; g_return_if_fail (GIMP_IS_FILE_DIALOG (dialog)); - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - dialog->gimage = gimage; + dialog->image = image; dialog->save_a_copy = save_a_copy; if (save_a_copy) - uri = g_object_get_data (G_OBJECT (gimage), "gimp-image-save-a-copy"); + uri = g_object_get_data (G_OBJECT (image), "gimp-image-save-a-copy"); if (! uri) - uri = gimp_object_get_name (GIMP_OBJECT (gimage)); + uri = gimp_object_get_name (GIMP_OBJECT (image)); if (uri) uri_set = gtk_file_chooser_set_uri (GTK_FILE_CHOOSER (dialog), uri); @@ -386,7 +386,7 @@ gimp_file_dialog_set_image (GimpFileDialog *dialog, if (! uri_set) { - const gchar *name = gimp_image_get_uri (gimage); + const gchar *name = gimp_image_get_uri (image); gchar *current; if (! name) diff --git a/app/widgets/gimpfiledialog.h b/app/widgets/gimpfiledialog.h index f3e80faf42..ff7d5d4f83 100644 --- a/app/widgets/gimpfiledialog.h +++ b/app/widgets/gimpfiledialog.h @@ -41,7 +41,7 @@ struct _GimpFileDialog PlugInProcDef *file_proc; - GimpImage *gimage; + GimpImage *image; gboolean save_a_copy; GtkWidget *thumb_box; @@ -75,7 +75,7 @@ void gimp_file_dialog_set_file_proc (GimpFileDialog *dialog, PlugInProcDef *file_proc); void gimp_file_dialog_set_image (GimpFileDialog *dialog, - GimpImage *gimage, + GimpImage *image, gboolean save_a_copy); G_END_DECLS diff --git a/app/widgets/gimphistogrameditor.c b/app/widgets/gimphistogrameditor.c index db529a3660..13a3de9738 100644 --- a/app/widgets/gimphistogrameditor.c +++ b/app/widgets/gimphistogrameditor.c @@ -50,8 +50,8 @@ static void gimp_histogram_editor_set_aux_info (GimpDocked *docked, static GList * gimp_histogram_editor_get_aux_info (GimpDocked *docked); static void gimp_histogram_editor_set_image (GimpImageEditor *editor, - GimpImage *gimage); -static void gimp_histogram_editor_layer_changed (GimpImage *gimage, + GimpImage *image); +static void gimp_histogram_editor_layer_changed (GimpImage *image, GimpHistogramEditor *editor); static void gimp_histogram_editor_update (GimpHistogramEditor *editor); @@ -235,12 +235,12 @@ gimp_histogram_editor_get_aux_info (GimpDocked *docked) static void gimp_histogram_editor_set_image (GimpImageEditor *image_editor, - GimpImage *gimage) + GimpImage *image) { GimpHistogramEditor *editor = GIMP_HISTOGRAM_EDITOR (image_editor); GimpHistogramView *view = GIMP_HISTOGRAM_BOX (editor->box)->view; - if (image_editor->gimage) + if (image_editor->image) { if (editor->idle_id) { @@ -248,10 +248,10 @@ gimp_histogram_editor_set_image (GimpImageEditor *image_editor, editor->idle_id = 0; } - g_signal_handlers_disconnect_by_func (image_editor->gimage, + g_signal_handlers_disconnect_by_func (image_editor->image, gimp_histogram_editor_layer_changed, editor); - g_signal_handlers_disconnect_by_func (image_editor->gimage, + g_signal_handlers_disconnect_by_func (image_editor->image, gimp_histogram_editor_menu_update, editor); @@ -264,26 +264,26 @@ gimp_histogram_editor_set_image (GimpImageEditor *image_editor, gimp_histogram_view_set_histogram (view, NULL); } - GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, gimage); + GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, image); - if (gimage) + if (image) { editor->histogram = gimp_histogram_new (); gimp_histogram_view_set_histogram (view, editor->histogram); - g_signal_connect_object (gimage, "mode-changed", + g_signal_connect_object (image, "mode-changed", G_CALLBACK (gimp_histogram_editor_menu_update), editor, G_CONNECT_SWAPPED); - g_signal_connect_object (gimage, "active-layer-changed", + g_signal_connect_object (image, "active-layer-changed", G_CALLBACK (gimp_histogram_editor_layer_changed), editor, 0); - g_signal_connect_object (gimage, "mask-changed", + g_signal_connect_object (image, "mask-changed", G_CALLBACK (gimp_histogram_editor_update), editor, G_CONNECT_SWAPPED); } - gimp_histogram_editor_layer_changed (gimage, editor); + gimp_histogram_editor_layer_changed (image, editor); } GtkWidget * @@ -293,7 +293,7 @@ gimp_histogram_editor_new (void) } static void -gimp_histogram_editor_layer_changed (GimpImage *gimage, +gimp_histogram_editor_layer_changed (GimpImage *image, GimpHistogramEditor *editor) { if (editor->drawable) @@ -310,8 +310,8 @@ gimp_histogram_editor_layer_changed (GimpImage *gimage, editor->drawable = NULL; } - if (gimage) - editor->drawable = (GimpDrawable *) gimp_image_get_active_layer (gimage); + if (image) + editor->drawable = (GimpDrawable *) gimp_image_get_active_layer (image); gimp_histogram_editor_menu_update (editor); diff --git a/app/widgets/gimpimageeditor.c b/app/widgets/gimpimageeditor.c index fc70f943de..54da1749c6 100644 --- a/app/widgets/gimpimageeditor.c +++ b/app/widgets/gimpimageeditor.c @@ -36,8 +36,8 @@ static void gimp_image_editor_set_context (GimpDocked *docked, GimpContext *context); static void gimp_image_editor_destroy (GtkObject *object); static void gimp_image_editor_real_set_image (GimpImageEditor *editor, - GimpImage *gimage); -static void gimp_image_editor_image_flush (GimpImage *gimage, + GimpImage *image); +static void gimp_image_editor_image_flush (GimpImage *image, GimpImageEditor *editor); @@ -61,7 +61,7 @@ gimp_image_editor_class_init (GimpImageEditorClass *klass) static void gimp_image_editor_init (GimpImageEditor *editor) { - editor->gimage = NULL; + editor->image = NULL; gtk_widget_set_sensitive (GTK_WIDGET (editor), FALSE); } @@ -103,7 +103,7 @@ gimp_image_editor_destroy (GtkObject *object) { GimpImageEditor *editor = GIMP_IMAGE_EDITOR (object); - if (editor->gimage) + if (editor->image) gimp_image_editor_set_image (editor, NULL); GTK_OBJECT_CLASS (parent_class)->destroy (object); @@ -111,21 +111,21 @@ gimp_image_editor_destroy (GtkObject *object) static void gimp_image_editor_real_set_image (GimpImageEditor *editor, - GimpImage *gimage) + GimpImage *image) { - if (editor->gimage) - g_signal_handlers_disconnect_by_func (editor->gimage, + if (editor->image) + g_signal_handlers_disconnect_by_func (editor->image, gimp_image_editor_image_flush, editor); - editor->gimage = gimage; + editor->image = image; - if (editor->gimage) - g_signal_connect (editor->gimage, "flush", + if (editor->image) + g_signal_connect (editor->image, "flush", G_CALLBACK (gimp_image_editor_image_flush), editor); - gtk_widget_set_sensitive (GTK_WIDGET (editor), gimage != NULL); + gtk_widget_set_sensitive (GTK_WIDGET (editor), image != NULL); } @@ -133,14 +133,14 @@ gimp_image_editor_real_set_image (GimpImageEditor *editor, void gimp_image_editor_set_image (GimpImageEditor *editor, - GimpImage *gimage) + GimpImage *image) { g_return_if_fail (GIMP_IS_IMAGE_EDITOR (editor)); - g_return_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage)); + g_return_if_fail (image == NULL || GIMP_IS_IMAGE (image)); - if (gimage != editor->gimage) + if (image != editor->image) { - GIMP_IMAGE_EDITOR_GET_CLASS (editor)->set_image (editor, gimage); + GIMP_IMAGE_EDITOR_GET_CLASS (editor)->set_image (editor, image); if (GIMP_EDITOR (editor)->ui_manager) gimp_ui_manager_update (GIMP_EDITOR (editor)->ui_manager, @@ -152,7 +152,7 @@ gimp_image_editor_set_image (GimpImageEditor *editor, /* private functions */ static void -gimp_image_editor_image_flush (GimpImage *gimage, +gimp_image_editor_image_flush (GimpImage *image, GimpImageEditor *editor) { if (GIMP_EDITOR (editor)->ui_manager) diff --git a/app/widgets/gimpimageeditor.h b/app/widgets/gimpimageeditor.h index 4f3a40eec6..038a0650bd 100644 --- a/app/widgets/gimpimageeditor.h +++ b/app/widgets/gimpimageeditor.h @@ -38,7 +38,7 @@ struct _GimpImageEditor GimpEditor parent_instance; GimpContext *context; - GimpImage *gimage; + GimpImage *image; }; struct _GimpImageEditorClass @@ -47,14 +47,14 @@ struct _GimpImageEditorClass /* virtual function */ void (* set_image) (GimpImageEditor *editor, - GimpImage *gimage); + GimpImage *image); }; GType gimp_image_editor_get_type (void) G_GNUC_CONST; void gimp_image_editor_set_image (GimpImageEditor *editor, - GimpImage *gimage); + GimpImage *image); #endif /* __GIMP_IMAGE_EDITOR_H__ */ diff --git a/app/widgets/gimpimagepropview.c b/app/widgets/gimpimagepropview.c index 82d9fbf83c..f68b841d39 100644 --- a/app/widgets/gimpimagepropview.c +++ b/app/widgets/gimpimagepropview.c @@ -62,7 +62,7 @@ static void gimp_image_prop_view_get_property (GObject *object, static GtkWidget * gimp_image_prop_view_add_label (GtkTable *table, gint row, const gchar *text); -static void gimp_image_prop_view_undo_event (GimpImage *gimage, +static void gimp_image_prop_view_undo_event (GimpImage *image, GimpUndoEvent event, GimpUndo *undo, GimpImagePropView *view); @@ -299,7 +299,7 @@ gimp_image_prop_view_label_set_undo (GtkWidget *label, } static void -gimp_image_prop_view_undo_event (GimpImage *gimage, +gimp_image_prop_view_undo_event (GimpImage *image, GimpUndoEvent event, GimpUndo *undo, GimpImagePropView *view) diff --git a/app/widgets/gimpitemtreeview.c b/app/widgets/gimpitemtreeview.c index 803d19ee0d..c060d4aaa9 100644 --- a/app/widgets/gimpitemtreeview.c +++ b/app/widgets/gimpitemtreeview.c @@ -75,9 +75,9 @@ static GObject * gimp_item_tree_view_constructor (GType type, static void gimp_item_tree_view_destroy (GtkObject *object); static void gimp_item_tree_view_real_set_image (GimpItemTreeView *view, - GimpImage *gimage); + GimpImage *image); -static void gimp_item_tree_view_image_flush (GimpImage *gimage, +static void gimp_item_tree_view_image_flush (GimpImage *image, GimpItemTreeView *view); static void gimp_item_tree_view_set_container (GimpContainerView *view, @@ -113,9 +113,9 @@ static void gimp_item_tree_view_new_dropped (GtkWidget *widget, GimpViewable *viewable, gpointer data); -static void gimp_item_tree_view_item_changed (GimpImage *gimage, +static void gimp_item_tree_view_item_changed (GimpImage *image, GimpItemTreeView *view); -static void gimp_item_tree_view_size_changed (GimpImage *gimage, +static void gimp_item_tree_view_size_changed (GimpImage *image, GimpItemTreeView *view); static void gimp_item_tree_view_name_edited (GtkCellRendererText *cell, @@ -238,7 +238,7 @@ gimp_item_tree_view_init (GimpItemTreeView *view) tree_view->dnd_drop_to_empty = TRUE; view->context = NULL; - view->gimage = NULL; + view->image = NULL; view->visible_changed_handler_id = 0; view->linked_changed_handler_id = 0; @@ -267,8 +267,8 @@ static void gimp_item_tree_view_set_context (GimpDocked *docked, GimpContext *context) { - GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (docked); - GimpImage *gimage = NULL; + GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (docked); + GimpImage *image = NULL; if (view->context) { @@ -288,10 +288,10 @@ gimp_item_tree_view_set_context (GimpDocked *docked, G_CALLBACK (gimp_item_tree_view_set_image), view); - gimage = gimp_context_get_image (context); + image = gimp_context_get_image (context); } - gimp_item_tree_view_set_image (view, gimage); + gimp_item_tree_view_set_image (view, image); } static GObject * @@ -422,7 +422,7 @@ gimp_item_tree_view_destroy (GtkObject *object) { GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (object); - if (view->gimage) + if (view->image) gimp_item_tree_view_set_image (view, NULL); GTK_OBJECT_CLASS (parent_class)->destroy (object); @@ -432,7 +432,7 @@ GtkWidget * gimp_item_tree_view_new (GType view_type, gint view_size, gint view_border_width, - GimpImage *gimage, + GimpImage *image, GimpMenuFactory *menu_factory, const gchar *menu_identifier, const gchar *ui_path) @@ -445,7 +445,7 @@ gimp_item_tree_view_new (GType view_type, g_return_val_if_fail (view_border_width >= 0 && view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH, NULL); - g_return_val_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage), NULL); + g_return_val_if_fail (image == NULL || GIMP_IS_IMAGE (image), NULL); g_return_val_if_fail (GIMP_IS_MENU_FACTORY (menu_factory), NULL); g_return_val_if_fail (menu_identifier != NULL, NULL); g_return_val_if_fail (ui_path != NULL, NULL); @@ -460,75 +460,75 @@ gimp_item_tree_view_new (GType view_type, gimp_container_view_set_view_size (GIMP_CONTAINER_VIEW (item_view), view_size, view_border_width); - gimp_item_tree_view_set_image (item_view, gimage); + gimp_item_tree_view_set_image (item_view, image); return GTK_WIDGET (item_view); } void gimp_item_tree_view_set_image (GimpItemTreeView *view, - GimpImage *gimage) + GimpImage *image) { g_return_if_fail (GIMP_IS_ITEM_TREE_VIEW (view)); - g_return_if_fail (gimage == NULL || GIMP_IS_IMAGE (gimage)); + g_return_if_fail (image == NULL || GIMP_IS_IMAGE (image)); - g_signal_emit (view, view_signals[SET_IMAGE], 0, gimage); + g_signal_emit (view, view_signals[SET_IMAGE], 0, image); gimp_ui_manager_update (GIMP_EDITOR (view)->ui_manager, view); } static void gimp_item_tree_view_real_set_image (GimpItemTreeView *view, - GimpImage *gimage) + GimpImage *image) { - if (view->gimage == gimage) + if (view->image == image) return; - if (view->gimage) + if (view->image) { - g_signal_handlers_disconnect_by_func (view->gimage, + g_signal_handlers_disconnect_by_func (view->image, gimp_item_tree_view_item_changed, view); - g_signal_handlers_disconnect_by_func (view->gimage, + g_signal_handlers_disconnect_by_func (view->image, gimp_item_tree_view_size_changed, view); gimp_container_view_set_container (GIMP_CONTAINER_VIEW (view), NULL); - g_signal_handlers_disconnect_by_func (view->gimage, + g_signal_handlers_disconnect_by_func (view->image, gimp_item_tree_view_image_flush, view); } - view->gimage = gimage; + view->image = image; - if (view->gimage) + if (view->image) { GimpContainer *container; container = - GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_container (view->gimage); + GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_container (view->image); gimp_container_view_set_container (GIMP_CONTAINER_VIEW (view), container); - g_signal_connect (view->gimage, + g_signal_connect (view->image, GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->signal_name, G_CALLBACK (gimp_item_tree_view_item_changed), view); - g_signal_connect (view->gimage, "size-changed", + g_signal_connect (view->image, "size-changed", G_CALLBACK (gimp_item_tree_view_size_changed), view); - g_signal_connect (view->gimage, "flush", + g_signal_connect (view->image, "flush", G_CALLBACK (gimp_item_tree_view_image_flush), view); - gimp_item_tree_view_item_changed (view->gimage, view); + gimp_item_tree_view_item_changed (view->image, view); } } static void -gimp_item_tree_view_image_flush (GimpImage *gimage, +gimp_item_tree_view_image_flush (GimpImage *image, GimpItemTreeView *view) { gimp_ui_manager_update (GIMP_EDITOR (view)->ui_manager, view); @@ -611,14 +611,14 @@ gimp_item_tree_view_select_item (GimpContainerView *view, item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (tree_view); - active_item = item_view_class->get_active_item (tree_view->gimage); + active_item = item_view_class->get_active_item (tree_view->image); if (active_item != (GimpItem *) item) { - item_view_class->set_active_item (tree_view->gimage, + item_view_class->set_active_item (tree_view->image, GIMP_ITEM (item)); - gimp_image_flush (tree_view->gimage); + gimp_image_flush (tree_view->image); } } @@ -713,7 +713,7 @@ gimp_item_tree_view_drop_viewable (GimpContainerTreeView *tree_view, item_view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (item_view); - if (item_view->gimage != gimp_item_get_image (GIMP_ITEM (src_viewable)) || + if (item_view->image != gimp_item_get_image (GIMP_ITEM (src_viewable)) || ! g_type_is_a (G_TYPE_FROM_INSTANCE (src_viewable), item_view_class->item_type)) { @@ -727,9 +727,9 @@ gimp_item_tree_view_drop_viewable (GimpContainerTreeView *tree_view, dest_index++; new_item = gimp_item_convert (GIMP_ITEM (src_viewable), - item_view->gimage, item_type, TRUE); + item_view->image, item_type, TRUE); - item_view_class->add_item (item_view->gimage, new_item, dest_index); + item_view_class->add_item (item_view->image, new_item, dest_index); } else if (dest_viewable) { @@ -747,14 +747,14 @@ gimp_item_tree_view_drop_viewable (GimpContainerTreeView *tree_view, dest_index--; } - item_view_class->reorder_item (item_view->gimage, + item_view_class->reorder_item (item_view->image, GIMP_ITEM (src_viewable), dest_index, TRUE, item_view_class->reorder_desc); } - gimp_image_flush (item_view->gimage); + gimp_image_flush (item_view->image); } @@ -795,19 +795,19 @@ gimp_item_tree_view_new_dropped (GtkWidget *widget, /* GimpImage callbacks */ static void -gimp_item_tree_view_item_changed (GimpImage *gimage, +gimp_item_tree_view_item_changed (GimpImage *image, GimpItemTreeView *view) { GimpItem *item; - item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (view->gimage); + item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (view->image); gimp_container_view_select_item (GIMP_CONTAINER_VIEW (view), (GimpViewable *) item); } static void -gimp_item_tree_view_size_changed (GimpImage *gimage, +gimp_item_tree_view_size_changed (GimpImage *image, GimpItemTreeView *tree_view) { GimpContainerView *view = GIMP_CONTAINER_VIEW (tree_view); @@ -954,7 +954,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle, void (* setter) (GimpItem *item, gboolean value, gboolean push_undo); - gboolean (* pusher) (GimpImage *gimage, + gboolean (* pusher) (GimpImage *image, const gchar *undo_desc, GimpItem *item); @@ -986,7 +986,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle, { GimpViewRenderer *renderer; GimpItem *item; - GimpImage *gimage; + GimpImage *image; gboolean active; gtk_tree_model_get (tree_view->model, &iter, @@ -999,7 +999,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle, item = GIMP_ITEM (renderer->viewable); g_object_unref (renderer); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); if (state & GDK_SHIFT_MASK) { @@ -1037,7 +1037,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle, view_class = GIMP_ITEM_TREE_VIEW_GET_CLASS (view); - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_UNDO_STACK, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_UNDO_STACK, group_type); if (undo && (g_object_get_data (G_OBJECT (undo), "item-type") == @@ -1046,10 +1046,10 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle, if (push_undo) { - if (gimp_image_undo_group_start (gimage, group_type, + if (gimp_image_undo_group_start (image, group_type, undo_desc)) { - undo = gimp_image_undo_can_compress (gimage, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_UNDO_STACK, group_type); @@ -1058,15 +1058,15 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle, (gpointer) view_class->item_type); } - pusher (gimage, NULL, item); + pusher (image, NULL, item); for (list = on; list; list = g_list_next (list)) - pusher (gimage, NULL, list->data); + pusher (image, NULL, list->data); for (list = off; list; list = g_list_next (list)) - pusher (gimage, NULL, list->data); + pusher (image, NULL, list->data); - gimp_image_undo_group_end (gimage); + gimp_image_undo_group_end (image); } else { @@ -1095,7 +1095,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle, GimpUndo *undo; gboolean push_undo = TRUE; - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, undo_type); if (undo && GIMP_ITEM_UNDO (undo)->item == item) @@ -1107,7 +1107,7 @@ gimp_item_tree_view_toggle_clicked (GtkCellRendererToggle *toggle, gimp_undo_refresh_preview (undo); } - gimp_image_flush (gimage); + gimp_image_flush (image); } gtk_tree_path_free (path); diff --git a/app/widgets/gimpitemtreeview.h b/app/widgets/gimpitemtreeview.h index d073d03cd9..a5fc31f315 100644 --- a/app/widgets/gimpitemtreeview.h +++ b/app/widgets/gimpitemtreeview.h @@ -26,21 +26,21 @@ #include "gimpcontainertreeview.h" -typedef GimpContainer * (* GimpGetContainerFunc) (const GimpImage *gimage); -typedef GimpItem * (* GimpGetItemFunc) (const GimpImage *gimage); -typedef void (* GimpSetItemFunc) (GimpImage *gimage, +typedef GimpContainer * (* GimpGetContainerFunc) (const GimpImage *image); +typedef GimpItem * (* GimpGetItemFunc) (const GimpImage *image); +typedef void (* GimpSetItemFunc) (GimpImage *image, GimpItem *item); -typedef void (* GimpReorderItemFunc) (GimpImage *gimage, +typedef void (* GimpReorderItemFunc) (GimpImage *image, GimpItem *item, gint new_index, gboolean push_undo, const gchar *undo_desc); -typedef void (* GimpAddItemFunc) (GimpImage *gimage, +typedef void (* GimpAddItemFunc) (GimpImage *image, GimpItem *item, gint index); -typedef void (* GimpRemoveItemFunc) (GimpImage *gimage, +typedef void (* GimpRemoveItemFunc) (GimpImage *image, GimpItem *item); -typedef GimpItem * (* GimpNewItemFunc) (GimpImage *gimage); +typedef GimpItem * (* GimpNewItemFunc) (GimpImage *image); #define GIMP_TYPE_ITEM_TREE_VIEW (gimp_item_tree_view_get_type ()) @@ -58,7 +58,7 @@ struct _GimpItemTreeView GimpContainerTreeView parent_instance; GimpContext *context; - GimpImage *gimage; + GimpImage *image; GtkWidget *edit_button; GtkWidget *new_button; @@ -83,7 +83,7 @@ struct _GimpItemTreeViewClass /* signals */ void (* set_image) (GimpItemTreeView *view, - GimpImage *gimage); + GimpImage *image); GType item_type; const gchar *signal_name; @@ -120,13 +120,13 @@ GType gimp_item_tree_view_get_type (void) G_GNUC_CONST; GtkWidget * gimp_item_tree_view_new (GType view_type, gint view_size, gint view_border_width, - GimpImage *gimage, + GimpImage *image, GimpMenuFactory *menu_facotry, const gchar *menu_identifier, const gchar *ui_identifier); void gimp_item_tree_view_set_image (GimpItemTreeView *view, - GimpImage *gimage); + GimpImage *image); #endif /* __GIMP_ITEM_TREE_VIEW_H__ */ diff --git a/app/widgets/gimplayertreeview.c b/app/widgets/gimplayertreeview.c index 9066cdc718..79de5ecd0e 100644 --- a/app/widgets/gimplayertreeview.c +++ b/app/widgets/gimplayertreeview.c @@ -95,7 +95,7 @@ static void gimp_layer_tree_view_drop_uri_list (GimpContainerTreeView *view, GimpViewable *dest_viewable, GtkTreeViewDropPosition drop_pos); static void gimp_layer_tree_view_drop_component (GimpContainerTreeView *tree_view, - GimpImage *gimage, + GimpImage *image, GimpChannelType component, GimpViewable *dest_viewable, GtkTreeViewDropPosition drop_pos); @@ -105,11 +105,11 @@ static void gimp_layer_tree_view_drop_pixbuf (GimpContainerTreeView *tree_v GtkTreeViewDropPosition drop_pos); static void gimp_layer_tree_view_set_image (GimpItemTreeView *view, - GimpImage *gimage); + GimpImage *image); static GimpItem * gimp_layer_tree_view_item_new (GimpImage *image); static void gimp_layer_tree_view_floating_selection_changed - (GimpImage *gimage, + (GimpImage *image, GimpLayerTreeView *view); static void gimp_layer_tree_view_paint_mode_menu_callback @@ -637,7 +637,7 @@ gimp_layer_tree_view_drop_possible (GimpContainerTreeView *tree_view, src_type == GIMP_DND_TYPE_PIXBUF || GIMP_IS_DRAWABLE (src_viewable)) { - GimpImage *dest_image = GIMP_ITEM_TREE_VIEW (tree_view)->gimage; + GimpImage *dest_image = GIMP_ITEM_TREE_VIEW (tree_view)->image; if (gimp_image_floating_sel (dest_image)) return FALSE; @@ -663,7 +663,7 @@ gimp_layer_tree_view_drop_color (GimpContainerTreeView *view, gimp_text_layer_set (GIMP_TEXT_LAYER (dest_viewable), NULL, "color", color, NULL); - gimp_image_flush (GIMP_ITEM_TREE_VIEW (view)->gimage); + gimp_image_flush (GIMP_ITEM_TREE_VIEW (view)->image); return; } @@ -679,13 +679,13 @@ gimp_layer_tree_view_drop_uri_list (GimpContainerTreeView *view, GtkTreeViewDropPosition drop_pos) { GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (view); - GimpImage *gimage = item_view->gimage; + GimpImage *image = item_view->image; gint index = -1; GList *list; if (dest_viewable) { - index = gimp_image_get_layer_index (gimage, GIMP_LAYER (dest_viewable)); + index = gimp_image_get_layer_index (image, GIMP_LAYER (dest_viewable)); if (drop_pos == GTK_TREE_VIEW_DROP_AFTER) index++; @@ -698,8 +698,8 @@ gimp_layer_tree_view_drop_uri_list (GimpContainerTreeView *view, GimpPDBStatusType status; GError *error = NULL; - new_layer = file_open_layer (gimage->gimp, item_view->context, NULL, - gimage, uri, GIMP_RUN_INTERACTIVE, NULL, + new_layer = file_open_layer (image->gimp, item_view->context, NULL, + image, uri, GIMP_RUN_INTERACTIVE, NULL, &status, &error); if (new_layer) @@ -708,8 +708,8 @@ gimp_layer_tree_view_drop_uri_list (GimpContainerTreeView *view, gint width, height; gint off_x, off_y; - width = gimp_image_get_width (gimage); - height = gimp_image_get_height (gimage); + width = gimp_image_get_width (image); + height = gimp_image_get_height (image); gimp_item_offsets (new_item, &off_x, &off_y); @@ -718,7 +718,7 @@ gimp_layer_tree_view_drop_uri_list (GimpContainerTreeView *view, gimp_item_translate (new_item, off_x, off_y, FALSE); - gimp_image_add_layer (gimage, new_layer, index++); + gimp_image_add_layer (image, new_layer, index++); } else if (status != GIMP_PDB_CANCEL) { @@ -732,7 +732,7 @@ gimp_layer_tree_view_drop_uri_list (GimpContainerTreeView *view, } } - gimp_image_flush (gimage); + gimp_image_flush (image); } static void @@ -751,7 +751,7 @@ gimp_layer_tree_view_drop_component (GimpContainerTreeView *tree_view, if (dest_viewable) { - index = gimp_image_get_layer_index (item_view->gimage, + index = gimp_image_get_layer_index (item_view->image, GIMP_LAYER (dest_viewable)); if (drop_pos == GTK_TREE_VIEW_DROP_AFTER) @@ -760,7 +760,7 @@ gimp_layer_tree_view_drop_component (GimpContainerTreeView *tree_view, channel = gimp_channel_new_from_component (src_image, component, NULL, NULL); - new_item = gimp_item_convert (GIMP_ITEM (channel), item_view->gimage, + new_item = gimp_item_convert (GIMP_ITEM (channel), item_view->image, GIMP_TYPE_LAYER, TRUE); g_object_unref (channel); @@ -771,8 +771,8 @@ gimp_layer_tree_view_drop_component (GimpContainerTreeView *tree_view, gimp_object_set_name (GIMP_OBJECT (new_item), name); g_free (name); - gimp_image_add_layer (item_view->gimage, GIMP_LAYER (new_item), index); - gimp_image_flush (item_view->gimage); + gimp_image_add_layer (item_view->image, GIMP_LAYER (new_item), index); + gimp_image_flush (item_view->image); } static void @@ -782,7 +782,7 @@ gimp_layer_tree_view_drop_pixbuf (GimpContainerTreeView *tree_view, GtkTreeViewDropPosition drop_pos) { GimpItemTreeView *item_view = GIMP_ITEM_TREE_VIEW (tree_view); - GimpImage *image = item_view->gimage; + GimpImage *image = item_view->image; GimpLayer *new_layer; gint index = -1; @@ -809,17 +809,17 @@ gimp_layer_tree_view_drop_pixbuf (GimpContainerTreeView *tree_view, static void gimp_layer_tree_view_set_image (GimpItemTreeView *view, - GimpImage *gimage) + GimpImage *image) { - if (view->gimage) - g_signal_handlers_disconnect_by_func (view->gimage, + if (view->image) + g_signal_handlers_disconnect_by_func (view->image, gimp_layer_tree_view_floating_selection_changed, view); - GIMP_ITEM_TREE_VIEW_CLASS (parent_class)->set_image (view, gimage); + GIMP_ITEM_TREE_VIEW_CLASS (parent_class)->set_image (view, image); - if (view->gimage) - g_signal_connect (view->gimage, + if (view->image) + g_signal_connect (view->image, "floating-selection-changed", G_CALLBACK (gimp_layer_tree_view_floating_selection_changed), view); @@ -850,7 +850,7 @@ gimp_layer_tree_view_item_new (GimpImage *image) /* callbacks */ static void -gimp_layer_tree_view_floating_selection_changed (GimpImage *gimage, +gimp_layer_tree_view_floating_selection_changed (GimpImage *image, GimpLayerTreeView *layer_view) { GimpContainerTreeView *tree_view = GIMP_CONTAINER_TREE_VIEW (layer_view); @@ -858,7 +858,7 @@ gimp_layer_tree_view_floating_selection_changed (GimpImage *gimage, GimpLayer *floating_sel; GtkTreeIter *iter; - floating_sel = gimp_image_floating_sel (gimage); + floating_sel = gimp_image_floating_sel (image); if (floating_sel) { @@ -874,7 +874,7 @@ gimp_layer_tree_view_floating_selection_changed (GimpImage *gimage, { GList *list; - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -908,14 +908,14 @@ static void gimp_layer_tree_view_paint_mode_menu_callback (GtkWidget *widget, GimpLayerTreeView *view) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer = NULL; - gimage = GIMP_ITEM_TREE_VIEW (view)->gimage; + image = GIMP_ITEM_TREE_VIEW (view)->image; - if (gimage) + if (image) layer = (GimpLayer *) - GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (gimage); + GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image); if (layer) { @@ -929,7 +929,7 @@ gimp_layer_tree_view_paint_mode_menu_callback (GtkWidget *widget, gboolean push_undo = TRUE; /* compress layer mode undos */ - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_LAYER_MODE); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer)) @@ -939,7 +939,7 @@ gimp_layer_tree_view_paint_mode_menu_callback (GtkWidget *widget, gimp_layer_set_mode (layer, (GimpLayerModeEffects) mode, push_undo); UNBLOCK(); - gimp_image_flush (gimage); + gimp_image_flush (image); if (! push_undo) gimp_undo_refresh_preview (undo); @@ -951,13 +951,13 @@ static void gimp_layer_tree_view_lock_alpha_button_toggled (GtkWidget *widget, GimpLayerTreeView *view) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - gimage = GIMP_ITEM_TREE_VIEW (view)->gimage; + image = GIMP_ITEM_TREE_VIEW (view)->image; layer = (GimpLayer *) - GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (gimage); + GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image); if (layer) { @@ -971,7 +971,7 @@ gimp_layer_tree_view_lock_alpha_button_toggled (GtkWidget *widget, gboolean push_undo = TRUE; /* compress opacity undos */ - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_LAYER_LOCK_ALPHA); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer)) @@ -981,7 +981,7 @@ gimp_layer_tree_view_lock_alpha_button_toggled (GtkWidget *widget, gimp_layer_set_lock_alpha (layer, lock_alpha, push_undo); UNBLOCK(); - gimp_image_flush (gimage); + gimp_image_flush (image); } } } @@ -990,13 +990,13 @@ static void gimp_layer_tree_view_opacity_scale_changed (GtkAdjustment *adjustment, GimpLayerTreeView *view) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; - gimage = GIMP_ITEM_TREE_VIEW (view)->gimage; + image = GIMP_ITEM_TREE_VIEW (view)->image; layer = (GimpLayer *) - GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (gimage); + GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image); if (layer) { @@ -1008,7 +1008,7 @@ gimp_layer_tree_view_opacity_scale_changed (GtkAdjustment *adjustment, gboolean push_undo = TRUE; /* compress opacity undos */ - undo = gimp_image_undo_can_compress (gimage, GIMP_TYPE_ITEM_UNDO, + undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO, GIMP_UNDO_LAYER_OPACITY); if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (layer)) @@ -1018,7 +1018,7 @@ gimp_layer_tree_view_opacity_scale_changed (GtkAdjustment *adjustment, gimp_layer_set_opacity (layer, opacity, push_undo); UNBLOCK(); - gimp_image_flush (gimage); + gimp_image_flush (image); if (! push_undo) gimp_undo_refresh_preview (undo); @@ -1038,7 +1038,7 @@ gimp_layer_tree_view_layer_signal_handler (GimpLayer *layer, GimpLayer *active_layer; active_layer = (GimpLayer *) - GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (item_view->gimage); + GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (item_view->image); if (active_layer == layer) gimp_layer_tree_view_update_options (view, layer); @@ -1393,7 +1393,7 @@ gimp_layer_tree_view_alpha_changed (GimpLayer *layer, gimp_layer_tree_view_alpha_update (layer_view, iter, layer); /* update button states */ - if (gimp_image_get_active_layer (item_view->gimage) == layer) + if (gimp_image_get_active_layer (item_view->image) == layer) gimp_container_view_select_item (GIMP_CONTAINER_VIEW (view), GIMP_VIEWABLE (layer)); } diff --git a/app/widgets/gimpmenudock.c b/app/widgets/gimpmenudock.c index d30dfe08d7..2ac22d9f9e 100644 --- a/app/widgets/gimpmenudock.c +++ b/app/widgets/gimpmenudock.c @@ -79,10 +79,10 @@ static void gimp_menu_dock_factory_display_changed (GimpContext *context, GimpObject *display, GimpDock *dock); static void gimp_menu_dock_factory_image_changed (GimpContext *context, - GimpImage *gimage, + GimpImage *image, GimpDock *dock); static void gimp_menu_dock_image_changed (GimpContext *context, - GimpImage *gimage, + GimpImage *image, GimpDock *dock); static void gimp_menu_dock_auto_clicked (GtkWidget *widget, GimpDock *dock); @@ -540,36 +540,36 @@ gimp_menu_dock_factory_display_changed (GimpContext *context, static void gimp_menu_dock_factory_image_changed (GimpContext *context, - GimpImage *gimage, + GimpImage *image, GimpDock *dock) { GimpMenuDock *menu_dock = GIMP_MENU_DOCK (dock); /* won't do anything if we already set the display above */ - if (gimage && menu_dock->auto_follow_active) - gimp_context_set_image (dock->context, gimage); + if (image && menu_dock->auto_follow_active) + gimp_context_set_image (dock->context, image); } static void gimp_menu_dock_image_changed (GimpContext *context, - GimpImage *gimage, + GimpImage *image, GimpDock *dock) { GimpMenuDock *menu_dock = GIMP_MENU_DOCK (dock); GimpContainer *image_container = menu_dock->image_container; GimpContainer *display_container = menu_dock->display_container; - if (gimage == NULL && ! gimp_container_is_empty (image_container)) + if (image == NULL && ! gimp_container_is_empty (image_container)) { - gimage = GIMP_IMAGE (gimp_container_get_child_by_index (image_container, + image = GIMP_IMAGE (gimp_container_get_child_by_index (image_container, 0)); - if (gimage) + if (image) { /* this invokes this function recursively but we don't enter * the if() branch the second time */ - gimp_context_set_image (context, gimage); + gimp_context_set_image (context, image); /* stop the emission of the original signal (the emission of * the recursive signal is finished) @@ -577,23 +577,23 @@ gimp_menu_dock_image_changed (GimpContext *context, g_signal_stop_emission_by_name (context, "image-changed"); } } - else if (gimage != NULL && ! gimp_container_is_empty (display_container)) + else if (image != NULL && ! gimp_container_is_empty (display_container)) { GimpObject *gdisp; - GimpImage *gdisp_gimage; + GimpImage *gdisp_image; gboolean find_display = TRUE; gdisp = gimp_context_get_display (context); if (gdisp) { - g_object_get (gdisp, "image", &gdisp_gimage, NULL); + g_object_get (gdisp, "image", &gdisp_image, NULL); - if (gdisp_gimage) + if (gdisp_image) { - g_object_unref (gdisp_gimage); + g_object_unref (gdisp_image); - if (gdisp_gimage == gimage) + if (gdisp_image == image) find_display = FALSE; } } @@ -608,13 +608,13 @@ gimp_menu_dock_image_changed (GimpContext *context, { gdisp = GIMP_OBJECT (list->data); - g_object_get (gdisp, "image", &gdisp_gimage, NULL); + g_object_get (gdisp, "image", &gdisp_image, NULL); - if (gdisp_gimage) + if (gdisp_image) { - g_object_unref (gdisp_gimage); + g_object_unref (gdisp_image); - if (gdisp_gimage == gimage) + if (gdisp_image == image) { /* this invokes this function recursively but we * don't enter the if(find_display) branch the diff --git a/app/widgets/gimpsamplepointeditor.c b/app/widgets/gimpsamplepointeditor.c index fbb15047a1..df58b628c0 100644 --- a/app/widgets/gimpsamplepointeditor.c +++ b/app/widgets/gimpsamplepointeditor.c @@ -63,18 +63,18 @@ static void gimp_sample_point_editor_dispose (GObject *ob static void gimp_sample_point_editor_style_set (GtkWidget *widget, GtkStyle *prev_style); static void gimp_sample_point_editor_set_image (GimpImageEditor *editor, - GimpImage *gimage); + GimpImage *image); -static void gimp_sample_point_editor_point_added (GimpImage *gimage, +static void gimp_sample_point_editor_point_added (GimpImage *image, GimpSamplePoint *sample_point, GimpSamplePointEditor *editor); -static void gimp_sample_point_editor_point_removed (GimpImage *gimage, +static void gimp_sample_point_editor_point_removed (GimpImage *image, GimpSamplePoint *sample_point, GimpSamplePointEditor *editor); -static void gimp_sample_point_editor_point_update (GimpImage *gimage, +static void gimp_sample_point_editor_point_update (GimpImage *image, GimpSamplePoint *sample_point, GimpSamplePointEditor *editor); -static void gimp_sample_point_editor_proj_update (GimpImage *gimage, +static void gimp_sample_point_editor_proj_update (GimpImage *image, gboolean now, gint x, gint y, @@ -254,40 +254,40 @@ gimp_sample_point_editor_style_set (GtkWidget *widget, static void gimp_sample_point_editor_set_image (GimpImageEditor *image_editor, - GimpImage *gimage) + GimpImage *image) { GimpSamplePointEditor *editor = GIMP_SAMPLE_POINT_EDITOR (image_editor); - if (image_editor->gimage) + if (image_editor->image) { - g_signal_handlers_disconnect_by_func (image_editor->gimage, + g_signal_handlers_disconnect_by_func (image_editor->image, gimp_sample_point_editor_point_added, editor); - g_signal_handlers_disconnect_by_func (image_editor->gimage, + g_signal_handlers_disconnect_by_func (image_editor->image, gimp_sample_point_editor_point_removed, editor); - g_signal_handlers_disconnect_by_func (image_editor->gimage, + g_signal_handlers_disconnect_by_func (image_editor->image, gimp_sample_point_editor_point_update, editor); - g_signal_handlers_disconnect_by_func (image_editor->gimage->projection, + g_signal_handlers_disconnect_by_func (image_editor->image->projection, gimp_sample_point_editor_proj_update, editor); } - GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, gimage); + GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, image); - if (gimage) + if (image) { - g_signal_connect (gimage, "sample-point-added", + g_signal_connect (image, "sample-point-added", G_CALLBACK (gimp_sample_point_editor_point_added), editor); - g_signal_connect (gimage, "sample-point-removed", + g_signal_connect (image, "sample-point-removed", G_CALLBACK (gimp_sample_point_editor_point_removed), editor); - g_signal_connect (gimage, "update-sample-point", + g_signal_connect (image, "update-sample-point", G_CALLBACK (gimp_sample_point_editor_point_update), editor); - g_signal_connect (gimage->projection, "update", + g_signal_connect (image->projection, "update", G_CALLBACK (gimp_sample_point_editor_proj_update), editor); } @@ -344,7 +344,7 @@ gimp_sample_point_editor_get_sample_merged (GimpSamplePointEditor *editor) /* private functions */ static void -gimp_sample_point_editor_point_added (GimpImage *gimage, +gimp_sample_point_editor_point_added (GimpImage *image, GimpSamplePoint *sample_point, GimpSamplePointEditor *editor) { @@ -352,7 +352,7 @@ gimp_sample_point_editor_point_added (GimpImage *gimage, } static void -gimp_sample_point_editor_point_removed (GimpImage *gimage, +gimp_sample_point_editor_point_removed (GimpImage *image, GimpSamplePoint *sample_point, GimpSamplePointEditor *editor) { @@ -360,18 +360,18 @@ gimp_sample_point_editor_point_removed (GimpImage *gimage, } static void -gimp_sample_point_editor_point_update (GimpImage *gimage, +gimp_sample_point_editor_point_update (GimpImage *image, GimpSamplePoint *sample_point, GimpSamplePointEditor *editor) { - gint i = g_list_index (gimage->sample_points, sample_point); + gint i = g_list_index (image->sample_points, sample_point); if (i < 4) gimp_sample_point_editor_dirty (editor, i); } static void -gimp_sample_point_editor_proj_update (GimpImage *gimage, +gimp_sample_point_editor_proj_update (GimpImage *image, gboolean now, gint x, gint y, @@ -384,9 +384,9 @@ gimp_sample_point_editor_proj_update (GimpImage *gimage, GList *list; gint i; - n_points = MIN (4, g_list_length (image_editor->gimage->sample_points)); + n_points = MIN (4, g_list_length (image_editor->image->sample_points)); - for (i = 0, list = image_editor->gimage->sample_points; + for (i = 0, list = image_editor->image->sample_points; i < n_points; i++, list = g_list_next (list)) { @@ -407,8 +407,8 @@ gimp_sample_point_editor_points_changed (GimpSamplePointEditor *editor) gint n_points = 0; gint i; - if (image_editor->gimage) - n_points = MIN (4, g_list_length (image_editor->gimage->sample_points)); + if (image_editor->image) + n_points = MIN (4, g_list_length (image_editor->image->sample_points)); for (i = 0; i < n_points; i++) { @@ -452,12 +452,12 @@ gimp_sample_point_editor_update (GimpSamplePointEditor *editor) editor->dirty_idle_id = 0; - if (! image_editor->gimage) + if (! image_editor->image) return FALSE; - n_points = MIN (4, g_list_length (image_editor->gimage->sample_points)); + n_points = MIN (4, g_list_length (image_editor->image->sample_points)); - for (i = 0, list = image_editor->gimage->sample_points; + for (i = 0, list = image_editor->image->sample_points; i < n_points; i++, list = g_list_next (list)) { @@ -473,7 +473,7 @@ gimp_sample_point_editor_update (GimpSamplePointEditor *editor) color_frame = GIMP_COLOR_FRAME (editor->color_frames[i]); - if (gimp_image_pick_color (image_editor->gimage, NULL, + if (gimp_image_pick_color (image_editor->image, NULL, sample_point->x, sample_point->y, editor->sample_merged, diff --git a/app/widgets/gimpselectiondata.c b/app/widgets/gimpselectiondata.c index 6e313af828..39369a3467 100644 --- a/app/widgets/gimpselectiondata.c +++ b/app/widgets/gimpselectiondata.c @@ -371,14 +371,14 @@ gimp_selection_data_get_stream (GtkSelectionData *selection, void gimp_selection_data_set_image (GtkSelectionData *selection, - GimpImage *gimage) + GimpImage *image) { gchar *str; g_return_if_fail (selection != NULL); - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - str = g_strdup_printf ("%d:%d", getpid (), gimp_image_get_ID (gimage)); + str = g_strdup_printf ("%d:%d", getpid (), gimp_image_get_ID (image)); gtk_selection_data_set (selection, selection->target, 8, (guchar *) str, strlen (str) + 1); @@ -415,15 +415,15 @@ gimp_selection_data_get_image (GtkSelectionData *selection, void gimp_selection_data_set_component (GtkSelectionData *selection, - GimpImage *gimage, + GimpImage *image, GimpChannelType channel) { gchar *str; g_return_if_fail (selection != NULL); - g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (GIMP_IS_IMAGE (image)); - str = g_strdup_printf ("%d:%d:%d", getpid (), gimp_image_get_ID (gimage), + str = g_strdup_printf ("%d:%d:%d", getpid (), gimp_image_get_ID (image), (gint) channel); gtk_selection_data_set (selection, selection->target, diff --git a/app/widgets/gimpselectiondata.h b/app/widgets/gimpselectiondata.h index df8c81b327..8e52d44f30 100644 --- a/app/widgets/gimpselectiondata.h +++ b/app/widgets/gimpselectiondata.h @@ -47,7 +47,7 @@ const guchar * gimp_selection_data_get_stream (GtkSelectionData *selection, /* image */ void gimp_selection_data_set_image (GtkSelectionData *selection, - GimpImage *gimage); + GimpImage *image); GimpImage * gimp_selection_data_get_image (GtkSelectionData *selection, Gimp *gimp); @@ -55,7 +55,7 @@ GimpImage * gimp_selection_data_get_image (GtkSelectionData *selection, /* component */ void gimp_selection_data_set_component (GtkSelectionData *selection, - GimpImage *gimage, + GimpImage *image, GimpChannelType channel); GimpImage * gimp_selection_data_get_component (GtkSelectionData *selection, Gimp *gimp, diff --git a/app/widgets/gimpselectioneditor.c b/app/widgets/gimpselectioneditor.c index 1b915d9804..c5be255fe9 100644 --- a/app/widgets/gimpselectioneditor.c +++ b/app/widgets/gimpselectioneditor.c @@ -57,7 +57,7 @@ static GObject * gimp_selection_editor_constructor (GType type, GObjectConstructParam *params); static void gimp_selection_editor_set_image (GimpImageEditor *editor, - GimpImage *gimage); + GimpImage *image); static gboolean gimp_selection_view_button_press (GtkWidget *widget, GdkEventButton *bevent, @@ -68,7 +68,7 @@ static void gimp_selection_editor_drop_color (GtkWidget *widget, const GimpRGB *color, gpointer data); -static void gimp_selection_editor_mask_changed (GimpImage *gimage, +static void gimp_selection_editor_mask_changed (GimpImage *image, GimpSelectionEditor *editor); @@ -169,27 +169,27 @@ gimp_selection_editor_constructor (GType type, static void gimp_selection_editor_set_image (GimpImageEditor *image_editor, - GimpImage *gimage) + GimpImage *image) { GimpSelectionEditor *editor = GIMP_SELECTION_EDITOR (image_editor); - if (image_editor->gimage) + if (image_editor->image) { - g_signal_handlers_disconnect_by_func (image_editor->gimage, + g_signal_handlers_disconnect_by_func (image_editor->image, gimp_selection_editor_mask_changed, editor); } - GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, gimage); + GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, image); - if (gimage) + if (image) { - g_signal_connect (gimage, "mask-changed", + g_signal_connect (image, "mask-changed", G_CALLBACK (gimp_selection_editor_mask_changed), editor); gimp_view_set_viewable (GIMP_VIEW (editor->view), - GIMP_VIEWABLE (gimp_image_get_mask (gimage))); + GIMP_VIEWABLE (gimp_image_get_mask (image))); } else { @@ -226,13 +226,13 @@ gimp_selection_view_button_press (GtkWidget *widget, gint x, y; GimpRGB color; - if (! image_editor->gimage) + if (! image_editor->image) return TRUE; renderer = GIMP_VIEW (editor->view)->renderer; tool_info = (GimpToolInfo *) - gimp_container_get_child_by_name (image_editor->gimage->gimp->tool_info_list, + gimp_container_get_child_by_name (image_editor->image->gimp->tool_info_list, "gimp-by-color-select-tool"); if (! tool_info) @@ -240,7 +240,7 @@ gimp_selection_view_button_press (GtkWidget *widget, options = GIMP_SELECTION_OPTIONS (tool_info->tool_options); - drawable = gimp_image_active_drawable (image_editor->gimage); + drawable = gimp_image_active_drawable (image_editor->image); if (! drawable) return TRUE; @@ -261,16 +261,16 @@ gimp_selection_view_button_press (GtkWidget *widget, operation = SELECTION_SUBTRACT; } - x = image_editor->gimage->width * bevent->x / renderer->width; - y = image_editor->gimage->height * bevent->y / renderer->height; + x = image_editor->image->width * bevent->x / renderer->width; + y = image_editor->image->height * bevent->y / renderer->height; - if (gimp_image_pick_color (image_editor->gimage, drawable, x, y, + if (gimp_image_pick_color (image_editor->image, drawable, x, y, options->sample_merged, FALSE, 0.0, NULL, &color, NULL)) { - gimp_channel_select_by_color (gimp_image_get_mask (image_editor->gimage), + gimp_channel_select_by_color (gimp_image_get_mask (image_editor->image), drawable, options->sample_merged, &color, @@ -281,7 +281,7 @@ gimp_selection_view_button_press (GtkWidget *widget, options->feather, options->feather_radius, options->feather_radius); - gimp_image_flush (image_editor->gimage); + gimp_image_flush (image_editor->image); } return TRUE; @@ -299,11 +299,11 @@ gimp_selection_editor_drop_color (GtkWidget *widget, GimpSelectionOptions *options; GimpDrawable *drawable; - if (! editor->gimage) + if (! editor->image) return; tool_info = (GimpToolInfo *) - gimp_container_get_child_by_name (editor->gimage->gimp->tool_info_list, + gimp_container_get_child_by_name (editor->image->gimp->tool_info_list, "gimp-by-color-select-tool"); if (! tool_info) @@ -311,12 +311,12 @@ gimp_selection_editor_drop_color (GtkWidget *widget, options = GIMP_SELECTION_OPTIONS (tool_info->tool_options); - drawable = gimp_image_active_drawable (editor->gimage); + drawable = gimp_image_active_drawable (editor->image); if (! drawable) return; - gimp_channel_select_by_color (gimp_image_get_mask (editor->gimage), + gimp_channel_select_by_color (gimp_image_get_mask (editor->image), drawable, options->sample_merged, color, @@ -327,11 +327,11 @@ gimp_selection_editor_drop_color (GtkWidget *widget, options->feather, options->feather_radius, options->feather_radius); - gimp_image_flush (editor->gimage); + gimp_image_flush (editor->image); } static void -gimp_selection_editor_mask_changed (GimpImage *gimage, +gimp_selection_editor_mask_changed (GimpImage *image, GimpSelectionEditor *editor) { gimp_view_renderer_invalidate (GIMP_VIEW (editor->view)->renderer); diff --git a/app/widgets/gimptoolbox-dnd.c b/app/widgets/gimptoolbox-dnd.c index da84324279..5f4cf474e3 100644 --- a/app/widgets/gimptoolbox-dnd.c +++ b/app/widgets/gimptoolbox-dnd.c @@ -143,14 +143,14 @@ gimp_toolbox_drop_uri_list (GtkWidget *widget, for (list = uri_list; list; list = g_list_next (list)) { const gchar *uri = list->data; - GimpImage *gimage; + GimpImage *image; GimpPDBStatusType status; GError *error = NULL; - gimage = file_open_with_display (context->gimp, context, NULL, + image = file_open_with_display (context->gimp, context, NULL, uri, &status, &error); - if (! gimage && status != GIMP_PDB_CANCEL) + if (! image && status != GIMP_PDB_CANCEL) { gchar *filename = file_utils_uri_display_name (uri); @@ -173,7 +173,7 @@ gimp_toolbox_drop_drawable (GtkWidget *widget, GimpContext *context = GIMP_CONTEXT (data); GimpDrawable *drawable; GimpItem *item; - GimpImage *gimage; + GimpImage *image; GimpImage *new_image; GimpLayer *new_layer; GType new_type; @@ -187,7 +187,7 @@ gimp_toolbox_drop_drawable (GtkWidget *widget, drawable = GIMP_DRAWABLE (viewable); item = GIMP_ITEM (viewable); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); width = gimp_item_width (item); height = gimp_item_height (item); @@ -195,19 +195,19 @@ gimp_toolbox_drop_drawable (GtkWidget *widget, type = GIMP_IMAGE_TYPE_BASE_TYPE (gimp_drawable_type (drawable)); - new_image = gimp_create_image (gimage->gimp, width, height, type, FALSE); + new_image = gimp_create_image (image->gimp, width, height, type, FALSE); gimp_image_undo_disable (new_image); if (type == GIMP_INDEXED) gimp_image_set_colormap (new_image, - gimp_image_get_colormap (gimage), - gimp_image_get_colormap_size (gimage), + gimp_image_get_colormap (image), + gimp_image_get_colormap_size (image), FALSE); gimp_image_set_resolution (new_image, - gimage->xresolution, gimage->yresolution); + image->xresolution, image->yresolution); gimp_image_set_unit (new_image, - gimp_image_get_unit (gimage)); + gimp_image_get_unit (image)); if (GIMP_IS_LAYER (drawable)) new_type = G_TYPE_FROM_INSTANCE (drawable); @@ -227,7 +227,7 @@ gimp_toolbox_drop_drawable (GtkWidget *widget, gimp_image_undo_enable (new_image); - gimp_create_display (gimage->gimp, new_image, GIMP_UNIT_PIXEL, 1.0); + gimp_create_display (image->gimp, new_image, GIMP_UNIT_PIXEL, 1.0); g_object_unref (new_image); } diff --git a/app/widgets/gimpundoeditor.c b/app/widgets/gimpundoeditor.c index 225fb40c41..899574a561 100644 --- a/app/widgets/gimpundoeditor.c +++ b/app/widgets/gimpundoeditor.c @@ -57,12 +57,12 @@ static void gimp_undo_editor_set_property (GObject *object, GParamSpec *pspec); static void gimp_undo_editor_set_image (GimpImageEditor *editor, - GimpImage *gimage); + GimpImage *image); static void gimp_undo_editor_fill (GimpUndoEditor *editor); static void gimp_undo_editor_clear (GimpUndoEditor *editor); -static void gimp_undo_editor_undo_event (GimpImage *gimage, +static void gimp_undo_editor_undo_event (GimpImage *image, GimpUndoEvent event, GimpUndo *undo, GimpUndoEditor *editor); @@ -162,27 +162,27 @@ gimp_undo_editor_set_property (GObject *object, static void gimp_undo_editor_set_image (GimpImageEditor *image_editor, - GimpImage *gimage) + GimpImage *image) { GimpUndoEditor *editor = GIMP_UNDO_EDITOR (image_editor); - if (image_editor->gimage) + if (image_editor->image) { gimp_undo_editor_clear (editor); - g_signal_handlers_disconnect_by_func (image_editor->gimage, + g_signal_handlers_disconnect_by_func (image_editor->image, gimp_undo_editor_undo_event, editor); } - GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, gimage); + GIMP_IMAGE_EDITOR_CLASS (parent_class)->set_image (image_editor, image); - if (image_editor->gimage) + if (image_editor->image) { - if (gimp_image_undo_is_enabled (image_editor->gimage)) + if (gimp_image_undo_is_enabled (image_editor->image)) gimp_undo_editor_fill (editor); - g_signal_connect (image_editor->gimage, "undo-event", + g_signal_connect (image_editor->image, "undo-event", G_CALLBACK (gimp_undo_editor_undo_event), editor); } @@ -212,21 +212,21 @@ gimp_undo_editor_new (GimpCoreConfig *config, static void gimp_undo_editor_fill (GimpUndoEditor *editor) { - GimpImage *gimage; + GimpImage *image; GimpUndo *top_undo_item; GList *list; - gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + image = GIMP_IMAGE_EDITOR (editor)->image; /* create a container as model for the undo history list */ editor->container = gimp_list_new (GIMP_TYPE_UNDO, FALSE); editor->base_item = g_object_new (GIMP_TYPE_UNDO, - "image", gimage, + "image", image, "name", _("[ Base Image ]"), NULL); /* the list prepends its items, so first add the redo items... */ - for (list = GIMP_LIST (gimage->redo_stack->undos)->list; + for (list = GIMP_LIST (image->redo_stack->undos)->list; list; list = g_list_next (list)) { @@ -237,7 +237,7 @@ gimp_undo_editor_fill (GimpUndoEditor *editor) gimp_list_reverse (GIMP_LIST (editor->container)); /* ...then add the undo items in descending order... */ - for (list = GIMP_LIST (gimage->undo_stack->undos)->list; + for (list = GIMP_LIST (image->undo_stack->undos)->list; list; list = g_list_next (list)) { @@ -245,7 +245,7 @@ gimp_undo_editor_fill (GimpUndoEditor *editor) * it will be added upon closing of the group. */ if (list->prev || ! GIMP_IS_UNDO_STACK (list->data) || - gimage->pushing_undo_group == GIMP_UNDO_GROUP_NONE) + image->pushing_undo_group == GIMP_UNDO_GROUP_NONE) { gimp_container_add (editor->container, GIMP_OBJECT (list->data)); } @@ -260,7 +260,7 @@ gimp_undo_editor_fill (GimpUndoEditor *editor) gimp_container_view_set_container (GIMP_CONTAINER_VIEW (editor->view), editor->container); - top_undo_item = gimp_undo_stack_peek (gimage->undo_stack); + top_undo_item = gimp_undo_stack_peek (image->undo_stack); g_signal_handlers_block_by_func (editor->view, gimp_undo_editor_select_item, @@ -304,14 +304,14 @@ gimp_undo_editor_clear (GimpUndoEditor *editor) } static void -gimp_undo_editor_undo_event (GimpImage *gimage, +gimp_undo_editor_undo_event (GimpImage *image, GimpUndoEvent event, GimpUndo *undo, GimpUndoEditor *editor) { GimpUndo *top_undo_item; - top_undo_item = gimp_undo_stack_peek (gimage->undo_stack); + top_undo_item = gimp_undo_stack_peek (image->undo_stack); switch (event) { @@ -360,7 +360,7 @@ gimp_undo_editor_undo_event (GimpImage *gimage, break; case GIMP_UNDO_EVENT_UNDO_FREE: - if (gimp_image_undo_is_enabled (gimage)) + if (gimp_image_undo_is_enabled (image)) gimp_undo_editor_clear (editor); break; @@ -380,15 +380,15 @@ gimp_undo_editor_select_item (GimpContainerView *view, gpointer insert_data, GimpUndoEditor *editor) { - GimpImage *gimage; + GimpImage *image; GimpUndo *top_undo_item; if (! undo) return; - gimage = GIMP_IMAGE_EDITOR (editor)->gimage; + image = GIMP_IMAGE_EDITOR (editor)->image; - top_undo_item = gimp_undo_stack_peek (gimage->undo_stack); + top_undo_item = gimp_undo_stack_peek (image->undo_stack); if (undo == editor->base_item) { @@ -396,35 +396,35 @@ gimp_undo_editor_select_item (GimpContainerView *view, */ while (top_undo_item != NULL) { - gimp_image_undo (gimage); + gimp_image_undo (image); - top_undo_item = gimp_undo_stack_peek (gimage->undo_stack); + top_undo_item = gimp_undo_stack_peek (image->undo_stack); } } - else if (gimp_container_have (gimage->undo_stack->undos, GIMP_OBJECT (undo))) + else if (gimp_container_have (image->undo_stack->undos, GIMP_OBJECT (undo))) { /* the selected item is on the undo stack, pop undos until it * is on top of the undo stack */ while (top_undo_item != undo) { - gimp_image_undo (gimage); + gimp_image_undo (image); - top_undo_item = gimp_undo_stack_peek (gimage->undo_stack); + top_undo_item = gimp_undo_stack_peek (image->undo_stack); } } - else if (gimp_container_have (gimage->redo_stack->undos, GIMP_OBJECT (undo))) + else if (gimp_container_have (image->redo_stack->undos, GIMP_OBJECT (undo))) { /* the selected item is on the redo stack, pop redos until it * is on top of the undo stack */ while (top_undo_item != undo) { - gimp_image_redo (gimage); + gimp_image_redo (image); - top_undo_item = gimp_undo_stack_peek (gimage->undo_stack); + top_undo_item = gimp_undo_stack_peek (image->undo_stack); } } - gimp_image_flush (gimage); + gimp_image_flush (image); } diff --git a/app/widgets/gimpvectorstreeview.c b/app/widgets/gimpvectorstreeview.c index 5692950f21..aa7f2872ab 100644 --- a/app/widgets/gimpvectorstreeview.c +++ b/app/widgets/gimpvectorstreeview.c @@ -216,7 +216,7 @@ gimp_vectors_tree_view_drop_svg (GimpContainerTreeView *tree_view, GtkTreeViewDropPosition drop_pos) { GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (tree_view); - GimpImage *image = view->gimage; + GimpImage *image = view->image; gint index = -1; GError *error = NULL; @@ -261,18 +261,18 @@ gimp_vectors_tree_view_drag_svg (GtkWidget *widget, gsize *svg_data_len, gpointer data) { - GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (data); - GimpImage *gimage = view->gimage; + GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (data); + GimpImage *image = view->image; GimpItem *item; gchar *svg_data = NULL; - item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (gimage); + item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image); *svg_data_len = 0; if (item) { - svg_data = gimp_vectors_export_string (gimage, GIMP_VECTORS (item)); + svg_data = gimp_vectors_export_string (image, GIMP_VECTORS (item)); if (svg_data) *svg_data_len = strlen (svg_data); diff --git a/app/widgets/gimpviewrendererdrawable.c b/app/widgets/gimpviewrendererdrawable.c index d6f0fd9858..6b9519c23c 100644 --- a/app/widgets/gimpviewrendererdrawable.c +++ b/app/widgets/gimpviewrendererdrawable.c @@ -66,7 +66,7 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer, { GimpDrawable *drawable; GimpItem *item; - GimpImage *gimage; + GimpImage *image; gint width; gint height; gint view_width; @@ -76,16 +76,16 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer, drawable = GIMP_DRAWABLE (renderer->viewable); item = GIMP_ITEM (drawable); - gimage = gimp_item_get_image (item); + image = gimp_item_get_image (item); width = renderer->width; height = renderer->height; - if (gimage && ! renderer->is_popup) + if (image && ! renderer->is_popup) { - width = MAX (1, ROUND ((((gdouble) width / (gdouble) gimage->width) * + width = MAX (1, ROUND ((((gdouble) width / (gdouble) image->width) * (gdouble) item->width))); - height = MAX (1, ROUND ((((gdouble) height / (gdouble) gimage->height) * + height = MAX (1, ROUND ((((gdouble) height / (gdouble) image->height) * (gdouble) item->height))); gimp_viewable_calc_preview_size (item->width, @@ -93,8 +93,8 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer, width, height, renderer->dot_for_dot, - gimage->xresolution, - gimage->yresolution, + image->xresolution, + image->yresolution, &view_width, &view_height, &scaling_up); @@ -106,8 +106,8 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer, width, height, renderer->dot_for_dot, - gimage ? gimage->xresolution : 1.0, - gimage ? gimage->yresolution : 1.0, + image ? image->xresolution : 1.0, + image ? image->yresolution : 1.0, &view_width, &view_height, &scaling_up); @@ -118,7 +118,7 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer, if (scaling_up) { - if (gimage && ! renderer->is_popup) + if (image && ! renderer->is_popup) { gint src_x, src_y; gint src_width, src_height; @@ -126,7 +126,7 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer, if (gimp_rectangle_intersect (0, 0, item->width, item->height, -item->offset_x, -item->offset_y, - gimage->width, gimage->height, + image->width, image->height, &src_x, &src_y, &src_width, &src_height)) { @@ -134,10 +134,10 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer, gint dest_height; dest_width = ROUND (((gdouble) renderer->width / - (gdouble) gimage->width) * + (gdouble) image->width) * (gdouble) src_width); dest_height = ROUND (((gdouble) renderer->height / - (gdouble) gimage->height) * + (gdouble) image->height) * (gdouble) src_height); if (dest_width < 1) dest_width = 1; @@ -181,16 +181,16 @@ gimp_view_renderer_drawable_render (GimpViewRenderer *renderer, if (render_buf) { - if (gimage && ! renderer->is_popup) + if (image && ! renderer->is_popup) { if (item->offset_x != 0) render_buf->x = - ROUND ((((gdouble) renderer->width / (gdouble) gimage->width) * + ROUND ((((gdouble) renderer->width / (gdouble) image->width) * (gdouble) item->offset_x)); if (item->offset_y != 0) render_buf->y = - ROUND ((((gdouble) renderer->height / (gdouble) gimage->height) * + ROUND ((((gdouble) renderer->height / (gdouble) image->height) * (gdouble) item->offset_y)); if (scaling_up) diff --git a/app/widgets/gimpviewrendererimage.c b/app/widgets/gimpviewrendererimage.c index beccd83b4f..ed45f2c075 100644 --- a/app/widgets/gimpviewrendererimage.c +++ b/app/widgets/gimpviewrendererimage.c @@ -63,21 +63,21 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer, GtkWidget *widget) { GimpViewRendererImage *rendererimage = GIMP_VIEW_RENDERER_IMAGE (renderer); - GimpImage *gimage; + GimpImage *image; gint view_width; gint view_height; gboolean scaling_up; TempBuf *render_buf = NULL; - gimage = GIMP_IMAGE (renderer->viewable); + image = GIMP_IMAGE (renderer->viewable); - gimp_viewable_calc_preview_size (gimage->width, - gimage->height, + gimp_viewable_calc_preview_size (image->width, + image->height, renderer->width, renderer->height, renderer->dot_for_dot, - gimage->xresolution, - gimage->yresolution, + image->xresolution, + image->yresolution, &view_width, &view_height, &scaling_up); @@ -87,7 +87,7 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer, TempBuf *temp_buf; temp_buf = gimp_viewable_get_new_preview (renderer->viewable, - gimage->width, gimage->height); + image->width, image->height); if (temp_buf) { @@ -127,7 +127,7 @@ gimp_view_renderer_image_render (GimpViewRenderer *renderer, if (rendererimage->channel != -1) component_index = - gimp_image_get_component_index (gimage, rendererimage->channel); + gimp_image_get_component_index (image, rendererimage->channel); gimp_view_renderer_render_buffer (renderer, render_buf, component_index, diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c index 1f6dd27d81..afe3a6ab3b 100644 --- a/app/xcf/xcf-load.c +++ b/app/xcf/xcf-load.c @@ -68,26 +68,26 @@ /* #define GIMP_XCF_PATH_DEBUG */ static gboolean xcf_load_image_props (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); static gboolean xcf_load_layer_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpLayer *layer, gboolean *apply_mask, gboolean *edit_mask, gboolean *show_mask, guint32 *text_layer_flags); static gboolean xcf_load_channel_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpChannel **channel); static gboolean xcf_load_prop (XcfInfo *info, PropType *prop_type, guint32 *prop_size); static GimpLayer * xcf_load_layer (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); static GimpChannel * xcf_load_channel (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); static GimpLayerMask * xcf_load_layer_mask (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); static gboolean xcf_load_hierarchy (XcfInfo *info, TileManager *tiles); static gboolean xcf_load_level (XcfInfo *info, @@ -99,13 +99,13 @@ static gboolean xcf_load_tile_rle (XcfInfo *info, gint data_length); static GimpParasite * xcf_load_parasite (XcfInfo *info); static gboolean xcf_load_old_paths (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); static gboolean xcf_load_old_path (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); static gboolean xcf_load_vectors (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); static gboolean xcf_load_vector (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); #ifdef SWAP_FROM_FILE static gboolean xcf_swap_func (gint fd, @@ -119,7 +119,7 @@ GimpImage * xcf_load_image (Gimp *gimp, XcfInfo *info) { - GimpImage *gimage; + GimpImage *image; GimpLayer *layer; GimpChannel *channel; GimpParasite *parasite; @@ -135,19 +135,19 @@ xcf_load_image (Gimp *gimp, info->cp += xcf_read_int32 (info->fp, (guint32 *) &height, 1); info->cp += xcf_read_int32 (info->fp, (guint32 *) &image_type, 1); - gimage = gimp_create_image (gimp, + image = gimp_create_image (gimp, width, height, image_type, FALSE); - gimp_image_undo_disable (gimage); + gimp_image_undo_disable (image); /* read the image properties */ - if (! xcf_load_image_props (info, gimage)) + if (! xcf_load_image_props (info, image)) goto hard_error; /* check for a GimpGrid parasite */ - parasite = gimp_image_parasite_find (GIMP_IMAGE (gimage), + parasite = gimp_image_parasite_find (GIMP_IMAGE (image), gimp_grid_parasite_name ()); if (parasite) { @@ -155,10 +155,10 @@ xcf_load_image (Gimp *gimp, if (grid) { - gimp_parasite_list_remove (GIMP_IMAGE (gimage)->parasites, + gimp_parasite_list_remove (GIMP_IMAGE (image)->parasites, gimp_parasite_name (parasite)); - gimp_image_set_grid (GIMP_IMAGE (gimage), grid, FALSE); + gimp_image_set_grid (GIMP_IMAGE (image), grid, FALSE); } } @@ -183,7 +183,7 @@ xcf_load_image (Gimp *gimp, goto error; /* read in the layer */ - layer = xcf_load_layer (info, gimage); + layer = xcf_load_layer (info, image); if (!layer) goto error; @@ -191,8 +191,8 @@ xcf_load_image (Gimp *gimp, /* add the layer to the image if its not the floating selection */ if (layer != info->floating_sel) - gimp_image_add_layer (gimage, layer, - gimp_container_num_children (gimage->layers)); + gimp_image_add_layer (image, layer, + gimp_container_num_children (image->layers)); /* restore the saved position so we'll be ready to * read the next offset. @@ -222,15 +222,15 @@ xcf_load_image (Gimp *gimp, goto error; /* read in the layer */ - channel = xcf_load_channel (info, gimage); + channel = xcf_load_channel (info, image); if (!channel) goto error; num_successful_elements++; /* add the channel to the image if its not the selection */ - if (channel != gimage->selection_mask) - gimp_image_add_channel (gimage, channel, -1); + if (channel != image->selection_mask) + gimp_image_add_channel (image, channel, -1); /* restore the saved position so we'll be ready to * read the next offset. @@ -243,19 +243,19 @@ xcf_load_image (Gimp *gimp, floating_sel_attach (info->floating_sel, info->floating_sel_drawable); if (info->active_layer) - gimp_image_set_active_layer (gimage, info->active_layer); + gimp_image_set_active_layer (image, info->active_layer); if (info->active_channel) - gimp_image_set_active_channel (gimage, info->active_channel); + gimp_image_set_active_channel (image, info->active_channel); - gimp_image_set_filename (gimage, info->filename); + gimp_image_set_filename (image, info->filename); if (info->tattoo_state > 0) - gimp_image_set_tattoo_state (gimage, info->tattoo_state); + gimp_image_set_tattoo_state (image, info->tattoo_state); - gimp_image_undo_enable (gimage); + gimp_image_undo_enable (image); - return gimage; + return image; error: if (num_successful_elements == 0) @@ -264,22 +264,22 @@ xcf_load_image (Gimp *gimp, g_message ("XCF: This file is corrupt! I have loaded as much\n" "of it as I can, but it is incomplete."); - gimp_image_undo_enable (gimage); + gimp_image_undo_enable (image); - return gimage; + return image; hard_error: g_message ("XCF: This file is corrupt! I could not even\n" "salvage any partial image data from it."); - g_object_unref (gimage); + g_object_unref (image); return NULL; } static gboolean xcf_load_image_props (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { PropType prop_type; guint32 prop_size; @@ -303,37 +303,37 @@ xcf_load_image_props (XcfInfo *info, "did not save indexed colormaps correctly.\n" "Substituting grayscale map.")); info->cp += - xcf_read_int32 (info->fp, (guint32 *) &gimage->num_cols, 1); - gimage->cmap = g_new (guchar, gimage->num_cols * 3); - if (!xcf_seek_pos (info, info->cp + gimage->num_cols, NULL)) + xcf_read_int32 (info->fp, (guint32 *) &image->num_cols, 1); + image->cmap = g_new (guchar, image->num_cols * 3); + if (!xcf_seek_pos (info, info->cp + image->num_cols, NULL)) return FALSE; - for (i = 0; inum_cols; i++) + for (i = 0; inum_cols; i++) { - gimage->cmap[i*3+0] = i; - gimage->cmap[i*3+1] = i; - gimage->cmap[i*3+2] = i; + image->cmap[i*3+0] = i; + image->cmap[i*3+1] = i; + image->cmap[i*3+2] = i; } } else { info->cp += - xcf_read_int32 (info->fp, (guint32 *) &gimage->num_cols, 1); - gimage->cmap = g_new (guchar, gimage->num_cols * 3); + xcf_read_int32 (info->fp, (guint32 *) &image->num_cols, 1); + image->cmap = g_new (guchar, image->num_cols * 3); info->cp += xcf_read_int8 (info->fp, - (guint8 *) gimage->cmap, gimage->num_cols * 3); + (guint8 *) image->cmap, image->num_cols * 3); } /* discard color map, if image is not indexed, this is just * sanity checking to make sure gimp doesn't end up with an * image state that is impossible. */ - if (gimp_image_base_type (gimage) != GIMP_INDEXED) + if (gimp_image_base_type (image) != GIMP_INDEXED) { - g_free (gimage->cmap); - gimage->cmap = NULL; - gimage->num_cols = 0; + g_free (image->cmap); + image->cmap = NULL; + image->num_cols = 0; } break; @@ -375,11 +375,11 @@ xcf_load_image_props (XcfInfo *info, switch (orientation) { case XCF_ORIENTATION_HORIZONTAL: - gimp_image_add_hguide (gimage, position, FALSE); + gimp_image_add_hguide (image, position, FALSE); break; case XCF_ORIENTATION_VERTICAL: - gimp_image_add_vguide (gimage, position, FALSE); + gimp_image_add_vguide (image, position, FALSE); break; default: @@ -392,7 +392,7 @@ xcf_load_image_props (XcfInfo *info, * but it restores the list to it's original order, which * cannot be wrong --Mitch */ - gimage->guides = g_list_reverse (gimage->guides); + image->guides = g_list_reverse (image->guides); } break; @@ -406,11 +406,11 @@ xcf_load_image_props (XcfInfo *info, yres < GIMP_MIN_RESOLUTION || yres > GIMP_MAX_RESOLUTION) { g_message ("Warning, resolution out of range in XCF file"); - xres = gimage->gimp->config->default_image->xresolution; - yres = gimage->gimp->config->default_image->yresolution; + xres = image->gimp->config->default_image->xresolution; + yres = image->gimp->config->default_image->yresolution; } - gimage->xresolution = xres; - gimage->yresolution = yres; + image->xresolution = xres; + image->yresolution = yres; } break; @@ -428,7 +428,7 @@ xcf_load_image_props (XcfInfo *info, while (info->cp - base < prop_size) { p = xcf_load_parasite (info); - gimp_image_parasite_attach (gimage, p); + gimp_image_parasite_attach (image, p); gimp_parasite_free (p); } if (info->cp - base != prop_size) @@ -443,19 +443,19 @@ xcf_load_image_props (XcfInfo *info, info->cp += xcf_read_int32 (info->fp, &unit, 1); if ((unit <= GIMP_UNIT_PIXEL) || - (unit >= _gimp_unit_get_number_of_built_in_units (gimage->gimp))) + (unit >= _gimp_unit_get_number_of_built_in_units (image->gimp))) { g_message ("Warning, unit out of range in XCF file, " "falling back to inches"); unit = GIMP_UNIT_INCH; } - gimage->resolution_unit = unit; + image->resolution_unit = unit; } break; case PROP_PATHS: - xcf_load_old_paths (info, gimage); + xcf_load_old_paths (info, image); break; case PROP_USER_UNIT: @@ -475,18 +475,18 @@ xcf_load_image_props (XcfInfo *info, if (unit_strings[i] == NULL) unit_strings[i] = g_strdup (""); - num_units = _gimp_unit_get_number_of_units (gimage->gimp); + num_units = _gimp_unit_get_number_of_units (image->gimp); - for (unit = _gimp_unit_get_number_of_built_in_units (gimage->gimp); + for (unit = _gimp_unit_get_number_of_built_in_units (image->gimp); unit < num_units; unit++) { /* if the factor and the identifier match some unit * in unitrc, use the unitrc unit */ - if ((ABS (_gimp_unit_get_factor (gimage->gimp, + if ((ABS (_gimp_unit_get_factor (image->gimp, unit) - factor) < 1e-5) && (strcmp (unit_strings[0], - _gimp_unit_get_identifier (gimage->gimp, + _gimp_unit_get_identifier (image->gimp, unit)) == 0)) { break; @@ -495,7 +495,7 @@ xcf_load_image_props (XcfInfo *info, /* no match */ if (unit == num_units) - unit = _gimp_unit_new (gimage->gimp, + unit = _gimp_unit_new (image->gimp, unit_strings[0], factor, digits, @@ -504,7 +504,7 @@ xcf_load_image_props (XcfInfo *info, unit_strings[3], unit_strings[4]); - gimage->resolution_unit = unit; + image->resolution_unit = unit; for (i = 0; i < 5; i++) g_free (unit_strings[i]); @@ -515,7 +515,7 @@ xcf_load_image_props (XcfInfo *info, { guint32 base = info->cp; - if (xcf_load_vectors (info, gimage)) + if (xcf_load_vectors (info, image)) { if (base + prop_size != info->cp) { @@ -559,7 +559,7 @@ xcf_load_image_props (XcfInfo *info, static gboolean xcf_load_layer_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpLayer *layer, gboolean *apply_mask, gboolean *edit_mask, @@ -702,7 +702,7 @@ xcf_load_layer_props (XcfInfo *info, static gboolean xcf_load_channel_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpChannel **channel) { PropType prop_type; @@ -723,20 +723,20 @@ xcf_load_channel_props (XcfInfo *info, break; case PROP_SELECTION: - g_object_unref (gimage->selection_mask); - gimage->selection_mask = - gimp_selection_new (gimage, + g_object_unref (image->selection_mask); + image->selection_mask = + gimp_selection_new (image, gimp_item_width (GIMP_ITEM (*channel)), gimp_item_height (GIMP_ITEM (*channel))); - g_object_ref (gimage->selection_mask); - gimp_item_sink (GIMP_ITEM (gimage->selection_mask)); + g_object_ref (image->selection_mask); + gimp_item_sink (GIMP_ITEM (image->selection_mask)); - tile_manager_unref (GIMP_DRAWABLE (gimage->selection_mask)->tiles); - GIMP_DRAWABLE (gimage->selection_mask)->tiles = + tile_manager_unref (GIMP_DRAWABLE (image->selection_mask)->tiles); + GIMP_DRAWABLE (image->selection_mask)->tiles = GIMP_DRAWABLE (*channel)->tiles; GIMP_DRAWABLE (*channel)->tiles = NULL; g_object_unref (*channel); - *channel = gimage->selection_mask; + *channel = image->selection_mask; (*channel)->boundary_known = FALSE; (*channel)->bounds_known = FALSE; break; @@ -846,7 +846,7 @@ xcf_load_prop (XcfInfo *info, static GimpLayer * xcf_load_layer (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { GimpLayer *layer; GimpLayerMask *layer_mask; @@ -876,14 +876,14 @@ xcf_load_layer (XcfInfo *info, info->cp += xcf_read_string (info->fp, &name, 1); /* create a new layer */ - layer = gimp_layer_new (gimage, width, height, + layer = gimp_layer_new (image, width, height, type, name, 255, GIMP_NORMAL_MODE); g_free (name); if (! layer) return NULL; /* read in the layer properties */ - if (! xcf_load_layer_props (info, gimage, layer, + if (! xcf_load_layer_props (info, image, layer, &apply_mask, &edit_mask, &show_mask, &text_layer_flags)) goto error; @@ -920,7 +920,7 @@ xcf_load_layer (XcfInfo *info, if (! xcf_seek_pos (info, layer_mask_offset, NULL)) goto error; - layer_mask = xcf_load_layer_mask (info, gimage); + layer_mask = xcf_load_layer_mask (info, image); if (! layer_mask) goto error; @@ -944,7 +944,7 @@ xcf_load_layer (XcfInfo *info, static GimpChannel * xcf_load_channel (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { GimpChannel *channel; guint32 hierarchy_offset; @@ -965,13 +965,13 @@ xcf_load_channel (XcfInfo *info, info->cp += xcf_read_string (info->fp, &name, 1); /* create a new channel */ - channel = gimp_channel_new (gimage, width, height, name, &color); + channel = gimp_channel_new (image, width, height, name, &color); g_free (name); if (!channel) return NULL; /* read in the channel properties */ - if (!xcf_load_channel_props (info, gimage, &channel)) + if (!xcf_load_channel_props (info, image, &channel)) goto error; /* read the hierarchy and layer mask offsets */ @@ -996,7 +996,7 @@ xcf_load_channel (XcfInfo *info, static GimpLayerMask * xcf_load_layer_mask (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { GimpLayerMask *layer_mask; GimpChannel *channel; @@ -1018,14 +1018,14 @@ xcf_load_layer_mask (XcfInfo *info, info->cp += xcf_read_string (info->fp, &name, 1); /* create a new layer mask */ - layer_mask = gimp_layer_mask_new (gimage, width, height, name, &color); + layer_mask = gimp_layer_mask_new (image, width, height, name, &color); g_free (name); if (!layer_mask) return NULL; /* read in the layer_mask properties */ channel = GIMP_CHANNEL (layer_mask); - if (!xcf_load_channel_props (info, gimage, &channel)) + if (!xcf_load_channel_props (info, image, &channel)) goto error; /* read the hierarchy and layer mask offsets */ @@ -1411,7 +1411,7 @@ xcf_load_parasite (XcfInfo *info) static gboolean xcf_load_old_paths (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { guint32 num_paths; guint32 last_selected_row; @@ -1421,20 +1421,20 @@ xcf_load_old_paths (XcfInfo *info, info->cp += xcf_read_int32 (info->fp, &num_paths, 1); while (num_paths-- > 0) - xcf_load_old_path (info, gimage); + xcf_load_old_path (info, image); active_vectors = (GimpVectors *) - gimp_container_get_child_by_index (gimage->vectors, last_selected_row); + gimp_container_get_child_by_index (image->vectors, last_selected_row); if (active_vectors) - gimp_image_set_active_vectors (gimage, active_vectors); + gimp_image_set_active_vectors (image, active_vectors); return TRUE; } static gboolean xcf_load_old_path (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { gchar *name; guint32 locked; @@ -1510,7 +1510,7 @@ xcf_load_old_path (XcfInfo *info, } } - vectors = gimp_vectors_compat_new (gimage, name, points, num_points, closed); + vectors = gimp_vectors_compat_new (image, name, points, num_points, closed); g_free (name); g_free (points); @@ -1520,15 +1520,15 @@ xcf_load_old_path (XcfInfo *info, if (tattoo) GIMP_ITEM (vectors)->tattoo = tattoo; - gimp_image_add_vectors (gimage, vectors, - gimp_container_num_children (gimage->vectors)); + gimp_image_add_vectors (image, vectors, + gimp_container_num_children (image->vectors)); return TRUE; } static gboolean xcf_load_vectors (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { guint32 version; guint32 active_index; @@ -1558,14 +1558,14 @@ xcf_load_vectors (XcfInfo *info, #endif while (num_paths-- > 0) - if (! xcf_load_vector (info, gimage)) + if (! xcf_load_vector (info, image)) return FALSE; active_vectors = (GimpVectors *) - gimp_container_get_child_by_index (gimage->vectors, active_index); + gimp_container_get_child_by_index (image->vectors, active_index); if (active_vectors) - gimp_image_set_active_vectors (gimage, active_vectors); + gimp_image_set_active_vectors (image, active_vectors); #ifdef GIMP_XCF_PATH_DEBUG g_printerr ("xcf_load_vectors: loaded %d bytes\n", info->cp - base); @@ -1575,7 +1575,7 @@ xcf_load_vectors (XcfInfo *info, static gboolean xcf_load_vector (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { gchar *name; GimpTattoo tattoo = 0; @@ -1603,7 +1603,7 @@ xcf_load_vector (XcfInfo *info, name, tattoo, visible, linked, num_parasites, num_strokes); #endif - vectors = gimp_vectors_new (gimage, name); + vectors = gimp_vectors_new (image, name); GIMP_ITEM (vectors)->visible = visible ? TRUE : FALSE; GIMP_ITEM (vectors)->linked = linked ? TRUE : FALSE; @@ -1703,8 +1703,8 @@ xcf_load_vector (XcfInfo *info, gimp_vectors_stroke_add (vectors, stroke); } - gimp_image_add_vectors (gimage, vectors, - gimp_container_num_children (gimage->vectors)); + gimp_image_add_vectors (image, vectors, + gimp_container_num_children (image->vectors)); return TRUE; } diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c index 47361ae208..e0e52d4b3c 100644 --- a/app/xcf/xcf-save.c +++ b/app/xcf/xcf-save.c @@ -63,27 +63,27 @@ static gboolean xcf_save_image_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GError **error); static gboolean xcf_save_layer_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpLayer *layer, GError **error); static gboolean xcf_save_channel_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpChannel *channel, GError **error); static gboolean xcf_save_prop (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, PropType prop_type, GError **error, ...); static gboolean xcf_save_layer (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpLayer *layer, GError **error); static gboolean xcf_save_channel (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpChannel *channel, GError **error); static gboolean xcf_save_hierarchy (XcfInfo *info, @@ -106,10 +106,10 @@ static gboolean xcf_save_parasite_list (XcfInfo *info, GimpParasiteList *parasite, GError **error); static gboolean xcf_save_old_paths (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GError **error); static gboolean xcf_save_vectors (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GError **error); @@ -217,17 +217,17 @@ static gboolean xcf_save_vectors (XcfInfo *info, void xcf_save_choose_format (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { GimpLayer *layer; GList *list; gint save_version = 0; /* default to oldest */ - if (gimage->cmap) + if (image->cmap) save_version = 1; /* need version 1 for colormaps */ - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list && save_version < 2; list = g_list_next (list)) { @@ -253,7 +253,7 @@ xcf_save_choose_format (XcfInfo *info, gint xcf_save_image (XcfInfo *info, - GimpImage *gimage) + GimpImage *image) { GimpLayer *layer; GimpLayer *floating_layer; @@ -268,7 +268,7 @@ xcf_save_image (XcfInfo *info, gchar version_tag[14]; GError *error = NULL; - floating_layer = gimp_image_floating_sel (gimage); + floating_layer = gimp_image_floating_sel (image); if (floating_layer) floating_sel_relax (floating_layer, FALSE); @@ -284,16 +284,16 @@ xcf_save_image (XcfInfo *info, xcf_write_int8_print_error (info, (guint8 *) version_tag, 14); /* write out the width, height and image type information for the image */ - xcf_write_int32_print_error (info, (guint32 *) &gimage->width, 1); - xcf_write_int32_print_error (info, (guint32 *) &gimage->height, 1); - xcf_write_int32_print_error (info, (guint32 *) &gimage->base_type, 1); + xcf_write_int32_print_error (info, (guint32 *) &image->width, 1); + xcf_write_int32_print_error (info, (guint32 *) &image->height, 1); + xcf_write_int32_print_error (info, (guint32 *) &image->base_type, 1); /* determine the number of layers and channels in the image */ - nlayers = (guint) gimp_container_num_children (gimage->layers); - nchannels = (guint) gimp_container_num_children (gimage->channels); + nlayers = (guint) gimp_container_num_children (image->layers); + nchannels = (guint) gimp_container_num_children (image->channels); /* check and see if we have to save out the selection */ - have_selection = gimp_channel_bounds (gimp_image_get_mask (gimage), + have_selection = gimp_channel_bounds (gimp_image_get_mask (image), &t1, &t2, &t3, &t4); if (have_selection) nchannels += 1; @@ -301,7 +301,7 @@ xcf_save_image (XcfInfo *info, /* write the property information for the image. */ - xcf_print_error (xcf_save_image_props (info, gimage, &error)); + xcf_print_error (xcf_save_image_props (info, image, &error)); /* save the current file position as it is the start of where * we place the layer offset information. @@ -313,7 +313,7 @@ xcf_save_image (XcfInfo *info, info->cp + (nlayers + nchannels + 2) * 4, &error)); - for (list = GIMP_LIST (gimage->layers)->list; + for (list = GIMP_LIST (image->layers)->list; list; list = g_list_next (list)) { @@ -325,7 +325,7 @@ xcf_save_image (XcfInfo *info, offset = info->cp; /* write out the layer. */ - xcf_print_error (xcf_save_layer (info, gimage, layer, &error)); + xcf_print_error (xcf_save_layer (info, image, layer, &error)); /* seek back to where we are to write out the next * layer offset and write it out. @@ -353,7 +353,7 @@ xcf_save_image (XcfInfo *info, saved_pos = info->cp; xcf_print_error (xcf_seek_end (info, &error)); - list = GIMP_LIST (gimage->channels)->list; + list = GIMP_LIST (image->channels)->list; while (list || have_selection) { @@ -365,7 +365,7 @@ xcf_save_image (XcfInfo *info, } else { - channel = gimage->selection_mask; + channel = image->selection_mask; have_selection = FALSE; } @@ -375,7 +375,7 @@ xcf_save_image (XcfInfo *info, offset = info->cp; /* write out the layer. */ - xcf_print_error (xcf_save_channel (info, gimage, channel, &error)); + xcf_print_error (xcf_save_channel (info, image, channel, &error)); /* seek back to where we are to write out the next * channel offset and write it out. @@ -410,127 +410,127 @@ xcf_save_image (XcfInfo *info, static gboolean xcf_save_image_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GError **error) { GimpParasite *parasite = NULL; - GimpUnit unit = gimp_image_get_unit (gimage); + GimpUnit unit = gimp_image_get_unit (image); /* check and see if we should save the colormap property */ - if (gimage->cmap) - xcf_check_error (xcf_save_prop (info, gimage, PROP_COLORMAP, error, - gimage->num_cols, gimage->cmap)); + if (image->cmap) + xcf_check_error (xcf_save_prop (info, image, PROP_COLORMAP, error, + image->num_cols, image->cmap)); if (info->compression != COMPRESS_NONE) - xcf_check_error (xcf_save_prop (info, gimage, PROP_COMPRESSION, + xcf_check_error (xcf_save_prop (info, image, PROP_COMPRESSION, error, info->compression)); - if (gimage->guides) - xcf_check_error (xcf_save_prop (info, gimage, PROP_GUIDES, - error, gimage->guides)); + if (image->guides) + xcf_check_error (xcf_save_prop (info, image, PROP_GUIDES, + error, image->guides)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_RESOLUTION, error, - gimage->xresolution, gimage->yresolution)); + xcf_check_error (xcf_save_prop (info, image, PROP_RESOLUTION, error, + image->xresolution, image->yresolution)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_TATTOO, error, - gimage->tattoo_state)); + xcf_check_error (xcf_save_prop (info, image, PROP_TATTOO, error, + image->tattoo_state)); - if (gimp_parasite_list_length (gimage->parasites) > 0) - xcf_check_error (xcf_save_prop (info, gimage, PROP_PARASITES, - error, gimage->parasites)); + if (gimp_parasite_list_length (image->parasites) > 0) + xcf_check_error (xcf_save_prop (info, image, PROP_PARASITES, + error, image->parasites)); - if (unit < _gimp_unit_get_number_of_built_in_units (gimage->gimp)) - xcf_check_error (xcf_save_prop (info, gimage, PROP_UNIT, error, unit)); + if (unit < _gimp_unit_get_number_of_built_in_units (image->gimp)) + xcf_check_error (xcf_save_prop (info, image, PROP_UNIT, error, unit)); - if (gimp_container_num_children (gimage->vectors) > 0) + if (gimp_container_num_children (image->vectors) > 0) { - if (gimp_vectors_compat_is_compatible (gimage)) - xcf_check_error (xcf_save_prop (info, gimage, PROP_PATHS, error)); + if (gimp_vectors_compat_is_compatible (image)) + xcf_check_error (xcf_save_prop (info, image, PROP_PATHS, error)); else - xcf_check_error (xcf_save_prop (info, gimage, PROP_VECTORS, error)); + xcf_check_error (xcf_save_prop (info, image, PROP_VECTORS, error)); } - if (unit >= _gimp_unit_get_number_of_built_in_units (gimage->gimp)) - xcf_check_error (xcf_save_prop (info, gimage, PROP_USER_UNIT, error, unit)); + if (unit >= _gimp_unit_get_number_of_built_in_units (image->gimp)) + xcf_check_error (xcf_save_prop (info, image, PROP_USER_UNIT, error, unit)); - if (GIMP_IS_GRID (gimage->grid)) + if (GIMP_IS_GRID (image->grid)) { - GimpGrid *grid = gimp_image_get_grid (gimage); + GimpGrid *grid = gimp_image_get_grid (image); parasite = gimp_grid_to_parasite (grid); - gimp_parasite_list_add (GIMP_IMAGE (gimage)->parasites, parasite); + gimp_parasite_list_add (GIMP_IMAGE (image)->parasites, parasite); } - if (gimp_parasite_list_length (GIMP_IMAGE (gimage)->parasites) > 0) + if (gimp_parasite_list_length (GIMP_IMAGE (image)->parasites) > 0) { - xcf_check_error (xcf_save_prop (info, gimage, PROP_PARASITES, error, - GIMP_IMAGE (gimage)->parasites)); + xcf_check_error (xcf_save_prop (info, image, PROP_PARASITES, error, + GIMP_IMAGE (image)->parasites)); } if (parasite) { - gimp_parasite_list_remove (GIMP_IMAGE (gimage)->parasites, + gimp_parasite_list_remove (GIMP_IMAGE (image)->parasites, gimp_parasite_name (parasite)); gimp_parasite_free (parasite); } - xcf_check_error (xcf_save_prop (info, gimage, PROP_END, error)); + xcf_check_error (xcf_save_prop (info, image, PROP_END, error)); return TRUE; } static gboolean xcf_save_layer_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpLayer *layer, GError **error) { GimpParasite *parasite = NULL; - if (layer == gimp_image_get_active_layer (gimage)) - xcf_check_error (xcf_save_prop (info, gimage, PROP_ACTIVE_LAYER, error)); + if (layer == gimp_image_get_active_layer (image)) + xcf_check_error (xcf_save_prop (info, image, PROP_ACTIVE_LAYER, error)); - if (layer == gimp_image_floating_sel (gimage)) + if (layer == gimp_image_floating_sel (image)) { info->floating_sel_drawable = layer->fs.drawable; - xcf_check_error (xcf_save_prop (info, gimage, PROP_FLOATING_SELECTION, + xcf_check_error (xcf_save_prop (info, image, PROP_FLOATING_SELECTION, error)); } - xcf_check_error (xcf_save_prop (info, gimage, PROP_OPACITY, error, + xcf_check_error (xcf_save_prop (info, image, PROP_OPACITY, error, layer->opacity)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_VISIBLE, error, + xcf_check_error (xcf_save_prop (info, image, PROP_VISIBLE, error, gimp_item_get_visible (GIMP_ITEM (layer)))); - xcf_check_error (xcf_save_prop (info, gimage, PROP_LINKED, error, + xcf_check_error (xcf_save_prop (info, image, PROP_LINKED, error, gimp_item_get_linked (GIMP_ITEM (layer)))); - xcf_check_error (xcf_save_prop (info, gimage, PROP_LOCK_ALPHA, + xcf_check_error (xcf_save_prop (info, image, PROP_LOCK_ALPHA, error, layer->lock_alpha)); if (layer->mask) { - xcf_check_error (xcf_save_prop (info, gimage, PROP_APPLY_MASK, + xcf_check_error (xcf_save_prop (info, image, PROP_APPLY_MASK, error, layer->mask->apply_mask)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_EDIT_MASK, + xcf_check_error (xcf_save_prop (info, image, PROP_EDIT_MASK, error, layer->mask->edit_mask)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_SHOW_MASK, + xcf_check_error (xcf_save_prop (info, image, PROP_SHOW_MASK, error, layer->mask->show_mask)); } else { - xcf_check_error (xcf_save_prop (info, gimage, PROP_APPLY_MASK, + xcf_check_error (xcf_save_prop (info, image, PROP_APPLY_MASK, error, FALSE)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_EDIT_MASK, + xcf_check_error (xcf_save_prop (info, image, PROP_EDIT_MASK, error, FALSE)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_SHOW_MASK, + xcf_check_error (xcf_save_prop (info, image, PROP_SHOW_MASK, error, FALSE)); } - xcf_check_error (xcf_save_prop (info, gimage, PROP_OFFSETS, error, + xcf_check_error (xcf_save_prop (info, image, PROP_OFFSETS, error, GIMP_ITEM (layer)->offset_x, GIMP_ITEM (layer)->offset_y)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_MODE, error, + xcf_check_error (xcf_save_prop (info, image, PROP_MODE, error, layer->mode)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_TATTOO, error, + xcf_check_error (xcf_save_prop (info, image, PROP_TATTOO, error, GIMP_ITEM (layer)->tattoo)); if (GIMP_IS_TEXT_LAYER (layer) && GIMP_TEXT_LAYER (layer)->text) @@ -542,13 +542,13 @@ xcf_save_layer_props (XcfInfo *info, if (flags) xcf_check_error (xcf_save_prop (info, - gimage, PROP_TEXT_LAYER_FLAGS, error, + image, PROP_TEXT_LAYER_FLAGS, error, flags)); } if (gimp_parasite_list_length (GIMP_ITEM (layer)->parasites) > 0) { - xcf_check_error (xcf_save_prop (info, gimage, PROP_PARASITES, error, + xcf_check_error (xcf_save_prop (info, image, PROP_PARASITES, error, GIMP_ITEM (layer)->parasites)); } @@ -559,52 +559,52 @@ xcf_save_layer_props (XcfInfo *info, gimp_parasite_free (parasite); } - xcf_check_error (xcf_save_prop (info, gimage, PROP_END, error)); + xcf_check_error (xcf_save_prop (info, image, PROP_END, error)); return TRUE; } static gboolean xcf_save_channel_props (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpChannel *channel, GError **error) { guchar col[3]; - if (channel == gimp_image_get_active_channel (gimage)) - xcf_check_error (xcf_save_prop (info, gimage, PROP_ACTIVE_CHANNEL, error)); + if (channel == gimp_image_get_active_channel (image)) + xcf_check_error (xcf_save_prop (info, image, PROP_ACTIVE_CHANNEL, error)); - if (channel == gimage->selection_mask) - xcf_check_error (xcf_save_prop (info, gimage, PROP_SELECTION, error)); + if (channel == image->selection_mask) + xcf_check_error (xcf_save_prop (info, image, PROP_SELECTION, error)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_OPACITY, error, + xcf_check_error (xcf_save_prop (info, image, PROP_OPACITY, error, channel->color.a)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_VISIBLE, error, + xcf_check_error (xcf_save_prop (info, image, PROP_VISIBLE, error, gimp_item_get_visible (GIMP_ITEM (channel)))); - xcf_check_error (xcf_save_prop (info, gimage, PROP_LINKED, error, + xcf_check_error (xcf_save_prop (info, image, PROP_LINKED, error, gimp_item_get_linked (GIMP_ITEM (channel)))); - xcf_check_error (xcf_save_prop (info, gimage, PROP_SHOW_MASKED, error, + xcf_check_error (xcf_save_prop (info, image, PROP_SHOW_MASKED, error, channel->show_masked)); gimp_rgb_get_uchar (&channel->color, &col[0], &col[1], &col[2]); - xcf_check_error (xcf_save_prop (info, gimage, PROP_COLOR, error, col)); + xcf_check_error (xcf_save_prop (info, image, PROP_COLOR, error, col)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_TATTOO, error, + xcf_check_error (xcf_save_prop (info, image, PROP_TATTOO, error, GIMP_ITEM (channel)->tattoo)); if (gimp_parasite_list_length (GIMP_ITEM (channel)->parasites) > 0) - xcf_check_error (xcf_save_prop (info, gimage, PROP_PARASITES, error, + xcf_check_error (xcf_save_prop (info, image, PROP_PARASITES, error, GIMP_ITEM (channel)->parasites)); - xcf_check_error (xcf_save_prop (info, gimage, PROP_END, error)); + xcf_check_error (xcf_save_prop (info, image, PROP_END, error)); return TRUE; } static gboolean xcf_save_prop (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, PropType prop_type, GError **error, ...) @@ -966,7 +966,7 @@ xcf_save_prop (XcfInfo *info, base = info->cp; - xcf_check_error (xcf_save_old_paths (info, gimage, error)); + xcf_check_error (xcf_save_old_paths (info, image, error)); length = info->cp - base; @@ -993,13 +993,13 @@ xcf_save_prop (XcfInfo *info, unit = va_arg (args, guint32); /* write the entire unit definition */ - unit_strings[0] = _gimp_unit_get_identifier (gimage->gimp, unit); - factor = _gimp_unit_get_factor (gimage->gimp, unit); - digits = _gimp_unit_get_digits (gimage->gimp, unit); - unit_strings[1] = _gimp_unit_get_symbol (gimage->gimp, unit); - unit_strings[2] = _gimp_unit_get_abbreviation (gimage->gimp, unit); - unit_strings[3] = _gimp_unit_get_singular (gimage->gimp, unit); - unit_strings[4] = _gimp_unit_get_plural (gimage->gimp, unit); + unit_strings[0] = _gimp_unit_get_identifier (image->gimp, unit); + factor = _gimp_unit_get_factor (image->gimp, unit); + digits = _gimp_unit_get_digits (image->gimp, unit); + unit_strings[1] = _gimp_unit_get_symbol (image->gimp, unit); + unit_strings[2] = _gimp_unit_get_abbreviation (image->gimp, unit); + unit_strings[3] = _gimp_unit_get_singular (image->gimp, unit); + unit_strings[4] = _gimp_unit_get_plural (image->gimp, unit); size = 2 * 4 + @@ -1032,7 +1032,7 @@ xcf_save_prop (XcfInfo *info, base = info->cp; - xcf_check_error (xcf_save_vectors (info, gimage, error)); + xcf_check_error (xcf_save_vectors (info, image, error)); length = info->cp - base; @@ -1070,7 +1070,7 @@ xcf_save_prop (XcfInfo *info, static gboolean xcf_save_layer (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpLayer *layer, GError **error) { @@ -1102,7 +1102,7 @@ xcf_save_layer (XcfInfo *info, xcf_write_string_check_error (info, &GIMP_OBJECT (layer)->name, 1); /* write out the layer properties */ - xcf_save_layer_props (info, gimage, layer, error); + xcf_save_layer_props (info, image, layer, error); /* save the current position which is where the hierarchy offset * will be stored. @@ -1127,7 +1127,7 @@ xcf_save_layer (XcfInfo *info, offset = info->cp; xcf_check_error (xcf_save_channel (info, - gimage, GIMP_CHANNEL(layer->mask), + image, GIMP_CHANNEL(layer->mask), error)); } else @@ -1141,7 +1141,7 @@ xcf_save_layer (XcfInfo *info, static gboolean xcf_save_channel (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GimpChannel *channel, GError **error) { @@ -1171,7 +1171,7 @@ xcf_save_channel (XcfInfo *info, xcf_write_string_check_error (info, &GIMP_OBJECT (channel)->name, 1); /* write out the channel properties */ - xcf_save_channel_props (info, gimage, channel, error); + xcf_save_channel_props (info, image, channel, error); /* save the current position which is where the hierarchy offset * will be stored. @@ -1564,7 +1564,7 @@ xcf_save_parasite_list (XcfInfo *info, static gboolean xcf_save_old_paths (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GError **error) { GimpVectors *active_vectors; @@ -1581,18 +1581,18 @@ xcf_save_old_paths (XcfInfo *info, * then each path:- */ - num_paths = gimp_container_num_children (gimage->vectors); + num_paths = gimp_container_num_children (image->vectors); - active_vectors = gimp_image_get_active_vectors (gimage); + active_vectors = gimp_image_get_active_vectors (image); if (active_vectors) - active_index = gimp_container_get_child_index (gimage->vectors, + active_index = gimp_container_get_child_index (image->vectors, GIMP_OBJECT (active_vectors)); xcf_write_int32_check_error (info, &active_index, 1); xcf_write_int32_check_error (info, &num_paths, 1); - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { @@ -1670,7 +1670,7 @@ xcf_save_old_paths (XcfInfo *info, static gboolean xcf_save_vectors (XcfInfo *info, - GimpImage *gimage, + GimpImage *image, GError **error) { GimpVectors *active_vectors; @@ -1690,19 +1690,19 @@ xcf_save_vectors (XcfInfo *info, * then each path:- */ - active_vectors = gimp_image_get_active_vectors (gimage); + active_vectors = gimp_image_get_active_vectors (image); if (active_vectors) - active_index = gimp_container_get_child_index (gimage->vectors, + active_index = gimp_container_get_child_index (image->vectors, GIMP_OBJECT (active_vectors)); - num_paths = gimp_container_num_children (gimage->vectors); + num_paths = gimp_container_num_children (image->vectors); xcf_write_int32_check_error (info, &version, 1); xcf_write_int32_check_error (info, &active_index, 1); xcf_write_int32_check_error (info, &num_paths, 1); - for (list = GIMP_LIST (gimage->vectors)->list; + for (list = GIMP_LIST (image->vectors)->list; list; list = g_list_next (list)) { diff --git a/app/xcf/xcf-save.h b/app/xcf/xcf-save.h index b9eec854a8..d9e13f1d17 100644 --- a/app/xcf/xcf-save.h +++ b/app/xcf/xcf-save.h @@ -21,9 +21,9 @@ void xcf_save_choose_format (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); gint xcf_save_image (XcfInfo *info, - GimpImage *gimage); + GimpImage *image); #endif /* __XCF_SAVE_H__ */ diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index c31a2fece2..794bd3439d 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -229,9 +229,9 @@ xcf_load_invoker (ProcRecord *procedure, { XcfInfo info; Argument *return_vals; - GimpImage *gimage = NULL; + GimpImage *image = NULL; const gchar *filename; - gboolean success = FALSE; + gboolean success = FALSE; gchar id[14]; gimp_set_busy (gimp); @@ -279,9 +279,9 @@ xcf_load_invoker (ProcRecord *procedure, { if (info.file_version < G_N_ELEMENTS (xcf_loaders)) { - gimage = (*(xcf_loaders[info.file_version])) (gimp, &info); + image = (*(xcf_loaders[info.file_version])) (gimp, &info); - if (! gimage) + if (! image) success = FALSE; } else @@ -301,7 +301,7 @@ xcf_load_invoker (ProcRecord *procedure, return_vals = procedural_db_return_values (procedure, success); if (success) - return_vals[1].value.pdb_int = gimp_image_get_ID (gimage); + return_vals[1].value.pdb_int = gimp_image_get_ID (image); gimp_unset_busy (gimp); @@ -317,13 +317,13 @@ xcf_save_invoker (ProcRecord *procedure, { XcfInfo info; Argument *return_vals; - GimpImage *gimage; + GimpImage *image; const gchar *filename; gboolean success = FALSE; gimp_set_busy (gimp); - gimage = gimp_image_get_by_ID (gimp, args[1].value.pdb_int); + image = gimp_image_get_by_ID (gimp, args[1].value.pdb_int); filename = args[3].value.pdb_pointer; info.fp = g_fopen (filename, "wb"); @@ -341,9 +341,9 @@ xcf_save_invoker (ProcRecord *procedure, info.ref_count = NULL; info.compression = COMPRESS_RLE; - xcf_save_choose_format (&info, gimage); + xcf_save_choose_format (&info, image); - success = xcf_save_image (&info, gimage); + success = xcf_save_image (&info, image); if (fclose (info.fp) == EOF) { g_message (_("Error saving XCF file: %s"), g_strerror (errno));