]> git.sur5r.net Git - glabels/blob - glabels2/src/object-editor.c
2006-02-07 Jim Evins <evins@snaught.com>
[glabels] / glabels2 / src / object-editor.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
3 /**
4  *  (GLABELS) Label and Business Card Creation program for GNOME
5  *
6  *  object-editor.c:  object properties editor module
7  *
8  *  Copyright (C) 2003  Jim Evins <evins@snaught.com>.
9  *
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2 of the License, or
13  *  (at your option) any later version.
14  *
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to the Free Software
22  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23  */
24 #include <config.h>
25
26 #include "object-editor.h"
27
28 #include <glib/gi18n.h>
29 #include <glade/glade-xml.h>
30 #include <gtk/gtklabel.h>
31 #include <gtk/gtknotebook.h>
32 #include <gtk/gtkcombobox.h>
33 #include <gtk/gtktogglebutton.h>
34
35 #include <math.h>
36
37 #include "prefs.h"
38 #include "mygal/widget-color-combo.h"
39 #include "color.h"
40 #include "wdgt-chain-button.h"
41 #include "marshal.h"
42
43 #include "object-editor-private.h"
44
45 #include "debug.h"
46
47 /*===========================================*/
48 /* Private macros                            */
49 /*===========================================*/
50
51 /*===========================================*/
52 /* Private data types                        */
53 /*===========================================*/
54
55 typedef void (*ChangedSignal) (GObject * object, gpointer data);
56
57 /*===========================================*/
58 /* Private globals                           */
59 /*===========================================*/
60
61 gint gl_object_editor_signals[LAST_SIGNAL] = { 0 };
62
63 static GtkVBoxClass *parent_class = NULL;
64
65 /*===========================================*/
66 /* Local function prototypes                 */
67 /*===========================================*/
68
69 static void gl_object_editor_class_init         (glObjectEditorClass  *klass);
70 static void gl_object_editor_init               (glObjectEditor       *editor);
71 static void gl_object_editor_finalize           (GObject              *object);
72
73 static void gl_object_notebook_construct_valist (glObjectEditor       *editor,
74                                                  glObjectEditorOption  first_option,
75                                                  va_list               args);
76
77 static void prefs_changed_cb                    (glObjectEditor       *editor);
78
79 \f
80 /*****************************************************************************/
81 /* Boilerplate object stuff.                                                 */
82 /*****************************************************************************/
83 GType
84 gl_object_editor_get_type (void)
85 {
86         static GType type = 0;
87
88         if (!type)
89         {
90                 static const GTypeInfo info =
91                 {
92                         sizeof (glObjectEditorClass),
93                         NULL,           /* base_init */
94                         NULL,           /* base_finalize */
95                         (GClassInitFunc) gl_object_editor_class_init,
96                         NULL,           /* class_finalize */
97                         NULL,           /* class_data */
98                         sizeof (glObjectEditor),
99                         0,              /* n_preallocs */
100                         (GInstanceInitFunc) gl_object_editor_init,
101                         NULL
102                 };
103
104                 type = g_type_register_static (GTK_TYPE_VBOX,
105                                                "glObjectEditor", &info, 0);
106         }
107
108         return type;
109 }
110
111 static void
112 gl_object_editor_class_init (glObjectEditorClass *klass)
113 {
114         GObjectClass *object_class = G_OBJECT_CLASS (klass);
115
116         gl_debug (DEBUG_EDITOR, "START");
117         
118         parent_class = g_type_class_peek_parent (klass);
119
120         object_class->finalize = gl_object_editor_finalize;     
121
122         gl_object_editor_signals[CHANGED] =
123             g_signal_new ("changed",
124                           G_OBJECT_CLASS_TYPE(object_class),
125                           G_SIGNAL_RUN_LAST,
126                           G_STRUCT_OFFSET (glObjectEditorClass, changed),
127                           NULL, NULL,
128                           gl_marshal_VOID__VOID,
129                           G_TYPE_NONE, 0);
130
131         gl_object_editor_signals[SIZE_CHANGED] =
132             g_signal_new ("size_changed",
133                           G_OBJECT_CLASS_TYPE(object_class),
134                           G_SIGNAL_RUN_LAST,
135                           G_STRUCT_OFFSET (glObjectEditorClass, size_changed),
136                           NULL, NULL,
137                           gl_marshal_VOID__VOID,
138                           G_TYPE_NONE, 0);
139
140         gl_debug (DEBUG_EDITOR, "END");
141 }
142
143 static void
144 gl_object_editor_init (glObjectEditor *editor)
145 {
146         gl_debug (DEBUG_EDITOR, "START");
147         
148         editor->priv = g_new0 (glObjectEditorPrivate, 1);
149
150         editor->priv->gui = glade_xml_new (GLABELS_GLADE_DIR "object-editor.glade",
151                                            "editor_vbox",
152                                            NULL);
153
154         if (!editor->priv->gui) {
155                 g_critical ("Could not open object-editor.glade. gLabels may not be installed correctly!");
156                 return;
157         }
158
159         editor->priv->editor_vbox = glade_xml_get_widget (editor->priv->gui,
160                                                           "editor_vbox");
161         gtk_box_pack_start (GTK_BOX(editor),
162                             editor->priv->editor_vbox,
163                             FALSE, FALSE, 0);
164
165         editor->priv->title_image = glade_xml_get_widget (editor->priv->gui,
166                                                           "title_image");
167         editor->priv->title_label = glade_xml_get_widget (editor->priv->gui,
168                                                           "title_label");
169         editor->priv->notebook    = glade_xml_get_widget (editor->priv->gui,
170                                                           "notebook");
171
172         gtk_widget_show_all (GTK_WIDGET(editor));
173
174         /* Hide all notebook pages to start with. */
175         gtk_widget_hide_all (editor->priv->notebook);
176         gtk_widget_set_no_show_all (editor->priv->notebook, TRUE);
177
178         gl_debug (DEBUG_EDITOR, "END");
179 }
180
181 static void 
182 gl_object_editor_finalize (GObject *object)
183 {
184         glObjectEditor* editor;
185         
186         gl_debug (DEBUG_EDITOR, "START");
187         
188         g_return_if_fail (object != NULL);
189         
190         editor = GL_OBJECT_EDITOR (object);
191
192         g_return_if_fail (GL_IS_OBJECT_EDITOR (editor));
193         g_return_if_fail (editor->priv != NULL);
194
195         if (editor->priv->gui) {
196                 g_object_unref (G_OBJECT (editor->priv->gui));
197         }
198
199         g_free (editor->priv);
200
201         g_signal_handlers_disconnect_by_func (G_OBJECT(gl_prefs),
202                                               prefs_changed_cb, editor);
203
204         G_OBJECT_CLASS (parent_class)->finalize (object);
205
206         gl_debug (DEBUG_EDITOR, "END");
207 }
208
209 /*****************************************************************************/
210 /* NEW object editor.                                                      */
211 /*****************************************************************************/
212 GtkWidget*
213 gl_object_editor_new (gchar                *image,
214                       gchar                *label,
215                       glObjectEditorOption  first_option, ...)
216 {
217         glObjectEditor *editor;
218         va_list         args;
219
220         gl_debug (DEBUG_EDITOR, "START");
221
222         editor = GL_OBJECT_EDITOR (g_object_new (GL_TYPE_OBJECT_EDITOR, NULL));
223
224         if (image) {
225                 gtk_image_set_from_stock (GTK_IMAGE(editor->priv->title_image),
226                                           image,
227                                           GTK_ICON_SIZE_LARGE_TOOLBAR);
228         }
229
230         if (label) {
231                 gchar *s;
232
233                 s = g_strdup_printf ("<span weight=\"bold\">%s</span>",
234                                      label);
235                 gtk_label_set_text (GTK_LABEL(editor->priv->title_label), s);
236                 g_free (s);
237
238                 gtk_label_set_use_markup (GTK_LABEL(editor->priv->title_label), TRUE);
239                                           
240         }
241
242         gtk_notebook_set_homogeneous_tabs (GTK_NOTEBOOK(editor->priv->notebook), TRUE);
243
244         va_start (args, first_option);
245         gl_object_notebook_construct_valist (editor, first_option, args);
246         va_end (args);
247
248         gl_debug (DEBUG_EDITOR, "END");
249
250         return GTK_WIDGET(editor);
251 }
252
253 /*--------------------------------------------------------------------------*/
254 /* PRIVATE.  Construct notebook.                                            */
255 /*--------------------------------------------------------------------------*/
256 static void
257 gl_object_notebook_construct_valist (glObjectEditor       *editor,
258                                      glObjectEditorOption  first_option,
259                                      va_list               args)
260 {
261         glObjectEditorOption option;
262         gint pages = 0;
263
264         gl_debug (DEBUG_EDITOR, "START");
265
266         option = first_option;
267
268         for ( option=first_option; option; option=va_arg (args, glObjectEditorOption) ) {
269
270                 switch (option) {
271
272                 case GL_OBJECT_EDITOR_EMPTY:
273                         gtk_widget_set_sensitive (editor->priv->title_image, FALSE);
274                         gtk_widget_set_sensitive (editor->priv->title_label, FALSE);
275                         break;
276
277                 case GL_OBJECT_EDITOR_POSITION_PAGE:
278                         gl_object_editor_prepare_position_page (editor);
279                         pages++;
280                         break;
281
282                 case GL_OBJECT_EDITOR_SIZE_PAGE:
283                 case GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE:
284                         gl_object_editor_prepare_size_page (editor, option);
285                         pages++;
286                         break;
287
288                 case GL_OBJECT_EDITOR_SIZE_LINE_PAGE:
289                         gl_object_editor_prepare_lsize_page (editor);
290                         pages++;
291                         break;
292
293                 case GL_OBJECT_EDITOR_FILL_PAGE:
294                         gl_object_editor_prepare_fill_page (editor);
295                         pages++;
296                         break;
297
298                 case GL_OBJECT_EDITOR_LINE_PAGE:
299                         gl_object_editor_prepare_line_page (editor);
300                         pages++;
301                         break;
302
303                 case GL_OBJECT_EDITOR_IMAGE_PAGE:
304                         gl_object_editor_prepare_image_page (editor);
305                         pages++;
306                         break;
307
308                 case GL_OBJECT_EDITOR_TEXT_PAGE:
309                         gl_object_editor_prepare_text_page (editor);
310                         pages++;
311                         break;
312
313                 case GL_OBJECT_EDITOR_EDIT_PAGE:
314                         gl_object_editor_prepare_edit_page (editor);
315                         pages++;
316                         break;
317
318                 case GL_OBJECT_EDITOR_BC_PAGE:
319                         gl_object_editor_prepare_bc_page (editor);
320                         pages++;
321                         break;
322
323                 case GL_OBJECT_EDITOR_DATA_PAGE:
324                         gl_object_editor_prepare_data_page (editor);
325                         pages++;
326                         break;
327
328                 case GL_OBJECT_EDITOR_SHADOW_PAGE:
329                         gl_object_editor_prepare_shadow_page (editor);
330                         pages++;
331                         break;
332
333                 default:
334                         g_message ("option = %d", option);
335                         g_assert_not_reached ();
336                 }
337                 
338         }
339         if (pages) {
340                 gtk_widget_show (editor->priv->notebook);
341         }
342
343         g_signal_connect_swapped (G_OBJECT (gl_prefs), "changed",
344                                   G_CALLBACK (prefs_changed_cb),
345                                   editor);
346
347         gl_debug (DEBUG_EDITOR, "END");
348 }
349
350 /*--------------------------------------------------------------------------*/
351 /* PRIVATE. Widget changed callback.  Emit our "changed" signal.            */
352 /*--------------------------------------------------------------------------*/
353 void
354 gl_object_editor_changed_cb (glObjectEditor *editor)
355 {
356         gl_debug (DEBUG_EDITOR, "START");
357
358         /* Emit our "changed" signal */
359         g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[CHANGED], 0);
360
361         gl_debug (DEBUG_EDITOR, "END");
362 }
363
364 /*--------------------------------------------------------------------------*/
365 /* PRIVATE. Widget size changed callback.  Emit our "size-changed" signal.  */
366 /*--------------------------------------------------------------------------*/
367 void
368 gl_object_editor_size_changed_cb (glObjectEditor *editor)
369 {
370         gl_debug (DEBUG_EDITOR, "START");
371
372         /* Emit our "size_changed" signal */
373         g_signal_emit (G_OBJECT (editor), gl_object_editor_signals[SIZE_CHANGED], 0);
374
375         gl_debug (DEBUG_EDITOR, "END");
376 }
377
378 /*****************************************************************************/
379 /* Set possible key names from merge object.                                 */
380 /*****************************************************************************/
381 void
382 gl_object_editor_set_key_names (glObjectEditor      *editor,
383                                 glMerge             *merge)
384 {
385         GList     *keys;
386         GtkWidget *combo;
387         gboolean   fixed_flag;
388         gboolean   state;
389  
390         gl_debug (DEBUG_EDITOR, "START");
391
392         if (editor->priv->edit_key_label) {
393                 gtk_widget_set_sensitive (editor->priv->edit_key_label, merge != NULL);
394         }
395  
396         if (editor->priv->edit_key_combo) {
397                 gtk_widget_set_sensitive (editor->priv->edit_key_combo, merge != NULL);
398         }
399  
400         if (editor->priv->text_auto_shrink_check) {
401                 gtk_widget_set_sensitive (editor->priv->text_auto_shrink_check,
402                                           merge != NULL);
403         }
404  
405         if (editor->priv->text_page_vbox) {
406                 gtk_widget_set_sensitive (editor->priv->text_color_key_radio, merge != NULL);
407                 if (merge == NULL) {
408                         gtk_toggle_button_set_active (
409                                 GTK_TOGGLE_BUTTON(editor->priv->text_color_radio), TRUE);
410                         gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE);
411                         gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE);
412                 } else {
413                         state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->text_color_key_radio));
414                         gtk_widget_set_sensitive (editor->priv->text_color_combo, !state);
415                         gtk_widget_set_sensitive (editor->priv->text_color_key_combo, state);
416                                                   
417                 }
418         }
419
420         if (editor->priv->edit_insert_field_button) {
421                 gtk_widget_set_sensitive (editor->priv->edit_insert_field_button,
422                                           merge != NULL);
423         }
424
425         if (editor->priv->img_key_combo) {
426                 gtk_widget_set_sensitive (editor->priv->img_key_combo, merge != NULL);
427         }
428  
429         if (editor->priv->img_key_radio) {
430                 gtk_widget_set_sensitive (editor->priv->img_key_radio, merge != NULL);
431                 if (merge == NULL) {
432                         gtk_toggle_button_set_active (
433                                 GTK_TOGGLE_BUTTON(editor->priv->img_file_radio), TRUE);
434                 }
435         }
436
437         if (editor->priv->data_key_combo) {
438                 gtk_widget_set_sensitive (editor->priv->data_key_combo, merge != NULL);
439         }
440  
441         if (editor->priv->data_key_radio) {
442                 gtk_widget_set_sensitive (editor->priv->data_key_radio, merge != NULL);
443                 if (merge == NULL) {
444                         gtk_toggle_button_set_active (
445                                 GTK_TOGGLE_BUTTON(editor->priv->data_literal_radio), TRUE);
446                 }
447         }
448         
449         fixed_flag = editor->priv->data_format_fixed_flag;
450         if (editor->priv->data_format_label) {
451                 gtk_widget_set_sensitive (editor->priv->data_format_label,
452                                           (merge != NULL));
453         }
454         if (editor->priv->data_ex_label) {
455                 gtk_widget_set_sensitive (editor->priv->data_ex_label,
456                                           (merge != NULL));
457         }
458         if (editor->priv->data_digits_label) {
459                 gtk_widget_set_sensitive (editor->priv->data_digits_label,
460                                           (merge != NULL) && !fixed_flag);
461         }
462         if (editor->priv->data_digits_spin) {
463                 gtk_widget_set_sensitive (editor->priv->data_digits_spin,
464                                           (merge != NULL) && !fixed_flag);
465         }
466
467         if (editor->priv->fill_page_vbox) {
468                 gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge != NULL);
469                 if (merge == NULL) {
470                         gtk_toggle_button_set_active (
471                                 GTK_TOGGLE_BUTTON(editor->priv->fill_color_radio), TRUE);
472                         gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE);
473                         gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE);
474                 } else {
475                         state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->fill_key_radio));
476                         gtk_widget_set_sensitive (editor->priv->fill_color_combo, !state);
477                         gtk_widget_set_sensitive (editor->priv->fill_key_combo, state);
478                                                   
479                 }
480         }
481
482         if (editor->priv->line_page_vbox) {
483                 gtk_widget_set_sensitive (editor->priv->line_key_radio, merge != NULL);
484                 if (merge == NULL) {
485                         gtk_toggle_button_set_active (
486                                 GTK_TOGGLE_BUTTON(editor->priv->line_color_radio), TRUE);
487                         gtk_widget_set_sensitive (editor->priv->line_color_combo, TRUE);
488                         gtk_widget_set_sensitive (editor->priv->line_key_combo, FALSE);
489                 } else {
490                         state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->line_key_radio));
491                         gtk_widget_set_sensitive (editor->priv->line_color_combo, !state);
492                         gtk_widget_set_sensitive (editor->priv->line_key_combo, state);
493                                                   
494                 }
495         }
496
497         if (editor->priv->bc_page_vbox) {
498                 gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge != NULL);
499                 if (merge == NULL) {
500                         gtk_toggle_button_set_active (
501                                 GTK_TOGGLE_BUTTON(editor->priv->bc_color_radio), TRUE);
502                         gtk_widget_set_sensitive (editor->priv->bc_color_combo, TRUE);
503                         gtk_widget_set_sensitive (editor->priv->bc_key_combo, FALSE);
504                 } else {
505                         state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->bc_key_radio));
506                         gtk_widget_set_sensitive (editor->priv->bc_color_combo, !state);
507                         gtk_widget_set_sensitive (editor->priv->bc_key_combo, state);
508                                                   
509                 }
510         }
511
512         if (editor->priv->shadow_page_vbox) {
513                 gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge != NULL);
514                 if (merge == NULL) {
515                         gtk_toggle_button_set_active (
516                                 GTK_TOGGLE_BUTTON(editor->priv->shadow_color_radio), TRUE);
517                         gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE);
518                         gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE);
519                 } else {
520                         state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(editor->priv->shadow_key_radio));
521                         gtk_widget_set_sensitive (editor->priv->shadow_color_combo, !state);
522                         gtk_widget_set_sensitive (editor->priv->shadow_key_combo, state);
523                                                   
524                 }
525         }
526
527         keys = gl_merge_get_key_list (merge);
528         if ( keys == NULL ) {
529                 keys = g_list_append (keys, "");
530         }
531
532         combo = editor->priv->img_key_combo;
533         if (combo) {
534                 gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
535         }
536
537         combo = editor->priv->edit_key_combo;
538         if (combo) {
539                 gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
540         }
541
542         combo = editor->priv->data_key_combo;
543         if (combo) {
544                 gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
545         }
546                 
547         combo = editor->priv->fill_key_combo;
548         if (combo) {
549                 gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
550         }
551
552         combo = editor->priv->text_color_key_combo;
553         if (combo) {
554                 gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
555         }
556
557         combo = editor->priv->line_key_combo;
558         if (combo) {
559                 gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
560         }
561                 
562         combo = editor->priv->bc_key_combo;
563         if (combo) {
564                 gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
565         }
566                 
567         combo = editor->priv->shadow_key_combo;
568         if (combo) {
569                 gl_util_combo_box_set_strings (GTK_COMBO_BOX (combo), keys);
570         }
571
572         gl_merge_free_key_list (&keys);
573  
574         gl_debug (DEBUG_EDITOR, "END");
575 }
576
577 /*****************************************************************************/
578 /* Construct color combo "Custom widget".                                    */
579 /*****************************************************************************/
580 GtkWidget *
581 gl_object_editor_construct_color_combo (gchar *name,
582                                         gchar *string1,
583                                         gchar *string2,
584                                         gint   int1,
585                                         gint   int2)
586 {
587         GtkWidget  *color_combo;
588         ColorGroup *cg;
589         gchar      *cg_name;
590         guint       color;
591         GdkColor   *gdk_color;
592         gchar      *no_color;
593
594         switch (int1) {
595
596         case 3:
597                 cg_name  = "shadow_color_group";
598                 color    = GL_COLOR_SHADOW_DEFAULT;
599                 no_color = _("Default");
600                 break;
601
602         case 2:
603                 cg_name  = "text_color_group";
604                 color    = gl_prefs->default_text_color;
605                 no_color = _("Default");
606                 break;
607
608         case 1:
609                 cg_name  = "line_color_group";
610                 color    = gl_prefs->default_line_color;
611                 no_color = _("No line");
612                 break;
613
614         case 0:
615         default:
616                 cg_name  = "fill_color_group";
617                 color    = gl_prefs->default_fill_color;
618                 no_color = _("No fill");
619                 break;
620
621         }
622
623         cg = color_group_fetch (cg_name, NULL);
624         gdk_color = gl_color_to_gdk_color (color);
625         color_combo = color_combo_new (NULL, no_color, gdk_color, cg);
626         g_free (gdk_color);
627
628         color_combo_box_set_preview_relief (COLOR_COMBO(color_combo), GTK_RELIEF_NORMAL);
629
630         return color_combo;
631 }
632
633 /*****************************************************************************/
634 /* Construct chain button "Custom widget".                                   */
635 /*****************************************************************************/
636 GtkWidget *
637 gl_object_editor_construct_chain_button (gchar *name,
638                                          gchar *string1,
639                                          gchar *string2,
640                                          gint   int1,
641                                          gint   int2)
642 {
643         GtkWidget  *chain_button;
644
645         chain_button = gl_wdgt_chain_button_new (GL_WDGT_CHAIN_RIGHT);
646         gl_wdgt_chain_button_set_active (GL_WDGT_CHAIN_BUTTON(chain_button), TRUE);
647
648         return chain_button;
649 }
650
651 /*--------------------------------------------------------------------------*/
652 /* PRIVATE. Prefs changed callback.  Update units related items.            */
653 /*--------------------------------------------------------------------------*/
654 static void
655 prefs_changed_cb (glObjectEditor *editor)
656 {
657
658         gl_debug (DEBUG_EDITOR, "START");
659
660         if (editor->priv->lsize_r_spin) {
661                 lsize_prefs_changed_cb (editor);
662         }
663                 
664         if (editor->priv->size_w_spin) {
665                 size_prefs_changed_cb (editor);
666         }
667                 
668         if (editor->priv->pos_x_spin) {
669                 position_prefs_changed_cb (editor);
670         }
671
672         if (editor->priv->shadow_x_spin) {
673                 shadow_prefs_changed_cb (editor);
674         }
675
676         gl_debug (DEBUG_EDITOR, "END");
677 }