Commit a5d10b2f authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

renamed gimp_image_active_drawable() to gimp_image_get_active_drawable().

2007-07-19  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage.[ch]: renamed gimp_image_active_drawable() to
	gimp_image_get_active_drawable().

	* app/[lots of files]
	* tools/pdbgen/pdb/paths.pdb
	* tools/pdbgen/pdb/image.pdb: changed accordingly.

svn path=/trunk/; revision=22958
parent f6c626fb
2007-07-19 Sven Neumann <sven@gimp.org>
* app/core/gimpimage.[ch]: renamed gimp_image_active_drawable() to
gimp_image_get_active_drawable().
* app/[lots of files]
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly.
2007-07-19 Sven Neumann <sven@gimp.org>
* app/tools/gimpcolortool.c (gimp_color_tool_draw): chain up.
......@@ -81,7 +81,7 @@ GimpObject * action_select_object (GimpActionSelectType select_type,
#define return_if_no_drawable(image,drawable,data) \
return_if_no_image (image,data); \
drawable = gimp_image_active_drawable (image); \
drawable = gimp_image_get_active_drawable (image); \
if (! drawable) \
return
......
......@@ -148,7 +148,7 @@ buffers_paste (GimpBufferView *view,
if (image)
{
gimp_edit_paste (image, gimp_image_active_drawable (image),
gimp_edit_paste (image, gimp_image_get_active_drawable (image),
buffer, paste_into, x, y, width, height);
gimp_image_flush (image);
......
......@@ -164,7 +164,7 @@ drawable_actions_update (GimpActionGroup *group,
if (image)
{
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
if (drawable)
{
......
......@@ -261,7 +261,7 @@ edit_actions_update (GimpActionGroup *group,
GimpUndo *undo;
GimpUndo *redo;
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
undo_enabled = gimp_image_undo_is_enabled (image);
......
......@@ -439,7 +439,7 @@ edit_paste (GimpDisplay *display,
&x, &y, &width, &height);
if (gimp_edit_paste (display->image,
gimp_image_active_drawable (display->image),
gimp_image_get_active_drawable (display->image),
buffer, paste_into, x, y, width, height))
{
gimp_image_flush (display->image);
......@@ -461,10 +461,8 @@ cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpImage *image = GIMP_IMAGE (data);
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (image);
GimpImage *image = GIMP_IMAGE (data);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (! drawable)
{
......@@ -488,10 +486,8 @@ copy_named_buffer_callback (GtkWidget *widget,
const gchar *name,
gpointer data)
{
GimpImage *image = GIMP_IMAGE (data);
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (image);
GimpImage *image = GIMP_IMAGE (data);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (! drawable)
{
......
......@@ -226,7 +226,7 @@ file_actions_update (GimpActionGroup *group,
GimpDrawable *drawable = NULL;
if (image)
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
......
......@@ -193,7 +193,7 @@ file_save_cmd_callback (GtkAction *action,
save_mode = (GimpSaveMode) value;
if (! gimp_image_active_drawable (image))
if (! gimp_image_get_active_drawable (image))
return;
switch (save_mode)
......
......@@ -225,7 +225,7 @@ plug_in_actions_update (GimpActionGroup *group,
if (image)
{
GimpDrawable *drawable = gimp_image_active_drawable (image);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (drawable)
type = gimp_drawable_type (drawable);
......
......@@ -434,7 +434,7 @@ plug_in_collect_display_args (GtkAction *action,
if (args->n_values > n_args &&
GIMP_IS_PARAM_SPEC_DRAWABLE_ID (pspecs[n_args]))
{
GimpDrawable *drawable = gimp_image_active_drawable (image);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (drawable)
{
......
......@@ -139,7 +139,7 @@ select_actions_update (GimpActionGroup *group,
if (image)
{
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
fs = (gimp_image_floating_sel (image) != NULL);
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
......
......@@ -121,7 +121,7 @@ select_float_cmd_callback (GtkAction *action,
return_if_no_image (image, data);
gimp_selection_float (gimp_image_get_mask (image),
gimp_image_active_drawable (image),
gimp_image_get_active_drawable (image),
action_data_get_context (data),
TRUE, 0, 0);
gimp_image_flush (image);
......@@ -299,7 +299,7 @@ select_stroke_cmd_callback (GtkAction *action,
return_if_no_image (image, data);
return_if_no_widget (widget, data);
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
if (! drawable)
{
......@@ -330,7 +330,7 @@ select_stroke_last_vals_cmd_callback (GtkAction *action,
return_if_no_context (context, data);
return_if_no_widget (widget, data);
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
if (! drawable)
{
......
......@@ -355,7 +355,7 @@ vectors_stroke_cmd_callback (GtkAction *action,
return_if_no_vectors (image, vectors, data);
return_if_no_widget (widget, data);
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
if (! drawable)
{
......@@ -387,7 +387,7 @@ vectors_stroke_last_vals_cmd_callback (GtkAction *action,
return_if_no_context (context, data);
return_if_no_widget (widget, data);
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
if (! drawable)
{
......
......@@ -313,7 +313,7 @@ gimp_image_crop_auto_shrink (GimpImage *image,
if (active_drawable_only)
{
active_drawable = gimp_image_active_drawable (image);
active_drawable = gimp_image_get_active_drawable (image);
if (! active_drawable)
goto FINISH;
......
......@@ -51,7 +51,7 @@ gimp_image_pick_color (GimpImage *image,
if (! sample_merged)
{
if (! drawable)
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
if (! drawable)
return FALSE;
......
......@@ -2509,7 +2509,7 @@ gimp_image_get_vectors (const GimpImage *image)
}
GimpDrawable *
gimp_image_active_drawable (const GimpImage *image)
gimp_image_get_active_drawable (const GimpImage *image)
{
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
......@@ -3711,7 +3711,7 @@ gimp_image_coords_in_active_pickable (GimpImage *image,
}
else
{
GimpDrawable *drawable = gimp_image_active_drawable (image);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (drawable)
{
......
......@@ -410,7 +410,7 @@ 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 *image);
GimpDrawable * gimp_image_get_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);
......
......@@ -68,7 +68,7 @@ floating_sel_attach (GimpLayer *layer,
* to the drawable
*/
if (drawable == (GimpDrawable *) floating_sel)
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
}
/* set the drawable and allocate a backing store */
......
......@@ -353,7 +353,7 @@ gimp_selection_boundary (GimpChannel *channel,
return TRUE;
}
else if ((drawable = gimp_image_active_drawable (image)) &&
else if ((drawable = gimp_image_get_active_drawable (image)) &&
GIMP_IS_CHANNEL (drawable))
{
/* Otherwise, return the boundary...if a channel is active */
......
......@@ -248,14 +248,13 @@ offset_response (GtkWidget *widget,
{
if (response_id == GTK_RESPONSE_OK)
{
GimpImage *image;
GimpDrawable *drawable;
gint offset_x;
gint offset_y;
GimpImage *image = dialog->image;
if ((image = dialog->image) != NULL)
if (image)
{
drawable = gimp_image_active_drawable (image);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
gint offset_x;
gint offset_y;
offset_x =
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (dialog->off_se),
......@@ -280,11 +279,11 @@ static void
offset_halfheight_callback (GtkWidget *widget,
OffsetDialog *dialog)
{
GimpImage *image = dialog->image;
GimpImage *image = dialog->image;
if (image)
{
GimpItem *item = GIMP_ITEM (gimp_image_active_drawable (image));
GimpItem *item = GIMP_ITEM (gimp_image_get_active_drawable (image));
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (dialog->off_se),
0, item->width / 2);
......
......@@ -271,11 +271,9 @@ stroke_dialog_response (GtkWidget *widget,
case GTK_RESPONSE_OK:
{
GimpDrawable *drawable;
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
GimpStrokeDesc *saved_desc;
drawable = gimp_image_active_drawable (image);
if (! drawable)
{
gimp_message (context->gimp, G_OBJECT (widget),
......
......@@ -850,7 +850,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
display);
}
else if ((active_tool->drawable !=
gimp_image_active_drawable (image)) &&
gimp_image_get_active_drawable (image)) &&
! gimp_tool_control_get_preserve (active_tool->control))
{
/* create a new one, deleting the current
......
......@@ -304,7 +304,7 @@ gimp_display_shell_bucket_fill (GimpDisplayShell *shell,
if (image->gimp->busy)
return;
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
if (! drawable)
return;
......@@ -389,7 +389,7 @@ gimp_display_shell_drop_buffer (GtkWidget *widget,
/* FIXME: popup a menu for selecting "Paste Into" */
gimp_edit_paste (image, gimp_image_active_drawable (image),
gimp_edit_paste (image, gimp_image_get_active_drawable (image),
buffer, FALSE,
x, y, width, height);
......
......@@ -321,7 +321,7 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
case 'n': /* active drawable name */
{
GimpDrawable *drawable = gimp_image_active_drawable (image);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (drawable)
i += print (title, title_len, i, "%s",
......@@ -333,7 +333,7 @@ gimp_display_shell_format_title (GimpDisplayShell *shell,
case 'P': /* active drawable PDB id */
{
GimpDrawable *drawable = gimp_image_active_drawable (image);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (drawable)
i += print (title, title_len, i, "%d",
......
......@@ -107,7 +107,7 @@ gimp_display_shell_transform_xy (GimpDisplayShell *shell,
{
GimpItem *item;
item = GIMP_ITEM (gimp_image_active_drawable (shell->display->image));
item = GIMP_ITEM (gimp_image_get_active_drawable (shell->display->image));
gimp_item_offsets (item, &offset_x, &offset_y);
}
......@@ -162,7 +162,7 @@ gimp_display_shell_untransform_xy (GimpDisplayShell *shell,
{
GimpItem *item;
item = GIMP_ITEM (gimp_image_active_drawable (shell->display->image));
item = GIMP_ITEM (gimp_image_get_active_drawable (shell->display->image));
gimp_item_offsets (item, &offset_x, &offset_y);
}
......@@ -210,7 +210,7 @@ gimp_display_shell_transform_xy_f (GimpDisplayShell *shell,
{
GimpItem *item;
item = GIMP_ITEM (gimp_image_active_drawable (shell->display->image));
item = GIMP_ITEM (gimp_image_get_active_drawable (shell->display->image));
gimp_item_offsets (item, &offset_x, &offset_y);
}
......@@ -257,7 +257,7 @@ gimp_display_shell_untransform_xy_f (GimpDisplayShell *shell,
{
GimpItem *item;
item = GIMP_ITEM (gimp_image_active_drawable (shell->display->image));
item = GIMP_ITEM (gimp_image_get_active_drawable (shell->display->image));
gimp_item_offsets (item, &offset_x, &offset_y);
}
......@@ -294,7 +294,7 @@ gimp_display_shell_transform_points (GimpDisplayShell *shell,
{
GimpItem *item;
item = GIMP_ITEM (gimp_image_active_drawable (shell->display->image));
item = GIMP_ITEM (gimp_image_get_active_drawable (shell->display->image));
gimp_item_offsets (item, &offset_x, &offset_y);
}
......@@ -346,7 +346,7 @@ gimp_display_shell_transform_coords (GimpDisplayShell *shell,
{
GimpItem *item;
item = GIMP_ITEM (gimp_image_active_drawable (shell->display->image));
item = GIMP_ITEM (gimp_image_get_active_drawable (shell->display->image));
gimp_item_offsets (item, &offset_x, &offset_y);
}
......@@ -398,7 +398,7 @@ gimp_display_shell_transform_segments (GimpDisplayShell *shell,
{
GimpItem *item;
item = GIMP_ITEM (gimp_image_active_drawable (shell->display->image));
item = GIMP_ITEM (gimp_image_get_active_drawable (shell->display->image));
gimp_item_offsets (item, &offset_x, &offset_y);
}
......
......@@ -94,7 +94,7 @@ file_save (GimpImage *image,
g_return_val_if_fail (error == NULL || *error == NULL,
GIMP_PDB_CALLING_ERROR);
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
if (! drawable)
return GIMP_PDB_EXECUTION_ERROR;
......
......@@ -611,7 +611,7 @@ image_get_active_drawable_invoker (GimpProcedure *procedure,
if (success)
{
drawable = gimp_image_active_drawable (image);
drawable = gimp_image_get_active_drawable (image);
}
return_vals = gimp_procedure_get_return_values (procedure, success);
......
......@@ -316,7 +316,7 @@ path_stroke_current_invoker (GimpProcedure *procedure,
if (success)
{
GimpVectors *vectors = gimp_image_get_active_vectors (image);
GimpDrawable *drawable = gimp_image_active_drawable (image);
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
if (vectors && drawable)
{
......
......@@ -150,7 +150,7 @@ gimp_blend_tool_initialize (GimpTool *tool,
GimpDisplay *display,
GError **error)
{
GimpDrawable *drawable = gimp_image_active_drawable (display->image);
GimpDrawable *drawable = gimp_image_get_active_drawable (display->image);
if (! GIMP_TOOL_CLASS (parent_class)->initialize (tool, display, error))
{
......@@ -215,6 +215,7 @@ gimp_blend_tool_button_release (GimpTool *tool,
((blend_tool->start_x != blend_tool->end_x) ||
(blend_tool->start_y != blend_tool->end_y)))
{
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
GimpProgress *progress;
gint off_x;
gint off_y;
......@@ -222,10 +223,9 @@ gimp_blend_tool_button_release (GimpTool *tool,
progress = gimp_progress_start (GIMP_PROGRESS (display),
_("Blending"), FALSE);
gimp_item_offsets (GIMP_ITEM (gimp_image_active_drawable (image)),
&off_x, &off_y);
gimp_item_offsets (GIMP_ITEM (drawable), &off_x, &off_y);
gimp_drawable_blend (gimp_image_active_drawable (image),
gimp_drawable_blend (drawable,
context,
GIMP_CUSTOM_MODE,
gimp_context_get_paint_mode (context),
......@@ -335,7 +335,7 @@ gimp_blend_tool_cursor_update (GimpTool *tool,
GdkModifierType state,
GimpDisplay *display)
{
switch (gimp_drawable_type (gimp_image_active_drawable (display->image)))
switch (gimp_drawable_type (gimp_image_get_active_drawable (display->image)))
{
case GIMP_INDEXED_IMAGE:
case GIMP_INDEXEDA_IMAGE:
......
......@@ -158,7 +158,7 @@ gimp_brightness_contrast_tool_initialize (GimpTool *tool,
GimpBrightnessContrastTool *bc_tool = GIMP_BRIGHTNESS_CONTRAST_TOOL (tool);
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (display->image);
drawable = gimp_image_get_active_drawable (display->image);
if (! drawable)
return FALSE;
......
......@@ -205,7 +205,7 @@ gimp_brush_tool_oper_update (GimpTool *tool,
proximity, display);
if (! gimp_color_tool_is_enabled (GIMP_COLOR_TOOL (tool)) &&
gimp_image_active_drawable (display->image) && proximity)
gimp_image_get_active_drawable (display->image) && proximity)
{
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpBrushCore *brush_core = GIMP_BRUSH_CORE (paint_tool->core);
......
......@@ -125,7 +125,7 @@ gimp_bucket_fill_tool_button_release (GimpTool *tool,
gimp_image_coords_in_active_pickable (display->image, coords,
options->sample_merged, TRUE))
{
GimpDrawable *drawable = gimp_image_active_drawable (display->image);
GimpDrawable *drawable = gimp_image_get_active_drawable (display->image);
GimpContext *context = GIMP_CONTEXT (options);
gint x, y;
......
......@@ -100,7 +100,7 @@ gimp_by_color_select_tool_get_mask (GimpRegionSelectTool *region_select,
GimpRGB color;
gint x, y;
drawable = gimp_image_active_drawable (display->image);
drawable = gimp_image_get_active_drawable (display->image);
x = region_select->x;
y = region_select->y;
......
......@@ -142,7 +142,7 @@ gimp_color_balance_tool_initialize (GimpTool *tool,
GimpColorBalanceTool *cb_tool = GIMP_COLOR_BALANCE_TOOL (tool);
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (display->image);
drawable = gimp_image_get_active_drawable (display->image);
if (! drawable)
return FALSE;
......
......@@ -137,9 +137,7 @@ gimp_colorize_tool_initialize (GimpTool *tool,
GError **error)
{
GimpColorizeTool *col_tool = GIMP_COLORIZE_TOOL (tool);
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (display->image);
GimpDrawable *drawable = gimp_image_get_active_drawable (display->image);
if (! drawable)
return FALSE;
......
......@@ -241,10 +241,8 @@ gimp_curves_tool_initialize (GimpTool *tool,
GimpDisplay *display,
GError **error)
{
GimpCurvesTool *c_tool = GIMP_CURVES_TOOL (tool);
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (display->image);
GimpCurvesTool *c_tool = GIMP_CURVES_TOOL (tool);
GimpDrawable *drawable = gimp_image_get_active_drawable (display->image);
if (! drawable)
return FALSE;
......@@ -303,9 +301,6 @@ gimp_curves_tool_button_release (GimpTool *tool,
GimpDisplay *display)
{
GimpCurvesTool *c_tool = GIMP_CURVES_TOOL (tool);
GimpDrawable *drawable;
drawable = gimp_image_active_drawable (display->image);
if (state & GDK_SHIFT_MASK)
{
......
......@@ -175,7 +175,7 @@ gimp_edit_selection_tool_start (GimpTool *parent_tool,
if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_VECTORS)
active_item = GIMP_ITEM (gimp_image_get_active_vectors (display->image));
else
active_item = GIMP_ITEM (gimp_image_active_drawable (display->image));
active_item = GIMP_ITEM (gimp_image_get_active_drawable (display->image));
switch (edit_select->edit_mode)
{
......@@ -424,7 +424,7 @@ gimp_edit_selection_tool_button_release (GimpTool *tool,
if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_VECTORS)
active_item = GIMP_ITEM (gimp_image_get_active_vectors (display->image));
else
active_item = GIMP_ITEM (gimp_image_active_drawable (display->image));
active_item = GIMP_ITEM (gimp_image_get_active_drawable (display->image));
gimp_edit_selection_tool_calc_coords (edit_select,
coords->x,
......@@ -538,7 +538,7 @@ gimp_edit_selection_tool_motion (GimpTool *tool,
if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_VECTORS)
active_item = GIMP_ITEM (gimp_image_get_active_vectors (display->image));
else
active_item = GIMP_ITEM (gimp_image_active_drawable (display->image));
active_item = GIMP_ITEM (gimp_image_get_active_drawable (display->image));
gimp_item_offsets (active_item, &off_x, &off_y);
......@@ -640,7 +640,8 @@ gimp_edit_selection_tool_motion (GimpTool *tool,
edit_select->edit_mode = GIMP_TRANSLATE_MODE_FLOATING_SEL;
active_item = GIMP_ITEM (gimp_image_active_drawable (display->image));
active_item =
GIMP_ITEM (gimp_image_get_active_drawable (display->image));
/* fall through */
......@@ -679,7 +680,7 @@ gimp_edit_selection_tool_draw (GimpDrawTool *draw_tool)
if (edit_select->edit_mode == GIMP_TRANSLATE_MODE_VECTORS)
active_item = GIMP_ITEM (gimp_image_get_active_vectors (display->image));
else
active_item = GIMP_ITEM (gimp_image_active_drawable (display->image));
active_item = GIMP_ITEM (gimp_image_get_active_drawable (display->image));
switch (edit_select->edit_mode)
{
......@@ -1066,7 +1067,7 @@ gimp_edit_selection_tool_translate (GimpTool *tool,
break;
case GIMP_TRANSFORM_TYPE_LAYER:
item = GIMP_ITEM (gimp_image_active_drawable (display->image));
item = GIMP_ITEM (gimp_image_get_active_drawable (display->image));
if (item)
{
......
......@@ -608,11 +608,12 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
{
GimpForegroundSelectTool *fg_select;
GimpForegroundSelectOptions *options;
GimpImage *image = display->image;
GimpDrawable *drawable = gimp_image_active_drawable (image);
GimpImage *image = display->image;
GimpDrawable *drawable;
GimpScanConvert *scan_convert;
GimpChannel *mask;
drawable = gimp_image_get_active_drawable (image);
fg_select = GIMP_FOREGROUND_SELECT_TOOL (free_sel);
options = GIMP_FOREGROUND_SELECT_TOOL_GET_OPTIONS (free_sel);
......
......@@ -97,7 +97,7 @@ gimp_fuzzy_select_tool_get_mask (GimpRegionSelectTool *region_select,
GimpDrawable *drawable;
gint x, y;