diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-29 23:50:53 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-01-30 09:22:57 +0800 |
commit | 21ab8044dab93b6367463593628ec42befda4f67 (patch) | |
tree | 50948c4b0675041b615b5113d7b9176f2d71db99 /widgets/table | |
parent | 8fade835168c511a89813019aef6d0ee02d63b5d (diff) | |
download | gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.gz gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.tar.zst gsoc2013-evolution-21ab8044dab93b6367463593628ec42befda4f67.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-table-click-to-add.h | 3 | ||||
-rw-r--r-- | widgets/table/e-table-field-chooser-item.c | 3 | ||||
-rw-r--r-- | widgets/table/e-table-header-item.c | 5 | ||||
-rw-r--r-- | widgets/table/e-table-header-item.h | 51 | ||||
-rw-r--r-- | widgets/table/e-table-header-utils.c | 23 | ||||
-rw-r--r-- | widgets/table/e-table-item.c | 2 | ||||
-rw-r--r-- | widgets/table/e-table.c | 26 | ||||
-rw-r--r-- | widgets/table/e-tree-model.h | 10 | ||||
-rw-r--r-- | widgets/table/e-tree.c | 44 |
9 files changed, 102 insertions, 65 deletions
diff --git a/widgets/table/e-table-click-to-add.h b/widgets/table/e-table-click-to-add.h index 49f8df334c..b92672d387 100644 --- a/widgets/table/e-table-click-to-add.h +++ b/widgets/table/e-table-click-to-add.h @@ -64,7 +64,8 @@ struct _ETableClickToAdd { gchar *message; - GnomeCanvasItem *row; /* If row is NULL, we're sitting with no data and a "Click here" message. */ + GnomeCanvasItem *row; /* If row is NULL, we're sitting with + * no data and a "Click here" message. */ GnomeCanvasItem *text; /* If text is NULL, row shouldn't be. */ GnomeCanvasItem *rect; /* What the heck. Why not. */ diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index 411c1b58f4..91a77c83c5 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -582,7 +582,8 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo button_height = e_table_header_compute_height (ecol, widget); window = gtk_widget_get_window (widget); - cs = gdk_window_create_similar_surface (window, CAIRO_CONTENT_COLOR, etfci->width, button_height); + cs = gdk_window_create_similar_surface ( + window, CAIRO_CONTENT_COLOR, etfci->width, button_height); style = gtk_widget_get_style (widget); state = gtk_widget_get_state (widget); diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index b7388fdfaa..0c56b59ea2 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -1235,9 +1235,8 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) col_width = ecol->width; s = cairo_image_surface_create (CAIRO_FORMAT_A1, col_width, ethi->height); cr = cairo_create (s); - pixbuf = gdk_pixbuf_get_from_surface(s, - 0, 0, - col_width, ethi->height); + pixbuf = gdk_pixbuf_get_from_surface ( + s, 0, 0, col_width, ethi->height); state = gtk_widget_get_state (widget); diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h index 4ab483a4ce..96f167b4e8 100644 --- a/widgets/table/e-table-header-item.h +++ b/widgets/table/e-table-header-item.h @@ -56,25 +56,25 @@ typedef struct _ETableHeaderItem ETableHeaderItem; typedef struct _ETableHeaderItemClass ETableHeaderItemClass; struct _ETableHeaderItem { - GnomeCanvasItem parent; - ETableHeader *eth; + GnomeCanvasItem parent; + ETableHeader *eth; - GdkCursor *change_cursor; - GdkCursor *resize_cursor; + GdkCursor *change_cursor; + GdkCursor *resize_cursor; - gshort height, width; + gshort height, width; PangoFontDescription *font_desc; /* - * Used during resizing; Could be shorts + * Used during resizing; Could be shorts */ - gint resize_col; - gint resize_start_pos; - gint resize_min_width; + gint resize_col; + gint resize_start_pos; + gint resize_min_width; - gpointer resize_guide; + gpointer resize_guide; - gint group_indent_width; + gint group_indent_width; /* * Ids @@ -84,20 +84,25 @@ struct _ETableHeaderItem { /* * For dragging columns */ - guint maybe_drag:1; - guint dnd_ready:1; - gint click_x, click_y; - gint drag_col, drop_col, drag_mark; - guint drag_motion_id, drag_end_id, drag_leave_id, drag_drop_id, drag_data_received_id, drag_data_get_id; - guint sort_info_changed_id, group_info_changed_id; + guint maybe_drag:1; + guint dnd_ready:1; + gint click_x, click_y; + gint drag_col, drop_col, drag_mark; + guint drag_motion_id; + guint drag_end_id; + guint drag_leave_id; + guint drag_drop_id; + guint drag_data_received_id; + guint drag_data_get_id; + guint sort_info_changed_id, group_info_changed_id; GnomeCanvasItem *remove_item; - gchar *dnd_code; + gchar *dnd_code; /* * For column sorting info */ - ETableSortInfo *sort_info; + ETableSortInfo *sort_info; guint scroll_direction : 4; gint last_drop_x; @@ -107,10 +112,10 @@ struct _ETableHeaderItem { gint scroll_idle_id; /* For adding fields. */ - ETableHeader *full_header; - ETable *table; - ETree *tree; - void *config; + ETableHeader *full_header; + ETable *table; + ETree *tree; + gpointer config; union { GtkWidget *widget; diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index da60ce03d9..55e90159c6 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -272,7 +272,8 @@ e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, } cairo_save (cr); - gdk_cairo_set_source_color (cr, >k_widget_get_style (GTK_WIDGET (g_label))->fg[state]); + gdk_cairo_set_source_color ( + cr, >k_widget_get_style (GTK_WIDGET (g_label))->fg[state]); xthick = style->xthickness; ythick = style->ythickness; @@ -321,7 +322,7 @@ e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, } layout = build_header_layout (widget, ecol->text); - pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END); + pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END); /* Pixbuf or label */ if (ecol->icon_name != NULL) { @@ -351,10 +352,12 @@ e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, ypos = inner_y; - pango_layout_set_width (layout, (inner_width - (xpos - inner_x)) * PANGO_SCALE); + pango_layout_set_width ( + layout, (inner_width - (xpos - inner_x)) * + PANGO_SCALE); - cairo_move_to (cr, xpos + pwidth + 1, ypos); - pango_cairo_show_layout (cr, layout); + cairo_move_to (cr, xpos + pwidth + 1, ypos); + pango_cairo_show_layout (cr, layout); } /* FIXME: For some reason, under clutter gdk_draw_rgb_image_dithalign crashes @@ -377,14 +380,14 @@ e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, g_object_unref (pixmap); } #endif - gdk_cairo_set_source_pixbuf (cr, ecol->pixbuf, + gdk_cairo_set_source_pixbuf (cr, ecol->pixbuf, xpos, inner_y + (inner_height - clip_height) / 2); - cairo_paint (cr); + cairo_paint (cr); } else { - pango_layout_set_width (layout, inner_width * PANGO_SCALE); + pango_layout_set_width (layout, inner_width * PANGO_SCALE); - cairo_move_to (cr, inner_x, inner_y); - pango_cairo_show_layout (cr, layout); + cairo_move_to (cr, inner_x, inner_y); + pango_cairo_show_layout (cr, layout); } switch (arrow) { diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index d5c9c2da14..75a8f44d5d 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -1743,7 +1743,7 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h GtkWidget *canvas = GTK_WIDGET (item->canvas); GtkStyle *style = gtk_widget_get_style (canvas); gint height_extra = eti->horizontal_draw_grid ? 1 : 0; - + /* * Find out our real position after grouping */ diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index 69e4241a7a..5028a48a6b 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -234,17 +234,21 @@ static void et_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) { ETable *et = E_TABLE (widget); - GTK_WIDGET_CLASS (e_table_parent_class)->get_preferred_width (widget, minimum, natural); + + GTK_WIDGET_CLASS (e_table_parent_class)-> + get_preferred_width (widget, minimum, natural); + if (et->horizontal_resize) { - *minimum = MAX (*minimum, et->header_width); - *natural = MAX (*natural, et->header_width); - } + *minimum = MAX (*minimum, et->header_width); + *natural = MAX (*natural, et->header_width); + } } static void et_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) { - GTK_WIDGET_CLASS (e_table_parent_class)->get_preferred_height (widget, minimum, natural); + GTK_WIDGET_CLASS (e_table_parent_class)-> + get_preferred_height (widget, minimum, natural); } static void @@ -3538,10 +3542,14 @@ e_table_class_init (ETableClass *class) G_PARAM_STATIC_STRINGS)); /* Scrollable interface */ - g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment"); - g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment"); - g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); - g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); + g_object_class_override_property ( + object_class, PROP_HADJUSTMENT, "hadjustment"); + g_object_class_override_property ( + object_class, PROP_VADJUSTMENT, "vadjustment"); + g_object_class_override_property ( + object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); + g_object_class_override_property ( + object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); gal_a11y_e_table_init (); } diff --git a/widgets/table/e-tree-model.h b/widgets/table/e-tree-model.h index 01c4bf4180..f857e52a49 100644 --- a/widgets/table/e-tree-model.h +++ b/widgets/table/e-tree-model.h @@ -227,24 +227,24 @@ void *e_tree_model_value_at (ETreeModel *etree, void e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, - const void *val); + gconstpointer val); gboolean e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col); void *e_tree_model_duplicate_value (ETreeModel *etree, gint col, - const void *value); + gconstpointer value); void e_tree_model_free_value (ETreeModel *etree, gint col, - void *value); + gpointer value); void *e_tree_model_initialize_value (ETreeModel *etree, gint col); gboolean e_tree_model_value_is_empty (ETreeModel *etree, gint col, - const void *value); + gconstpointer value); gchar * e_tree_model_value_to_string (ETreeModel *etree, gint col, - const void *value); + gconstpointer value); /* depth first traversal of path's descendents, calling func on each one */ void e_tree_model_node_traverse (ETreeModel *model, diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 4471514d68..b77bda8ef7 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1922,25 +1922,33 @@ et_get_property (GObject *object, break; case PROP_HADJUSTMENT: if (etree->priv->table_canvas) - g_object_get_property (G_OBJECT (etree->priv->table_canvas), "hadjustment", value); + g_object_get_property ( + G_OBJECT (etree->priv->table_canvas), + "hadjustment", value); else g_value_set_object (value, NULL); break; case PROP_VADJUSTMENT: if (etree->priv->table_canvas) - g_object_get_property (G_OBJECT (etree->priv->table_canvas), "vadjustment", value); + g_object_get_property ( + G_OBJECT (etree->priv->table_canvas), + "vadjustment", value); else g_value_set_object (value, NULL); break; case PROP_HSCROLL_POLICY: if (etree->priv->table_canvas) - g_object_get_property (G_OBJECT (etree->priv->table_canvas), "hscroll-policy", value); + g_object_get_property ( + G_OBJECT (etree->priv->table_canvas), + "hscroll-policy", value); else g_value_set_enum (value, 0); break; case PROP_VSCROLL_POLICY: if (etree->priv->table_canvas) - g_object_get_property (G_OBJECT (etree->priv->table_canvas), "vscroll-policy", value); + g_object_get_property ( + G_OBJECT (etree->priv->table_canvas), + "vscroll-policy", value); else g_value_set_enum (value, 0); break; @@ -2018,19 +2026,27 @@ et_set_property (GObject *object, case PROP_HADJUSTMENT: if (etree->priv->table_canvas) - g_object_set_property (G_OBJECT (etree->priv->table_canvas), "hadjustment", value); + g_object_set_property ( + G_OBJECT (etree->priv->table_canvas), + "hadjustment", value); break; case PROP_VADJUSTMENT: if (etree->priv->table_canvas) - g_object_set_property (G_OBJECT (etree->priv->table_canvas), "vadjustment", value); + g_object_set_property ( + G_OBJECT (etree->priv->table_canvas), + "vadjustment", value); break; case PROP_HSCROLL_POLICY: if (etree->priv->table_canvas) - g_object_set_property (G_OBJECT (etree->priv->table_canvas), "hscroll-policy", value); + g_object_set_property ( + G_OBJECT (etree->priv->table_canvas), + "hscroll-policy", value); break; case PROP_VSCROLL_POLICY: if (etree->priv->table_canvas) - g_object_set_property (G_OBJECT (etree->priv->table_canvas), "vscroll-policy", value); + g_object_set_property ( + G_OBJECT (etree->priv->table_canvas), + "vscroll-policy", value); break; } } @@ -3548,10 +3564,14 @@ e_tree_class_init (ETreeClass *class) G_PARAM_STATIC_STRINGS)); /* Scrollable interface */ - g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment"); - g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment"); - g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); - g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); + g_object_class_override_property ( + object_class, PROP_HADJUSTMENT, "hadjustment"); + g_object_class_override_property ( + object_class, PROP_VADJUSTMENT, "vadjustment"); + g_object_class_override_property ( + object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); + g_object_class_override_property ( + object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); gal_a11y_e_tree_init (); } |