~ubuntu-branches/ubuntu/hoary/gimp/hoary

« back to all changes in this revision

Viewing changes to app/tools/gimptool.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2005-04-04 14:51:23 UTC
  • Revision ID: james.westby@ubuntu.com-20050404145123-9py049eeelfymur8
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* The GIMP -- an image manipulation program
 
2
 * Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis, and others
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 */
 
18
 
 
19
#ifndef __GIMP_TOOL_H__
 
20
#define __GIMP_TOOL_H__
 
21
 
 
22
 
 
23
#include "core/gimpobject.h"
 
24
 
 
25
 
 
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))
 
32
 
 
33
 
 
34
typedef struct _GimpToolClass GimpToolClass;
 
35
 
 
36
struct _GimpTool
 
37
{
 
38
  GimpObject       parent_instance;
 
39
 
 
40
  GimpToolInfo    *tool_info;
 
41
 
 
42
  gint             ID;           /*  unique tool ID                         */
 
43
 
 
44
  GimpToolControl *control;
 
45
 
 
46
  GimpDisplay     *gdisp;        /*  pointer to currently active gdisp      */
 
47
  GimpDrawable    *drawable;     /*  pointer to the tool's current drawable */
 
48
 
 
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!
 
52
   */
 
53
  GimpDisplay     *focus_display;
 
54
  GdkModifierType  modifier_state;
 
55
};
 
56
 
 
57
struct _GimpToolClass
 
58
{
 
59
  GimpObjectClass  parent_class;
 
60
 
 
61
  /*  virtual functions  */
 
62
 
 
63
  gboolean (* initialize)     (GimpTool        *tool,
 
64
                               GimpDisplay     *gdisp);
 
65
  void     (* control)        (GimpTool        *tool,
 
66
                               GimpToolAction   action,
 
67
                               GimpDisplay     *gdisp);
 
68
 
 
69
  void     (* button_press)   (GimpTool        *tool,
 
70
                               GimpCoords      *coords,
 
71
                               guint32          time,
 
72
                               GdkModifierType  state,
 
73
                               GimpDisplay     *gdisp);
 
74
  void     (* button_release) (GimpTool        *tool,
 
75
                               GimpCoords      *coords,
 
76
                               guint32          time,
 
77
                               GdkModifierType  state,
 
78
                               GimpDisplay     *gdisp);
 
79
  void     (* motion)         (GimpTool        *tool,
 
80
                               GimpCoords      *coords,
 
81
                               guint32          time,
 
82
                               GdkModifierType  state,
 
83
                               GimpDisplay     *gdisp);
 
84
 
 
85
  gboolean (* key_press)      (GimpTool        *tool,
 
86
                               GdkEventKey     *kevent,
 
87
                               GimpDisplay     *gdisp);
 
88
  void     (* modifier_key)   (GimpTool        *tool,
 
89
                               GdkModifierType  key,
 
90
                               gboolean         press,
 
91
                               GdkModifierType  state,
 
92
                               GimpDisplay     *gdisp);
 
93
 
 
94
  void     (* oper_update)    (GimpTool        *tool,
 
95
                               GimpCoords      *coords,
 
96
                               GdkModifierType  state,
 
97
                               GimpDisplay     *gdisp);
 
98
  void     (* cursor_update)  (GimpTool        *tool,
 
99
                               GimpCoords      *coords,
 
100
                               GdkModifierType  state,
 
101
                               GimpDisplay     *gdisp);
 
102
};
 
103
 
 
104
 
 
105
GType         gimp_tool_get_type           (void) G_GNUC_CONST;
 
106
 
 
107
gboolean      gimp_tool_initialize         (GimpTool            *tool,
 
108
                                            GimpDisplay         *gdisp);
 
109
void          gimp_tool_control            (GimpTool            *tool,
 
110
                                            GimpToolAction       action,
 
111
                                            GimpDisplay         *gdisp);
 
112
 
 
113
void          gimp_tool_button_press       (GimpTool            *tool,
 
114
                                            GimpCoords          *coords,
 
115
                                            guint32              time,
 
116
                                            GdkModifierType      state,
 
117
                                            GimpDisplay         *gdisp);
 
118
void          gimp_tool_button_release     (GimpTool            *tool,
 
119
                                            GimpCoords          *coords,
 
120
                                            guint32              time,
 
121
                                            GdkModifierType      state,
 
122
                                            GimpDisplay         *gdisp);
 
123
void          gimp_tool_motion             (GimpTool            *tool,
 
124
                                            GimpCoords          *coords,
 
125
                                            guint32              time,
 
126
                                            GdkModifierType      state,
 
127
                                            GimpDisplay         *gdisp);
 
128
 
 
129
gboolean      gimp_tool_key_press          (GimpTool            *tool,
 
130
                                            GdkEventKey         *kevent,
 
131
                                            GimpDisplay         *gdisp);
 
132
 
 
133
void          gimp_tool_set_focus_display  (GimpTool            *tool,
 
134
                                            GimpDisplay         *gdisp);
 
135
void          gimp_tool_set_modifier_state (GimpTool            *tool,
 
136
                                            GdkModifierType      state,
 
137
                                            GimpDisplay         *gdisp);
 
138
 
 
139
void          gimp_tool_oper_update        (GimpTool            *tool,
 
140
                                            GimpCoords          *coords,
 
141
                                            GdkModifierType      state,
 
142
                                            GimpDisplay         *gdisp);
 
143
void          gimp_tool_cursor_update      (GimpTool            *tool,
 
144
                                            GimpCoords          *coords,
 
145
                                            GdkModifierType      state,
 
146
                                            GimpDisplay         *gdisp);
 
147
 
 
148
void          gimp_tool_push_status        (GimpTool            *tool,
 
149
                                            const gchar         *message);
 
150
void          gimp_tool_push_status_coords (GimpTool            *tool,
 
151
                                            const gchar         *title,
 
152
                                            gdouble              x,
 
153
                                            const gchar         *separator,
 
154
                                            gdouble              y);
 
155
void          gimp_tool_push_status_length (GimpTool            *tool,
 
156
                                            const gchar         *title,
 
157
                                            GimpOrientationType  axis,
 
158
                                            gdouble              value);
 
159
void          gimp_tool_pop_status         (GimpTool            *tool);
 
160
 
 
161
void          gimp_tool_set_cursor         (GimpTool            *tool,
 
162
                                            GimpDisplay         *gdisp,
 
163
                                            GimpCursorType       cursor,
 
164
                                            GimpToolCursorType   tool_cursor,
 
165
                                            GimpCursorModifier   modifier);
 
166
 
 
167
 
 
168
#endif  /*  __GIMP_TOOL_H__  */