moved all global variables into the GimpPaintTool structure so they have a

2002-02-13  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimppainttool.[ch]: moved all global variables into
	the GimpPaintTool structure so they have a proper lifecycle and
	it's easier to move them to the upcoming GimpPaintCore (??)
	object.

	* app/tools/gimppainttool_kernels.h
	* tools/kernelgen.c: s/SUBSAMPLE/KERNEL_SUBSAMPLE/
This commit is contained in:
Michael Natterer 2002-02-13 14:50:37 +00:00 committed by Michael Natterer
parent 1e9c264a3a
commit dac875d3f2
9 changed files with 1516 additions and 918 deletions

View File

@ -1,3 +1,13 @@
2002-02-13 Michael Natterer <mitch@gimp.org>
* app/tools/gimppainttool.[ch]: moved all global variables into
the GimpPaintTool structure so they have a proper lifecycle and
it's easier to move them to the upcoming GimpPaintCore (??)
object.
* app/tools/gimppainttool_kernels.h
* tools/kernelgen.c: s/SUBSAMPLE/KERNEL_SUBSAMPLE/
2002-02-13 Michael Natterer <mitch@gimp.org>
* app/gui/menus.c: moved "Merge Layers" and "Flatten Image" from

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,9 @@
#include "gimpdrawtool.h"
#define PAINT_TOOL_SUBSAMPLE 4
/* the different states that the painting function can be called with */
typedef enum /*< pdb-skip >*/
@ -83,6 +86,27 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl or alt is pressed */
gboolean pick_state; /* was ctrl or alt pressed when clicked? */
ToolFlags flags; /* tool flags, see ToolFlags above */
/* undo blocks variables */
TileManager *undo_tiles;
TileManager *canvas_tiles;
/* paint buffers variables */
TempBuf *orig_buf;
TempBuf *canvas_buf;
/* brush buffers */
MaskBuf *pressure_brush;
MaskBuf *solid_brush;
MaskBuf *scale_brush;
MaskBuf *scale_pixmap;
MaskBuf *kernel_brushes[PAINT_TOOL_SUBSAMPLE + 1][PAINT_TOOL_SUBSAMPLE + 1];
MaskBuf *last_brush_mask;
gboolean cache_invalid;
/* don't use this one... */
GimpBrush *grr_brush;
};
struct _GimpPaintToolClass

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,9 @@
#include "gimpdrawtool.h"
#define PAINT_TOOL_SUBSAMPLE 4
/* the different states that the painting function can be called with */
typedef enum /*< pdb-skip >*/
@ -83,6 +86,27 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl or alt is pressed */
gboolean pick_state; /* was ctrl or alt pressed when clicked? */
ToolFlags flags; /* tool flags, see ToolFlags above */
/* undo blocks variables */
TileManager *undo_tiles;
TileManager *canvas_tiles;
/* paint buffers variables */
TempBuf *orig_buf;
TempBuf *canvas_buf;
/* brush buffers */
MaskBuf *pressure_brush;
MaskBuf *solid_brush;
MaskBuf *scale_brush;
MaskBuf *scale_pixmap;
MaskBuf *kernel_brushes[PAINT_TOOL_SUBSAMPLE + 1][PAINT_TOOL_SUBSAMPLE + 1];
MaskBuf *last_brush_mask;
gboolean cache_invalid;
/* don't use this one... */
GimpBrush *grr_brush;
};
struct _GimpPaintToolClass

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,9 @@
#include "gimpdrawtool.h"
#define PAINT_TOOL_SUBSAMPLE 4
/* the different states that the painting function can be called with */
typedef enum /*< pdb-skip >*/
@ -83,6 +86,27 @@ struct _GimpPaintTool
gboolean pick_colors; /* pick color if ctrl or alt is pressed */
gboolean pick_state; /* was ctrl or alt pressed when clicked? */
ToolFlags flags; /* tool flags, see ToolFlags above */
/* undo blocks variables */
TileManager *undo_tiles;
TileManager *canvas_tiles;
/* paint buffers variables */
TempBuf *orig_buf;
TempBuf *canvas_buf;
/* brush buffers */
MaskBuf *pressure_brush;
MaskBuf *solid_brush;
MaskBuf *scale_brush;
MaskBuf *scale_pixmap;
MaskBuf *kernel_brushes[PAINT_TOOL_SUBSAMPLE + 1][PAINT_TOOL_SUBSAMPLE + 1];
MaskBuf *last_brush_mask;
gboolean cache_invalid;
/* don't use this one... */
GimpBrush *grr_brush;
};
struct _GimpPaintToolClass

View File

@ -4,9 +4,9 @@
* (threshold = 0.25)
*/
#define KERNEL_WIDTH 3
#define KERNEL_HEIGHT 3
#define SUBSAMPLE 4
#define KERNEL_WIDTH 3
#define KERNEL_HEIGHT 3
#define KERNEL_SUBSAMPLE 4
/* Brush pixel subsampling kernels */

View File

@ -89,9 +89,9 @@ main (int argc,
" * This file was generated using kernelgen as found in the tools dir.\n");
printf (" * (threshold = %g)\n", THRESHOLD);
printf (" */\n\n");
printf ("#define KERNEL_WIDTH %d\n", KERNEL_WIDTH);
printf ("#define KERNEL_HEIGHT %d\n", KERNEL_HEIGHT);
printf ("#define SUBSAMPLE %d\n", SUBSAMPLE);
printf ("#define KERNEL_WIDTH %d\n", KERNEL_WIDTH);
printf ("#define KERNEL_HEIGHT %d\n", KERNEL_HEIGHT);
printf ("#define KERNEL_SUBSAMPLE %d\n", SUBSAMPLE);
printf ("\n\n");
printf ("/* Brush pixel subsampling kernels */\n");
printf ("static const int subsample[%d][%d][%d] = {\n",