Commit 3220f9ec authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/channel.[ch] app/drawable.[ch] app/gdisplay.[ch] app/gimpdrawable.[ch]

2001-01-14  Michael Natterer  <mitch@gimp.org>

	* app/channel.[ch]
	* app/drawable.[ch]
	* app/gdisplay.[ch]
	* app/gimpdrawable.[ch]
	* app/layer.[ch]:

	- Removed all "typedef drawable_function gimp_drawable_function".
	- Renamed all *_get_ID() functions to *_get_by_ID().
	- For symmetry reasons, renamed drawable_ID() to gimp_drawable_get_ID().
	- Removed the *_get_ID() functions of GimpLayer, GimpLayerMask
	  and GimpChannel.

	* app/airbrush.c
	* app/bezier_select.c
	* app/blend.c
	* app/brightness_contrast.c
	* app/bucket_fill.c
	* app/by_color_select.c
	* app/clone.c
	* app/color_balance.c
	* app/color_picker.c
	* app/convert.c
	* app/convolve.c
	* app/crop.c
	* app/curves.c
	* app/desaturate.c
	* app/dodgeburn.c
	* app/edit_selection.c
	* app/eraser.c
	* app/fileops.c
	* app/flip_tool.c
	* app/floating_sel.c
	* app/fuzzy_select.c
	* app/gimage.c
	* app/gimage_mask.c
	* app/gimphistogram.c
	* app/gimpimage.c
	* app/global_edit.c
	* app/histogram_tool.c
	* app/hue_saturation.c
	* app/image_map.c
	* app/ink.c
	* app/invert.c
	* app/layer_select.c
	* app/layers_dialog.c
	* app/levels.c
	* app/paint_core.c
	* app/paintbrush.c
	* app/pencil.c
	* app/plug_in.c
	* app/posterize.c
	* app/scan_convert.c
	* app/smudge.c
	* app/text_tool.c
	* app/threshold.c
	* app/transform_core.c
	* app/undo.c
	* app/undo_history.c

	* app/channel_cmds.c
	* app/channel_ops_cmds.c
	* app/color_cmds.c
	* app/display_cmds.c
	* app/drawable_cmds.c
	* app/edit_cmds.c
	* app/floating_sel_cmds.c
	* app/image_cmds.c
	* app/layer_cmds.c
	* app/parasite_cmds.c
	* app/selection_cmds.c
	* app/text_tool_cmds.c
	* app/tools_cmds.c
	* libgimp/gimpdrawable_pdb.c
	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/channel_ops.pdb
	* tools/pdbgen/pdb/color.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/selection.pdb
	* tools/pdbgen/pdb/tools.pdb: changed accordingly.
parent 70c1ecfd
2001-01-14 Michael Natterer <mitch@gimp.org>
* app/channel.[ch]
* app/drawable.[ch]
* app/gdisplay.[ch]
* app/gimpdrawable.[ch]
* app/layer.[ch]:
- Removed all "typedef drawable_function gimp_drawable_function".
- Renamed all *_get_ID() functions to *_get_by_ID().
- For symmetry reasons, renamed drawable_ID() to gimp_drawable_get_ID().
- Removed the *_get_ID() functions of GimpLayer, GimpLayerMask
and GimpChannel.
* app/airbrush.c
* app/bezier_select.c
* app/blend.c
* app/brightness_contrast.c
* app/bucket_fill.c
* app/by_color_select.c
* app/clone.c
* app/color_balance.c
* app/color_picker.c
* app/convert.c
* app/convolve.c
* app/crop.c
* app/curves.c
* app/desaturate.c
* app/dodgeburn.c
* app/edit_selection.c
* app/eraser.c
* app/fileops.c
* app/flip_tool.c
* app/floating_sel.c
* app/fuzzy_select.c
* app/gimage.c
* app/gimage_mask.c
* app/gimphistogram.c
* app/gimpimage.c
* app/global_edit.c
* app/histogram_tool.c
* app/hue_saturation.c
* app/image_map.c
* app/ink.c
* app/invert.c
* app/layer_select.c
* app/layers_dialog.c
* app/levels.c
* app/paint_core.c
* app/paintbrush.c
* app/pencil.c
* app/plug_in.c
* app/posterize.c
* app/scan_convert.c
* app/smudge.c
* app/text_tool.c
* app/threshold.c
* app/transform_core.c
* app/undo.c
* app/undo_history.c
* app/channel_cmds.c
* app/channel_ops_cmds.c
* app/color_cmds.c
* app/display_cmds.c
* app/drawable_cmds.c
* app/edit_cmds.c
* app/floating_sel_cmds.c
* app/image_cmds.c
* app/layer_cmds.c
* app/parasite_cmds.c
* app/selection_cmds.c
* app/text_tool_cmds.c
* app/tools_cmds.c
* libgimp/gimpdrawable_pdb.c
* tools/pdbgen/pdb.pl
* tools/pdbgen/pdb/channel_ops.pdb
* tools/pdbgen/pdb/color.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/selection.pdb
* tools/pdbgen/pdb/tools.pdb: changed accordingly.
2001-01-14 Sven Neumann <sven@gimp.org>
* libgimp/gimpcolor.[ch]: added GimpHSV type and functions and
......
......@@ -81,7 +81,7 @@
#include "app_procs.h"
#include "appenv.h"
#include "brush_select.h" /* Need for closing dialogs */
#include "brush_select.h"
#include "drawable.h"
#include "datafiles.h"
#include "errors.h"
......@@ -92,7 +92,7 @@
#include "gimprc.h"
#include "gradient_select.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
#include "pattern_select.h"
#include "plug_in.h"
#include "tile.h"
#include "tile_manager.h"
......@@ -1370,7 +1370,7 @@ plug_in_repeat (gboolean with_interface)
/* initialize the first three plug-in arguments */
args[0].value.pdb_int = (with_interface ? RUN_INTERACTIVE : RUN_WITH_LAST_VALS);
args[1].value.pdb_int = pdb_image_to_id (gdisplay->gimage);
args[2].value.pdb_int = drawable_ID (gimp_image_active_drawable (gdisplay->gimage));
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
/* run the plug-in procedure */
plug_in_run (last_plug_in, args, 3, FALSE, TRUE, gdisplay->ID);
......@@ -1594,9 +1594,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req)
tile_info = msg.data;
if (tile_info->shadow)
tm = drawable_shadow (drawable_get_ID (tile_info->drawable_ID));
tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_info->drawable_ID));
else
tm = drawable_data (drawable_get_ID (tile_info->drawable_ID));
tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_info->drawable_ID));
if (!tm)
{
......@@ -1631,9 +1631,9 @@ plug_in_handle_tile_req (GPTileReq *tile_req)
else
{
if (tile_req->shadow)
tm = drawable_shadow (drawable_get_ID (tile_req->drawable_ID));
tm = gimp_drawable_shadow (gimp_drawable_get_by_ID (tile_req->drawable_ID));
else
tm = drawable_data (drawable_get_ID (tile_req->drawable_ID));
tm = gimp_drawable_data (gimp_drawable_get_by_ID (tile_req->drawable_ID));
if (!tm)
{
......@@ -2633,7 +2633,7 @@ plug_in_callback (GtkWidget *widget,
/* initialize the first 3 plug-in arguments */
args[0].value.pdb_int = RUN_INTERACTIVE;
args[1].value.pdb_int = pdb_image_to_id (gdisplay->gimage);
args[2].value.pdb_int = drawable_ID (gimp_image_active_drawable (gdisplay->gimage));
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
argc = 3;
}
else
......@@ -2656,7 +2656,7 @@ plug_in_callback (GtkWidget *widget,
gdisp_ID = gdisplay->ID;
args[1].value.pdb_int = pdb_image_to_id (gdisplay->gimage);
args[2].value.pdb_int = drawable_ID (gimp_image_active_drawable (gdisplay->gimage));
args[2].value.pdb_int = gimp_drawable_get_ID (gimp_image_active_drawable (gdisplay->gimage));
argc = 3;
}
else
......@@ -3511,8 +3511,8 @@ plug_in_progress_init (PlugIn *plug_in,
if (!message)
message = plug_in->args[0];
if (gdisp_ID > 0)
gdisp = gdisplay_get_ID(gdisp_ID);
if (gdisp_ID > 0)
gdisp = gdisplay_get_by_ID (gdisp_ID);
if (plug_in->progress)
plug_in->progress = progress_restart (plug_in->progress, message,
......
......@@ -316,7 +316,7 @@ airbrush_motion (PaintCore *paint_core,
if (!drawable)
return;
if (! (gimage = drawable_gimage (drawable)))
if (! (gimage = gimp_drawable_gimage (drawable)))
return;
if (pressure_options->size)
......
......@@ -229,7 +229,7 @@ color_balance_initialize (GDisplay *gdisp)
{
gint i;
if (! drawable_color (gimp_image_active_drawable (gdisp->gimage)))
if (! gimp_drawable_is_rgb (gimp_image_active_drawable (gdisp->gimage)))
{
g_message (_("Color balance operates only on RGB color drawables."));
return;
......
......@@ -240,7 +240,7 @@ curves_colour_update (Tool *tool,
if (!tool || tool->state != ACTIVE)
return;
drawable_offsets (drawable, &offx, &offy);
gimp_drawable_offsets (drawable, &offx, &offy);
x -= offx;
y -= offy;
......@@ -333,7 +333,7 @@ curves_button_press (Tool *tool,
tool->drawable = drawable;
curves_dialog->drawable = drawable;
curves_dialog->color = drawable_color (drawable);
curves_dialog->color = gimp_drawable_is_rgb (drawable);
curves_dialog->image_map = image_map_create (gdisp, drawable);
}
......@@ -474,7 +474,7 @@ curves_initialize (GDisplay *gdisp)
{
gint i, j;
if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage)))
if (gimp_drawable_is_indexed (gimp_image_active_drawable (gdisp->gimage)))
{
g_message (_("Curves for indexed drawables cannot be adjusted."));
return;
......@@ -498,11 +498,11 @@ curves_initialize (GDisplay *gdisp)
}
curves_dialog->drawable = gimp_image_active_drawable (gdisp->gimage);
curves_dialog->color = drawable_color (curves_dialog->drawable);
curves_dialog->color = gimp_drawable_is_rgb (curves_dialog->drawable);
curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable);
/* check for alpha channel */
if (drawable_has_alpha (curves_dialog->drawable))
if (gimp_drawable_has_alpha (curves_dialog->drawable))
gtk_widget_set_sensitive (channel_items[4], TRUE);
else
gtk_widget_set_sensitive (channel_items[4], FALSE);
......
......@@ -359,7 +359,7 @@ gimp_histogram_calculate_drawable (GimpHistogram *histogram,
gint off_x, off_y;
gboolean no_mask;
no_mask = (drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2) == FALSE);
no_mask = (gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2) == FALSE);
pixel_region_init (&region, gimp_drawable_data (drawable), x1, y1,
(x2 - x1), (y2 - y1), FALSE);
......@@ -371,7 +371,7 @@ gimp_histogram_calculate_drawable (GimpHistogram *histogram,
gimage = gimp_drawable_gimage (drawable);
sel_mask = gimp_image_get_mask (gimage);
drawable_offsets (drawable, &off_x, &off_y);
gimp_drawable_offsets (drawable, &off_x, &off_y);
pixel_region_init (&mask, gimp_drawable_data (GIMP_DRAWABLE (sel_mask)),
x1 + off_x, y1 + off_y, (x2 - x1), (y2 - y1), FALSE);
gimp_histogram_calculate (histogram, &region, &mask);
......
......@@ -304,7 +304,7 @@ hue_saturation_initialize (GDisplay *gdisp)
{
gint i;
if (! drawable_color (gimp_image_active_drawable (gdisp->gimage)))
if (! gimp_drawable_is_rgb (gimp_image_active_drawable (gdisp->gimage)))
{
g_message (_("Hue-Saturation operates only on RGB color drawables."));
return;
......
......@@ -234,7 +234,7 @@ tools_free_threshold (Tool *tool)
void
threshold_initialize (GDisplay *gdisp)
{
if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage)))
if (gimp_drawable_is_indexed (gimp_image_active_drawable (gdisp->gimage)))
{
g_message (_("Threshold does not operate on indexed drawables."));
return;
......@@ -251,7 +251,7 @@ threshold_initialize (GDisplay *gdisp)
threshold_dialog->high_threshold = 255;
threshold_dialog->drawable = gimp_image_active_drawable (gdisp->gimage);
threshold_dialog->color = drawable_color (threshold_dialog->drawable);
threshold_dialog->color = gimp_drawable_is_rgb (threshold_dialog->drawable);
threshold_dialog->image_map =
image_map_create (gdisp, threshold_dialog->drawable);
......
......@@ -3460,7 +3460,7 @@ bezier_stroke (BezierSelect *bezier_sel,
return_vals =
procedural_db_run_proc (tool_active_PDB_string (),
&nreturn_vals,
PDB_DRAWABLE, drawable_ID (drawable),
PDB_DRAWABLE, gimp_drawable_get_ID (drawable),
PDB_INT32, (gint32) rpnts->num_stroke_points * 2,
PDB_FLOATARRAY, rpnts->stroke_points,
PDB_END);
......
......@@ -493,7 +493,7 @@ blend_button_press (Tool *tool,
blend_tool = (BlendTool *) tool->private;
switch (drawable_type (gimp_image_active_drawable (gdisp->gimage)))
switch (gimp_drawable_type (gimp_image_active_drawable (gdisp->gimage)))
{
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
g_message (_("Blend: Invalid for indexed images."));
......@@ -698,7 +698,7 @@ blend_cursor_update (Tool *tool,
GdkEventMotion *mevent,
GDisplay *gdisp)
{
switch (drawable_type (gimp_image_active_drawable (gdisp->gimage)))
switch (gimp_drawable_type (gimp_image_active_drawable (gdisp->gimage)))
{
case INDEXED_GIMAGE:
case INDEXEDA_GIMAGE:
......@@ -831,10 +831,10 @@ blend (GImage *gimage,
gimp_add_busy_cursors();
has_selection = drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
has_selection = gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
has_alpha = drawable_has_alpha (drawable);
bytes = drawable_bytes (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
bytes = gimp_drawable_bytes (drawable);
/* Always create an alpha temp buf (for generality) */
if (! has_alpha)
......@@ -1245,12 +1245,12 @@ gradient_precalc_shapeburst (GImage *gimage,
gint x1, y1, x2, y2;
gint offx, offy;
drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
drawable_offsets (drawable, &offx, &offy);
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
gimp_drawable_offsets (drawable, &offx, &offy);
/* the selection mask */
mask = gimp_image_get_mask (gimage);
pixel_region_init (&maskR, drawable_data (GIMP_DRAWABLE(mask)),
pixel_region_init (&maskR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
x1 + offx, y1 + offy, (x2 - x1), (y2 - y1), FALSE);
/* copy the mask to the temp mask */
......@@ -1260,11 +1260,11 @@ gradient_precalc_shapeburst (GImage *gimage,
else
{
/* If the intended drawable has an alpha channel, use that */
if (drawable_has_alpha (drawable))
if (gimp_drawable_has_alpha (drawable))
{
PixelRegion drawableR;
pixel_region_init (&drawableR, drawable_data (drawable),
pixel_region_init (&drawableR, gimp_drawable_data (drawable),
PR->x, PR->y, PR->w, PR->h, FALSE);
extract_alpha_region (&drawableR, NULL, &tempR);
......
......@@ -176,7 +176,7 @@ tools_free_brightness_contrast (Tool *tool)
void
brightness_contrast_initialize (GDisplay *gdisp)
{
if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage)))
if (gimp_drawable_is_indexed (gimp_image_active_drawable (gdisp->gimage)))
{
g_message (_("Brightness-Contrast does not operate on indexed drawables."));
return;
......
......@@ -255,7 +255,7 @@ bucket_fill_button_release (Tool *tool,
return_vals =
procedural_db_run_proc ("gimp_bucket_fill",
&nreturn_vals,
PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gdisp->gimage)),
PDB_DRAWABLE, gimp_drawable_get_ID (gimp_image_active_drawable (gdisp->gimage)),
PDB_INT32, (gint32) bucket_options->fill_mode,
PDB_INT32, (gint32) gimp_context_get_paint_mode (NULL),
PDB_FLOAT, (gdouble) gimp_context_get_opacity (NULL) * 100,
......@@ -291,11 +291,11 @@ bucket_fill_cursor_update (Tool *tool,
&x, &y, FALSE, FALSE);
if ((layer = gimp_image_get_active_layer (gdisp->gimage)))
{
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gimp_drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
if (x >= off_x && y >= off_y &&
x < (off_x + drawable_width (GIMP_DRAWABLE (layer))) &&
y < (off_y + drawable_height (GIMP_DRAWABLE (layer))))
x < (off_x + gimp_drawable_width (GIMP_DRAWABLE (layer))) &&
y < (off_y + gimp_drawable_height (GIMP_DRAWABLE (layer))))
{
/* One more test--is there a selected region?
* if so, is cursor inside?
......@@ -396,15 +396,17 @@ bucket_fill (GimpImage *gimage,
/* If the pattern doesn't match the image in terms of color type,
* transform it. (ie pattern is RGB, image is indexed)
*/
if (((pattern->mask->bytes == 3) && !drawable_color (drawable)) ||
((pattern->mask->bytes == 1) && !drawable_gray (drawable)))
if (((pattern->mask->bytes == 3) && !gimp_drawable_is_rgb (drawable)) ||
((pattern->mask->bytes == 1) && !gimp_drawable_is_gray (drawable)))
{
int size;
if ((pattern->mask->bytes == 1) && drawable_color (drawable))
pat_buf = temp_buf_new (pattern->mask->width, pattern->mask->height, 3, 0, 0, NULL);
if ((pattern->mask->bytes == 1) && gimp_drawable_is_rgb (drawable))
pat_buf = temp_buf_new (pattern->mask->width, pattern->mask->height,
3, 0, 0, NULL);
else
pat_buf = temp_buf_new (pattern->mask->width, pattern->mask->height, 1, 0, 0, NULL);
pat_buf = temp_buf_new (pattern->mask->width, pattern->mask->height,
1, 0, 0, NULL);
d1 = temp_buf_data (pattern->mask);
d2 = temp_buf_data (pat_buf);
......@@ -426,13 +428,13 @@ bucket_fill (GimpImage *gimage,
gimp_add_busy_cursors ();
bytes = drawable_bytes (drawable);
has_alpha = drawable_has_alpha (drawable);
bytes = gimp_drawable_bytes (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
/* If there is no selection mask, the do a seed bucket
* fill...To do this, calculate a new contiguous region
*/
if (! drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2))
if (! gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2))
{
mask = find_contiguous_region (gimage, drawable, TRUE, (int) threshold,
(int) x, (int) y, sample_merged);
......@@ -445,13 +447,13 @@ bucket_fill (GimpImage *gimage,
gint off_x, off_y;
/* Limit the channel bounds to the drawable's extents */
drawable_offsets (drawable, &off_x, &off_y);
x1 = CLAMP (x1, off_x, (off_x + drawable_width (drawable)));
y1 = CLAMP (y1, off_y, (off_y + drawable_height (drawable)));
x2 = CLAMP (x2, off_x, (off_x + drawable_width (drawable)));
y2 = CLAMP (y2, off_y, (off_y + drawable_height (drawable)));
gimp_drawable_offsets (drawable, &off_x, &off_y);
x1 = CLAMP (x1, off_x, (off_x + gimp_drawable_width (drawable)));
y1 = CLAMP (y1, off_y, (off_y + gimp_drawable_height (drawable)));
x2 = CLAMP (x2, off_x, (off_x + gimp_drawable_width (drawable)));
y2 = CLAMP (y2, off_y, (off_y + gimp_drawable_height (drawable)));
pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE (mask)),
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
/* translate mask bounds to drawable coords */
......@@ -461,7 +463,7 @@ bucket_fill (GimpImage *gimage,
y2 -= off_y;
}
else
pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE (mask)),
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
x1, y1, (x2 - x1), (y2 - y1), TRUE);
/* if the gimage doesn't have an alpha channel,
......
......@@ -255,14 +255,14 @@ by_color_select_color (GImage *gimage,
}
else
{
bytes = drawable_bytes (drawable);
d_type = drawable_type (drawable);
has_alpha = drawable_has_alpha (drawable);
indexed = drawable_indexed (drawable);
width = drawable_width (drawable);
height = drawable_height (drawable);
pixel_region_init (&imagePR, drawable_data (drawable),
bytes = gimp_drawable_bytes (drawable);
d_type = gimp_drawable_type (drawable);
has_alpha = gimp_drawable_has_alpha (drawable);
indexed = gimp_drawable_is_indexed (drawable);
width = gimp_drawable_width (drawable);
height = gimp_drawable_height (drawable);
pixel_region_init (&imagePR, gimp_drawable_data (drawable),
0, 0, width, height, FALSE);
}
......@@ -279,7 +279,7 @@ by_color_select_color (GImage *gimage,
alpha = bytes - 1;
mask = channel_new_mask (gimage, width, height);
pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE(mask)),
pixel_region_init (&maskPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
0, 0, width, height, TRUE);
/* iterate over the entire image */
......@@ -353,7 +353,9 @@ by_color_select (GImage *gimage,
off_x = 0; off_y = 0;
}
else
drawable_offsets (drawable, &off_x, &off_y);
{
gimp_drawable_offsets (drawable, &off_x, &off_y);
}
if (feather)
channel_feather (new_mask, gimp_image_get_mask (gimage),
......@@ -910,20 +912,20 @@ by_color_select_render (ByColorDialog *bcd,
gint scale;
mask = gimp_image_get_mask (gimage);
if ((drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) ||
(drawable_height (GIMP_DRAWABLE(mask)) > PREVIEW_HEIGHT))
if ((gimp_drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) ||
(gimp_drawable_height (GIMP_DRAWABLE(mask)) > PREVIEW_HEIGHT))
{
if (((float) drawable_width (GIMP_DRAWABLE (mask)) / (float) PREVIEW_WIDTH) >
((float) drawable_height (GIMP_DRAWABLE (mask)) / (float) PREVIEW_HEIGHT))
if (((float) gimp_drawable_width (GIMP_DRAWABLE (mask)) / (float) PREVIEW_WIDTH) >
((float) gimp_drawable_height (GIMP_DRAWABLE (mask)) / (float) PREVIEW_HEIGHT))
{
width = PREVIEW_WIDTH;
height = ((drawable_height (GIMP_DRAWABLE (mask)) * PREVIEW_WIDTH) /
drawable_width (GIMP_DRAWABLE (mask)));
height = ((gimp_drawable_height (GIMP_DRAWABLE (mask)) * PREVIEW_WIDTH) /
gimp_drawable_width (GIMP_DRAWABLE (mask)));
}
else
{
width = ((drawable_width (GIMP_DRAWABLE (mask)) * PREVIEW_HEIGHT) /
drawable_height (GIMP_DRAWABLE (mask)));
width = ((gimp_drawable_width (GIMP_DRAWABLE (mask)) * PREVIEW_HEIGHT) /
gimp_drawable_height (GIMP_DRAWABLE (mask)));
height = PREVIEW_HEIGHT;
}
......@@ -931,8 +933,8 @@ by_color_select_render (ByColorDialog *bcd,
}
else
{
width = drawable_width (GIMP_DRAWABLE (mask));
height = drawable_height (GIMP_DRAWABLE (mask));
width = gimp_drawable_width (GIMP_DRAWABLE (mask));
height = gimp_drawable_height (GIMP_DRAWABLE (mask));
scale = FALSE;
}
......@@ -956,14 +958,14 @@ by_color_select_render (ByColorDialog *bcd,
{
/* calculate 'acceptable' subsample */
subsample = 1;
while ((width * (subsample + 1) * 2 < drawable_width (GIMP_DRAWABLE (mask))) &&
(height * (subsample + 1) * 2 < drawable_height (GIMP_DRAWABLE (mask))))
while ((width * (subsample + 1) * 2 < gimp_drawable_width (GIMP_DRAWABLE (mask))) &&
(height * (subsample + 1) * 2 < gimp_drawable_height (GIMP_DRAWABLE (mask))))
subsample = subsample + 1;
pixel_region_init (&srcPR, drawable_data (GIMP_DRAWABLE (mask)),
pixel_region_init (&srcPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
0, 0,
drawable_width (GIMP_DRAWABLE (mask)),
drawable_height (GIMP_DRAWABLE (mask)), FALSE);
gimp_drawable_width (GIMP_DRAWABLE (mask)),
gimp_drawable_height (GIMP_DRAWABLE (mask)), FALSE);
scaled_buf = mask_buf_new (width, height);
destPR.bytes = 1;
......@@ -979,10 +981,10 @@ by_color_select_render (ByColorDialog *bcd,
}
else
{
pixel_region_init (&srcPR, drawable_data (GIMP_DRAWABLE (mask)),
pixel_region_init (&srcPR, gimp_drawable_data (GIMP_DRAWABLE (mask)),
0, 0,
drawable_width (GIMP_DRAWABLE (mask)),
drawable_height (GIMP_DRAWABLE (mask)), FALSE);
gimp_drawable_width (GIMP_DRAWABLE (mask)),
gimp_drawable_height (GIMP_DRAWABLE (mask)), FALSE);
scaled_buf = mask_buf_new (width, height);
destPR.bytes = 1;
......@@ -1063,7 +1065,7 @@ by_color_select_invert_callback (GtkWidget *widget,
return;
/* check if the image associated to the mask still exists */
if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage))))
if (! gimp_drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage))))
return;
/* invert the mask */
......@@ -1089,7 +1091,7 @@ by_color_select_select_all_callback (GtkWidget *widget,
return;
/* check if the image associated to the mask still exists */
if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage))))
if (! gimp_drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage))))
return;
/* fill the mask */
......@@ -1115,7 +1117,7 @@ by_color_select_select_none_callback (GtkWidget *widget,
return;
/* check if the image associated to the mask still exists */
if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage))))
if (! gimp_drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage))))
return;
/* reset the mask */
......@@ -1163,7 +1165,7 @@ by_color_select_preview_button_press (ByColorDialog *bcd,
drawable = gimp_image_active_drawable (bcd->gimage);
/* check if the gimage associated to the drawable still exists */
if (!drawable_gimage (drawable))
if (! gimp_drawable_gimage (drawable))
return;
/* Defaults */
......@@ -1200,13 +1202,14 @@ by_color_select_preview_button_press (ByColorDialog *bcd,
{
gint offx, offy;
drawable_offsets (drawable, &offx, &offy);
x = drawable_width (drawable) * bevent->x / bcd->preview->requisition.width - offx;
y = drawable_height (drawable) * bevent->y / bcd->preview->requisition.height - offy;
gimp_drawable_offsets (drawable, &offx, &offy);
x = gimp_drawable_width (drawable) * bevent->x / bcd->preview->requisition.width - offx;
y = gimp_drawable_height (drawable) * bevent->y / bcd->preview->requisition.height - offy;
if (x < 0 || y < 0 ||
x >= drawable_width (drawable) || y >= drawable_height (drawable))
x >= gimp_drawable_width (drawable) || y >= gimp_drawable_height (drawable))
return;
tile = tile_manager_get_tile (drawable_data (drawable), x, y, TRUE, FALSE);
tile = tile_manager_get_tile (gimp_drawable_data (drawable),
x, y, TRUE, FALSE);
col = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT);
}
......
......@@ -255,19 +255,6 @@ channel_set_opacity (Channel *channel,
channel->opacity = (gint) (opacity * 255) / 100;
}
Channel *
channel_get_ID (gint ID)
{
GimpDrawable *drawable;
drawable = drawable_get_ID (ID);
if (drawable && GIMP_IS_CHANNEL (drawable))
return GIMP_CHANNEL (drawable);
else
return NULL;
}
void
channel_delete (Channel *channel)
{
......
......@@ -111,9 +111,7 @@ const guchar * channel_get_color (const Channel *channel);
void channel_set_color (Channel *channel,
const guchar *color);
Channel * channel_get_ID (gint ID);
void channel_delete (Channel *channel);
void