G_CALLBACK (bc_radio_toggled_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->data_digits_spin),
- "changed",
+ "value-changed",
G_CALLBACK (data_digits_spin_changed_cb),
G_OBJECT (editor));
const gchar *backend_id;
const gchar *style_name;
- if (editor->priv->stop_signals) return;
-
backend_name =
gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo));
gchar *ex_string = NULL;
guint digits;
- if (editor->priv->stop_signals) return;
-
backend_name =
gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo));
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_style_combo),
+ style_changed_cb, editor);
styles = gl_barcode_backends_get_styles_list (backend_id);
gl_combo_util_set_strings (GTK_COMBO_BOX_TEXT(editor->priv->bc_style_combo), styles);
gl_barcode_backends_free_styles_list (styles);
- editor->priv->stop_signals = FALSE;
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_style_combo),
+ style_changed_cb, editor);
gl_debug (DEBUG_EDITOR, "END");
}
gl_object_editor_load_bc_styles (editor, bc_style->backend_id);
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_backend_combo),
+ backend_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_style_combo),
+ style_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_text_check),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_cs_check),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_digits_spin),
+ data_digits_spin_changed_cb, editor);
+
backend_name = gl_barcode_backends_backend_id_to_name (bc_style->backend_id);
style_name = gl_barcode_backends_style_id_to_name (bc_style->backend_id, bc_style->id);
!editor->priv->data_format_fixed_flag);
}
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_backend_combo),
+ backend_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_style_combo),
+ style_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_text_check),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_cs_check),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_digits_spin),
+ data_digits_spin_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
- gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge_flag);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_color_radio),
+ bc_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_key_radio),
+ bc_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->bc_key_combo),
+ gl_object_editor_changed_cb, editor);
- if ( color_node->color == GL_COLOR_NONE ) {
-
- gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->bc_color_combo));
- } else {
+ gtk_widget_set_sensitive (editor->priv->bc_key_radio, merge_flag);
+ if ( color_node->color == GL_COLOR_NONE )
+ {
+ gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->bc_color_combo));
+ }
+ else
+ {
gl_color_combo_set_color (GL_COLOR_COMBO(editor->priv->bc_color_combo),
color_node->color);
}
color_node->key);
}
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_color_radio),
+ bc_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_key_radio),
+ bc_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->bc_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
static void
bc_radio_toggled_cb (glObjectEditor *editor)
{
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->bc_color_radio))) {
guint digits;
gchar *ex_string;
- if (editor->priv->stop_signals) return;
-
backend_name = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (editor->priv->bc_backend_combo));
backend_id = gl_barcode_backends_backend_name_to_id (backend_name);
static void
data_radio_toggled_cb (glObjectEditor *editor)
{
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_WDGT, "START");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) {
gint pos;
gl_debug (DEBUG_EDITOR, "START");
+
- editor->priv->stop_signals = TRUE;
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_literal_radio),
+ data_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_key_radio),
+ data_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_text_entry),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->data_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gtk_widget_set_sensitive (editor->priv->data_key_radio, merge_flag);
- if (!text_node->field_flag || !merge_flag) {
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
+ if (!text_node->field_flag || !merge_flag)
+ {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(editor->priv->data_literal_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->data_text_entry, TRUE);
gtk_widget_set_sensitive (editor->priv->data_key_combo, FALSE);
gtk_editable_delete_text (GTK_EDITABLE (editor->priv->data_text_entry), 0, -1);
pos = 0;
- if (text_node->data != NULL ) {
+ if (text_node->data != NULL )
+ {
gtk_editable_insert_text (GTK_EDITABLE (editor->priv->data_text_entry),
text_node->data,
strlen (text_node->data),
&pos);
}
-
- } else {
-
+ }
+ else
+ {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
(editor->priv->data_key_radio), TRUE);
}
- editor->priv->stop_signals = FALSE;
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_literal_radio),
+ data_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_key_radio),
+ data_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_text_entry),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->data_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
/*****************************************************************************/
-/* Query data. */
+/* Query data. */
/*****************************************************************************/
glTextNode *
gl_object_editor_get_data (glObjectEditor *editor)
text_node = g_new0(glTextNode,1);
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio))) {
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->data_literal_radio)))
+ {
text_node->field_flag = FALSE;
text_node->data =
- gtk_editable_get_chars (GTK_EDITABLE (editor->priv->data_text_entry),
- 0, -1);
- } else {
+ gtk_editable_get_chars (GTK_EDITABLE (editor->priv->data_text_entry), 0, -1);
+ }
+ else
+ {
text_node->field_flag = TRUE;
text_node->data =
gl_field_button_get_key (GL_FIELD_BUTTON (editor->priv->data_key_combo));
return;
}
- editor->priv->stop_signals = TRUE;
- gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge_flag);
-
- if ( color_node->color == GL_COLOR_NONE ) {
-
- gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->fill_color_combo));
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->fill_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->fill_color_radio),
+ fill_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->fill_key_radio),
+ fill_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->fill_key_combo),
+ gl_object_editor_changed_cb, editor);
- } else {
- gl_color_combo_set_color (GL_COLOR_COMBO(editor->priv->fill_color_combo),
- color_node->color);
+ gtk_widget_set_sensitive (editor->priv->fill_key_radio, merge_flag);
+ if ( color_node->color == GL_COLOR_NONE )
+ {
+ gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->fill_color_combo));
+ }
+ else
+ {
+ gl_color_combo_set_color (GL_COLOR_COMBO(editor->priv->fill_color_combo), color_node->color);
}
- if (!color_node->field_flag || !merge_flag) {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
- (editor->priv->fill_color_radio), TRUE);
+ if (!color_node->field_flag || !merge_flag)
+ {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE);
gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE);
- } else {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
- (editor->priv->fill_key_radio), TRUE);
+ }
+ else
+ {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->fill_key_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->fill_color_combo, FALSE);
gtk_widget_set_sensitive (editor->priv->fill_key_combo, TRUE);
- gl_field_button_set_key (GL_FIELD_BUTTON (editor->priv->fill_key_combo),
- color_node->key);
+ gl_field_button_set_key (GL_FIELD_BUTTON (editor->priv->fill_key_combo), color_node->key);
}
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->fill_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->fill_color_radio),
+ fill_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->fill_key_radio),
+ fill_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->fill_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
static void
fill_radio_toggled_cb (glObjectEditor *editor)
{
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio))) {
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->fill_color_radio)))
+ {
gtk_widget_set_sensitive (editor->priv->fill_color_combo, TRUE);
gtk_widget_set_sensitive (editor->priv->fill_key_combo, FALSE);
- } else {
+ }
+ else
+ {
gtk_widget_set_sensitive (editor->priv->fill_color_combo, FALSE);
gtk_widget_set_sensitive (editor->priv->fill_key_combo, TRUE);
-
}
gl_object_editor_changed_cb (editor);
static void
img_radio_toggled_cb (glObjectEditor *editor)
{
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_WDGT, "START");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio))) {
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_file_radio),
+ img_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_key_radio),
+ img_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_file_button),
+ img_selection_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->img_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gtk_widget_set_sensitive (editor->priv->img_key_radio, merge_flag);
- if (!text_node->field_flag || !merge_flag) {
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
- (editor->priv->img_file_radio), TRUE);
+ if (!text_node->field_flag || !merge_flag)
+ {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->img_file_button, TRUE);
gtk_widget_set_sensitive (editor->priv->img_key_combo, FALSE);
- if (text_node->data != NULL ) {
+ if (text_node->data != NULL )
+ {
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button),
text_node->data);
- } else {
+ }
+ else
+ {
gtk_file_chooser_unselect_all (GTK_FILE_CHOOSER(editor->priv->img_file_button));
}
- } else {
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
- (editor->priv->img_key_radio), TRUE);
+ }
+ else
+ {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->img_key_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->img_file_button, FALSE);
gtk_widget_set_sensitive (editor->priv->img_key_combo, TRUE);
text_node->data);
}
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_file_radio),
+ img_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_key_radio),
+ img_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_file_button),
+ img_selection_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->img_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
text_node = g_new0(glTextNode,1);
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio))) {
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->img_file_radio)))
+ {
text_node->field_flag = FALSE;
text_node->data =
gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button));
- } else {
+ }
+ else
+ {
text_node->field_flag = TRUE;
text_node->data =
gl_field_button_get_key (GL_FIELD_BUTTON (editor->priv->img_key_combo));
preview = GTK_WIDGET (data);
filename = gtk_file_chooser_get_preview_filename (file_chooser);
- if (filename) {
+ if (filename)
+ {
gl_debug (DEBUG_EDITOR, "filename =\"%s\"", filename);
pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL);
if (pixbuf != NULL)
TRUE);
}
g_free (filename);
- } else {
+ }
+ else
+ {
gtk_file_chooser_set_preview_widget_active (file_chooser, FALSE);
}
/* Individual image filters */
formats = gdk_pixbuf_get_formats ();
- for (it = formats; it != NULL; it = it->next) {
+ for (it = formats; it != NULL; it = it->next)
+ {
gchar *filter_name;
GdkPixbufFormat *format;
filter = gtk_file_filter_new ();
g_free (filter_name);
mime_types = gdk_pixbuf_format_get_mime_types ((GdkPixbufFormat *) it->data);
- for (i = 0; mime_types[i] != NULL; i++) {
+ for (i = 0; mime_types[i] != NULL; i++)
+ {
gtk_file_filter_add_mime_type (filter, mime_types[i]);
gtk_file_filter_add_mime_type (all_img_filter, mime_types[i]);
}
g_strfreev (mime_types);
pattern = gdk_pixbuf_format_get_extensions ((GdkPixbufFormat *) it->data);
- for (i = 0; pattern[i] != NULL; i++) {
+ for (i = 0; pattern[i] != NULL; i++)
+ {
tmp = g_strconcat ("*.", pattern[i], NULL);
gtk_file_filter_add_pattern (filter, tmp);
gtk_file_filter_add_pattern (all_img_filter, tmp);
{
gchar *filename;
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(editor->priv->img_file_button));
/* Connect signals */
g_signal_connect_swapped (G_OBJECT (editor->priv->line_width_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_changed_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->line_color_combo),
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_width_spin),
+ gl_object_editor_changed_cb, editor);
+
/* Set widget values */
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->line_width_spin),
width);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_width_spin),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
return;
}
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_color_radio),
+ line_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_key_radio),
+ line_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->line_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X", color_node->key, color_node->field_flag, color_node->color);
gtk_widget_set_sensitive (editor->priv->line_key_radio, merge_flag);
color_node->key);
}
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_color_radio),
+ line_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_key_radio),
+ line_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->line_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
static void
line_radio_toggled_cb (glObjectEditor *editor)
{
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->line_color_radio))) {
/* Connect signals */
g_signal_connect_swapped (G_OBJECT (editor->priv->lsize_r_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_size_changed_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->lsize_theta_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_size_changed_cb),
G_OBJECT (editor));
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+ gl_object_editor_size_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+ gl_object_editor_size_changed_cb, editor);
+
/* save a copy in internal units */
editor->priv->dx = dx;
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->lsize_theta_spin),
theta);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+ gl_object_editor_size_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+ gl_object_editor_size_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
- if (editor->priv->lsize_page_vbox)
- {
- editor->priv->stop_signals = TRUE;
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+ gl_object_editor_size_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+ gl_object_editor_size_changed_cb, editor);
- /* save a copy in internal units */
- editor->priv->dx_max = dx_max;
- editor->priv->dy_max = dy_max;
- /* 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);
+
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+ gl_object_editor_size_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+ gl_object_editor_size_changed_cb, editor);
- }
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+ gl_object_editor_size_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+ gl_object_editor_size_changed_cb, editor);
+
+
/* Get new configuration information */
units = gl_prefs_model_get_units (gl_prefs);
units_string = lgl_units_get_name (units);
digits = gl_units_util_get_precision (units);
/* Update characteristics of r_spin */
- editor->priv->stop_signals = TRUE;
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin),
- digits);
- gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin),
- climb_rate, 0);
- editor->priv->stop_signals = FALSE;
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), digits);
+ gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->lsize_r_spin), climb_rate, 0);
/* Update r_units_label */
gtk_label_set_text (GTK_LABEL(editor->priv->lsize_r_units_label),
editor->priv->dx_max,
editor->priv->dy_max);
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_r_spin),
+ gl_object_editor_size_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->lsize_theta_spin),
+ gl_object_editor_size_changed_cb, editor);
+
+
gl_debug (DEBUG_EDITOR, "END");
}
/* Connect signals */
g_signal_connect_swapped (G_OBJECT (editor->priv->pos_x_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_changed_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->pos_y_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_changed_cb),
G_OBJECT (editor));
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_y_spin),
+ gl_object_editor_changed_cb, editor);
+
/* save a copy in internal units */
editor->priv->x = x;
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), x);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), y);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_y_spin),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_y_spin),
+ gl_object_editor_changed_cb, editor);
+
/* save a copy in internal units */
editor->priv->x_max = x_max;
/* Set widget values */
tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin));
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_x_spin),
- -x_max, 2.0*x_max);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), -x_max, 2.0*x_max);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_x_spin), tmp);
tmp = gtk_spin_button_get_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin));
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_y_spin),
- -y_max, 2.0*y_max);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), -y_max, 2.0*y_max);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->pos_y_spin), tmp);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_y_spin),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->pos_y_spin),
+ gl_object_editor_changed_cb, editor);
+
+
/* Get new configuration information */
units = gl_prefs_model_get_units (gl_prefs);
units_string = lgl_units_get_name (units);
digits = gl_units_util_get_precision (units);
/* Update characteristics of x_spin/y_spin */
- editor->priv->stop_signals = TRUE;
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_x_spin),
- digits);
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_y_spin),
- digits);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_x_spin), digits);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->pos_y_spin), digits);
gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_x_spin),
climb_rate, 10.0*climb_rate);
gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->pos_y_spin),
climb_rate, 10.0*climb_rate);
- editor->priv->stop_signals = FALSE;
+
/* Update units_labels */
gtk_label_set_text (GTK_LABEL(editor->priv->pos_x_units_label),
units_string);
/* Update values of x_spin/y_spin */
- gl_object_editor_set_position (editor,
- editor->priv->x,
- editor->priv->y);
- gl_object_editor_set_max_position (editor,
- editor->priv->x_max,
- editor->priv->y_max);
+ gl_object_editor_set_position (editor, editor->priv->x, editor->priv->y);
+ gl_object_editor_set_max_position (editor, editor->priv->x_max, editor->priv->y_max);
+
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->pos_y_spin),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
gdouble shadow_x_max;
gdouble shadow_y_max;
- /* Prevent recursion */
- gboolean stop_signals;
};
enum {
G_CALLBACK (shadow_enable_check_toggled_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_x_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_changed_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_y_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_changed_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_color_combo),
G_CALLBACK (shadow_color_radio_toggled_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->shadow_opacity_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_changed_cb),
G_OBJECT (editor));
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check),
- state);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_enable_check),
+ shadow_enable_check_toggled_cb, editor);
+
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check), state);
gtk_widget_set_sensitive (editor->priv->shadow_controls_table, state);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_enable_check),
+ shadow_enable_check_toggled_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+ gl_object_editor_changed_cb, editor);
+
/* save a copy in internal units */
editor->priv->shadow_x = x;
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_x_spin), x);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_y_spin), y);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
return;
}
- editor->priv->stop_signals = TRUE;
- gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge_flag);
-
- if ( color_node->color == GL_COLOR_NONE ) {
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_color_radio),
+ shadow_color_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_key_radio),
+ shadow_color_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_key_combo),
+ gl_object_editor_changed_cb, editor);
- gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->shadow_color_combo));
- } else {
+ gtk_widget_set_sensitive (editor->priv->shadow_key_radio, merge_flag);
+ if ( color_node->color == GL_COLOR_NONE )
+ {
+ gl_color_combo_set_to_default (GL_COLOR_COMBO(editor->priv->shadow_color_combo));
+ }
+ else
+ {
gl_color_combo_set_color (GL_COLOR_COMBO(editor->priv->shadow_color_combo),
color_node->color);
-
}
- if (!color_node->field_flag || !merge_flag) {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
- (editor->priv->shadow_color_radio), TRUE);
+ if (!color_node->field_flag || !merge_flag)
+ {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_color_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->shadow_color_combo, TRUE);
gtk_widget_set_sensitive (editor->priv->shadow_key_combo, FALSE);
- } else {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
- (editor->priv->shadow_key_radio), TRUE);
+ }
+ else
+ {
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_key_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->shadow_color_combo, FALSE);
gtk_widget_set_sensitive (editor->priv->shadow_key_combo, TRUE);
color_node->key);
}
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_color_radio),
+ shadow_color_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_key_radio),
+ shadow_color_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_opacity_spin),
- alpha * 100.0);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_opacity_spin),
+ gl_object_editor_changed_cb, editor);
+
+
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->shadow_opacity_spin), alpha * 100.0);
+
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_opacity_spin),
+ gl_object_editor_changed_cb, editor);
- editor->priv->stop_signals = FALSE;
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
- if (editor->priv->shadow_page_vbox)
- {
- editor->priv->stop_signals = TRUE;
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+ gl_object_editor_changed_cb, editor);
- /* save a copy in internal units */
- editor->priv->shadow_x_max = x_max;
- editor->priv->shadow_y_max = y_max;
- /* 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);
+
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+ gl_object_editor_changed_cb, editor);
- }
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+ gl_object_editor_changed_cb, editor);
+
+
/* Get new configuration information */
units = gl_prefs_model_get_units (gl_prefs);
units_string = lgl_units_get_name (units);
digits = gl_units_util_get_precision (units);
/* Update characteristics of x_spin/y_spin */
- editor->priv->stop_signals = TRUE;
gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_x_spin),
digits);
gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin),
climb_rate, 10.0*climb_rate);
gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->shadow_y_spin),
climb_rate, 10.0*climb_rate);
- editor->priv->stop_signals = FALSE;
/* Update units_labels */
gtk_label_set_text (GTK_LABEL(editor->priv->shadow_x_units_label),
editor->priv->shadow_x_max,
editor->priv->shadow_y_max);
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_x_spin),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->shadow_y_spin),
+ gl_object_editor_changed_cb, editor);
+
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gboolean state;
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_enable_check));
static void
shadow_color_radio_toggled_cb (glObjectEditor *editor)
{
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->shadow_color_radio))) {
G_CALLBACK (aspect_toggle_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->size_w_spin),
- "changed",
+ "value-changed",
G_CALLBACK (w_spin_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->size_h_spin),
- "changed",
+ "value-changed",
G_CALLBACK (h_spin_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->size_reset_image_button),
glWdgtChainButton *toggle;
gdouble w, h;
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton);
gdouble w, h;
glWdgtChainButton *toggle;
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton);
h = w * editor->priv->size_aspect_ratio;
/* Update our sibling control, blocking recursion. */
- editor->priv->stop_signals = TRUE;
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), h);
- editor->priv->stop_signals = FALSE;
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
}
gl_object_editor_size_changed_cb (editor);
gdouble w, h;
glWdgtChainButton *toggle;
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
toggle = GL_WDGT_CHAIN_BUTTON (editor->priv->size_aspect_checkbutton);
w = h / editor->priv->size_aspect_ratio;
/* Update our sibling control, blocking recursion. */
- editor->priv->stop_signals = TRUE;
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_w_spin), w);
- editor->priv->stop_signals = FALSE;
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
}
gl_object_editor_size_changed_cb (editor);
gdouble w_max, h_max, wh_max;
gdouble aspect_ratio;
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
w_base = editor->priv->w_base;
h_base = editor->priv->h_base;
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin),
h_base);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
gl_object_editor_size_changed_cb (editor);
/*****************************************************************************/
void
gl_object_editor_set_size (glObjectEditor *editor,
- gdouble w,
- gdouble h)
+ gdouble w,
+ gdouble h)
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
/* save a copy in internal units */
editor->priv->w = w;
/* Update aspect ratio */
editor->priv->size_aspect_ratio = h / w;
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
- if (editor->priv->size_page_vbox)
- {
- editor->priv->stop_signals = TRUE;
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
- /* 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;
- wh_max = MAX( w_max, h_max );
- 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;
- /* 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*wh_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*wh_max);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), tmp);
+ /* 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;
+ wh_max = MAX( w_max, h_max );
+ gl_debug (DEBUG_EDITOR, "display w_max,h_max = %g, %g", w_max, h_max);
- editor->priv->stop_signals = FALSE;
+ /* 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*wh_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*wh_max);
+ gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->size_h_spin), tmp);
+
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
- }
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "START");
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
+
/* Get new configuration information */
units = gl_prefs_model_get_units (gl_prefs);
units_string = lgl_units_get_name (units);
digits = gl_units_util_get_precision (units);
/* Update characteristics of w_spin/h_spin */
- editor->priv->stop_signals = TRUE;
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_w_spin),
- digits);
- gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_h_spin),
- digits);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_w_spin), digits);
+ gtk_spin_button_set_digits (GTK_SPIN_BUTTON(editor->priv->size_h_spin), digits);
gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_w_spin),
climb_rate, 10.0*climb_rate);
gtk_spin_button_set_increments (GTK_SPIN_BUTTON(editor->priv->size_h_spin),
climb_rate, 10.0*climb_rate);
- editor->priv->stop_signals = FALSE;
/* Update units_labels */
gtk_label_set_text (GTK_LABEL(editor->priv->size_w_units_label),
units_string);
/* Update values of w_spin/h_spin */
- gl_object_editor_set_size (editor,
- editor->priv->w,
- editor->priv->h);
- gl_object_editor_set_max_size (editor,
- editor->priv->w_max,
- editor->priv->h_max);
+ gl_object_editor_set_size (editor, editor->priv->w, editor->priv->h);
+ gl_object_editor_set_max_size (editor, editor->priv->w_max, editor->priv->h_max);
+
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_w_spin), w_spin_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->size_h_spin), h_spin_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
G_CALLBACK (gl_object_editor_changed_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->text_size_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_changed_cb),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->text_bold_toggle),
G_OBJECT (editor));
g_signal_connect_swapped (G_OBJECT (editor->priv->text_line_spacing_spin),
- "changed",
+ "value-changed",
G_CALLBACK (gl_object_editor_changed_cb),
G_OBJECT (editor));
align_toggle_cb (GtkToggleButton *toggle,
glObjectEditor *editor)
{
- if (editor->priv->stop_signals) return;
-
if (gtk_toggle_button_get_active (toggle)) {
if (GTK_WIDGET (toggle) == GTK_WIDGET (editor->priv->text_left_toggle)) {
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_family_combo),
+ gl_object_editor_changed_cb, editor);
+
old_font_family = gl_font_combo_get_family (GL_FONT_COMBO (editor->priv->text_family_combo));
g_free (old_font_family);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_family_combo),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_size_spin),
+ gl_object_editor_changed_cb, editor);
+
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->text_size_spin),
font_size);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_size_spin),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_bold_toggle),
+ gl_object_editor_changed_cb, editor);
+
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_bold_toggle),
(font_weight == PANGO_WEIGHT_BOLD));
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_bold_toggle),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_italic_toggle),
+ gl_object_editor_changed_cb, editor);
+
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_italic_toggle),
font_italic_flag);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_italic_toggle),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_left_toggle), align_toggle_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_center_toggle), align_toggle_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_right_toggle), align_toggle_cb, editor);
+
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_left_toggle),
(align == PANGO_ALIGN_LEFT));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_right_toggle),
(align == PANGO_ALIGN_RIGHT));
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_left_toggle), align_toggle_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_center_toggle), align_toggle_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_right_toggle), align_toggle_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
return;
}
- editor->priv->stop_signals = TRUE;
- gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X", text_color_node->key, text_color_node->field_flag, text_color_node->color);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_color_radio),
+ text_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_color_key_radio),
+ text_radio_toggled_cb, editor);
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_color_key_combo),
+ gl_object_editor_changed_cb, editor);
+
+
+ gl_debug (DEBUG_EDITOR, "color field %s(%d) / %X",
+ text_color_node->key, text_color_node->field_flag, text_color_node->color);
gtk_widget_set_sensitive (editor->priv->text_color_key_radio, merge_flag);
text_color_node->color);
}
- if (!text_color_node->field_flag || !merge_flag) {
+ if (!text_color_node->field_flag || !merge_flag)
+ {
gl_debug (DEBUG_EDITOR, "color field false");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
- (editor->priv->text_color_radio), TRUE);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->text_color_combo, TRUE);
gtk_widget_set_sensitive (editor->priv->text_color_key_combo, FALSE);
- } else {
+ }
+ else
+ {
gl_debug (DEBUG_EDITOR, "color field true");
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
- (editor->priv->text_color_key_radio), TRUE);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_key_radio), TRUE);
gtk_widget_set_sensitive (editor->priv->text_color_combo, FALSE);
gtk_widget_set_sensitive (editor->priv->text_color_key_combo, TRUE);
gl_field_button_set_key (GL_FIELD_BUTTON (editor->priv->text_color_key_combo), "");
}
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_color_combo),
+ gl_object_editor_changed_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_color_radio),
+ text_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_color_key_radio),
+ text_radio_toggled_cb, editor);
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_color_key_combo),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_line_spacing_spin),
+ gl_object_editor_changed_cb, editor);
+
gtk_spin_button_set_value (GTK_SPIN_BUTTON (editor->priv->text_line_spacing_spin),
text_line_spacing);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_line_spacing_spin),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
{
gl_debug (DEBUG_EDITOR, "START");
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (editor->priv->text_auto_shrink_check),
+ gl_object_editor_changed_cb, editor);
+
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (editor->priv->text_auto_shrink_check),
auto_shrink);
- editor->priv->stop_signals = FALSE;
+
+ g_signal_handlers_unblock_by_func (G_OBJECT (editor->priv->text_auto_shrink_check),
+ gl_object_editor_changed_cb, editor);
+
gl_debug (DEBUG_EDITOR, "END");
}
static void
text_radio_toggled_cb (glObjectEditor *editor)
{
- if (editor->priv->stop_signals) return;
-
gl_debug (DEBUG_EDITOR, "START");
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (editor->priv->text_color_radio))) {
gtk_widget_set_sensitive (editor->priv->title_image, TRUE);
gtk_widget_set_sensitive (editor->priv->title_label, TRUE);
- editor->priv->stop_signals = TRUE;
gtk_widget_show (editor->priv->notebook);
- editor->priv->stop_signals = FALSE;
/* if the old active page is no longer visible, set to 1st visible page. */
new_page = gtk_notebook_get_current_page (GTK_NOTEBOOK (editor->priv->notebook));
gl_debug (DEBUG_EDITOR, "BEGIN");
- if (editor->priv->stop_signals) return;
- editor->priv->stop_signals = TRUE;
-
gl_label_object_get_position (object, &x, &y);
gl_object_editor_set_position (editor, x, y);
gl_color_node_free (&shadow_color_node);
- editor->priv->stop_signals = FALSE;
-
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "BEGIN");
- if (editor->priv->stop_signals) return;
- editor->priv->stop_signals = TRUE;
+
+ g_signal_handlers_block_by_func (G_OBJECT (object), object_changed_cb, editor);
gl_object_editor_get_position (editor, &x, &y);
gl_color_node_free (&shadow_color_node);
- editor->priv->stop_signals = FALSE;
+ g_signal_handlers_unblock_by_func (G_OBJECT (object), object_changed_cb, editor);
gl_debug (DEBUG_EDITOR, "END");
}
gl_debug (DEBUG_EDITOR, "BEGIN");
- if (editor->priv->stop_signals) return;
- editor->priv->stop_signals = TRUE;
+ g_signal_handlers_block_by_func (G_OBJECT (object), object_changed_cb, editor);
if ( GL_IS_LABEL_LINE (object) )
gl_label_object_set_size (object, w, h, TRUE);
- editor->priv->stop_signals = FALSE;
+ g_signal_handlers_unblock_by_func (G_OBJECT (object), object_changed_cb, editor);
gl_debug (DEBUG_EDITOR, "END");
}