Commit 905fdfcb authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

did a global gimage -> image substitution.

2006-03-28  Sven Neumann  <sven@gimp.org>

	* app/*: did a global gimage -> image substitution.
parent aead1803
2006-03-28 Sven Neumann <sven@gimp.org>
* app/*: did a global gimage -> image substitution.
2006-03-28 Michael Natterer <mitch@gimp.org>
* app/core/gimpparamspecs.[ch] (gimp_param_spec_string): reordered
......
......@@ -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;
......
......@@ -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
......
......@@ -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);
}
}
}
......@@ -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);
......
This diff is collapsed.
......@@ -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);
......
......@@ -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:
......
......@@ -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);
......
......@@ -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:
......
......@@ -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))
{
......
......@@ -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)
{
......
......@@ -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))