Commit 2580f0c0 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

added a progress parameter.

2005-07-29  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdrawable-foreground-extract.[ch]: added a progress
	parameter.

	* app/tools/gimpforegroundselecttool.[ch]: changed the "select"
	method to take a GimpDisplay instead of a GimpImage.

	* tools/pdbgen/pdb/drawable.pdb
	* app/tools/gimpforegroundselecttool.c: changed accordingly.

	* app/pdb/drawable_cmds.c: regenerated.
parent 7b17dfe7
2005-07-29 Sven Neumann <sven@gimp.org>
* app/core/gimpdrawable-foreground-extract.[ch]: added a progress
parameter.
* app/tools/gimpforegroundselecttool.[ch]: changed the "select"
method to take a GimpDisplay instead of a GimpImage.
* tools/pdbgen/pdb/drawable.pdb
* app/tools/gimpforegroundselecttool.c: changed accordingly.
* app/pdb/drawable_cmds.c: regenerated.
2005-07-29 Sven Neumann <sven@gimp.org>
* plug-ins/jpeg/jpeg-load.c: fixed signedness warnings.
......
......@@ -31,6 +31,9 @@
#include "gimpdrawable-foreground-extract.h"
#include "gimpimage.h"
#include "gimpimage-colormap.h"
#include "gimpprogress.h"
#include "gimp-intl.h"
/* public functions */
......@@ -38,7 +41,8 @@
void
gimp_drawable_foreground_extract (GimpDrawable *drawable,
GimpForegroundExtractMode mode,
GimpDrawable *mask)
GimpDrawable *mask,
GimpProgress *progress)
{
GimpImage *gimage;
const guchar *colormap = NULL;
......@@ -50,6 +54,8 @@ gimp_drawable_foreground_extract (GimpDrawable *drawable,
g_return_if_fail (GIMP_IS_DRAWABLE (mask));
g_return_if_fail (gimp_drawable_bytes (mask) == 1);
g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress));
gimage = gimp_item_get_image (GIMP_ITEM (drawable));
if (gimp_image_base_type (gimage) == GIMP_INDEXED)
......@@ -57,6 +63,9 @@ gimp_drawable_foreground_extract (GimpDrawable *drawable,
gimp_item_offsets (GIMP_ITEM (drawable), &x, &y);
if (progress)
gimp_progress_start (progress, _("Foreground Extraction..."), FALSE);
switch (mode)
{
case GIMP_FOREGROUND_EXTRACT_SIOX:
......@@ -72,6 +81,9 @@ gimp_drawable_foreground_extract (GimpDrawable *drawable,
g_return_if_reached ();
}
if (progress)
gimp_progress_end (progress);
gimp_drawable_update (mask,
0, 0,
gimp_item_width (GIMP_ITEM (mask)),
......
......@@ -22,7 +22,8 @@
void gimp_drawable_foreground_extract (GimpDrawable *drawable,
GimpForegroundExtractMode mode,
GimpDrawable *mask);
GimpDrawable *mask,
GimpProgress *progress);
#endif /* __GIMP_DRAWABLE_FOREGROUND_EXTRACT_H__ */
......@@ -2531,7 +2531,7 @@ drawable_foreground_extract_invoker (Gimp *gimp,
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
gimp_drawable_foreground_extract (drawable, mode, mask);
gimp_drawable_foreground_extract (drawable, mode, mask, progress);
}
return procedural_db_return_args (&drawable_foreground_extract_proc, success);
......
......@@ -29,6 +29,7 @@
#include "core/gimpchannel-select.h"
#include "core/gimpdrawable-foreground-extract.h"
#include "core/gimpimage.h"
#include "core/gimpprogress.h"
#include "core/gimpscanconvert.h"
#include "core/gimptoolinfo.h"
......@@ -66,7 +67,7 @@ static void gimp_foreground_select_tool_motion (GimpTool *tool,
static void gimp_foreground_select_tool_draw (GimpDrawTool *draw_tool);
static void gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
GimpImage *gimage);
GimpDisplay *gdisp);
static GimpFreeSelectToolClass *parent_class = NULL;
......@@ -209,9 +210,10 @@ gimp_foreground_select_tool_draw (GimpDrawTool *draw_tool)
static void
gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
GimpImage *gimage)
GimpDisplay *gdisp)
{
GimpTool *tool = GIMP_TOOL (free_sel);
GimpImage *gimage = gdisp->gimage;
GimpDrawable *drawable = gimp_image_active_drawable (gimage);
GimpScanConvert *scan_convert;
GimpChannel *mask;
......@@ -240,7 +242,8 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
gimp_drawable_foreground_extract (drawable,
GIMP_FOREGROUND_EXTRACT_SIOX,
GIMP_DRAWABLE (mask));
GIMP_DRAWABLE (mask),
GIMP_PROGRESS (gdisp));
gimp_channel_select_channel (gimp_image_get_mask (gimage),
tool->tool_info->blurb,
......
......@@ -67,7 +67,7 @@ static void gimp_free_select_tool_motion (GimpTool *tool,
static void gimp_free_select_tool_draw (GimpDrawTool *draw_tool);
static void gimp_free_select_tool_select (GimpFreeSelectTool *free_sel,
GimpImage *gimage);
GimpDisplay *gdisp);
static void gimp_free_select_tool_add_point (GimpFreeSelectTool *free_sel,
gdouble x,
......@@ -235,8 +235,7 @@ gimp_free_select_tool_button_release (GimpTool *tool,
}
else
{
GIMP_FREE_SELECT_TOOL_GET_CLASS (free_sel)->select (free_sel,
gdisp->gimage);
GIMP_FREE_SELECT_TOOL_GET_CLASS (free_sel)->select (free_sel, gdisp);
}
gimp_image_flush (gdisp->gimage);
......@@ -303,14 +302,14 @@ gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
static void
gimp_free_select_tool_select (GimpFreeSelectTool *free_sel,
GimpImage *gimage)
GimpDisplay *gdisp)
{
GimpTool *tool = GIMP_TOOL (free_sel);
GimpSelectionOptions *options;
options = GIMP_SELECTION_OPTIONS (tool->tool_info->tool_options);
gimp_channel_select_polygon (gimp_image_get_mask (gimage),
gimp_channel_select_polygon (gimp_image_get_mask (gdisp->gimage),
tool->tool_info->blurb,
free_sel->num_points,
free_sel->points,
......
......@@ -52,7 +52,7 @@ struct _GimpFreeSelectToolClass
/* virtual function */
void (* select) (GimpFreeSelectTool *free_select_tool,
GimpImage *gimage);
GimpDisplay *gdisp);
};
......
......@@ -863,7 +863,7 @@ HELP
success = gimp_item_is_attached (GIMP_ITEM (drawable));
if (success)
gimp_drawable_foreground_extract (drawable, mode, mask);
gimp_drawable_foreground_extract (drawable, mode, mask, progress);
}
CODE
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment