Indentation paranoia!

--Sven
This commit is contained in:
Sven Neumann 1999-07-19 19:46:05 +00:00
parent 2518748a66
commit 645f85352d
21 changed files with 894 additions and 852 deletions

View File

@ -1,3 +1,15 @@
Mon Jul 19 21:40:48 MEST 1999 Sven Neumann <sven@gimp.org>
* app/brush_select.c: update the brush title when editing a brush
* app/gimage.[ch]
* app/gimpimage.c
* app/ops_buttons.[ch]
* app/pixel_regions.c
* app/temp_buf.c
* app/undo.c: Indentation paranoia! (I was browsing the code a lot
this weekend and just couldn't resist...)
1999-07-19 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/gdisplay.c (gdisplay_set_menu_sensitivity): moved the _()

View File

@ -68,12 +68,13 @@ static void pixel_region_configure (PixelRegionHolder *, PixelRegionIterator
/* Function definitions */
void
pixel_region_init (PR, tiles, x, y, w, h, dirty)
PixelRegion *PR;
TileManager *tiles;
int x, y;
int w, h;
int dirty;
pixel_region_init (PixelRegion *PR,
TileManager *tiles,
int x,
int y,
int w,
int h,
int dirty)
{
PR->tiles = tiles;
PR->curtile = NULL;
@ -89,10 +90,11 @@ pixel_region_init (PR, tiles, x, y, w, h, dirty)
void
pixel_region_resize (PR, x, y, w, h)
PixelRegion *PR;
int x, y;
int w, h;
pixel_region_resize (PixelRegion *PR,
int x,
int y,
int w,
int h)
{
/* If the data is non-null, data is contiguous--need to advance */
if (PR->data != NULL)
@ -107,15 +109,14 @@ pixel_region_resize (PR, x, y, w, h)
PR->h = h;
}
/* request that tiles within a region be fetched asynchronously
*/
/* request that tiles within a region be fetched asynchronously */
void
pixel_region_get_async (PR, ulx, uly, lrx, lry)
PixelRegion *PR;
int ulx;
int uly;
int lrx;
int lry;
pixel_region_get_async (PixelRegion *PR,
int ulx,
int uly,
int lrx,
int lry)
{
int x, y;
@ -124,13 +125,14 @@ pixel_region_get_async (PR, ulx, uly, lrx, lry)
tile_manager_get_async (PR->tiles, x, y);
}
void
pixel_region_get_row (PR, x, y, w, data, subsample)
PixelRegion *PR;
int x, y;
int w;
unsigned char *data;
int subsample;
pixel_region_get_row (PixelRegion *PR,
int x,
int y,
int w,
unsigned char *data,
int subsample)
{
Tile *tile;
unsigned char *tile_data;
@ -176,11 +178,11 @@ pixel_region_get_row (PR, x, y, w, data, subsample)
void
pixel_region_set_row (PR, x, y, w, data)
PixelRegion *PR;
int x, y;
int w;
unsigned char *data;
pixel_region_set_row (PixelRegion *PR,
int x,
int y,
int w,
unsigned char *data)
{
Tile *tile;
unsigned char *tile_data;
@ -212,12 +214,12 @@ pixel_region_set_row (PR, x, y, w, data)
void
pixel_region_get_col (PR, x, y, h, data, subsample)
PixelRegion *PR;
int x, y;
int h;
unsigned char *data;
int subsample;
pixel_region_get_col (PixelRegion *PR,
int x,
int y,
int h,
unsigned char *data,
int subsample)
{
Tile *tile;
unsigned char *tile_data;
@ -253,11 +255,11 @@ pixel_region_get_col (PR, x, y, h, data, subsample)
void
pixel_region_set_col (PR, x, y, h, data)
PixelRegion *PR;
int x, y;
int h;
unsigned char *data;
pixel_region_set_col (PixelRegion *PR,
int x,
int y,
int h,
unsigned char *data)
{
Tile *tile;
unsigned char *tile_data;
@ -292,7 +294,8 @@ pixel_region_set_col (PR, x, y, h, data)
}
void *
pixel_regions_register (int num_regions, ...)
pixel_regions_register (int num_regions,
...)
{
PixelRegion *PR;
PixelRegionHolder *PRH;
@ -345,8 +348,7 @@ pixel_regions_register (int num_regions, ...)
void *
pixel_regions_process (PRI_ptr)
void *PRI_ptr;
pixel_regions_process (void *PRI_ptr)
{
GSList *list;
PixelRegionHolder *PRH;
@ -392,8 +394,7 @@ pixel_regions_process (PRI_ptr)
}
void
pixel_regions_process_stop (PRI_ptr)
void *PRI_ptr;
pixel_regions_process_stop (void *PRI_ptr)
{
GSList *list;
PixelRegionHolder *PRH;
@ -445,8 +446,7 @@ pixel_regions_process_stop (PRI_ptr)
/* Static Function Definitions */
static int
get_portion_height (PRI)
PixelRegionIterator *PRI;
get_portion_height (PixelRegionIterator *PRI)
{
GSList *list;
PixelRegionHolder *PRH;
@ -488,8 +488,7 @@ get_portion_height (PRI)
static int
get_portion_width (PRI)
PixelRegionIterator *PRI;
get_portion_width (PixelRegionIterator *PRI)
{
GSList *list;
PixelRegionHolder *PRH;
@ -531,8 +530,7 @@ get_portion_width (PRI)
static void *
pixel_regions_configure (PRI)
PixelRegionIterator *PRI;
pixel_regions_configure (PixelRegionIterator *PRI)
{
PixelRegionHolder *PRH;
GSList *list;
@ -580,9 +578,8 @@ pixel_regions_configure (PRI)
static void
pixel_region_configure (PRH, PRI)
PixelRegionHolder *PRH;
PixelRegionIterator *PRI;
pixel_region_configure (PixelRegionHolder *PRH,
PixelRegionIterator *PRI)
{
/* Configure the rowstride and data pointer for the pixel region
* based on the current offsets into the region and whether the
@ -590,7 +587,8 @@ pixel_region_configure (PRH, PRI)
*/
if (PRH->PR->tiles)
{
PRH->PR->curtile = tile_manager_get_tile (PRH->PR->tiles, PRH->PR->x, PRH->PR->y, TRUE, PRH->PR->dirty);
PRH->PR->curtile =
tile_manager_get_tile (PRH->PR->tiles, PRH->PR->x, PRH->PR->y, TRUE, PRH->PR->dirty);
PRH->PR->offx = PRH->PR->x % TILE_WIDTH;
PRH->PR->offy = PRH->PR->y % TILE_HEIGHT;

View File

@ -47,16 +47,15 @@
static unsigned char * temp_buf_allocate (unsigned int);
static void temp_buf_to_color (TempBuf *, TempBuf *);
static void temp_buf_to_gray (TempBuf *, TempBuf *);
static void temp_buf_to_gray (TempBuf *, TempBuf *);
/* Memory management */
static unsigned char *
temp_buf_allocate (size)
unsigned int size;
temp_buf_allocate (unsigned int size)
{
unsigned char * data;
unsigned char *data;
data = (unsigned char *) g_malloc (size);
@ -67,9 +66,8 @@ temp_buf_allocate (size)
/* The conversion routines */
static void
temp_buf_to_color (src_buf, dest_buf)
TempBuf * src_buf;
TempBuf * dest_buf;
temp_buf_to_color (TempBuf *src_buf,
TempBuf *dest_buf)
{
unsigned char *src;
unsigned char *dest;
@ -92,13 +90,12 @@ temp_buf_to_color (src_buf, dest_buf)
static void
temp_buf_to_gray (src_buf, dest_buf)
TempBuf * src_buf;
TempBuf * dest_buf;
temp_buf_to_gray (TempBuf *src_buf,
TempBuf *dest_buf)
{
unsigned char *src;
unsigned char *dest;
long num_bytes;
long num_bytes;
float pix;
src = temp_buf_data (src_buf);
@ -121,15 +118,15 @@ temp_buf_to_gray (src_buf, dest_buf)
TempBuf *
temp_buf_new (width, height, bytes, x, y, col)
int width;
int height;
int bytes;
int x, y;
unsigned char * col;
temp_buf_new (int width,
int height,
int bytes,
int x,
int y,
unsigned char *col)
{
long i;
int j;
int j;
unsigned char * data;
TempBuf * temp;
@ -190,9 +187,8 @@ temp_buf_new (width, height, bytes, x, y, col)
TempBuf *
temp_buf_copy (src, dest)
TempBuf * src;
TempBuf * dest;
temp_buf_copy (TempBuf *src,
TempBuf *dest)
{
TempBuf * new;
long length;
@ -233,11 +229,12 @@ temp_buf_copy (src, dest)
TempBuf *
temp_buf_resize (buf, bytes, x, y, w, h)
TempBuf * buf;
int bytes;
int x, y;
int w, h;
temp_buf_resize (TempBuf *buf,
int bytes,
int x,
int y,
int w,
int h)
{
int size;
@ -271,12 +268,13 @@ temp_buf_resize (buf, bytes, x, y, w, h)
TempBuf *
temp_buf_copy_area (src, dest, x, y, w, h, border)
TempBuf * src;
TempBuf * dest;
int x, y;
int w, h;
int border;
temp_buf_copy_area (TempBuf *src,
TempBuf *dest,
int x,
int y,
int w,
int h,
int border)
{
TempBuf * new;
PixelRegion srcR, destR;
@ -333,8 +331,7 @@ temp_buf_copy_area (src, dest, x, y, w, h, border)
void
temp_buf_free (temp_buf)
TempBuf * temp_buf;
temp_buf_free (TempBuf *temp_buf)
{
if (temp_buf->data)
g_free (temp_buf->data);
@ -347,8 +344,7 @@ temp_buf_free (temp_buf)
unsigned char *
temp_buf_data (temp_buf)
TempBuf * temp_buf;
temp_buf_data (TempBuf *temp_buf)
{
if (temp_buf->swapped)
temp_buf_unswap (temp_buf);
@ -363,9 +359,8 @@ temp_buf_data (temp_buf)
MaskBuf *
mask_buf_new (width, height)
int width;
int height;
mask_buf_new (int width,
int height)
{
static unsigned char empty = 0;
@ -374,16 +369,14 @@ mask_buf_new (width, height)
void
mask_buf_free (mask)
MaskBuf * mask;
mask_buf_free (MaskBuf *mask)
{
temp_buf_free ((TempBuf *) mask);
}
unsigned char *
mask_buf_data (mask_buf)
MaskBuf * mask_buf;
mask_buf_data (MaskBuf *mask_buf)
{
if (mask_buf->swapped)
temp_buf_unswap (mask_buf);
@ -411,13 +404,14 @@ mask_buf_data (mask_buf)
* from disk. In the former case, cached_in_memory is set to NULL;
* in the latter case, cached_in_memory is left unchanged.
* If temp_buf_swap_free is called, cached_in_memory must be checked
* against the temp buf being freed. If they are the same, then cached_in_memory
* must be set to NULL;
* against the temp buf being freed. If they are the same, then
* cached_in_memory must be set to NULL;
*
* In the case where memory usage is set to "stingy":
* temp bufs are not cached in memory at all, they go right to disk.
*/
/* a static counter for generating unique filenames */
static int swap_index = 0;
@ -436,8 +430,7 @@ generate_unique_filename (void)
void
temp_buf_swap (buf)
TempBuf * buf;
temp_buf_swap (TempBuf *buf)
{
TempBuf * swap;
char * filename;
@ -511,8 +504,7 @@ temp_buf_swap (buf)
void
temp_buf_unswap (buf)
TempBuf * buf;
temp_buf_unswap (TempBuf *buf)
{
struct stat stat_buf;
FILE * fp;
@ -563,8 +555,7 @@ temp_buf_unswap (buf)
void
temp_buf_swap_free (buf)
TempBuf * buf;
temp_buf_swap_free (TempBuf *buf)
{
struct stat stat_buf;

View File

@ -613,6 +613,7 @@ brush_select_brush_changed (BrushSelectP bsp,
{
display_brushes (bsp);
gtk_widget_draw (bsp->preview, NULL);
update_active_brush_field (bsp);
}
}

View File

@ -142,7 +142,8 @@ gimp_image_class_init (GimpImageClass *klass)
/* static functions */
static void gimp_image_init (GimpImage *gimage)
static void
gimp_image_init (GimpImage *gimage)
{
gimage->has_filename = 0;
gimage->num_cols = 0;
@ -176,15 +177,18 @@ static void gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
GtkType
gimp_image_get_type (void)
{
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
}
@ -231,7 +235,10 @@ gimp_image_free_projection (GimpImage *gimage)
}
static void
gimp_image_allocate_shadow (GimpImage *gimage, int width, int height, int bpp)
gimp_image_allocate_shadow (GimpImage *gimage,
int width,
int height,
int bpp)
{
/* allocate the new projection */
gimage->shadow = tile_manager_new (width, height, bpp);
@ -342,7 +349,7 @@ gimp_image_get_resolution (GimpImage *gimage,
void
gimp_image_set_unit (GimpImage *gimage,
GUnit unit)
GUnit unit)
{
gimage->unit = unit;
}
@ -355,7 +362,8 @@ gimp_image_get_unit (GimpImage *gimage)
void
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc)
{
gimage->save_proc = proc;
}
@ -414,10 +422,9 @@ gimp_image_resize (GimpImage *gimage,
while (guide_list)
{
Guide *guide;
GList *next;
guide = (Guide*) guide_list->data;
next = g_list_next (guide_list);
guide_list = g_list_next (guide_list);
switch (guide->orientation)
{
@ -434,7 +441,6 @@ gimp_image_resize (GimpImage *gimage,
default:
g_error("Unknown guide orientation I.\n");
}
guide_list = next;
}
/* Don't forget the selection mask! */
@ -469,11 +475,11 @@ gimp_image_scale (GimpImage *gimage,
int new_height)
{
Channel *channel;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
int old_width, old_height;
int layer_width, layer_height;
@ -590,21 +596,22 @@ gimp_image_free_shadow (GimpImage *gimage)
static void
gimp_image_destroy (GtkObject *object)
{
GimpImage* gimage=GIMP_IMAGE(object);
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
GimpImage* gimage = GIMP_IMAGE(object);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
@ -619,7 +626,7 @@ gimp_image_apply_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
@ -715,7 +722,7 @@ gimp_image_replace_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR;
@ -971,8 +978,6 @@ gimp_image_transform_color (GimpImage *gimage,
Guide*
gimp_image_add_hguide (GimpImage *gimage)
{
@ -1061,7 +1066,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
Parasite *parasite)
{
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
parasite differs from the current one and we aren't undoable */
if (parasite_is_undoable(parasite))
undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent(parasite)
@ -1081,6 +1086,7 @@ gimp_image_detach_parasite (GimpImage *gimage,
const char *parasite)
{
Parasite *p;
if (!(p = parasite_list_find(gimage->parasites, parasite)))
return;
if (parasite_is_undoable(p))
@ -1223,7 +1229,7 @@ static void
gimp_image_free_layers (GimpImage *gimage)
{
GSList *list = gimage->layers;
Layer * layer;
Layer *layer;
while (list)
{
@ -1239,8 +1245,8 @@ gimp_image_free_layers (GimpImage *gimage)
static void
gimp_image_free_channels (GimpImage *gimage)
{
GSList *list = gimage->channels;
Channel * channel;
GSList *list = gimage->channels;
Channel *channel;
while (list)
{
@ -1602,8 +1608,8 @@ gimp_image_construct (GimpImage *gimage,
}
void
gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
int w, int h,
gimp_image_invalidate_without_render (GimpImage *gimage,
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
@ -1634,14 +1640,8 @@ gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
void
gimp_image_invalidate (GimpImage *gimage,
int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
TileManager *tm;

View File

@ -142,7 +142,8 @@ gimp_image_class_init (GimpImageClass *klass)
/* static functions */
static void gimp_image_init (GimpImage *gimage)
static void
gimp_image_init (GimpImage *gimage)
{
gimage->has_filename = 0;
gimage->num_cols = 0;
@ -176,15 +177,18 @@ static void gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
GtkType
gimp_image_get_type (void)
{
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
}
@ -231,7 +235,10 @@ gimp_image_free_projection (GimpImage *gimage)
}
static void
gimp_image_allocate_shadow (GimpImage *gimage, int width, int height, int bpp)
gimp_image_allocate_shadow (GimpImage *gimage,
int width,
int height,
int bpp)
{
/* allocate the new projection */
gimage->shadow = tile_manager_new (width, height, bpp);
@ -342,7 +349,7 @@ gimp_image_get_resolution (GimpImage *gimage,
void
gimp_image_set_unit (GimpImage *gimage,
GUnit unit)
GUnit unit)
{
gimage->unit = unit;
}
@ -355,7 +362,8 @@ gimp_image_get_unit (GimpImage *gimage)
void
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc)
{
gimage->save_proc = proc;
}
@ -414,10 +422,9 @@ gimp_image_resize (GimpImage *gimage,
while (guide_list)
{
Guide *guide;
GList *next;
guide = (Guide*) guide_list->data;
next = g_list_next (guide_list);
guide_list = g_list_next (guide_list);
switch (guide->orientation)
{
@ -434,7 +441,6 @@ gimp_image_resize (GimpImage *gimage,
default:
g_error("Unknown guide orientation I.\n");
}
guide_list = next;
}
/* Don't forget the selection mask! */
@ -469,11 +475,11 @@ gimp_image_scale (GimpImage *gimage,
int new_height)
{
Channel *channel;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
int old_width, old_height;
int layer_width, layer_height;
@ -590,21 +596,22 @@ gimp_image_free_shadow (GimpImage *gimage)
static void
gimp_image_destroy (GtkObject *object)
{
GimpImage* gimage=GIMP_IMAGE(object);
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
GimpImage* gimage = GIMP_IMAGE(object);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
@ -619,7 +626,7 @@ gimp_image_apply_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
@ -715,7 +722,7 @@ gimp_image_replace_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR;
@ -971,8 +978,6 @@ gimp_image_transform_color (GimpImage *gimage,
Guide*
gimp_image_add_hguide (GimpImage *gimage)
{
@ -1061,7 +1066,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
Parasite *parasite)
{
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
parasite differs from the current one and we aren't undoable */
if (parasite_is_undoable(parasite))
undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent(parasite)
@ -1081,6 +1086,7 @@ gimp_image_detach_parasite (GimpImage *gimage,
const char *parasite)
{
Parasite *p;
if (!(p = parasite_list_find(gimage->parasites, parasite)))
return;
if (parasite_is_undoable(p))
@ -1223,7 +1229,7 @@ static void
gimp_image_free_layers (GimpImage *gimage)
{
GSList *list = gimage->layers;
Layer * layer;
Layer *layer;
while (list)
{
@ -1239,8 +1245,8 @@ gimp_image_free_layers (GimpImage *gimage)
static void
gimp_image_free_channels (GimpImage *gimage)
{
GSList *list = gimage->channels;
Channel * channel;
GSList *list = gimage->channels;
Channel *channel;
while (list)
{
@ -1602,8 +1608,8 @@ gimp_image_construct (GimpImage *gimage,
}
void
gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
int w, int h,
gimp_image_invalidate_without_render (GimpImage *gimage,
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
@ -1634,14 +1640,8 @@ gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
void
gimp_image_invalidate (GimpImage *gimage,
int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
TileManager *tm;

View File

@ -142,7 +142,8 @@ gimp_image_class_init (GimpImageClass *klass)
/* static functions */
static void gimp_image_init (GimpImage *gimage)
static void
gimp_image_init (GimpImage *gimage)
{
gimage->has_filename = 0;
gimage->num_cols = 0;
@ -176,15 +177,18 @@ static void gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
GtkType
gimp_image_get_type (void)
{
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
}
@ -231,7 +235,10 @@ gimp_image_free_projection (GimpImage *gimage)
}
static void
gimp_image_allocate_shadow (GimpImage *gimage, int width, int height, int bpp)
gimp_image_allocate_shadow (GimpImage *gimage,
int width,
int height,
int bpp)
{
/* allocate the new projection */
gimage->shadow = tile_manager_new (width, height, bpp);
@ -342,7 +349,7 @@ gimp_image_get_resolution (GimpImage *gimage,
void
gimp_image_set_unit (GimpImage *gimage,
GUnit unit)
GUnit unit)
{
gimage->unit = unit;
}
@ -355,7 +362,8 @@ gimp_image_get_unit (GimpImage *gimage)
void
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc)
{
gimage->save_proc = proc;
}
@ -414,10 +422,9 @@ gimp_image_resize (GimpImage *gimage,
while (guide_list)
{
Guide *guide;
GList *next;
guide = (Guide*) guide_list->data;
next = g_list_next (guide_list);
guide_list = g_list_next (guide_list);
switch (guide->orientation)
{
@ -434,7 +441,6 @@ gimp_image_resize (GimpImage *gimage,
default:
g_error("Unknown guide orientation I.\n");
}
guide_list = next;
}
/* Don't forget the selection mask! */
@ -469,11 +475,11 @@ gimp_image_scale (GimpImage *gimage,
int new_height)
{
Channel *channel;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
int old_width, old_height;
int layer_width, layer_height;
@ -590,21 +596,22 @@ gimp_image_free_shadow (GimpImage *gimage)
static void
gimp_image_destroy (GtkObject *object)
{
GimpImage* gimage=GIMP_IMAGE(object);
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
GimpImage* gimage = GIMP_IMAGE(object);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
@ -619,7 +626,7 @@ gimp_image_apply_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
@ -715,7 +722,7 @@ gimp_image_replace_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR;
@ -971,8 +978,6 @@ gimp_image_transform_color (GimpImage *gimage,
Guide*
gimp_image_add_hguide (GimpImage *gimage)
{
@ -1061,7 +1066,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
Parasite *parasite)
{
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
parasite differs from the current one and we aren't undoable */
if (parasite_is_undoable(parasite))
undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent(parasite)
@ -1081,6 +1086,7 @@ gimp_image_detach_parasite (GimpImage *gimage,
const char *parasite)
{
Parasite *p;
if (!(p = parasite_list_find(gimage->parasites, parasite)))
return;
if (parasite_is_undoable(p))
@ -1223,7 +1229,7 @@ static void
gimp_image_free_layers (GimpImage *gimage)
{
GSList *list = gimage->layers;
Layer * layer;
Layer *layer;
while (list)
{
@ -1239,8 +1245,8 @@ gimp_image_free_layers (GimpImage *gimage)
static void
gimp_image_free_channels (GimpImage *gimage)
{
GSList *list = gimage->channels;
Channel * channel;
GSList *list = gimage->channels;
Channel *channel;
while (list)
{
@ -1602,8 +1608,8 @@ gimp_image_construct (GimpImage *gimage,
}
void
gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
int w, int h,
gimp_image_invalidate_without_render (GimpImage *gimage,
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
@ -1634,14 +1640,8 @@ gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
void
gimp_image_invalidate (GimpImage *gimage,
int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
TileManager *tm;

View File

@ -142,7 +142,8 @@ gimp_image_class_init (GimpImageClass *klass)
/* static functions */
static void gimp_image_init (GimpImage *gimage)
static void
gimp_image_init (GimpImage *gimage)
{
gimage->has_filename = 0;
gimage->num_cols = 0;
@ -176,15 +177,18 @@ static void gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
GtkType
gimp_image_get_type (void)
{
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
}
@ -231,7 +235,10 @@ gimp_image_free_projection (GimpImage *gimage)
}
static void
gimp_image_allocate_shadow (GimpImage *gimage, int width, int height, int bpp)
gimp_image_allocate_shadow (GimpImage *gimage,
int width,
int height,
int bpp)
{
/* allocate the new projection */
gimage->shadow = tile_manager_new (width, height, bpp);
@ -342,7 +349,7 @@ gimp_image_get_resolution (GimpImage *gimage,
void
gimp_image_set_unit (GimpImage *gimage,
GUnit unit)
GUnit unit)
{
gimage->unit = unit;
}
@ -355,7 +362,8 @@ gimp_image_get_unit (GimpImage *gimage)
void
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc)
{
gimage->save_proc = proc;
}
@ -414,10 +422,9 @@ gimp_image_resize (GimpImage *gimage,
while (guide_list)
{
Guide *guide;
GList *next;
guide = (Guide*) guide_list->data;
next = g_list_next (guide_list);
guide_list = g_list_next (guide_list);
switch (guide->orientation)
{
@ -434,7 +441,6 @@ gimp_image_resize (GimpImage *gimage,
default:
g_error("Unknown guide orientation I.\n");
}
guide_list = next;
}
/* Don't forget the selection mask! */
@ -469,11 +475,11 @@ gimp_image_scale (GimpImage *gimage,
int new_height)
{
Channel *channel;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
int old_width, old_height;
int layer_width, layer_height;
@ -590,21 +596,22 @@ gimp_image_free_shadow (GimpImage *gimage)
static void
gimp_image_destroy (GtkObject *object)
{
GimpImage* gimage=GIMP_IMAGE(object);
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
GimpImage* gimage = GIMP_IMAGE(object);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
@ -619,7 +626,7 @@ gimp_image_apply_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
@ -715,7 +722,7 @@ gimp_image_replace_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR;
@ -971,8 +978,6 @@ gimp_image_transform_color (GimpImage *gimage,
Guide*
gimp_image_add_hguide (GimpImage *gimage)
{
@ -1061,7 +1066,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
Parasite *parasite)
{
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
parasite differs from the current one and we aren't undoable */
if (parasite_is_undoable(parasite))
undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent(parasite)
@ -1081,6 +1086,7 @@ gimp_image_detach_parasite (GimpImage *gimage,
const char *parasite)
{
Parasite *p;
if (!(p = parasite_list_find(gimage->parasites, parasite)))
return;
if (parasite_is_undoable(p))
@ -1223,7 +1229,7 @@ static void
gimp_image_free_layers (GimpImage *gimage)
{
GSList *list = gimage->layers;
Layer * layer;
Layer *layer;
while (list)
{
@ -1239,8 +1245,8 @@ gimp_image_free_layers (GimpImage *gimage)
static void
gimp_image_free_channels (GimpImage *gimage)
{
GSList *list = gimage->channels;
Channel * channel;
GSList *list = gimage->channels;
Channel *channel;
while (list)
{
@ -1602,8 +1608,8 @@ gimp_image_construct (GimpImage *gimage,
}
void
gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
int w, int h,
gimp_image_invalidate_without_render (GimpImage *gimage,
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
@ -1634,14 +1640,8 @@ gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
void
gimp_image_invalidate (GimpImage *gimage,
int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
TileManager *tm;

View File

@ -142,7 +142,8 @@ gimp_image_class_init (GimpImageClass *klass)
/* static functions */
static void gimp_image_init (GimpImage *gimage)
static void
gimp_image_init (GimpImage *gimage)
{
gimage->has_filename = 0;
gimage->num_cols = 0;
@ -176,15 +177,18 @@ static void gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
GtkType
gimp_image_get_type (void)
{
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
}
@ -231,7 +235,10 @@ gimp_image_free_projection (GimpImage *gimage)
}
static void
gimp_image_allocate_shadow (GimpImage *gimage, int width, int height, int bpp)
gimp_image_allocate_shadow (GimpImage *gimage,
int width,
int height,
int bpp)
{
/* allocate the new projection */
gimage->shadow = tile_manager_new (width, height, bpp);
@ -342,7 +349,7 @@ gimp_image_get_resolution (GimpImage *gimage,
void
gimp_image_set_unit (GimpImage *gimage,
GUnit unit)
GUnit unit)
{
gimage->unit = unit;
}
@ -355,7 +362,8 @@ gimp_image_get_unit (GimpImage *gimage)
void
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc)
{
gimage->save_proc = proc;
}
@ -414,10 +422,9 @@ gimp_image_resize (GimpImage *gimage,
while (guide_list)
{
Guide *guide;
GList *next;
guide = (Guide*) guide_list->data;
next = g_list_next (guide_list);
guide_list = g_list_next (guide_list);
switch (guide->orientation)
{
@ -434,7 +441,6 @@ gimp_image_resize (GimpImage *gimage,
default:
g_error("Unknown guide orientation I.\n");
}
guide_list = next;
}
/* Don't forget the selection mask! */
@ -469,11 +475,11 @@ gimp_image_scale (GimpImage *gimage,
int new_height)
{
Channel *channel;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
int old_width, old_height;
int layer_width, layer_height;
@ -590,21 +596,22 @@ gimp_image_free_shadow (GimpImage *gimage)
static void
gimp_image_destroy (GtkObject *object)
{
GimpImage* gimage=GIMP_IMAGE(object);
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
GimpImage* gimage = GIMP_IMAGE(object);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
@ -619,7 +626,7 @@ gimp_image_apply_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
@ -715,7 +722,7 @@ gimp_image_replace_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR;
@ -971,8 +978,6 @@ gimp_image_transform_color (GimpImage *gimage,
Guide*
gimp_image_add_hguide (GimpImage *gimage)
{
@ -1061,7 +1066,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
Parasite *parasite)
{
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
parasite differs from the current one and we aren't undoable */
if (parasite_is_undoable(parasite))
undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent(parasite)
@ -1081,6 +1086,7 @@ gimp_image_detach_parasite (GimpImage *gimage,
const char *parasite)
{
Parasite *p;
if (!(p = parasite_list_find(gimage->parasites, parasite)))
return;
if (parasite_is_undoable(p))
@ -1223,7 +1229,7 @@ static void
gimp_image_free_layers (GimpImage *gimage)
{
GSList *list = gimage->layers;
Layer * layer;
Layer *layer;
while (list)
{
@ -1239,8 +1245,8 @@ gimp_image_free_layers (GimpImage *gimage)
static void
gimp_image_free_channels (GimpImage *gimage)
{
GSList *list = gimage->channels;
Channel * channel;
GSList *list = gimage->channels;
Channel *channel;
while (list)
{
@ -1602,8 +1608,8 @@ gimp_image_construct (GimpImage *gimage,
}
void
gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
int w, int h,
gimp_image_invalidate_without_render (GimpImage *gimage,
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
@ -1634,14 +1640,8 @@ gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
void
gimp_image_invalidate (GimpImage *gimage,
int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
TileManager *tm;

View File

@ -103,8 +103,8 @@ void undo_free_qmask (int, void *);
/* Sizing functions */
static int layer_size (Layer *);
static int channel_size (Channel *);
static int layer_size (Layer *);
static int channel_size (Channel *);
static int group_count = 0;
static int shrink_wrap = FALSE;
@ -117,7 +117,8 @@ layer_size (Layer *layer)
{
int size;
size = sizeof (Layer) + GIMP_DRAWABLE(layer)->width * GIMP_DRAWABLE(layer)->height * GIMP_DRAWABLE(layer)->bytes +
size = sizeof (Layer) +
GIMP_DRAWABLE(layer)->width * GIMP_DRAWABLE(layer)->height * GIMP_DRAWABLE(layer)->bytes +
strlen (GIMP_DRAWABLE(layer)->name);
if (layer_mask (layer))
@ -276,7 +277,7 @@ static int
pop_stack (GImage *gimage,
GSList **stack_ptr,
GSList **unstack_ptr,
int state)
int state)
{
Undo * object;
GSList *stack;
@ -452,12 +453,12 @@ struct _image_undo
int
undo_push_image (GImage *gimage,
undo_push_image (GImage *gimage,
GimpDrawable *drawable,
int x1,
int y1,
int x2,
int y2)
int x1,
int y1,
int x2,
int y2)
{
long size;
Undo *new;
@ -509,14 +510,14 @@ undo_push_image (GImage *gimage,
int
undo_push_image_mod (GImage *gimage,
undo_push_image_mod (GImage *gimage,
GimpDrawable *drawable,
int x1,
int y1,
int x2,
int y2,
void *tiles_ptr,
int sparse)
int x1,
int y1,
int x2,
int y2,
void *tiles_ptr,
int sparse)
{
long size;
int dwidth, dheight;
@ -803,7 +804,7 @@ undo_free_mask (int state,
/* Layer displacement Undo functions */
int
undo_push_layer_displace (GImage *gimage,
undo_push_layer_displace (GImage *gimage,
GimpLayer *layer)
{
Undo * new;
@ -1218,7 +1219,8 @@ undo_push_layer_mod (GImage *gimage,
tiles = GIMP_DRAWABLE(layer)->tiles;
tiles->x = GIMP_DRAWABLE(layer)->offset_x;
tiles->y = GIMP_DRAWABLE(layer)->offset_y;
size = GIMP_DRAWABLE(layer)->width * GIMP_DRAWABLE(layer)->height * GIMP_DRAWABLE(layer)->bytes + sizeof (void *) * 3;
size = GIMP_DRAWABLE(layer)->width * GIMP_DRAWABLE(layer)->height *
GIMP_DRAWABLE(layer)->bytes + sizeof (void *) * 3;
if ((new = undo_push (gimage, size, LAYER_MOD)))
{
@ -1306,7 +1308,8 @@ undo_pop_layer_mod (GImage *gimage,
data[1] = temp;
/* Issue the second update */
drawable_update (GIMP_DRAWABLE(layer), 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height);
drawable_update (GIMP_DRAWABLE(layer), 0, 0,
GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height);
return TRUE;
}
@ -1398,7 +1401,8 @@ undo_pop_layer_mask (GImage *gimage,
* this is undoing an add...
*/
if ((state == REDO && lmu->mode == DISCARD) || state == UNDO)
drawable_update (GIMP_DRAWABLE(lmu->layer), 0, 0, GIMP_DRAWABLE(lmu->layer)->width, GIMP_DRAWABLE(lmu->layer)->height);
drawable_update (GIMP_DRAWABLE(lmu->layer), 0, 0,
GIMP_DRAWABLE(lmu->layer)->width, GIMP_DRAWABLE(lmu->layer)->height);
}
/* restore layer */
else
@ -1415,7 +1419,8 @@ undo_pop_layer_mask (GImage *gimage,
* this is redoing an add
*/
if ((state == UNDO && lmu->mode == DISCARD) || state == REDO)
drawable_update (GIMP_DRAWABLE(lmu->layer), 0, 0, GIMP_DRAWABLE(lmu->layer)->width, GIMP_DRAWABLE(lmu->layer)->height);
drawable_update (GIMP_DRAWABLE(lmu->layer), 0, 0,
GIMP_DRAWABLE(lmu->layer)->width, GIMP_DRAWABLE(lmu->layer)->height);
}
return TRUE;
@ -1515,7 +1520,8 @@ undo_pop_channel (GImage *gimage,
gimage_set_active_channel (gimage, cu->prev_channel);
/* update the area */
drawable_update (GIMP_DRAWABLE(cu->channel), 0, 0, GIMP_DRAWABLE(cu->channel)->width, GIMP_DRAWABLE(cu->channel)->height);
drawable_update (GIMP_DRAWABLE(cu->channel), 0, 0,
GIMP_DRAWABLE(cu->channel)->width, GIMP_DRAWABLE(cu->channel)->height);
}
/* restore channel */
else
@ -1530,7 +1536,8 @@ undo_pop_channel (GImage *gimage,
gimage_set_active_channel (gimage, cu->channel);
/* update the area */
drawable_update (GIMP_DRAWABLE(cu->channel), 0, 0, GIMP_DRAWABLE(cu->channel)->width, GIMP_DRAWABLE(cu->channel)->height);
drawable_update (GIMP_DRAWABLE(cu->channel), 0, 0,
GIMP_DRAWABLE(cu->channel)->width, GIMP_DRAWABLE(cu->channel)->height);
}
return TRUE;
@ -1629,7 +1636,8 @@ undo_pop_channel_mod (GImage *gimage,
tiles = (TileManager *) data[1];
/* Issue the first update */
drawable_update (GIMP_DRAWABLE(channel), 0, 0, GIMP_DRAWABLE(channel)->width, GIMP_DRAWABLE(channel)->height);
drawable_update (GIMP_DRAWABLE(channel), 0, 0,
GIMP_DRAWABLE(channel)->width, GIMP_DRAWABLE(channel)->height);
temp = GIMP_DRAWABLE(channel)->tiles;
GIMP_DRAWABLE(channel)->tiles = tiles;
@ -1640,7 +1648,8 @@ undo_pop_channel_mod (GImage *gimage,
data[1] = temp;
/* Issue the second update */
drawable_update (GIMP_DRAWABLE(channel), 0, 0, GIMP_DRAWABLE(channel)->width, GIMP_DRAWABLE(channel)->height);
drawable_update (GIMP_DRAWABLE(channel), 0, 0,
GIMP_DRAWABLE(channel)->width, GIMP_DRAWABLE(channel)->height);
return TRUE;
}
@ -1727,8 +1736,11 @@ undo_pop_fs_to_layer (GImage *gimage,
gimage->floating_sel = fsu->layer;
/* restore the contents of the drawable */
floating_sel_store (fsu->layer, GIMP_DRAWABLE(fsu->layer)->offset_x, GIMP_DRAWABLE(fsu->layer)->offset_y,
GIMP_DRAWABLE(fsu->layer)->width, GIMP_DRAWABLE(fsu->layer)->height);
floating_sel_store (fsu->layer,
GIMP_DRAWABLE(fsu->layer)->offset_x,
GIMP_DRAWABLE(fsu->layer)->offset_y,
GIMP_DRAWABLE(fsu->layer)->width,
GIMP_DRAWABLE(fsu->layer)->height);
fsu->layer->fs.initial = TRUE;
/* clear the selection */
@ -1740,8 +1752,11 @@ undo_pop_fs_to_layer (GImage *gimage,
case REDO:
/* restore the contents of the drawable */
floating_sel_restore (fsu->layer, GIMP_DRAWABLE(fsu->layer)->offset_x, GIMP_DRAWABLE(fsu->layer)->offset_y,
GIMP_DRAWABLE(fsu->layer)->width, GIMP_DRAWABLE(fsu->layer)->height);
floating_sel_restore (fsu->layer,
GIMP_DRAWABLE(fsu->layer)->offset_x,
GIMP_DRAWABLE(fsu->layer)->offset_y,
GIMP_DRAWABLE(fsu->layer)->width,
GIMP_DRAWABLE(fsu->layer)->height);
/* Update the preview for the gimage and underlying drawable */
drawable_invalidate_preview (GIMP_DRAWABLE(fsu->layer));
@ -1824,16 +1839,20 @@ undo_pop_fs_rigor (GImage *gimage,
/* restore the contents of drawable the floating layer is attached to */
if (floating_layer->fs.initial == FALSE)
floating_sel_restore (floating_layer,
GIMP_DRAWABLE(floating_layer)->offset_x, GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width, GIMP_DRAWABLE(floating_layer)->height);
GIMP_DRAWABLE(floating_layer)->offset_x,
GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width,
GIMP_DRAWABLE(floating_layer)->height);
floating_layer->fs.initial = TRUE;
break;
case REDO:
/* store the affected area from the drawable in the backing store */
floating_sel_store (floating_layer,
GIMP_DRAWABLE(floating_layer)->offset_x, GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width, GIMP_DRAWABLE(floating_layer)->height);
GIMP_DRAWABLE(floating_layer)->offset_x,
GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width,
GIMP_DRAWABLE(floating_layer)->height);
floating_layer->fs.initial = TRUE;
break;
}
@ -1897,8 +1916,10 @@ undo_pop_fs_relax (GImage *gimage,
case UNDO:
/* store the affected area from the drawable in the backing store */
floating_sel_store (floating_layer,
GIMP_DRAWABLE(floating_layer)->offset_x, GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width, GIMP_DRAWABLE(floating_layer)->height);
GIMP_DRAWABLE(floating_layer)->offset_x,
GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width,
GIMP_DRAWABLE(floating_layer)->height);
floating_layer->fs.initial = TRUE;
break;
@ -1906,8 +1927,10 @@ undo_pop_fs_relax (GImage *gimage,
/* restore the contents of drawable the floating layer is attached to */
if (floating_layer->fs.initial == FALSE)
floating_sel_restore (floating_layer,
GIMP_DRAWABLE(floating_layer)->offset_x, GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width, GIMP_DRAWABLE(floating_layer)->height);
GIMP_DRAWABLE(floating_layer)->offset_x,
GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width,
GIMP_DRAWABLE(floating_layer)->height);
floating_layer->fs.initial = TRUE;
break;
}
@ -2063,7 +2086,6 @@ undo_pop_qmask (GImage *gimage,
{
QmaskUndo *data;
int tmp;
int tmp_ref;
data = data_ptr;
@ -2195,10 +2217,10 @@ typedef struct _ParasiteUndo ParasiteUndo;
struct _ParasiteUndo
{
GImage *gimage;
GImage *gimage;
GimpDrawable *drawable;
Parasite *parasite;
char *name;
Parasite *parasite;
char *name;
};
int
@ -2223,8 +2245,8 @@ undo_push_image_parasite (GImage *gimage,
data->gimage = gimage;
data->drawable = NULL;
data->name = g_strdup(parasite_name(parasite));
data->parasite = parasite_copy(gimp_image_find_parasite(gimage, data->name));
data->name = g_strdup (parasite_name (parasite));
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->name));
return TRUE;
}
@ -2254,8 +2276,8 @@ undo_push_image_parasite_remove (GImage *gimage,
data->gimage = gimage;
data->drawable = NULL;
data->name = g_strdup(name);
data->parasite = parasite_copy(gimp_image_find_parasite(gimage, data->name));
data->name = g_strdup (name);
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->name));
return TRUE;
}
@ -2286,8 +2308,8 @@ undo_push_drawable_parasite (GImage *gimage,
data->gimage = NULL;
data->drawable = drawable;
data->name = g_strdup(parasite_name(parasite));
data->parasite = parasite_copy(gimp_drawable_find_parasite(drawable, data->name));
data->name = g_strdup (parasite_name (parasite));
data->parasite = parasite_copy (gimp_drawable_find_parasite (drawable, data->name));
return TRUE;
}
@ -2317,8 +2339,8 @@ undo_push_drawable_parasite_remove (GImage *gimage,
data->gimage = NULL;
data->drawable = drawable;
data->name = g_strdup(name);
data->parasite = parasite_copy(gimp_drawable_find_parasite(drawable, data->name));
data->name = g_strdup (name);
data->parasite = parasite_copy (gimp_drawable_find_parasite (drawable, data->name));
return TRUE;
}
@ -2328,9 +2350,9 @@ undo_push_drawable_parasite_remove (GImage *gimage,
int
undo_pop_parasite (GImage *gimage,
int state,
int type,
void *data_ptr)
int state,
int type,
void *data_ptr)
{
ParasiteUndo *data;
Parasite *tmp;
@ -2341,33 +2363,33 @@ undo_pop_parasite (GImage *gimage,
if (data->gimage)
{
data->parasite = parasite_copy(gimp_image_find_parasite(gimage,
data->name));
data->parasite = parasite_copy (gimp_image_find_parasite (gimage,
data->name));
if (tmp)
parasite_list_add(data->gimage->parasites, tmp);
parasite_list_add (data->gimage->parasites, tmp);
else
parasite_list_remove(data->gimage->parasites, data->name);
parasite_list_remove (data->gimage->parasites, data->name);
}
else if (data->drawable)
{
data->parasite = parasite_copy(gimp_drawable_find_parasite(data->drawable,
data->name));
data->parasite = parasite_copy (gimp_drawable_find_parasite (data->drawable,
data->name));
if (tmp)
parasite_list_add(data->drawable->parasites, tmp);
parasite_list_add (data->drawable->parasites, tmp);
else
parasite_list_remove(data->drawable->parasites, data->name);
parasite_list_remove (data->drawable->parasites, data->name);
}
else
{
data->parasite = parasite_copy(gimp_find_parasite(data->name));
data->parasite = parasite_copy (gimp_find_parasite (data->name));
if (tmp)
gimp_attach_parasite(tmp);
gimp_attach_parasite (tmp);
else
gimp_detach_parasite(data->name);
gimp_detach_parasite (data->name);
}
if (tmp)
parasite_free(tmp);
parasite_free (tmp);
/* if ((tmp && parasite_is_persistant(tmp)) || */
/* (data->parasite && parasite_is_persistant(data->parasite))) */
@ -2387,7 +2409,7 @@ undo_pop_parasite (GImage *gimage,
void
undo_free_parasite (int state,
void *data_ptr)
void *data_ptr)
{
ParasiteUndo *data;

View File

@ -142,7 +142,8 @@ gimp_image_class_init (GimpImageClass *klass)
/* static functions */
static void gimp_image_init (GimpImage *gimage)
static void
gimp_image_init (GimpImage *gimage)
{
gimage->has_filename = 0;
gimage->num_cols = 0;
@ -176,15 +177,18 @@ static void gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
GtkType
gimp_image_get_type (void)
{
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
}
@ -231,7 +235,10 @@ gimp_image_free_projection (GimpImage *gimage)
}
static void
gimp_image_allocate_shadow (GimpImage *gimage, int width, int height, int bpp)
gimp_image_allocate_shadow (GimpImage *gimage,
int width,
int height,
int bpp)
{
/* allocate the new projection */
gimage->shadow = tile_manager_new (width, height, bpp);
@ -342,7 +349,7 @@ gimp_image_get_resolution (GimpImage *gimage,
void
gimp_image_set_unit (GimpImage *gimage,
GUnit unit)
GUnit unit)
{
gimage->unit = unit;
}
@ -355,7 +362,8 @@ gimp_image_get_unit (GimpImage *gimage)
void
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc)
{
gimage->save_proc = proc;
}
@ -414,10 +422,9 @@ gimp_image_resize (GimpImage *gimage,
while (guide_list)
{
Guide *guide;
GList *next;
guide = (Guide*) guide_list->data;
next = g_list_next (guide_list);
guide_list = g_list_next (guide_list);
switch (guide->orientation)
{
@ -434,7 +441,6 @@ gimp_image_resize (GimpImage *gimage,
default:
g_error("Unknown guide orientation I.\n");
}
guide_list = next;
}
/* Don't forget the selection mask! */
@ -469,11 +475,11 @@ gimp_image_scale (GimpImage *gimage,
int new_height)
{
Channel *channel;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
int old_width, old_height;
int layer_width, layer_height;
@ -590,21 +596,22 @@ gimp_image_free_shadow (GimpImage *gimage)
static void
gimp_image_destroy (GtkObject *object)
{
GimpImage* gimage=GIMP_IMAGE(object);
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
GimpImage* gimage = GIMP_IMAGE(object);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
@ -619,7 +626,7 @@ gimp_image_apply_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
@ -715,7 +722,7 @@ gimp_image_replace_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR;
@ -971,8 +978,6 @@ gimp_image_transform_color (GimpImage *gimage,
Guide*
gimp_image_add_hguide (GimpImage *gimage)
{
@ -1061,7 +1066,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
Parasite *parasite)
{
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
parasite differs from the current one and we aren't undoable */
if (parasite_is_undoable(parasite))
undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent(parasite)
@ -1081,6 +1086,7 @@ gimp_image_detach_parasite (GimpImage *gimage,
const char *parasite)
{
Parasite *p;
if (!(p = parasite_list_find(gimage->parasites, parasite)))
return;
if (parasite_is_undoable(p))
@ -1223,7 +1229,7 @@ static void
gimp_image_free_layers (GimpImage *gimage)
{
GSList *list = gimage->layers;
Layer * layer;
Layer *layer;
while (list)
{
@ -1239,8 +1245,8 @@ gimp_image_free_layers (GimpImage *gimage)
static void
gimp_image_free_channels (GimpImage *gimage)
{
GSList *list = gimage->channels;
Channel * channel;
GSList *list = gimage->channels;
Channel *channel;
while (list)
{
@ -1602,8 +1608,8 @@ gimp_image_construct (GimpImage *gimage,
}
void
gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
int w, int h,
gimp_image_invalidate_without_render (GimpImage *gimage,
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
@ -1634,14 +1640,8 @@ gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
void
gimp_image_invalidate (GimpImage *gimage,
int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
TileManager *tm;

View File

@ -142,7 +142,8 @@ gimp_image_class_init (GimpImageClass *klass)
/* static functions */
static void gimp_image_init (GimpImage *gimage)
static void
gimp_image_init (GimpImage *gimage)
{
gimage->has_filename = 0;
gimage->num_cols = 0;
@ -176,15 +177,18 @@ static void gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
GtkType
gimp_image_get_type (void)
{
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
}
@ -231,7 +235,10 @@ gimp_image_free_projection (GimpImage *gimage)
}
static void
gimp_image_allocate_shadow (GimpImage *gimage, int width, int height, int bpp)
gimp_image_allocate_shadow (GimpImage *gimage,
int width,
int height,
int bpp)
{
/* allocate the new projection */
gimage->shadow = tile_manager_new (width, height, bpp);
@ -342,7 +349,7 @@ gimp_image_get_resolution (GimpImage *gimage,
void
gimp_image_set_unit (GimpImage *gimage,
GUnit unit)
GUnit unit)
{
gimage->unit = unit;
}
@ -355,7 +362,8 @@ gimp_image_get_unit (GimpImage *gimage)
void
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc)
{
gimage->save_proc = proc;
}
@ -414,10 +422,9 @@ gimp_image_resize (GimpImage *gimage,
while (guide_list)
{
Guide *guide;
GList *next;
guide = (Guide*) guide_list->data;
next = g_list_next (guide_list);
guide_list = g_list_next (guide_list);
switch (guide->orientation)
{
@ -434,7 +441,6 @@ gimp_image_resize (GimpImage *gimage,
default:
g_error("Unknown guide orientation I.\n");
}
guide_list = next;
}
/* Don't forget the selection mask! */
@ -469,11 +475,11 @@ gimp_image_scale (GimpImage *gimage,
int new_height)
{
Channel *channel;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
int old_width, old_height;
int layer_width, layer_height;
@ -590,21 +596,22 @@ gimp_image_free_shadow (GimpImage *gimage)
static void
gimp_image_destroy (GtkObject *object)
{
GimpImage* gimage=GIMP_IMAGE(object);
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
GimpImage* gimage = GIMP_IMAGE(object);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
@ -619,7 +626,7 @@ gimp_image_apply_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
@ -715,7 +722,7 @@ gimp_image_replace_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR;
@ -971,8 +978,6 @@ gimp_image_transform_color (GimpImage *gimage,
Guide*
gimp_image_add_hguide (GimpImage *gimage)
{
@ -1061,7 +1066,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
Parasite *parasite)
{
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
parasite differs from the current one and we aren't undoable */
if (parasite_is_undoable(parasite))
undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent(parasite)
@ -1081,6 +1086,7 @@ gimp_image_detach_parasite (GimpImage *gimage,
const char *parasite)
{
Parasite *p;
if (!(p = parasite_list_find(gimage->parasites, parasite)))
return;
if (parasite_is_undoable(p))
@ -1223,7 +1229,7 @@ static void
gimp_image_free_layers (GimpImage *gimage)
{
GSList *list = gimage->layers;
Layer * layer;
Layer *layer;
while (list)
{
@ -1239,8 +1245,8 @@ gimp_image_free_layers (GimpImage *gimage)
static void
gimp_image_free_channels (GimpImage *gimage)
{
GSList *list = gimage->channels;
Channel * channel;
GSList *list = gimage->channels;
Channel *channel;
while (list)
{
@ -1602,8 +1608,8 @@ gimp_image_construct (GimpImage *gimage,
}
void
gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
int w, int h,
gimp_image_invalidate_without_render (GimpImage *gimage,
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
@ -1634,14 +1640,8 @@ gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
void
gimp_image_invalidate (GimpImage *gimage,
int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
TileManager *tm;

View File

@ -23,17 +23,19 @@
to proper places. That is, the handlers should be moved to
layers_dialog, gdisplay, tools, etc.. */
static void gimage_dirty_handler (GimpImage* gimage);
static void gimage_destroy_handler (GimpImage* gimage);
static void gimage_cmap_change_handler (GimpImage* gimage, gint ncol,
gpointer user_data);
static void gimage_rename_handler (GimpImage* gimage);
static void gimage_resize_handler (GimpImage* gimage);
static void gimage_restructure_handler (GimpImage* gimage);
static void gimage_repaint_handler (GimpImage* gimage, gint, gint, gint, gint);
static void gimage_dirty_handler (GimpImage* gimage);
static void gimage_destroy_handler (GimpImage* gimage);
static void gimage_cmap_change_handler (GimpImage* gimage, gint ncol, gpointer user_data);
static void gimage_rename_handler (GimpImage* gimage);
static void gimage_resize_handler (GimpImage* gimage);
static void gimage_restructure_handler (GimpImage* gimage);
static void gimage_repaint_handler (GimpImage* gimage, gint, gint, gint, gint);
GImage*
gimage_new(int width, int height, GimpImageBaseType base_type)
gimage_new(int width,
int height,
GimpImageBaseType base_type)
{
GimpImage* gimage = gimp_image_new (width, height, base_type);
@ -52,17 +54,16 @@ gimage_new(int width, int height, GimpImageBaseType base_type)
gtk_signal_connect (GTK_OBJECT (gimage), "colormap_changed",
GTK_SIGNAL_FUNC(gimage_cmap_change_handler), NULL);
gimp_set_add(image_context, gimage);
gimp_set_add (image_context, gimage);
palette_import_image_new(gimage);
palette_import_image_new (gimage);
return gimage;
}
GImage*
gimage_get_ID (gint ID)
{
return pdb_id_to_image(ID);
return pdb_id_to_image (ID);
}
@ -74,19 +75,21 @@ void
gimage_delete (GImage *gimage)
{
gimage->ref_count--;
if (gimage->ref_count <= 0)
gtk_object_unref (GTK_OBJECT(gimage));
if (gimage->ref_count <= 0)
gtk_object_unref (GTK_OBJECT (gimage));
}
static void
invalidate_cb(gpointer image, gpointer user_data){
gimp_image_invalidate_preview(GIMP_IMAGE(image));
invalidate_cb (gpointer image,
gpointer user_data)
{
gimp_image_invalidate_preview (GIMP_IMAGE(image));
}
void
gimage_invalidate_previews (void)
{
gimp_set_foreach(image_context, invalidate_cb, NULL);
gimp_set_foreach (image_context, invalidate_cb, NULL);
}
static void
@ -107,21 +110,23 @@ gimage_dirty_handler (GimpImage* gimage)
}
static void
gimlist_cb(gpointer im, gpointer data){
GSList** l=(GSList**)data;
*l=g_slist_prepend(*l, im);
gimlist_cb (gpointer im,
gpointer data)
{
GSList** l=(GSList**)data;
*l=g_slist_prepend(*l, im);
}
gint
gimage_image_count()
gimage_image_count (void)
{
GSList *list=NULL;
gint num_images = 0;
gimage_foreach(gimlist_cb, &list);
gimage_foreach (gimlist_cb, &list);
num_images = g_slist_length (list);
g_slist_free(list);
g_slist_free (list);
return (num_images);
}
@ -129,22 +134,23 @@ gimage_image_count()
static void
gimage_destroy_handler (GimpImage* gimage)
{
/* free the undo list */
undo_free (gimage);
palette_import_image_destroyed(gimage);
palette_import_image_destroyed (gimage);
if(gimage_image_count() == 1) /* This is the last image */
if (gimage_image_count () == 1) /* This is the last image */
{
dialog_show_toolbox();
dialog_show_toolbox ();
}
}
static void gimage_cmap_change_handler (GimpImage* gimage, gint ncol,
gpointer user_data)
static void
gimage_cmap_change_handler (GimpImage *gimage,
gint ncol,
gpointer user_data)
{
gdisplays_update_full(gimage);
gdisplays_update_full (gimage);
}
@ -154,7 +160,7 @@ gimage_rename_handler (GimpImage* gimage)
gdisplays_update_title (gimage);
lc_dialog_update_image_list ();
palette_import_image_renamed(gimage);
palette_import_image_renamed (gimage);
}
static void
@ -178,7 +184,11 @@ gimage_restructure_handler (GimpImage* gimage)
}
static void
gimage_repaint_handler (GimpImage* gimage, gint x, gint y, gint w, gint h)
gimage_repaint_handler (GimpImage* gimage,
gint x,
gint y,
gint w,
gint h)
{
gdisplays_update_area (gimage, x, y, w, h);
}
@ -188,27 +198,29 @@ gimage_repaint_handler (GimpImage* gimage, gint x, gint y, gint w, gint h)
/* These really belong in the layer class */
void
gimage_set_layer_mask_apply (GImage *gimage, GimpLayer* layer)
gimage_set_layer_mask_apply (GImage *gimage,
GimpLayer *layer)
{
int off_x, off_y;
g_return_if_fail(gimage);
g_return_if_fail(layer);
g_return_if_fail (gimage);
g_return_if_fail (layer);
if (! layer->mask)
return;
layer->apply_mask = ! layer->apply_mask;
drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y);
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gdisplays_update_area (gimage, off_x, off_y,
drawable_width (GIMP_DRAWABLE(layer)),
drawable_height (GIMP_DRAWABLE(layer)));
drawable_width (GIMP_DRAWABLE (layer)),
drawable_height (GIMP_DRAWABLE (layer)));
}
void
gimage_set_layer_mask_edit (GImage *gimage, Layer * layer, int edit)
gimage_set_layer_mask_edit (GImage *gimage,
Layer *layer,
int edit)
{
/* find the layer */
if (!layer)
@ -220,24 +232,32 @@ gimage_set_layer_mask_edit (GImage *gimage, Layer * layer, int edit)
void
gimage_set_layer_mask_show (GImage *gimage, GimpLayer* layer)
gimage_set_layer_mask_show (GImage *gimage,
GimpLayer *layer)
{
int off_x, off_y;
g_return_if_fail(gimage);
g_return_if_fail(layer);
g_return_if_fail (gimage);
g_return_if_fail (layer);
if (! layer->mask)
return;
layer->show_mask = ! layer->show_mask;
drawable_offsets (GIMP_DRAWABLE(layer), &off_x, &off_y);
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
gdisplays_update_area (gimage, off_x, off_y,
drawable_width (GIMP_DRAWABLE(layer)), drawable_height (GIMP_DRAWABLE(layer)));
drawable_width (GIMP_DRAWABLE (layer)),
drawable_height (GIMP_DRAWABLE (layer)));
}
void
gimage_foreach (GFunc func, gpointer user_data){
gimp_set_foreach(image_context, func, user_data);
gimage_foreach (GFunc func,
gpointer user_data)
{
gimp_set_foreach (image_context, func, user_data);
}

View File

@ -24,29 +24,14 @@
typedef GimpImage GImage;
GImage*
gimage_new(int width, int height, GimpImageBaseType base_type);
GImage*
gimage_get_ID (gint ID);
void
gimage_delete (GImage *gimage);
void
gimage_invalidate_previews (void);
void
gimage_set_layer_mask_apply (GImage *gimage, GimpLayer* layer);
void
gimage_set_layer_mask_edit (GImage *gimage, GimpLayer * layer, int edit);
void
gimage_set_layer_mask_show (GImage *gimage, GimpLayer* layer);
void
gimage_foreach (GFunc func, gpointer user_data);
GImage* gimage_new (int width, int height, GimpImageBaseType base_type);
GImage* gimage_get_ID (gint ID);
void gimage_delete (GImage *gimage);
void gimage_invalidate_previews (void);
void gimage_set_layer_mask_apply (GImage *gimage, GimpLayer *layer);
void gimage_set_layer_mask_edit (GImage *gimage, GimpLayer *layer, int edit);
void gimage_set_layer_mask_show (GImage *gimage, GimpLayer *layer);
void gimage_foreach (GFunc func, gpointer user_data);
#define gimage_set_filename gimp_image_set_filename

View File

@ -142,7 +142,8 @@ gimp_image_class_init (GimpImageClass *klass)
/* static functions */
static void gimp_image_init (GimpImage *gimage)
static void
gimp_image_init (GimpImage *gimage)
{
gimage->has_filename = 0;
gimage->num_cols = 0;
@ -176,15 +177,18 @@ static void gimp_image_init (GimpImage *gimage)
gimage->paths = NULL;
}
GtkType gimp_image_get_type(void){
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
GtkType
gimp_image_get_type (void)
{
static GtkType type;
GIMP_TYPE_INIT(type,
GimpImage,
GimpImageClass,
gimp_image_init,
gimp_image_class_init,
GIMP_TYPE_OBJECT);
return type;
}
@ -231,7 +235,10 @@ gimp_image_free_projection (GimpImage *gimage)
}
static void
gimp_image_allocate_shadow (GimpImage *gimage, int width, int height, int bpp)
gimp_image_allocate_shadow (GimpImage *gimage,
int width,
int height,
int bpp)
{
/* allocate the new projection */
gimage->shadow = tile_manager_new (width, height, bpp);
@ -342,7 +349,7 @@ gimp_image_get_resolution (GimpImage *gimage,
void
gimp_image_set_unit (GimpImage *gimage,
GUnit unit)
GUnit unit)
{
gimage->unit = unit;
}
@ -355,7 +362,8 @@ gimp_image_get_unit (GimpImage *gimage)
void
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc)
{
gimage->save_proc = proc;
}
@ -414,10 +422,9 @@ gimp_image_resize (GimpImage *gimage,
while (guide_list)
{
Guide *guide;
GList *next;
guide = (Guide*) guide_list->data;
next = g_list_next (guide_list);
guide_list = g_list_next (guide_list);
switch (guide->orientation)
{
@ -434,7 +441,6 @@ gimp_image_resize (GimpImage *gimage,
default:
g_error("Unknown guide orientation I.\n");
}
guide_list = next;
}
/* Don't forget the selection mask! */
@ -469,11 +475,11 @@ gimp_image_scale (GimpImage *gimage,
int new_height)
{
Channel *channel;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
Layer *layer;
Layer *floating_layer;
GSList *list;
GList *glist;
Guide *guide;
int old_width, old_height;
int layer_width, layer_height;
@ -590,21 +596,22 @@ gimp_image_free_shadow (GimpImage *gimage)
static void
gimp_image_destroy (GtkObject *object)
{
GimpImage* gimage=GIMP_IMAGE(object);
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
GimpImage* gimage = GIMP_IMAGE(object);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
gimp_image_free_projection (gimage);
gimp_image_free_shadow (gimage);
if (gimage->cmap)
g_free (gimage->cmap);
if (gimage->has_filename)
g_free (gimage->filename);
gimp_image_free_layers (gimage);
gimp_image_free_channels (gimage);
channel_delete (gimage->selection_mask);
if (gimage->parasites)
gtk_object_unref(GTK_OBJECT(gimage->parasites));
}
void
@ -619,7 +626,7 @@ gimp_image_apply_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR, maskPR;
@ -715,7 +722,7 @@ gimp_image_replace_image (GimpImage *gimage,
int x,
int y)
{
Channel * mask;
Channel *mask;
int x1, y1, x2, y2;
int offset_x, offset_y;
PixelRegion src1PR, destPR;
@ -971,8 +978,6 @@ gimp_image_transform_color (GimpImage *gimage,
Guide*
gimp_image_add_hguide (GimpImage *gimage)
{
@ -1061,7 +1066,7 @@ gimp_image_attach_parasite (GimpImage *gimage,
Parasite *parasite)
{
/* only set the dirty bit manually if we can be saved and the new
parasite differs from the current one and we arn't undoable */
parasite differs from the current one and we aren't undoable */
if (parasite_is_undoable(parasite))
undo_push_image_parasite (gimage, parasite);
if (parasite_is_persistent(parasite)
@ -1081,6 +1086,7 @@ gimp_image_detach_parasite (GimpImage *gimage,
const char *parasite)
{
Parasite *p;
if (!(p = parasite_list_find(gimage->parasites, parasite)))
return;
if (parasite_is_undoable(p))
@ -1223,7 +1229,7 @@ static void
gimp_image_free_layers (GimpImage *gimage)
{
GSList *list = gimage->layers;
Layer * layer;
Layer *layer;
while (list)
{
@ -1239,8 +1245,8 @@ gimp_image_free_layers (GimpImage *gimage)
static void
gimp_image_free_channels (GimpImage *gimage)
{
GSList *list = gimage->channels;
Channel * channel;
GSList *list = gimage->channels;
Channel *channel;
while (list)
{
@ -1602,8 +1608,8 @@ gimp_image_construct (GimpImage *gimage,
}
void
gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
int w, int h,
gimp_image_invalidate_without_render (GimpImage *gimage,
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
@ -1634,14 +1640,8 @@ gimp_image_invalidate_without_render (GimpImage *gimage, int x, int y,
void
gimp_image_invalidate (GimpImage *gimage,
int x,
int y,
int w,
int h,
int x1,
int y1,
int x2,
int y2)
int x, int y, int w, int h,
int x1, int y1, int x2, int y2)
{
Tile *tile;
TileManager *tm;

View File

@ -613,6 +613,7 @@ brush_select_brush_changed (BrushSelectP bsp,
{
display_brushes (bsp);
gtk_widget_draw (bsp->preview, NULL);
update_active_brush_field (bsp);
}
}

View File

@ -25,14 +25,15 @@
#include "libgimp/gimpintl.h"
void ops_button_pressed_callback (GtkWidget*, GdkEventButton*, gpointer);
void ops_button_pressed_callback (GtkWidget*, GdkEventButton*, gpointer);
void ops_button_extended_callback (GtkWidget*, gpointer);
GtkWidget *ops_button_box_new (GtkWidget *parent,
GtkTooltips *tool_tips,
OpsButton *ops_button,
OpsButtonType ops_type)
GtkWidget *
ops_button_box_new (GtkWidget *parent,
GtkTooltips *tool_tips,
OpsButton *ops_button,
OpsButtonType ops_type)
{
GtkWidget *button;
GtkWidget *button_box;
@ -125,9 +126,9 @@ ops_button_box_set_insensitive (OpsButton *ops_button)
}
void
ops_button_pressed_callback (GtkWidget *widget,
ops_button_pressed_callback (GtkWidget *widget,
GdkEventButton *bevent,
gpointer client_data)
gpointer client_data)
{
OpsButton *ops_button;

View File

@ -40,19 +40,19 @@ typedef enum {
struct _OpsButton
{
gchar **xpm_data; /* xpm data for the button */
OpsButtonCallback callback;
OpsButtonCallback *ext_callbacks;
char *tooltip;
GtkWidget *widget; /* the button widget */
gint modifier;
gchar **xpm_data; /* xpm data for the button */
OpsButtonCallback callback; /* callback function */
OpsButtonCallback *ext_callbacks; /* callback functions when modifiers are pressed */
char *tooltip;
GtkWidget *widget; /* the button widget */
gint modifier;
};
/* Function declarations */
GtkWidget * ops_button_box_new (GtkWidget *, /* parent widget */
GtkWidget * ops_button_box_new (GtkWidget *, /* parent widget */
GtkTooltips *,
OpsButton *,
OpsButton *,
OpsButtonType);
void ops_button_box_set_insensitive (OpsButton *);

View File

@ -68,12 +68,13 @@ static void pixel_region_configure (PixelRegionHolder *, PixelRegionIterator
/* Function definitions */
void
pixel_region_init (PR, tiles, x, y, w, h, dirty)
PixelRegion *PR;
TileManager *tiles;
int x, y;
int w, h;
int dirty;
pixel_region_init (PixelRegion *PR,
TileManager *tiles,
int x,
int y,
int w,
int h,
int dirty)
{
PR->tiles = tiles;
PR->curtile = NULL;
@ -89,10 +90,11 @@ pixel_region_init (PR, tiles, x, y, w, h, dirty)
void
pixel_region_resize (PR, x, y, w, h)
PixelRegion *PR;
int x, y;
int w, h;
pixel_region_resize (PixelRegion *PR,
int x,
int y,
int w,
int h)
{
/* If the data is non-null, data is contiguous--need to advance */
if (PR->data != NULL)
@ -107,15 +109,14 @@ pixel_region_resize (PR, x, y, w, h)
PR->h = h;
}
/* request that tiles within a region be fetched asynchronously
*/
/* request that tiles within a region be fetched asynchronously */
void
pixel_region_get_async (PR, ulx, uly, lrx, lry)
PixelRegion *PR;
int ulx;
int uly;
int lrx;
int lry;
pixel_region_get_async (PixelRegion *PR,
int ulx,
int uly,
int lrx,
int lry)
{
int x, y;
@ -124,13 +125,14 @@ pixel_region_get_async (PR, ulx, uly, lrx, lry)
tile_manager_get_async (PR->tiles, x, y);
}
void
pixel_region_get_row (PR, x, y, w, data, subsample)
PixelRegion *PR;
int x, y;
int w;
unsigned char *data;
int subsample;
pixel_region_get_row (PixelRegion *PR,
int x,
int y,
int w,
unsigned char *data,
int subsample)
{
Tile *tile;
unsigned char *tile_data;
@ -176,11 +178,11 @@ pixel_region_get_row (PR, x, y, w, data, subsample)
void
pixel_region_set_row (PR, x, y, w, data)
PixelRegion *PR;
int x, y;
int w;
unsigned char *data;
pixel_region_set_row (PixelRegion *PR,
int x,
int y,
int w,
unsigned char *data)
{
Tile *tile;
unsigned char *tile_data;
@ -212,12 +214,12 @@ pixel_region_set_row (PR, x, y, w, data)
void
pixel_region_get_col (PR, x, y, h, data, subsample)
PixelRegion *PR;
int x, y;
int h;
unsigned char *data;
int subsample;
pixel_region_get_col (PixelRegion *PR,
int x,
int y,
int h,
unsigned char *data,
int subsample)
{
Tile *tile;
unsigned char *tile_data;
@ -253,11 +255,11 @@ pixel_region_get_col (PR, x, y, h, data, subsample)
void
pixel_region_set_col (PR, x, y, h, data)
PixelRegion *PR;
int x, y;
int h;
unsigned char *data;
pixel_region_set_col (PixelRegion *PR,
int x,
int y,
int h,
unsigned char *data)
{
Tile *tile;
unsigned char *tile_data;
@ -292,7 +294,8 @@ pixel_region_set_col (PR, x, y, h, data)
}
void *
pixel_regions_register (int num_regions, ...)
pixel_regions_register (int num_regions,
...)
{
PixelRegion *PR;
PixelRegionHolder *PRH;
@ -345,8 +348,7 @@ pixel_regions_register (int num_regions, ...)
void *
pixel_regions_process (PRI_ptr)
void *PRI_ptr;
pixel_regions_process (void *PRI_ptr)
{
GSList *list;
PixelRegionHolder *PRH;
@ -392,8 +394,7 @@ pixel_regions_process (PRI_ptr)
}
void
pixel_regions_process_stop (PRI_ptr)
void *PRI_ptr;
pixel_regions_process_stop (void *PRI_ptr)
{
GSList *list;
PixelRegionHolder *PRH;
@ -445,8 +446,7 @@ pixel_regions_process_stop (PRI_ptr)
/* Static Function Definitions */
static int
get_portion_height (PRI)
PixelRegionIterator *PRI;
get_portion_height (PixelRegionIterator *PRI)
{
GSList *list;
PixelRegionHolder *PRH;
@ -488,8 +488,7 @@ get_portion_height (PRI)
static int
get_portion_width (PRI)
PixelRegionIterator *PRI;
get_portion_width (PixelRegionIterator *PRI)
{
GSList *list;
PixelRegionHolder *PRH;
@ -531,8 +530,7 @@ get_portion_width (PRI)
static void *
pixel_regions_configure (PRI)
PixelRegionIterator *PRI;
pixel_regions_configure (PixelRegionIterator *PRI)
{
PixelRegionHolder *PRH;
GSList *list;
@ -580,9 +578,8 @@ pixel_regions_configure (PRI)
static void
pixel_region_configure (PRH, PRI)
PixelRegionHolder *PRH;
PixelRegionIterator *PRI;
pixel_region_configure (PixelRegionHolder *PRH,
PixelRegionIterator *PRI)
{
/* Configure the rowstride and data pointer for the pixel region
* based on the current offsets into the region and whether the
@ -590,7 +587,8 @@ pixel_region_configure (PRH, PRI)
*/
if (PRH->PR->tiles)
{
PRH->PR->curtile = tile_manager_get_tile (PRH->PR->tiles, PRH->PR->x, PRH->PR->y, TRUE, PRH->PR->dirty);
PRH->PR->curtile =
tile_manager_get_tile (PRH->PR->tiles, PRH->PR->x, PRH->PR->y, TRUE, PRH->PR->dirty);
PRH->PR->offx = PRH->PR->x % TILE_WIDTH;
PRH->PR->offy = PRH->PR->y % TILE_HEIGHT;

View File

@ -47,16 +47,15 @@
static unsigned char * temp_buf_allocate (unsigned int);
static void temp_buf_to_color (TempBuf *, TempBuf *);
static void temp_buf_to_gray (TempBuf *, TempBuf *);
static void temp_buf_to_gray (TempBuf *, TempBuf *);
/* Memory management */
static unsigned char *
temp_buf_allocate (size)
unsigned int size;
temp_buf_allocate (unsigned int size)
{
unsigned char * data;
unsigned char *data;
data = (unsigned char *) g_malloc (size);
@ -67,9 +66,8 @@ temp_buf_allocate (size)
/* The conversion routines */
static void
temp_buf_to_color (src_buf, dest_buf)
TempBuf * src_buf;
TempBuf * dest_buf;
temp_buf_to_color (TempBuf *src_buf,
TempBuf *dest_buf)
{
unsigned char *src;
unsigned char *dest;
@ -92,13 +90,12 @@ temp_buf_to_color (src_buf, dest_buf)
static void
temp_buf_to_gray (src_buf, dest_buf)
TempBuf * src_buf;
TempBuf * dest_buf;
temp_buf_to_gray (TempBuf *src_buf,
TempBuf *dest_buf)
{
unsigned char *src;
unsigned char *dest;
long num_bytes;
long num_bytes;
float pix;
src = temp_buf_data (src_buf);
@ -121,15 +118,15 @@ temp_buf_to_gray (src_buf, dest_buf)
TempBuf *
temp_buf_new (width, height, bytes, x, y, col)
int width;
int height;
int bytes;
int x, y;
unsigned char * col;
temp_buf_new (int width,
int height,
int bytes,
int x,
int y,
unsigned char *col)
{
long i;
int j;
int j;
unsigned char * data;
TempBuf * temp;
@ -190,9 +187,8 @@ temp_buf_new (width, height, bytes, x, y, col)
TempBuf *
temp_buf_copy (src, dest)
TempBuf * src;
TempBuf * dest;
temp_buf_copy (TempBuf *src,
TempBuf *dest)
{
TempBuf * new;
long length;
@ -233,11 +229,12 @@ temp_buf_copy (src, dest)
TempBuf *
temp_buf_resize (buf, bytes, x, y, w, h)
TempBuf * buf;
int bytes;
int x, y;
int w, h;
temp_buf_resize (TempBuf *buf,
int bytes,
int x,
int y,
int w,
int h)
{
int size;
@ -271,12 +268,13 @@ temp_buf_resize (buf, bytes, x, y, w, h)
TempBuf *
temp_buf_copy_area (src, dest, x, y, w, h, border)
TempBuf * src;
TempBuf * dest;
int x, y;
int w, h;
int border;
temp_buf_copy_area (TempBuf *src,
TempBuf *dest,
int x,
int y,
int w,
int h,
int border)
{
TempBuf * new;
PixelRegion srcR, destR;
@ -333,8 +331,7 @@ temp_buf_copy_area (src, dest, x, y, w, h, border)
void
temp_buf_free (temp_buf)
TempBuf * temp_buf;
temp_buf_free (TempBuf *temp_buf)
{
if (temp_buf->data)
g_free (temp_buf->data);
@ -347,8 +344,7 @@ temp_buf_free (temp_buf)
unsigned char *
temp_buf_data (temp_buf)
TempBuf * temp_buf;
temp_buf_data (TempBuf *temp_buf)
{
if (temp_buf->swapped)
temp_buf_unswap (temp_buf);
@ -363,9 +359,8 @@ temp_buf_data (temp_buf)
MaskBuf *
mask_buf_new (width, height)
int width;
int height;
mask_buf_new (int width,
int height)
{
static unsigned char empty = 0;
@ -374,16 +369,14 @@ mask_buf_new (width, height)
void
mask_buf_free (mask)
MaskBuf * mask;
mask_buf_free (MaskBuf *mask)
{
temp_buf_free ((TempBuf *) mask);
}
unsigned char *
mask_buf_data (mask_buf)
MaskBuf * mask_buf;
mask_buf_data (MaskBuf *mask_buf)
{
if (mask_buf->swapped)
temp_buf_unswap (mask_buf);
@ -411,13 +404,14 @@ mask_buf_data (mask_buf)
* from disk. In the former case, cached_in_memory is set to NULL;
* in the latter case, cached_in_memory is left unchanged.
* If temp_buf_swap_free is called, cached_in_memory must be checked
* against the temp buf being freed. If they are the same, then cached_in_memory
* must be set to NULL;
* against the temp buf being freed. If they are the same, then
* cached_in_memory must be set to NULL;
*
* In the case where memory usage is set to "stingy":
* temp bufs are not cached in memory at all, they go right to disk.
*/
/* a static counter for generating unique filenames */
static int swap_index = 0;
@ -436,8 +430,7 @@ generate_unique_filename (void)
void
temp_buf_swap (buf)
TempBuf * buf;
temp_buf_swap (TempBuf *buf)
{
TempBuf * swap;
char * filename;
@ -511,8 +504,7 @@ temp_buf_swap (buf)
void
temp_buf_unswap (buf)
TempBuf * buf;
temp_buf_unswap (TempBuf *buf)
{
struct stat stat_buf;
FILE * fp;
@ -563,8 +555,7 @@ temp_buf_unswap (buf)
void
temp_buf_swap_free (buf)
TempBuf * buf;
temp_buf_swap_free (TempBuf *buf)
{
struct stat stat_buf;

View File

@ -103,8 +103,8 @@ void undo_free_qmask (int, void *);
/* Sizing functions */
static int layer_size (Layer *);
static int channel_size (Channel *);
static int layer_size (Layer *);
static int channel_size (Channel *);
static int group_count = 0;
static int shrink_wrap = FALSE;
@ -117,7 +117,8 @@ layer_size (Layer *layer)
{
int size;
size = sizeof (Layer) + GIMP_DRAWABLE(layer)->width * GIMP_DRAWABLE(layer)->height * GIMP_DRAWABLE(layer)->bytes +
size = sizeof (Layer) +
GIMP_DRAWABLE(layer)->width * GIMP_DRAWABLE(layer)->height * GIMP_DRAWABLE(layer)->bytes +
strlen (GIMP_DRAWABLE(layer)->name);
if (layer_mask (layer))
@ -276,7 +277,7 @@ static int
pop_stack (GImage *gimage,
GSList **stack_ptr,
GSList **unstack_ptr,
int state)
int state)
{
Undo * object;
GSList *stack;
@ -452,12 +453,12 @@ struct _image_undo
int
undo_push_image (GImage *gimage,
undo_push_image (GImage *gimage,
GimpDrawable *drawable,
int x1,
int y1,
int x2,
int y2)
int x1,
int y1,
int x2,
int y2)
{
long size;
Undo *new;
@ -509,14 +510,14 @@ undo_push_image (GImage *gimage,
int
undo_push_image_mod (GImage *gimage,
undo_push_image_mod (GImage *gimage,
GimpDrawable *drawable,
int x1,
int y1,
int x2,
int y2,
void *tiles_ptr,
int sparse)
int x1,
int y1,
int x2,
int y2,
void *tiles_ptr,
int sparse)
{
long size;
int dwidth, dheight;
@ -803,7 +804,7 @@ undo_free_mask (int state,
/* Layer displacement Undo functions */
int
undo_push_layer_displace (GImage *gimage,
undo_push_layer_displace (GImage *gimage,
GimpLayer *layer)
{
Undo * new;
@ -1218,7 +1219,8 @@ undo_push_layer_mod (GImage *gimage,
tiles = GIMP_DRAWABLE(layer)->tiles;
tiles->x = GIMP_DRAWABLE(layer)->offset_x;
tiles->y = GIMP_DRAWABLE(layer)->offset_y;
size = GIMP_DRAWABLE(layer)->width * GIMP_DRAWABLE(layer)->height * GIMP_DRAWABLE(layer)->bytes + sizeof (void *) * 3;
size = GIMP_DRAWABLE(layer)->width * GIMP_DRAWABLE(layer)->height *
GIMP_DRAWABLE(layer)->bytes + sizeof (void *) * 3;
if ((new = undo_push (gimage, size, LAYER_MOD)))
{
@ -1306,7 +1308,8 @@ undo_pop_layer_mod (GImage *gimage,
data[1] = temp;
/* Issue the second update */
drawable_update (GIMP_DRAWABLE(layer), 0, 0, GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height);
drawable_update (GIMP_DRAWABLE(layer), 0, 0,
GIMP_DRAWABLE(layer)->width, GIMP_DRAWABLE(layer)->height);
return TRUE;
}
@ -1398,7 +1401,8 @@ undo_pop_layer_mask (GImage *gimage,
* this is undoing an add...
*/
if ((state == REDO && lmu->mode == DISCARD) || state == UNDO)
drawable_update (GIMP_DRAWABLE(lmu->layer), 0, 0, GIMP_DRAWABLE(lmu->layer)->width, GIMP_DRAWABLE(lmu->layer)->height);
drawable_update (GIMP_DRAWABLE(lmu->layer), 0, 0,
GIMP_DRAWABLE(lmu->layer)->width, GIMP_DRAWABLE(lmu->layer)->height);
}
/* restore layer */
else
@ -1415,7 +1419,8 @@ undo_pop_layer_mask (GImage *gimage,
* this is redoing an add
*/
if ((state == UNDO && lmu->mode == DISCARD) || state == REDO)
drawable_update (GIMP_DRAWABLE(lmu->layer), 0, 0, GIMP_DRAWABLE(lmu->layer)->width, GIMP_DRAWABLE(lmu->layer)->height);
drawable_update (GIMP_DRAWABLE(lmu->layer), 0, 0,
GIMP_DRAWABLE(lmu->layer)->width, GIMP_DRAWABLE(lmu->layer)->height);
}
return TRUE;
@ -1515,7 +1520,8 @@ undo_pop_channel (GImage *gimage,
gimage_set_active_channel (gimage, cu->prev_channel);
/* update the area */
drawable_update (GIMP_DRAWABLE(cu->channel), 0, 0, GIMP_DRAWABLE(cu->channel)->width, GIMP_DRAWABLE(cu->channel)->height);
drawable_update (GIMP_DRAWABLE(cu->channel), 0, 0,
GIMP_DRAWABLE(cu->channel)->width, GIMP_DRAWABLE(cu->channel)->height);
}
/* restore channel */
else
@ -1530,7 +1536,8 @@ undo_pop_channel (GImage *gimage,
gimage_set_active_channel (gimage, cu->channel);
/* update the area */
drawable_update (GIMP_DRAWABLE(cu->channel), 0, 0, GIMP_DRAWABLE(cu->channel)->width, GIMP_DRAWABLE(cu->channel)->height);
drawable_update (GIMP_DRAWABLE(cu->channel), 0, 0,
GIMP_DRAWABLE(cu->channel)->width, GIMP_DRAWABLE(cu->channel)->height);
}
return TRUE;
@ -1629,7 +1636,8 @@ undo_pop_channel_mod (GImage *gimage,
tiles = (TileManager *) data[1];
/* Issue the first update */
drawable_update (GIMP_DRAWABLE(channel), 0, 0, GIMP_DRAWABLE(channel)->width, GIMP_DRAWABLE(channel)->height);
drawable_update (GIMP_DRAWABLE(channel), 0, 0,
GIMP_DRAWABLE(channel)->width, GIMP_DRAWABLE(channel)->height);
temp = GIMP_DRAWABLE(channel)->tiles;
GIMP_DRAWABLE(channel)->tiles = tiles;
@ -1640,7 +1648,8 @@ undo_pop_channel_mod (GImage *gimage,
data[1] = temp;
/* Issue the second update */
drawable_update (GIMP_DRAWABLE(channel), 0, 0, GIMP_DRAWABLE(channel)->width, GIMP_DRAWABLE(channel)->height);
drawable_update (GIMP_DRAWABLE(channel), 0, 0,
GIMP_DRAWABLE(channel)->width, GIMP_DRAWABLE(channel)->height);
return TRUE;
}
@ -1727,8 +1736,11 @@ undo_pop_fs_to_layer (GImage *gimage,
gimage->floating_sel = fsu->layer;
/* restore the contents of the drawable */
floating_sel_store (fsu->layer, GIMP_DRAWABLE(fsu->layer)->offset_x, GIMP_DRAWABLE(fsu->layer)->offset_y,
GIMP_DRAWABLE(fsu->layer)->width, GIMP_DRAWABLE(fsu->layer)->height);
floating_sel_store (fsu->layer,
GIMP_DRAWABLE(fsu->layer)->offset_x,
GIMP_DRAWABLE(fsu->layer)->offset_y,
GIMP_DRAWABLE(fsu->layer)->width,
GIMP_DRAWABLE(fsu->layer)->height);
fsu->layer->fs.initial = TRUE;
/* clear the selection */
@ -1740,8 +1752,11 @@ undo_pop_fs_to_layer (GImage *gimage,
case REDO:
/* restore the contents of the drawable */
floating_sel_restore (fsu->layer, GIMP_DRAWABLE(fsu->layer)->offset_x, GIMP_DRAWABLE(fsu->layer)->offset_y,
GIMP_DRAWABLE(fsu->layer)->width, GIMP_DRAWABLE(fsu->layer)->height);
floating_sel_restore (fsu->layer,
GIMP_DRAWABLE(fsu->layer)->offset_x,
GIMP_DRAWABLE(fsu->layer)->offset_y,
GIMP_DRAWABLE(fsu->layer)->width,
GIMP_DRAWABLE(fsu->layer)->height);
/* Update the preview for the gimage and underlying drawable */
drawable_invalidate_preview (GIMP_DRAWABLE(fsu->layer));
@ -1824,16 +1839,20 @@ undo_pop_fs_rigor (GImage *gimage,
/* restore the contents of drawable the floating layer is attached to */
if (floating_layer->fs.initial == FALSE)
floating_sel_restore (floating_layer,
GIMP_DRAWABLE(floating_layer)->offset_x, GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width, GIMP_DRAWABLE(floating_layer)->height);
GIMP_DRAWABLE(floating_layer)->offset_x,
GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width,
GIMP_DRAWABLE(floating_layer)->height);
floating_layer->fs.initial = TRUE;
break;
case REDO:
/* store the affected area from the drawable in the backing store */
floating_sel_store (floating_layer,
GIMP_DRAWABLE(floating_layer)->offset_x, GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width, GIMP_DRAWABLE(floating_layer)->height);
GIMP_DRAWABLE(floating_layer)->offset_x,
GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width,
GIMP_DRAWABLE(floating_layer)->height);
floating_layer->fs.initial = TRUE;
break;
}
@ -1897,8 +1916,10 @@ undo_pop_fs_relax (GImage *gimage,
case UNDO:
/* store the affected area from the drawable in the backing store */
floating_sel_store (floating_layer,
GIMP_DRAWABLE(floating_layer)->offset_x, GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width, GIMP_DRAWABLE(floating_layer)->height);
GIMP_DRAWABLE(floating_layer)->offset_x,
GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width,
GIMP_DRAWABLE(floating_layer)->height);
floating_layer->fs.initial = TRUE;
break;
@ -1906,8 +1927,10 @@ undo_pop_fs_relax (GImage *gimage,
/* restore the contents of drawable the floating layer is attached to */
if (floating_layer->fs.initial == FALSE)
floating_sel_restore (floating_layer,
GIMP_DRAWABLE(floating_layer)->offset_x, GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width, GIMP_DRAWABLE(floating_layer)->height);
GIMP_DRAWABLE(floating_layer)->offset_x,
GIMP_DRAWABLE(floating_layer)->offset_y,
GIMP_DRAWABLE(floating_layer)->width,
GIMP_DRAWABLE(floating_layer)->height);
floating_layer->fs.initial = TRUE;
break;
}
@ -2063,7 +2086,6 @@ undo_pop_qmask (GImage *gimage,
{
QmaskUndo *data;
int tmp;
int tmp_ref;
data = data_ptr;
@ -2195,10 +2217,10 @@ typedef struct _ParasiteUndo ParasiteUndo;
struct _ParasiteUndo
{
GImage *gimage;
GImage *gimage;
GimpDrawable *drawable;
Parasite *parasite;
char *name;
Parasite *parasite;
char *name;
};
int
@ -2223,8 +2245,8 @@ undo_push_image_parasite (GImage *gimage,
data->gimage = gimage;
data->drawable = NULL;
data->name = g_strdup(parasite_name(parasite));
data->parasite = parasite_copy(gimp_image_find_parasite(gimage, data->name));
data->name = g_strdup (parasite_name (parasite));
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->name));
return TRUE;
}
@ -2254,8 +2276,8 @@ undo_push_image_parasite_remove (GImage *gimage,
data->gimage = gimage;
data->drawable = NULL;
data->name = g_strdup(name);
data->parasite = parasite_copy(gimp_image_find_parasite(gimage, data->name));
data->name = g_strdup (name);
data->parasite = parasite_copy (gimp_image_find_parasite (gimage, data->name));
return TRUE;
}
@ -2286,8 +2308,8 @@ undo_push_drawable_parasite (GImage *gimage,
data->gimage = NULL;
data->drawable = drawable;
data->name = g_strdup(parasite_name(parasite));
data->parasite = parasite_copy(gimp_drawable_find_parasite(drawable, data->name));
data->name = g_strdup (parasite_name (parasite));
data->parasite = parasite_copy (gimp_drawable_find_parasite (drawable, data->name));
return TRUE;
}
@ -2317,8 +2339,8 @@ undo_push_drawable_parasite_remove (GImage *gimage,
data->gimage = NULL;
data->drawable = drawable;
data->name = g_strdup(name);
data->parasite = parasite_copy(gimp_drawable_find_parasite(drawable, data->name));
data->name = g_strdup (name);
data->parasite = parasite_copy (gimp_drawable_find_parasite (drawable, data->name));
return TRUE;
}
@ -2328,9 +2350,9 @@ undo_push_drawable_parasite_remove (GImage *gimage,
int
undo_pop_parasite (GImage *gimage,
int state,
int type,
void *data_ptr)
int state,
int type,
void *data_ptr)
{
ParasiteUndo *data;
Parasite *tmp;
@ -2341,33 +2363,33 @@ undo_pop_parasite (GImage *gimage,
if (data->gimage)
{
data->parasite = parasite_copy(gimp_image_find_parasite(gimage,
data->name));
data->parasite = parasite_copy (gimp_image_find_parasite (gimage,
data->name));
if (tmp)
parasite_list_add(data->gimage->parasites, tmp);
parasite_list_add (data->gimage->parasites, tmp);
else
parasite_list_remove(data->gimage->parasites, data->name);
parasite_list_remove (data->gimage->parasites, data->name);
}
else if (data->drawable)
{
data->parasite = parasite_copy(gimp_drawable_find_parasite(data->drawable,
data->name));
data->parasite = parasite_copy (gimp_drawable_find_parasite (data->drawable,
data->name));
if (tmp)
parasite_list_add(data->drawable->parasites, tmp);
parasite_list_add (data->drawable->parasites, tmp);
else
parasite_list_remove(data->drawable->parasites, data->name);
parasite_list_remove (data->drawable->parasites, data->name);
}
else
{
data->parasite = parasite_copy(gimp_find_parasite(data->name));
data->parasite = parasite_copy (gimp_find_parasite (data->name));
if (tmp)
gimp_attach_parasite(tmp);
gimp_attach_parasite (tmp);
else
gimp_detach_parasite(data->name);
gimp_detach_parasite (data->name);
}
if (tmp)
parasite_free(tmp);
parasite_free (tmp);
/* if ((tmp && parasite_is_persistant(tmp)) || */
/* (data->parasite && parasite_is_persistant(data->parasite))) */
@ -2387,7 +2409,7 @@ undo_pop_parasite (GImage *gimage,
void
undo_free_parasite (int state,
void *data_ptr)
void *data_ptr)
{
ParasiteUndo *data;