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);
......
......@@ -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);
......
......@@ -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 = actio