]> git.sur5r.net Git - glabels/blob - glabels2/src/object-editor.h
2004-07-18 Jim Evins <evins@snaught.com>
[glabels] / glabels2 / src / object-editor.h
1 /*
2  *  (GLABELS) Label and Business Card Creation program for GNOME
3  *
4  *  object-editor.h:  object properties editor module header file
5  *
6  *  Copyright (C) 2003  Jim Evins <evins@snaught.com>.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21  */
22 #ifndef __OBJECT_EDITOR_H__
23 #define __OBJECT_EDITOR_H__
24
25 #include <gtk/gtk.h>
26 #include "text-node.h"
27 #include "merge.h"
28 #include "bc.h"
29 #include <gtk/gtkenums.h>
30 #include <libgnomeprint/gnome-font.h>
31
32 G_BEGIN_DECLS
33
34 typedef enum {
35         GL_OBJECT_EDITOR_EMPTY = 1,
36         GL_OBJECT_EDITOR_POSITION_PAGE,
37         GL_OBJECT_EDITOR_SIZE_PAGE,
38         GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE,
39         GL_OBJECT_EDITOR_SIZE_LINE_PAGE,
40         GL_OBJECT_EDITOR_FILL_PAGE,
41         GL_OBJECT_EDITOR_LINE_PAGE,
42         GL_OBJECT_EDITOR_IMAGE_PAGE,
43         GL_OBJECT_EDITOR_TEXT_PAGE,
44         GL_OBJECT_EDITOR_EDIT_PAGE,
45         GL_OBJECT_EDITOR_BC_PAGE,
46         GL_OBJECT_EDITOR_DATA_PAGE,
47 } glObjectEditorOption;
48
49 #define GL_TYPE_OBJECT_EDITOR            (gl_object_editor_get_type ())
50 #define GL_OBJECT_EDITOR(obj)            (GTK_CHECK_CAST ((obj), GL_TYPE_OBJECT_EDITOR, glObjectEditor))
51 #define GL_OBJECT_EDITOR_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GL_TYPE_OBJECT_EDITOR, glObjectEditorClass))
52 #define GL_IS_OBJECT_EDITOR(obj)         (GTK_CHECK_TYPE ((obj), GL_TYPE_OBJECT_EDITOR))
53 #define GL_IS_OBJECT_EDITOR_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GL_TYPE_OBJECT_EDITOR))
54 #define GL_OBJECT_EDITOR_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GL_TYPE_OBJECT_EDITOR, glObjectEditorClass))
55
56
57 typedef struct _glObjectEditor         glObjectEditor;
58 typedef struct _glObjectEditorClass    glObjectEditorClass;
59
60 typedef struct _glObjectEditorPrivate  glObjectEditorPrivate;
61
62 struct _glObjectEditor
63 {
64         GtkVBox                parent_instance;
65
66         glObjectEditorPrivate *priv;
67
68 };
69
70 struct  _glObjectEditorClass
71 {
72         GtkVBoxClass             parent_class;
73
74         void (*changed)      (glObjectEditor *editor, gpointer user_data);
75         void (*size_changed) (glObjectEditor *editor, gpointer user_data);
76 };
77
78
79
80
81 GtkType     gl_object_editor_get_type             (void) G_GNUC_CONST;
82
83 GtkWidget  *gl_object_editor_new                  (gchar               *image,
84                                                    gchar               *label,
85                                                    glObjectEditorOption first_option, ...);
86
87 void        gl_object_editor_set_key_names        (glObjectEditor      *editor,
88                                                    glMerge             *merge);
89
90
91 /*
92  * Position Page
93  */
94 void        gl_object_editor_set_position         (glObjectEditor      *editor,
95                                                    gdouble              x,
96                                                    gdouble              y);
97
98 void        gl_object_editor_set_max_position     (glObjectEditor      *editor,
99                                                    gdouble              x_max,
100                                                    gdouble              y_max);
101
102 void        gl_object_editor_get_position         (glObjectEditor      *editor,
103                                                    gdouble             *x,
104                                                    gdouble             *y);
105
106 /*
107  * Size Page
108  */
109 void        gl_object_editor_set_size             (glObjectEditor      *editor,
110                                                    gdouble              w,
111                                                    gdouble              h);
112
113 void        gl_object_editor_set_max_size         (glObjectEditor      *editor,
114                                                    gdouble              w_max,
115                                                    gdouble              h_max);
116
117 void        gl_object_editor_set_base_size        (glObjectEditor      *editor,
118                                                    gdouble              w_max,
119                                                    gdouble              h_max);
120
121 void        gl_object_editor_get_size             (glObjectEditor      *editor,
122                                                    gdouble             *w,
123                                                    gdouble             *h);
124
125
126 /*
127  * Line Size Page
128  */
129 void        gl_object_editor_set_lsize            (glObjectEditor      *editor,
130                                                    gdouble              dx,
131                                                    gdouble              dy);
132
133 void        gl_object_editor_set_max_lsize        (glObjectEditor      *editor,
134                                                    gdouble              dx_max,
135                                                    gdouble              dy_max);
136
137 void        gl_object_editor_get_lsize            (glObjectEditor      *editor,
138                                                    gdouble             *dx,
139                                                    gdouble             *dy);
140
141
142 /*
143  * Fill Page
144  */
145 void        gl_object_editor_set_fill_color       (glObjectEditor      *editor,
146                                                    guint                color);
147
148 guint       gl_object_editor_get_fill_color       (glObjectEditor      *editor);
149
150
151 /*
152  * Line/Outline Page
153  */
154 void        gl_object_editor_set_line_color       (glObjectEditor      *editor,
155                                                    guint                color);
156
157 guint       gl_object_editor_get_line_color       (glObjectEditor      *editor);
158
159 void        gl_object_editor_set_line_width       (glObjectEditor      *editor,
160                                                    gdouble              width);
161
162 gdouble     gl_object_editor_get_line_width       (glObjectEditor      *editor);
163
164
165 /*
166  * Image Page
167  */
168 void        gl_object_editor_set_image            (glObjectEditor      *editor,
169                                                    gboolean             merge_flag,
170                                                    glTextNode          *text_node);
171
172 glTextNode *gl_object_editor_get_image            (glObjectEditor      *editor);
173
174
175 /*
176  * Text Page
177  */
178 void        gl_object_editor_set_font_family      (glObjectEditor      *editor,
179                                                    const gchar         *font_family);
180
181 gchar      *gl_object_editor_get_font_family      (glObjectEditor      *editor);
182
183 void        gl_object_editor_set_font_size        (glObjectEditor      *editor,
184                                                    gdouble              font_size);
185
186 gdouble     gl_object_editor_get_font_size        (glObjectEditor      *editor);
187
188 void        gl_object_editor_set_font_weight      (glObjectEditor      *editor,
189                                                    GnomeFontWeight      font_weight);
190
191 GnomeFontWeight gl_object_editor_get_font_weight  (glObjectEditor      *editor);
192
193 void        gl_object_editor_set_font_italic_flag (glObjectEditor      *editor,
194                                                    gboolean             font_italic_flag);
195
196 gboolean    gl_object_editor_get_font_italic_flag (glObjectEditor      *editor);
197
198 void        gl_object_editor_set_text_alignment   (glObjectEditor      *editor,
199                                                    GtkJustification     text_alignment);
200
201 GtkJustification gl_object_editor_get_text_alignment (glObjectEditor      *editor);
202
203 void        gl_object_editor_set_text_line_spacing (glObjectEditor      *editor,
204                                                    gdouble              text_line_spacing);
205
206 gdouble     gl_object_editor_get_text_line_spacing (glObjectEditor      *editor);
207
208 void        gl_object_editor_set_text_color       (glObjectEditor      *editor,
209                                                    guint                text_color);
210
211 guint       gl_object_editor_get_text_color       (glObjectEditor      *editor);
212
213 void        gl_object_editor_set_text_auto_shrink (glObjectEditor      *editor,
214                                                    gboolean             auto_shrink);
215
216 gboolean    gl_object_editor_get_text_auto_shrink (glObjectEditor      *editor);
217
218
219 /*
220  * Edit Text Page
221  */
222 void        gl_object_editor_set_text_buffer      (glObjectEditor      *editor,
223                                                    GtkTextBuffer       *buffer);
224
225 /*
226  * Barcode Page
227  */
228 void        gl_object_editor_set_bc_style         (glObjectEditor      *editor,
229                                                    gchar               *id,
230                                                    gboolean             text_flag,
231                                                    gboolean             checksum_flag,
232                                                    guint                format_digits);
233
234 void        gl_object_editor_get_bc_style         (glObjectEditor      *editor,
235                                                    gchar              **id,
236                                                    gboolean            *text_flag,
237                                                    gboolean            *checksum_flag,
238                                                    guint               *format_digits);
239
240 void        gl_object_editor_set_bc_color         (glObjectEditor      *editor,
241                                                    guint                text_color);
242
243 guint       gl_object_editor_get_bc_color         (glObjectEditor      *editor);
244
245
246 /*
247  * Barcode Data Page
248  */
249 void        gl_object_editor_set_data             (glObjectEditor      *editor,
250                                                    gboolean             merge_flag,
251                                                    glTextNode          *text_node);
252
253 glTextNode *gl_object_editor_get_data             (glObjectEditor      *editor);
254
255
256
257 G_END_DECLS
258
259 #endif