app/Makefile.am app/gimpchannel.[ch] new files moved here by Yosh.

2001-02-01  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/gimpchannel.[ch]
	* app/gimplayer.[ch]: new files moved here by Yosh.

	* app/channel.[ch]
	* app/layer.[ch]: removed.

	* app/gdisplay.c: cleanup stuff.

	* app/[lotsa files].c
	* tools/pdbgen/Makefile.am
	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/floating_sel.pdb
	* tools/pdbgen/pdb/layer.pdb: changed includes accordingly.
This commit is contained in:
Michael Natterer 2001-02-01 18:44:22 +00:00 committed by Michael Natterer
parent edc9ba7bf2
commit dde74f9735
125 changed files with 802 additions and 4118 deletions

View File

@ -1,3 +1,22 @@
2001-02-01 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/gimpchannel.[ch]
* app/gimplayer.[ch]: new files moved here by Yosh.
* app/channel.[ch]
* app/layer.[ch]: removed.
* app/gdisplay.c: cleanup stuff.
* app/[lotsa files].c
* tools/pdbgen/Makefile.am
* tools/pdbgen/pdb.pl
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/drawable.pdb
* tools/pdbgen/pdb/floating_sel.pdb
* tools/pdbgen/pdb/layer.pdb: changed includes accordingly.
2001-01-31 Seth Burgess <sjburges@gimp.org>
* plug-ins/perl/po/POTFILES.in : removed bilb/lib/Gimp.pm from list,

View File

@ -34,8 +34,6 @@ gimp_SOURCES = \
brush_scale.h \
brush_select.c \
brush_select.h \
channel.c \
channel.h \
channels_dialog.c \
channels_dialog.h \
channel_ops.c \
@ -110,6 +108,8 @@ gimp_SOURCES = \
gimpbrushlist.h \
gimpbrushpipe.c \
gimpbrushpipe.h \
gimpchannel.c \
gimpchannel.h \
gimpcontext.c \
gimpcontext.h \
gimpcontextpreview.c \
@ -126,6 +126,8 @@ gimp_SOURCES = \
gimphistogram.h \
gimpimage.c \
gimpimage.h \
gimplayer.c \
gimplayer.h \
gimplayermask.c \
gimplayermask.h \
gimplist.c \
@ -177,8 +179,6 @@ gimp_SOURCES = \
interface.h \
invert.c \
invert.h \
layer.c \
layer.h \
layer_select.c \
layer_select.h \
layers_dialog.c \

View File

@ -51,6 +51,7 @@
#include "gimpdrawable.h"
#include "gimphelp.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "gimpui.h"
#include "global_edit.h"
@ -58,7 +59,6 @@
#include "image_render.h"
#include "info_dialog.h"
#include "info_window.h"
#include "layer.h"
#include "nav_window.h"
#include "invert.h"
#include "lc_dialog.h"

View File

@ -29,14 +29,14 @@
#include "apptypes.h"
#include "channel.h"
#include "color_panel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "global_edit.h"
#include "qmask.h"
#include "undo.h"

View File

@ -29,14 +29,14 @@
#include "apptypes.h"
#include "channel.h"
#include "color_panel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "global_edit.h"
#include "qmask.h"
#include "undo.h"

View File

@ -31,7 +31,6 @@
#include "apptypes.h"
#include "channel.h"
#include "gimpdrawable.h"
#include "gimphistogram.h"
#include "gimpimage.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,204 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_CHANNEL_H__
#define __GIMP_CHANNEL_H__
#include "gimpdrawable.h"
/* Half way point where a region is no longer visible in a selection */
#define HALF_WAY 127
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel))
#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass))
#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL))
#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL))
typedef struct _GimpChannelClass GimpChannelClass;
struct _GimpChannel
{
GimpDrawable parent_instance;
GimpRGB color; /* Also stored the opacity */
gboolean show_masked; /* Show masked areas--as */
/* opposed to selected areas */
/* Selection mask variables */
gboolean boundary_known; /* is the current boundary valid */
BoundSeg *segs_in; /* outline of selected region */
BoundSeg *segs_out; /* outline of selected region */
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 */
};
struct _GimpChannelClass
{
GimpDrawableClass parent_class;
};
/* Special undo types */
typedef struct _ChannelUndo ChannelUndo;
typedef struct _MaskUndo MaskUndo;
struct _ChannelUndo
{
GimpChannel *channel; /* the actual channel */
gint prev_position; /* former position in list */
GimpChannel *prev_channel; /* previous active channel */
};
struct _MaskUndo
{
TileManager *tiles; /* the actual mask */
gint x, y; /* offsets */
};
/* function declarations */
GtkType gimp_channel_get_type (void);
GimpChannel * gimp_channel_new (GimpImage *gimage,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
GimpChannel * gimp_channel_copy (const GimpChannel *channel);
gint gimp_channel_get_opacity (const GimpChannel *channel);
void gimp_channel_set_opacity (GimpChannel *channel,
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,
gint new_width,
gint new_height);
void gimp_channel_resize (GimpChannel *channel,
gint new_width,
gint new_height,
gint offx,
gint offy);
gboolean gimp_channel_toggle_visibility (GimpChannel *channel);
/* selection mask functions */
GimpChannel * gimp_channel_new_mask (GimpImage *gimage,
gint width,
gint height);
gboolean gimp_channel_boundary (GimpChannel *mask,
BoundSeg **segs_in,
BoundSeg **segs_out,
gint *num_segs_in,
gint *num_segs_out,
gint x1,
gint y1,
gint x2,
gint y2);
gboolean gimp_channel_bounds (GimpChannel *mask,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
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,
gint width,
gint value);
void gimp_channel_sub_segment (GimpChannel *mask,
gint x,
gint y,
gint width,
gint value);
void gimp_channel_combine_rect (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h);
void gimp_channel_combine_ellipse (GimpChannel *mask,
ChannelOps op,
gint x,
gint y,
gint w,
gint h,
gboolean antialias);
void gimp_channel_combine_mask (GimpChannel *mask,
GimpChannel *add_on,
ChannelOps op,
gint off_x,
gint off_y);
void gimp_channel_feather (GimpChannel *input,
GimpChannel *output,
gdouble radius_x,
gdouble radius_y,
ChannelOps op,
gint off_x,
gint off_y);
void gimp_channel_push_undo (GimpChannel *mask);
void gimp_channel_clear (GimpChannel *mask);
void gimp_channel_invert (GimpChannel *mask);
void gimp_channel_sharpen (GimpChannel *mask);
void gimp_channel_all (GimpChannel *mask);
void gimp_channel_border (GimpChannel *mask,
gint radius_x,
gint radius_y);
void gimp_channel_grow (GimpChannel *mask,
gint radius_x,
gint radius_y);
void gimp_channel_shrink (GimpChannel *mask,
gint radius_x,
gint radius_y,
gboolean edge_lock);
void gimp_channel_translate (GimpChannel *mask,
gint off_x,
gint off_y);
void gimp_channel_load (GimpChannel *mask,
GimpChannel *channel);
void gimp_channel_layer_alpha (GimpChannel *mask,
GimpLayer *layer);
void gimp_channel_layer_mask (GimpChannel *mask,
GimpLayer *layer);
void gimp_channel_invalidate_bounds (GimpChannel *channel);
#endif /* __GIMP_CHANNEL_H__ */

View File

@ -29,15 +29,15 @@
#include "apptypes.h"
#include "apptypes.h"
#include "channel.h"
#include "channel_ops.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimpcontext.h"
#include "gimage.h"
#include "layer.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -28,13 +28,13 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "channels_dialog.h"
#include "color_panel.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimage.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpdnd.h"
#include "gimpdrawablepreview.h"
#include "gimppreviewcache.h"

View File

@ -51,6 +51,7 @@
#include "gimpdrawable.h"
#include "gimphelp.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "gimpui.h"
#include "global_edit.h"
@ -58,7 +59,6 @@
#include "image_render.h"
#include "info_dialog.h"
#include "info_window.h"
#include "layer.h"
#include "nav_window.h"
#include "invert.h"
#include "lc_dialog.h"

View File

@ -104,8 +104,8 @@
#include "gdisplay.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimppalette.h"
#include "layer.h"
#include "palette.h"
#include "palette_select.h"
#include "pixel_region.h"

View File

@ -32,10 +32,10 @@
#include "gimage.h"
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "global_edit.h"
#include "image_new.h"
#include "layer.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "tile_manager.h"

View File

@ -30,13 +30,13 @@
#include "appenv.h"
#include "boundary.h"
#include "channel.h"
#include "drawable.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimplayer.h"
#include "gimppreviewcache.h"
#include "gimplut.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "pixel_processor.h"
@ -1595,25 +1595,25 @@ gimp_channel_layer_mask (GimpChannel *mask,
gimp_channel_push_undo (mask);
/* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height,
GIMP_DRAWABLE (mask)->width, GIMP_DRAWABLE (mask)->height,
TRUE);
color_region (&destPR, &empty);
x1 = CLAMP (GIMP_DRAWABLE(layer)->offset_x, 0, GIMP_DRAWABLE(mask)->width);
y1 = CLAMP (GIMP_DRAWABLE(layer)->offset_y, 0, GIMP_DRAWABLE(mask)->height);
x2 = CLAMP (GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width,
0, GIMP_DRAWABLE(mask)->width);
y2 = CLAMP (GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height,
0, GIMP_DRAWABLE(mask)->height);
x1 = CLAMP (GIMP_DRAWABLE (layer)->offset_x, 0, GIMP_DRAWABLE (mask)->width);
y1 = CLAMP (GIMP_DRAWABLE (layer)->offset_y, 0, GIMP_DRAWABLE (mask)->height);
x2 = CLAMP (GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width,
0, GIMP_DRAWABLE (mask)->width);
y2 = CLAMP (GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height,
0, GIMP_DRAWABLE (mask)->height);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer->mask)->tiles,
(x1 - GIMP_DRAWABLE(layer)->offset_x),
(y1 - GIMP_DRAWABLE(layer)->offset_y),
pixel_region_init (&srcPR, GIMP_DRAWABLE (layer->mask)->tiles,
(x1 - GIMP_DRAWABLE (layer)->offset_x),
(y1 - GIMP_DRAWABLE (layer)->offset_y),
(x2 - x1), (y2 - y1),
FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
x1, y1,
(x2 - x1), (y2 - y1),
TRUE);

View File

@ -30,13 +30,13 @@
#include "appenv.h"
#include "boundary.h"
#include "channel.h"
#include "drawable.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimplayer.h"
#include "gimppreviewcache.h"
#include "gimplut.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "pixel_processor.h"
@ -1595,25 +1595,25 @@ gimp_channel_layer_mask (GimpChannel *mask,
gimp_channel_push_undo (mask);
/* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height,
GIMP_DRAWABLE (mask)->width, GIMP_DRAWABLE (mask)->height,
TRUE);
color_region (&destPR, &empty);
x1 = CLAMP (GIMP_DRAWABLE(layer)->offset_x, 0, GIMP_DRAWABLE(mask)->width);
y1 = CLAMP (GIMP_DRAWABLE(layer)->offset_y, 0, GIMP_DRAWABLE(mask)->height);
x2 = CLAMP (GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width,
0, GIMP_DRAWABLE(mask)->width);
y2 = CLAMP (GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height,
0, GIMP_DRAWABLE(mask)->height);
x1 = CLAMP (GIMP_DRAWABLE (layer)->offset_x, 0, GIMP_DRAWABLE (mask)->width);
y1 = CLAMP (GIMP_DRAWABLE (layer)->offset_y, 0, GIMP_DRAWABLE (mask)->height);
x2 = CLAMP (GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width,
0, GIMP_DRAWABLE (mask)->width);
y2 = CLAMP (GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height,
0, GIMP_DRAWABLE (mask)->height);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer->mask)->tiles,
(x1 - GIMP_DRAWABLE(layer)->offset_x),
(y1 - GIMP_DRAWABLE(layer)->offset_y),
pixel_region_init (&srcPR, GIMP_DRAWABLE (layer->mask)->tiles,
(x1 - GIMP_DRAWABLE (layer)->offset_x),
(y1 - GIMP_DRAWABLE (layer)->offset_y),
(x2 - x1), (y2 - y1),
FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
x1, y1,
(x2 - x1), (y2 - y1),
TRUE);

View File

@ -29,15 +29,15 @@
#include "apptypes.h"
#include "apptypes.h"
#include "channel.h"
#include "channel_ops.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimpcontext.h"
#include "gimage.h"
#include "layer.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -29,12 +29,12 @@
#include "apptypes.h"
#include "channel.h"
#include "gimpdrawable.h"
#include "layer.h"
#include "gimppreviewcache.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimppreviewcache.h"
#include "gimpparasite.h"
#include "paint_funcs.h"
#include "parasitelist.h"

View File

@ -32,10 +32,10 @@
#include "gimage.h"
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "global_edit.h"
#include "image_new.h"
#include "layer.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "tile_manager.h"

View File

@ -104,8 +104,8 @@
#include "gdisplay.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimppalette.h"
#include "layer.h"
#include "palette.h"
#include "palette_select.h"
#include "pixel_region.h"

View File

@ -29,15 +29,15 @@
#include "apptypes.h"
#include "apptypes.h"
#include "channel.h"
#include "channel_ops.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimpcontext.h"
#include "gimage.h"
#include "layer.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -27,7 +27,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
@ -36,11 +35,11 @@
#include "gimpcontext.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -23,15 +23,15 @@
#include "apptypes.h"
#include "boundary.h"
#include "channel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimprc.h"
#include "layer.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "tile_manager.h"

View File

@ -27,7 +27,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
@ -36,11 +35,11 @@
#include "gimpcontext.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -27,7 +27,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
@ -36,11 +35,11 @@
#include "gimpcontext.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -29,14 +29,14 @@
#include "apptypes.h"
#include "channel.h"
#include "color_panel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "global_edit.h"
#include "qmask.h"
#include "undo.h"

View File

@ -29,14 +29,14 @@
#include "apptypes.h"
#include "channel.h"
#include "color_panel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "global_edit.h"
#include "qmask.h"
#include "undo.h"

View File

@ -27,7 +27,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
@ -36,11 +35,11 @@
#include "gimpcontext.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -27,7 +27,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
@ -36,11 +35,11 @@
#include "gimpcontext.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -26,7 +26,6 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "draw_core.h"
#include "drawable.h"
#include "floating_sel.h"
@ -34,10 +33,11 @@
#include "gdisplay_ops.h"
#include "gimage.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimpparasite.h"
#include "gimprc.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path_transform.h"

View File

@ -27,7 +27,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
@ -36,11 +35,11 @@
#include "gimpcontext.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -30,8 +30,8 @@
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "layer.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "tile_manager.h"

View File

@ -35,9 +35,9 @@
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimppreviewcache.h"
#include "layer.h"
#include "parasitelist.h"
#include "paint_funcs.h"
#include "pixel_region.h"

View File

@ -20,7 +20,7 @@
#define __GIMP_LAYER_MASK_H__
#include "channel.h"
#include "gimpchannel.h"
#define GIMP_TYPE_LAYER_MASK (gimp_layer_mask_get_type ())

View File

@ -27,7 +27,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
@ -36,11 +35,11 @@
#include "gimpcontext.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -28,7 +28,6 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
@ -37,14 +36,15 @@
#include "gdisplay_ops.h"
#include "gimage.h"
#include "gimage_mask.h"
#include "gimpdrawable.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpdrawable.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "gximage.h"
#include "image_render.h"
#include "info_window.h"
#include "interface.h"
#include "layer.h"
#include "lc_dialog.h"
#include "menus.h"
#include "nav_window.h"
@ -83,45 +83,46 @@ GSList * display_list = NULL;
static gint display_num = 1;
static GdkCursorType default_gdisplay_cursor = GDK_TOP_LEFT_ARROW;
/* Local functions */
static void gdisplay_format_title (GDisplay *,
gchar *,
gint );
static void gdisplay_delete (GDisplay *);
static GSList * gdisplay_free_area_list (GSList *);
static GSList * gdisplay_process_area_list (GSList *,
GimpArea *);
static void gdisplay_add_update_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static void gdisplay_add_display_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static void gdisplay_paint_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static void gdisplay_draw_cursor (GDisplay *);
static void gdisplay_display_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static guint gdisplay_hash (GDisplay *);
static void gdisplay_cleandirty_handler (GimpImage *,
gpointer );
static void gdisplay_format_title (GDisplay *gdisp,
gchar *title,
gint title_len);
static void gdisplay_delete (GDisplay *gdisp);
static GSList * gdisplay_free_area_list (GSList *list);
static GSList * gdisplay_process_area_list (GSList *list,
GimpArea *ga1);
static void gdisplay_add_update_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static void gdisplay_add_display_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static void gdisplay_paint_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static void gdisplay_draw_cursor (GDisplay *gdisp);
static void gdisplay_display_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static guint gdisplay_hash (GDisplay *gdisp);
static void gdisplay_cleandirty_handler (GimpImage *gdisp,
gpointer data);
static GHashTable *display_ht = NULL;
/* FIXME: GDisplays really need to be GtkObjects */
GDisplay*
GDisplay *
gdisplay_new (GimpImage *gimage,
guint scale)
{
@ -196,7 +197,7 @@ gdisplay_new (GimpImage *gimage,
gdisp->color_type = (gimp_image_base_type (gimage) == GRAY) ? GRAY : RGB;
/* set the qmask buttons */
qmask_buttons_update(gdisp);
qmask_buttons_update (gdisp);
/* set the user data */
if (!display_ht)
@ -214,7 +215,7 @@ gdisplay_new (GimpImage *gimage,
gimage->instance_count++; /* this is obsolete */
gimage->disp_count++;
lc_dialog_preview_update(gimage);
lc_dialog_preview_update (gimage);
/* We're interested in clean and dirty signals so we can update the
* title if need be. */
@ -226,7 +227,6 @@ gdisplay_new (GimpImage *gimage,
return gdisp;
}
static int print (char *, int, int, const char *, ...) G_GNUC_PRINTF (4, 5);
static int
@ -252,10 +252,10 @@ gdisplay_format_title (GDisplay *gdisp,
gint title_len)
{
GimpImage *gimage;
char *image_type_str;
int empty;
int i;
char *format;
gchar *image_type_str;
gint empty;
gint i;
gchar *format;
gimage = gdisp->gimage;
@ -280,88 +280,89 @@ gdisplay_format_title (GDisplay *gdisp,
format = image_title_format;
while (i < title_len && *format)
{
switch (*format) {
case '%':
format++;
switch (*format) {
case 0:
g_warning ("image-title-format string ended within %%-sequence");
break;
case '%':
title[i++] = '%';
break;
case 'f': /* pruned filename */
i += print (title, title_len, i,
"%s", g_basename (gimp_image_filename (gimage)));
break;
case 'F': /* full filename */
i += print (title, title_len, i, "%s", gimp_image_filename (gimage));
break;
case 'p': /* PDB id */
i += print (title, title_len, i, "%d", pdb_image_to_id (gimage));
break;
case 'i': /* instance */
i += print (title, title_len, i, "%d", gdisp->instance);
break;
case 't': /* type */
i += print (title, title_len, i, "%s", image_type_str);
break;
case 's': /* user source zoom factor */
i += print (title, title_len, i, "%d", SCALESRC (gdisp));
break;
case 'd': /* user destination zoom factor */
i += print (title, title_len, i, "%d", SCALEDEST (gdisp));
break;
case 'z': /* user zoom factor (percentage) */
i += print (title, title_len, i,
"%d", 100 * SCALEDEST (gdisp) / SCALESRC (gdisp));
break;
case 'D': /* dirty flag */
if (format[1] == 0)
{
g_warning("image-title-format string ended within %%D-sequence");
break;
}
if (gimage->dirty)
title[i++] = format[1];
{
switch (*format)
{
case '%':
format++;
switch (*format)
{
case 0:
g_warning ("image-title-format string ended within %%-sequence");
break;
case '%':
title[i++] = '%';
break;
case 'f': /* pruned filename */
i += print (title, title_len, i,
"%s", g_basename (gimp_image_filename (gimage)));
break;
case 'F': /* full filename */
i += print (title, title_len, i, "%s", gimp_image_filename (gimage));
break;
case 'p': /* PDB id */
i += print (title, title_len, i, "%d", pdb_image_to_id (gimage));
break;
case 'i': /* instance */
i += print (title, title_len, i, "%d", gdisp->instance);
break;
case 't': /* type */
i += print (title, title_len, i, "%s", image_type_str);
break;
case 's': /* user source zoom factor */
i += print (title, title_len, i, "%d", SCALESRC (gdisp));
break;
case 'd': /* user destination zoom factor */
i += print (title, title_len, i, "%d", SCALEDEST (gdisp));
break;
case 'z': /* user zoom factor (percentage) */
i += print (title, title_len, i,
"%d", 100 * SCALEDEST (gdisp) / SCALESRC (gdisp));
break;
case 'D': /* dirty flag */
if (format[1] == 0)
{
g_warning("image-title-format string ended within %%D-sequence");
break;
}
if (gimage->dirty)
title[i++] = format[1];
format++;
break;
/* Other cool things to be added:
* %m = memory used by picture
* some kind of resolution / image size thing
* people seem to want to know the active layer name
*/
default:
g_warning ("image-title-format contains unknown format sequence '%%%c'", *format);
break;
}
break;
/* Other cool things to be added:
* %m = memory used by picture
* some kind of resolution / image size thing
* people seem to want to know the active layer name
*/
default:
g_warning ("image-title-format contains unknown format sequence '%%%c'", *format);
default:
title[i++] = *format;
break;
}
break;
}
default:
title[i++] = *format;
break;
format++;
}
format++;
}
title[MIN(i, title_len-1)] = 0;
}
static void
gdisplay_delete (GDisplay *gdisp)
{
@ -429,20 +430,17 @@ gdisplay_delete (GDisplay *gdisp)
g_free (gdisp);
}
static GSList *
gdisplay_free_area_list (GSList *list)
{
GSList *l = list;
GSList *l;
GimpArea *ga;
while (l)
for (l = list; l; l = g_slist_next (l))
{
/* free the data */
ga = (GimpArea *) l->data;
g_free (ga);
l = g_slist_next (l);
g_free (ga);
}
if (list)
@ -451,14 +449,13 @@ gdisplay_free_area_list (GSList *list)
return NULL;
}
/*
* As far as I can tell, this function takes a GimpArea and unifies it with
* an existing list of GimpAreas, trying to avoid overdraw. [adam]
*/
static GSList *
gdisplay_process_area_list (GSList *list,
GimpArea *ga1)
gdisplay_process_area_list (GSList *list,
GimpArea *ga1)
{
GSList *new_list;
GSList *l = list;
@ -1310,15 +1307,15 @@ gdisplay_display_area (GDisplay *gdisp,
gint w,
gint h)
{
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
guchar *buf;
gint bpp, bpl;
gint bpp, bpl;
#ifdef DISPLAY_FILTERS
GList *list;
GList *list;
#endif /* DISPLAY_FILTERS */
buf = gximage_get_data ();
@ -1419,7 +1416,6 @@ gdisplay_display_area (GDisplay *gdisp,
}
}
gint
gdisplay_mask_value (GDisplay *gdisp,
gint x,
@ -1431,7 +1427,6 @@ gdisplay_mask_value (GDisplay *gdisp,
return gimage_mask_value (gdisp->gimage, x, y);
}
gint
gdisplay_mask_bounds (GDisplay *gdisp,
gint *x1,
@ -1480,7 +1475,6 @@ gdisplay_mask_bounds (GDisplay *gdisp,
return TRUE;
}
void
gdisplay_transform_coords (GDisplay *gdisp,
gint x,
@ -1491,8 +1485,8 @@ gdisplay_transform_coords (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
/* transform from image coordinates to screen coordinates */
scalex = SCALEFACTOR_X (gdisp);
@ -1513,7 +1507,6 @@ gdisplay_transform_coords (GDisplay *gdisp,
*ny += gdisp->disp_yoffset;
}
void
gdisplay_untransform_coords (GDisplay *gdisp,
gint x,
@ -1525,8 +1518,8 @@ gdisplay_untransform_coords (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
x -= gdisp->disp_xoffset;
y -= gdisp->disp_yoffset;
@ -1555,7 +1548,6 @@ gdisplay_untransform_coords (GDisplay *gdisp,
}
}
void
gdisplay_transform_coords_f (GDisplay *gdisp,
gdouble x,
@ -1566,8 +1558,8 @@ gdisplay_transform_coords_f (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
/* transform from gimp coordinates to screen coordinates */
scalex = SCALEFACTOR_X (gdisp);
@ -1588,7 +1580,6 @@ gdisplay_transform_coords_f (GDisplay *gdisp,
*ny += gdisp->disp_yoffset;
}
void
gdisplay_untransform_coords_f (GDisplay *gdisp,
gdouble x,
@ -1599,8 +1590,8 @@ gdisplay_untransform_coords_f (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
x -= gdisp->disp_xoffset;
y -= gdisp->disp_yoffset;
@ -1621,7 +1612,6 @@ gdisplay_untransform_coords_f (GDisplay *gdisp,
*ny = (y + gdisp->offset_y) / scaley - offset_y;
}
/* install and remove tool cursor from gdisplay... */
void
gdisplay_real_install_tool_cursor (GDisplay *gdisp,
@ -1685,8 +1675,6 @@ gdisplay_install_tool_cursor (GDisplay *gdisp,
FALSE);
}
/* install an override-cursor on gdisplay... */
void
gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type)
@ -1705,8 +1693,6 @@ gdisplay_install_override_cursor (GDisplay *gdisp,
}
}
/* remove an override-cursor from gdisplay... */
void
gdisplay_remove_override_cursor (GDisplay *gdisp)
{
@ -1722,14 +1708,12 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
}
}
void
gdisplay_remove_tool_cursor (GDisplay *gdisp)
{
unset_win_cursor (gdisp->canvas->window);
}
void
gdisplay_set_menu_sensitivity (GDisplay *gdisp)
{
@ -1965,7 +1949,6 @@ gdisplay_active (void)
return gimp_context_get_display (gimp_context_get_user ());
}
GDisplay *
gdisplay_get_by_ID (gint ID)
{
@ -1986,7 +1969,6 @@ gdisplay_get_by_ID (gint ID)
return NULL;
}
void
gdisplay_update_title (GDisplay *gdisp)
{
@ -2004,21 +1986,19 @@ gdisplay_update_title (GDisplay *gdisp)
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), context_id, title);
}
void
gdisplays_update_title (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
gdisplay_update_title (gdisp);
list = g_slist_next (list);
if (gdisp->gimage == gimage)
gdisplay_update_title (gdisp);
}
}
@ -2026,16 +2006,15 @@ void
gdisplays_resize_cursor_label (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
gdisplay_resize_cursor_label (gdisp);
list = g_slist_next (list);
}
}
@ -2043,16 +2022,15 @@ void
gdisplays_setup_scale (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
setup_scale (gdisp);
list = g_slist_next (list);
}
}
@ -2064,14 +2042,15 @@ gdisplays_update_area (GimpImage *gimage,
gint h)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* int x1, y1, x2, y2; */
/* int count = 0; */
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
/* We only need to update the first instance that
@ -2102,71 +2081,62 @@ gdisplays_update_area (GimpImage *gimage,
gdisplay_add_display_area (gdisp, x1, y1, (x2 - x1), (y2 - y1));
*/
}
list = g_slist_next (list);
}
}
void
gdisplays_expose_guides (GimpImage *gimage)
{
GDisplay *gdisp;
GList *tmp_list;
GSList *list;
GSList *list;
GList *guide_list;
/* traverse the linked list of displays, handling each one */
list = display_list;
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
tmp_list = gdisp->gimage->guides;
while (tmp_list)
for (guide_list = gdisp->gimage->guides;
guide_list;
guide_list = g_list_next (guide_list))
{
gdisplay_expose_guide (gdisp, tmp_list->data);
tmp_list = tmp_list->next;
gdisplay_expose_guide (gdisp, guide_list->data);
}
}
list = g_slist_next (list);
}
}
void
gdisplays_expose_guide (GimpImage *gimage,
Guide *guide)
{
GDisplay *gdisp;
GSList *list;
GSList *list;
/* traverse the linked list of displays, handling each one */
list = display_list;
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
gdisplay_expose_guide (gdisp, guide);
}
list = g_slist_next (list);
gdisplay_expose_guide (gdisp, guide);
}
}
void
gdisplays_update_full (GimpImage* gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
gint count = 0;
GSList *list;
gint count = 0;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
if (! count)
@ -2180,42 +2150,37 @@ gdisplays_update_full (GimpImage* gimage)
count++;
}
list = g_slist_next (list);
}
}
void
gdisplays_shrink_wrap (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
shrink_wrap_display (gdisp);
list = g_slist_next (list);
}
}
void
gdisplays_expose_full (void)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
gdisplay_expose_full (gdisp);
list = g_slist_next (list);
}
}
@ -2223,10 +2188,10 @@ void
gdisplays_nav_preview_resized (void)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
@ -2235,8 +2200,6 @@ gdisplays_nav_preview_resized (void)
if (gdisp->nav_popup)
nav_window_popup_preview_resized (&gdisp->nav_popup);
list = g_slist_next (list);
}
}
@ -2249,9 +2212,10 @@ gdisplays_selection_visibility (GimpImage *gimage,
gint count = 0;
/* traverse the linked list of displays, handling each one */
for (list = display_list; list; list = g_slist_next (list))
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage && gdisp->select)
{
switch (function)
@ -2277,44 +2241,41 @@ gdisplays_selection_visibility (GimpImage *gimage,
}
}
gboolean
gdisplays_dirty (void)
{
gboolean dirty = FALSE;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
if (((GDisplay *) list->data)->gimage->dirty != 0)
dirty = TRUE;
list = g_slist_next (list);
}
return dirty;
}
void
gdisplays_delete (void)
{
GSList *list = display_list;
GDisplay *gdisp;
GSList *list;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
list = g_slist_next (list);
gtk_widget_destroy (gdisp->shell);
}
/* free up linked list data */
g_slist_free (display_list);
display_list = NULL;
}
GDisplay *
gdisplays_check_valid (GDisplay *gtest,
GimpImage *gimage)
@ -2324,30 +2285,31 @@ gdisplays_check_valid (GDisplay *gtest,
* gimage. If none found return NULL;
*/
GSList *list = display_list;
GDisplay *gdisp;
GDisplay *gdisp_found = NULL;
GSList *list;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp == gtest)
return (gtest);
return gtest;
if (!gdisp_found && gdisp->gimage == gimage)
gdisp_found = gdisp;
list = g_slist_next (list);
}
return (gdisp_found);
return gdisp_found;
}
static void
gdisplays_flush_whenever (gboolean now)
{
static gboolean flushing = FALSE;
GSList *list = display_list;
GSList *list;
/* no flushing necessary without an interface */
if (no_interface)
@ -2363,10 +2325,9 @@ gdisplays_flush_whenever (gboolean now)
flushing = TRUE;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisplay_flush_whenever ((GDisplay *) list->data, now);
list = g_slist_next (list);
}
/* for convenience, we call the L&C flush here */
@ -2430,7 +2391,6 @@ gdisplay_reconnect (GDisplay *gdisp,
gdisplay_flush (gdisp);
}
void
gdisplays_reconnect (GimpImage *old,
GimpImage *new)

View File

@ -26,7 +26,7 @@
#include "apptypes.h"
#include "channel.h"
#include "gimpchannel.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "pixel_region.h"

View File

@ -36,7 +36,6 @@
#include "gimphelp.h"
#include "gimprc.h"
#include "image_render.h"
#include "layer.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "resolution_calibrate.h"

View File

@ -27,8 +27,8 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "layer.h"
#include "resize.h"
#include "undo.h"

View File

@ -36,9 +36,9 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "info_window.h"
#include "layer.h"
#include "layer_select.h"
#include "paint_funcs.h"
#include "patterns.h"

View File

@ -36,9 +36,9 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "info_window.h"
#include "layer.h"
#include "layer_select.h"
#include "paint_funcs.h"
#include "patterns.h"

View File

@ -28,7 +28,6 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
@ -37,14 +36,15 @@
#include "gdisplay_ops.h"
#include "gimage.h"
#include "gimage_mask.h"
#include "gimpdrawable.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpdrawable.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "gximage.h"
#include "image_render.h"
#include "info_window.h"
#include "interface.h"
#include "layer.h"
#include "lc_dialog.h"
#include "menus.h"
#include "nav_window.h"
@ -83,45 +83,46 @@ GSList * display_list = NULL;
static gint display_num = 1;
static GdkCursorType default_gdisplay_cursor = GDK_TOP_LEFT_ARROW;
/* Local functions */
static void gdisplay_format_title (GDisplay *,
gchar *,
gint );
static void gdisplay_delete (GDisplay *);
static GSList * gdisplay_free_area_list (GSList *);
static GSList * gdisplay_process_area_list (GSList *,
GimpArea *);
static void gdisplay_add_update_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static void gdisplay_add_display_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static void gdisplay_paint_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static void gdisplay_draw_cursor (GDisplay *);
static void gdisplay_display_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static guint gdisplay_hash (GDisplay *);
static void gdisplay_cleandirty_handler (GimpImage *,
gpointer );
static void gdisplay_format_title (GDisplay *gdisp,
gchar *title,
gint title_len);
static void gdisplay_delete (GDisplay *gdisp);
static GSList * gdisplay_free_area_list (GSList *list);
static GSList * gdisplay_process_area_list (GSList *list,
GimpArea *ga1);
static void gdisplay_add_update_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static void gdisplay_add_display_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static void gdisplay_paint_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static void gdisplay_draw_cursor (GDisplay *gdisp);
static void gdisplay_display_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static guint gdisplay_hash (GDisplay *gdisp);
static void gdisplay_cleandirty_handler (GimpImage *gdisp,
gpointer data);
static GHashTable *display_ht = NULL;
/* FIXME: GDisplays really need to be GtkObjects */
GDisplay*
GDisplay *
gdisplay_new (GimpImage *gimage,
guint scale)
{
@ -196,7 +197,7 @@ gdisplay_new (GimpImage *gimage,
gdisp->color_type = (gimp_image_base_type (gimage) == GRAY) ? GRAY : RGB;
/* set the qmask buttons */
qmask_buttons_update(gdisp);
qmask_buttons_update (gdisp);
/* set the user data */
if (!display_ht)
@ -214,7 +215,7 @@ gdisplay_new (GimpImage *gimage,
gimage->instance_count++; /* this is obsolete */
gimage->disp_count++;
lc_dialog_preview_update(gimage);
lc_dialog_preview_update (gimage);
/* We're interested in clean and dirty signals so we can update the
* title if need be. */
@ -226,7 +227,6 @@ gdisplay_new (GimpImage *gimage,
return gdisp;
}
static int print (char *, int, int, const char *, ...) G_GNUC_PRINTF (4, 5);
static int
@ -252,10 +252,10 @@ gdisplay_format_title (GDisplay *gdisp,
gint title_len)
{
GimpImage *gimage;
char *image_type_str;
int empty;
int i;
char *format;
gchar *image_type_str;
gint empty;
gint i;
gchar *format;
gimage = gdisp->gimage;
@ -280,88 +280,89 @@ gdisplay_format_title (GDisplay *gdisp,
format = image_title_format;
while (i < title_len && *format)
{
switch (*format) {
case '%':
format++;
switch (*format) {
case 0:
g_warning ("image-title-format string ended within %%-sequence");
break;
case '%':
title[i++] = '%';
break;
case 'f': /* pruned filename */
i += print (title, title_len, i,
"%s", g_basename (gimp_image_filename (gimage)));
break;
case 'F': /* full filename */
i += print (title, title_len, i, "%s", gimp_image_filename (gimage));
break;
case 'p': /* PDB id */
i += print (title, title_len, i, "%d", pdb_image_to_id (gimage));
break;
case 'i': /* instance */
i += print (title, title_len, i, "%d", gdisp->instance);
break;
case 't': /* type */
i += print (title, title_len, i, "%s", image_type_str);
break;
case 's': /* user source zoom factor */
i += print (title, title_len, i, "%d", SCALESRC (gdisp));
break;
case 'd': /* user destination zoom factor */
i += print (title, title_len, i, "%d", SCALEDEST (gdisp));
break;
case 'z': /* user zoom factor (percentage) */
i += print (title, title_len, i,
"%d", 100 * SCALEDEST (gdisp) / SCALESRC (gdisp));
break;
case 'D': /* dirty flag */
if (format[1] == 0)
{
g_warning("image-title-format string ended within %%D-sequence");
break;
}
if (gimage->dirty)
title[i++] = format[1];
{
switch (*format)
{
case '%':
format++;
switch (*format)
{
case 0:
g_warning ("image-title-format string ended within %%-sequence");
break;
case '%':
title[i++] = '%';
break;
case 'f': /* pruned filename */
i += print (title, title_len, i,
"%s", g_basename (gimp_image_filename (gimage)));
break;
case 'F': /* full filename */
i += print (title, title_len, i, "%s", gimp_image_filename (gimage));
break;
case 'p': /* PDB id */
i += print (title, title_len, i, "%d", pdb_image_to_id (gimage));
break;
case 'i': /* instance */
i += print (title, title_len, i, "%d", gdisp->instance);
break;
case 't': /* type */
i += print (title, title_len, i, "%s", image_type_str);
break;
case 's': /* user source zoom factor */
i += print (title, title_len, i, "%d", SCALESRC (gdisp));
break;
case 'd': /* user destination zoom factor */
i += print (title, title_len, i, "%d", SCALEDEST (gdisp));
break;
case 'z': /* user zoom factor (percentage) */
i += print (title, title_len, i,
"%d", 100 * SCALEDEST (gdisp) / SCALESRC (gdisp));
break;
case 'D': /* dirty flag */
if (format[1] == 0)
{
g_warning("image-title-format string ended within %%D-sequence");
break;
}
if (gimage->dirty)
title[i++] = format[1];
format++;
break;
/* Other cool things to be added:
* %m = memory used by picture
* some kind of resolution / image size thing
* people seem to want to know the active layer name
*/
default:
g_warning ("image-title-format contains unknown format sequence '%%%c'", *format);
break;
}
break;
/* Other cool things to be added:
* %m = memory used by picture
* some kind of resolution / image size thing
* people seem to want to know the active layer name
*/
default:
g_warning ("image-title-format contains unknown format sequence '%%%c'", *format);
default:
title[i++] = *format;
break;
}
break;
}
default:
title[i++] = *format;
break;
format++;
}
format++;
}
title[MIN(i, title_len-1)] = 0;
}
static void
gdisplay_delete (GDisplay *gdisp)
{
@ -429,20 +430,17 @@ gdisplay_delete (GDisplay *gdisp)
g_free (gdisp);
}
static GSList *
gdisplay_free_area_list (GSList *list)
{
GSList *l = list;
GSList *l;
GimpArea *ga;
while (l)
for (l = list; l; l = g_slist_next (l))
{
/* free the data */
ga = (GimpArea *) l->data;
g_free (ga);
l = g_slist_next (l);
g_free (ga);
}
if (list)
@ -451,14 +449,13 @@ gdisplay_free_area_list (GSList *list)
return NULL;
}
/*
* As far as I can tell, this function takes a GimpArea and unifies it with
* an existing list of GimpAreas, trying to avoid overdraw. [adam]
*/
static GSList *
gdisplay_process_area_list (GSList *list,
GimpArea *ga1)
gdisplay_process_area_list (GSList *list,
GimpArea *ga1)
{
GSList *new_list;
GSList *l = list;
@ -1310,15 +1307,15 @@ gdisplay_display_area (GDisplay *gdisp,
gint w,
gint h)
{
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
guchar *buf;
gint bpp, bpl;
gint bpp, bpl;
#ifdef DISPLAY_FILTERS
GList *list;
GList *list;
#endif /* DISPLAY_FILTERS */
buf = gximage_get_data ();
@ -1419,7 +1416,6 @@ gdisplay_display_area (GDisplay *gdisp,
}
}
gint
gdisplay_mask_value (GDisplay *gdisp,
gint x,
@ -1431,7 +1427,6 @@ gdisplay_mask_value (GDisplay *gdisp,
return gimage_mask_value (gdisp->gimage, x, y);
}
gint
gdisplay_mask_bounds (GDisplay *gdisp,
gint *x1,
@ -1480,7 +1475,6 @@ gdisplay_mask_bounds (GDisplay *gdisp,
return TRUE;
}
void
gdisplay_transform_coords (GDisplay *gdisp,
gint x,
@ -1491,8 +1485,8 @@ gdisplay_transform_coords (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
/* transform from image coordinates to screen coordinates */
scalex = SCALEFACTOR_X (gdisp);
@ -1513,7 +1507,6 @@ gdisplay_transform_coords (GDisplay *gdisp,
*ny += gdisp->disp_yoffset;
}
void
gdisplay_untransform_coords (GDisplay *gdisp,
gint x,
@ -1525,8 +1518,8 @@ gdisplay_untransform_coords (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
x -= gdisp->disp_xoffset;
y -= gdisp->disp_yoffset;
@ -1555,7 +1548,6 @@ gdisplay_untransform_coords (GDisplay *gdisp,
}
}
void
gdisplay_transform_coords_f (GDisplay *gdisp,
gdouble x,
@ -1566,8 +1558,8 @@ gdisplay_transform_coords_f (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
/* transform from gimp coordinates to screen coordinates */
scalex = SCALEFACTOR_X (gdisp);
@ -1588,7 +1580,6 @@ gdisplay_transform_coords_f (GDisplay *gdisp,
*ny += gdisp->disp_yoffset;
}
void
gdisplay_untransform_coords_f (GDisplay *gdisp,
gdouble x,
@ -1599,8 +1590,8 @@ gdisplay_untransform_coords_f (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
x -= gdisp->disp_xoffset;
y -= gdisp->disp_yoffset;
@ -1621,7 +1612,6 @@ gdisplay_untransform_coords_f (GDisplay *gdisp,
*ny = (y + gdisp->offset_y) / scaley - offset_y;
}
/* install and remove tool cursor from gdisplay... */
void
gdisplay_real_install_tool_cursor (GDisplay *gdisp,
@ -1685,8 +1675,6 @@ gdisplay_install_tool_cursor (GDisplay *gdisp,
FALSE);
}
/* install an override-cursor on gdisplay... */
void
gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type)
@ -1705,8 +1693,6 @@ gdisplay_install_override_cursor (GDisplay *gdisp,
}
}
/* remove an override-cursor from gdisplay... */
void
gdisplay_remove_override_cursor (GDisplay *gdisp)
{
@ -1722,14 +1708,12 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
}
}
void
gdisplay_remove_tool_cursor (GDisplay *gdisp)
{
unset_win_cursor (gdisp->canvas->window);
}
void
gdisplay_set_menu_sensitivity (GDisplay *gdisp)
{
@ -1965,7 +1949,6 @@ gdisplay_active (void)
return gimp_context_get_display (gimp_context_get_user ());
}
GDisplay *
gdisplay_get_by_ID (gint ID)
{
@ -1986,7 +1969,6 @@ gdisplay_get_by_ID (gint ID)
return NULL;
}
void
gdisplay_update_title (GDisplay *gdisp)
{
@ -2004,21 +1986,19 @@ gdisplay_update_title (GDisplay *gdisp)
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), context_id, title);
}
void
gdisplays_update_title (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
gdisplay_update_title (gdisp);
list = g_slist_next (list);
if (gdisp->gimage == gimage)
gdisplay_update_title (gdisp);
}
}
@ -2026,16 +2006,15 @@ void
gdisplays_resize_cursor_label (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
gdisplay_resize_cursor_label (gdisp);
list = g_slist_next (list);
}
}
@ -2043,16 +2022,15 @@ void
gdisplays_setup_scale (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
setup_scale (gdisp);
list = g_slist_next (list);
}
}
@ -2064,14 +2042,15 @@ gdisplays_update_area (GimpImage *gimage,
gint h)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* int x1, y1, x2, y2; */
/* int count = 0; */
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
/* We only need to update the first instance that
@ -2102,71 +2081,62 @@ gdisplays_update_area (GimpImage *gimage,
gdisplay_add_display_area (gdisp, x1, y1, (x2 - x1), (y2 - y1));
*/
}
list = g_slist_next (list);
}
}
void
gdisplays_expose_guides (GimpImage *gimage)
{
GDisplay *gdisp;
GList *tmp_list;
GSList *list;
GSList *list;
GList *guide_list;
/* traverse the linked list of displays, handling each one */
list = display_list;
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
tmp_list = gdisp->gimage->guides;
while (tmp_list)
for (guide_list = gdisp->gimage->guides;
guide_list;
guide_list = g_list_next (guide_list))
{
gdisplay_expose_guide (gdisp, tmp_list->data);
tmp_list = tmp_list->next;
gdisplay_expose_guide (gdisp, guide_list->data);
}
}
list = g_slist_next (list);
}
}
void
gdisplays_expose_guide (GimpImage *gimage,
Guide *guide)
{
GDisplay *gdisp;
GSList *list;
GSList *list;
/* traverse the linked list of displays, handling each one */
list = display_list;
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
gdisplay_expose_guide (gdisp, guide);
}
list = g_slist_next (list);
gdisplay_expose_guide (gdisp, guide);
}
}
void
gdisplays_update_full (GimpImage* gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
gint count = 0;
GSList *list;
gint count = 0;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
if (! count)
@ -2180,42 +2150,37 @@ gdisplays_update_full (GimpImage* gimage)
count++;
}
list = g_slist_next (list);
}
}
void
gdisplays_shrink_wrap (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
shrink_wrap_display (gdisp);
list = g_slist_next (list);
}
}
void
gdisplays_expose_full (void)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
gdisplay_expose_full (gdisp);
list = g_slist_next (list);
}
}
@ -2223,10 +2188,10 @@ void
gdisplays_nav_preview_resized (void)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
@ -2235,8 +2200,6 @@ gdisplays_nav_preview_resized (void)
if (gdisp->nav_popup)
nav_window_popup_preview_resized (&gdisp->nav_popup);
list = g_slist_next (list);
}
}
@ -2249,9 +2212,10 @@ gdisplays_selection_visibility (GimpImage *gimage,
gint count = 0;
/* traverse the linked list of displays, handling each one */
for (list = display_list; list; list = g_slist_next (list))
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage && gdisp->select)
{
switch (function)
@ -2277,44 +2241,41 @@ gdisplays_selection_visibility (GimpImage *gimage,
}
}
gboolean
gdisplays_dirty (void)
{
gboolean dirty = FALSE;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
if (((GDisplay *) list->data)->gimage->dirty != 0)
dirty = TRUE;
list = g_slist_next (list);
}
return dirty;
}
void
gdisplays_delete (void)
{
GSList *list = display_list;
GDisplay *gdisp;
GSList *list;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
list = g_slist_next (list);
gtk_widget_destroy (gdisp->shell);
}
/* free up linked list data */
g_slist_free (display_list);
display_list = NULL;
}
GDisplay *
gdisplays_check_valid (GDisplay *gtest,
GimpImage *gimage)
@ -2324,30 +2285,31 @@ gdisplays_check_valid (GDisplay *gtest,
* gimage. If none found return NULL;
*/
GSList *list = display_list;
GDisplay *gdisp;
GDisplay *gdisp_found = NULL;
GSList *list;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp == gtest)
return (gtest);
return gtest;
if (!gdisp_found && gdisp->gimage == gimage)
gdisp_found = gdisp;
list = g_slist_next (list);
}
return (gdisp_found);
return gdisp_found;
}
static void
gdisplays_flush_whenever (gboolean now)
{
static gboolean flushing = FALSE;
GSList *list = display_list;
GSList *list;
/* no flushing necessary without an interface */
if (no_interface)
@ -2363,10 +2325,9 @@ gdisplays_flush_whenever (gboolean now)
flushing = TRUE;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisplay_flush_whenever ((GDisplay *) list->data, now);
list = g_slist_next (list);
}
/* for convenience, we call the L&C flush here */
@ -2430,7 +2391,6 @@ gdisplay_reconnect (GDisplay *gdisp,
gdisplay_flush (gdisp);
}
void
gdisplays_reconnect (GimpImage *old,
GimpImage *new)

View File

@ -36,9 +36,9 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "info_window.h"
#include "layer.h"
#include "layer_select.h"
#include "paint_funcs.h"
#include "patterns.h"

View File

@ -27,8 +27,8 @@
#include "gimpdrawable.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "layer.h"
#include "layer_select.h"
#include "layers_dialogP.h"
#include "temp_buf.h"

View File

@ -29,14 +29,14 @@
#include "apptypes.h"
#include "channel.h"
#include "color_panel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "global_edit.h"
#include "qmask.h"
#include "undo.h"

View File

@ -66,7 +66,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "dialog_handler.h"
#include "docindex.h"
@ -79,7 +78,6 @@
#include "gimprc.h"
#include "fileops.h"
#include "fileopsP.h"
#include "layer.h"
#include "menus.h"
#include "plug_in.h"
#include "temp_buf.h"

View File

@ -30,8 +30,8 @@
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "layer.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "tile_manager.h"

View File

@ -28,7 +28,6 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
@ -37,14 +36,15 @@
#include "gdisplay_ops.h"
#include "gimage.h"
#include "gimage_mask.h"
#include "gimpdrawable.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpdrawable.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "gximage.h"
#include "image_render.h"
#include "info_window.h"
#include "interface.h"
#include "layer.h"
#include "lc_dialog.h"
#include "menus.h"
#include "nav_window.h"
@ -83,45 +83,46 @@ GSList * display_list = NULL;
static gint display_num = 1;
static GdkCursorType default_gdisplay_cursor = GDK_TOP_LEFT_ARROW;
/* Local functions */
static void gdisplay_format_title (GDisplay *,
gchar *,
gint );
static void gdisplay_delete (GDisplay *);
static GSList * gdisplay_free_area_list (GSList *);
static GSList * gdisplay_process_area_list (GSList *,
GimpArea *);
static void gdisplay_add_update_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static void gdisplay_add_display_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static void gdisplay_paint_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static void gdisplay_draw_cursor (GDisplay *);
static void gdisplay_display_area (GDisplay *,
gint ,
gint ,
gint ,
gint );
static guint gdisplay_hash (GDisplay *);
static void gdisplay_cleandirty_handler (GimpImage *,
gpointer );
static void gdisplay_format_title (GDisplay *gdisp,
gchar *title,
gint title_len);
static void gdisplay_delete (GDisplay *gdisp);
static GSList * gdisplay_free_area_list (GSList *list);
static GSList * gdisplay_process_area_list (GSList *list,
GimpArea *ga1);
static void gdisplay_add_update_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static void gdisplay_add_display_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static void gdisplay_paint_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static void gdisplay_draw_cursor (GDisplay *gdisp);
static void gdisplay_display_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
static guint gdisplay_hash (GDisplay *gdisp);
static void gdisplay_cleandirty_handler (GimpImage *gdisp,
gpointer data);
static GHashTable *display_ht = NULL;
/* FIXME: GDisplays really need to be GtkObjects */
GDisplay*
GDisplay *
gdisplay_new (GimpImage *gimage,
guint scale)
{
@ -196,7 +197,7 @@ gdisplay_new (GimpImage *gimage,
gdisp->color_type = (gimp_image_base_type (gimage) == GRAY) ? GRAY : RGB;
/* set the qmask buttons */
qmask_buttons_update(gdisp);
qmask_buttons_update (gdisp);
/* set the user data */
if (!display_ht)
@ -214,7 +215,7 @@ gdisplay_new (GimpImage *gimage,
gimage->instance_count++; /* this is obsolete */
gimage->disp_count++;
lc_dialog_preview_update(gimage);
lc_dialog_preview_update (gimage);
/* We're interested in clean and dirty signals so we can update the
* title if need be. */
@ -226,7 +227,6 @@ gdisplay_new (GimpImage *gimage,
return gdisp;
}
static int print (char *, int, int, const char *, ...) G_GNUC_PRINTF (4, 5);
static int
@ -252,10 +252,10 @@ gdisplay_format_title (GDisplay *gdisp,
gint title_len)
{
GimpImage *gimage;
char *image_type_str;
int empty;
int i;
char *format;
gchar *image_type_str;
gint empty;
gint i;
gchar *format;
gimage = gdisp->gimage;
@ -280,88 +280,89 @@ gdisplay_format_title (GDisplay *gdisp,
format = image_title_format;
while (i < title_len && *format)
{
switch (*format) {
case '%':
format++;
switch (*format) {
case 0:
g_warning ("image-title-format string ended within %%-sequence");
break;
case '%':
title[i++] = '%';
break;
case 'f': /* pruned filename */
i += print (title, title_len, i,
"%s", g_basename (gimp_image_filename (gimage)));
break;
case 'F': /* full filename */
i += print (title, title_len, i, "%s", gimp_image_filename (gimage));
break;
case 'p': /* PDB id */
i += print (title, title_len, i, "%d", pdb_image_to_id (gimage));
break;
case 'i': /* instance */
i += print (title, title_len, i, "%d", gdisp->instance);
break;
case 't': /* type */
i += print (title, title_len, i, "%s", image_type_str);
break;
case 's': /* user source zoom factor */
i += print (title, title_len, i, "%d", SCALESRC (gdisp));
break;
case 'd': /* user destination zoom factor */
i += print (title, title_len, i, "%d", SCALEDEST (gdisp));
break;
case 'z': /* user zoom factor (percentage) */
i += print (title, title_len, i,
"%d", 100 * SCALEDEST (gdisp) / SCALESRC (gdisp));
break;
case 'D': /* dirty flag */
if (format[1] == 0)
{
g_warning("image-title-format string ended within %%D-sequence");
break;
}
if (gimage->dirty)
title[i++] = format[1];
{
switch (*format)
{
case '%':
format++;
switch (*format)
{
case 0:
g_warning ("image-title-format string ended within %%-sequence");
break;
case '%':
title[i++] = '%';
break;
case 'f': /* pruned filename */
i += print (title, title_len, i,
"%s", g_basename (gimp_image_filename (gimage)));
break;
case 'F': /* full filename */
i += print (title, title_len, i, "%s", gimp_image_filename (gimage));
break;
case 'p': /* PDB id */
i += print (title, title_len, i, "%d", pdb_image_to_id (gimage));
break;
case 'i': /* instance */
i += print (title, title_len, i, "%d", gdisp->instance);
break;
case 't': /* type */
i += print (title, title_len, i, "%s", image_type_str);
break;
case 's': /* user source zoom factor */
i += print (title, title_len, i, "%d", SCALESRC (gdisp));
break;
case 'd': /* user destination zoom factor */
i += print (title, title_len, i, "%d", SCALEDEST (gdisp));
break;
case 'z': /* user zoom factor (percentage) */
i += print (title, title_len, i,
"%d", 100 * SCALEDEST (gdisp) / SCALESRC (gdisp));
break;
case 'D': /* dirty flag */
if (format[1] == 0)
{
g_warning("image-title-format string ended within %%D-sequence");
break;
}
if (gimage->dirty)
title[i++] = format[1];
format++;
break;
/* Other cool things to be added:
* %m = memory used by picture
* some kind of resolution / image size thing
* people seem to want to know the active layer name
*/
default:
g_warning ("image-title-format contains unknown format sequence '%%%c'", *format);
break;
}
break;
/* Other cool things to be added:
* %m = memory used by picture
* some kind of resolution / image size thing
* people seem to want to know the active layer name
*/
default:
g_warning ("image-title-format contains unknown format sequence '%%%c'", *format);
default:
title[i++] = *format;
break;
}
break;
}
default:
title[i++] = *format;
break;
format++;
}
format++;
}
title[MIN(i, title_len-1)] = 0;
}
static void
gdisplay_delete (GDisplay *gdisp)
{
@ -429,20 +430,17 @@ gdisplay_delete (GDisplay *gdisp)
g_free (gdisp);
}
static GSList *
gdisplay_free_area_list (GSList *list)
{
GSList *l = list;
GSList *l;
GimpArea *ga;
while (l)
for (l = list; l; l = g_slist_next (l))
{
/* free the data */
ga = (GimpArea *) l->data;
g_free (ga);
l = g_slist_next (l);
g_free (ga);
}
if (list)
@ -451,14 +449,13 @@ gdisplay_free_area_list (GSList *list)
return NULL;
}
/*
* As far as I can tell, this function takes a GimpArea and unifies it with
* an existing list of GimpAreas, trying to avoid overdraw. [adam]
*/
static GSList *
gdisplay_process_area_list (GSList *list,
GimpArea *ga1)
gdisplay_process_area_list (GSList *list,
GimpArea *ga1)
{
GSList *new_list;
GSList *l = list;
@ -1310,15 +1307,15 @@ gdisplay_display_area (GDisplay *gdisp,
gint w,
gint h)
{
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
gint sx, sy;
gint x1, y1;
gint x2, y2;
gint dx, dy;
gint i, j;
guchar *buf;
gint bpp, bpl;
gint bpp, bpl;
#ifdef DISPLAY_FILTERS
GList *list;
GList *list;
#endif /* DISPLAY_FILTERS */
buf = gximage_get_data ();
@ -1419,7 +1416,6 @@ gdisplay_display_area (GDisplay *gdisp,
}
}
gint
gdisplay_mask_value (GDisplay *gdisp,
gint x,
@ -1431,7 +1427,6 @@ gdisplay_mask_value (GDisplay *gdisp,
return gimage_mask_value (gdisp->gimage, x, y);
}
gint
gdisplay_mask_bounds (GDisplay *gdisp,
gint *x1,
@ -1480,7 +1475,6 @@ gdisplay_mask_bounds (GDisplay *gdisp,
return TRUE;
}
void
gdisplay_transform_coords (GDisplay *gdisp,
gint x,
@ -1491,8 +1485,8 @@ gdisplay_transform_coords (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
/* transform from image coordinates to screen coordinates */
scalex = SCALEFACTOR_X (gdisp);
@ -1513,7 +1507,6 @@ gdisplay_transform_coords (GDisplay *gdisp,
*ny += gdisp->disp_yoffset;
}
void
gdisplay_untransform_coords (GDisplay *gdisp,
gint x,
@ -1525,8 +1518,8 @@ gdisplay_untransform_coords (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
x -= gdisp->disp_xoffset;
y -= gdisp->disp_yoffset;
@ -1555,7 +1548,6 @@ gdisplay_untransform_coords (GDisplay *gdisp,
}
}
void
gdisplay_transform_coords_f (GDisplay *gdisp,
gdouble x,
@ -1566,8 +1558,8 @@ gdisplay_transform_coords_f (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
/* transform from gimp coordinates to screen coordinates */
scalex = SCALEFACTOR_X (gdisp);
@ -1588,7 +1580,6 @@ gdisplay_transform_coords_f (GDisplay *gdisp,
*ny += gdisp->disp_yoffset;
}
void
gdisplay_untransform_coords_f (GDisplay *gdisp,
gdouble x,
@ -1599,8 +1590,8 @@ gdisplay_untransform_coords_f (GDisplay *gdisp,
{
gdouble scalex;
gdouble scaley;
gint offset_x;
gint offset_y;
gint offset_x;
gint offset_y;
x -= gdisp->disp_xoffset;
y -= gdisp->disp_yoffset;
@ -1621,7 +1612,6 @@ gdisplay_untransform_coords_f (GDisplay *gdisp,
*ny = (y + gdisp->offset_y) / scaley - offset_y;
}
/* install and remove tool cursor from gdisplay... */
void
gdisplay_real_install_tool_cursor (GDisplay *gdisp,
@ -1685,8 +1675,6 @@ gdisplay_install_tool_cursor (GDisplay *gdisp,
FALSE);
}
/* install an override-cursor on gdisplay... */
void
gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type)
@ -1705,8 +1693,6 @@ gdisplay_install_override_cursor (GDisplay *gdisp,
}
}
/* remove an override-cursor from gdisplay... */
void
gdisplay_remove_override_cursor (GDisplay *gdisp)
{
@ -1722,14 +1708,12 @@ gdisplay_remove_override_cursor (GDisplay *gdisp)
}
}
void
gdisplay_remove_tool_cursor (GDisplay *gdisp)
{
unset_win_cursor (gdisp->canvas->window);
}
void
gdisplay_set_menu_sensitivity (GDisplay *gdisp)
{
@ -1965,7 +1949,6 @@ gdisplay_active (void)
return gimp_context_get_display (gimp_context_get_user ());
}
GDisplay *
gdisplay_get_by_ID (gint ID)
{
@ -1986,7 +1969,6 @@ gdisplay_get_by_ID (gint ID)
return NULL;
}
void
gdisplay_update_title (GDisplay *gdisp)
{
@ -2004,21 +1986,19 @@ gdisplay_update_title (GDisplay *gdisp)
gtk_statusbar_push (GTK_STATUSBAR (gdisp->statusbar), context_id, title);
}
void
gdisplays_update_title (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
gdisplay_update_title (gdisp);
list = g_slist_next (list);
if (gdisp->gimage == gimage)
gdisplay_update_title (gdisp);
}
}
@ -2026,16 +2006,15 @@ void
gdisplays_resize_cursor_label (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
gdisplay_resize_cursor_label (gdisp);
list = g_slist_next (list);
}
}
@ -2043,16 +2022,15 @@ void
gdisplays_setup_scale (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
setup_scale (gdisp);
list = g_slist_next (list);
}
}
@ -2064,14 +2042,15 @@ gdisplays_update_area (GimpImage *gimage,
gint h)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* int x1, y1, x2, y2; */
/* int count = 0; */
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
/* We only need to update the first instance that
@ -2102,71 +2081,62 @@ gdisplays_update_area (GimpImage *gimage,
gdisplay_add_display_area (gdisp, x1, y1, (x2 - x1), (y2 - y1));
*/
}
list = g_slist_next (list);
}
}
void
gdisplays_expose_guides (GimpImage *gimage)
{
GDisplay *gdisp;
GList *tmp_list;
GSList *list;
GSList *list;
GList *guide_list;
/* traverse the linked list of displays, handling each one */
list = display_list;
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
tmp_list = gdisp->gimage->guides;
while (tmp_list)
for (guide_list = gdisp->gimage->guides;
guide_list;
guide_list = g_list_next (guide_list))
{
gdisplay_expose_guide (gdisp, tmp_list->data);
tmp_list = tmp_list->next;
gdisplay_expose_guide (gdisp, guide_list->data);
}
}
list = g_slist_next (list);
}
}
void
gdisplays_expose_guide (GimpImage *gimage,
Guide *guide)
{
GDisplay *gdisp;
GSList *list;
GSList *list;
/* traverse the linked list of displays, handling each one */
list = display_list;
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
gdisplay_expose_guide (gdisp, guide);
}
list = g_slist_next (list);
gdisplay_expose_guide (gdisp, guide);
}
}
void
gdisplays_update_full (GimpImage* gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
gint count = 0;
GSList *list;
gint count = 0;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
if (! count)
@ -2180,42 +2150,37 @@ gdisplays_update_full (GimpImage* gimage)
count++;
}
list = g_slist_next (list);
}
}
void
gdisplays_shrink_wrap (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
shrink_wrap_display (gdisp);
list = g_slist_next (list);
}
}
void
gdisplays_expose_full (void)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
gdisplay_expose_full (gdisp);
list = g_slist_next (list);
}
}
@ -2223,10 +2188,10 @@ void
gdisplays_nav_preview_resized (void)
{
GDisplay *gdisp;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays, handling each one */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
@ -2235,8 +2200,6 @@ gdisplays_nav_preview_resized (void)
if (gdisp->nav_popup)
nav_window_popup_preview_resized (&gdisp->nav_popup);
list = g_slist_next (list);
}
}
@ -2249,9 +2212,10 @@ gdisplays_selection_visibility (GimpImage *gimage,
gint count = 0;
/* traverse the linked list of displays, handling each one */
for (list = display_list; list; list = g_slist_next (list))
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage && gdisp->select)
{
switch (function)
@ -2277,44 +2241,41 @@ gdisplays_selection_visibility (GimpImage *gimage,
}
}
gboolean
gdisplays_dirty (void)
{
gboolean dirty = FALSE;
GSList *list = display_list;
GSList *list;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
if (((GDisplay *) list->data)->gimage->dirty != 0)
dirty = TRUE;
list = g_slist_next (list);
}
return dirty;
}
void
gdisplays_delete (void)
{
GSList *list = display_list;
GDisplay *gdisp;
GSList *list;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
list = g_slist_next (list);
gtk_widget_destroy (gdisp->shell);
}
/* free up linked list data */
g_slist_free (display_list);
display_list = NULL;
}
GDisplay *
gdisplays_check_valid (GDisplay *gtest,
GimpImage *gimage)
@ -2324,30 +2285,31 @@ gdisplays_check_valid (GDisplay *gtest,
* gimage. If none found return NULL;
*/
GSList *list = display_list;
GDisplay *gdisp;
GDisplay *gdisp_found = NULL;
GSList *list;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisp = (GDisplay *) list->data;
if (gdisp == gtest)
return (gtest);
return gtest;
if (!gdisp_found && gdisp->gimage == gimage)
gdisp_found = gdisp;
list = g_slist_next (list);
}
return (gdisp_found);
return gdisp_found;
}
static void
gdisplays_flush_whenever (gboolean now)
{
static gboolean flushing = FALSE;
GSList *list = display_list;
GSList *list;
/* no flushing necessary without an interface */
if (no_interface)
@ -2363,10 +2325,9 @@ gdisplays_flush_whenever (gboolean now)
flushing = TRUE;
/* traverse the linked list of displays */
while (list)
for (list = display_list; list; list = g_slist_next (list))
{
gdisplay_flush_whenever ((GDisplay *) list->data, now);
list = g_slist_next (list);
}
/* for convenience, we call the L&C flush here */
@ -2430,7 +2391,6 @@ gdisplay_reconnect (GDisplay *gdisp,
gdisplay_flush (gdisp);
}
void
gdisplays_reconnect (GimpImage *old,
GimpImage *new)

View File

@ -23,14 +23,13 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "dialog_handler.h"
#include "gdisplay.h"
#include "gimage.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimpset.h"
#include "layer.h"
#include "lc_dialog.h"
#include "paint_funcs.h"
#include "palette_import.h"

View File

@ -23,15 +23,15 @@
#include "apptypes.h"
#include "boundary.h"
#include "channel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimprc.h"
#include "layer.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "tile_manager.h"

View File

@ -30,13 +30,13 @@
#include "appenv.h"
#include "boundary.h"
#include "channel.h"
#include "drawable.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimplayer.h"
#include "gimppreviewcache.h"
#include "gimplut.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "pixel_processor.h"
@ -1595,25 +1595,25 @@ gimp_channel_layer_mask (GimpChannel *mask,
gimp_channel_push_undo (mask);
/* clear the mask */
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
0, 0,
GIMP_DRAWABLE(mask)->width, GIMP_DRAWABLE(mask)->height,
GIMP_DRAWABLE (mask)->width, GIMP_DRAWABLE (mask)->height,
TRUE);
color_region (&destPR, &empty);
x1 = CLAMP (GIMP_DRAWABLE(layer)->offset_x, 0, GIMP_DRAWABLE(mask)->width);
y1 = CLAMP (GIMP_DRAWABLE(layer)->offset_y, 0, GIMP_DRAWABLE(mask)->height);
x2 = CLAMP (GIMP_DRAWABLE(layer)->offset_x + GIMP_DRAWABLE(layer)->width,
0, GIMP_DRAWABLE(mask)->width);
y2 = CLAMP (GIMP_DRAWABLE(layer)->offset_y + GIMP_DRAWABLE(layer)->height,
0, GIMP_DRAWABLE(mask)->height);
x1 = CLAMP (GIMP_DRAWABLE (layer)->offset_x, 0, GIMP_DRAWABLE (mask)->width);
y1 = CLAMP (GIMP_DRAWABLE (layer)->offset_y, 0, GIMP_DRAWABLE (mask)->height);
x2 = CLAMP (GIMP_DRAWABLE (layer)->offset_x + GIMP_DRAWABLE (layer)->width,
0, GIMP_DRAWABLE (mask)->width);
y2 = CLAMP (GIMP_DRAWABLE (layer)->offset_y + GIMP_DRAWABLE (layer)->height,
0, GIMP_DRAWABLE (mask)->height);
pixel_region_init (&srcPR, GIMP_DRAWABLE(layer->mask)->tiles,
(x1 - GIMP_DRAWABLE(layer)->offset_x),
(y1 - GIMP_DRAWABLE(layer)->offset_y),
pixel_region_init (&srcPR, GIMP_DRAWABLE (layer->mask)->tiles,
(x1 - GIMP_DRAWABLE (layer)->offset_x),
(y1 - GIMP_DRAWABLE (layer)->offset_y),
(x2 - x1), (y2 - y1),
FALSE);
pixel_region_init (&destPR, GIMP_DRAWABLE(mask)->tiles,
pixel_region_init (&destPR, GIMP_DRAWABLE (mask)->tiles,
x1, y1,
(x2 - x1), (y2 - y1),
TRUE);

View File

@ -29,15 +29,15 @@
#include "apptypes.h"
#include "apptypes.h"
#include "channel.h"
#include "channel_ops.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimpcontext.h"
#include "gimage.h"
#include "layer.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -29,12 +29,12 @@
#include "apptypes.h"
#include "channel.h"
#include "gimpdrawable.h"
#include "layer.h"
#include "gimppreviewcache.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimppreviewcache.h"
#include "gimpparasite.h"
#include "paint_funcs.h"
#include "parasitelist.h"

View File

@ -24,12 +24,12 @@
#include "apptypes.h"
#include "channel.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "gimpdrawable.h"
#include "gimpdrawablepreview.h"
#include "gimplayer.h"
#include "gimppreviewcache.h"
#include "layer.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "temp_buf.h"

View File

@ -31,7 +31,6 @@
#include "apptypes.h"
#include "channel.h"
#include "gimpdrawable.h"
#include "gimphistogram.h"
#include "gimpimage.h"

View File

@ -104,8 +104,8 @@
#include "gdisplay.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimppalette.h"
#include "layer.h"
#include "palette.h"
#include "palette_select.h"
#include "pixel_region.h"

View File

@ -29,15 +29,15 @@
#include "apptypes.h"
#include "apptypes.h"
#include "channel.h"
#include "channel_ops.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimpcontext.h"
#include "gimage.h"
#include "layer.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -27,7 +27,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "floating_sel.h"
@ -36,11 +35,11 @@
#include "gimpcontext.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimpmarshal.h"
#include "gimprc.h"
#include "gimpparasite.h"
#include "layer.h"
#include "paint_funcs.h"
#include "parasitelist.h"
#include "path.h"

View File

@ -35,9 +35,9 @@
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimppreviewcache.h"
#include "layer.h"
#include "parasitelist.h"
#include "paint_funcs.h"
#include "pixel_region.h"

View File

@ -20,7 +20,7 @@
#define __GIMP_LAYER_MASK_H__
#include "channel.h"
#include "gimpchannel.h"
#define GIMP_TYPE_LAYER_MASK (gimp_layer_mask_get_type ())

View File

@ -32,10 +32,10 @@
#include "gimage.h"
#include "gimage_mask.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "global_edit.h"
#include "image_new.h"
#include "layer.h"
#include "paint_funcs.h"
#include "pixel_region.h"
#include "tile_manager.h"

View File

@ -28,13 +28,13 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "channels_dialog.h"
#include "color_panel.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimage.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpdnd.h"
#include "gimpdrawablepreview.h"
#include "gimppreviewcache.h"

View File

@ -51,6 +51,7 @@
#include "gimpdrawable.h"
#include "gimphelp.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "gimpui.h"
#include "global_edit.h"
@ -58,7 +59,6 @@
#include "image_render.h"
#include "info_dialog.h"
#include "info_window.h"
#include "layer.h"
#include "nav_window.h"
#include "invert.h"
#include "lc_dialog.h"

View File

@ -51,6 +51,7 @@
#include "gimpdrawable.h"
#include "gimphelp.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "gimpui.h"
#include "global_edit.h"
@ -58,7 +59,6 @@
#include "image_render.h"
#include "info_dialog.h"
#include "info_window.h"
#include "layer.h"
#include "nav_window.h"
#include "invert.h"
#include "lc_dialog.h"

View File

@ -27,8 +27,8 @@
#include "gimpdrawable.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "layer.h"
#include "layer_select.h"
#include "layers_dialogP.h"
#include "temp_buf.h"

View File

@ -35,10 +35,10 @@
#include "gimage_mask.h"
#include "gimpdnd.h"
#include "gimpdrawablepreview.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimprc.h"
#include "image_render.h"
#include "layer.h"
#include "layers_dialog.h"
#include "layers_dialogP.h"
#include "lc_dialogP.h"

View File

@ -36,7 +36,6 @@
#include "gimphelp.h"
#include "gimprc.h"
#include "image_render.h"
#include "layer.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "resolution_calibrate.h"

View File

@ -29,14 +29,14 @@
#include "apptypes.h"
#include "channel.h"
#include "color_panel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "global_edit.h"
#include "qmask.h"
#include "undo.h"

View File

@ -27,8 +27,8 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "layer.h"
#include "resize.h"
#include "undo.h"

View File

@ -32,10 +32,10 @@
#include "gimage.h"
#include "gimpcontext.h"
#include "gimpdnd.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "gtkhwrapbox.h"
#include "indicator_area.h"
#include "layer.h"
#include "menus.h"
#include "paint_funcs.h"
#include "session.h"

View File

@ -28,9 +28,9 @@
#include "gdisplay.h"
#include "gimage.h"
#include "gimpcontext.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "image_new.h"
#include "layer.h"
#include "paint_funcs.h"
#include "tile_manager.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,144 +0,0 @@
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_LAYER_H__
#define __GIMP_LAYER_H__
#include "gimpdrawable.h"
#define GIMP_TYPE_LAYER (gimp_layer_get_type ())
#define GIMP_LAYER(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_LAYER, GimpLayer))
#define GIMP_LAYER_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_LAYER, GimpLayerClass))
#define GIMP_IS_LAYER(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_LAYER))
#define GIMP_IS_LAYER_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_LAYER))
typedef struct _GimpLayerClass GimpLayerClass;
struct _GimpLayer
{
GimpDrawable parent_instance;
gboolean linked; /* control linkage */
gboolean preserve_trans; /* preserve transparency */
GimpLayerMask *mask; /* possible layer mask */
gint apply_mask; /* controls mask application */
gboolean edit_mask; /* edit mask or layer? */
gboolean show_mask; /* show mask or layer? */
gint opacity; /* layer opacity */
LayerModeEffects mode; /* layer combination mode */
/* Floating selections */
struct
{
TileManager *backing_store; /* for obscured regions */
GimpDrawable *drawable; /* floating sel is attached to */
gboolean initial; /* is fs composited yet? */
gboolean boundary_known; /* is the current boundary valid */
BoundSeg *segs; /* boundary of floating sel */
gint num_segs; /* number of segs in boundary */
} fs;
};
struct _GimpLayerClass
{
GimpDrawableClass parent_class;
};
/* Special undo types */
struct _LayerUndo
{
GimpLayer *layer; /* the actual layer */
gint prev_position; /* former position in list */
GimpLayer *prev_layer; /* previous active layer */
};
struct _FStoLayerUndo
{
GimpLayer *layer; /* the layer */
GimpDrawable *drawable; /* drawable of floating sel */
};
/* function declarations */
GtkType gimp_layer_get_type (void);
GimpLayer * gimp_layer_new (GimpImage *gimage,
gint width,
gint height,
GimpImageType type,
const gchar *name,
gint opacity,
LayerModeEffects mode);
GimpLayer * gimp_layer_copy (GimpLayer *layer,
gboolean add_alpha);
GimpLayer * gimp_layer_new_from_tiles (GimpImage *gimage,
GimpImageType layer_type,
TileManager *tiles,
gchar *name,
gint opacity,
LayerModeEffects mode);
gboolean gimp_layer_check_scaling (GimpLayer *layer,
gint new_width,
gint new_height);
GimpLayerMask * gimp_layer_create_mask (GimpLayer *layer,
AddMaskType add_mask_type);
GimpLayerMask * gimp_layer_add_mask (GimpLayer *layer,
GimpLayerMask *mask);
void gimp_layer_apply_mask (GimpLayer *layer,
MaskApplyMode mode);
void gimp_layer_translate (GimpLayer *layer,
gint off_x,
gint off_y);
void gimp_layer_add_alpha (GimpLayer *layer);
gboolean gimp_layer_scale_by_factors (GimpLayer *layer,
gdouble w_factor,
gdouble h_factor);
void gimp_layer_scale (GimpLayer *layer,
gint new_width,
gint new_height,
gboolean local_origin);
void gimp_layer_resize (GimpLayer *layer,
gint new_width,
gint new_height,
gint offx,
gint offy);
void gimp_layer_resize_to_image (GimpLayer *layer);
BoundSeg * gimp_layer_boundary (GimpLayer *layer,
gint *num_segs);
void gimp_layer_invalidate_boundary (GimpLayer *layer);
gint gimp_layer_pick_correlate (GimpLayer *layer,
gint x,
gint y);
GimpLayerMask * gimp_layer_get_mask (GimpLayer *layer);
gboolean gimp_layer_has_alpha (GimpLayer *layer);
gboolean gimp_layer_is_floating_sel (GimpLayer *layer);
gboolean gimp_layer_linked (GimpLayer *layer);
#endif /* __GIMP_LAYER_H__ */

View File

@ -27,8 +27,8 @@
#include "gimpdrawable.h"
#include "gimpdrawablepreview.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "layer.h"
#include "layer_select.h"
#include "layers_dialogP.h"
#include "temp_buf.h"

View File

@ -35,10 +35,10 @@
#include "gimage_mask.h"
#include "gimpdnd.h"
#include "gimpdrawablepreview.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "gimprc.h"
#include "image_render.h"
#include "layer.h"
#include "layers_dialog.h"
#include "layers_dialogP.h"
#include "lc_dialogP.h"

View File

@ -26,8 +26,8 @@
#include "apptypes.h"
#include "procedural_db.h"
#include "channel.h"
#include "drawable.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "pdb_glue.h"

View File

@ -27,11 +27,10 @@
#include "apptypes.h"
#include "procedural_db.h"
#include "channel.h"
#include "drawable.h"
#include "gimpdrawablepreview.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "layer.h"
#include "pdb_glue.h"
#include "temp_buf.h"
#include "tile.h"

View File

@ -28,8 +28,8 @@
#include "drawable.h"
#include "gimage_mask.h"
#include "gimplayer.h"
#include "global_edit.h"
#include "layer.h"
extern TileManager *global_buf;

View File

@ -28,7 +28,7 @@
#include "drawable.h"
#include "floating_sel.h"
#include "layer.h"
#include "gimplayer.h"
static ProcRecord floating_sel_remove_proc;
static ProcRecord floating_sel_anchor_proc;

View File

@ -27,13 +27,14 @@
#include "apptypes.h"
#include "procedural_db.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimage.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "layer.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "temp_buf.h"
#include "libgimp/gimpintl.h"

View File

@ -26,11 +26,11 @@
#include "apptypes.h"
#include "procedural_db.h"
#include "channel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gimpimage.h"
#include "layer.h"
#include "gimplayer.h"
#include "gimplayermask.h"
#include "pdb_glue.h"
#include "undo.h"

View File

@ -26,11 +26,11 @@
#include "apptypes.h"
#include "procedural_db.h"
#include "channel.h"
#include "drawable.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "layer.h"
#include "gimplayer.h"
static ProcRecord selection_bounds_proc;
static ProcRecord selection_value_proc;

View File

@ -30,7 +30,7 @@
#include "appenv.h"
#include "drawable.h"
#include "layer.h"
#include "gimplayer.h"
#include "tools/text_tool.h"
#include "libgimp/gimplimits.h"

View File

@ -36,7 +36,6 @@
#include "gimphelp.h"
#include "gimprc.h"
#include "image_render.h"
#include "layer.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "resolution_calibrate.h"

View File

@ -29,14 +29,14 @@
#include "apptypes.h"
#include "channel.h"
#include "color_panel.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimpimage.h"
#include "global_edit.h"
#include "qmask.h"
#include "undo.h"

View File

@ -27,8 +27,8 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "layer.h"
#include "resize.h"
#include "undo.h"

View File

@ -26,7 +26,7 @@
#include "apptypes.h"
#include "channel.h"
#include "gimpchannel.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "pixel_region.h"

View File

@ -32,10 +32,10 @@
#include "gimage.h"
#include "gimpcontext.h"
#include "gimpdnd.h"
#include "gimplayer.h"
#include "gimprc.h"
#include "gtkhwrapbox.h"
#include "indicator_area.h"
#include "layer.h"
#include "menus.h"
#include "paint_funcs.h"
#include "session.h"

View File

@ -26,7 +26,6 @@
#include "apptypes.h"
#include "channel.h"
#include "cursorutil.h"
#include "draw_core.h"
#include "drawable.h"
@ -35,6 +34,7 @@
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "rect_select.h"
#include "bezier_select.h"

View File

@ -26,12 +26,12 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimprc.h"
#include "paint_funcs.h"

View File

@ -28,11 +28,11 @@
#include "appenv.h"
#include "boundary.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "draw_core.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpdnd.h"
#include "gimpimage.h"
#include "gimprc.h"

View File

@ -29,16 +29,16 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "cursorutil.h"
#include "draw_core.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimage_mask.h"
#include "info_dialog.h"
#include "layer.h"
#include "pixel_region.h"
#include "undo.h"

View File

@ -33,11 +33,11 @@
#include "draw_core.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimprc.h"
#include "gdisplay.h"
#include "layer.h"
#include "gimage_mask.h"
#include "gimplayer.h"
#include "gimpimage.h"
#include "gimprc.h"
#include "path_transform.h"
#include "selection.h"
#include "undo.h"

View File

@ -24,11 +24,11 @@
#include "apptypes.h"
#include "channel.h"
#include "draw_core.h"
#include "edit_selection.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "rect_select.h"
#include "rect_selectP.h"

View File

@ -27,13 +27,13 @@
#include "apptypes.h"
#include "channel.h"
#include "draw_core.h"
#include "errors.h"
#include "floating_sel.h"
#include "gimage_mask.h"
#include "gimpimage.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "scan_convert.h"
#include "edit_selection.h"

View File

@ -27,15 +27,15 @@
#include "apptypes.h"
#include "boundary.h"
#include "channel.h"
#include "cursorutil.h"
#include "draw_core.h"
#include "drawable.h"
#include "edit_selection.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "gimprc.h"
#include "gdisplay.h"
#include "pixel_region.h"
#include "tile_manager.h"
#include "tile.h"

View File

@ -26,12 +26,12 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "gdisplay.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpcontext.h"
#include "gimprc.h"
#include "paint_funcs.h"

View File

@ -28,11 +28,11 @@
#include "appenv.h"
#include "boundary.h"
#include "channel.h"
#include "cursorutil.h"
#include "drawable.h"
#include "draw_core.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpdnd.h"
#include "gimpimage.h"
#include "gimprc.h"

View File

@ -29,16 +29,16 @@
#include "apptypes.h"
#include "appenv.h"
#include "channel.h"
#include "cursorutil.h"
#include "draw_core.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gdisplay.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "gimplayer.h"
#include "gimage_mask.h"
#include "info_dialog.h"
#include "layer.h"
#include "pixel_region.h"
#include "undo.h"

View File

@ -33,11 +33,11 @@
#include "draw_core.h"
#include "drawable.h"
#include "floating_sel.h"
#include "gimpimage.h"
#include "gimage_mask.h"
#include "gimprc.h"
#include "gdisplay.h"
#include "layer.h"
#include "gimage_mask.h"
#include "gimplayer.h"
#include "gimpimage.h"
#include "gimprc.h"
#include "path_transform.h"
#include "selection.h"
#include "undo.h"

View File

@ -24,11 +24,11 @@
#include "apptypes.h"
#include "channel.h"
#include "draw_core.h"
#include "edit_selection.h"
#include "gdisplay.h"
#include "gimage_mask.h"
#include "gimpchannel.h"
#include "gimpimage.h"
#include "rect_select.h"
#include "rect_selectP.h"

Some files were not shown because too many files have changed in this diff Show More