From 01b780d68235b1bdcd42d73496052efde35f90c0 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 17 Aug 2001 14:27:31 +0000 Subject: [PATCH] added app/display/ and app/plug-in/. Empty for now except for the types 2001-08-17 Michael Natterer * configure.in: added app/display/ and app/plug-in/. Empty for now except for the types files. * app/Makefile.am * app/appenums.h * app/apptypes.h: removed. * app/display/Makefile.am * app/display/display-types.h * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/gui/Makefile.am * app/gui/gui-types.h * app/pdb/Makefile.am * app/pdb/pdb-types.h: new files for typedefs. * app/appenv.h: added MessageHandlerType and StackTraceMode here. * app/undo_types.h: moved undo struct typedefs here. * app/tools/tools-types.h * app/core/core-types.h: added some enums and Tattoo here (renamed to GimpTattoo). * app/gdisplay.h: temp_hack: #include "display/display-types.h" * app/gimphelp.c: s/gtk_idle_add/g_idle_add/ * app/gimprc.c: don't use "gimprc" in token handlers but the passed "val1p" and "val2p". * app/image_map.[ch]: cleanup in preparation of making a GObject out of it. * app/base/pixel-region.[ch]: no need to pass the PixelRegionIterator around as void pointer. * app/core/gimp.[ch] * app/core/gimpcontext.[ch] * app/core/gimptoolinfo.[ch] * app/tools/tool_manager.c * app/widgets/gimpdnd.c: added the standard_tool_info to the Gimp object. * app/batch.c * app/file-open.c * app/file-save.c * app/file-utils.c * app/interface.c * app/main.c * app/path.[ch] * app/pathP.h * app/plug_in.h * app/core/gimpdrawable.[ch] * app/core/gimpimage-mask.c * app/core/gimpimage.[ch] * app/core/gimplayer.c * app/gui/color-area.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/error-console-dialog.c * app/gui/gradient-editor.c * app/gui/gradient-select.c * app/gui/indicator-area.c * app/gui/info-dialog.c * app/gui/palette-editor.c * app/gui/palette-select.c * app/gui/pattern-select.c * app/gui/session.c * app/gui/splash.c * app/gui/view-commands.c * app/tools/gimpinktool-blob.c * app/widgets/gimpcolorpanel.c * app/widgets/gimpdockbook.c * app/widgets/gimppreview.c * app/xcf/xcf-load.c * app/xcf/xcf-save.c * app/xcf/xcf.c: changed accordingly: s/Tattoo/GimpTattoo/, include the new types files, include instead of >gtk/gtk.h>. Bad hacks to get rid of SELECTION_OFF and friends in core/ (will be replaced ba a signal soon). * tools/pdbgen/Makefile.am: changed list of headers scanned for enums accordingly. * app/pdb/procedural_db.c * tools/pdbgen/app.pl * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb: same fixes as above, added hacks to ensure that all foo-types.h files are included before all other gimp internal includes, include "pdb-types.h" unconditionally. * tools/pdbgen/enums.pl * app/pdb/*_cmds.c: regenerated. --- ChangeLog | 103 +++++++++ app/Makefile.am | 6 +- app/actions/dialogs-commands.c | 3 +- app/actions/view-commands.c | 2 +- app/appenums.h | 121 ----------- app/appenv.h | 15 ++ app/apptypes.h | 84 -------- app/base/pixel-region.c | 8 +- app/base/pixel-region.h | 87 ++++---- app/batch.c | 2 +- app/core/core-types.h | 64 +++++- app/core/gimp.c | 4 + app/core/gimp.h | 1 + app/core/gimpcontext.c | 4 +- app/core/gimpcontext.h | 4 +- app/core/gimpdrawable.c | 6 +- app/core/gimpdrawable.h | 4 +- app/core/gimpimage-guides.c | 44 ++-- app/core/gimpimage-guides.h | 12 +- app/core/gimpimage-mask.c | 6 +- app/core/gimpimage-merge.c | 44 ++-- app/core/gimpimage-merge.h | 12 +- app/core/gimpimage-projection.c | 44 ++-- app/core/gimpimage-projection.h | 12 +- app/core/gimpimage-resize.c | 44 ++-- app/core/gimpimage-resize.h | 12 +- app/core/gimpimage-scale.c | 44 ++-- app/core/gimpimage-scale.h | 12 +- app/core/gimpimage.c | 44 ++-- app/core/gimpimage.h | 12 +- app/core/gimpimagemap.c | 182 ++++++++-------- app/core/gimpimagemap.h | 11 +- app/core/gimplayer.c | 7 +- app/core/gimpprojection-construct.c | 44 ++-- app/core/gimpprojection-construct.h | 12 +- app/core/gimpprojection.h | 5 +- app/core/gimptoolinfo.c | 55 ++--- app/core/gimptoolinfo.h | 4 +- app/dialogs/color-dialog.c | 2 +- app/dialogs/dialogs-constructors.c | 10 +- app/dialogs/info-dialog.c | 2 +- app/display/.cvsignore | 6 + app/display/Makefile.am | 49 +++++ app/display/display-types.h | 38 ++++ app/display/gimpdisplay.h | 5 +- app/display/gimpdisplayshell-draw.c | 8 +- app/display/gimpdisplayshell.c | 8 +- app/file-open.c | 4 +- app/file-save.c | 6 +- app/file-utils.c | 4 +- app/file/file-open.c | 4 +- app/file/file-save.c | 6 +- app/file/file-utils.c | 4 +- app/gdisplay.h | 5 +- app/gimphelp.c | 4 +- app/gimprc.c | 253 ++++++++++------------- app/gui/Makefile.am | 1 + app/gui/color-area.c | 2 +- app/gui/color-notebook.c | 2 +- app/gui/colormap-dialog.c | 3 +- app/gui/dialogs-commands.c | 3 +- app/gui/dialogs-constructors.c | 10 +- app/gui/error-console-dialog.c | 5 +- app/gui/gradient-editor.c | 2 +- app/gui/gradient-select.c | 3 +- app/gui/gui-types.h | 32 +++ app/gui/indicator-area.c | 3 +- app/gui/info-dialog.c | 2 +- app/gui/palette-editor.c | 3 +- app/gui/palette-select.c | 3 +- app/gui/pattern-select.c | 3 +- app/gui/session.c | 7 +- app/gui/splash.c | 5 +- app/gui/view-commands.c | 2 +- app/image_map.c | 182 ++++++++-------- app/image_map.h | 11 +- app/interface.c | 8 +- app/main.c | 4 +- app/paint/gimpink-blob.c | 43 ++-- app/path.c | 6 +- app/path.h | 46 ++--- app/pathP.h | 14 +- app/pdb/Makefile.am | 3 +- app/pdb/brush_select_cmds.c | 2 +- app/pdb/brushes_cmds.c | 4 +- app/pdb/channel_cmds.c | 15 +- app/pdb/color_cmds.c | 2 +- app/pdb/convert_cmds.c | 4 +- app/pdb/display_cmds.c | 3 +- app/pdb/drawable_cmds.c | 4 +- app/pdb/edit_cmds.c | 4 +- app/pdb/fileops_cmds.c | 4 +- app/pdb/floating_sel_cmds.c | 4 +- app/pdb/gimp-pdb.c | 2 +- app/pdb/gimppdb.c | 2 +- app/pdb/gimpprocedure.c | 2 +- app/pdb/gimprc_cmds.c | 4 +- app/pdb/gradient_select_cmds.c | 3 +- app/pdb/gradients_cmds.c | 4 +- app/pdb/guides_cmds.c | 6 +- app/pdb/help_cmds.c | 4 +- app/pdb/image_cmds.c | 15 +- app/pdb/internal_procs.c | 4 +- app/pdb/layer_cmds.c | 13 +- app/pdb/message_cmds.c | 5 +- app/pdb/misc_cmds.c | 4 +- app/pdb/palette_cmds.c | 4 +- app/pdb/parasite_cmds.c | 4 +- app/pdb/paths_cmds.c | 2 +- app/pdb/pattern_select_cmds.c | 3 +- app/pdb/patterns_cmds.c | 4 +- app/pdb/pdb-types.h | 31 +++ app/pdb/plug_in_cmds.c | 4 +- app/pdb/procedural_db.c | 2 +- app/pdb/procedural_db_cmds.c | 4 +- app/pdb/selection_cmds.c | 6 +- app/pdb/text_tool_cmds.c | 2 +- app/pdb/tools_cmds.c | 3 +- app/pdb/undo_cmds.c | 4 +- app/pdb/unit_cmds.c | 4 +- app/plug-in/.cvsignore | 6 + app/plug-in/Makefile.am | 29 +++ app/plug-in/gimpplugin-progress.h | 5 + app/plug-in/gimpplugin.h | 5 + app/plug-in/gimppluginmanager.h | 5 + app/plug-in/plug-in-def.h | 5 + app/plug-in/plug-in-params.h | 5 + app/plug-in/plug-in-progress.h | 5 + app/plug-in/plug-in-types.h | 40 ++++ app/plug-in/plug-in.h | 5 + app/plug-in/plug-ins.h | 5 + app/plug_in.h | 5 + app/tools/gimpinktool-blob.c | 43 ++-- app/tools/tool_manager.c | 2 + app/tools/tools-types.h | 37 ++++ app/undo_types.h | 102 ++++----- app/widgets/gimpcolordialog.c | 2 +- app/widgets/gimpcolormapeditor.c | 3 +- app/widgets/gimpcolorpanel.c | 1 + app/widgets/gimpdnd.c | 2 +- app/widgets/gimpdockbook.c | 9 +- app/widgets/gimpgradienteditor.c | 2 +- app/widgets/gimphelp.c | 4 +- app/widgets/gimppaletteeditor.c | 3 +- app/widgets/gimppreview.c | 1 + app/widgets/gimppreviewrenderer.c | 1 + app/widgets/gimptoolbox-color-area.c | 2 +- app/widgets/gimptoolbox-indicator-area.c | 3 +- app/widgets/gimpview.c | 1 + app/widgets/gimpviewrenderer.c | 1 + app/xcf/xcf-load.c | 27 ++- app/xcf/xcf-save.c | 3 +- app/xcf/xcf.c | 2 +- configure.in | 2 + tools/pdbgen/Makefile.am | 4 +- tools/pdbgen/app.pl | 37 +++- tools/pdbgen/enums.pl | 152 +++++++------- tools/pdbgen/pdb/channel.pdb | 11 +- tools/pdbgen/pdb/display.pdb | 2 +- tools/pdbgen/pdb/gradient_select.pdb | 3 +- tools/pdbgen/pdb/image.pdb | 16 +- tools/pdbgen/pdb/layer.pdb | 10 +- tools/pdbgen/pdb/pattern_select.pdb | 6 +- 163 files changed, 1613 insertions(+), 1198 deletions(-) delete mode 100644 app/appenums.h delete mode 100644 app/apptypes.h create mode 100644 app/display/.cvsignore create mode 100644 app/display/Makefile.am create mode 100644 app/display/display-types.h create mode 100644 app/gui/gui-types.h create mode 100644 app/pdb/pdb-types.h create mode 100644 app/plug-in/.cvsignore create mode 100644 app/plug-in/Makefile.am create mode 100644 app/plug-in/plug-in-types.h diff --git a/ChangeLog b/ChangeLog index db84d9b2c7..c542a39a02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,106 @@ +2001-08-17 Michael Natterer + + * configure.in: added app/display/ and app/plug-in/. Empty for + now except for the types files. + + * app/Makefile.am + * app/appenums.h + * app/apptypes.h: removed. + + * app/display/Makefile.am + * app/display/display-types.h + * app/plug-in/Makefile.am + * app/plug-in/plug-in-types.h + * app/gui/Makefile.am + * app/gui/gui-types.h + * app/pdb/Makefile.am + * app/pdb/pdb-types.h: new files for typedefs. + + * app/appenv.h: added MessageHandlerType and StackTraceMode here. + + * app/undo_types.h: moved undo struct typedefs here. + + * app/tools/tools-types.h + * app/core/core-types.h: added some enums and Tattoo here + (renamed to GimpTattoo). + + * app/gdisplay.h: temp_hack: #include "display/display-types.h" + + * app/gimphelp.c: s/gtk_idle_add/g_idle_add/ + + * app/gimprc.c: don't use "gimprc" in token handlers but the + passed "val1p" and "val2p". + + * app/image_map.[ch]: cleanup in preparation of making a GObject + out of it. + + * app/base/pixel-region.[ch]: no need to pass the + PixelRegionIterator around as void pointer. + + * app/core/gimp.[ch] + * app/core/gimpcontext.[ch] + * app/core/gimptoolinfo.[ch] + * app/tools/tool_manager.c + * app/widgets/gimpdnd.c: added the standard_tool_info to the Gimp + object. + + * app/batch.c + * app/file-open.c + * app/file-save.c + * app/file-utils.c + * app/interface.c + * app/main.c + * app/path.[ch] + * app/pathP.h + * app/plug_in.h + * app/core/gimpdrawable.[ch] + * app/core/gimpimage-mask.c + * app/core/gimpimage.[ch] + * app/core/gimplayer.c + * app/gui/color-area.c + * app/gui/color-notebook.c + * app/gui/colormap-dialog.c + * app/gui/dialogs-commands.c + * app/gui/dialogs-constructors.c + * app/gui/error-console-dialog.c + * app/gui/gradient-editor.c + * app/gui/gradient-select.c + * app/gui/indicator-area.c + * app/gui/info-dialog.c + * app/gui/palette-editor.c + * app/gui/palette-select.c + * app/gui/pattern-select.c + * app/gui/session.c + * app/gui/splash.c + * app/gui/view-commands.c + * app/tools/gimpinktool-blob.c + * app/widgets/gimpcolorpanel.c + * app/widgets/gimpdockbook.c + * app/widgets/gimppreview.c + * app/xcf/xcf-load.c + * app/xcf/xcf-save.c + * app/xcf/xcf.c: changed accordingly: s/Tattoo/GimpTattoo/, include + the new types files, include instead of >gtk/gtk.h>. + Bad hacks to get rid of SELECTION_OFF and friends in core/ (will + be replaced ba a signal soon). + + * tools/pdbgen/Makefile.am: changed list of headers scanned for + enums accordingly. + + * app/pdb/procedural_db.c + * tools/pdbgen/app.pl + * tools/pdbgen/pdb/channel.pdb + * tools/pdbgen/pdb/display.pdb + * tools/pdbgen/pdb/gradient_select.pdb + * tools/pdbgen/pdb/image.pdb + * tools/pdbgen/pdb/layer.pdb + * tools/pdbgen/pdb/pattern_select.pdb: same fixes as above, added + hacks to ensure that all foo-types.h files are included before all + other gimp internal includes, include "pdb-types.h" unconditionally. + + * tools/pdbgen/enums.pl + * app/pdb/*_cmds.c: regenerated. + 2001-08-15 Michael Natterer * app/tools/gimptool.[ch] diff --git a/app/Makefile.am b/app/Makefile.am index 9c87f108a9..6e6ab49743 100644 --- a/app/Makefile.am +++ b/app/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = paint-funcs base core pdb xcf tools widgets gui +SUBDIRS = paint-funcs base core pdb plug-in xcf tools display widgets gui scriptdata = @@ -103,8 +103,6 @@ gimp_SOURCES = @STRIP_BEGIN@ \ ## app_procs.c \ app_procs.h \ - appenums.h \ - apptypes.h \ main.c \ \ batch.c \ @@ -153,8 +151,10 @@ INCLUDES = @STRIP_BEGIN@ \ gimp_LDADD = @STRIP_BEGIN@ \ gui/libappgui.a \ tools/libapptools.a \ + display/libappdisplay.a \ widgets/libappwidgets.a \ xcf/libappxcf.a \ + plug-in/libappplug-in.a \ pdb/libapppdb.a \ core/libappcore.a \ paint-funcs/libapppaint-funcs.a \ diff --git a/app/actions/dialogs-commands.c b/app/actions/dialogs-commands.c index 3ceccab816..fa8e8758c6 100644 --- a/app/actions/dialogs-commands.c +++ b/app/actions/dialogs-commands.c @@ -20,8 +20,7 @@ #include -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "widgets/gimpdialogfactory.h" #include "widgets/gimpdockable.h" diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c index d04b30d03d..be51306a33 100644 --- a/app/actions/view-commands.c +++ b/app/actions/view-commands.c @@ -22,7 +22,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "gui-types.h" #include "core/gimpimage.h" diff --git a/app/appenums.h b/app/appenums.h deleted file mode 100644 index d200e301c1..0000000000 --- a/app/appenums.h +++ /dev/null @@ -1,121 +0,0 @@ -/* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __APPENUMS_H__ -#define __APPENUMS_H__ - - -typedef enum -{ - MESSAGE_BOX, - CONSOLE, - ERROR_CONSOLE -} MessageHandlerType; - -typedef enum -{ - STACK_TRACE_NEVER, - STACK_TRACE_QUERY, - STACK_TRACE_ALWAYS -} StackTraceMode; - -/* Brush application types */ -typedef enum -{ - HARD, /* pencil */ - SOFT, /* paintbrush */ - PRESSURE /* paintbrush with variable pressure */ -} BrushApplicationMode; - -/* Paint application modes */ -typedef enum -{ - CONSTANT, /*< nick=CONTINUOUS >*/ /* pencil, paintbrush, airbrush, clone */ - INCREMENTAL /* convolve, smudge */ -} PaintApplicationMode; - -typedef enum /*< chop=ADD_ >*/ -{ - ADD_WHITE_MASK, - ADD_BLACK_MASK, - ADD_ALPHA_MASK, - ADD_SELECTION_MASK, - ADD_INV_SELECTION_MASK -} AddMaskType; - -/* gradient paint modes */ -typedef enum -{ - ONCE_FORWARD, /* paint through once, then stop */ - ONCE_BACKWARDS, /* paint once, then stop, but run the gradient the other way */ - LOOP_SAWTOOTH, /* keep painting, looping through the grad start->end,start->end /|/|/| */ - LOOP_TRIANGLE, /* keep paiting, looping though the grad start->end,end->start /\/\/\/ */ - ONCE_END_COLOR /* paint once, but keep painting with the end color */ -} GradientPaintMode; - -typedef enum /*< skip >*/ -{ - ORIENTATION_UNKNOWN, - ORIENTATION_HORIZONTAL, - ORIENTATION_VERTICAL -} InternalOrientationType; - -typedef enum -{ - HORIZONTAL, - VERTICAL, - UNKNOWN -} OrientationType; - -/* Selection Boolean operations */ -typedef enum /*< chop=CHANNEL_OP_ >*/ -{ - CHANNEL_OP_ADD, - CHANNEL_OP_SUB, - CHANNEL_OP_REPLACE, - CHANNEL_OP_INTERSECT -} ChannelOps; - -typedef enum /*< skip >*/ -{ - SELECTION_ADD = CHANNEL_OP_ADD, - SELECTION_SUB = CHANNEL_OP_SUB, - SELECTION_REPLACE = CHANNEL_OP_REPLACE, - SELECTION_INTERSECT = CHANNEL_OP_INTERSECT, - SELECTION_MOVE_MASK, - SELECTION_MOVE, - SELECTION_ANCHOR -} SelectOps; - -/* Plug-In run modes */ -typedef enum -{ - RUN_INTERACTIVE = 0, - RUN_NONINTERACTIVE = 1, - RUN_WITH_LAST_VALS = 2 -} RunModeType; - -typedef enum /*< skip >*/ -{ - CURSOR_MODE_TOOL_ICON, - CURSOR_MODE_TOOL_CROSSHAIR, - CURSOR_MODE_CROSSHAIR -} CursorMode; - - -#endif /* __APPENUMS_H__ */ diff --git a/app/appenv.h b/app/appenv.h index 403b632f52..20fd4159f6 100644 --- a/app/appenv.h +++ b/app/appenv.h @@ -20,6 +20,21 @@ #define __APPENV_H__ +typedef enum +{ + MESSAGE_BOX, + CONSOLE, + ERROR_CONSOLE +} MessageHandlerType; + +typedef enum +{ + STACK_TRACE_NEVER, + STACK_TRACE_QUERY, + STACK_TRACE_ALWAYS +} StackTraceMode; + + /* command line options */ extern gboolean no_interface; extern gboolean no_splash; diff --git a/app/apptypes.h b/app/apptypes.h deleted file mode 100644 index fb5c532cf3..0000000000 --- a/app/apptypes.h +++ /dev/null @@ -1,84 +0,0 @@ -/* The GIMP -- an image manipulation program - * Copyright (C) 1995 Spencer Kimball and Peter Mattis - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifndef __APPTYPES_H__ -#define __APPTYPES_H__ - - -#include "libgimpcolor/gimpcolortypes.h" -#include "libgimpmath/gimpmathtypes.h" -#include "libgimpbase/gimpbasetypes.h" - -#include "base/base-types.h" - -#include "undo_types.h" - -#include "appenums.h" - - -/* other stuff */ - -typedef struct _Argument Argument; - -typedef struct _ColorNotebook ColorNotebook; - -typedef struct _GDisplay GDisplay; - -typedef struct _GimpProgress GimpProgress; - -typedef struct _ImageMap ImageMap; - -typedef struct _InfoDialog InfoDialog; - -typedef struct _NavigationDialog NavigationDialog; - -typedef struct _Path Path; -typedef struct _PathPoint PathPoint; -typedef struct _PathList PathList; - -typedef struct _PlugIn PlugIn; -typedef struct _PlugInDef PlugInDef; -typedef struct _PlugInProcDef PlugInProcDef; - -typedef struct _ProcArg ProcArg; -typedef struct _ProcRecord ProcRecord; - -typedef guint32 Tattoo; - -typedef struct _Selection Selection; - - -/* some undo stuff */ - -typedef struct _LayerUndo LayerUndo; - -typedef struct _LayerMaskUndo LayerMaskUndo; - -typedef struct _FStoLayerUndo FStoLayerUndo; - -typedef GSList PathUndo; - - -/* functions */ - -typedef void (* ImageMapApplyFunc) (PixelRegion *srcPR, - PixelRegion *destPR, - gpointer data); - - -#endif /* __APPTYPES_H__ */ diff --git a/app/base/pixel-region.c b/app/base/pixel-region.c index c21530aaf3..8b118dfcab 100644 --- a/app/base/pixel-region.c +++ b/app/base/pixel-region.c @@ -344,13 +344,11 @@ pixel_regions_register (gint num_regions, gpointer -pixel_regions_process (gpointer PRI_ptr) +pixel_regions_process (PixelRegionIterator *PRI) { GSList *list; PixelRegionHolder *PRH; - PixelRegionIterator *PRI; - PRI = (PixelRegionIterator *) PRI_ptr; PRI->process_count++; /* Unref all referenced tiles and increment the offsets */ @@ -390,13 +388,11 @@ pixel_regions_process (gpointer PRI_ptr) } void -pixel_regions_process_stop (gpointer PRI_ptr) +pixel_regions_process_stop (PixelRegionIterator *PRI) { GSList *list; PixelRegionHolder *PRH; - PixelRegionIterator *PRI; - PRI = (PixelRegionIterator *) PRI_ptr; PRI->process_count++; /* Unref all referenced tiles and increment the offsets */ diff --git a/app/base/pixel-region.h b/app/base/pixel-region.h index f03adf4c8e..f66dbfd3b0 100644 --- a/app/base/pixel-region.h +++ b/app/base/pixel-region.h @@ -60,50 +60,51 @@ struct _PixelRegionIterator /* PixelRegion functions */ -void pixel_region_init (PixelRegion *PR, - TileManager *tiles, - gint x, - gint y, - gint w, - gint h, - gboolean dirty); -void pixel_region_resize (PixelRegion *PR, - gint x, - gint y, - gint w, - gint h); -void pixel_region_get_async (PixelRegion *PR, - gint ulx, - gint uly, - gint lrx, - gint lry); -void pixel_region_get_row (PixelRegion *PR, - gint x, - gint y, - gint w, - guchar *data, - gint subsample); -void pixel_region_set_row (PixelRegion *PR, - gint x, - gint y, - gint w, - guchar *data); -void pixel_region_get_col (PixelRegion *PR, - gint x, - gint y, - gint h, - guchar *data, - gint subsample); -void pixel_region_set_col (PixelRegion *PR, - gint x, - gint y, - gint h, - guchar *data); -gboolean pixel_region_has_alpha (PixelRegion *PR); -gpointer pixel_regions_register (gint num_regions, +void pixel_region_init (PixelRegion *PR, + TileManager *tiles, + gint x, + gint y, + gint w, + gint h, + gboolean dirty); +void pixel_region_resize (PixelRegion *PR, + gint x, + gint y, + gint w, + gint h); +void pixel_region_get_async (PixelRegion *PR, + gint ulx, + gint uly, + gint lrx, + gint lry); +void pixel_region_get_row (PixelRegion *PR, + gint x, + gint y, + gint w, + guchar *data, + gint subsample); +void pixel_region_set_row (PixelRegion *PR, + gint x, + gint y, + gint w, + guchar *data); +void pixel_region_get_col (PixelRegion *PR, + gint x, + gint y, + gint h, + guchar *data, + gint subsample); +void pixel_region_set_col (PixelRegion *PR, + gint x, + gint y, + gint h, + guchar *data); +gboolean pixel_region_has_alpha (PixelRegion *PR); + +gpointer pixel_regions_register (gint num_regions, ...); -gpointer pixel_regions_process (gpointer PRI_ptr); -void pixel_regions_process_stop (gpointer PRI_ptr); +gpointer pixel_regions_process (PixelRegionIterator *PRI); +void pixel_regions_process_stop (PixelRegionIterator *PRI); #endif /* __PIXEL_REGION_H__ */ diff --git a/app/batch.c b/app/batch.c index 000f40563a..79b365acaf 100644 --- a/app/batch.c +++ b/app/batch.c @@ -27,7 +27,7 @@ #include #endif -#include +#include #include "core/core-types.h" diff --git a/app/core/core-types.h b/app/core/core-types.h index c4a0c72a36..56edc9b1e4 100644 --- a/app/core/core-types.h +++ b/app/core/core-types.h @@ -20,15 +20,19 @@ #define __CORE_TYPES_H__ -/* EEK */ -#include +#include /* EEK */ -#include "apptypes.h" +#include "libgimpbase/gimpbasetypes.h" +#include "libgimpmath/gimpmath.h" + +#include "base/base-types.h" +#include "plug-in/plug-in-types.h" + +#include "undo_types.h" /* EEK */ /* enums */ -/* Base image types */ typedef enum { RGB, @@ -36,7 +40,6 @@ typedef enum INDEXED } GimpImageBaseType; -/* Image types */ typedef enum { RGB_GIMAGE, /*< nick=RGB_IMAGE >*/ @@ -47,7 +50,6 @@ typedef enum INDEXEDA_GIMAGE /*< nick=INDEXEDA_IMAGE >*/ } GimpImageType; -/* Channel types */ typedef enum { RED_CHANNEL, @@ -58,13 +60,44 @@ typedef enum ALPHA_CHANNEL } ChannelType; +typedef enum /*< chop=ADD_ >*/ +{ + ADD_WHITE_MASK, + ADD_BLACK_MASK, + ADD_ALPHA_MASK, + ADD_SELECTION_MASK, + ADD_INV_SELECTION_MASK +} AddMaskType; + typedef enum { APPLY, DISCARD } MaskApplyMode; -/* Fill types */ +typedef enum +{ + HORIZONTAL, + VERTICAL, + UNKNOWN +} OrientationType; + +typedef enum /*< skip >*/ +{ + ORIENTATION_UNKNOWN, + ORIENTATION_HORIZONTAL, + ORIENTATION_VERTICAL +} InternalOrientationType; + +/* Selection Boolean operations */ +typedef enum /*< chop=CHANNEL_OP_ >*/ +{ + CHANNEL_OP_ADD, + CHANNEL_OP_SUB, + CHANNEL_OP_REPLACE, + CHANNEL_OP_INTERSECT +} ChannelOps; + typedef enum { FOREGROUND_FILL, /*< nick=FG_IMAGE_FILL >*/ @@ -74,7 +107,6 @@ typedef enum NO_FILL /*< nick=NO_IMAGE_FILL >*/ } GimpFillType; -/* Transfer modes */ typedef enum /*< chop=GIMP_ >*/ { GIMP_SHADOWS, @@ -140,6 +172,11 @@ typedef struct _GimpUndo GimpUndo; typedef struct _GimpUndoStack GimpUndoStack; +/* other objects */ + +typedef struct _ImageMap ImageMap; /* temp_hack, will be an object */ + + /* non-object types */ typedef struct _GimpCoreConfig GimpCoreConfig; @@ -148,6 +185,17 @@ typedef struct _GimpGuide GimpGuide; typedef struct _GimpImageNewValues GimpImageNewValues; +typedef struct _GimpProgress GimpProgress; + +typedef guint32 GimpTattoo; + + +/* EEK stuff */ + +typedef struct _Path Path; +typedef struct _PathPoint PathPoint; +typedef struct _PathList PathList; + /* stuff which is forward declared here so we don't need to cross-include it */ diff --git a/app/core/gimp.c b/app/core/gimp.c index 38fc1bc7f3..4a1444b21d 100644 --- a/app/core/gimp.c +++ b/app/core/gimp.c @@ -25,6 +25,7 @@ #include "libgimpbase/gimpbase.h" #include "core-types.h" +#include "pdb/pdb-types.h" #include "base/tile-manager.h" @@ -146,6 +147,7 @@ gimp_init (Gimp *gimp) gimp->tool_info_list = gimp_list_new (GIMP_TYPE_TOOL_INFO, GIMP_CONTAINER_POLICY_STRONG); + gimp->standard_tool_info = NULL; gimp_documents_init (gimp); @@ -210,6 +212,8 @@ gimp_finalize (GObject *object) if (gimp->documents) gimp_documents_exit (gimp); + gimp_tool_info_set_standard (gimp, NULL); + if (gimp->tool_info_list) { g_object_unref (G_OBJECT (gimp->tool_info_list)); diff --git a/app/core/gimp.h b/app/core/gimp.h index 20e8c5874d..4135dfa91e 100644 --- a/app/core/gimp.h +++ b/app/core/gimp.h @@ -75,6 +75,7 @@ struct _Gimp GHashTable *procedural_ht; GimpContainer *tool_info_list; + GimpToolInfo *standard_tool_info; /* the opened and saved images in MRU order */ GimpContainer *documents; diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index 1cf39fe5c6..1700044eef 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -1366,7 +1366,7 @@ gimp_context_tool_list_thaw (GimpContainer *container, (context, GIMP_TOOL_INFO (gimp_container_get_child_by_index (container, 0))); else - gimp_context_real_set_tool (context, gimp_tool_info_get_standard ()); + gimp_context_real_set_tool (context, gimp_tool_info_get_standard (context->gimp)); } /* the active tool disappeared */ @@ -1394,7 +1394,7 @@ gimp_context_real_set_tool (GimpContext *context, GimpToolInfo *tool_info) { if (! standard_tool_info) - standard_tool_info = gimp_tool_info_get_standard (); + standard_tool_info = gimp_tool_info_get_standard (context->gimp); if (context->tool_info == tool_info) return; diff --git a/app/core/gimpcontext.h b/app/core/gimpcontext.h index fcf27d328b..d60b898195 100644 --- a/app/core/gimpcontext.h +++ b/app/core/gimpcontext.h @@ -96,7 +96,7 @@ struct _GimpContext guint32 defined_props; GimpImage *image; - GDisplay *display; + gpointer display; GimpToolInfo *tool_info; gchar *tool_name; @@ -129,7 +129,7 @@ struct _GimpContextClass void (* image_changed) (GimpContext *context, GimpImage *image); void (* display_changed) (GimpContext *context, - GDisplay *display); + gpointer display); void (* tool_changed) (GimpContext *context, GimpToolInfo *tool_info); diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c index cae67951fb..021ffbc59a 100644 --- a/app/core/gimpdrawable.c +++ b/app/core/gimpdrawable.c @@ -883,7 +883,7 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable, gimp_parasite_list_remove (drawable->parasites, parasite); } -Tattoo +GimpTattoo gimp_drawable_get_tattoo (const GimpDrawable *drawable) { g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), 0); @@ -893,11 +893,11 @@ gimp_drawable_get_tattoo (const GimpDrawable *drawable) void gimp_drawable_set_tattoo (GimpDrawable *drawable, - Tattoo val) + GimpTattoo tattoo) { g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); - drawable->tattoo = val; + drawable->tattoo = tattoo; } gboolean diff --git a/app/core/gimpdrawable.h b/app/core/gimpdrawable.h index 448c9ebfc3..eda9336bf4 100644 --- a/app/core/gimpdrawable.h +++ b/app/core/gimpdrawable.h @@ -148,9 +148,9 @@ GimpParasite * gimp_drawable_parasite_find (const GimpDrawable *drawable, const gchar *name); gchar ** gimp_drawable_parasite_list (const GimpDrawable *drawable, gint *count); -Tattoo gimp_drawable_get_tattoo (const GimpDrawable *drawable); +GimpTattoo gimp_drawable_get_tattoo (const GimpDrawable *drawable); void gimp_drawable_set_tattoo (GimpDrawable *drawable, - Tattoo tattoo); + GimpTattoo tattoo); #endif /* __GIMP_DRAWABLE_H__ */ diff --git a/app/core/gimpimage-guides.c b/app/core/gimpimage-guides.c index 9035514a89..8826915c8c 100644 --- a/app/core/gimpimage-guides.c +++ b/app/core/gimpimage-guides.c @@ -1666,7 +1666,8 @@ gimp_image_parasite_detach (GimpImage *gimage, { GimpParasite *p; - g_return_if_fail (GIMP_IS_IMAGE (gimage) && parasite != NULL); + g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (parasite != NULL); if (!(p = gimp_parasite_list_find (gimage->parasites, parasite))) return; @@ -1677,31 +1678,35 @@ gimp_image_parasite_detach (GimpImage *gimage, gimp_parasite_list_remove (gimage->parasites, parasite); } -Tattoo -gimp_image_get_new_tattoo (GimpImage *image) +GimpTattoo +gimp_image_get_new_tattoo (GimpImage *gimage) { - image->tattoo_state++; + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); - if (image->tattoo_state <= 0) - g_warning ("Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + gimage->tattoo_state++; - return image->tattoo_state; + if (gimage->tattoo_state <= 0) + g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + + return gimage->tattoo_state; } -Tattoo -gimp_image_get_tattoo_state (GimpImage *image) +GimpTattoo +gimp_image_get_tattoo_state (GimpImage *gimage) { - return (image->tattoo_state); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + + return gimage->tattoo_state; } gboolean -gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val) +gimp_image_set_tattoo_state (GimpImage *gimage, + GimpTattoo val) { GList *list; gboolean retval = TRUE; GimpChannel *channel; - Tattoo maxval = 0; + GimpTattoo maxval = 0; Path *pptr = NULL; PathList *plist; @@ -1711,7 +1716,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ltattoo; + GimpTattoo ltattoo; ltattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (list->data)); if (ltattoo > maxval) @@ -1733,7 +1738,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ctattoo; + GimpTattoo ctattoo; + channel = (GimpChannel *) list->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); @@ -1751,8 +1757,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, if (plist && plist->bz_paths) { - Tattoo ptattoo; - GSList *pl; + GimpTattoo ptattoo; + GSList *pl; for (pl = plist->bz_paths; pl; pl = g_slist_next (pl)) { @@ -2520,7 +2526,7 @@ gimp_image_get_active_channel (const GimpImage *gimage) GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpLayer *layer; GList *list; @@ -2542,7 +2548,7 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpChannel *channel; GList *list; diff --git a/app/core/gimpimage-guides.h b/app/core/gimpimage-guides.h index 1dbc5d871c..c4b4940dc5 100644 --- a/app/core/gimpimage-guides.h +++ b/app/core/gimpimage-guides.h @@ -81,7 +81,7 @@ struct _GimpImage gint instance_count; /* number of instances */ gint disp_count; /* number of displays */ - Tattoo tattoo_state; /* the next unique tattoo to use*/ + GimpTattoo tattoo_state; /* the next unique tattoo to use*/ TileManager *shadow; /* shadow buffer tiles */ @@ -262,10 +262,10 @@ void gimp_image_parasite_attach (GimpImage *gimage, void gimp_image_parasite_detach (GimpImage *gimage, const gchar *parasite); -Tattoo gimp_image_get_new_tattoo (GimpImage *gimage); +GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage); gboolean gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val); -Tattoo gimp_image_get_tattoo_state (GimpImage *gimage); + GimpTattoo val); +GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage); void gimp_image_set_paths (GimpImage *gimage, PathList *paths); @@ -303,9 +303,9 @@ gint gimp_image_get_channel_index (const GimpImage *gimage, GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name); GimpChannel * gimp_image_get_mask (const GimpImage *gimage); diff --git a/app/core/gimpimage-mask.c b/app/core/gimpimage-mask.c index c122d9350c..62fa2b983f 100644 --- a/app/core/gimpimage-mask.c +++ b/app/core/gimpimage-mask.c @@ -20,9 +20,10 @@ #include -#include +#include #include "core-types.h" +#include "pdb/pdb-types.h" #include "base/boundary.h" #include "base/pixel-region.h" @@ -39,7 +40,6 @@ #include "gimptoolinfo.h" #include "floating_sel.h" -#include "gdisplay.h" /* EEK */ #include "undo.h" #include "pdb/procedural_db.h" @@ -142,7 +142,7 @@ gimage_mask_invalidate (GimpImage *gimage) GimpChannel *mask; /* Turn the current selection off */ - gdisplays_selection_visibility (gimage, SELECTION_OFF); + gdisplays_selection_visibility (gimage, 0 /* SELECTION_OFF */); mask = gimp_image_get_mask (gimage); mask->boundary_known = FALSE; diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c index 9035514a89..8826915c8c 100644 --- a/app/core/gimpimage-merge.c +++ b/app/core/gimpimage-merge.c @@ -1666,7 +1666,8 @@ gimp_image_parasite_detach (GimpImage *gimage, { GimpParasite *p; - g_return_if_fail (GIMP_IS_IMAGE (gimage) && parasite != NULL); + g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (parasite != NULL); if (!(p = gimp_parasite_list_find (gimage->parasites, parasite))) return; @@ -1677,31 +1678,35 @@ gimp_image_parasite_detach (GimpImage *gimage, gimp_parasite_list_remove (gimage->parasites, parasite); } -Tattoo -gimp_image_get_new_tattoo (GimpImage *image) +GimpTattoo +gimp_image_get_new_tattoo (GimpImage *gimage) { - image->tattoo_state++; + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); - if (image->tattoo_state <= 0) - g_warning ("Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + gimage->tattoo_state++; - return image->tattoo_state; + if (gimage->tattoo_state <= 0) + g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + + return gimage->tattoo_state; } -Tattoo -gimp_image_get_tattoo_state (GimpImage *image) +GimpTattoo +gimp_image_get_tattoo_state (GimpImage *gimage) { - return (image->tattoo_state); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + + return gimage->tattoo_state; } gboolean -gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val) +gimp_image_set_tattoo_state (GimpImage *gimage, + GimpTattoo val) { GList *list; gboolean retval = TRUE; GimpChannel *channel; - Tattoo maxval = 0; + GimpTattoo maxval = 0; Path *pptr = NULL; PathList *plist; @@ -1711,7 +1716,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ltattoo; + GimpTattoo ltattoo; ltattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (list->data)); if (ltattoo > maxval) @@ -1733,7 +1738,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ctattoo; + GimpTattoo ctattoo; + channel = (GimpChannel *) list->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); @@ -1751,8 +1757,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, if (plist && plist->bz_paths) { - Tattoo ptattoo; - GSList *pl; + GimpTattoo ptattoo; + GSList *pl; for (pl = plist->bz_paths; pl; pl = g_slist_next (pl)) { @@ -2520,7 +2526,7 @@ gimp_image_get_active_channel (const GimpImage *gimage) GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpLayer *layer; GList *list; @@ -2542,7 +2548,7 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpChannel *channel; GList *list; diff --git a/app/core/gimpimage-merge.h b/app/core/gimpimage-merge.h index 1dbc5d871c..c4b4940dc5 100644 --- a/app/core/gimpimage-merge.h +++ b/app/core/gimpimage-merge.h @@ -81,7 +81,7 @@ struct _GimpImage gint instance_count; /* number of instances */ gint disp_count; /* number of displays */ - Tattoo tattoo_state; /* the next unique tattoo to use*/ + GimpTattoo tattoo_state; /* the next unique tattoo to use*/ TileManager *shadow; /* shadow buffer tiles */ @@ -262,10 +262,10 @@ void gimp_image_parasite_attach (GimpImage *gimage, void gimp_image_parasite_detach (GimpImage *gimage, const gchar *parasite); -Tattoo gimp_image_get_new_tattoo (GimpImage *gimage); +GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage); gboolean gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val); -Tattoo gimp_image_get_tattoo_state (GimpImage *gimage); + GimpTattoo val); +GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage); void gimp_image_set_paths (GimpImage *gimage, PathList *paths); @@ -303,9 +303,9 @@ gint gimp_image_get_channel_index (const GimpImage *gimage, GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name); GimpChannel * gimp_image_get_mask (const GimpImage *gimage); diff --git a/app/core/gimpimage-projection.c b/app/core/gimpimage-projection.c index 9035514a89..8826915c8c 100644 --- a/app/core/gimpimage-projection.c +++ b/app/core/gimpimage-projection.c @@ -1666,7 +1666,8 @@ gimp_image_parasite_detach (GimpImage *gimage, { GimpParasite *p; - g_return_if_fail (GIMP_IS_IMAGE (gimage) && parasite != NULL); + g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (parasite != NULL); if (!(p = gimp_parasite_list_find (gimage->parasites, parasite))) return; @@ -1677,31 +1678,35 @@ gimp_image_parasite_detach (GimpImage *gimage, gimp_parasite_list_remove (gimage->parasites, parasite); } -Tattoo -gimp_image_get_new_tattoo (GimpImage *image) +GimpTattoo +gimp_image_get_new_tattoo (GimpImage *gimage) { - image->tattoo_state++; + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); - if (image->tattoo_state <= 0) - g_warning ("Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + gimage->tattoo_state++; - return image->tattoo_state; + if (gimage->tattoo_state <= 0) + g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + + return gimage->tattoo_state; } -Tattoo -gimp_image_get_tattoo_state (GimpImage *image) +GimpTattoo +gimp_image_get_tattoo_state (GimpImage *gimage) { - return (image->tattoo_state); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + + return gimage->tattoo_state; } gboolean -gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val) +gimp_image_set_tattoo_state (GimpImage *gimage, + GimpTattoo val) { GList *list; gboolean retval = TRUE; GimpChannel *channel; - Tattoo maxval = 0; + GimpTattoo maxval = 0; Path *pptr = NULL; PathList *plist; @@ -1711,7 +1716,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ltattoo; + GimpTattoo ltattoo; ltattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (list->data)); if (ltattoo > maxval) @@ -1733,7 +1738,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ctattoo; + GimpTattoo ctattoo; + channel = (GimpChannel *) list->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); @@ -1751,8 +1757,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, if (plist && plist->bz_paths) { - Tattoo ptattoo; - GSList *pl; + GimpTattoo ptattoo; + GSList *pl; for (pl = plist->bz_paths; pl; pl = g_slist_next (pl)) { @@ -2520,7 +2526,7 @@ gimp_image_get_active_channel (const GimpImage *gimage) GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpLayer *layer; GList *list; @@ -2542,7 +2548,7 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpChannel *channel; GList *list; diff --git a/app/core/gimpimage-projection.h b/app/core/gimpimage-projection.h index 1dbc5d871c..c4b4940dc5 100644 --- a/app/core/gimpimage-projection.h +++ b/app/core/gimpimage-projection.h @@ -81,7 +81,7 @@ struct _GimpImage gint instance_count; /* number of instances */ gint disp_count; /* number of displays */ - Tattoo tattoo_state; /* the next unique tattoo to use*/ + GimpTattoo tattoo_state; /* the next unique tattoo to use*/ TileManager *shadow; /* shadow buffer tiles */ @@ -262,10 +262,10 @@ void gimp_image_parasite_attach (GimpImage *gimage, void gimp_image_parasite_detach (GimpImage *gimage, const gchar *parasite); -Tattoo gimp_image_get_new_tattoo (GimpImage *gimage); +GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage); gboolean gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val); -Tattoo gimp_image_get_tattoo_state (GimpImage *gimage); + GimpTattoo val); +GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage); void gimp_image_set_paths (GimpImage *gimage, PathList *paths); @@ -303,9 +303,9 @@ gint gimp_image_get_channel_index (const GimpImage *gimage, GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name); GimpChannel * gimp_image_get_mask (const GimpImage *gimage); diff --git a/app/core/gimpimage-resize.c b/app/core/gimpimage-resize.c index 9035514a89..8826915c8c 100644 --- a/app/core/gimpimage-resize.c +++ b/app/core/gimpimage-resize.c @@ -1666,7 +1666,8 @@ gimp_image_parasite_detach (GimpImage *gimage, { GimpParasite *p; - g_return_if_fail (GIMP_IS_IMAGE (gimage) && parasite != NULL); + g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (parasite != NULL); if (!(p = gimp_parasite_list_find (gimage->parasites, parasite))) return; @@ -1677,31 +1678,35 @@ gimp_image_parasite_detach (GimpImage *gimage, gimp_parasite_list_remove (gimage->parasites, parasite); } -Tattoo -gimp_image_get_new_tattoo (GimpImage *image) +GimpTattoo +gimp_image_get_new_tattoo (GimpImage *gimage) { - image->tattoo_state++; + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); - if (image->tattoo_state <= 0) - g_warning ("Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + gimage->tattoo_state++; - return image->tattoo_state; + if (gimage->tattoo_state <= 0) + g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + + return gimage->tattoo_state; } -Tattoo -gimp_image_get_tattoo_state (GimpImage *image) +GimpTattoo +gimp_image_get_tattoo_state (GimpImage *gimage) { - return (image->tattoo_state); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + + return gimage->tattoo_state; } gboolean -gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val) +gimp_image_set_tattoo_state (GimpImage *gimage, + GimpTattoo val) { GList *list; gboolean retval = TRUE; GimpChannel *channel; - Tattoo maxval = 0; + GimpTattoo maxval = 0; Path *pptr = NULL; PathList *plist; @@ -1711,7 +1716,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ltattoo; + GimpTattoo ltattoo; ltattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (list->data)); if (ltattoo > maxval) @@ -1733,7 +1738,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ctattoo; + GimpTattoo ctattoo; + channel = (GimpChannel *) list->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); @@ -1751,8 +1757,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, if (plist && plist->bz_paths) { - Tattoo ptattoo; - GSList *pl; + GimpTattoo ptattoo; + GSList *pl; for (pl = plist->bz_paths; pl; pl = g_slist_next (pl)) { @@ -2520,7 +2526,7 @@ gimp_image_get_active_channel (const GimpImage *gimage) GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpLayer *layer; GList *list; @@ -2542,7 +2548,7 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpChannel *channel; GList *list; diff --git a/app/core/gimpimage-resize.h b/app/core/gimpimage-resize.h index 1dbc5d871c..c4b4940dc5 100644 --- a/app/core/gimpimage-resize.h +++ b/app/core/gimpimage-resize.h @@ -81,7 +81,7 @@ struct _GimpImage gint instance_count; /* number of instances */ gint disp_count; /* number of displays */ - Tattoo tattoo_state; /* the next unique tattoo to use*/ + GimpTattoo tattoo_state; /* the next unique tattoo to use*/ TileManager *shadow; /* shadow buffer tiles */ @@ -262,10 +262,10 @@ void gimp_image_parasite_attach (GimpImage *gimage, void gimp_image_parasite_detach (GimpImage *gimage, const gchar *parasite); -Tattoo gimp_image_get_new_tattoo (GimpImage *gimage); +GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage); gboolean gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val); -Tattoo gimp_image_get_tattoo_state (GimpImage *gimage); + GimpTattoo val); +GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage); void gimp_image_set_paths (GimpImage *gimage, PathList *paths); @@ -303,9 +303,9 @@ gint gimp_image_get_channel_index (const GimpImage *gimage, GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name); GimpChannel * gimp_image_get_mask (const GimpImage *gimage); diff --git a/app/core/gimpimage-scale.c b/app/core/gimpimage-scale.c index 9035514a89..8826915c8c 100644 --- a/app/core/gimpimage-scale.c +++ b/app/core/gimpimage-scale.c @@ -1666,7 +1666,8 @@ gimp_image_parasite_detach (GimpImage *gimage, { GimpParasite *p; - g_return_if_fail (GIMP_IS_IMAGE (gimage) && parasite != NULL); + g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (parasite != NULL); if (!(p = gimp_parasite_list_find (gimage->parasites, parasite))) return; @@ -1677,31 +1678,35 @@ gimp_image_parasite_detach (GimpImage *gimage, gimp_parasite_list_remove (gimage->parasites, parasite); } -Tattoo -gimp_image_get_new_tattoo (GimpImage *image) +GimpTattoo +gimp_image_get_new_tattoo (GimpImage *gimage) { - image->tattoo_state++; + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); - if (image->tattoo_state <= 0) - g_warning ("Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + gimage->tattoo_state++; - return image->tattoo_state; + if (gimage->tattoo_state <= 0) + g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + + return gimage->tattoo_state; } -Tattoo -gimp_image_get_tattoo_state (GimpImage *image) +GimpTattoo +gimp_image_get_tattoo_state (GimpImage *gimage) { - return (image->tattoo_state); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + + return gimage->tattoo_state; } gboolean -gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val) +gimp_image_set_tattoo_state (GimpImage *gimage, + GimpTattoo val) { GList *list; gboolean retval = TRUE; GimpChannel *channel; - Tattoo maxval = 0; + GimpTattoo maxval = 0; Path *pptr = NULL; PathList *plist; @@ -1711,7 +1716,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ltattoo; + GimpTattoo ltattoo; ltattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (list->data)); if (ltattoo > maxval) @@ -1733,7 +1738,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ctattoo; + GimpTattoo ctattoo; + channel = (GimpChannel *) list->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); @@ -1751,8 +1757,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, if (plist && plist->bz_paths) { - Tattoo ptattoo; - GSList *pl; + GimpTattoo ptattoo; + GSList *pl; for (pl = plist->bz_paths; pl; pl = g_slist_next (pl)) { @@ -2520,7 +2526,7 @@ gimp_image_get_active_channel (const GimpImage *gimage) GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpLayer *layer; GList *list; @@ -2542,7 +2548,7 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpChannel *channel; GList *list; diff --git a/app/core/gimpimage-scale.h b/app/core/gimpimage-scale.h index 1dbc5d871c..c4b4940dc5 100644 --- a/app/core/gimpimage-scale.h +++ b/app/core/gimpimage-scale.h @@ -81,7 +81,7 @@ struct _GimpImage gint instance_count; /* number of instances */ gint disp_count; /* number of displays */ - Tattoo tattoo_state; /* the next unique tattoo to use*/ + GimpTattoo tattoo_state; /* the next unique tattoo to use*/ TileManager *shadow; /* shadow buffer tiles */ @@ -262,10 +262,10 @@ void gimp_image_parasite_attach (GimpImage *gimage, void gimp_image_parasite_detach (GimpImage *gimage, const gchar *parasite); -Tattoo gimp_image_get_new_tattoo (GimpImage *gimage); +GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage); gboolean gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val); -Tattoo gimp_image_get_tattoo_state (GimpImage *gimage); + GimpTattoo val); +GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage); void gimp_image_set_paths (GimpImage *gimage, PathList *paths); @@ -303,9 +303,9 @@ gint gimp_image_get_channel_index (const GimpImage *gimage, GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name); GimpChannel * gimp_image_get_mask (const GimpImage *gimage); diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 9035514a89..8826915c8c 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -1666,7 +1666,8 @@ gimp_image_parasite_detach (GimpImage *gimage, { GimpParasite *p; - g_return_if_fail (GIMP_IS_IMAGE (gimage) && parasite != NULL); + g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (parasite != NULL); if (!(p = gimp_parasite_list_find (gimage->parasites, parasite))) return; @@ -1677,31 +1678,35 @@ gimp_image_parasite_detach (GimpImage *gimage, gimp_parasite_list_remove (gimage->parasites, parasite); } -Tattoo -gimp_image_get_new_tattoo (GimpImage *image) +GimpTattoo +gimp_image_get_new_tattoo (GimpImage *gimage) { - image->tattoo_state++; + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); - if (image->tattoo_state <= 0) - g_warning ("Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + gimage->tattoo_state++; - return image->tattoo_state; + if (gimage->tattoo_state <= 0) + g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + + return gimage->tattoo_state; } -Tattoo -gimp_image_get_tattoo_state (GimpImage *image) +GimpTattoo +gimp_image_get_tattoo_state (GimpImage *gimage) { - return (image->tattoo_state); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + + return gimage->tattoo_state; } gboolean -gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val) +gimp_image_set_tattoo_state (GimpImage *gimage, + GimpTattoo val) { GList *list; gboolean retval = TRUE; GimpChannel *channel; - Tattoo maxval = 0; + GimpTattoo maxval = 0; Path *pptr = NULL; PathList *plist; @@ -1711,7 +1716,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ltattoo; + GimpTattoo ltattoo; ltattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (list->data)); if (ltattoo > maxval) @@ -1733,7 +1738,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ctattoo; + GimpTattoo ctattoo; + channel = (GimpChannel *) list->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); @@ -1751,8 +1757,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, if (plist && plist->bz_paths) { - Tattoo ptattoo; - GSList *pl; + GimpTattoo ptattoo; + GSList *pl; for (pl = plist->bz_paths; pl; pl = g_slist_next (pl)) { @@ -2520,7 +2526,7 @@ gimp_image_get_active_channel (const GimpImage *gimage) GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpLayer *layer; GList *list; @@ -2542,7 +2548,7 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpChannel *channel; GList *list; diff --git a/app/core/gimpimage.h b/app/core/gimpimage.h index 1dbc5d871c..c4b4940dc5 100644 --- a/app/core/gimpimage.h +++ b/app/core/gimpimage.h @@ -81,7 +81,7 @@ struct _GimpImage gint instance_count; /* number of instances */ gint disp_count; /* number of displays */ - Tattoo tattoo_state; /* the next unique tattoo to use*/ + GimpTattoo tattoo_state; /* the next unique tattoo to use*/ TileManager *shadow; /* shadow buffer tiles */ @@ -262,10 +262,10 @@ void gimp_image_parasite_attach (GimpImage *gimage, void gimp_image_parasite_detach (GimpImage *gimage, const gchar *parasite); -Tattoo gimp_image_get_new_tattoo (GimpImage *gimage); +GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage); gboolean gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val); -Tattoo gimp_image_get_tattoo_state (GimpImage *gimage); + GimpTattoo val); +GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage); void gimp_image_set_paths (GimpImage *gimage, PathList *paths); @@ -303,9 +303,9 @@ gint gimp_image_get_channel_index (const GimpImage *gimage, GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name); GimpChannel * gimp_image_get_mask (const GimpImage *gimage); diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c index 755bf441ed..56d8d05e7b 100644 --- a/app/core/gimpimagemap.c +++ b/app/core/gimpimagemap.c @@ -35,81 +35,34 @@ #include "image_map.h" -#define WAITING 0 -#define WORKING 1 +typedef enum +{ + IMAGE_MAP_WAITING, + IMAGE_MAP_WORKING +} ImageMapState; -#define WORK_DELAY 1 struct _ImageMap { - GDisplay *gdisp; - GimpDrawable *drawable; - TileManager *undo_tiles; - ImageMapApplyFunc apply_func; - gpointer user_data; - PixelRegion srcPR, destPR; - void *pr; - gint state; - gint idle; + GDisplay *gdisp; + GimpDrawable *drawable; + TileManager *undo_tiles; + ImageMapApplyFunc apply_func; + gpointer user_data; + PixelRegion srcPR; + PixelRegion destPR; + PixelRegionIterator *PRI; + ImageMapState state; + guint idle_id; }; -/**************************/ -/* Function definitions */ +/* local function prototypes */ -static gint -image_map_do (gpointer data) -{ - ImageMap *image_map; - GimpImage *gimage; - PixelRegion shadowPR; - gint x, y, w, h; +static gboolean image_map_do (gpointer data); - image_map = (ImageMap *) data; - if (! (gimage = gimp_drawable_gimage (image_map->drawable))) - { - image_map->state = WAITING; - - return FALSE; - } - - /* Process the pixel regions and apply the image mapping */ - (* image_map->apply_func) (&image_map->srcPR, - &image_map->destPR, - image_map->user_data); - - x = image_map->destPR.x; - y = image_map->destPR.y; - w = image_map->destPR.w; - h = image_map->destPR.h; - - /* apply the results */ - pixel_region_init (&shadowPR, gimage->shadow, x, y, w, h, FALSE); - gimp_image_apply_image (gimage, image_map->drawable, &shadowPR, - FALSE, OPAQUE_OPACITY, REPLACE_MODE, NULL, x, y); - - /* display the results */ - if (image_map->gdisp) - { - gimp_drawable_update (image_map->drawable, - x, y, - w, h); - gdisplay_flush_now (image_map->gdisp); - } - - image_map->pr = pixel_regions_process (image_map->pr); - - if (image_map->pr == NULL) - { - image_map->state = WAITING; - gdisplays_flush (); - - return FALSE; - } - - return TRUE; -} +/* public functions */ ImageMap * image_map_create (GDisplay *gdisp, @@ -118,7 +71,6 @@ image_map_create (GDisplay *gdisp, ImageMap *image_map; g_return_val_if_fail (gdisp != NULL, NULL); - g_return_val_if_fail (drawable != NULL, NULL); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); image_map = g_new0 (ImageMap, 1); @@ -126,7 +78,10 @@ image_map_create (GDisplay *gdisp, image_map->gdisp = gdisp; image_map->drawable = drawable; image_map->undo_tiles = NULL; - image_map->state = WAITING; + image_map->apply_func = NULL; + image_map->user_data = NULL; + image_map->state = IMAGE_MAP_WAITING; + image_map->idle_id = 0; /* Interactive tools based on image_map disable the undo stack * to avert any unintented undo interaction through the UI @@ -154,12 +109,13 @@ image_map_apply (ImageMap *image_map, image_map->user_data = apply_data; /* If we're still working, remove the timer */ - if (image_map->state == WORKING) + if (image_map->state == IMAGE_MAP_WORKING) { - gtk_idle_remove (image_map->idle); - pixel_regions_process_stop (image_map->pr); + g_source_remove (image_map->idle_id); + image_map->idle_id = 0; - image_map->pr = NULL; + pixel_regions_process_stop (image_map->PRI); + image_map->PRI = NULL; } /* Make sure the drawable is still valid */ @@ -236,11 +192,13 @@ image_map_apply (ImageMap *image_map, x1, y1, (x2 - x1), (y2 - y1), TRUE); /* Apply the image transformation to the pixels */ - image_map->pr = pixel_regions_register (2, &image_map->srcPR, &image_map->destPR); + image_map->PRI = pixel_regions_register (2, + &image_map->srcPR, + &image_map->destPR); /* Start the intermittant work procedure */ - image_map->state = WORKING; - image_map->idle = gtk_idle_add (image_map_do, image_map); + image_map->state = IMAGE_MAP_WORKING; + image_map->idle_id = g_idle_add (image_map_do, image_map); } void @@ -250,12 +208,13 @@ image_map_commit (ImageMap *image_map) g_return_if_fail (image_map != NULL); - if (image_map->state == WORKING) + if (image_map->state == IMAGE_MAP_WORKING) { - gtk_idle_remove (image_map->idle); + g_source_remove (image_map->idle_id); + image_map->idle_id = 0; /* Finish the changes */ - while (image_map_do (image_map)) ; + while (image_map_do (image_map)); } /* Make sure the drawable is still valid */ @@ -287,14 +246,16 @@ image_map_clear (ImageMap *image_map) g_return_if_fail (image_map != NULL); - if (image_map->state == WORKING) + if (image_map->state == IMAGE_MAP_WORKING) { - gtk_idle_remove (image_map->idle); - pixel_regions_process_stop (image_map->pr); - image_map->pr = NULL; + g_source_remove (image_map->idle_id); + image_map->idle_id = 0; + + pixel_regions_process_stop (image_map->PRI); + image_map->PRI = NULL; } - image_map->state = WAITING; + image_map->state = IMAGE_MAP_WAITING; /* Make sure the drawable is still valid */ if (! gimp_drawable_gimage (image_map->drawable)) @@ -412,3 +373,60 @@ image_map_get_color_at (ImageMap *image_map, return NULL; } } + + +/* private functions */ + +static gboolean +image_map_do (gpointer data) +{ + ImageMap *image_map; + GimpImage *gimage; + PixelRegion shadowPR; + gint x, y, w, h; + + image_map = (ImageMap *) data; + + if (! (gimage = gimp_drawable_gimage (image_map->drawable))) + { + image_map->state = IMAGE_MAP_WAITING; + + return FALSE; + } + + /* Process the pixel regions and apply the image mapping */ + (* image_map->apply_func) (&image_map->srcPR, + &image_map->destPR, + image_map->user_data); + + x = image_map->destPR.x; + y = image_map->destPR.y; + w = image_map->destPR.w; + h = image_map->destPR.h; + + /* apply the results */ + pixel_region_init (&shadowPR, gimage->shadow, x, y, w, h, FALSE); + gimp_image_apply_image (gimage, image_map->drawable, &shadowPR, + FALSE, OPAQUE_OPACITY, REPLACE_MODE, NULL, x, y); + + /* display the results */ + if (image_map->gdisp) + { + gimp_drawable_update (image_map->drawable, + x, y, + w, h); + gdisplay_flush_now (image_map->gdisp); + } + + image_map->PRI = pixel_regions_process (image_map->PRI); + + if (image_map->PRI == NULL) + { + image_map->state = IMAGE_MAP_WAITING; + gdisplays_flush (); + + return FALSE; + } + + return TRUE; +} diff --git a/app/core/gimpimagemap.h b/app/core/gimpimagemap.h index 8c882cf277..a5ae11b835 100644 --- a/app/core/gimpimagemap.h +++ b/app/core/gimpimagemap.h @@ -20,12 +20,19 @@ #define __IMAGE_MAP_H__ +typedef void (* ImageMapApplyFunc) (PixelRegion *srcPR, + PixelRegion *destPR, + gpointer data); + + /* Image Map functions */ /* Successive image map apply functions can be called, but eventually - * MUST be followed with an image_map_commit or an image_map_abort call - * The image map is no longer valid after a call to commit or abort. + * MUST be followed with an image_map_commit or an image_map_abort call + * The image map is no longer valid after a call to commit or abort. */ + + ImageMap * image_map_create (GDisplay *gdisp, GimpDrawable *drawable); void image_map_apply (ImageMap *image_map, diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c index e79cca8789..6be59a12f0 100644 --- a/app/core/gimplayer.c +++ b/app/core/gimplayer.c @@ -25,8 +25,6 @@ #include -#include /* EEK */ - #include "libgimpmath/gimpmath.h" #include "core-types.h" @@ -45,7 +43,6 @@ #include "gimpparasitelist.h" #include "floating_sel.h" -#include "gdisplay.h" /* EEK */ #include "undo.h" #include "libgimp/gimpintl.h" @@ -1292,10 +1289,10 @@ gimp_layer_invalidate_boundary (GimpLayer *layer) return; /* Turn the current selection off */ - gdisplays_selection_visibility (gimage, SELECTION_OFF); + gdisplays_selection_visibility (gimage, 0 /* SELECTION_OFF */); /* clear the affected region surrounding the layer */ - gdisplays_selection_visibility (gimage, SELECTION_LAYER_OFF); + gdisplays_selection_visibility (gimage, 1 /* SELECTION_LAYER_OFF */); /* get the selection mask channel */ mask = gimp_image_get_mask (gimage); diff --git a/app/core/gimpprojection-construct.c b/app/core/gimpprojection-construct.c index 9035514a89..8826915c8c 100644 --- a/app/core/gimpprojection-construct.c +++ b/app/core/gimpprojection-construct.c @@ -1666,7 +1666,8 @@ gimp_image_parasite_detach (GimpImage *gimage, { GimpParasite *p; - g_return_if_fail (GIMP_IS_IMAGE (gimage) && parasite != NULL); + g_return_if_fail (GIMP_IS_IMAGE (gimage)); + g_return_if_fail (parasite != NULL); if (!(p = gimp_parasite_list_find (gimage->parasites, parasite))) return; @@ -1677,31 +1678,35 @@ gimp_image_parasite_detach (GimpImage *gimage, gimp_parasite_list_remove (gimage->parasites, parasite); } -Tattoo -gimp_image_get_new_tattoo (GimpImage *image) +GimpTattoo +gimp_image_get_new_tattoo (GimpImage *gimage) { - image->tattoo_state++; + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); - if (image->tattoo_state <= 0) - g_warning ("Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + gimage->tattoo_state++; - return image->tattoo_state; + if (gimage->tattoo_state <= 0) + g_warning ("gimp_image_get_new_tattoo(): Tattoo state has become corrupt (2.1 billion operation limit exceded)"); + + return gimage->tattoo_state; } -Tattoo -gimp_image_get_tattoo_state (GimpImage *image) +GimpTattoo +gimp_image_get_tattoo_state (GimpImage *gimage) { - return (image->tattoo_state); + g_return_val_if_fail (GIMP_IS_IMAGE (gimage), 0); + + return gimage->tattoo_state; } gboolean -gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val) +gimp_image_set_tattoo_state (GimpImage *gimage, + GimpTattoo val) { GList *list; gboolean retval = TRUE; GimpChannel *channel; - Tattoo maxval = 0; + GimpTattoo maxval = 0; Path *pptr = NULL; PathList *plist; @@ -1711,7 +1716,7 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ltattoo; + GimpTattoo ltattoo; ltattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (list->data)); if (ltattoo > maxval) @@ -1733,7 +1738,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, list; list = g_list_next (list)) { - Tattoo ctattoo; + GimpTattoo ctattoo; + channel = (GimpChannel *) list->data; ctattoo = gimp_drawable_get_tattoo (GIMP_DRAWABLE (channel)); @@ -1751,8 +1757,8 @@ gimp_image_set_tattoo_state (GimpImage *gimage, if (plist && plist->bz_paths) { - Tattoo ptattoo; - GSList *pl; + GimpTattoo ptattoo; + GSList *pl; for (pl = plist->bz_paths; pl; pl = g_slist_next (pl)) { @@ -2520,7 +2526,7 @@ gimp_image_get_active_channel (const GimpImage *gimage) GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpLayer *layer; GList *list; @@ -2542,7 +2548,7 @@ gimp_image_get_layer_by_tattoo (const GimpImage *gimage, GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tattoo) + GimpTattoo tattoo) { GimpChannel *channel; GList *list; diff --git a/app/core/gimpprojection-construct.h b/app/core/gimpprojection-construct.h index 1dbc5d871c..c4b4940dc5 100644 --- a/app/core/gimpprojection-construct.h +++ b/app/core/gimpprojection-construct.h @@ -81,7 +81,7 @@ struct _GimpImage gint instance_count; /* number of instances */ gint disp_count; /* number of displays */ - Tattoo tattoo_state; /* the next unique tattoo to use*/ + GimpTattoo tattoo_state; /* the next unique tattoo to use*/ TileManager *shadow; /* shadow buffer tiles */ @@ -262,10 +262,10 @@ void gimp_image_parasite_attach (GimpImage *gimage, void gimp_image_parasite_detach (GimpImage *gimage, const gchar *parasite); -Tattoo gimp_image_get_new_tattoo (GimpImage *gimage); +GimpTattoo gimp_image_get_new_tattoo (GimpImage *gimage); gboolean gimp_image_set_tattoo_state (GimpImage *gimage, - Tattoo val); -Tattoo gimp_image_get_tattoo_state (GimpImage *gimage); + GimpTattoo val); +GimpTattoo gimp_image_get_tattoo_state (GimpImage *gimage); void gimp_image_set_paths (GimpImage *gimage, PathList *paths); @@ -303,9 +303,9 @@ gint gimp_image_get_channel_index (const GimpImage *gimage, GimpLayer * gimp_image_get_active_layer (const GimpImage *gimage); GimpChannel * gimp_image_get_active_channel (const GimpImage *gimage); GimpLayer * gimp_image_get_layer_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_tattoo (const GimpImage *gimage, - Tattoo tatoo); + GimpTattoo tatoo); GimpChannel * gimp_image_get_channel_by_name (const GimpImage *gimage, const gchar *name); GimpChannel * gimp_image_get_mask (const GimpImage *gimage); diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index 8348ce8354..f0dccd0509 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -20,8 +20,9 @@ #define __GDISPLAY_H__ -/* FIXME: don't include gdisplay.h from core/ */ -#include "widgets/widgets-types.h" +/* FIXME: move the display stuff to display/ */ + +#include "display/display-types.h" typedef enum diff --git a/app/core/gimptoolinfo.c b/app/core/gimptoolinfo.c index 5e8d489755..7186566f24 100644 --- a/app/core/gimptoolinfo.c +++ b/app/core/gimptoolinfo.c @@ -19,9 +19,6 @@ #include "config.h" #include -#include - -#include #include "core-types.h" @@ -31,10 +28,6 @@ #include "gimpcontext.h" #include "gimptoolinfo.h" -/* GRMPF */ -#include "tools/tools-types.h" -#include "tools/gimprectselecttool.h" - static void gimp_tool_info_class_init (GimpToolInfoClass *klass); static void gimp_tool_info_init (GimpToolInfo *tool_info); @@ -296,36 +289,30 @@ gimp_tool_info_new (GimpContext *context, return tool_info; } -GimpToolInfo * -gimp_tool_info_get_standard (void) +void +gimp_tool_info_set_standard (Gimp *gimp, + GimpToolInfo *tool_info) { - static GimpToolInfo *standard_tool_info = NULL; + g_return_if_fail (GIMP_IS_GIMP (gimp)); + g_return_if_fail (! tool_info || GIMP_IS_TOOL_INFO (tool_info)); - if (! standard_tool_info) + if (gimp->standard_tool_info) { - GdkPixbuf *pixbuf; - - pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, - TRUE, - 8, - 22, - 22); - - standard_tool_info = - gimp_tool_info_new (NULL, - GIMP_TYPE_RECT_SELECT_TOOL, - FALSE, - "gimp:standard_tool", - "Standard Tool", - "Well something must be broken", - "/Tools/Default Tool", NULL, - NULL, NULL, - NULL, - GTK_STOCK_STOP, - pixbuf); - - g_object_unref (G_OBJECT (pixbuf)); + g_object_unref (G_OBJECT (gimp->standard_tool_info)); } - return standard_tool_info; + gimp->standard_tool_info = tool_info; + + if (gimp->standard_tool_info) + { + g_object_ref (G_OBJECT (gimp->standard_tool_info)); + } +} + +GimpToolInfo * +gimp_tool_info_get_standard (Gimp *gimp) +{ + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + return gimp->standard_tool_info; } diff --git a/app/core/gimptoolinfo.h b/app/core/gimptoolinfo.h index 21355ca173..2010bbcf00 100644 --- a/app/core/gimptoolinfo.h +++ b/app/core/gimptoolinfo.h @@ -81,7 +81,9 @@ GimpToolInfo * gimp_tool_info_new (GimpContext *context, const gchar *stock_id, GdkPixbuf *stock_pixbuf); -GimpToolInfo * gimp_tool_info_get_standard (void); +void gimp_tool_info_set_standard (Gimp *gimp, + GimpToolInfo *tool_info); +GimpToolInfo * gimp_tool_info_get_standard (Gimp *gimp); #endif /* __GIMP_TOOL_INFO_H__ */ diff --git a/app/dialogs/color-dialog.c b/app/dialogs/color-dialog.c index fb53584286..724a8590f7 100644 --- a/app/dialogs/color-dialog.c +++ b/app/dialogs/color-dialog.c @@ -32,7 +32,7 @@ #include "libgimpwidgets/gimpwidgets.h" #include "libgimp/gimpcolorselector.h" -#include "apptypes.h" +#include "gui-types.h" #include "color-area.h" #include "color-notebook.h" diff --git a/app/dialogs/dialogs-constructors.c b/app/dialogs/dialogs-constructors.c index ff5bc71d66..d612d974ab 100644 --- a/app/dialogs/dialogs-constructors.c +++ b/app/dialogs/dialogs-constructors.c @@ -23,7 +23,7 @@ #include "libgimpcolor/gimpcolor.h" #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" +#include "gui-types.h" #include "tools/tools-types.h" #include "core/gimp.h" @@ -78,7 +78,6 @@ #include "app_procs.h" #include "devices.h" #include "docindex.h" -#include "gdisplay.h" #include "gimprc.h" #include "module_db.h" #include "undo_history.h" @@ -238,17 +237,14 @@ GtkWidget * dialogs_undo_history_get (GimpDialogFactory *factory, GimpContext *context) { - GDisplay *gdisp; GimpImage *gimage; GtkWidget *undo_history; - gdisp = gimp_context_get_display (context); + gimage = gimp_context_get_image (context); - if (! gdisp) + if (! gimage) return NULL; - gimage = gdisp->gimage; - undo_history = g_object_get_data (G_OBJECT (gimage), "undo-history"); if (! undo_history) diff --git a/app/dialogs/info-dialog.c b/app/dialogs/info-dialog.c index 6e64ddd6e8..a61bd85101 100644 --- a/app/dialogs/info-dialog.c +++ b/app/dialogs/info-dialog.c @@ -24,7 +24,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "gui-types.h" #include "info-dialog.h" diff --git a/app/display/.cvsignore b/app/display/.cvsignore new file mode 100644 index 0000000000..4b82088969 --- /dev/null +++ b/app/display/.cvsignore @@ -0,0 +1,6 @@ +Makefile +Makefile.in +.deps +.libs +*.lo +libappdisplay.la diff --git a/app/display/Makefile.am b/app/display/Makefile.am new file mode 100644 index 0000000000..c0fe41fc15 --- /dev/null +++ b/app/display/Makefile.am @@ -0,0 +1,49 @@ +## Process this file with automake to produce Makefile.in + +noinst_LIBRARIES = libappdisplay.a + +libappdisplay_a_SOURCES = @STRIP_BEGIN@ \ + display-types.h \ +## display.c \ +## display.h \ +## gimpdisplay.c \ +## gimpdisplay.h \ +## gimpdisplay-callbacks.c \ +## gimpdisplay-callbacks.h \ +## gimpdisplay-ops.c \ +## gimpdisplay-ops.h \ +## gimpdisplay-render.c \ +## gimpdisplay-render.h \ +## gimpdisplay-scale.c \ +## gimpdisplay-scale.h \ +## gimpdisplay-scroll.c \ +## gimpdisplay-scroll.h \ +## gimpdisplay-selection.c \ +## gimpdisplay-selection.h \ +## gimpdisplay-shell.c \ +## gimpdisplay-shell.h \ +## \ +## gximage.c \ +## gximage.h \ +## marching_ants.h \ +@STRIP_END@ + +AM_CPPFLAGS = @STRIP_BEGIN@ \ + -DG_LOG_DOMAIN=\"Gimp-Display\" \ + @GIMP_THREAD_FLAGS@ \ + @GIMP_MP_FLAGS@ \ +@STRIP_END@ + +INCLUDES = @STRIP_BEGIN@ \ + -I$(top_srcdir) \ + -I$(top_srcdir)/app \ + $(GTK_CFLAGS) \ + -I$(includedir) \ +@STRIP_END@ + +.PHONY: files + +files: + @files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \ + echo $$p; \ + done diff --git a/app/display/display-types.h b/app/display/display-types.h new file mode 100644 index 0000000000..b768d9326d --- /dev/null +++ b/app/display/display-types.h @@ -0,0 +1,38 @@ +/* The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __DISPLAY_TYPES_H__ +#define __DISPLAY_TYPES_H__ + + +#include "gui/gui-types.h" + + +typedef enum /*< skip >*/ +{ + CURSOR_MODE_TOOL_ICON, + CURSOR_MODE_TOOL_CROSSHAIR, + CURSOR_MODE_CROSSHAIR +} CursorMode; + + +typedef struct _GDisplay GDisplay; +typedef struct _Selection Selection; + + +#endif /* __DISPLAY_TYPES_H__ */ diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h index 8348ce8354..f0dccd0509 100644 --- a/app/display/gimpdisplay.h +++ b/app/display/gimpdisplay.h @@ -20,8 +20,9 @@ #define __GDISPLAY_H__ -/* FIXME: don't include gdisplay.h from core/ */ -#include "widgets/widgets-types.h" +/* FIXME: move the display stuff to display/ */ + +#include "display/display-types.h" typedef enum diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 894248f0fe..6f570a08b9 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -22,7 +22,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "display/display-types.h" #include "core/gimpbuffer.h" #include "core/gimpimage.h" @@ -56,6 +56,7 @@ static gint gdisplay_delete (GtkWidget *widget, GdkEvent *event, GDisplay *display); + static GtkTargetEntry display_target_table[] = { GIMP_TARGET_LAYER, @@ -65,8 +66,7 @@ static GtkTargetEntry display_target_table[] = GIMP_TARGET_PATTERN, GIMP_TARGET_BUFFER }; -static guint display_n_targets = (sizeof (display_target_table) / - sizeof (display_target_table[0])); + static void gdisplay_destroy (GtkWidget *widget, @@ -190,7 +190,7 @@ create_display_shell (GDisplay *gdisp, /* dnd stuff */ gtk_drag_dest_set (gdisp->shell, GTK_DEST_DEFAULT_ALL, - display_target_table, display_n_targets, + display_target_table, G_N_ELEMENTS (display_target_table), GDK_ACTION_COPY); gimp_dnd_viewable_dest_set (gdisp->shell, GIMP_TYPE_LAYER, diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 894248f0fe..6f570a08b9 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -22,7 +22,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "display/display-types.h" #include "core/gimpbuffer.h" #include "core/gimpimage.h" @@ -56,6 +56,7 @@ static gint gdisplay_delete (GtkWidget *widget, GdkEvent *event, GDisplay *display); + static GtkTargetEntry display_target_table[] = { GIMP_TARGET_LAYER, @@ -65,8 +66,7 @@ static GtkTargetEntry display_target_table[] = GIMP_TARGET_PATTERN, GIMP_TARGET_BUFFER }; -static guint display_n_targets = (sizeof (display_target_table) / - sizeof (display_target_table[0])); + static void gdisplay_destroy (GtkWidget *widget, @@ -190,7 +190,7 @@ create_display_shell (GDisplay *gdisp, /* dnd stuff */ gtk_drag_dest_set (gdisp->shell, GTK_DEST_DEFAULT_ALL, - display_target_table, display_n_targets, + display_target_table, G_N_ELEMENTS (display_target_table), GDK_ACTION_COPY); gimp_dnd_viewable_dest_set (gdisp->shell, GIMP_TYPE_LAYER, diff --git a/app/file-open.c b/app/file-open.c index 29f672a7e9..0e00981229 100644 --- a/app/file-open.c +++ b/app/file-open.c @@ -33,7 +33,7 @@ #include #endif -#include +#include #ifdef G_OS_WIN32 #include @@ -57,6 +57,8 @@ #define getegid() 0 #endif +#include + #include "core/core-types.h" #include "core/gimpimage.h" diff --git a/app/file-save.c b/app/file-save.c index f27b65569b..991b9a8167 100644 --- a/app/file-save.c +++ b/app/file-save.c @@ -33,7 +33,7 @@ #include #endif -#include +#include #ifdef G_OS_WIN32 #include @@ -57,6 +57,10 @@ #define getegid() 0 #endif +#include + +#include /* EEK */ + #include "core/core-types.h" #include "core/gimp.h" diff --git a/app/file-utils.c b/app/file-utils.c index 0aeec2ef53..1343750dd4 100644 --- a/app/file-utils.c +++ b/app/file-utils.c @@ -33,13 +33,15 @@ #include #endif -#include +#include #ifdef G_OS_WIN32 #include /* For _mkdir() */ #define mkdir(path,mode) _mkdir(path) #endif +#include + #include "libgimpmath/gimpmath.h" #include "core/core-types.h" diff --git a/app/file/file-open.c b/app/file/file-open.c index 29f672a7e9..0e00981229 100644 --- a/app/file/file-open.c +++ b/app/file/file-open.c @@ -33,7 +33,7 @@ #include #endif -#include +#include #ifdef G_OS_WIN32 #include @@ -57,6 +57,8 @@ #define getegid() 0 #endif +#include + #include "core/core-types.h" #include "core/gimpimage.h" diff --git a/app/file/file-save.c b/app/file/file-save.c index f27b65569b..991b9a8167 100644 --- a/app/file/file-save.c +++ b/app/file/file-save.c @@ -33,7 +33,7 @@ #include #endif -#include +#include #ifdef G_OS_WIN32 #include @@ -57,6 +57,10 @@ #define getegid() 0 #endif +#include + +#include /* EEK */ + #include "core/core-types.h" #include "core/gimp.h" diff --git a/app/file/file-utils.c b/app/file/file-utils.c index 0aeec2ef53..1343750dd4 100644 --- a/app/file/file-utils.c +++ b/app/file/file-utils.c @@ -33,13 +33,15 @@ #include #endif -#include +#include #ifdef G_OS_WIN32 #include /* For _mkdir() */ #define mkdir(path,mode) _mkdir(path) #endif +#include + #include "libgimpmath/gimpmath.h" #include "core/core-types.h" diff --git a/app/gdisplay.h b/app/gdisplay.h index 8348ce8354..f0dccd0509 100644 --- a/app/gdisplay.h +++ b/app/gdisplay.h @@ -20,8 +20,9 @@ #define __GDISPLAY_H__ -/* FIXME: don't include gdisplay.h from core/ */ -#include "widgets/widgets-types.h" +/* FIXME: move the display stuff to display/ */ + +#include "display/display-types.h" typedef enum diff --git a/app/gimphelp.c b/app/gimphelp.c index fe5910b27e..299140cc4f 100644 --- a/app/gimphelp.c +++ b/app/gimphelp.c @@ -91,7 +91,7 @@ gimp_help (const gchar *help_path, if (help_data && strlen (help_data)) idle_help->help_data = g_strdup (help_data); - gtk_idle_add ((GtkFunction) gimp_idle_help, (gpointer) idle_help); + g_idle_add (gimp_idle_help, idle_help); } } @@ -99,7 +99,7 @@ gimp_help (const gchar *help_path, /* local functions */ /*********************/ -static gint +static gboolean gimp_idle_help (gpointer data) { GimpIdleHelp *idle_help; diff --git a/app/gimprc.c b/app/gimprc.c index 2d820a31ed..801941f852 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -251,118 +251,64 @@ static GHashTable *parse_func_hash = NULL; static ParseFunc funcs[] = { - { "gamma-correction", TT_DOUBLE, - &(gimprc.gamma_val), NULL }, - { "marching-ants-speed", TT_INT, - &(gimprc.marching_speed), NULL }, - { "last-opened-size", TT_INT, - &(gimprc.last_opened_size), NULL }, - { "transparency-type", TT_INT, - &(gimprc.transparency_type), NULL }, - { "perfect-mouse", TT_BOOLEAN, - &(gimprc.perfectmouse), NULL }, - { "transparency-size", TT_INT, - &(gimprc.transparency_size), NULL }, - { "min-colors", TT_INT, - &(gimprc.min_colors), NULL }, - { "install-colormap", TT_BOOLEAN, - &(gimprc.install_cmap), NULL }, - { "colormap-cycling", TT_BOOLEAN, - &(gimprc.cycled_marching_ants), NULL }, - { "default-threshold", TT_INT, - &(gimprc.default_threshold), NULL }, - { "allow-resize-windows", TT_BOOLEAN, - &(gimprc.allow_resize_windows), NULL }, - { "dont-allow-resize-windows", TT_BOOLEAN, NULL, - &(gimprc.allow_resize_windows) }, - { "cursor-updating", TT_BOOLEAN, NULL, - &(gimprc.no_cursor_updating) }, - { "no-cursor-updating", TT_BOOLEAN, - &(gimprc.no_cursor_updating), NULL }, - { "preview-size", TT_XPREVSIZE, NULL, NULL }, - { "nav-preview-size", TT_XNAVPREVSIZE, NULL, NULL }, - { "show-rulers", TT_BOOLEAN, - &(gimprc.show_rulers), NULL }, - { "dont-show-rulers", TT_BOOLEAN, NULL, - &(gimprc.show_rulers) }, - { "show-statusbar", TT_BOOLEAN, - &(gimprc.show_statusbar), NULL }, - { "dont-show-statusbar", TT_BOOLEAN, NULL, - &(gimprc.show_statusbar) }, - { "auto-save", TT_BOOLEAN, - &(gimprc.auto_save), NULL }, - { "dont-auto-save", TT_BOOLEAN, NULL, - &(gimprc.auto_save) }, - { "confirm-on-close", TT_BOOLEAN, - &(gimprc.confirm_on_close), NULL }, - { "dont-confirm-on-close", TT_BOOLEAN, NULL, - &(gimprc.confirm_on_close) }, - { "save-session-info", TT_BOOLEAN, - &(gimprc.save_session_info), NULL }, - { "dont-save-session-info", TT_BOOLEAN, NULL, - &(gimprc.save_session_info)}, - { "save-device-status", TT_BOOLEAN, - &(gimprc.save_device_status), NULL }, - { "dont-save-device-status", TT_BOOLEAN, NULL, - &(gimprc.save_device_status)}, - { "always-restore-session", TT_BOOLEAN, - &(gimprc.always_restore_session), NULL }, - { "show-tips", TT_BOOLEAN, - &(gimprc.show_tips), NULL }, - { "dont-show-tips", TT_BOOLEAN, NULL, - &(gimprc.show_tips) }, - { "last-tip-shown", TT_INT, - &(gimprc.last_tip), NULL }, - { "show-tool-tips", TT_BOOLEAN, - &(gimprc.show_tool_tips), NULL }, - { "dont-show-tool-tips", TT_BOOLEAN, NULL, - &(gimprc.show_tool_tips) }, - { "default-dot-for-dot", TT_BOOLEAN, - &(gimprc.default_dot_for_dot), NULL }, - { "monitor-xresolution", TT_DOUBLE, - &(gimprc.monitor_xres), NULL }, - { "monitor-yresolution", TT_DOUBLE, - &(gimprc.monitor_yres), NULL }, - { "image-title-format", TT_STRING, - &(gimprc.image_title_format), NULL }, - { "parasite", TT_XPARASITE, NULL, NULL }, - { "global-paint-options", TT_BOOLEAN, - &(gimprc.global_paint_options), NULL }, - { "show-indicators", TT_BOOLEAN, - &(gimprc.show_indicators), NULL }, - { "dont-show-indicators", TT_BOOLEAN, NULL, - &(gimprc.show_indicators) }, - { "no-global-paint-options", TT_BOOLEAN, NULL, - &(gimprc.global_paint_options) }, - { "max-new-image-size", TT_MEMSIZE, - &(gimprc.max_new_image_size), NULL }, - { "trust-dirty-flag", TT_BOOLEAN, - &(gimprc.trust_dirty_flag), NULL }, - { "dont-trust-dirty-flag", TT_BOOLEAN, NULL, - &(gimprc.trust_dirty_flag) }, - { "use-help", TT_BOOLEAN, - &(gimprc.use_help), NULL }, - { "dont-use-help", TT_BOOLEAN, NULL, - &(gimprc.use_help) }, - { "nav-window-per-display", TT_BOOLEAN, - &(gimprc.nav_window_per_display), NULL }, - { "nav-window-follows-auto", TT_BOOLEAN, NULL, - &(gimprc.nav_window_per_display) }, - { "info-window-follows-mouse", TT_BOOLEAN, - &(gimprc.info_window_follows_mouse), NULL }, - { "info-window-per-display", TT_BOOLEAN, NULL, - &(gimprc.info_window_follows_mouse) }, - { "help-browser", TT_XHELPBROWSER, - &(gimprc.help_browser), NULL }, - { "cursor-mode", TT_XCURSORMODE, - &(gimprc.cursor_mode), NULL }, - { "disable-tearoff-menus", TT_BOOLEAN, - &(gimprc.disable_tearoff_menus), NULL }, - { "theme-path", TT_PATH, - &(gimprc.theme_path), NULL }, - { "theme", TT_STRING, - &(gimprc.theme), NULL }, + { "gamma-correction", TT_DOUBLE, &gimprc.gamma_val, NULL }, + { "marching-ants-speed", TT_INT, &gimprc.marching_speed, NULL }, + { "last-opened-size", TT_INT, &gimprc.last_opened_size, NULL }, + { "transparency-type", TT_INT, &gimprc.transparency_type, NULL }, + { "perfect-mouse", TT_BOOLEAN, &gimprc.perfectmouse, NULL }, + { "transparency-size", TT_INT, &gimprc.transparency_size, NULL }, + { "min-colors", TT_INT, &gimprc.min_colors, NULL }, + { "install-colormap", TT_BOOLEAN, &gimprc.install_cmap, NULL }, + { "colormap-cycling", TT_BOOLEAN, &gimprc.cycled_marching_ants, NULL }, + { "default-threshold", TT_INT, &gimprc.default_threshold, NULL }, + { "allow-resize-windows", TT_BOOLEAN, &gimprc.allow_resize_windows, NULL }, + { "dont-allow-resize-windows", TT_BOOLEAN, NULL, &gimprc.allow_resize_windows }, + { "cursor-updating", TT_BOOLEAN, NULL, &gimprc.no_cursor_updating }, + { "no-cursor-updating", TT_BOOLEAN, &gimprc.no_cursor_updating, NULL }, + { "preview-size", TT_XPREVSIZE, &gimprc.preview_size, NULL }, + { "nav-preview-size", TT_XNAVPREVSIZE, &gimprc.nav_preview_size, NULL }, + { "show-rulers", TT_BOOLEAN, &gimprc.show_rulers, NULL }, + { "dont-show-rulers", TT_BOOLEAN, NULL, &gimprc.show_rulers }, + { "show-statusbar", TT_BOOLEAN, &gimprc.show_statusbar, NULL }, + { "dont-show-statusbar", TT_BOOLEAN, NULL, &gimprc.show_statusbar }, + { "auto-save", TT_BOOLEAN, &gimprc.auto_save, NULL }, + { "dont-auto-save", TT_BOOLEAN, NULL, &gimprc.auto_save }, + { "confirm-on-close", TT_BOOLEAN, &gimprc.confirm_on_close, NULL }, + { "dont-confirm-on-close", TT_BOOLEAN, NULL, &gimprc.confirm_on_close }, + { "save-session-info", TT_BOOLEAN, &gimprc.save_session_info, NULL }, + { "dont-save-session-info", TT_BOOLEAN, NULL, &gimprc.save_session_info }, + { "save-device-status", TT_BOOLEAN, &gimprc.save_device_status, NULL }, + { "dont-save-device-status", TT_BOOLEAN, NULL, &gimprc.save_device_status }, + { "always-restore-session", TT_BOOLEAN, &gimprc.always_restore_session , NULL }, + { "show-tips", TT_BOOLEAN, &gimprc.show_tips, NULL }, + { "dont-show-tips", TT_BOOLEAN, NULL, &gimprc.show_tips }, + { "last-tip-shown", TT_INT, &gimprc.last_tip, NULL }, + { "show-tool-tips", TT_BOOLEAN, &gimprc.show_tool_tips, NULL }, + { "dont-show-tool-tips", TT_BOOLEAN, NULL, &gimprc.show_tool_tips }, + { "default-dot-for-dot", TT_BOOLEAN, &gimprc.default_dot_for_dot, NULL }, + { "monitor-xresolution", TT_DOUBLE, &gimprc.monitor_xres, NULL }, + { "monitor-yresolution", TT_DOUBLE, &gimprc.monitor_yres, NULL }, + { "image-title-format", TT_STRING, &gimprc.image_title_format, NULL }, + { "global-paint-options", TT_BOOLEAN, &gimprc.global_paint_options, NULL }, + { "show-indicators", TT_BOOLEAN, &gimprc.show_indicators, NULL }, + { "dont-show-indicators", TT_BOOLEAN, NULL, &gimprc.show_indicators }, + { "no-global-paint-options", TT_BOOLEAN, NULL, &gimprc.global_paint_options }, + { "max-new-image-size", TT_MEMSIZE, &gimprc.max_new_image_size, NULL }, + { "trust-dirty-flag", TT_BOOLEAN, &gimprc.trust_dirty_flag, NULL }, + { "dont-trust-dirty-flag", TT_BOOLEAN, NULL, &gimprc.trust_dirty_flag }, + { "use-help", TT_BOOLEAN, &gimprc.use_help, NULL }, + { "dont-use-help", TT_BOOLEAN, NULL, &gimprc.use_help }, + { "nav-window-per-display", TT_BOOLEAN, &gimprc.nav_window_per_display, NULL }, + { "nav-window-follows-auto", TT_BOOLEAN, NULL, &gimprc.nav_window_per_display }, + { "info-window-follows-mouse", TT_BOOLEAN, &gimprc.info_window_follows_mouse, NULL }, + { "info-window-per-display", TT_BOOLEAN, NULL, &gimprc.info_window_follows_mouse }, + { "help-browser", TT_XHELPBROWSER, &gimprc.help_browser, NULL }, + { "cursor-mode", TT_XCURSORMODE, &gimprc.cursor_mode, NULL }, + { "disable-tearoff-menus", TT_BOOLEAN, &gimprc.disable_tearoff_menus, NULL }, + { "theme-path", TT_PATH, &gimprc.theme_path, NULL }, + { "theme", TT_STRING, &gimprc.theme, NULL }, + { "parasite", TT_XPARASITE, NULL, NULL }, { "plug-in", TT_XPLUGIN, NULL, NULL }, { "plug-in-def", TT_XPLUGINDEF, NULL, NULL }, { "menu-path", TT_XMENUPATH, NULL, NULL }, @@ -1369,22 +1315,22 @@ parse_preview_size (gpointer val1p, if (token == TOKEN_SYMBOL) { if (strcmp (token_sym, "none") == 0) - gimprc.preview_size = 0; + *((gint *) val1p) = 0; else if (strcmp (token_sym, "tiny") == 0) - gimprc.preview_size = 24; + *((gint *) val1p) = 24; else if (strcmp (token_sym, "small") == 0) - gimprc.preview_size = 32; + *((gint *) val1p) = 32; else if (strcmp (token_sym, "medium") == 0) - gimprc.preview_size = 48; + *((gint *) val1p) = 48; else if (strcmp (token_sym, "large") == 0) - gimprc.preview_size = 64; + *((gint *) val1p) = 64; else if (strcmp (token_sym, "huge") == 0) - gimprc.preview_size = 128; + *((gint *) val1p) = 128; else - gimprc.preview_size = 0; + *((gint *) val1p) = 0; } else if (token == TOKEN_NUMBER) - gimprc.preview_size = token_num; + *((gint *) val1p) = token_num; token = peek_next_token (); if (!token || (token != TOKEN_RIGHT_PAREN)) @@ -1407,20 +1353,19 @@ parse_nav_preview_size (gpointer val1p, if (token == TOKEN_SYMBOL) { -/* if (strcmp (token_sym, "none") == 0) */ -/* preview_size = 0; */ -/* else */ - if (strcmp (token_sym, "small") == 0) - gimprc.nav_preview_size = 48; + if (strcmp (token_sym, "none") == 0) + *((gint *) val1p) = 0; + else if (strcmp (token_sym, "small") == 0) + *((gint *) val1p) = 48; else if (strcmp (token_sym, "medium") == 0) - gimprc.nav_preview_size = 80; + *((gint *) val1p) = 80; else if (strcmp (token_sym, "large") == 0) - gimprc.nav_preview_size = 112; + *((gint *) val1p) = 112; else - gimprc.nav_preview_size = 112; + *((gint *) val1p) = 0; } else if (token == TOKEN_NUMBER) - gimprc.nav_preview_size = token_num; + *((gint *) val1p) = token_num; token = peek_next_token (); if (!token || (token != TOKEN_RIGHT_PAREN)) @@ -2779,9 +2724,9 @@ parse_help_browser (gpointer val1p, token = get_next_token (); if (strcmp (token_sym, "gimp") == 0) - gimprc.help_browser = HELP_BROWSER_GIMP; + *((gint *) val1p) = HELP_BROWSER_GIMP; else if (strcmp (token_sym, "netscape") == 0) - gimprc.help_browser = HELP_BROWSER_NETSCAPE; + *((gint *) val1p) = HELP_BROWSER_NETSCAPE; token = peek_next_token (); if (!token || (token != TOKEN_RIGHT_PAREN)) @@ -2803,11 +2748,11 @@ parse_cursor_mode (gpointer val1p, token = get_next_token (); if (strcmp (token_sym, "tool-icon") == 0) - gimprc.cursor_mode = CURSOR_MODE_TOOL_ICON; + *((CursorMode *) val1p) = CURSOR_MODE_TOOL_ICON; else if (strcmp (token_sym, "tool-crosshair") == 0) - gimprc.cursor_mode = CURSOR_MODE_TOOL_CROSSHAIR; + *((CursorMode *) val1p) = CURSOR_MODE_TOOL_CROSSHAIR; else if (strcmp (token_sym, "crosshair") == 0) - gimprc.cursor_mode = CURSOR_MODE_CROSSHAIR; + *((CursorMode *) val1p) = CURSOR_MODE_CROSSHAIR; token = peek_next_token (); if (!token || (token != TOKEN_RIGHT_PAREN)) @@ -3089,15 +3034,19 @@ static inline gchar * preview_size_to_str (gpointer val1p, gpointer val2p) { - if (gimprc.preview_size >= 128) + gint size; + + size = *((gint *) val1p); + + if (size >= 128) return g_strdup ("huge"); - else if (gimprc.preview_size >= 64) + else if (size >= 64) return g_strdup ("large"); - else if (gimprc.preview_size >= 48) + else if (size >= 48) return g_strdup ("medium"); - else if (gimprc.preview_size >= 32) + else if (size >= 32) return g_strdup ("small"); - else if (gimprc.preview_size >= 24) + else if (size >= 24) return g_strdup ("tiny"); else return g_strdup ("none"); @@ -3107,14 +3056,18 @@ static inline gchar * nav_preview_size_to_str (gpointer val1p, gpointer val2p) { - if (gimprc.nav_preview_size >= 112) + gint size; + + size = *((gint *) val1p); + + if (size >= 112) return g_strdup ("large"); - else if (gimprc.nav_preview_size >= 80) + else if (size >= 80) return g_strdup ("medium"); - else if (gimprc.nav_preview_size >= 48) + else if (size >= 48) return g_strdup ("small"); else - return g_strdup ("large"); + return g_strdup ("none"); } @@ -3122,14 +3075,18 @@ static inline gchar * units_to_str (gpointer val1p, gpointer val2p) { - return g_strdup (gimp_unit_get_identifier (*((GimpUnit*)val1p))); + return g_strdup (gimp_unit_get_identifier (*((GimpUnit *) val1p))); } static inline gchar * help_browser_to_str (gpointer val1p, gpointer val2p) { - if (gimprc.help_browser == HELP_BROWSER_NETSCAPE) + gint browser; + + browser = *((gint *) val1p); + + if (browser == HELP_BROWSER_NETSCAPE) return g_strdup ("netscape"); else return g_strdup ("gimp"); @@ -3139,9 +3096,13 @@ static inline gchar * cursor_mode_to_str (gpointer val1p, gpointer val2p) { - if (gimprc.cursor_mode == CURSOR_MODE_TOOL_ICON) + CursorMode mode; + + mode = *((CursorMode *) val1p); + + if (mode == CURSOR_MODE_TOOL_ICON) return g_strdup ("tool-icon"); - else if (gimprc.cursor_mode == CURSOR_MODE_TOOL_CROSSHAIR) + else if (mode == CURSOR_MODE_TOOL_CROSSHAIR) return g_strdup ("tool-crosshair"); else return g_strdup ("crosshair"); diff --git a/app/gui/Makefile.am b/app/gui/Makefile.am index 7462f3e782..c6533f6c92 100644 --- a/app/gui/Makefile.am +++ b/app/gui/Makefile.am @@ -56,6 +56,7 @@ libappgui_a_SOURCES = @STRIP_BEGIN@ \ gradients-commands.h \ gui.c \ gui.h \ + gui-types.h \ image-commands.c \ image-commands.h \ indicator-area.c \ diff --git a/app/gui/color-area.c b/app/gui/color-area.c index 1e7de2ad67..b590ea9ddd 100644 --- a/app/gui/color-area.c +++ b/app/gui/color-area.c @@ -29,7 +29,7 @@ #include "libgimpcolor/gimpcolor.h" -#include "core/core-types.h" +#include "gui-types.h" #include "core/gimp.h" #include "core/gimpcontext.h" diff --git a/app/gui/color-notebook.c b/app/gui/color-notebook.c index fb53584286..724a8590f7 100644 --- a/app/gui/color-notebook.c +++ b/app/gui/color-notebook.c @@ -32,7 +32,7 @@ #include "libgimpwidgets/gimpwidgets.h" #include "libgimp/gimpcolorselector.h" -#include "apptypes.h" +#include "gui-types.h" #include "color-area.h" #include "color-notebook.h" diff --git a/app/gui/colormap-dialog.c b/app/gui/colormap-dialog.c index c8f8c3e0bd..52335313d4 100644 --- a/app/gui/colormap-dialog.c +++ b/app/gui/colormap-dialog.c @@ -29,7 +29,7 @@ #include "libgimpmath/gimpmath.h" #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "gui-types.h" #include "core/gimpcontainer.h" #include "core/gimpimage.h" @@ -42,7 +42,6 @@ #include "colormaps.h" #include "image_render.h" -#include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/gui/dialogs-commands.c b/app/gui/dialogs-commands.c index 3ceccab816..fa8e8758c6 100644 --- a/app/gui/dialogs-commands.c +++ b/app/gui/dialogs-commands.c @@ -20,8 +20,7 @@ #include -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "widgets/gimpdialogfactory.h" #include "widgets/gimpdockable.h" diff --git a/app/gui/dialogs-constructors.c b/app/gui/dialogs-constructors.c index ff5bc71d66..d612d974ab 100644 --- a/app/gui/dialogs-constructors.c +++ b/app/gui/dialogs-constructors.c @@ -23,7 +23,7 @@ #include "libgimpcolor/gimpcolor.h" #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" +#include "gui-types.h" #include "tools/tools-types.h" #include "core/gimp.h" @@ -78,7 +78,6 @@ #include "app_procs.h" #include "devices.h" #include "docindex.h" -#include "gdisplay.h" #include "gimprc.h" #include "module_db.h" #include "undo_history.h" @@ -238,17 +237,14 @@ GtkWidget * dialogs_undo_history_get (GimpDialogFactory *factory, GimpContext *context) { - GDisplay *gdisp; GimpImage *gimage; GtkWidget *undo_history; - gdisp = gimp_context_get_display (context); + gimage = gimp_context_get_image (context); - if (! gdisp) + if (! gimage) return NULL; - gimage = gdisp->gimage; - undo_history = g_object_get_data (G_OBJECT (gimage), "undo-history"); if (! undo_history) diff --git a/app/gui/error-console-dialog.c b/app/gui/error-console-dialog.c index 3cae45100b..0499fcfbed 100644 --- a/app/gui/error-console-dialog.c +++ b/app/gui/error-console-dialog.c @@ -27,9 +27,6 @@ #include #include #include -#ifdef HAVE_DIRENT_H -#include -#endif #ifdef HAVE_UNISTD_H #include #endif @@ -51,7 +48,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" +#include "gui-types.h" #include "appenv.h" diff --git a/app/gui/gradient-editor.c b/app/gui/gradient-editor.c index f453a6490c..862f364b53 100644 --- a/app/gui/gradient-editor.c +++ b/app/gui/gradient-editor.c @@ -62,7 +62,7 @@ #include "libgimpbase/gimpbase.h" #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "gui-types.h" #include "core/gimp.h" #include "core/gimpcontainer.h" diff --git a/app/gui/gradient-select.c b/app/gui/gradient-select.c index 14ca89b7c4..fc28815e0d 100644 --- a/app/gui/gradient-select.c +++ b/app/gui/gradient-select.c @@ -25,8 +25,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "core/gimp.h" #include "core/gimpcontainer.h" diff --git a/app/gui/gui-types.h b/app/gui/gui-types.h new file mode 100644 index 0000000000..3b15a9333b --- /dev/null +++ b/app/gui/gui-types.h @@ -0,0 +1,32 @@ +/* The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __GUI_TYPES_H__ +#define __GUI_TYPES_H__ + + +#include "widgets/widgets-types.h" +#include "display/display-types.h" + + +typedef struct _ColorNotebook ColorNotebook; +typedef struct _InfoDialog InfoDialog; +typedef struct _NavigationDialog NavigationDialog; + + +#endif /* __GUI_TYPES_H__ */ diff --git a/app/gui/indicator-area.c b/app/gui/indicator-area.c index f3ca602b8d..d1cc3b8329 100644 --- a/app/gui/indicator-area.c +++ b/app/gui/indicator-area.c @@ -25,8 +25,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "core/gimpbrush.h" #include "core/gimpcontext.h" diff --git a/app/gui/info-dialog.c b/app/gui/info-dialog.c index 6e64ddd6e8..a61bd85101 100644 --- a/app/gui/info-dialog.c +++ b/app/gui/info-dialog.c @@ -24,7 +24,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "gui-types.h" #include "info-dialog.h" diff --git a/app/gui/palette-editor.c b/app/gui/palette-editor.c index 7828a61648..d4f9ae1115 100644 --- a/app/gui/palette-editor.c +++ b/app/gui/palette-editor.c @@ -24,8 +24,7 @@ #include "libgimpbase/gimpbase.h" #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "core/gimp.h" #include "core/gimpcontainer.h" diff --git a/app/gui/palette-select.c b/app/gui/palette-select.c index 42fb78bfb6..8374e9b2f9 100644 --- a/app/gui/palette-select.c +++ b/app/gui/palette-select.c @@ -25,8 +25,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "core/gimp.h" #include "core/gimpcontainer.h" diff --git a/app/gui/pattern-select.c b/app/gui/pattern-select.c index fa7993b81a..81b53fb109 100644 --- a/app/gui/pattern-select.c +++ b/app/gui/pattern-select.c @@ -24,8 +24,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "base/temp-buf.h" diff --git a/app/gui/session.c b/app/gui/session.c index ca0dec630c..6bb8659d05 100644 --- a/app/gui/session.c +++ b/app/gui/session.c @@ -39,18 +39,13 @@ #include "config.h" -#include #include -#ifdef HAVE_UNISTD_H -#include -#endif #include #include "libgimpbase/gimpbase.h" -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "widgets/gimpdialogfactory.h" diff --git a/app/gui/splash.c b/app/gui/splash.c index cf1585c8ba..f91348e509 100644 --- a/app/gui/splash.c +++ b/app/gui/splash.c @@ -26,10 +26,11 @@ #include "libgimpbase/gimpbase.h" #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" +#include "gui-types.h" + +#include "splash.h" #include "appenv.h" -#include "splash.h" #include "libgimp/gimpintl.h" diff --git a/app/gui/view-commands.c b/app/gui/view-commands.c index d04b30d03d..be51306a33 100644 --- a/app/gui/view-commands.c +++ b/app/gui/view-commands.c @@ -22,7 +22,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "gui-types.h" #include "core/gimpimage.h" diff --git a/app/image_map.c b/app/image_map.c index 755bf441ed..56d8d05e7b 100644 --- a/app/image_map.c +++ b/app/image_map.c @@ -35,81 +35,34 @@ #include "image_map.h" -#define WAITING 0 -#define WORKING 1 +typedef enum +{ + IMAGE_MAP_WAITING, + IMAGE_MAP_WORKING +} ImageMapState; -#define WORK_DELAY 1 struct _ImageMap { - GDisplay *gdisp; - GimpDrawable *drawable; - TileManager *undo_tiles; - ImageMapApplyFunc apply_func; - gpointer user_data; - PixelRegion srcPR, destPR; - void *pr; - gint state; - gint idle; + GDisplay *gdisp; + GimpDrawable *drawable; + TileManager *undo_tiles; + ImageMapApplyFunc apply_func; + gpointer user_data; + PixelRegion srcPR; + PixelRegion destPR; + PixelRegionIterator *PRI; + ImageMapState state; + guint idle_id; }; -/**************************/ -/* Function definitions */ +/* local function prototypes */ -static gint -image_map_do (gpointer data) -{ - ImageMap *image_map; - GimpImage *gimage; - PixelRegion shadowPR; - gint x, y, w, h; +static gboolean image_map_do (gpointer data); - image_map = (ImageMap *) data; - if (! (gimage = gimp_drawable_gimage (image_map->drawable))) - { - image_map->state = WAITING; - - return FALSE; - } - - /* Process the pixel regions and apply the image mapping */ - (* image_map->apply_func) (&image_map->srcPR, - &image_map->destPR, - image_map->user_data); - - x = image_map->destPR.x; - y = image_map->destPR.y; - w = image_map->destPR.w; - h = image_map->destPR.h; - - /* apply the results */ - pixel_region_init (&shadowPR, gimage->shadow, x, y, w, h, FALSE); - gimp_image_apply_image (gimage, image_map->drawable, &shadowPR, - FALSE, OPAQUE_OPACITY, REPLACE_MODE, NULL, x, y); - - /* display the results */ - if (image_map->gdisp) - { - gimp_drawable_update (image_map->drawable, - x, y, - w, h); - gdisplay_flush_now (image_map->gdisp); - } - - image_map->pr = pixel_regions_process (image_map->pr); - - if (image_map->pr == NULL) - { - image_map->state = WAITING; - gdisplays_flush (); - - return FALSE; - } - - return TRUE; -} +/* public functions */ ImageMap * image_map_create (GDisplay *gdisp, @@ -118,7 +71,6 @@ image_map_create (GDisplay *gdisp, ImageMap *image_map; g_return_val_if_fail (gdisp != NULL, NULL); - g_return_val_if_fail (drawable != NULL, NULL); g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL); image_map = g_new0 (ImageMap, 1); @@ -126,7 +78,10 @@ image_map_create (GDisplay *gdisp, image_map->gdisp = gdisp; image_map->drawable = drawable; image_map->undo_tiles = NULL; - image_map->state = WAITING; + image_map->apply_func = NULL; + image_map->user_data = NULL; + image_map->state = IMAGE_MAP_WAITING; + image_map->idle_id = 0; /* Interactive tools based on image_map disable the undo stack * to avert any unintented undo interaction through the UI @@ -154,12 +109,13 @@ image_map_apply (ImageMap *image_map, image_map->user_data = apply_data; /* If we're still working, remove the timer */ - if (image_map->state == WORKING) + if (image_map->state == IMAGE_MAP_WORKING) { - gtk_idle_remove (image_map->idle); - pixel_regions_process_stop (image_map->pr); + g_source_remove (image_map->idle_id); + image_map->idle_id = 0; - image_map->pr = NULL; + pixel_regions_process_stop (image_map->PRI); + image_map->PRI = NULL; } /* Make sure the drawable is still valid */ @@ -236,11 +192,13 @@ image_map_apply (ImageMap *image_map, x1, y1, (x2 - x1), (y2 - y1), TRUE); /* Apply the image transformation to the pixels */ - image_map->pr = pixel_regions_register (2, &image_map->srcPR, &image_map->destPR); + image_map->PRI = pixel_regions_register (2, + &image_map->srcPR, + &image_map->destPR); /* Start the intermittant work procedure */ - image_map->state = WORKING; - image_map->idle = gtk_idle_add (image_map_do, image_map); + image_map->state = IMAGE_MAP_WORKING; + image_map->idle_id = g_idle_add (image_map_do, image_map); } void @@ -250,12 +208,13 @@ image_map_commit (ImageMap *image_map) g_return_if_fail (image_map != NULL); - if (image_map->state == WORKING) + if (image_map->state == IMAGE_MAP_WORKING) { - gtk_idle_remove (image_map->idle); + g_source_remove (image_map->idle_id); + image_map->idle_id = 0; /* Finish the changes */ - while (image_map_do (image_map)) ; + while (image_map_do (image_map)); } /* Make sure the drawable is still valid */ @@ -287,14 +246,16 @@ image_map_clear (ImageMap *image_map) g_return_if_fail (image_map != NULL); - if (image_map->state == WORKING) + if (image_map->state == IMAGE_MAP_WORKING) { - gtk_idle_remove (image_map->idle); - pixel_regions_process_stop (image_map->pr); - image_map->pr = NULL; + g_source_remove (image_map->idle_id); + image_map->idle_id = 0; + + pixel_regions_process_stop (image_map->PRI); + image_map->PRI = NULL; } - image_map->state = WAITING; + image_map->state = IMAGE_MAP_WAITING; /* Make sure the drawable is still valid */ if (! gimp_drawable_gimage (image_map->drawable)) @@ -412,3 +373,60 @@ image_map_get_color_at (ImageMap *image_map, return NULL; } } + + +/* private functions */ + +static gboolean +image_map_do (gpointer data) +{ + ImageMap *image_map; + GimpImage *gimage; + PixelRegion shadowPR; + gint x, y, w, h; + + image_map = (ImageMap *) data; + + if (! (gimage = gimp_drawable_gimage (image_map->drawable))) + { + image_map->state = IMAGE_MAP_WAITING; + + return FALSE; + } + + /* Process the pixel regions and apply the image mapping */ + (* image_map->apply_func) (&image_map->srcPR, + &image_map->destPR, + image_map->user_data); + + x = image_map->destPR.x; + y = image_map->destPR.y; + w = image_map->destPR.w; + h = image_map->destPR.h; + + /* apply the results */ + pixel_region_init (&shadowPR, gimage->shadow, x, y, w, h, FALSE); + gimp_image_apply_image (gimage, image_map->drawable, &shadowPR, + FALSE, OPAQUE_OPACITY, REPLACE_MODE, NULL, x, y); + + /* display the results */ + if (image_map->gdisp) + { + gimp_drawable_update (image_map->drawable, + x, y, + w, h); + gdisplay_flush_now (image_map->gdisp); + } + + image_map->PRI = pixel_regions_process (image_map->PRI); + + if (image_map->PRI == NULL) + { + image_map->state = IMAGE_MAP_WAITING; + gdisplays_flush (); + + return FALSE; + } + + return TRUE; +} diff --git a/app/image_map.h b/app/image_map.h index 8c882cf277..a5ae11b835 100644 --- a/app/image_map.h +++ b/app/image_map.h @@ -20,12 +20,19 @@ #define __IMAGE_MAP_H__ +typedef void (* ImageMapApplyFunc) (PixelRegion *srcPR, + PixelRegion *destPR, + gpointer data); + + /* Image Map functions */ /* Successive image map apply functions can be called, but eventually - * MUST be followed with an image_map_commit or an image_map_abort call - * The image map is no longer valid after a call to commit or abort. + * MUST be followed with an image_map_commit or an image_map_abort call + * The image map is no longer valid after a call to commit or abort. */ + + ImageMap * image_map_create (GDisplay *gdisp, GimpDrawable *drawable); void image_map_apply (ImageMap *image_map, diff --git a/app/interface.c b/app/interface.c index 894248f0fe..6f570a08b9 100644 --- a/app/interface.c +++ b/app/interface.c @@ -22,7 +22,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "display/display-types.h" #include "core/gimpbuffer.h" #include "core/gimpimage.h" @@ -56,6 +56,7 @@ static gint gdisplay_delete (GtkWidget *widget, GdkEvent *event, GDisplay *display); + static GtkTargetEntry display_target_table[] = { GIMP_TARGET_LAYER, @@ -65,8 +66,7 @@ static GtkTargetEntry display_target_table[] = GIMP_TARGET_PATTERN, GIMP_TARGET_BUFFER }; -static guint display_n_targets = (sizeof (display_target_table) / - sizeof (display_target_table[0])); + static void gdisplay_destroy (GtkWidget *widget, @@ -190,7 +190,7 @@ create_display_shell (GDisplay *gdisp, /* dnd stuff */ gtk_drag_dest_set (gdisp->shell, GTK_DEST_DEFAULT_ALL, - display_target_table, display_n_targets, + display_target_table, G_N_ELEMENTS (display_target_table), GDK_ACTION_COPY); gimp_dnd_viewable_dest_set (gdisp->shell, GIMP_TYPE_LAYER, diff --git a/app/main.c b/app/main.c index 954bd3901d..43a229ff0b 100644 --- a/app/main.c +++ b/app/main.c @@ -52,8 +52,8 @@ #ifdef G_OS_WIN32 #include #else -static void gimp_sigfatal_handler (gint sig_num); -static void gimp_sigchld_handler (gint sig_num); +static void gimp_sigfatal_handler (gint sig_num); +static void gimp_sigchld_handler (gint sig_num); #endif diff --git a/app/paint/gimpink-blob.c b/app/paint/gimpink-blob.c index 04e4bf030b..b4c851c535 100644 --- a/app/paint/gimpink-blob.c +++ b/app/paint/gimpink-blob.c @@ -31,35 +31,40 @@ #include "libgimpmath/gimpmath.h" -#include "apptypes.h" +#include "tools-types.h" #include "gimpinktool-blob.h" +typedef enum +{ + EDGE_NONE = 0, + EDGE_LEFT = 1 << 0, + EDGE_RIGHT = 1 << 1 +} EdgeType; + + static Blob * -blob_new (int y, int height) +blob_new (gint y, + gint height) { Blob *result; - result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * (height-1)); - result->y = y; + result = g_malloc (sizeof (Blob) + sizeof (BlobSpan) * (height - 1)); + + result->y = y; result->height = height; return result; } -typedef enum { - EDGE_NONE = 0, - EDGE_LEFT = 1 << 0, - EDGE_RIGHT = 1 << 1 -} EdgeType; - static void -blob_fill (Blob *b, EdgeType *present) +blob_fill (Blob *b, + EdgeType *present) { - int start; - int x1, x2, i1, i2; - int i; + gint start; + gint x1, x2, i1, i2; + gint i; /* Mark empty lines at top and bottom as unused */ @@ -109,11 +114,11 @@ blob_fill (Blob *b, EdgeType *present) /* Find empty gaps */ if (!(present[i1+1] & EDGE_LEFT)) { - int increment; /* fractional part */ - int denom; /* denominator of fraction */ - int step; /* integral step */ - int frac; /* fractional step */ - int reverse; + gint increment; /* fractional part */ + gint denom; /* denominator of fraction */ + gint step; /* integral step */ + gint frac; /* fractional step */ + gint reverse; /* find bottom of gap */ i2 = i1+2; diff --git a/app/path.c b/app/path.c index f73d60984b..5c8e403895 100644 --- a/app/path.c +++ b/app/path.c @@ -166,7 +166,7 @@ path_distance (Path *bzp, return ret; } -Tattoo +GimpTattoo path_get_tattoo (Path* p) { if (!p) @@ -179,8 +179,8 @@ path_get_tattoo (Path* p) } Path* -path_get_path_by_tattoo (GimpImage *gimage, - Tattoo tattoo) +path_get_path_by_tattoo (GimpImage *gimage, + GimpTattoo tattoo) { GSList *tlist; PathList *plp; diff --git a/app/path.h b/app/path.h index 89cbec8c2f..1a3a17f89b 100644 --- a/app/path.h +++ b/app/path.h @@ -23,7 +23,7 @@ struct _PathList { GimpImage *gimage; - GDisplay *gdisp; /* This is a hack.. Needed so we can get back to + gpointer gdisp; /* This is a hack.. Needed so we can get back to * the same display that these curves were added * too. That way when an entry in the paths dialog * is clicked the bezier tool can be targeted at @@ -42,30 +42,30 @@ typedef enum BEZIER = 1 } PathType; -Path* path_new (GimpImage *gimage, - PathType ptype, - GSList *path_details, - gint closed, - gint state, - gint locked, - gint tattoo, - gchar *name); -Path* path_copy (GimpImage *gimage, - Path *path); -void path_free (Path *path); +Path* path_new (GimpImage *gimage, + PathType ptype, + GSList *path_details, + gint closed, + gint state, + gint locked, + gint tattoo, + gchar *name); +Path* path_copy (GimpImage *gimage, + Path *path); +void path_free (Path *path); -Tattoo path_get_tattoo (Path *path); -Path* path_get_path_by_tattoo (GimpImage *gimage, - Tattoo tattoo); +GimpTattoo path_get_tattoo (Path *path); +Path* path_get_path_by_tattoo (GimpImage *gimage, + GimpTattoo tattoo); -void path_stroke (GimpImage *gimage, - PathList *pl, - Path *bzp); -gint path_distance (Path *bzp, - gdouble dist, - gint *x, - gint *y, - gdouble *grad); +void path_stroke (GimpImage *gimage, + PathList *pl, + Path *bzp); +gint path_distance (Path *bzp, + gdouble dist, + gint *x, + gint *y, + gdouble *grad); PathPoint* path_point_new (guint type, gdouble x, diff --git a/app/pathP.h b/app/pathP.h index 06bedbc5bc..a575b9f277 100644 --- a/app/pathP.h +++ b/app/pathP.h @@ -28,13 +28,13 @@ struct _PathPoint struct _Path { - GSList *path_details; - gint pathtype; /* Only beziers to start with */ - gboolean closed; - guint32 state; - guint32 locked; /* Only bottom bit used */ - Tattoo tattoo; /* The tattoo for the path */ - gchar *name; + GSList *path_details; + gint pathtype; /* Only beziers to start with */ + gboolean closed; + guint32 state; + guint32 locked; /* Only bottom bit used */ + GimpTattoo tattoo; /* The tattoo for the path */ + gchar *name; }; gboolean path_set_path (GimpImage *gimage, diff --git a/app/pdb/Makefile.am b/app/pdb/Makefile.am index 54fac0684f..001e99df17 100644 --- a/app/pdb/Makefile.am +++ b/app/pdb/Makefile.am @@ -3,7 +3,6 @@ noinst_LIBRARIES = libapppdb.a libapppdb_a_SOURCES = @STRIP_BEGIN@ \ - pdb_glue.h \ internal_procs.c \ internal_procs.h \ procedural_db.c \ @@ -32,6 +31,8 @@ libapppdb_a_SOURCES = @STRIP_BEGIN@ \ paths_cmds.c \ pattern_select_cmds.c \ patterns_cmds.c \ + pdb_glue.h \ + pdb-types.h \ plug_in_cmds.c \ procedural_db_cmds.c \ selection_cmds.c \ diff --git a/app/pdb/brush_select_cmds.c b/app/pdb/brush_select_cmds.c index 71c1c386ff..cdb564b545 100644 --- a/app/pdb/brush_select_cmds.c +++ b/app/pdb/brush_select_cmds.c @@ -26,7 +26,7 @@ #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "widgets/widgets-types.h" #include "procedural_db.h" diff --git a/app/pdb/brushes_cmds.c b/app/pdb/brushes_cmds.c index 1f08e7b124..8376513e47 100644 --- a/app/pdb/brushes_cmds.c +++ b/app/pdb/brushes_cmds.c @@ -22,11 +22,11 @@ #include -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "base/base-types.h" diff --git a/app/pdb/channel_cmds.c b/app/pdb/channel_cmds.c index 73f14cdf62..b4dc0f01dc 100644 --- a/app/pdb/channel_cmds.c +++ b/app/pdb/channel_cmds.c @@ -21,14 +21,14 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" -#include "appenums.h" +#include "core/core-types.h" #include "core/gimpchannel.h" #include "core/gimpimage.h" #include "pdb_glue.h" @@ -255,7 +255,14 @@ channel_delete_invoker (Gimp *gimp, success = FALSE; if (success) - gtk_object_sink (GTK_OBJECT (channel)); + { + if (! gimp_drawable_gimage (GIMP_DRAWABLE (channel))) + { + g_object_unref (G_OBJECT (channel)); + success = TRUE; + } + + } return procedural_db_return_args (&channel_delete_proc, success); } diff --git a/app/pdb/color_cmds.c b/app/pdb/color_cmds.c index fb67bd61be..d5fca8d64b 100644 --- a/app/pdb/color_cmds.c +++ b/app/pdb/color_cmds.c @@ -25,7 +25,7 @@ #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "tools/tools-types.h" #include "procedural_db.h" diff --git a/app/pdb/convert_cmds.c b/app/pdb/convert_cmds.c index 68000b7936..a0bbdece8a 100644 --- a/app/pdb/convert_cmds.c +++ b/app/pdb/convert_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "core/gimp.h" diff --git a/app/pdb/display_cmds.c b/app/pdb/display_cmds.c index 2b72916fb2..de9c1674bb 100644 --- a/app/pdb/display_cmds.c +++ b/app/pdb/display_cmds.c @@ -25,7 +25,8 @@ #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" +#include "display/display-types.h" #include "procedural_db.h" #include "core/gimpimage.h" diff --git a/app/pdb/drawable_cmds.c b/app/pdb/drawable_cmds.c index d6d9d33fe6..09cae0b610 100644 --- a/app/pdb/drawable_cmds.c +++ b/app/pdb/drawable_cmds.c @@ -22,11 +22,11 @@ #include -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "base/temp-buf.h" diff --git a/app/pdb/edit_cmds.c b/app/pdb/edit_cmds.c index cc45a5adb1..3bdc9d645b 100644 --- a/app/pdb/edit_cmds.c +++ b/app/pdb/edit_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "core/core-types.h" diff --git a/app/pdb/fileops_cmds.c b/app/pdb/fileops_cmds.c index 405123c32d..a049ce2cd8 100644 --- a/app/pdb/fileops_cmds.c +++ b/app/pdb/fileops_cmds.c @@ -34,11 +34,11 @@ #endif -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "base/base-config.h" diff --git a/app/pdb/floating_sel_cmds.c b/app/pdb/floating_sel_cmds.c index 4e78994767..0926735412 100644 --- a/app/pdb/floating_sel_cmds.c +++ b/app/pdb/floating_sel_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "core/gimpdrawable.h" diff --git a/app/pdb/gimp-pdb.c b/app/pdb/gimp-pdb.c index daa6fbdc5c..a8edc26e0e 100644 --- a/app/pdb/gimp-pdb.c +++ b/app/pdb/gimp-pdb.c @@ -24,7 +24,7 @@ #include -#include "core/core-types.h" +#include "pdb-types.h" #include "core/gimp.h" diff --git a/app/pdb/gimppdb.c b/app/pdb/gimppdb.c index daa6fbdc5c..a8edc26e0e 100644 --- a/app/pdb/gimppdb.c +++ b/app/pdb/gimppdb.c @@ -24,7 +24,7 @@ #include -#include "core/core-types.h" +#include "pdb-types.h" #include "core/gimp.h" diff --git a/app/pdb/gimpprocedure.c b/app/pdb/gimpprocedure.c index daa6fbdc5c..a8edc26e0e 100644 --- a/app/pdb/gimpprocedure.c +++ b/app/pdb/gimpprocedure.c @@ -24,7 +24,7 @@ #include -#include "core/core-types.h" +#include "pdb-types.h" #include "core/gimp.h" diff --git a/app/pdb/gimprc_cmds.c b/app/pdb/gimprc_cmds.c index 93ae29d3bc..a5d4d325b6 100644 --- a/app/pdb/gimprc_cmds.c +++ b/app/pdb/gimprc_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "gimprc.h" diff --git a/app/pdb/gradient_select_cmds.c b/app/pdb/gradient_select_cmds.c index 95796f9338..f3092cc022 100644 --- a/app/pdb/gradient_select_cmds.c +++ b/app/pdb/gradient_select_cmds.c @@ -26,7 +26,8 @@ #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" +#include "gui/gui-types.h" #include "procedural_db.h" #include "core/gimp.h" diff --git a/app/pdb/gradients_cmds.c b/app/pdb/gradients_cmds.c index 2fc6fba6bb..fd477e074c 100644 --- a/app/pdb/gradients_cmds.c +++ b/app/pdb/gradients_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "core/gimp.h" diff --git a/app/pdb/guides_cmds.c b/app/pdb/guides_cmds.c index a516a9cce1..ce830bf885 100644 --- a/app/pdb/guides_cmds.c +++ b/app/pdb/guides_cmds.c @@ -21,14 +21,14 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" -#include "appenums.h" +#include "core/core-types.h" #include "core/gimpimage.h" #include "undo.h" diff --git a/app/pdb/help_cmds.c b/app/pdb/help_cmds.c index b549069e26..e8811d3916 100644 --- a/app/pdb/help_cmds.c +++ b/app/pdb/help_cmds.c @@ -22,11 +22,11 @@ #include -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "gimphelp.h" diff --git a/app/pdb/image_cmds.c b/app/pdb/image_cmds.c index 2cad3cf3f1..51a3e46ba1 100644 --- a/app/pdb/image_cmds.c +++ b/app/pdb/image_cmds.c @@ -22,11 +22,11 @@ #include -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "app_procs.h" @@ -43,7 +43,6 @@ #include "core/gimplayermask.h" #include "core/gimplist.h" #include "core/gimpunit.h" -#include "gdisplay.h" #include "libgimp/gimpintl.h" #include "libgimpbase/gimpbase.h" @@ -571,7 +570,13 @@ image_delete_invoker (Gimp *gimp, success = FALSE; if (success) - gtk_object_sink (GTK_OBJECT (gimage)); + { + if (gimage->disp_count == 0) + { + g_object_unref (G_OBJECT (gimage)); + success = TRUE; + } + } return procedural_db_return_args (&image_delete_proc, success); } @@ -2011,7 +2016,7 @@ image_set_cmap_invoker (Gimp *gimp, gimage->num_cols = num_bytes / 3; /* A colormap alteration affects the whole image */ - gdisplays_update_area (gimage, 0, 0, gimage->width, gimage->height); + gimp_image_update (gimage, 0, 0, gimage->width, gimage->height); } return procedural_db_return_args (&image_set_cmap_proc, success); diff --git a/app/pdb/internal_procs.c b/app/pdb/internal_procs.c index 203b675f66..13677ff853 100644 --- a/app/pdb/internal_procs.c +++ b/app/pdb/internal_procs.c @@ -20,9 +20,9 @@ #include "config.h" -#include +#include -#include "core/core-types.h" +#include "pdb-types.h" #include "app_procs.h" diff --git a/app/pdb/layer_cmds.c b/app/pdb/layer_cmds.c index 61a127ac59..cd5cb4532b 100644 --- a/app/pdb/layer_cmds.c +++ b/app/pdb/layer_cmds.c @@ -21,14 +21,13 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" -#include "appenums.h" #include "base/base-types.h" #include "core/core-types.h" #include "core/gimpimage.h" @@ -566,7 +565,13 @@ layer_delete_invoker (Gimp *gimp, success = FALSE; if (success) - gtk_object_sink (GTK_OBJECT (layer)); + { + if (! gimp_drawable_gimage (GIMP_DRAWABLE (layer))) + { + g_object_unref (G_OBJECT (layer)); + success = TRUE; + } + } return procedural_db_return_args (&layer_delete_proc, success); } diff --git a/app/pdb/message_cmds.c b/app/pdb/message_cmds.c index ac702ad1d7..21762e16bb 100644 --- a/app/pdb/message_cmds.c +++ b/app/pdb/message_cmds.c @@ -21,14 +21,13 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" -#include "appenums.h" #include "appenv.h" static ProcRecord message_proc; diff --git a/app/pdb/misc_cmds.c b/app/pdb/misc_cmds.c index 7aa4d00945..4daeb62e68 100644 --- a/app/pdb/misc_cmds.c +++ b/app/pdb/misc_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "app_procs.h" diff --git a/app/pdb/palette_cmds.c b/app/pdb/palette_cmds.c index 9e528ab1c7..c20bdfde82 100644 --- a/app/pdb/palette_cmds.c +++ b/app/pdb/palette_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "core/gimp.h" diff --git a/app/pdb/parasite_cmds.c b/app/pdb/parasite_cmds.c index d9daef8305..87683e1e96 100644 --- a/app/pdb/parasite_cmds.c +++ b/app/pdb/parasite_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "core/gimpdrawable.h" diff --git a/app/pdb/paths_cmds.c b/app/pdb/paths_cmds.c index 22ebe953ff..21c64f6b79 100644 --- a/app/pdb/paths_cmds.c +++ b/app/pdb/paths_cmds.c @@ -26,7 +26,7 @@ #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "tools/tools-types.h" #include "procedural_db.h" diff --git a/app/pdb/pattern_select_cmds.c b/app/pdb/pattern_select_cmds.c index 910f2d56dd..ddf9a5637c 100644 --- a/app/pdb/pattern_select_cmds.c +++ b/app/pdb/pattern_select_cmds.c @@ -26,7 +26,8 @@ #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" +#include "gui/gui-types.h" #include "procedural_db.h" #include "core/gimp.h" diff --git a/app/pdb/patterns_cmds.c b/app/pdb/patterns_cmds.c index ad2484913c..9a2c36836f 100644 --- a/app/pdb/patterns_cmds.c +++ b/app/pdb/patterns_cmds.c @@ -22,11 +22,11 @@ #include -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "base/temp-buf.h" diff --git a/app/pdb/pdb-types.h b/app/pdb/pdb-types.h new file mode 100644 index 0000000000..8879df2ca2 --- /dev/null +++ b/app/pdb/pdb-types.h @@ -0,0 +1,31 @@ +/* The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PDB_TYPES_H__ +#define __PDB_TYPES_H__ + + +#include "core/core-types.h" + + +typedef struct _Argument Argument; +typedef struct _ProcArg ProcArg; +typedef struct _ProcRecord ProcRecord; + + +#endif /* __PDB_TYPES_H__ */ diff --git a/app/pdb/plug_in_cmds.c b/app/pdb/plug_in_cmds.c index 0aa5dfb768..8fa9deaf36 100644 --- a/app/pdb/plug_in_cmds.c +++ b/app/pdb/plug_in_cmds.c @@ -23,11 +23,11 @@ #include #include -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "appenv.h" diff --git a/app/pdb/procedural_db.c b/app/pdb/procedural_db.c index daa6fbdc5c..a8edc26e0e 100644 --- a/app/pdb/procedural_db.c +++ b/app/pdb/procedural_db.c @@ -24,7 +24,7 @@ #include -#include "core/core-types.h" +#include "pdb-types.h" #include "core/gimp.h" diff --git a/app/pdb/procedural_db_cmds.c b/app/pdb/procedural_db_cmds.c index ea7c0c6e73..a87f537f40 100644 --- a/app/pdb/procedural_db_cmds.c +++ b/app/pdb/procedural_db_cmds.c @@ -24,11 +24,11 @@ #include #include -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "core/gimp.h" diff --git a/app/pdb/selection_cmds.c b/app/pdb/selection_cmds.c index eeffcb5b84..e0021ec3d9 100644 --- a/app/pdb/selection_cmds.c +++ b/app/pdb/selection_cmds.c @@ -21,14 +21,14 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" -#include "appenums.h" +#include "core/core-types.h" #include "core/gimpchannel.h" #include "core/gimpdrawable.h" #include "core/gimpimage-mask.h" diff --git a/app/pdb/text_tool_cmds.c b/app/pdb/text_tool_cmds.c index 63b8849eb8..ef3e34384a 100644 --- a/app/pdb/text_tool_cmds.c +++ b/app/pdb/text_tool_cmds.c @@ -27,7 +27,7 @@ #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "tools/tools-types.h" #include "procedural_db.h" diff --git a/app/pdb/tools_cmds.c b/app/pdb/tools_cmds.c index cafb12d4dd..97a490fa12 100644 --- a/app/pdb/tools_cmds.c +++ b/app/pdb/tools_cmds.c @@ -25,11 +25,10 @@ #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "tools/tools-types.h" #include "procedural_db.h" -#include "appenums.h" #include "base/base-types.h" #include "base/tile-manager.h" #include "core/core-types.h" diff --git a/app/pdb/undo_cmds.c b/app/pdb/undo_cmds.c index d235a3deb5..eebb2e0c18 100644 --- a/app/pdb/undo_cmds.c +++ b/app/pdb/undo_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "core/gimpimage.h" diff --git a/app/pdb/unit_cmds.c b/app/pdb/unit_cmds.c index c7a6fc148e..4e13e97876 100644 --- a/app/pdb/unit_cmds.c +++ b/app/pdb/unit_cmds.c @@ -21,11 +21,11 @@ #include "config.h" -#include +#include #include "libgimpbase/gimpbasetypes.h" -#include "core/core-types.h" +#include "pdb-types.h" #include "procedural_db.h" #include "core/gimpunit.h" diff --git a/app/plug-in/.cvsignore b/app/plug-in/.cvsignore new file mode 100644 index 0000000000..c1ca9a4d4d --- /dev/null +++ b/app/plug-in/.cvsignore @@ -0,0 +1,6 @@ +Makefile +Makefile.in +.deps +.libs +*.lo +libappplug-in.la diff --git a/app/plug-in/Makefile.am b/app/plug-in/Makefile.am new file mode 100644 index 0000000000..14669f44e9 --- /dev/null +++ b/app/plug-in/Makefile.am @@ -0,0 +1,29 @@ +## Process this file with automake to produce Makefile.in + +noinst_LIBRARIES = libappplug-in.a + +libappplug_in_a_SOURCES = @STRIP_BEGIN@ \ + plug-in-types.h \ +## plug-in.c \ +## plug-in.h \ +@STRIP_END@ + +AM_CPPFLAGS = @STRIP_BEGIN@ \ + -DG_LOG_DOMAIN=\"Gimp-Plug-In\" \ + @GIMP_THREAD_FLAGS@ \ + @GIMP_MP_FLAGS@ \ +@STRIP_END@ + +INCLUDES = @STRIP_BEGIN@ \ + -I$(top_srcdir) \ + -I$(top_srcdir)/app \ + $(GTK_CFLAGS) \ + -I$(includedir) \ +@STRIP_END@ + +.PHONY: files + +files: + @files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \ + echo $$p; \ + done diff --git a/app/plug-in/gimpplugin-progress.h b/app/plug-in/gimpplugin-progress.h index b48e1cd67d..87551a0304 100644 --- a/app/plug-in/gimpplugin-progress.h +++ b/app/plug-in/gimpplugin-progress.h @@ -23,6 +23,11 @@ #include /* time_t */ #include /* pid_t */ + +/* FIXME: move the plugin stuff to plug-in/ */ + +#include "plug-in/plug-in-types.h" + #include "pdb/procedural_db.h" diff --git a/app/plug-in/gimpplugin.h b/app/plug-in/gimpplugin.h index b48e1cd67d..87551a0304 100644 --- a/app/plug-in/gimpplugin.h +++ b/app/plug-in/gimpplugin.h @@ -23,6 +23,11 @@ #include /* time_t */ #include /* pid_t */ + +/* FIXME: move the plugin stuff to plug-in/ */ + +#include "plug-in/plug-in-types.h" + #include "pdb/procedural_db.h" diff --git a/app/plug-in/gimppluginmanager.h b/app/plug-in/gimppluginmanager.h index b48e1cd67d..87551a0304 100644 --- a/app/plug-in/gimppluginmanager.h +++ b/app/plug-in/gimppluginmanager.h @@ -23,6 +23,11 @@ #include /* time_t */ #include /* pid_t */ + +/* FIXME: move the plugin stuff to plug-in/ */ + +#include "plug-in/plug-in-types.h" + #include "pdb/procedural_db.h" diff --git a/app/plug-in/plug-in-def.h b/app/plug-in/plug-in-def.h index b48e1cd67d..87551a0304 100644 --- a/app/plug-in/plug-in-def.h +++ b/app/plug-in/plug-in-def.h @@ -23,6 +23,11 @@ #include /* time_t */ #include /* pid_t */ + +/* FIXME: move the plugin stuff to plug-in/ */ + +#include "plug-in/plug-in-types.h" + #include "pdb/procedural_db.h" diff --git a/app/plug-in/plug-in-params.h b/app/plug-in/plug-in-params.h index b48e1cd67d..87551a0304 100644 --- a/app/plug-in/plug-in-params.h +++ b/app/plug-in/plug-in-params.h @@ -23,6 +23,11 @@ #include /* time_t */ #include /* pid_t */ + +/* FIXME: move the plugin stuff to plug-in/ */ + +#include "plug-in/plug-in-types.h" + #include "pdb/procedural_db.h" diff --git a/app/plug-in/plug-in-progress.h b/app/plug-in/plug-in-progress.h index b48e1cd67d..87551a0304 100644 --- a/app/plug-in/plug-in-progress.h +++ b/app/plug-in/plug-in-progress.h @@ -23,6 +23,11 @@ #include /* time_t */ #include /* pid_t */ + +/* FIXME: move the plugin stuff to plug-in/ */ + +#include "plug-in/plug-in-types.h" + #include "pdb/procedural_db.h" diff --git a/app/plug-in/plug-in-types.h b/app/plug-in/plug-in-types.h new file mode 100644 index 0000000000..ca87fa6bf1 --- /dev/null +++ b/app/plug-in/plug-in-types.h @@ -0,0 +1,40 @@ +/* The GIMP -- an image manipulation program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __PLUG_IN_TYPES_H__ +#define __PLUG_IN_TYPES_H__ + + +#include "core/core-types.h" +#include "pdb/pdb-types.h" + + +typedef enum +{ + RUN_INTERACTIVE = 0, + RUN_NONINTERACTIVE = 1, + RUN_WITH_LAST_VALS = 2 +} RunModeType; + + +typedef struct _PlugIn PlugIn; +typedef struct _PlugInDef PlugInDef; +typedef struct _PlugInProcDef PlugInProcDef; + + +#endif /* __PLUG_IN_TYPES_H__ */ diff --git a/app/plug-in/plug-in.h b/app/plug-in/plug-in.h index b48e1cd67d..87551a0304 100644 --- a/app/plug-in/plug-in.h +++ b/app/plug-in/plug-in.h @@ -23,6 +23,11 @@ #include /* time_t */ #include /* pid_t */ + +/* FIXME: move the plugin stuff to plug-in/ */ + +#include "plug-in/plug-in-types.h" + #include "pdb/procedural_db.h" diff --git a/app/plug-in/plug-ins.h b/app/plug-in/plug-ins.h index b48e1cd67d..87551a0304 100644 --- a/app/plug-in/plug-ins.h +++ b/app/plug-in/plug-ins.h @@ -23,6 +23,11 @@ #include /* time_t */ #include /* pid_t */ + +/* FIXME: move the plugin stuff to plug-in/ */ + +#include "plug-in/plug-in-types.h" + #include "pdb/procedural_db.h" diff --git a/app/plug_in.h b/app/plug_in.h index b48e1cd67d..87551a0304 100644 --- a/app/plug_in.h +++ b/app/plug_in.h @@ -23,6 +23,11 @@ #include /* time_t */ #include /* pid_t */ + +/* FIXME: move the plugin stuff to plug-in/ */ + +#include "plug-in/plug-in-types.h" + #include "pdb/procedural_db.h" diff --git a/app/tools/gimpinktool-blob.c b/app/tools/gimpinktool-blob.c index 04e4bf030b..b4c851c535 100644 --- a/app/tools/gimpinktool-blob.c +++ b/app/tools/gimpinktool-blob.c @@ -31,35 +31,40 @@ #include "libgimpmath/gimpmath.h" -#include "apptypes.h" +#include "tools-types.h" #include "gimpinktool-blob.h" +typedef enum +{ + EDGE_NONE = 0, + EDGE_LEFT = 1 << 0, + EDGE_RIGHT = 1 << 1 +} EdgeType; + + static Blob * -blob_new (int y, int height) +blob_new (gint y, + gint height) { Blob *result; - result = g_malloc (sizeof (Blob) + sizeof(BlobSpan) * (height-1)); - result->y = y; + result = g_malloc (sizeof (Blob) + sizeof (BlobSpan) * (height - 1)); + + result->y = y; result->height = height; return result; } -typedef enum { - EDGE_NONE = 0, - EDGE_LEFT = 1 << 0, - EDGE_RIGHT = 1 << 1 -} EdgeType; - static void -blob_fill (Blob *b, EdgeType *present) +blob_fill (Blob *b, + EdgeType *present) { - int start; - int x1, x2, i1, i2; - int i; + gint start; + gint x1, x2, i1, i2; + gint i; /* Mark empty lines at top and bottom as unused */ @@ -109,11 +114,11 @@ blob_fill (Blob *b, EdgeType *present) /* Find empty gaps */ if (!(present[i1+1] & EDGE_LEFT)) { - int increment; /* fractional part */ - int denom; /* denominator of fraction */ - int step; /* integral step */ - int frac; /* fractional step */ - int reverse; + gint increment; /* fractional part */ + gint denom; /* denominator of fraction */ + gint step; /* integral step */ + gint frac; /* fractional step */ + gint reverse; /* find bottom of gap */ i2 = i1+2; diff --git a/app/tools/tool_manager.c b/app/tools/tool_manager.c index fdcc3820d9..235e168e19 100644 --- a/app/tools/tool_manager.c +++ b/app/tools/tool_manager.c @@ -128,6 +128,8 @@ tool_manager_init (Gimp *gimp) /* register internal tools */ tools_init (gimp); + gimp_tool_info_set_standard (gimp, tool_manager_get_info_by_type (gimp, GIMP_TYPE_RECT_SELECT_TOOL)); + if (! gimprc.global_paint_options && tool_manager->active_tool) { tool_context = diff --git a/app/tools/tools-types.h b/app/tools/tools-types.h index 7b760199c2..5c997eb4ca 100644 --- a/app/tools/tools-types.h +++ b/app/tools/tools-types.h @@ -23,6 +23,7 @@ #include "core/core-types.h" #include "widgets/widgets-types.h" +#include "display/display-types.h" /* tools */ @@ -49,6 +50,42 @@ typedef void (* ToolOptionsResetFunc) (GimpToolOptions *tool_options); /* enums */ +/* Brush application types */ +typedef enum +{ + HARD, /* pencil */ + SOFT, /* paintbrush */ + PRESSURE /* paintbrush with variable pressure */ +} BrushApplicationMode; + +/* Paint application modes */ +typedef enum +{ + CONSTANT, /*< nick=CONTINUOUS >*/ /* pencil, paintbrush, airbrush, clone */ + INCREMENTAL /* convolve, smudge */ +} PaintApplicationMode; + +/* gradient paint modes */ +typedef enum +{ + ONCE_FORWARD, /* paint through once, then stop */ + ONCE_BACKWARDS, /* paint once, then stop, but run the gradient the other way */ + LOOP_SAWTOOTH, /* keep painting, looping through the grad start->end,start->end /|/|/| */ + LOOP_TRIANGLE, /* keep paiting, looping though the grad start->end,end->start /\/\/\/ */ + ONCE_END_COLOR /* paint once, but keep painting with the end color */ +} GradientPaintMode; + +typedef enum /*< skip >*/ +{ + SELECTION_ADD = CHANNEL_OP_ADD, + SELECTION_SUB = CHANNEL_OP_SUB, + SELECTION_REPLACE = CHANNEL_OP_REPLACE, + SELECTION_INTERSECT = CHANNEL_OP_INTERSECT, + SELECTION_MOVE_MASK, + SELECTION_MOVE, + SELECTION_ANCHOR +} SelectOps; + /* The possible states for tools */ typedef enum /*< skip >*/ { diff --git a/app/undo_types.h b/app/undo_types.h index 10a2678385..c366caa1b0 100644 --- a/app/undo_types.h +++ b/app/undo_types.h @@ -15,67 +15,75 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef __UNDO_TYPES_H__ #define __UNDO_TYPES_H__ +typedef struct _LayerUndo LayerUndo; +typedef struct _LayerMaskUndo LayerMaskUndo; +typedef struct _FStoLayerUndo FStoLayerUndo; +typedef GSList PathUndo; + /* Undo types */ /* NOTE: If you change this list, please update the textual mapping at - * the bottom of undo.c as well. */ + * the bottom of undo.c as well. + */ typedef enum { - /* Type UNDO_NULL (0) is special - in the gimpimage structure it means - * there is no undo group currently being added to. */ + /* Type UNDO_NULL (0) is special - in the gimpimage structure it + * means there is no undo group currently being added to. + */ - UNDO_NULL = 0, /* Picky compilers demand this in the enumeration - gosgood@idt.net */ - IMAGE_UNDO, - IMAGE_MOD_UNDO, - MASK_UNDO, - LAYER_DISPLACE_UNDO, - TRANSFORM_UNDO, - PAINT_UNDO, - LAYER_ADD_UNDO, - LAYER_REMOVE_UNDO, - LAYER_MOD, - LAYER_MASK_ADD_UNDO, - LAYER_MASK_REMOVE_UNDO, - LAYER_RENAME_UNDO, - LAYER_REPOSITION_UNDO, - CHANNEL_ADD_UNDO, - CHANNEL_REMOVE_UNDO, - CHANNEL_MOD, - FS_TO_LAYER_UNDO, - GIMAGE_MOD, - FS_RIGOR, - FS_RELAX, - GUIDE_UNDO, - TEXT_UNDO, + UNDO_NULL = 0, /* Picky compilers demand this in the enumeration - gosgood@idt.net */ + IMAGE_UNDO, + IMAGE_MOD_UNDO, + MASK_UNDO, + LAYER_DISPLACE_UNDO, + TRANSFORM_UNDO, + PAINT_UNDO, + LAYER_ADD_UNDO, + LAYER_REMOVE_UNDO, + LAYER_MOD, + LAYER_MASK_ADD_UNDO, + LAYER_MASK_REMOVE_UNDO, + LAYER_RENAME_UNDO, + LAYER_REPOSITION_UNDO, + CHANNEL_ADD_UNDO, + CHANNEL_REMOVE_UNDO, + CHANNEL_MOD, + FS_TO_LAYER_UNDO, + GIMAGE_MOD, + FS_RIGOR, + FS_RELAX, + GUIDE_UNDO, + TEXT_UNDO, - FLOAT_MASK_UNDO, - EDIT_PASTE_UNDO, - EDIT_CUT_UNDO, - TRANSFORM_CORE_UNDO, + FLOAT_MASK_UNDO, + EDIT_PASTE_UNDO, + EDIT_CUT_UNDO, + TRANSFORM_CORE_UNDO, - PAINT_CORE_UNDO, - FLOATING_LAYER_UNDO, - LINKED_LAYER_UNDO, - LAYER_APPLY_MASK_UNDO, - LAYER_MERGE_UNDO, - FS_ANCHOR_UNDO, - GIMAGE_MOD_UNDO, - CROP_UNDO, - LAYER_SCALE_UNDO, - LAYER_RESIZE_UNDO, - QMASK_UNDO, - PARASITE_ATTACH_UNDO, - PARASITE_REMOVE_UNDO, - RESOLUTION_UNDO, - IMAGE_SCALE_UNDO, - IMAGE_RESIZE_UNDO, + PAINT_CORE_UNDO, + FLOATING_LAYER_UNDO, + LINKED_LAYER_UNDO, + LAYER_APPLY_MASK_UNDO, + LAYER_MERGE_UNDO, + FS_ANCHOR_UNDO, + GIMAGE_MOD_UNDO, + CROP_UNDO, + LAYER_SCALE_UNDO, + LAYER_RESIZE_UNDO, + QMASK_UNDO, + PARASITE_ATTACH_UNDO, + PARASITE_REMOVE_UNDO, + RESOLUTION_UNDO, + IMAGE_SCALE_UNDO, + IMAGE_RESIZE_UNDO, - MISC_UNDO = 100 + MISC_UNDO = 100 } UndoType; diff --git a/app/widgets/gimpcolordialog.c b/app/widgets/gimpcolordialog.c index fb53584286..724a8590f7 100644 --- a/app/widgets/gimpcolordialog.c +++ b/app/widgets/gimpcolordialog.c @@ -32,7 +32,7 @@ #include "libgimpwidgets/gimpwidgets.h" #include "libgimp/gimpcolorselector.h" -#include "apptypes.h" +#include "gui-types.h" #include "color-area.h" #include "color-notebook.h" diff --git a/app/widgets/gimpcolormapeditor.c b/app/widgets/gimpcolormapeditor.c index c8f8c3e0bd..52335313d4 100644 --- a/app/widgets/gimpcolormapeditor.c +++ b/app/widgets/gimpcolormapeditor.c @@ -29,7 +29,7 @@ #include "libgimpmath/gimpmath.h" #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "gui-types.h" #include "core/gimpcontainer.h" #include "core/gimpimage.h" @@ -42,7 +42,6 @@ #include "colormaps.h" #include "image_render.h" -#include "gdisplay.h" #include "libgimp/gimpintl.h" diff --git a/app/widgets/gimpcolorpanel.c b/app/widgets/gimpcolorpanel.c index 20203c9df6..21f0f4f825 100644 --- a/app/widgets/gimpcolorpanel.c +++ b/app/widgets/gimpcolorpanel.c @@ -24,6 +24,7 @@ #include "widgets-types.h" +#include "gui/gui-types.h" #include "gui/color-notebook.h" #include "gimpcolorpanel.h" diff --git a/app/widgets/gimpdnd.c b/app/widgets/gimpdnd.c index 3a0afdd6c7..89f993e070 100644 --- a/app/widgets/gimpdnd.c +++ b/app/widgets/gimpdnd.c @@ -1519,7 +1519,7 @@ gimp_dnd_set_tool_data (GtkWidget *widget, name = (gchar *) vals; if (strcmp (name, "gimp:standard_tool") == 0) - tool_info = gimp_tool_info_get_standard (); + tool_info = gimp_tool_info_get_standard (the_gimp); else tool_info = (GimpToolInfo *) gimp_container_get_child_by_name (the_gimp->tool_info_list, diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c index 136b1ba71f..7a87a2e25b 100644 --- a/app/widgets/gimpdockbook.c +++ b/app/widgets/gimpdockbook.c @@ -272,6 +272,12 @@ gimp_dockbook_add (GimpDockbook *dockbook, position); } + /* Now this is evil: GtkNotebook's menu_item "activate" callback + * gets it's notebook context from gtk_menu_get_attach_widget() + * which badly fails because we hijacked the menu and attached it + * to our own item_factory menu. As a workaround, we disconnect + * gtk's handler and install our own. --Mitch + */ { GtkWidget *menu_item; GList *widget_list; @@ -294,12 +300,13 @@ gimp_dockbook_add (GimpDockbook *dockbook, if ((GtkWidget *) widget_list->data == (GtkWidget *) dockable) { - /* EEK: disconnect GtkNotebook's own handler */ + /* disconnect GtkNotebook's handler */ g_signal_handlers_disconnect_matched (G_OBJECT (menu_item), G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page); + /* and install our own */ g_signal_connect (G_OBJECT (menu_item), "activate", G_CALLBACK (gimp_dockbook_menu_switch_page), dockable); diff --git a/app/widgets/gimpgradienteditor.c b/app/widgets/gimpgradienteditor.c index f453a6490c..862f364b53 100644 --- a/app/widgets/gimpgradienteditor.c +++ b/app/widgets/gimpgradienteditor.c @@ -62,7 +62,7 @@ #include "libgimpbase/gimpbase.h" #include "libgimpwidgets/gimpwidgets.h" -#include "core/core-types.h" +#include "gui-types.h" #include "core/gimp.h" #include "core/gimpcontainer.h" diff --git a/app/widgets/gimphelp.c b/app/widgets/gimphelp.c index fe5910b27e..299140cc4f 100644 --- a/app/widgets/gimphelp.c +++ b/app/widgets/gimphelp.c @@ -91,7 +91,7 @@ gimp_help (const gchar *help_path, if (help_data && strlen (help_data)) idle_help->help_data = g_strdup (help_data); - gtk_idle_add ((GtkFunction) gimp_idle_help, (gpointer) idle_help); + g_idle_add (gimp_idle_help, idle_help); } } @@ -99,7 +99,7 @@ gimp_help (const gchar *help_path, /* local functions */ /*********************/ -static gint +static gboolean gimp_idle_help (gpointer data) { GimpIdleHelp *idle_help; diff --git a/app/widgets/gimppaletteeditor.c b/app/widgets/gimppaletteeditor.c index 7828a61648..d4f9ae1115 100644 --- a/app/widgets/gimppaletteeditor.c +++ b/app/widgets/gimppaletteeditor.c @@ -24,8 +24,7 @@ #include "libgimpbase/gimpbase.h" #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "core/gimp.h" #include "core/gimpcontainer.h" diff --git a/app/widgets/gimppreview.c b/app/widgets/gimppreview.c index 338a253cda..a1a0b8cdda 100644 --- a/app/widgets/gimppreview.c +++ b/app/widgets/gimppreview.c @@ -55,6 +55,7 @@ #include "gimppreview.h" #include "gimptoolinfopreview.h" +#include "display/display-types.h" #include "image_render.h" diff --git a/app/widgets/gimppreviewrenderer.c b/app/widgets/gimppreviewrenderer.c index 338a253cda..a1a0b8cdda 100644 --- a/app/widgets/gimppreviewrenderer.c +++ b/app/widgets/gimppreviewrenderer.c @@ -55,6 +55,7 @@ #include "gimppreview.h" #include "gimptoolinfopreview.h" +#include "display/display-types.h" #include "image_render.h" diff --git a/app/widgets/gimptoolbox-color-area.c b/app/widgets/gimptoolbox-color-area.c index 1e7de2ad67..b590ea9ddd 100644 --- a/app/widgets/gimptoolbox-color-area.c +++ b/app/widgets/gimptoolbox-color-area.c @@ -29,7 +29,7 @@ #include "libgimpcolor/gimpcolor.h" -#include "core/core-types.h" +#include "gui-types.h" #include "core/gimp.h" #include "core/gimpcontext.h" diff --git a/app/widgets/gimptoolbox-indicator-area.c b/app/widgets/gimptoolbox-indicator-area.c index f3ca602b8d..d1cc3b8329 100644 --- a/app/widgets/gimptoolbox-indicator-area.c +++ b/app/widgets/gimptoolbox-indicator-area.c @@ -25,8 +25,7 @@ #include "libgimpwidgets/gimpwidgets.h" -#include "apptypes.h" -#include "widgets/widgets-types.h" +#include "gui-types.h" #include "core/gimpbrush.h" #include "core/gimpcontext.h" diff --git a/app/widgets/gimpview.c b/app/widgets/gimpview.c index 338a253cda..a1a0b8cdda 100644 --- a/app/widgets/gimpview.c +++ b/app/widgets/gimpview.c @@ -55,6 +55,7 @@ #include "gimppreview.h" #include "gimptoolinfopreview.h" +#include "display/display-types.h" #include "image_render.h" diff --git a/app/widgets/gimpviewrenderer.c b/app/widgets/gimpviewrenderer.c index 338a253cda..a1a0b8cdda 100644 --- a/app/widgets/gimpviewrenderer.c +++ b/app/widgets/gimpviewrenderer.c @@ -55,6 +55,7 @@ #include "gimppreview.h" #include "gimptoolinfopreview.h" +#include "display/display-types.h" #include "image_render.h" diff --git a/app/xcf/xcf-load.c b/app/xcf/xcf-load.c index 3c082db07c..ed625c2556 100644 --- a/app/xcf/xcf-load.c +++ b/app/xcf/xcf-load.c @@ -21,13 +21,12 @@ #include #include /* strcmp, memcmp */ -#include +#include #include "libgimpbase/gimpbase.h" #include "libgimpcolor/gimpcolor.h" #include "core/core-types.h" -#include "tools/tools-types.h" /* EEK */ #include "base/tile.h" #include "base/tile-manager.h" @@ -147,16 +146,16 @@ static Path * xcf_load_path (GimpImage *gimage, XcfInfo *info) { - Path *bzp; - gchar *name; - guint32 locked; - guint8 state; - guint32 closed; - guint32 num_points; - guint32 version; /* changed from num_paths */ - Tattoo tattoo = 0; - GSList *pts_list = NULL; - PathType ptype; + Path *bzp; + gchar *name; + guint32 locked; + guint8 state; + guint32 closed; + guint32 num_points; + guint32 version; /* changed from num_paths */ + GimpTattoo tattoo = 0; + GSList *pts_list = NULL; + PathType ptype; info->cp += xcf_read_string (info->fp, &name, 1); info->cp += xcf_read_int32 (info->fp, &locked, 1); @@ -191,8 +190,8 @@ xcf_load_path (GimpImage *gimage, else if (version == 3) { /* Has extra tatto field */ - info->cp += xcf_read_int32 (info->fp, (guint32 *)&ptype, 1); - info->cp += xcf_read_int32 (info->fp, (guint32 *)&tattoo, 1); + info->cp += xcf_read_int32 (info->fp, (guint32 *) &ptype, 1); + info->cp += xcf_read_int32 (info->fp, (guint32 *) &tattoo, 1); while (num_points-- > 0) { PathPoint *bpt; diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c index 9bba437ed3..00dad7a4e7 100644 --- a/app/xcf/xcf-save.c +++ b/app/xcf/xcf-save.c @@ -21,13 +21,12 @@ #include #include /* strcpy, strlen */ -#include +#include #include "libgimpbase/gimpbase.h" #include "libgimpcolor/gimpcolor.h" #include "core/core-types.h" -#include "tools/tools-types.h" /* EEK */ #include "base/tile.h" #include "base/tile-manager.h" diff --git a/app/xcf/xcf.c b/app/xcf/xcf.c index ab0dc44fed..37aa207ced 100644 --- a/app/xcf/xcf.c +++ b/app/xcf/xcf.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include "core/core-types.h" diff --git a/configure.in b/configure.in index aa0dc2ed6c..5ade55f217 100644 --- a/configure.in +++ b/configure.in @@ -875,9 +875,11 @@ app/Makefile app/makefile.mingw app/base/Makefile app/core/Makefile +app/display/Makefile app/gui/Makefile app/paint-funcs/Makefile app/pdb/Makefile +app/plug-in/Makefile app/tools/Makefile app/widgets/Makefile app/xcf/Makefile diff --git a/tools/pdbgen/Makefile.am b/tools/pdbgen/Makefile.am index 393ed3dc9e..3e8e18a90e 100644 --- a/tools/pdbgen/Makefile.am +++ b/tools/pdbgen/Makefile.am @@ -49,13 +49,15 @@ EXTRA_DIST = \ enum_headers = \ ../../libgimpbase/gimpbasetypes.h \ - ../../app/appenums.h \ + ../../app/appenv.h \ ../../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 \ ../../app/tools/gimpbucketfilltool.h \ ../../app/tools/gimpclonetool.h \ diff --git a/tools/pdbgen/app.pl b/tools/pdbgen/app.pl index 795eec02e4..370b938d4c 100644 --- a/tools/pdbgen/app.pl +++ b/tools/pdbgen/app.pl @@ -678,6 +678,8 @@ GPL my $out = $out{$group}; my $tool_eek = 0; my $widgets_eek = 0; + my $display_eek = 0; + my $gui_eek = 0; foreach (@{$main::grp{$group}->{headers}}) { $out->{headers}->{$_}++ } delete $out->{headers}->{q/"procedural_db.h"/}; @@ -693,6 +695,16 @@ GPL delete $out->{headers}->{q|"widgets/widgets-types.h"|}; } + if (exists $out->{headers}->{q|"display/display-types.h"|}) { + $display_eek = 1; + delete $out->{headers}->{q|"display/display-types.h"|}; + } + + if (exists $out->{headers}->{q|"gui/gui-types.h"|}) { + $gui_eek = 1; + delete $out->{headers}->{q|"gui/gui-types.h"|}; + } + my @headers = sort { my ($x, $y) = ($a, $b); foreach ($x, $y) { @@ -719,11 +731,18 @@ GPL if ($eek == 0 && !/^'; + + if ($tool_eek == 1 || $widgets_eek == 1 || + $display_eek == 1 || $gui_eek == 1) { + $headers .= '#include '; + } else { + $headers .= '#include '; + } + $headers .= "\n\n"; $headers .= '#include "libgimpbase/gimpbasetypes.h"'; $headers .= "\n\n"; - $headers .= '#include "core/core-types.h"'; + $headers .= '#include "pdb-types.h"'; $headers .= "\n"; if ($tool_eek == 1) { @@ -736,6 +755,16 @@ GPL $headers .= "\n"; } + if ($display_eek == 1) { + $headers .= '#include "display/display-types.h"'; + $headers .= "\n"; + } + + if ($gui_eek == 1) { + $headers .= '#include "gui/gui-types.h"'; + $headers .= "\n"; + } + $headers .= '#include "procedural_db.h"'; $headers .= "\n"; $headers .= "\n"; @@ -824,8 +853,8 @@ HEADER open IFILE, "> $internal" or die "Can't open $cmdfile: $!\n"; print IFILE $gpl; print IFILE qq@#include "config.h"\n\n@; - print IFILE qq@#include \n\n@; - print IFILE qq@#include "core/core-types.h"\n\n@; + print IFILE qq@#include \n\n@; + print IFILE qq@#include "pdb-types.h"\n\n@; print IFILE qq@#include "app_procs.h"\n\n@; print IFILE qq@#include "libgimp/gimpintl.h"\n\n@; print IFILE "/* Forward declarations for registering PDB procs */\n\n"; diff --git a/tools/pdbgen/enums.pl b/tools/pdbgen/enums.pl index 82306f0059..40d95baa36 100644 --- a/tools/pdbgen/enums.pl +++ b/tools/pdbgen/enums.pl @@ -130,7 +130,7 @@ package Gimp::CodeGen::enums; }, MessageHandlerType => { contig => 1, - header => 'appenums.h', + header => 'appenv.h', symbols => [ qw(MESSAGE_BOX CONSOLE ERROR_CONSOLE) ], mapping => { MESSAGE_BOX => '0', CONSOLE => '1', @@ -138,87 +138,13 @@ package Gimp::CodeGen::enums; }, StackTraceMode => { contig => 1, - header => 'appenums.h', + header => 'appenv.h', symbols => [ qw(STACK_TRACE_NEVER STACK_TRACE_QUERY STACK_TRACE_ALWAYS) ], mapping => { STACK_TRACE_NEVER => '0', STACK_TRACE_QUERY => '1', STACK_TRACE_ALWAYS => '2' } }, - BrushApplicationMode => - { contig => 1, - header => 'appenums.h', - symbols => [ qw(HARD SOFT PRESSURE) ], - mapping => { HARD => '0', - SOFT => '1', - PRESSURE => '2' } - }, - PaintApplicationMode => - { contig => 1, - header => 'appenums.h', - symbols => [ qw(CONSTANT INCREMENTAL) ], - mapping => { CONSTANT => '0', - INCREMENTAL => '1' }, - nicks => { CONSTANT => 'CONTINUOUS' } - }, - AddMaskType => - { contig => 1, - header => 'appenums.h', - symbols => [ qw(ADD_WHITE_MASK ADD_BLACK_MASK ADD_ALPHA_MASK - ADD_SELECTION_MASK ADD_INV_SELECTION_MASK) ], - mapping => { ADD_WHITE_MASK => '0', - ADD_BLACK_MASK => '1', - ADD_ALPHA_MASK => '2', - ADD_SELECTION_MASK => '3', - ADD_INV_SELECTION_MASK => '4' }, - nicks => { ADD_WHITE_MASK => 'WHITE_MASK', - ADD_BLACK_MASK => 'BLACK_MASK', - ADD_ALPHA_MASK => 'ALPHA_MASK', - ADD_SELECTION_MASK => 'SELECTION_MASK', - ADD_INV_SELECTION_MASK => 'INV_SELECTION_MASK' } - }, - GradientPaintMode => - { contig => 1, - header => 'appenums.h', - symbols => [ qw(ONCE_FORWARD ONCE_BACKWARDS LOOP_SAWTOOTH - LOOP_TRIANGLE ONCE_END_COLOR) ], - mapping => { ONCE_FORWARD => '0', - ONCE_BACKWARDS => '1', - LOOP_SAWTOOTH => '2', - LOOP_TRIANGLE => '3', - ONCE_END_COLOR => '4' } - }, - OrientationType => - { contig => 1, - header => 'appenums.h', - symbols => [ qw(HORIZONTAL VERTICAL UNKNOWN) ], - mapping => { HORIZONTAL => '0', - VERTICAL => '1', - UNKNOWN => '2' } - }, - ChannelOps => - { contig => 1, - header => 'appenums.h', - symbols => [ qw(CHANNEL_OP_ADD CHANNEL_OP_SUB CHANNEL_OP_REPLACE - CHANNEL_OP_INTERSECT) ], - mapping => { CHANNEL_OP_ADD => '0', - CHANNEL_OP_SUB => '1', - CHANNEL_OP_REPLACE => '2', - CHANNEL_OP_INTERSECT => '3' }, - nicks => { CHANNEL_OP_ADD => 'ADD', - CHANNEL_OP_SUB => 'SUB', - CHANNEL_OP_REPLACE => 'REPLACE', - CHANNEL_OP_INTERSECT => 'INTERSECT' } - }, - RunModeType => - { contig => 1, - header => 'appenums.h', - symbols => [ qw(RUN_INTERACTIVE RUN_NONINTERACTIVE - RUN_WITH_LAST_VALS) ], - mapping => { RUN_INTERACTIVE => '0', - RUN_NONINTERACTIVE => '1', - RUN_WITH_LAST_VALS => '2' } - }, LayerModeEffects => { contig => 1, header => 'base/base-types.h', @@ -313,6 +239,22 @@ package Gimp::CodeGen::enums; INDEXED_CHANNEL => '4', ALPHA_CHANNEL => '5' } }, + AddMaskType => + { contig => 1, + header => 'core/core-types.h', + symbols => [ qw(ADD_WHITE_MASK ADD_BLACK_MASK ADD_ALPHA_MASK + ADD_SELECTION_MASK ADD_INV_SELECTION_MASK) ], + mapping => { ADD_WHITE_MASK => '0', + ADD_BLACK_MASK => '1', + ADD_ALPHA_MASK => '2', + ADD_SELECTION_MASK => '3', + ADD_INV_SELECTION_MASK => '4' }, + nicks => { ADD_WHITE_MASK => 'WHITE_MASK', + ADD_BLACK_MASK => 'BLACK_MASK', + ADD_ALPHA_MASK => 'ALPHA_MASK', + ADD_SELECTION_MASK => 'SELECTION_MASK', + ADD_INV_SELECTION_MASK => 'INV_SELECTION_MASK' } + }, MaskApplyMode => { contig => 1, header => 'core/core-types.h', @@ -320,6 +262,28 @@ package Gimp::CodeGen::enums; mapping => { APPLY => '0', DISCARD => '1' } }, + OrientationType => + { contig => 1, + header => 'core/core-types.h', + symbols => [ qw(HORIZONTAL VERTICAL UNKNOWN) ], + mapping => { HORIZONTAL => '0', + VERTICAL => '1', + UNKNOWN => '2' } + }, + ChannelOps => + { contig => 1, + header => 'core/core-types.h', + symbols => [ qw(CHANNEL_OP_ADD CHANNEL_OP_SUB CHANNEL_OP_REPLACE + CHANNEL_OP_INTERSECT) ], + mapping => { CHANNEL_OP_ADD => '0', + CHANNEL_OP_SUB => '1', + CHANNEL_OP_REPLACE => '2', + CHANNEL_OP_INTERSECT => '3' }, + nicks => { CHANNEL_OP_ADD => 'ADD', + CHANNEL_OP_SUB => 'SUB', + CHANNEL_OP_REPLACE => 'REPLACE', + CHANNEL_OP_INTERSECT => 'INTERSECT' } + }, GimpFillType => { contig => 1, header => 'core/core-types.h', @@ -386,6 +350,42 @@ package Gimp::CodeGen::enums; FIXED_DITHER => '3', NODESTRUCT_DITHER => '4' } }, + RunModeType => + { contig => 1, + header => 'plug-in/plug-in-types.h', + symbols => [ qw(RUN_INTERACTIVE RUN_NONINTERACTIVE + RUN_WITH_LAST_VALS) ], + mapping => { RUN_INTERACTIVE => '0', + RUN_NONINTERACTIVE => '1', + RUN_WITH_LAST_VALS => '2' } + }, + BrushApplicationMode => + { contig => 1, + header => 'tools/tools-types.h', + symbols => [ qw(HARD SOFT PRESSURE) ], + mapping => { HARD => '0', + SOFT => '1', + PRESSURE => '2' } + }, + PaintApplicationMode => + { contig => 1, + header => 'tools/tools-types.h', + symbols => [ qw(CONSTANT INCREMENTAL) ], + mapping => { CONSTANT => '0', + INCREMENTAL => '1' }, + nicks => { CONSTANT => 'CONTINUOUS' } + }, + GradientPaintMode => + { contig => 1, + header => 'tools/tools-types.h', + symbols => [ qw(ONCE_FORWARD ONCE_BACKWARDS LOOP_SAWTOOTH + LOOP_TRIANGLE ONCE_END_COLOR) ], + mapping => { ONCE_FORWARD => '0', + ONCE_BACKWARDS => '1', + LOOP_SAWTOOTH => '2', + LOOP_TRIANGLE => '3', + ONCE_END_COLOR => '4' } + }, GradientType => { contig => 1, header => 'tools/gimpblendtool.h', diff --git a/tools/pdbgen/pdb/channel.pdb b/tools/pdbgen/pdb/channel.pdb index e265e85dae..953e7a8bad 100644 --- a/tools/pdbgen/pdb/channel.pdb +++ b/tools/pdbgen/pdb/channel.pdb @@ -210,7 +210,16 @@ HELP @inargs = ( &channel_arg ); $inargs[0]->{desc} .= ' to delete'; - %invoke = ( code => 'gtk_object_sink (GTK_OBJECT (channel));' ); + %invoke = ( code => <<'CODE' ); +{ + if (! gimp_drawable_gimage (GIMP_DRAWABLE (channel))) + { + g_object_unref (G_OBJECT (channel)); + success = TRUE; + } + +} +CODE } sub channel_combine_masks { diff --git a/tools/pdbgen/pdb/display.pdb b/tools/pdbgen/pdb/display.pdb index c08cc5c79a..e8c41bca44 100644 --- a/tools/pdbgen/pdb/display.pdb +++ b/tools/pdbgen/pdb/display.pdb @@ -81,7 +81,7 @@ HELP %invoke = ( code => 'gdisplays_flush ();' ); } -@headers = qw("gdisplay.h"); +@headers = qw("display/display-types.h" "gdisplay.h"); @procs = qw(display_new display_delete displays_flush); %exports = (app => [@procs], lib => [@procs]); diff --git a/tools/pdbgen/pdb/gradient_select.pdb b/tools/pdbgen/pdb/gradient_select.pdb index 0b14ed28b1..ae5adb9065 100644 --- a/tools/pdbgen/pdb/gradient_select.pdb +++ b/tools/pdbgen/pdb/gradient_select.pdb @@ -229,7 +229,8 @@ CODE @headers = qw( "core/gimp.h" "core/gimpcontext.h" "core/gimpcontainer.h" "core/gimpdatafactory.h" - "core/gimpgradient.h" "gui/gradient-select.h"); + "core/gimpgradient.h" + "gui/gui-types.h" "gui/gradient-select.h"); $extra{app}->{code} = <<'CODE'; static GradientSelect * diff --git a/tools/pdbgen/pdb/image.pdb b/tools/pdbgen/pdb/image.pdb index 2cd10ebbf1..771b5591e7 100644 --- a/tools/pdbgen/pdb/image.pdb +++ b/tools/pdbgen/pdb/image.pdb @@ -386,7 +386,15 @@ HELP @inargs = ( &std_image_arg ); - %invoke = ( code => 'gtk_object_sink (GTK_OBJECT (gimage));' ); + %invoke = ( code => <<'CODE' ); +{ + if (gimage->disp_count == 0) + { + g_object_unref (G_OBJECT (gimage)); + success = TRUE; + } +} +CODE } sub image_free_shadow { @@ -847,9 +855,7 @@ HELP %%desc%%' } } ); - %invoke = ( - headers => [ qw("gdisplay.h") ], - code => <<'CODE' + %invoke = ( code => <<'CODE' { if (gimage->cmap == NULL) gimage->cmap = g_new (guchar, COLORMAP_SIZE); @@ -860,7 +866,7 @@ HELP gimage->num_cols = num_bytes / 3; /* A colormap alteration affects the whole image */ - gdisplays_update_area (gimage, 0, 0, gimage->width, gimage->height); + gimp_image_update (gimage, 0, 0, gimage->width, gimage->height); } CODE ); diff --git a/tools/pdbgen/pdb/layer.pdb b/tools/pdbgen/pdb/layer.pdb index e9800e9359..c9c8d753c7 100644 --- a/tools/pdbgen/pdb/layer.pdb +++ b/tools/pdbgen/pdb/layer.pdb @@ -352,7 +352,15 @@ HELP @inargs = ( &layer_arg ); $inargs[0]->{desc} .= ' to delete'; - %invoke = ( code => 'gtk_object_sink (GTK_OBJECT (layer));' ); + %invoke = ( code => <<'CODE' ); +{ + if (! gimp_drawable_gimage (GIMP_DRAWABLE (layer))) + { + g_object_unref (G_OBJECT (layer)); + success = TRUE; + } +} +CODE } sub layer_translate { diff --git a/tools/pdbgen/pdb/pattern_select.pdb b/tools/pdbgen/pdb/pattern_select.pdb index d1ef8811e7..b0bb46ff80 100644 --- a/tools/pdbgen/pdb/pattern_select.pdb +++ b/tools/pdbgen/pdb/pattern_select.pdb @@ -137,9 +137,9 @@ CODE ); } -@headers = qw( "core/gimp.h" "gui/pattern-select.h" - "core/gimpcontext.h" "core/gimpdatafactory.h" - "core/gimpcontainer.h"); +@headers = qw( "core/gimp.h" "core/gimpcontext.h" + "core/gimpdatafactory.h" "core/gimpcontainer.h" + "gui/gui-types.h" "gui/pattern-select.h"); $extra{app}->{code} = <<'CODE'; static PatternSelect *