3 * Copyright (C) 2001-2009 Jim Evins <evins@snaught.com>.
5 * This file is part of gLabels.
7 * gLabels is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * gLabels is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with gLabels. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef __LABEL_OBJECT_H__
22 #define __LABEL_OBJECT_H__
24 #include <glib-object.h>
26 #include <pango/pango.h>
36 GL_LABEL_OBJECT_ELLIPSE,
37 GL_LABEL_OBJECT_IMAGE,
38 GL_LABEL_OBJECT_BARCODE,
39 GL_LABEL_OBJECT_N_TYPES
44 GL_LABEL_OBJECT_HANDLE_NONE = 0,
45 GL_LABEL_OBJECT_HANDLE_N,
46 GL_LABEL_OBJECT_HANDLE_E,
47 GL_LABEL_OBJECT_HANDLE_W,
48 GL_LABEL_OBJECT_HANDLE_S,
49 GL_LABEL_OBJECT_HANDLE_NW,
50 GL_LABEL_OBJECT_HANDLE_NE,
51 GL_LABEL_OBJECT_HANDLE_SE,
52 GL_LABEL_OBJECT_HANDLE_SW,
53 GL_LABEL_OBJECT_HANDLE_P1,
54 GL_LABEL_OBJECT_HANDLE_P2
55 } glLabelObjectHandle;
58 #define GL_TYPE_LABEL_OBJECT (gl_label_object_get_type ())
59 #define GL_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GL_TYPE_LABEL_OBJECT, glLabelObject))
60 #define GL_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GL_TYPE_LABEL_OBJECT, glLabelObjectClass))
61 #define GL_IS_LABEL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GL_TYPE_LABEL_OBJECT))
62 #define GL_IS_LABEL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GL_TYPE_LABEL_OBJECT))
63 #define GL_LABEL_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), GL_TYPE_LABEL_OBJECT, glLabelObjectClass))
66 typedef struct _glLabelObject glLabelObject;
67 typedef struct _glLabelObjectClass glLabelObjectClass;
69 typedef struct _glLabelObjectPrivate glLabelObjectPrivate;
74 struct _glLabelObject {
77 glLabelObjectPrivate *priv;
80 struct _glLabelObjectClass {
81 GObjectClass parent_class;
87 void (*set_size) (glLabelObject *object,
92 void (*set_font_family) (glLabelObject *object,
93 const gchar *font_family,
96 void (*set_font_size) (glLabelObject *object,
100 void (*set_font_weight) (glLabelObject *object,
101 PangoWeight font_weight,
102 gboolean checkpoint);
104 void (*set_font_italic_flag) (glLabelObject *object,
105 gboolean font_italic_flag,
106 gboolean checkpoint);
108 void (*set_text_alignment) (glLabelObject *object,
109 PangoAlignment text_alignment,
110 gboolean checkpoint);
112 void (*set_text_line_spacing)(glLabelObject *object,
113 gdouble text_line_spacing,
114 gboolean checkpoint);
116 void (*set_text_color) (glLabelObject *object,
117 glColorNode *text_color_node,
118 gboolean checkpoint);
120 void (*set_fill_color) (glLabelObject *object,
121 glColorNode *fill_color_node,
122 gboolean checkpoint);
124 void (*set_line_color) (glLabelObject *object,
125 glColorNode *line_color_node,
126 gboolean checkpoint);
128 void (*set_line_width) (glLabelObject *object,
130 gboolean checkpoint);
132 void (*get_size) (glLabelObject *object,
136 gchar * (*get_font_family) (glLabelObject *object);
138 gdouble (*get_font_size) (glLabelObject *object);
140 PangoWeight (*get_font_weight) (glLabelObject *object);
142 gboolean (*get_font_italic_flag) (glLabelObject *object);
144 PangoAlignment (*get_text_alignment) (glLabelObject *object);
146 gdouble (*get_text_line_spacing) (glLabelObject *object);
148 glColorNode * (*get_text_color) (glLabelObject *object);
150 glColorNode * (*get_fill_color) (glLabelObject *object);
152 glColorNode * (*get_line_color) (glLabelObject *object);
154 gdouble (*get_line_width) (glLabelObject *object);
156 void (*copy) (glLabelObject *dst_object
158 glLabelObject *src_object);
163 void (*draw_shadow) (glLabelObject *object,
165 gboolean screen_flag,
166 glMergeRecord *record);
168 void (*draw_object) (glLabelObject *object,
170 gboolean screen_flag,
171 glMergeRecord *record);
173 void (*draw_handles) (glLabelObject *object,
177 * Cairo context query methods
179 gboolean (*object_at) (glLabelObject *object,
184 glLabelObjectHandle (*handle_at) (glLabelObject *object,
194 void (*changed) (glLabelObject *object,
197 void (*moved) (glLabelObject *object,
204 GType gl_label_object_get_type (void) G_GNUC_CONST;
206 GObject *gl_label_object_new (glLabel *label);
209 glLabelObject *gl_label_object_dup (glLabelObject *src_object,
213 void gl_label_object_emit_changed (glLabelObject *object);
215 void gl_label_object_set_parent (glLabelObject *object,
218 glLabel *gl_label_object_get_parent (glLabelObject *object);
221 void gl_label_object_select (glLabelObject *object);
222 void gl_label_object_unselect (glLabelObject *object);
223 gboolean gl_label_object_is_selected (glLabelObject *object);
225 void gl_label_object_set_name (glLabelObject *object,
228 gchar *gl_label_object_get_name (glLabelObject *object);
231 void gl_label_object_set_position (glLabelObject *object,
234 gboolean checkpoint);
236 void gl_label_object_set_position_relative (glLabelObject *object,
239 gboolean checkpoint);
241 void gl_label_object_set_size (glLabelObject *object,
244 gboolean checkpoint);
246 void gl_label_object_set_raw_size (glLabelObject *object,
249 gboolean checkpoint);
251 void gl_label_object_set_size_honor_aspect (glLabelObject *object,
254 gboolean checkpoint);
256 void gl_label_object_set_font_family (glLabelObject *object,
257 const gchar *font_family,
258 gboolean checkpoint);
260 void gl_label_object_set_font_size (glLabelObject *object,
262 gboolean checkpoint);
264 void gl_label_object_set_font_weight (glLabelObject *object,
265 PangoWeight font_weight,
266 gboolean checkpoint);
268 void gl_label_object_set_font_italic_flag (glLabelObject *object,
269 gboolean font_italic_flag,
270 gboolean checkpoint);
272 void gl_label_object_set_text_alignment (glLabelObject *object,
273 PangoAlignment text_alignment,
274 gboolean checkpoint);
276 void gl_label_object_set_text_color (glLabelObject *object,
277 glColorNode *text_color_node,
278 gboolean checkpoint);
280 void gl_label_object_set_text_line_spacing (glLabelObject *object,
281 gdouble text_line_spacing,
282 gboolean checkpoint);
284 void gl_label_object_set_fill_color (glLabelObject *object,
285 glColorNode *fill_color_node,
286 gboolean checkpoint);
288 void gl_label_object_set_line_color (glLabelObject *object,
289 glColorNode *line_color_node,
290 gboolean checkpoint);
292 void gl_label_object_set_line_width (glLabelObject *object,
294 gboolean checkpoint);
297 void gl_label_object_set_shadow_state (glLabelObject *object,
299 gboolean checkpoint);
301 void gl_label_object_set_shadow_offset (glLabelObject *object,
304 gboolean checkpoint);
306 void gl_label_object_set_shadow_color (glLabelObject *object,
307 glColorNode *color_node,
308 gboolean checkpoint);
310 void gl_label_object_set_shadow_opacity (glLabelObject *object,
312 gboolean checkpoint);
315 void gl_label_object_flip_horiz (glLabelObject *object);
317 void gl_label_object_flip_vert (glLabelObject *object);
319 void gl_label_object_rotate (glLabelObject *object,
322 void gl_label_object_set_matrix (glLabelObject *object,
323 cairo_matrix_t *matrix);
326 void gl_label_object_get_position (glLabelObject *object,
330 void gl_label_object_get_size (glLabelObject *object,
334 void gl_label_object_get_raw_size (glLabelObject *object,
338 void gl_label_object_get_extent (glLabelObject *object,
339 glLabelRegion *region);
341 gboolean gl_label_object_can_text (glLabelObject *object);
344 gchar *gl_label_object_get_font_family (glLabelObject *object);
346 gdouble gl_label_object_get_font_size (glLabelObject *object);
348 PangoWeight gl_label_object_get_font_weight (glLabelObject *object);
350 gboolean gl_label_object_get_font_italic_flag (glLabelObject *object);
352 PangoAlignment gl_label_object_get_text_alignment (glLabelObject *object);
354 gdouble gl_label_object_get_text_line_spacing (glLabelObject *object);
356 glColorNode *gl_label_object_get_text_color (glLabelObject *object);
359 gboolean gl_label_object_can_fill (glLabelObject *object);
361 glColorNode* gl_label_object_get_fill_color (glLabelObject *object);
364 gboolean gl_label_object_can_line_color (glLabelObject *object);
366 glColorNode *gl_label_object_get_line_color (glLabelObject *object);
368 gboolean gl_label_object_can_line_width (glLabelObject *object);
370 gdouble gl_label_object_get_line_width (glLabelObject *object);
373 void gl_label_object_get_matrix (glLabelObject *object,
374 cairo_matrix_t *matrix);
376 gboolean gl_label_object_get_shadow_state (glLabelObject *object);
378 void gl_label_object_get_shadow_offset (glLabelObject *object,
382 glColorNode* gl_label_object_get_shadow_color (glLabelObject *object);
384 gdouble gl_label_object_get_shadow_opacity (glLabelObject *object);
387 void gl_label_object_draw (glLabelObject *object,
389 gboolean screen_flag,
390 glMergeRecord *record);
392 gboolean gl_label_object_is_located_at (glLabelObject *object,
397 void gl_label_object_draw_handles (glLabelObject *object,
400 glLabelObjectHandle gl_label_object_handle_at (glLabelObject *object,
407 * Specific handle drawing methods.
409 void gl_label_object_draw_handles_box (glLabelObject *object,
412 void gl_label_object_draw_handles_line (glLabelObject *object,
417 * Specific handle query methods.
419 glLabelObjectHandle gl_label_object_box_handle_at (glLabelObject *object,
424 glLabelObjectHandle gl_label_object_line_handle_at (glLabelObject *object,
433 #endif /* __LABEL_OBJECT_H__ */
439 * Local Variables: -- emacs
441 * c-basic-offset: 8 -- emacs
442 * tab-width: 8 -- emacs
443 * indent-tabs-mode: nil -- emacs