mirror of https://github.com/GNOME/gimp.git
app/Makefile.am lowlevel stuff taken out of the transform tool.
2001-03-31 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/pixel_surround.[ch]: lowlevel stuff taken out of the transform tool. * app/tools/gimpscaletool.[ch]: minor cleanups, declare gimp_scale_tool_register() publically. * app/tools/gimptransformtool.[ch]: removed the PixelSurround stuff, hardcode tr_tool->interactive to TRUE, removed the no_draw() function, register the tool options, misc. other fixes and bad hacks that need to go away. (All this non-interactive stuff needs to be done outside the tool system. A "non-interactive tool" is just pure nonsense) * app/tools/gimptool.h: spacing. * app/tools/tool_manager.c: tool_manager_register_tool_options(): return after warning, don't simply continue and crash. * app/tools/tools.c: register the bezier select tool.
This commit is contained in:
parent
c32c14552f
commit
47f987f801
24
ChangeLog
24
ChangeLog
|
@ -1,3 +1,27 @@
|
|||
2001-03-31 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/Makefile.am
|
||||
* app/pixel_surround.[ch]: lowlevel stuff taken out of the transform
|
||||
tool.
|
||||
|
||||
* app/tools/gimpscaletool.[ch]: minor cleanups, declare
|
||||
gimp_scale_tool_register() publically.
|
||||
|
||||
* app/tools/gimptransformtool.[ch]: removed the PixelSurround stuff,
|
||||
hardcode tr_tool->interactive to TRUE, removed the no_draw() function,
|
||||
register the tool options, misc. other fixes and bad hacks that need
|
||||
to go away.
|
||||
|
||||
(All this non-interactive stuff needs to be done outside the tool
|
||||
system. A "non-interactive tool" is just pure nonsense)
|
||||
|
||||
* app/tools/gimptool.h: spacing.
|
||||
|
||||
* app/tools/tool_manager.c: tool_manager_register_tool_options():
|
||||
return after warning, don't simply continue and crash.
|
||||
|
||||
* app/tools/tools.c: register the bezier select tool.
|
||||
|
||||
2001-03-30 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/devices.c
|
||||
|
|
|
@ -86,9 +86,6 @@ gimp_SOURCES = \
|
|||
errors.h \
|
||||
equalize.c \
|
||||
equalize.h \
|
||||
## fileops.c \
|
||||
## fileops.h \
|
||||
## fileopsP.h \
|
||||
file-open.c \
|
||||
file-open.h \
|
||||
file-save.c \
|
||||
|
@ -288,6 +285,8 @@ gimp_SOURCES = \
|
|||
pixel_processor.h \
|
||||
pixel_region.c \
|
||||
pixel_region.h \
|
||||
pixel_surround.c \
|
||||
pixel_surround.h \
|
||||
temp_buf.c \
|
||||
temp_buf.h \
|
||||
tile.c \
|
||||
|
|
|
@ -0,0 +1,149 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995-2001 Spencer Kimball, Peter Mattis, and others
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gimpimage.h"
|
||||
#include "pixel_region.h"
|
||||
#include "pixel_surround.h"
|
||||
#include "tile_manager.h"
|
||||
#include "tile.h"
|
||||
|
||||
|
||||
void
|
||||
pixel_surround_init (PixelSurround *ps,
|
||||
TileManager *tm,
|
||||
gint w,
|
||||
gint h,
|
||||
guchar bg[MAX_CHANNELS])
|
||||
{
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < MAX_CHANNELS; ++i)
|
||||
{
|
||||
ps->bg[i] = bg[i];
|
||||
}
|
||||
|
||||
ps->tile = NULL;
|
||||
ps->mgr = tm;
|
||||
ps->bpp = tile_manager_bpp (tm);
|
||||
ps->w = w;
|
||||
ps->h = h;
|
||||
/* make sure buffer is big enough */
|
||||
ps->buff_size = w * h * ps->bpp;
|
||||
ps->buff = g_malloc (ps->buff_size);
|
||||
ps->row_stride = 0;
|
||||
}
|
||||
|
||||
guchar *
|
||||
pixel_surround_lock (PixelSurround *ps,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
gint i, j;
|
||||
guchar *k;
|
||||
guchar *ptr;
|
||||
|
||||
ps->tile = tile_manager_get_tile (ps->mgr, x, y, TRUE, FALSE);
|
||||
|
||||
i = x % TILE_WIDTH;
|
||||
j = y % TILE_HEIGHT;
|
||||
|
||||
/* do we have the whole region? */
|
||||
if (ps->tile &&
|
||||
(i < (tile_ewidth(ps->tile) - ps->w)) &&
|
||||
(j < (tile_eheight(ps->tile) - ps->h)))
|
||||
{
|
||||
ps->row_stride = tile_ewidth (ps->tile) * ps->bpp;
|
||||
/* is this really the correct way? */
|
||||
return tile_data_pointer (ps->tile, i, j);
|
||||
}
|
||||
|
||||
/* nope, do this the hard way (for now) */
|
||||
if (ps->tile)
|
||||
{
|
||||
tile_release (ps->tile, FALSE);
|
||||
ps->tile = 0;
|
||||
}
|
||||
|
||||
/* copy pixels, one by one */
|
||||
/* no, this is not the best way, but it's much better than before */
|
||||
ptr = ps->buff;
|
||||
for (j = y; j < y+ps->h; ++j)
|
||||
{
|
||||
for (i = x; i < x+ps->w; ++i)
|
||||
{
|
||||
Tile *tile = tile_manager_get_tile (ps->mgr, i, j, TRUE, FALSE);
|
||||
|
||||
if (tile)
|
||||
{
|
||||
guchar *buff = tile_data_pointer (tile,
|
||||
i % TILE_WIDTH,
|
||||
j % TILE_HEIGHT);
|
||||
|
||||
for (k = buff; k < buff+ps->bpp; ++k, ++ptr)
|
||||
{
|
||||
*ptr = *k;
|
||||
}
|
||||
tile_release (tile, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (k = ps->bg; k < ps->bg+ps->bpp; ++k, ++ptr)
|
||||
{
|
||||
*ptr = *k;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ps->row_stride = ps->w * ps->bpp;
|
||||
|
||||
return ps->buff;
|
||||
}
|
||||
|
||||
gint
|
||||
pixel_surround_rowstride (PixelSurround *ps)
|
||||
{
|
||||
return ps->row_stride;
|
||||
}
|
||||
|
||||
void
|
||||
pixel_surround_release (PixelSurround *ps)
|
||||
{
|
||||
/* always get new tile (for now), so release the old one */
|
||||
if (ps->tile)
|
||||
{
|
||||
tile_release (ps->tile, FALSE);
|
||||
ps->tile = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
pixel_surround_clear (PixelSurround *ps)
|
||||
{
|
||||
if (ps->buff)
|
||||
{
|
||||
g_free (ps->buff);
|
||||
ps->buff = 0;
|
||||
ps->buff_size = 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PIXEL_SURROUND_H__
|
||||
#define __PIXEL_SURROUND_H__
|
||||
|
||||
|
||||
/* PixelSurround describes a (read-only)
|
||||
* region around a pixel in a tile manager
|
||||
*/
|
||||
|
||||
typedef struct _PixelSurround
|
||||
{
|
||||
Tile *tile;
|
||||
TileManager *mgr;
|
||||
guchar *buff;
|
||||
gint buff_size;
|
||||
gint bpp;
|
||||
gint w;
|
||||
gint h;
|
||||
guchar bg[MAX_CHANNELS];
|
||||
gint row_stride;
|
||||
} PixelSurround;
|
||||
|
||||
|
||||
void pixel_surround_init (PixelSurround *ps,
|
||||
TileManager *tm,
|
||||
gint w,
|
||||
gint h,
|
||||
guchar bg[MAX_CHANNELS]);
|
||||
|
||||
/* return a pointer to a buffer which contains all the surrounding pixels
|
||||
* strategy: if we are in the middle of a tile, use the tile storage
|
||||
* otherwise just copy into our own malloced buffer and return that
|
||||
*/
|
||||
guchar * pixel_surround_lock (PixelSurround *ps,
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
gint pixel_surround_rowstride (PixelSurround *ps);
|
||||
|
||||
void pixel_surround_release (PixelSurround *ps);
|
||||
|
||||
void pixel_surround_clear (PixelSurround *ps);
|
||||
|
||||
|
||||
#endif /* __PIXEL_SURROUND_H__ */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,149 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995-2001 Spencer Kimball, Peter Mattis, and others
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gimpimage.h"
|
||||
#include "pixel_region.h"
|
||||
#include "pixel_surround.h"
|
||||
#include "tile_manager.h"
|
||||
#include "tile.h"
|
||||
|
||||
|
||||
void
|
||||
pixel_surround_init (PixelSurround *ps,
|
||||
TileManager *tm,
|
||||
gint w,
|
||||
gint h,
|
||||
guchar bg[MAX_CHANNELS])
|
||||
{
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < MAX_CHANNELS; ++i)
|
||||
{
|
||||
ps->bg[i] = bg[i];
|
||||
}
|
||||
|
||||
ps->tile = NULL;
|
||||
ps->mgr = tm;
|
||||
ps->bpp = tile_manager_bpp (tm);
|
||||
ps->w = w;
|
||||
ps->h = h;
|
||||
/* make sure buffer is big enough */
|
||||
ps->buff_size = w * h * ps->bpp;
|
||||
ps->buff = g_malloc (ps->buff_size);
|
||||
ps->row_stride = 0;
|
||||
}
|
||||
|
||||
guchar *
|
||||
pixel_surround_lock (PixelSurround *ps,
|
||||
gint x,
|
||||
gint y)
|
||||
{
|
||||
gint i, j;
|
||||
guchar *k;
|
||||
guchar *ptr;
|
||||
|
||||
ps->tile = tile_manager_get_tile (ps->mgr, x, y, TRUE, FALSE);
|
||||
|
||||
i = x % TILE_WIDTH;
|
||||
j = y % TILE_HEIGHT;
|
||||
|
||||
/* do we have the whole region? */
|
||||
if (ps->tile &&
|
||||
(i < (tile_ewidth(ps->tile) - ps->w)) &&
|
||||
(j < (tile_eheight(ps->tile) - ps->h)))
|
||||
{
|
||||
ps->row_stride = tile_ewidth (ps->tile) * ps->bpp;
|
||||
/* is this really the correct way? */
|
||||
return tile_data_pointer (ps->tile, i, j);
|
||||
}
|
||||
|
||||
/* nope, do this the hard way (for now) */
|
||||
if (ps->tile)
|
||||
{
|
||||
tile_release (ps->tile, FALSE);
|
||||
ps->tile = 0;
|
||||
}
|
||||
|
||||
/* copy pixels, one by one */
|
||||
/* no, this is not the best way, but it's much better than before */
|
||||
ptr = ps->buff;
|
||||
for (j = y; j < y+ps->h; ++j)
|
||||
{
|
||||
for (i = x; i < x+ps->w; ++i)
|
||||
{
|
||||
Tile *tile = tile_manager_get_tile (ps->mgr, i, j, TRUE, FALSE);
|
||||
|
||||
if (tile)
|
||||
{
|
||||
guchar *buff = tile_data_pointer (tile,
|
||||
i % TILE_WIDTH,
|
||||
j % TILE_HEIGHT);
|
||||
|
||||
for (k = buff; k < buff+ps->bpp; ++k, ++ptr)
|
||||
{
|
||||
*ptr = *k;
|
||||
}
|
||||
tile_release (tile, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (k = ps->bg; k < ps->bg+ps->bpp; ++k, ++ptr)
|
||||
{
|
||||
*ptr = *k;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ps->row_stride = ps->w * ps->bpp;
|
||||
|
||||
return ps->buff;
|
||||
}
|
||||
|
||||
gint
|
||||
pixel_surround_rowstride (PixelSurround *ps)
|
||||
{
|
||||
return ps->row_stride;
|
||||
}
|
||||
|
||||
void
|
||||
pixel_surround_release (PixelSurround *ps)
|
||||
{
|
||||
/* always get new tile (for now), so release the old one */
|
||||
if (ps->tile)
|
||||
{
|
||||
tile_release (ps->tile, FALSE);
|
||||
ps->tile = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
pixel_surround_clear (PixelSurround *ps)
|
||||
{
|
||||
if (ps->buff)
|
||||
{
|
||||
g_free (ps->buff);
|
||||
ps->buff = 0;
|
||||
ps->buff_size = 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PIXEL_SURROUND_H__
|
||||
#define __PIXEL_SURROUND_H__
|
||||
|
||||
|
||||
/* PixelSurround describes a (read-only)
|
||||
* region around a pixel in a tile manager
|
||||
*/
|
||||
|
||||
typedef struct _PixelSurround
|
||||
{
|
||||
Tile *tile;
|
||||
TileManager *mgr;
|
||||
guchar *buff;
|
||||
gint buff_size;
|
||||
gint bpp;
|
||||
gint w;
|
||||
gint h;
|
||||
guchar bg[MAX_CHANNELS];
|
||||
gint row_stride;
|
||||
} PixelSurround;
|
||||
|
||||
|
||||
void pixel_surround_init (PixelSurround *ps,
|
||||
TileManager *tm,
|
||||
gint w,
|
||||
gint h,
|
||||
guchar bg[MAX_CHANNELS]);
|
||||
|
||||
/* return a pointer to a buffer which contains all the surrounding pixels
|
||||
* strategy: if we are in the middle of a tile, use the tile storage
|
||||
* otherwise just copy into our own malloced buffer and return that
|
||||
*/
|
||||
guchar * pixel_surround_lock (PixelSurround *ps,
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
gint pixel_surround_rowstride (PixelSurround *ps);
|
||||
|
||||
void pixel_surround_release (PixelSurround *ps);
|
||||
|
||||
void pixel_surround_clear (PixelSurround *ps);
|
||||
|
||||
|
||||
#endif /* __PIXEL_SURROUND_H__ */
|
|
@ -35,8 +35,6 @@
|
|||
#include "tile_manager.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "pixmaps2.h"
|
||||
|
||||
#include "tools/tool_options.h"
|
||||
#include "tools/gimptool.h"
|
||||
#include "tools/gimpdrawtool.h"
|
||||
|
@ -48,6 +46,8 @@
|
|||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps2.h"
|
||||
|
||||
|
||||
/* forward function declarations */
|
||||
static TileManager * gimp_scale_tool_transform (GimpTransformTool *tool,
|
||||
|
@ -65,7 +65,7 @@ static void gimp_scale_tool_unit_changed (GtkWidget *widget,
|
|||
gpointer data);
|
||||
static void gimp_scale_tool_class_init (GimpScaleToolClass *klass);
|
||||
|
||||
static void gimp_scale_tool_init (GimpScaleTool *sc_tool);
|
||||
static void gimp_scale_tool_init (GimpScaleTool *sc_tool);
|
||||
|
||||
|
||||
/* storage for information dialog fields */
|
||||
|
@ -79,6 +79,7 @@ static gchar y_ratio_buf[MAX_INFO_BUF];
|
|||
static GtkWidget *sizeentry = NULL;
|
||||
static GimpTransformToolClass *parent_class = NULL;
|
||||
|
||||
|
||||
void
|
||||
gimp_scale_tool_register (void)
|
||||
{
|
||||
|
@ -90,7 +91,7 @@ gimp_scale_tool_register (void)
|
|||
N_("/Tools/Color Picker"), "<shift>T",
|
||||
NULL, "tools/transform.html",
|
||||
(const gchar **) scale_bits);
|
||||
}
|
||||
}
|
||||
|
||||
GtkType
|
||||
gimp_scale_tool_get_type (void)
|
||||
|
@ -136,14 +137,13 @@ gimp_scale_tool_class_init (GimpScaleToolClass *klass)
|
|||
static void
|
||||
gimp_scale_tool_init (GimpScaleTool *sc_tool)
|
||||
{
|
||||
/*GimpTool *tool;*/
|
||||
GimpTool *tool;
|
||||
GimpTransformTool *tr_tool;
|
||||
|
||||
/* tool = GIMP_TOOL (sc_tool); */
|
||||
tool = GIMP_TOOL (sc_tool);
|
||||
tr_tool = GIMP_TRANSFORM_TOOL (sc_tool);
|
||||
|
||||
/* FIXME! tool->tool_cursor = GIMP_RESIZE_TOOL_CURSOR; */
|
||||
|
||||
tool->tool_cursor = GIMP_RESIZE_TOOL_CURSOR;
|
||||
|
||||
/* set the scale specific transformation attributes */
|
||||
tr_tool->trans_info[X0] = 0.0;
|
||||
|
@ -291,9 +291,9 @@ gimp_scale_tool_info_update (GimpScaleTool *sc_tool)
|
|||
|
||||
static GimpUnit label_unit = GIMP_UNIT_PIXEL;
|
||||
|
||||
tool = GIMP_TOOL (sc_tool);
|
||||
tr_tool = GIMP_TRANSFORM_TOOL (sc_tool);
|
||||
unit = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (sizeentry));;
|
||||
tool = GIMP_TOOL (sc_tool);
|
||||
tr_tool = GIMP_TRANSFORM_TOOL (sc_tool);
|
||||
unit = gimp_size_entry_get_unit (GIMP_SIZE_ENTRY (sizeentry));;
|
||||
|
||||
/* Find original sizes */
|
||||
x1 = tr_tool->x1;
|
||||
|
@ -362,7 +362,7 @@ gimp_scale_tool_size_changed (GtkWidget *widget,
|
|||
tr_tool = GIMP_TRANSFORM_TOOL(tool);
|
||||
dr_tool = GIMP_DRAW_TOOL(tool);
|
||||
|
||||
width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
width = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 0));
|
||||
height = RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (widget), 1));
|
||||
|
||||
if ((width != (tr_tool->trans_info[X1] -
|
||||
|
@ -385,12 +385,12 @@ static void
|
|||
gimp_scale_tool_unit_changed (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
gimp_scale_tool_info_update (GIMP_SCALE_TOOL(data));
|
||||
gimp_scale_tool_info_update (GIMP_SCALE_TOOL (data));
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_scale_tool_motion (GimpScaleTool *sc_tool,
|
||||
GDisplay *gdisp)
|
||||
gimp_scale_tool_motion (GimpScaleTool *sc_tool,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpTransformTool *tr_tool;
|
||||
gdouble ratio;
|
||||
|
@ -439,7 +439,9 @@ gimp_scale_tool_motion (GimpScaleTool *sc_tool,
|
|||
y2 = &tr_tool->trans_info [Y0];
|
||||
dir_x = dir_y = -1;
|
||||
break;
|
||||
default :
|
||||
case TRANSFORM_HANDLE_CENTER:
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -496,8 +498,8 @@ gimp_scale_tool_motion (GimpScaleTool *sc_tool,
|
|||
}
|
||||
|
||||
static void
|
||||
gimp_scale_tool_recalc (GimpScaleTool *sc_tool,
|
||||
GDisplay *gdisp)
|
||||
gimp_scale_tool_recalc (GimpScaleTool *sc_tool,
|
||||
GDisplay *gdisp)
|
||||
{
|
||||
GimpTransformTool *tr_tool;
|
||||
gint x1, y1, x2, y2;
|
||||
|
@ -505,7 +507,7 @@ gimp_scale_tool_recalc (GimpScaleTool *sc_tool,
|
|||
gint cx, cy;
|
||||
gdouble scalex, scaley;
|
||||
|
||||
tr_tool = GIMP_TRANSFORM_TOOL(sc_tool);
|
||||
tr_tool = GIMP_TRANSFORM_TOOL (sc_tool);
|
||||
|
||||
x1 = (int) tr_tool->trans_info [X0];
|
||||
y1 = (int) tr_tool->trans_info [Y0];
|
||||
|
@ -540,7 +542,11 @@ gimp_scale_tool_recalc (GimpScaleTool *sc_tool,
|
|||
diffx = x1 - tr_tool->x1;
|
||||
diffy = y1 - tr_tool->y1;
|
||||
break;
|
||||
default :
|
||||
case TRANSFORM_HANDLE_CENTER:
|
||||
cx = x1; cy = y1;
|
||||
diffx = diffy = 0;
|
||||
break;
|
||||
default:
|
||||
cx = x1; cy = y1;
|
||||
diffx = diffy = 0;
|
||||
break;
|
||||
|
|
|
@ -19,34 +19,40 @@
|
|||
#ifndef __GIMP_SCALE_TOOL_H__
|
||||
#define __GIMP_SCALE_TOOL_H__
|
||||
|
||||
|
||||
#include "tools/gimptransformtool.h"
|
||||
|
||||
|
||||
#define GIMP_TYPE_SCALE_TOOL (gimp_scale_tool_get_type ())
|
||||
#define GIMP_SCALE_TOOL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_SCALE_TOOL, GimpScaleTool))
|
||||
#define GIMP_IS_SCALE_TOOL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_SCALE_TOOL))
|
||||
#define GIMP_SCALE_TOOL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SCALE_TOOL, GimpScaleToolClass))
|
||||
|
||||
struct _GimpScaleTool {
|
||||
GimpTransformTool parent_instance;
|
||||
};
|
||||
|
||||
struct _GimpScaleToolClass {
|
||||
GimpTransformToolClass parent_class;
|
||||
};
|
||||
|
||||
typedef struct _GimpScaleTool GimpScaleTool;
|
||||
typedef struct _GimpScaleToolClass GimpScaleToolClass;
|
||||
|
||||
struct _GimpScaleTool
|
||||
{
|
||||
GimpTransformTool parent_instance;
|
||||
};
|
||||
|
||||
TileManager * gimp_scale_tool_scale (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
GDisplay *gdisp,
|
||||
gdouble *trans_info,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix);
|
||||
struct _GimpScaleToolClass
|
||||
{
|
||||
GimpTransformToolClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
TileManager * gimp_scale_tool_scale (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
GDisplay *gdisp,
|
||||
gdouble *trans_info,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix);
|
||||
|
||||
void gimp_scale_tool_register (void);
|
||||
GtkType gimp_scale_tool_get_type (void);
|
||||
|
||||
GtkType gimp_scale_tool_get_type (void);
|
||||
GimpTool * gimp_scale_tool_new (void);
|
||||
|
||||
#endif /* __GIMP_SCALE_TOOL_H__ */
|
||||
|
|
|
@ -108,6 +108,8 @@ struct _GimpToolClass
|
|||
GdkEventMotion *mevent,
|
||||
GDisplay *gdisp);
|
||||
};
|
||||
|
||||
|
||||
GtkType gimp_tool_get_type (void);
|
||||
|
||||
void gimp_tool_initialize (GimpTool *tool,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -94,7 +94,8 @@ struct _GimpTransformTool
|
|||
gdouble *tgrid_coords; /* transformed grid_coords */
|
||||
};
|
||||
|
||||
struct _GimpTransformToolClass {
|
||||
struct _GimpTransformToolClass
|
||||
{
|
||||
GimpDrawToolClass parent_class;
|
||||
|
||||
TileManager * (* transform) (GimpTransformTool *tool,
|
||||
|
@ -130,9 +131,9 @@ extern InfoDialog * transform_info;
|
|||
Tool * gimp_transform_tool_new (GimpTransformToolType tool_type,
|
||||
gboolean interactive);
|
||||
*/
|
||||
void gimp_transform_tool_destroy (GtkObject *tool);
|
||||
void gimp_transform_tool_draw (GimpDrawTool *tool);
|
||||
void gimp_transform_tool_no_draw (GimpDrawTool *tool);
|
||||
|
||||
GtkType gimp_transform_tool_get_type (void);
|
||||
|
||||
void gimp_transform_tool_transform_bounding_box (GimpTransformTool *tool);
|
||||
void gimp_transform_tool_reset (GimpTransformTool *tool,
|
||||
GDisplay *gdisp);
|
||||
|
@ -143,27 +144,27 @@ TileManager * gimp_transform_tool_transform (GimpTransformTool *
|
|||
TransformState state);
|
||||
/* transform functions */
|
||||
/* FIXME this function needs to be renamed */
|
||||
TileManager * gimp_transform_tool_do (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
TileManager * gimp_transform_tool_cut (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
gboolean *new_layer);
|
||||
gboolean gimp_transform_tool_paste (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *tiles,
|
||||
gboolean new_layer);
|
||||
GtkType gimp_transform_tool_get_type (void);
|
||||
gboolean gimp_transform_tool_smoothing (void);
|
||||
gboolean gimp_transform_tool_showpath (void);
|
||||
gboolean gimp_transform_tool_clip (void);
|
||||
gint gimp_transform_tool_direction (void);
|
||||
gint gimp_transform_tool_grid_size (void);
|
||||
gboolean gimp_transform_tool_show_grid (void);
|
||||
TileManager * gimp_transform_tool_do (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *float_tiles,
|
||||
gboolean interpolation,
|
||||
GimpMatrix3 matrix,
|
||||
GimpProgressFunc progress_callback,
|
||||
gpointer progress_data);
|
||||
TileManager * gimp_transform_tool_cut (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
gboolean *new_layer);
|
||||
gboolean gimp_transform_tool_paste (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
TileManager *tiles,
|
||||
gboolean new_layer);
|
||||
|
||||
gboolean gimp_transform_tool_smoothing (void);
|
||||
gboolean gimp_transform_tool_showpath (void);
|
||||
gboolean gimp_transform_tool_clip (void);
|
||||
gint gimp_transform_tool_direction (void);
|
||||
gint gimp_transform_tool_grid_size (void);
|
||||
gboolean gimp_transform_tool_show_grid (void);
|
||||
|
||||
|
||||
#endif /* __GIMP_TRANSFORM_TOOL_H__ */
|
||||
|
|
|
@ -301,6 +301,7 @@ tool_manager_register_tool_options (GtkType tool_type,
|
|||
{
|
||||
g_warning ("%s(): no tool info registered for %s",
|
||||
G_GNUC_FUNCTION, gtk_type_name (tool_type));
|
||||
return;
|
||||
}
|
||||
|
||||
tool_info->tool_options = tool_options;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "tool_manager.h"
|
||||
|
||||
#include "gimpairbrushtool.h"
|
||||
#include "gimpbezierselecttool.h"
|
||||
#include "gimpblendtool.h"
|
||||
#include "gimpbucketfilltool.h"
|
||||
#include "gimpbycolorselecttool.h"
|
||||
|
@ -93,6 +94,7 @@ register_tools (void)
|
|||
|
||||
/* selection tools */
|
||||
|
||||
gimp_bezier_select_tool_register ();
|
||||
gimp_iscissors_tool_register ();
|
||||
gimp_fuzzy_select_tool_register ();
|
||||
gimp_free_select_tool_register ();
|
||||
|
|
Loading…
Reference in New Issue