~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/tools/gimptool.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995-2002 Spencer Kimball, Peter Mattis, and others
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
30
30
#define GIMP_IS_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TOOL))
31
31
#define GIMP_TOOL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TOOL, GimpToolClass))
32
32
 
 
33
#define GIMP_TOOL_GET_OPTIONS(t)  (gimp_tool_get_options (GIMP_TOOL (t)))
 
34
 
33
35
 
34
36
typedef struct _GimpToolClass GimpToolClass;
35
37
 
39
41
 
40
42
  GimpToolInfo    *tool_info;
41
43
 
42
 
  gint             ID;           /*  unique tool ID                         */
 
44
  gint             ID;          /*  unique tool ID                         */
43
45
 
44
46
  GimpToolControl *control;
45
47
 
46
 
  GimpDisplay     *gdisp;        /*  pointer to currently active gdisp      */
47
 
  GimpDrawable    *drawable;     /*  pointer to the tool's current drawable */
 
48
  GimpDisplay     *display;     /*  pointer to currently active display    */
 
49
  GimpDrawable    *drawable;    /*  pointer to the tool's current drawable */
48
50
 
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!
 
51
  /*  private state of gimp_tool_set_focus_display() and
 
52
   *  gimp_tool_set_[active_]modifier_state()
52
53
   */
53
54
  GimpDisplay     *focus_display;
54
55
  GdkModifierType  modifier_state;
 
56
  GdkModifierType  button_press_state;
 
57
  GdkModifierType  active_modifier_state;
 
58
 
 
59
  /*  private state for click detection
 
60
   */
 
61
  gboolean         in_click_distance;
 
62
  gboolean         got_motion_event;
 
63
  GimpCoords       button_press_coords;
 
64
  guint32          button_press_time;
 
65
 
 
66
  /*  private list of displays which have a status message from this tool
 
67
   */
 
68
  GList           *status_displays;
55
69
};
56
70
 
57
71
struct _GimpToolClass
60
74
 
61
75
  /*  virtual functions  */
62
76
 
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);
 
77
  gboolean      (* has_display)         (GimpTool              *tool,
 
78
                                         GimpDisplay           *display);
 
79
  GimpDisplay * (* has_image)           (GimpTool              *tool,
 
80
                                         GimpImage             *image);
 
81
 
 
82
  gboolean      (* initialize)          (GimpTool              *tool,
 
83
                                         GimpDisplay           *display,
 
84
                                         GError               **error);
 
85
  void          (* control)             (GimpTool              *tool,
 
86
                                         GimpToolAction         action,
 
87
                                         GimpDisplay           *display);
 
88
 
 
89
  void          (* button_press)        (GimpTool              *tool,
 
90
                                         GimpCoords            *coords,
 
91
                                         guint32                time,
 
92
                                         GdkModifierType        state,
 
93
                                         GimpDisplay           *display);
 
94
  void          (* button_release)      (GimpTool              *tool,
 
95
                                         GimpCoords            *coords,
 
96
                                         guint32                time,
 
97
                                         GdkModifierType        state,
 
98
                                         GimpButtonReleaseType  release_type,
 
99
                                         GimpDisplay           *display);
 
100
  void          (* motion)              (GimpTool              *tool,
 
101
                                         GimpCoords            *coords,
 
102
                                         guint32                time,
 
103
                                         GdkModifierType        state,
 
104
                                         GimpDisplay           *display);
 
105
 
 
106
  gboolean      (* key_press)           (GimpTool              *tool,
 
107
                                         GdkEventKey           *kevent,
 
108
                                         GimpDisplay           *display);
 
109
  void          (* modifier_key)        (GimpTool              *tool,
 
110
                                         GdkModifierType        key,
 
111
                                         gboolean               press,
 
112
                                         GdkModifierType        state,
 
113
                                         GimpDisplay           *display);
 
114
  void          (* active_modifier_key) (GimpTool              *tool,
 
115
                                         GdkModifierType        key,
 
116
                                         gboolean               press,
 
117
                                         GdkModifierType        state,
 
118
                                         GimpDisplay           *display);
 
119
 
 
120
  void          (* oper_update)         (GimpTool              *tool,
 
121
                                         GimpCoords            *coords,
 
122
                                         GdkModifierType        state,
 
123
                                         gboolean               proximity,
 
124
                                         GimpDisplay           *display);
 
125
  void          (* cursor_update)       (GimpTool              *tool,
 
126
                                         GimpCoords            *coords,
 
127
                                         GdkModifierType        state,
 
128
                                         GimpDisplay           *display);
102
129
};
103
130
 
104
131
 
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);
 
132
GType         gimp_tool_get_type            (void) G_GNUC_CONST;
 
133
 
 
134
GimpToolOptions * gimp_tool_get_options     (GimpTool            *tool);
 
135
 
 
136
gboolean      gimp_tool_has_display         (GimpTool            *tool,
 
137
                                             GimpDisplay         *display);
 
138
GimpDisplay * gimp_tool_has_image           (GimpTool            *tool,
 
139
                                             GimpImage           *image);
 
140
 
 
141
gboolean      gimp_tool_initialize          (GimpTool            *tool,
 
142
                                             GimpDisplay         *display);
 
143
void          gimp_tool_control             (GimpTool            *tool,
 
144
                                             GimpToolAction       action,
 
145
                                             GimpDisplay         *display);
 
146
 
 
147
void          gimp_tool_button_press        (GimpTool            *tool,
 
148
                                             GimpCoords          *coords,
 
149
                                             guint32              time,
 
150
                                             GdkModifierType      state,
 
151
                                             GimpDisplay         *display);
 
152
void          gimp_tool_button_release      (GimpTool            *tool,
 
153
                                             GimpCoords          *coords,
 
154
                                             guint32              time,
 
155
                                             GdkModifierType      state,
 
156
                                             GimpDisplay         *display);
 
157
void          gimp_tool_motion              (GimpTool            *tool,
 
158
                                             GimpCoords          *coords,
 
159
                                             guint32              time,
 
160
                                             GdkModifierType      state,
 
161
                                             GimpDisplay         *display);
 
162
 
 
163
gboolean      gimp_tool_key_press           (GimpTool            *tool,
 
164
                                             GdkEventKey         *kevent,
 
165
                                             GimpDisplay         *display);
 
166
 
 
167
void          gimp_tool_set_focus_display   (GimpTool            *tool,
 
168
                                             GimpDisplay         *display);
 
169
void          gimp_tool_set_modifier_state  (GimpTool            *tool,
 
170
                                             GdkModifierType      state,
 
171
                                             GimpDisplay         *display);
 
172
void    gimp_tool_set_active_modifier_state (GimpTool            *tool,
 
173
                                             GdkModifierType      state,
 
174
                                             GimpDisplay         *display);
 
175
 
 
176
void          gimp_tool_oper_update         (GimpTool            *tool,
 
177
                                             GimpCoords          *coords,
 
178
                                             GdkModifierType      state,
 
179
                                             gboolean             proximity,
 
180
                                             GimpDisplay         *display);
 
181
void          gimp_tool_cursor_update       (GimpTool            *tool,
 
182
                                             GimpCoords          *coords,
 
183
                                             GdkModifierType      state,
 
184
                                             GimpDisplay         *display);
 
185
 
 
186
void          gimp_tool_push_status         (GimpTool            *tool,
 
187
                                             GimpDisplay         *display,
 
188
                                             const gchar         *format,
 
189
                                             ...) G_GNUC_PRINTF(3,4);
 
190
void          gimp_tool_push_status_coords  (GimpTool            *tool,
 
191
                                             GimpDisplay         *display,
 
192
                                             const gchar         *title,
 
193
                                             gdouble              x,
 
194
                                             const gchar         *separator,
 
195
                                             gdouble              y,
 
196
                                             const gchar         *help);
 
197
void          gimp_tool_push_status_length  (GimpTool            *tool,
 
198
                                             GimpDisplay         *display,
 
199
                                             const gchar         *title,
 
200
                                             GimpOrientationType  axis,
 
201
                                             gdouble              value,
 
202
                                             const gchar         *help);
 
203
void          gimp_tool_replace_status      (GimpTool            *tool,
 
204
                                             GimpDisplay         *display,
 
205
                                             const gchar         *format,
 
206
                                             ...) G_GNUC_PRINTF(3,4);
 
207
void          gimp_tool_pop_status          (GimpTool            *tool,
 
208
                                             GimpDisplay         *display);
 
209
 
 
210
void          gimp_tool_message             (GimpTool            *tool,
 
211
                                             GimpDisplay         *display,
 
212
                                             const gchar         *format,
 
213
                                             ...) G_GNUC_PRINTF(3,4);
 
214
 
 
215
void          gimp_tool_set_cursor          (GimpTool            *tool,
 
216
                                             GimpDisplay         *display,
 
217
                                             GimpCursorType       cursor,
 
218
                                             GimpToolCursorType   tool_cursor,
 
219
                                             GimpCursorModifier   modifier);
166
220
 
167
221
 
168
222
#endif  /*  __GIMP_TOOL_H__  */