renamed it to GimpDisplay and made it a GimpObject subclass.

2001-09-25  Michael Natterer  <mitch@gimp.org>

	* app/gdisplay.[ch]: renamed it to GimpDisplay and made it a
	GimpObject subclass.

	* app/disp_callbacks.[ch]
	* app/gdisplay_ops.[ch]
	* app/scale.[ch]
	* app/scroll.[ch]
	* app/display/display-types.h: changed accordingly.

	* app/core/gimpimage.[ch]: new signal "selection_control".

	* app/core/core-types.h: moved the SelectionControl enum and all
	other core enums here.

	* app/gui/gui.c: connect to the images' "selection_control" signal
	and call gdisplays_selection_visibility().

	* app/core/gimpcontext.c
	* app/core/gimpdrawable-offset.h
	* app/core/gimpimage-convert.h
	* app/core/gimpimage-mask.c
	* app/core/gimplayer.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpinktool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c: changed accordingly.

	* app/gui/colormap-dialog.[ch]: GObject porting.

	* tools/pdbgen/Makefile.am: removed headers which no longer
	contain enums.

	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/drawable.pdb: include files which are no longer
	included automatically by the enum voodoo.

	* app/pdb/convert_cmds.c
	* tools/pdbgen/enums.pl: regenerated.
This commit is contained in:
Michael Natterer 2001-09-25 17:44:03 +00:00 committed by Michael Natterer
parent 0b99316751
commit b2215a1f8b
67 changed files with 3640 additions and 2927 deletions

View File

@ -1,3 +1,44 @@
2001-09-25 Michael Natterer <mitch@gimp.org>
* app/gdisplay.[ch]: renamed it to GimpDisplay and made it a
GimpObject subclass.
* app/disp_callbacks.[ch]
* app/gdisplay_ops.[ch]
* app/scale.[ch]
* app/scroll.[ch]
* app/display/display-types.h: changed accordingly.
* app/core/gimpimage.[ch]: new signal "selection_control".
* app/core/core-types.h: moved the SelectionControl enum and all
other core enums here.
* app/gui/gui.c: connect to the images' "selection_control" signal
and call gdisplays_selection_visibility().
* app/core/gimpcontext.c
* app/core/gimpdrawable-offset.h
* app/core/gimpimage-convert.h
* app/core/gimpimage-mask.c
* app/core/gimplayer.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpinktool.c
* app/tools/gimpmovetool.c
* app/tools/gimppainttool.c: changed accordingly.
* app/gui/colormap-dialog.[ch]: GObject porting.
* tools/pdbgen/Makefile.am: removed headers which no longer
contain enums.
* tools/pdbgen/pdb/convert.pdb
* tools/pdbgen/pdb/drawable.pdb: include files which are no longer
included automatically by the enum voodoo.
* app/pdb/convert_cmds.c
* tools/pdbgen/enums.pl: regenerated.
2001-09-24 Nathan Summers <rock@gimp.org>
* plug-ins/Lighting/lighting_image.c

View File

@ -98,6 +98,15 @@ typedef enum /*< chop=CHANNEL_OP_ >*/
CHANNEL_OP_INTERSECT
} ChannelOps;
typedef enum /*< skip >*/
{
GIMP_SELECTION_OFF,
GIMP_SELECTION_LAYER_OFF,
GIMP_SELECTION_ON,
GIMP_SELECTION_PAUSE,
GIMP_SELECTION_RESUME
} GimpSelectionControl;
typedef enum
{
FOREGROUND_FILL, /*< nick=FG_IMAGE_FILL >*/
@ -114,6 +123,39 @@ typedef enum /*< chop=GIMP_ >*/
GIMP_HIGHLIGHTS
} GimpTransferMode;
typedef enum
{
OFFSET_BACKGROUND,
OFFSET_TRANSPARENT
} GimpOffsetType;
typedef enum
{
EXPAND_AS_NECESSARY,
CLIP_TO_IMAGE,
CLIP_TO_BOTTOM_LAYER,
FLATTEN_IMAGE
} MergeType;
typedef enum
{
MAKE_PALETTE = 0,
REUSE_PALETTE = 1,
WEB_PALETTE = 2,
MONO_PALETTE = 3,
CUSTOM_PALETTE = 4
} ConvertPaletteType;
typedef enum
{
NO_DITHER = 0,
FS_DITHER = 1,
FSLOWBLEED_DITHER = 2,
FIXED_DITHER = 3,
NODESTRUCT_DITHER = 4 /* NEVER USE NODESTRUCT_DITHER EXPLICITLY */
} ConvertDitherType;
/* base objects */

View File

@ -1249,8 +1249,9 @@ gimp_context_real_set_display (GimpContext *context,
{
typedef struct
{
GObject *shell;
GimpImage *gimage;
GimpObject foobar;
GObject *shell;
GimpImage *gimage;
} EEKWrapper;
EEKWrapper *eek_wrapper;

View File

@ -20,13 +20,6 @@
#define __GIMP_DRAWABLE_OFFSET_H__
typedef enum
{
OFFSET_BACKGROUND,
OFFSET_TRANSPARENT
} GimpOffsetType;
void gimp_drawable_offset (GimpDrawable *drawable,
gboolean wrap_around,
GimpOffsetType fill_type,

View File

@ -20,27 +20,6 @@
#define __GIMP_IMAGE_CONVERT_H__
/* adam's extra palette stuff */
typedef enum
{
MAKE_PALETTE = 0,
REUSE_PALETTE = 1,
WEB_PALETTE = 2,
MONO_PALETTE = 3,
CUSTOM_PALETTE = 4
} ConvertPaletteType;
/* adam's extra dither stuff */
typedef enum
{
NO_DITHER = 0,
FS_DITHER = 1,
FSLOWBLEED_DITHER = 2,
FIXED_DITHER = 3,
NODESTRUCT_DITHER = 4 /* NEVER USE NODESTRUCT_DITHER EXPLICITLY */
} ConvertDitherType;
#define MAXNUMCOLORS 256

View File

@ -171,6 +171,7 @@ enum
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
SELECTION_CONTROL,
CLEAN,
DIRTY,
@ -301,6 +302,16 @@ gimp_image_class_init (GimpImageClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_image_signals[SELECTION_CONTROL] =
g_signal_new ("selection_control",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, selection_control),
NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1,
G_TYPE_INT);
gimp_image_signals[CLEAN] =
g_signal_new ("clean",
G_TYPE_FROM_CLASS (klass),
@ -1854,6 +1865,16 @@ gimp_image_update (GimpImage *gimage,
x, y, width, height);
}
void
gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_signal_emit (G_OBJECT (gimage), gimp_image_signals[SELECTION_CONTROL], 0,
control);
}
/************************************************************/
/* Projection functions */

View File

@ -30,15 +30,6 @@
(t) == INDEXEDA_GIMAGE)
typedef enum
{
EXPAND_AS_NECESSARY,
CLIP_TO_IMAGE,
CLIP_TO_BOTTOM_LAYER,
FLATTEN_IMAGE
} MergeType;
struct _GimpGuide
{
gint ref_count;
@ -136,31 +127,33 @@ struct _GimpImageClass
{
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* selection_control) (GimpImage *gimage,
GimpSelectionControl control);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
};
@ -168,108 +161,108 @@ struct _GimpImageClass
GType gimp_image_get_type (void);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
/* Temporary hack till colormap manipulation is encapsulated in functions.
* Call this whenever you modify an image's colormap. The col argument
@ -277,18 +270,20 @@ PathList * gimp_image_get_paths (const GimpImage *gimage);
* Currently, use this also when the image's base type is changed to/from
* indexed.
*/
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control);
/* layer/channel functions */

View File

@ -46,7 +46,6 @@
#include "libgimp/gimpintl.h"
#include "display/display-funcs.h"
/* local variables */
static gboolean gimage_mask_stroking = FALSE;
@ -143,7 +142,7 @@ gimage_mask_invalidate (GimpImage *gimage)
GimpChannel *mask;
/* Turn the current selection off */
gdisplays_selection_visibility (gimage, 0 /* SELECTION_OFF */);
gimp_image_selection_control (gimage, GIMP_SELECTION_OFF);
mask = gimp_image_get_mask (gimage);
mask->boundary_known = FALSE;

View File

@ -171,6 +171,7 @@ enum
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
SELECTION_CONTROL,
CLEAN,
DIRTY,
@ -301,6 +302,16 @@ gimp_image_class_init (GimpImageClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_image_signals[SELECTION_CONTROL] =
g_signal_new ("selection_control",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, selection_control),
NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1,
G_TYPE_INT);
gimp_image_signals[CLEAN] =
g_signal_new ("clean",
G_TYPE_FROM_CLASS (klass),
@ -1854,6 +1865,16 @@ gimp_image_update (GimpImage *gimage,
x, y, width, height);
}
void
gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_signal_emit (G_OBJECT (gimage), gimp_image_signals[SELECTION_CONTROL], 0,
control);
}
/************************************************************/
/* Projection functions */

View File

@ -30,15 +30,6 @@
(t) == INDEXEDA_GIMAGE)
typedef enum
{
EXPAND_AS_NECESSARY,
CLIP_TO_IMAGE,
CLIP_TO_BOTTOM_LAYER,
FLATTEN_IMAGE
} MergeType;
struct _GimpGuide
{
gint ref_count;
@ -136,31 +127,33 @@ struct _GimpImageClass
{
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* selection_control) (GimpImage *gimage,
GimpSelectionControl control);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
};
@ -168,108 +161,108 @@ struct _GimpImageClass
GType gimp_image_get_type (void);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
/* Temporary hack till colormap manipulation is encapsulated in functions.
* Call this whenever you modify an image's colormap. The col argument
@ -277,18 +270,20 @@ PathList * gimp_image_get_paths (const GimpImage *gimage);
* Currently, use this also when the image's base type is changed to/from
* indexed.
*/
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control);
/* layer/channel functions */

View File

@ -171,6 +171,7 @@ enum
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
SELECTION_CONTROL,
CLEAN,
DIRTY,
@ -301,6 +302,16 @@ gimp_image_class_init (GimpImageClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_image_signals[SELECTION_CONTROL] =
g_signal_new ("selection_control",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, selection_control),
NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1,
G_TYPE_INT);
gimp_image_signals[CLEAN] =
g_signal_new ("clean",
G_TYPE_FROM_CLASS (klass),
@ -1854,6 +1865,16 @@ gimp_image_update (GimpImage *gimage,
x, y, width, height);
}
void
gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_signal_emit (G_OBJECT (gimage), gimp_image_signals[SELECTION_CONTROL], 0,
control);
}
/************************************************************/
/* Projection functions */

View File

@ -30,15 +30,6 @@
(t) == INDEXEDA_GIMAGE)
typedef enum
{
EXPAND_AS_NECESSARY,
CLIP_TO_IMAGE,
CLIP_TO_BOTTOM_LAYER,
FLATTEN_IMAGE
} MergeType;
struct _GimpGuide
{
gint ref_count;
@ -136,31 +127,33 @@ struct _GimpImageClass
{
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* selection_control) (GimpImage *gimage,
GimpSelectionControl control);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
};
@ -168,108 +161,108 @@ struct _GimpImageClass
GType gimp_image_get_type (void);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
/* Temporary hack till colormap manipulation is encapsulated in functions.
* Call this whenever you modify an image's colormap. The col argument
@ -277,18 +270,20 @@ PathList * gimp_image_get_paths (const GimpImage *gimage);
* Currently, use this also when the image's base type is changed to/from
* indexed.
*/
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control);
/* layer/channel functions */

View File

@ -171,6 +171,7 @@ enum
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
SELECTION_CONTROL,
CLEAN,
DIRTY,
@ -301,6 +302,16 @@ gimp_image_class_init (GimpImageClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_image_signals[SELECTION_CONTROL] =
g_signal_new ("selection_control",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, selection_control),
NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1,
G_TYPE_INT);
gimp_image_signals[CLEAN] =
g_signal_new ("clean",
G_TYPE_FROM_CLASS (klass),
@ -1854,6 +1865,16 @@ gimp_image_update (GimpImage *gimage,
x, y, width, height);
}
void
gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_signal_emit (G_OBJECT (gimage), gimp_image_signals[SELECTION_CONTROL], 0,
control);
}
/************************************************************/
/* Projection functions */

View File

@ -30,15 +30,6 @@
(t) == INDEXEDA_GIMAGE)
typedef enum
{
EXPAND_AS_NECESSARY,
CLIP_TO_IMAGE,
CLIP_TO_BOTTOM_LAYER,
FLATTEN_IMAGE
} MergeType;
struct _GimpGuide
{
gint ref_count;
@ -136,31 +127,33 @@ struct _GimpImageClass
{
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* selection_control) (GimpImage *gimage,
GimpSelectionControl control);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
};
@ -168,108 +161,108 @@ struct _GimpImageClass
GType gimp_image_get_type (void);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
/* Temporary hack till colormap manipulation is encapsulated in functions.
* Call this whenever you modify an image's colormap. The col argument
@ -277,18 +270,20 @@ PathList * gimp_image_get_paths (const GimpImage *gimage);
* Currently, use this also when the image's base type is changed to/from
* indexed.
*/
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control);
/* layer/channel functions */

View File

@ -171,6 +171,7 @@ enum
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
SELECTION_CONTROL,
CLEAN,
DIRTY,
@ -301,6 +302,16 @@ gimp_image_class_init (GimpImageClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_image_signals[SELECTION_CONTROL] =
g_signal_new ("selection_control",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, selection_control),
NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1,
G_TYPE_INT);
gimp_image_signals[CLEAN] =
g_signal_new ("clean",
G_TYPE_FROM_CLASS (klass),
@ -1854,6 +1865,16 @@ gimp_image_update (GimpImage *gimage,
x, y, width, height);
}
void
gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_signal_emit (G_OBJECT (gimage), gimp_image_signals[SELECTION_CONTROL], 0,
control);
}
/************************************************************/
/* Projection functions */

View File

@ -30,15 +30,6 @@
(t) == INDEXEDA_GIMAGE)
typedef enum
{
EXPAND_AS_NECESSARY,
CLIP_TO_IMAGE,
CLIP_TO_BOTTOM_LAYER,
FLATTEN_IMAGE
} MergeType;
struct _GimpGuide
{
gint ref_count;
@ -136,31 +127,33 @@ struct _GimpImageClass
{
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* selection_control) (GimpImage *gimage,
GimpSelectionControl control);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
};
@ -168,108 +161,108 @@ struct _GimpImageClass
GType gimp_image_get_type (void);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
/* Temporary hack till colormap manipulation is encapsulated in functions.
* Call this whenever you modify an image's colormap. The col argument
@ -277,18 +270,20 @@ PathList * gimp_image_get_paths (const GimpImage *gimage);
* Currently, use this also when the image's base type is changed to/from
* indexed.
*/
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control);
/* layer/channel functions */

View File

@ -171,6 +171,7 @@ enum
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
SELECTION_CONTROL,
CLEAN,
DIRTY,
@ -301,6 +302,16 @@ gimp_image_class_init (GimpImageClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_image_signals[SELECTION_CONTROL] =
g_signal_new ("selection_control",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, selection_control),
NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1,
G_TYPE_INT);
gimp_image_signals[CLEAN] =
g_signal_new ("clean",
G_TYPE_FROM_CLASS (klass),
@ -1854,6 +1865,16 @@ gimp_image_update (GimpImage *gimage,
x, y, width, height);
}
void
gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_signal_emit (G_OBJECT (gimage), gimp_image_signals[SELECTION_CONTROL], 0,
control);
}
/************************************************************/
/* Projection functions */

View File

@ -30,15 +30,6 @@
(t) == INDEXEDA_GIMAGE)
typedef enum
{
EXPAND_AS_NECESSARY,
CLIP_TO_IMAGE,
CLIP_TO_BOTTOM_LAYER,
FLATTEN_IMAGE
} MergeType;
struct _GimpGuide
{
gint ref_count;
@ -136,31 +127,33 @@ struct _GimpImageClass
{
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* selection_control) (GimpImage *gimage,
GimpSelectionControl control);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
};
@ -168,108 +161,108 @@ struct _GimpImageClass
GType gimp_image_get_type (void);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
/* Temporary hack till colormap manipulation is encapsulated in functions.
* Call this whenever you modify an image's colormap. The col argument
@ -277,18 +270,20 @@ PathList * gimp_image_get_paths (const GimpImage *gimage);
* Currently, use this also when the image's base type is changed to/from
* indexed.
*/
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control);
/* layer/channel functions */

View File

@ -47,7 +47,6 @@
#include "libgimp/gimpintl.h"
#include "display/display-funcs.h"
enum
{
@ -1290,10 +1289,10 @@ gimp_layer_invalidate_boundary (GimpLayer *layer)
return;
/* Turn the current selection off */
gdisplays_selection_visibility (gimage, 0 /* SELECTION_OFF */);
gimp_image_selection_control (gimage, GIMP_SELECTION_OFF);
/* clear the affected region surrounding the layer */
gdisplays_selection_visibility (gimage, 1 /* SELECTION_LAYER_OFF */);
gimp_image_selection_control (gimage, GIMP_SELECTION_LAYER_OFF);
/* get the selection mask channel */
mask = gimp_image_get_mask (gimage);

View File

@ -171,6 +171,7 @@ enum
COMPONENT_VISIBILITY_CHANGED,
COMPONENT_ACTIVE_CHANGED,
MASK_CHANGED,
SELECTION_CONTROL,
CLEAN,
DIRTY,
@ -301,6 +302,16 @@ gimp_image_class_init (GimpImageClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
gimp_image_signals[SELECTION_CONTROL] =
g_signal_new ("selection_control",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpImageClass, selection_control),
NULL, NULL,
g_cclosure_marshal_VOID__INT,
G_TYPE_NONE, 1,
G_TYPE_INT);
gimp_image_signals[CLEAN] =
g_signal_new ("clean",
G_TYPE_FROM_CLASS (klass),
@ -1854,6 +1865,16 @@ gimp_image_update (GimpImage *gimage,
x, y, width, height);
}
void
gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control)
{
g_return_if_fail (GIMP_IS_IMAGE (gimage));
g_signal_emit (G_OBJECT (gimage), gimp_image_signals[SELECTION_CONTROL], 0,
control);
}
/************************************************************/
/* Projection functions */

View File

@ -30,15 +30,6 @@
(t) == INDEXEDA_GIMAGE)
typedef enum
{
EXPAND_AS_NECESSARY,
CLIP_TO_IMAGE,
CLIP_TO_BOTTOM_LAYER,
FLATTEN_IMAGE
} MergeType;
struct _GimpGuide
{
gint ref_count;
@ -136,31 +127,33 @@ struct _GimpImageClass
{
GimpViewableClass parent_class;
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* mode_changed) (GimpImage *gimage);
void (* alpha_changed) (GimpImage *gimage);
void (* floating_selection_changed) (GimpImage *gimage);
void (* active_layer_changed) (GimpImage *gimage);
void (* active_channel_changed) (GimpImage *gimage);
void (* component_visibility_changed) (GimpImage *gimage,
ChannelType channel);
void (* component_active_changed) (GimpImage *gimage,
ChannelType channel);
void (* mask_changed) (GimpImage *gimage);
void (* selection_control) (GimpImage *gimage,
GimpSelectionControl control);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* clean) (GimpImage *gimage);
void (* dirty) (GimpImage *gimage);
void (* update) (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void (* colormap_changed) (GimpImage *gimage,
gint color_index);
void (* undo_event) (GimpImage *gimage,
gint event);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
void (* undo) (GimpImage *gimage);
void (* redo) (GimpImage *gimage);
};
@ -168,108 +161,108 @@ struct _GimpImageClass
GType gimp_image_get_type (void);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
GimpImage * gimp_image_new (Gimp *gimp,
gint width,
gint height,
GimpImageBaseType base_type);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
gint gimp_image_get_ID (GimpImage *gimage);
GimpImage * gimp_image_get_by_ID (Gimp *gimp,
gint id);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_set_filename (GimpImage *gimage,
const gchar *filename);
void gimp_image_set_resolution (GimpImage *gimage,
gdouble xres,
gdouble yres);
void gimp_image_get_resolution (const GimpImage *gimage,
gdouble *xresolution,
gdouble *yresolution);
void gimp_image_set_unit (GimpImage *gimage,
GimpUnit unit);
GimpUnit gimp_image_get_unit (const GimpImage *gimage);
void gimp_image_set_save_proc (GimpImage *gimage,
PlugInProcDef *proc);
PlugInProcDef * gimp_image_get_save_proc (const GimpImage *gimage);
gint gimp_image_get_width (const GimpImage *gimage);
gint gimp_image_get_height (const GimpImage *gimage);
void gimp_image_resize (GimpImage *gimage,
gint new_width,
gint new_height,
gint offset_x,
gint offset_y);
void gimp_image_scale (GimpImage *gimage,
gint new_width,
gint new_height);
gboolean gimp_image_check_scaling (const GimpImage *gimage,
gint new_width,
gint new_height);
TileManager * gimp_image_shadow (GimpImage *gimage,
gint width,
gint height,
gint bpp);
void gimp_image_free_shadow (GimpImage *gimage);
void gimp_image_apply_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
LayerModeEffects mode,
TileManager *src1_tiles,
gint x,
gint y);
void gimp_image_replace_image (GimpImage *gimage,
GimpDrawable *drawable,
PixelRegion *src2PR,
gboolean undo,
gint opacity,
PixelRegion *maskPR,
gint x,
gint y);
void gimp_image_get_foreground (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *fg);
void gimp_image_get_background (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *bg);
guchar * gimp_image_get_color_at (GimpImage *gimage,
gint x,
gint y);
void gimp_image_get_color (const GimpImage *gimage,
GimpImageType d_type,
guchar *rgb,
guchar *src);
void gimp_image_transform_color (const GimpImage *gimage,
const GimpDrawable *drawable,
guchar *src,
guchar *dest,
GimpImageBaseType type);
GimpGuide * gimp_image_add_hguide (GimpImage *gimage);
GimpGuide * gimp_image_add_vguide (GimpImage *gimage);
void gimp_image_add_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_remove_guide (GimpImage *gimage,
GimpGuide *guide);
void gimp_image_delete_guide (GimpImage *gimage,
GimpGuide *guide);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpParasite * gimp_image_parasite_find (const GimpImage *gimage,
const gchar *name);
gchar ** gimp_image_parasite_list (const GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *gimage,
GimpParasite *parasite);
void gimp_image_parasite_detach (GimpImage *gimage,
const gchar *parasite);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage);
gboolean gimp_image_set_tattoo_state (GimpImage *gimage,
GimpTattoo val);
GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
void gimp_image_set_paths (GimpImage *gimage,
PathList *paths);
PathList * gimp_image_get_paths (const GimpImage *gimage);
/* Temporary hack till colormap manipulation is encapsulated in functions.
* Call this whenever you modify an image's colormap. The col argument
@ -277,18 +270,20 @@ PathList * gimp_image_get_paths (const GimpImage *gimage);
* Currently, use this also when the image's base type is changed to/from
* indexed.
*/
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_colormap_changed (GimpImage *gimage,
gint col);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_mode_changed (GimpImage *gimage);
void gimp_image_alpha_changed (GimpImage *gimage);
void gimp_image_floating_selection_changed (GimpImage *gimage);
void gimp_image_mask_changed (GimpImage *gimage);
void gimp_image_update (GimpImage *gimage,
gint x,
gint y,
gint width,
gint height);
void gimp_image_selection_control (GimpImage *gimage,
GimpSelectionControl control);
/* layer/channel functions */

File diff suppressed because it is too large Load Diff

View File

@ -20,21 +20,14 @@
#define __GDISPLAY_H__
#include "core/gimpobject.h"
/* FIXME: move the display stuff to display/ */
#include "display/display-types.h"
typedef enum
{
SELECTION_OFF,
SELECTION_LAYER_OFF,
SELECTION_ON,
SELECTION_PAUSE,
SELECTION_RESUME
} SelectionControl;
/* some useful macros */
/* unpacking the user scale level (char) */
@ -93,8 +86,20 @@ struct _IdleRenderStruct
};
struct _GDisplay
#define GIMP_TYPE_DISPLAY (gimp_display_get_type ())
#define GIMP_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DISPLAY, GimpDisplay))
#define GIMP_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DISPLAY, GimpDisplayClass))
#define GIMP_IS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DISPLAY))
#define GIMP_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DISPLAY))
#define GIMP_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DISPLAY, GimpDisplayClass))
typedef struct _GimpDisplayClass GimpDisplayClass;
struct _GimpDisplay
{
GimpObject parent_instance;
GtkWidget *shell; /* shell widget for this gdisplay */
GimpImage *gimage; /* pointer to the associated gimage struct */
/*
@ -185,144 +190,150 @@ struct _GDisplay
#endif /* DISPLAY_FILTERS */
};
struct _GimpDisplayClass
{
GimpObjectClass parent_class;
};
/* member function declarations */
GDisplay * gdisplay_new (GimpImage *gimage,
guint scale);
void gdisplay_reconnect (GDisplay *gdisp,
GimpImage *gimage);
void gdisplay_remove_and_delete (GDisplay *gdisp);
gint gdisplay_mask_value (GDisplay *gdisp,
gint x,
gint y);
gint gdisplay_mask_bounds (GDisplay *gdisp,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
void gdisplay_transform_coords (GDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean use_offsets);
void gdisplay_untransform_coords (GDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean round,
gboolean use_offsets);
void gdisplay_transform_coords_f (GDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gdisplay_untransform_coords_f (GDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
GType gimp_display_get_type (void);
void gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gdisplay_remove_tool_cursor (GDisplay *gdisp);
void gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GDisplay *gdisp);
GimpDisplay * gdisplay_new (GimpImage *gimage,
guint scale);
void gdisplay_reconnect (GimpDisplay *gdisp,
GimpImage *gimage);
void gdisplay_remove_and_delete (GimpDisplay *gdisp);
gint gdisplay_mask_value (GimpDisplay *gdisp,
gint x,
gint y);
gint gdisplay_mask_bounds (GimpDisplay *gdisp,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
void gdisplay_transform_coords (GimpDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean use_offsets);
void gdisplay_untransform_coords (GimpDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean round,
gboolean use_offsets);
void gdisplay_transform_coords_f (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gdisplay_untransform_coords_f (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gdisplay_set_menu_sensitivity (GDisplay *gdisp);
void gdisplay_expose_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void gdisplay_expose_guide (GDisplay *gdisp,
GimpGuide *guide);
void gdisplay_expose_full (GDisplay *gdisp);
void gdisplay_selection_visibility (GDisplay *gdisp,
SelectionControl function);
void gdisplay_flush (GDisplay *gdisp);
void gdisplay_flush_now (GDisplay *gdisp);
void gdisplay_update_icon (GDisplay *gdisp);
gboolean gdisplay_update_icon_timer (gpointer data);
gboolean gdisplay_update_icon_invoker (gpointer data);
void gdisplay_update_icon_scheduler (GimpImage *gimage,
gpointer data);
void gdisplay_draw_guides (GDisplay *gdisp);
void gdisplay_draw_guide (GDisplay *gdisp,
GimpGuide *guide,
gboolean active);
GimpGuide *gdisplay_find_guide (GDisplay *gdisp,
gdouble x,
double y);
gboolean gdisplay_snap_point (GDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *tx,
gdouble *ty);
void gdisplay_snap_rectangle (GDisplay *gdisp,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gdouble *tx1,
gdouble *ty1);
void gdisplay_update_cursor (GDisplay *gdisp,
gint x,
gint y);
void gdisplay_set_dot_for_dot (GDisplay *gdisp,
gboolean dot_for_dot);
void gdisplay_resize_cursor_label (GDisplay *gdisp);
void gdisplay_update_title (GDisplay *gdisp);
void gdisplay_flush_displays_only (GDisplay *gdisp); /* no rerender! */
void gdisplay_real_install_tool_cursor (GimpDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void gdisplay_install_tool_cursor (GimpDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gdisplay_remove_tool_cursor (GimpDisplay *gdisp);
void gdisplay_install_override_cursor (GimpDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GimpDisplay *gdisp);
GDisplay * gdisplay_active (void);
GDisplay * gdisplay_get_by_ID (Gimp *gimp,
gint ID);
void gdisplay_set_menu_sensitivity (GimpDisplay *gdisp);
void gdisplay_expose_area (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void gdisplay_expose_guide (GimpDisplay *gdisp,
GimpGuide *guide);
void gdisplay_expose_full (GimpDisplay *gdisp);
void gdisplay_selection_visibility (GimpDisplay *gdisp,
GimpSelectionControl control);
void gdisplay_flush (GimpDisplay *gdisp);
void gdisplay_flush_now (GimpDisplay *gdisp);
void gdisplay_update_icon (GimpDisplay *gdisp);
gboolean gdisplay_update_icon_timer (gpointer data);
gboolean gdisplay_update_icon_invoker (gpointer data);
void gdisplay_update_icon_scheduler (GimpImage *gimage,
gpointer data);
void gdisplay_draw_guides (GimpDisplay *gdisp);
void gdisplay_draw_guide (GimpDisplay *gdisp,
GimpGuide *guide,
gboolean active);
GimpGuide * gdisplay_find_guide (GimpDisplay *gdisp,
gdouble x,
double y);
gboolean gdisplay_snap_point (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *tx,
gdouble *ty);
void gdisplay_snap_rectangle (GimpDisplay *gdisp,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gdouble *tx1,
gdouble *ty1);
void gdisplay_update_cursor (GimpDisplay *gdisp,
gint x,
gint y);
void gdisplay_set_dot_for_dot (GimpDisplay *gdisp,
gboolean dot_for_dot);
void gdisplay_resize_cursor_label (GimpDisplay *gdisp);
void gdisplay_update_title (GimpDisplay *gdisp);
void gdisplay_flush_displays_only (GimpDisplay *gdisp); /* no rerender! */
GimpDisplay * gdisplay_active (void);
GimpDisplay * gdisplay_get_by_ID (Gimp *gimp,
gint ID);
/* function declarations */
GDisplay * gdisplays_check_valid (GDisplay *gdisp,
GimpImage *gimage);
void gdisplays_reconnect (GimpImage *old,
GimpImage *new);
void gdisplays_update_title (GimpImage *gimage);
void gdisplays_resize_cursor_label (GimpImage *gimage);
void gdisplays_setup_scale (GimpImage *gimage);
void gdisplays_update_area (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gdisplays_expose_guides (GimpImage *gimage);
void gdisplays_expose_guide (GimpImage *gimage,
GimpGuide *guide);
void gdisplays_update_full (GimpImage *gimage);
void gdisplays_shrink_wrap (GimpImage *gimage);
void gdisplays_expose_full (void);
void gdisplays_selection_visibility (GimpImage *gimage,
SelectionControl function);
gboolean gdisplays_dirty (void);
void gdisplays_delete (void);
void gdisplays_flush (void);
void gdisplays_flush_now (void);
void gdisplays_finish_draw (void);
void gdisplays_nav_preview_resized (void);
void gdisplays_foreach (GFunc func,
gpointer user_data);
GimpDisplay * gdisplays_check_valid (GimpDisplay *gdisp,
GimpImage *gimage);
void gdisplays_reconnect (GimpImage *old,
GimpImage *new);
void gdisplays_update_title (GimpImage *gimage);
void gdisplays_resize_cursor_label (GimpImage *gimage);
void gdisplays_setup_scale (GimpImage *gimage);
void gdisplays_update_area (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gdisplays_expose_guides (GimpImage *gimage);
void gdisplays_expose_guide (GimpImage *gimage,
GimpGuide *guide);
void gdisplays_update_full (GimpImage *gimage);
void gdisplays_shrink_wrap (GimpImage *gimage);
void gdisplays_expose_full (void);
void gdisplays_selection_visibility (GimpImage *gimage,
GimpSelectionControl control);
gboolean gdisplays_dirty (void);
void gdisplays_delete (void);
void gdisplays_flush (void);
void gdisplays_flush_now (void);
void gdisplays_finish_draw (void);
void gdisplays_nav_preview_resized (void);
void gdisplays_foreach (GFunc func,
gpointer user_data);
#endif /* __GDISPLAY_H__ */

View File

@ -68,11 +68,11 @@
static void
gdisplay_redraw (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h)
gdisplay_redraw (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h)
{
glong x1, y1, x2, y2; /* coordinate of rectangle corners */
@ -96,7 +96,7 @@ gdisplay_redraw (GDisplay *gdisp,
}
static void
gdisplay_check_device_cursor (GDisplay *gdisp)
gdisplay_check_device_cursor (GimpDisplay *gdisp)
{
GList *list;
@ -136,22 +136,22 @@ key_to_state (gint key)
static void
gdisplay_vscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
GimpDisplay *gdisp)
{
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
}
static void
gdisplay_hscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
GimpDisplay *gdisp)
{
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
}
gboolean
gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
GDisplay *gdisp)
gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
GimpDisplay *gdisp)
{
switch (event->type)
{
@ -170,9 +170,9 @@ gdisplay_shell_events (GtkWidget *widget,
}
gboolean
gdisplay_canvas_events (GtkWidget *canvas,
GdkEvent *event,
GDisplay *gdisp)
gdisplay_canvas_events (GtkWidget *canvas,
GdkEvent *event,
GimpDisplay *gdisp)
{
GimpTool *active_tool;
GdkEventExpose *eevent;
@ -664,9 +664,9 @@ gdisplay_hruler_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return TRUE;
@ -702,9 +702,9 @@ gdisplay_vruler_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return TRUE;
@ -764,9 +764,9 @@ gdisplay_origin_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (! gdisp->gimage->gimp->busy && event->button == 1)
{
@ -793,7 +793,7 @@ gdisplay_drop_drawable (GtkWidget *widget,
gpointer data)
{
GimpDrawable *drawable;
GDisplay *gdisp;
GimpDisplay *gdisp;
GimpImage *src_gimage;
GimpLayer *new_layer;
GimpImage *dest_gimage;
@ -806,7 +806,7 @@ gdisplay_drop_drawable (GtkWidget *widget,
gint bytes;
GimpImageBaseType type;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return;
@ -896,7 +896,7 @@ gdisplay_drop_drawable (GtkWidget *widget,
}
static void
gdisplay_bucket_fill (GDisplay *gdisp,
gdisplay_bucket_fill (GimpDisplay *gdisp,
BucketFillMode fill_mode,
guchar orig_color[],
TempBuf *orig_pat_buf)
@ -1015,9 +1015,9 @@ gdisplay_drop_pattern (GtkWidget *widget,
GimpViewable *viewable,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (GIMP_IS_PATTERN (viewable))
{
@ -1033,10 +1033,10 @@ gdisplay_drop_color (GtkWidget *widget,
const GimpRGB *drop_color,
gpointer data)
{
GDisplay *gdisp;
guchar color[4];
GimpDisplay *gdisp;
guchar color[4];
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
gimp_rgba_get_uchar (drop_color,
&color[0],
@ -1055,10 +1055,10 @@ gdisplay_drop_buffer (GtkWidget *widget,
GimpViewable *viewable,
gpointer data)
{
GimpBuffer *buffer;
GDisplay *gdisp;
GimpBuffer *buffer;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return;

View File

@ -35,14 +35,14 @@
gboolean gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
GDisplay *gdisp);
GimpDisplay *gdisp);
gboolean gdisplay_canvas_events (GtkWidget *widget,
GdkEvent *event,
GDisplay *gdisp);
GimpDisplay *gdisp);
gboolean gdisplay_hruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
gpointer dtata);
gpointer data);
gboolean gdisplay_vruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
gpointer data);

View File

@ -31,8 +31,13 @@ typedef enum /*< skip >*/
} CursorMode;
typedef struct _GDisplay GDisplay;
typedef struct _Selection Selection;
#define GDisplay GimpDisplay
typedef struct _GimpDisplay GimpDisplay;
typedef struct _GimpDisplayShell GimpDisplayShell;
typedef struct _Selection Selection;
#endif /* __DISPLAY_TYPES_H__ */

View File

@ -68,11 +68,11 @@
static void
gdisplay_redraw (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h)
gdisplay_redraw (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h)
{
glong x1, y1, x2, y2; /* coordinate of rectangle corners */
@ -96,7 +96,7 @@ gdisplay_redraw (GDisplay *gdisp,
}
static void
gdisplay_check_device_cursor (GDisplay *gdisp)
gdisplay_check_device_cursor (GimpDisplay *gdisp)
{
GList *list;
@ -136,22 +136,22 @@ key_to_state (gint key)
static void
gdisplay_vscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
GimpDisplay *gdisp)
{
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
}
static void
gdisplay_hscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
GimpDisplay *gdisp)
{
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
}
gboolean
gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
GDisplay *gdisp)
gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
GimpDisplay *gdisp)
{
switch (event->type)
{
@ -170,9 +170,9 @@ gdisplay_shell_events (GtkWidget *widget,
}
gboolean
gdisplay_canvas_events (GtkWidget *canvas,
GdkEvent *event,
GDisplay *gdisp)
gdisplay_canvas_events (GtkWidget *canvas,
GdkEvent *event,
GimpDisplay *gdisp)
{
GimpTool *active_tool;
GdkEventExpose *eevent;
@ -664,9 +664,9 @@ gdisplay_hruler_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return TRUE;
@ -702,9 +702,9 @@ gdisplay_vruler_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return TRUE;
@ -764,9 +764,9 @@ gdisplay_origin_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (! gdisp->gimage->gimp->busy && event->button == 1)
{
@ -793,7 +793,7 @@ gdisplay_drop_drawable (GtkWidget *widget,
gpointer data)
{
GimpDrawable *drawable;
GDisplay *gdisp;
GimpDisplay *gdisp;
GimpImage *src_gimage;
GimpLayer *new_layer;
GimpImage *dest_gimage;
@ -806,7 +806,7 @@ gdisplay_drop_drawable (GtkWidget *widget,
gint bytes;
GimpImageBaseType type;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return;
@ -896,7 +896,7 @@ gdisplay_drop_drawable (GtkWidget *widget,
}
static void
gdisplay_bucket_fill (GDisplay *gdisp,
gdisplay_bucket_fill (GimpDisplay *gdisp,
BucketFillMode fill_mode,
guchar orig_color[],
TempBuf *orig_pat_buf)
@ -1015,9 +1015,9 @@ gdisplay_drop_pattern (GtkWidget *widget,
GimpViewable *viewable,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (GIMP_IS_PATTERN (viewable))
{
@ -1033,10 +1033,10 @@ gdisplay_drop_color (GtkWidget *widget,
const GimpRGB *drop_color,
gpointer data)
{
GDisplay *gdisp;
guchar color[4];
GimpDisplay *gdisp;
guchar color[4];
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
gimp_rgba_get_uchar (drop_color,
&color[0],
@ -1055,10 +1055,10 @@ gdisplay_drop_buffer (GtkWidget *widget,
GimpViewable *viewable,
gpointer data)
{
GimpBuffer *buffer;
GDisplay *gdisp;
GimpBuffer *buffer;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return;

View File

@ -35,14 +35,14 @@
gboolean gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
GDisplay *gdisp);
GimpDisplay *gdisp);
gboolean gdisplay_canvas_events (GtkWidget *widget,
GdkEvent *event,
GDisplay *gdisp);
GimpDisplay *gdisp);
gboolean gdisplay_hruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
gpointer dtata);
gpointer data);
gboolean gdisplay_vruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
gpointer data);

View File

@ -38,32 +38,32 @@ static void gdisplay_close_warning_callback (GtkWidget *widget,
gboolean close,
gpointer data);
static void gdisplay_close_warning_dialog (const gchar *image_name,
GDisplay *gdisp);
GimpDisplay *gdisp);
/*
* This file is for operations on the gdisplay object
*/
gulong
gdisplay_white_pixel (GDisplay *gdisp)
gdisplay_white_pixel (GimpDisplay *gdisp)
{
return g_white_pixel;
}
gulong
gdisplay_gray_pixel (GDisplay *gdisp)
gdisplay_gray_pixel (GimpDisplay *gdisp)
{
return g_gray_pixel;
}
gulong
gdisplay_black_pixel (GDisplay *gdisp)
gdisplay_black_pixel (GimpDisplay *gdisp)
{
return g_black_pixel;
}
gulong
gdisplay_color_pixel (GDisplay *gdisp)
gdisplay_color_pixel (GimpDisplay *gdisp)
{
return g_color_pixel;
}
@ -98,9 +98,9 @@ gdisplay_xserver_resolution (gdouble *xres,
void
gdisplay_new_view (GDisplay *gdisp)
gdisplay_new_view (GimpDisplay *gdisp)
{
GDisplay *new_gdisp;
GimpDisplay *new_gdisp;
/* make sure the image has been fully loaded... */
if (gdisp->gimage)
@ -111,8 +111,8 @@ gdisplay_new_view (GDisplay *gdisp)
void
gdisplay_close_window (GDisplay *gdisp,
gboolean kill_it)
gdisplay_close_window (GimpDisplay *gdisp,
gboolean kill_it)
{
/* FIXME: gimp_busy HACK not really appropriate here because we only
* want to prevent the busy image and display to be closed. --Mitch
@ -145,7 +145,7 @@ gdisplay_close_window (GDisplay *gdisp,
void
gdisplay_shrink_wrap (GDisplay *gdisp)
gdisplay_shrink_wrap (GimpDisplay *gdisp)
{
/*
* I'm pretty sure this assumes that the current size is < display size
@ -278,9 +278,9 @@ gdisplay_close_warning_callback (GtkWidget *widget,
gboolean close,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
gdisp->warning_dialog = NULL;
@ -290,7 +290,7 @@ gdisplay_close_warning_callback (GtkWidget *widget,
static void
gdisplay_close_warning_dialog (const gchar *image_name,
GDisplay *gdisp)
GimpDisplay *gdisp)
{
GtkWidget *mbox;
gchar *warning_buf;

View File

@ -15,22 +15,26 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GDISPLAY_OPS_H__
#define __GDISPLAY_OPS_H__
#include "gdisplay.h"
gulong gdisplay_black_pixel (GDisplay *gdisp);
gulong gdisplay_gray_pixel (GDisplay *gdisp);
gulong gdisplay_white_pixel (GDisplay *gdisp);
gulong gdisplay_color_pixel (GDisplay *gdisp);
void gdisplay_xserver_resolution (gdouble *xres,
gdouble *yres);
gulong gdisplay_black_pixel (GimpDisplay *gdisp);
gulong gdisplay_gray_pixel (GimpDisplay *gdisp);
gulong gdisplay_white_pixel (GimpDisplay *gdisp);
gulong gdisplay_color_pixel (GimpDisplay *gdisp);
void gdisplay_xserver_resolution (gdouble *xres,
gdouble *yres);
void gdisplay_new_view (GimpDisplay *gdisp);
void gdisplay_close_window (GimpDisplay *gdisp,
gboolean kill_it);
void gdisplay_shrink_wrap (GimpDisplay *gdisp);
void gdisplay_new_view (GDisplay *gdisp);
void gdisplay_close_window (GDisplay *gdisp,
gboolean kill_it);
void gdisplay_shrink_wrap (GDisplay *gdisp);
#endif /* __GDISPLAY_OPS_H__ */

View File

@ -40,7 +40,7 @@
void
bounds_checking (GDisplay *gdisp)
bounds_checking (GimpDisplay *gdisp)
{
gint sx, sy;
@ -56,9 +56,9 @@ bounds_checking (GDisplay *gdisp)
void
resize_display (GDisplay *gdisp,
gboolean resize_window,
gboolean redisplay)
resize_display (GimpDisplay *gdisp,
gboolean resize_window,
gboolean redisplay)
{
/* freeze the active tool */
tool_manager_control_active (gdisp->gimage->gimp, PAUSE, gdisp);
@ -83,7 +83,7 @@ resize_display (GDisplay *gdisp,
void
shrink_wrap_display (GDisplay *gdisp)
shrink_wrap_display (GimpDisplay *gdisp)
{
/* freeze the active tool */
tool_manager_control_active (gdisp->gimage->gimp, PAUSE, gdisp);
@ -102,7 +102,7 @@ shrink_wrap_display (GDisplay *gdisp)
void
change_scale (GDisplay *gdisp,
change_scale (GimpDisplay *gdisp,
GimpZoomType zoom_type)
{
guchar scalesrc, scaledest;
@ -181,9 +181,9 @@ change_scale (GDisplay *gdisp,
/* 27/Feb/1999 I tried inlining this, but the result was slightly
* slower (poorer cache locality, probably) -- austin */
static gdouble
img2real (GDisplay *gdisp,
gboolean xdir,
gdouble a)
img2real (GimpDisplay *gdisp,
gboolean xdir,
gdouble a)
{
gdouble res;
@ -200,12 +200,12 @@ img2real (GDisplay *gdisp,
void
setup_scale (GDisplay *gdisp)
setup_scale (GimpDisplay *gdisp)
{
GtkRuler *hruler;
GtkRuler *vruler;
gfloat sx, sy;
gfloat stepx, stepy;
gfloat sx, sy;
gfloat stepx, stepy;
sx = SCALEX (gdisp, gdisp->gimage->width);
sy = SCALEY (gdisp, gdisp->gimage->height);
@ -224,8 +224,8 @@ setup_scale (GDisplay *gdisp)
gdisp->vsbdata->page_increment = (gdisp->disp_height / 2);
gdisp->vsbdata->step_increment = stepy;
g_signal_emit_by_name (G_OBJECT (gdisp->hsbdata), "changed", 0);
g_signal_emit_by_name (G_OBJECT (gdisp->vsbdata), "changed", 0);
gtk_adjustment_changed (gdisp->hsbdata);
gtk_adjustment_changed (gdisp->vsbdata);
hruler = GTK_RULER (gdisp->hrule);
vruler = GTK_RULER (gdisp->vrule);

View File

@ -20,14 +20,14 @@
#define __SCALE_H__
void change_scale (GDisplay *gdisp,
void change_scale (GimpDisplay *gdisp,
GimpZoomType zoom_type);
void resize_display (GDisplay *gdisp,
void resize_display (GimpDisplay *gdisp,
gboolean resize_window,
gboolean redisplay);
void shrink_wrap_display (GDisplay *gdisp);
void setup_scale (GDisplay *gdisp);
void bounds_checking (GDisplay *gdisp);
void shrink_wrap_display (GimpDisplay *gdisp);
void setup_scale (GimpDisplay *gdisp);
void bounds_checking (GimpDisplay *gdisp);
#endif /* __SCALE_H__ */

View File

@ -47,7 +47,7 @@
static gint startx, starty;
void
start_grab_and_scroll (GDisplay *gdisp,
start_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent)
{
GdkCursor *cursor;
@ -64,7 +64,7 @@ start_grab_and_scroll (GDisplay *gdisp,
void
end_grab_and_scroll (GDisplay *gdisp,
end_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent)
{
gdisplay_real_install_tool_cursor (gdisp,
@ -76,7 +76,7 @@ end_grab_and_scroll (GDisplay *gdisp,
void
grab_and_scroll (GDisplay *gdisp,
grab_and_scroll (GimpDisplay *gdisp,
GdkEventMotion *mevent)
{
if (mevent && mevent->window != gdisp->canvas->window)
@ -89,7 +89,7 @@ grab_and_scroll (GDisplay *gdisp,
void
scroll_to_pointer_position (GDisplay *gdisp,
scroll_to_pointer_position (GimpDisplay *gdisp,
GdkEventMotion *mevent)
{
gdouble child_x, child_y;
@ -126,7 +126,7 @@ scroll_to_pointer_position (GDisplay *gdisp,
}
gboolean
scroll_display (GDisplay *gdisp,
scroll_display (GimpDisplay *gdisp,
gint x_offset,
gint y_offset)
{

View File

@ -21,17 +21,17 @@
/* routines for grabbing the image and scrolling via the pointer */
void start_grab_and_scroll (GDisplay *gdisp,
void start_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent);
void end_grab_and_scroll (GDisplay *gdisp,
void end_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent);
void grab_and_scroll (GDisplay *gdisp,
void grab_and_scroll (GimpDisplay *gdisp,
GdkEventMotion *mevent);
void scroll_to_pointer_position (GDisplay *gdisp,
void scroll_to_pointer_position (GimpDisplay *gdisp,
GdkEventMotion *mevent);
/* generic scroll-by-offset function */
gboolean scroll_display (GDisplay *gdisp,
gboolean scroll_display (GimpDisplay *gdisp,
gint x_offset,
gint y_offset);

File diff suppressed because it is too large Load Diff

View File

@ -20,21 +20,14 @@
#define __GDISPLAY_H__
#include "core/gimpobject.h"
/* FIXME: move the display stuff to display/ */
#include "display/display-types.h"
typedef enum
{
SELECTION_OFF,
SELECTION_LAYER_OFF,
SELECTION_ON,
SELECTION_PAUSE,
SELECTION_RESUME
} SelectionControl;
/* some useful macros */
/* unpacking the user scale level (char) */
@ -93,8 +86,20 @@ struct _IdleRenderStruct
};
struct _GDisplay
#define GIMP_TYPE_DISPLAY (gimp_display_get_type ())
#define GIMP_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DISPLAY, GimpDisplay))
#define GIMP_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DISPLAY, GimpDisplayClass))
#define GIMP_IS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DISPLAY))
#define GIMP_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DISPLAY))
#define GIMP_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DISPLAY, GimpDisplayClass))
typedef struct _GimpDisplayClass GimpDisplayClass;
struct _GimpDisplay
{
GimpObject parent_instance;
GtkWidget *shell; /* shell widget for this gdisplay */
GimpImage *gimage; /* pointer to the associated gimage struct */
/*
@ -185,144 +190,150 @@ struct _GDisplay
#endif /* DISPLAY_FILTERS */
};
struct _GimpDisplayClass
{
GimpObjectClass parent_class;
};
/* member function declarations */
GDisplay * gdisplay_new (GimpImage *gimage,
guint scale);
void gdisplay_reconnect (GDisplay *gdisp,
GimpImage *gimage);
void gdisplay_remove_and_delete (GDisplay *gdisp);
gint gdisplay_mask_value (GDisplay *gdisp,
gint x,
gint y);
gint gdisplay_mask_bounds (GDisplay *gdisp,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
void gdisplay_transform_coords (GDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean use_offsets);
void gdisplay_untransform_coords (GDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean round,
gboolean use_offsets);
void gdisplay_transform_coords_f (GDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gdisplay_untransform_coords_f (GDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
GType gimp_display_get_type (void);
void gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gdisplay_remove_tool_cursor (GDisplay *gdisp);
void gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GDisplay *gdisp);
GimpDisplay * gdisplay_new (GimpImage *gimage,
guint scale);
void gdisplay_reconnect (GimpDisplay *gdisp,
GimpImage *gimage);
void gdisplay_remove_and_delete (GimpDisplay *gdisp);
gint gdisplay_mask_value (GimpDisplay *gdisp,
gint x,
gint y);
gint gdisplay_mask_bounds (GimpDisplay *gdisp,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
void gdisplay_transform_coords (GimpDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean use_offsets);
void gdisplay_untransform_coords (GimpDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean round,
gboolean use_offsets);
void gdisplay_transform_coords_f (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gdisplay_untransform_coords_f (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gdisplay_set_menu_sensitivity (GDisplay *gdisp);
void gdisplay_expose_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void gdisplay_expose_guide (GDisplay *gdisp,
GimpGuide *guide);
void gdisplay_expose_full (GDisplay *gdisp);
void gdisplay_selection_visibility (GDisplay *gdisp,
SelectionControl function);
void gdisplay_flush (GDisplay *gdisp);
void gdisplay_flush_now (GDisplay *gdisp);
void gdisplay_update_icon (GDisplay *gdisp);
gboolean gdisplay_update_icon_timer (gpointer data);
gboolean gdisplay_update_icon_invoker (gpointer data);
void gdisplay_update_icon_scheduler (GimpImage *gimage,
gpointer data);
void gdisplay_draw_guides (GDisplay *gdisp);
void gdisplay_draw_guide (GDisplay *gdisp,
GimpGuide *guide,
gboolean active);
GimpGuide *gdisplay_find_guide (GDisplay *gdisp,
gdouble x,
double y);
gboolean gdisplay_snap_point (GDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *tx,
gdouble *ty);
void gdisplay_snap_rectangle (GDisplay *gdisp,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gdouble *tx1,
gdouble *ty1);
void gdisplay_update_cursor (GDisplay *gdisp,
gint x,
gint y);
void gdisplay_set_dot_for_dot (GDisplay *gdisp,
gboolean dot_for_dot);
void gdisplay_resize_cursor_label (GDisplay *gdisp);
void gdisplay_update_title (GDisplay *gdisp);
void gdisplay_flush_displays_only (GDisplay *gdisp); /* no rerender! */
void gdisplay_real_install_tool_cursor (GimpDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void gdisplay_install_tool_cursor (GimpDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gdisplay_remove_tool_cursor (GimpDisplay *gdisp);
void gdisplay_install_override_cursor (GimpDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GimpDisplay *gdisp);
GDisplay * gdisplay_active (void);
GDisplay * gdisplay_get_by_ID (Gimp *gimp,
gint ID);
void gdisplay_set_menu_sensitivity (GimpDisplay *gdisp);
void gdisplay_expose_area (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void gdisplay_expose_guide (GimpDisplay *gdisp,
GimpGuide *guide);
void gdisplay_expose_full (GimpDisplay *gdisp);
void gdisplay_selection_visibility (GimpDisplay *gdisp,
GimpSelectionControl control);
void gdisplay_flush (GimpDisplay *gdisp);
void gdisplay_flush_now (GimpDisplay *gdisp);
void gdisplay_update_icon (GimpDisplay *gdisp);
gboolean gdisplay_update_icon_timer (gpointer data);
gboolean gdisplay_update_icon_invoker (gpointer data);
void gdisplay_update_icon_scheduler (GimpImage *gimage,
gpointer data);
void gdisplay_draw_guides (GimpDisplay *gdisp);
void gdisplay_draw_guide (GimpDisplay *gdisp,
GimpGuide *guide,
gboolean active);
GimpGuide * gdisplay_find_guide (GimpDisplay *gdisp,
gdouble x,
double y);
gboolean gdisplay_snap_point (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *tx,
gdouble *ty);
void gdisplay_snap_rectangle (GimpDisplay *gdisp,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gdouble *tx1,
gdouble *ty1);
void gdisplay_update_cursor (GimpDisplay *gdisp,
gint x,
gint y);
void gdisplay_set_dot_for_dot (GimpDisplay *gdisp,
gboolean dot_for_dot);
void gdisplay_resize_cursor_label (GimpDisplay *gdisp);
void gdisplay_update_title (GimpDisplay *gdisp);
void gdisplay_flush_displays_only (GimpDisplay *gdisp); /* no rerender! */
GimpDisplay * gdisplay_active (void);
GimpDisplay * gdisplay_get_by_ID (Gimp *gimp,
gint ID);
/* function declarations */
GDisplay * gdisplays_check_valid (GDisplay *gdisp,
GimpImage *gimage);
void gdisplays_reconnect (GimpImage *old,
GimpImage *new);
void gdisplays_update_title (GimpImage *gimage);
void gdisplays_resize_cursor_label (GimpImage *gimage);
void gdisplays_setup_scale (GimpImage *gimage);
void gdisplays_update_area (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gdisplays_expose_guides (GimpImage *gimage);
void gdisplays_expose_guide (GimpImage *gimage,
GimpGuide *guide);
void gdisplays_update_full (GimpImage *gimage);
void gdisplays_shrink_wrap (GimpImage *gimage);
void gdisplays_expose_full (void);
void gdisplays_selection_visibility (GimpImage *gimage,
SelectionControl function);
gboolean gdisplays_dirty (void);
void gdisplays_delete (void);
void gdisplays_flush (void);
void gdisplays_flush_now (void);
void gdisplays_finish_draw (void);
void gdisplays_nav_preview_resized (void);
void gdisplays_foreach (GFunc func,
gpointer user_data);
GimpDisplay * gdisplays_check_valid (GimpDisplay *gdisp,
GimpImage *gimage);
void gdisplays_reconnect (GimpImage *old,
GimpImage *new);
void gdisplays_update_title (GimpImage *gimage);
void gdisplays_resize_cursor_label (GimpImage *gimage);
void gdisplays_setup_scale (GimpImage *gimage);
void gdisplays_update_area (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gdisplays_expose_guides (GimpImage *gimage);
void gdisplays_expose_guide (GimpImage *gimage,
GimpGuide *guide);
void gdisplays_update_full (GimpImage *gimage);
void gdisplays_shrink_wrap (GimpImage *gimage);
void gdisplays_expose_full (void);
void gdisplays_selection_visibility (GimpImage *gimage,
GimpSelectionControl control);
gboolean gdisplays_dirty (void);
void gdisplays_delete (void);
void gdisplays_flush (void);
void gdisplays_flush_now (void);
void gdisplays_finish_draw (void);
void gdisplays_nav_preview_resized (void);
void gdisplays_foreach (GFunc func,
gpointer user_data);
#endif /* __GDISPLAY_H__ */

View File

@ -68,11 +68,11 @@
static void
gdisplay_redraw (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h)
gdisplay_redraw (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h)
{
glong x1, y1, x2, y2; /* coordinate of rectangle corners */
@ -96,7 +96,7 @@ gdisplay_redraw (GDisplay *gdisp,
}
static void
gdisplay_check_device_cursor (GDisplay *gdisp)
gdisplay_check_device_cursor (GimpDisplay *gdisp)
{
GList *list;
@ -136,22 +136,22 @@ key_to_state (gint key)
static void
gdisplay_vscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
GimpDisplay *gdisp)
{
scroll_display (gdisp, 0, (adjustment->value - gdisp->offset_y));
}
static void
gdisplay_hscrollbar_update (GtkAdjustment *adjustment,
GDisplay *gdisp)
GimpDisplay *gdisp)
{
scroll_display (gdisp, (adjustment->value - gdisp->offset_x), 0);
}
gboolean
gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
GDisplay *gdisp)
gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
GimpDisplay *gdisp)
{
switch (event->type)
{
@ -170,9 +170,9 @@ gdisplay_shell_events (GtkWidget *widget,
}
gboolean
gdisplay_canvas_events (GtkWidget *canvas,
GdkEvent *event,
GDisplay *gdisp)
gdisplay_canvas_events (GtkWidget *canvas,
GdkEvent *event,
GimpDisplay *gdisp)
{
GimpTool *active_tool;
GdkEventExpose *eevent;
@ -664,9 +664,9 @@ gdisplay_hruler_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return TRUE;
@ -702,9 +702,9 @@ gdisplay_vruler_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return TRUE;
@ -764,9 +764,9 @@ gdisplay_origin_button_press (GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (! gdisp->gimage->gimp->busy && event->button == 1)
{
@ -793,7 +793,7 @@ gdisplay_drop_drawable (GtkWidget *widget,
gpointer data)
{
GimpDrawable *drawable;
GDisplay *gdisp;
GimpDisplay *gdisp;
GimpImage *src_gimage;
GimpLayer *new_layer;
GimpImage *dest_gimage;
@ -806,7 +806,7 @@ gdisplay_drop_drawable (GtkWidget *widget,
gint bytes;
GimpImageBaseType type;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return;
@ -896,7 +896,7 @@ gdisplay_drop_drawable (GtkWidget *widget,
}
static void
gdisplay_bucket_fill (GDisplay *gdisp,
gdisplay_bucket_fill (GimpDisplay *gdisp,
BucketFillMode fill_mode,
guchar orig_color[],
TempBuf *orig_pat_buf)
@ -1015,9 +1015,9 @@ gdisplay_drop_pattern (GtkWidget *widget,
GimpViewable *viewable,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (GIMP_IS_PATTERN (viewable))
{
@ -1033,10 +1033,10 @@ gdisplay_drop_color (GtkWidget *widget,
const GimpRGB *drop_color,
gpointer data)
{
GDisplay *gdisp;
guchar color[4];
GimpDisplay *gdisp;
guchar color[4];
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
gimp_rgba_get_uchar (drop_color,
&color[0],
@ -1055,10 +1055,10 @@ gdisplay_drop_buffer (GtkWidget *widget,
GimpViewable *viewable,
gpointer data)
{
GimpBuffer *buffer;
GDisplay *gdisp;
GimpBuffer *buffer;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
if (gdisp->gimage->gimp->busy)
return;

View File

@ -35,14 +35,14 @@
gboolean gdisplay_shell_events (GtkWidget *widget,
GdkEvent *event,
GDisplay *gdisp);
GimpDisplay *gdisp);
gboolean gdisplay_canvas_events (GtkWidget *widget,
GdkEvent *event,
GDisplay *gdisp);
GimpDisplay *gdisp);
gboolean gdisplay_hruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
gpointer dtata);
gpointer data);
gboolean gdisplay_vruler_button_press (GtkWidget *widget,
GdkEventButton *bevent,
gpointer data);

View File

@ -40,7 +40,7 @@
void
bounds_checking (GDisplay *gdisp)
bounds_checking (GimpDisplay *gdisp)
{
gint sx, sy;
@ -56,9 +56,9 @@ bounds_checking (GDisplay *gdisp)
void
resize_display (GDisplay *gdisp,
gboolean resize_window,
gboolean redisplay)
resize_display (GimpDisplay *gdisp,
gboolean resize_window,
gboolean redisplay)
{
/* freeze the active tool */
tool_manager_control_active (gdisp->gimage->gimp, PAUSE, gdisp);
@ -83,7 +83,7 @@ resize_display (GDisplay *gdisp,
void
shrink_wrap_display (GDisplay *gdisp)
shrink_wrap_display (GimpDisplay *gdisp)
{
/* freeze the active tool */
tool_manager_control_active (gdisp->gimage->gimp, PAUSE, gdisp);
@ -102,7 +102,7 @@ shrink_wrap_display (GDisplay *gdisp)
void
change_scale (GDisplay *gdisp,
change_scale (GimpDisplay *gdisp,
GimpZoomType zoom_type)
{
guchar scalesrc, scaledest;
@ -181,9 +181,9 @@ change_scale (GDisplay *gdisp,
/* 27/Feb/1999 I tried inlining this, but the result was slightly
* slower (poorer cache locality, probably) -- austin */
static gdouble
img2real (GDisplay *gdisp,
gboolean xdir,
gdouble a)
img2real (GimpDisplay *gdisp,
gboolean xdir,
gdouble a)
{
gdouble res;
@ -200,12 +200,12 @@ img2real (GDisplay *gdisp,
void
setup_scale (GDisplay *gdisp)
setup_scale (GimpDisplay *gdisp)
{
GtkRuler *hruler;
GtkRuler *vruler;
gfloat sx, sy;
gfloat stepx, stepy;
gfloat sx, sy;
gfloat stepx, stepy;
sx = SCALEX (gdisp, gdisp->gimage->width);
sy = SCALEY (gdisp, gdisp->gimage->height);
@ -224,8 +224,8 @@ setup_scale (GDisplay *gdisp)
gdisp->vsbdata->page_increment = (gdisp->disp_height / 2);
gdisp->vsbdata->step_increment = stepy;
g_signal_emit_by_name (G_OBJECT (gdisp->hsbdata), "changed", 0);
g_signal_emit_by_name (G_OBJECT (gdisp->vsbdata), "changed", 0);
gtk_adjustment_changed (gdisp->hsbdata);
gtk_adjustment_changed (gdisp->vsbdata);
hruler = GTK_RULER (gdisp->hrule);
vruler = GTK_RULER (gdisp->vrule);

View File

@ -20,14 +20,14 @@
#define __SCALE_H__
void change_scale (GDisplay *gdisp,
void change_scale (GimpDisplay *gdisp,
GimpZoomType zoom_type);
void resize_display (GDisplay *gdisp,
void resize_display (GimpDisplay *gdisp,
gboolean resize_window,
gboolean redisplay);
void shrink_wrap_display (GDisplay *gdisp);
void setup_scale (GDisplay *gdisp);
void bounds_checking (GDisplay *gdisp);
void shrink_wrap_display (GimpDisplay *gdisp);
void setup_scale (GimpDisplay *gdisp);
void bounds_checking (GimpDisplay *gdisp);
#endif /* __SCALE_H__ */

View File

@ -47,7 +47,7 @@
static gint startx, starty;
void
start_grab_and_scroll (GDisplay *gdisp,
start_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent)
{
GdkCursor *cursor;
@ -64,7 +64,7 @@ start_grab_and_scroll (GDisplay *gdisp,
void
end_grab_and_scroll (GDisplay *gdisp,
end_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent)
{
gdisplay_real_install_tool_cursor (gdisp,
@ -76,7 +76,7 @@ end_grab_and_scroll (GDisplay *gdisp,
void
grab_and_scroll (GDisplay *gdisp,
grab_and_scroll (GimpDisplay *gdisp,
GdkEventMotion *mevent)
{
if (mevent && mevent->window != gdisp->canvas->window)
@ -89,7 +89,7 @@ grab_and_scroll (GDisplay *gdisp,
void
scroll_to_pointer_position (GDisplay *gdisp,
scroll_to_pointer_position (GimpDisplay *gdisp,
GdkEventMotion *mevent)
{
gdouble child_x, child_y;
@ -126,7 +126,7 @@ scroll_to_pointer_position (GDisplay *gdisp,
}
gboolean
scroll_display (GDisplay *gdisp,
scroll_display (GimpDisplay *gdisp,
gint x_offset,
gint y_offset)
{

View File

@ -21,17 +21,17 @@
/* routines for grabbing the image and scrolling via the pointer */
void start_grab_and_scroll (GDisplay *gdisp,
void start_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent);
void end_grab_and_scroll (GDisplay *gdisp,
void end_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent);
void grab_and_scroll (GDisplay *gdisp,
void grab_and_scroll (GimpDisplay *gdisp,
GdkEventMotion *mevent);
void scroll_to_pointer_position (GDisplay *gdisp,
void scroll_to_pointer_position (GimpDisplay *gdisp,
GdkEventMotion *mevent);
/* generic scroll-by-offset function */
gboolean scroll_display (GDisplay *gdisp,
gboolean scroll_display (GimpDisplay *gdisp,
gint x_offset,
gint y_offset);

File diff suppressed because it is too large Load Diff

View File

@ -20,21 +20,14 @@
#define __GDISPLAY_H__
#include "core/gimpobject.h"
/* FIXME: move the display stuff to display/ */
#include "display/display-types.h"
typedef enum
{
SELECTION_OFF,
SELECTION_LAYER_OFF,
SELECTION_ON,
SELECTION_PAUSE,
SELECTION_RESUME
} SelectionControl;
/* some useful macros */
/* unpacking the user scale level (char) */
@ -93,8 +86,20 @@ struct _IdleRenderStruct
};
struct _GDisplay
#define GIMP_TYPE_DISPLAY (gimp_display_get_type ())
#define GIMP_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_DISPLAY, GimpDisplay))
#define GIMP_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_DISPLAY, GimpDisplayClass))
#define GIMP_IS_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_DISPLAY))
#define GIMP_IS_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_DISPLAY))
#define GIMP_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_DISPLAY, GimpDisplayClass))
typedef struct _GimpDisplayClass GimpDisplayClass;
struct _GimpDisplay
{
GimpObject parent_instance;
GtkWidget *shell; /* shell widget for this gdisplay */
GimpImage *gimage; /* pointer to the associated gimage struct */
/*
@ -185,144 +190,150 @@ struct _GDisplay
#endif /* DISPLAY_FILTERS */
};
struct _GimpDisplayClass
{
GimpObjectClass parent_class;
};
/* member function declarations */
GDisplay * gdisplay_new (GimpImage *gimage,
guint scale);
void gdisplay_reconnect (GDisplay *gdisp,
GimpImage *gimage);
void gdisplay_remove_and_delete (GDisplay *gdisp);
gint gdisplay_mask_value (GDisplay *gdisp,
gint x,
gint y);
gint gdisplay_mask_bounds (GDisplay *gdisp,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
void gdisplay_transform_coords (GDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean use_offsets);
void gdisplay_untransform_coords (GDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean round,
gboolean use_offsets);
void gdisplay_transform_coords_f (GDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gdisplay_untransform_coords_f (GDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
GType gimp_display_get_type (void);
void gdisplay_real_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void gdisplay_install_tool_cursor (GDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gdisplay_remove_tool_cursor (GDisplay *gdisp);
void gdisplay_install_override_cursor (GDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GDisplay *gdisp);
GimpDisplay * gdisplay_new (GimpImage *gimage,
guint scale);
void gdisplay_reconnect (GimpDisplay *gdisp,
GimpImage *gimage);
void gdisplay_remove_and_delete (GimpDisplay *gdisp);
gint gdisplay_mask_value (GimpDisplay *gdisp,
gint x,
gint y);
gint gdisplay_mask_bounds (GimpDisplay *gdisp,
gint *x1,
gint *y1,
gint *x2,
gint *y2);
void gdisplay_transform_coords (GimpDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean use_offsets);
void gdisplay_untransform_coords (GimpDisplay *gdisp,
gint x,
gint y,
gint *nx,
gint *ny,
gboolean round,
gboolean use_offsets);
void gdisplay_transform_coords_f (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gdisplay_untransform_coords_f (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *nx,
gdouble *ny,
gboolean use_offsets);
void gdisplay_set_menu_sensitivity (GDisplay *gdisp);
void gdisplay_expose_area (GDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void gdisplay_expose_guide (GDisplay *gdisp,
GimpGuide *guide);
void gdisplay_expose_full (GDisplay *gdisp);
void gdisplay_selection_visibility (GDisplay *gdisp,
SelectionControl function);
void gdisplay_flush (GDisplay *gdisp);
void gdisplay_flush_now (GDisplay *gdisp);
void gdisplay_update_icon (GDisplay *gdisp);
gboolean gdisplay_update_icon_timer (gpointer data);
gboolean gdisplay_update_icon_invoker (gpointer data);
void gdisplay_update_icon_scheduler (GimpImage *gimage,
gpointer data);
void gdisplay_draw_guides (GDisplay *gdisp);
void gdisplay_draw_guide (GDisplay *gdisp,
GimpGuide *guide,
gboolean active);
GimpGuide *gdisplay_find_guide (GDisplay *gdisp,
gdouble x,
double y);
gboolean gdisplay_snap_point (GDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *tx,
gdouble *ty);
void gdisplay_snap_rectangle (GDisplay *gdisp,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gdouble *tx1,
gdouble *ty1);
void gdisplay_update_cursor (GDisplay *gdisp,
gint x,
gint y);
void gdisplay_set_dot_for_dot (GDisplay *gdisp,
gboolean dot_for_dot);
void gdisplay_resize_cursor_label (GDisplay *gdisp);
void gdisplay_update_title (GDisplay *gdisp);
void gdisplay_flush_displays_only (GDisplay *gdisp); /* no rerender! */
void gdisplay_real_install_tool_cursor (GimpDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier,
gboolean always_install);
void gdisplay_install_tool_cursor (GimpDisplay *gdisp,
GdkCursorType cursor_type,
GimpToolCursorType tool_cursor,
GimpCursorModifier modifier);
void gdisplay_remove_tool_cursor (GimpDisplay *gdisp);
void gdisplay_install_override_cursor (GimpDisplay *gdisp,
GdkCursorType cursor_type);
void gdisplay_remove_override_cursor (GimpDisplay *gdisp);
GDisplay * gdisplay_active (void);
GDisplay * gdisplay_get_by_ID (Gimp *gimp,
gint ID);
void gdisplay_set_menu_sensitivity (GimpDisplay *gdisp);
void gdisplay_expose_area (GimpDisplay *gdisp,
gint x,
gint y,
gint w,
gint h);
void gdisplay_expose_guide (GimpDisplay *gdisp,
GimpGuide *guide);
void gdisplay_expose_full (GimpDisplay *gdisp);
void gdisplay_selection_visibility (GimpDisplay *gdisp,
GimpSelectionControl control);
void gdisplay_flush (GimpDisplay *gdisp);
void gdisplay_flush_now (GimpDisplay *gdisp);
void gdisplay_update_icon (GimpDisplay *gdisp);
gboolean gdisplay_update_icon_timer (gpointer data);
gboolean gdisplay_update_icon_invoker (gpointer data);
void gdisplay_update_icon_scheduler (GimpImage *gimage,
gpointer data);
void gdisplay_draw_guides (GimpDisplay *gdisp);
void gdisplay_draw_guide (GimpDisplay *gdisp,
GimpGuide *guide,
gboolean active);
GimpGuide * gdisplay_find_guide (GimpDisplay *gdisp,
gdouble x,
double y);
gboolean gdisplay_snap_point (GimpDisplay *gdisp,
gdouble x,
gdouble y,
gdouble *tx,
gdouble *ty);
void gdisplay_snap_rectangle (GimpDisplay *gdisp,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2,
gdouble *tx1,
gdouble *ty1);
void gdisplay_update_cursor (GimpDisplay *gdisp,
gint x,
gint y);
void gdisplay_set_dot_for_dot (GimpDisplay *gdisp,
gboolean dot_for_dot);
void gdisplay_resize_cursor_label (GimpDisplay *gdisp);
void gdisplay_update_title (GimpDisplay *gdisp);
void gdisplay_flush_displays_only (GimpDisplay *gdisp); /* no rerender! */
GimpDisplay * gdisplay_active (void);
GimpDisplay * gdisplay_get_by_ID (Gimp *gimp,
gint ID);
/* function declarations */
GDisplay * gdisplays_check_valid (GDisplay *gdisp,
GimpImage *gimage);
void gdisplays_reconnect (GimpImage *old,
GimpImage *new);
void gdisplays_update_title (GimpImage *gimage);
void gdisplays_resize_cursor_label (GimpImage *gimage);
void gdisplays_setup_scale (GimpImage *gimage);
void gdisplays_update_area (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gdisplays_expose_guides (GimpImage *gimage);
void gdisplays_expose_guide (GimpImage *gimage,
GimpGuide *guide);
void gdisplays_update_full (GimpImage *gimage);
void gdisplays_shrink_wrap (GimpImage *gimage);
void gdisplays_expose_full (void);
void gdisplays_selection_visibility (GimpImage *gimage,
SelectionControl function);
gboolean gdisplays_dirty (void);
void gdisplays_delete (void);
void gdisplays_flush (void);
void gdisplays_flush_now (void);
void gdisplays_finish_draw (void);
void gdisplays_nav_preview_resized (void);
void gdisplays_foreach (GFunc func,
gpointer user_data);
GimpDisplay * gdisplays_check_valid (GimpDisplay *gdisp,
GimpImage *gimage);
void gdisplays_reconnect (GimpImage *old,
GimpImage *new);
void gdisplays_update_title (GimpImage *gimage);
void gdisplays_resize_cursor_label (GimpImage *gimage);
void gdisplays_setup_scale (GimpImage *gimage);
void gdisplays_update_area (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h);
void gdisplays_expose_guides (GimpImage *gimage);
void gdisplays_expose_guide (GimpImage *gimage,
GimpGuide *guide);
void gdisplays_update_full (GimpImage *gimage);
void gdisplays_shrink_wrap (GimpImage *gimage);
void gdisplays_expose_full (void);
void gdisplays_selection_visibility (GimpImage *gimage,
GimpSelectionControl control);
gboolean gdisplays_dirty (void);
void gdisplays_delete (void);
void gdisplays_flush (void);
void gdisplays_flush_now (void);
void gdisplays_finish_draw (void);
void gdisplays_nav_preview_resized (void);
void gdisplays_foreach (GFunc func,
gpointer user_data);
#endif /* __GDISPLAY_H__ */

View File

@ -38,32 +38,32 @@ static void gdisplay_close_warning_callback (GtkWidget *widget,
gboolean close,
gpointer data);
static void gdisplay_close_warning_dialog (const gchar *image_name,
GDisplay *gdisp);
GimpDisplay *gdisp);
/*
* This file is for operations on the gdisplay object
*/
gulong
gdisplay_white_pixel (GDisplay *gdisp)
gdisplay_white_pixel (GimpDisplay *gdisp)
{
return g_white_pixel;
}
gulong
gdisplay_gray_pixel (GDisplay *gdisp)
gdisplay_gray_pixel (GimpDisplay *gdisp)
{
return g_gray_pixel;
}
gulong
gdisplay_black_pixel (GDisplay *gdisp)
gdisplay_black_pixel (GimpDisplay *gdisp)
{
return g_black_pixel;
}
gulong
gdisplay_color_pixel (GDisplay *gdisp)
gdisplay_color_pixel (GimpDisplay *gdisp)
{
return g_color_pixel;
}
@ -98,9 +98,9 @@ gdisplay_xserver_resolution (gdouble *xres,
void
gdisplay_new_view (GDisplay *gdisp)
gdisplay_new_view (GimpDisplay *gdisp)
{
GDisplay *new_gdisp;
GimpDisplay *new_gdisp;
/* make sure the image has been fully loaded... */
if (gdisp->gimage)
@ -111,8 +111,8 @@ gdisplay_new_view (GDisplay *gdisp)
void
gdisplay_close_window (GDisplay *gdisp,
gboolean kill_it)
gdisplay_close_window (GimpDisplay *gdisp,
gboolean kill_it)
{
/* FIXME: gimp_busy HACK not really appropriate here because we only
* want to prevent the busy image and display to be closed. --Mitch
@ -145,7 +145,7 @@ gdisplay_close_window (GDisplay *gdisp,
void
gdisplay_shrink_wrap (GDisplay *gdisp)
gdisplay_shrink_wrap (GimpDisplay *gdisp)
{
/*
* I'm pretty sure this assumes that the current size is < display size
@ -278,9 +278,9 @@ gdisplay_close_warning_callback (GtkWidget *widget,
gboolean close,
gpointer data)
{
GDisplay *gdisp;
GimpDisplay *gdisp;
gdisp = (GDisplay *) data;
gdisp = (GimpDisplay *) data;
gdisp->warning_dialog = NULL;
@ -290,7 +290,7 @@ gdisplay_close_warning_callback (GtkWidget *widget,
static void
gdisplay_close_warning_dialog (const gchar *image_name,
GDisplay *gdisp)
GimpDisplay *gdisp)
{
GtkWidget *mbox;
gchar *warning_buf;

View File

@ -15,22 +15,26 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GDISPLAY_OPS_H__
#define __GDISPLAY_OPS_H__
#include "gdisplay.h"
gulong gdisplay_black_pixel (GDisplay *gdisp);
gulong gdisplay_gray_pixel (GDisplay *gdisp);
gulong gdisplay_white_pixel (GDisplay *gdisp);
gulong gdisplay_color_pixel (GDisplay *gdisp);
void gdisplay_xserver_resolution (gdouble *xres,
gdouble *yres);
gulong gdisplay_black_pixel (GimpDisplay *gdisp);
gulong gdisplay_gray_pixel (GimpDisplay *gdisp);
gulong gdisplay_white_pixel (GimpDisplay *gdisp);
gulong gdisplay_color_pixel (GimpDisplay *gdisp);
void gdisplay_xserver_resolution (gdouble *xres,
gdouble *yres);
void gdisplay_new_view (GimpDisplay *gdisp);
void gdisplay_close_window (GimpDisplay *gdisp,
gboolean kill_it);
void gdisplay_shrink_wrap (GimpDisplay *gdisp);
void gdisplay_new_view (GDisplay *gdisp);
void gdisplay_close_window (GDisplay *gdisp,
gboolean kill_it);
void gdisplay_shrink_wrap (GDisplay *gdisp);
#endif /* __GDISPLAY_OPS_H__ */

View File

@ -126,42 +126,39 @@ static GtkTargetEntry color_palette_target_table[] =
{
GIMP_TARGET_COLOR
};
static guint n_color_palette_targets = (sizeof (color_palette_target_table) /
sizeof (color_palette_target_table[0]));
GtkType
GType
gimp_colormap_dialog_get_type (void)
{
static GtkType gimp_colormap_dialog_type = 0;
static GType gcd_type = 0;
if (! gimp_colormap_dialog_type)
if (! gcd_type)
{
static GtkTypeInfo info =
static const GTypeInfo gcd_info =
{
"GimpColormapDialog",
sizeof (GimpColormapDialogClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_colormap_dialog_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpColormapDialog),
sizeof (GimpColormapDialogClass),
(GtkClassInitFunc) gimp_colormap_dialog_class_init,
(GtkObjectInitFunc) gimp_colormap_dialog_init,
NULL,
NULL,
NULL,
0, /* n_preallocs */
(GInstanceInitFunc) gimp_colormap_dialog_init,
};
gimp_colormap_dialog_type = gtk_type_unique (GTK_TYPE_VBOX, &info);
gcd_type = g_type_register_static (GTK_TYPE_VBOX,
"GimpColormapDialog",
&gcd_info, 0);
}
return gimp_colormap_dialog_type;
return gcd_type;
}
static void
gimp_colormap_dialog_class_init (GimpColormapDialogClass* klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) klass;
parent_class = g_type_class_peek_parent (klass);
gimp_colormap_dialog_signals[SELECTED] =
@ -235,7 +232,8 @@ gimp_colormap_dialog_new (GimpImage *gimage)
/* dnd stuff */
gtk_drag_source_set (ipal->palette,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
color_palette_target_table, n_color_palette_targets,
color_palette_target_table,
G_N_ELEMENTS (color_palette_target_table),
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gimp_dnd_color_source_set (ipal->palette, ipal_drag_color, ipal);
@ -243,7 +241,8 @@ gimp_colormap_dialog_new (GimpImage *gimage)
GTK_DEST_DEFAULT_HIGHLIGHT |
GTK_DEST_DEFAULT_MOTION |
GTK_DEST_DEFAULT_DROP,
color_palette_target_table, n_color_palette_targets,
color_palette_target_table,
G_N_ELEMENTS (color_palette_target_table),
GDK_ACTION_COPY);
gimp_dnd_color_dest_set (ipal->palette, ipal_drop_color, ipal);
@ -335,8 +334,6 @@ gimp_colormap_dialog_set_image (GimpColormapDialog *ipal,
{
ipal_draw (ipal);
gtk_container_queue_resize (GTK_CONTAINER (ipal));
ipal->index_adjustment->upper = ipal->image->num_cols - 1;
gtk_adjustment_changed (ipal->index_adjustment);
@ -775,7 +772,6 @@ image_colormap_changed_cb (GimpImage *gimage,
if (ncol < 0)
{
ipal_draw (ipal);
gtk_container_queue_resize (GTK_CONTAINER (ipal));
}
else
{

View File

@ -20,14 +20,15 @@
#define __COLORMAP_DIALOG_H__
#include <gtk/gtkdialog.h>
#include <gtk/gtkvbox.h>
#define GIMP_TYPE_COLORMAP_DIALOG (gimp_colormap_dialog_get_type ())
#define GIMP_COLORMAP_DIALOG(obj) (GTK_CHECK_CAST((obj), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialog))
#define GIMP_COLORMAP_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST((klass), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialogClass))
#define GIMP_IS_COLORMAP_DIALOG(obj) (GTK_CHECK_TYPE((obj), GIMP_TYPE_COLORMAP_DIALOG))
#define GIMP_IS_COLORMAP_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GIMP_TYPE_COLORMAP_DIALOG))
#define GIMP_COLORMAP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialog))
#define GIMP_COLORMAP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialogClass))
#define GIMP_IS_COLORMAP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_COLORMAP_DIALOG))
#define GIMP_IS_COLORMAP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLORMAP_DIALOG))
#define GIMP_COLORMAP_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialogClass))
typedef struct _GimpColormapDialog GimpColormapDialog;
@ -35,7 +36,7 @@ typedef struct _GimpColormapDialogClass GimpColormapDialogClass;
struct _GimpColormapDialog
{
GtkVBox parent;
GtkVBox parent_instance;
GimpImage *image;
gint col_index;
@ -62,7 +63,7 @@ struct _GimpColormapDialogClass
};
GtkType gimp_colormap_dialog_get_type (void);
GType gimp_colormap_dialog_get_type (void);
GtkWidget * gimp_colormap_dialog_new (GimpImage *gimage);

View File

@ -68,40 +68,43 @@
/* local function prototypes */
static void gui_set_busy (Gimp *gimp);
static void gui_unset_busy (Gimp *gimp);
static void gui_display_new (GimpImage *gimage);
static void gui_set_busy (Gimp *gimp);
static void gui_unset_busy (Gimp *gimp);
static void gui_display_new (GimpImage *gimage);
static gint gui_rotate_the_shield_harmonics (GtkWidget *widget,
GdkEvent *eevent,
gpointer data);
static void gui_really_quit_callback (GtkWidget *button,
gboolean quit,
gpointer data);
static gint gui_rotate_the_shield_harmonics (GtkWidget *widget,
GdkEvent *eevent,
gpointer data);
static void gui_really_quit_callback (GtkWidget *button,
gboolean quit,
gpointer data);
static void gui_display_changed (GimpContext *context,
GDisplay *display,
gpointer data);
static void gui_display_changed (GimpContext *context,
GDisplay *display,
gpointer data);
static void gui_image_disconnect (GimpImage *gimage,
gpointer data);
static void gui_image_mode_changed (GimpImage *gimage,
gpointer data);
static void gui_image_colormap_changed (GimpImage *gimage,
gint ncol,
gpointer data);
static void gui_image_name_changed (GimpImage *gimage,
gpointer data);
static void gui_image_size_changed (GimpImage *gimage,
gpointer data);
static void gui_image_alpha_changed (GimpImage *gimage,
gpointer data);
static void gui_image_update (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gpointer data);
static void gui_image_disconnect (GimpImage *gimage,
gpointer data);
static void gui_image_mode_changed (GimpImage *gimage,
gpointer data);
static void gui_image_colormap_changed (GimpImage *gimage,
gint ncol,
gpointer data);
static void gui_image_name_changed (GimpImage *gimage,
gpointer data);
static void gui_image_size_changed (GimpImage *gimage,
gpointer data);
static void gui_image_alpha_changed (GimpImage *gimage,
gpointer data);
static void gui_image_update (GimpImage *gimage,
gint x,
gint y,
gint w,
gint h,
gpointer data);
static void gui_image_selection_control (GimpImage *gimage,
GimpSelectionControl control,
gpointer data);
/* global variables */
@ -111,13 +114,14 @@ extern GSList *display_list; /* from gdisplay.c */
/* private variables */
static GQuark image_disconnect_handler_id = 0;
static GQuark image_mode_changed_handler_id = 0;
static GQuark image_colormap_changed_handler_id = 0;
static GQuark image_name_changed_handler_id = 0;
static GQuark image_size_changed_handler_id = 0;
static GQuark image_alpha_changed_handler_id = 0;
static GQuark image_update_handler_id = 0;
static GQuark image_disconnect_handler_id = 0;
static GQuark image_mode_changed_handler_id = 0;
static GQuark image_colormap_changed_handler_id = 0;
static GQuark image_name_changed_handler_id = 0;
static GQuark image_size_changed_handler_id = 0;
static GQuark image_alpha_changed_handler_id = 0;
static GQuark image_update_handler_id = 0;
static GQuark image_selection_control_handler_id = 0;
static GHashTable *themes_hash = NULL;
@ -248,6 +252,11 @@ gui_init (Gimp *gimp)
G_CALLBACK (gui_image_update),
gimp);
image_selection_control_handler_id =
gimp_container_add_handler (gimp->images, "selection_control",
G_CALLBACK (gui_image_selection_control),
gimp);
g_signal_connect (G_OBJECT (gimp_get_user_context (gimp)), "display_changed",
G_CALLBACK (gui_display_changed),
gimp);
@ -365,14 +374,16 @@ gui_exit (Gimp *gimp)
gimp_container_remove_handler (gimp->images, image_size_changed_handler_id);
gimp_container_remove_handler (gimp->images, image_alpha_changed_handler_id);
gimp_container_remove_handler (gimp->images, image_update_handler_id);
gimp_container_remove_handler (gimp->images, image_selection_control_handler_id);
image_disconnect_handler_id = 0;
image_mode_changed_handler_id = 0;
image_colormap_changed_handler_id = 0;
image_name_changed_handler_id = 0;
image_size_changed_handler_id = 0;
image_alpha_changed_handler_id = 0;
image_update_handler_id = 0;
image_disconnect_handler_id = 0;
image_mode_changed_handler_id = 0;
image_colormap_changed_handler_id = 0;
image_name_changed_handler_id = 0;
image_size_changed_handler_id = 0;
image_alpha_changed_handler_id = 0;
image_update_handler_id = 0;
image_selection_control_handler_id = 0;
if (themes_hash)
{
@ -629,3 +640,15 @@ gui_image_update (GimpImage *gimage,
gdisplays_update_area (gimage, x, y, w, h);
}
static void
gui_image_selection_control (GimpImage *gimage,
GimpSelectionControl control,
gpointer data)
{
Gimp *gimp;
gimp = (Gimp *) data;
gdisplays_selection_visibility (gimage, control);
}

View File

@ -946,7 +946,7 @@ ink_button_press (GimpTool *tool,
tool->paused_count = 0;
/* pause the current selection and grab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_PAUSE);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_PAUSE);
/* add motion memory if you press mod1 first ^ perfectmouse */
if (((bevent->state & GDK_MOD1_MASK) != 0) != (gimprc.perfectmouse != 0))
@ -995,7 +995,7 @@ ink_button_release (GimpTool *tool,
gimage = gdisp->gimage;
/* resume the current selection and ungrab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_RESUME);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_RESUME);
gdk_pointer_ungrab (bevent->time);
gdk_flush ();

View File

@ -406,7 +406,7 @@ gimp_paint_tool_button_press (GimpTool *tool,
tool->paused_count = 0;
/* pause the current selection and grab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_PAUSE);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_PAUSE);
/* add motion memory if perfectmouse is set */
if (gimprc.perfectmouse != 0)
@ -506,7 +506,7 @@ gimp_paint_tool_button_release (GimpTool *tool,
paint_tool = GIMP_PAINT_TOOL (tool);
/* resume the current selection and ungrab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_RESUME);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_RESUME);
gdk_pointer_ungrab (bevent->time);
gdk_flush ();

View File

@ -28,6 +28,7 @@
#include "pdb-types.h"
#include "procedural_db.h"
#include "core/core-types.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "core/gimpdatafactory.h"

View File

@ -40,7 +40,7 @@
void
bounds_checking (GDisplay *gdisp)
bounds_checking (GimpDisplay *gdisp)
{
gint sx, sy;
@ -56,9 +56,9 @@ bounds_checking (GDisplay *gdisp)
void
resize_display (GDisplay *gdisp,
gboolean resize_window,
gboolean redisplay)
resize_display (GimpDisplay *gdisp,
gboolean resize_window,
gboolean redisplay)
{
/* freeze the active tool */
tool_manager_control_active (gdisp->gimage->gimp, PAUSE, gdisp);
@ -83,7 +83,7 @@ resize_display (GDisplay *gdisp,
void
shrink_wrap_display (GDisplay *gdisp)
shrink_wrap_display (GimpDisplay *gdisp)
{
/* freeze the active tool */
tool_manager_control_active (gdisp->gimage->gimp, PAUSE, gdisp);
@ -102,7 +102,7 @@ shrink_wrap_display (GDisplay *gdisp)
void
change_scale (GDisplay *gdisp,
change_scale (GimpDisplay *gdisp,
GimpZoomType zoom_type)
{
guchar scalesrc, scaledest;
@ -181,9 +181,9 @@ change_scale (GDisplay *gdisp,
/* 27/Feb/1999 I tried inlining this, but the result was slightly
* slower (poorer cache locality, probably) -- austin */
static gdouble
img2real (GDisplay *gdisp,
gboolean xdir,
gdouble a)
img2real (GimpDisplay *gdisp,
gboolean xdir,
gdouble a)
{
gdouble res;
@ -200,12 +200,12 @@ img2real (GDisplay *gdisp,
void
setup_scale (GDisplay *gdisp)
setup_scale (GimpDisplay *gdisp)
{
GtkRuler *hruler;
GtkRuler *vruler;
gfloat sx, sy;
gfloat stepx, stepy;
gfloat sx, sy;
gfloat stepx, stepy;
sx = SCALEX (gdisp, gdisp->gimage->width);
sy = SCALEY (gdisp, gdisp->gimage->height);
@ -224,8 +224,8 @@ setup_scale (GDisplay *gdisp)
gdisp->vsbdata->page_increment = (gdisp->disp_height / 2);
gdisp->vsbdata->step_increment = stepy;
g_signal_emit_by_name (G_OBJECT (gdisp->hsbdata), "changed", 0);
g_signal_emit_by_name (G_OBJECT (gdisp->vsbdata), "changed", 0);
gtk_adjustment_changed (gdisp->hsbdata);
gtk_adjustment_changed (gdisp->vsbdata);
hruler = GTK_RULER (gdisp->hrule);
vruler = GTK_RULER (gdisp->vrule);

View File

@ -20,14 +20,14 @@
#define __SCALE_H__
void change_scale (GDisplay *gdisp,
void change_scale (GimpDisplay *gdisp,
GimpZoomType zoom_type);
void resize_display (GDisplay *gdisp,
void resize_display (GimpDisplay *gdisp,
gboolean resize_window,
gboolean redisplay);
void shrink_wrap_display (GDisplay *gdisp);
void setup_scale (GDisplay *gdisp);
void bounds_checking (GDisplay *gdisp);
void shrink_wrap_display (GimpDisplay *gdisp);
void setup_scale (GimpDisplay *gdisp);
void bounds_checking (GimpDisplay *gdisp);
#endif /* __SCALE_H__ */

View File

@ -47,7 +47,7 @@
static gint startx, starty;
void
start_grab_and_scroll (GDisplay *gdisp,
start_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent)
{
GdkCursor *cursor;
@ -64,7 +64,7 @@ start_grab_and_scroll (GDisplay *gdisp,
void
end_grab_and_scroll (GDisplay *gdisp,
end_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent)
{
gdisplay_real_install_tool_cursor (gdisp,
@ -76,7 +76,7 @@ end_grab_and_scroll (GDisplay *gdisp,
void
grab_and_scroll (GDisplay *gdisp,
grab_and_scroll (GimpDisplay *gdisp,
GdkEventMotion *mevent)
{
if (mevent && mevent->window != gdisp->canvas->window)
@ -89,7 +89,7 @@ grab_and_scroll (GDisplay *gdisp,
void
scroll_to_pointer_position (GDisplay *gdisp,
scroll_to_pointer_position (GimpDisplay *gdisp,
GdkEventMotion *mevent)
{
gdouble child_x, child_y;
@ -126,7 +126,7 @@ scroll_to_pointer_position (GDisplay *gdisp,
}
gboolean
scroll_display (GDisplay *gdisp,
scroll_display (GimpDisplay *gdisp,
gint x_offset,
gint y_offset)
{

View File

@ -21,17 +21,17 @@
/* routines for grabbing the image and scrolling via the pointer */
void start_grab_and_scroll (GDisplay *gdisp,
void start_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent);
void end_grab_and_scroll (GDisplay *gdisp,
void end_grab_and_scroll (GimpDisplay *gdisp,
GdkEventButton *bevent);
void grab_and_scroll (GDisplay *gdisp,
void grab_and_scroll (GimpDisplay *gdisp,
GdkEventMotion *mevent);
void scroll_to_pointer_position (GDisplay *gdisp,
void scroll_to_pointer_position (GimpDisplay *gdisp,
GdkEventMotion *mevent);
/* generic scroll-by-offset function */
gboolean scroll_display (GDisplay *gdisp,
gboolean scroll_display (GimpDisplay *gdisp,
gint x_offset,
gint y_offset);

View File

@ -406,7 +406,7 @@ gimp_paint_tool_button_press (GimpTool *tool,
tool->paused_count = 0;
/* pause the current selection and grab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_PAUSE);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_PAUSE);
/* add motion memory if perfectmouse is set */
if (gimprc.perfectmouse != 0)
@ -506,7 +506,7 @@ gimp_paint_tool_button_release (GimpTool *tool,
paint_tool = GIMP_PAINT_TOOL (tool);
/* resume the current selection and ungrab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_RESUME);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_RESUME);
gdk_pointer_ungrab (bevent->time);
gdk_flush ();

View File

@ -289,7 +289,7 @@ init_edit_selection (GimpTool *tool,
GIMP_TOOL (edit_select));
/* pause the current selection */
gdisplay_selection_visibility (gdisp, SELECTION_PAUSE);
gdisplay_selection_visibility (gdisp, GIMP_SELECTION_PAUSE);
/* initialize the statusbar display */
edit_select->context_id
@ -317,7 +317,7 @@ gimp_edit_selection_tool_button_release (GimpTool *tool,
edit_select = GIMP_EDIT_SELECTION_TOOL (tool);
/* resume the current selection and ungrab the pointer */
gdisplay_selection_visibility (gdisp, SELECTION_RESUME);
gdisplay_selection_visibility (gdisp, GIMP_SELECTION_RESUME);
gdk_pointer_ungrab (bevent->time);
gdk_flush ();

View File

@ -946,7 +946,7 @@ ink_button_press (GimpTool *tool,
tool->paused_count = 0;
/* pause the current selection and grab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_PAUSE);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_PAUSE);
/* add motion memory if you press mod1 first ^ perfectmouse */
if (((bevent->state & GDK_MOD1_MASK) != 0) != (gimprc.perfectmouse != 0))
@ -995,7 +995,7 @@ ink_button_release (GimpTool *tool,
gimage = gdisp->gimage;
/* resume the current selection and ungrab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_RESUME);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_RESUME);
gdk_pointer_ungrab (bevent->time);
gdk_flush ();

View File

@ -376,7 +376,7 @@ move_tool_button_release (GimpTool *tool,
move_tool_motion (tool, NULL, gdisp);
}
gdisplay_selection_visibility (gdisp, SELECTION_RESUME);
gdisplay_selection_visibility (gdisp, GIMP_SELECTION_RESUME);
gdisplays_flush ();
if (move->guide)
@ -539,7 +539,7 @@ gimp_move_tool_start_hguide (GimpTool *tool,
move = GIMP_MOVE_TOOL (tool);
gdisplay_selection_visibility (gdisp, SELECTION_PAUSE);
gdisplay_selection_visibility (gdisp, GIMP_SELECTION_PAUSE);
tool->gdisp = gdisp;
tool->scroll_lock = TRUE;
@ -563,7 +563,7 @@ gimp_move_tool_start_vguide (GimpTool *tool,
move = GIMP_MOVE_TOOL (tool);
gdisplay_selection_visibility (gdisp, SELECTION_PAUSE);
gdisplay_selection_visibility (gdisp, GIMP_SELECTION_PAUSE);
tool->gdisp = gdisp;
tool->scroll_lock = TRUE;

View File

@ -406,7 +406,7 @@ gimp_paint_tool_button_press (GimpTool *tool,
tool->paused_count = 0;
/* pause the current selection and grab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_PAUSE);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_PAUSE);
/* add motion memory if perfectmouse is set */
if (gimprc.perfectmouse != 0)
@ -506,7 +506,7 @@ gimp_paint_tool_button_release (GimpTool *tool,
paint_tool = GIMP_PAINT_TOOL (tool);
/* resume the current selection and ungrab the pointer */
gdisplays_selection_visibility (gdisp->gimage, SELECTION_RESUME);
gimp_image_selection_control (gdisp->gimage, GIMP_SELECTION_RESUME);
gdk_pointer_ungrab (bevent->time);
gdk_flush ();

View File

@ -126,42 +126,39 @@ static GtkTargetEntry color_palette_target_table[] =
{
GIMP_TARGET_COLOR
};
static guint n_color_palette_targets = (sizeof (color_palette_target_table) /
sizeof (color_palette_target_table[0]));
GtkType
GType
gimp_colormap_dialog_get_type (void)
{
static GtkType gimp_colormap_dialog_type = 0;
static GType gcd_type = 0;
if (! gimp_colormap_dialog_type)
if (! gcd_type)
{
static GtkTypeInfo info =
static const GTypeInfo gcd_info =
{
"GimpColormapDialog",
sizeof (GimpColormapDialogClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gimp_colormap_dialog_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GimpColormapDialog),
sizeof (GimpColormapDialogClass),
(GtkClassInitFunc) gimp_colormap_dialog_class_init,
(GtkObjectInitFunc) gimp_colormap_dialog_init,
NULL,
NULL,
NULL,
0, /* n_preallocs */
(GInstanceInitFunc) gimp_colormap_dialog_init,
};
gimp_colormap_dialog_type = gtk_type_unique (GTK_TYPE_VBOX, &info);
gcd_type = g_type_register_static (GTK_TYPE_VBOX,
"GimpColormapDialog",
&gcd_info, 0);
}
return gimp_colormap_dialog_type;
return gcd_type;
}
static void
gimp_colormap_dialog_class_init (GimpColormapDialogClass* klass)
{
GtkObjectClass *object_class;
object_class = (GtkObjectClass*) klass;
parent_class = g_type_class_peek_parent (klass);
gimp_colormap_dialog_signals[SELECTED] =
@ -235,7 +232,8 @@ gimp_colormap_dialog_new (GimpImage *gimage)
/* dnd stuff */
gtk_drag_source_set (ipal->palette,
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
color_palette_target_table, n_color_palette_targets,
color_palette_target_table,
G_N_ELEMENTS (color_palette_target_table),
GDK_ACTION_COPY | GDK_ACTION_MOVE);
gimp_dnd_color_source_set (ipal->palette, ipal_drag_color, ipal);
@ -243,7 +241,8 @@ gimp_colormap_dialog_new (GimpImage *gimage)
GTK_DEST_DEFAULT_HIGHLIGHT |
GTK_DEST_DEFAULT_MOTION |
GTK_DEST_DEFAULT_DROP,
color_palette_target_table, n_color_palette_targets,
color_palette_target_table,
G_N_ELEMENTS (color_palette_target_table),
GDK_ACTION_COPY);
gimp_dnd_color_dest_set (ipal->palette, ipal_drop_color, ipal);
@ -335,8 +334,6 @@ gimp_colormap_dialog_set_image (GimpColormapDialog *ipal,
{
ipal_draw (ipal);
gtk_container_queue_resize (GTK_CONTAINER (ipal));
ipal->index_adjustment->upper = ipal->image->num_cols - 1;
gtk_adjustment_changed (ipal->index_adjustment);
@ -775,7 +772,6 @@ image_colormap_changed_cb (GimpImage *gimage,
if (ncol < 0)
{
ipal_draw (ipal);
gtk_container_queue_resize (GTK_CONTAINER (ipal));
}
else
{

View File

@ -20,14 +20,15 @@
#define __COLORMAP_DIALOG_H__
#include <gtk/gtkdialog.h>
#include <gtk/gtkvbox.h>
#define GIMP_TYPE_COLORMAP_DIALOG (gimp_colormap_dialog_get_type ())
#define GIMP_COLORMAP_DIALOG(obj) (GTK_CHECK_CAST((obj), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialog))
#define GIMP_COLORMAP_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_CAST((klass), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialogClass))
#define GIMP_IS_COLORMAP_DIALOG(obj) (GTK_CHECK_TYPE((obj), GIMP_TYPE_COLORMAP_DIALOG))
#define GIMP_IS_COLORMAP_DIALOG_CLASS(klass) (GTK_CHECK_CLASS_TYPE((klass), GIMP_TYPE_COLORMAP_DIALOG))
#define GIMP_COLORMAP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialog))
#define GIMP_COLORMAP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialogClass))
#define GIMP_IS_COLORMAP_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_COLORMAP_DIALOG))
#define GIMP_IS_COLORMAP_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_COLORMAP_DIALOG))
#define GIMP_COLORMAP_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_COLORMAP_DIALOG, GimpColormapDialogClass))
typedef struct _GimpColormapDialog GimpColormapDialog;
@ -35,7 +36,7 @@ typedef struct _GimpColormapDialogClass GimpColormapDialogClass;
struct _GimpColormapDialog
{
GtkVBox parent;
GtkVBox parent_instance;
GimpImage *image;
gint col_index;
@ -62,7 +63,7 @@ struct _GimpColormapDialogClass
};
GtkType gimp_colormap_dialog_get_type (void);
GType gimp_colormap_dialog_get_type (void);
GtkWidget * gimp_colormap_dialog_new (GimpImage *gimage);

View File

@ -53,9 +53,6 @@ enum_headers = \
../../app/paint-funcs/paint-funcs.h \
../../app/base/base-types.h \
../../app/core/core-types.h \
../../app/core/gimpdrawable-offset.h \
../../app/core/gimpimage.h \
../../app/core/gimpimage-convert.h \
../../app/plug-in/plug-in-types.h \
../../app/tools/tools-types.h \
../../app/tools/gimpblendtool.h \
@ -64,7 +61,6 @@ enum_headers = \
../../app/tools/gimpconvolvetool.h \
../../app/tools/gimpdodgeburntool.h \
../../app/tools/gimphuesaturationtool.h \
../../app/tools/gimppainttool.h \
../../app/tools/gimptexttool.h
pdb_scripts = \

View File

@ -313,14 +313,14 @@ package Gimp::CodeGen::enums;
},
GimpOffsetType =>
{ contig => 1,
header => 'core/gimpdrawable-offset.h',
header => 'core/core-types.h',
symbols => [ qw(OFFSET_BACKGROUND OFFSET_TRANSPARENT) ],
mapping => { OFFSET_BACKGROUND => '0',
OFFSET_TRANSPARENT => '1' }
},
MergeType =>
{ contig => 1,
header => 'core/gimpimage.h',
header => 'core/core-types.h',
symbols => [ qw(EXPAND_AS_NECESSARY CLIP_TO_IMAGE
CLIP_TO_BOTTOM_LAYER FLATTEN_IMAGE) ],
mapping => { EXPAND_AS_NECESSARY => '0',
@ -330,7 +330,7 @@ package Gimp::CodeGen::enums;
},
ConvertPaletteType =>
{ contig => 1,
header => 'core/gimpimage-convert.h',
header => 'core/core-types.h',
symbols => [ qw(MAKE_PALETTE REUSE_PALETTE WEB_PALETTE
MONO_PALETTE CUSTOM_PALETTE) ],
mapping => { MAKE_PALETTE => '0',
@ -341,7 +341,7 @@ package Gimp::CodeGen::enums;
},
ConvertDitherType =>
{ contig => 1,
header => 'core/gimpimage-convert.h',
header => 'core/core-types.h',
symbols => [ qw(NO_DITHER FS_DITHER FSLOWBLEED_DITHER FIXED_DITHER
NODESTRUCT_DITHER) ],
mapping => { NO_DITHER => '0',

View File

@ -153,8 +153,9 @@ CODE
);
}
@headers = qw("core/gimp.h" "core/gimpcontainer.h"
"core/gimpimage.h" "core/gimpdatafactory.h" "core/gimppalette.h");
@headers = qw("core/gimp.h" "core/gimpcontainer.h" "core/gimpimage.h"
"core/gimpimage-convert.h" "core/gimpdatafactory.h"
"core/gimppalette.h");
@procs = qw(convert_rgb convert_grayscale convert_indexed);
%exports = (app => [@procs], lib => [@procs]);

View File

@ -537,7 +537,7 @@ CODE
}
@headers = qw("core/gimp.h" "core/gimplayermask.h" "core/gimpchannel.h"
"core/gimpdrawable.h"
"core/gimpdrawable.h" "core/gimpdrawable-offset.h"
"pdb_glue.h" "base/tile.h" "base/tile-manager.h"
"base/temp-buf.h");