aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/e-composer-private.c6
-rw-r--r--composer/e-msg-composer.c15
-rw-r--r--e-util/e-util.c16
-rw-r--r--filter/e-filter-color.c6
-rw-r--r--filter/e-filter-datespec.c13
-rw-r--r--filter/e-filter-option.c8
-rw-r--r--filter/e-filter-rule.c16
-rw-r--r--filter/e-rule-context.c9
-rw-r--r--filter/e-rule-editor.c95
-rw-r--r--libgnomecanvas/gnome-canvas-text.c804
-rw-r--r--libgnomecanvas/gnome-canvas-widget.c14
-rw-r--r--libgnomecanvas/gnome-canvas.c209
-rw-r--r--mail/e-mail-backend.c14
-rw-r--r--widgets/misc/e-source-config.c12
14 files changed, 734 insertions, 503 deletions
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index f6fd7d9ac5..f878fa8aaa 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -278,14 +278,16 @@ e_composer_private_constructed (EMsgComposer *composer)
priv->header_table = g_object_ref (widget);
gtk_widget_show (widget);
- header = e_composer_header_table_get_header (E_COMPOSER_HEADER_TABLE (widget),
+ header = e_composer_header_table_get_header (
+ E_COMPOSER_HEADER_TABLE (widget),
E_COMPOSER_HEADER_SUBJECT);
g_object_bind_property (
shell_settings, "composer-inline-spelling",
header->input_widget, "checking-enabled",
G_BINDING_SYNC_CREATE);
- g_signal_connect (G_OBJECT (composer), "spell-languages-changed",
+ g_signal_connect (
+ G_OBJECT (composer), "spell-languages-changed",
G_CALLBACK (composer_spell_languages_changed), NULL);
/* Construct the attachment paned. */
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index e6c6442c50..0fc5f2f475 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -854,8 +854,8 @@ composer_build_message_smime (AsyncContext *context,
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Cannot sign outgoing message: "
- "No signing certificate set for "
- "this account"));
+ "No signing certificate set for "
+ "this account"));
return FALSE;
}
@@ -863,8 +863,8 @@ composer_build_message_smime (AsyncContext *context,
g_set_error (
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Cannot encrypt outgoing message: "
- "No encryption certificate set for "
- "this account"));
+ "No encryption certificate set for "
+ "this account"));
return FALSE;
}
@@ -4026,8 +4026,9 @@ handle_mailto (EMsgComposer *composer,
subject = content;
content = NULL;
} else {
- subject = g_locale_to_utf8 (content, clen, &nread,
- &nwritten, NULL);
+ subject = g_locale_to_utf8 (
+ content, clen, &nread,
+ &nwritten, NULL);
if (subject) {
subject = g_realloc (subject, nwritten + 1);
subject[nwritten] = '\0';
@@ -4196,7 +4197,7 @@ e_msg_composer_set_body (EMsgComposer *composer,
buff = g_markup_printf_escaped (
"<b>%s</b>",
_("The composer contains a non-text "
- "message body, which cannot be edited."));
+ "message body, which cannot be edited."));
set_editor_text (composer, buff, FALSE);
g_free (buff);
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 38bcdfd6ef..8d47da2186 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -121,16 +121,22 @@ window_update_settings (WindowData *data)
return FALSE;
}
-static gboolean
-window_configure_event_cb (GtkWindow *window,
- GdkEventConfigure *event,
- WindowData *data)
+static void
+window_delayed_update_settings (WindowData *data)
{
if (data->timeout_id > 0)
g_source_remove (data->timeout_id);
data->timeout_id = g_timeout_add_seconds (
1, (GSourceFunc) window_update_settings, data);
+}
+
+static gboolean
+window_configure_event_cb (GtkWindow *window,
+ GdkEventConfigure *event,
+ WindowData *data)
+{
+ window_delayed_update_settings (data);
return FALSE;
}
@@ -165,7 +171,7 @@ window_state_event_cb (GtkWindow *window,
gtk_window_resize (window, width, height);
}
- window_configure_event_cb (window, NULL, data);
+ window_delayed_update_settings (data);
return FALSE;
}
diff --git a/filter/e-filter-color.c b/filter/e-filter-color.c
index 3b39cabbbf..e267489b09 100644
--- a/filter/e-filter-color.c
+++ b/filter/e-filter-color.c
@@ -60,7 +60,8 @@ filter_color_xml_encode (EFilterElement *element)
xmlNodePtr value;
gchar spec[16];
- g_snprintf (spec, sizeof (spec), "#%04x%04x%04x",
+ g_snprintf (
+ spec, sizeof (spec), "#%04x%04x%04x",
fc->color.red, fc->color.green, fc->color.blue);
value = xmlNewNode (NULL, (xmlChar *)"value");
@@ -124,7 +125,8 @@ filter_color_format_sexp (EFilterElement *element,
EFilterColor *fc = E_FILTER_COLOR (element);
gchar spec[16];
- g_snprintf (spec, sizeof (spec), "#%04x%04x%04x",
+ g_snprintf (
+ spec, sizeof (spec), "#%04x%04x%04x",
fc->color.red, fc->color.green, fc->color.blue);
camel_sexp_encode_string (out, spec);
}
diff --git a/filter/e-filter-datespec.c b/filter/e-filter-datespec.c
index 2464dd2bbf..8cf01d664f 100644
--- a/filter/e-filter-datespec.c
+++ b/filter/e-filter-datespec.c
@@ -286,11 +286,14 @@ button_clicked (GtkButton *button,
toplevel = e_builder_get_widget (builder, "filter_datespec");
dialog = (GtkDialog *) gtk_dialog_new ();
- gtk_window_set_title ((GtkWindow *) dialog, _("Select a time to compare against"));
- gtk_dialog_add_buttons (dialog,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ gtk_window_set_title (
+ GTK_WINDOW (dialog),
+ _("Select a time to compare against"));
+ gtk_dialog_add_buttons (
+ dialog,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
p->notebook_type = e_builder_get_widget (builder, "notebook_type");
p->combobox_type = e_builder_get_widget (builder, "combobox_type");
diff --git a/filter/e-filter-option.c b/filter/e-filter-option.c
index e11d384927..630ab31916 100644
--- a/filter/e-filter-option.c
+++ b/filter/e-filter-option.c
@@ -117,8 +117,9 @@ filter_option_generate_code (EFilterOption *option,
if (g_module_symbol (module, option->current->code_gen_func, (gpointer) &code_gen_func)) {
code_gen_func (E_FILTER_ELEMENT (option), out, part);
} else {
- g_warning ("optionlist dynamic code function '%s' not found",
- option->current->code_gen_func);
+ g_warning (
+ "optionlist dynamic code function '%s' not found",
+ option->current->code_gen_func);
}
g_module_close (module);
@@ -189,7 +190,8 @@ filter_option_xml_create (EFilterElement *element,
}
} else if (!strcmp ((gchar *) work->name, "code")) {
if (code || code_gen_func) {
- g_warning ("Element 'code' defined twice in '%s'",
+ g_warning (
+ "Element 'code' defined twice in '%s'",
element->name);
} else {
xmlChar *fn;
diff --git a/filter/e-filter-rule.c b/filter/e-filter-rule.c
index 4d27ab1ae0..548fe4cc87 100644
--- a/filter/e-filter-rule.c
+++ b/filter/e-filter-rule.c
@@ -214,16 +214,18 @@ attach_rule (GtkWidget *rule,
{
GtkWidget *remove;
- gtk_table_attach (GTK_TABLE (data->parts), rule, 0, 1, row, row + 1,
- GTK_EXPAND | GTK_FILL, 0, 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (data->parts), rule, 0, 1, row, row + 1,
+ GTK_EXPAND | GTK_FILL, 0, 0, 0);
remove = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
g_object_set_data ((GObject *) remove, "rule", rule);
g_signal_connect (
remove, "clicked",
G_CALLBACK (less_parts), data);
- gtk_table_attach (GTK_TABLE (data->parts), remove, 1, 2, row, row + 1,
- 0, 0, 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (data->parts), remove, 1, 2, row, row + 1,
+ 0, 0, 0, 0);
gtk_widget_show (remove);
}
@@ -660,7 +662,8 @@ ensure_scrolled_width_cb (GtkAdjustment *adj,
GParamSpec *param_spec,
GtkScrolledWindow *scrolled_window)
{
- gtk_scrolled_window_set_min_content_width (scrolled_window,
+ gtk_scrolled_window_set_min_content_width (
+ scrolled_window,
gtk_adjustment_get_upper (adj));
}
@@ -816,7 +819,8 @@ filter_rule_get_widget (EFilterRule *rule,
gtk_container_add (GTK_CONTAINER (vgrid), GTK_WIDGET (hgrid));
} else {
- text = g_strdup_printf ("<b>%s</b>",
+ text = g_strdup_printf (
+ "<b>%s</b>",
_("Find items that meet the following conditions"));
label = gtk_label_new (text);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c
index 0f41b52c04..714c37f1c9 100644
--- a/filter/e-rule-context.c
+++ b/filter/e-rule-context.c
@@ -812,10 +812,11 @@ e_rule_context_add_rule_gui (ERuleContext *context,
gtk_widget_show (widget);
dialog =(GtkDialog *) gtk_dialog_new ();
- gtk_dialog_add_buttons (dialog,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ gtk_dialog_add_buttons (
+ dialog,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
gtk_window_set_title ((GtkWindow *) dialog, title);
gtk_window_set_default_size ((GtkWindow *) dialog, 600, 400);
diff --git a/filter/e-rule-editor.c b/filter/e-rule-editor.c
index 58ffdc14cd..d3a92b3693 100644
--- a/filter/e-rule-editor.c
+++ b/filter/e-rule-editor.c
@@ -156,30 +156,44 @@ add_editor_response (GtkWidget *dialog,
}
if (e_rule_context_find_rule (editor->context, editor->edit->name, editor->edit->source)) {
- e_alert_run_dialog_for_args ((GtkWindow *) dialog,
- "filter:bad-name-notunique",
- editor->edit->name, NULL);
+ e_alert_run_dialog_for_args (
+ GTK_WINDOW (dialog),
+ "filter:bad-name-notunique",
+ editor->edit->name, NULL);
return;
}
g_object_ref (editor->edit);
gtk_list_store_append (editor->model, &iter);
- gtk_list_store_set (editor->model, &iter, 0, editor->edit->name, 1, editor->edit, 2, editor->edit->enabled, -1);
+ gtk_list_store_set (
+ editor->model, &iter,
+ 0, editor->edit->name,
+ 1, editor->edit,
+ 2, editor->edit->enabled, -1);
selection = gtk_tree_view_get_selection (editor->list);
gtk_tree_selection_select_iter (selection, &iter);
/* scroll to the newly added row */
- path = gtk_tree_model_get_path ((GtkTreeModel *) editor->model, &iter);
- gtk_tree_view_scroll_to_cell (editor->list, path, NULL, TRUE, 1.0, 0.0);
+ path = gtk_tree_model_get_path (
+ GTK_TREE_MODEL (editor->model), &iter);
+ gtk_tree_view_scroll_to_cell (
+ editor->list, path, NULL, TRUE, 1.0, 0.0);
gtk_tree_path_free (path);
editor->current = editor->edit;
e_rule_context_add_rule (editor->context, editor->current);
g_object_ref (editor->current);
- rule_editor_add_undo (editor, E_RULE_EDITOR_LOG_ADD, editor->current,
- e_rule_context_get_rank_rule (editor->context, editor->current, editor->current->source), 0);
+ rule_editor_add_undo (
+ editor,
+ E_RULE_EDITOR_LOG_ADD,
+ editor->current,
+ e_rule_context_get_rank_rule (
+ editor->context,
+ editor->current,
+ editor->current->source),
+ 0);
}
gtk_widget_destroy (dialog);
@@ -265,10 +279,11 @@ rule_add (GtkWidget *widget,
rules = e_filter_rule_get_widget (editor->edit, editor->context);
editor->dialog = gtk_dialog_new ();
- gtk_dialog_add_buttons ((GtkDialog *) editor->dialog,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ gtk_dialog_add_buttons (
+ GTK_DIALOG (editor->dialog),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
gtk_window_set_title ((GtkWindow *) editor->dialog, _("Add Rule"));
gtk_window_set_default_size (GTK_WINDOW (editor->dialog), 650, 400);
@@ -312,26 +327,39 @@ edit_editor_response (GtkWidget *dialog,
return;
}
- rule = e_rule_context_find_rule (editor->context, editor->edit->name, editor->edit->source);
- if (rule != NULL && rule != editor->current) {
- e_alert_run_dialog_for_args ((GtkWindow *) dialog,
- "filter:bad-name-notunique",
- rule->name, NULL);
+ rule = e_rule_context_find_rule (
+ editor->context,
+ editor->edit->name,
+ editor->edit->source);
+ if (rule != NULL && rule != editor->current) {
+ e_alert_run_dialog_for_args (
+ GTK_WINDOW (dialog),
+ "filter:bad-name-notunique",
+ rule->name, NULL);
return;
}
- pos = e_rule_context_get_rank_rule (editor->context, editor->current, editor->source);
+ pos = e_rule_context_get_rank_rule (
+ editor->context,
+ editor->current,
+ editor->source);
+
if (pos != -1) {
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, pos);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (editor->model), &iter, path);
+ gtk_tree_model_get_iter (
+ GTK_TREE_MODEL (editor->model), &iter, path);
gtk_tree_path_free (path);
- gtk_list_store_set (editor->model, &iter, 0, editor->edit->name, -1);
+ gtk_list_store_set (
+ editor->model, &iter,
+ 0, editor->edit->name, -1);
- rule_editor_add_undo (editor, E_RULE_EDITOR_LOG_EDIT, e_filter_rule_clone (editor->current),
- pos, 0);
+ rule_editor_add_undo (
+ editor, E_RULE_EDITOR_LOG_EDIT,
+ e_filter_rule_clone (editor->current),
+ pos, 0);
/* replace the old rule with the new rule */
e_filter_rule_copy (editor->current, editor->edit);
@@ -358,7 +386,8 @@ rule_edit (GtkWidget *widget,
rules = e_filter_rule_get_widget (editor->edit, editor->context);
editor->dialog = gtk_dialog_new ();
- gtk_dialog_add_buttons ((GtkDialog *) editor->dialog,
+ gtk_dialog_add_buttons (
+ (GtkDialog *) editor->dialog,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
@@ -412,8 +441,15 @@ rule_delete (GtkWidget *widget,
gtk_list_store_remove (editor->model, &iter);
gtk_tree_path_free (path);
- rule_editor_add_undo (editor, E_RULE_EDITOR_LOG_REMOVE, delete_rule,
- e_rule_context_get_rank_rule (editor->context, delete_rule, delete_rule->source), 0);
+ rule_editor_add_undo (
+ editor,
+ E_RULE_EDITOR_LOG_REMOVE,
+ delete_rule,
+ e_rule_context_get_rank_rule (
+ editor->context,
+ delete_rule,
+ delete_rule->source),
+ 0);
#if 0
g_object_unref (delete_rule);
#endif
@@ -876,8 +912,9 @@ e_rule_editor_construct (ERuleEditor *editor,
G_CALLBACK (editor_response), editor);
rule_editor_set_source (editor, source);
- gtk_dialog_add_buttons ((GtkDialog *) editor,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
+ gtk_dialog_add_buttons (
+ GTK_DIALOG (editor),
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OK, GTK_RESPONSE_OK,
+ NULL);
}
diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c
index 6720ad42eb..89d8078702 100644
--- a/libgnomecanvas/gnome-canvas-text.c
+++ b/libgnomecanvas/gnome-canvas-text.c
@@ -148,305 +148,420 @@ gnome_canvas_text_class_init (GnomeCanvasTextClass *class)
gobject_class->get_property = gnome_canvas_text_get_property;
/* Text */
- g_object_class_install_property
- (gobject_class,
- PROP_TEXT,
- g_param_spec_string ("text",
- "Text",
- "Text to render",
- NULL,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
- g_object_class_install_property
- (gobject_class,
- PROP_MARKUP,
- g_param_spec_string ("markup",
- "Markup",
- "Marked up text to render",
- NULL,
- (G_PARAM_WRITABLE)));
+ g_object_class_install_property (
+ gobject_class,
+ PROP_TEXT,
+ g_param_spec_string (
+ "text",
+ "Text",
+ "Text to render",
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_MARKUP,
+ g_param_spec_string (
+ "markup",
+ "Markup",
+ "Marked up text to render",
+ NULL,
+ G_PARAM_WRITABLE));
/* Position */
- g_object_class_install_property
- (gobject_class,
- PROP_X,
- g_param_spec_double ("x", NULL, NULL,
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
- g_object_class_install_property
- (gobject_class,
- PROP_Y,
- g_param_spec_double ("y", NULL, NULL,
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+ g_object_class_install_property (
+ gobject_class,
+ PROP_X,
+ g_param_spec_double (
+ "x",
+ NULL,
+ NULL,
+ -G_MAXDOUBLE,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_Y,
+ g_param_spec_double (
+ "y",
+ NULL,
+ NULL,
+ -G_MAXDOUBLE,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
/* Font */
- g_object_class_install_property
- (gobject_class,
- PROP_FONT,
- g_param_spec_string ("font",
- "Font",
- "Font description as a string",
- NULL,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
- g_object_class_install_property
- (gobject_class,
- PROP_FONT_DESC,
- g_param_spec_boxed ("font_desc",
- "Font description",
- "Font description as a PangoFontDescription struct",
- PANGO_TYPE_FONT_DESCRIPTION,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
- g_object_class_install_property
- (gobject_class,
- PROP_FAMILY,
- g_param_spec_string ("family",
- "Font family",
- "Name of the font family, e.g. "
- "Sans, Helvetica, Times, Monospace",
- NULL,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+ g_object_class_install_property (
+ gobject_class,
+ PROP_FONT,
+ g_param_spec_string (
+ "font",
+ "Font",
+ "Font description as a string",
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_FONT_DESC,
+ g_param_spec_boxed (
+ "font_desc",
+ "Font description",
+ "Font description as a PangoFontDescription struct",
+ PANGO_TYPE_FONT_DESCRIPTION,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_FAMILY,
+ g_param_spec_string (
+ "family",
+ "Font family",
+ "Name of the font family, e.g. "
+ "Sans, Helvetica, Times, Monospace",
+ NULL,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
/* Style */
- g_object_class_install_property
- (gobject_class,
- PROP_ATTRIBUTES,
- g_param_spec_boxed ("attributes", NULL, NULL,
- PANGO_TYPE_ATTR_LIST,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
- g_object_class_install_property
- (gobject_class,
- PROP_STYLE,
- g_param_spec_enum ("style",
- "Font style",
- "Font style",
- PANGO_TYPE_STYLE,
- PANGO_STYLE_NORMAL,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
- PROP_VARIANT,
- g_param_spec_enum ("variant",
- "Font variant",
- "Font variant",
- PANGO_TYPE_VARIANT,
- PANGO_VARIANT_NORMAL,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
- PROP_WEIGHT,
- g_param_spec_int ("weight",
- "Font weight",
- "Font weight",
- 0,
- G_MAXINT,
- PANGO_WEIGHT_NORMAL,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
- PROP_STRETCH,
- g_param_spec_enum ("stretch",
- "Font stretch",
- "Font stretch",
- PANGO_TYPE_STRETCH,
- PANGO_STRETCH_NORMAL,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
- PROP_SIZE,
- g_param_spec_int ("size",
- "Font size",
- "Font size (as a multiple of PANGO_SCALE, "
- "eg. 12*PANGO_SCALE for a 12pt font size)",
- 0,
- G_MAXINT,
- 0,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
+ g_object_class_install_property (
+ gobject_class,
+ PROP_ATTRIBUTES,
+ g_param_spec_boxed (
+ "attributes",
+ NULL,
+ NULL,
+ PANGO_TYPE_ATTR_LIST,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_STYLE,
+ g_param_spec_enum (
+ "style",
+ "Font style",
+ "Font style",
+ PANGO_TYPE_STYLE,
+ PANGO_STYLE_NORMAL,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_VARIANT,
+ g_param_spec_enum (
+ "variant",
+ "Font variant",
+ "Font variant",
+ PANGO_TYPE_VARIANT,
+ PANGO_VARIANT_NORMAL,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_WEIGHT,
+ g_param_spec_int (
+ "weight",
+ "Font weight",
+ "Font weight",
+ 0,
+ G_MAXINT,
+ PANGO_WEIGHT_NORMAL,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_STRETCH,
+ g_param_spec_enum (
+ "stretch",
+ "Font stretch",
+ "Font stretch",
+ PANGO_TYPE_STRETCH,
+ PANGO_STRETCH_NORMAL,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_SIZE,
+ g_param_spec_int (
+ "size",
+ "Font size",
+ "Font size (as a multiple of PANGO_SCALE, "
+ "eg. 12*PANGO_SCALE for a 12pt font size)",
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
PROP_SIZE_POINTS,
- g_param_spec_double ("size_points",
- "Font points",
- "Font size in points (eg. 12 for a 12pt font size)",
- 0.0,
- G_MAXDOUBLE,
- 0.0,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
- PROP_RISE,
- g_param_spec_int ("rise",
- "Rise",
- "Offset of text above the baseline "
- "(below the baseline if rise is negative)",
- -G_MAXINT,
- G_MAXINT,
- 0,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
- PROP_STRIKETHROUGH,
- g_param_spec_boolean ("strikethrough",
- "Strikethrough",
- "Whether to strike through the text",
- FALSE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
- PROP_UNDERLINE,
- g_param_spec_enum ("underline",
- "Underline",
- "Style of underline for this text",
- PANGO_TYPE_UNDERLINE,
- PANGO_UNDERLINE_NONE,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
- PROP_SCALE,
- g_param_spec_double ("scale",
- "Scale",
- "Size of font, relative to default size",
- 0.0,
- G_MAXDOUBLE,
- 1.0,
- G_PARAM_READABLE | G_PARAM_WRITABLE));
-
- g_object_class_install_property
- (gobject_class,
- PROP_JUSTIFICATION,
- g_param_spec_enum ("justification", NULL, NULL,
- GTK_TYPE_JUSTIFICATION,
- GTK_JUSTIFY_LEFT,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
- g_object_class_install_property
- (gobject_class,
- PROP_CLIP_WIDTH,
- g_param_spec_double ("clip_width", NULL, NULL,
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
- g_object_class_install_property
- (gobject_class,
- PROP_CLIP_HEIGHT,
- g_param_spec_double ("clip_height", NULL, NULL,
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
- g_object_class_install_property
- (gobject_class,
- PROP_CLIP,
- g_param_spec_boolean ("clip", NULL, NULL,
- FALSE,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
- g_object_class_install_property
- (gobject_class,
- PROP_X_OFFSET,
- g_param_spec_double ("x_offset", NULL, NULL,
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
- g_object_class_install_property
- (gobject_class,
- PROP_Y_OFFSET,
- g_param_spec_double ("y_offset", NULL, NULL,
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
- g_object_class_install_property
- (gobject_class,
- PROP_FILL_COLOR,
- g_param_spec_string ("fill_color",
- "Color",
- "Text color, as string",
- NULL,
- G_PARAM_WRITABLE));
- g_object_class_install_property
- (gobject_class,
- PROP_FILL_COLOR_GDK,
- g_param_spec_boxed ("fill_color_gdk",
- "Color",
- "Text color, as a GdkColor",
- GDK_TYPE_COLOR,
- G_PARAM_WRITABLE));
- g_object_class_install_property
- (gobject_class,
- PROP_FILL_COLOR_RGBA,
- g_param_spec_uint ("fill_color_rgba",
- "Color",
- "Text color, as an R/G/B/A combined integer",
- 0, G_MAXUINT, 0,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
- g_object_class_install_property
- (gobject_class,
- PROP_TEXT_WIDTH,
- g_param_spec_double ("text_width",
- "Text width",
- "Width of the rendered text",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
- g_object_class_install_property
- (gobject_class,
- PROP_TEXT_HEIGHT,
- g_param_spec_double ("text_height",
- "Text height",
- "Height of the rendered text",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
+ g_param_spec_double (
+ "size_points",
+ "Font points",
+ "Font size in points (eg. 12 for a 12pt font size)",
+ 0.0,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_RISE,
+ g_param_spec_int (
+ "rise",
+ "Rise",
+ "Offset of text above the baseline "
+ "(below the baseline if rise is negative)",
+ -G_MAXINT,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_STRIKETHROUGH,
+ g_param_spec_boolean (
+ "strikethrough",
+ "Strikethrough",
+ "Whether to strike through the text",
+ FALSE,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_UNDERLINE,
+ g_param_spec_enum (
+ "underline",
+ "Underline",
+ "Style of underline for this text",
+ PANGO_TYPE_UNDERLINE,
+ PANGO_UNDERLINE_NONE,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_SCALE,
+ g_param_spec_double (
+ "scale",
+ "Scale",
+ "Size of font, relative to default size",
+ 0.0,
+ G_MAXDOUBLE,
+ 1.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_JUSTIFICATION,
+ g_param_spec_enum (
+ "justification",
+ NULL,
+ NULL,
+ GTK_TYPE_JUSTIFICATION,
+ GTK_JUSTIFY_LEFT,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_CLIP_WIDTH,
+ g_param_spec_double (
+ "clip_width",
+ NULL,
+ NULL,
+ -G_MAXDOUBLE,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_CLIP_HEIGHT,
+ g_param_spec_double (
+ "clip_height",
+ NULL,
+ NULL,
+ -G_MAXDOUBLE,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_CLIP,
+ g_param_spec_boolean (
+ "clip",
+ NULL,
+ NULL,
+ FALSE,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_X_OFFSET,
+ g_param_spec_double (
+ "x_offset",
+ NULL,
+ NULL,
+ -G_MAXDOUBLE,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_Y_OFFSET,
+ g_param_spec_double (
+ "y_offset",
+ NULL,
+ NULL,
+ -G_MAXDOUBLE,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_FILL_COLOR,
+ g_param_spec_string (
+ "fill_color",
+ "Color",
+ "Text color, as string",
+ NULL,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_FILL_COLOR_GDK,
+ g_param_spec_boxed (
+ "fill_color_gdk",
+ "Color",
+ "Text color, as a GdkColor",
+ GDK_TYPE_COLOR,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_FILL_COLOR_RGBA,
+ g_param_spec_uint (
+ "fill_color_rgba",
+ "Color",
+ "Text color, as an R/G/B/A combined integer",
+ 0, G_MAXUINT, 0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_TEXT_WIDTH,
+ g_param_spec_double (
+ "text_width",
+ "Text width",
+ "Width of the rendered text",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (
+ gobject_class,
+ PROP_TEXT_HEIGHT,
+ g_param_spec_double (
+ "text_height",
+ "Text height",
+ "Height of the rendered text",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READABLE));
/* Style props are set (explicitly applied) or not */
#define ADD_SET_PROP(propname, propval, nick, blurb) \
g_object_class_install_property ( \
- gobject_class, propval, g_param_spec_boolean ( \
- propname, nick, blurb, FALSE, G_PARAM_READABLE | G_PARAM_WRITABLE))
-
- ADD_SET_PROP ("family_set", PROP_FAMILY_SET,
- "Font family set",
- "Whether this tag affects the font family");
-
- ADD_SET_PROP ("style_set", PROP_STYLE_SET,
- "Font style set",
- "Whether this tag affects the font style");
-
- ADD_SET_PROP ("variant_set", PROP_VARIANT_SET,
- "Font variant set",
- "Whether this tag affects the font variant");
-
- ADD_SET_PROP ("weight_set", PROP_WEIGHT_SET,
- "Font weight set",
- "Whether this tag affects the font weight");
-
- ADD_SET_PROP ("stretch_set", PROP_STRETCH_SET,
- "Font stretch set",
- "Whether this tag affects the font stretch");
-
- ADD_SET_PROP ("size_set", PROP_SIZE_SET,
- "Font size set",
- "Whether this tag affects the font size");
-
- ADD_SET_PROP ("rise_set", PROP_RISE_SET,
- "Rise set",
- "Whether this tag affects the rise");
-
- ADD_SET_PROP ("strikethrough_set", PROP_STRIKETHROUGH_SET,
- "Strikethrough set",
- "Whether this tag affects strikethrough");
-
- ADD_SET_PROP ("underline_set", PROP_UNDERLINE_SET,
- "Underline set",
- "Whether this tag affects underlining");
-
- ADD_SET_PROP ("scale_set", PROP_SCALE_SET,
- "Scale set",
- "Whether this tag affects font scaling");
+ gobject_class, propval, \
+ g_param_spec_boolean ( \
+ propname, nick, blurb, FALSE, \
+ G_PARAM_READABLE | G_PARAM_WRITABLE))
+
+ ADD_SET_PROP (
+ "family_set",
+ PROP_FAMILY_SET,
+ "Font family set",
+ "Whether this tag affects the font family");
+
+ ADD_SET_PROP (
+ "style_set",
+ PROP_STYLE_SET,
+ "Font style set",
+ "Whether this tag affects the font style");
+
+ ADD_SET_PROP (
+ "variant_set",
+ PROP_VARIANT_SET,
+ "Font variant set",
+ "Whether this tag affects the font variant");
+
+ ADD_SET_PROP (
+ "weight_set",
+ PROP_WEIGHT_SET,
+ "Font weight set",
+ "Whether this tag affects the font weight");
+
+ ADD_SET_PROP (
+ "stretch_set",
+ PROP_STRETCH_SET,
+ "Font stretch set",
+ "Whether this tag affects the font stretch");
+
+ ADD_SET_PROP (
+ "size_set",
+ PROP_SIZE_SET,
+ "Font size set",
+ "Whether this tag affects the font size");
+
+ ADD_SET_PROP (
+ "rise_set",
+ PROP_RISE_SET,
+ "Rise set",
+ "Whether this tag affects the rise");
+
+ ADD_SET_PROP (
+ "strikethrough_set",
+ PROP_STRIKETHROUGH_SET,
+ "Strikethrough set",
+ "Whether this tag affects strikethrough");
+
+ ADD_SET_PROP (
+ "underline_set",
+ PROP_UNDERLINE_SET,
+ "Underline set",
+ "Whether this tag affects underlining");
+
+ ADD_SET_PROP (
+ "scale_set",
+ PROP_SCALE_SET,
+ "Scale set",
+ "Whether this tag affects font scaling");
#undef ADD_SET_PROP
item_class->dispose = gnome_canvas_text_dispose;
@@ -557,23 +672,22 @@ get_bounds (GnomeCanvasText *text,
static PangoFontMask
get_property_font_set_mask (guint property_id)
{
- switch (property_id)
- {
- case PROP_FAMILY_SET:
- return PANGO_FONT_MASK_FAMILY;
- case PROP_STYLE_SET:
- return PANGO_FONT_MASK_STYLE;
- case PROP_VARIANT_SET:
- return PANGO_FONT_MASK_VARIANT;
- case PROP_WEIGHT_SET:
- return PANGO_FONT_MASK_WEIGHT;
- case PROP_STRETCH_SET:
- return PANGO_FONT_MASK_STRETCH;
- case PROP_SIZE_SET:
- return PANGO_FONT_MASK_SIZE;
- }
-
- return 0;
+ switch (property_id) {
+ case PROP_FAMILY_SET:
+ return PANGO_FONT_MASK_FAMILY;
+ case PROP_STYLE_SET:
+ return PANGO_FONT_MASK_STYLE;
+ case PROP_VARIANT_SET:
+ return PANGO_FONT_MASK_VARIANT;
+ case PROP_WEIGHT_SET:
+ return PANGO_FONT_MASK_WEIGHT;
+ case PROP_STRETCH_SET:
+ return PANGO_FONT_MASK_STRETCH;
+ case PROP_SIZE_SET:
+ return PANGO_FONT_MASK_SIZE;
+ }
+
+ return 0;
}
static void
@@ -616,8 +730,8 @@ gnome_canvas_text_set_property (GObject *object,
break;
case PROP_MARKUP:
- gnome_canvas_text_set_markup (text,
- g_value_get_string (value));
+ gnome_canvas_text_set_markup (
+ text, g_value_get_string (value));
break;
case PROP_X:
@@ -660,33 +774,40 @@ gnome_canvas_text_set_property (GObject *object,
switch (param_id) {
case PROP_FAMILY:
- pango_font_description_set_family (text->font_desc,
- g_value_get_string (value));
+ pango_font_description_set_family (
+ text->font_desc,
+ g_value_get_string (value));
break;
case PROP_STYLE:
- pango_font_description_set_style (text->font_desc,
- g_value_get_enum (value));
+ pango_font_description_set_style (
+ text->font_desc,
+ g_value_get_enum (value));
break;
case PROP_VARIANT:
- pango_font_description_set_variant (text->font_desc,
- g_value_get_enum (value));
+ pango_font_description_set_variant (
+ text->font_desc,
+ g_value_get_enum (value));
break;
case PROP_WEIGHT:
- pango_font_description_set_weight (text->font_desc,
- g_value_get_int (value));
+ pango_font_description_set_weight (
+ text->font_desc,
+ g_value_get_int (value));
break;
case PROP_STRETCH:
- pango_font_description_set_stretch (text->font_desc,
- g_value_get_enum (value));
+ pango_font_description_set_stretch (
+ text->font_desc,
+ g_value_get_enum (value));
break;
case PROP_SIZE:
/* FIXME: This is bogus! It should be pixels, not points/PANGO_SCALE! */
- pango_font_description_set_size (text->font_desc,
- g_value_get_int (value));
+ pango_font_description_set_size (
+ text->font_desc,
+ g_value_get_int (value));
break;
case PROP_SIZE_POINTS:
- pango_font_description_set_size (text->font_desc,
- g_value_get_double (value) * PANGO_SCALE);
+ pango_font_description_set_size (
+ text->font_desc,
+ g_value_get_double (value) * PANGO_SCALE);
break;
}
@@ -700,8 +821,9 @@ gnome_canvas_text_set_property (GObject *object,
case PROP_STRETCH_SET:
case PROP_SIZE_SET:
if (!g_value_get_boolean (value) && text->font_desc)
- pango_font_description_unset_fields (text->font_desc,
- get_property_font_set_mask (param_id));
+ pango_font_description_unset_fields (
+ text->font_desc,
+ get_property_font_set_mask (param_id));
break;
case PROP_SCALE:
@@ -847,9 +969,10 @@ gnome_canvas_text_set_property (GObject *object,
/* Calculate text dimensions */
if (text->layout)
- pango_layout_get_pixel_size (text->layout,
- &text->max_width,
- &text->height);
+ pango_layout_get_pixel_size (
+ text->layout,
+ &text->max_width,
+ &text->height);
else {
text->max_width = 0;
text->height = 0;
@@ -1170,9 +1293,10 @@ gnome_canvas_text_update (GnomeCanvasItem *item,
get_bounds (text, &x1, &y1, &x2, &y2);
- gnome_canvas_update_bbox (item,
- floor (x1), floor (y1),
- ceil (x2), ceil (y2));
+ gnome_canvas_update_bbox (
+ item,
+ floor (x1), floor (y1),
+ ceil (x2), ceil (y2));
}
/* Draw handler for the text item */
@@ -1192,19 +1316,21 @@ gnome_canvas_text_draw (GnomeCanvasItem *item,
cairo_save (cr);
if (text->clip) {
- cairo_rectangle (cr,
- text->clip_cx - x,
- text->clip_cy - y,
- text->clip_cwidth,
- text->clip_cheight);
+ cairo_rectangle (
+ cr,
+ text->clip_cx - x,
+ text->clip_cy - y,
+ text->clip_cwidth,
+ text->clip_cheight);
cairo_clip (cr);
}
- cairo_set_source_rgba (cr,
- ((text->rgba >> 24) & 0xff) / 255.0,
- ((text->rgba >> 16) & 0xff) / 255.0,
- ((text->rgba >> 8) & 0xff) / 255.0,
- ( text->rgba & 0xff) / 255.0);
+ cairo_set_source_rgba (
+ cr,
+ ((text->rgba >> 24) & 0xff) / 255.0,
+ ((text->rgba >> 16) & 0xff) / 255.0,
+ ((text->rgba >> 8) & 0xff) / 255.0,
+ ( text->rgba & 0xff) / 255.0);
cairo_move_to (cr, text->cx - x, text->cy - y);
pango_cairo_show_layout (cr, text->layout);
diff --git a/libgnomecanvas/gnome-canvas-widget.c b/libgnomecanvas/gnome-canvas-widget.c
index 7632bb0ddf..f47c32332b 100644
--- a/libgnomecanvas/gnome-canvas-widget.c
+++ b/libgnomecanvas/gnome-canvas-widget.c
@@ -211,9 +211,10 @@ recalc_bounds (GnomeCanvasWidget *witem)
item->y2 = witem->cy + witem->cheight;
if (witem->widget)
- gtk_layout_move (GTK_LAYOUT (item->canvas), witem->widget,
- witem->cx + item->canvas->zoom_xofs,
- witem->cy + item->canvas->zoom_yofs);
+ gtk_layout_move (
+ GTK_LAYOUT (item->canvas), witem->widget,
+ witem->cx + item->canvas->zoom_xofs,
+ witem->cy + item->canvas->zoom_yofs);
}
static void
@@ -248,9 +249,10 @@ gnome_canvas_widget_set_property (GObject *object,
if (obj) {
witem->widget = GTK_WIDGET (obj);
g_object_weak_ref (obj, do_destroy, witem);
- gtk_layout_put (GTK_LAYOUT (item->canvas), witem->widget,
- witem->cx + item->canvas->zoom_xofs,
- witem->cy + item->canvas->zoom_yofs);
+ gtk_layout_put (
+ GTK_LAYOUT (item->canvas), witem->widget,
+ witem->cx + item->canvas->zoom_xofs,
+ witem->cy + item->canvas->zoom_yofs);
}
update = TRUE;
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 24d44e0af9..2b1c61e000 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -854,12 +854,9 @@ gnome_canvas_item_grab (GnomeCanvasItem *item,
layout = GTK_LAYOUT (item->canvas);
bin_window = gtk_layout_get_bin_window (layout);
- retval = gdk_pointer_grab (bin_window,
- FALSE,
- event_mask,
- NULL,
- cursor,
- etime);
+ retval = gdk_pointer_grab (
+ bin_window, FALSE, event_mask,
+ NULL, cursor, etime);
if (retval != GDK_GRAB_SUCCESS)
return retval;
@@ -1225,20 +1222,31 @@ gnome_canvas_group_class_init (GnomeCanvasGroupClass *class)
object_class->set_property = gnome_canvas_group_set_property;
object_class->get_property = gnome_canvas_group_get_property;
- g_object_class_install_property
- (object_class, GROUP_PROP_X,
- g_param_spec_double ("x",
- "X",
- "X",
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
- g_object_class_install_property
- (object_class, GROUP_PROP_Y,
- g_param_spec_double ("y",
- "Y",
- "Y",
- -G_MAXDOUBLE, G_MAXDOUBLE, 0.0,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
+ g_object_class_install_property (
+ object_class,
+ GROUP_PROP_X,
+ g_param_spec_double (
+ "x",
+ "X",
+ "X",
+ -G_MAXDOUBLE,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ GROUP_PROP_Y,
+ g_param_spec_double (
+ "y",
+ "Y",
+ "Y",
+ -G_MAXDOUBLE,
+ G_MAXDOUBLE,
+ 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
item_class->dispose = gnome_canvas_group_dispose;
item_class->update = gnome_canvas_group_update;
@@ -1827,19 +1835,29 @@ gnome_canvas_class_init (GnomeCanvasClass *class)
class->draw_background = gnome_canvas_draw_background;
class->request_update = gnome_canvas_request_update_real;
- g_object_class_install_property (object_class, PROP_FOCUSED_ITEM,
- g_param_spec_object ("focused_item", NULL, NULL,
- GNOME_TYPE_CANVAS_ITEM,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
- canvas_signals[DRAW_BACKGROUND] =
- g_signal_new ("draw_background",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GnomeCanvasClass, draw_background),
- NULL, NULL, NULL,
- G_TYPE_NONE, 5, CAIRO_GOBJECT_TYPE_CONTEXT,
- G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
+ g_object_class_install_property (
+ object_class,
+ PROP_FOCUSED_ITEM,
+ g_param_spec_object (
+ "focused_item",
+ NULL,
+ NULL,
+ GNOME_TYPE_CANVAS_ITEM,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ canvas_signals[DRAW_BACKGROUND] = g_signal_new (
+ "draw_background",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GnomeCanvasClass, draw_background),
+ NULL, NULL, NULL,
+ G_TYPE_NONE, 5,
+ CAIRO_GOBJECT_TYPE_CONTEXT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT);
gail_canvas_init ();
}
@@ -2018,18 +2036,19 @@ gnome_canvas_realize (GtkWidget *widget)
layout = GTK_LAYOUT (canvas);
bin_window = gtk_layout_get_bin_window (layout);
- gdk_window_set_events (bin_window,
- (gdk_window_get_events (bin_window)
- | GDK_EXPOSURE_MASK
- | GDK_SCROLL_MASK
- | GDK_BUTTON_PRESS_MASK
- | GDK_BUTTON_RELEASE_MASK
- | GDK_POINTER_MOTION_MASK
- | GDK_KEY_PRESS_MASK
- | GDK_KEY_RELEASE_MASK
- | GDK_ENTER_NOTIFY_MASK
- | GDK_LEAVE_NOTIFY_MASK
- | GDK_FOCUS_CHANGE_MASK));
+ gdk_window_set_events (
+ bin_window,
+ (gdk_window_get_events (bin_window)
+ | GDK_EXPOSURE_MASK
+ | GDK_SCROLL_MASK
+ | GDK_BUTTON_PRESS_MASK
+ | GDK_BUTTON_RELEASE_MASK
+ | GDK_POINTER_MOTION_MASK
+ | GDK_KEY_PRESS_MASK
+ | GDK_KEY_RELEASE_MASK
+ | GDK_ENTER_NOTIFY_MASK
+ | GDK_LEAVE_NOTIFY_MASK
+ | GDK_FOCUS_CHANGE_MASK));
/* Create our own temporary pixmap gc and realize all the items */
@@ -2181,9 +2200,10 @@ gnome_canvas_size_allocate (GtkWidget *widget,
gtk_adjustment_set_page_size (vadjustment, allocation->height);
gtk_adjustment_set_page_increment (vadjustment, allocation->height / 2);
- scroll_to (GNOME_CANVAS (widget),
- gtk_adjustment_get_value (hadjustment),
- gtk_adjustment_get_value (vadjustment));
+ scroll_to (
+ GNOME_CANVAS (widget),
+ gtk_adjustment_get_value (hadjustment),
+ gtk_adjustment_get_value (vadjustment));
g_object_thaw_notify (G_OBJECT (hadjustment));
g_object_thaw_notify (G_OBJECT (vadjustment));
@@ -2222,18 +2242,20 @@ gnome_canvas_draw (GtkWidget *widget,
}
cairo_save (cr);
- cairo_translate (cr,
- -canvas->zoom_xofs + rect.x,
- -canvas->zoom_yofs + rect.y);
+ cairo_translate (
+ cr,
+ -canvas->zoom_xofs + rect.x,
+ -canvas->zoom_yofs + rect.y);
rect.x += hadjustment_value;
rect.y += vadjustment_value;
/* No pending updates, draw exposed area immediately */
- gnome_canvas_paint_rect (canvas, cr,
- rect.x, rect.y,
- rect.x + rect.width,
- rect.y + rect.height);
+ gnome_canvas_paint_rect (
+ canvas, cr,
+ rect.x, rect.y,
+ rect.x + rect.width,
+ rect.y + rect.height);
cairo_restore (cr);
/* And call expose on parent container class */
@@ -2322,9 +2344,10 @@ emit_event (GnomeCanvas *canvas,
{
case GDK_ENTER_NOTIFY:
case GDK_LEAVE_NOTIFY:
- gnome_canvas_window_to_world (canvas,
- ev->crossing.x, ev->crossing.y,
- &ev->crossing.x, &ev->crossing.y);
+ gnome_canvas_window_to_world (
+ canvas,
+ ev->crossing.x, ev->crossing.y,
+ &ev->crossing.x, &ev->crossing.y);
break;
case GDK_MOTION_NOTIFY:
@@ -2332,9 +2355,10 @@ emit_event (GnomeCanvas *canvas,
case GDK_2BUTTON_PRESS:
case GDK_3BUTTON_PRESS:
case GDK_BUTTON_RELEASE:
- gnome_canvas_window_to_world (canvas,
- ev->motion.x, ev->motion.y,
- &ev->motion.x, &ev->motion.y);
+ gnome_canvas_window_to_world (
+ canvas,
+ ev->motion.x, ev->motion.y,
+ &ev->motion.x, &ev->motion.y);
break;
default:
@@ -2361,8 +2385,9 @@ emit_event (GnomeCanvas *canvas,
while (item && !finished) {
g_object_ref (G_OBJECT (item));
- g_signal_emit (item, item_signals[ITEM_EVENT], 0,
- ev, &finished);
+ g_signal_emit (
+ item, item_signals[ITEM_EVENT], 0,
+ ev, &finished);
parent = item->parent;
g_object_unref (G_OBJECT (item));
@@ -2805,10 +2830,11 @@ add_idle (GnomeCanvas *canvas)
g_return_if_fail (canvas->need_update);
if (!canvas->idle_id)
- canvas->idle_id = g_idle_add_full (CANVAS_IDLE_PRIORITY,
- idle_handler,
- canvas,
- NULL);
+ canvas->idle_id = g_idle_add_full (
+ CANVAS_IDLE_PRIORITY,
+ idle_handler,
+ canvas,
+ NULL);
/* canvas->idle_id = gtk_idle_add (idle_handler, canvas); */
}
@@ -2870,12 +2896,11 @@ gnome_canvas_set_scroll_region (GnomeCanvas *canvas,
* visible contents of the canvas.
*/
- gnome_canvas_c2w (canvas,
- hadjustment_value + canvas->zoom_xofs,
- vadjustment_value + canvas->zoom_yofs,
- /*canvas->zoom_xofs,
- canvas->zoom_yofs,*/
- &wxofs, &wyofs);
+ gnome_canvas_c2w (
+ canvas,
+ hadjustment_value + canvas->zoom_xofs,
+ vadjustment_value + canvas->zoom_yofs,
+ &wxofs, &wyofs);
canvas->scroll_x1 = x1;
canvas->scroll_y1 = y1;
@@ -3084,8 +3109,9 @@ gnome_canvas_request_redraw (GnomeCanvas *canvas,
if (!gdk_rectangle_intersect (&area, &clip, &area))
return;
- gdk_window_invalidate_rect (gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
- &area, FALSE);
+ gdk_window_invalidate_rect (
+ gtk_layout_get_bin_window (GTK_LAYOUT (canvas)),
+ &area, FALSE);
}
/**
@@ -3302,20 +3328,25 @@ gnome_canvas_item_class_init (GnomeCanvasItemClass *class)
gobject_class->set_property = gnome_canvas_item_set_property;
gobject_class->get_property = gnome_canvas_item_get_property;
- g_object_class_install_property
- (gobject_class, ITEM_PROP_PARENT,
- g_param_spec_object ("parent", NULL, NULL,
- GNOME_TYPE_CANVAS_ITEM,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
- item_signals[ITEM_EVENT] =
- g_signal_new ("event",
- G_TYPE_FROM_CLASS (class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GnomeCanvasItemClass, event),
- boolean_handled_accumulator, NULL, NULL,
- G_TYPE_BOOLEAN, 1,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+ g_object_class_install_property (
+ gobject_class,
+ ITEM_PROP_PARENT,
+ g_param_spec_object (
+ "parent",
+ NULL,
+ NULL,
+ GNOME_TYPE_CANVAS_ITEM,
+ G_PARAM_READABLE |
+ G_PARAM_WRITABLE));
+
+ item_signals[ITEM_EVENT] = g_signal_new (
+ "event",
+ G_TYPE_FROM_CLASS (class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GnomeCanvasItemClass, event),
+ boolean_handled_accumulator, NULL, NULL,
+ G_TYPE_BOOLEAN, 1,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
gobject_class->dispose = gnome_canvas_item_dispose;
diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c
index ae6aebba9a..5eb408105b 100644
--- a/mail/e-mail-backend.c
+++ b/mail/e-mail-backend.c
@@ -562,6 +562,7 @@ mail_backend_folder_renamed_cb (MailFolderCache *folder_cache,
ESource *source = E_SOURCE (link->data);
ESourceExtension *extension;
const gchar *drafts_folder_uri;
+ gboolean need_update;
extension = e_source_get_extension (source, extension_name);
@@ -569,7 +570,11 @@ mail_backend_folder_renamed_cb (MailFolderCache *folder_cache,
e_source_mail_composition_get_drafts_folder (
E_SOURCE_MAIL_COMPOSITION (extension));
- if (class->equal_folder_name (drafts_folder_uri, old_uri)) {
+ need_update =
+ (drafts_folder_uri != NULL) &&
+ class->equal_folder_name (drafts_folder_uri, old_uri);
+
+ if (need_update) {
GError *error = NULL;
e_source_mail_composition_set_drafts_folder (
@@ -593,6 +598,7 @@ mail_backend_folder_renamed_cb (MailFolderCache *folder_cache,
ESource *source = E_SOURCE (link->data);
ESourceExtension *extension;
const gchar *sent_folder_uri;
+ gboolean need_update;
extension = e_source_get_extension (source, extension_name);
@@ -600,7 +606,11 @@ mail_backend_folder_renamed_cb (MailFolderCache *folder_cache,
e_source_mail_submission_get_sent_folder (
E_SOURCE_MAIL_SUBMISSION (extension));
- if (sent_folder_uri && class->equal_folder_name (sent_folder_uri, old_uri)) {
+ need_update =
+ (sent_folder_uri != NULL) &&
+ class->equal_folder_name (sent_folder_uri, old_uri);
+
+ if (need_update) {
GError *error = NULL;
e_source_mail_submission_set_sent_folder (
diff --git a/widgets/misc/e-source-config.c b/widgets/misc/e-source-config.c
index 16c3c05f64..8e37836cc9 100644
--- a/widgets/misc/e-source-config.c
+++ b/widgets/misc/e-source-config.c
@@ -56,6 +56,7 @@ struct _Candidate {
GtkWidget *page;
ESource *scratch_source;
ESourceConfigBackend *backend;
+ gulong changed_handler_id;
};
enum {
@@ -178,6 +179,7 @@ source_config_add_candidate (ESourceConfig *config,
ESourceRegistry *registry;
const gchar *display_name;
const gchar *parent_uid;
+ gulong handler_id;
backend_box = GTK_BOX (config->priv->backend_box);
type_label = GTK_LABEL (config->priv->type_label);
@@ -217,10 +219,12 @@ source_config_add_candidate (ESourceConfig *config,
e_source_config_backend_insert_widgets (
candidate->backend, candidate->scratch_source);
- g_signal_connect_swapped (
+ handler_id = g_signal_connect_swapped (
candidate->scratch_source, "changed",
G_CALLBACK (e_source_config_check_complete), config);
+ candidate->changed_handler_id = handler_id;
+
/* Trigger the "changed" handler we just connected to set the
* initial "complete" state based on the widgets we just added. */
e_source_changed (candidate->scratch_source);
@@ -231,9 +235,9 @@ source_config_add_candidate (ESourceConfig *config,
static void
source_config_free_candidate (Candidate *candidate)
{
- g_signal_handlers_disconnect_matched (
- candidate->scratch_source, G_SIGNAL_MATCH_FUNC,
- 0, 0, NULL, G_CALLBACK (e_source_config_check_complete), NULL);
+ g_signal_handler_disconnect (
+ candidate->scratch_source,
+ candidate->changed_handler_id);
g_object_unref (candidate->page);
g_object_unref (candidate->scratch_source);