mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 04:22:29 +00:00
a3f44d8b0f
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.
99 lines
4.9 KiB
C
99 lines
4.9 KiB
C
/* 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.
|
|
*/
|
|
|
|
#ifndef __TOOL_MANAGER_H__
|
|
#define __TOOL_MANAGER_H__
|
|
|
|
|
|
void tool_manager_init (Gimp *gimp);
|
|
void tool_manager_restore (Gimp *gimp);
|
|
void tool_manager_exit (Gimp *gimp);
|
|
|
|
GimpTool * tool_manager_get_active (Gimp *gimp);
|
|
|
|
void tool_manager_select_tool (Gimp *gimp,
|
|
GimpTool *tool);
|
|
|
|
void tool_manager_push_tool (Gimp *gimp,
|
|
GimpTool *tool);
|
|
void tool_manager_pop_tool (Gimp *gimp);
|
|
|
|
|
|
void tool_manager_initialize_active (Gimp *gimp,
|
|
GimpDisplay *gdisp);
|
|
void tool_manager_control_active (Gimp *gimp,
|
|
GimpToolAction action,
|
|
GimpDisplay *gdisp);
|
|
void tool_manager_button_press_active (Gimp *gimp,
|
|
GimpCoords *coords,
|
|
guint32 time,
|
|
GdkModifierType state,
|
|
GimpDisplay *gdisp);
|
|
void tool_manager_button_release_active (Gimp *gimp,
|
|
GimpCoords *coords,
|
|
guint32 time,
|
|
GdkModifierType state,
|
|
GimpDisplay *gdisp);
|
|
void tool_manager_motion_active (Gimp *gimp,
|
|
GimpCoords *coords,
|
|
guint32 time,
|
|
GdkModifierType state,
|
|
GimpDisplay *gdisp);
|
|
void tool_manager_arrow_key_active (Gimp *gimp,
|
|
GdkEventKey *kevent,
|
|
GimpDisplay *gdisp);
|
|
void tool_manager_modifier_key_active (Gimp *gimp,
|
|
GdkModifierType key,
|
|
gboolean press,
|
|
GdkModifierType state,
|
|
GimpDisplay *gdisp);
|
|
void tool_manager_oper_update_active (Gimp *gimp,
|
|
GimpCoords *coords,
|
|
GdkModifierType state,
|
|
GimpDisplay *gdisp);
|
|
void tool_manager_cursor_update_active (Gimp *gimp,
|
|
GimpCoords *coords,
|
|
GdkModifierType state,
|
|
GimpDisplay *gdisp);
|
|
|
|
|
|
const gchar * tool_manager_active_get_help_data (Gimp *gimp);
|
|
|
|
|
|
void tool_manager_register_tool (GType tool_type,
|
|
GimpToolOptionsNewFunc options_new_func,
|
|
gboolean tool_context,
|
|
const gchar *identifier,
|
|
const gchar *blurb,
|
|
const gchar *help,
|
|
const gchar *menu_path,
|
|
const gchar *menu_accel,
|
|
const gchar *help_domain,
|
|
const gchar *help_data,
|
|
const gchar *stock_id,
|
|
gpointer data);
|
|
|
|
GimpToolInfo * tool_manager_get_info_by_type (Gimp *gimp,
|
|
GType tool_type);
|
|
|
|
|
|
void tool_manager_help_func (const gchar *help_data);
|
|
|
|
|
|
#endif /* __TOOL_MANAGER_H__ */
|