diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-09-11 23:50:51 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-09-12 02:14:04 +0800 |
commit | ebcce86769d174cce6e881740c5e9bcedce28e06 (patch) | |
tree | b2cc2d18ceb0c3bd3e78f5b768c1b6926b69bb4a /widgets/text | |
parent | 1e3deb31476cf0026011876327be83e9a47847ee (diff) | |
download | gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.gz gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.bz2 gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.lz gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.xz gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.zst gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.zip |
Coding style and whitespace cleanups.
Diffstat (limited to 'widgets/text')
-rw-r--r-- | widgets/text/e-reflow-model.c | 54 | ||||
-rw-r--r-- | widgets/text/e-reflow.c | 192 | ||||
-rw-r--r-- | widgets/text/e-text.c | 206 | ||||
-rw-r--r-- | widgets/text/gal-a11y-e-text.c | 22 |
4 files changed, 237 insertions, 237 deletions
diff --git a/widgets/text/e-reflow-model.c b/widgets/text/e-reflow-model.c index 1eaccdad09..6f8223ae9a 100644 --- a/widgets/text/e-reflow-model.c +++ b/widgets/text/e-reflow-model.c @@ -30,7 +30,7 @@ G_DEFINE_TYPE (EReflowModel, e_reflow_model, G_TYPE_OBJECT) #define d(x) -d(static gint depth = 0;) +d (static gint depth = 0;) enum { MODEL_CHANGED, @@ -41,7 +41,7 @@ enum { LAST_SIGNAL }; -static guint e_reflow_model_signals [LAST_SIGNAL] = { 0, }; +static guint e_reflow_model_signals[LAST_SIGNAL] = { 0, }; /** * e_reflow_model_set_width: @@ -151,7 +151,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - e_reflow_model_signals [MODEL_CHANGED] = + e_reflow_model_signals[MODEL_CHANGED] = g_signal_new ("model_changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -160,7 +160,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_reflow_model_signals [COMPARISON_CHANGED] = + e_reflow_model_signals[COMPARISON_CHANGED] = g_signal_new ("comparison_changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -169,7 +169,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - e_reflow_model_signals [MODEL_ITEMS_INSERTED] = + e_reflow_model_signals[MODEL_ITEMS_INSERTED] = g_signal_new ("model_items_inserted", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -178,7 +178,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) e_marshal_NONE__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - e_reflow_model_signals [MODEL_ITEM_CHANGED] = + e_reflow_model_signals[MODEL_ITEM_CHANGED] = g_signal_new ("model_item_changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -187,7 +187,7 @@ e_reflow_model_class_init (EReflowModelClass *klass) g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); - e_reflow_model_signals [MODEL_ITEM_REMOVED] = + e_reflow_model_signals[MODEL_ITEM_REMOVED] = g_signal_new ("model_item_removed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -243,12 +243,12 @@ e_reflow_model_changed (EReflowModel *e_reflow_model) g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting model_changed on model 0x%p.\n", e_reflow_model)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [MODEL_CHANGED], 0); - d(depth--); + e_reflow_model_signals[MODEL_CHANGED], 0); + d (depth--); } /** @@ -266,12 +266,12 @@ e_reflow_model_comparison_changed (EReflowModel *e_reflow_model) g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting comparison_changed on model 0x%p.\n", e_reflow_model)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [COMPARISON_CHANGED], 0); - d(depth--); + e_reflow_model_signals[COMPARISON_CHANGED], 0); + d (depth--); } /** @@ -288,13 +288,13 @@ e_reflow_model_items_inserted (EReflowModel *e_reflow_model, gint position, gint g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting items_inserted on model 0x%p, position=%d, count=%d.\n", e_reflow_model, position, count)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [MODEL_ITEMS_INSERTED], 0, + e_reflow_model_signals[MODEL_ITEMS_INSERTED], 0, position, count); - d(depth--); + d (depth--); } /** @@ -312,13 +312,13 @@ e_reflow_model_item_removed (EReflowModel *e_reflow_model, g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting item_removed on model 0x%p, n=%d.\n", e_reflow_model, n)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [MODEL_ITEM_REMOVED], 0, + e_reflow_model_signals[MODEL_ITEM_REMOVED], 0, n); - d(depth--); + d (depth--); } /** @@ -338,11 +338,11 @@ e_reflow_model_item_changed (EReflowModel *e_reflow_model, gint n) g_return_if_fail (e_reflow_model != NULL); g_return_if_fail (E_IS_REFLOW_MODEL (e_reflow_model)); - d(print_tabs()); + d (print_tabs ()); d(g_print("Emitting item_changed on model 0x%p, n=%d.\n", e_reflow_model, n)); - d(depth++); + d (depth++); g_signal_emit (e_reflow_model, - e_reflow_model_signals [MODEL_ITEM_CHANGED], 0, + e_reflow_model_signals[MODEL_ITEM_CHANGED], 0, n); - d(depth--); + d (depth--); } diff --git a/widgets/text/e-reflow.c b/widgets/text/e-reflow.c index ddbbf5a987..7a0f7ad121 100644 --- a/widgets/text/e-reflow.c +++ b/widgets/text/e-reflow.c @@ -45,7 +45,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, static void e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gint flags); static gdouble e_reflow_point (GnomeCanvasItem *item, gdouble x, gdouble y, gint cx, gint cy, GnomeCanvasItem **actual_item); static void e_reflow_reflow (GnomeCanvasItem *item, gint flags); -static void set_empty(EReflow *reflow); +static void set_empty (EReflow *reflow); static void e_reflow_resize_children (GnomeCanvasItem *item); @@ -72,7 +72,7 @@ enum { LAST_SIGNAL }; -static guint signals [LAST_SIGNAL] = {0, }; +static guint signals[LAST_SIGNAL] = {0, }; static gint er_compare (gint i1, gint i2, gpointer user_data) @@ -112,7 +112,7 @@ e_reflow_resize_children (GnomeCanvasItem *item) count = reflow->count; for (i = 0; i < count; i++) { if (reflow->items[i]) - gnome_canvas_item_set(reflow->items[i], + gnome_canvas_item_set (reflow->items[i], "width", (gdouble) reflow->column_width, NULL); } @@ -122,7 +122,7 @@ static inline void e_reflow_update_selection_row (EReflow *reflow, gint row) { if (reflow->items[row]) { - g_object_set(reflow->items[row], + g_object_set (reflow->items[row], "selected", e_selection_model_is_row_selected(E_SELECTION_MODEL(reflow->selection), row), NULL); } else if (e_selection_model_is_row_selected (E_SELECTION_MODEL (reflow->selection), row)) { @@ -334,7 +334,7 @@ reflow_columns (EReflow *reflow) for (i = start; i < count; i++) { gint unsorted = e_sorter_sorted_to_model (E_SORTER (reflow->sorter), i); if (i != 0 && running_height + reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH > reflow->height) { - list = g_slist_prepend (list, GINT_TO_POINTER(i)); + list = g_slist_prepend (list, GINT_TO_POINTER (i)); column_count++; running_height = E_REFLOW_BORDER_WIDTH * 2 + reflow->heights[unsorted]; } else @@ -347,7 +347,7 @@ reflow_columns (EReflow *reflow) for (; column_count > column_start; column_count--) { GSList *to_free; - reflow->columns[column_count] = GPOINTER_TO_INT(list->data); + reflow->columns[column_count] = GPOINTER_TO_INT (list->data); to_free = list; list = list->next; g_slist_free_1 (to_free); @@ -372,7 +372,7 @@ item_changed (EReflowModel *model, gint i, EReflow *reflow) e_sorter_array_clean (reflow->sorter); reflow->reflow_from_column = -1; reflow->need_reflow_columns = TRUE; - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); } static void @@ -405,12 +405,12 @@ item_removed (EReflowModel *model, gint i, EReflow *reflow) reflow->count--; - reflow->heights [reflow->count] = 0; - reflow->items [reflow->count] = NULL; + reflow->heights[reflow->count] = 0; + reflow->items[reflow->count] = NULL; reflow->need_reflow_columns = TRUE; set_empty (reflow); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); e_sorter_array_set_count (reflow->sorter, reflow->count); @@ -467,7 +467,7 @@ items_inserted (EReflowModel *model, gint position, gint count, EReflow *reflow) reflow->need_reflow_columns = TRUE; set_empty (reflow); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); } static void @@ -504,7 +504,7 @@ model_changed (EReflowModel *model, EReflow *reflow) if (oldcount > reflow->count) reflow_columns (reflow); set_empty (reflow); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); } static void @@ -513,31 +513,31 @@ comparison_changed (EReflowModel *model, EReflow *reflow) e_sorter_array_clean (reflow->sorter); reflow->reflow_from_column = -1; reflow->need_reflow_columns = TRUE; - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM (reflow)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (reflow)); } static void -set_empty(EReflow *reflow) +set_empty (EReflow *reflow) { if (reflow->count == 0) { if (reflow->empty_text) { if (reflow->empty_message) { - gnome_canvas_item_set(reflow->empty_text, + gnome_canvas_item_set (reflow->empty_text, "width", reflow->minimum_width, "text", reflow->empty_message, NULL); - e_canvas_item_move_absolute(reflow->empty_text, + e_canvas_item_move_absolute (reflow->empty_text, reflow->minimum_width / 2, 0); } else { - gtk_object_destroy(GTK_OBJECT(reflow->empty_text)); + gtk_object_destroy (GTK_OBJECT (reflow->empty_text)); reflow->empty_text = NULL; } } else { if (reflow->empty_message) { reflow->empty_text = - gnome_canvas_item_new(GNOME_CANVAS_GROUP(reflow), - e_text_get_type(), + gnome_canvas_item_new (GNOME_CANVAS_GROUP (reflow), + e_text_get_type (), "anchor", GTK_ANCHOR_N, "width", reflow->minimum_width, "clip", TRUE, @@ -546,14 +546,14 @@ set_empty(EReflow *reflow) "text", reflow->empty_message, "draw_background", FALSE, NULL); - e_canvas_item_move_absolute(reflow->empty_text, + e_canvas_item_move_absolute (reflow->empty_text, reflow->minimum_width / 2, 0); } } } else { if (reflow->empty_text) { - gtk_object_destroy(GTK_OBJECT(reflow->empty_text)); + gtk_object_destroy (GTK_OBJECT (reflow->empty_text)); reflow->empty_text = NULL; } } @@ -726,19 +726,19 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar case PROP_HEIGHT: reflow->height = g_value_get_double (value); reflow->need_reflow_columns = TRUE; - e_canvas_item_request_reflow(item); + e_canvas_item_request_reflow (item); break; case PROP_MINIMUM_WIDTH: reflow->minimum_width = g_value_get_double (value); if (item->flags & GNOME_CANVAS_ITEM_REALIZED) - set_empty(reflow); - e_canvas_item_request_reflow(item); + set_empty (reflow); + e_canvas_item_request_reflow (item); break; case PROP_EMPTY_MESSAGE: - g_free(reflow->empty_message); - reflow->empty_message = g_strdup(g_value_get_string (value)); + g_free (reflow->empty_message); + reflow->empty_message = g_strdup (g_value_get_string (value)); if (item->flags & GNOME_CANVAS_ITEM_REALIZED) - set_empty(reflow); + set_empty (reflow); break; case PROP_MODEL: connect_model (reflow, (EReflowModel *) g_value_get_object (value)); @@ -762,11 +762,11 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar adjustment, step_increment); gtk_adjustment_set_page_increment ( adjustment, page_size - step_increment); - e_reflow_resize_children(item); - e_canvas_item_request_reflow(item); + e_reflow_resize_children (item); + e_canvas_item_request_reflow (item); reflow->need_column_resize = TRUE; - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); if (old_width != reflow->column_width) column_width_changed (reflow); @@ -810,7 +810,7 @@ e_reflow_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec static void e_reflow_dispose (GObject *object) { - EReflow *reflow = E_REFLOW(object); + EReflow *reflow = E_REFLOW (object); g_free (reflow->items); g_free (reflow->heights); @@ -833,7 +833,7 @@ e_reflow_dispose (GObject *object) disconnect_model (reflow); disconnect_selection (reflow); - g_free(reflow->empty_message); + g_free (reflow->empty_message); reflow->empty_message = NULL; if (reflow->sorter) { @@ -841,7 +841,7 @@ e_reflow_dispose (GObject *object) reflow->sorter = NULL; } - G_OBJECT_CLASS(e_reflow_parent_class)->dispose (object); + G_OBJECT_CLASS (e_reflow_parent_class)->dispose (object); } static void @@ -857,8 +857,8 @@ e_reflow_realize (GnomeCanvasItem *item) reflow = E_REFLOW (item); - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->realize) - (* GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->realize) (item); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->realize) + (* GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->realize) (item); reflow->arrow_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW); reflow->default_cursor = gdk_cursor_new (GDK_LEFT_PTR); @@ -866,15 +866,15 @@ e_reflow_realize (GnomeCanvasItem *item) count = reflow->count; for (i = 0; i < count; i++) { if (reflow->items[i]) - gnome_canvas_item_set(reflow->items[i], + gnome_canvas_item_set (reflow->items[i], "width", reflow->column_width, NULL); } - set_empty(reflow); + set_empty (reflow); reflow->need_reflow_columns = TRUE; - e_canvas_item_request_reflow(item); + e_canvas_item_request_reflow (item); adjustment = gtk_layout_get_hadjustment (GTK_LAYOUT (item->canvas)); @@ -908,8 +908,8 @@ e_reflow_unrealize (GnomeCanvasItem *item) disconnect_set_adjustment (reflow); disconnect_adjustment (reflow); - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->unrealize) - (* GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->unrealize) (item); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->unrealize) + (* GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->unrealize) (item); } static gboolean @@ -923,7 +923,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) switch (event->type) { case GDK_KEY_PRESS: - return_val = e_selection_model_key_press(reflow->selection, (GdkEventKey *) event); + return_val = e_selection_model_key_press (reflow->selection, (GdkEventKey *) event); break; #if 0 if (event->key.keyval == GDK_Tab || @@ -937,7 +937,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) GnomeCanvasItem *item = reflow->items[unsorted]; EFocus has_focus; if (item) { - g_object_get(item, + g_object_get (item, "has_focus", &has_focus, NULL); if (has_focus) { @@ -957,7 +957,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) } item = reflow->items[unsorted]; - gnome_canvas_item_set(item, + gnome_canvas_item_set (item, "has_focus", (event->key.state & GDK_SHIFT_MASK) ? E_FOCUS_END : E_FOCUS_START, NULL); return TRUE; @@ -975,13 +975,13 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) gdouble n_x; n_x = button->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); if (button->y >= E_REFLOW_BORDER_WIDTH && button->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER) { /* don't allow to drag the first line*/ - if (e_reflow_pick_line(reflow, button->x) == 0) + if (e_reflow_pick_line (reflow, button->x) == 0) return TRUE; - reflow->which_column_dragged = e_reflow_pick_line(reflow, button->x); + reflow->which_column_dragged = e_reflow_pick_line (reflow, button->x); reflow->start_x = reflow->which_column_dragged * (reflow->column_width + E_REFLOW_FULL_GUTTER) - E_REFLOW_DIVIDER_WIDTH / 2; reflow->temp_column_width = reflow->column_width; reflow->column_drag = TRUE; @@ -993,7 +993,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) reflow->previous_temp_column_width = -1; reflow->need_column_resize = TRUE; - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); return TRUE; } } @@ -1045,7 +1045,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) value = gtk_adjustment_get_value (adjustment); reflow->temp_column_width = reflow->column_width + - (button->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line(reflow, value)); + (button->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); if (reflow->temp_column_width < 50) reflow->temp_column_width = 50; reflow->column_drag = FALSE; @@ -1055,19 +1055,19 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) gdouble page_size; page_size = gtk_adjustment_get_page_size (adjustment); - gtk_adjustment_set_value(adjustment, value + e_reflow_pick_line(reflow, value) * (reflow->temp_column_width - reflow->column_width)); + gtk_adjustment_set_value (adjustment, value + e_reflow_pick_line (reflow, value) * (reflow->temp_column_width - reflow->column_width)); reflow->column_width = reflow->temp_column_width; step_increment = (reflow->column_width + E_REFLOW_FULL_GUTTER) / 2; page_increment = page_size - step_increment; gtk_adjustment_set_step_increment (adjustment, step_increment); gtk_adjustment_set_page_increment (adjustment, page_increment); - e_reflow_resize_children(item); - e_canvas_item_request_reflow(item); - gnome_canvas_request_redraw(item->canvas, 0, 0, reflow->width, reflow->height); + e_reflow_resize_children (item); + e_canvas_item_request_reflow (item); + gnome_canvas_request_redraw (item->canvas, 0, 0, reflow->width, reflow->height); column_width_changed (reflow); } reflow->need_column_resize = TRUE; - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); gnome_canvas_item_ungrab (item, button->time); return TRUE; } @@ -1085,12 +1085,12 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) value = gtk_adjustment_get_value (adjustment); reflow->temp_column_width = reflow->column_width + - (motion->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line(reflow, value)); + (motion->x - reflow->start_x)/(reflow->which_column_dragged - e_reflow_pick_line (reflow, value)); if (reflow->temp_column_width < 50) reflow->temp_column_width = 50; if (old_width != reflow->temp_column_width) { reflow->need_column_resize = TRUE; - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); } return TRUE; } else { @@ -1100,18 +1100,18 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) n_x = motion->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); window = gtk_widget_get_window (GTK_WIDGET (item->canvas)); if (motion->y >= E_REFLOW_BORDER_WIDTH && motion->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER) { if (reflow->default_cursor_shown) { - gdk_window_set_cursor(window, reflow->arrow_cursor); + gdk_window_set_cursor (window, reflow->arrow_cursor); reflow->default_cursor_shown = FALSE; } } else if (!reflow->default_cursor_shown) { - gdk_window_set_cursor(window, reflow->default_cursor); + gdk_window_set_cursor (window, reflow->default_cursor); reflow->default_cursor_shown = TRUE; } @@ -1125,13 +1125,13 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) n_x = crossing->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); window = gtk_widget_get_window (GTK_WIDGET (item->canvas)); if (crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER) { if (reflow->default_cursor_shown) { - gdk_window_set_cursor(window, reflow->arrow_cursor); + gdk_window_set_cursor (window, reflow->arrow_cursor); reflow->default_cursor_shown = FALSE; } } @@ -1145,13 +1145,13 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) n_x = crossing->x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x,(reflow->column_width + E_REFLOW_FULL_GUTTER)); window = gtk_widget_get_window (GTK_WIDGET (item->canvas)); if (!( crossing->y >= E_REFLOW_BORDER_WIDTH && crossing->y <= reflow->height - E_REFLOW_BORDER_WIDTH && n_x < E_REFLOW_FULL_GUTTER )) { if (!reflow->default_cursor_shown) { - gdk_window_set_cursor(window, reflow->default_cursor); + gdk_window_set_cursor (window, reflow->default_cursor); reflow->default_cursor_shown = TRUE; } } @@ -1162,8 +1162,8 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) } if (return_val) return return_val; - else if (GNOME_CANVAS_ITEM_CLASS( e_reflow_parent_class )->event) - return (* GNOME_CANVAS_ITEM_CLASS( e_reflow_parent_class )->event) (item, event); + else if (GNOME_CANVAS_ITEM_CLASS ( e_reflow_parent_class )->event) + return (* GNOME_CANVAS_ITEM_CLASS ( e_reflow_parent_class )->event) (item, event); else return FALSE; } @@ -1174,12 +1174,12 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, GtkStyle *style; gint x_rect, y_rect, width_rect, height_rect; gdouble running_width; - EReflow *reflow = E_REFLOW(item); + EReflow *reflow = E_REFLOW (item); gint i; gdouble column_width; - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw) - GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->draw (item, drawable, x, y, width, height); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->draw) + GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->draw (item, drawable, x, y, width, height); column_width = reflow->column_width; running_width = E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; y_rect = E_REFLOW_BORDER_WIDTH; @@ -1197,12 +1197,12 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, if (running_width > x + width) break; x_rect = running_width; - gtk_paint_flat_box(style, + gtk_paint_flat_box (style, drawable, GTK_STATE_ACTIVE, GTK_SHADOW_NONE, NULL, - GTK_WIDGET(item->canvas), + GTK_WIDGET (item->canvas), "reflow", x_rect - x, y_rect - y, @@ -1220,7 +1220,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, adjustment = gtk_layout_get_hadjustment (layout); value = gtk_adjustment_get_value (adjustment); - start_line = e_reflow_pick_line(reflow, value); + start_line = e_reflow_pick_line (reflow, value); i = x - start_line * (column_width + E_REFLOW_FULL_GUTTER); running_width = start_line * (column_width + E_REFLOW_FULL_GUTTER); column_width = reflow->temp_column_width; @@ -1239,7 +1239,7 @@ static void e_reflow_draw (GnomeCanvasItem *item, GdkDrawable *drawable, if (running_width > x + width) break; x_rect = running_width; - gdk_draw_rectangle(drawable, + gdk_draw_rectangle (drawable, style->fg_gc[GTK_STATE_NORMAL], TRUE, x_rect - x, @@ -1259,8 +1259,8 @@ e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gi reflow = E_REFLOW (item); - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->update) - GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->update (item, affine, clip_path, flags); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->update) + GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->update (item, affine, clip_path, flags); x0 = item->x1; y0 = item->y1; @@ -1282,12 +1282,12 @@ e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gi x0 = 0; if (y0 > 0) y0 = 0; - if (x1 < E_REFLOW(item)->width) - x1 = E_REFLOW(item)->width; - if (x1 < E_REFLOW(item)->height) - x1 = E_REFLOW(item)->height; + if (x1 < E_REFLOW (item)->width) + x1 = E_REFLOW (item)->width; + if (x1 < E_REFLOW (item)->height) + x1 = E_REFLOW (item)->height; - gnome_canvas_request_redraw(item->canvas, x0, y0, x1, y1); + gnome_canvas_request_redraw (item->canvas, x0, y0, x1, y1); reflow->need_height_update = FALSE; } else if (reflow->need_column_resize) { GtkLayout *layout; @@ -1315,7 +1315,7 @@ e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gi for ( i = 0; i < reflow->column_count; i++) { x_rect = running_width; - gnome_canvas_request_redraw(item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); + gnome_canvas_request_redraw (item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } } @@ -1331,7 +1331,7 @@ e_reflow_update (GnomeCanvasItem *item, gdouble affine[6], ArtSVP *clip_path, gi for ( i = 0; i < reflow->column_count; i++) { x_rect = running_width; - gnome_canvas_request_redraw(item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); + gnome_canvas_request_redraw (item->canvas, x_rect, y_rect, x_rect + width_rect, y_rect + height_rect); running_width += E_REFLOW_DIVIDER_WIDTH + E_REFLOW_BORDER_WIDTH + column_width + E_REFLOW_BORDER_WIDTH; } } @@ -1350,8 +1350,8 @@ e_reflow_point (GnomeCanvasItem *item, *actual_item = NULL; - if (GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->point) - distance = GNOME_CANVAS_ITEM_CLASS(e_reflow_parent_class)->point (item, x, y, cx, cy, actual_item); + if (GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->point) + distance = GNOME_CANVAS_ITEM_CLASS (e_reflow_parent_class)->point (item, x, y, cx, cy, actual_item); if ((gint) (distance * item->canvas->pixels_per_unit + 0.5) <= item->canvas->close_enough && *actual_item) return distance; @@ -1362,7 +1362,7 @@ e_reflow_point (GnomeCanvasItem *item, gfloat n_x; n_x = x; n_x += E_REFLOW_BORDER_WIDTH + E_REFLOW_DIVIDER_WIDTH; - n_x = fmod(n_x, (reflow->column_width + E_REFLOW_FULL_GUTTER)); + n_x = fmod (n_x, (reflow->column_width + E_REFLOW_FULL_GUTTER)); if (n_x < E_REFLOW_FULL_GUTTER) { *actual_item = item; return 0; @@ -1373,9 +1373,9 @@ e_reflow_point (GnomeCanvasItem *item, } static void -e_reflow_reflow( GnomeCanvasItem *item, gint flags ) +e_reflow_reflow ( GnomeCanvasItem *item, gint flags ) { - EReflow *reflow = E_REFLOW(item); + EReflow *reflow = E_REFLOW (item); gdouble old_width; gdouble running_width; gdouble running_height; @@ -1405,7 +1405,7 @@ e_reflow_reflow( GnomeCanvasItem *item, gint flags ) } if (unsorted >= 0 && reflow->items[unsorted]) { - e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(reflow->items[unsorted]), + e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (reflow->items[unsorted]), (gdouble) running_width, (gdouble) running_height); running_height += reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH; @@ -1415,7 +1415,7 @@ e_reflow_reflow( GnomeCanvasItem *item, gint flags ) if (reflow->width < reflow->minimum_width) reflow->width = reflow->minimum_width; if (old_width != reflow->width) - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); } static gint @@ -1431,15 +1431,15 @@ e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent row = er_find_item (reflow, item); if (event->button.button == 1) { reflow->maybe_did_something = - e_selection_model_maybe_do_something(reflow->selection, row, 0, event->button.state); + e_selection_model_maybe_do_something (reflow->selection, row, 0, event->button.state); reflow->maybe_in_drag = TRUE; } else { - e_selection_model_do_something(reflow->selection, row, 0, event->button.state); + e_selection_model_do_something (reflow->selection, row, 0, event->button.state); } break; case 3: row = er_find_item (reflow, item); - e_selection_model_right_click_down(reflow->selection, row, 0, 0); + e_selection_model_right_click_down (reflow->selection, row, 0, 0); break; default: return_val = FALSE; @@ -1452,13 +1452,13 @@ e_reflow_selection_event_real (EReflow *reflow, GnomeCanvasItem *item, GdkEvent reflow->maybe_in_drag = FALSE; if (!reflow->maybe_did_something) { row = er_find_item (reflow, item); - e_selection_model_do_something(reflow->selection, row, 0, event->button.state); + e_selection_model_do_something (reflow->selection, row, 0, event->button.state); } } } break; case GDK_KEY_PRESS: - return_val = e_selection_model_key_press(reflow->selection, (GdkEventKey *) event); + return_val = e_selection_model_key_press (reflow->selection, (GdkEventKey *) event); break; default: return_val = FALSE; @@ -1534,7 +1534,7 @@ e_reflow_class_init (EReflowClass *klass) 0.0, G_MAXDOUBLE, 150.0, G_PARAM_READWRITE)); - signals [SELECTION_EVENT] = + signals[SELECTION_EVENT] = g_signal_new ("selection_event", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -1544,7 +1544,7 @@ e_reflow_class_init (EReflowClass *klass) G_TYPE_INT, 2, G_TYPE_OBJECT, GDK_TYPE_EVENT); - signals [COLUMN_WIDTH_CHANGED] = + signals[COLUMN_WIDTH_CHANGED] = g_signal_new ("column_width_changed", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -1593,7 +1593,7 @@ e_reflow_init (EReflow *reflow) reflow->do_adjustment_idle_id = 0; reflow->set_scroll_adjustments_id = 0; - reflow->selection = E_SELECTION_MODEL (e_selection_model_simple_new()); + reflow->selection = E_SELECTION_MODEL (e_selection_model_simple_new ()); reflow->sorter = e_sorter_array_new (er_compare, reflow); g_object_set (reflow->selection, @@ -1610,5 +1610,5 @@ e_reflow_init (EReflow *reflow) g_signal_connect(reflow->selection, "cursor_changed", G_CALLBACK (cursor_changed), reflow); - e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(reflow), e_reflow_reflow); + e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (reflow), e_reflow_reflow); } diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index bb9b2dda51..979cae72e0 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -123,7 +123,7 @@ static void e_text_text_model_reposition (ETextModel *model, gpointer repos_data, gpointer data); -static void _get_tep(EText *text); +static void _get_tep (EText *text); static void calc_height (EText *text); @@ -133,7 +133,7 @@ static void e_text_do_popup (EText *text, GdkEventButton *button, gint position) static void e_text_update_primary_selection (EText *text); static void e_text_paste (EText *text, GdkAtom selection); -static void e_text_insert(EText *text, const gchar *string); +static void e_text_insert (EText *text, const gchar *string); static void reset_layout_attrs (EText *text); @@ -213,11 +213,11 @@ e_text_dispose (GObject *object) text->model_repos_signal_id = 0; if (text->model) - g_object_unref(text->model); + g_object_unref (text->model); text->model = NULL; if (text->tep_command_id) - g_signal_handler_disconnect(text->tep, + g_signal_handler_disconnect (text->tep, text->tep_command_id); text->tep_command_id = 0; @@ -233,13 +233,13 @@ e_text_dispose (GObject *object) text->stipple = NULL; if (text->timeout_id) { - g_source_remove(text->timeout_id); + g_source_remove (text->timeout_id); text->timeout_id = 0; } if (text->timer) { - g_timer_stop(text->timer); - g_timer_destroy(text->timer); + g_timer_stop (text->timer); + g_timer_destroy (text->timer); text->timer = NULL; } @@ -289,7 +289,7 @@ insert_preedit_text (EText *text) if (text->layout == NULL || !GTK_IS_IM_CONTEXT (text->im_context)) return; - text->text = e_text_model_get_text(text->model); + text->text = e_text_model_get_text (text->model); length = strlen (text->text); g_string_prepend_len (tmp_string, text->text,length); @@ -424,7 +424,7 @@ reset_layout (EText *text) context = pango_layout_get_context (text->layout); - font_options = get_font_options(); + font_options = get_font_options (); pango_cairo_context_set_font_options (context, font_options); cairo_font_options_destroy (font_options); pango_layout_context_changed (text->layout); @@ -469,7 +469,7 @@ static void e_text_text_model_changed (ETextModel *model, EText *text) { gint model_len = e_text_model_get_text_length (model); - text->text = e_text_model_get_text(model); + text->text = e_text_model_get_text (model); /* Make sure our selection doesn't extend past the bounds of our text. */ text->selection_start = CLAMP (text->selection_start, 0, model_len); @@ -478,7 +478,7 @@ e_text_text_model_changed (ETextModel *model, EText *text) text->needs_reset_layout = 1; text->needs_split_into_lines = 1; text->needs_redraw = 1; - e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(text)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (text)); gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text)); g_signal_emit (text, e_text_signals[E_TEXT_CHANGED], 0); @@ -628,7 +628,7 @@ calc_height (EText *text) text->width = width; if (old_height != text->height || old_width != text->width) - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); } static void @@ -730,7 +730,7 @@ e_text_set_property (GObject *object, G_CALLBACK (e_text_text_model_reposition), text); - text->text = e_text_model_get_text(text->model); + text->text = e_text_model_get_text (text->model); g_signal_emit (text, e_text_signals[E_TEXT_CHANGED], 0); text->needs_split_into_lines = 1; @@ -739,17 +739,17 @@ e_text_set_property (GObject *object, case PROP_EVENT_PROCESSOR: if (text->tep && text->tep_command_id) - g_signal_handler_disconnect(text->tep, + g_signal_handler_disconnect (text->tep, text->tep_command_id); if (text->tep) { - g_object_unref(text->tep); + g_object_unref (text->tep); } - text->tep = E_TEXT_EVENT_PROCESSOR(g_value_get_object (value)); - g_object_ref(text->tep); + text->tep = E_TEXT_EVENT_PROCESSOR (g_value_get_object (value)); + g_object_ref (text->tep); text->tep_command_id = - g_signal_connect(text->tep, + g_signal_connect (text->tep, "command", - G_CALLBACK(e_text_command), + G_CALLBACK (e_text_command), text); if (!text->allow_newlines) g_object_set (text->tep, @@ -758,7 +758,7 @@ e_text_set_property (GObject *object, break; case PROP_TEXT: - e_text_model_set_text(text->model, g_value_get_string (value)); + e_text_model_set_text (text->model, g_value_get_string (value)); break; case PROP_BOLD: @@ -920,11 +920,11 @@ e_text_set_property (GObject *object, case PROP_BREAK_CHARACTERS: if (text->break_characters) { - g_free(text->break_characters); + g_free (text->break_characters); text->break_characters = NULL; } if (g_value_get_string (value)) - text->break_characters = g_strdup( g_value_get_string (value) ); + text->break_characters = g_strdup ( g_value_get_string (value) ); text->needs_split_into_lines = 1; needs_reflow = 1; break; @@ -978,7 +978,7 @@ e_text_set_property (GObject *object, case PROP_ALLOW_NEWLINES: text->allow_newlines = g_value_get_boolean (value); - _get_tep(text); + _get_tep (text); g_object_set (text->tep, "allow_newlines", g_value_get_boolean (value), NULL); @@ -1051,7 +1051,7 @@ e_text_get_property (GObject *object, break; case PROP_EVENT_PROCESSOR: - _get_tep(text); + _get_tep (text); g_value_set_object (value, text->tep); break; @@ -1212,7 +1212,7 @@ e_text_reflow (GnomeCanvasItem *item, gint flags) if (text->needs_calc_height) { calc_height (text); - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); text->needs_calc_height = 0; text->needs_recalc_bounds = 1; } @@ -1308,14 +1308,14 @@ e_text_unrealize (GnomeCanvasItem *item) } static void -_get_tep(EText *text) +_get_tep (EText *text) { if (!text->tep) { - text->tep = e_text_event_processor_emacs_like_new(); + text->tep = e_text_event_processor_emacs_like_new (); text->tep_command_id = - g_signal_connect(text->tep, + g_signal_connect (text->tep, "command", - G_CALLBACK(e_text_command), + G_CALLBACK (e_text_command), text); } } @@ -1417,8 +1417,8 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, GtkStateType state; text = E_TEXT (item); - canvas = GNOME_CANVAS_ITEM(text)->canvas; - widget = GTK_WIDGET(canvas); + canvas = GNOME_CANVAS_ITEM (text)->canvas; + widget = GTK_WIDGET (canvas); state = gtk_widget_get_state (widget); style = gtk_widget_get_style (widget); window = gtk_widget_get_window (widget); @@ -1433,9 +1433,9 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gdouble thisx = item->x1 - x; gdouble thisy = item->y1 - y; gdouble thiswidth, thisheight; - widget = GTK_WIDGET(item->canvas); + widget = GTK_WIDGET (item->canvas); - g_object_get(text, + g_object_get (text, "width", &thiswidth, "height", &thisheight, NULL); @@ -1472,7 +1472,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, widget = gtk_widget_get_parent (widget); - while (widget && !GTK_IS_BUTTON(widget)) { + while (widget && !GTK_IS_BUTTON (widget)) { if (gtk_widget_get_has_window (widget)) { widget = NULL; break; @@ -1616,14 +1616,14 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, end_index = MAX (text->selection_start, text->selection_end); /* convert these into byte indices */ - start_index = g_utf8_offset_to_pointer(text->text, start_index) - text->text; - end_index = g_utf8_offset_to_pointer(text->text, end_index) - text->text; + start_index = g_utf8_offset_to_pointer (text->text, start_index) - text->text; + end_index = g_utf8_offset_to_pointer (text->text, end_index) - text->text; if (text->has_selection) { - selection_gc = style->base_gc [GTK_STATE_SELECTED]; + selection_gc = style->base_gc[GTK_STATE_SELECTED]; text_gc = style->text_gc[GTK_STATE_SELECTED]; } else { - selection_gc = style->base_gc [GTK_STATE_ACTIVE]; + selection_gc = style->base_gc[GTK_STATE_ACTIVE]; text_gc = style->text_gc[GTK_STATE_ACTIVE]; } @@ -1868,12 +1868,12 @@ get_position_from_xy (EText *text, gint x, gint y) static gboolean _blink_scroll_timeout (gpointer data) { - EText *text = E_TEXT(data); + EText *text = E_TEXT (data); gulong current_time; gboolean scroll = FALSE; gboolean redraw = FALSE; - g_timer_elapsed(text->timer, ¤t_time); + g_timer_elapsed (text->timer, ¤t_time); if (text->scroll_start + SCROLL_WAIT_TIME > 1000000) { if (current_time > text->scroll_start - (1000000 - SCROLL_WAIT_TIME) && @@ -1922,8 +1922,8 @@ _blink_scroll_timeout (gpointer data) e_tep_event.type = GDK_MOTION_NOTIFY; e_tep_event.motion.state = text->last_state; e_tep_event.motion.time = 0; - e_tep_event.motion.position = get_position_from_xy(text, text->lastx, text->lasty); - _get_tep(text); + e_tep_event.motion.position = get_position_from_xy (text, text->lastx, text->lasty); + _get_tep (text); e_text_event_processor_handle_event (text->tep, &e_tep_event); text->scroll_start = current_time; @@ -1942,7 +1942,7 @@ _blink_scroll_timeout (gpointer data) } if (redraw) { text->needs_redraw = 1; - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text)); } return TRUE; } @@ -1972,10 +1972,10 @@ start_editing (EText *text) text->xofs_edit = 0; text->yofs_edit = 0; if (text->timeout_id == 0) - text->timeout_id = g_timeout_add(10, _blink_scroll_timeout, text); - text->timer = g_timer_new(); - g_timer_elapsed(text->timer, &(text->scroll_start)); - g_timer_start(text->timer); + text->timeout_id = g_timeout_add (10, _blink_scroll_timeout, text); + text->timer = g_timer_new (); + g_timer_elapsed (text->timer, &(text->scroll_start)); + g_timer_start (text->timer); } void @@ -1997,8 +1997,8 @@ e_text_stop_editing (EText *text) text->default_cursor_shown = TRUE; } if (text->timer) { - g_timer_stop(text->timer); - g_timer_destroy(text->timer); + g_timer_stop (text->timer); + g_timer_destroy (text->timer); text->timer = NULL; } } @@ -2007,7 +2007,7 @@ void e_text_cancel_editing (EText *text) { if (text->revert) - e_text_model_set_text(text->model, text->revert); + e_text_model_set_text (text->model, text->revert); e_text_stop_editing (text); } @@ -2021,7 +2021,7 @@ _click (gpointer data) static gint e_text_event (GnomeCanvasItem *item, GdkEvent *event) { - EText *text = E_TEXT(item); + EText *text = E_TEXT (item); ETextEventProcessorEvent e_tep_event; GdkWindow *window; @@ -2094,18 +2094,18 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_text_stop_editing (text); if (text->timeout_id) { - g_source_remove(text->timeout_id); + g_source_remove (text->timeout_id); text->timeout_id = 0; } if (text->show_cursor || text->draw_borders) { text->show_cursor = FALSE; text->needs_redraw = 1; - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text)); } } if (text->line_wrap) text->needs_split_into_lines = 1; - e_canvas_item_request_reflow (GNOME_CANVAS_ITEM(text)); + e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (text)); } return_val = 0; break; @@ -2160,7 +2160,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.key.length = 0; } #endif - _get_tep(text); + _get_tep (text); ret = e_text_event_processor_handle_event (text->tep, &e_tep_event); if (event->type == GDK_KEY_PRESS) @@ -2188,8 +2188,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = get_position_from_xy(text, button.x, button.y); - _get_tep(text); + e_tep_event.button.position = get_position_from_xy (text, button.x, button.y); + _get_tep (text); return_val = e_text_event_processor_handle_event (text->tep, &e_tep_event); e_tep_event.type = GDK_BUTTON_RELEASE; @@ -2239,8 +2239,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = get_position_from_xy(text, button.x, button.y); - _get_tep(text); + e_tep_event.button.position = get_position_from_xy (text, button.x, button.y); + _get_tep (text); return_val = e_text_event_processor_handle_event (text->tep, &e_tep_event); if (event->button.button == 1) { @@ -2259,8 +2259,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) GdkEventMotion motion = event->motion; e_tep_event.motion.time = motion.time; e_tep_event.motion.state = motion.state; - e_tep_event.motion.position = get_position_from_xy(text, motion.x, motion.y); - _get_tep(text); + e_tep_event.motion.position = get_position_from_xy (text, motion.x, motion.y); + _get_tep (text); return_val = e_text_event_processor_handle_event (text->tep, &e_tep_event); text->lastx = motion.x; @@ -2272,7 +2272,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->pointer_in = TRUE; if (text->editing || text->draw_borders) { if (text->default_cursor_shown) { - gdk_window_set_cursor(window, text->i_cursor); + gdk_window_set_cursor (window, text->i_cursor); text->default_cursor_shown = FALSE; } } @@ -2281,7 +2281,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->pointer_in = FALSE; if (text->editing || text->draw_borders) { if (!text->default_cursor_shown) { - gdk_window_set_cursor(window, text->default_cursor); + gdk_window_set_cursor (window, text->default_cursor); text->default_cursor_shown = TRUE; } } @@ -2291,8 +2291,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) } if (return_val) return return_val; - if (GNOME_CANVAS_ITEM_CLASS(e_text_parent_class)->event) - return GNOME_CANVAS_ITEM_CLASS(e_text_parent_class)->event(item, event); + if (GNOME_CANVAS_ITEM_CLASS (e_text_parent_class)->event) + return GNOME_CANVAS_ITEM_CLASS (e_text_parent_class)->event (item, event); else return 0; } @@ -2321,15 +2321,15 @@ e_text_copy_clipboard (EText *text) } void -e_text_delete_selection(EText *text) +e_text_delete_selection (EText *text) { gint sel_start, sel_end; - sel_start = MIN(text->selection_start, text->selection_end); - sel_end = MAX(text->selection_start, text->selection_end); + sel_start = MIN (text->selection_start, text->selection_end); + sel_end = MAX (text->selection_start, text->selection_end); if (sel_start != sel_end) - e_text_model_delete(text->model, sel_start, sel_end - sel_start); + e_text_model_delete (text->model, sel_start, sel_end - sel_start); } void @@ -2348,7 +2348,7 @@ e_text_paste_clipboard (EText *text) command.position = E_TEP_SELECTION; command.string = ""; command.value = 0; - e_text_command(text->tep, &command, text); + e_text_command (text->tep, &command, text); } void @@ -2360,7 +2360,7 @@ e_text_select_all (EText *text) command.position = E_TEP_SELECT_ALL; command.string = ""; command.value = 0; - e_text_command(text->tep, &command, text); + e_text_command (text->tep, &command, text); } static void @@ -2372,8 +2372,8 @@ primary_get_cb (GtkClipboard *clipboard, EText *text = E_TEXT (data); gint sel_start, sel_end; - sel_start = MIN(text->selection_start, text->selection_end); - sel_end = MAX(text->selection_start, text->selection_end); + sel_start = MIN (text->selection_start, text->selection_end); + sel_end = MAX (text->selection_start, text->selection_end); /* convert sel_start/sel_end to byte indices */ sel_start = g_utf8_offset_to_pointer (text->text, sel_start) - text->text; @@ -2471,7 +2471,7 @@ popup_menu_placement_cb (GtkMenu *menu, gboolean *push_in, gpointer user_data) { - EText *text = E_TEXT(user_data); + EText *text = E_TEXT (user_data); GnomeCanvasItem *item = &text->item; GnomeCanvas *parent = item->canvas; @@ -2502,7 +2502,7 @@ popup_targets_received (GtkClipboard *clipboard, g_free (closure); gtk_menu_attach_to_widget (GTK_MENU (popup_menu), - GTK_WIDGET(GNOME_CANVAS_ITEM (text)->canvas), + GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), popup_menu_detach); /* cut menu item */ @@ -2669,7 +2669,7 @@ find_offset_into_line (EText *text, gint offset_into_text, gchar **start_of_line } /* direction = TRUE (move forward), FALSE (move backward) - Any error shall return length(text->text) or 0 or + Any error shall return length (text->text) or 0 or text->selection_end (as deemed fit) */ static gint _get_updated_position (EText *text, gboolean direction) @@ -2693,7 +2693,7 @@ _get_updated_position (EText *text, gboolean direction) return 0; /* check for validness of full text->text */ - if (!g_utf8_validate(text->text, -1, NULL)) + if (!g_utf8_validate (text->text, -1, NULL)) return text->selection_end; /* get layout's PangoLogAttr to facilitate moving when @@ -2731,13 +2731,13 @@ _get_updated_position (EText *text, gboolean direction) } if (log_attrs) - g_free(log_attrs); + g_free (log_attrs); return new_pos; } static gint -_get_position(EText *text, ETextEventProcessorCommand *command) +_get_position (EText *text, ETextEventProcessorCommand *command) { gint length, obj_num; gunichar unival; @@ -2812,7 +2812,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) new_pos = length; else /* get updated position to display cursor */ - new_pos = _get_updated_position(text, TRUE); + new_pos = _get_updated_position (text, TRUE); break; @@ -3010,7 +3010,7 @@ _get_position(EText *text, ETextEventProcessorCommand *command) } static void -e_text_insert(EText *text, const gchar *string) +e_text_insert (EText *text, const gchar *string) { gint len = strlen (string); @@ -3022,7 +3022,7 @@ e_text_insert(EText *text, const gchar *string) gchar *new_string = g_malloc (len + 1); gchar *j = new_string; - for (i = string; *i; i = g_utf8_next_char(i)) { + for (i = string; *i; i = g_utf8_next_char (i)) { if (*i != '\n') { gunichar c; gint charlen; @@ -3034,12 +3034,12 @@ e_text_insert(EText *text, const gchar *string) } } *j = 0; - e_text_model_insert_length(text->model, text->selection_start, new_string, utf8len); + e_text_model_insert_length (text->model, text->selection_start, new_string, utf8len); g_free (new_string); } else { utf8len = g_utf8_strlen (string, -1); - e_text_model_insert_length(text->model, text->selection_start, string, utf8len); + e_text_model_insert_length (text->model, text->selection_start, string, utf8len); } } } @@ -3097,16 +3097,16 @@ e_text_command (ETextEventProcessor *tep, ETextEventProcessorCommand *command, gpointer data) { - EText *text = E_TEXT(data); + EText *text = E_TEXT (data); gboolean scroll = TRUE; gboolean use_start = TRUE; switch (command->action) { case E_TEP_MOVE: - text->selection_start = _get_position(text, command); + text->selection_start = _get_position (text, command); text->selection_end = text->selection_start; if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } use_start = TRUE; @@ -3115,7 +3115,7 @@ e_text_command (ETextEventProcessor *tep, text->selection_start = e_text_model_validate_position ( text->model, text->selection_start); /* paranoia */ - text->selection_end = _get_position(text, command); + text->selection_end = _get_position (text, command); e_text_update_primary_selection (text); @@ -3124,11 +3124,11 @@ e_text_command (ETextEventProcessor *tep, break; case E_TEP_DELETE: if (text->selection_end == text->selection_start) { - text->selection_end = _get_position(text, command); + text->selection_end = _get_position (text, command); } - e_text_delete_selection(text); + e_text_delete_selection (text); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } use_start = FALSE; @@ -3138,11 +3138,11 @@ e_text_command (ETextEventProcessor *tep, case E_TEP_INSERT: if (g_utf8_validate (command->string, command->value, NULL)) { if (text->selection_end != text->selection_start) { - e_text_delete_selection(text); + e_text_delete_selection (text); } - e_text_insert(text, command->string); + e_text_insert (text, command->string); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } } break; @@ -3150,14 +3150,14 @@ e_text_command (ETextEventProcessor *tep, e_text_copy_clipboard (text); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } scroll = FALSE; break; case E_TEP_PASTE: e_text_paste (text, GDK_NONE); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } break; case E_TEP_GET_SELECTION: @@ -3166,15 +3166,15 @@ e_text_command (ETextEventProcessor *tep, case E_TEP_ACTIVATE: g_signal_emit (text, e_text_signals[E_TEXT_ACTIVATE], 0); if (text->timer) { - g_timer_reset(text->timer); + g_timer_reset (text->timer); } break; case E_TEP_SET_SELECT_BY_WORD: text->select_by_word = command->value; break; case E_TEP_GRAB: - e_canvas_item_grab (E_CANVAS (GNOME_CANVAS_ITEM(text)->canvas), - GNOME_CANVAS_ITEM(text), + e_canvas_item_grab (E_CANVAS (GNOME_CANVAS_ITEM (text)->canvas), + GNOME_CANVAS_ITEM (text), GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, text->i_cursor, command->time, @@ -3183,8 +3183,8 @@ e_text_command (ETextEventProcessor *tep, scroll = FALSE; break; case E_TEP_UNGRAB: - e_canvas_item_ungrab (E_CANVAS (GNOME_CANVAS_ITEM(text)->canvas), - GNOME_CANVAS_ITEM(text), + e_canvas_item_ungrab (E_CANVAS (GNOME_CANVAS_ITEM (text)->canvas), + GNOME_CANVAS_ITEM (text), command->time); scroll = FALSE; break; @@ -3311,7 +3311,7 @@ e_text_command (ETextEventProcessor *tep, } text->needs_redraw = 1; - gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(text)); + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (text)); } /* Class initialization function for the text item */ @@ -3704,7 +3704,7 @@ e_text_init (EText *text) text->handle_popup = FALSE; - e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(text), e_text_reflow); + e_canvas_item_set_reflow_callback (GNOME_CANVAS_ITEM (text), e_text_reflow); } /* IM Context Callbacks */ diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c index 9145ed8b41..45bd9341ec 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/widgets/text/gal-a11y-e-text.c @@ -146,7 +146,7 @@ et_get_text (AtkText *text, static gboolean is_a_seperator (gunichar c) { - return g_unichar_ispunct(c) || g_unichar_isspace(c); + return g_unichar_ispunct (c) || g_unichar_isspace (c); } static gint @@ -480,7 +480,7 @@ et_get_caret_offset (AtkText *text) EText *etext; gint offset; - g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1); + g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text), -1); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); if (obj == NULL) return -1; @@ -526,14 +526,14 @@ et_get_character_extents (AtkText *text, GtkWidget *widget; PangoRectangle pango_pos; - g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text)); + g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text)); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); if (obj == NULL) return; g_return_if_fail (E_IS_TEXT (obj)); - etext = E_TEXT(obj); - canvas = GNOME_CANVAS_ITEM(etext)->canvas; - widget = GTK_WIDGET(canvas); + etext = E_TEXT (obj); + canvas = GNOME_CANVAS_ITEM (etext)->canvas; + widget = GTK_WIDGET (canvas); window = gtk_widget_get_window (widget); gdk_window_get_origin (window, &x_widget, &y_widget); @@ -604,14 +604,14 @@ et_get_offset_at_point (AtkText *text, gint index; gint trailing; - g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text), -1); + g_return_val_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text), -1); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); if (obj == NULL) return -1; g_return_val_if_fail (E_IS_TEXT (obj), -1); - etext = E_TEXT(obj); - canvas = GNOME_CANVAS_ITEM(etext)->canvas; - widget = GTK_WIDGET(canvas); + etext = E_TEXT (obj); + canvas = GNOME_CANVAS_ITEM (etext)->canvas; + widget = GTK_WIDGET (canvas); window = gtk_widget_get_window (widget); gdk_window_get_origin (window, &x_widget, &y_widget); @@ -880,7 +880,7 @@ et_delete_text (AtkEditableText *text, GObject *obj; EText *etext; - g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE(text)); + g_return_if_fail (ATK_IS_GOBJECT_ACCESSIBLE (text)); obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text)); if (obj == NULL) return; |