gimp/app/tools/gimpsourcetool.c

370 lines
12 KiB
C
Raw Normal View History

/* The GIMP -- an image manipulation program
1997-11-25 06:05:25 +08:00
* 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.
1997-11-25 06:05:25 +08:00
*/
#include "config.h"
#include <gtk/gtk.h>
Makefile.am configure.in added the new library below. 2001-01-24 Michael Natterer <mitch@gimp.org> * Makefile.am * configure.in * gimptool.in: added the new library below. * libgimpwidgets/Makefile.am * libgimpwidgets/gimpchainbutton.[ch] * libgimpwidgets/gimpcolorarea.[ch] * libgimpwidgets/gimpcolorbutton.[ch] * libgimpwidgets/gimpdialog.[ch] * libgimpwidgets/gimpfileselection.[ch] * libgimpwidgets/gimphelpui.[ch] * libgimpwidgets/gimppatheditor.[ch] * libgimpwidgets/gimppixmap.[ch] * libgimpwidgets/gimpquerybox.[ch] * libgimpwidgets/gimpsizeentry.[ch] * libgimpwidgets/gimpunitmenu.[ch] * libgimpwidgets/gimpwidgets.[ch] * libgimpwidgets/gimpwidgets.def * libgimpwidgets/gimpwidgetstypes.h: new shared library. Currently there are some ugly dependencies into libgimp. These will be removed and go to a "libgimpglue" library which will be a library for functions which share a common interface between plug-ins and the app but have different implementations. Include "libgimp/gimpunit.h" from "libgimpwidgets/gimpwidgetstypes.h" to simulate this upcoming separation. * libgimp/Makefile.am * libgimp/gimpchainbutton.[ch] * libgimp/gimpcolorarea.[ch] * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimpfileselection.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimppixmap.[ch] * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: removed from here. * libgimp/gimpui.h * libgimp/gimpuitypes.h * libgimp/makefile.mingw.in * libgimp/makefile.msc: changed accordingly. * app/[all ui files] * app/pdb/palette_cmds.c * app/pdb/tools_cmds.c * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/tools.pdb: #include "libgimpwidgets/gimpwidgets.h" and removed useless includes. * app/apptypes.h: #include "libgimpwidgets/gimpwidgetstypes.h" * app/Makefile.am * plug-ins/[all makefiles which link against libgimpui]: link against libgimpwidgets.la * po-libgimp/POTFILES.in: changed file locations.
2001-01-25 06:36:18 +08:00
#include "libgimpwidgets/gimpwidgets.h"
devel-docs/Makefile.am new file documenting the core's include policy. 2002-05-03 Michael Natterer <mitch@gimp.org> * devel-docs/Makefile.am * devel-docs/includes.txt: new file documenting the core's include policy. * HACKING: mention it here. * libgimptool/gimptooltypes.h: removed GimpToolOptions here. * app/core/core-types.h: and added it here. This is a temp hack needed because GimpToolInfo needs to know the GimpToolOptions type. * libgimpproxy/gimpproxytypes.h: regenerated. * libgimptool/gimptoolmodule.h: don't include gimptooltypes.h here... * libgimptool/gimptoolmodule.c: ...but here. * app/config/gimpconfig-params.c: include "libgimpbase/gimpbase.h" entirely, not single files from it. * app/core/gimp.c * app/core/gimpcontext.c * app/core/gimpcoreconfig.c * app/core/gimpdatafactory.c * app/core/gimpdocuments.c * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-offset.c * app/core/gimpdrawable-transform.c * app/core/gimpdrawable.c * app/core/gimpedit.c * app/core/gimpimage-convert.c * app/core/gimpimage-crop.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-guides.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-new.c * app/core/gimpimage-projection.c * app/core/gimpimage-qmask.c * app/core/gimpimage-resize.c * app/core/gimpimage-scale.c * app/core/gimpimage.c * app/core/gimpitem.c * app/core/gimpmodules.c * app/core/gimppaintinfo.c * app/core/gimpparasite.c * app/core/gimppreviewcache.c * app/core/gimptoolinfo.c * app/core/gimpunit.c: include "core-types.h" and no other types file. * app/display/gimpdisplay.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell.c: include "tools/tools-types.h" instead of "libgimptool/gimptooltypes.h", warn about inclusion on "gui/gui-types.h" * app/file/file-open.c * app/file/file-save.c: don't include "libgimptool/gimptooltypes.h". * app/gui/about-dialog.c * app/gui/brush-select.c * app/gui/brushes-commands.c * app/gui/color-select.c * app/gui/data-commands.c * app/gui/device-status-dialog.c * app/gui/dialogs.c * app/gui/gradients-commands.c * app/gui/help-commands.c * app/gui/info-window.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/resize-dialog.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c: include "gui-types.h" and no other types file. * app/paint/gimpairbrush.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/paint/gimppaintcore-stroke.c * app/paint/gimppaintcore.c * app/paint/gimppaintoptions.c * app/paint/gimppencil.c * app/paint/gimpsmudge.c * app/paint/paint.c: include "paint-types.h" and no other types file. * app/pdb/pdb-types.h: don't include "libgimptool/gimptooltypes.h". * app/plug-in/plug-in-progress.c: warn about inclusion of "display/display-types.h" * app/tools/tools-types.h: include "libgimptool/gimptooltypes.h". * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppaintbrushtool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimppenciltool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpselectiontool.c * app/tools/gimpsheartool.c * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimptoolcontrol.c * app/tools/gimptoolcontrol.h * app/tools/gimptransformtool.c * app/tools/gimpvectortool.c * app/tools/tools.c: include "tools-types.h" and no other types file, warn about inclusion of "gui/gui-types.h". * app/widgets/gimpcolorpanel.c * app/widgets/gimptoolbox-color-area.c: warn about inclusion of "gui/gui-types.h". * app/xcf/xcf-load.c * app/xcf/xcf.c: don't include "libgimptool/gimptooltypes.h". Split tool-safe-mode up in two files, one including libgimpproxy, one libgimp. * plug-ins/tools/Makefile.am * plug-ins/tools/tool-safe-mode-plug-in.[ch]: new files including libgimp/ stuff only. * plug-ins/tools/tool-safe-mode.[ch]: include libgimpproxy/ and libgimptool/ but don't include libgimp/ because of conflicting declarations. Unrelated: * app/tools/gimpclonetool.c: create the clone core so we don't crash. * app/gui/file-open-dialog.c: changed the way we create previews so that only out-of-date previews are created on a click in the preview area. Unconditional creation can still be forced by <Ctrl>+click. Changed the tooltip to document this.
2002-05-03 20:45:22 +08:00
#include "tools-types.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
#include "core/gimppickable.h"
#include "core/gimptoolinfo.h"
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
#include "paint/gimpclone.h"
Made GimpToolOptions a GimpContext subclass and objectified all tool 2003-02-05 Michael Natterer <mitch@gimp.org> Made GimpToolOptions a GimpContext subclass and objectified all tool options types. * app/core/core-types.h: replaced GimpToolOptionsNewFunc by GimpToolOptionsGUIFunc. * libgimpproxy/gimpproxytypes.h: regenerated. * app/core/gimppaintinfo.[ch]: added "GType paint_options_type". * app/core/gimptoolinfo.[ch]: added "GType tool_options_type", removed tool_info->context since GimpToolOptions are a GimpContext now. Added "gboolean use_context" as a temp_hack. * libgimptool/gimptooltypes.h: added the tool_options_type to the tool registering callback. * app/tools/tool_options.[ch]: is a real GimpContext subclass now. * app/paint/paint-types.h * app/paint/paint.c: added the paint_options_type to the paint registering stuff. * app/paint/gimppaintoptions.[ch]: is a real GimpToolOptions subclass now. * app/paint/Makefile.am * app/paint/gimpairbrushoptions.[ch] * app/paint/gimpcloneoptions.[ch] * app/paint/gimpconvolveoptions.[ch] * app/paint/gimpdodgeburnoptions.[ch] * app/paint/gimperaseroptions.[ch] * app/paint/gimpsmudgeoptions.[ch]: new files holding GimpPaintOptions subclasses. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.c * app/paint/gimppaintcore.c * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: removed paint options stuff, lots of related changed & cleanups. * tools/pdbgen/pdb/paint_tools.pdb: changed accordingly. * app/pdb/paint_tools_cmds.c: regenerated. * app/tools/Makefile.am * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpcropoptions.[ch] * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.[ch] * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimptextoptions.[ch] * app/tools/gimpvectoroptions.[ch]: new files holding the various tool options classes. * app/tools/selection_options.[ch] * app/tools/transform_options.[ch]: made them objects. * app/tools/paint_options.[ch]: contains only the paint_options GUI and reset stuff. * app/tools/tools-types.h: removed SelectionOptions typedef for now. * app/tools/[all tools]: removed the tool options stuff except some GUI constructors. Tons of related changes. * app/tools/tool_manager.[ch]: changed tool registration / restore / switching accordingly. * app/widgets/gimpdrawablelistview.c * app/widgets/gimpselectioneditor.c: changed accordingly.
2003-02-05 22:39:40 +08:00
#include "paint/gimpcloneoptions.h"
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpviewablebox.h"
#include "widgets/gimpwidgets-utils.h"
#include "display/gimpdisplay.h"
#include "gimpclonetool.h"
#include "gimppaintoptions-gui.h"
#include "gimptoolcontrol.h"
#include "gimp-intl.h"
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h 2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
2000-12-29 23:22:01 +08:00
#define TARGET_WIDTH 15
#define TARGET_HEIGHT 15
1997-11-25 06:05:25 +08:00
static void gimp_clone_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *display);
static void gimp_clone_tool_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *display);
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
static void gimp_clone_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display);
static void gimp_clone_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display);
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
static void gimp_clone_tool_draw (GimpDrawTool *draw_tool);
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
static GtkWidget * gimp_clone_options_gui (GimpToolOptions *tool_options);
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
G_DEFINE_TYPE (GimpCloneTool, gimp_clone_tool, GIMP_TYPE_PAINT_TOOL)
#define parent_class gimp_clone_tool_parent_class
1997-11-25 06:05:25 +08:00
void
2002-03-29 11:50:29 +08:00
gimp_clone_tool_register (GimpToolRegisterCallback callback,
app/tools/gimpairbrushtool.[ch] app/tools/gimpbezierselecttool.[ch] 2002-05-03 Sven Neumann <sven@gimp.org> * app/tools/gimpairbrushtool.[ch] * app/tools/gimpbezierselecttool.[ch] * app/tools/gimpblendtool.[ch] * app/tools/gimpbrightnesscontrasttool.[ch] * app/tools/gimpbucketfilltool[.ch] * app/tools/gimpbycolorselecttool[.ch] * app/tools/gimpclonetool[.ch] * app/tools/gimpcolorbalancetool[.ch] * app/tools/gimpcolorpickertool[.ch] * app/tools/gimpconvolvetool[.ch] * app/tools/gimpcroptool[.ch] * app/tools/gimpcurvestool[.ch] * app/tools/gimpdodgeburntool[.ch] * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool[.ch] * app/tools/gimperasertool[.ch] * app/tools/gimpfliptool[.ch] * app/tools/gimpfreeselecttool[.ch] * app/tools/gimpfuzzyselecttool[.ch] * app/tools/gimphistogramtool[.ch] * app/tools/gimphuesaturationtool[.ch] * app/tools/gimpinktool[.ch] * app/tools/gimpiscissorstool[.ch] * app/tools/gimplevelstool[.ch] * app/tools/gimpmagnifytool[.ch] * app/tools/gimpmeasuretool[.ch] * app/tools/gimpmovetool[.ch] * app/tools/gimppaintbrushtool[.ch] * app/tools/gimppainttool.c * app/tools/gimppathtool[.ch] * app/tools/gimppenciltool[.ch] * app/tools/gimpperspectivetool[.ch] * app/tools/gimpposterizetool[.ch] * app/tools/gimprectselecttool[.ch] * app/tools/gimprotatetool[.ch] * app/tools/gimpscaletool[.ch] * app/tools/gimpselectiontool.c * app/tools/gimpsheartool[.ch] * app/tools/gimpsmudgetool[.ch] * app/tools/gimptexttool[.ch] * app/tools/gimpthresholdtool[.ch] * app/tools/gimptool.c * app/tools/gimptoolcontrol.h * app/tools/gimptoolmodule[.ch] * app/tools/gimptransformtool.c * app/tools/gimpvectortool[.ch] * app/tools/path_tool.c * app/tools/tool_manager[.ch] * app/tools/tools.c * libgimptool/gimptool.c * libgimptool/gimptoolcontrol.h * libgimptool/gimptoolmodule.h: removed tons of warnings. Do we need to add -Werror to the CFLAGS to avoid such a mess in the future ?! Also had to enforce the GIMP coding style in lots of places :-( * libgimp/gimppixelrgn.c: got sick and tired of debugging plug-ins, so I've added checks for most parameters passed to the GimpPixelRgn functions. This will slow down plug-in execution a little bit but should help to find bugs early.
2002-05-03 19:31:08 +08:00
gpointer data)
{
2002-03-29 11:50:29 +08:00
(* callback) (GIMP_TYPE_CLONE_TOOL,
Made GimpToolOptions a GimpContext subclass and objectified all tool 2003-02-05 Michael Natterer <mitch@gimp.org> Made GimpToolOptions a GimpContext subclass and objectified all tool options types. * app/core/core-types.h: replaced GimpToolOptionsNewFunc by GimpToolOptionsGUIFunc. * libgimpproxy/gimpproxytypes.h: regenerated. * app/core/gimppaintinfo.[ch]: added "GType paint_options_type". * app/core/gimptoolinfo.[ch]: added "GType tool_options_type", removed tool_info->context since GimpToolOptions are a GimpContext now. Added "gboolean use_context" as a temp_hack. * libgimptool/gimptooltypes.h: added the tool_options_type to the tool registering callback. * app/tools/tool_options.[ch]: is a real GimpContext subclass now. * app/paint/paint-types.h * app/paint/paint.c: added the paint_options_type to the paint registering stuff. * app/paint/gimppaintoptions.[ch]: is a real GimpToolOptions subclass now. * app/paint/Makefile.am * app/paint/gimpairbrushoptions.[ch] * app/paint/gimpcloneoptions.[ch] * app/paint/gimpconvolveoptions.[ch] * app/paint/gimpdodgeburnoptions.[ch] * app/paint/gimperaseroptions.[ch] * app/paint/gimpsmudgeoptions.[ch]: new files holding GimpPaintOptions subclasses. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.c * app/paint/gimppaintcore.c * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: removed paint options stuff, lots of related changed & cleanups. * tools/pdbgen/pdb/paint_tools.pdb: changed accordingly. * app/pdb/paint_tools_cmds.c: regenerated. * app/tools/Makefile.am * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpcropoptions.[ch] * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.[ch] * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimptextoptions.[ch] * app/tools/gimpvectoroptions.[ch]: new files holding the various tool options classes. * app/tools/selection_options.[ch] * app/tools/transform_options.[ch]: made them objects. * app/tools/paint_options.[ch]: contains only the paint_options GUI and reset stuff. * app/tools/tools-types.h: removed SelectionOptions typedef for now. * app/tools/[all tools]: removed the tool options stuff except some GUI constructors. Tons of related changes. * app/tools/tool_manager.[ch]: changed tool registration / restore / switching accordingly. * app/widgets/gimpdrawablelistview.c * app/widgets/gimpselectioneditor.c: changed accordingly.
2003-02-05 22:39:40 +08:00
GIMP_TYPE_CLONE_OPTIONS,
gimp_clone_options_gui,
GIMP_PAINT_OPTIONS_CONTEXT_MASK |
GIMP_CONTEXT_PATTERN_MASK,
./mitch --sanitize-identifier-namespace 2002-03-20 Michael Natterer <mitch@gimp.org> ./mitch --sanitize-identifier-namespace * app/core/gimpcontext.c * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-dnd.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/dialogs.c * app/gui/edit-commands.c * app/gui/gui.c * app/gui/menus.c * app/gui/vectors-commands.c * app/gui/view-commands.c * app/tools/gimpairbrushtool.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbrightnesscontrasttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorbalancetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpellipseselecttool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimphistogramtool.c * app/tools/gimphuesaturationtool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimplevelstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppaintbrushtool.c * app/tools/gimppathtool.c * app/tools/gimppenciltool.c * app/tools/gimpperspectivetool.c * app/tools/gimpposterizetool.c * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimpthresholdtool.c * app/tools/gimpvectortool.c * app/widgets/gimpdnd.c * app/widgets/gimptoolbox-indicator-area.c * app/widgets/gimptoolbox.c: s/gimp:/gimp-/g and s/_/-/g for all identifier strings (e.g. gimp:eraser_tool -> gimp-eraser-tool, gimp:layer-list -> gimp-layer-list, ...) * plug-ins/tools/common/gimpbrushselecttool.c: s/gimp:brush_select_tool/gimp-brush-select-tool-module/ Don't quite remember why I introduced the "gimp:" prefix in the first place, but we can always add it back if we need it (for whatever reason) You may want to edit your ~/.gimp-1.3/sessionrc and devicerc or all session settings will be lost due to parse errors.
2002-03-21 20:17:17 +08:00
"gimp-clone-tool",
_("Clone"),
_("Paint using Patterns or Image Regions"),
N_("_Clone"), "C",
NULL, GIMP_HELP_TOOL_CLONE,
2002-03-29 11:50:29 +08:00
GIMP_STOCK_TOOL_CLONE,
app/tools/gimpairbrushtool.[ch] app/tools/gimpbezierselecttool.[ch] 2002-05-03 Sven Neumann <sven@gimp.org> * app/tools/gimpairbrushtool.[ch] * app/tools/gimpbezierselecttool.[ch] * app/tools/gimpblendtool.[ch] * app/tools/gimpbrightnesscontrasttool.[ch] * app/tools/gimpbucketfilltool[.ch] * app/tools/gimpbycolorselecttool[.ch] * app/tools/gimpclonetool[.ch] * app/tools/gimpcolorbalancetool[.ch] * app/tools/gimpcolorpickertool[.ch] * app/tools/gimpconvolvetool[.ch] * app/tools/gimpcroptool[.ch] * app/tools/gimpcurvestool[.ch] * app/tools/gimpdodgeburntool[.ch] * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool[.ch] * app/tools/gimperasertool[.ch] * app/tools/gimpfliptool[.ch] * app/tools/gimpfreeselecttool[.ch] * app/tools/gimpfuzzyselecttool[.ch] * app/tools/gimphistogramtool[.ch] * app/tools/gimphuesaturationtool[.ch] * app/tools/gimpinktool[.ch] * app/tools/gimpiscissorstool[.ch] * app/tools/gimplevelstool[.ch] * app/tools/gimpmagnifytool[.ch] * app/tools/gimpmeasuretool[.ch] * app/tools/gimpmovetool[.ch] * app/tools/gimppaintbrushtool[.ch] * app/tools/gimppainttool.c * app/tools/gimppathtool[.ch] * app/tools/gimppenciltool[.ch] * app/tools/gimpperspectivetool[.ch] * app/tools/gimpposterizetool[.ch] * app/tools/gimprectselecttool[.ch] * app/tools/gimprotatetool[.ch] * app/tools/gimpscaletool[.ch] * app/tools/gimpselectiontool.c * app/tools/gimpsheartool[.ch] * app/tools/gimpsmudgetool[.ch] * app/tools/gimptexttool[.ch] * app/tools/gimpthresholdtool[.ch] * app/tools/gimptool.c * app/tools/gimptoolcontrol.h * app/tools/gimptoolmodule[.ch] * app/tools/gimptransformtool.c * app/tools/gimpvectortool[.ch] * app/tools/path_tool.c * app/tools/tool_manager[.ch] * app/tools/tools.c * libgimptool/gimptool.c * libgimptool/gimptoolcontrol.h * libgimptool/gimptoolmodule.h: removed tons of warnings. Do we need to add -Werror to the CFLAGS to avoid such a mess in the future ?! Also had to enforce the GIMP coding style in lots of places :-( * libgimp/gimppixelrgn.c: got sick and tired of debugging plug-ins, so I've added checks for most parameters passed to the GimpPixelRgn functions. This will slow down plug-in execution a little bit but should help to find bugs early.
2002-05-03 19:31:08 +08:00
data);
}
static void
gimp_clone_tool_class_init (GimpCloneToolClass *klass)
1997-11-25 06:05:25 +08:00
{
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
1997-11-25 06:05:25 +08:00
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
tool_class->button_press = gimp_clone_tool_button_press;
tool_class->motion = gimp_clone_tool_motion;
tool_class->cursor_update = gimp_clone_tool_cursor_update;
tool_class->oper_update = gimp_clone_tool_oper_update;
1997-11-25 06:05:25 +08:00
draw_tool_class->draw = gimp_clone_tool_draw;
}
1997-11-25 06:05:25 +08:00
static void
gimp_clone_tool_init (GimpCloneTool *clone)
{
GimpTool *tool = GIMP_TOOL (clone);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_CLONE);
gimp_tool_control_set_action_object_2 (tool->control,
"context/context-pattern-select-set");
}
static void
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
gimp_clone_tool_button_press (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *display)
{
Immplement "Sample Merged" for the clone tool. Fixes bug #123627. 2005-08-28 Michael Natterer <mitch@gimp.org> Immplement "Sample Merged" for the clone tool. Fixes bug #123627. * app/paint/gimppaintcore.[ch] (struct GimpPaintCore): added members "saved_proj_tiles" which stores the unmodified projection, "orig_proj_buf" which stores the unmodified temp paint application buf and "use_saved_proj" which controls if all the additional stuff should be allocated and managed. (gimp_paint_core_start): allocate the saved_proj_tiles if needed. (gimp_paint_core_get_orig_proj): new function like gimp_paint_core_get_orig_image() which returns unmodified projection pixels for paint application. (gimp_paint_core_validate_saved_proj_tiles): new function like gimp_paint_core_validate_undo_tiles() which copies the tiles that will be dirtied to saved_proj_tiles. (gimp_paint_core_paste): call above save_proj_tiles() so projection tiles are saved before dirtying them. * app/paint/gimpclone.[ch]: replaced member src_drawable by src_pickable and use the image's projection if sample_merged it TRUE. Adjust src offsets accordingly and use GimpPaintCore's new get_orig_proj() API to get the src pixels. * app/paint/gimpcloneoptions.[ch]: added boolean "sample_merged" property. * app/tools/gimpclonetool.c: follow GimpClone's src_drawable -> src_pickable change. (gimp_clone_tool_button_press): set the paint_core's "use_saved_proj" boolean before chaining up. (gimp_clone_options_gui): add a "Sample Merged" toggle button.
2005-08-29 03:17:44 +08:00
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpCloneTool *clone_tool = GIMP_CLONE_TOOL (tool);
GimpClone *clone = GIMP_CLONE (paint_tool->core);
Immplement "Sample Merged" for the clone tool. Fixes bug #123627. 2005-08-28 Michael Natterer <mitch@gimp.org> Immplement "Sample Merged" for the clone tool. Fixes bug #123627. * app/paint/gimppaintcore.[ch] (struct GimpPaintCore): added members "saved_proj_tiles" which stores the unmodified projection, "orig_proj_buf" which stores the unmodified temp paint application buf and "use_saved_proj" which controls if all the additional stuff should be allocated and managed. (gimp_paint_core_start): allocate the saved_proj_tiles if needed. (gimp_paint_core_get_orig_proj): new function like gimp_paint_core_get_orig_image() which returns unmodified projection pixels for paint application. (gimp_paint_core_validate_saved_proj_tiles): new function like gimp_paint_core_validate_undo_tiles() which copies the tiles that will be dirtied to saved_proj_tiles. (gimp_paint_core_paste): call above save_proj_tiles() so projection tiles are saved before dirtying them. * app/paint/gimpclone.[ch]: replaced member src_drawable by src_pickable and use the image's projection if sample_merged it TRUE. Adjust src offsets accordingly and use GimpPaintCore's new get_orig_proj() API to get the src pixels. * app/paint/gimpcloneoptions.[ch]: added boolean "sample_merged" property. * app/tools/gimpclonetool.c: follow GimpClone's src_drawable -> src_pickable change. (gimp_clone_tool_button_press): set the paint_core's "use_saved_proj" boolean before chaining up. (gimp_clone_options_gui): add a "Sample Merged" toggle button.
2005-08-29 03:17:44 +08:00
GimpCloneOptions *options;
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
Immplement "Sample Merged" for the clone tool. Fixes bug #123627. 2005-08-28 Michael Natterer <mitch@gimp.org> Immplement "Sample Merged" for the clone tool. Fixes bug #123627. * app/paint/gimppaintcore.[ch] (struct GimpPaintCore): added members "saved_proj_tiles" which stores the unmodified projection, "orig_proj_buf" which stores the unmodified temp paint application buf and "use_saved_proj" which controls if all the additional stuff should be allocated and managed. (gimp_paint_core_start): allocate the saved_proj_tiles if needed. (gimp_paint_core_get_orig_proj): new function like gimp_paint_core_get_orig_image() which returns unmodified projection pixels for paint application. (gimp_paint_core_validate_saved_proj_tiles): new function like gimp_paint_core_validate_undo_tiles() which copies the tiles that will be dirtied to saved_proj_tiles. (gimp_paint_core_paste): call above save_proj_tiles() so projection tiles are saved before dirtying them. * app/paint/gimpclone.[ch]: replaced member src_drawable by src_pickable and use the image's projection if sample_merged it TRUE. Adjust src offsets accordingly and use GimpPaintCore's new get_orig_proj() API to get the src pixels. * app/paint/gimpcloneoptions.[ch]: added boolean "sample_merged" property. * app/tools/gimpclonetool.c: follow GimpClone's src_drawable -> src_pickable change. (gimp_clone_tool_button_press): set the paint_core's "use_saved_proj" boolean before chaining up. (gimp_clone_options_gui): add a "Sample Merged" toggle button.
2005-08-29 03:17:44 +08:00
paint_tool->core->use_saved_proj = FALSE;
made the gimp_object_get_memsize() debugging output configurable by a 2002-02-06 Michael Natterer <mitch@gimp.org> * app/core/gimpobject.c: made the gimp_object_get_memsize() debugging output configurable by a global "gimp_debug_memsize" boolean. * app/display/gimpdisplay.c: removed duplicated prototype. * app/display/gimpdisplayshell.[ch]: renamed the various cursor functions to be more consistent and shorter. Compress window title updates by adding a "gboolean title_dirty" and updating the title in gimp_display_shell_flush(). Added "%m" (memory size) to the possible title string substitutions. * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell-handlers.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimptool.c: changed accordingly. * app/display/gimpdisplayshell-callbacks.c: forgot to grab the pointer when dragging guides from the rulers. Coincidentially, this also fixes the buggy offset between guide and mouse pointer... Cleaned up the main tool event callback a but more. * app/widgets/gimppreview.c * app/gui/commands.c: set the new global "gimp_debug_memsize" toggle to TRUE while calling gimp_object_get_memsize(). * app/gui/preferences-dialog.c: added a image title example containing the new "%m" feature. * docs/gimprc-1.3.5.in: document "%m" in the manpage. * app/tools/gimpbezierselecttool.c: reordered some statements. * app/tools/gimpdrawtool.[ch]: store the GimpDisplay passed to gimp_draw_tool_start() in draw_tool->gdisp and use it for coordinate transfomration. This way we can paint on a display which is not tool->gdisp. * app/tools/gimppainttool.c: changed the gimp_draw_tool_foo() calls needed to make the straight_line preview work in a way that does not interfere with paint_tool subclasses which want to do their own drawing (like the clone tool). Also changed the paint_tools PRETRACE_PAINT and POSTTRACE_PAINT flags usage in a way that subclasses can use them without major hackery: don't simply wrap gimp_display_flush_now() with PRETRACE/POSTTRACE calls, but wrap the actual painting calls, so subclasses are able to do useful things with paint_tool->*_coords. * app/tools/gimpclonetool.c: removed poking around in draw_tool internals and simply suspend()/resume() it in PRETRACE_PAINT/POSTTRACE_PAINT to get the clone_src indicator drawn correctly.
2002-02-07 19:33:01 +08:00
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
{
clone->set_source = TRUE;
if (display != clone_tool->src_display)
{
if (clone_tool->src_display)
g_object_remove_weak_pointer (G_OBJECT (clone_tool->src_display),
(gpointer *) &clone_tool->src_display);
clone_tool->src_display = display;
g_object_add_weak_pointer (G_OBJECT (display),
(gpointer *) &clone_tool->src_display);
}
}
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
else
{
clone->set_source = FALSE;
Immplement "Sample Merged" for the clone tool. Fixes bug #123627. 2005-08-28 Michael Natterer <mitch@gimp.org> Immplement "Sample Merged" for the clone tool. Fixes bug #123627. * app/paint/gimppaintcore.[ch] (struct GimpPaintCore): added members "saved_proj_tiles" which stores the unmodified projection, "orig_proj_buf" which stores the unmodified temp paint application buf and "use_saved_proj" which controls if all the additional stuff should be allocated and managed. (gimp_paint_core_start): allocate the saved_proj_tiles if needed. (gimp_paint_core_get_orig_proj): new function like gimp_paint_core_get_orig_image() which returns unmodified projection pixels for paint application. (gimp_paint_core_validate_saved_proj_tiles): new function like gimp_paint_core_validate_undo_tiles() which copies the tiles that will be dirtied to saved_proj_tiles. (gimp_paint_core_paste): call above save_proj_tiles() so projection tiles are saved before dirtying them. * app/paint/gimpclone.[ch]: replaced member src_drawable by src_pickable and use the image's projection if sample_merged it TRUE. Adjust src offsets accordingly and use GimpPaintCore's new get_orig_proj() API to get the src pixels. * app/paint/gimpcloneoptions.[ch]: added boolean "sample_merged" property. * app/tools/gimpclonetool.c: follow GimpClone's src_drawable -> src_pickable change. (gimp_clone_tool_button_press): set the paint_core's "use_saved_proj" boolean before chaining up. (gimp_clone_options_gui): add a "Sample Merged" toggle button.
2005-08-29 03:17:44 +08:00
if (options->clone_type == GIMP_IMAGE_CLONE &&
options->sample_merged &&
display == clone_tool->src_display)
Immplement "Sample Merged" for the clone tool. Fixes bug #123627. 2005-08-28 Michael Natterer <mitch@gimp.org> Immplement "Sample Merged" for the clone tool. Fixes bug #123627. * app/paint/gimppaintcore.[ch] (struct GimpPaintCore): added members "saved_proj_tiles" which stores the unmodified projection, "orig_proj_buf" which stores the unmodified temp paint application buf and "use_saved_proj" which controls if all the additional stuff should be allocated and managed. (gimp_paint_core_start): allocate the saved_proj_tiles if needed. (gimp_paint_core_get_orig_proj): new function like gimp_paint_core_get_orig_image() which returns unmodified projection pixels for paint application. (gimp_paint_core_validate_saved_proj_tiles): new function like gimp_paint_core_validate_undo_tiles() which copies the tiles that will be dirtied to saved_proj_tiles. (gimp_paint_core_paste): call above save_proj_tiles() so projection tiles are saved before dirtying them. * app/paint/gimpclone.[ch]: replaced member src_drawable by src_pickable and use the image's projection if sample_merged it TRUE. Adjust src offsets accordingly and use GimpPaintCore's new get_orig_proj() API to get the src pixels. * app/paint/gimpcloneoptions.[ch]: added boolean "sample_merged" property. * app/tools/gimpclonetool.c: follow GimpClone's src_drawable -> src_pickable change. (gimp_clone_tool_button_press): set the paint_core's "use_saved_proj" boolean before chaining up. (gimp_clone_options_gui): add a "Sample Merged" toggle button.
2005-08-29 03:17:44 +08:00
{
paint_tool->core->use_saved_proj = TRUE;
}
}
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
GIMP_TOOL_CLASS (parent_class)->button_press (tool, coords, time, state,
display);
clone_tool->src_x = clone->src_x;
clone_tool->src_y = clone->src_y;
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
}
static void
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
gimp_clone_tool_motion (GimpTool *tool,
GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *display)
1997-11-25 06:05:25 +08:00
{
GimpCloneTool *clone_tool = GIMP_CLONE_TOOL (tool);
GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (tool);
GimpClone *clone = GIMP_CLONE (paint_tool->core);
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
1997-11-25 06:05:25 +08:00
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
clone->set_source = TRUE;
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
else
clone->set_source = FALSE;
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
GIMP_TOOL_CLASS (parent_class)->motion (tool, coords, time, state, display);
clone_tool->src_x = clone->src_x;
clone_tool->src_y = clone->src_y;
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
1997-11-25 06:05:25 +08:00
}
static void
build display/ before tools/. 2001-11-08 Michael Natterer <mitch@gimp.org> * app/Makefile.am: build display/ before tools/. * app/devices.c: devices_check_change(): added all events which have a GdkDevice pointer. * app/gimpprogress.c: include "display-types.h" instead of "core-types.h". * app/core/Makefile.am * app/core/gimpdrawable-bucket-fill.[ch]: new files: the bucket_fill stuff taken from tools/gimpbucketfilltool.[ch]. * app/core/core-types.h: added "BucketFillMode". * app/core/gimpimage-mask-select.[ch]: cleanup. * app/core/gimpmarshal.list: added more marshallers for GimpTool's new signal signatures. * app/core/gimpmarshal.[ch]: regenerated. * app/display/Makefile.am * app/display/gimpdisplayshell-dnd.[ch] * app/display/gimpdisplayshell-layer-select.[ch]: new files: the canvas drop callbacks from gimpdisplayshell-callbacks.[ch] and the stuff formerly knows as gui/layer-select.[ch]. * app/display/gimpdisplay.h: don't include "gui/gui-types.h". * app/display/gximage.c: include "display-types.h". * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell.[ch]: call gdsplay_delete(), don't destroy the shell widget. * app/gui/Makefile.am * app/gui/layer-select.[ch]: removed. * app/gui/gradients-commands.c: fixed "Save as POV" fprintf()s. * app/gui/preferences-dialog.c: removed the layer_select stuff because it is useless with the new preview system. * app/gui/tool-options-dialog.c: send the correct data to the close_callback. * app/gui/tools-commands.c: changed to follow the new gimp_tool_initialize() semantics (see below). Tool & canvas event handling chainsawing: * app/tools/tools-types.h: new struct GimpCoords which contains x, y, pressure, tilt etc. * app/display/gimpdisplayshell-callbacks.[ch]: added utility functions which transparently retreive the current event's GimpCoords or take it from the device directly if the event has none. Pass GimpCoords _in_image_coordinates_ to all tool functions. Most important: don't pass GdkEvents and display coordinates to tools any more. * app/tools/gimptool.[ch]: changed virtual functions to take GimpCoords, time and state separately instead of GdkEvents. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.[ch] * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.[ch] * app/tools/gimpcurvestool.c * app/tools/gimpdodgeburntool.c * app/tools/gimpdrawtool.c * app/tools/gimpeditselectiontool.[ch] * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfreeselecttool.[ch] * app/tools/gimpfuzzyselecttool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.[ch] * app/tools/gimprectselecttool.c * app/tools/gimprotatetool.c * app/tools/gimpselectiontool.[ch] * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimptransformtool.[ch] * app/tools/path_tool.[ch] * app/tools/selection_options.c: tons and tons of changes: - changed to use the new virtual function parameters. - removed zillions of gdisplay_untransform_coords(). - get the active drawable's offsets manually in many cases. (questionable, but IMHO ok because it's obvious and not simply a "TRUE" passed to some function) - reordered some functions to be consistent across tools. - some tools had to be changed to work on image coords, not display ones (esp. crop). - fixed strange rotate tool behaviour which should be backported to stable. - some stuff i came across. - indentation and other paranoia. - rounding of coordinated may be broken in some tools. - new bugs guaranteed. * app/tools/tool_manager.[ch]: new semantic of tool_manager_initialize_active() (looked at the places where it was used from and put common code together). Should be a bit better now :) * app/tools/gimpblendtool.c * app/tools/transform_options.c: use the new GTK+ feature that a widget (toggle button) can be a frame's title for this tools' tool options. * app/widgets/widgets-types.h: stuff. * themes/Default/gtkrc: s/GtkDialog/GimpDialog/. * tools/pdbgen/Makefile.am: don't scan tools/gimpbucketfilltool.h any more. * tools/pdbgen/enums.pl: regenerated. * tools/pdbgen/pdb/tools.pdb: changed bucket_fill wrapper. * app/pdb/tools_cmds.c: regenerated.
2001-11-09 03:14:51 +08:00
gimp_clone_tool_cursor_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display)
1999-05-15 20:13:43 +08:00
{
Made the paint tool PDB wrappers work again (a bit at least...) 2002-02-21 Michael Natterer <mitch@gimp.org> Made the paint tool PDB wrappers work again (a bit at least...) * app/Makefile.am: changed linking order. libtool sucks. * app/undo.c: check if active_tool is a GimpPaintTool before casting it. * app/paint/Makefile.am * app/paint/paint-types.h: added new files/types. * app/paint/gimppaintoptions.[ch]: new files cut out of tools/paint_options.h. Prefixed everything with "Gimp". There is still GtkWidget* cruft hanging around in the structs... * app/paint/gimppaintcore-stroke.[ch]: utility function which paints a stroke array. Needed for the PDB wrappers. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.c * app/paint/gimppaintcore.[ch] * app/paint/gimppencil.c * app/paint/gimpsmudge.[ch]: added *_options_new() functions which create correctly initialized options structures without widgets. * app/tools/paint_options.[ch]: removed the options struct definitions and value initialisations. * app/tools/gimpairbrushtool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpinktool.c * app/tools/gimppaintbrushtool.c * app/tools/gimppainttool.c * app/tools/gimppenciltool.c * app/tools/gimpsmudgetool.c: changed all paint_options functions accordingly, s/PaintOptions/GimpPaintOptions/g etc., removed all #if 0'ed non_gui functions. * tools/pdbgen/pdb/paint_tools.pdb: use gimp_paint_core_stroke(). We currently leak all paint_options structs created by the PDB wrappers, more stuff to come... * app/pdb/paint_tools_cmds.c: regenerated.
2002-02-22 00:02:30 +08:00
GimpCloneOptions *options;
GimpCursorType ctype = GIMP_CURSOR_MOUSE;
2001-11-01 05:20:09 +08:00
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
if (gimp_image_coords_in_active_drawable (display->image, coords))
1999-05-15 20:13:43 +08:00
{
GimpChannel *selection = gimp_image_get_mask (display->image);
removed gimp_drawable_offsets(). 2003-05-08 Michael Natterer <mitch@gimp.org> * app/core/gimpdrawable.[ch]: removed gimp_drawable_offsets(). * app/core/gimpitem.[ch]: added gimp_item_offsets(). * app/core/gimpdrawable-blend.c * app/core/gimpdrawable-bucket-fill.c * app/core/gimpdrawable-histogram.c * app/core/gimpedit.c * app/core/gimpimage-convert.c * app/core/gimpimage-crop.c * app/core/gimpimage-mask-select.c * app/core/gimpimage-mask.c * app/core/gimpimage-merge.c * app/core/gimpimage-pick-color.c * app/core/gimpimage-preview.c * app/core/gimpimage-projection.c * app/core/gimpimage-undo-push.c * app/core/gimpimage.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/display/gimpdisplay.c * app/display/gimpdisplayshell-transform.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/paint/gimppaintcore.c * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpcurvestool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpinktool.c * app/tools/gimplevelstool.c * app/tools/gimppainttool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpselectioneditor.c * app/widgets/gimptoolbox.c * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/drawable.pdb: changed accordingly. * app/pdb/color_cmds.c * app/pdb/drawable_cmds.c: regenerated.
2003-05-08 22:06:03 +08:00
/* One more test--is there a selected region?
* if so, is cursor inside?
*/
if (gimp_channel_is_empty (selection) ||
gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection),
coords->x, coords->y))
ctype = GIMP_CURSOR_MOUSE;
1999-05-15 20:13:43 +08:00
}
made the gimp_object_get_memsize() debugging output configurable by a 2002-02-06 Michael Natterer <mitch@gimp.org> * app/core/gimpobject.c: made the gimp_object_get_memsize() debugging output configurable by a global "gimp_debug_memsize" boolean. * app/display/gimpdisplay.c: removed duplicated prototype. * app/display/gimpdisplayshell.[ch]: renamed the various cursor functions to be more consistent and shorter. Compress window title updates by adding a "gboolean title_dirty" and updating the title in gimp_display_shell_flush(). Added "%m" (memory size) to the possible title string substitutions. * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell-handlers.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimptool.c: changed accordingly. * app/display/gimpdisplayshell-callbacks.c: forgot to grab the pointer when dragging guides from the rulers. Coincidentially, this also fixes the buggy offset between guide and mouse pointer... Cleaned up the main tool event callback a but more. * app/widgets/gimppreview.c * app/gui/commands.c: set the new global "gimp_debug_memsize" toggle to TRUE while calling gimp_object_get_memsize(). * app/gui/preferences-dialog.c: added a image title example containing the new "%m" feature. * docs/gimprc-1.3.5.in: document "%m" in the manpage. * app/tools/gimpbezierselecttool.c: reordered some statements. * app/tools/gimpdrawtool.[ch]: store the GimpDisplay passed to gimp_draw_tool_start() in draw_tool->gdisp and use it for coordinate transfomration. This way we can paint on a display which is not tool->gdisp. * app/tools/gimppainttool.c: changed the gimp_draw_tool_foo() calls needed to make the straight_line preview work in a way that does not interfere with paint_tool subclasses which want to do their own drawing (like the clone tool). Also changed the paint_tools PRETRACE_PAINT and POSTTRACE_PAINT flags usage in a way that subclasses can use them without major hackery: don't simply wrap gimp_display_flush_now() with PRETRACE/POSTTRACE calls, but wrap the actual painting calls, so subclasses are able to do useful things with paint_tool->*_coords. * app/tools/gimpclonetool.c: removed poking around in draw_tool internals and simply suspend()/resume() it in PRETRACE_PAINT/POSTTRACE_PAINT to get the clone_src indicator drawn correctly.
2002-02-07 19:33:01 +08:00
Added object properties for almost all tool_options values and registered 2003-02-07 Michael Natterer <mitch@gimp.org> Added object properties for almost all tool_options values and registered lots of enums with the type system: Part I (enum and type cleanup): * app/core/core-enums.[ch] * app/core/core-types.h: removed InternalOrientaionType and register GimpOrientationType. Register GimpChannelOps. Removed GimpToolOptionsGUIFunc. * app/xcf/xcf-private.h: added XcfOrientationType with the same values as the old InternalOrientationType * app/xcf/xcf-load.c * app/xcf/xcf-save.c: translate between GimpOrientationType and XcfOrientationType. * app/core/gimpdrawable-transform-utils.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-guides.c * app/core/gimpimage-resize.c * app/core/gimpimage-scale.c * app/core/gimpimage.h * app/display/gimpdisplayshell.c * tools/pdbgen/stddefs.pdb * tools/pdbgen/pdb/transform_tools.pdb: changed accordingly. * app/pdb/guides_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpenums.h * libgimpproxy/gimpproxytypes.h * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated. * libgimptool/gimptoolenums.[ch]: added GimpTransformGridType. * libgimptool/gimptooltypes.h: removed GimpToolOptionsResetFunc, added GimpToolOptionsGUIFunc. Part II (tool options changes): * app/config/gimpconfig-utils.c (gimp_config_reset_properties): don't reset object properties because they have NULL as default value. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_[enum|boolean]_radio_frame_new(), gimp_prop_paint_mode_menu_new() and gimp_prop_scale_entry_new(), which are all needed by the new tool options GUI code. * app/tools/tool_options.[ch]: removed the "reset_func" since the virtual reset() method is used now. * app/paint/gimpairbrushoptions.[ch] * app/paint/gimpcloneoptions.[ch] * app/paint/gimpconvolveoptions.[ch] * app/paint/gimpdodgeburnoptions.[ch] * app/paint/gimperaseroptions.[ch] * app/paint/gimppaintoptions.[ch] * app/paint/gimpsmudgeoptions.[ch]: added properties all over the place and removed the widget and default_value members from the structs. Renamed some values (e.g. s/type/clone_type/). Don't #include <gtk/gtk.h>. * app/paint/gimpairbrush.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/paint/gimppaintcore-stroke.c * app/paint/gimppaintcore.c * app/paint/gimppencil.c * app/paint/gimpsmudge.c * app/paint/paint-types.h * app/paint/paint.c: changed accordingly. Don't #include <gtk/gtk.h>. * tools/pdbgen/pdb/paint_tools.pdb: changed accordingly. * app/pdb/paint_tools_cmds.c: regenerated. * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpcropoptions.[ch] * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.c * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimptextoptions.c * app/tools/paint_options.[ch] * app/tools/selection_options.[ch] * app/tools/transform_options.[ch]: ditto: added properties and removed widget and default_value stuff. Removed most reset functions. Use gimp_prop widgets all over the place, renamed some values as above. * app/tools/Makefile.am * app/tools/gimpairbrushtool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/tools/gimpselectiontool.c * app/tools/gimpsheartool.c * app/tools/gimpsmudgetool.c * app/tools/gimptransformtool.c * app/tools/gimpvectoroptions.c: changed accordingly. Ported the paint_options GUI constructors to gimp_prop widgets. * app/widgets/gimpselectioneditor.c * app/gui/tool-options-dialog.c: changed accordingly.
2003-02-08 01:12:21 +08:00
if (options->clone_type == GIMP_IMAGE_CLONE)
{
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
ctype = GIMP_CURSOR_CROSSHAIR_SMALL;
else if (! GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core)->src_drawable)
ctype = GIMP_CURSOR_BAD;
}
app/tools/gimpairbrushtool.[ch] app/tools/gimpbezierselecttool.[ch] 2002-05-03 Sven Neumann <sven@gimp.org> * app/tools/gimpairbrushtool.[ch] * app/tools/gimpbezierselecttool.[ch] * app/tools/gimpblendtool.[ch] * app/tools/gimpbrightnesscontrasttool.[ch] * app/tools/gimpbucketfilltool[.ch] * app/tools/gimpbycolorselecttool[.ch] * app/tools/gimpclonetool[.ch] * app/tools/gimpcolorbalancetool[.ch] * app/tools/gimpcolorpickertool[.ch] * app/tools/gimpconvolvetool[.ch] * app/tools/gimpcroptool[.ch] * app/tools/gimpcurvestool[.ch] * app/tools/gimpdodgeburntool[.ch] * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool[.ch] * app/tools/gimperasertool[.ch] * app/tools/gimpfliptool[.ch] * app/tools/gimpfreeselecttool[.ch] * app/tools/gimpfuzzyselecttool[.ch] * app/tools/gimphistogramtool[.ch] * app/tools/gimphuesaturationtool[.ch] * app/tools/gimpinktool[.ch] * app/tools/gimpiscissorstool[.ch] * app/tools/gimplevelstool[.ch] * app/tools/gimpmagnifytool[.ch] * app/tools/gimpmeasuretool[.ch] * app/tools/gimpmovetool[.ch] * app/tools/gimppaintbrushtool[.ch] * app/tools/gimppainttool.c * app/tools/gimppathtool[.ch] * app/tools/gimppenciltool[.ch] * app/tools/gimpperspectivetool[.ch] * app/tools/gimpposterizetool[.ch] * app/tools/gimprectselecttool[.ch] * app/tools/gimprotatetool[.ch] * app/tools/gimpscaletool[.ch] * app/tools/gimpselectiontool.c * app/tools/gimpsheartool[.ch] * app/tools/gimpsmudgetool[.ch] * app/tools/gimptexttool[.ch] * app/tools/gimpthresholdtool[.ch] * app/tools/gimptool.c * app/tools/gimptoolcontrol.h * app/tools/gimptoolmodule[.ch] * app/tools/gimptransformtool.c * app/tools/gimpvectortool[.ch] * app/tools/path_tool.c * app/tools/tool_manager[.ch] * app/tools/tools.c * libgimptool/gimptool.c * libgimptool/gimptoolcontrol.h * libgimptool/gimptoolmodule.h: removed tons of warnings. Do we need to add -Werror to the CFLAGS to avoid such a mess in the future ?! Also had to enforce the GIMP coding style in lots of places :-( * libgimp/gimppixelrgn.c: got sick and tired of debugging plug-ins, so I've added checks for most parameters passed to the GimpPixelRgn functions. This will slow down plug-in execution a little bit but should help to find bugs early.
2002-05-03 19:31:08 +08:00
gimp_tool_control_set_cursor (tool->control, ctype);
added fields for both the tool's toggled and untoggled GdkCursorType, 2002-02-04 Michael Natterer <mitch@gimp.org> * app/tools/gimptool.[ch]: added fields for both the tool's toggled and untoggled GdkCursorType, GimpToolCursorType and GimpCursorModifier. Added a default implementation of gimp_tool_cursor_update() which uses the new fields. Added gimp_tool_set_cursor() as simple wrapper around the resp. GimpDisplayShell functions so tools don't need to know them. Tool implementations can either set the new fields in their cursor_update() function and chain up or call the new wrapper. * app/tools/gimpbezierselecttool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimpiscissorstool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimpmovetool.c * app/tools/gimppainttool.[ch] * app/tools/gimppathtool.c * app/tools/gimpselectiontool.c * app/tools/gimpsmudgetool.c * app/tools/gimptexttool.c * app/tools/gimptransformtool.c: changed accordingly: - set default values in the tools' instance_init functions. - changed the cursor_update() stuff. - removed inclusion of subclasses in gimppainttool.c - the cursor_update() functions are better than before but still evil. - i probably broke some of them...
2002-02-05 01:43:01 +08:00
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
1999-05-15 20:13:43 +08:00
}
static void
gimp_clone_tool_oper_update (GimpTool *tool,
GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display)
{
GimpCloneTool *clone_tool = GIMP_CLONE_TOOL (tool);
GimpCloneOptions *options;
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity,
display);
if (options->clone_type == GIMP_IMAGE_CLONE && proximity)
{
GimpClone *clone = GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core);
if (clone->src_drawable == NULL)
{
gimp_tool_replace_status (tool, display,
_("Ctrl-Click to set a clone source."));
}
else
{
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
clone_tool->src_x = clone->src_x;
clone_tool->src_y = clone->src_y;
if (! clone->first_stroke)
{
if (options->align_mode == GIMP_CLONE_ALIGN_YES)
{
clone_tool->src_x = coords->x + clone->offset_x;
clone_tool->src_y = coords->y + clone->offset_y;
}
else if (options->align_mode == GIMP_CLONE_ALIGN_REGISTERED)
{
clone_tool->src_x = coords->x;
clone_tool->src_y = coords->y;
}
}
gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
}
}
}
1997-11-25 06:05:25 +08:00
static void
gimp_clone_tool_draw (GimpDrawTool *draw_tool)
1997-11-25 06:05:25 +08:00
{
GimpTool *tool = GIMP_TOOL (draw_tool);
GimpCloneTool *clone_tool = GIMP_CLONE_TOOL (draw_tool);
GimpClone *clone = GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core);
GimpCloneOptions *options;
made the gimp_object_get_memsize() debugging output configurable by a 2002-02-06 Michael Natterer <mitch@gimp.org> * app/core/gimpobject.c: made the gimp_object_get_memsize() debugging output configurable by a global "gimp_debug_memsize" boolean. * app/display/gimpdisplay.c: removed duplicated prototype. * app/display/gimpdisplayshell.[ch]: renamed the various cursor functions to be more consistent and shorter. Compress window title updates by adding a "gboolean title_dirty" and updating the title in gimp_display_shell_flush(). Added "%m" (memory size) to the possible title string substitutions. * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell-handlers.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimptool.c: changed accordingly. * app/display/gimpdisplayshell-callbacks.c: forgot to grab the pointer when dragging guides from the rulers. Coincidentially, this also fixes the buggy offset between guide and mouse pointer... Cleaned up the main tool event callback a but more. * app/widgets/gimppreview.c * app/gui/commands.c: set the new global "gimp_debug_memsize" toggle to TRUE while calling gimp_object_get_memsize(). * app/gui/preferences-dialog.c: added a image title example containing the new "%m" feature. * docs/gimprc-1.3.5.in: document "%m" in the manpage. * app/tools/gimpbezierselecttool.c: reordered some statements. * app/tools/gimpdrawtool.[ch]: store the GimpDisplay passed to gimp_draw_tool_start() in draw_tool->gdisp and use it for coordinate transfomration. This way we can paint on a display which is not tool->gdisp. * app/tools/gimppainttool.c: changed the gimp_draw_tool_foo() calls needed to make the straight_line preview work in a way that does not interfere with paint_tool subclasses which want to do their own drawing (like the clone tool). Also changed the paint_tools PRETRACE_PAINT and POSTTRACE_PAINT flags usage in a way that subclasses can use them without major hackery: don't simply wrap gimp_display_flush_now() with PRETRACE/POSTTRACE calls, but wrap the actual painting calls, so subclasses are able to do useful things with paint_tool->*_coords. * app/tools/gimpclonetool.c: removed poking around in draw_tool internals and simply suspend()/resume() it in PRETRACE_PAINT/POSTTRACE_PAINT to get the clone_src indicator drawn correctly.
2002-02-07 19:33:01 +08:00
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
if (options->clone_type == GIMP_IMAGE_CLONE &&
clone->src_drawable && clone_tool->src_display)
{
GimpDisplay *tmp_display;
gint off_x;
gint off_y;
gimp_item_offsets (GIMP_ITEM (clone->src_drawable), &off_x, &off_y);
tmp_display = draw_tool->display;
draw_tool->display = clone_tool->src_display;
gimp_draw_tool_draw_handle (draw_tool,
GIMP_HANDLE_CROSS,
clone_tool->src_x + off_x,
clone_tool->src_y + off_y,
TARGET_WIDTH, TARGET_WIDTH,
GTK_ANCHOR_CENTER,
FALSE);
draw_tool->display = tmp_display;
made the gimp_object_get_memsize() debugging output configurable by a 2002-02-06 Michael Natterer <mitch@gimp.org> * app/core/gimpobject.c: made the gimp_object_get_memsize() debugging output configurable by a global "gimp_debug_memsize" boolean. * app/display/gimpdisplay.c: removed duplicated prototype. * app/display/gimpdisplayshell.[ch]: renamed the various cursor functions to be more consistent and shorter. Compress window title updates by adding a "gboolean title_dirty" and updating the title in gimp_display_shell_flush(). Added "%m" (memory size) to the possible title string substitutions. * app/display/gimpdisplay-foreach.c * app/display/gimpdisplayshell-handlers.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimptool.c: changed accordingly. * app/display/gimpdisplayshell-callbacks.c: forgot to grab the pointer when dragging guides from the rulers. Coincidentially, this also fixes the buggy offset between guide and mouse pointer... Cleaned up the main tool event callback a but more. * app/widgets/gimppreview.c * app/gui/commands.c: set the new global "gimp_debug_memsize" toggle to TRUE while calling gimp_object_get_memsize(). * app/gui/preferences-dialog.c: added a image title example containing the new "%m" feature. * docs/gimprc-1.3.5.in: document "%m" in the manpage. * app/tools/gimpbezierselecttool.c: reordered some statements. * app/tools/gimpdrawtool.[ch]: store the GimpDisplay passed to gimp_draw_tool_start() in draw_tool->gdisp and use it for coordinate transfomration. This way we can paint on a display which is not tool->gdisp. * app/tools/gimppainttool.c: changed the gimp_draw_tool_foo() calls needed to make the straight_line preview work in a way that does not interfere with paint_tool subclasses which want to do their own drawing (like the clone tool). Also changed the paint_tools PRETRACE_PAINT and POSTTRACE_PAINT flags usage in a way that subclasses can use them without major hackery: don't simply wrap gimp_display_flush_now() with PRETRACE/POSTTRACE calls, but wrap the actual painting calls, so subclasses are able to do useful things with paint_tool->*_coords. * app/tools/gimpclonetool.c: removed poking around in draw_tool internals and simply suspend()/resume() it in PRETRACE_PAINT/POSTTRACE_PAINT to get the clone_src indicator drawn correctly.
2002-02-07 19:33:01 +08:00
}
GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
1997-11-25 06:05:25 +08:00
}
Core/UI separation for the paint tools: 2002-02-14 Michael Natterer <mitch@gimp.org> Core/UI separation for the paint tools: * configure.in * app/Makefile.am * app/paint/.cvsignore * app/paint/Makefile.am: added new directory for the paint methods without GUI and tools around them. * app/paint/paint-types.h: typedefs for this module. * app/paint/gimppaintcore-kernels.h * app/paint/gimppaintcore.[ch]: the general paint logic taken from GimpPaintTool. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.[ch] * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: subclasses of GimpPaintCore, implementing their own paint() methods. Needs more hacking to get the GtkWidget pointers out of the options structs. * app/tools/gimppainttool_kernels.h: removed. * app/tools/tools-types.h: removed the paint tool enums. * app/tools/gimpairbrushtool.[ch] * app/tools/gimpclonetool.[ch] * app/tools/gimpconvolvetool.[ch] * app/tools/gimpdodgeburntool.[ch] * app/tools/gimperasertool.[ch] * app/tools/gimppaintbrushtool.[ch] * app/tools/gimppainttool.[ch] * app/tools/gimppenciltool.[ch] * app/tools/gimpsmudgetool.[ch]: all paint tools are pure GUI things now. PaintOptions and friends still need to be chopped up though... * app/undo.c: changed PaintUndo to GimpPaintCoreUndo, some minor cleanup. * tools/kernelgen.c: changed accordingly. * tools/pdbgen/Makefile.am: scan paint/paint-types.h for enums. * tools/pdbgen/pdb/paint_tools.pdb: hardcode "success = FALSE" for all paint PDB wrappers. The non-gui stuff is completely broken. More commits to come... * app/pdb/paint_tools_cmds.c * tools/pdbgen/enums.pl: regenerated.
2002-02-15 03:31:16 +08:00
Made the paint tool PDB wrappers work again (a bit at least...) 2002-02-21 Michael Natterer <mitch@gimp.org> Made the paint tool PDB wrappers work again (a bit at least...) * app/Makefile.am: changed linking order. libtool sucks. * app/undo.c: check if active_tool is a GimpPaintTool before casting it. * app/paint/Makefile.am * app/paint/paint-types.h: added new files/types. * app/paint/gimppaintoptions.[ch]: new files cut out of tools/paint_options.h. Prefixed everything with "Gimp". There is still GtkWidget* cruft hanging around in the structs... * app/paint/gimppaintcore-stroke.[ch]: utility function which paints a stroke array. Needed for the PDB wrappers. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.c * app/paint/gimppaintcore.[ch] * app/paint/gimppencil.c * app/paint/gimpsmudge.[ch]: added *_options_new() functions which create correctly initialized options structures without widgets. * app/tools/paint_options.[ch]: removed the options struct definitions and value initialisations. * app/tools/gimpairbrushtool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpclonetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpinktool.c * app/tools/gimppaintbrushtool.c * app/tools/gimppainttool.c * app/tools/gimppenciltool.c * app/tools/gimpsmudgetool.c: changed all paint_options functions accordingly, s/PaintOptions/GimpPaintOptions/g etc., removed all #if 0'ed non_gui functions. * tools/pdbgen/pdb/paint_tools.pdb: use gimp_paint_core_stroke(). We currently leak all paint_options structs created by the PDB wrappers, more stuff to come... * app/pdb/paint_tools_cmds.c: regenerated.
2002-02-22 00:02:30 +08:00
/* tool options stuff */
simplified everything a lot by merging the public GimpContextPropType enum 2003-02-09 Michael Natterer <mitch@gimp.org> * app/core/gimpcontext.[ch]: simplified everything a lot by merging the public GimpContextPropType enum with the internal anonymous object property id enum. Removed the internal copy_prop functions and handle property copying in a big switch() in gimp_context_copy_property(). Removed the separate signal connections for each property of the parent context and do the same using a single "notify" handler. Emit "notify" signals all over the place. Removed internal arrays which are no longer needed due to enum merge and copy_property simplification. Removed the array of signal names and use g_signal_name(). Removed gimp_context_unset_parent() and allow "parent" being NULL in gimp_context_set_parent(). * app/tools/tool_manager.c * app/widgets/gimpdevices.c: changed accordingly. * libgimptool/gimptooltypes.h: changed GimpToolOptionsGUIFunc to return a GtkWidget (the created tool options widget). * libgimptool/gimptoolmodule.c: #include <gtk/gtk.h> * app/tools/tool_options.[ch]: removed the "main_vbox" from the GimpToolOptions struct. Changed gimp_tool_options_gui() to create and return the main_vbox. * app/tools/tool_manager.c: create the "This Tool has no Options" label here if NULL was passed as "options_gui_func". Attach the options widget to the tool_options object using g_object_set_data(). * app/gui/tool-options-dialog.c: changed accordingly. * app/tools/gimpairbrushtool.c * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpclonetool.c * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpconvolvetool.c * app/tools/gimpcropoptions.[ch] * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.[ch] * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimpselectionoptions.[ch] * app/tools/gimpsmudgetool.c * app/tools/gimptextoptions.[ch] * app/tools/gimptransformoptions.[ch] * app/tools/gimpvectoroptions.[ch] * app/tools/paint_options.[ch]: return the options vbox from all tool_options_gui functions.
2003-02-10 01:32:52 +08:00
static GtkWidget *
Made GimpToolOptions a GimpContext subclass and objectified all tool 2003-02-05 Michael Natterer <mitch@gimp.org> Made GimpToolOptions a GimpContext subclass and objectified all tool options types. * app/core/core-types.h: replaced GimpToolOptionsNewFunc by GimpToolOptionsGUIFunc. * libgimpproxy/gimpproxytypes.h: regenerated. * app/core/gimppaintinfo.[ch]: added "GType paint_options_type". * app/core/gimptoolinfo.[ch]: added "GType tool_options_type", removed tool_info->context since GimpToolOptions are a GimpContext now. Added "gboolean use_context" as a temp_hack. * libgimptool/gimptooltypes.h: added the tool_options_type to the tool registering callback. * app/tools/tool_options.[ch]: is a real GimpContext subclass now. * app/paint/paint-types.h * app/paint/paint.c: added the paint_options_type to the paint registering stuff. * app/paint/gimppaintoptions.[ch]: is a real GimpToolOptions subclass now. * app/paint/Makefile.am * app/paint/gimpairbrushoptions.[ch] * app/paint/gimpcloneoptions.[ch] * app/paint/gimpconvolveoptions.[ch] * app/paint/gimpdodgeburnoptions.[ch] * app/paint/gimperaseroptions.[ch] * app/paint/gimpsmudgeoptions.[ch]: new files holding GimpPaintOptions subclasses. * app/paint/gimpairbrush.[ch] * app/paint/gimpclone.[ch] * app/paint/gimpconvolve.[ch] * app/paint/gimpdodgeburn.[ch] * app/paint/gimperaser.[ch] * app/paint/gimppaintbrush.c * app/paint/gimppaintcore.c * app/paint/gimppencil.[ch] * app/paint/gimpsmudge.[ch]: removed paint options stuff, lots of related changed & cleanups. * tools/pdbgen/pdb/paint_tools.pdb: changed accordingly. * app/pdb/paint_tools_cmds.c: regenerated. * app/tools/Makefile.am * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpcropoptions.[ch] * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.[ch] * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimptextoptions.[ch] * app/tools/gimpvectoroptions.[ch]: new files holding the various tool options classes. * app/tools/selection_options.[ch] * app/tools/transform_options.[ch]: made them objects. * app/tools/paint_options.[ch]: contains only the paint_options GUI and reset stuff. * app/tools/tools-types.h: removed SelectionOptions typedef for now. * app/tools/[all tools]: removed the tool options stuff except some GUI constructors. Tons of related changes. * app/tools/tool_manager.[ch]: changed tool registration / restore / switching accordingly. * app/widgets/gimpdrawablelistview.c * app/widgets/gimpselectioneditor.c: changed accordingly.
2003-02-05 22:39:40 +08:00
gimp_clone_options_gui (GimpToolOptions *tool_options)
{
GObject *config = G_OBJECT (tool_options);
Added object properties for almost all tool_options values and registered 2003-02-07 Michael Natterer <mitch@gimp.org> Added object properties for almost all tool_options values and registered lots of enums with the type system: Part I (enum and type cleanup): * app/core/core-enums.[ch] * app/core/core-types.h: removed InternalOrientaionType and register GimpOrientationType. Register GimpChannelOps. Removed GimpToolOptionsGUIFunc. * app/xcf/xcf-private.h: added XcfOrientationType with the same values as the old InternalOrientationType * app/xcf/xcf-load.c * app/xcf/xcf-save.c: translate between GimpOrientationType and XcfOrientationType. * app/core/gimpdrawable-transform-utils.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-guides.c * app/core/gimpimage-resize.c * app/core/gimpimage-scale.c * app/core/gimpimage.h * app/display/gimpdisplayshell.c * tools/pdbgen/stddefs.pdb * tools/pdbgen/pdb/transform_tools.pdb: changed accordingly. * app/pdb/guides_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpenums.h * libgimpproxy/gimpproxytypes.h * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated. * libgimptool/gimptoolenums.[ch]: added GimpTransformGridType. * libgimptool/gimptooltypes.h: removed GimpToolOptionsResetFunc, added GimpToolOptionsGUIFunc. Part II (tool options changes): * app/config/gimpconfig-utils.c (gimp_config_reset_properties): don't reset object properties because they have NULL as default value. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_[enum|boolean]_radio_frame_new(), gimp_prop_paint_mode_menu_new() and gimp_prop_scale_entry_new(), which are all needed by the new tool options GUI code. * app/tools/tool_options.[ch]: removed the "reset_func" since the virtual reset() method is used now. * app/paint/gimpairbrushoptions.[ch] * app/paint/gimpcloneoptions.[ch] * app/paint/gimpconvolveoptions.[ch] * app/paint/gimpdodgeburnoptions.[ch] * app/paint/gimperaseroptions.[ch] * app/paint/gimppaintoptions.[ch] * app/paint/gimpsmudgeoptions.[ch]: added properties all over the place and removed the widget and default_value members from the structs. Renamed some values (e.g. s/type/clone_type/). Don't #include <gtk/gtk.h>. * app/paint/gimpairbrush.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/paint/gimppaintcore-stroke.c * app/paint/gimppaintcore.c * app/paint/gimppencil.c * app/paint/gimpsmudge.c * app/paint/paint-types.h * app/paint/paint.c: changed accordingly. Don't #include <gtk/gtk.h>. * tools/pdbgen/pdb/paint_tools.pdb: changed accordingly. * app/pdb/paint_tools_cmds.c: regenerated. * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpcropoptions.[ch] * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.c * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimptextoptions.c * app/tools/paint_options.[ch] * app/tools/selection_options.[ch] * app/tools/transform_options.[ch]: ditto: added properties and removed widget and default_value stuff. Removed most reset functions. Use gimp_prop widgets all over the place, renamed some values as above. * app/tools/Makefile.am * app/tools/gimpairbrushtool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/tools/gimpselectiontool.c * app/tools/gimpsheartool.c * app/tools/gimpsmudgetool.c * app/tools/gimptransformtool.c * app/tools/gimpvectoroptions.c: changed accordingly. Ported the paint_options GUI constructors to gimp_prop widgets. * app/widgets/gimpselectioneditor.c * app/gui/tool-options-dialog.c: changed accordingly.
2003-02-08 01:12:21 +08:00
GtkWidget *vbox;
GtkWidget *frame;
Immplement "Sample Merged" for the clone tool. Fixes bug #123627. 2005-08-28 Michael Natterer <mitch@gimp.org> Immplement "Sample Merged" for the clone tool. Fixes bug #123627. * app/paint/gimppaintcore.[ch] (struct GimpPaintCore): added members "saved_proj_tiles" which stores the unmodified projection, "orig_proj_buf" which stores the unmodified temp paint application buf and "use_saved_proj" which controls if all the additional stuff should be allocated and managed. (gimp_paint_core_start): allocate the saved_proj_tiles if needed. (gimp_paint_core_get_orig_proj): new function like gimp_paint_core_get_orig_image() which returns unmodified projection pixels for paint application. (gimp_paint_core_validate_saved_proj_tiles): new function like gimp_paint_core_validate_undo_tiles() which copies the tiles that will be dirtied to saved_proj_tiles. (gimp_paint_core_paste): call above save_proj_tiles() so projection tiles are saved before dirtying them. * app/paint/gimpclone.[ch]: replaced member src_drawable by src_pickable and use the image's projection if sample_merged it TRUE. Adjust src offsets accordingly and use GimpPaintCore's new get_orig_proj() API to get the src pixels. * app/paint/gimpcloneoptions.[ch]: added boolean "sample_merged" property. * app/tools/gimpclonetool.c: follow GimpClone's src_drawable -> src_pickable change. (gimp_clone_tool_button_press): set the paint_core's "use_saved_proj" boolean before chaining up. (gimp_clone_options_gui): add a "Sample Merged" toggle button.
2005-08-29 03:17:44 +08:00
GtkWidget *button;
GtkWidget *hbox;
GtkWidget *table;
GtkWidget *combo;
simplified everything a lot by merging the public GimpContextPropType enum 2003-02-09 Michael Natterer <mitch@gimp.org> * app/core/gimpcontext.[ch]: simplified everything a lot by merging the public GimpContextPropType enum with the internal anonymous object property id enum. Removed the internal copy_prop functions and handle property copying in a big switch() in gimp_context_copy_property(). Removed the separate signal connections for each property of the parent context and do the same using a single "notify" handler. Emit "notify" signals all over the place. Removed internal arrays which are no longer needed due to enum merge and copy_property simplification. Removed the array of signal names and use g_signal_name(). Removed gimp_context_unset_parent() and allow "parent" being NULL in gimp_context_set_parent(). * app/tools/tool_manager.c * app/widgets/gimpdevices.c: changed accordingly. * libgimptool/gimptooltypes.h: changed GimpToolOptionsGUIFunc to return a GtkWidget (the created tool options widget). * libgimptool/gimptoolmodule.c: #include <gtk/gtk.h> * app/tools/tool_options.[ch]: removed the "main_vbox" from the GimpToolOptions struct. Changed gimp_tool_options_gui() to create and return the main_vbox. * app/tools/tool_manager.c: create the "This Tool has no Options" label here if NULL was passed as "options_gui_func". Attach the options widget to the tool_options object using g_object_set_data(). * app/gui/tool-options-dialog.c: changed accordingly. * app/tools/gimpairbrushtool.c * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpclonetool.c * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpconvolvetool.c * app/tools/gimpcropoptions.[ch] * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.[ch] * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimpselectionoptions.[ch] * app/tools/gimpsmudgetool.c * app/tools/gimptextoptions.[ch] * app/tools/gimptransformoptions.[ch] * app/tools/gimpvectoroptions.[ch] * app/tools/paint_options.[ch]: return the options vbox from all tool_options_gui functions.
2003-02-10 01:32:52 +08:00
vbox = gimp_paint_options_gui (tool_options);
Added object properties for almost all tool_options values and registered 2003-02-07 Michael Natterer <mitch@gimp.org> Added object properties for almost all tool_options values and registered lots of enums with the type system: Part I (enum and type cleanup): * app/core/core-enums.[ch] * app/core/core-types.h: removed InternalOrientaionType and register GimpOrientationType. Register GimpChannelOps. Removed GimpToolOptionsGUIFunc. * app/xcf/xcf-private.h: added XcfOrientationType with the same values as the old InternalOrientationType * app/xcf/xcf-load.c * app/xcf/xcf-save.c: translate between GimpOrientationType and XcfOrientationType. * app/core/gimpdrawable-transform-utils.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-guides.c * app/core/gimpimage-resize.c * app/core/gimpimage-scale.c * app/core/gimpimage.h * app/display/gimpdisplayshell.c * tools/pdbgen/stddefs.pdb * tools/pdbgen/pdb/transform_tools.pdb: changed accordingly. * app/pdb/guides_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpenums.h * libgimpproxy/gimpproxytypes.h * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated. * libgimptool/gimptoolenums.[ch]: added GimpTransformGridType. * libgimptool/gimptooltypes.h: removed GimpToolOptionsResetFunc, added GimpToolOptionsGUIFunc. Part II (tool options changes): * app/config/gimpconfig-utils.c (gimp_config_reset_properties): don't reset object properties because they have NULL as default value. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_[enum|boolean]_radio_frame_new(), gimp_prop_paint_mode_menu_new() and gimp_prop_scale_entry_new(), which are all needed by the new tool options GUI code. * app/tools/tool_options.[ch]: removed the "reset_func" since the virtual reset() method is used now. * app/paint/gimpairbrushoptions.[ch] * app/paint/gimpcloneoptions.[ch] * app/paint/gimpconvolveoptions.[ch] * app/paint/gimpdodgeburnoptions.[ch] * app/paint/gimperaseroptions.[ch] * app/paint/gimppaintoptions.[ch] * app/paint/gimpsmudgeoptions.[ch]: added properties all over the place and removed the widget and default_value members from the structs. Renamed some values (e.g. s/type/clone_type/). Don't #include <gtk/gtk.h>. * app/paint/gimpairbrush.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/paint/gimppaintcore-stroke.c * app/paint/gimppaintcore.c * app/paint/gimppencil.c * app/paint/gimpsmudge.c * app/paint/paint-types.h * app/paint/paint.c: changed accordingly. Don't #include <gtk/gtk.h>. * tools/pdbgen/pdb/paint_tools.pdb: changed accordingly. * app/pdb/paint_tools_cmds.c: regenerated. * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpcropoptions.[ch] * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.c * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimptextoptions.c * app/tools/paint_options.[ch] * app/tools/selection_options.[ch] * app/tools/transform_options.[ch]: ditto: added properties and removed widget and default_value stuff. Removed most reset functions. Use gimp_prop widgets all over the place, renamed some values as above. * app/tools/Makefile.am * app/tools/gimpairbrushtool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/tools/gimpselectiontool.c * app/tools/gimpsheartool.c * app/tools/gimpsmudgetool.c * app/tools/gimptransformtool.c * app/tools/gimpvectoroptions.c: changed accordingly. Ported the paint_options GUI constructors to gimp_prop widgets. * app/widgets/gimpselectioneditor.c * app/gui/tool-options-dialog.c: changed accordingly.
2003-02-08 01:12:21 +08:00
frame = gimp_prop_enum_radio_frame_new (config, "clone-type",
_("Source"), 0, 0);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
button = gimp_prop_check_button_new (config, "sample-merged",
_("Sample merged"));
gimp_enum_radio_frame_add (GTK_FRAME (frame), button, GIMP_IMAGE_CLONE);
hbox = gimp_prop_pattern_box_new (NULL, GIMP_CONTEXT (tool_options), 2,
"pattern-view-type", "pattern-view-size");
gimp_enum_radio_frame_add (GTK_FRAME (frame), hbox, GIMP_PATTERN_CLONE);
table = gtk_table_new (1, 2, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 2);
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
combo = gimp_prop_enum_combo_box_new (config, "align-mode", 0, 0);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
_("Alignment:"), 0.0, 0.5,
combo, 1, FALSE);
simplified everything a lot by merging the public GimpContextPropType enum 2003-02-09 Michael Natterer <mitch@gimp.org> * app/core/gimpcontext.[ch]: simplified everything a lot by merging the public GimpContextPropType enum with the internal anonymous object property id enum. Removed the internal copy_prop functions and handle property copying in a big switch() in gimp_context_copy_property(). Removed the separate signal connections for each property of the parent context and do the same using a single "notify" handler. Emit "notify" signals all over the place. Removed internal arrays which are no longer needed due to enum merge and copy_property simplification. Removed the array of signal names and use g_signal_name(). Removed gimp_context_unset_parent() and allow "parent" being NULL in gimp_context_set_parent(). * app/tools/tool_manager.c * app/widgets/gimpdevices.c: changed accordingly. * libgimptool/gimptooltypes.h: changed GimpToolOptionsGUIFunc to return a GtkWidget (the created tool options widget). * libgimptool/gimptoolmodule.c: #include <gtk/gtk.h> * app/tools/tool_options.[ch]: removed the "main_vbox" from the GimpToolOptions struct. Changed gimp_tool_options_gui() to create and return the main_vbox. * app/tools/tool_manager.c: create the "This Tool has no Options" label here if NULL was passed as "options_gui_func". Attach the options widget to the tool_options object using g_object_set_data(). * app/gui/tool-options-dialog.c: changed accordingly. * app/tools/gimpairbrushtool.c * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpclonetool.c * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpconvolvetool.c * app/tools/gimpcropoptions.[ch] * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.[ch] * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimpselectionoptions.[ch] * app/tools/gimpsmudgetool.c * app/tools/gimptextoptions.[ch] * app/tools/gimptransformoptions.[ch] * app/tools/gimpvectoroptions.[ch] * app/tools/paint_options.[ch]: return the options vbox from all tool_options_gui functions.
2003-02-10 01:32:52 +08:00
return vbox;
}