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/table/e-table-click-to-add.c | |
parent | 1e3deb31476cf0026011876327be83e9a47847ee (diff) | |
download | gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.gz gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.tar.zst gsoc2013-evolution-ebcce86769d174cce6e881740c5e9bcedce28e06.zip |
Coding style and whitespace cleanups.
Diffstat (limited to 'widgets/table/e-table-click-to-add.c')
-rw-r--r-- | widgets/table/e-table-click-to-add.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index e50d0f4274..3d5a374382 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -47,7 +47,7 @@ enum { LAST_SIGNAL }; -static guint etcta_signals [LAST_SIGNAL] = { 0 }; +static guint etcta_signals[LAST_SIGNAL] = { 0 }; /* workaround for avoiding APi breakage */ #define etcta_get_type e_table_click_to_add_get_type @@ -66,7 +66,7 @@ static void etcta_cursor_change (GtkObject *object, gint row, gint col, ETableClickToAdd *etcta) { g_signal_emit (etcta, - etcta_signals [CURSOR_CHANGE], 0, + etcta_signals[CURSOR_CHANGE], 0, row, col); } @@ -100,7 +100,7 @@ etcta_add_table_header (ETableClickToAdd *etcta, ETableHeader *header) if (etcta->eth) g_object_ref (etcta->eth); if (etcta->row) - gnome_canvas_item_set(GNOME_CANVAS_ITEM(etcta->row), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etcta->row), "ETableHeader", header, NULL); } @@ -122,10 +122,10 @@ etcta_add_one (ETableClickToAdd *etcta, ETableModel *one) if (etcta->one) g_object_ref (etcta->one); if (etcta->row) - gnome_canvas_item_set(GNOME_CANVAS_ITEM(etcta->row), + gnome_canvas_item_set (GNOME_CANVAS_ITEM (etcta->row), "ETableModel", one, NULL); - g_object_set(etcta->selection, + g_object_set (etcta->selection, "model", one, NULL); } @@ -137,7 +137,7 @@ etcta_drop_one (ETableClickToAdd *etcta) return; g_object_unref (etcta->one); etcta->one = NULL; - g_object_set(etcta->selection, + g_object_set (etcta->selection, "model", NULL, NULL); } @@ -163,13 +163,13 @@ etcta_drop_model (ETableClickToAdd *etcta) static void etcta_add_message (ETableClickToAdd *etcta, const gchar *message) { - etcta->message = g_strdup(message); + etcta->message = g_strdup (message); } static void etcta_drop_message (ETableClickToAdd *etcta) { - g_free(etcta->message); + g_free (etcta->message); etcta->message = NULL; } @@ -204,11 +204,11 @@ etcta_set_property (GObject *object, switch (prop_id) { case PROP_HEADER: etcta_drop_table_header (etcta); - etcta_add_table_header (etcta, E_TABLE_HEADER(g_value_get_object (value))); + etcta_add_table_header (etcta, E_TABLE_HEADER (g_value_get_object (value))); break; case PROP_MODEL: etcta_drop_model (etcta); - etcta_add_model (etcta, E_TABLE_MODEL(g_value_get_object (value))); + etcta_add_model (etcta, E_TABLE_MODEL (g_value_get_object (value))); break; case PROP_MESSAGE: etcta_drop_message (etcta); @@ -217,15 +217,15 @@ etcta_set_property (GObject *object, case PROP_WIDTH: etcta->width = g_value_get_double (value); if (etcta->row) - gnome_canvas_item_set(etcta->row, + gnome_canvas_item_set (etcta->row, "minimum_width", etcta->width, NULL); if (etcta->text) - gnome_canvas_item_set(etcta->text, + gnome_canvas_item_set (etcta->text, "width", etcta->width - 4, NULL); if (etcta->rect) - gnome_canvas_item_set(etcta->rect, + gnome_canvas_item_set (etcta->rect, "x2", etcta->width - 1, NULL); break; @@ -234,7 +234,7 @@ etcta_set_property (GObject *object, return; } - gnome_canvas_item_request_update(item); + gnome_canvas_item_request_update (item); } static void @@ -285,7 +285,7 @@ etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p g_value_set_object (value, etcta->model); break; case PROP_MESSAGE: - g_value_set_string (value, g_strdup(etcta->message)); + g_value_set_string (value, g_strdup (etcta->message)); break; case PROP_WIDTH: g_value_set_double (value, etcta->width); @@ -334,7 +334,7 @@ item_key_press (ETableItem *item, case GDK_KP_Enter: case GDK_ISO_Enter: case GDK_3270_Enter: - finish_editing(etcta); + finish_editing (etcta); return TRUE; } return FALSE; @@ -343,7 +343,7 @@ item_key_press (ETableItem *item, static void set_initial_selection (ETableClickToAdd *etcta) { - e_selection_model_do_something (E_SELECTION_MODEL(etcta->selection), + e_selection_model_do_something (E_SELECTION_MODEL (etcta->selection), 0, e_table_header_prioritized_column (etcta->eth), 0); } @@ -355,19 +355,19 @@ finish_editing (ETableClickToAdd *etcta) ETableModel *one; e_table_item_leave_edit (E_TABLE_ITEM (etcta->row)); - e_table_one_commit(E_TABLE_ONE(etcta->one)); + e_table_one_commit (E_TABLE_ONE (etcta->one)); etcta_drop_one (etcta); - gtk_object_destroy(GTK_OBJECT (etcta->row)); + gtk_object_destroy (GTK_OBJECT (etcta->row)); etcta->row = NULL; - one = e_table_one_new(etcta->model); + one = e_table_one_new (etcta->model); etcta_add_one (etcta, one); g_object_unref (one); - e_selection_model_clear(E_SELECTION_MODEL(etcta->selection)); + e_selection_model_clear (E_SELECTION_MODEL (etcta->selection)); - etcta->row = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta), - e_table_item_get_type(), + etcta->row = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etcta), + e_table_item_get_type (), "ETableHeader", etcta->eth, "ETableModel", etcta->one, "minimum_width", etcta->width, @@ -378,7 +378,7 @@ finish_editing (ETableClickToAdd *etcta) NULL); g_signal_connect(etcta->row, "key_press", - G_CALLBACK(item_key_press), etcta); + G_CALLBACK (item_key_press), etcta); set_initial_selection (etcta); } @@ -398,24 +398,24 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_BUTTON_PRESS: if (etcta->text) { - gtk_object_destroy(GTK_OBJECT (etcta->text)); + gtk_object_destroy (GTK_OBJECT (etcta->text)); etcta->text = NULL; } if (etcta->rect) { - gtk_object_destroy(GTK_OBJECT (etcta->rect)); + gtk_object_destroy (GTK_OBJECT (etcta->rect)); etcta->rect = NULL; } if (!etcta->row) { ETableModel *one; - one = e_table_one_new(etcta->model); + one = e_table_one_new (etcta->model); etcta_add_one (etcta, one); g_object_unref (one); - e_selection_model_clear(E_SELECTION_MODEL(etcta->selection)); + e_selection_model_clear (E_SELECTION_MODEL (etcta->selection)); - etcta->row = gnome_canvas_item_new(GNOME_CANVAS_GROUP(item), - e_table_item_get_type(), + etcta->row = gnome_canvas_item_new (GNOME_CANVAS_GROUP (item), + e_table_item_get_type (), "ETableHeader", etcta->eth, "ETableModel", etcta->one, "minimum_width", etcta->width, @@ -428,7 +428,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) g_signal_connect(etcta->row, "key_press", G_CALLBACK (item_key_press), etcta); - e_canvas_item_grab_focus (GNOME_CANVAS_ITEM(etcta->row), TRUE); + e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (etcta->row), TRUE); set_initial_selection (etcta); } @@ -447,7 +447,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) if (etcta->row) { e_table_item_leave_edit (E_TABLE_ITEM (etcta->row)); etcta_drop_one (etcta); - gtk_object_destroy(GTK_OBJECT (etcta->row)); + gtk_object_destroy (GTK_OBJECT (etcta->row)); etcta->row = NULL; create_rect_and_text (etcta); e_canvas_item_move_absolute (etcta->text, 3, 3); @@ -470,32 +470,32 @@ etcta_reflow (GnomeCanvasItem *item, gint flags) gdouble old_height = etcta->height; if (etcta->text) { - g_object_get(etcta->text, + g_object_get (etcta->text, "height", &etcta->height, NULL); etcta->height += 6; } if (etcta->row) { - g_object_get(etcta->row, + g_object_get (etcta->row, "height", &etcta->height, NULL); } if (etcta->rect) { - g_object_set(etcta->rect, + g_object_set (etcta->rect, "y2", etcta->height - 1, NULL); } if (old_height != etcta->height) - e_canvas_item_request_parent_reflow(item); + e_canvas_item_request_parent_reflow (item); } static void etcta_class_init (ETableClickToAddClass *klass) { - GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS(klass); - GObjectClass *object_class = G_OBJECT_CLASS(klass); + GnomeCanvasItemClass *item_class = GNOME_CANVAS_ITEM_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); klass->cursor_change = NULL; klass->style_set = etcta_style_set; @@ -543,7 +543,7 @@ etcta_class_init (ETableClickToAddClass *klass) 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READABLE | G_PARAM_LAX_VALIDATION)); - etcta_signals [CURSOR_CHANGE] = + etcta_signals[CURSOR_CHANGE] = g_signal_new ("cursor_change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -552,7 +552,7 @@ etcta_class_init (ETableClickToAddClass *klass) e_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - etcta_signals [STYLE_SET] = + etcta_signals[STYLE_SET] = g_signal_new ("style_set", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, @@ -583,7 +583,7 @@ etcta_init (ETableClickToAdd *etcta) etcta->width = 12; etcta->height = 6; - etcta->selection = e_table_selection_model_new(); + etcta->selection = e_table_selection_model_new (); g_signal_connect(etcta->selection, "cursor_changed", G_CALLBACK (etcta_cursor_change), etcta); @@ -608,9 +608,9 @@ void e_table_click_to_add_commit (ETableClickToAdd *etcta) { if (etcta->row) { - e_table_one_commit(E_TABLE_ONE(etcta->one)); + e_table_one_commit (E_TABLE_ONE (etcta->one)); etcta_drop_one (etcta); - gtk_object_destroy(GTK_OBJECT (etcta->row)); + gtk_object_destroy (GTK_OBJECT (etcta->row)); etcta->row = NULL; } create_rect_and_text (etcta); |