gimp/app/tools/tool_manager.h

97 lines
5.6 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
2001-02-14 13:16:58 +08:00
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
2001-02-14 13:16:58 +08:00
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2001-02-14 13:16:58 +08:00
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2001-02-14 13:16:58 +08:00
*/
#ifndef __TOOL_MANAGER_H__
#define __TOOL_MANAGER_H__
void tool_manager_init (Gimp *gimp);
void tool_manager_exit (Gimp *gimp);
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 20:17:23 +08:00
GimpTool * tool_manager_get_active (Gimp *gimp);
void tool_manager_push_tool (Gimp *gimp,
GimpTool *tool);
void tool_manager_pop_tool (Gimp *gimp);
2001-02-14 13:16:58 +08:00
gboolean tool_manager_initialize_active (Gimp *gimp,
GimpDisplay *display);
void tool_manager_control_active (Gimp *gimp,
GimpToolAction action,
GimpDisplay *display);
void tool_manager_button_press_active (Gimp *gimp,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpButtonPressType press_type,
GimpDisplay *display);
void tool_manager_button_release_active (Gimp *gimp,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *display);
void tool_manager_motion_active (Gimp *gimp,
const GimpCoords *coords,
guint32 time,
GdkModifierType state,
GimpDisplay *display);
gboolean tool_manager_key_press_active (Gimp *gimp,
GdkEventKey *kevent,
GimpDisplay *display);
gboolean tool_manager_key_release_active (Gimp *gimp,
GdkEventKey *kevent,
GimpDisplay *display);
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 19:14:28 +08:00
void tool_manager_focus_display_active (Gimp *gimp,
GimpDisplay *display);
void tool_manager_modifier_state_active (Gimp *gimp,
GdkModifierType state,
GimpDisplay *display);
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 19:14:28 +08:00
void tool_manager_active_modifier_state_active (Gimp *gimp,
GdkModifierType state,
GimpDisplay *display);
void tool_manager_oper_update_active (Gimp *gimp,
const GimpCoords *coords,
GdkModifierType state,
gboolean proximity,
GimpDisplay *display);
void tool_manager_cursor_update_active (Gimp *gimp,
const GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display);
2001-02-14 13:16:58 +08:00
const gchar * tool_manager_can_undo_active (Gimp *gimp,
GimpDisplay *display);
const gchar * tool_manager_can_redo_active (Gimp *gimp,
GimpDisplay *display);
gboolean tool_manager_undo_active (Gimp *gimp,
GimpDisplay *display);
gboolean tool_manager_redo_active (Gimp *gimp,
GimpDisplay *display);
GimpUIManager * tool_manager_get_popup_active (Gimp *gimp,
const GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display,
const gchar **ui_path);
2001-02-14 13:16:58 +08:00
#endif /* __TOOL_MANAGER_H__ */