gimp/app/tools/gimpsheartool.c

374 lines
9.5 KiB
C
Raw Normal View History

1997-11-25 06:05:25 +08:00
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1997-11-25 06:05:25 +08:00
*/
#include "config.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
#include <gtk/gtk.h>
#include "apptypes.h"
1997-11-25 06:05:25 +08:00
#include "appenv.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
#include "draw_core.h"
1997-11-25 06:05:25 +08:00
#include "drawable.h"
#include "gdisplay.h"
#include "gimage_mask.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
#include "gimpimage.h"
#include "gimpui.h"
#include "gimpprogress.h"
1997-11-25 06:05:25 +08:00
#include "info_dialog.h"
#include "shear_tool.h"
#include "selection.h"
#include "tile_manager.h"
#include "undo.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
#include "tools.h"
#include "tool_options.h"
#include "transform_core.h"
1997-11-25 06:05:25 +08:00
#include "transform_tool.h"
#include "libgimp/gimpmath.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
#include "libgimp/gimpintl.h"
1997-11-25 06:05:25 +08:00
/* index into trans_info array */
#define HORZ_OR_VERT 0
#define XSHEAR 1
#define YSHEAR 2
1997-11-25 06:05:25 +08:00
/* the minimum movement before direction of shear can be determined (pixels) */
#define MIN_MOVE 5
1997-11-25 06:05:25 +08:00
/* forward function declarations */
static TileManager * shear_tool_transform (Tool *tool,
GDisplay *gdisp,
TransformState state);
static void shear_tool_recalc (Tool *tool,
GDisplay *gdisp);
static void shear_tool_motion (Tool *tool,
GDisplay *gdisp);
static void shear_info_update (Tool *tool);
static void shear_x_mag_changed (GtkWidget *widget,
gpointer data);
static void shear_y_mag_changed (GtkWidget *widget,
gpointer data);
1997-11-25 06:05:25 +08:00
/* variables local to this file */
static gdouble xshear_val;
static gdouble yshear_val;
1997-11-25 06:05:25 +08:00
static TileManager *
shear_tool_transform (Tool *tool,
GDisplay *gdisp,
TransformState state)
1997-11-25 06:05:25 +08:00
{
TransformCore *transform_core;
1997-11-25 06:05:25 +08:00
transform_core = (TransformCore *) tool->private;
switch (state)
{
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
case TRANSFORM_INIT:
1997-11-25 06:05:25 +08:00
if (!transform_info)
{
app/Makefile.am app/gimphelp.[ch] new files 1999-09-27 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gimphelp.[ch] * app/gimpui.[ch]: new files * app/interface.[ch] * app/preferences_dialog.[ch] The GIMP Help System part 1: Press "F1" in any dialog to pop up the help page for this dialog. Moved the widget constructors from preferences_dialog.[ch] and the query boxes from interface.[ch] to gimpui.[ch]. The dialog constructors take a help_func and a help_data parameter and install the "F1" accelerator which emits the new "help" signal. The "help" signal callback calls help_func(help_data) which finally has to call gimp_help() which in turn invokes the help browser. Still have to find a proper way to (1) prevent "F1" being assigned to some menu item and (2) to catch "F1" while browsing the menu trees in order to pop up the help for the selected item. * app/menus.c: a <Toolbox>/File/Help... menu item. * app/commands.[ch]: a command callback for the "Help..." menu item. * app/gimprc.[ch]: new boolean gimprc variable "use_help". * app/info_dialog.[ch]: pass a help function and data to the info dialog constructor. * app/tools.[ch]: store the tools help page names in the tool info structure. Export a special tools_help_func() which shows the help page for the active tool. * app/[all files calling a dialog constructor]: pass the dialog's help page to the constructor. Most dialogs are now created by gimp_dialog_new() which also sets up the action_area and the WM delete event callback, so I removed the resp. code from these files. Fixed some minor bugs and did some other stuff but didn't change any logic except dialog creation. * plug-ins/helpbrowser/helpbrowser.c: don't try to call a running help browser and don't install any menu path (all done in app/gimphelp.[ch] now).
1999-09-28 01:58:10 +08:00
transform_info = info_dialog_new (_("Shear Information"),
gimp_standard_help_func,
"tools/transform_shear.html");
info_dialog_add_spinbutton (transform_info,
_("Shear Magnitude X:"),
&xshear_val,
-65536, 65536, 1, 15, 1, 1, 0,
shear_x_mag_changed, tool);
info_dialog_add_spinbutton (transform_info,
_("Y:"),
&yshear_val,
-65536, 65536, 1, 15, 1, 1, 0,
shear_y_mag_changed, tool);
1997-11-25 06:05:25 +08:00
}
Bit of a large checkin this - it's basically three things: 1 - GimpModules Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk> Bit of a large checkin this - it's basically three things: 1 - GimpModules using gmodules to dynamically load and initialise modules at gimp start of day. 2 - Color selectors now register themselves with a color notebook. 3 - progress bars have been cleaned up a bit, so now have progress indictations on all transform tool and gradient fill operations. Not done bucket fill, but that seems to be the next candidate. New directories: * modules/: new directory for dynamically loadable modules. New files: * modules/.cvsignore * modules/Makefile.am * modules/colorsel_gtk.c: GTK color selector wrapped up as a color selector the gimp can use. * app/gimpprogress.[ch]: progress bars within gimp core, either as popups, or in the status bar. This is mainly code moved out of plug-in.c * app/color_notebook.[ch]: color selector notebook, implementing very similar interface to color_select.h so it can be used as a drop-in replacement for it. * libgimp/color_selector.h: API color selectors need to implement to become a page in the color_notebook. * libgimp/gimpmodule.h: API gimp modules need to implement to be initialised by gimp at start of day. Modified files: * Makefile.am: add modules/ to SUBDIRS * libgimp/Makefile.am: install gimpmodule.h and color_selector.h * app/gimprc.[ch]: recognise module-path variable. * gimprc.in: set module-path variable to something sensible (currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules"). * app/Makefile.am: build color notebook and gimpprogress * app/app_procs.c: register internal GIMP color selector with color notebook. * app/asupsample.c: call progress function less frequently for better performance. * app/asupsample.h: progress_func_t typedef moved to gimpprogress.h * app/blend.c: make callbacks to a progress function * app/color_area.c: use a color notebook rather than a color selector * app/color_panel.c: ditto * app/color_select.c: export color selector interface for notebook * app/color_select.h: color_select_init() prototype * app/flip_tool.c: flip the image every time, rather than every second click. * app/interface.c: move progress bar stuff out to gimpprogress.c. Make the code actually work while we're at it. * app/interface.h: move prototypes for progress functions out to gimpprogress.h * app/plug_in.c: load and initialise modules (if possible). Move progress bar handling code out to gimpprogress.c * app/plug_in.h: keep only a gimp_progress * for each plugin, not a whole bunch of GtkWidgets. * app/scale_tool.c * app/rotate_tool.c * app/shear_tool.c * app/perspective_tool.c: progress bar during operation. De-sensitise the dialog to discourage the user from running two transforms in parallel. * app/transform_core.c: recalculate grid coords when bounding box changes. Only initialise the action area of the dialog once, to avoid multiple "ok" / "reset" buttons appearing. Undraw transform tool with correct matrix to get rid of handle remains on screen. Call a progress function as we apply the transform matrix. A few new i18n markups. Invalidate floating selection marching ants after applying matrix. * app/transform_core.h: transform_core_do() takes an optional progress callback argument (and data). * plug-ins/oilify/oilify.c: send progress bar updates after every pixel region, not only if they processed a multiple of 5 pixels (which was quite unlikely, and therefore gave a jerky progress indication).
1999-01-11 08:57:33 +08:00
gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), TRUE);
transform_core->trans_info[HORZ_OR_VERT] = ORIENTATION_UNKNOWN;
1997-11-25 06:05:25 +08:00
transform_core->trans_info[XSHEAR] = 0.0;
transform_core->trans_info[YSHEAR] = 0.0;
return NULL;
break;
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
case TRANSFORM_MOTION:
shear_tool_motion (tool, gdisp);
shear_tool_recalc (tool, gdisp);
1997-11-25 06:05:25 +08:00
break;
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
case TRANSFORM_RECALC:
shear_tool_recalc (tool, gdisp);
1997-11-25 06:05:25 +08:00
break;
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
case TRANSFORM_FINISH:
Bit of a large checkin this - it's basically three things: 1 - GimpModules Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk> Bit of a large checkin this - it's basically three things: 1 - GimpModules using gmodules to dynamically load and initialise modules at gimp start of day. 2 - Color selectors now register themselves with a color notebook. 3 - progress bars have been cleaned up a bit, so now have progress indictations on all transform tool and gradient fill operations. Not done bucket fill, but that seems to be the next candidate. New directories: * modules/: new directory for dynamically loadable modules. New files: * modules/.cvsignore * modules/Makefile.am * modules/colorsel_gtk.c: GTK color selector wrapped up as a color selector the gimp can use. * app/gimpprogress.[ch]: progress bars within gimp core, either as popups, or in the status bar. This is mainly code moved out of plug-in.c * app/color_notebook.[ch]: color selector notebook, implementing very similar interface to color_select.h so it can be used as a drop-in replacement for it. * libgimp/color_selector.h: API color selectors need to implement to become a page in the color_notebook. * libgimp/gimpmodule.h: API gimp modules need to implement to be initialised by gimp at start of day. Modified files: * Makefile.am: add modules/ to SUBDIRS * libgimp/Makefile.am: install gimpmodule.h and color_selector.h * app/gimprc.[ch]: recognise module-path variable. * gimprc.in: set module-path variable to something sensible (currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules"). * app/Makefile.am: build color notebook and gimpprogress * app/app_procs.c: register internal GIMP color selector with color notebook. * app/asupsample.c: call progress function less frequently for better performance. * app/asupsample.h: progress_func_t typedef moved to gimpprogress.h * app/blend.c: make callbacks to a progress function * app/color_area.c: use a color notebook rather than a color selector * app/color_panel.c: ditto * app/color_select.c: export color selector interface for notebook * app/color_select.h: color_select_init() prototype * app/flip_tool.c: flip the image every time, rather than every second click. * app/interface.c: move progress bar stuff out to gimpprogress.c. Make the code actually work while we're at it. * app/interface.h: move prototypes for progress functions out to gimpprogress.h * app/plug_in.c: load and initialise modules (if possible). Move progress bar handling code out to gimpprogress.c * app/plug_in.h: keep only a gimp_progress * for each plugin, not a whole bunch of GtkWidgets. * app/scale_tool.c * app/rotate_tool.c * app/shear_tool.c * app/perspective_tool.c: progress bar during operation. De-sensitise the dialog to discourage the user from running two transforms in parallel. * app/transform_core.c: recalculate grid coords when bounding box changes. Only initialise the action area of the dialog once, to avoid multiple "ok" / "reset" buttons appearing. Undraw transform tool with correct matrix to get rid of handle remains on screen. Call a progress function as we apply the transform matrix. A few new i18n markups. Invalidate floating selection marching ants after applying matrix. * app/transform_core.h: transform_core_do() takes an optional progress callback argument (and data). * plug-ins/oilify/oilify.c: send progress bar updates after every pixel region, not only if they processed a multiple of 5 pixels (which was quite unlikely, and therefore gave a jerky progress indication).
1999-01-11 08:57:33 +08:00
gtk_widget_set_sensitive (GTK_WIDGET (transform_info->shell), FALSE);
return shear_tool_shear (gdisp->gimage,
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
gimp_image_active_drawable (gdisp->gimage),
gdisp,
transform_core->original,
transform_tool_smoothing (),
1997-11-25 06:05:25 +08:00
transform_core->transform);
break;
}
return NULL;
}
Tool *
add sample_colorize and curve_bend defs * plug-ins/common/plugin-defs.pl: add sample_colorize and curve_bend defs * libgimp/color_selector.h: minor consistency cleanup * libgimp/gimpchainbutton.[ch]: use new style gtk object helper macros * libgimp/gimpfileselection.c * libgimp/gimpmatrix.h: minor cleanup * libgimp/gimpintl.h: resync with gnome-i18n.h * libgimp/color_display.h * app/gimp.sym * app/gdisplay_color.[ch] * app/app_procs.c * app/gdisplay.h * app/image_render.c: color display transformation code. Still unfinished, so it's not activated yet. * app/buildmenu.h: remove unused defines (PULLDOWN, POPUP, OPTION) * app/colormaps.[ch] * app/image_render.c: remove vestigal dithering stuff * app/convolve.h * app/gimpdrawable.h * app/gimpimage.h * app/lut_funcs.h * app/paint_funcs.h * app/plug_in.h: enum nick changes from Marc * app/channel_ops.c * app/crop.c * app/gdisplay.c * app/gimpimage.[ch] * app/move.c: s/([A-Z]+)_GUIDE/ORIENTATION_$1/ * app/flip_tool.[ch] * app/shear_tool.[ch]: use ORIENTATION_* constants instead of our own * app/disp_callbacks.c: remove HORIZONTAL and VERTICAL #defines * app/general.h: enumified TOKEN_* symbols * app/lc_dialog.c * app/paint_funcs.c: remove unused variables * tools/pdbgen/lib.pl: autogen gimpenums.h (unfinished) * tools/pdbgen/stddefs.pdb: new std_orientation_enum, remove layer_mode shortcut since we've skipped it in app/ * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gimage.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: reflect above enum changes, whitespace cleanups * tools/pdbgen/enums.pl * app/brush_select_cmds.c * app/brushes_cmds.c * app/color_cmds.c * app/drawable_cmds.c * app/gimage_cmds.c * app/layer_cmds.c * app/procedural_db_cmds.c * app/tools_cmds.c: reflect pdb and enum nick changes above -Yosh
1999-07-29 07:00:08 +08:00
tools_new_shear_tool (void)
1997-11-25 06:05:25 +08:00
{
Tool *tool;
TransformCore *private;
1997-11-25 06:05:25 +08:00
tool = transform_core_new (SHEAR, TRUE);
1997-11-25 06:05:25 +08:00
private = tool->private;
/* set the rotation specific transformation attributes */
private->trans_func = shear_tool_transform;
/* assemble the transformation matrix */
gimp_matrix3_identity (private->transform);
1997-11-25 06:05:25 +08:00
return tool;
}
void
tools_free_shear_tool (Tool *tool)
1997-11-25 06:05:25 +08:00
{
transform_core_free (tool);
}
static void
shear_info_update (Tool *tool)
1997-11-25 06:05:25 +08:00
{
TransformCore *transform_core;
1997-11-25 06:05:25 +08:00
transform_core = (TransformCore *) tool->private;
xshear_val = transform_core->trans_info[XSHEAR];
yshear_val = transform_core->trans_info[YSHEAR];
1997-11-25 06:05:25 +08:00
info_dialog_update (transform_info);
info_dialog_popup (transform_info);
}
static void
shear_x_mag_changed (GtkWidget *widget,
gpointer data)
{
Tool *tool;
TransformCore *transform_core;
gint value;
tool = (Tool *) data;
if (tool)
{
transform_core = (TransformCore *) tool->private;
value = GTK_ADJUSTMENT (widget)->value;
if (value != transform_core->trans_info[XSHEAR])
{
draw_core_pause (transform_core->core, tool);
transform_core->trans_info[XSHEAR] = value;
shear_tool_recalc (tool, tool->gdisp);
draw_core_resume (transform_core->core, tool);
}
}
}
static void
shear_y_mag_changed (GtkWidget *widget,
gpointer data)
{
Tool *tool;
TransformCore *transform_core;
gint value;
tool = (Tool *) data;
if (tool)
{
transform_core = (TransformCore *) tool->private;
value = GTK_ADJUSTMENT (widget)->value;
if (value != transform_core->trans_info[YSHEAR])
{
draw_core_pause (transform_core->core, tool);
transform_core->trans_info[YSHEAR] = value;
shear_tool_recalc (tool, tool->gdisp);
draw_core_resume (transform_core->core, tool);
}
}
}
1997-11-25 06:05:25 +08:00
static void
shear_tool_motion (Tool *tool,
GDisplay *gdisp)
1997-11-25 06:05:25 +08:00
{
TransformCore *transform_core;
gint diffx, diffy;
gint dir;
1997-11-25 06:05:25 +08:00
transform_core = (TransformCore *) tool->private;
diffx = transform_core->curx - transform_core->lastx;
diffy = transform_core->cury - transform_core->lasty;
/* If we haven't yet decided on which way to control shearing
* decide using the maximum differential
*/
if (transform_core->trans_info[HORZ_OR_VERT] == ORIENTATION_UNKNOWN)
1997-11-25 06:05:25 +08:00
{
if (abs (diffx) > MIN_MOVE || abs (diffy) > MIN_MOVE)
1997-11-25 06:05:25 +08:00
{
if (abs (diffx) > abs (diffy))
1997-11-25 06:05:25 +08:00
{
add sample_colorize and curve_bend defs * plug-ins/common/plugin-defs.pl: add sample_colorize and curve_bend defs * libgimp/color_selector.h: minor consistency cleanup * libgimp/gimpchainbutton.[ch]: use new style gtk object helper macros * libgimp/gimpfileselection.c * libgimp/gimpmatrix.h: minor cleanup * libgimp/gimpintl.h: resync with gnome-i18n.h * libgimp/color_display.h * app/gimp.sym * app/gdisplay_color.[ch] * app/app_procs.c * app/gdisplay.h * app/image_render.c: color display transformation code. Still unfinished, so it's not activated yet. * app/buildmenu.h: remove unused defines (PULLDOWN, POPUP, OPTION) * app/colormaps.[ch] * app/image_render.c: remove vestigal dithering stuff * app/convolve.h * app/gimpdrawable.h * app/gimpimage.h * app/lut_funcs.h * app/paint_funcs.h * app/plug_in.h: enum nick changes from Marc * app/channel_ops.c * app/crop.c * app/gdisplay.c * app/gimpimage.[ch] * app/move.c: s/([A-Z]+)_GUIDE/ORIENTATION_$1/ * app/flip_tool.[ch] * app/shear_tool.[ch]: use ORIENTATION_* constants instead of our own * app/disp_callbacks.c: remove HORIZONTAL and VERTICAL #defines * app/general.h: enumified TOKEN_* symbols * app/lc_dialog.c * app/paint_funcs.c: remove unused variables * tools/pdbgen/lib.pl: autogen gimpenums.h (unfinished) * tools/pdbgen/stddefs.pdb: new std_orientation_enum, remove layer_mode shortcut since we've skipped it in app/ * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gimage.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: reflect above enum changes, whitespace cleanups * tools/pdbgen/enums.pl * app/brush_select_cmds.c * app/brushes_cmds.c * app/color_cmds.c * app/drawable_cmds.c * app/gimage_cmds.c * app/layer_cmds.c * app/procedural_db_cmds.c * app/tools_cmds.c: reflect pdb and enum nick changes above -Yosh
1999-07-29 07:00:08 +08:00
transform_core->trans_info[HORZ_OR_VERT] = ORIENTATION_HORIZONTAL;
transform_core->trans_info[ORIENTATION_VERTICAL] = 0.0;
1997-11-25 06:05:25 +08:00
}
else
{
add sample_colorize and curve_bend defs * plug-ins/common/plugin-defs.pl: add sample_colorize and curve_bend defs * libgimp/color_selector.h: minor consistency cleanup * libgimp/gimpchainbutton.[ch]: use new style gtk object helper macros * libgimp/gimpfileselection.c * libgimp/gimpmatrix.h: minor cleanup * libgimp/gimpintl.h: resync with gnome-i18n.h * libgimp/color_display.h * app/gimp.sym * app/gdisplay_color.[ch] * app/app_procs.c * app/gdisplay.h * app/image_render.c: color display transformation code. Still unfinished, so it's not activated yet. * app/buildmenu.h: remove unused defines (PULLDOWN, POPUP, OPTION) * app/colormaps.[ch] * app/image_render.c: remove vestigal dithering stuff * app/convolve.h * app/gimpdrawable.h * app/gimpimage.h * app/lut_funcs.h * app/paint_funcs.h * app/plug_in.h: enum nick changes from Marc * app/channel_ops.c * app/crop.c * app/gdisplay.c * app/gimpimage.[ch] * app/move.c: s/([A-Z]+)_GUIDE/ORIENTATION_$1/ * app/flip_tool.[ch] * app/shear_tool.[ch]: use ORIENTATION_* constants instead of our own * app/disp_callbacks.c: remove HORIZONTAL and VERTICAL #defines * app/general.h: enumified TOKEN_* symbols * app/lc_dialog.c * app/paint_funcs.c: remove unused variables * tools/pdbgen/lib.pl: autogen gimpenums.h (unfinished) * tools/pdbgen/stddefs.pdb: new std_orientation_enum, remove layer_mode shortcut since we've skipped it in app/ * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gimage.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: reflect above enum changes, whitespace cleanups * tools/pdbgen/enums.pl * app/brush_select_cmds.c * app/brushes_cmds.c * app/color_cmds.c * app/drawable_cmds.c * app/gimage_cmds.c * app/layer_cmds.c * app/procedural_db_cmds.c * app/tools_cmds.c: reflect pdb and enum nick changes above -Yosh
1999-07-29 07:00:08 +08:00
transform_core->trans_info[HORZ_OR_VERT] = ORIENTATION_VERTICAL;
transform_core->trans_info[ORIENTATION_HORIZONTAL] = 0.0;
1997-11-25 06:05:25 +08:00
}
}
/* set the current coords to the last ones */
else
{
transform_core->curx = transform_core->lastx;
transform_core->cury = transform_core->lasty;
}
}
/* if the direction is known, keep track of the magnitude */
if (transform_core->trans_info[HORZ_OR_VERT] != ORIENTATION_UNKNOWN)
1997-11-25 06:05:25 +08:00
{
dir = transform_core->trans_info[HORZ_OR_VERT];
switch (transform_core->function)
{
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
case TRANSFORM_HANDLE_1:
add sample_colorize and curve_bend defs * plug-ins/common/plugin-defs.pl: add sample_colorize and curve_bend defs * libgimp/color_selector.h: minor consistency cleanup * libgimp/gimpchainbutton.[ch]: use new style gtk object helper macros * libgimp/gimpfileselection.c * libgimp/gimpmatrix.h: minor cleanup * libgimp/gimpintl.h: resync with gnome-i18n.h * libgimp/color_display.h * app/gimp.sym * app/gdisplay_color.[ch] * app/app_procs.c * app/gdisplay.h * app/image_render.c: color display transformation code. Still unfinished, so it's not activated yet. * app/buildmenu.h: remove unused defines (PULLDOWN, POPUP, OPTION) * app/colormaps.[ch] * app/image_render.c: remove vestigal dithering stuff * app/convolve.h * app/gimpdrawable.h * app/gimpimage.h * app/lut_funcs.h * app/paint_funcs.h * app/plug_in.h: enum nick changes from Marc * app/channel_ops.c * app/crop.c * app/gdisplay.c * app/gimpimage.[ch] * app/move.c: s/([A-Z]+)_GUIDE/ORIENTATION_$1/ * app/flip_tool.[ch] * app/shear_tool.[ch]: use ORIENTATION_* constants instead of our own * app/disp_callbacks.c: remove HORIZONTAL and VERTICAL #defines * app/general.h: enumified TOKEN_* symbols * app/lc_dialog.c * app/paint_funcs.c: remove unused variables * tools/pdbgen/lib.pl: autogen gimpenums.h (unfinished) * tools/pdbgen/stddefs.pdb: new std_orientation_enum, remove layer_mode shortcut since we've skipped it in app/ * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gimage.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: reflect above enum changes, whitespace cleanups * tools/pdbgen/enums.pl * app/brush_select_cmds.c * app/brushes_cmds.c * app/color_cmds.c * app/drawable_cmds.c * app/gimage_cmds.c * app/layer_cmds.c * app/procedural_db_cmds.c * app/tools_cmds.c: reflect pdb and enum nick changes above -Yosh
1999-07-29 07:00:08 +08:00
if (dir == ORIENTATION_HORIZONTAL)
1997-11-25 06:05:25 +08:00
transform_core->trans_info[XSHEAR] -= diffx;
else
transform_core->trans_info[YSHEAR] -= diffy;
break;
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
case TRANSFORM_HANDLE_2:
add sample_colorize and curve_bend defs * plug-ins/common/plugin-defs.pl: add sample_colorize and curve_bend defs * libgimp/color_selector.h: minor consistency cleanup * libgimp/gimpchainbutton.[ch]: use new style gtk object helper macros * libgimp/gimpfileselection.c * libgimp/gimpmatrix.h: minor cleanup * libgimp/gimpintl.h: resync with gnome-i18n.h * libgimp/color_display.h * app/gimp.sym * app/gdisplay_color.[ch] * app/app_procs.c * app/gdisplay.h * app/image_render.c: color display transformation code. Still unfinished, so it's not activated yet. * app/buildmenu.h: remove unused defines (PULLDOWN, POPUP, OPTION) * app/colormaps.[ch] * app/image_render.c: remove vestigal dithering stuff * app/convolve.h * app/gimpdrawable.h * app/gimpimage.h * app/lut_funcs.h * app/paint_funcs.h * app/plug_in.h: enum nick changes from Marc * app/channel_ops.c * app/crop.c * app/gdisplay.c * app/gimpimage.[ch] * app/move.c: s/([A-Z]+)_GUIDE/ORIENTATION_$1/ * app/flip_tool.[ch] * app/shear_tool.[ch]: use ORIENTATION_* constants instead of our own * app/disp_callbacks.c: remove HORIZONTAL and VERTICAL #defines * app/general.h: enumified TOKEN_* symbols * app/lc_dialog.c * app/paint_funcs.c: remove unused variables * tools/pdbgen/lib.pl: autogen gimpenums.h (unfinished) * tools/pdbgen/stddefs.pdb: new std_orientation_enum, remove layer_mode shortcut since we've skipped it in app/ * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gimage.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: reflect above enum changes, whitespace cleanups * tools/pdbgen/enums.pl * app/brush_select_cmds.c * app/brushes_cmds.c * app/color_cmds.c * app/drawable_cmds.c * app/gimage_cmds.c * app/layer_cmds.c * app/procedural_db_cmds.c * app/tools_cmds.c: reflect pdb and enum nick changes above -Yosh
1999-07-29 07:00:08 +08:00
if (dir == ORIENTATION_HORIZONTAL)
1997-11-25 06:05:25 +08:00
transform_core->trans_info[XSHEAR] -= diffx;
else
transform_core->trans_info[YSHEAR] += diffy;
break;
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
case TRANSFORM_HANDLE_3:
add sample_colorize and curve_bend defs * plug-ins/common/plugin-defs.pl: add sample_colorize and curve_bend defs * libgimp/color_selector.h: minor consistency cleanup * libgimp/gimpchainbutton.[ch]: use new style gtk object helper macros * libgimp/gimpfileselection.c * libgimp/gimpmatrix.h: minor cleanup * libgimp/gimpintl.h: resync with gnome-i18n.h * libgimp/color_display.h * app/gimp.sym * app/gdisplay_color.[ch] * app/app_procs.c * app/gdisplay.h * app/image_render.c: color display transformation code. Still unfinished, so it's not activated yet. * app/buildmenu.h: remove unused defines (PULLDOWN, POPUP, OPTION) * app/colormaps.[ch] * app/image_render.c: remove vestigal dithering stuff * app/convolve.h * app/gimpdrawable.h * app/gimpimage.h * app/lut_funcs.h * app/paint_funcs.h * app/plug_in.h: enum nick changes from Marc * app/channel_ops.c * app/crop.c * app/gdisplay.c * app/gimpimage.[ch] * app/move.c: s/([A-Z]+)_GUIDE/ORIENTATION_$1/ * app/flip_tool.[ch] * app/shear_tool.[ch]: use ORIENTATION_* constants instead of our own * app/disp_callbacks.c: remove HORIZONTAL and VERTICAL #defines * app/general.h: enumified TOKEN_* symbols * app/lc_dialog.c * app/paint_funcs.c: remove unused variables * tools/pdbgen/lib.pl: autogen gimpenums.h (unfinished) * tools/pdbgen/stddefs.pdb: new std_orientation_enum, remove layer_mode shortcut since we've skipped it in app/ * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gimage.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: reflect above enum changes, whitespace cleanups * tools/pdbgen/enums.pl * app/brush_select_cmds.c * app/brushes_cmds.c * app/color_cmds.c * app/drawable_cmds.c * app/gimage_cmds.c * app/layer_cmds.c * app/procedural_db_cmds.c * app/tools_cmds.c: reflect pdb and enum nick changes above -Yosh
1999-07-29 07:00:08 +08:00
if (dir == ORIENTATION_HORIZONTAL)
1997-11-25 06:05:25 +08:00
transform_core->trans_info[XSHEAR] += diffx;
else
transform_core->trans_info[YSHEAR] -= diffy;
break;
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
case TRANSFORM_HANDLE_4:
add sample_colorize and curve_bend defs * plug-ins/common/plugin-defs.pl: add sample_colorize and curve_bend defs * libgimp/color_selector.h: minor consistency cleanup * libgimp/gimpchainbutton.[ch]: use new style gtk object helper macros * libgimp/gimpfileselection.c * libgimp/gimpmatrix.h: minor cleanup * libgimp/gimpintl.h: resync with gnome-i18n.h * libgimp/color_display.h * app/gimp.sym * app/gdisplay_color.[ch] * app/app_procs.c * app/gdisplay.h * app/image_render.c: color display transformation code. Still unfinished, so it's not activated yet. * app/buildmenu.h: remove unused defines (PULLDOWN, POPUP, OPTION) * app/colormaps.[ch] * app/image_render.c: remove vestigal dithering stuff * app/convolve.h * app/gimpdrawable.h * app/gimpimage.h * app/lut_funcs.h * app/paint_funcs.h * app/plug_in.h: enum nick changes from Marc * app/channel_ops.c * app/crop.c * app/gdisplay.c * app/gimpimage.[ch] * app/move.c: s/([A-Z]+)_GUIDE/ORIENTATION_$1/ * app/flip_tool.[ch] * app/shear_tool.[ch]: use ORIENTATION_* constants instead of our own * app/disp_callbacks.c: remove HORIZONTAL and VERTICAL #defines * app/general.h: enumified TOKEN_* symbols * app/lc_dialog.c * app/paint_funcs.c: remove unused variables * tools/pdbgen/lib.pl: autogen gimpenums.h (unfinished) * tools/pdbgen/stddefs.pdb: new std_orientation_enum, remove layer_mode shortcut since we've skipped it in app/ * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gimage.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: reflect above enum changes, whitespace cleanups * tools/pdbgen/enums.pl * app/brush_select_cmds.c * app/brushes_cmds.c * app/color_cmds.c * app/drawable_cmds.c * app/gimage_cmds.c * app/layer_cmds.c * app/procedural_db_cmds.c * app/tools_cmds.c: reflect pdb and enum nick changes above -Yosh
1999-07-29 07:00:08 +08:00
if (dir == ORIENTATION_HORIZONTAL)
1997-11-25 06:05:25 +08:00
transform_core->trans_info[XSHEAR] += diffx;
else
transform_core->trans_info[YSHEAR] += diffy;
break;
default:
break;
1997-11-25 06:05:25 +08:00
}
}
}
static void
shear_tool_recalc (Tool *tool,
GDisplay *gdisp)
1997-11-25 06:05:25 +08:00
{
TransformCore *transform_core;
gfloat width, height;
gfloat cx, cy;
1997-11-25 06:05:25 +08:00
transform_core = (TransformCore *) tool->private;
cx = (transform_core->x1 + transform_core->x2) / 2.0;
cy = (transform_core->y1 + transform_core->y2) / 2.0;
width = transform_core->x2 - transform_core->x1;
height = transform_core->y2 - transform_core->y1;
if (width == 0)
width = 1;
if (height == 0)
height = 1;
/* assemble the transformation matrix */
gimp_matrix3_identity (transform_core->transform);
gimp_matrix3_translate (transform_core->transform, -cx, -cy);
1997-11-25 06:05:25 +08:00
/* shear matrix */
add sample_colorize and curve_bend defs * plug-ins/common/plugin-defs.pl: add sample_colorize and curve_bend defs * libgimp/color_selector.h: minor consistency cleanup * libgimp/gimpchainbutton.[ch]: use new style gtk object helper macros * libgimp/gimpfileselection.c * libgimp/gimpmatrix.h: minor cleanup * libgimp/gimpintl.h: resync with gnome-i18n.h * libgimp/color_display.h * app/gimp.sym * app/gdisplay_color.[ch] * app/app_procs.c * app/gdisplay.h * app/image_render.c: color display transformation code. Still unfinished, so it's not activated yet. * app/buildmenu.h: remove unused defines (PULLDOWN, POPUP, OPTION) * app/colormaps.[ch] * app/image_render.c: remove vestigal dithering stuff * app/convolve.h * app/gimpdrawable.h * app/gimpimage.h * app/lut_funcs.h * app/paint_funcs.h * app/plug_in.h: enum nick changes from Marc * app/channel_ops.c * app/crop.c * app/gdisplay.c * app/gimpimage.[ch] * app/move.c: s/([A-Z]+)_GUIDE/ORIENTATION_$1/ * app/flip_tool.[ch] * app/shear_tool.[ch]: use ORIENTATION_* constants instead of our own * app/disp_callbacks.c: remove HORIZONTAL and VERTICAL #defines * app/general.h: enumified TOKEN_* symbols * app/lc_dialog.c * app/paint_funcs.c: remove unused variables * tools/pdbgen/lib.pl: autogen gimpenums.h (unfinished) * tools/pdbgen/stddefs.pdb: new std_orientation_enum, remove layer_mode shortcut since we've skipped it in app/ * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gimage.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: reflect above enum changes, whitespace cleanups * tools/pdbgen/enums.pl * app/brush_select_cmds.c * app/brushes_cmds.c * app/color_cmds.c * app/drawable_cmds.c * app/gimage_cmds.c * app/layer_cmds.c * app/procedural_db_cmds.c * app/tools_cmds.c: reflect pdb and enum nick changes above -Yosh
1999-07-29 07:00:08 +08:00
if (transform_core->trans_info[HORZ_OR_VERT] == ORIENTATION_HORIZONTAL)
gimp_matrix3_xshear (transform_core->transform,
(float) transform_core->trans_info [XSHEAR] / height);
1997-11-25 06:05:25 +08:00
else
gimp_matrix3_yshear (transform_core->transform,
(float) transform_core->trans_info [YSHEAR] / width);
1997-11-25 06:05:25 +08:00
gimp_matrix3_translate (transform_core->transform, +cx, +cy);
1997-11-25 06:05:25 +08:00
/* transform the bounding box */
transform_core_transform_bounding_box (tool);
1997-11-25 06:05:25 +08:00
/* update the information dialog */
shear_info_update (tool);
}
TileManager *
add sample_colorize and curve_bend defs * plug-ins/common/plugin-defs.pl: add sample_colorize and curve_bend defs * libgimp/color_selector.h: minor consistency cleanup * libgimp/gimpchainbutton.[ch]: use new style gtk object helper macros * libgimp/gimpfileselection.c * libgimp/gimpmatrix.h: minor cleanup * libgimp/gimpintl.h: resync with gnome-i18n.h * libgimp/color_display.h * app/gimp.sym * app/gdisplay_color.[ch] * app/app_procs.c * app/gdisplay.h * app/image_render.c: color display transformation code. Still unfinished, so it's not activated yet. * app/buildmenu.h: remove unused defines (PULLDOWN, POPUP, OPTION) * app/colormaps.[ch] * app/image_render.c: remove vestigal dithering stuff * app/convolve.h * app/gimpdrawable.h * app/gimpimage.h * app/lut_funcs.h * app/paint_funcs.h * app/plug_in.h: enum nick changes from Marc * app/channel_ops.c * app/crop.c * app/gdisplay.c * app/gimpimage.[ch] * app/move.c: s/([A-Z]+)_GUIDE/ORIENTATION_$1/ * app/flip_tool.[ch] * app/shear_tool.[ch]: use ORIENTATION_* constants instead of our own * app/disp_callbacks.c: remove HORIZONTAL and VERTICAL #defines * app/general.h: enumified TOKEN_* symbols * app/lc_dialog.c * app/paint_funcs.c: remove unused variables * tools/pdbgen/lib.pl: autogen gimpenums.h (unfinished) * tools/pdbgen/stddefs.pdb: new std_orientation_enum, remove layer_mode shortcut since we've skipped it in app/ * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/gimage.pdb * tools/pdbgen/pdb/guides.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/tools.pdb: reflect above enum changes, whitespace cleanups * tools/pdbgen/enums.pl * app/brush_select_cmds.c * app/brushes_cmds.c * app/color_cmds.c * app/drawable_cmds.c * app/gimage_cmds.c * app/layer_cmds.c * app/procedural_db_cmds.c * app/tools_cmds.c: reflect pdb and enum nick changes above -Yosh
1999-07-29 07:00:08 +08:00
shear_tool_shear (GimpImage *gimage,
GimpDrawable *drawable,
GDisplay *gdisp,
TileManager *float_tiles,
gboolean interpolation,
GimpMatrix3 matrix)
1997-11-25 06:05:25 +08:00
{
GimpProgress *progress;
TileManager *ret;
Bit of a large checkin this - it's basically three things: 1 - GimpModules Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk> Bit of a large checkin this - it's basically three things: 1 - GimpModules using gmodules to dynamically load and initialise modules at gimp start of day. 2 - Color selectors now register themselves with a color notebook. 3 - progress bars have been cleaned up a bit, so now have progress indictations on all transform tool and gradient fill operations. Not done bucket fill, but that seems to be the next candidate. New directories: * modules/: new directory for dynamically loadable modules. New files: * modules/.cvsignore * modules/Makefile.am * modules/colorsel_gtk.c: GTK color selector wrapped up as a color selector the gimp can use. * app/gimpprogress.[ch]: progress bars within gimp core, either as popups, or in the status bar. This is mainly code moved out of plug-in.c * app/color_notebook.[ch]: color selector notebook, implementing very similar interface to color_select.h so it can be used as a drop-in replacement for it. * libgimp/color_selector.h: API color selectors need to implement to become a page in the color_notebook. * libgimp/gimpmodule.h: API gimp modules need to implement to be initialised by gimp at start of day. Modified files: * Makefile.am: add modules/ to SUBDIRS * libgimp/Makefile.am: install gimpmodule.h and color_selector.h * app/gimprc.[ch]: recognise module-path variable. * gimprc.in: set module-path variable to something sensible (currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules"). * app/Makefile.am: build color notebook and gimpprogress * app/app_procs.c: register internal GIMP color selector with color notebook. * app/asupsample.c: call progress function less frequently for better performance. * app/asupsample.h: progress_func_t typedef moved to gimpprogress.h * app/blend.c: make callbacks to a progress function * app/color_area.c: use a color notebook rather than a color selector * app/color_panel.c: ditto * app/color_select.c: export color selector interface for notebook * app/color_select.h: color_select_init() prototype * app/flip_tool.c: flip the image every time, rather than every second click. * app/interface.c: move progress bar stuff out to gimpprogress.c. Make the code actually work while we're at it. * app/interface.h: move prototypes for progress functions out to gimpprogress.h * app/plug_in.c: load and initialise modules (if possible). Move progress bar handling code out to gimpprogress.c * app/plug_in.h: keep only a gimp_progress * for each plugin, not a whole bunch of GtkWidgets. * app/scale_tool.c * app/rotate_tool.c * app/shear_tool.c * app/perspective_tool.c: progress bar during operation. De-sensitise the dialog to discourage the user from running two transforms in parallel. * app/transform_core.c: recalculate grid coords when bounding box changes. Only initialise the action area of the dialog once, to avoid multiple "ok" / "reset" buttons appearing. Undraw transform tool with correct matrix to get rid of handle remains on screen. Call a progress function as we apply the transform matrix. A few new i18n markups. Invalidate floating selection marching ants after applying matrix. * app/transform_core.h: transform_core_do() takes an optional progress callback argument (and data). * plug-ins/oilify/oilify.c: send progress bar updates after every pixel region, not only if they processed a multiple of 5 pixels (which was quite unlikely, and therefore gave a jerky progress indication).
1999-01-11 08:57:33 +08:00
progress = progress_start (gdisp, _("Shearing..."), FALSE, NULL, NULL);
ret = transform_core_do (gimage, drawable, float_tiles,
interpolation, matrix,
progress ? progress_update_and_flush :
(GimpProgressFunc) NULL,
progress);
Bit of a large checkin this - it's basically three things: 1 - GimpModules Sun Jan 11 00:24:21 GMT 1999 Austin Donnelly <austin@greenend.org.uk> Bit of a large checkin this - it's basically three things: 1 - GimpModules using gmodules to dynamically load and initialise modules at gimp start of day. 2 - Color selectors now register themselves with a color notebook. 3 - progress bars have been cleaned up a bit, so now have progress indictations on all transform tool and gradient fill operations. Not done bucket fill, but that seems to be the next candidate. New directories: * modules/: new directory for dynamically loadable modules. New files: * modules/.cvsignore * modules/Makefile.am * modules/colorsel_gtk.c: GTK color selector wrapped up as a color selector the gimp can use. * app/gimpprogress.[ch]: progress bars within gimp core, either as popups, or in the status bar. This is mainly code moved out of plug-in.c * app/color_notebook.[ch]: color selector notebook, implementing very similar interface to color_select.h so it can be used as a drop-in replacement for it. * libgimp/color_selector.h: API color selectors need to implement to become a page in the color_notebook. * libgimp/gimpmodule.h: API gimp modules need to implement to be initialised by gimp at start of day. Modified files: * Makefile.am: add modules/ to SUBDIRS * libgimp/Makefile.am: install gimpmodule.h and color_selector.h * app/gimprc.[ch]: recognise module-path variable. * gimprc.in: set module-path variable to something sensible (currently "${gimp_dir}/modules:${gimp_plugin_dir}/modules"). * app/Makefile.am: build color notebook and gimpprogress * app/app_procs.c: register internal GIMP color selector with color notebook. * app/asupsample.c: call progress function less frequently for better performance. * app/asupsample.h: progress_func_t typedef moved to gimpprogress.h * app/blend.c: make callbacks to a progress function * app/color_area.c: use a color notebook rather than a color selector * app/color_panel.c: ditto * app/color_select.c: export color selector interface for notebook * app/color_select.h: color_select_init() prototype * app/flip_tool.c: flip the image every time, rather than every second click. * app/interface.c: move progress bar stuff out to gimpprogress.c. Make the code actually work while we're at it. * app/interface.h: move prototypes for progress functions out to gimpprogress.h * app/plug_in.c: load and initialise modules (if possible). Move progress bar handling code out to gimpprogress.c * app/plug_in.h: keep only a gimp_progress * for each plugin, not a whole bunch of GtkWidgets. * app/scale_tool.c * app/rotate_tool.c * app/shear_tool.c * app/perspective_tool.c: progress bar during operation. De-sensitise the dialog to discourage the user from running two transforms in parallel. * app/transform_core.c: recalculate grid coords when bounding box changes. Only initialise the action area of the dialog once, to avoid multiple "ok" / "reset" buttons appearing. Undraw transform tool with correct matrix to get rid of handle remains on screen. Call a progress function as we apply the transform matrix. A few new i18n markups. Invalidate floating selection marching ants after applying matrix. * app/transform_core.h: transform_core_do() takes an optional progress callback argument (and data). * plug-ins/oilify/oilify.c: send progress bar updates after every pixel region, not only if they processed a multiple of 5 pixels (which was quite unlikely, and therefore gave a jerky progress indication).
1999-01-11 08:57:33 +08:00
if (progress)
progress_end (progress);
return ret;
1997-11-25 06:05:25 +08:00
}