gimp/app/tools/gimpcurvestool.h

70 lines
2.2 KiB
C
Raw Normal View History

/* GIMP - The GNU 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
1997-11-25 06:05:25 +08:00
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
1997-11-25 06:05:25 +08:00
* (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, see <https://www.gnu.org/licenses/>.
1997-11-25 06:05:25 +08:00
*/
#ifndef __GIMP_CURVES_TOOL_H__
#define __GIMP_CURVES_TOOL_H__
#include "gimpfiltertool.h"
1997-11-25 06:05:25 +08:00
#define GIMP_TYPE_CURVES_TOOL (gimp_curves_tool_get_type ())
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) 2001-07-24 Michael Natterer <mitch@gimp.org> Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning) * configure.in: require glib/gtk+ >= 1.3.7, commented out the gtkxmhtml stuff. From now on, you will need glib, pango, atk and gtk+ HEAD from CVS to hack or use GIMP HEAD. Beware, it crashes randomly :) * app/core/Makefile.am * app/core/gimpmarshal.list: new file plus rules to generate gimpmarshal.[ch] from it. * app/core/* * app/tools/* * app/widgets/* * libgimpwidgets/*: started to use the glib object system. All core/ objects are still gtk objects however. All signals are created using g_signal_new(). There are many gtk+ artefacts left. Finally, we will _not_ use the gtk_signal_foo() wrappers and friends any more. * app/colormaps.c * app/devices.[ch] * app/disp_callbacks.c * app/errorconsole.c * app/file-save.[ch] * app/interface.c * app/module_db.c * app/nav_window.c * app/ops_buttons.c * app/scroll.c * app/user_install.c * app/gui/about-dialog.c * app/gui/brush-editor.c * app/gui/brushes-commands.c * app/gui/color-notebook.c * app/gui/colormap-dialog.c * app/gui/dialogs-commands.c * app/gui/dialogs-constructors.c * app/gui/file-commands.c * app/gui/file-dialog-utils.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.[ch] * app/gui/file-save-dialog.c * app/gui/gradient-editor.c * app/gui/gradients-commands.c * app/gui/image-commands.c * app/gui/info-dialog.[ch] * app/gui/layer-select.c * app/gui/layers-commands.c * app/gui/menus.c * app/gui/offset-dialog.c * app/gui/palette-editor.c * app/gui/palettes-commands.c * app/gui/patterns-commands.c * app/gui/preferences-dialog.c * app/gui/resize-dialog.[ch] * app/gui/splash.c * app/gui/tips-dialog.c * app/gui/tool-options-dialog.c * app/gui/toolbox.c * app/gui/tools-commands.c * libgimp/gimpbrushmenu.c * libgimp/gimpmenu.c * libgimp/gimppatternmenu.c * libgimp/gimpui.c * libgimpbase/gimpenv.c: tons and tons of changes like "const gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete and currently disables), lots of s/gtk_signal/g_signal/, removal/replacement of deprecated stuff, s/GtkSignalFunc/GCallback/ and lots of small changes and fixes while I was on it, zillions of warnings left... * modules/Makefile.am: disabled the water color selector temporarily (XInput issues). * plug-ins/Makefile.am * plug-ins/common/.cvsignore * plug-ins/common/Makefile.am * plug-ins/common/plugin-defs.pl: simply excluded all plug-ins which did not build (including Script-Fu). They are trivial to fix.
2001-07-25 05:27:11 +08:00
#define GIMP_CURVES_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_CURVES_TOOL, GimpCurvesTool))
#define GIMP_IS_CURVES_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_CURVES_TOOL))
#define GIMP_CURVES_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CURVES_TOOL, GimpCurvesToolClass))
#define GIMP_IS_CURVES_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CURVES_TOOL))
typedef struct _GimpCurvesTool GimpCurvesTool;
typedef struct _GimpCurvesToolClass GimpCurvesToolClass;
struct _GimpCurvesTool
{
GimpFilterTool parent_instance;
Color correction tool chopping: 2002-08-26 Michael Natterer <mitch@gimp.org> Color correction tool chopping: * app/Makefile.am * app/image_map.[ch]: removed... * app/core/Makefile.am * app/core/core-types.h * app/core/gimpimagemap.[ch]: ...and added here as object. * app/base/Makefile.am * app/base/base-types.h * app/base/color-balance.[ch] * app/base/curves.[ch] * app/base/hue-saturation.[ch] * app/base/threshold.[ch]: the lowlevel color correction functions plus their parameter structs cut out of the resp. tools. * app/core/core-enums.[ch]: removed GimpTransferMode enum... * app/base/base-enums.[ch]: ...added it here. Also added GimpHueRange for the new hue-saturation files. * tools/pdbgen/enums.pl * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c: regenerated. * app/tools/Makefile.am * app/tools/gimpcolorbalancetool-transfer.c: removed (code went to base/color-balance.c). * app/tools/gimpimagemaptool.[ch]: added most code which was diplicated in subclasses. Create the dialog here with a nice title bar including image preview and name (fixes #66033). Added virtual functions map(), dialog() and reset() which need to be implemented by subclasses. * app/tools/gimpbrightnesscontrasttool.[ch] * app/tools/gimpcolorbalancetool.[ch] * app/tools/gimpcurvestool.[ch] * app/tools/gimphuesaturationtool.[ch] * app/tools/gimplevelstool.[ch] * app/tools/gimpposterizetool.[ch] * app/tools/gimpthresholdtool.[ch]: removed tons of duplicated code and simply implement GimpImageMapTool's virtual functions. Removed all dialog structs and keep the variables in the tool structs. The dialogs are now created on-the-fly and destroyed when the tool goes away, which makes all callbacks much simpler and safer. Lots of GUI & code cleanup in all dialogs. * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c: added separate "Reset Channel" buttons and let the global "Reset" buttons reset all color channels. * app/tools/tools.c: the various antique foo_free() functions don't exist any more. * app/tools/gimphistogramtool.c: removed ImageMap field from dialog struct (it was unused). Cleaned up dialog a bit. * tools/pdbgen/Makefile.am: don't scan tools/gimphuesaturationtool.h for enums. * tools/pdbgen/pdb/color.pdb: use the new stuff from base/ and don't include stuff from tools/ any more. * app/pdb/color_cmds.c * app/pdb/paint_tools_cmds.c: regenerated.
2002-08-26 19:35:56 +08:00
/* dialog */
gdouble scale;
gdouble picked_color[5];
More color correction stuff cleanup: 2002-09-04 Michael Natterer <mitch@gimp.org> More color correction stuff cleanup: * app/base/Makefile.am * app/base/base-types.h * app/base/levels.[ch]: new files containing levels_lut_func(), a new "Levels" parameter struct and the "auto levels" stuff. * app/base/lut-funcs.[ch]: removed the levels stuff here, added lots of g_return_if_fail(). * app/base/color-balance.[ch] * app/base/hue-saturation.[ch]: added init() and reset() functions so we don't need to duplicate this code in the tool and the pdb wrappers. * app/base/curves.[ch]: s/gint/GimpHistogramChannel/g, made curves_channel_reset() initialize the curves array. * app/tools/gimpcolorbalancetool.[ch]: use the new functions, moved the "Range" frame to the top, added a per-range "Reset" button, made the global "Reset" button reset all ranges and the "Preserve Luminosity" toggle. * app/tools/gimpcurvestool.[ch]: don't initialize the curves array manually, as curves_channel_reset() does that, s/gint/GimpHistogramChannel/g. * app/tools/gimphuesaturationtool.c: use the new functions, added a per-channel "Reset" button and made the global "Reset" button reset all channels, cleaned up the GUI update function. * app/tools/gimplevelstool.[ch]: changed to use the new Levels parameter struct and it's utility functions. Removed stuff which now lives in base/levels.c * app/tools/gimpimagemaptool.c: align the "Preview" button bottom-left, not bottom-right. * tools/pdbgen/pdb/color.pdb: use the new stuff and removed uglyness because using the "Levels" struct makes the code more straightforward. * app/pdb/color_cmds.c: regenerated.
2002-09-04 23:25:15 +08:00
GtkWidget *channel_menu;
GtkWidget *xrange;
GtkWidget *yrange;
GtkWidget *graph;
GtkWidget *point_box;
GtkWidget *point_input;
GtkWidget *point_output;
GtkWidget *point_type;
GtkWidget *curve_type;
/* export dialog */
gboolean export_old_format;
Color correction tool chopping: 2002-08-26 Michael Natterer <mitch@gimp.org> Color correction tool chopping: * app/Makefile.am * app/image_map.[ch]: removed... * app/core/Makefile.am * app/core/core-types.h * app/core/gimpimagemap.[ch]: ...and added here as object. * app/base/Makefile.am * app/base/base-types.h * app/base/color-balance.[ch] * app/base/curves.[ch] * app/base/hue-saturation.[ch] * app/base/threshold.[ch]: the lowlevel color correction functions plus their parameter structs cut out of the resp. tools. * app/core/core-enums.[ch]: removed GimpTransferMode enum... * app/base/base-enums.[ch]: ...added it here. Also added GimpHueRange for the new hue-saturation files. * tools/pdbgen/enums.pl * libgimp/gimpenums.h * plug-ins/script-fu/script-fu-constants.c: regenerated. * app/tools/Makefile.am * app/tools/gimpcolorbalancetool-transfer.c: removed (code went to base/color-balance.c). * app/tools/gimpimagemaptool.[ch]: added most code which was diplicated in subclasses. Create the dialog here with a nice title bar including image preview and name (fixes #66033). Added virtual functions map(), dialog() and reset() which need to be implemented by subclasses. * app/tools/gimpbrightnesscontrasttool.[ch] * app/tools/gimpcolorbalancetool.[ch] * app/tools/gimpcurvestool.[ch] * app/tools/gimphuesaturationtool.[ch] * app/tools/gimplevelstool.[ch] * app/tools/gimpposterizetool.[ch] * app/tools/gimpthresholdtool.[ch]: removed tons of duplicated code and simply implement GimpImageMapTool's virtual functions. Removed all dialog structs and keep the variables in the tool structs. The dialogs are now created on-the-fly and destroyed when the tool goes away, which makes all callbacks much simpler and safer. Lots of GUI & code cleanup in all dialogs. * app/tools/gimpcurvestool.c * app/tools/gimplevelstool.c: added separate "Reset Channel" buttons and let the global "Reset" buttons reset all color channels. * app/tools/tools.c: the various antique foo_free() functions don't exist any more. * app/tools/gimphistogramtool.c: removed ImageMap field from dialog struct (it was unused). Cleaned up dialog a bit. * tools/pdbgen/Makefile.am: don't scan tools/gimphuesaturationtool.h for enums. * tools/pdbgen/pdb/color.pdb: use the new stuff from base/ and don't include stuff from tools/ any more. * app/pdb/color_cmds.c * app/pdb/paint_tools_cmds.c: regenerated.
2002-08-26 19:35:56 +08:00
};
struct _GimpCurvesToolClass
{
GimpFilterToolClass parent_class;
};
2002-03-29 11:50:29 +08:00
void gimp_curves_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);
bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. 2001-11-23 Sven Neumann <sven@gimp.org> * configure.in: bumped version number to 1.3.1. Require Glib/GTK+-1.3.11 and Pango-0.22. Removed GDK_DISABLE_COMPAT_H and GTK_DISABLE_COMPAT_H from our default CFLAGS since they don't exist any longer. * RELEASE-TO-CVS.patch: removed since the glib/gtk+ API is supposed to be frozen now. * HACKING: removed reference to RELEASE-TO-CVS.patch * app/gui/menus.c * app/tools/gimptexttool.c: applied RELEASE-TO-CVS.patch to conform to the new GTK+/Pango API. * app/core/Makefile.am: generate marshallers with gimp_marshal prefix. * app/core/gimpmarshal.list: added all marshallers we use. * app/core/gimpmarshal.[ch]: regenerated. * app/[lots of .c files]: use gimp_marshal_* for all marshallers. * data/images/ * app/app_procs.c * app/gui/splash.c: * libgimpbase/Makefile.am * libgimpbase/gimpbase.h * libgimpbase/gimputils.[ch]: removed since they are no longer needed. * app/gimprc.c * plug-ins/common/ps.c * plug-ins/gdyntext/gdyntext.c * plug-ins/gdyntext/gdyntextcompat.c * plug-ins/gfig/gfig.c * plug-ins/gflare/gflare.c * plug-ins/script-fu/script-fu-scripts.c: use glib functions instead of gimp_strescape() and gimpstrcompress(). * cleaned up all header files: use G_BEGIN_DECLS/G_END_DECLS, declared all _get_type function as G_GNUC_CONST. * tools/pdbgen/enumcode.pl * tools/pdbgen/lib.pl: make them generate header files using G_BEGIN_DECLS/G_END_DECLS. * pixmaps/Makefile.am * pixmaps/wilber3.xpm: removed ... * data/images/tips_wilber.png: ... and added here as PNG * app/gui/tips-dialog.c: load the Wilber on demand using GdkPixbuf. * data/images/gimp_splash.ppm: removed ... * data/images/gimp_splash.png: ... and added as PNG * app/app_procs.c * app/gui/splash.[ch]: load the splash image using GdkPixbuf. * app/gui/about-dialog.c: sink the GtkPreview.
2001-11-23 07:46:13 +08:00
GType gimp_curves_tool_get_type (void) G_GNUC_CONST;
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
#endif /* __GIMP_CURVES_TOOL_H__ */