Michael Natterer <mitch@gimp.org>

2001-12-03  Sven Neumann  <sven@gimp.org>
	    Michael Natterer <mitch@gimp.org>

	* app/paint-funcs/paint-funcs-mmx.h: removed redefiniton of HAS_ALPHA
	macro.

	* app/core/gimp.c: reverted Daniel's change; it doesn't make the code
	simpler, only more error-prone.

	* app/gui/info-dialog.h
	* app/gui/resize-dialog.h
	* app/core/gimp.h
	* app/core/gimpbrushgenerated.h
	* app/core/gimpbrushpipe.h
	* app/core/gimpchannel.[ch]
	* app/core/gimpcontainer.h
	* app/core/gimpcoreconfig.h
	* app/core/gimpdata.h
	* app/core/gimpdatafactory.[ch]
	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable.[ch]
	* app/core/gimpimage.h
	* app/core/gimpimagefile.h
	* app/core/gimplayer.h
	* app/core/gimplayermask.h
	* app/core/gimpmoduleinfo.h
	* app/core/gimppalette.h
	* app/core/gimpundo.h
	* app/widgets/gimpbrushfactoryview.h
	* app/widgets/gimpconstrainedhwrapbox.h
	* app/widgets/gimpcontainermenu.h
	* app/widgets/gimpcontainerview.h
	* app/widgets/gimpdialogfactory.h
	* app/widgets/gimpimagedock.h
	* app/widgets/gimplistitem.h
	* app/widgets/gimpmenuitem.h
	* app/widgets/gimpnavigationpreview.h
	* app/widgets/gimppreview.h
	* app/gimprc.h
	* app/pathP.h
	* app/tools/gimpbezierselecttool.h
	* app/tools/gimpcolorbalancetool.h
	* app/tools/gimpcurvestool.h
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimpfreeselecttool.h
	* app/tools/gimphuesaturationtool.h
	* app/tools/gimpinktool-blob.h
	* app/tools/gimpinktool.h
	* app/tools/gimpiscissorstool.h
	* app/tools/gimpmagnifytool.h
	* app/tools/gimpmeasuretool.h
	* app/tools/gimppainttool.h
	* app/tools/gimppathtool.h
	* app/tools/gimprectselecttool.h
	* app/tools/gimpthresholdtool.h
	* app/tools/gimptool.h
	* app/tools/gimptransformtool.h
	* app/base/base-config.h
	* app/base/gimplut.[ch]
	* app/base/pixel-region.h
	* app/base/pixel-surround.[ch]
	* app/base/temp-buf.[ch]
	* app/base/tile-manager-private.h
	* app/base/tile-manager.[ch]
	* app/base/tile-private.h
	* app/base/tile.[ch]
	* app/display/gimpdisplay.h
	* app/display/gimpdisplayshell-selection.h
	* app/display/gimpdisplayshell.h
	* app/gui/brush-select.h
	* app/gui/gradient-editor.h
	* app/gui/gradient-select.h: reverted most of Daniel's changes.

	There's no reason to use unsigned integers here and in lots of places
	it is even wrong.

	Then it's way too early to convert gbooleans into bitfields. This
	change may make sense in a few places but can happen later when the
	API has settled and the code is more stable.

	* app/gimprc.c: reverted Daniel's change. This is a GCC-ism and this
	code is about to die soon anyway.
This commit is contained in:
Sven Neumann 2001-12-03 13:44:59 +00:00 committed by Sven Neumann
parent ae3211fee4
commit 4ba6db4e94
97 changed files with 752 additions and 593 deletions

View File

@ -1,3 +1,86 @@
2001-12-03 Sven Neumann <sven@gimp.org>
Michael Natterer <mitch@gimp.org>
* app/paint-funcs/paint-funcs-mmx.h: removed redefiniton of HAS_ALPHA
macro.
* app/core/gimp.c: reverted Daniel's change; it doesn't make the code
simpler, only more error-prone.
* app/gui/info-dialog.h
* app/gui/resize-dialog.h
* app/core/gimp.h
* app/core/gimpbrushgenerated.h
* app/core/gimpbrushpipe.h
* app/core/gimpchannel.[ch]
* app/core/gimpcontainer.h
* app/core/gimpcoreconfig.h
* app/core/gimpdata.h
* app/core/gimpdatafactory.[ch]
* app/core/gimpdrawable-blend.c
* app/core/gimpdrawable.[ch]
* app/core/gimpimage.h
* app/core/gimpimagefile.h
* app/core/gimplayer.h
* app/core/gimplayermask.h
* app/core/gimpmoduleinfo.h
* app/core/gimppalette.h
* app/core/gimpundo.h
* app/widgets/gimpbrushfactoryview.h
* app/widgets/gimpconstrainedhwrapbox.h
* app/widgets/gimpcontainermenu.h
* app/widgets/gimpcontainerview.h
* app/widgets/gimpdialogfactory.h
* app/widgets/gimpimagedock.h
* app/widgets/gimplistitem.h
* app/widgets/gimpmenuitem.h
* app/widgets/gimpnavigationpreview.h
* app/widgets/gimppreview.h
* app/gimprc.h
* app/pathP.h
* app/tools/gimpbezierselecttool.h
* app/tools/gimpcolorbalancetool.h
* app/tools/gimpcurvestool.h
* app/tools/gimpdodgeburntool.c
* app/tools/gimpfreeselecttool.h
* app/tools/gimphuesaturationtool.h
* app/tools/gimpinktool-blob.h
* app/tools/gimpinktool.h
* app/tools/gimpiscissorstool.h
* app/tools/gimpmagnifytool.h
* app/tools/gimpmeasuretool.h
* app/tools/gimppainttool.h
* app/tools/gimppathtool.h
* app/tools/gimprectselecttool.h
* app/tools/gimpthresholdtool.h
* app/tools/gimptool.h
* app/tools/gimptransformtool.h
* app/base/base-config.h
* app/base/gimplut.[ch]
* app/base/pixel-region.h
* app/base/pixel-surround.[ch]
* app/base/temp-buf.[ch]
* app/base/tile-manager-private.h
* app/base/tile-manager.[ch]
* app/base/tile-private.h
* app/base/tile.[ch]
* app/display/gimpdisplay.h
* app/display/gimpdisplayshell-selection.h
* app/display/gimpdisplayshell.h
* app/gui/brush-select.h
* app/gui/gradient-editor.h
* app/gui/gradient-select.h: reverted most of Daniel's changes.
There's no reason to use unsigned integers here and in lots of places
it is even wrong.
Then it's way too early to convert gbooleans into bitfields. This
change may make sense in a few places but can happen later when the
API has settled and the code is more stable.
* app/gimprc.c: reverted Daniel's change. This is a GCC-ism and this
code is about to die soon anyway.
2001-12-03 Daniel Egger <degger@fhm.edu>
* app/core/gimp.c: Simplified logic thanks to bitfields.

View File

@ -29,7 +29,7 @@ struct _GimpBaseConfig
guint tile_cache_size;
gboolean stingy_memory_use;
InterpolationType interpolation_type;
guint num_processors;
gint num_processors;
};

View File

@ -67,8 +67,8 @@ struct _ColorBalanceDialog
guchar g_lookup[256];
guchar b_lookup[256];
guint preserve_luminosity : 1;
guint preview : 1;
gboolean preserve_luminosity;
gboolean preview;
GimpTransferMode application_mode;
};

View File

@ -70,7 +70,7 @@ struct _CurvesDialog
gint color;
gint channel;
guint preview : 1;
gboolean preview;
gint grab_point;
gint last;

View File

@ -58,7 +58,7 @@ void
gimp_lut_setup (GimpLut *lut,
GimpLutFunc func,
void *user_data,
guint nchannels)
gint nchannels)
{
guint i, v;
gdouble val;
@ -92,7 +92,7 @@ void
gimp_lut_setup_exact (GimpLut *lut,
GimpLutFunc func,
void *user_data,
guint nchannels)
gint nchannels)
{
gimp_lut_setup (lut, func, user_data, nchannels);
}

View File

@ -25,7 +25,7 @@
struct _GimpLut
{
guchar **luts;
guint nchannels;
gint nchannels;
};
/* TODO: the GimpLutFunc should really be passed the ColorModel of the region,
@ -36,17 +36,18 @@ struct _GimpLut
* and do no correction as this will be handled by gimp_lut_setup
*/
typedef gfloat (*GimpLutFunc) (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value);
GimpLut * gimp_lut_new (void);
void gimp_lut_free (GimpLut *lut);
void gimp_lut_setup (GimpLut *lut,
GimpLutFunc func,
gpointer user_data,
guint nchannels);
gint nchannels);
/* gimp_lut_setup_exact is currently identical to gimp_lut_setup. It
* however is guaranteed to never perform any interpolation or gamma
@ -55,7 +56,7 @@ void gimp_lut_setup (GimpLut *lut,
void gimp_lut_setup_exact (GimpLut *lut,
GimpLutFunc func,
gpointer user_data,
guint nchannels);
gint nchannels);
void gimp_lut_process (GimpLut *lut,
PixelRegion *srcPR,
@ -77,4 +78,5 @@ void gimp_lut_process_2 (PixelRegion *srcPR,
PixelRegion *destPR,
GimpLut *lut);
#endif /* __GIMP_LUT_H__ */

View File

@ -77,7 +77,7 @@ struct _HueSaturationDialog
gdouble saturation[7];
HueRange hue_partition;
guint preview : 1;
gboolean preview;
};

View File

@ -27,14 +27,14 @@ struct _PixelRegion
Tile *curtile; /* current tile */
gint offx; /* tile offsets */
gint offy; /* tile offsets */
guint rowstride; /* bytes per pixel row */
gint rowstride; /* bytes per pixel row */
gint x; /* origin */
gint y; /* origin */
guint w; /* width of region */
guint h; /* height of region */
guint bytes; /* bytes per pixel */
guint dirty : 1; /* will this region be dirtied? */
guint process_count; /* used internally */
gint w; /* width of region */
gint h; /* height of region */
gint bytes; /* bytes per pixel */
gboolean dirty; /* will this region be dirtied? */
gint process_count; /* used internally */
};
struct _PixelRegionHolder
@ -43,18 +43,18 @@ struct _PixelRegionHolder
guchar *original_data;
gint startx;
gint starty;
guint count;
gint count;
};
struct _PixelRegionIterator
{
GSList *pixel_regions;
guint dirty_tiles;
guint region_width;
guint region_height;
guint portion_width;
guint portion_height;
guint process_count;
gint dirty_tiles;
gint region_width;
gint region_height;
gint portion_width;
gint portion_height;
gint process_count;
};

View File

@ -31,11 +31,11 @@
void
pixel_surround_init (PixelSurround *ps,
TileManager *tm,
guint w,
guint h,
gint w,
gint h,
guchar bg[MAX_CHANNELS])
{
guint i;
gint i;
for (i = 0; i < MAX_CHANNELS; ++i)
{
@ -55,10 +55,10 @@ pixel_surround_init (PixelSurround *ps,
guchar *
pixel_surround_lock (PixelSurround *ps,
guint x,
guint y)
gint x,
gint y)
{
guint i, j;
gint i, j;
guchar *k;
guchar *ptr;
@ -119,7 +119,7 @@ pixel_surround_lock (PixelSurround *ps,
return ps->buff;
}
guint
gint
pixel_surround_rowstride (PixelSurround *ps)
{
return ps->row_stride;

View File

@ -29,19 +29,19 @@ typedef struct _PixelSurround
Tile *tile;
TileManager *mgr;
guchar *buff;
guint buff_size;
guint bpp;
guint w;
guint h;
gint buff_size;
gint bpp;
gint w;
gint h;
guchar bg[MAX_CHANNELS];
guint row_stride;
gint row_stride;
} PixelSurround;
void pixel_surround_init (PixelSurround *ps,
TileManager *tm,
guint w,
guint h,
gint w,
gint h,
guchar bg[MAX_CHANNELS]);
/* return a pointer to a buffer which contains all the surrounding pixels
@ -49,10 +49,10 @@ void pixel_surround_init (PixelSurround *ps,
* otherwise just copy into our own malloced buffer and return that
*/
guchar * pixel_surround_lock (PixelSurround *ps,
guint x,
guint y);
gint x,
gint y);
guint pixel_surround_rowstride (PixelSurround *ps);
gint pixel_surround_rowstride (PixelSurround *ps);
void pixel_surround_release (PixelSurround *ps);

View File

@ -54,7 +54,7 @@ static void temp_buf_to_gray (TempBuf *src_buf,
/* Memory management */
static inline guchar *
static guchar *
temp_buf_allocate (guint size)
{
guchar *data;
@ -73,7 +73,7 @@ temp_buf_to_color (TempBuf *src_buf,
{
guchar *src;
guchar *dest;
gulong num_bytes;
glong num_bytes;
src = temp_buf_data (src_buf);
dest = temp_buf_data (dest_buf);
@ -97,7 +97,7 @@ temp_buf_to_gray (TempBuf *src_buf,
{
guchar *src;
guchar *dest;
gulong num_bytes;
glong num_bytes;
gfloat pix;
src = temp_buf_data (src_buf);
@ -117,20 +117,19 @@ temp_buf_to_gray (TempBuf *src_buf,
}
TempBuf *
temp_buf_new (guint width,
guint height,
guint bytes,
temp_buf_new (gint width,
gint height,
gint bytes,
gint x,
gint y,
guchar *col)
{
const gulong size = width * height * bytes;
glong i;
gint j;
guchar *data;
TempBuf *temp;
glong i;
gint j;
guchar *data;
TempBuf *temp;
g_return_val_if_fail (size > 0, NULL);
g_return_val_if_fail (width > 0 && height > 0, NULL);
temp = g_new (TempBuf, 1);
@ -142,7 +141,7 @@ temp_buf_new (guint width,
temp->swapped = FALSE;
temp->filename = NULL;
temp->data = data = temp_buf_allocate (size);
temp->data = data = temp_buf_allocate (width * height * bytes);
/* initialize the data */
if (col)
@ -198,8 +197,8 @@ temp_buf_new (guint width,
parameters into a newly allocated tempbuf */
TempBuf *
temp_buf_new_check (guint width,
guint height,
temp_buf_new_check (gint width,
gint height,
GimpCheckType check_type,
GimpCheckSize check_size)
{
@ -208,7 +207,7 @@ temp_buf_new_check (guint width,
guchar check_shift = 0;
guchar fg_color = 0;
guchar bg_color = 0;
guint i, j;
gint i, j;
g_return_val_if_fail (width > 0 && height > 0, NULL);
@ -309,16 +308,18 @@ temp_buf_copy (TempBuf *src,
TempBuf *
temp_buf_resize (TempBuf *buf,
guint bytes,
gint bytes,
gint x,
gint y,
guint width,
guint height)
gint width,
gint height)
{
/* calculate the requested size */
const gulong size = width * height * bytes;
gint size;
g_return_val_if_fail (size > 0, NULL);
g_return_val_if_fail (width > 0 && height > 0, NULL);
/* calculate the requested size */
size = width * height * bytes;
/* First, configure the canvas buffer */
if (!buf)
@ -349,11 +350,11 @@ temp_buf_resize (TempBuf *buf,
TempBuf *
temp_buf_scale (TempBuf *src,
guint new_width,
guint new_height)
gint new_width,
gint new_height)
{
guint loop1;
guint loop2;
gint loop1;
gint loop2;
gdouble x_ratio;
gdouble y_ratio;
guchar *src_data;
@ -402,8 +403,8 @@ temp_buf_copy_area (TempBuf *src,
TempBuf *dest,
gint x,
gint y,
guint width,
guint height,
gint width,
gint height,
gint dest_x,
gint dest_y)
{
@ -507,8 +508,8 @@ temp_buf_data_clear (TempBuf *temp_buf)
MaskBuf *
mask_buf_new (guint width,
guint height)
mask_buf_new (gint width,
gint height)
{
static guchar empty = 0;

View File

@ -22,48 +22,48 @@
struct _TempBuf
{
guint width;
guint height;
gint x, y; /* origin of data source */
gint bytes; /* the necessary info */
gint width;
gint height;
gint x, y; /* origin of data source */
guint bytes : 4; /* the necessary info */
guint swapped : 1; /* flag indicating whether buf is cached to disk */
gchar *filename; /* filename of cached information */
gboolean swapped; /* flag indicating whether buf is cached to disk */
gchar *filename; /* filename of cached information */
guchar *data; /* The data buffer. Do never access this field
guchar *data; /* The data buffer. Do never access this field
directly, use temp_buf_data() instead !! */
};
/* The temp buffer functions */
TempBuf * temp_buf_new (guint width,
guint height,
guint bytes,
TempBuf * temp_buf_new (gint width,
gint height,
gint bytes,
gint x,
gint y,
guchar *col);
TempBuf * temp_buf_new_check (guint width,
guint height,
TempBuf * temp_buf_new_check (gint width,
gint height,
GimpCheckType check_type,
GimpCheckSize check_size);
TempBuf * temp_buf_copy (TempBuf *src,
TempBuf *dest);
TempBuf * temp_buf_resize (TempBuf *buf,
guint bytes,
gint bytes,
gint x,
gint y,
guint width,
guint height);
gint width,
gint height);
TempBuf * temp_buf_scale (TempBuf *buf,
guint width,
guint height);
gint width,
gint height);
TempBuf * temp_buf_copy_area (TempBuf *src,
TempBuf *dest,
gint x,
gint y,
guint width,
guint height,
gint width,
gint height,
gint dest_x,
gint dest_y);
void temp_buf_free (TempBuf *buf);
@ -72,8 +72,8 @@ guchar * temp_buf_data_clear (TempBuf *buf);
/* The mask buffer functions */
MaskBuf * mask_buf_new (guint width,
guint height);
MaskBuf * mask_buf_new (gint width,
gint height);
void mask_buf_free (MaskBuf *mask_buf);
guchar * mask_buf_data (MaskBuf *mask_buf);
guchar * mask_buf_data_clear (MaskBuf *mask_buf);

View File

@ -57,14 +57,14 @@ struct _ThresholdDialog
GimpHistogramView *histogram;
GimpHistogram *hist;
GimpDrawable *drawable;
ImageMap *image_map;
GimpDrawable *drawable;
ImageMap *image_map;
gint color;
gint low_threshold;
gint high_threshold;
gint color;
gint low_threshold;
gint high_threshold;
guint preview : 1;
gboolean preview;
};

View File

@ -24,12 +24,12 @@ struct _TileManager
{
gint x, y; /* tile manager offsets */
guint width; /* the width of the tiled area */
guint height; /* the height of the tiled area */
guint bpp; /* the bpp of each tile */
gint width; /* the width of the tiled area */
gint height; /* the height of the tiled area */
gint bpp; /* the bpp of each tile */
guint ntile_rows; /* the number of tiles in each row */
guint ntile_cols; /* the number of tiles in each columns */
gint ntile_rows; /* the number of tiles in each row */
gint ntile_cols; /* the number of tiles in each columns */
Tile **tiles; /* the tiles for this level */
TileValidateProc validate_proc; /* this proc is called when an attempt
@ -45,11 +45,11 @@ struct _PixelDataHandlePrivate
{
PixelDataHandle public;
TileManager *tm;
Tile *tile;
gint x1, x2, y1, y2;
guint readable : 1;
guint writeable : 1;
guint local_buffer : 1;
gboolean readable;
gboolean writeable;
gboolean local_buffer;
Tile *tile;
};

View File

@ -32,17 +32,15 @@
#include "tile-swap.h"
static inline gboolean
tile_manager_get_tile_num (TileManager *tm,
gint xpixel,
gint ypixel,
guint *tile_num);
static gint tile_manager_get_tile_num (TileManager *tm,
gint xpixel,
gint ypixel);
TileManager *
tile_manager_new (guint toplevel_width,
guint toplevel_height,
guint bpp)
tile_manager_new (gint toplevel_width,
gint toplevel_height,
gint bpp)
{
TileManager *tm;
gint width;
@ -71,8 +69,8 @@ tile_manager_new (guint toplevel_width,
void
tile_manager_destroy (TileManager *tm)
{
guint ntiles;
guint i;
gint ntiles;
gint i;
g_return_if_fail (tm != NULL);
@ -107,14 +105,15 @@ Tile *
tile_manager_get_tile (TileManager *tm,
gint xpixel,
gint ypixel,
gboolean wantread,
gboolean wantwrite)
gint wantread,
gint wantwrite)
{
guint tile_num;
gint tile_num;
g_return_val_if_fail (tm != NULL, NULL);
if (!tile_manager_get_tile_num (tm, xpixel, ypixel, &tile_num))
tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel);
if (tile_num < 0)
return NULL;
return tile_manager_get (tm, tile_num, wantread, wantwrite);
@ -122,23 +121,23 @@ tile_manager_get_tile (TileManager *tm,
Tile *
tile_manager_get (TileManager *tm,
guint tile_num,
gboolean wantread,
gboolean wantwrite)
gint tile_num,
gint wantread,
gint wantwrite)
{
Tile **tiles;
Tile **tile_ptr;
guint ntiles;
guint nrows, ncols;
gint ntiles;
gint nrows, ncols;
gint right_tile;
gint bottom_tile;
guint i, j, k;
gint i, j, k;
g_return_val_if_fail (tm != NULL, NULL);
ntiles = tm->ntile_rows * tm->ntile_cols;
if (tile_num >= ntiles)
if ((tile_num < 0) || (tile_num >= ntiles))
return NULL;
if (!tm->tiles)
@ -176,6 +175,14 @@ tile_manager_get (TileManager *tm,
g_warning("WRITE-ONLY TILE... UNTESTED!");
}
/*
if ((*tile_ptr)->share_count &&
(*tile_ptr)->write_count)
fprintf(stderr," >> MEEPITY %d,%d << ",
(*tile_ptr)->share_count,
(*tile_ptr)->write_count
); */
if (wantread)
{
TILE_MUTEX_LOCK (*tile_ptr);
@ -225,6 +232,11 @@ tile_manager_get (TileManager *tm,
(*tile_ptr)->write_count++;
(*tile_ptr)->dirty = TRUE;
}
/* else
{
if ((*tile_ptr)->write_count)
fprintf(stderr,"STINK! r/o on r/w tile /%d\007 ",(*tile_ptr)->write_count);
} */
TILE_MUTEX_UNLOCK (*tile_ptr);
tile_lock (*tile_ptr);
}
@ -238,14 +250,16 @@ tile_manager_get_async (TileManager *tm,
gint ypixel)
{
Tile *tile_ptr;
guint tile_num;
gint tile_num;
g_return_if_fail (tm != NULL);
if (!tile_manager_get_tile_num (tm, xpixel, ypixel, &tile_num))
tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel);
if (tile_num < 0)
return;
tile_ptr = tm->tiles[tile_num];
tile_swap_in_async (tile_ptr);
}
@ -260,6 +274,17 @@ tile_manager_validate (TileManager *tm,
if (tm->validate_proc)
(* tm->validate_proc) (tm, tile);
/* DEBUG STUFF -> if (tm->user_data)
{
fprintf(stderr,"V%p ",tm->user_data);
fprintf(stderr,"V");
}
else
{
fprintf(stderr,"v");
} */
}
void
@ -295,12 +320,13 @@ tile_invalidate_tile (Tile **tile_ptr,
gint xpixel,
gint ypixel)
{
guint tile_num;
gint tile_num;
g_return_if_fail (tile_ptr != NULL);
g_return_if_fail (tm != NULL);
if (!tile_manager_get_tile_num (tm, xpixel, ypixel, &tile_num))
tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel);
if (tile_num < 0)
return;
tile_invalidate (tile_ptr, tm, tile_num);
@ -310,7 +336,7 @@ tile_invalidate_tile (Tile **tile_ptr,
void
tile_invalidate (Tile **tile_ptr,
TileManager *tm,
guint tile_num)
gint tile_num)
{
Tile *tile = *tile_ptr;
@ -364,13 +390,24 @@ tile_manager_map_tile (TileManager *tm,
gint ypixel,
Tile *srctile)
{
guint tile_num;
gint tile_row;
gint tile_col;
gint tile_num;
g_return_if_fail (tm != NULL);
g_return_if_fail (srctile != NULL);
if (!tile_manager_get_tile_num (tm, xpixel, ypixel, &tile_num))
return;
if ((xpixel < 0) || (xpixel >= tm->width) ||
(ypixel < 0) || (ypixel >= tm->height))
{
g_warning ("tile_manager_map_tile: tile co-ord out of range.");
return;
}
tile_row = ypixel / TILE_HEIGHT;
tile_col = xpixel / TILE_WIDTH;
tile_num = tile_row * tm->ntile_cols + tile_col;
tile_manager_map (tm, tile_num, srctile);
}
@ -415,6 +452,8 @@ tile_manager_map (TileManager *tm,
{
for (j = 0; j < ncols; j++, k++)
{
/* printf(",");fflush(stdout);*/
tiles[k] = g_new (Tile, 1);
tile_init (tiles[k], tm->bpp);
tile_attach (tiles[k], tm, k);
@ -426,10 +465,14 @@ tile_manager_map (TileManager *tm,
tiles[k]->eheight = bottom_tile;
}
}
/* g_warning ("tile_manager_map: empty tile level - done.");*/
}
tile_ptr = &tm->tiles[tile_num];
/* printf(")");fflush(stdout);*/
if (!srctile->valid)
g_warning("tile_manager_map: srctile not validated yet! please report.");
@ -443,31 +486,41 @@ tile_manager_map (TileManager *tm,
}
tile_detach (*tile_ptr, tm, tile_num);
/* printf(">");fflush(stdout);*/
TILE_MUTEX_LOCK (srctile);
/* printf(" [src:%p tm:%p tn:%d] ", srctile, tm, tile_num); fflush(stdout);*/
tile_attach (srctile, tm, tile_num);
*tile_ptr = srctile;
TILE_MUTEX_UNLOCK (srctile);
/* printf("}");fflush(stdout);*/
}
static inline gboolean
static gint
tile_manager_get_tile_num (TileManager *tm,
gint xpixel,
gint ypixel,
guint *tile_num)
gint ypixel)
{
guint tile_row;
guint tile_col;
gint tile_row;
gint tile_col;
gint tile_num;
g_return_val_if_fail (tm != NULL, FALSE);
g_return_val_if_fail (tm != NULL, -1);
if ((xpixel < 0) || (ypixel < 0) ||
(xpixel >= tm->width) || (ypixel >= tm->height))
return FALSE;
if ((xpixel < 0) || (xpixel >= tm->width) ||
(ypixel < 0) || (ypixel >= tm->height))
return -1;
tile_row = ypixel / TILE_HEIGHT;
tile_col = xpixel / TILE_WIDTH;
*tile_num = tile_row * tm->ntile_cols + tile_col;
return TRUE;
tile_num = tile_row * tm->ntile_cols + tile_col;
return tile_num;
}
void
@ -609,10 +662,9 @@ request_pixel_data (TileManager *tm,
pdh->public.width = w = (x2-x1)+1;
pdh->public.height = h = (y2-y1)+1;
tile_manager_get_tile_num (tm, x1, y1, &tile_num_1);
tile_manager_get_tile_num (tm, x2, y2, &tile_num_2);
tile_num_1 = tile_manager_get_tile_num (tm, x1, y1);
tile_num_2 = tile_manager_get_tile_num (tm, x2, y2);
/* FIXME: What if both nums are -1 aka inavlid? */
if (tile_num_1 == tile_num_2)
{
pdh->tile = tile_manager_get (tm, tile_num_1, wantread, wantwrite);

View File

@ -22,10 +22,10 @@
struct _PixelDataHandle
{
guchar *data;
guint width;
guint height;
guint stride;
guint bpp;
gint width;
gint height;
gint stride;
gint bpp;
};
/* Creates a new tile manager with the specified
@ -38,9 +38,9 @@ struct _PixelDataHandle
* hierarchy is "nlevels - 1". That level will be smaller
* than TILE_WIDTH x TILE_HEIGHT
*/
TileManager * tile_manager_new (guint toplevel_width,
guint toplevel_height,
guint bpp);
TileManager * tile_manager_new (gint toplevel_width,
gint toplevel_height,
gint bpp);
/* Destroy a tile manager and all the tiles it contains.
*/
@ -60,15 +60,15 @@ void tile_manager_set_validate_proc (TileManager *tm,
Tile * tile_manager_get_tile (TileManager *tm,
gint xpixel,
gint ypixel,
gboolean wantread,
gboolean wantwrite);
gint wantread,
gint wantwrite);
/* Get a specified tile from a tile manager.
*/
Tile * tile_manager_get (TileManager *tm,
guint tile_num,
gboolean wantread,
gboolean wantwrite);
gint tile_num,
gint wantread,
gint wantwrite);
/* Request that (if possible) the tile at x,y be swapped
* in. This is only a hint to improve performance; no guarantees.
@ -95,7 +95,7 @@ void tile_manager_validate (TileManager *tm,
void tile_invalidate (Tile **tile_ptr,
TileManager *tm,
guint tile_num);
gint tile_num);
void tile_invalidate_tile (Tile **tile_ptr,
TileManager *tm,
gint xpixel,

View File

@ -35,7 +35,7 @@ typedef struct _TileLink TileLink;
struct _TileLink
{
TileLink *next;
guint tile_num; /* the number of this tile within the drawable */
gint tile_num; /* the number of this tile within the drawable */
TileManager *tm; /* A pointer to the tile manager for this tile.
* We need this in order to call the tile managers
* validate proc whenever the tile is referenced
@ -45,20 +45,20 @@ struct _TileLink
struct _Tile
{
gushort ref_count; /* reference count. when the reference count is
gshort ref_count; /* reference count. when the reference count is
* non-zero then the "data" for this tile must
* be valid. when the reference count for a tile
* is 0 then the "data" for this tile must be
* NULL.
*/
gushort write_count;/* write count: number of references that are
gshort write_count; /* write count: number of references that are
for write access */
gushort share_count;/* share count: number of tile managers that
gshort share_count; /* share count: number of tile managers that
hold this tile */
guint dirty : 1; /* is the tile dirty? has it been modified? */
guint valid : 1; /* is the tile valid? */
guint bpp : 4; /* the bytes per pixel (1, 2, 3 or 4) */
guchar bpp; /* the bytes per pixel (1, 2, 3 or 4) */
gushort ewidth; /* the effective width of the tile */
gushort eheight; /* the effective height of the tile
* a tile's effective width and height may be smaller
@ -72,7 +72,7 @@ struct _Tile
* case the tile data is on disk.
*/
guint swap_num; /* the index into the file table of the file to be used
gint swap_num; /* the index into the file table of the file to be used
* for swapping. swap_num 1 is always the global
* swap file.
*/
@ -98,4 +98,5 @@ struct _Tile
#define TILE_MUTEX_UNLOCK(tile) /* nothing */
#endif
#endif /* __TILE_PRIVATE_H__ */

View File

@ -322,7 +322,7 @@ tile_mark_valid (Tile *tile)
void
tile_attach (Tile *tile,
void *tm,
guint tile_num)
gint tile_num)
{
TileLink *tmp;
@ -351,7 +351,7 @@ tile_attach (Tile *tile,
void
tile_detach (Tile *tile,
void *tm,
guint tile_num)
gint tile_num)
{
TileLink **link;
TileLink *tmp;

View File

@ -101,10 +101,10 @@ void * tile_data_pointer (Tile *tile,
void tile_attach (Tile *tile,
void *tm,
guint tile_num);
gint tile_num);
void tile_detach (Tile *tile,
void *tm,
guint tile_num);
gint tile_num);
#endif /* __TILE_H__ */

View File

@ -332,9 +332,9 @@ gimp_new (gboolean be_verbose,
gimp = g_object_new (GIMP_TYPE_GIMP, NULL);
gimp->be_verbose = be_verbose;
gimp->no_data = no_data;
gimp->no_interface = no_interface;
gimp->be_verbose = be_verbose ? TRUE : FALSE;
gimp->no_data = no_data ? TRUE : FALSE;
gimp->no_interface = no_interface ? TRUE : FALSE;
gimp->stack_trace_mode = stack_trace_mode;
return gimp;

View File

@ -48,9 +48,9 @@ struct _Gimp
GimpCoreConfig *config;
guint be_verbose : 1;
guint no_data : 1;
guint no_interface : 1;
gboolean be_verbose;
gboolean no_data;
gboolean no_interface;
GimpMessageHandlerType message_handler;
GimpStackTraceMode stack_trace_mode;
@ -67,7 +67,7 @@ struct _Gimp
guint busy_idle_id;
GList *user_units;
guint n_user_units;
gint n_user_units;
GimpParasiteList *parasites;
@ -105,7 +105,7 @@ struct _Gimp
GList *image_base_type_names;
GList *fill_type_names;
GimpImageNewValues image_new_last_values;
guint have_current_cut_buffer : 1;
gboolean have_current_cut_buffer;
/* the list of all contexts */
GList *context_list;

View File

@ -48,7 +48,7 @@ struct _GimpBrushGenerated
gfloat aspect_ratio; /* y/x */
/* private */
guint freeze;
gint freeze;
};
struct _GimpBrushGeneratedClass

View File

@ -61,7 +61,7 @@ struct _GimpBrushPipe
gint *index; /* Current index for incremental dimensions */
guint nbrushes; /* Might be less than the product of the
gint nbrushes; /* Might be less than the product of the
* ranks in some odd special case */
GimpBrush **brushes;
GimpBrush *current; /* Currently selected brush */

View File

@ -118,6 +118,7 @@ gimp_channel_init (GimpChannel *channel)
channel->y1 = 0;
channel->x2 = 0;
channel->y2 = 0;
}
static void
@ -155,8 +156,8 @@ gimp_channel_validate (TileManager *tm,
GimpChannel *
gimp_channel_new (GimpImage *gimage,
guint width,
guint height,
gint width,
gint height,
const gchar *name,
const GimpRGB *color)
{
@ -171,6 +172,7 @@ gimp_channel_new (GimpImage *gimage,
/* set the channel color and opacity */
channel->color = *color;
channel->show_masked = TRUE;
/* selection mask variables */
@ -268,17 +270,17 @@ gimp_channel_get_color (const GimpChannel *channel)
return &channel->color;
}
guint
gint
gimp_channel_get_opacity (const GimpChannel *channel)
{
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0);
return (guint) (channel->color.a * 100.999);
return (gint) (channel->color.a * 100.999);
}
void
gimp_channel_set_opacity (GimpChannel *channel,
guint opacity)
gint opacity)
{
g_return_if_fail (GIMP_IS_CHANNEL (channel));
@ -289,8 +291,8 @@ gimp_channel_set_opacity (GimpChannel *channel,
void
gimp_channel_scale (GimpChannel *channel,
guint new_width,
guint new_height)
gint new_width,
gint new_height)
{
PixelRegion srcPR, destPR;
TileManager *new_tiles;
@ -339,8 +341,8 @@ gimp_channel_scale (GimpChannel *channel,
void
gimp_channel_resize (GimpChannel *channel,
guint new_width,
guint new_height,
gint new_width,
gint new_height,
gint offx,
gint offy)
{
@ -443,8 +445,8 @@ gimp_channel_resize (GimpChannel *channel,
GimpChannel *
gimp_channel_new_mask (GimpImage *gimage,
guint width,
guint height)
gint width,
gint height)
{
GimpRGB black = { 0.0, 0.0, 0.0, 0.5 };
GimpChannel *new_channel;
@ -534,13 +536,13 @@ gimp_channel_boundary (GimpChannel *mask,
return TRUE;
}
guchar
gint
gimp_channel_value (GimpChannel *mask,
gint x,
gint y)
{
Tile *tile;
guchar val;
gint val;
g_return_val_if_fail (GIMP_IS_CHANNEL (mask), 0);
@ -739,8 +741,8 @@ void
gimp_channel_add_segment (GimpChannel *mask,
gint x,
gint y,
guint width,
guint value)
gint width,
gint value)
{
PixelRegion maskPR;
guchar *data;
@ -784,8 +786,8 @@ void
gimp_channel_sub_segment (GimpChannel *mask,
gint x,
gint y,
guint width,
guint value)
gint width,
gint value)
{
PixelRegion maskPR;
guchar *data;
@ -829,8 +831,8 @@ gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
guint w,
guint h)
gint w,
gint h)
{
gint x2, y2;
PixelRegion maskPR;
@ -891,8 +893,8 @@ gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
guint w,
guint h,
gint w,
gint h,
gboolean antialias)
{
gint i, j;
@ -1341,14 +1343,17 @@ gimp_channel_all (GimpChannel *mask)
void
gimp_channel_border (GimpChannel *mask,
guint radius_x,
guint radius_y)
gint radius_x,
gint radius_y)
{
PixelRegion bPR;
gint x1, y1, x2, y2;
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (radius_x < 0 || radius_y < 0)
return;
if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return;
if (gimp_channel_is_empty (mask))
@ -1385,8 +1390,8 @@ gimp_channel_border (GimpChannel *mask,
void
gimp_channel_grow (GimpChannel *mask,
gint radius_x,
gint radius_y)
gint radius_x,
gint radius_y)
{
PixelRegion bPR;
gint x1, y1, x2, y2;
@ -1396,15 +1401,17 @@ gimp_channel_grow (GimpChannel *mask,
if (radius_x == 0 && radius_y == 0)
return;
if (radius_x < 0 && radius_y < 0)
if (radius_x <= 0 && radius_y <= 0)
{
gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE);
return;
}
if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
if (radius_x < 0 || radius_y < 0)
return;
if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return;
if (gimp_channel_is_empty (mask))
return;
@ -1451,12 +1458,15 @@ gimp_channel_shrink (GimpChannel *mask,
if (radius_x == 0 && radius_y == 0)
return;
if (radius_x < 0 && radius_y < 0)
if (radius_x <= 0 && radius_y <= 0)
{
gimp_channel_grow (mask, -radius_x, -radius_y);
return;
}
if (radius_x < 0 || radius_y < 0)
return;
if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return;
if (gimp_channel_is_empty (mask))

View File

@ -42,17 +42,17 @@ struct _GimpChannel
GimpDrawable parent_instance;
GimpRGB color; /* Also stored the opacity */
guint show_masked; /* Show masked areas--as */
gboolean show_masked; /* Show masked areas--as */
/* opposed to selected areas */
/* Selection mask variables */
guint boundary_known : 1;/* is the current boundary valid */
guint empty : 1; /* is the region empty? */
guint bounds_known : 1; /* recalculate the bounds? */
gboolean boundary_known; /* is the current boundary valid */
BoundSeg *segs_in; /* outline of selected region */
BoundSeg *segs_out; /* outline of selected region */
guint num_segs_in; /* number of lines in boundary */
guint num_segs_out; /* number of lines in boundary */
gint num_segs_in; /* number of lines in boundary */
gint num_segs_out; /* number of lines in boundary */
gboolean empty; /* is the region empty? */
gboolean bounds_known; /* recalculate the bounds? */
gint x1, y1; /* coordinates for bounding box */
gint x2, y2; /* lower right hand coordinate */
};
@ -87,27 +87,27 @@ struct _MaskUndo
GType gimp_channel_get_type (void) G_GNUC_CONST;
GimpChannel * gimp_channel_new (GimpImage *gimage,
guint width,
guint height,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
GimpChannel * gimp_channel_copy (const GimpChannel *channel,
gboolean dummy);
guint gimp_channel_get_opacity (const GimpChannel *channel);
gint gimp_channel_get_opacity (const GimpChannel *channel);
void gimp_channel_set_opacity (GimpChannel *channel,
guint opacity);
gint opacity);
const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color);
void gimp_channel_scale (GimpChannel *channel,
guint new_width,
guint new_height);
gint new_width,
gint new_height);
void gimp_channel_resize (GimpChannel *channel,
guint new_width,
guint new_height,
gint new_width,
gint new_height,
gint offx,
gint offy);
@ -115,8 +115,8 @@ void gimp_channel_resize (GimpChannel *channel,
/* selection mask functions */
GimpChannel * gimp_channel_new_mask (GimpImage *gimage,
guint width,
guint height);
gint width,
gint height);
gboolean gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in,
BoundSeg **segs_out,
@ -131,32 +131,32 @@ gboolean gimp_channel_bounds (GimpChannel *mask,
gint *y1,
gint *x2,
gint *y2);
guchar gimp_channel_value (GimpChannel *mask,
gint gimp_channel_value (GimpChannel *mask,
gint x,
gint y);
gboolean gimp_channel_is_empty (GimpChannel *mask);
void gimp_channel_add_segment (GimpChannel *mask,
gint x,
gint y,
guint width,
guint value);
gint width,
gint value);
void gimp_channel_sub_segment (GimpChannel *mask,
gint x,
gint y,
guint width,
guint value);
gint width,
gint value);
void gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
guint w,
guint h);
gint w,
gint h);
void gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
guint w,
guint h,
gint w,
gint h,
gboolean antialias);
void gimp_channel_combine_mask (GimpChannel *mask,
GimpChannel *add_on,
@ -175,8 +175,8 @@ void gimp_channel_sharpen (GimpChannel *mask);
void gimp_channel_all (GimpChannel *mask);
void gimp_channel_border (GimpChannel *mask,
guint radius_x,
guint radius_y);
gint radius_x,
gint radius_y);
void gimp_channel_grow (GimpChannel *mask,
gint radius_x,
gint radius_y);

View File

@ -118,6 +118,7 @@ gimp_channel_init (GimpChannel *channel)
channel->y1 = 0;
channel->x2 = 0;
channel->y2 = 0;
}
static void
@ -155,8 +156,8 @@ gimp_channel_validate (TileManager *tm,
GimpChannel *
gimp_channel_new (GimpImage *gimage,
guint width,
guint height,
gint width,
gint height,
const gchar *name,
const GimpRGB *color)
{
@ -171,6 +172,7 @@ gimp_channel_new (GimpImage *gimage,
/* set the channel color and opacity */
channel->color = *color;
channel->show_masked = TRUE;
/* selection mask variables */
@ -268,17 +270,17 @@ gimp_channel_get_color (const GimpChannel *channel)
return &channel->color;
}
guint
gint
gimp_channel_get_opacity (const GimpChannel *channel)
{
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), 0);
return (guint) (channel->color.a * 100.999);
return (gint) (channel->color.a * 100.999);
}
void
gimp_channel_set_opacity (GimpChannel *channel,
guint opacity)
gint opacity)
{
g_return_if_fail (GIMP_IS_CHANNEL (channel));
@ -289,8 +291,8 @@ gimp_channel_set_opacity (GimpChannel *channel,
void
gimp_channel_scale (GimpChannel *channel,
guint new_width,
guint new_height)
gint new_width,
gint new_height)
{
PixelRegion srcPR, destPR;
TileManager *new_tiles;
@ -339,8 +341,8 @@ gimp_channel_scale (GimpChannel *channel,
void
gimp_channel_resize (GimpChannel *channel,
guint new_width,
guint new_height,
gint new_width,
gint new_height,
gint offx,
gint offy)
{
@ -443,8 +445,8 @@ gimp_channel_resize (GimpChannel *channel,
GimpChannel *
gimp_channel_new_mask (GimpImage *gimage,
guint width,
guint height)
gint width,
gint height)
{
GimpRGB black = { 0.0, 0.0, 0.0, 0.5 };
GimpChannel *new_channel;
@ -534,13 +536,13 @@ gimp_channel_boundary (GimpChannel *mask,
return TRUE;
}
guchar
gint
gimp_channel_value (GimpChannel *mask,
gint x,
gint y)
{
Tile *tile;
guchar val;
gint val;
g_return_val_if_fail (GIMP_IS_CHANNEL (mask), 0);
@ -739,8 +741,8 @@ void
gimp_channel_add_segment (GimpChannel *mask,
gint x,
gint y,
guint width,
guint value)
gint width,
gint value)
{
PixelRegion maskPR;
guchar *data;
@ -784,8 +786,8 @@ void
gimp_channel_sub_segment (GimpChannel *mask,
gint x,
gint y,
guint width,
guint value)
gint width,
gint value)
{
PixelRegion maskPR;
guchar *data;
@ -829,8 +831,8 @@ gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
guint w,
guint h)
gint w,
gint h)
{
gint x2, y2;
PixelRegion maskPR;
@ -891,8 +893,8 @@ gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
guint w,
guint h,
gint w,
gint h,
gboolean antialias)
{
gint i, j;
@ -1341,14 +1343,17 @@ gimp_channel_all (GimpChannel *mask)
void
gimp_channel_border (GimpChannel *mask,
guint radius_x,
guint radius_y)
gint radius_x,
gint radius_y)
{
PixelRegion bPR;
gint x1, y1, x2, y2;
g_return_if_fail (GIMP_IS_CHANNEL (mask));
if (radius_x < 0 || radius_y < 0)
return;
if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return;
if (gimp_channel_is_empty (mask))
@ -1385,8 +1390,8 @@ gimp_channel_border (GimpChannel *mask,
void
gimp_channel_grow (GimpChannel *mask,
gint radius_x,
gint radius_y)
gint radius_x,
gint radius_y)
{
PixelRegion bPR;
gint x1, y1, x2, y2;
@ -1396,15 +1401,17 @@ gimp_channel_grow (GimpChannel *mask,
if (radius_x == 0 && radius_y == 0)
return;
if (radius_x < 0 && radius_y < 0)
if (radius_x <= 0 && radius_y <= 0)
{
gimp_channel_shrink (mask, -radius_x, -radius_y, FALSE);
return;
}
if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
if (radius_x < 0 || radius_y < 0)
return;
if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return;
if (gimp_channel_is_empty (mask))
return;
@ -1451,12 +1458,15 @@ gimp_channel_shrink (GimpChannel *mask,
if (radius_x == 0 && radius_y == 0)
return;
if (radius_x < 0 && radius_y < 0)
if (radius_x <= 0 && radius_y <= 0)
{
gimp_channel_grow (mask, -radius_x, -radius_y);
return;
}
if (radius_x < 0 || radius_y < 0)
return;
if (! gimp_channel_bounds (mask, &x1, &y1, &x2, &y2))
return;
if (gimp_channel_is_empty (mask))

View File

@ -42,17 +42,17 @@ struct _GimpChannel
GimpDrawable parent_instance;
GimpRGB color; /* Also stored the opacity */
guint show_masked; /* Show masked areas--as */
gboolean show_masked; /* Show masked areas--as */
/* opposed to selected areas */
/* Selection mask variables */
guint boundary_known : 1;/* is the current boundary valid */
guint empty : 1; /* is the region empty? */
guint bounds_known : 1; /* recalculate the bounds? */
gboolean boundary_known; /* is the current boundary valid */
BoundSeg *segs_in; /* outline of selected region */
BoundSeg *segs_out; /* outline of selected region */
guint num_segs_in; /* number of lines in boundary */
guint num_segs_out; /* number of lines in boundary */
gint num_segs_in; /* number of lines in boundary */
gint num_segs_out; /* number of lines in boundary */
gboolean empty; /* is the region empty? */
gboolean bounds_known; /* recalculate the bounds? */
gint x1, y1; /* coordinates for bounding box */
gint x2, y2; /* lower right hand coordinate */
};
@ -87,27 +87,27 @@ struct _MaskUndo
GType gimp_channel_get_type (void) G_GNUC_CONST;
GimpChannel * gimp_channel_new (GimpImage *gimage,
guint width,
guint height,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
GimpChannel * gimp_channel_copy (const GimpChannel *channel,
gboolean dummy);
guint gimp_channel_get_opacity (const GimpChannel *channel);
gint gimp_channel_get_opacity (const GimpChannel *channel);
void gimp_channel_set_opacity (GimpChannel *channel,
guint opacity);
gint opacity);
const GimpRGB * gimp_channel_get_color (const GimpChannel *channel);
void gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color);
void gimp_channel_scale (GimpChannel *channel,
guint new_width,
guint new_height);
gint new_width,
gint new_height);
void gimp_channel_resize (GimpChannel *channel,
guint new_width,
guint new_height,
gint new_width,
gint new_height,
gint offx,
gint offy);
@ -115,8 +115,8 @@ void gimp_channel_resize (GimpChannel *channel,
/* selection mask functions */
GimpChannel * gimp_channel_new_mask (GimpImage *gimage,
guint width,
guint height);
gint width,
gint height);
gboolean gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in,
BoundSeg **segs_out,
@ -131,32 +131,32 @@ gboolean gimp_channel_bounds (GimpChannel *mask,
gint *y1,
gint *x2,
gint *y2);
guchar gimp_channel_value (GimpChannel *mask,
gint gimp_channel_value (GimpChannel *mask,
gint x,
gint y);
gboolean gimp_channel_is_empty (GimpChannel *mask);
void gimp_channel_add_segment (GimpChannel *mask,
gint x,
gint y,
guint width,
guint value);
gint width,
gint value);
void gimp_channel_sub_segment (GimpChannel *mask,
gint x,
gint y,
guint width,
guint value);
gint width,
gint value);
void gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
guint w,
guint h);
gint w,
gint h);
void gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
guint w,
guint h,
gint w,
gint h,
gboolean antialias);
void gimp_channel_combine_mask (GimpChannel *mask,
GimpChannel *add_on,
@ -175,8 +175,8 @@ void gimp_channel_sharpen (GimpChannel *mask);
void gimp_channel_all (GimpChannel *mask);
void gimp_channel_border (GimpChannel *mask,
guint radius_x,
guint radius_y);
gint radius_x,
gint radius_y);
void gimp_channel_grow (GimpChannel *mask,
gint radius_x,
gint radius_y);

View File

@ -51,11 +51,11 @@ struct _GimpContainer
/* public, read-only */
GType children_type;
GimpContainerPolicy policy;
guint num_children;
gint num_children;
/* private */
GList *handlers;
guint freeze_count;
gint freeze_count;
};
struct _GimpContainerClass

View File

@ -37,17 +37,17 @@ struct _GimpCoreConfig
gchar *default_comment;
GimpImageBaseType default_type;
guint default_width;
guint default_height;
gint default_width;
gint default_height;
GimpUnit default_units;
gdouble default_xresolution;
gdouble default_yresolution;
GimpUnit default_resolution_units;
guint levels_of_undo;
gint levels_of_undo;
gchar *pluginrc_path;
gchar *module_db_load_inhibit;
guint thumbnail_mode;
gint thumbnail_mode;
};

View File

@ -41,7 +41,7 @@ struct _GimpData
GimpViewable parent_instance;
gchar *filename;
guint dirty : 1;
gboolean dirty;
};
struct _GimpDataClass

View File

@ -117,7 +117,7 @@ GimpDataFactory *
gimp_data_factory_new (GType data_type,
const gchar **data_path,
const GimpDataFactoryLoaderEntry *loader_entries,
guint n_loader_entries,
gint n_loader_entries,
GimpDataNewFunc new_func,
GimpDataGetStandardFunc standard_func)
{
@ -261,7 +261,7 @@ gimp_data_factory_data_load_callback (const gchar *filename,
gpointer callback_data)
{
GimpDataFactory *factory;
guint i;
gint i;
factory = (GimpDataFactory *) callback_data;

View File

@ -59,7 +59,7 @@ struct _GimpDataFactory
const gchar **data_path;
const GimpDataFactoryLoaderEntry *loader_entries;
guint n_loader_entries;
gint n_loader_entries;
GimpDataNewFunc data_new_func;
GimpDataGetStandardFunc data_get_standard_func;
@ -76,7 +76,7 @@ GType gimp_data_factory_get_type (void) G_GNUC_CONST;
GimpDataFactory * gimp_data_factory_new (GType data_type,
const gchar **data_path,
const GimpDataFactoryLoaderEntry *loader_entries,
guint n_loader_entries,
gint n_loader_entries,
GimpDataNewFunc new_func,
GimpDataGetStandardFunc standard_func);

View File

@ -61,8 +61,8 @@ typedef struct
{
PixelRegion *PR;
guchar *row_data;
guint bytes;
guint width;
gint bytes;
gint width;
} PutPixelData;

View File

@ -326,8 +326,8 @@ gimp_drawable_invalidate_preview (GimpViewable *viewable)
void
gimp_drawable_configure (GimpDrawable *drawable,
GimpImage *gimage,
guint width,
guint height,
gint width,
gint height,
GimpImageType type,
const gchar *name)
{
@ -438,8 +438,8 @@ void
gimp_drawable_update (GimpDrawable *drawable,
gint x,
gint y,
guint w,
guint h)
gint w,
gint h)
{
GimpImage *gimage;
gint offset_x;
@ -467,11 +467,11 @@ gimp_drawable_apply_image (GimpDrawable *drawable,
gint x2,
gint y2,
TileManager *tiles,
gboolean sparse)
gint sparse)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (!tiles)
if (! tiles)
undo_push_image (drawable->gimage, drawable,
x1, y1, x2, y2);
else

View File

@ -38,22 +38,22 @@ struct _GimpDrawable
GimpViewable parent_instance;
TileManager *tiles; /* tiles for drawable data */
guint visible : 1; /* controls visibility */
guint width, height; /* size of drawable */
gboolean visible; /* controls visibility */
gint width, height; /* size of drawable */
gint offset_x, offset_y; /* offset of layer in image */
guint bytes : 4; /* bytes per pixel */
guint has_alpha : 1; /* drawable has alpha */
gint bytes; /* bytes per pixel */
gint ID; /* provides a unique ID */
guint32 tattoo; /* provides a perminant ID */
GimpImage *gimage; /* gimage owner */
GimpImageType type; /* type of drawable */
gboolean has_alpha; /* drawable has alpha */
GimpParasiteList *parasites; /* Plug-in parasite data */
/* Preview variables */
GSList *preview_cache; /* preview caches of the channel */
guint preview_valid : 1; /* is the preview valid? */
gboolean preview_valid; /* is the preview valid? */
};
struct _GimpDrawableClass
@ -71,8 +71,8 @@ GType gimp_drawable_get_type (void) G_GNUC_CONST;
void gimp_drawable_configure (GimpDrawable *drawable,
GimpImage *gimage,
guint width,
guint height,
gint width,
gint height,
GimpImageType type,
const gchar *name);
@ -87,8 +87,8 @@ void gimp_drawable_set_gimage (GimpDrawable *drawable,
void gimp_drawable_update (GimpDrawable *drawable,
gint x,
gint y,
guint w,
guint h);
gint w,
gint h);
void gimp_drawable_apply_image (GimpDrawable *drawable,
gint x1,
@ -96,7 +96,7 @@ void gimp_drawable_apply_image (GimpDrawable *drawable,
gint x2,
gint y2,
TileManager *tiles,
gboolean sparse);
gint sparse);
void gimp_drawable_merge_shadow (GimpDrawable *drawable,
gboolean undo);

View File

@ -32,7 +32,7 @@
struct _GimpGuide
{
guint ref_count;
gint ref_count;
gint position;
InternalOrientationType orientation;
guint32 guide_ID;
@ -59,7 +59,7 @@ struct _GimpImage
PlugInProcDef *save_proc; /* last PDB save proc used */
guint width, height; /* width and height attributes */
gint width, height; /* width and height attributes */
gdouble xresolution; /* image x-res, in dpi */
gdouble yresolution; /* image y-res, in dpi */
GimpUnit unit; /* image unit */
@ -68,18 +68,18 @@ struct _GimpImage
guchar *cmap; /* colormap--for indexed */
gint num_cols; /* number of cols--for indexed */
guint dirty; /* dirty flag -- # of ops */
guint undo_on : 1; /* Is undo enabled? */
gint dirty; /* dirty flag -- # of ops */
gboolean undo_on; /* Is undo enabled? */
guint instance_count; /* number of instances */
guint disp_count; /* number of displays */
gint instance_count; /* number of instances */
gint disp_count; /* number of displays */
GimpTattoo tattoo_state; /* the next unique tattoo to use*/
TileManager *shadow; /* shadow buffer tiles */
/* Projection attributes */
guint construct_flag : 1; /* flag for construction */
gboolean construct_flag; /* flag for construction */
GimpImageType proj_type; /* type of the projection image */
gint proj_bytes; /* bpp in projection image */
gint proj_level; /* projection level */
@ -102,19 +102,19 @@ struct _GimpImage
PathList *paths; /* Paths data for this image */
gboolean visible[MAX_CHANNELS]; /* visible channels */
gboolean active[MAX_CHANNELS]; /* active channels */
gboolean visible[MAX_CHANNELS]; /* visible channels */
gboolean active[MAX_CHANNELS]; /* active channels */
guint qmask_state : 1; /* TRUE if qmask is on */
guint qmask_inverted : 1; /* TRUE if qmask is inverted */
gboolean qmask_state; /* TRUE if qmask is on */
gboolean qmask_inverted; /* TRUE if qmask is inverted */
GimpRGB qmask_color; /* rgba triplet of the color */
/* Old undo apparatus */
GSList *undo_stack; /* stack for undo operations */
GSList *redo_stack; /* stack for redo operations */
guint undo_bytes; /* bytes in undo stack */
guint undo_levels; /* levels in undo stack */
guint group_count; /* nested undo groups */
gint undo_bytes; /* bytes in undo stack */
gint undo_levels; /* levels in undo stack */
gint group_count; /* nested undo groups */
UndoType pushing_undo_group; /* undo group status flag */
/* New undo apparatus */
@ -123,7 +123,7 @@ struct _GimpImage
/* Composite preview */
TempBuf *comp_preview; /* the composite preview */
guint comp_preview_valid : 1;/* preview valid-1/channel */
gboolean comp_preview_valid; /* preview valid-1/channel */
};
struct _GimpImageClass

View File

@ -40,9 +40,9 @@ struct _GimpImagefile
{
GimpViewable parent_instance;
guint width;
guint height;
guint size;
gint width;
gint height;
gint size;
};
struct _GimpImagefileClass

View File

@ -37,11 +37,12 @@ struct _GimpLayer
{
GimpDrawable parent_instance;
guint opacity; /* layer opacity */
gint opacity; /* layer opacity */
LayerModeEffects mode; /* layer combination mode */
guint preserve_trans; /* preserve transparency */
guint linked; /* control linkage */
gboolean preserve_trans; /* preserve transparency */
gboolean linked; /* control linkage */
GimpLayerMask *mask; /* possible layer mask */
/* Floating selections */
@ -49,10 +50,11 @@ struct _GimpLayer
{
TileManager *backing_store; /* for obscured regions */
GimpDrawable *drawable; /* floating sel is attached to */
guint initial : 1; /* is fs composited yet? */
guint boundary_known : 1; /* is the current boundary valid */
gboolean initial; /* is fs composited yet? */
gboolean boundary_known; /* is the current boundary valid */
BoundSeg *segs; /* boundary of floating sel */
guint num_segs; /* number of segs in boundary */
gint num_segs; /* number of segs in boundary */
} fs;
};

View File

@ -39,9 +39,9 @@ struct _GimpLayerMask
GimpLayer *layer;
guint apply_mask : 1; /* controls mask application */
guint edit_mask : 1; /* edit mask or layer? */
guint show_mask : 1; /* show mask or layer? */
gboolean apply_mask; /* controls mask application */
gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show mask or layer? */
};
struct _GimpLayerMaskClass

View File

@ -54,8 +54,8 @@ struct _GimpModuleInfoObj
gchar *fullpath; /* path to the module */
GimpModuleState state; /* what's happened to the module */
guint on_disk : 1; /* TRUE if file still exists */
guint load_inhibit : 1; /* user requests not to load at boot time */
gboolean on_disk; /* TRUE if file still exists */
gboolean load_inhibit; /* user requests not to load at boot time */
/* Count of times main gimp is within the module. Normally, this
* will be 1, and we assume that the module won't call its
@ -64,7 +64,7 @@ struct _GimpModuleInfoObj
* unload function, to stop the module attempting to unload
* itself.
*/
guint refs;
gint refs;
/* stuff from now on may be NULL depending on the state the module is in */
GimpModuleInfo *info; /* returned values from module_init */

View File

@ -53,8 +53,9 @@ struct _GimpPalette
GimpData parent_instance;
GList *colors;
guint n_colors;
guint n_columns;
gint n_colors;
gint n_columns;
};
struct _GimpPaletteClass

View File

@ -57,8 +57,8 @@ typedef struct _IdleRenderStruct IdleRenderStruct;
struct _IdleRenderStruct
{
guint width;
guint height;
gint width;
gint height;
gint x;
gint y;
gint basex;
@ -94,9 +94,9 @@ struct _GimpDisplay
GtkWidget *shell; /* shell widget for this gdisplay */
gint scale; /* scale factor from original raw image */
guint dot_for_dot : 1; /* is monitor resolution being ignored? */
guint draw_guides : 1; /* should the guides be drawn? */
guint snap_to_guides : 1; /* should the guides be snapped to? */
gboolean dot_for_dot; /* is monitor resolution being ignored? */
gboolean draw_guides; /* should the guides be drawn? */
gboolean snap_to_guides; /* should the guides be snapped to? */
GSList *update_areas; /* Update areas list */

View File

@ -43,7 +43,7 @@ struct _GimpUndo
gpointer data; /* data to implement the undo */
glong size; /* size of undo item */
guint dirties_image : 1; /* TRUE if undo mutates image */
gboolean dirties_image; /* TRUE if undo mutates image */
GimpUndoPopFunc pop_func; /* function pointer to undo pop proc */
GimpUndoFreeFunc free_func; /* function pointer to free undo data */

View File

@ -50,7 +50,7 @@ struct _InfoDialog
GtkWidget *info_notebook;
GSList *field_list;
guint nfields;
gint nfields;
void *user_data;
};

View File

@ -42,8 +42,8 @@ struct _Resize
ResizeType type;
ResizeTarget target;
guint width;
guint height;
gint width;
gint height;
gdouble resolution_x;
gdouble resolution_y;

View File

@ -57,8 +57,8 @@ typedef struct _IdleRenderStruct IdleRenderStruct;
struct _IdleRenderStruct
{
guint width;
guint height;
gint width;
gint height;
gint x;
gint y;
gint basex;
@ -94,9 +94,9 @@ struct _GimpDisplay
GtkWidget *shell; /* shell widget for this gdisplay */
gint scale; /* scale factor from original raw image */
guint dot_for_dot : 1; /* is monitor resolution being ignored? */
guint draw_guides : 1; /* should the guides be drawn? */
guint snap_to_guides : 1; /* should the guides be snapped to? */
gboolean dot_for_dot; /* is monitor resolution being ignored? */
gboolean draw_guides; /* should the guides be drawn? */
gboolean snap_to_guides; /* should the guides be snapped to? */
GSList *update_areas; /* Update areas list */

View File

@ -57,12 +57,12 @@ struct _GimpDisplayShell
gint offset_x; /* offset of display image into raw image */
gint offset_y;
guint disp_width; /* width of drawing area */
guint disp_height; /* height of drawing area */
gint disp_width; /* width of drawing area */
gint disp_height; /* height of drawing area */
gint disp_xoffset;
gint disp_yoffset;
guint proximity : 1; /* is a device in proximity */
gboolean proximity; /* is a device in proximity */
Selection *select; /* Selection object */
@ -91,7 +91,7 @@ struct _GimpDisplayShell
guchar *render_buf; /* buffer for rendering the image */
GdkGC *render_gc; /* GC for rendering the image */
guint icon_size; /* size of the icon pixmap */
gint icon_size; /* size of the icon pixmap */
guint icon_idle_id; /* ID of the idle-function */
GdkCursorType current_cursor; /* Currently installed main cursor */
@ -99,10 +99,10 @@ struct _GimpDisplayShell
GimpCursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
GdkCursorType override_cursor; /* Overriding cursor */
guint using_override_cursor : 1; /* is the cursor overridden? */
gboolean using_override_cursor; /* is the cursor overridden? */
guint draw_cursor : 1; /* should we draw software cursor ? */
guint have_cursor : 1; /* is cursor currently drawn ? */
gboolean draw_cursor; /* should we draw software cursor ? */
gboolean have_cursor; /* is cursor currently drawn ? */
gint cursor_x; /* software cursor X value */
gint cursor_y; /* software cursor Y value */

View File

@ -42,10 +42,10 @@ struct _Selection
gint index_layer; /* index of current stipple pattern */
gint state; /* internal drawing state */
gint paused; /* count of pause requests */
guint speed; /* speed of marching ants */
guint recalc : 1; /* flag to recalculate the selection */
guint hidden : 1; /* is the selection hidden? */
guint layer_hidden : 1; /* is the layer boundary hidden? */
gboolean recalc; /* flag to recalculate the selection */
gint speed; /* speed of marching ants */
gboolean hidden; /* is the selection hidden? */
gboolean layer_hidden; /* is the layer boundary hidden? */
guint timeout_id; /* timer for successive draws */
gint cycle; /* color cycling turned on */
GdkPixmap *cycle_pix; /* cycling pixmap */

View File

@ -57,12 +57,12 @@ struct _GimpDisplayShell
gint offset_x; /* offset of display image into raw image */
gint offset_y;
guint disp_width; /* width of drawing area */
guint disp_height; /* height of drawing area */
gint disp_width; /* width of drawing area */
gint disp_height; /* height of drawing area */
gint disp_xoffset;
gint disp_yoffset;
guint proximity : 1; /* is a device in proximity */
gboolean proximity; /* is a device in proximity */
Selection *select; /* Selection object */
@ -91,7 +91,7 @@ struct _GimpDisplayShell
guchar *render_buf; /* buffer for rendering the image */
GdkGC *render_gc; /* GC for rendering the image */
guint icon_size; /* size of the icon pixmap */
gint icon_size; /* size of the icon pixmap */
guint icon_idle_id; /* ID of the idle-function */
GdkCursorType current_cursor; /* Currently installed main cursor */
@ -99,10 +99,10 @@ struct _GimpDisplayShell
GimpCursorModifier cursor_modifier; /* Cursor modifier (plus, minus, ...) */
GdkCursorType override_cursor; /* Overriding cursor */
guint using_override_cursor : 1; /* is the cursor overridden? */
gboolean using_override_cursor; /* is the cursor overridden? */
guint draw_cursor : 1; /* should we draw software cursor ? */
guint have_cursor : 1; /* is cursor currently drawn ? */
gboolean draw_cursor; /* should we draw software cursor ? */
gboolean have_cursor; /* is cursor currently drawn ? */
gint cursor_x; /* software cursor X value */
gint cursor_y; /* software cursor Y value */

View File

@ -195,48 +195,48 @@ static gchar * open_backup_file (gchar *filename,
/* global gimprc variables */
GimpRc gimprc =
{
marching_speed : 300, /* 300 ms */
last_opened_size : 4,
gamma_val : 1.0,
transparency_type : 1, /* Mid-Tone Checks */
perfectmouse : FALSE, /* off (fast and sloppy) */
transparency_size : 1, /* Medium sized */
min_colors : 144, /* 6*6*4 */
install_cmap : FALSE,
cycled_marching_ants : 0,
default_threshold : 15,
resize_windows_on_zoom : FALSE,
resize_windows_on_resize : FALSE,
no_cursor_updating : FALSE,
preview_size : GIMP_PREVIEW_SIZE_SMALL,
nav_preview_size : GIMP_PREVIEW_SIZE_HUGE,
show_rulers : TRUE,
show_statusbar : TRUE,
auto_save : TRUE,
confirm_on_close : TRUE,
default_dot_for_dot : TRUE,
save_session_info : TRUE,
save_device_status : FALSE,
always_restore_session : TRUE,
show_tips : TRUE,
last_tip : -1,
show_tool_tips : TRUE,
monitor_xres : 72.0,
monitor_yres : 72.0,
using_xserver_resolution : FALSE,
image_title_format : NULL,
global_paint_options : FALSE,
show_indicators : TRUE,
max_new_image_size : 33554432, /* 32 MB */
trust_dirty_flag : FALSE,
use_help : TRUE,
nav_window_per_display : FALSE,
info_window_follows_mouse : TRUE,
help_browser : HELP_BROWSER_GIMP,
cursor_mode : CURSOR_MODE_TOOL_ICON,
disable_tearoff_menus : FALSE,
theme_path : NULL,
theme : NULL
/* marching_speed */ 300, /* 300 ms */
/* last_opened_size */ 4,
/* gamma_val */ 1.0,
/* transparency_type */ 1, /* Mid-Tone Checks */
/* perfectmouse */ FALSE, /* off (fast and sloppy) */
/* transparency_size */ 1, /* Medium sized */
/* min_colors */ 144, /* 6*6*4 */
/* install_cmap */ FALSE,
/* cycled_marching_ants */ 0,
/* default_threshold */ 15,
/* resize_windows_on_zoom */ FALSE,
/* resize_windows_on_resize */ FALSE,
/* no_cursor_updating */ FALSE,
/* preview_size */ GIMP_PREVIEW_SIZE_SMALL,
/* nav_preview_size */ GIMP_PREVIEW_SIZE_HUGE,
/* show_rulers */ TRUE,
/* show_statusbar */ TRUE,
/* auto_save */ TRUE,
/* confirm_on_close */ TRUE,
/* default_dot_for_dot */ TRUE,
/* save_session_info */ TRUE,
/* save_device_status */ FALSE,
/* always_restore_session */ TRUE,
/* show_tips */ TRUE,
/* last_tip */ -1,
/* show_tool_tips */ TRUE,
/* monitor_xres */ 72.0,
/* monitor_yres */ 72.0,
/* using_xserver_resolution */ FALSE,
/* image_title_format */ NULL,
/* global_paint_options */ FALSE,
/* show_indicators */ TRUE,
/* max_new_image_size */ 33554432, /* 32 MB */
/* trust_dirty_flag */ FALSE,
/* use_help */ TRUE,
/* nav_window_per_display */ FALSE,
/* info_window_follows_mouse */ TRUE,
/* help_browser */ HELP_BROWSER_GIMP,
/* cursor_mode */ CURSOR_MODE_TOOL_ICON,
/* disable_tearoff_menus */ FALSE,
/* theme_path */ NULL,
/* theme */ NULL
};
static GHashTable *parse_func_hash = NULL;

View File

@ -25,21 +25,21 @@ typedef struct _GimpRc GimpRc;
/* global gimprc variables - need some comments on this stuff */
struct _GimpRc
{
guint marching_speed;
guint last_opened_size;
gint marching_speed;
gint last_opened_size;
gdouble gamma_val;
guint transparency_type;
gint transparency_type;
gboolean perfectmouse;
guint transparency_size;
guint min_colors;
gint transparency_size;
gint min_colors;
gboolean install_cmap;
gboolean cycled_marching_ants;
guint default_threshold;
gint default_threshold;
gboolean resize_windows_on_zoom;
gboolean resize_windows_on_resize;
gboolean no_cursor_updating;
guint preview_size;
guint nav_preview_size;
gint preview_size;
gint nav_preview_size;
gboolean show_rulers;
gboolean show_statusbar;
gboolean auto_save;

View File

@ -37,7 +37,7 @@ struct _BrushSelect
/* Context to store the current brush & paint options */
GimpContext *context;
guint spacing_value;
gint spacing_value;
};

View File

@ -61,12 +61,12 @@ struct _GradientEditor
GtkObject *scroll_data;
/* Instant update */
guint instant_update : 1;
gboolean instant_update;
/* Gradient preview */
guchar *preview_rows[2]; /* For caching redraw info */
gint preview_last_x;
guint preview_button_down : 1;
gboolean preview_button_down;
/* Gradient control */
GdkPixmap *control_pixmap;
@ -75,7 +75,7 @@ struct _GradientEditor
GimpGradientSegment *control_sel_r; /* Right segment of selection */
GradientEditorDragMode control_drag_mode; /* What is being dragged? */
guint32 control_click_time; /* Time when mouse was pressed */
guint control_compress : 1; /* Compressing/expanding handles */
gboolean control_compress; /* Compressing/expanding handles */
gint control_last_x; /* Last mouse position when dragging */
gdouble control_last_gx; /* Last position (wrt gradient) when dragging */
gdouble control_orig_pos; /* Original click position when dragging */
@ -91,10 +91,10 @@ struct _GradientEditor
/* Color dialogs */
GimpGradientSegment *left_saved_segments;
gboolean left_saved_dirty;
GimpGradientSegment *right_saved_segments;
guint left_saved_dirty : 1;
guint right_saved_dirty : 1;
gboolean right_saved_dirty;
};

View File

@ -30,7 +30,7 @@ struct _GradientSelect
GimpContext *context;
gchar *callback_name;
guint sample_size;
gint sample_size;
};

View File

@ -50,7 +50,7 @@ struct _InfoDialog
GtkWidget *info_notebook;
GSList *field_list;
guint nfields;
gint nfields;
void *user_data;
};

View File

@ -42,8 +42,8 @@ struct _Resize
ResizeType type;
ResizeTarget target;
guint width;
guint height;
gint width;
gint height;
gdouble resolution_x;
gdouble resolution_y;

View File

@ -35,12 +35,6 @@ x( \
guint count, \
guchar *dst) __attribute((regparm(3)));
/* A drawable has an alphachannel if contains either 4 or 2 bytes data
* aka GRAYA and RGBA and thus the macro below works. This will have
* to change if we support bigger formats. We'll do it so for now because
* masking is always cheaper than passing parameters over the stack. */
#define HAS_ALPHA(bytes) (~##bytes & 1)
#define MMX_PIXEL_OP_3A_1A(op) \
MMX_PIXEL_OP(op##_pixels_3a_3a) \
MMX_PIXEL_OP(op##_pixels_1a_1a)

View File

@ -106,16 +106,16 @@ static void gimp_dodgeburn_tool_motion (GimpPaintTool *paint_t
GimpLut *lut);
static gfloat gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value);
static gfloat gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value);
static gfloat gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value);
static GimpToolOptions * gimp_dodgeburn_tool_options_new (GimpToolInfo *tool_info);
@ -459,8 +459,8 @@ gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool,
static gfloat
gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value)
{
gfloat *exposure_ptr = (gfloat *) user_data;
@ -476,8 +476,8 @@ gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data,
static gfloat
gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value)
{
gfloat *exposure_ptr = (gfloat *) user_data;
@ -498,8 +498,8 @@ gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data,
static gfloat
gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value)
{
gfloat *exposure_ptr = (gfloat *) user_data;

View File

@ -45,7 +45,7 @@ struct _BlobSpan
struct _Blob
{
gint y;
guint height;
gint height;
BlobSpan data[1];
};

View File

@ -59,7 +59,7 @@ struct _GimpInkTool
gdouble last_time; /* previous time of a motion event */
gdouble lastx, lasty; /* previous position of a motion event */
guint init_velocity : 1;
gboolean init_velocity;
};
struct _GimpInkToolClass

View File

@ -80,8 +80,8 @@ struct _GimpPaintTool
GimpBrush * brush; /* current brush */
guint pick_colors : 1; /* pick color if ctrl or alt is pressed */
guint pick_state : 1; /* was ctrl or alt pressed when clicked? */
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 */
guint context_id; /* for the statusbar */

View File

@ -30,7 +30,7 @@ struct _Path
{
GSList *path_details;
gint pathtype; /* Only beziers to start with */
guint closed : 1;
gboolean closed;
guint32 state;
guint32 locked; /* Only bottom bit used */
GimpTattoo tattoo; /* The tattoo for the path */

View File

@ -63,8 +63,9 @@ struct _GimpBezierSelectPoint
GimpBezierSelectPoint *prev; /* prev point on curve */
GimpBezierSelectPoint *next_curve; /* Next curve segment */
guint pointflags : 1; /* Status of point 0 = not selected
* 1 = selected */
gint pointflags; /* Status of point 0 = not selected
* 1 = selected
*/
};
struct _GimpBezierSelectTool
@ -80,7 +81,7 @@ struct _GimpBezierSelectTool
GimpBezierSelectPoint *cur_control; /* the current active control point */
GimpBezierSelectPoint *last_point; /* the last point on the curve */
guint num_points; /* number of points in the curve */
gint num_points; /* number of points in the curve */
GimpChannel *mask; /* null if the curve is open */
GSList **scanlines; /* used in converting a curve */
};
@ -98,7 +99,7 @@ typedef void (* GimpBezierSelectPointsFunc) (GimpBezierSelectTool *bezier_sel,
typedef struct
{
guint count;
gint count;
} CountCurves;

View File

@ -80,8 +80,8 @@ struct _GimpPaintTool
GimpBrush * brush; /* current brush */
guint pick_colors : 1; /* pick color if ctrl or alt is pressed */
guint pick_state : 1; /* was ctrl or alt pressed when clicked? */
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 */
guint context_id; /* for the statusbar */

View File

@ -67,8 +67,8 @@ struct _ColorBalanceDialog
guchar g_lookup[256];
guchar b_lookup[256];
guint preserve_luminosity : 1;
guint preview : 1;
gboolean preserve_luminosity;
gboolean preview;
GimpTransferMode application_mode;
};

View File

@ -70,7 +70,7 @@ struct _CurvesDialog
gint color;
gint channel;
guint preview : 1;
gboolean preview;
gint grab_point;
gint last;

View File

@ -106,16 +106,16 @@ static void gimp_dodgeburn_tool_motion (GimpPaintTool *paint_t
GimpLut *lut);
static gfloat gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value);
static gfloat gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value);
static gfloat gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value);
static GimpToolOptions * gimp_dodgeburn_tool_options_new (GimpToolInfo *tool_info);
@ -459,8 +459,8 @@ gimp_dodgeburn_tool_motion (GimpPaintTool *paint_tool,
static gfloat
gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value)
{
gfloat *exposure_ptr = (gfloat *) user_data;
@ -476,8 +476,8 @@ gimp_dodgeburn_tool_highlights_lut_func (gpointer user_data,
static gfloat
gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value)
{
gfloat *exposure_ptr = (gfloat *) user_data;
@ -498,8 +498,8 @@ gimp_dodgeburn_tool_midtones_lut_func (gpointer user_data,
static gfloat
gimp_dodgeburn_tool_shadows_lut_func (gpointer user_data,
guint nchannels,
guint channel,
gint nchannels,
gint channel,
gfloat value)
{
gfloat *exposure_ptr = (gfloat *) user_data;

View File

@ -39,8 +39,8 @@ struct _GimpFreeSelectTool
GimpSelectionTool parent_instance;
GimpVector2 *points;
guint num_points;
guint max_segs;
gint num_points;
gint max_segs;
};
struct _GimpFreeSelectToolClass

View File

@ -77,7 +77,7 @@ struct _HueSaturationDialog
gdouble saturation[7];
HueRange hue_partition;
guint preview : 1;
gboolean preview;
};

View File

@ -45,7 +45,7 @@ struct _BlobSpan
struct _Blob
{
gint y;
guint height;
gint height;
BlobSpan data[1];
};

View File

@ -59,7 +59,7 @@ struct _GimpInkTool
gdouble last_time; /* previous time of a motion event */
gdouble lastx, lasty; /* previous position of a motion event */
guint init_velocity : 1;
gboolean init_velocity;
};
struct _GimpInkToolClass

View File

@ -77,8 +77,8 @@ struct _GimpIscissorsTool
GSList *curves; /* the list of curves */
guint first_point : 1; /* is this the first point? */
guint connected : 1; /* is the region closed? */
gboolean first_point; /* is this the first point? */
gboolean connected; /* is the region closed? */
Iscissors_state state; /* state of iscissors */
Iscissors_draw draw; /* items to draw on a draw request */

View File

@ -39,7 +39,7 @@ struct _GimpMagnifyTool
GimpDrawTool parent_instance;
gint x, y; /* upper left hand coordinate */
guint w, h; /* width and height */
gint w, h; /* width and height */
GimpZoomType op; /* magnify operation */
};

View File

@ -54,7 +54,7 @@ struct _GimpMeasureTool
gint last_x; /* last x coordinate */
gint last_y; /* last y coordinate */
gint point; /* what are we manipulating? */
guint num_points; /* how many points? */
gint num_points; /* how many points? */
gint x[3]; /* three x coordinates */
gint y[3]; /* three y coordinates */
gdouble angle1; /* first angle */

View File

@ -80,8 +80,8 @@ struct _GimpPaintTool
GimpBrush * brush; /* current brush */
guint pick_colors : 1; /* pick color if ctrl or alt is pressed */
guint pick_state : 1; /* was ctrl or alt pressed when clicked? */
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 */
guint context_id; /* for the statusbar */

View File

@ -50,7 +50,7 @@ struct _GimpPathTool
gdouble click_position; /* The position on the segment */
gint click_handle_id; /* The handle ID of the segment */
guint active_count; /* How many segments are active? */
gint active_count; /* How many segments are active? */
/*
* WARNING: single_active_segment may contain non NULL Values
* which point to the nirvana. But they are important!

View File

@ -39,7 +39,7 @@ struct _GimpRectSelectTool
GimpSelectionTool parent_instance;
gint x, y; /* upper left hand coordinate */
guint w, h; /* width and height */
gint w, h; /* width and height */
gint center; /* is the selection being created from the
* center out? */

View File

@ -57,14 +57,14 @@ struct _ThresholdDialog
GimpHistogramView *histogram;
GimpHistogram *hist;
GimpDrawable *drawable;
ImageMap *image_map;
GimpDrawable *drawable;
ImageMap *image_map;
gint color;
gint low_threshold;
gint high_threshold;
gint color;
gint low_threshold;
gint high_threshold;
guint preview : 1;
gboolean preview;
};

View File

@ -49,16 +49,14 @@ struct _GimpTool
ToolState state; /* state of tool activity */
gint paused_count; /* paused control count */
guint scroll_lock : 1; /* allow scrolling or not */
guint auto_snap_to : 1; /* snap to guides automatically */
gboolean scroll_lock; /* allow scrolling or not */
gboolean auto_snap_to; /* snap to guides automatically */
guint handle_empty_image : 1; /* invoke the tool on images without
* active drawable */
gboolean handle_empty_image; /* invoke the tool on images without
* active drawable
*/
guint preserve : 1; /* Preserve this tool across drawable changes */
guint toggled : 1; /* Bad hack to let the paint_core show the
* right toggle cursors
*/
gboolean preserve; /* Preserve this tool across drawable changes */
GimpDisplay *gdisp; /* pointer to currently active gdisp */
GimpDrawable *drawable; /* pointer to the tool's current drawable */
@ -68,6 +66,10 @@ struct _GimpTool
* functions are properly
* virtualized
*/
gboolean toggled; /* Bad hack to let the paint_core show the
* right toggle cursors
*/
};
struct _GimpToolClass

View File

@ -79,8 +79,8 @@ struct _GimpTransformTool
TransformAction function; /* current tool activity */
guint use_grid : 1; /* does the tool use the grid */
guint use_center : 1; /* use the center handle */
gboolean use_grid; /* does the tool use the grid */
gboolean use_center; /* use the center handle */
gint ngx, ngy; /* number of grid lines in original
* x and y directions

View File

@ -42,7 +42,7 @@ struct _GimpBrushFactoryView
GtkWidget *spacing_scale;
GtkAdjustment *spacing_adjustment;
guint change_brush_spacing : 1;
gboolean change_brush_spacing;
GQuark spacing_changed_handler_id;
};

View File

@ -41,8 +41,8 @@ struct _GimpConstrainedHWrapBox
{
GtkHWrapBox parent_instance;
guint rows;
guint columns;
gint rows;
gint columns;
};
struct _GimpConstrainedHWrapBoxClass

View File

@ -49,7 +49,7 @@ struct _GimpContainerMenu
GHashTable *hash_table;
guint preview_size;
gint preview_size;
GimpItemGetNameFunc get_name_func;
};

View File

@ -45,8 +45,8 @@ struct _GimpContainerView
GHashTable *hash_table;
guint preview_size;
guint reorderable : 1;
gint preview_size;
gboolean reorderable;
GimpItemGetNameFunc get_name_func;

View File

@ -40,24 +40,24 @@ struct _GimpDialogFactoryEntry
{
gchar *identifier;
GimpDialogNewFunc new_func;
guint preview_size;
guint singleton : 1;
guint session_managed : 1;
guint remember_size : 1;
guint remember_if_open : 1;
gint preview_size;
gboolean singleton;
gboolean session_managed;
gboolean remember_size;
gboolean remember_if_open;
};
struct _GimpSessionInfo
{
gint x;
gint y;
guint width;
guint height;
gint width;
gint height;
GtkWidget *widget;
/* only valid while restoring and saving the session */
guint open : 1;
gboolean open;
/* GList of gchar* of optional additional dialog specific info */
GList *aux_info;

View File

@ -61,12 +61,12 @@ struct _GradientEditor
GtkObject *scroll_data;
/* Instant update */
guint instant_update : 1;
gboolean instant_update;
/* Gradient preview */
guchar *preview_rows[2]; /* For caching redraw info */
gint preview_last_x;
guint preview_button_down : 1;
gboolean preview_button_down;
/* Gradient control */
GdkPixmap *control_pixmap;
@ -75,7 +75,7 @@ struct _GradientEditor
GimpGradientSegment *control_sel_r; /* Right segment of selection */
GradientEditorDragMode control_drag_mode; /* What is being dragged? */
guint32 control_click_time; /* Time when mouse was pressed */
guint control_compress : 1; /* Compressing/expanding handles */
gboolean control_compress; /* Compressing/expanding handles */
gint control_last_x; /* Last mouse position when dragging */
gdouble control_last_gx; /* Last position (wrt gradient) when dragging */
gdouble control_orig_pos; /* Original click position when dragging */
@ -91,10 +91,10 @@ struct _GradientEditor
/* Color dialogs */
GimpGradientSegment *left_saved_segments;
gboolean left_saved_dirty;
GimpGradientSegment *right_saved_segments;
guint left_saved_dirty : 1;
guint right_saved_dirty : 1;
gboolean right_saved_dirty;
};

View File

@ -42,7 +42,7 @@ struct _GimpImageDock
GimpContainer *image_container;
guint show_image_menu : 1;
gboolean show_image_menu;
gboolean auto_follow_active;
GtkWidget *option_menu;

View File

@ -45,10 +45,10 @@ struct _GimpListItem
GtkWidget *name_label;
/*< protected >*/
guint preview_size;
gint preview_size;
/*< private >*/
guint reorderable : 1;
gboolean reorderable;
GimpContainer *container;
GimpDropType drop_type;
GimpItemGetNameFunc get_name_func;

View File

@ -42,7 +42,7 @@ struct _GimpImageDock
GimpContainer *image_container;
guint show_image_menu : 1;
gboolean show_image_menu;
gboolean auto_follow_active;
GtkWidget *option_menu;

View File

@ -45,7 +45,7 @@ struct _GimpMenuItem
GtkWidget *name_label;
/*< protected >*/
guint preview_size;
gint preview_size;
/*< private >*/
GimpItemGetNameFunc get_name_func;

View File

@ -42,18 +42,18 @@ struct _GimpNavigationPreview
/* values in image coordinates */
gint x;
gint y;
guint width;
guint height;
gint width;
gint height;
/* values in preview coordinates */
gint p_x;
gint p_y;
guint p_width;
guint p_height;
gint p_width;
gint p_height;
gint motion_offset_x;
gint motion_offset_y;
guint has_grab : 1;
gboolean has_grab;
GdkGC *gc;
};

View File

@ -42,18 +42,18 @@ struct _GimpNavigationPreview
/* values in image coordinates */
gint x;
gint y;
guint width;
guint height;
gint width;
gint height;
/* values in preview coordinates */
gint p_x;
gint p_y;
guint p_width;
guint p_height;
gint p_width;
gint p_height;
gint motion_offset_x;
gint motion_offset_y;
guint has_grab : 1;
gboolean has_grab;
GdkGC *gc;
};

View File

@ -41,20 +41,20 @@ struct _GimpPreview
GimpViewable *viewable;
GimpRGB border_color;
gint width;
gint height;
gint border_width;
guint dot_for_dot : 1;
gboolean dot_for_dot;
guint is_popup : 1;
guint clickable : 1;
guint show_popup : 1;
GimpRGB border_color;
gboolean is_popup;
gboolean clickable;
gboolean show_popup;
/*< private >*/
guint size;
guint in_button : 1;
gint size;
gboolean in_button;
guint press_state;
guint idle_id;
guint popup_id;

View File

@ -41,20 +41,20 @@ struct _GimpPreview
GimpViewable *viewable;
GimpRGB border_color;
gint width;
gint height;
gint border_width;
guint dot_for_dot : 1;
gboolean dot_for_dot;
guint is_popup : 1;
guint clickable : 1;
guint show_popup : 1;
GimpRGB border_color;
gboolean is_popup;
gboolean clickable;
gboolean show_popup;
/*< private >*/
guint size;
guint in_button : 1;
gint size;
gboolean in_button;
guint press_state;
guint idle_id;
guint popup_id;

View File

@ -41,20 +41,20 @@ struct _GimpPreview
GimpViewable *viewable;
GimpRGB border_color;
gint width;
gint height;
gint border_width;
guint dot_for_dot : 1;
gboolean dot_for_dot;
guint is_popup : 1;
guint clickable : 1;
guint show_popup : 1;
GimpRGB border_color;
gboolean is_popup;
gboolean clickable;
gboolean show_popup;
/*< private >*/
guint size;
guint in_button : 1;
gint size;
gboolean in_button;
guint press_state;
guint idle_id;
guint popup_id;

View File

@ -41,20 +41,20 @@ struct _GimpPreview
GimpViewable *viewable;
GimpRGB border_color;
gint width;
gint height;
gint border_width;
guint dot_for_dot : 1;
gboolean dot_for_dot;
guint is_popup : 1;
guint clickable : 1;
guint show_popup : 1;
GimpRGB border_color;
gboolean is_popup;
gboolean clickable;
gboolean show_popup;
/*< private >*/
guint size;
guint in_button : 1;
gint size;
gboolean in_button;
guint press_state;
guint idle_id;
guint popup_id;

View File

@ -54,8 +54,8 @@ struct _GimpModuleInfoObj
gchar *fullpath; /* path to the module */
GimpModuleState state; /* what's happened to the module */
guint on_disk : 1; /* TRUE if file still exists */
guint load_inhibit : 1; /* user requests not to load at boot time */
gboolean on_disk; /* TRUE if file still exists */
gboolean load_inhibit; /* user requests not to load at boot time */
/* Count of times main gimp is within the module. Normally, this
* will be 1, and we assume that the module won't call its
@ -64,7 +64,7 @@ struct _GimpModuleInfoObj
* unload function, to stop the module attempting to unload
* itself.
*/
guint refs;
gint refs;
/* stuff from now on may be NULL depending on the state the module is in */
GimpModuleInfo *info; /* returned values from module_init */