Commit Graph

48 Commits

Author SHA1 Message Date
Michael Natterer 54683840e3 app: rename GimpTool::get_undo_desc() and ::get_redo_desc()
to ::can_undo() and ::can_redo(). They still return description
strings and the new naming is slightly off :) but get_undo_desc() will
be needed for something else soon, and half of the time the functions
are indeed used to check whether there are undo/redo staps at all.
2017-07-04 20:43:28 +02:00
Michael Natterer 40d42d113e app: make tool_manager_select_tool() a private function 2014-04-04 16:47:51 +02:00
Michael Natterer 8320381885 app: add untested infrastructure for tool-internal undo/redo
Add virtual functions GimpTool::undo(), ::redo(), ::get_undo_desc()
and ::get_redo_desc() and corresponding wrappers in tool_manager.

Make the edit-undo and edit-redo actions check tool undo/redo first
before invoking image undo/redo.
2013-05-12 19:51:52 +02:00
Michael Natterer c0aa4498d2 app: add intrastructure to send key_release events to tools
The code is 100% identical to the key_press handling and simply
dispatches key_release events too tools which selected them via
GimpToolControl.
2010-02-18 20:50:11 +01:00
Michael Natterer e170ad77b1 Remove the newly added tool clipboard facility again, we don't need it 2009-06-24 19:08:24 +02:00
Michael Natterer 0f55bf15bc Enable cut/copy/paste for the text tool
* app/tools/tools-enums.[ch]: add enum GimpClipboardAction which can be
{ CUT, COPY, PASTE }

* app/tools/gimptool.[ch]
* app/tools/tool_manager.[ch]: add GimpTool::clipboard_action() which
returns a boolean indicating whether the tool handled the action.

* app/tools/gimptexttool.c: implement clipboard_action().

* app/actions/edit-commands.c: try the active tool first in the cut,
copy and paste callbacks.
2009-06-21 23:37:18 +02:00
Michael Natterer 1a16b48c93 Add infrastructure for sending double and triple clicks to tools
* app/tools/tools-enums.[ch]: add enum GimpButtonPressType which can
be { NORMAL, DOUBLE, TRIPLE }

* app/tools/gimptool.[ch]: add press_type paramater to GimpTool::button_press()

* app/tools/gimp*tool.c
* app/tools/tool_manager.[ch]: changed accordingly.

* app/tools/gimptoolcontrol.[ch]: add members and API so tools can choose
to receive double and triple clicks.

* app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_tool_events):
dispatch double and triple clicks to tools if they want them, and if they
became active by the preceding normal button press.
2009-06-20 17:37:31 +02:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Michael Natterer f7287be7b5 app/tools/gimptool.[ch] made all GimpCoords* in the tool API const.
2008-11-01  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.[ch]
	* app/tools/tool_manager.[ch]: made all GimpCoords* in the tool
	API const.

	* app/tools/gimpaligntool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpbrushtool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpcolortool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimpeditselectiontool.[ch]
	* app/tools/gimperasertool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpfreeselecttool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimpperspectiveclonetool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.[ch]
	* app/tools/gimpregionselecttool.c
	* app/tools/gimpselectiontool.[ch]
	* app/tools/gimpsourcetool.c
	* app/tools/gimptexttool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c: changed accordingly and added const
	to all GimpCoords* in utility functions too.

	* app/tools/gimptexttool.c: don't modify the passed coords. In
	fact, simply removed the code that did because it had no effect.


svn path=/trunk/; revision=27517
2008-11-01 15:17:36 +00:00
Michael Natterer 68e6d7a610 Add some infrastructure for the on-canvas text editing GSoC project:
2008-10-26  Michael Natterer  <mitch@gimp.org>

	Add some infrastructure for the on-canvas text editing GSoC
	project:

	* app/tools/gimptoolcontrol.[ch]: add boolean wants_all_key_events
	member and API to set and get it.

	* app/tools/gimptool.[ch]: add GimpTool::get_popup() which returns
	the tool's context menu if it has one, or NULL otherwise.

	* app/tools/tool_manager.[ch]: add tool_manager_get_popup_active()
	wrapper.

	* app/display/gimpdisplayshell-callbacks.c: check if the tool has
	a popup menu and show it instead of the usual right-click menu.

	Also call the tool's key_press() unconditionally if it wants all
	key events, but this code needs more thinking.


svn path=/trunk/; revision=27416
2008-10-26 16:25:24 +00:00
Sven Neumann 41237259c9 In all files, changed the standard copyright notice to say "GIMP - The GNU
2006-12-09  Sven Neumann  <sven@gimp.org>

        * In all files, changed the standard copyright notice to say
        "GIMP - The GNU Image Manipulation Program".
2006-12-09 21:33:38 +00:00
Michael Natterer 868b8afbff Added new tool API for modifier key events while the tool is active and
2006-09-12  Michael Natterer  <mitch@gimp.org>

	Added new tool API for modifier key events while the tool
	is active and implement it in the rect select and crop tools.
	Fixes bug #316156 and bug #355302.

	* app/tools/gimptool.[ch]: added GimpTool::active_modifier_key()
	and public function gimp_tool_set_active_motifier_state(). Remember
	the active_state at button_press and reset it on button_release.
	Ignore releases of modifiers that were pressed at button_press (but
	only ignore them once).

	* app/tools/tool_manager.[ch]: added wrapper
	tool_manager_active_modifier_state_active().

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_events): return FALSE for all modifiers even
	when mouse button 1 is pressed.

	(gimp_display_shell_canvas_tool_events): when bouse button 1 is
	pressed *and* the tool is active, dispatch the new active_modifier
	events to tools.

	* app/tools/gimpcroptool.c
	* app/tools/gimprectangleselecttool.c
	* app/tools/gimprectangletool.[ch]: implement active_modifier_key()
	instead of modifier_key().
2006-09-12 18:41:09 +00:00
Sven Neumann 5439aa4995 did a global gdisp -> display substitution.
2006-03-28  Sven Neumann  <sven@gimp.org>

	* app/*: did a global gdisp -> display substitution.
2006-03-28 17:55:52 +00:00
Michael Natterer 2ed407b54f app/tools/gimptool.[ch] add "gboolean proximity" parameter to
2006-03-25  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.[ch]
	* app/tools/tool_manager.[ch]: add "gboolean proximity" parameter
	to GimpTool::oper_update() in order to emphasize its importance
	and to avoid peeking around in the GimpDisplayShell struct.

	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpcolortool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpforegroundselecttool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimpnewrectselecttool.c
	* app/tools/gimppainttool.c
	* app/tools/gimprectangletool.[ch]
	* app/tools/gimpselectiontool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c: changed accordingly. Got rid of
	quite some "display/gimpdisplayshell.h" includes.

	* app/display/gimpdisplayshell-callbacks.c
	(gimp_display_shell_canvas_tool_events): pass shell->proximity to
	tool_manager_oper_update_active().
2006-03-25 14:23:09 +00:00
Michael Natterer 02b91f6628 app/tools/gimptool.[ch] added boolean return value to
2004-06-24  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.[ch]
	* app/tools/tool_manager.[ch]: added boolean return value to
	GimpTool::key_press() which indicates if the event was handled.

	* app/tools/gimpcroptool.c
	* app/tools/gimpeditselectiontool.[ch]
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c: return TRUE if the key event was handled.

	* app/tools/gimppainttool.c: removed key_press() implementation.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h
	* app/widgets/gimpcontrollerkeyboard.[ch]: new controller class
	which takes GdkEventKey and emits controller events for all
	combinations of modifiers and cursor keys.

	* app/widgets/gimpcontrollers.[ch]: added new function
	gimp_controllers_get_keyboard().

	* app/display/gimpdisplayshell-callbacks.c: if a key event was not
	handled by the active tool, dispatch it to the keyboard controller.

	* etc/controllerrc: add a keyboard controller which is configured
	to do the same as the removed gimp_paint_tool_key_press().
2004-06-24 10:16:08 +00:00
Simon Budig 39614b34a6 renamed tool_manager_arrow_key_active to tool_manager_key_press_active.
2004-06-12  Simon Budig  <simon@gimp.org>

	* app/tools/tool_manager.[ch]: renamed
	tool_manager_arrow_key_active to tool_manager_key_press_active.

	* app/display/gimpdisplayshell-callbacks.c: Also dispatch
	GDK_Return/KP_Enter/BackSpace/Delete to the tools "arrow_key"
	member of GimpTool probably should be renamed.

	* app/tools/gimpvectortool.c: Use Enter/Return to convert the
	current path to a selection, use Backspace/Delete to delete the
	currently active anchors in a path.

	Implemented on Jimmacs request - thanks for being a great host  :)
2004-06-12 18:03:48 +00:00
Michael Natterer 613e328f13 added boolean return value to GimpTool::initialize(). Returning FALSE
2004-01-21  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.[ch]: added boolean return value to
	GimpTool::initialize(). Returning FALSE means the tool could not
	be initialized and doesn't want to receive button events.
	Return TRUE from the default implementation.

	* app/tools/tool_manager.[ch]: added boolean return value to
	tool_manager_initialize_active(). Don't set the tool's display or
	drawable if initialize() returns FALSE.

	* app/display/gimpdisplayshell-callbacks.c: don't send button
	events to the tool if initialize() returns FALSE.

	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorizetool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimpthresholdtool.c: return FALSE for NULL and indexed
	drawables.

	* app/tools/gimpimagemaptool.c: always return TRUE because our
	subclasses already checked if the active drawable is OK.

	* app/tools/gimptransformtool.c: return FALSE for layers with
	masks. Fixes bug #132089. Some random cleanups.
2004-01-21 16:07:48 +00:00
Michael Natterer b19deeb311 Refactored modifier handling of displays and tools. Hopefully finally
2003-10-14  Michael Natterer  <mitch@gimp.org>

	Refactored modifier handling of displays and tools. Hopefully
	finally fixes bug #124135.

	* app/tools/gimptool.[ch] (struct GimpTool): added private members
	"focus_display" and "modifier_state" so tools are aware of their
	modifier state.

	* app/tools/gimptool.[ch]
	* app/tools/tool_manager.[ch]: removed all public modifier_key()
	API and added set_focus_display() and set_modifier_state()
	instead.

	* app/tools/tool_manager.c (tool_manager_select_tool)
	* app/display/gimpdisplay.c (gimp_display_delete): set the
	active_tool's focus_display to NULL.

	* app/display/gimpdisplayshell.[ch] (struct GimpDisplayShell):
	added almost the whole stuff that used to be static variables of
	gimp_display_shell_tool_events(). Cleaned up the struct a bit.

	* app/display/gimpdisplayshell-callbacks.c: removed utility
	function gimp_display_shell_update_tool_modifiers().

	(gimp_display_shell_tool_events):

	- Replaced all calls to gimp_display_shell_update_tool_modifiers()
	  and tool_manager_modifier_key_active() by
	  tool_manager_modifier_state_active().

	- Call tool_manager_focus_display_active() before setting the
	  tool's modifier_state. Set the tool's focus_display to NULL when
	  we get a focus_out event.

	- Don't grab/ungrab the keyboard twice when <space>-selecting the
	  move tool.

	- Removed most static variables and use the new members of
	  GimpDisplayShell. Don't remember any old modifier states since
	  GimpTool does that by itself now.
2003-10-14 11:14:28 +00:00
Michael Natterer 6b2ca702ad app/paint/Makefile.am removed... ...and added.
2003-09-18  Michael Natterer  <mitch@gimp.org>

	* app/paint/Makefile.am
	* app/paint/paint.[ch]: removed...
	* app/paint/gimp-paint.[ch]: ...and added.

	* app/core/gimp.c: changed accordingly.

	* app/tools/Makefile.am
	* app/tools/tools.[ch]: removed...

	* app/tools/gimp-tools.[ch]: ...and added. Added
	gimp_tools_restore() and gimp_tools_save() and moved the entire
	tool registering and tool_options loading/saving code here. Call
	tool_manager_init() from gimp_tools_init() and tool_manager_exit()
	from gimp_tools_exit().

	* app/tools/tool_manager.[ch]: removed the code which now lives
	in gimp-tools.[ch]. The tool manager now has no knowledge about
	individual tools any more and just handles the active_tool
	and the tool part of tool <-> display interaction.
	Removed tool_manager_get_info_by_type().

	* app/tools/gimpvectortool.c (gimp_vector_tool_register): the
	tool's identifier is "gimp-vector-tool", not "gimp-path-tool".

	* app/app_procs.c
	* app/display/gimpdisplayshell-callbacks.c
	* app/gui/vectors-commands.c
	* app/tools/gimppainttool.c: changed accordingly.
2003-09-18 13:51:10 +00:00
Michael Natterer 5096672060 app/core/gimpbrush.c app/paint/gimppaintcore.c app/tools/gimpcurvestool.c
2003-07-10  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpbrush.c
	* app/paint/gimppaintcore.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimptool.c
	* app/tools/tool_manager.h: removed trailing whitespace.
2003-07-10 12:13:21 +00:00
Michael Natterer e14e158e70 removed enum GimpContextPropType and enum GimpContextPropMask.
2003-06-28  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpcontext.h: removed enum GimpContextPropType and
	enum GimpContextPropMask.

	* app/core/core-enums.[ch]: added them here.

	* app/core/gimptoolinfo.[ch]: replaced "gboolean tool_context"
	member by "GimpContextPropMask context_props" so each tool can
	specify exactly which context properties it wants to have
	persistently remembered.

	* app/tools/tools-types.h: changed typedef GimpToolRegisterCallback
	accordingly.

	* app/tools/tool_manager.[ch] (tool_manager_register_tool): ditto.

	Removed the "global_tool_context" and initialize all tool info
	objects from the user_context after creation. Removed the
	PAINT_OPTIONS_MASK #define and use the new context_props stored in
	tool_info insted.

	* app/tools/gimppainttool.h: #define the common properties of the
	paint tools as GIMP_PAINT_TOOL_OPTIONS_MASK (which is OPACITY |
	PAINT_MODE | BRUSH).

	* app/tools/[all tools].c (gimp_*_tool_register): replaced the
	"use_context" boolean by the actual mask of context properties the
	tools need.
2003-06-28 11:20:37 +00:00
Michael Natterer dd9a0a4a63 Use g_object_[set|get]_qdata(), not just _data() to speed up tool manager
2003-05-25  Michael Natterer  <mitch@gimp.org>

	* app/tools/tool_manager.[ch] (tool_manager_set,get): Use
	g_object_[set|get]_qdata(), not just _data() to speed up tool
	manager access.

	Removed tool_manager_active_get_help_data() and
	tool_manager_help_func().

	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimphistogramtool.c
	* app/tools/gimpimagemaptool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimptransformtool.c: use gimp_standard_help_func and
	tool->tool_info->help_data instead. Don't #include "tool_manager.h".
2003-05-25 17:16:59 +00:00
Michael Natterer a071be69ae added a "const gchar *extension" parameter to
2003-02-10  Michael Natterer  <mitch@gimp.org>

	* app/tools/tool_options.[ch]: added a "const gchar *extension"
	parameter to gimp_tool_options_[de]serialize(). Default to
	"default" if NULL is passed.

	* app/tools/tool_manager.[ch]: load the tool_options from the
	default files in tool_manager_restore(), added tool_manager_save()
	which saves the default files.

	* app/app_procs.c: call tool_manager_save() on app exit.

	* app/gui/tool-options-dialog.c: pass "user" when loading/saving
	the user defaults. Changed tooltips of the load & save buttons.
2003-02-10 11:46:10 +00:00
Michael Natterer aa9f82d127 Made GimpToolOptions a GimpContext subclass and objectified all tool
2003-02-05  Michael Natterer  <mitch@gimp.org>

	Made GimpToolOptions a GimpContext subclass and objectified
	all tool options types.

	* app/core/core-types.h: replaced GimpToolOptionsNewFunc by
	GimpToolOptionsGUIFunc.

	* libgimpproxy/gimpproxytypes.h: regenerated.

	* app/core/gimppaintinfo.[ch]: added "GType paint_options_type".

	* app/core/gimptoolinfo.[ch]: added "GType tool_options_type",
	removed tool_info->context since GimpToolOptions are a GimpContext
	now. Added "gboolean use_context" as a temp_hack.

	* libgimptool/gimptooltypes.h: added the tool_options_type to
	the tool registering callback.

	* app/tools/tool_options.[ch]: is a real GimpContext subclass now.

	* app/paint/paint-types.h
	* app/paint/paint.c: added the paint_options_type to the paint
	registering stuff.

	* app/paint/gimppaintoptions.[ch]: is a real GimpToolOptions
	subclass now.

	* app/paint/Makefile.am
	* app/paint/gimpairbrushoptions.[ch]
	* app/paint/gimpcloneoptions.[ch]
	* app/paint/gimpconvolveoptions.[ch]
	* app/paint/gimpdodgeburnoptions.[ch]
	* app/paint/gimperaseroptions.[ch]
	* app/paint/gimpsmudgeoptions.[ch]: new files holding
	GimpPaintOptions subclasses.

	* app/paint/gimpairbrush.[ch]
	* app/paint/gimpclone.[ch]
	* app/paint/gimpconvolve.[ch]
	* app/paint/gimpdodgeburn.[ch]
	* app/paint/gimperaser.[ch]
	* app/paint/gimppaintbrush.c
	* app/paint/gimppaintcore.c
	* app/paint/gimppencil.[ch]
	* app/paint/gimpsmudge.[ch]: removed paint options stuff, lots
	of related changed & cleanups.

	* tools/pdbgen/pdb/paint_tools.pdb: changed accordingly.

	* app/pdb/paint_tools_cmds.c: regenerated.

	* app/tools/Makefile.am
	* app/tools/gimpblendoptions.[ch]
	* app/tools/gimpbucketfilloptions.[ch]
	* app/tools/gimpcolorpickeroptions.[ch]
	* app/tools/gimpcropoptions.[ch]
	* app/tools/gimpflipoptions.[ch]
	* app/tools/gimpinkoptions.[ch]
	* app/tools/gimpmagnifyoptions.[ch]
	* app/tools/gimpmeasureoptions.[ch]
	* app/tools/gimpmoveoptions.[ch]
	* app/tools/gimptextoptions.[ch]
	* app/tools/gimpvectoroptions.[ch]: new files holding the various
	tool options classes.

	* app/tools/selection_options.[ch]
	* app/tools/transform_options.[ch]: made them objects.

	* app/tools/paint_options.[ch]: contains only the paint_options
	GUI and reset stuff.

	* app/tools/tools-types.h: removed SelectionOptions typedef for
	now.

	* app/tools/[all tools]: removed the tool options stuff except
	some GUI constructors. Tons of related changes.

	* app/tools/tool_manager.[ch]: changed tool registration / restore /
	switching accordingly.

	* app/widgets/gimpdrawablelistview.c
	* app/widgets/gimpselectioneditor.c: changed accordingly.
2003-02-05 14:39:40 +00:00
Michael Natterer a3f44d8b0f Separated tool_options creation from tool registration so we don't
2002-06-17  Michael Natterer  <mitch@gimp.org>

	Separated tool_options creation from tool registration so we
	don't implicitly create widgets before gui_init():

	* libgimptool/gimptooltypes.h: removed GimpToolOptionsNewFunc
	typedef here...

	* app/core/core-types.h: ...and added it here.

	* libgimpproxy/gimpproxytypes.h: regenerated.

	* app/core/gimptoolinfo.[ch]: added a GimpToolOptionsNewFunc
	pointer to remember the constructor. Fixed the finalize() method
	(bug was never noticed because we leaked all tool infos)

	* app/tools/tool_manager.[ch]: moved tool_options creation to the
	new function tool_manager_restore(). Unref the tool infos after
	adding them to their container. Added "brush" and "gradient" to
	the context properties which are defined for tool contexts.

	* app/app_procs.c: call tool_manager_restore() after gui_init().

	* app/gui/gui.c: removed the hack introduced recently and call
	render_setup() in gui_init() again, not in gui_themes_init().

	Use the correct contexts now that they are properly initialized
	at the time of tool_options creation:

	* app/tools/gimpblendtool.c: use tool_info->context, not
	gimp_get_user_context() to get/set the tool's gradient.

	* app/paint/gimppaintcore.[ch] (gimp_paint_core_start): added a
	GimpPaintOptions paramater and get the brush to use from
	paint_options->context (instead of gimp_get_current_context()).

	* app/paint/gimppaintcore-stroke.c
	* app/tools/gimppainttool.c: changed accordingly.

	* app/tools/paint_options.c: added a brush preview to the paint
	options.
2002-06-17 10:34:28 +00:00
Sven Neumann 84e1810adc 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 11:31:08 +00:00
Nate Summers 69ccb4d370 massive tool plugin changes 2002-03-29 03:50:29 +00:00
Michael Natterer 17d655c1c3 app/gimprc.[ch] app/gui/preferences-dialog.c
2002-03-12  Michael Natterer  <mitch@gimp.org>

	* app/gimprc.[ch]
	* app/gui/preferences-dialog.c
	* app/paint/gimppaintoptions.[ch]
	* app/tools/paint_options.[ch]
	* app/tools/tool_manager.[ch]: removed the "global_paint_options"
	gimprc option because it doesn't quite fit the new dockable dialog
	architecture.

	* app/gui/brush-select.[ch]
	* app/gui/gradient-select.[ch]
	* app/gui/palette-select.[ch]
	* app/gui/pattern-select.[ch]: removed the "Global Brush/Pattern/...
	Selection" part of them. They are now only used for temp popup
	selections and the PDB. *Lots* of cleanup.

	* app/gui/convert-dialog.c
	* app/gui/dialogs-constructors.[ch]
	* app/gui/dialogs.c
	* app/gui/gui.c
	* app/gui/menus.c
	* app/gui/palette-import-dialog.c
	* app/plug-in/plug-in.c: changed accordingly.

	Cleaned up the palette and other data PDB stuff:

	* tools/pdbgen/Makefile.am
	* tools/pdbgen/groups.pl: added "palette_select" and "palettes".

	* tools/pdbgen/pdb/palette_select.pdb: new file. Makes the palette
	selection PDB controllable.

	* tools/pdbgen/pdb/palettes.pdb: new file cut out of palette.pdb
	because of API symmetry with brushes, patterns, ...

	* tools/pdbgen/pdb/palette.pdb: removed from here.

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/pattern_select.pdb
	* tools/pdbgen/pdb/patterns.pdb: lots of cleanup.

	Autogenerated stuff:

	* app/pdb/Makefile.am
	* app/pdb/palette_select_cmds.c
	* app/pdb/palettes_cmds.c: new files.

	* app/pdb/brush_select_cmds.c
	* app/pdb/brushes_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/internal_procs.c
	* app/pdb/palette_cmds.c
	* app/pdb/pattern_select_cmds.c
	* app/pdb/patterns_cmds.c: regenerated.

	* libgimp/Makefile.am
	* libgimp/gimp_pdb.h
	* libgimp/gimppalettes_pdb.[ch]
	* libgimp/gimppaletteselect_pdb.[ch]: new files.

	* libgimp/gimpgradientselect_pdb.[ch]
	* libgimp/gimppalette_pdb.[ch]
	* libgimp/gimppatterns_pdb.c: regenerated.

	* devel-docs/libgimp/tmpl/gimpgradients.sgml
	* devel-docs/libgimp/tmpl/gimppalette.sgml: regenerated.
2002-03-12 21:02:10 +00:00
Michael Natterer bec4c72534 app/tools/tools-types.h chain up unconditionally in control(),
2002-02-18  Michael Natterer  <mitch@gimp.org>

	* app/tools/tools-types.h
	* app/tools/*.[ch]: chain up unconditionally in control(),
	s/ToolAction/GimpToolAction/g, s/ToolState/GimpToolState/g.

	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpinktool.c
	* app/tools/gimppainttool.c: don't touch tool->paused_count
	(setting it to 0 was a hack which should no longer be needed).

	* app/tools/gimpdrawtool.c: check if the draw tool has actually
	been started (draw_tool->gdisp != NULL) before calling it's
	draw() function.

	* app/tools/tool_manager.c: simplified tool_manager_control_active():
	simply call gimp_tool_control() if gdisp == tool->gdisp.

	* app/tools/gimptool.[ch]: gimp_tool_control(): do all the PAUSE,
	RESUME and HALT voodoo here.

	* app/tools/gimppainttool.c: implemented #9902 (Drawing straight
	lines does not work between different views). It's an evil hack,
	but clearly marked in the source.
2002-02-18 17:00:09 +00:00
Michael Natterer a75c675d03 added GimpToolRegisterFunc, GimpToolRegisterCallback and
2001-11-20  Michael Natterer  <mitch@gimp.org>

	* app/tools/tools-types.h: added GimpToolRegisterFunc,
	GimpToolRegisterCallback and GimpToolOptionsNewFunc typedefs
	which are used to register tools.

	* app/tools/tools.c: put the register funcs in an array of
	GimpToolRegisterFuncs. Pass a Gimp pointer *plus* a
	GimpToolRegisterCallback (which is tool_manager_register_tool())
	to the tools' register functions.

	* app/tools/tool_manager.[ch]: added a GimpToolOptionsNewFunc to
	the parameters of tool_manager_register_tool(). Create the tool
	options here, not in each tool.

	* app/tools/paint_options.[ch]
	* app/tools/selection_options.[ch]
	* app/tools/tool_options.[ch]
	* app/tools/transform_options.[ch]: all _init() and _new()
	functions take a GimpToolInfo pointer now. The _reset() func needs
	to be set manually now.

	* app/tools/[all_tools].[ch]: changed accordingly:

	- pass GimpToolOptionsNewFuncs to the register callback.
	- don't create the tool options in the tools' _init() function.
	- removed all static tool options variables.
	- get the options from the tool system in the cases i missed
	  in my last commit.
	- added minor hacks to get rid of the static options pointer
	  in some pathological cases :) (i.e. the ink tool).
2001-11-20 23:00:47 +00:00
Michael Natterer 55aa4776f7 added tool_manager_button_press_active() and friends functions.
2001-11-14  Michael Natterer  <mitch@gimp.org>

	* app/tools/tool_manager.[ch]: added
	tool_manager_button_press_active() and friends functions.

	* app/display/gimpdisplayshell-callbacks.c:
	gimp_display_shell_canvas_events(): use the functions instead of
	re-fetching the active_tool whenever it may have changed
	(which requires knowledge about the tools' implementation).
	Also moved lots of variables around.
2001-11-14 17:12:51 +00:00
Michael Natterer 02fde14c95 build display/ before tools/.
2001-11-08  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am: build display/ before tools/.

	* app/devices.c: devices_check_change(): added all events
	which have a GdkDevice pointer.

	* app/gimpprogress.c: include "display-types.h" instead of
	"core-types.h".

	* app/core/Makefile.am
	* app/core/gimpdrawable-bucket-fill.[ch]: new files: the bucket_fill
	stuff taken from tools/gimpbucketfilltool.[ch].

	* app/core/core-types.h: added "BucketFillMode".

	* app/core/gimpimage-mask-select.[ch]: cleanup.

	* app/core/gimpmarshal.list: added more marshallers for GimpTool's
	new signal signatures.

	* app/core/gimpmarshal.[ch]: regenerated.

	* app/display/Makefile.am
	* app/display/gimpdisplayshell-dnd.[ch]
	* app/display/gimpdisplayshell-layer-select.[ch]: new files: the
	canvas drop callbacks from gimpdisplayshell-callbacks.[ch] and
	the stuff formerly knows as gui/layer-select.[ch].

	* app/display/gimpdisplay.h: don't include "gui/gui-types.h".

	* app/display/gximage.c: include "display-types.h".

	* app/display/gimpdisplay-foreach.c
	* app/display/gimpdisplayshell.[ch]: call gdsplay_delete(), don't
	destroy the shell widget.

	* app/gui/Makefile.am
	* app/gui/layer-select.[ch]: removed.

	* app/gui/gradients-commands.c: fixed "Save as POV" fprintf()s.

	* app/gui/preferences-dialog.c: removed the layer_select stuff
	because it is useless with the new preview system.

	* app/gui/tool-options-dialog.c: send the correct data to the
	close_callback.

	* app/gui/tools-commands.c: changed to follow the new
	gimp_tool_initialize() semantics (see below).

	Tool & canvas event handling chainsawing:

	* app/tools/tools-types.h: new struct GimpCoords which contains
	x, y, pressure, tilt etc.

	* app/display/gimpdisplayshell-callbacks.[ch]: added utility
	functions which transparently retreive the current event's
	GimpCoords or take it from the device directly if the event has
	none. Pass GimpCoords _in_image_coordinates_ to all tool
	functions.

	Most important: don't pass GdkEvents and display coordinates to
	tools any more.

	* app/tools/gimptool.[ch]: changed virtual functions to take
	GimpCoords, time and state separately instead of GdkEvents.

	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbucketfilltool.[ch]
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcroptool.[ch]
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimpdrawtool.c
	* app/tools/gimpeditselectiontool.[ch]
	* app/tools/gimperasertool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpfreeselecttool.[ch]
	* app/tools/gimpfuzzyselecttool.c
	* app/tools/gimpinktool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimppathtool.[ch]
	* app/tools/gimprectselecttool.c
	* app/tools/gimprotatetool.c
	* app/tools/gimpselectiontool.[ch]
	* app/tools/gimpsmudgetool.c
	* app/tools/gimptexttool.c
	* app/tools/gimptransformtool.[ch]
	* app/tools/path_tool.[ch]
	* app/tools/selection_options.c: tons and tons of changes:

	- changed to use the new virtual function parameters.
	- removed zillions of gdisplay_untransform_coords().
	- get the active drawable's offsets manually in many cases.
	  (questionable, but IMHO ok because it's obvious and not simply a
	  "TRUE" passed to some function)
	- reordered some functions to be consistent across tools.
	- some tools had to be changed to work on image coords, not
	  display ones (esp. crop).
	- fixed strange rotate tool behaviour which should be backported
	  to stable.
	- some stuff i came across.
	- indentation and other paranoia.
	- rounding of coordinated may be broken in some tools.
	- new bugs guaranteed.

	* app/tools/tool_manager.[ch]: new semantic of
	tool_manager_initialize_active() (looked at the places where it
	was used from and put common code together). Should be a bit
	better now :)

	* app/tools/gimpblendtool.c
	* app/tools/transform_options.c: use the new GTK+ feature that a
	widget (toggle button) can be a frame's title for this tools' tool
	options.

	* app/widgets/widgets-types.h: stuff.

	* themes/Default/gtkrc: s/GtkDialog/GimpDialog/.

	* tools/pdbgen/Makefile.am: don't scan tools/gimpbucketfilltool.h
	any more.

	* tools/pdbgen/enums.pl: regenerated.

	* tools/pdbgen/pdb/tools.pdb: changed bucket_fill wrapper.

	* app/pdb/tools_cmds.c: regenerated.
2001-11-08 19:14:51 +00:00
Michael Natterer 05e15eb1cc Cleanup weekend...
2001-10-29  Michael Natterer  <mitch@gimp.org>

	Cleanup weekend...

	* app/app_procs.c: pass "no_interface" to gimp_new().

	* app/core/gimp.[ch]: added "gboolean no_interface" and the
	load_procs and save_procs GSLists.

	* app/core/gimptoolinfo.[ch]: added a "Gimp" pointer to the
	GimpToolInfo object so more functions find their context without
	accessing the global "the_gimp" variable.

	* app/display/display-types.h: removed the GDisplay -> GimpDisplay
	typedef.

	* app/display/gimpdisplay.c: look at gimp->no_interface, don't
	include "appenv.h".

	* app/file/file-open.[ch]
	* app/file/file-save.[ch]: don't use "the_gimp" any more. Instead,
	pass around lots of "Gimp" pointers. Removed the global load_procs
	and save_procs variables here. Use access() to find out whether a
	file is readable/writable, removed the manual voodoo and it's
	Win32 wrappers. Added an optional (can be NULL) "PlunInProcDef"
	parameter to file_save(), removed file_save_with_proc().

	* app/gui/menus.c: Use the unused "gpointer data" parameter of the
	GtkItemFactory callbacks to pass a "Gimp" pointer to all of them.
	This reduces the usage of the global "the_gimp" hack to zero
	in app/gui/... yeah.

	* app/gui/channels-commands.c
	* app/gui/edit-commands.c
	* app/gui/file-commands.c
	* app/gui/image-commands.c
	* app/gui/layers-commands.c
	* app/gui/palettes-commands.c
	* app/gui/select-commands.c
	* app/gui/test-commands.c
	* app/gui/tools-commands.c
	* app/gui/view-commands.c: use the passed "Gimp" pointer.

	* app/gui/color-area.[ch]
	* app/gui/convert-dialog.c
	* app/gui/dialogs-constructors.c
	* app/gui/file-new-dialog.[ch]
	* app/gui/file-open-dialog.[ch]
	* app/gui/file-save-dialog.[ch]
	* app/gui/gui.c
	* app/gui/info-window.[ch]
	* app/gui/module-browser.[ch]
	* app/gui/palette-editor.c
	* app/gui/palette-import-dialog.[ch]
	* app/gui/paths-dialog.c
	* app/gui/preferences-dialog.[ch]
	* app/gui/resize-dialog.[ch]
	* app/gui/tool-options-dialog.[ch]
	* app/gui/toolbox.c: pass around lots more "Gimp" and
	"GimpContext" pointers and don't use "the_gimp" any more.

	* app/tools/gimptool.h: added a pointer to the corresponding
	GimpToolInfo object (which in turn has a pointer to a Gimp).

	* app/tools/tool_manager.[ch]: set the pointer after creating the
	tool object. Removed tool_manager_get_info_by_tool() as there is a
	tool->tool_info pointer now.

	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcolorpickertool.c
	* app/tools/gimpconvolvetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpdodgeburntool.c
	* app/tools/gimpdrawtool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimpellipseselecttool.c
	* app/tools/gimperasertool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimphistogramtool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimpinktool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpmagnifytool.c
	* app/tools/gimpmeasuretool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimppainttool.c
	* app/tools/gimppathtool.c
	* app/tools/gimpperspectivetool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimprectselecttool.c
	* app/tools/gimprotatetool.c
	* app/tools/gimpscaletool.c
	* app/tools/gimpsheartool.c
	* app/tools/gimptexttool.c
	* app/tools/gimpthresholdtool.c
	* app/tools/path_tool.c
	* app/tools/xinput_airbrush.c: s/GDisplay/GimpDisplay/g.
	Use tool->tool_info and tool_info->gimp in some places to get
	rid of using "the_gimp".

	Removing the remaining ones involves changing the tool options
	system and is scheduled next...

	* app/widgets/gimpdnd.c
	* app/widgets/gimpdocumentview.c: pass a "Gimp" pointer to all
	file_open_*() functions.

	* app/gdisplay_color.[ch]
	* app/gdisplay_color_ui.[ch]
	* app/image_map.[ch]
	* app/nav_window.[ch]
	* app/path.c
	* app/path_bezier.c
	* app/path_transform.h
	* app/qmask.[ch]: s/GDisplay/GimpDisplay/g

	* tools/pdbgen/pdb/fileops.pdb: load_procs and save_procs are
	members of the "Gimp" object now.

	* tools/pdbgen/pdb/plug_in.pdb: use gimp->no_interface, don't
	include "appenv.h".

	* app/pdb/fileops_cmds.c
	* app/pdb/plug_in_cmds.c: regenerated.
2001-10-29 11:47:11 +00:00
Michael Natterer 18dd072836 app/gimpprogress.[ch] s/GDisplay/GimpDisplay/
2001-10-16  Michael Natterer  <mitch@gimp.org>

	* app/gimpprogress.[ch]
	* app/undo.c: s/GDisplay/GimpDisplay/

	* app/plug_in.[ch]: removed unused boolean "destroy" field of
	the PlugIn struct.

	* app/core/gimpedit.c: don't include "app_procs.h"

	* app/display/gimpdisplay-callbacks.c: moved the "grab_abd_scroll"
	stuff from gimpdisplay-scroll.* here (less complicated and easier
	to cleanup...)

	* app/display/gimpdisplay-scroll.[ch]: removed here.

	* app/display/gimpdisplay-render.[ch]
	* app/display/gimpdisplay-selection.[ch]
	* app/display/gimpdisplayshell.c: s/GDisplay/GimpDisplay/g

	* app/display/gimpdisplay.[ch]: ditto, removed gdisplay_active()
	which was just a wrapper around
	"gimp_context_get_display (gimp_get_user_context (the_gimp))"
	(which is more to type but makes the use of the global
	"the_gimp" variable more obvious).

	* app/gui/color-area.h
	* app/gui/edit-commands.c
	* app/gui/file-commands.c
	* app/gui/file-dialog-utils.c
	* app/gui/image-commands.c
	* app/gui/info-window.h
	* app/gui/paths-dialog.h
	* app/gui/select-commands.c
	* app/gui/tool-options-dialog.c
	* app/gui/tools-commands.c
	* app/gui/view-commands.c: s/GDisplay/GimpDisplay/, gdisplay_active()
	removal, include "app_procs.h" for "the_gimp".

	* app/tools/gimpbezierselecttool.h
	* app/tools/gimpbrightnesscontrasttool.[ch]
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpcolorbalancetool.[ch]
	* app/tools/gimpcurvestool.[ch]
	* app/tools/gimpeditselectiontool.h
	* app/tools/gimphistogramtool.[ch]
	* app/tools/gimphuesaturationtool.[ch]
	* app/tools/gimplevelstool.[ch]
	* app/tools/gimpmovetool.h
	* app/tools/gimpperspectivetool.h
	* app/tools/gimpposterizetool.[ch]
	* app/tools/gimprotatetool.h
	* app/tools/gimpscaletool.h
	* app/tools/gimpsheartool.h
	* app/tools/gimptexttool.h
	* app/tools/gimpthresholdtool.[ch]
	* app/tools/gimptool.[ch]
	* app/tools/gimptransformtool.h
	* app/tools/tool_manager.[ch]: lots of s/GDisplay/GimpDisplay/, made
	all *_dialog_hide() functions private, cleanup.

	* app/widgets/*: removed GtkType and gtk_type_* stuff entirely and
	use GObject functions, removed lots of empty "destroy" methods and
	use more type checking class cast macros instead of casting
	directly.

	* app/widgets/gimpcontainermenu.c: fixed item insert order.

	* app/widgets/gimphistogramview.[ch]: cleaned up and renamed all
	functions.

	* app/widgets/gimpwidgets-utils.[ch]: removed gimp_dialog_hide() as
	Gtk+ does the right thing (TM) now.

	* tools/pdbgen/pdb/color.pdb: implemented "histogram" without
	digging into tools/ and widgets/ (needs to be done for all
	color PDB functions).

	* tools/pdbgen/pdb/gimprc.pdb: no need to use "the_gimp" in a PDB
	function as a "Gimp" pointer is passed to them all.

	* tools/pdbgen/pdb/image.pdb: don't include "app_procs.h"

	* app/pdb/color_cmds.c
	* app/pdb/gimprc_cmds.c
	* app/pdb/image_cmds.c: regenerated.

	* app/pdb/procedural_db.c: don't include "app_procs.h"
2001-10-17 11:33:43 +00:00
Michael Natterer 667d8626eb app/tools/gimptool.[ch] removed all *_get_PDB_string() functions and
2001-08-15  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimptool.[ch]
	* app/tools/tool_manager.[ch]: removed all *_get_PDB_string()
	functions and GimpToolClass' "pdb_string" field as this info is
	stored independent from a specific tool instance in GimpToolInfo

	* app/tools/gimpbezierselecttool.c: use GimpToolInfo's "pdb_string".
2001-08-14 22:28:25 +00:00
Michael Natterer e2daae315b an evil temp_hack which lets GimpContext managing the active display
2001-08-14  Michael Natterer  <mitch@gimp.org>

	* app/gdisplay.h: an evil temp_hack which lets GimpContext managing
	the active display withoug including "gdisplay.h". Will go away as
	soon ad context properties are registered dynamically.

	* app/module_db.c: cleaned up the object code in preparation of
	moving it to core/.

	* app/path.c: connect to GimpImage's

	* app/core/gimpobject.[ch]: derive it from GObject, not from
	GtkObject any more (yeah :-)

	* app/core/*.c: #include <glib-object.h> instead of <gtk/gtk.h>,
	removed some remaining GtkObject-isms.

	(left in a few #include <gtk/gtk.h> where bigger changes are needed
	to get rid of the UI dependency).

	* app/core/core-types.h: #include <gdk-pixbuf/gdk-pixbuf.h> here
	temporarily.

	* app/core/gimp.c (gimp_create_display): unref the image after
	creating it's first display.

	* app/core/gimpbrush.[ch]: disabled the parts of the code which
	depend on GimpPaintTool.

	* app/core/gimpbrushgenerated.c
	* app/core/gimpbrushpipe.c: changed accordingly.

	* app/core/gimpcontext.[ch]: evil hack (see above) to manage the
	active display without including "gdisplay.h"

	* app/core/gimpimage-mask.[ch]: pass a context to
	gimage_mask_stroke() and get the current tool's PDB string from
	there.

	* app/core/gimpedit.c: changed accordingly.

	* app/core/gimpimage.c: use gimp_image_update() instead of
	gdisplays_update_full().

	* app/gui/color-area.c
	* app/gui/colormap-dialog.c
	* app/gui/dialogs-constructors.c
	* app/gui/edit-commands.c
	* app/gui/image-commands.c
	* app/gui/toolbox.c: changed accordingly (don't use Gtk methods on
	GObjects).

	* app/gui/menus.c: fix some const warnings by explicit casting.

	* app/tools/*.[ch]: ported all tools to GObject, some minor
	cleanup while i was on it.

	* app/widgets/gimpdialogfactory.[ch]: ported to GObject.

	* app/widgets/gimplayerlistview.h: added FOO_GET_CLASS() macro.

	* tools/pdbgen/app.pl: added a "widgets_eek" hack like "tools_eek"
	which inserts #include "widgets/widgets-types.h" before ordinary
	includes.

	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/edit.pdb
	* app/pdb/brush_select_cmds.c
	* app/pdb/edit_cmds.c: changed according to the stuff above.
2001-08-14 14:53:55 +00:00
Michael Natterer fdabe08cf0 DIE broken pipe, DIE 2001-08-05 16:08:19 +00:00
Michael Natterer b844c98549 removed path_to_beziersel() so this file can be safely included from
2001-07-17  Michael Natterer  <mitch@gimp.org>

	* app/path.[ch]: removed path_to_beziersel() so this file can be
	safely included from core/.

	* app/tools/gimpbezierselecttool.[ch]: added it here.

	* app/core/core-types.h: added a GimpToolOptions typedef. Removes
	deps into tools/ and will later be a core object anyway.

	* app/tools/tools-types.h: removed the ToolOptions typedef here.

	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-mask.c
	* app/core/gimpimage.c
	* app/core/gimptoolinfo.[ch]: removed deps into tools/, misc stuff.

	* app/tools/tool_manager.[ch]: some ugly temp hacks. Please ignore.

	* app/widgets/gimpdialogfactory.[ch]: added a "remember_if_open" field
	to the GimpDialogFactoryEntry so we can manage dialogs which should
	not be re-opened on startup.

	* app/gui/dialogs-constructors.c
	* app/gui/dialogs.c: register & create all editor dialog with the
	"global_dialog_factory".

	* app/gui/tool-options-dialog.c
	* app/tools/*: s/ToolOptions/GimpToolOptions/
2001-07-17 20:50:01 +00:00
Michael Natterer b70ee4b76d put all tool_manager variables into a struct which is attached to a
2001-07-07  Michael Natterer  <mitch@gimp.org>

	* app/tools/tool_manager.[ch]: put all tool_manager variables into
	a struct which is attached to a "Gimp". Pass a Gimp* to all
	tool_manager functions.

	* app/disp_callbacks.c
	* app/gdisplay.c
	* app/gimage.c
	* app/scale.c
	* app/scroll.c
	* app/undo.c
	* app/gui/convert-dialog.c
	* app/gui/edit-commands.c
	* app/gui/tool-options-dialog.c
	* app/gui/tools-commands.c: changed accordingly.

	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpbrightnesscontrasttool.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolorbalancetool.c
	* app/tools/gimpcroptool.c
	* app/tools/gimpcurvestool.c
	* app/tools/gimpeditselectiontool.c
	* app/tools/gimphistogramtool.c
	* app/tools/gimphuesaturationtool.c
	* app/tools/gimplevelstool.c
	* app/tools/gimpposterizetool.c
	* app/tools/gimptexttool.c
	* app/tools/gimpthresholdtool.c
	* app/tools/gimptool.c
	* app/tools/gimptransformtool.c: mostly bad hacks for tool dialogs
	which exist without a real context. Needs some more review.
2001-07-07 17:36:00 +00:00
Michael Natterer 1bcd3e1834 app/Makefile.am removed.
2001-07-07  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/context_manager.[ch]: removed.

	* app/app_procs.c: call tool_mananger instead of context_manager
	functions, pass "the_gimp" to some more functions.

	* app/drawable.[ch]: pass a GimpContext to drawable_fill().

	* app/errors.c: behave according to "stack_trace_mode" when using
	the debugging signal handler.

	* app/gimprc.[ch]: removed the core/ config variables.

	* app/selection.c: set the selection's state to INVISIBLE in
	selection_pause().

	* app/core/Makefile.am
	* app/core/gimpcoreconfig.[ch]: new files (the configuration
	variables used by core/).

	* app/core/gimpcontext.[ch]: removed the global contexts (user,
	default, ...) and their functions. It's no longer possible to pass
	NULL to the context functions to manipulate the current context
	(gimpcontext.c doesn't know the current context any more).

	* app/core/gimp.[ch]: added them here. The functions are now called
	gimp_[set|get]_*_context(). Added gimp_create_context() which is
	the only function to create contexts now.

	* app/gui/dialogs.[ch]
	* app/gui/gui.[ch]: pass "gimp" to all functions.

	* app/tools/tool_manager.[ch]
	* app/tools/tools.[ch]: pass "gimp" to lots of functions. Added
	the "global_tool_context" logic and the global/non-global paint
	options switching from the context_manager. Pass "gimp" to all
	tools' "register" functions.

	* app/tools/*: changed accordingly.

	* app/devices.c
	* app/disp_callbacks.c
	* app/file-open.[ch]
	* app/file-save.c
	* app/gdisplay.c
	* app/gimage.c
	* app/libgimp_glue.c
	* app/module_db.c
	* app/nav_window.c
	* app/plug_in.c
	* app/qmask.c
	* app/undo.c
	* app/base/base-config.c
	* app/core/gimpbrushpipe.c
	* app/core/gimpdrawable-offset.c
	* app/core/gimpgradient.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-mask.c
	* app/core/gimpimage-new.c
	* app/core/gimpimage.c
	* app/core/gimppalette.c
	* app/core/gimptoolinfo.[ch]
	* app/core/gimpundo.c
	* app/gui/brush-select.c
	* app/gui/channels-commands.c
	* app/gui/color-area.c
	* app/gui/dialogs-constructors.c
	* app/gui/file-new-dialog.c
	* app/gui/file-open-dialog.c
	* app/gui/gradient-editor.c
	* app/gui/gradient-select.c
	* app/gui/info-window.c
	* app/gui/layers-commands.c
	* app/gui/menus.c
	* app/gui/palette-editor.c
	* app/gui/palette-import-dialog.c
	* app/gui/palette-select.c
	* app/gui/paths-dialog.c
	* app/gui/pattern-select.c
	* app/gui/preferences-dialog.c
	* app/gui/resize-dialog.c
	* app/gui/test-commands.c
	* app/gui/tool-options-dialog.c
	* app/gui/toolbox.c
	* app/gui/tools-commands.c
	* app/xcf/xcf-load.c
	* app/xcf/xcf-save.c
	* app/widgets/gimpchannellistview.c
	* app/widgets/gimpdnd.c
	* app/widgets/gimpdrawablelistview.[ch]
	* app/widgets/gimpimagedock.c
	* app/widgets/gimplayerlistview.c
	* app/pdb/brushes_cmds.c
	* app/pdb/drawable_cmds.c
	* app/pdb/gradient_select_cmds.c
	* app/pdb/gradients_cmds.c
	* app/pdb/palette_cmds.c
	* app/pdb/patterns_cmds.c
	* app/pdb/procedural_db.c
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/drawable.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/patterns.pdb: changed accordingly: remove usage
	of gimp_context_[get|set]_*(NULL), create contexts with
	gimp_create_context(). Get the user/current context with
	gimp_get_[user|current]_context(). Added/removed access to the
	global "the_gimp" variable in some places. Get the core's config
	variables from "core_config".
2001-07-07 12:17:23 +00:00
Michael Natterer 0164596064 app/core/Makefile.am app/core/core-types.h added an "application object"
2001-07-04  Michael Natterer  <mitch@gimp.org>

	* app/core/Makefile.am
	* app/core/core-types.h
	* app/core/gimp.[ch]: added an "application object" called Gimp.

	Currently, it contains the image list, the clipboard, the data
	factories, the procedural hashtable and the tool info list.  It's
	the toplevel object of the core object system. Finally, creating a
	Gimp object will return a standalone gimp core engine instance
	with no other global states/variables involved.

	* app/app_procs.[ch]: allocate a "Gimp" instance called "the_gimp" :)
	Removed stuff which is now done by the "Gimp" object. Merged
	gimp_init() into app_init() because gimp_init() is taken now.

	* app/context_manager.[ch]: removed stuff done by "Gimp".

	* app/batch.[ch]
	* app/gimage.[ch]
	* app/xcf/xcf-load.[ch]
	* app/xcf/xcf.[ch]
	* app/core/gimpedit.[ch]
	* app/tools/tool_manager.[ch]: pass around an additional "Gimp"
	argument.

	* app/pdb/procedural_db.[ch]: pass a "Gimp" pointer as first
	parameter to all internal procedures and to all procedural_db_*
	functions.

	* app/core/gimpcontext.[ch]
	* app/core/gimpimage.[ch]: added a "Gimp" pointer to the structs.

	* app/devices.c
	* app/errors.c
	* app/file-open.c
	* app/file-save.c
	* app/gimphelp.c
	* app/gimpunit.c
	* app/image_new.c
	* app/main.c
	* app/nav_window.c
	* app/plug_in.c
	* app/base/base.c
	* app/core/gimpdatafactory.c
	* app/core/gimpimage-duplicate.c
	* app/core/gimpimage-mask.c
	* app/core/gimptoolinfo.[ch]
	* app/gui/brush-select.c
	* app/gui/convert-dialog.c
	* app/gui/dialogs-constructors.c
	* app/gui/edit-commands.c
	* app/gui/file-open-dialog.c
	* app/gui/file-save-dialog.c
	* app/gui/gradient-editor.c
	* app/gui/gradient-select.c
	* app/gui/gui.c
	* app/gui/image-commands.c
	* app/gui/info-window.c
	* app/gui/menus.c
	* app/gui/palette-editor.c
	* app/gui/palette-import-dialog.c
	* app/gui/palette-select.c
	* app/gui/paths-dialog.c
	* app/gui/pattern-select.c
	* app/gui/preferences-dialog.c
	* app/gui/test-commands.c
	* app/gui/toolbox.c
	* app/gui/tools-commands.c
	* app/tools/gimpbezierselecttool.c
	* app/tools/gimpbucketfilltool.c
	* app/tools/gimppainttool.h
	* app/tools/gimptexttool.c
	* app/tools/gimptransformtool.h
	* app/widgets/gimpbufferview.c
	* app/widgets/gimpcontainerview-utils.c
	* app/widgets/gimpcursor.c
	* app/widgets/gimpdnd.c
	* app/widgets/gimpimagedock.c: changed accordingly. Cleaned up
	lots of includes. Many files still access the global "the_gimp"
	variable exported by app_procs.h.

	* tools/pdbgen/app.pl
	* tools/pdbgen/pdb/brush_select.pdb
	* tools/pdbgen/pdb/brushes.pdb
	* tools/pdbgen/pdb/convert.pdb
	* tools/pdbgen/pdb/edit.pdb
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/pdb/gradient_select.pdb
	* tools/pdbgen/pdb/gradients.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/palette.pdb
	* tools/pdbgen/pdb/pattern_select.pdb
	* tools/pdbgen/pdb/patterns.pdb
	* tools/pdbgen/pdb/procedural_db.pdb: changed accordingly. Don't
	use "the_gimp" here because all procedures get passed a "Gimp"
	pointer now.

	* app/pdb/*: regenerated.
2001-07-04 19:31:35 +00:00
Michael Natterer a138eae7c4 app/gdisplay.c app/gimage.c. #include "tools/tool.h"
2001-02-28  Michael Natterer  <mitch@gimp.org>

	* app/gdisplay.c
	* app/gimage.c. #include "tools/tool.h"

	* app/tools/edit_selection.[ch]: the arrow_key function is not
	a method of edit_selection but of any tool that needs it.

	* app/tools/gimppaintbrushtool.c: removed variables.

	* app/tools/move.c: use the arrow_key function.

	* app/tools/tool_manager.h: removed the include of "tool.h"
2001-02-28 02:53:27 +00:00
Michael Natterer 904d8e2cab app/tools/Makefile.am back as real tool which gets temporarily pushed to
2001-02-28  Michael Natterer  <mitch@gimp.org>

	* app/tools/Makefile.am
	* app/tools/edit_selection.[ch]: back as real tool which gets
	temporarily pushed to the tool_manager's new tool stack.

	* app/tools/move.c
	* app/tools/text_tool.c: call the edit_selection stuff again.

	* app/tools/tool.c: added a STUB().

	* app/tools/tool_manager.[ch]: implemented tool_manager_push_tool()
	and tool_manager_pop_tool().
2001-02-28 02:29:25 +00:00
Michael Natterer 3d78cbd56c made the global_paint_options public.
2001-02-28  Michael Natterer  <mitch@gimp.org>

	* app/context_manager.[ch]: made the global_paint_options public.

	* app/tools/gimptoolinfo.[ch]: added a "tool_context" boolean to
	the constructor and create a private context for the tool
	initialized with global_paint_options's values.

	* app/tools/tool_manager.[ch]: changed tool_manager_register_tool()
	accordingly.

	* app/tools/gimpcolorpickertool.c
	* app/tools/measure.c
	* app/tools/move.c
	* app/tools/text_tool.c: changed accordingly.

	* app/tools/paint_options.[ch]: added the fade out and gradient
	options here so they can be used by all paint tools.

	* app/tools/gimppaintbrushtool.c: removed them here. Changed
	the non_gui stuff: removed the non_gui_paint_func and handle
	the non_gui stuff in the normal paint method. Allocate a
	non_gui_paintbrush instead of the old non_gui_paint_core.

	The non_gui stuff will change totally and will be handled
	by GimpPaintTool only.

	* app/tools/tool.c: removed the STUB()'s again.
2001-02-27 23:20:51 +00:00
Michael Natterer 3eb62f8756 removed crap from ancient times when tools used to be an enum.
2001-02-23  Michael Natterer  <mitch@gimp.org>

	* app/app_procs.c: removed crap from ancient times when tools
	used to be an enum.

	* app/brush_select.[ch]: cleaned up the gui and made global paint
	mode toggling much simpler by expanding vertically instead of
	reparenting.

	* app/context_manager.c: removed hack by using a tool manager
	accessor function.

	* app/gimpcontext.c: use the new standard tool info object. Tools
	also _behave_ like all other data types now (can e.g. be
	refreshed).

	* app/tools/tool.[ch]

	* app/tools/gimptoolinfo.[ch]: added an "identifier" which is an
	untranslated string with a meaningful prefix and name, e.g.
	"gimp:color_picker_tool". Renamed "tool_name" and "tool_desc"
	to "blurb" and "help", changed the constructor accordingly.
	Added gimp_tool_info_get_standards() to make the context work
	with tool refresh.

	* app/tools/tool_manager.[ch]
	* app/tools/tools.c: removed the global list of tool class
	structures because the tool info list is in place.
	Added tool_manager_register_tool_options() which calls
	tool_options_dialog_add() and registers the options in the
	global_tool_info_list.

	* app/tools/Makefile.am
	* app/tools/paint_options.[ch]
	* app/tools/selection_options.[ch]
	* app/tools/tool_options.[ch]
	* app/tools/tool_options_dialog.[ch]: build them all again. This
	is mostly the old tool options system with minor modifications to
	work with the new stuff. The tool options auto-update with the user
	context now, so there are no update functions any more.

	* app/gimpdnd.c
	* app/toolbox.c
	* app/tools/color_picker.c
	* app/tools/measure.c
	* app/tools/move.c: changed accordingly.
2001-02-23 21:32:47 +00:00
Michael Natterer 9417fa1db7 forgot one s/gimptool/gimptool-1.4/
2001-02-21  Michael Natterer  <mitch@gimp.org>

	* configure.in: forgot one s/gimptool/gimptool-1.4/

	* app/appenums.h: removed "UPDATE_CURSOR" from the ToolAction enum.

	* app/context_manager.c: removed the toolbox toggle button updating
	code here...

	* app/toolbox.c: ...and handle it in the toolbox itself.

	* app/devices.c: removed some obsolete old tool suff.

	* app/tools/Makefile.am
	* app/tools/move.[ch]: reactivated. Disabled the edit_selection
	stuff for now. We need a way to temporary push tools to some stack
	of the tool manager.

	* app/tools/tool.[ch]: removed lot of stuff that is obsolete or
	handled by the GimpToolInfo object now.

	* app/tools/tool_manager.[ch]: stripped all tool options stuff
	because they will be able to follow tool changes themselves.
	Renamed some functions to be consistent.

	* app/tools/tools.c: register the move tool again.

	* app/cursorutil.c
	* app/disp_callbacks.c
	* app/gimage_mask.c
	* app/global_edit.c
	* app/tools/color_picker.c
	* app/tools/measure.[ch]
	* app/tools/tool_options.c: changed accordingly.
2001-02-21 21:56:39 +00:00
Michael Natterer 99c5201870 Made the tool system work again and integrated it back with the
2001-02-21  Michael Natterer  <mitch@gimp.org>

	Made the tool system work again and integrated it back with the
	GimpContext. It's a hack between old, new and freshly hacked
	stuff. There are still lots of warnings but at least we can switch
	tools again.

	* app/tools/Makefile.am
	* app/tools/gimptoolinfo.[ch]: resurrected as real object.
	The GimpToolInfo objects are derived from GimpData, which gives
	us the tool icon stuff for free. Also, we need a list of _objects_
	which is allocated all the time. All tools are required to have
	a "register" function which registers themselves with the list
	of GimpToolInfo objects which is maintained by the tool manager.

	* app/tools/tool.[ch]: made a real GtkObject with properly named
	functions out of it. The former "active_tool_control" is of
	course not the default implementation of the tool's "control"
	method but a hack _around_ it, so it went to the tool manager.

	* app/tools/color_picker.[ch]
	* app/tools/measure.[ch]: ditto. Added "register" functions and
	"destroy" implementations so the tools go away after use.

	* app/tools/tool_manager.[ch]: badly hacked at the moment to keep
	both the list of class structures _and_ the tool info list.

	* app/tools/tools.c: call the tools' register functions.

	* app/gimpcontext.[ch]: store a pointer to a GimpToolInfo object
	as "active_tool" in the context, so we're independent of tools
	being allocated or not. It's treated just like a brush or pattern
	now.

	* app/gimpdnd.[ch]: made tool DND work like all other DND types.

	* app/devices.[ch]: also here: the tool is just a normal data object
	now, resulting in removal of lots of code.

	* app/commands.c
	* app/context_manager.c: updated the tool select and context stuff
	to work again.

	* app/toolbox.c: removed the old pixmap buttons and put GimpPreviews
	inside the tool buttons. Still needs an own preview type to
	look nice.

	* app/disp_callbacks.c
	* app/about_dialog.c
	* app/app_procs.c
	* app/appenums.h
	* app/apptypes.h
	* app/gimage.c
	* app/gimppalette.c
	* app/gimppreview.c
	* app/gimprc.c
	* app/info_window.c
	* app/menus.c
	* app/palette_select.h
	* app/scale.c
	* app/scroll.c: lots of changes to make it work again.
2001-02-21 12:18:09 +00:00
Nate Summers ac6149fb86 forgot a file 2001-02-14 05:16:58 +00:00