1
/* GIMP - The GNU Image Manipulation Program
2
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
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_RECTANGLE_TOOL_H__
20
#define __GIMP_RECTANGLE_TOOL_H__
25
GIMP_RECTANGLE_TOOL_PROP_0,
26
GIMP_RECTANGLE_TOOL_PROP_X1,
27
GIMP_RECTANGLE_TOOL_PROP_Y1,
28
GIMP_RECTANGLE_TOOL_PROP_X2,
29
GIMP_RECTANGLE_TOOL_PROP_Y2,
30
GIMP_RECTANGLE_TOOL_PROP_CONSTRAINT,
31
GIMP_RECTANGLE_TOOL_PROP_LAST = GIMP_RECTANGLE_TOOL_PROP_CONSTRAINT
32
} GimpRectangleToolProp;
35
/* possible functions */
41
RECT_RESIZING_UPPER_LEFT,
42
RECT_RESIZING_UPPER_RIGHT,
43
RECT_RESIZING_LOWER_LEFT,
44
RECT_RESIZING_LOWER_RIGHT,
50
} GimpRectangleFunction;
53
#define GIMP_TYPE_RECTANGLE_TOOL (gimp_rectangle_tool_interface_get_type ())
54
#define GIMP_IS_RECTANGLE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_RECTANGLE_TOOL))
55
#define GIMP_RECTANGLE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_RECTANGLE_TOOL, GimpRectangleTool))
56
#define GIMP_RECTANGLE_TOOL_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GIMP_TYPE_RECTANGLE_TOOL, GimpRectangleToolInterface))
58
#define GIMP_RECTANGLE_TOOL_GET_OPTIONS(t) (GIMP_RECTANGLE_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
61
typedef struct _GimpRectangleTool GimpRectangleTool;
62
typedef struct _GimpRectangleToolInterface GimpRectangleToolInterface;
64
struct _GimpRectangleToolInterface
66
GTypeInterface base_iface;
68
/* virtual functions */
69
gboolean (* execute) (GimpRectangleTool *rect_tool,
74
void (* cancel) (GimpRectangleTool *rect_tool);
77
gboolean (* rectangle_changed) (GimpRectangleTool *rect_tool);
81
GType gimp_rectangle_tool_interface_get_type (void) G_GNUC_CONST;
83
void gimp_rectangle_tool_constructor (GObject *object);
85
void gimp_rectangle_tool_control (GimpTool *tool,
86
GimpToolAction action,
87
GimpDisplay *display);
88
void gimp_rectangle_tool_button_press (GimpTool *tool,
91
GdkModifierType state,
92
GimpDisplay *display);
93
void gimp_rectangle_tool_button_release (GimpTool *tool,
96
GdkModifierType state,
97
GimpButtonReleaseType release_type,
98
GimpDisplay *display);
99
void gimp_rectangle_tool_motion (GimpTool *tool,
102
GdkModifierType state,
103
GimpDisplay *display);
104
gboolean gimp_rectangle_tool_key_press (GimpTool *tool,
106
GimpDisplay *display);
107
void gimp_rectangle_tool_active_modifier_key (GimpTool *tool,
110
GdkModifierType state,
111
GimpDisplay *display);
112
void gimp_rectangle_tool_oper_update (GimpTool *tool,
114
GdkModifierType state,
116
GimpDisplay *display);
117
void gimp_rectangle_tool_cursor_update (GimpTool *tool,
119
GdkModifierType state,
120
GimpDisplay *display);
121
void gimp_rectangle_tool_draw (GimpDrawTool *draw);
122
gboolean gimp_rectangle_tool_execute (GimpRectangleTool *rect_tool);
123
void gimp_rectangle_tool_cancel (GimpRectangleTool *rect_tool);
124
void gimp_rectangle_tool_configure (GimpRectangleTool *rectangle);
125
void gimp_rectangle_tool_set_constraint (GimpRectangleTool *rectangle,
126
GimpRectangleConstraint constraint);
127
GimpRectangleFunction gimp_rectangle_tool_get_function (GimpRectangleTool *rectangle);
128
void gimp_rectangle_tool_set_function (GimpRectangleTool *rectangle,
129
GimpRectangleFunction function);
130
void gimp_rectangle_tool_get_press_coords (GimpRectangleTool *rectangle,
135
/* convenience functions */
137
void gimp_rectangle_tool_install_properties (GObjectClass *klass);
138
void gimp_rectangle_tool_set_property (GObject *object,
142
void gimp_rectangle_tool_get_property (GObject *object,
148
#endif /* __GIMP_RECTANGLE_TOOL_H__ */