1
/* The GIMP -- an image manipulation program
2
* Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis, and others
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
#ifndef __GIMP_TOOL_H__
20
#define __GIMP_TOOL_H__
23
#include "core/gimpobject.h"
26
#define GIMP_TYPE_TOOL (gimp_tool_get_type ())
27
#define GIMP_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TOOL, GimpTool))
28
#define GIMP_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TOOL, GimpToolClass))
29
#define GIMP_IS_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TOOL))
30
#define GIMP_IS_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TOOL))
31
#define GIMP_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TOOL, GimpToolClass))
34
typedef struct _GimpToolClass GimpToolClass;
38
GimpObject parent_instance;
40
GimpToolInfo *tool_info;
42
gint ID; /* unique tool ID */
44
GimpToolControl *control;
46
GimpDisplay *gdisp; /* pointer to currently active gdisp */
47
GimpDrawable *drawable; /* pointer to the tool's current drawable */
49
/* focus_display and modifier_state are *private* state of
50
* gimp_tool_set_focus_display() and gimp_tool_set_modifier_state().
51
* ignore them in tool implementations, they don't exist!
53
GimpDisplay *focus_display;
54
GdkModifierType modifier_state;
59
GimpObjectClass parent_class;
61
/* virtual functions */
63
gboolean (* initialize) (GimpTool *tool,
65
void (* control) (GimpTool *tool,
66
GimpToolAction action,
69
void (* button_press) (GimpTool *tool,
72
GdkModifierType state,
74
void (* button_release) (GimpTool *tool,
77
GdkModifierType state,
79
void (* motion) (GimpTool *tool,
82
GdkModifierType state,
85
gboolean (* key_press) (GimpTool *tool,
88
void (* modifier_key) (GimpTool *tool,
91
GdkModifierType state,
94
void (* oper_update) (GimpTool *tool,
96
GdkModifierType state,
98
void (* cursor_update) (GimpTool *tool,
100
GdkModifierType state,
105
GType gimp_tool_get_type (void) G_GNUC_CONST;
107
gboolean gimp_tool_initialize (GimpTool *tool,
109
void gimp_tool_control (GimpTool *tool,
110
GimpToolAction action,
113
void gimp_tool_button_press (GimpTool *tool,
116
GdkModifierType state,
118
void gimp_tool_button_release (GimpTool *tool,
121
GdkModifierType state,
123
void gimp_tool_motion (GimpTool *tool,
126
GdkModifierType state,
129
gboolean gimp_tool_key_press (GimpTool *tool,
133
void gimp_tool_set_focus_display (GimpTool *tool,
135
void gimp_tool_set_modifier_state (GimpTool *tool,
136
GdkModifierType state,
139
void gimp_tool_oper_update (GimpTool *tool,
141
GdkModifierType state,
143
void gimp_tool_cursor_update (GimpTool *tool,
145
GdkModifierType state,
148
void gimp_tool_push_status (GimpTool *tool,
149
const gchar *message);
150
void gimp_tool_push_status_coords (GimpTool *tool,
153
const gchar *separator,
155
void gimp_tool_push_status_length (GimpTool *tool,
157
GimpOrientationType axis,
159
void gimp_tool_pop_status (GimpTool *tool);
161
void gimp_tool_set_cursor (GimpTool *tool,
163
GimpCursorType cursor,
164
GimpToolCursorType tool_cursor,
165
GimpCursorModifier modifier);
168
#endif /* __GIMP_TOOL_H__ */