gl_debug (DEBUG_EDITOR, "START");
- g_print( "Field activated: \"%s\"\n", field );
-
field_string = g_strdup_printf ("${%s}", field);
gl_debug (DEBUG_WDGT, "Inserting %s", field_string);
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+ if (editor->priv->lsize_page_vbox)
+ {
- /* save a copy in internal units */
- editor->priv->dx_max = dx_max;
- editor->priv->dy_max = dy_max;
+ editor->priv->stop_signals = TRUE;
- /* convert internal units to displayed units */
- gl_debug (DEBUG_EDITOR, "internal dx_max,dy_max = %g, %g", dx_max, dy_max);
- dx_max *= editor->priv->units_per_point;
- dy_max *= editor->priv->units_per_point;
- gl_debug (DEBUG_EDITOR, "display dx_max,dy_max = %g, %g", dx_max, dy_max);
+ /* save a copy in internal units */
+ editor->priv->dx_max = dx_max;
+ editor->priv->dy_max = dy_max;
- /* Set widget values */
- tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin));
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin),
- 0.0, 2.0*LENGTH (dx_max, dy_max));
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), tmp);
+ /* convert internal units to displayed units */
+ gl_debug (DEBUG_EDITOR, "internal dx_max,dy_max = %g, %g", dx_max, dy_max);
+ dx_max *= editor->priv->units_per_point;
+ dy_max *= editor->priv->units_per_point;
+ gl_debug (DEBUG_EDITOR, "display dx_max,dy_max = %g, %g", dx_max, dy_max);
- editor->priv->stop_signals = FALSE;
+ /* Set widget values */
+ tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin));
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin),
+ 0.0, 2.0*LENGTH (dx_max, dy_max));
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_r_spin), tmp);
+
+ editor->priv->stop_signals = FALSE;
+
+ }
gl_debug (DEBUG_EDITOR, "END");
}
GladeXML *gui;
GtkWidget *editor_vbox;
+ glLabel *label;
+
gdouble units_per_point;
GtkWidget *title_image;
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+ if (editor->priv->shadow_page_vbox)
+ {
- /* save a copy in internal units */
- editor->priv->shadow_x_max = x_max;
- editor->priv->shadow_y_max = y_max;
+ editor->priv->stop_signals = TRUE;
- /* convert internal units to displayed units */
- gl_debug (DEBUG_EDITOR, "internal x_max,y_max = %g, %g", x_max, y_max);
- x_max *= editor->priv->units_per_point;
- y_max *= editor->priv->units_per_point;
- gl_debug (DEBUG_EDITOR, "display x_max,y_max = %g, %g", x_max, y_max);
+ /* save a copy in internal units */
+ editor->priv->shadow_x_max = x_max;
+ editor->priv->shadow_y_max = y_max;
- /* Set widget values */
- tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin));
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin),
- -x_max, x_max);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), tmp);
- tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin));
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin),
- -y_max, y_max);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), tmp);
+ /* convert internal units to displayed units */
+ gl_debug (DEBUG_EDITOR, "internal x_max,y_max = %g, %g", x_max, y_max);
+ x_max *= editor->priv->units_per_point;
+ y_max *= editor->priv->units_per_point;
+ gl_debug (DEBUG_EDITOR, "display x_max,y_max = %g, %g", x_max, y_max);
- editor->priv->stop_signals = FALSE;
+ /* Set widget values */
+ tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin));
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin),
+ -x_max, x_max);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), tmp);
+ tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin));
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin),
+ -y_max, y_max);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), tmp);
+
+ editor->priv->stop_signals = FALSE;
+
+ }
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+ if (editor->priv->size_page_vbox)
+ {
- /* save a copy in internal units */
- editor->priv->w_max = w_max;
- editor->priv->h_max = h_max;
+ editor->priv->stop_signals = TRUE;
- /* convert internal units to displayed units */
- gl_debug (DEBUG_EDITOR, "internal w_max,h_max = %g, %g", w_max, h_max);
- w_max *= editor->priv->units_per_point;
- h_max *= editor->priv->units_per_point;
- gl_debug (DEBUG_EDITOR, "display w_max,h_max = %g, %g", w_max, h_max);
+ /* save a copy in internal units */
+ editor->priv->w_max = w_max;
+ editor->priv->h_max = h_max;
+
+ /* convert internal units to displayed units */
+ gl_debug (DEBUG_EDITOR, "internal w_max,h_max = %g, %g", w_max, h_max);
+ w_max *= editor->priv->units_per_point;
+ h_max *= editor->priv->units_per_point;
+ gl_debug (DEBUG_EDITOR, "display w_max,h_max = %g, %g", w_max, h_max);
+
+ /* Set widget values */
+ tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin));
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_w_spin),
+ 0.0, 2.0*w_max);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), tmp);
+ tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin));
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_h_spin),
+ 0.0, 2.0*h_max);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), tmp);
- /* Set widget values */
- tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin));
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_w_spin),
- 0.0, 2.0*w_max);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), tmp);
- tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin));
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->size_h_spin),
- 0.0, 2.0*h_max);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), tmp);
+ editor->priv->stop_signals = FALSE;
- editor->priv->stop_signals = FALSE;
+ }
gl_debug (DEBUG_EDITOR, "END");
}
static void gl_object_editor_finalize (GObject *object);
static void gl_object_notebook_construct_valist (glObjectEditor *editor,
+ glLabel *label,
glObjectEditorOption first_option,
va_list args);
static void prefs_changed_cb (glObjectEditor *editor);
+static void label_changed_cb (glLabel *label,
+ glObjectEditor *editor);
+
\f
/*****************************************************************************/
/* Boilerplate object stuff. */
g_return_if_fail (GL_IS_OBJECT_EDITOR (editor));
g_return_if_fail (editor->priv != NULL);
- g_object_unref (editor->priv->gui);
- g_free (editor->priv);
-
g_signal_handlers_disconnect_by_func (G_OBJECT(gl_prefs),
prefs_changed_cb, editor);
+ g_signal_handlers_disconnect_by_func (G_OBJECT(editor->priv->label),
+ label_changed_cb, editor);
+
+ g_object_unref (editor->priv->gui);
+ g_free (editor->priv);
G_OBJECT_CLASS (gl_object_editor_parent_class)->finalize (object);
/*****************************************************************************/
GtkWidget*
gl_object_editor_new (gchar *image,
- gchar *label,
+ gchar *title,
+ glLabel *label,
glObjectEditorOption first_option, ...)
{
glObjectEditor *editor;
GTK_ICON_SIZE_LARGE_TOOLBAR);
}
- if (label) {
+ if (title) {
gchar *s;
s = g_strdup_printf ("<span weight=\"bold\">%s</span>",
- label);
+ title);
gtk_label_set_text (GTK_LABEL(editor->priv->title_label), s);
g_free (s);
gtk_notebook_set_homogeneous_tabs (GTK_NOTEBOOK(editor->priv->notebook), TRUE);
va_start (args, first_option);
- gl_object_notebook_construct_valist (editor, first_option, args);
+ gl_object_notebook_construct_valist (editor, label, first_option, args);
va_end (args);
- if (editor->priv->gui) {
- g_object_unref (G_OBJECT (editor->priv->gui));
- }
-
gl_debug (DEBUG_EDITOR, "END");
return GTK_WIDGET(editor);
/*--------------------------------------------------------------------------*/
static void
gl_object_notebook_construct_valist (glObjectEditor *editor,
+ glLabel *label,
glObjectEditorOption first_option,
va_list args)
{
gl_debug (DEBUG_EDITOR, "START");
+ editor->priv->label = label;
+
option = first_option;
for ( option=first_option; option; option=va_arg (args, glObjectEditorOption) ) {
g_signal_connect_swapped (G_OBJECT (gl_prefs), "changed",
G_CALLBACK (prefs_changed_cb),
editor);
+ if (label)
+ {
+ label_changed_cb (label, editor);
+ g_signal_connect (G_OBJECT (label), "size_changed",
+ G_CALLBACK (label_changed_cb),
+ editor);
+ g_signal_connect (G_OBJECT (label), "merge_changed",
+ G_CALLBACK (label_changed_cb),
+ editor);
+ }
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "END");
}
+
+/*---------------------------------------------------------------------------*/
+/* PRIVATE. label "changed" callback. */
+/*---------------------------------------------------------------------------*/
+static void
+label_changed_cb (glLabel *label,
+ glObjectEditor *editor)
+{
+ gdouble label_width, label_height;
+ glMerge *merge;
+
+ gl_debug (DEBUG_EDITOR, "START");
+
+ gl_label_get_size (label, &label_width, &label_height);
+ gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor),
+ label_width, label_height);
+ gl_object_editor_set_max_size (GL_OBJECT_EDITOR (editor),
+ label_width, label_height);
+ gl_object_editor_set_max_lsize (GL_OBJECT_EDITOR (editor),
+ label_width, label_height);
+ gl_object_editor_set_max_shadow_offset (GL_OBJECT_EDITOR (editor),
+ label_width, label_height);
+
+ merge = gl_label_get_merge (label);
+ gl_object_editor_set_key_names (editor, merge);
+
+ gl_debug (DEBUG_EDITOR, "END");
+}
+
#include <gtk/gtktextbuffer.h>
#include "text-node.h"
+#include "label.h"
#include "merge.h"
#include "bc.h"
#include "color.h"
GtkType gl_object_editor_get_type (void) G_GNUC_CONST;
GtkWidget *gl_object_editor_new (gchar *image,
- gchar *label,
+ gchar *title,
+ glLabel *label,
glObjectEditorOption first_option, ...);
void gl_object_editor_set_key_names (glObjectEditor *editor,
sidebar->priv->empty_child = gl_object_editor_new (GL_STOCK_PROPERTIES,
_("Object properties"),
+ NULL,
GL_OBJECT_EDITOR_EMPTY,
NULL);
gdouble dy,
glObjectEditor *editor);
-static void update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor);
-
static gboolean object_at (glViewObject *view_object,
cairo_t *cr,
gdouble x,
/* Build editor. */
editor = gl_object_editor_new (GL_STOCK_BARCODE, _("Barcode object properties"),
+ object->parent,
GL_OBJECT_EDITOR_POSITION_PAGE,
GL_OBJECT_EDITOR_SIZE_PAGE,
GL_OBJECT_EDITOR_BC_PAGE,
0);
/* Update */
- update_editor_from_label_cb (object->parent, GL_OBJECT_EDITOR(editor));
update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor));
update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor));
G_CALLBACK (update_editor_from_object_cb), editor);
g_signal_connect (G_OBJECT (object), "moved",
G_CALLBACK (update_editor_from_move_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "size_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "merge_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
gl_debug (DEBUG_VIEW, "END");
gl_debug (DEBUG_VIEW, "END");
}
-/*---------------------------------------------------------------------------*/
-/* PRIVATE. label "changed" callback. */
-/*---------------------------------------------------------------------------*/
-static void
-update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor)
-{
- gdouble label_width, label_height;
- glMerge *merge;
-
- gl_debug (DEBUG_VIEW, "START");
-
- gl_label_get_size (label, &label_width, &label_height);
- gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_size (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
-
- merge = gl_label_get_merge (label);
- gl_object_editor_set_key_names (editor, merge);
-
- gl_debug (DEBUG_VIEW, "END");
-}
-
/*****************************************************************************/
/* Is object at (x,y)? */
/*****************************************************************************/
gdouble dy,
glObjectEditor *editor);
-static void update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor);
-
static gboolean object_at (glViewObject *view_object,
cairo_t *cr,
gdouble x,
/* Build editor. */
editor = gl_object_editor_new (GL_STOCK_BOX, _("Box object properties"),
+ object->parent,
GL_OBJECT_EDITOR_SHADOW_PAGE,
GL_OBJECT_EDITOR_POSITION_PAGE,
GL_OBJECT_EDITOR_SIZE_PAGE,
0);
/* Update */
- update_editor_from_label_cb (object->parent, GL_OBJECT_EDITOR(editor));
update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor));
update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor));
G_CALLBACK (update_editor_from_object_cb), editor);
g_signal_connect (G_OBJECT (object), "moved",
G_CALLBACK (update_editor_from_move_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "size_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "merge_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
gl_debug (DEBUG_VIEW, "END");
gl_debug (DEBUG_VIEW, "END");
}
-/*---------------------------------------------------------------------------*/
-/* PRIVATE. label "changed" callback. */
-/*---------------------------------------------------------------------------*/
-static void
-update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor)
-{
- gdouble label_width, label_height;
- glMerge *merge;
-
- gl_debug (DEBUG_VIEW, "START");
-
- gl_label_get_size (label, &label_width, &label_height);
- gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_size (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_shadow_offset (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
-
- merge = gl_label_get_merge (label);
- gl_object_editor_set_key_names (editor, merge);
-
- gl_debug (DEBUG_VIEW, "END");
-}
-
/*****************************************************************************/
/* Is object at (x,y)? */
/*****************************************************************************/
gdouble dy,
glObjectEditor *editor);
-static void update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor);
-
static gboolean object_at (glViewObject *view_object,
cairo_t *cr,
gdouble x,
/* Build editor. */
editor = gl_object_editor_new (GL_STOCK_ELLIPSE, _("Ellipse object properties"),
+ object->parent,
GL_OBJECT_EDITOR_SHADOW_PAGE,
GL_OBJECT_EDITOR_POSITION_PAGE,
GL_OBJECT_EDITOR_SIZE_PAGE,
0);
/* Update */
- update_editor_from_label_cb (object->parent, GL_OBJECT_EDITOR(editor));
update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor));
update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor));
G_CALLBACK (update_editor_from_object_cb), editor);
g_signal_connect (G_OBJECT (object), "moved",
G_CALLBACK (update_editor_from_move_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "size_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "merge_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
gl_debug (DEBUG_VIEW, "END");
gl_debug (DEBUG_VIEW, "END");
}
-/*---------------------------------------------------------------------------*/
-/* PRIVATE. label "changed" callback. */
-/*---------------------------------------------------------------------------*/
-static void
-update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor)
-{
- gdouble label_width, label_height;
- glMerge *merge;
-
- gl_debug (DEBUG_VIEW, "START");
-
- gl_label_get_size (label, &label_width, &label_height);
- gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_size (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_shadow_offset (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
-
- merge = gl_label_get_merge (label);
- gl_object_editor_set_key_names (editor, merge);
-
- gl_debug (DEBUG_VIEW, "END");
-}
-
/*****************************************************************************/
/* Is object at (x,y)? */
/*****************************************************************************/
gdouble dy,
glObjectEditor *editor);
-static void update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor);
-
static gboolean object_at (glViewObject *view_object,
cairo_t *cr,
gdouble x,
/* Build editor. */
editor = gl_object_editor_new (GL_STOCK_IMAGE, _("Image object properties"),
+ object->parent,
GL_OBJECT_EDITOR_POSITION_PAGE,
GL_OBJECT_EDITOR_SIZE_IMAGE_PAGE,
GL_OBJECT_EDITOR_IMAGE_PAGE,
0);
/* Update */
- update_editor_from_label_cb (object->parent, GL_OBJECT_EDITOR(editor));
update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor));
update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor));
G_CALLBACK (update_editor_from_object_cb), editor);
g_signal_connect (G_OBJECT (object), "moved",
G_CALLBACK (update_editor_from_move_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "size_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "merge_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
gl_debug (DEBUG_VIEW, "END");
gl_debug (DEBUG_VIEW, "END");
}
-/*---------------------------------------------------------------------------*/
-/* PRIVATE. label "changed" callback. */
-/*---------------------------------------------------------------------------*/
-static void
-update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor)
-{
- gdouble label_width, label_height;
- glMerge *merge;
-
- gl_debug (DEBUG_VIEW, "START");
-
- gl_label_get_size (label, &label_width, &label_height);
- gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_size (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
-
- merge = gl_label_get_merge (label);
- gl_object_editor_set_key_names (editor, merge);
-
- gl_debug (DEBUG_VIEW, "END");
-}
-
/*****************************************************************************/
/* Is object at (x,y)? */
/*****************************************************************************/
gdouble dy,
glObjectEditor *editor);
-static void update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor);
-
static gboolean object_at (glViewObject *view_object,
cairo_t *cr,
gdouble x,
/* Build editor. */
editor = gl_object_editor_new (GL_STOCK_LINE, _("Line object properties"),
+ object->parent,
GL_OBJECT_EDITOR_SHADOW_PAGE,
GL_OBJECT_EDITOR_POSITION_PAGE,
GL_OBJECT_EDITOR_SIZE_LINE_PAGE,
0);
/* Update */
- update_editor_from_label_cb (object->parent, GL_OBJECT_EDITOR(editor));
update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor));
update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor));
G_CALLBACK (update_editor_from_object_cb), editor);
g_signal_connect (G_OBJECT (object), "moved",
G_CALLBACK (update_editor_from_move_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "size_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "merge_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
gl_debug (DEBUG_VIEW, "END");
gl_debug (DEBUG_VIEW, "END");
}
-/*---------------------------------------------------------------------------*/
-/* PRIVATE. label "changed" callback. */
-/*---------------------------------------------------------------------------*/
-static void
-update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor)
-{
- gdouble label_width, label_height;
- glMerge *merge;
-
- gl_debug (DEBUG_VIEW, "START");
-
- gl_label_get_size (label, &label_width, &label_height);
- gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_lsize (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_shadow_offset (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
-
- merge = gl_label_get_merge (label);
- gl_object_editor_set_key_names (editor, merge);
-
- gl_debug (DEBUG_VIEW, "END");
-}
-
/*****************************************************************************/
/* Is object at (x,y)? */
/*****************************************************************************/
g_object_unref (view_object->priv->object);
if (view_object->priv->property_editor) {
- gtk_object_destroy (GTK_OBJECT(view_object->priv->property_editor));
+ gl_debug (DEBUG_VIEW, "Destroy editor");
+ g_object_unref (G_OBJECT(view_object->priv->property_editor));
}
g_free (view_object->priv);
gdouble dy,
glObjectEditor *editor);
-static void update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor);
-
static gboolean object_at (glViewObject *view_object,
cairo_t *cr,
gdouble x,
/* Build editor. */
editor = gl_object_editor_new (GL_STOCK_TEXT, _("Text object properties"),
+ object->parent,
GL_OBJECT_EDITOR_SHADOW_PAGE,
GL_OBJECT_EDITOR_POSITION_PAGE,
GL_OBJECT_EDITOR_SIZE_PAGE,
gl_object_editor_set_text_buffer (GL_OBJECT_EDITOR(editor), buffer);
/* Update */
- update_editor_from_label_cb (object->parent, GL_OBJECT_EDITOR(editor));
update_editor_from_object_cb (object, GL_OBJECT_EDITOR(editor));
update_editor_from_move_cb (object, 0, 0, GL_OBJECT_EDITOR(editor));
G_CALLBACK (update_editor_from_object_cb), editor);
g_signal_connect (G_OBJECT (object), "moved",
G_CALLBACK (update_editor_from_move_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "size_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
- g_signal_connect (G_OBJECT (object->parent), "merge_changed",
- G_CALLBACK (update_editor_from_label_cb), editor);
gl_debug (DEBUG_VIEW, "END");
gl_debug (DEBUG_VIEW, "END");
}
-/*---------------------------------------------------------------------------*/
-/* PRIVATE. label "changed" callback. */
-/*---------------------------------------------------------------------------*/
-static void
-update_editor_from_label_cb (glLabel *label,
- glObjectEditor *editor)
-{
- gdouble label_width, label_height;
- glMerge *merge;
-
- gl_debug (DEBUG_VIEW, "START");
-
- gl_label_get_size (label, &label_width, &label_height);
- gl_object_editor_set_max_position (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_size (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
- gl_object_editor_set_max_shadow_offset (GL_OBJECT_EDITOR (editor),
- label_width, label_height);
-
- merge = gl_label_get_merge (label);
- gl_object_editor_set_key_names (editor, merge);
-
- gl_debug (DEBUG_VIEW, "END");
-}
/*****************************************************************************/
/* Is object at (x,y)? */
g_free (family);
lines = gl_text_node_lines_new_from_text (_("Text"));
gl_label_text_set_lines (GL_LABEL_TEXT(object), lines);
- view_text = gl_view_text_new (GL_LABEL_TEXT(object), view);
gl_color_node_free (&color_node);
view->create_object = GL_LABEL_OBJECT (object);