aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-cell-checkbox.c5
-rw-r--r--widgets/table/e-cell-combo.c33
-rw-r--r--widgets/table/e-cell-date-edit.c53
-rw-r--r--widgets/table/e-cell-hbox.c2
-rw-r--r--widgets/table/e-cell-percent.c5
-rw-r--r--widgets/table/e-cell-pixbuf.c49
-rw-r--r--widgets/table/e-cell-popup.c80
-rw-r--r--widgets/table/e-cell-text.c282
-rw-r--r--widgets/table/e-cell-toggle.c11
-rw-r--r--widgets/table/e-cell-tree.c44
-rw-r--r--widgets/table/e-cell.h2
-rw-r--r--widgets/table/e-table-click-to-add.c250
-rw-r--r--widgets/table/e-table-col.c15
-rw-r--r--widgets/table/e-table-config.c69
-rw-r--r--widgets/table/e-table-field-chooser-dialog.c32
-rw-r--r--widgets/table/e-table-field-chooser-item.c112
-rw-r--r--widgets/table/e-table-field-chooser.c147
-rw-r--r--widgets/table/e-table-group-container.c459
-rw-r--r--widgets/table/e-table-group-leaf.c98
-rw-r--r--widgets/table/e-table-group.c205
-rw-r--r--widgets/table/e-table-header-item.c218
-rw-r--r--widgets/table/e-table-header.c149
-rw-r--r--widgets/table/e-table-item.c966
-rw-r--r--widgets/table/e-table-memory-store.c29
-rw-r--r--widgets/table/e-table-model.c20
-rw-r--r--widgets/table/e-table-search.c48
-rw-r--r--widgets/table/e-table-selection-model.c69
-rw-r--r--widgets/table/e-table-sort-info.c40
-rw-r--r--widgets/table/e-table-sorted-variable.c5
-rw-r--r--widgets/table/e-table-sorted.c5
-rw-r--r--widgets/table/e-table-sorter.c50
-rw-r--r--widgets/table/e-table-specification.c2
-rw-r--r--widgets/table/e-table-subset.c35
-rw-r--r--widgets/table/e-table-utils.c7
-rw-r--r--widgets/table/e-table.c176
-rw-r--r--widgets/table/e-tree-memory.c21
-rw-r--r--widgets/table/e-tree-model.c189
-rw-r--r--widgets/table/e-tree-sorted.c35
-rw-r--r--widgets/table/e-tree-table-adapter.c22
-rw-r--r--widgets/table/e-tree.c992
-rw-r--r--widgets/table/gal-a11y-e-cell-popup.c43
-rw-r--r--widgets/table/gal-a11y-e-cell-toggle.c35
-rw-r--r--widgets/table/gal-a11y-e-cell-tree.c73
-rw-r--r--widgets/table/gal-a11y-e-cell-vbox.c12
-rw-r--r--widgets/table/gal-a11y-e-cell.c47
-rw-r--r--widgets/table/gal-a11y-e-table-click-to-add.c8
-rw-r--r--widgets/table/gal-a11y-e-table-item.c167
-rw-r--r--widgets/table/gal-a11y-e-table.c8
-rw-r--r--widgets/table/gal-a11y-e-tree.c13
49 files changed, 3008 insertions, 2429 deletions
diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c
index 9e775761c7..0d30031397 100644
--- a/widgets/table/e-cell-checkbox.c
+++ b/widgets/table/e-cell-checkbox.c
@@ -52,10 +52,11 @@ ecc_print (ECellView *ecell_view,
{
cairo_t *cr = gtk_print_context_get_cairo_context (context);
const gint value = GPOINTER_TO_INT (
- e_table_model_value_at (ecell_view->e_table_model, model_col, row));
+ e_table_model_value_at (
+ ecell_view->e_table_model, model_col, row));
cairo_save (cr);
- if ( value == 1) {
+ if (value == 1) {
cairo_set_line_width (cr, 2);
cairo_move_to (cr, 3, 11);
cairo_line_to (cr, 7, 14);
diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c
index 422f9da815..48bf24724d 100644
--- a/widgets/table/e-cell-combo.c
+++ b/widgets/table/e-cell-combo.c
@@ -319,8 +319,9 @@ e_cell_combo_select_matching_item (ECellCombo *ecc)
eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
ecol = e_table_header_get_column (eti->header, ecp->popup_view_col);
- cell_text = e_cell_text_get_text (ecell_text, ecv->e_table_model,
- ecol->col_idx, ecp->popup_row);
+ cell_text = e_cell_text_get_text (
+ ecell_text, ecv->e_table_model,
+ ecol->col_idx, ecp->popup_row);
model = gtk_tree_view_get_model (GTK_TREE_VIEW (ecc->popup_tree_view));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ecc->popup_tree_view));
@@ -432,25 +433,21 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc,
x1 = e_table_header_col_diff (eti->header, 0, view_col + 1);
y1 = e_table_item_row_diff (eti, 0, row + 1);
- column_width = e_table_header_col_diff (eti->header, view_col,
- view_col + 1);
- row_height = e_table_item_row_diff (eti, row,
- row + 1);
+ column_width = e_table_header_col_diff (
+ eti->header, view_col, view_col + 1);
+ row_height = e_table_item_row_diff (eti, row, row + 1);
gnome_canvas_item_i2w (GNOME_CANVAS_ITEM (eti), &x1, &y1);
- gnome_canvas_world_to_window (GNOME_CANVAS (canvas),
- x1,
- y1,
- &wx,
- &wy);
+ gnome_canvas_world_to_window (
+ GNOME_CANVAS (canvas), x1, y1, &wx, &wy);
x1 = wx;
y1 = wy;
*x += x1;
/* The ETable positions don't include the grid lines, I think, so we add 1. */
- *y += y1 + 1
- - (gint) gtk_adjustment_get_value (
+ *y += y1 + 1 - (gint)
+ gtk_adjustment_get_value (
gtk_scrollable_get_vadjustment (
GTK_SCROLLABLE (&((GnomeCanvas *) canvas)->layout)))
+ ((GnomeCanvas *) canvas)->zoom_yofs;
@@ -712,13 +709,15 @@ e_cell_combo_update_cell (ECellCombo *ecc)
/* Compare it with the existing cell contents. */
ecol = e_table_header_get_column (eti->header, ecp->popup_view_col);
- old_text = e_cell_text_get_text (ecell_text, ecv->e_table_model,
- ecol->col_idx, ecp->popup_row);
+ old_text = e_cell_text_get_text (
+ ecell_text, ecv->e_table_model,
+ ecol->col_idx, ecp->popup_row);
/* If they are different, update the cell contents. */
if (old_text && strcmp (old_text, text)) {
- e_cell_text_set_value (ecell_text, ecv->e_table_model,
- ecol->col_idx, ecp->popup_row, text);
+ e_cell_text_set_value (
+ ecell_text, ecv->e_table_model,
+ ecol->col_idx, ecp->popup_row, text);
}
e_cell_text_free_text (ecell_text, old_text);
diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c
index 70c15dfafd..46f224f315 100644
--- a/widgets/table/e-cell-date-edit.c
+++ b/widgets/table/e-cell-date-edit.c
@@ -222,8 +222,9 @@ e_cell_date_edit_init (ECellDateEdit *ecde)
* ever be one popup in use at a time. */
ecde->popup_window = gtk_window_new (GTK_WINDOW_POPUP);
- gtk_window_set_type_hint (GTK_WINDOW (ecde->popup_window),
- GDK_WINDOW_TYPE_HINT_COMBO);
+ gtk_window_set_type_hint (
+ GTK_WINDOW (ecde->popup_window),
+ GDK_WINDOW_TYPE_HINT_COMBO);
gtk_window_set_resizable (GTK_WINDOW (ecde->popup_window), TRUE);
frame = gtk_frame_new (NULL);
@@ -240,9 +241,10 @@ e_cell_date_edit_init (ECellDateEdit *ecde)
gtk_widget_show (hbox);
ecde->calendar = e_calendar_new ();
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (E_CALENDAR (ecde->calendar)->calitem),
- "move_selection_when_moving", FALSE,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (E_CALENDAR (ecde->calendar)->calitem),
+ "move_selection_when_moving", FALSE,
+ NULL);
gtk_box_pack_start (GTK_BOX (hbox), ecde->calendar, TRUE, TRUE, 0);
gtk_widget_show (ecde->calendar);
@@ -252,15 +254,16 @@ e_cell_date_edit_init (ECellDateEdit *ecde)
ecde->time_entry = gtk_entry_new ();
gtk_widget_set_size_request (ecde->time_entry, 50, -1);
- gtk_box_pack_start (GTK_BOX (vbox2), ecde->time_entry,
- FALSE, FALSE, 0);
+ gtk_box_pack_start (
+ GTK_BOX (vbox2), ecde->time_entry,
+ FALSE, FALSE, 0);
gtk_widget_show (ecde->time_entry);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_box_pack_start (GTK_BOX (vbox2), scrolled_window, TRUE, TRUE, 0);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
- GTK_POLICY_NEVER,
- GTK_POLICY_ALWAYS);
+ gtk_scrolled_window_set_policy (
+ GTK_SCROLLED_WINDOW (scrolled_window),
+ GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
gtk_widget_show (scrolled_window);
store = gtk_list_store_new (1, G_TYPE_STRING);
@@ -541,14 +544,18 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde)
if (is_date) {
buffer[0] = '\0';
} else {
- e_time_format_time (&date_tm, ecde->use_24_hour_format,
- FALSE, buffer, sizeof (buffer));
+ e_time_format_time (
+ &date_tm, ecde->use_24_hour_format,
+ FALSE, buffer, sizeof (buffer));
}
gtk_entry_set_text (GTK_ENTRY (ecde->time_entry), buffer);
g_date_clear (&date, 1);
- g_date_set_dmy (&date, date_tm.tm_mday, date_tm.tm_mon + 1,
- date_tm.tm_year + 1900);
+ g_date_set_dmy (
+ &date,
+ date_tm.tm_mday,
+ date_tm.tm_mon + 1,
+ date_tm.tm_year + 1900);
e_calendar_item_set_selection (calitem, &date, &date);
if (is_date) {
@@ -660,17 +667,13 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde,
x1 = e_table_header_col_diff (eti->header, 0, view_col + 1);
y1 = e_table_item_row_diff (eti, 0, row + 1);
- column_width = e_table_header_col_diff (eti->header, view_col,
- view_col + 1);
- row_height = e_table_item_row_diff (eti, row,
- row + 1);
+ column_width = e_table_header_col_diff (
+ eti->header, view_col, view_col + 1);
+ row_height = e_table_item_row_diff (eti, row, row + 1);
gnome_canvas_item_i2w (GNOME_CANVAS_ITEM (eti), &x1, &y1);
- gnome_canvas_world_to_window (GNOME_CANVAS (canvas),
- x1,
- y1,
- &wx,
- &wy);
+ gnome_canvas_world_to_window (
+ GNOME_CANVAS (canvas), x1, y1, &wx, &wy);
x1 = wx;
y1 = wy;
@@ -816,8 +819,8 @@ e_cell_date_edit_on_ok_clicked (GtkWidget *button,
gboolean is_date = FALSE;
calitem = E_CALENDAR_ITEM (E_CALENDAR (ecde->calendar)->calitem);
- day_selected = e_calendar_item_get_selection (calitem, &start_date,
- &end_date);
+ day_selected = e_calendar_item_get_selection (
+ calitem, &start_date, &end_date);
text = gtk_entry_get_text (GTK_ENTRY (ecde->time_entry));
status = e_time_parse_time (text, &date_tm);
diff --git a/widgets/table/e-cell-hbox.c b/widgets/table/e-cell-hbox.c
index 6bca769174..74301a773c 100644
--- a/widgets/table/e-cell-hbox.c
+++ b/widgets/table/e-cell-hbox.c
@@ -166,7 +166,7 @@ ecv_draw (ECellView *ecell_view,
/* e_cell_max_width_by_row (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col, row);
if (width < hbox_view->def_size_cols[i])
width = hbox_view->def_size_cols[i];
- printf ("width of %d %d of %d\n", width,hbox_view->def_size_cols[i], allotted_width ); */
+ printf ("width of %d %d of %d\n", width,hbox_view->def_size_cols[i], allotted_width); */
e_cell_draw (
hbox_view->subcell_views[i], cr,
diff --git a/widgets/table/e-cell-percent.c b/widgets/table/e-cell-percent.c
index 61543b0e0c..81465d5a62 100644
--- a/widgets/table/e-cell-percent.c
+++ b/widgets/table/e-cell-percent.c
@@ -115,8 +115,9 @@ ecp_set_value (ECellText *cell,
}
}
- e_table_model_set_value_at (model, col, row,
- GINT_TO_POINTER (percent));
+ e_table_model_set_value_at (
+ model, col, row,
+ GINT_TO_POINTER (percent));
}
static void
diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c
index b2cf3e2a2d..41b030ec5a 100644
--- a/widgets/table/e-cell-pixbuf.c
+++ b/widgets/table/e-cell-pixbuf.c
@@ -356,25 +356,34 @@ e_cell_pixbuf_class_init (ECellPixbufClass *class)
ecc->print_height = pixbuf_print_height;
ecc->max_width = pixbuf_max_width;
- g_object_class_install_property (object_class, PROP_SELECTED_COLUMN,
- g_param_spec_int ("selected_column",
- "Selected Column",
- NULL,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FOCUSED_COLUMN,
- g_param_spec_int ("focused_column",
- "Focused Column",
- NULL,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNSELECTED_COLUMN,
- g_param_spec_int ("unselected_column",
- "Unselected Column",
- NULL,
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_SELECTED_COLUMN,
+ g_param_spec_int (
+ "selected_column",
+ "Selected Column",
+ NULL,
+ 0, G_MAXINT, 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FOCUSED_COLUMN,
+ g_param_spec_int (
+ "focused_column",
+ "Focused Column",
+ NULL,
+ 0, G_MAXINT, 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_UNSELECTED_COLUMN,
+ g_param_spec_int (
+ "unselected_column",
+ "Unselected Column",
+ NULL,
+ 0, G_MAXINT, 0,
+ G_PARAM_READWRITE));
}
diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c
index 65440b2465..0f549748fe 100644
--- a/widgets/table/e-cell-popup.c
+++ b/widgets/table/e-cell-popup.c
@@ -131,9 +131,9 @@ e_cell_popup_class_init (ECellPopupClass *class)
ecc->max_width = ecp_max_width;
ecc->get_bg_color = ecp_get_bg_color;
- gal_a11y_e_cell_registry_add_cell_type (NULL,
- E_TYPE_CELL_POPUP,
- gal_a11y_e_cell_popup_new);
+ gal_a11y_e_cell_registry_add_cell_type (
+ NULL, E_TYPE_CELL_POPUP,
+ gal_a11y_e_cell_popup_new);
}
static void
@@ -190,8 +190,9 @@ ecp_new_view (ECell *ecell,
ecp_view->cell_view.kill_view_cb = NULL;
ecp_view->cell_view.kill_view_cb_data = NULL;
- ecp_view->child_view = e_cell_new_view (ecp->child, table_model,
- e_table_item_view);
+ ecp_view->child_view = e_cell_new_view (
+ ecp->child, table_model,
+ e_table_item_view);
return (ECellView *) ecp_view;
}
@@ -277,9 +278,9 @@ ecp_draw (ECellView *ecv,
e_table_model_is_cell_editable (
ecv->e_table_model, model_col, row) &&
(flags & E_CELL_CURSOR ||
- (ecp->popup_shown && ecp->popup_view_col == view_col
- && ecp->popup_row == row
- && ecp->popup_model == ((ECellView *) ecp_view)->e_table_model));
+ (ecp->popup_shown && ecp->popup_view_col == view_col
+ && ecp->popup_row == row
+ && ecp->popup_model == ((ECellView *) ecp_view)->e_table_model));
if (flags & E_CELL_CURSOR)
ecp->popup_arrow_shown = show_popup_arrow;
@@ -287,9 +288,10 @@ ecp_draw (ECellView *ecv,
if (show_popup_arrow) {
GtkStyle *style;
- e_cell_draw (ecp_view->child_view, cr, model_col,
- view_col, row, flags,
- x1, y1, x2 - E_CELL_POPUP_ARROW_WIDTH, y2);
+ e_cell_draw (
+ ecp_view->child_view, cr, model_col,
+ view_col, row, flags,
+ x1, y1, x2 - E_CELL_POPUP_ARROW_WIDTH, y2);
rect.x = x2 - E_CELL_POPUP_ARROW_WIDTH;
rect.y = y1 + 1;
@@ -303,21 +305,24 @@ ecp_draw (ECellView *ecv,
style = gtk_widget_get_style (canvas);
- gtk_paint_box (style, cr,
- GTK_STATE_NORMAL, shadow,
- canvas, "ecellpopup",
- rect.x, rect.y, rect.width, rect.height);
- gtk_paint_arrow (style, cr,
- GTK_STATE_NORMAL, GTK_SHADOW_NONE,
- canvas, NULL,
- GTK_ARROW_DOWN, TRUE,
- rect.x + E_CELL_POPUP_ARROW_XPAD,
- rect.y + E_CELL_POPUP_ARROW_YPAD,
- rect.width - E_CELL_POPUP_ARROW_XPAD * 2,
- rect.height - E_CELL_POPUP_ARROW_YPAD * 2);
+ gtk_paint_box (
+ style, cr,
+ GTK_STATE_NORMAL, shadow,
+ canvas, "ecellpopup",
+ rect.x, rect.y, rect.width, rect.height);
+ gtk_paint_arrow (
+ style, cr,
+ GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+ canvas, NULL,
+ GTK_ARROW_DOWN, TRUE,
+ rect.x + E_CELL_POPUP_ARROW_XPAD,
+ rect.y + E_CELL_POPUP_ARROW_YPAD,
+ rect.width - E_CELL_POPUP_ARROW_XPAD * 2,
+ rect.height - E_CELL_POPUP_ARROW_YPAD * 2);
} else {
- e_cell_draw (ecp_view->child_view, cr, model_col,
- view_col, row, flags, x1, y1, x2, y2);
+ e_cell_draw (
+ ecp_view->child_view, cr, model_col,
+ view_col, row, flags, x1, y1, x2, y2);
}
cairo_restore (cr);
@@ -345,8 +350,9 @@ ecp_event (ECellView *ecv,
if (e_table_model_is_cell_editable (ecv->e_table_model, model_col, row) &&
flags & E_CELL_CURSOR
&& ecp->popup_arrow_shown) {
- width = e_table_header_col_diff (eti->header, view_col,
- view_col + 1);
+ width = e_table_header_col_diff (
+ eti->header, view_col,
+ view_col + 1);
/* FIXME: The event coords seem to be relative to the
* text within the cell, so we have to add 4. */
@@ -366,8 +372,9 @@ ecp_event (ECellView *ecv,
break;
}
- return e_cell_event (ecp_view->child_view, event, model_col, view_col,
- row, flags, actions);
+ return e_cell_event (
+ ecp_view->child_view, event, model_col, view_col,
+ row, flags, actions);
}
/*
@@ -410,8 +417,9 @@ ecp_leave_edit (ECellView *ecv,
{
ECellPopupView *ecp_view = (ECellPopupView *) ecv;
- e_cell_leave_edit (ecp_view->child_view, model_col, view_col, row,
- edit_context);
+ e_cell_leave_edit (
+ ecp_view->child_view, model_col, view_col, row,
+ edit_context);
}
static void
@@ -425,8 +433,9 @@ ecp_print (ECellView *ecv,
{
ECellPopupView *ecp_view = (ECellPopupView *) ecv;
- e_cell_print (ecp_view->child_view, context, model_col, view_col, row,
- width, height);
+ e_cell_print (
+ ecp_view->child_view, context, model_col, view_col, row,
+ width, height);
}
static gdouble
@@ -439,8 +448,9 @@ ecp_print_height (ECellView *ecv,
{
ECellPopupView *ecp_view = (ECellPopupView *) ecv;
- return e_cell_print_height (ecp_view->child_view, context, model_col,
- view_col, row, width);
+ return e_cell_print_height (
+ ecp_view->child_view, context, model_col,
+ view_col, row, width);
}
static gint
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 6e28c8b7b2..f1d852a951 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -305,8 +305,9 @@ ect_stop_editing (ECellTextView *text_view,
ECellText *ect = (ECellText *) ecell_view->ecell;
if (strcmp (old_text, text)) {
- e_cell_text_set_value (ect, ecell_view->e_table_model,
- model_col, row, text);
+ e_cell_text_set_value (
+ ect, ecell_view->e_table_model,
+ model_col, row, text);
}
}
g_free (text);
@@ -463,9 +464,10 @@ layout_with_preedit (ECellTextView *text_view,
gint text_length = strlen (text);
gint mlen = MIN (edit->selection_start,text_length);
- gtk_im_context_get_preedit_string (edit->im_context,
- &preedit_string,&preedit_attrs,
- NULL);
+ gtk_im_context_get_preedit_string (
+ edit->im_context,
+ &preedit_string,&preedit_attrs,
+ NULL);
preedit_length = edit->preedit_length = strlen (preedit_string);;
layout = edit->layout;
@@ -770,9 +772,8 @@ ect_draw (ECellView *ecell_view,
indices[0] = MIN (edit->selection_start, edit->selection_end);
indices[1] = MAX (edit->selection_start, edit->selection_end);
- clip_region = gdk_pango_layout_get_clip_region (layout,
- x_origin, y_origin,
- indices, 1);
+ clip_region = gdk_pango_layout_get_clip_region (
+ layout, x_origin, y_origin, indices, 1);
gdk_cairo_region (cr, clip_region);
cairo_clip (cr);
cairo_region_destroy (clip_region);
@@ -815,8 +816,9 @@ ect_get_bg_color (ECellView *ecell_view,
if (ect->bg_color_column == -1)
return NULL;
- color_spec = e_table_model_value_at (ecell_view->e_table_model,
- ect->bg_color_column, row);
+ color_spec = e_table_model_value_at (
+ ecell_view->e_table_model,
+ ect->bg_color_column, row);
return color_spec;
}
@@ -867,7 +869,7 @@ ect_event (ECellView *ecell_view,
if (!(flags & E_CELL_EDITING))
return 0;
- if ( edit && !edit->preedit_length && flags & E_CELL_PREEDIT)
+ if (edit && !edit->preedit_length && flags & E_CELL_PREEDIT)
return 1;
if (edit && edit->view_col == view_col && edit->row == row) {
@@ -970,8 +972,8 @@ ect_event (ECellView *ecell_view,
e_tep_event.button.position = get_position_from_xy (edit, event->button.x, event->button.y);
_get_tep (edit);
edit->actions = 0;
- return_val = e_text_event_processor_handle_event (edit->tep,
- &e_tep_event);
+ return_val = e_text_event_processor_handle_event (
+ edit->tep, &e_tep_event);
*actions = edit->actions;
if (event->button.button == 1) {
if (event->type == GDK_BUTTON_PRESS)
@@ -993,8 +995,8 @@ ect_event (ECellView *ecell_view,
e_tep_event.button.position = get_position_from_xy (edit, event->button.x, event->button.y);
_get_tep (edit);
edit->actions = 0;
- return_val = e_text_event_processor_handle_event (edit->tep,
- &e_tep_event);
+ return_val = e_text_event_processor_handle_event (
+ edit->tep, &e_tep_event);
*actions = edit->actions;
if (event->button.button == 1) {
if (event->type == GDK_BUTTON_PRESS)
@@ -1017,8 +1019,8 @@ ect_event (ECellView *ecell_view,
e_tep_event.motion.position = get_position_from_xy (edit, event->motion.x, event->motion.y);
_get_tep (edit);
edit->actions = 0;
- return_val = e_text_event_processor_handle_event (edit->tep,
- &e_tep_event);
+ return_val = e_text_event_processor_handle_event (
+ edit->tep, &e_tep_event);
*actions = edit->actions;
edit->lastx = motion.x;
edit->lasty = motion.y;
@@ -1421,7 +1423,7 @@ ect_print_height (ECellView *ecell_view,
/* Checking if the text width goes beyond the column width to increase the
* number of lines.
*/
- if ( text_width > width - 4)
+ if (text_width > width - 4)
lines = (text_width / (width - 4)) + 1;
return 16 *lines + 8;
}
@@ -1603,69 +1605,93 @@ e_cell_text_class_init (ECellTextClass *class)
object_class->get_property = ect_get_property;
object_class->set_property = ect_set_property;
- signals[TEXT_INSERTED] =
- g_signal_new ("text_inserted",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (ECellTextClass, text_inserted),
- NULL, NULL,
- e_marshal_VOID__POINTER_INT_INT_INT_INT,
- G_TYPE_NONE, 5,
- G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT,
- G_TYPE_INT, G_TYPE_INT);
-
- signals[TEXT_DELETED] =
- g_signal_new ("text_deleted",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (ECellTextClass, text_deleted),
- NULL, NULL,
- e_marshal_VOID__POINTER_INT_INT_INT_INT,
- G_TYPE_NONE, 5,
- G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT,
- G_TYPE_INT, G_TYPE_INT);
-
- g_object_class_install_property (object_class, PROP_STRIKEOUT_COLUMN,
- g_param_spec_int ("strikeout_column",
- "Strikeout Column",
- NULL,
- -1, G_MAXINT, -1,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNDERLINE_COLUMN,
- g_param_spec_int ("underline_column",
- "Underline Column",
- NULL,
- -1, G_MAXINT, -1,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_BOLD_COLUMN,
- g_param_spec_int ("bold_column",
- "Bold Column",
- NULL,
- -1, G_MAXINT, -1,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_COLOR_COLUMN,
- g_param_spec_int ("color_column",
- "Color Column",
- NULL,
- -1, G_MAXINT, -1,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_EDITABLE,
- g_param_spec_boolean ("editable",
- "Editable",
- NULL,
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_BG_COLOR_COLUMN,
- g_param_spec_int ("bg_color_column",
- "BG Color Column",
- NULL,
- -1, G_MAXINT, -1,
- G_PARAM_READWRITE));
+ signals[TEXT_INSERTED] = g_signal_new (
+ "text_inserted",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (ECellTextClass, text_inserted),
+ NULL, NULL,
+ e_marshal_VOID__POINTER_INT_INT_INT_INT,
+ G_TYPE_NONE, 5,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT);
+
+ signals[TEXT_DELETED] = g_signal_new (
+ "text_deleted",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (ECellTextClass, text_deleted),
+ NULL, NULL,
+ e_marshal_VOID__POINTER_INT_INT_INT_INT,
+ G_TYPE_NONE, 5,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_INT);
+
+ g_object_class_install_property (
+ object_class,
+ PROP_STRIKEOUT_COLUMN,
+ g_param_spec_int (
+ "strikeout_column",
+ "Strikeout Column",
+ NULL,
+ -1, G_MAXINT, -1,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_UNDERLINE_COLUMN,
+ g_param_spec_int (
+ "underline_column",
+ "Underline Column",
+ NULL,
+ -1, G_MAXINT, -1,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_BOLD_COLUMN,
+ g_param_spec_int (
+ "bold_column",
+ "Bold Column",
+ NULL,
+ -1, G_MAXINT, -1,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_COLOR_COLUMN,
+ g_param_spec_int (
+ "color_column",
+ "Color Column",
+ NULL,
+ -1, G_MAXINT, -1,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_EDITABLE,
+ g_param_spec_boolean (
+ "editable",
+ "Editable",
+ NULL,
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_BG_COLOR_COLUMN,
+ g_param_spec_int (
+ "bg_color_column",
+ "BG Color Column",
+ NULL,
+ -1, G_MAXINT, -1,
+ G_PARAM_READWRITE));
if (!clipboard_atom)
clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
@@ -1702,8 +1728,8 @@ e_cell_text_get_cursor_locations (ECellTextView *tv,
row = edit->row;
col = edit->view_col;
- e_table_item_get_cell_geometry (item, &row, &col,
- &x, &y, NULL, &area.height);
+ e_table_item_get_cell_geometry (
+ item, &row, &col, &x, &y, NULL, &area.height);
gnome_canvas_item_get_bounds (GNOME_CANVAS_ITEM (parent_item), &x1, &y1, NULL, NULL);
@@ -1711,10 +1737,11 @@ e_cell_text_get_cursor_locations (ECellTextView *tv,
index = edit->selection_end + edit->preedit_pos;
- pango_layout_get_cursor_pos (edit->layout,
- index,
- strong_pos ? &pango_strong_pos : NULL,
- weak_pos ? &pango_weak_pos : NULL);
+ pango_layout_get_cursor_pos (
+ edit->layout,
+ index,
+ strong_pos ? &pango_strong_pos : NULL,
+ weak_pos ? &pango_weak_pos : NULL);
if (strong_pos) {
strong_pos->x = x + x1 - cx - edit->xofs_edit + pango_strong_pos.x / PANGO_SCALE;
@@ -1749,8 +1776,9 @@ e_cell_text_preedit_changed_cb (GtkIMContext *context,
gchar *preedit_string;
gint cursor_pos;
CellEdit *edit = tv->edit;
- gtk_im_context_get_preedit_string (edit->im_context, &preedit_string,
- NULL, &cursor_pos);
+ gtk_im_context_get_preedit_string (
+ edit->im_context, &preedit_string,
+ NULL, &cursor_pos);
edit->preedit_length = strlen (preedit_string);
cursor_pos = CLAMP (cursor_pos, 0, g_utf8_strlen (preedit_string, -1));
@@ -1784,11 +1812,11 @@ e_cell_text_retrieve_surrounding_cb (GtkIMContext *context,
{
CellEdit *edit = tv->edit;
- gtk_im_context_set_surrounding (context,
- edit->text,
- strlen (edit->text),
- MIN (edit->selection_start, edit->selection_end)
- );
+ gtk_im_context_set_surrounding (
+ context,
+ edit->text,
+ strlen (edit->text),
+ MIN (edit->selection_start, edit->selection_end));
return TRUE;
}
@@ -1804,8 +1832,9 @@ e_cell_text_delete_surrounding_cb (GtkIMContext *context,
CellEdit *edit = tv->edit;
text_len = g_utf8_strlen (edit->text, -1);
- begin_pos = g_utf8_pointer_to_offset (edit->text,
- edit->text + MIN (edit->selection_start, edit->selection_end));
+ begin_pos = g_utf8_pointer_to_offset (
+ edit->text,
+ edit->text + MIN (edit->selection_start, edit->selection_end));
begin_pos += offset;
end_pos = begin_pos + n_chars;
if (begin_pos < 0 || text_len < begin_pos)
@@ -2023,8 +2052,9 @@ _blink_scroll_timeout (gpointer data)
e_tep_event.motion.time = 0;
e_tep_event.motion.position = get_position_from_xy (edit, edit->lastx, edit->lasty);
_get_tep (edit);
- e_text_event_processor_handle_event (edit->tep,
- &e_tep_event);
+ e_text_event_processor_handle_event (
+ edit->tep,
+ &e_tep_event);
edit->scroll_start = current_time;
}
}
@@ -2168,13 +2198,14 @@ _get_position (ECellTextView *text_view,
return 0;
case E_TEP_FORWARD_LINE:
- pango_layout_move_cursor_visually (edit->layout,
- TRUE,
- edit->selection_end,
- 0,
- TRUE,
- &index,
- &trailing);
+ pango_layout_move_cursor_visually (
+ edit->layout,
+ TRUE,
+ edit->selection_end,
+ 0,
+ TRUE,
+ &index,
+ &trailing);
index = g_utf8_offset_to_pointer (edit->text + index, trailing) - edit->text;
if (index < 0)
return 0;
@@ -2183,13 +2214,14 @@ _get_position (ECellTextView *text_view,
return length;
return index;
case E_TEP_BACKWARD_LINE:
- pango_layout_move_cursor_visually (edit->layout,
- TRUE,
- edit->selection_end,
- 0,
- TRUE,
- &index,
- &trailing);
+ pango_layout_move_cursor_visually (
+ edit->layout,
+ TRUE,
+ edit->selection_end,
+ 0,
+ TRUE,
+ &index,
+ &trailing);
index = g_utf8_offset_to_pointer (edit->text + index, trailing) - edit->text;
if (index < 0)
@@ -2360,9 +2392,10 @@ e_cell_text_view_command (ETextEventProcessor *tep,
sel_start = MIN (edit->selection_start, edit->selection_end);
sel_end = MAX (edit->selection_start, edit->selection_end);
if (sel_start != sel_end) {
- e_cell_text_view_supply_selection (edit, command->time, GDK_SELECTION_PRIMARY,
- edit->text + sel_start,
- sel_end - sel_start);
+ e_cell_text_view_supply_selection (
+ edit, command->time, GDK_SELECTION_PRIMARY,
+ edit->text + sel_start,
+ sel_end - sel_start);
} else if (edit->timer) {
g_timer_reset (edit->timer);
}
@@ -2395,9 +2428,10 @@ e_cell_text_view_command (ETextEventProcessor *tep,
sel_start = MIN (edit->selection_start, edit->selection_end);
sel_end = MAX (edit->selection_start, edit->selection_end);
if (sel_start != sel_end) {
- e_cell_text_view_supply_selection (edit, command->time, clipboard_atom,
- edit->text + sel_start,
- sel_end - sel_start);
+ e_cell_text_view_supply_selection (
+ edit, command->time, clipboard_atom,
+ edit->text + sel_start,
+ sel_end - sel_start);
}
if (edit->timer) {
g_timer_reset (edit->timer);
@@ -2520,9 +2554,10 @@ e_cell_text_view_get_selection (CellEdit *edit,
guint32 time)
{
#if DO_SELECTION
- gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (edit->text_view->canvas),
- selection),
- paste_received, edit);
+ gtk_clipboard_request_text (
+ gtk_widget_get_clipboard (GTK_WIDGET (edit->text_view->canvas),
+ selection),
+ paste_received, edit);
#endif
}
@@ -2764,8 +2799,9 @@ e_cell_text_get_text_by_view (ECellView *cell_view,
if (edit && ectv->edit->row == row && ectv->edit->model_col == col) { /* being editted now */
ret = g_strdup (edit->text);
} else{
- model_text = e_cell_text_get_text (E_CELL_TEXT (cell_view->ecell),
- cell_view->e_table_model, col, row);
+ model_text = e_cell_text_get_text (
+ E_CELL_TEXT (cell_view->ecell),
+ cell_view->e_table_model, col, row);
ret = g_strdup (model_text);
e_cell_text_free_text (E_CELL_TEXT (cell_view->ecell), model_text);
}
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index cf5db5858a..f4de9d6922 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -186,7 +186,7 @@ cell_toggle_draw (ECellView *ecell_view,
gint x, y;
const gint value = GPOINTER_TO_INT (
- e_table_model_value_at (ecell_view->e_table_model, model_col, row));
+ e_table_model_value_at (ecell_view->e_table_model, model_col, row));
priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
@@ -307,9 +307,12 @@ cell_toggle_print (ECellView *ecell_view,
image = gdk_pixbuf_add_alpha (image, TRUE, 255, 255, 255);
image_width = (gdouble) gdk_pixbuf_get_width (image);
image_height = (gdouble) gdk_pixbuf_get_height (image);
- cairo_rectangle (cr, image_width / 7, image_height / 3,
- image_width - image_width / 4,
- image_width - image_height / 7);
+ cairo_rectangle (
+ cr,
+ image_width / 7,
+ image_height / 3,
+ image_width - image_width / 4,
+ image_width - image_height / 7);
cairo_clip (cr);
gdk_cairo_set_source_pixbuf (cr, image, 0, image_height / 4);
cairo_paint (cr);
diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c
index e4bb093912..3a3bd7be99 100644
--- a/widgets/table/e-cell-tree.c
+++ b/widgets/table/e-cell-tree.c
@@ -280,9 +280,10 @@ ect_draw (ECellView *ecell_view,
}
if (node_image) {
- gdk_cairo_set_source_pixbuf (cr, node_image,
- x1 + subcell_offset,
- y1 + (y2 - y1) / 2 - node_image_height / 2);
+ gdk_cairo_set_source_pixbuf (
+ cr, node_image,
+ x1 + subcell_offset,
+ y1 + (y2 - y1) / 2 - node_image_height / 2);
cairo_paint (cr);
subcell_offset += node_image_width;
@@ -291,9 +292,10 @@ ect_draw (ECellView *ecell_view,
/* Now cause our subcell to draw its contents, shifted by
* subcell_offset pixels */
- e_cell_draw (tree_view->subcell_view, cr,
- model_col, view_col, row, flags,
- x1 + subcell_offset, y1, x2, y2);
+ e_cell_draw (
+ tree_view->subcell_view, cr,
+ model_col, view_col, row, flags,
+ x1 + subcell_offset, y1, x2, y2);
cairo_restore (cr);
}
@@ -426,8 +428,9 @@ ect_event (ECellView *ecell_view,
cairo_t *cr;
gint hgt;
- e_table_item_get_cell_geometry (tree_view->cell_view.e_table_item_view,
- &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height);
+ e_table_item_get_cell_geometry (
+ tree_view->cell_view.e_table_item_view,
+ &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height);
area.width = offset - 2;
hgt = e_cell_height (ecell_view, model_col, view_col, row);
@@ -466,8 +469,9 @@ ect_event (ECellView *ecell_view,
gint tmp_row = row;
cairo_t *cr;
- e_table_item_get_cell_geometry (tree_view->cell_view.e_table_item_view,
- &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height);
+ e_table_item_get_cell_geometry (
+ tree_view->cell_view.e_table_item_view,
+ &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height);
area.width = offset - 2;
cr = gdk_cairo_create (window);
@@ -492,8 +496,9 @@ ect_event (ECellView *ecell_view,
GdkRectangle area;
cairo_t *cr;
- e_table_item_get_cell_geometry (tree_view->cell_view.e_table_item_view,
- &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height);
+ e_table_item_get_cell_geometry (
+ tree_view->cell_view.e_table_item_view,
+ &tmp_row, &view_col, &area.x, &area.y, NULL, &area.height);
area.width = offset - 2;
cr = gdk_cairo_create (window);
@@ -666,16 +671,19 @@ ect_print (ECellView *ecell_view,
if (!e_tree_model_node_is_root (tree_model, node)
|| e_tree_model_node_get_children (tree_model, node, NULL) > 0) {
- cairo_move_to (cr,
+ cairo_move_to (
+ cr,
offset - INDENT_AMOUNT / 2,
height / 2);
cairo_line_to (cr, offset, height / 2);
}
if (visible_depth_of_node (ecell_view->e_table_model, row) != 0) {
- cairo_move_to (cr,
+ cairo_move_to (
+ cr,
offset - INDENT_AMOUNT / 2, height);
- cairo_line_to (cr,
+ cairo_line_to (
+ cr,
offset - INDENT_AMOUNT / 2,
e_tree_table_adapter_node_get_next
(tree_table_adapter, node) ? 0 :
@@ -690,10 +698,12 @@ ect_print (ECellView *ecell_view,
offset -= INDENT_AMOUNT;
while (node && depth != 0) {
if (e_tree_table_adapter_node_get_next (tree_table_adapter, node)) {
- cairo_move_to (cr,
+ cairo_move_to (
+ cr,
offset - INDENT_AMOUNT / 2,
height);
- cairo_line_to (cr,
+ cairo_line_to (
+ cr,
offset - INDENT_AMOUNT / 2, 0);
}
node = e_tree_model_node_get_parent (tree_model, node);
diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h
index 830184c06d..38fcc68c32 100644
--- a/widgets/table/e-cell.h
+++ b/widgets/table/e-cell.h
@@ -92,7 +92,7 @@ struct _ECellView {
gint focus_x1, focus_y1, focus_x2, focus_y2;
gint focus_col, focus_row;
- void (*kill_view_cb) (struct _ECellView *, gpointer );
+ void (*kill_view_cb) (struct _ECellView *, gpointer);
GList *kill_view_cb_data;
};
diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c
index d14350fa55..b08d3fcf39 100644
--- a/widgets/table/e-table-click-to-add.c
+++ b/widgets/table/e-table-click-to-add.c
@@ -68,9 +68,10 @@ etcta_cursor_change (GObject *object,
gint col,
ETableClickToAdd *etcta)
{
- g_signal_emit (etcta,
- etcta_signals[CURSOR_CHANGE], 0,
- row, col);
+ g_signal_emit (
+ etcta,
+ etcta_signals[CURSOR_CHANGE], 0,
+ row, col);
}
static void
@@ -105,9 +106,10 @@ etcta_add_table_header (ETableClickToAdd *etcta,
if (etcta->eth)
g_object_ref (etcta->eth);
if (etcta->row)
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etcta->row),
- "ETableHeader", header,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etcta->row),
+ "ETableHeader", header,
+ NULL);
}
static void
@@ -128,12 +130,14 @@ etcta_add_one (ETableClickToAdd *etcta,
if (etcta->one)
g_object_ref (etcta->one);
if (etcta->row)
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etcta->row),
- "ETableModel", one,
- NULL);
- g_object_set (etcta->selection,
- "model", one,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etcta->row),
+ "ETableModel", one,
+ NULL);
+ g_object_set (
+ etcta->selection,
+ "model", one,
+ NULL);
}
static void
@@ -143,9 +147,10 @@ etcta_drop_one (ETableClickToAdd *etcta)
return;
g_object_unref (etcta->one);
etcta->one = NULL;
- g_object_set (etcta->selection,
- "model", NULL,
- NULL);
+ g_object_set (
+ etcta->selection,
+ "model", NULL,
+ NULL);
}
static void
@@ -225,17 +230,20 @@ etcta_set_property (GObject *object,
case PROP_WIDTH:
etcta->width = g_value_get_double (value);
if (etcta->row)
- gnome_canvas_item_set (etcta->row,
- "minimum_width", etcta->width,
- NULL);
+ gnome_canvas_item_set (
+ etcta->row,
+ "minimum_width", etcta->width,
+ NULL);
if (etcta->text)
- gnome_canvas_item_set (etcta->text,
- "width", (etcta->width < 4 ? 4 : etcta->width) - 4,
- NULL);
+ gnome_canvas_item_set (
+ etcta->text,
+ "width", (etcta->width < 4 ? 4 : etcta->width) - 4,
+ NULL);
if (etcta->rect)
- gnome_canvas_item_set (etcta->rect,
- "x2", etcta->width - 1,
- NULL);
+ gnome_canvas_item_set (
+ etcta->rect,
+ "x2", etcta->width - 1,
+ NULL);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
@@ -352,9 +360,10 @@ item_key_press (ETableItem *item,
static void
set_initial_selection (ETableClickToAdd *etcta)
{
- e_selection_model_do_something (E_SELECTION_MODEL (etcta->selection),
- 0, e_table_header_prioritized_column (etcta->eth),
- 0);
+ e_selection_model_do_something (
+ E_SELECTION_MODEL (etcta->selection),
+ 0, e_table_header_prioritized_column (etcta->eth),
+ 0);
}
static void
@@ -375,16 +384,17 @@ finish_editing (ETableClickToAdd *etcta)
e_selection_model_clear (E_SELECTION_MODEL (etcta->selection));
- 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,
- "horizontal_draw_grid", TRUE,
- "vertical_draw_grid", TRUE,
- "selection_model", etcta->selection,
- "cursor_mode", E_CURSOR_SPREADSHEET,
- NULL);
+ 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,
+ "horizontal_draw_grid", TRUE,
+ "vertical_draw_grid", TRUE,
+ "selection_model", etcta->selection,
+ "cursor_mode", E_CURSOR_SPREADSHEET,
+ NULL);
g_signal_connect (
etcta->row, "key_press",
@@ -425,16 +435,17 @@ etcta_event (GnomeCanvasItem *item,
e_selection_model_clear (E_SELECTION_MODEL (etcta->selection));
- 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,
- "horizontal_draw_grid", TRUE,
- "vertical_draw_grid", TRUE,
- "selection_model", etcta->selection,
- "cursor_mode", E_CURSOR_SPREADSHEET,
- NULL);
+ 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,
+ "horizontal_draw_grid", TRUE,
+ "vertical_draw_grid", TRUE,
+ "selection_model", etcta->selection,
+ "cursor_mode", E_CURSOR_SPREADSHEET,
+ NULL);
g_signal_connect (
etcta->row, "key_press",
@@ -483,21 +494,24 @@ etcta_reflow (GnomeCanvasItem *item,
gdouble old_height = etcta->height;
if (etcta->text) {
- g_object_get (etcta->text,
- "height", &etcta->height,
- NULL);
+ g_object_get (
+ etcta->text,
+ "height", &etcta->height,
+ NULL);
etcta->height += 6;
}
if (etcta->row) {
- g_object_get (etcta->row,
- "height", &etcta->height,
- NULL);
+ g_object_get (
+ etcta->row,
+ "height", &etcta->height,
+ NULL);
}
if (etcta->rect) {
- g_object_set (etcta->rect,
- "y2", etcta->height - 1,
- NULL);
+ g_object_set (
+ etcta->rect,
+ "y2", etcta->height - 1,
+ NULL);
}
if (old_height != etcta->height)
@@ -521,58 +535,78 @@ etcta_class_init (ETableClickToAddClass *class)
item_class->unrealize = etcta_unrealize;
item_class->event = etcta_event;
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- "Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- "Model",
- NULL,
- E_TYPE_TABLE_MODEL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MESSAGE,
- g_param_spec_string ("message",
- "Message",
- NULL,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- "Width",
- NULL,
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- "Height",
- NULL,
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE | G_PARAM_LAX_VALIDATION));
-
- etcta_signals[CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClickToAddClass, cursor_change),
- NULL, NULL,
- e_marshal_VOID__INT_INT,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
-
- etcta_signals[STYLE_SET] =
- g_signal_new ("style_set",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableClickToAddClass, style_set),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1, GTK_TYPE_STYLE);
+ g_object_class_install_property (
+ object_class,
+ PROP_HEADER,
+ g_param_spec_object (
+ "header",
+ "Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MODEL,
+ g_param_spec_object (
+ "model",
+ "Model",
+ NULL,
+ E_TYPE_TABLE_MODEL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MESSAGE,
+ g_param_spec_string (
+ "message",
+ "Message",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_WIDTH,
+ g_param_spec_double (
+ "width",
+ "Width",
+ NULL,
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE |
+ G_PARAM_LAX_VALIDATION));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HEIGHT,
+ g_param_spec_double (
+ "height",
+ "Height",
+ NULL,
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READABLE |
+ G_PARAM_LAX_VALIDATION));
+
+ etcta_signals[CURSOR_CHANGE] = g_signal_new (
+ "cursor_change",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClickToAddClass, cursor_change),
+ NULL, NULL,
+ e_marshal_VOID__INT_INT,
+ G_TYPE_NONE, 2,
+ G_TYPE_INT,
+ G_TYPE_INT);
+
+ etcta_signals[STYLE_SET] = g_signal_new (
+ "style_set",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableClickToAddClass, style_set),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ GTK_TYPE_STYLE);
gal_a11y_e_table_click_to_add_init ();
}
diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c
index fc7da9c9f5..823aba415d 100644
--- a/widgets/table/e-table-col.c
+++ b/widgets/table/e-table-col.c
@@ -124,12 +124,15 @@ e_table_col_class_init (ETableColClass *class)
object_class->set_property = etc_set_property;
object_class->get_property = etc_get_property;
- g_object_class_install_property (object_class, PROP_COMPARE_COL,
- g_param_spec_int ("compare_col",
- "Width",
- "Width",
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_COMPARE_COL,
+ g_param_spec_int (
+ "compare_col",
+ "Width",
+ "Width",
+ 0, G_MAXINT, 0,
+ G_PARAM_READWRITE));
}
static void
diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c
index 3547bb3169..3be7539ada 100644
--- a/widgets/table/e-table-config.c
+++ b/widgets/table/e-table-config.c
@@ -99,17 +99,19 @@ e_table_config_changed (ETableConfig *config,
{
g_return_if_fail (E_IS_TABLE_CONFIG (config));
- g_signal_emit (G_OBJECT (config), e_table_config_signals[CHANGED], 0, state);
+ g_signal_emit (config, e_table_config_signals[CHANGED], 0, state);
}
static void
config_dialog_changed (ETableConfig *config)
{
/* enable the apply/ok buttons */
- gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel),
- GTK_RESPONSE_APPLY, TRUE);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel),
- GTK_RESPONSE_OK, TRUE);
+ gtk_dialog_set_response_sensitive (
+ GTK_DIALOG (config->dialog_toplevel),
+ GTK_RESPONSE_APPLY, TRUE);
+ gtk_dialog_set_response_sensitive (
+ GTK_DIALOG (config->dialog_toplevel),
+ GTK_RESPONSE_OK, TRUE);
}
static void
@@ -139,21 +141,24 @@ e_table_config_class_init (ETableConfigClass *class)
object_class->finalize = config_finalize;
object_class->get_property = config_get_property;
- e_table_config_signals[CHANGED] =
- g_signal_new ("changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableConfigClass, changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- g_object_class_install_property (object_class, PROP_STATE,
- g_param_spec_object ("state",
- "State",
- NULL,
- E_TYPE_TABLE_STATE,
- G_PARAM_READABLE));
+ e_table_config_signals[CHANGED] = g_signal_new (
+ "changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableConfigClass, changed),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ g_object_class_install_property (
+ object_class,
+ PROP_STATE,
+ g_param_spec_object (
+ "state",
+ "State",
+ NULL,
+ E_TYPE_TABLE_STATE,
+ G_PARAM_READABLE));
}
static void
@@ -1249,9 +1254,10 @@ configure_fields_dialog (ETableConfig *config,
scrolled = e_builder_get_widget (builder, "available-scrolled");
gtk_container_add (GTK_CONTAINER (scrolled), etable);
config->available = E_TABLE (etable);
- g_object_get (config->available,
- "model", &config->available_model,
- NULL);
+ g_object_get (
+ config->available,
+ "model", &config->available_model,
+ NULL);
gtk_widget_show_all (etable);
gtk_label_set_mnemonic_widget (
GTK_LABEL (e_builder_get_widget (
@@ -1263,9 +1269,10 @@ configure_fields_dialog (ETableConfig *config,
scrolled = e_builder_get_widget (builder, "shown-scrolled");
gtk_container_add (GTK_CONTAINER (scrolled), etable);
config->shown = E_TABLE (etable);
- g_object_get (config->shown,
- "model", &config->shown_model,
- NULL);
+ g_object_get (
+ config->shown,
+ "model", &config->shown_model,
+ NULL);
gtk_widget_show_all (etable);
gtk_label_set_mnemonic_widget (
GTK_LABEL (e_builder_get_widget (
@@ -1351,8 +1358,9 @@ setup_gui (ETableConfig *config)
configure_group_dialog (config, builder);
configure_fields_dialog (config, builder);
- g_object_weak_ref (G_OBJECT (config->dialog_toplevel),
- dialog_destroyed, config);
+ g_object_weak_ref (
+ G_OBJECT (config->dialog_toplevel),
+ dialog_destroyed, config);
g_signal_connect (
config->dialog_toplevel, "response",
@@ -1449,8 +1457,9 @@ e_table_config_new (const gchar *header,
widget = gtk_dialog_get_action_area (dialog);
gtk_container_set_border_width (GTK_CONTAINER (widget), 12);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel),
- GTK_RESPONSE_APPLY, FALSE);
+ gtk_dialog_set_response_sensitive (
+ GTK_DIALOG (config->dialog_toplevel),
+ GTK_RESPONSE_APPLY, FALSE);
gtk_widget_show (config->dialog_toplevel);
return E_TABLE_CONFIG (config);
diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c
index 6e69ccd6ad..fb005ed30f 100644
--- a/widgets/table/e-table-field-chooser-dialog.c
+++ b/widgets/table/e-table-field-chooser-dialog.c
@@ -56,9 +56,10 @@ e_table_field_chooser_dialog_set_property (GObject *object,
g_free (etfcd->dnd_code);
etfcd->dnd_code = g_strdup (g_value_get_string (value));
if (etfcd->etfc)
- g_object_set (etfcd->etfc,
- "dnd_code", etfcd->dnd_code,
- NULL);
+ g_object_set (
+ etfcd->etfc,
+ "dnd_code", etfcd->dnd_code,
+ NULL);
break;
case PROP_FULL_HEADER:
if (etfcd->full_header)
@@ -70,9 +71,10 @@ e_table_field_chooser_dialog_set_property (GObject *object,
if (etfcd->full_header)
g_object_ref (etfcd->full_header);
if (etfcd->etfc)
- g_object_set (etfcd->etfc,
- "full_header", etfcd->full_header,
- NULL);
+ g_object_set (
+ etfcd->etfc,
+ "full_header", etfcd->full_header,
+ NULL);
break;
case PROP_HEADER:
if (etfcd->header)
@@ -84,9 +86,10 @@ e_table_field_chooser_dialog_set_property (GObject *object,
if (etfcd->header)
g_object_ref (etfcd->header);
if (etfcd->etfc)
- g_object_set (etfcd->etfc,
- "header", etfcd->header,
- NULL);
+ g_object_set (
+ etfcd->etfc,
+ "header", etfcd->header,
+ NULL);
break;
default:
break;
@@ -210,11 +213,12 @@ e_table_field_chooser_dialog_init (ETableFieldChooserDialog *e_table_field_choos
widget = e_table_field_chooser_new ();
e_table_field_chooser_dialog->etfc = E_TABLE_FIELD_CHOOSER (widget);
- g_object_set (widget,
- "dnd_code", e_table_field_chooser_dialog->dnd_code,
- "full_header", e_table_field_chooser_dialog->full_header,
- "header", e_table_field_chooser_dialog->header,
- NULL);
+ g_object_set (
+ widget,
+ "dnd_code", e_table_field_chooser_dialog->dnd_code,
+ "full_header", e_table_field_chooser_dialog->full_header,
+ "header", e_table_field_chooser_dialog->header,
+ NULL);
content_area = gtk_dialog_get_content_area (dialog);
gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0);
diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c
index 32d2904bb9..3c6c33cdcf 100644
--- a/widgets/table/e-table-field-chooser-item.c
+++ b/widgets/table/e-table-field-chooser-item.c
@@ -425,11 +425,12 @@ etfci_drag_data_get (GtkWidget *widget,
{
if (etfci->drag_col != -1) {
gchar *string = g_strdup_printf ("%d", etfci->drag_col);
- gtk_selection_data_set (selection_data,
- GDK_SELECTION_TYPE_STRING,
- sizeof (string[0]),
- (guchar *) string,
- strlen (string));
+ gtk_selection_data_set (
+ selection_data,
+ GDK_SELECTION_TYPE_STRING,
+ sizeof (string[0]),
+ (guchar *) string,
+ strlen (string));
g_free (string);
}
}
@@ -518,12 +519,13 @@ etfci_draw (GnomeCanvasItem *item,
cairo_save (cr);
- e_table_header_draw_button (cr, ecol,
- GTK_WIDGET (canvas),
- -x, y1 - y,
- width, height,
- etfci->width, y2 - y1,
- E_TABLE_COL_ARROW_NONE);
+ e_table_header_draw_button (
+ cr, ecol,
+ GTK_WIDGET (canvas),
+ -x, y1 - y,
+ width, height,
+ etfci->width, y2 - y1,
+ E_TABLE_COL_ARROW_NONE);
cairo_restore (cr);
}
@@ -596,8 +598,9 @@ etfci_start_drag (ETableFieldChooserItem *etfci,
g_free ((gpointer) etfci_drag_types[0].target);
button_height = e_table_header_compute_height (ecol, widget);
- cs = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- etfci->width, button_height);
+ cs = cairo_image_surface_create (
+ CAIRO_FORMAT_ARGB32,
+ etfci->width, button_height);
cr = cairo_create (cs);
e_table_header_draw_button (
@@ -671,40 +674,55 @@ etfci_class_init (ETableFieldChooserItemClass *class)
item_class->point = etfci_point;
item_class->event = etfci_event;
- g_object_class_install_property (object_class, PROP_DND_CODE,
- g_param_spec_string ("dnd_code",
- "DnD code",
- NULL,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FULL_HEADER,
- g_param_spec_object ("full_header",
- "Full Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- "Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- "Width",
- NULL,
- 0, G_MAXDOUBLE, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- "Height",
- NULL,
- 0, G_MAXDOUBLE, 0,
- G_PARAM_READABLE));
+ g_object_class_install_property (
+ object_class,
+ PROP_DND_CODE,
+ g_param_spec_string (
+ "dnd_code",
+ "DnD code",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FULL_HEADER,
+ g_param_spec_object (
+ "full_header",
+ "Full Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HEADER,
+ g_param_spec_object (
+ "header",
+ "Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_WIDTH,
+ g_param_spec_double (
+ "width",
+ "Width",
+ NULL,
+ 0, G_MAXDOUBLE, 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HEIGHT,
+ g_param_spec_double (
+ "height",
+ "Height",
+ NULL,
+ 0, G_MAXDOUBLE, 0,
+ G_PARAM_READABLE));
}
static void
diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c
index 19791fb229..50f8267109 100644
--- a/widgets/table/e-table-field-chooser.c
+++ b/widgets/table/e-table-field-chooser.c
@@ -60,26 +60,35 @@ e_table_field_chooser_class_init (ETableFieldChooserClass *class)
object_class->get_property = e_table_field_chooser_get_property;
object_class->dispose = e_table_field_chooser_dispose;
- g_object_class_install_property (object_class, PROP_DND_CODE,
- g_param_spec_string ("dnd_code",
- "DnD code",
- NULL,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FULL_HEADER,
- g_param_spec_object ("full_header",
- "Full Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- "Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_DND_CODE,
+ g_param_spec_string (
+ "dnd_code",
+ "DnD code",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FULL_HEADER,
+ g_param_spec_object (
+ "full_header",
+ "Full Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HEADER,
+ g_param_spec_object (
+ "header",
+ "Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
}
static void
@@ -104,35 +113,40 @@ static void allocate_callback (GtkWidget *canvas, GtkAllocation *allocation, ETa
{
gdouble height;
etfc->last_alloc = *allocation;
- gnome_canvas_item_set ( etfc->item,
- "width", (gdouble) allocation->width,
- NULL );
- g_object_get (etfc->item,
- "height", &height,
- NULL);
+ gnome_canvas_item_set (
+ etfc->item,
+ "width", (gdouble) allocation->width,
+ NULL);
+ g_object_get (
+ etfc->item,
+ "height", &height,
+ NULL);
height = MAX (height, allocation->height);
- gnome_canvas_set_scroll_region (GNOME_CANVAS ( etfc->canvas ), 0, 0, allocation->width - 1, height - 1);
- gnome_canvas_item_set ( etfc->rect,
- "x2", (gdouble) allocation->width,
- "y2", (gdouble) height,
- NULL );
+ gnome_canvas_set_scroll_region (GNOME_CANVAS (etfc->canvas), 0, 0, allocation->width - 1, height - 1);
+ gnome_canvas_item_set (
+ etfc->rect,
+ "x2", (gdouble) allocation->width,
+ "y2", (gdouble) height,
+ NULL);
ensure_nonzero_step_increments (etfc);
}
static void resize (GnomeCanvas *canvas, ETableFieldChooser *etfc)
{
gdouble height;
- g_object_get (etfc->item,
- "height", &height,
- NULL);
+ g_object_get (
+ etfc->item,
+ "height", &height,
+ NULL);
height = MAX (height, etfc->last_alloc.height);
gnome_canvas_set_scroll_region (GNOME_CANVAS (etfc->canvas), 0, 0, etfc->last_alloc.width - 1, height - 1);
- gnome_canvas_item_set ( etfc->rect,
- "x2", (gdouble) etfc->last_alloc.width,
- "y2", (gdouble) height,
- NULL );
+ gnome_canvas_item_set (
+ etfc->rect,
+ "x2", (gdouble) etfc->last_alloc.width,
+ "y2", (gdouble) height,
+ NULL);
ensure_nonzero_step_increments (etfc);
}
@@ -184,22 +198,24 @@ e_table_field_chooser_init (ETableFieldChooser *etfc)
gtk_widget_set_size_request (widget, -1, 250);
gtk_box_pack_start (GTK_BOX (etfc), widget, TRUE, TRUE, 0);
- etfc->rect = gnome_canvas_item_new (gnome_canvas_root ( GNOME_CANVAS ( etfc->canvas ) ),
- gnome_canvas_rect_get_type (),
- "x1", (gdouble) 0,
- "y1", (gdouble) 0,
- "x2", (gdouble) 100,
- "y2", (gdouble) 100,
- "fill_color", "white",
- NULL );
-
- etfc->item = gnome_canvas_item_new (gnome_canvas_root (etfc->canvas),
- e_table_field_chooser_item_get_type (),
- "width", (gdouble) 100,
- "full_header", etfc->full_header,
- "header", etfc->header,
- "dnd_code", etfc->dnd_code,
- NULL );
+ etfc->rect = gnome_canvas_item_new (
+ gnome_canvas_root (GNOME_CANVAS (etfc->canvas)),
+ gnome_canvas_rect_get_type (),
+ "x1", (gdouble) 0,
+ "y1", (gdouble) 0,
+ "x2", (gdouble) 100,
+ "y2", (gdouble) 100,
+ "fill_color", "white",
+ NULL);
+
+ etfc->item = gnome_canvas_item_new (
+ gnome_canvas_root (etfc->canvas),
+ e_table_field_chooser_item_get_type (),
+ "width", (gdouble) 100,
+ "full_header", etfc->full_header,
+ "header", etfc->header,
+ "dnd_code", etfc->dnd_code,
+ NULL);
g_signal_connect (
etfc->canvas, "reflow",
@@ -207,7 +223,7 @@ e_table_field_chooser_init (ETableFieldChooser *etfc)
gnome_canvas_set_scroll_region (
GNOME_CANVAS (etfc->canvas),
- 0, 0, 100, 100 );
+ 0, 0, 100, 100);
/* Connect the signals */
g_signal_connect (
@@ -256,9 +272,10 @@ e_table_field_chooser_set_property (GObject *object,
g_free (etfc->dnd_code);
etfc->dnd_code = g_strdup (g_value_get_string (value));
if (etfc->item)
- g_object_set (etfc->item,
- "dnd_code", etfc->dnd_code,
- NULL);
+ g_object_set (
+ etfc->item,
+ "dnd_code", etfc->dnd_code,
+ NULL);
break;
case PROP_FULL_HEADER:
if (etfc->full_header)
@@ -270,9 +287,10 @@ e_table_field_chooser_set_property (GObject *object,
if (etfc->full_header)
g_object_ref (etfc->full_header);
if (etfc->item)
- g_object_set (etfc->item,
- "full_header", etfc->full_header,
- NULL);
+ g_object_set (
+ etfc->item,
+ "full_header", etfc->full_header,
+ NULL);
break;
case PROP_HEADER:
if (etfc->header)
@@ -284,9 +302,10 @@ e_table_field_chooser_set_property (GObject *object,
if (etfc->header)
g_object_ref (etfc->header);
if (etfc->item)
- g_object_set (etfc->item,
- "header", etfc->header,
- NULL);
+ g_object_set (
+ etfc->item,
+ "header", etfc->header,
+ NULL);
break;
default:
break;
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
index 9841b99d99..602ef12e17 100644
--- a/widgets/table/e-table-group-container.c
+++ b/widgets/table/e-table-group-container.c
@@ -74,8 +74,9 @@ e_table_group_container_child_node_free (ETableGroupContainer *etgc,
ETableGroup *child = child_node->child;
g_object_run_dispose (G_OBJECT (child));
- e_table_model_free_value (etg->model, etgc->ecol->col_idx,
- child_node->key);
+ e_table_model_free_value (
+ etg->model, etgc->ecol->col_idx,
+ child_node->key);
g_free (child_node->string);
g_object_run_dispose (G_OBJECT (child_node->text));
g_object_run_dispose (G_OBJECT (child_node->rect));
@@ -201,8 +202,9 @@ e_table_group_container_new (GnomeCanvasGroup *parent,
etgc = g_object_new (E_TYPE_TABLE_GROUP_CONTAINER, NULL);
- e_table_group_container_construct (parent, etgc, full_header, header,
- model, sort_info, n);
+ e_table_group_container_construct (
+ parent, etgc, full_header, header,
+ model, sort_info, n);
return E_TABLE_GROUP (etgc);
}
@@ -357,11 +359,13 @@ compute_text (ETableGroupContainer *etgc,
* Finally the %d is replaced with count of items in this group.
* Example: "Family name: Smith (13 items)"
*/
- text = g_strdup_printf (ngettext ("%s: %s (%d item)",
- "%s: %s (%d items)",
- child_node->count),
- etgc->ecol->text, child_node->string,
- (gint) child_node->count);
+ text = g_strdup_printf (
+ ngettext (
+ "%s: %s (%d item)",
+ "%s: %s (%d items)",
+ child_node->count),
+ etgc->ecol->text, child_node->string,
+ (gint) child_node->count);
} else {
/* Translators: This text is used as a special row when an ETable
* has turned on grouping on a column, which doesn't have set a title.
@@ -369,15 +373,18 @@ compute_text (ETableGroupContainer *etgc,
* The %d is replaced with count of items in this group.
* Example: "Smith (13 items)"
*/
- text = g_strdup_printf (ngettext ("%s (%d item)",
- "%s (%d items)",
- child_node->count),
- child_node->string,
- (gint) child_node->count);
+ text = g_strdup_printf (
+ ngettext (
+ "%s (%d item)",
+ "%s (%d items)",
+ child_node->count),
+ child_node->string,
+ (gint) child_node->count);
}
- gnome_canvas_item_set (child_node->text,
- "text", text,
- NULL);
+ gnome_canvas_item_set (
+ child_node->text,
+ "text", text,
+ NULL);
g_free (text);
}
@@ -456,28 +463,32 @@ create_child_node (ETableGroupContainer *etgc,
ETableGroup *etg = E_TABLE_GROUP (etgc);
child_node = g_new (ETableGroupContainerChildNode, 1);
- child_node->rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etgc),
- gnome_canvas_rect_get_type (),
- "fill_color", "grey70",
- "outline_color", "grey50",
- NULL);
- child_node->text = gnome_canvas_item_new (GNOME_CANVAS_GROUP (etgc),
- e_text_get_type (),
- "fill_color", "black",
- NULL);
- child = e_table_group_new (GNOME_CANVAS_GROUP (etgc), etg->full_header,
- etg->header, etg->model, etgc->sort_info, etgc->n + 1);
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (child),
- "alternating_row_colors", etgc->alternating_row_colors,
- "horizontal_draw_grid", etgc->horizontal_draw_grid,
- "vertical_draw_grid", etgc->vertical_draw_grid,
- "drawfocus", etgc->draw_focus,
- "cursor_mode", etgc->cursor_mode,
- "selection_model", etgc->selection_model,
- "length_threshold", etgc->length_threshold,
- "uniform_row_height", etgc->uniform_row_height,
- "minimum_width", etgc->minimum_width - GROUP_INDENT,
- NULL);
+ child_node->rect = gnome_canvas_item_new (
+ GNOME_CANVAS_GROUP (etgc),
+ gnome_canvas_rect_get_type (),
+ "fill_color", "grey70",
+ "outline_color", "grey50",
+ NULL);
+ child_node->text = gnome_canvas_item_new (
+ GNOME_CANVAS_GROUP (etgc),
+ e_text_get_type (),
+ "fill_color", "black",
+ NULL);
+ child = e_table_group_new (
+ GNOME_CANVAS_GROUP (etgc), etg->full_header,
+ etg->header, etg->model, etgc->sort_info, etgc->n + 1);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (child),
+ "alternating_row_colors", etgc->alternating_row_colors,
+ "horizontal_draw_grid", etgc->horizontal_draw_grid,
+ "vertical_draw_grid", etgc->vertical_draw_grid,
+ "drawfocus", etgc->draw_focus,
+ "cursor_mode", etgc->cursor_mode,
+ "selection_model", etgc->selection_model,
+ "length_threshold", etgc->length_threshold,
+ "uniform_row_height", etgc->uniform_row_height,
+ "minimum_width", etgc->minimum_width - GROUP_INDENT,
+ NULL);
g_signal_connect (
child, "cursor_change",
@@ -673,8 +684,9 @@ etgc_increment (ETableGroup *etg,
GList *list;
for (list = etgc->children; list; list = g_list_next (list))
- e_table_group_increment (((ETableGroupContainerChildNode *) list->data)->child,
- position, amount);
+ e_table_group_increment (
+ ((ETableGroupContainerChildNode *) list->data)->child,
+ position, amount);
}
static void
@@ -686,8 +698,9 @@ etgc_decrement (ETableGroup *etg,
GList *list;
for (list = etgc->children; list; list = g_list_next (list))
- e_table_group_decrement (((ETableGroupContainerChildNode *) list->data)->child,
- position, amount);
+ e_table_group_decrement (
+ ((ETableGroupContainerChildNode *) list->data)->child,
+ position, amount);
}
static void
@@ -698,11 +711,13 @@ etgc_set_focus (ETableGroup *etg,
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg);
if (etgc->children) {
if (direction == E_FOCUS_END)
- e_table_group_set_focus (((ETableGroupContainerChildNode *) g_list_last (etgc->children)->data)->child,
- direction, view_col);
+ e_table_group_set_focus (
+ ((ETableGroupContainerChildNode *) g_list_last (etgc->children)->data)->child,
+ direction, view_col);
else
- e_table_group_set_focus (((ETableGroupContainerChildNode *) etgc->children->data)->child,
- direction, view_col);
+ e_table_group_set_focus (
+ ((ETableGroupContainerChildNode *) etgc->children->data)->child,
+ direction, view_col);
}
}
@@ -850,27 +865,30 @@ etgc_set_property (GObject *object,
for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- g_object_set (child_node->child,
- "minimum_width", etgc->minimum_width - GROUP_INDENT,
- NULL);
+ g_object_set (
+ child_node->child,
+ "minimum_width", etgc->minimum_width - GROUP_INDENT,
+ NULL);
}
break;
case PROP_LENGTH_THRESHOLD:
etgc->length_threshold = g_value_get_int (value);
for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- g_object_set (child_node->child,
- "length_threshold", etgc->length_threshold,
- NULL);
+ g_object_set (
+ child_node->child,
+ "length_threshold", etgc->length_threshold,
+ NULL);
}
break;
case PROP_UNIFORM_ROW_HEIGHT:
etgc->uniform_row_height = g_value_get_boolean (value);
for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- g_object_set (child_node->child,
- "uniform_row_height", etgc->uniform_row_height,
- NULL);
+ g_object_set (
+ child_node->child,
+ "uniform_row_height", etgc->uniform_row_height,
+ NULL);
}
break;
@@ -882,9 +900,10 @@ etgc_set_property (GObject *object,
g_object_ref (etgc->selection_model);
for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- g_object_set (child_node->child,
- "selection_model", etgc->selection_model,
- NULL);
+ g_object_set (
+ child_node->child,
+ "selection_model", etgc->selection_model,
+ NULL);
}
break;
@@ -892,9 +911,10 @@ etgc_set_property (GObject *object,
etgc->alternating_row_colors = g_value_get_boolean (value);
for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- g_object_set (child_node->child,
- "alternating_row_colors", etgc->alternating_row_colors,
- NULL);
+ g_object_set (
+ child_node->child,
+ "alternating_row_colors", etgc->alternating_row_colors,
+ NULL);
}
break;
@@ -902,9 +922,10 @@ etgc_set_property (GObject *object,
etgc->horizontal_draw_grid = g_value_get_boolean (value);
for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- g_object_set (child_node->child,
- "horizontal_draw_grid", etgc->horizontal_draw_grid,
- NULL);
+ g_object_set (
+ child_node->child,
+ "horizontal_draw_grid", etgc->horizontal_draw_grid,
+ NULL);
}
break;
@@ -912,9 +933,10 @@ etgc_set_property (GObject *object,
etgc->vertical_draw_grid = g_value_get_boolean (value);
for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- g_object_set (child_node->child,
- "vertical_draw_grid", etgc->vertical_draw_grid,
- NULL);
+ g_object_set (
+ child_node->child,
+ "vertical_draw_grid", etgc->vertical_draw_grid,
+ NULL);
}
break;
@@ -922,9 +944,10 @@ etgc_set_property (GObject *object,
etgc->draw_focus = g_value_get_boolean (value);
for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- g_object_set (child_node->child,
- "drawfocus", etgc->draw_focus,
- NULL);
+ g_object_set (
+ child_node->child,
+ "drawfocus", etgc->draw_focus,
+ NULL);
}
break;
@@ -932,9 +955,10 @@ etgc_set_property (GObject *object,
etgc->cursor_mode = g_value_get_int (value);
for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
- g_object_set (child_node->child,
- "cursor_mode", etgc->cursor_mode,
- NULL);
+ g_object_set (
+ child_node->child,
+ "cursor_mode", etgc->cursor_mode,
+ NULL);
}
break;
default:
@@ -1002,89 +1026,127 @@ etgc_class_init (ETableGroupContainerClass *class)
e_group_class->get_mouse_over = etgc_get_mouse_over;
e_group_class->get_cell_geometry = etgc_get_cell_geometry;
- g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS,
- g_param_spec_boolean ("alternating_row_colors",
- "Alternating Row Colors",
- "Alternating Row Colors",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID,
- g_param_spec_boolean ("horizontal_draw_grid",
- "Horizontal Draw Grid",
- "Horizontal Draw Grid",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID,
- g_param_spec_boolean ("vertical_draw_grid",
- "Vertical Draw Grid",
- "Vertical Draw Grid",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS,
- g_param_spec_boolean ("drawfocus",
- "Draw focus",
- "Draw focus",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_MODE,
- g_param_spec_int ("cursor_mode",
- "Cursor mode",
- "Cursor mode",
- E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_SELECTION_MODEL,
- g_param_spec_object ("selection_model",
- "Selection model",
- "Selection model",
- E_TYPE_SELECTION_MODEL,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- "Length Threshold",
- "Length Threshold",
- -1, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- "Uniform row height",
- "Uniform row height",
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_FROZEN,
- g_param_spec_boolean ("frozen",
- "Frozen",
- "Frozen",
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- "Height",
- "Height",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- "Width",
- "Width",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
- g_param_spec_double ("minimum_width",
- "Minimum width",
- "Minimum Width",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_ALTERNATING_ROW_COLORS,
+ g_param_spec_boolean (
+ "alternating_row_colors",
+ "Alternating Row Colors",
+ "Alternating Row Colors",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_HORIZONTAL_DRAW_GRID,
+ g_param_spec_boolean (
+ "horizontal_draw_grid",
+ "Horizontal Draw Grid",
+ "Horizontal Draw Grid",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_VERTICAL_DRAW_GRID,
+ g_param_spec_boolean (
+ "vertical_draw_grid",
+ "Vertical Draw Grid",
+ "Vertical Draw Grid",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_DRAW_FOCUS,
+ g_param_spec_boolean (
+ "drawfocus",
+ "Draw focus",
+ "Draw focus",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_CURSOR_MODE,
+ g_param_spec_int (
+ "cursor_mode",
+ "Cursor mode",
+ "Cursor mode",
+ E_CURSOR_LINE,
+ E_CURSOR_SPREADSHEET,
+ E_CURSOR_LINE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SELECTION_MODEL,
+ g_param_spec_object (
+ "selection_model",
+ "Selection model",
+ "Selection model",
+ E_TYPE_SELECTION_MODEL,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_LENGTH_THRESHOLD,
+ g_param_spec_int (
+ "length_threshold",
+ "Length Threshold",
+ "Length Threshold",
+ -1, G_MAXINT, 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_UNIFORM_ROW_HEIGHT,
+ g_param_spec_boolean (
+ "uniform_row_height",
+ "Uniform row height",
+ "Uniform row height",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FROZEN,
+ g_param_spec_boolean (
+ "frozen",
+ "Frozen",
+ "Frozen",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HEIGHT,
+ g_param_spec_double (
+ "height",
+ "Height",
+ "Height",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_WIDTH,
+ g_param_spec_double (
+ "width",
+ "Width",
+ "Width",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MINIMUM_WIDTH,
+ g_param_spec_double (
+ "minimum_width",
+ "Minimum width",
+ "Minimum Width",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
}
static void
@@ -1094,9 +1156,10 @@ etgc_reflow (GnomeCanvasItem *item,
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (item);
gboolean frozen;
- g_object_get (etgc,
- "frozen", &frozen,
- NULL);
+ g_object_get (
+ etgc,
+ "frozen", &frozen,
+ NULL);
if (frozen)
return;
@@ -1133,38 +1196,43 @@ etgc_reflow (GnomeCanvasItem *item,
running_height = extra_height;
- for ( list = etgc->children; list; list = g_list_next (list)) {
+ for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
ETableGroup *child = child_node->child;
- g_object_get (child,
- "width", &item_width,
- NULL);
+ g_object_get (
+ child,
+ "width", &item_width,
+ NULL);
if (item_width > running_width)
running_width = item_width;
}
- for ( list = etgc->children; list; list = g_list_next (list)) {
+ for (list = etgc->children; list; list = g_list_next (list)) {
ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data;
ETableGroup *child = child_node->child;
- g_object_get (child,
- "height", &item_height,
- NULL);
-
- e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (child_node->text),
- GROUP_INDENT,
- running_height - GROUP_INDENT - BUTTON_PADDING);
-
- e_canvas_item_move_absolute (GNOME_CANVAS_ITEM (child),
- GROUP_INDENT,
- running_height);
-
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (child_node->rect),
- "x1", (gdouble) 0,
- "x2", (gdouble) running_width + GROUP_INDENT,
- "y1", (gdouble) running_height - extra_height,
- "y2", (gdouble) running_height + item_height,
- NULL);
+ g_object_get (
+ child,
+ "height", &item_height,
+ NULL);
+
+ e_canvas_item_move_absolute (
+ GNOME_CANVAS_ITEM (child_node->text),
+ GROUP_INDENT,
+ running_height - GROUP_INDENT - BUTTON_PADDING);
+
+ e_canvas_item_move_absolute (
+ GNOME_CANVAS_ITEM (child),
+ GROUP_INDENT,
+ running_height);
+
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (child_node->rect),
+ "x1", (gdouble) 0,
+ "x2", (gdouble) running_width + GROUP_INDENT,
+ "y1", (gdouble) running_height - extra_height,
+ "y2", (gdouble) running_height + item_height,
+ NULL);
running_height += item_height + extra_height;
}
@@ -1217,8 +1285,9 @@ e_table_group_apply_to_leafs (ETableGroup *etg,
} else if (E_IS_TABLE_GROUP_LEAF (etg)) {
(*fn) (E_TABLE_GROUP_LEAF (etg)->item, closure);
} else {
- g_error ("Unknown ETableGroup found: %s",
- g_type_name (G_TYPE_FROM_INSTANCE (etg)));
+ g_error (
+ "Unknown ETableGroup found: %s",
+ g_type_name (G_TYPE_FROM_INSTANCE (etg)));
}
}
@@ -1328,16 +1397,18 @@ e_table_group_container_print_page (EPrintable *ep,
cairo_move_to (cr, 0, 0);
if (groupcontext->etgc->ecol->text)
- string = g_strdup_printf ("%s : %s (%d item%s)",
- groupcontext->etgc->ecol->text,
- child_node->string,
- (gint) child_node->count,
- child_node->count == 1 ? "" : "s");
+ string = g_strdup_printf (
+ "%s : %s (%d item%s)",
+ groupcontext->etgc->ecol->text,
+ child_node->string,
+ (gint) child_node->count,
+ child_node->count == 1 ? "" : "s");
else
- string = g_strdup_printf ("%s (%d item%s)",
- child_node->string,
- (gint) child_node->count,
- child_node->count == 1 ? "" : "s");
+ string = g_strdup_printf (
+ "%s (%d item%s)",
+ child_node->string,
+ (gint) child_node->count,
+ child_node->count == 1 ? "" : "s");
pango_layout_set_text (layout, string, -1);
pango_cairo_show_layout (cr, layout);
g_free (string);
diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c
index fba38abfbb..2da75bf006 100644
--- a/widgets/table/e-table-group-leaf.c
+++ b/widgets/table/e-table-group-leaf.c
@@ -69,26 +69,33 @@ etgl_dispose (GObject *object)
if (etgl->item) {
if (etgl->etgl_cursor_change_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_cursor_change_id);
+ g_signal_handler_disconnect (
+ etgl->item,
+ etgl->etgl_cursor_change_id);
if (etgl->etgl_cursor_activated_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_cursor_activated_id);
+ g_signal_handler_disconnect (
+ etgl->item,
+ etgl->etgl_cursor_activated_id);
if (etgl->etgl_double_click_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_double_click_id);
+ g_signal_handler_disconnect (
+ etgl->item,
+ etgl->etgl_double_click_id);
if (etgl->etgl_right_click_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_right_click_id);
+ g_signal_handler_disconnect (
+ etgl->item,
+ etgl->etgl_right_click_id);
if (etgl->etgl_click_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_click_id);
+ g_signal_handler_disconnect (
+ etgl->item,
+ etgl->etgl_click_id);
if (etgl->etgl_key_press_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_key_press_id);
+ g_signal_handler_disconnect (
+ etgl->item,
+ etgl->etgl_key_press_id);
if (etgl->etgl_start_drag_id != 0)
- g_signal_handler_disconnect (etgl->item,
- etgl->etgl_start_drag_id);
+ g_signal_handler_disconnect (
+ etgl->item,
+ etgl->etgl_start_drag_id);
etgl->etgl_cursor_change_id = 0;
etgl->etgl_cursor_activated_id = 0;
@@ -502,17 +509,19 @@ etgl_set_property (GObject *object,
case PROP_WIDTH:
etgl->minimum_width = g_value_get_double (value);
if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item),
- "minimum_width", etgl->minimum_width,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etgl->item),
+ "minimum_width", etgl->minimum_width,
+ NULL);
}
break;
case PROP_LENGTH_THRESHOLD:
etgl->length_threshold = g_value_get_int (value);
if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item),
- "length_threshold", etgl->length_threshold,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etgl->item),
+ "length_threshold", etgl->length_threshold,
+ NULL);
}
break;
case PROP_SELECTION_MODEL:
@@ -523,63 +532,70 @@ etgl_set_property (GObject *object,
g_object_ref (etgl->selection_model);
}
if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item),
- "selection_model", etgl->selection_model,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etgl->item),
+ "selection_model", etgl->selection_model,
+ NULL);
}
break;
case PROP_UNIFORM_ROW_HEIGHT:
etgl->uniform_row_height = g_value_get_boolean (value);
if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item),
- "uniform_row_height", etgl->uniform_row_height,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etgl->item),
+ "uniform_row_height", etgl->uniform_row_height,
+ NULL);
}
break;
case PROP_TABLE_ALTERNATING_ROW_COLORS:
etgl->alternating_row_colors = g_value_get_boolean (value);
if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item),
- "alternating_row_colors", etgl->alternating_row_colors,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etgl->item),
+ "alternating_row_colors", etgl->alternating_row_colors,
+ NULL);
}
break;
case PROP_TABLE_HORIZONTAL_DRAW_GRID:
etgl->horizontal_draw_grid = g_value_get_boolean (value);
if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item),
- "horizontal_draw_grid", etgl->horizontal_draw_grid,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etgl->item),
+ "horizontal_draw_grid", etgl->horizontal_draw_grid,
+ NULL);
}
break;
case PROP_TABLE_VERTICAL_DRAW_GRID:
etgl->vertical_draw_grid = g_value_get_boolean (value);
if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item),
- "vertical_draw_grid", etgl->vertical_draw_grid,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etgl->item),
+ "vertical_draw_grid", etgl->vertical_draw_grid,
+ NULL);
}
break;
case PROP_TABLE_DRAW_FOCUS:
etgl->draw_focus = g_value_get_boolean (value);
if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item),
- "drawfocus", etgl->draw_focus,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etgl->item),
+ "drawfocus", etgl->draw_focus,
+ NULL);
}
break;
case PROP_CURSOR_MODE:
etgl->cursor_mode = g_value_get_int (value);
if (etgl->item) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (etgl->item),
- "cursor_mode", etgl->cursor_mode,
- NULL);
+ gnome_canvas_item_set (
+ GNOME_CANVAS_ITEM (etgl->item),
+ "cursor_mode", etgl->cursor_mode,
+ NULL);
}
break;
default:
diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c
index 8d820f861a..032ec7dd88 100644
--- a/widgets/table/e-table-group.c
+++ b/widgets/table/e-table-group.c
@@ -443,9 +443,10 @@ e_table_group_cursor_change (ETableGroup *e_table_group,
g_return_if_fail (e_table_group != NULL);
g_return_if_fail (E_IS_TABLE_GROUP (e_table_group));
- g_signal_emit (e_table_group,
- etg_signals[CURSOR_CHANGE], 0,
- row);
+ g_signal_emit (
+ e_table_group,
+ etg_signals[CURSOR_CHANGE], 0,
+ row);
}
/**
@@ -462,9 +463,10 @@ e_table_group_cursor_activated (ETableGroup *e_table_group,
g_return_if_fail (e_table_group != NULL);
g_return_if_fail (E_IS_TABLE_GROUP (e_table_group));
- g_signal_emit (e_table_group,
- etg_signals[CURSOR_ACTIVATED], 0,
- row);
+ g_signal_emit (
+ e_table_group,
+ etg_signals[CURSOR_ACTIVATED], 0,
+ row);
}
/**
@@ -485,9 +487,10 @@ e_table_group_double_click (ETableGroup *e_table_group,
g_return_if_fail (e_table_group != NULL);
g_return_if_fail (E_IS_TABLE_GROUP (e_table_group));
- g_signal_emit (e_table_group,
- etg_signals[DOUBLE_CLICK], 0,
- row, col, event);
+ g_signal_emit (
+ e_table_group,
+ etg_signals[DOUBLE_CLICK], 0,
+ row, col, event);
}
/**
@@ -510,9 +513,10 @@ e_table_group_right_click (ETableGroup *e_table_group,
g_return_val_if_fail (e_table_group != NULL, FALSE);
g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE);
- g_signal_emit (e_table_group,
- etg_signals[RIGHT_CLICK], 0,
- row, col, event, &return_val);
+ g_signal_emit (
+ e_table_group,
+ etg_signals[RIGHT_CLICK], 0,
+ row, col, event, &return_val);
return return_val;
}
@@ -537,9 +541,10 @@ e_table_group_click (ETableGroup *e_table_group,
g_return_val_if_fail (e_table_group != NULL, FALSE);
g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE);
- g_signal_emit (e_table_group,
- etg_signals[CLICK], 0,
- row, col, event, &return_val);
+ g_signal_emit (
+ e_table_group,
+ etg_signals[CLICK], 0,
+ row, col, event, &return_val);
return return_val;
}
@@ -564,9 +569,10 @@ e_table_group_key_press (ETableGroup *e_table_group,
g_return_val_if_fail (e_table_group != NULL, FALSE);
g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE);
- g_signal_emit (e_table_group,
- etg_signals[KEY_PRESS], 0,
- row, col, event, &return_val);
+ g_signal_emit (
+ e_table_group,
+ etg_signals[KEY_PRESS], 0,
+ row, col, event, &return_val);
return return_val;
}
@@ -591,9 +597,10 @@ e_table_group_start_drag (ETableGroup *e_table_group,
g_return_val_if_fail (e_table_group != NULL, FALSE);
g_return_val_if_fail (E_IS_TABLE_GROUP (e_table_group), FALSE);
- g_signal_emit (e_table_group,
- etg_signals[START_DRAG], 0,
- row, col, event, &return_val);
+ g_signal_emit (
+ e_table_group,
+ etg_signals[START_DRAG], 0,
+ row, col, event, &return_val);
return return_val;
}
@@ -678,83 +685,85 @@ etg_class_init (ETableGroupClass *class)
class->get_mouse_over = NULL;
class->get_cell_geometry = NULL;
- etg_signals[CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, cursor_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- etg_signals[CURSOR_ACTIVATED] =
- g_signal_new ("cursor_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, cursor_activated),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- etg_signals[DOUBLE_CLICK] =
- g_signal_new ("double_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, double_click),
- NULL, NULL,
- e_marshal_NONE__INT_INT_BOXED,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- etg_signals[RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, right_click),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- etg_signals[CLICK] =
- g_signal_new ("click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, click),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- etg_signals[KEY_PRESS] =
- g_signal_new ("key_press",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, key_press),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- etg_signals[START_DRAG] =
- g_signal_new ("start_drag",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableGroupClass, start_drag),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+ etg_signals[CURSOR_CHANGE] = g_signal_new (
+ "cursor_change",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableGroupClass, cursor_change),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
+
+ etg_signals[CURSOR_ACTIVATED] = g_signal_new (
+ "cursor_activated",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableGroupClass, cursor_activated),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
+
+ etg_signals[DOUBLE_CLICK] = g_signal_new (
+ "double_click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableGroupClass, double_click),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT_BOXED,
+ G_TYPE_NONE, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ etg_signals[RIGHT_CLICK] = g_signal_new (
+ "right_click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableGroupClass, right_click),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ etg_signals[CLICK] = g_signal_new (
+ "click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableGroupClass, click),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ etg_signals[KEY_PRESS] = g_signal_new (
+ "key_press",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableGroupClass, key_press),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ etg_signals[START_DRAG] = g_signal_new (
+ "start_drag",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableGroupClass, start_drag),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
}
static void
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index ef24716e33..d8e0665b8e 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -165,8 +165,8 @@ e_table_header_item_get_height (ETableHeaderItem *ethi)
ETableCol *ecol = e_table_header_get_column (eth, col);
gint height;
- height = e_table_header_compute_height (ecol,
- GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas));
+ height = e_table_header_compute_height (
+ ecol, GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas));
if (height > maxheight)
maxheight = height;
@@ -742,8 +742,8 @@ ethi_drag_motion (GtkWidget *widget,
targets = gdk_drag_context_list_targets (context);
droptype = gdk_atom_name (GDK_POINTER_TO_ATOM (targets->data));
- headertype = g_strdup_printf ("%s-%s", TARGET_ETABLE_COL_TYPE,
- ethi->dnd_code);
+ headertype = g_strdup_printf (
+ "%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code);
if (strcmp (droptype, headertype) != 0) {
g_free (headertype);
@@ -864,11 +864,12 @@ ethi_drag_data_get (GtkWidget *canvas,
ETableCol *ecol = e_table_header_get_column (ethi->eth, ethi->drag_col);
gchar *string = g_strdup_printf ("%d", ecol->col_idx);
- gtk_selection_data_set (selection_data,
- GDK_SELECTION_TYPE_STRING,
- sizeof (string[0]),
- (guchar *) string,
- strlen (string));
+ gtk_selection_data_set (
+ selection_data,
+ GDK_SELECTION_TYPE_STRING,
+ sizeof (string[0]),
+ (guchar *) string,
+ strlen (string));
g_free (string);
}
}
@@ -1268,9 +1269,10 @@ ethi_start_drag (ETableHeaderItem *ethi,
g_hash_table_insert (
arrows,
GINT_TO_POINTER ((gint) column.column),
- GINT_TO_POINTER (column.ascending ?
- E_TABLE_COL_ARROW_DOWN :
- E_TABLE_COL_ARROW_UP));
+ GINT_TO_POINTER (
+ column.ascending ?
+ E_TABLE_COL_ARROW_DOWN :
+ E_TABLE_COL_ARROW_UP));
}
length = e_table_sort_info_sorting_get_count (ethi->sort_info);
for (i = 0; i < length; i++) {
@@ -1281,9 +1283,10 @@ ethi_start_drag (ETableHeaderItem *ethi,
g_hash_table_insert (
arrows,
GINT_TO_POINTER ((gint) column.column),
- GINT_TO_POINTER (column.ascending ?
- E_TABLE_COL_ARROW_DOWN :
- E_TABLE_COL_ARROW_UP));
+ GINT_TO_POINTER (
+ column.ascending ?
+ E_TABLE_COL_ARROW_DOWN :
+ E_TABLE_COL_ARROW_UP));
}
}
@@ -1488,11 +1491,12 @@ ethi_popup_field_chooser (GtkWidget *widget,
g_object_add_weak_pointer (G_OBJECT (etfcd), &info->ethi->etfcd.pointer);
- g_object_set (info->ethi->etfcd.widget,
- "full_header", info->ethi->full_header,
- "header", info->ethi->eth,
- "dnd_code", info->ethi->dnd_code,
- NULL);
+ g_object_set (
+ info->ethi->etfcd.widget,
+ "full_header", info->ethi->full_header,
+ "header", info->ethi->eth,
+ "dnd_code", info->ethi->dnd_code,
+ NULL);
gtk_widget_show (etfcd);
}
@@ -1510,9 +1514,10 @@ ethi_popup_best_fit (GtkWidget *widget,
ETableHeaderItem *ethi = info->ethi;
gint width;
- g_signal_emit_by_name (ethi->eth,
- "request_width",
- info->col, &width);
+ g_signal_emit_by_name (
+ ethi->eth,
+ "request_width",
+ info->col, &width);
/* Add 10 to stop it from "..."ing */
e_table_header_set_size (ethi->eth, info->col, width + 10);
@@ -1546,8 +1551,9 @@ apply_changes (ETableConfig *config,
e_tree_set_state (ethi->tree, state);
g_free (state);
- gtk_dialog_set_response_sensitive (GTK_DIALOG (config->dialog_toplevel),
- GTK_RESPONSE_APPLY, FALSE);
+ gtk_dialog_set_response_sensitive (
+ GTK_DIALOG (config->dialog_toplevel),
+ GTK_RESPONSE_APPLY, FALSE);
}
static void
@@ -1573,8 +1579,9 @@ ethi_popup_customize_view (GtkWidget *widget,
ethi->config = e_table_config_new (
_("Customize Current View"),
spec, state, GTK_WINDOW (gtk_widget_get_toplevel (widget)));
- g_object_weak_ref (G_OBJECT (ethi->config),
- config_destroyed, ethi);
+ g_object_weak_ref (
+ G_OBJECT (ethi->config),
+ config_destroyed, ethi);
g_signal_connect (
ethi->config, "changed",
G_CALLBACK (apply_changes), ethi);
@@ -1675,7 +1682,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi,
GtkWidget *menu_item, *sub_menu;
ETableSortColumn column;
gboolean ascending = TRUE;
- d ( g_print ("ethi_header_context_menu: \n") );
+ d (g_print ("ethi_header_context_menu: \n"));
info->ethi = ethi;
info->col = ethi_find_col_by_x (ethi, event->x);
@@ -1892,11 +1899,12 @@ ethi_event (GnomeCanvasItem *item,
/* Quick hack until I actually bind the views */
ethi->resize_guide = GINT_TO_POINTER (1);
- gnome_canvas_item_grab (item,
- GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_RELEASE_MASK,
- ethi->resize_cursor,
- e->button.time);
+ gnome_canvas_item_grab (
+ item,
+ GDK_POINTER_MOTION_MASK |
+ GDK_BUTTON_RELEASE_MASK,
+ ethi->resize_cursor,
+ e->button.time);
}
new_width = x - ethi->resize_start_pos;
@@ -1963,9 +1971,10 @@ ethi_event (GnomeCanvasItem *item,
break;
else {
gint width = 0;
- g_signal_emit_by_name (ethi->eth,
- "request_width",
- (gint) ethi->resize_col, &width);
+ g_signal_emit_by_name (
+ ethi->eth,
+ "request_width",
+ (gint) ethi->resize_col, &width);
/* Add 10 to stop it from "..."ing */
e_table_header_set_size (ethi->eth, ethi->resize_col, width + 10);
@@ -2077,64 +2086,85 @@ ethi_class_init (ETableHeaderItemClass *class)
item_class->point = ethi_point;
item_class->event = ethi_event;
- g_object_class_install_property (object_class, PROP_DND_CODE,
- g_param_spec_string ("dnd_code",
- "DnD code",
- NULL,
- NULL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TABLE_FONT_DESC,
- g_param_spec_boxed ("font-desc",
- "Font Description",
- NULL,
- PANGO_TYPE_FONT_DESCRIPTION,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_FULL_HEADER,
- g_param_spec_object ("full_header",
- "Full Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_TABLE_HEADER,
- g_param_spec_object ("ETableHeader",
- "Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_SORT_INFO,
- g_param_spec_object ("sort_info",
- "Sort Info",
- NULL,
- E_TYPE_TABLE_SORT_INFO,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE,
- g_param_spec_object ("table",
- "Table",
- NULL,
- E_TYPE_TABLE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TREE,
- g_param_spec_object ("tree",
- "Tree",
- NULL,
- E_TYPE_TREE,
- G_PARAM_WRITABLE));
-
- ethi_signals[BUTTON_PRESSED] =
- g_signal_new ("button_pressed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderItemClass, button_pressed),
- NULL, NULL,
- g_cclosure_marshal_VOID__BOXED,
- G_TYPE_NONE, 1,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+ g_object_class_install_property (
+ object_class,
+ PROP_DND_CODE,
+ g_param_spec_string (
+ "dnd_code",
+ "DnD code",
+ NULL,
+ NULL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_FONT_DESC,
+ g_param_spec_boxed (
+ "font-desc",
+ "Font Description",
+ NULL,
+ PANGO_TYPE_FONT_DESCRIPTION,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_FULL_HEADER,
+ g_param_spec_object (
+ "full_header",
+ "Full Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_HEADER,
+ g_param_spec_object (
+ "ETableHeader",
+ "Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SORT_INFO,
+ g_param_spec_object (
+ "sort_info",
+ "Sort Info",
+ NULL,
+ E_TYPE_TABLE_SORT_INFO,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE,
+ g_param_spec_object (
+ "table",
+ "Table",
+ NULL,
+ E_TYPE_TABLE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TREE,
+ g_param_spec_object (
+ "tree",
+ "Tree",
+ NULL,
+ E_TYPE_TREE,
+ G_PARAM_WRITABLE));
+
+ ethi_signals[BUTTON_PRESSED] = g_signal_new (
+ "button_pressed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableHeaderItemClass, button_pressed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__BOXED,
+ G_TYPE_NONE, 1,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
}
static void
diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c
index 68516d5b4d..325390d559 100644
--- a/widgets/table/e-table-header.c
+++ b/widgets/table/e-table-header.c
@@ -151,8 +151,9 @@ eth_do_remove (ETableHeader *eth,
if (do_unref)
g_object_unref (eth->columns[idx]);
- memmove (&eth->columns[idx], &eth->columns[idx + 1],
- sizeof (ETableCol *) * (eth->col_count - idx - 1));
+ memmove (
+ &eth->columns[idx], &eth->columns[idx + 1],
+ sizeof (ETableCol *) * (eth->col_count - idx - 1));
eth->col_count--;
}
@@ -165,8 +166,9 @@ eth_finalize (GObject *object)
if (eth->sort_info) {
if (eth->sort_info_group_change_id)
- g_signal_handler_disconnect (G_OBJECT (eth->sort_info),
- eth->sort_info_group_change_id);
+ g_signal_handler_disconnect (
+ eth->sort_info,
+ eth->sort_info_group_change_id);
g_object_unref (eth->sort_info);
eth->sort_info = NULL;
}
@@ -224,7 +226,7 @@ eth_set_property (GObject *object,
if (eth->sort_info) {
if (eth->sort_info_group_change_id)
g_signal_handler_disconnect (
- G_OBJECT (eth->sort_info),
+ eth->sort_info,
eth->sort_info_group_change_id);
g_object_unref (eth->sort_info);
}
@@ -252,7 +254,7 @@ eth_get_property (GObject *object,
switch (property_id) {
case PROP_SORT_INFO:
- g_value_set_object (val, G_OBJECT (eth->sort_info));
+ g_value_set_object (val, eth->sort_info);
break;
case PROP_WIDTH:
g_value_set_double (val, eth->nominal_width);
@@ -276,55 +278,70 @@ e_table_header_class_init (ETableHeaderClass *class)
object_class->get_property = eth_get_property;
g_object_class_install_property (
- object_class, PROP_WIDTH,
- g_param_spec_double ("width", "Width", "Width",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
+ object_class,
+ PROP_WIDTH,
+ g_param_spec_double (
+ "width", "Width", "Width",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
g_object_class_install_property (
- object_class, PROP_WIDTH_EXTRAS,
- g_param_spec_double ("width_extras", "Width of Extras", "Width of Extras",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
+ object_class,
+ PROP_WIDTH_EXTRAS,
+ g_param_spec_double (
+ "width_extras",
+ "Width of Extras",
+ "Width of Extras",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
g_object_class_install_property (
- object_class, PROP_SORT_INFO,
- g_param_spec_object ("sort_info", "Sort Info", "Sort Info",
- E_TYPE_TABLE_SORT_INFO,
- G_PARAM_READWRITE));
-
- eth_signals[STRUCTURE_CHANGE] =
- g_signal_new ("structure_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderClass, structure_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- eth_signals[DIMENSION_CHANGE] =
- g_signal_new ("dimension_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderClass, dimension_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
- eth_signals[EXPANSION_CHANGE] =
- g_signal_new ("expansion_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderClass, expansion_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- eth_signals[REQUEST_WIDTH] =
- g_signal_new ("request_width",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableHeaderClass, request_width),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_INT__INT,
- G_TYPE_INT, 1, G_TYPE_INT);
+ object_class,
+ PROP_SORT_INFO,
+ g_param_spec_object (
+ "sort_info",
+ "Sort Info",
+ "Sort Info",
+ E_TYPE_TABLE_SORT_INFO,
+ G_PARAM_READWRITE));
+
+ eth_signals[STRUCTURE_CHANGE] = g_signal_new (
+ "structure_change",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableHeaderClass, structure_change),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ eth_signals[DIMENSION_CHANGE] = g_signal_new (
+ "dimension_change",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableHeaderClass, dimension_change),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
+
+ eth_signals[EXPANSION_CHANGE] = g_signal_new (
+ "expansion_change",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableHeaderClass, expansion_change),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ eth_signals[REQUEST_WIDTH] = g_signal_new (
+ "request_width",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableHeaderClass, request_width),
+ (GSignalAccumulator) NULL, NULL,
+ e_marshal_INT__INT,
+ G_TYPE_INT, 1,
+ G_TYPE_INT);
class->structure_change = NULL;
class->dimension_change = NULL;
@@ -380,7 +397,8 @@ eth_do_insert (ETableHeader *eth,
gint pos,
ETableCol *val)
{
- memmove (&eth->columns[pos + 1], &eth->columns[pos],
+ memmove (
+ &eth->columns[pos + 1], &eth->columns[pos],
sizeof (ETableCol *) * (eth->col_count - pos));
eth->columns[pos] = val;
eth->col_count++;
@@ -424,7 +442,7 @@ e_table_header_add_column (ETableHeader *eth,
eth_do_insert (eth, pos, tc);
enqueue (eth, -1, eth->nominal_width);
- g_signal_emit (G_OBJECT (eth), eth_signals[STRUCTURE_CHANGE], 0);
+ g_signal_emit (eth, eth_signals[STRUCTURE_CHANGE], 0);
}
/**
@@ -673,8 +691,8 @@ e_table_header_move (ETableHeader *eth,
eth_do_insert (eth, target_index, old);
eth_update_offsets (eth);
- g_signal_emit (G_OBJECT (eth), eth_signals[DIMENSION_CHANGE], 0, eth->width);
- g_signal_emit (G_OBJECT (eth), eth_signals[STRUCTURE_CHANGE], 0);
+ g_signal_emit (eth, eth_signals[DIMENSION_CHANGE], 0, eth->width);
+ g_signal_emit (eth, eth_signals[STRUCTURE_CHANGE], 0);
}
/**
@@ -696,7 +714,7 @@ e_table_header_remove (ETableHeader *eth,
eth_do_remove (eth, idx, TRUE);
enqueue (eth, -1, eth->nominal_width);
- g_signal_emit (G_OBJECT (eth), eth_signals[STRUCTURE_CHANGE], 0);
+ g_signal_emit (eth, eth_signals[STRUCTURE_CHANGE], 0);
}
/*
@@ -771,7 +789,7 @@ eth_set_size (ETableHeader *eth,
eth->columns[i]->expansion = 0;
}
- g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0);
+ g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0);
return;
}
@@ -781,7 +799,7 @@ eth_set_size (ETableHeader *eth,
for (i = idx; i < eth->col_count; i++) {
eth->columns[i]->expansion = 0;
}
- g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0);
+ g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0);
return;
}
@@ -798,7 +816,7 @@ eth_set_size (ETableHeader *eth,
for (i = idx + 1; i < eth->col_count; i++) {
eth->columns[i]->expansion = 0;
}
- g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0);
+ g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0);
return;
}
@@ -825,7 +843,7 @@ eth_set_size (ETableHeader *eth,
eth->columns[i]->expansion = expansion / expandable_count;
}
}
- g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0);
+ g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0);
return;
}
@@ -835,7 +853,7 @@ eth_set_size (ETableHeader *eth,
eth->columns[i]->expansion *= expansion / old_expansion;
}
}
- g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0);
+ g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0);
}
/**
@@ -922,7 +940,7 @@ eth_calc_widths (ETableHeader *eth)
}
g_free (widths);
if (changed)
- g_signal_emit (G_OBJECT (eth), eth_signals[DIMENSION_CHANGE], 0, eth->width);
+ g_signal_emit (eth, eth_signals[DIMENSION_CHANGE], 0, eth->width);
eth_update_offsets (eth);
}
@@ -937,14 +955,13 @@ e_table_header_update_horizontal (ETableHeader *eth)
for (i = 0; i < cols; i++) {
gint width = 0;
- g_signal_emit_by_name (G_OBJECT (eth),
- "request_width",
- i, &width);
+ g_signal_emit_by_name (
+ eth, "request_width", i, &width);
eth->columns[i]->min_width = width + 10;
eth->columns[i]->expansion = 1;
}
enqueue (eth, -1, eth->nominal_width);
- g_signal_emit (G_OBJECT (eth), eth_signals[EXPANSION_CHANGE], 0);
+ g_signal_emit (eth, eth_signals[EXPANSION_CHANGE], 0);
}
gint
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index b9e2cce10d..1cb81f00dc 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -381,8 +381,9 @@ eti_free_save_state (ETableItem *eti)
!eti->cell_views_realized)
return;
- e_cell_free_state (eti->cell_views[eti->save_col], view_to_model_col (eti, eti->save_col),
- eti->save_col, eti->save_row, eti->save_state);
+ e_cell_free_state (
+ eti->cell_views[eti->save_col], view_to_model_col (eti, eti->save_col),
+ eti->save_col, eti->save_row, eti->save_state);
eti->save_row = -1;
eti->save_col = -1;
eti->save_state = NULL;
@@ -564,8 +565,9 @@ eti_update (GnomeCanvasItem *item,
}
if (eti->needs_redraw) {
- gnome_canvas_request_redraw (item->canvas, item->x1, item->y1,
- item->x2, item->y2);
+ gnome_canvas_request_redraw (
+ item->canvas, item->x1, item->y1,
+ item->x2, item->y2);
eti->needs_redraw = 0;
}
}
@@ -581,20 +583,27 @@ eti_remove_table_model (ETableItem *eti)
if (!eti->table_model)
return;
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_pre_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_no_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_row_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_cell_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_rows_inserted_id);
- g_signal_handler_disconnect (G_OBJECT (eti->table_model),
- eti->table_model_rows_deleted_id);
+ g_signal_handler_disconnect (
+ eti->table_model,
+ eti->table_model_pre_change_id);
+ g_signal_handler_disconnect (
+ eti->table_model,
+ eti->table_model_no_change_id);
+ g_signal_handler_disconnect (
+ eti->table_model,
+ eti->table_model_change_id);
+ g_signal_handler_disconnect (
+ eti->table_model,
+ eti->table_model_row_change_id);
+ g_signal_handler_disconnect (
+ eti->table_model,
+ eti->table_model_cell_change_id);
+ g_signal_handler_disconnect (
+ eti->table_model,
+ eti->table_model_rows_inserted_id);
+ g_signal_handler_disconnect (
+ eti->table_model,
+ eti->table_model_rows_deleted_id);
g_object_unref (eti->table_model);
if (eti->source_model)
g_object_unref (eti->source_model);
@@ -622,14 +631,18 @@ eti_remove_selection_model (ETableItem *eti)
if (!eti->selection)
return;
- g_signal_handler_disconnect (eti->selection,
- eti->selection_change_id);
- g_signal_handler_disconnect (eti->selection,
- eti->selection_row_change_id);
- g_signal_handler_disconnect (eti->selection,
- eti->cursor_change_id);
- g_signal_handler_disconnect (eti->selection,
- eti->cursor_activated_id);
+ g_signal_handler_disconnect (
+ eti->selection,
+ eti->selection_change_id);
+ g_signal_handler_disconnect (
+ eti->selection,
+ eti->selection_row_change_id);
+ g_signal_handler_disconnect (
+ eti->selection,
+ eti->cursor_change_id);
+ g_signal_handler_disconnect (
+ eti->selection,
+ eti->cursor_activated_id);
g_object_unref (eti->selection);
eti->selection_change_id = 0;
@@ -649,12 +662,15 @@ eti_remove_header_model (ETableItem *eti)
if (!eti->header)
return;
- g_signal_handler_disconnect (G_OBJECT (eti->header),
- eti->header_structure_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->header),
- eti->header_dim_change_id);
- g_signal_handler_disconnect (G_OBJECT (eti->header),
- eti->header_request_width_id);
+ g_signal_handler_disconnect (
+ eti->header,
+ eti->header_structure_change_id);
+ g_signal_handler_disconnect (
+ eti->header,
+ eti->header_dim_change_id);
+ g_signal_handler_disconnect (
+ eti->header,
+ eti->header_request_width_id);
if (eti->cell_views) {
eti_unrealize_cell_views (eti);
@@ -948,15 +964,18 @@ eti_request_region_redraw (ETableItem *eti,
if (eti->rows > 0) {
- eti_get_region (eti,
- start_col, start_row,
- end_col, end_row,
- &x1, &y1, &x2, &y2);
+ eti_get_region (
+ eti,
+ start_col, start_row,
+ end_col, end_row,
+ &x1, &y1, &x2, &y2);
- eti_item_region_redraw (eti, x1 - border,
- y1 - border,
- x2 + 1 + border,
- y2 + 1 + border);
+ eti_item_region_redraw (
+ eti,
+ x1 - border,
+ y1 - border,
+ x2 + 1 + border,
+ y2 + 1 + border);
}
}
@@ -976,15 +995,18 @@ eti_request_region_show (ETableItem *eti,
{
gint x1, y1, x2, y2;
- eti_get_region (eti,
- start_col, start_row,
- end_col, end_row,
- &x1, &y1, &x2, &y2);
+ eti_get_region (
+ eti,
+ start_col, start_row,
+ end_col, end_row,
+ &x1, &y1, &x2, &y2);
if (delay)
- e_canvas_item_show_area_delayed (GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2, delay);
+ e_canvas_item_show_area_delayed (
+ GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2, delay);
else
- e_canvas_item_show_area (GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2);
+ e_canvas_item_show_area (
+ GNOME_CANVAS_ITEM (eti), x1, y1, x2, y2);
}
static void
@@ -1005,9 +1027,10 @@ eti_show_cursor (ETableItem *eti,
}
#if 0
- g_object_get (eti->selection,
- "cursor_row", &cursor_row,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &cursor_row,
+ NULL);
#else
cursor_row = e_selection_model_cursor_row (eti->selection);
#endif
@@ -1016,9 +1039,10 @@ eti_show_cursor (ETableItem *eti,
if (cursor_row != -1) {
cursor_row = model_to_view_row (eti, cursor_row);
- eti_request_region_show (eti,
- 0, cursor_row, eti->cols - 1, cursor_row,
- delay);
+ eti_request_region_show (
+ eti,
+ 0, cursor_row, eti->cols - 1, cursor_row,
+ delay);
}
}
@@ -1038,9 +1062,10 @@ eti_check_cursor_bounds (ETableItem *eti)
return;
}
- g_object_get (eti->selection,
- "cursor_row", &cursor_row,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &cursor_row,
+ NULL);
if (cursor_row == -1) {
eti->cursor_x1 = -1;
@@ -1057,9 +1082,10 @@ eti_check_cursor_bounds (ETableItem *eti)
d (g_print ("%s: cursor row: %d\n", __FUNCTION__, cursor_row));
- eti_get_region (eti,
- 0, cursor_row, eti->cols - 1, cursor_row,
- &x1, &y1, &x2, &y2);
+ eti_get_region (
+ eti,
+ 0, cursor_row, eti->cols - 1, cursor_row,
+ &x1, &y1, &x2, &y2);
eti->cursor_x1 = x1;
eti->cursor_y1 = y1;
eti->cursor_x2 = x2;
@@ -1325,10 +1351,11 @@ e_table_item_redraw_range (ETableItem *eti,
g_return_if_fail (eti != NULL);
g_return_if_fail (E_IS_TABLE_ITEM (eti));
- g_object_get (eti->selection,
- "cursor_col", &cursor_col,
- "cursor_row", &cursor_row,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_col", &cursor_col,
+ "cursor_row", &cursor_row,
+ NULL);
if ((start_col == cursor_col) ||
(end_col == cursor_col) ||
@@ -1359,31 +1386,31 @@ eti_add_table_model (ETableItem *eti,
g_object_ref (eti->table_model);
eti->table_model_pre_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_pre_change",
+ table_model, "model_pre_change",
G_CALLBACK (eti_table_model_pre_change), eti);
eti->table_model_no_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_no_change",
+ table_model, "model_no_change",
G_CALLBACK (eti_table_model_no_change), eti);
eti->table_model_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_changed",
+ table_model, "model_changed",
G_CALLBACK (eti_table_model_changed), eti);
eti->table_model_row_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_row_changed",
+ table_model, "model_row_changed",
G_CALLBACK (eti_table_model_row_changed), eti);
eti->table_model_cell_change_id = g_signal_connect (
- G_OBJECT (table_model), "model_cell_changed",
+ table_model, "model_cell_changed",
G_CALLBACK (eti_table_model_cell_changed), eti);
eti->table_model_rows_inserted_id = g_signal_connect (
- G_OBJECT (table_model), "model_rows_inserted",
+ table_model, "model_rows_inserted",
G_CALLBACK (eti_table_model_rows_inserted), eti);
eti->table_model_rows_deleted_id = g_signal_connect (
- G_OBJECT (table_model), "model_rows_deleted",
+ table_model, "model_rows_deleted",
G_CALLBACK (eti_table_model_rows_deleted), eti);
if (eti->header) {
@@ -1429,8 +1456,7 @@ eti_add_selection_model (ETableItem *eti,
G_CALLBACK (eti_cursor_activated), eti);
eti_selection_change (selection, eti);
- g_signal_emit_by_name (G_OBJECT (eti),
- "selection_model_added", eti->selection);
+ g_signal_emit_by_name (eti, "selection_model_added", eti->selection);
}
static void
@@ -1498,16 +1524,16 @@ eti_add_header_model (ETableItem *eti,
eti_header_structure_changed (header, eti);
eti->header_dim_change_id = g_signal_connect (
- G_OBJECT (header), "dimension_change",
+ header, "dimension_change",
G_CALLBACK (eti_header_dim_changed), eti);
eti->header_structure_change_id = g_signal_connect (
- G_OBJECT (header), "structure_change",
+ header, "structure_change",
G_CALLBACK (eti_header_structure_changed), eti);
- eti->header_request_width_id = g_signal_connect
- (G_OBJECT (header), "request_width",
- G_CALLBACK (eti_request_column_width), eti);
+ eti->header_request_width_id = g_signal_connect (
+ header, "request_width",
+ G_CALLBACK (eti_request_column_width), eti);
}
/*
@@ -1563,8 +1589,8 @@ eti_set_property (GObject *object,
break;
case PROP_SELECTION_MODEL:
- g_signal_emit_by_name (G_OBJECT (eti),
- "selection_model_removed", eti->selection);
+ g_signal_emit_by_name (
+ eti, "selection_model_removed", eti->selection);
eti_remove_selection_model (eti);
if (g_value_get_object (value))
eti_add_selection_model (eti, E_SELECTION_MODEL (g_value_get_object (value)));
@@ -1604,9 +1630,10 @@ eti_set_property (GObject *object,
eti->minimum_width = g_value_get_double (value);
break;
case PROP_CURSOR_ROW:
- g_object_get (eti->selection,
- "cursor_col", &cursor_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_col", &cursor_col,
+ NULL);
e_table_item_focus (eti, cursor_col != -1 ? cursor_col : 0, view_to_model_row (eti, g_value_get_int (value)), 0);
break;
@@ -1649,9 +1676,10 @@ eti_get_property (GObject *object,
g_value_set_double (value, eti->minimum_width);
break;
case PROP_CURSOR_ROW:
- g_object_get (eti->selection,
- "cursor_row", &row,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &row,
+ NULL);
g_value_set_int (value, model_to_view_row (eti, row));
break;
case PROP_UNIFORM_ROW_HEIGHT:
@@ -1972,10 +2000,11 @@ eti_draw (GnomeCanvasItem *item,
selected = e_selection_model_is_row_selected (E_SELECTION_MODEL (eti->selection), view_to_model_row (eti,row));
- g_object_get (eti->selection,
- "cursor_col", &cursor_col,
- "cursor_row", &cursor_row,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_col", &cursor_col,
+ "cursor_row", &cursor_row,
+ NULL);
for (col = first_col; col < last_col; col++) {
ETableCol *ecol = e_table_header_get_column (eti->header, col);
@@ -2010,17 +2039,20 @@ eti_draw (GnomeCanvasItem *item,
cairo_save (cr);
pat = cairo_pattern_create_linear (0, y1, 0, y2);
- cairo_pattern_add_color_stop_rgba (pat, 0.0, background->red / 65535.0 ,
- background->green / 65535.0,
- background->blue / 65535.0, selected ? 0.8: 1.0);
+ cairo_pattern_add_color_stop_rgba (
+ pat, 0.0, background->red / 65535.0 ,
+ background->green / 65535.0,
+ background->blue / 65535.0, selected ? 0.8: 1.0);
if (selected)
- cairo_pattern_add_color_stop_rgba (pat, 0.5, background->red / 65535.0 ,
- background->green / 65535.0,
- background->blue / 65535.0, 0.9);
-
- cairo_pattern_add_color_stop_rgba (pat, 1, background->red / 65535.0 ,
- background->green / 65535.0,
- background->blue / 65535.0, selected ? 0.8 : 1.0);
+ cairo_pattern_add_color_stop_rgba (
+ pat, 0.5, background->red / 65535.0 ,
+ background->green / 65535.0,
+ background->blue / 65535.0, 0.9);
+
+ cairo_pattern_add_color_stop_rgba (
+ pat, 1, background->red / 65535.0 ,
+ background->green / 65535.0,
+ background->blue / 65535.0, selected ? 0.8 : 1.0);
cairo_rectangle (cr, x1, y1, ecol->width, height - 1);
cairo_set_source (cr, pat);
cairo_fill_preserve (cr);
@@ -2031,17 +2063,19 @@ eti_draw (GnomeCanvasItem *item,
cairo_save (cr);
cairo_set_line_width (cr, 1.0);
- cairo_set_source_rgba (cr, background->red / 65535.0 ,
- background->green / 65535.0,
- background->blue / 65535.0, 1);
+ cairo_set_source_rgba (
+ cr, background->red / 65535.0 ,
+ background->green / 65535.0,
+ background->blue / 65535.0, 1);
cairo_move_to (cr, x1, y1);
cairo_line_to (cr, x2, y1);
cairo_stroke (cr);
cairo_set_line_width (cr, 1.0);
- cairo_set_source_rgba (cr, background->red / 65535.0 ,
- background->green / 65535.0,
- background->blue / 65535.0, 1);
+ cairo_set_source_rgba (
+ cr, background->red / 65535.0 ,
+ background->green / 65535.0,
+ background->blue / 65535.0, 1);
cairo_move_to (cr, x1, y2);
cairo_line_to (cr, x2, y2);
cairo_stroke (cr);
@@ -2069,8 +2103,9 @@ eti_draw (GnomeCanvasItem *item,
break;
}
- e_cell_draw (ecell_view, cr, ecol->col_idx, col, row, flags,
- xd, yd, xd + ecol->width, yd + height);
+ e_cell_draw (
+ ecell_view, cr, ecol->col_idx, col, row, flags,
+ xd, yd, xd + ecol->width, yd + height);
if (!f_found && !selected) {
switch (eti->cursor_mode) {
@@ -2128,9 +2163,10 @@ eti_draw (GnomeCanvasItem *item,
if (eti->draw_focus && f_found) {
static const double dash[] = { 1.0, 1.0 };
cairo_set_line_width (cr, 1.0);
- cairo_rectangle (cr,
- f_x1 + 0.5, f_x2 + 0.5,
- f_x2 - f_x1 - 1, f_y2 - f_y1);
+ cairo_rectangle (
+ cr,
+ f_x1 + 0.5, f_x2 + 0.5,
+ f_x2 - f_x1 - 1, f_y2 - f_y1);
gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
cairo_stroke_preserve (cr);
@@ -2236,10 +2272,11 @@ static void
eti_cursor_move_left (ETableItem *eti)
{
gint cursor_col, cursor_row;
- g_object_get (eti->selection,
- "cursor_col", &cursor_col,
- "cursor_row", &cursor_row,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_col", &cursor_col,
+ "cursor_row", &cursor_row,
+ NULL);
eti_cursor_move (eti, model_to_view_row (eti, cursor_row), model_to_view_col (eti, cursor_col) - 1);
}
@@ -2248,10 +2285,11 @@ static void
eti_cursor_move_right (ETableItem *eti)
{
gint cursor_col, cursor_row;
- g_object_get (eti->selection,
- "cursor_col", &cursor_col,
- "cursor_row", &cursor_row,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_col", &cursor_col,
+ "cursor_row", &cursor_row,
+ NULL);
eti_cursor_move (eti, model_to_view_row (eti, cursor_row), model_to_view_col (eti, cursor_col) + 1);
}
@@ -2335,10 +2373,11 @@ eti_event (GnomeCanvasItem *item,
button.x = x1;
button.y = y1;
- g_object_get (eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &cursor_row,
+ "cursor_col", &cursor_col,
+ NULL);
if (cursor_col == view_to_model_col (eti, col) && cursor_row == view_to_model_row (eti, row)) {
flags = E_CELL_CURSOR;
@@ -2350,25 +2389,28 @@ eti_event (GnomeCanvasItem *item,
if (return_val)
return TRUE;
- g_signal_emit (eti, eti_signals[CLICK], 0,
- row, view_to_model_col (eti, col), &button, &return_val);
+ g_signal_emit (
+ eti, eti_signals[CLICK], 0,
+ row, view_to_model_col (eti, col), &button, &return_val);
if (return_val) {
eti->click_count = 0;
return TRUE;
}
- g_object_get (eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &cursor_row,
+ "cursor_col", &cursor_col,
+ NULL);
eti->maybe_did_something =
e_selection_model_maybe_do_something (E_SELECTION_MODEL (eti->selection), view_to_model_row (eti, row), view_to_model_col (eti, col), button.state);
- g_object_get (eti->selection,
- "cursor_row", &new_cursor_row,
- "cursor_col", &new_cursor_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &new_cursor_row,
+ "cursor_col", &new_cursor_col,
+ NULL);
if (cursor_row != new_cursor_row || cursor_col != new_cursor_col) {
eti->click_count = 1;
@@ -2385,8 +2427,9 @@ eti_event (GnomeCanvasItem *item,
*/
if (eti_editing (eti)) {
- return_val = eti_e_cell_event (eti, ecell_view, (GdkEvent *) &button, button.time,
- view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR);
+ return_val = eti_e_cell_event (
+ eti, ecell_view, (GdkEvent *) &button, button.time,
+ view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR);
if (return_val)
return TRUE;
}
@@ -2415,8 +2458,9 @@ eti_event (GnomeCanvasItem *item,
e_selection_model_right_click_down (E_SELECTION_MODEL (eti->selection), view_to_model_row (eti, row), view_to_model_col (eti, col), 0);
- g_signal_emit (eti, eti_signals[RIGHT_CLICK], 0,
- row, view_to_model_col (eti, col), e, &return_val);
+ g_signal_emit (
+ eti, eti_signals[RIGHT_CLICK], 0,
+ row, view_to_model_col (eti, col), e, &return_val);
if (!return_val)
e_selection_model_right_click_up (E_SELECTION_MODEL (eti->selection));
break;
@@ -2459,7 +2503,8 @@ eti_event (GnomeCanvasItem *item,
#if d(!)0
{
gboolean cell_found = find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1);
- g_print ("%s: find_cell(%f, %f) = %s(%d, %d, %f, %f)\n", __FUNCTION__, e->button.x, e->button.y,
+ g_print (
+ "%s: find_cell(%f, %f) = %s(%d, %d, %f, %f)\n", __FUNCTION__, e->button.x, e->button.y,
cell_found?"true":"false", col, row, x1, y1);
}
#endif
@@ -2467,14 +2512,11 @@ eti_event (GnomeCanvasItem *item,
if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1))
return TRUE;
- g_object_get (eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
-
- d (g_print ("%s: GDK_BUTTON_RELEASE received, button %d, line: %d\n"
- "eti_editing: %s, row:%d:%d, col:%d:%d\n", __FUNCTION__, e->button.button, __LINE__,
- eti_editing (eti)?"true":"false", cursor_row, view_to_model_row (eti, row), cursor_col, view_to_model_col (eti, col)));
+ g_object_get (
+ eti->selection,
+ "cursor_row", &cursor_row,
+ "cursor_col", &cursor_col,
+ NULL);
if (eti_editing (eti) && cursor_row == view_to_model_row (eti, row) && cursor_col == view_to_model_col (eti, col)) {
@@ -2489,8 +2531,9 @@ eti_event (GnomeCanvasItem *item,
e->button.x = x1;
e->button.y = y1;
- return_val = eti_e_cell_event (eti, ecell_view, e, e->button.time,
- view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR);
+ return_val = eti_e_cell_event (
+ eti, ecell_view, e, e->button.time,
+ view_to_model_col (eti, col), col, row, E_CELL_EDITING | E_CELL_CURSOR);
}
break;
case 3:
@@ -2527,10 +2570,11 @@ eti_event (GnomeCanvasItem *item,
return TRUE;
#endif
- g_object_get (eti->selection,
- "cursor_row", &model_row,
- "cursor_col", &model_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &model_row,
+ "cursor_col", &model_col,
+ NULL);
e->button.x -= e_table_header_col_diff (eti->header, 0, model_to_view_col (eti, model_col));
e->button.y -= e_table_item_row_diff (eti, 0, model_to_view_row (eti, model_row));
@@ -2555,8 +2599,9 @@ eti_event (GnomeCanvasItem *item,
}
if (model_row != -1 && model_col != -1) {
- g_signal_emit (eti, eti_signals[DOUBLE_CLICK], 0,
- model_row, model_col, e);
+ g_signal_emit (
+ eti, eti_signals[DOUBLE_CLICK], 0,
+ model_row, model_col, e);
}
}
break;
@@ -2574,8 +2619,9 @@ eti_event (GnomeCanvasItem *item,
gboolean drag_handled;
eti->maybe_in_drag = 0;
- g_signal_emit (eti, eti_signals[START_DRAG], 0,
- eti->drag_row, eti->drag_col, e, &drag_handled);
+ g_signal_emit (
+ eti, eti_signals[START_DRAG], 0,
+ eti->drag_row, eti->drag_col, e, &drag_handled);
if (drag_handled)
eti->in_drag = 1;
else
@@ -2590,19 +2636,21 @@ eti_event (GnomeCanvasItem *item,
(row != eti->motion_row || col != eti->motion_col)) {
GdkEvent *cross = gdk_event_new (GDK_LEAVE_NOTIFY);
cross->crossing.time = e->motion.time;
- return_val = eti_e_cell_event (eti, eti->cell_views[eti->motion_col],
- cross, cross->crossing.time,
- view_to_model_col (eti, eti->motion_col),
- eti->motion_col, eti->motion_row, 0);
+ return_val = eti_e_cell_event (
+ eti, eti->cell_views[eti->motion_col],
+ cross, cross->crossing.time,
+ view_to_model_col (eti, eti->motion_col),
+ eti->motion_col, eti->motion_row, 0);
}
eti->motion_row = row;
eti->motion_col = col;
- g_object_get (eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &cursor_row,
+ "cursor_col", &cursor_col,
+ NULL);
flags = 0;
if (cursor_row == view_to_model_row (eti, row) && cursor_col == view_to_model_col (eti, col)) {
@@ -2617,8 +2665,9 @@ eti_event (GnomeCanvasItem *item,
e->motion.x = x1;
e->motion.y = y1;
- return_val = eti_e_cell_event (eti, ecell_view, e, e->motion.time,
- view_to_model_col (eti, col), col, row, flags);
+ return_val = eti_e_cell_event (
+ eti, ecell_view, e, e->motion.time,
+ view_to_model_col (eti, col), col, row, flags);
break;
}
@@ -2628,10 +2677,11 @@ eti_event (GnomeCanvasItem *item,
d (g_print ("%s: GDK_KEY_PRESS received, keyval: %d\n", __FUNCTION__, (gint) e->key.keyval));
- g_object_get (eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &cursor_row,
+ "cursor_col", &cursor_col,
+ NULL);
if (cursor_row == -1 && cursor_col == -1)
return FALSE;
@@ -2646,8 +2696,9 @@ eti_event (GnomeCanvasItem *item,
break;
}
- g_signal_emit (eti, eti_signals[KEY_PRESS], 0,
- model_to_view_row (eti, cursor_row), cursor_col, e, &return_val);
+ g_signal_emit (
+ eti, eti_signals[KEY_PRESS], 0,
+ model_to_view_row (eti, cursor_row), cursor_col, e, &return_val);
if ((!return_val) &&
(atk_get_root () || eti->cursor_mode != E_CURSOR_LINE) &&
cursor_col != view_to_model_col (eti, 0))
@@ -2662,8 +2713,9 @@ eti_event (GnomeCanvasItem *item,
break;
}
- g_signal_emit (eti, eti_signals[KEY_PRESS], 0,
- model_to_view_row (eti, cursor_row), cursor_col, e, &return_val);
+ g_signal_emit (
+ eti, eti_signals[KEY_PRESS], 0,
+ model_to_view_row (eti, cursor_row), cursor_col, e, &return_val);
if ((!return_val) &&
(atk_get_root () || eti->cursor_mode != E_CURSOR_LINE) &&
cursor_col != view_to_model_col (eti, eti->cols - 1))
@@ -2676,7 +2728,7 @@ eti_event (GnomeCanvasItem *item,
case GDK_KEY_Down:
case GDK_KEY_KP_Down:
if ((e->key.state & GDK_MOD1_MASK)
- && ((e->key.keyval == GDK_KEY_Down ) || (e->key.keyval == GDK_KEY_KP_Down))) {
+ && ((e->key.keyval == GDK_KEY_Down) || (e->key.keyval == GDK_KEY_KP_Down))) {
gint view_col = model_to_view_col (eti, cursor_col);
if ((view_col >= 0) && (view_col < eti->cols))
@@ -2735,10 +2787,11 @@ eti_event (GnomeCanvasItem *item,
else
return_val = FALSE;
}
- g_object_get (eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &cursor_row,
+ "cursor_col", &cursor_col,
+ NULL);
if (cursor_col >= 0 && cursor_row >= 0 && return_val &&
(!eti_editing (eti)) && e_table_model_is_cell_editable (eti->table_model, cursor_col, model_to_view_row (eti, cursor_row))) {
@@ -2757,14 +2810,16 @@ eti_event (GnomeCanvasItem *item,
case GDK_KEY_3270_Enter:
if (eti_editing (eti)) {
ecell_view = eti->cell_views[eti->editing_col];
- return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time,
- view_to_model_col (eti, eti->editing_col),
- eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR | E_CELL_PREEDIT);
+ return_val = eti_e_cell_event (
+ eti, ecell_view, e, e->key.time,
+ view_to_model_col (eti, eti->editing_col),
+ eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR | E_CELL_PREEDIT);
if (!return_val)
break;
}
- g_signal_emit (eti, eti_signals[KEY_PRESS], 0,
- model_to_view_row (eti, cursor_row), cursor_col, e, &return_val);
+ g_signal_emit (
+ eti, eti_signals[KEY_PRESS], 0,
+ model_to_view_row (eti, cursor_row), cursor_col, e, &return_val);
if (!return_val)
return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
break;
@@ -2805,15 +2860,17 @@ eti_event (GnomeCanvasItem *item,
}
}
if (!eti_editing (eti)) {
- g_signal_emit (eti, eti_signals[KEY_PRESS], 0,
- model_to_view_row (eti, cursor_row), cursor_col, e, &return_val);
+ g_signal_emit (
+ eti, eti_signals[KEY_PRESS], 0,
+ model_to_view_row (eti, cursor_row), cursor_col, e, &return_val);
if (!return_val)
e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
} else {
ecell_view = eti->cell_views[eti->editing_col];
- return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time,
- view_to_model_col (eti, eti->editing_col),
- eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR);
+ return_val = eti_e_cell_event (
+ eti, ecell_view, e, e->key.time,
+ view_to_model_col (eti, eti->editing_col),
+ eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR);
if (!return_val)
e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
}
@@ -2829,19 +2886,21 @@ eti_event (GnomeCanvasItem *item,
d (g_print ("%s: GDK_KEY_RELEASE received, keyval: %d\n", __FUNCTION__, (gint) e->key.keyval));
- g_object_get (eti->selection,
- "cursor_row", &cursor_row,
- "cursor_col", &cursor_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_row", &cursor_row,
+ "cursor_col", &cursor_col,
+ NULL);
if (cursor_col == -1)
return FALSE;
if (eti_editing (eti)) {
ecell_view = eti->cell_views[eti->editing_col];
- return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time,
- view_to_model_col (eti, eti->editing_col),
- eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR);
+ return_val = eti_e_cell_event (
+ eti, ecell_view, e, e->key.time,
+ view_to_model_col (eti, eti->editing_col),
+ eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR);
}
break;
}
@@ -2851,10 +2910,11 @@ eti_event (GnomeCanvasItem *item,
case GDK_ENTER_NOTIFY:
d (g_print ("%s: %s received\n", __FUNCTION__, leave ? "GDK_LEAVE_NOTIFY" : "GDK_ENTER_NOTIFY"));
if (eti->motion_row != -1 && eti->motion_col != -1)
- return_val = eti_e_cell_event (eti, eti->cell_views[eti->motion_col],
- e, e->crossing.time,
- view_to_model_col (eti, eti->motion_col),
- eti->motion_col, eti->motion_row, 0);
+ return_val = eti_e_cell_event (
+ eti, eti->cell_views[eti->motion_col],
+ e, e->crossing.time,
+ view_to_model_col (eti, eti->motion_col),
+ eti->motion_col, eti->motion_row, 0);
eti->motion_row = -1;
eti->motion_col = -1;
@@ -2868,8 +2928,9 @@ eti_event (GnomeCanvasItem *item,
!eti_editing (eti) &&
e_table_model_is_cell_editable (eti->table_model, view_to_model_col (eti, eti->save_col), eti->save_row)) {
e_table_item_enter_edit (eti, eti->save_col, eti->save_row);
- e_cell_load_state (eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->save_col),
- eti->save_col, eti->save_row, eti->edit_ctx, eti->save_state);
+ e_cell_load_state (
+ eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->save_col),
+ eti->save_col, eti->save_row, eti->edit_ctx, eti->save_state);
eti_free_save_state (eti);
}
} else {
@@ -2878,8 +2939,9 @@ eti_event (GnomeCanvasItem *item,
eti->save_row = eti->editing_row;
eti->save_col = eti->editing_col;
- eti->save_state = e_cell_save_state (eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->editing_col),
- eti->editing_col, eti->editing_row, eti->edit_ctx);
+ eti->save_state = e_cell_save_state (
+ eti->cell_views[eti->editing_col], view_to_model_col (eti, eti->editing_col),
+ eti->editing_col, eti->editing_row, eti->edit_ctx);
e_table_item_leave_edit_(eti);
}
}
@@ -2948,209 +3010,257 @@ eti_class_init (ETableItemClass *class)
class->selection_model_removed = NULL;
class->selection_model_added = NULL;
- g_object_class_install_property (object_class, PROP_TABLE_HEADER,
- g_param_spec_object ("ETableHeader",
- "Table header",
- "Table header",
- E_TYPE_TABLE_HEADER,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_MODEL,
- g_param_spec_object ("ETableModel",
- "Table model",
- "Table model",
- E_TYPE_TABLE_MODEL,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_SELECTION_MODEL,
- g_param_spec_object ("selection_model",
- "Selection model",
- "Selection model",
- E_TYPE_SELECTION_MODEL,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_ALTERNATING_ROW_COLORS,
- g_param_spec_boolean ("alternating_row_colors",
- "Alternating Row Colors",
- "Alternating Row Colors",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_HORIZONTAL_DRAW_GRID,
- g_param_spec_boolean ("horizontal_draw_grid",
- "Horizontal Draw Grid",
- "Horizontal Draw Grid",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_VERTICAL_DRAW_GRID,
- g_param_spec_boolean ("vertical_draw_grid",
- "Vertical Draw Grid",
- "Vertical Draw Grid",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_TABLE_DRAW_FOCUS,
- g_param_spec_boolean ("drawfocus",
- "Draw focus",
- "Draw focus",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_MODE,
- g_param_spec_int ("cursor_mode",
- "Cursor mode",
- "Cursor mode",
- E_CURSOR_LINE, E_CURSOR_SPREADSHEET, E_CURSOR_LINE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- "Length Threshold",
- "Length Threshold",
- -1, G_MAXINT, 0,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_MINIMUM_WIDTH,
- g_param_spec_double ("minimum_width",
- "Minimum width",
- "Minimum Width",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_WIDTH,
- g_param_spec_double ("width",
- "Width",
- "Width",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class, PROP_HEIGHT,
- g_param_spec_double ("height",
- "Height",
- "Height",
- 0.0, G_MAXDOUBLE, 0.0,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_CURSOR_ROW,
- g_param_spec_int ("cursor_row",
- "Cursor row",
- "Cursor row",
- 0, G_MAXINT, 0,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- "Uniform row height",
- "Uniform row height",
- FALSE,
- G_PARAM_READWRITE));
-
- eti_signals[CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, cursor_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- eti_signals[CURSOR_ACTIVATED] =
- g_signal_new ("cursor_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, cursor_activated),
- NULL, NULL,
- g_cclosure_marshal_VOID__INT,
- G_TYPE_NONE, 1, G_TYPE_INT);
-
- eti_signals[DOUBLE_CLICK] =
- g_signal_new ("double_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, double_click),
- NULL, NULL,
- e_marshal_NONE__INT_INT_BOXED,
- G_TYPE_NONE, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- eti_signals[START_DRAG] =
- g_signal_new ("start_drag",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, start_drag),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- eti_signals[RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, right_click),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- eti_signals[CLICK] =
- g_signal_new ("click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, click),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- eti_signals[KEY_PRESS] =
- g_signal_new ("key_press",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, key_press),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_INT_BOXED,
- G_TYPE_BOOLEAN, 3,
- G_TYPE_INT,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- eti_signals[STYLE_SET] =
- g_signal_new ("style_set",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableItemClass, style_set),
- NULL, NULL,
- g_cclosure_marshal_VOID__OBJECT,
- G_TYPE_NONE, 1, GTK_TYPE_STYLE);
-
- eti_signals[SELECTION_MODEL_REMOVED] =
- g_signal_new ("selection_model_removed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (ETableItemClass, selection_model_removed),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
-
- eti_signals[SELECTION_MODEL_ADDED] =
- g_signal_new ("selection_model_added",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (ETableItemClass, selection_model_added),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1,
- G_TYPE_POINTER);
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_HEADER,
+ g_param_spec_object (
+ "ETableHeader",
+ "Table header",
+ "Table header",
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_MODEL,
+ g_param_spec_object (
+ "ETableModel",
+ "Table model",
+ "Table model",
+ E_TYPE_TABLE_MODEL,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_SELECTION_MODEL,
+ g_param_spec_object (
+ "selection_model",
+ "Selection model",
+ "Selection model",
+ E_TYPE_SELECTION_MODEL,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_ALTERNATING_ROW_COLORS,
+ g_param_spec_boolean (
+ "alternating_row_colors",
+ "Alternating Row Colors",
+ "Alternating Row Colors",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_HORIZONTAL_DRAW_GRID,
+ g_param_spec_boolean (
+ "horizontal_draw_grid",
+ "Horizontal Draw Grid",
+ "Horizontal Draw Grid",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_VERTICAL_DRAW_GRID,
+ g_param_spec_boolean (
+ "vertical_draw_grid",
+ "Vertical Draw Grid",
+ "Vertical Draw Grid",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_TABLE_DRAW_FOCUS,
+ g_param_spec_boolean (
+ "drawfocus",
+ "Draw focus",
+ "Draw focus",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_CURSOR_MODE,
+ g_param_spec_int (
+ "cursor_mode",
+ "Cursor mode",
+ "Cursor mode",
+ E_CURSOR_LINE,
+ E_CURSOR_SPREADSHEET,
+ E_CURSOR_LINE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_LENGTH_THRESHOLD,
+ g_param_spec_int (
+ "length_threshold",
+ "Length Threshold",
+ "Length Threshold",
+ -1, G_MAXINT, 0,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_MINIMUM_WIDTH,
+ g_param_spec_double (
+ "minimum_width",
+ "Minimum width",
+ "Minimum Width",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_WIDTH,
+ g_param_spec_double (
+ "width",
+ "Width",
+ "Width",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HEIGHT,
+ g_param_spec_double (
+ "height",
+ "Height",
+ "Height",
+ 0.0, G_MAXDOUBLE, 0.0,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_CURSOR_ROW,
+ g_param_spec_int (
+ "cursor_row",
+ "Cursor row",
+ "Cursor row",
+ 0, G_MAXINT, 0,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_UNIFORM_ROW_HEIGHT,
+ g_param_spec_boolean (
+ "uniform_row_height",
+ "Uniform row height",
+ "Uniform row height",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ eti_signals[CURSOR_CHANGE] = g_signal_new (
+ "cursor_change",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableItemClass, cursor_change),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
+
+ eti_signals[CURSOR_ACTIVATED] = g_signal_new (
+ "cursor_activated",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableItemClass, cursor_activated),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
+
+ eti_signals[DOUBLE_CLICK] = g_signal_new (
+ "double_click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableItemClass, double_click),
+ NULL, NULL,
+ e_marshal_NONE__INT_INT_BOXED,
+ G_TYPE_NONE, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ eti_signals[START_DRAG] = g_signal_new (
+ "start_drag",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableItemClass, start_drag),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ eti_signals[RIGHT_CLICK] = g_signal_new (
+ "right_click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableItemClass, right_click),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ eti_signals[CLICK] = g_signal_new (
+ "click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableItemClass, click),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ eti_signals[KEY_PRESS] = g_signal_new (
+ "key_press",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableItemClass, key_press),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_INT_BOXED,
+ G_TYPE_BOOLEAN, 3,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ eti_signals[STYLE_SET] = g_signal_new (
+ "style_set",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableItemClass, style_set),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__OBJECT,
+ G_TYPE_NONE, 1,
+ GTK_TYPE_STYLE);
+
+ eti_signals[SELECTION_MODEL_REMOVED] = g_signal_new (
+ "selection_model_removed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (ETableItemClass, selection_model_removed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
+
+ eti_signals[SELECTION_MODEL_ADDED] = g_signal_new (
+ "selection_model_added",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (ETableItemClass, selection_model_added),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
/* A11y Init */
gal_a11y_e_table_item_init ();
@@ -3190,9 +3300,9 @@ e_table_item_focus (ETableItem *eti,
}
if (row != -1) {
- e_selection_model_do_something (E_SELECTION_MODEL (eti->selection),
- row, col,
- state);
+ e_selection_model_do_something (
+ E_SELECTION_MODEL (eti->selection),
+ row, col, state);
}
}
@@ -3212,9 +3322,10 @@ e_table_item_get_focused_column (ETableItem *eti)
g_return_val_if_fail (eti != NULL, -1);
g_return_val_if_fail (E_IS_TABLE_ITEM (eti), -1);
- g_object_get (eti->selection,
- "cursor_col", &cursor_col,
- NULL);
+ g_object_get (
+ eti->selection,
+ "cursor_col", &cursor_col,
+ NULL);
return cursor_col;
}
@@ -3253,8 +3364,8 @@ eti_cursor_change (ESelectionModel *selection,
e_canvas_item_grab_focus (GNOME_CANVAS_ITEM (eti), FALSE);
if (eti_editing (eti))
e_table_item_leave_edit_(eti);
- g_signal_emit (eti, eti_signals[CURSOR_CHANGE], 0,
- view_row);
+
+ g_signal_emit (eti, eti_signals[CURSOR_CHANGE], 0, view_row);
e_table_item_redraw_row (eti, view_row);
@@ -3292,8 +3403,8 @@ eti_cursor_activated (ESelectionModel *selection,
e_table_item_leave_edit_(eti);
if (view_row != -1)
- g_signal_emit (eti, eti_signals[CURSOR_ACTIVATED], 0,
- view_row);
+ g_signal_emit (
+ eti, eti_signals[CURSOR_ACTIVATED], 0, view_row);
}
static void
@@ -3380,9 +3491,10 @@ e_table_item_leave_edit (ETableItem *eti)
eti->editing_row = -1;
eti->edit_ctx = NULL;
- e_cell_leave_edit (eti->cell_views[col],
- view_to_model_col (eti, col),
- col, row, edit_ctx);
+ e_cell_leave_edit (
+ eti->cell_views[col],
+ view_to_model_col (eti, col),
+ col, row, edit_ctx);
}
/**
@@ -3517,8 +3629,9 @@ eti_printed_row_height (ETableItem *eti,
gdouble height = 0;
for (col = 0; col < cols; col++) {
ECellView *ecell_view = eti->cell_views[col];
- gdouble this_height = e_cell_print_height (ecell_view, context, view_to_model_col (eti, col), col, row,
- widths[col] - 1);
+ gdouble this_height = e_cell_print_height (
+ ecell_view, context, view_to_model_col (eti, col), col, row,
+ widths[col] - 1);
if (this_height > height)
height = this_height;
}
@@ -3599,12 +3712,13 @@ e_table_item_print_page (EPrintable *ep,
cairo_rectangle (cr, 0, 0, widths[col] - 1, row_height);
cairo_clip (cr);
- e_cell_print (ecell_view, context,
- view_to_model_col (eti, col),
- col,
- row,
- widths[col] - 1,
- row_height + 2 );
+ e_cell_print (
+ ecell_view, context,
+ view_to_model_col (eti, col),
+ col,
+ row,
+ widths[col] - 1,
+ row_height + 2);
cairo_restore (cr);
diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c
index 56c1dee33b..950b58e31e 100644
--- a/widgets/table/e-table-memory-store.c
+++ b/widgets/table/e-table-memory-store.c
@@ -377,9 +377,10 @@ e_table_memory_store_insert_array (ETableMemoryStore *etms,
if (row == -1)
row = row_count - 1;
etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (gpointer));
- memmove (etms->priv->store + etms->priv->col_count * (row + 1),
- etms->priv->store + etms->priv->col_count * row,
- etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer));
+ memmove (
+ etms->priv->store + etms->priv->col_count * (row + 1),
+ etms->priv->store + etms->priv->col_count * row,
+ etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer));
for (i = 0; i < etms->priv->col_count; i++) {
STORE_LOCATOR (etms, i, row) = duplicate_value (etms, i, store[i]);
@@ -402,7 +403,7 @@ e_table_memory_store_insert (ETableMemoryStore *etms,
va_start (args, data);
for (i = 0; i < etms->priv->col_count; i++) {
- store[i] = va_arg (args, gpointer );
+ store[i] = va_arg (args, gpointer);
}
va_end (args);
@@ -424,9 +425,10 @@ e_table_memory_store_insert_adopt_array (ETableMemoryStore *etms,
if (row == -1)
row = row_count - 1;
etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (gpointer));
- memmove (etms->priv->store + etms->priv->col_count * (row + 1),
- etms->priv->store + etms->priv->col_count * row,
- etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer));
+ memmove (
+ etms->priv->store + etms->priv->col_count * (row + 1),
+ etms->priv->store + etms->priv->col_count * row,
+ etms->priv->col_count * (row_count - row - 1) * sizeof (gpointer));
for (i = 0; i < etms->priv->col_count; i++) {
STORE_LOCATOR (etms, i, row) = store[i];
@@ -449,7 +451,7 @@ e_table_memory_store_insert_adopt (ETableMemoryStore *etms,
va_start (args, data);
for (i = 0; i < etms->priv->col_count; i++) {
- store[i] = va_arg (args, gpointer );
+ store[i] = va_arg (args, gpointer);
}
va_end (args);
@@ -515,7 +517,7 @@ e_table_memory_store_change (ETableMemoryStore *etms,
va_start (args, data);
for (i = 0; i < etms->priv->col_count; i++) {
- store[i] = va_arg (args, gpointer );
+ store[i] = va_arg (args, gpointer);
}
va_end (args);
@@ -580,7 +582,7 @@ e_table_memory_store_change_adopt (ETableMemoryStore *etms,
va_start (args, data);
for (i = 0; i < etms->priv->col_count; i++) {
- store[i] = va_arg (args, gpointer );
+ store[i] = va_arg (args, gpointer);
}
va_end (args);
@@ -604,9 +606,10 @@ e_table_memory_store_remove (ETableMemoryStore *etms,
e_table_model_free_value (model, i, e_table_model_value_at (model, i, row));
row_count = e_table_model_row_count (E_TABLE_MODEL (etms)) - 1;
- memmove (etms->priv->store + etms->priv->col_count * row,
- etms->priv->store + etms->priv->col_count * (row + 1),
- etms->priv->col_count * (row_count - row) * sizeof (gpointer));
+ memmove (
+ etms->priv->store + etms->priv->col_count * row,
+ etms->priv->store + etms->priv->col_count * (row + 1),
+ etms->priv->col_count * (row_count - row) * sizeof (gpointer));
etms->priv->store = g_realloc (etms->priv->store, etms->priv->col_count * row_count * sizeof (gpointer));
e_table_memory_remove (E_TABLE_MEMORY (etms), row);
diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c
index 7c12496af9..99479f94ee 100644
--- a/widgets/table/e-table-model.c
+++ b/widgets/table/e-table-model.c
@@ -457,8 +457,7 @@ e_table_model_pre_change (ETableModel *e_table_model)
d (print_tabs ());
d (depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- signals[MODEL_PRE_CHANGE], 0);
+ g_signal_emit (e_table_model, signals[MODEL_PRE_CHANGE], 0);
d (depth--);
}
@@ -485,8 +484,7 @@ e_table_model_no_change (ETableModel *e_table_model)
d (print_tabs ());
d (depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- signals[MODEL_NO_CHANGE], 0);
+ g_signal_emit (e_table_model, signals[MODEL_NO_CHANGE], 0);
d (depth--);
}
@@ -513,8 +511,7 @@ e_table_model_changed (ETableModel *e_table_model)
d (print_tabs ());
d (depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- signals[MODEL_CHANGED], 0);
+ g_signal_emit (e_table_model, signals[MODEL_CHANGED], 0);
d (depth--);
}
@@ -539,8 +536,7 @@ e_table_model_row_changed (ETableModel *e_table_model,
d (print_tabs ());
d (depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- signals[MODEL_ROW_CHANGED], 0, row);
+ g_signal_emit (e_table_model, signals[MODEL_ROW_CHANGED], 0, row);
d (depth--);
}
@@ -567,8 +563,8 @@ e_table_model_cell_changed (ETableModel *e_table_model,
d (print_tabs ());
d (depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- signals[MODEL_CELL_CHANGED], 0, col, row);
+ g_signal_emit (
+ e_table_model, signals[MODEL_CELL_CHANGED], 0, col, row);
d (depth--);
}
@@ -595,8 +591,8 @@ e_table_model_rows_inserted (ETableModel *e_table_model,
d (print_tabs ());
d (depth++);
- g_signal_emit (G_OBJECT (e_table_model),
- signals[MODEL_ROWS_INSERTED], 0, row, count);
+ g_signal_emit (
+ e_table_model, signals[MODEL_ROWS_INSERTED], 0, row, count);
d (depth--);
}
diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c
index 99a0d7b9ab..e084bc9602 100644
--- a/widgets/table/e-table-search.c
+++ b/widgets/table/e-table-search.c
@@ -63,9 +63,10 @@ e_table_search_search (ETableSearch *e_table_search,
gboolean ret_val;
g_return_val_if_fail (E_IS_TABLE_SEARCH (e_table_search), FALSE);
- g_signal_emit (G_OBJECT (e_table_search),
- e_table_search_signals[SEARCH_SEARCH],
- 0, string, flags, &ret_val);
+ g_signal_emit (
+ e_table_search,
+ e_table_search_signals[SEARCH_SEARCH], 0,
+ string, flags, &ret_val);
return ret_val;
}
@@ -75,8 +76,9 @@ e_table_search_accept (ETableSearch *e_table_search)
{
g_return_if_fail (E_IS_TABLE_SEARCH (e_table_search));
- g_signal_emit (G_OBJECT (e_table_search),
- e_table_search_signals[SEARCH_ACCEPT], 0);
+ g_signal_emit (
+ e_table_search,
+ e_table_search_signals[SEARCH_ACCEPT], 0);
}
static gboolean
@@ -134,23 +136,25 @@ e_table_search_class_init (ETableSearchClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->finalize = e_table_search_finalize;
- e_table_search_signals[SEARCH_SEARCH] =
- g_signal_new ("search",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableSearchClass, search),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_BOOLEAN__STRING_INT,
- G_TYPE_BOOLEAN, 2, G_TYPE_STRING, G_TYPE_INT);
-
- e_table_search_signals[SEARCH_ACCEPT] =
- g_signal_new ("accept",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableSearchClass, accept),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ e_table_search_signals[SEARCH_SEARCH] = g_signal_new (
+ "search",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableSearchClass, search),
+ (GSignalAccumulator) NULL, NULL,
+ e_marshal_BOOLEAN__STRING_INT,
+ G_TYPE_BOOLEAN, 2,
+ G_TYPE_STRING,
+ G_TYPE_INT);
+
+ e_table_search_signals[SEARCH_ACCEPT] = g_signal_new (
+ "accept",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableSearchClass, accept),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
class->search = NULL;
class->accept = NULL;
diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c
index 0320663e8e..2ee44a7ffe 100644
--- a/widgets/table/e-table-selection-model.c
+++ b/widgets/table/e-table-selection-model.c
@@ -80,9 +80,10 @@ model_pre_change (ETableModel *etm,
(GDestroyNotify) NULL);
e_selection_model_foreach (E_SELECTION_MODEL (etsm), save_to_hash, etsm);
- g_object_get (etsm,
- "cursor_row", &cursor_row,
- NULL);
+ g_object_get (
+ etsm,
+ "cursor_row", &cursor_row,
+ NULL);
g_free (etsm->cursor_id);
if (cursor_row != -1)
etsm->cursor_id = e_table_model_get_save_id (etm, cursor_row);
@@ -234,18 +235,24 @@ inline static void
drop_model (ETableSelectionModel *etsm)
{
if (etsm->model) {
- g_signal_handler_disconnect (G_OBJECT (etsm->model),
- etsm->model_pre_change_id);
- g_signal_handler_disconnect (G_OBJECT (etsm->model),
- etsm->model_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etsm->model),
- etsm->model_row_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etsm->model),
- etsm->model_cell_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etsm->model),
- etsm->model_rows_inserted_id);
- g_signal_handler_disconnect (G_OBJECT (etsm->model),
- etsm->model_rows_deleted_id);
+ g_signal_handler_disconnect (
+ etsm->model,
+ etsm->model_pre_change_id);
+ g_signal_handler_disconnect (
+ etsm->model,
+ etsm->model_changed_id);
+ g_signal_handler_disconnect (
+ etsm->model,
+ etsm->model_row_changed_id);
+ g_signal_handler_disconnect (
+ etsm->model,
+ etsm->model_cell_changed_id);
+ g_signal_handler_disconnect (
+ etsm->model,
+ etsm->model_rows_inserted_id);
+ g_signal_handler_disconnect (
+ etsm->model,
+ etsm->model_rows_deleted_id);
g_object_unref (etsm->model);
}
@@ -332,19 +339,25 @@ e_table_selection_model_class_init (ETableSelectionModelClass *class)
esma_class->get_row_count = etsm_get_row_count;
- g_object_class_install_property (object_class, PROP_MODEL,
- g_param_spec_object ("model",
- "Model",
- NULL,
- E_TYPE_TABLE_MODEL,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_HEADER,
- g_param_spec_object ("header",
- "Header",
- NULL,
- E_TYPE_TABLE_HEADER,
- G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_MODEL,
+ g_param_spec_object (
+ "model",
+ "Model",
+ NULL,
+ E_TYPE_TABLE_MODEL,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HEADER,
+ g_param_spec_object (
+ "header",
+ "Header",
+ NULL,
+ E_TYPE_TABLE_HEADER,
+ G_PARAM_READWRITE));
}
/**
diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c
index 4740c0fb50..7ce56d7c75 100644
--- a/widgets/table/e-table-sort-info.c
+++ b/widgets/table/e-table-sort-info.c
@@ -79,23 +79,23 @@ e_table_sort_info_class_init (ETableSortInfoClass *class)
object_class->finalize = etsi_finalize;
- e_table_sort_info_signals[SORT_INFO_CHANGED] =
- g_signal_new ("sort_info_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableSortInfoClass, sort_info_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- e_table_sort_info_signals[GROUP_INFO_CHANGED] =
- g_signal_new ("group_info_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETableSortInfoClass, group_info_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ e_table_sort_info_signals[SORT_INFO_CHANGED] = g_signal_new (
+ "sort_info_changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableSortInfoClass, sort_info_changed),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ e_table_sort_info_signals[GROUP_INFO_CHANGED] = g_signal_new (
+ "group_info_changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETableSortInfoClass, group_info_changed),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
class->sort_info_changed = NULL;
class->group_info_changed = NULL;
@@ -110,7 +110,7 @@ e_table_sort_info_sort_info_changed (ETableSortInfo *info)
if (info->frozen) {
info->sort_info_changed = 1;
} else {
- g_signal_emit (G_OBJECT (info), e_table_sort_info_signals[SORT_INFO_CHANGED], 0);
+ g_signal_emit (info, e_table_sort_info_signals[SORT_INFO_CHANGED], 0);
}
}
@@ -123,7 +123,7 @@ e_table_sort_info_group_info_changed (ETableSortInfo *info)
if (info->frozen) {
info->group_info_changed = 1;
} else {
- g_signal_emit (G_OBJECT (info), e_table_sort_info_signals[GROUP_INFO_CHANGED], 0);
+ g_signal_emit (info, e_table_sort_info_signals[GROUP_INFO_CHANGED], 0);
}
}
@@ -405,7 +405,7 @@ e_table_sort_info_load_from_node (ETableSortInfo *info,
}
}
}
- g_signal_emit (G_OBJECT (info), e_table_sort_info_signals[SORT_INFO_CHANGED], 0);
+ g_signal_emit (info, e_table_sort_info_signals[SORT_INFO_CHANGED], 0);
}
/**
diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c
index 7792795477..73a92c35ef 100644
--- a/widgets/table/e-table-sorted-variable.c
+++ b/widgets/table/e-table-sorted-variable.c
@@ -54,8 +54,9 @@ etsv_dispose (GObject *object)
ETableSortedVariable *etsv = E_TABLE_SORTED_VARIABLE (object);
if (etsv->sort_info_changed_id)
- g_signal_handler_disconnect (G_OBJECT (etsv->sort_info),
- etsv->sort_info_changed_id);
+ g_signal_handler_disconnect (
+ etsv->sort_info,
+ etsv->sort_info_changed_id);
etsv->sort_info_changed_id = 0;
if (etsv->sort_idle_id) {
diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c
index 022e4e9582..31f0fa60b4 100644
--- a/widgets/table/e-table-sorted.c
+++ b/widgets/table/e-table-sorted.c
@@ -65,8 +65,9 @@ ets_dispose (GObject *object)
ets->insert_idle_id = 0;
if (ets->sort_info) {
- g_signal_handler_disconnect (G_OBJECT (ets->sort_info),
- ets->sort_info_changed_id);
+ g_signal_handler_disconnect (
+ ets->sort_info,
+ ets->sort_info_changed_id);
g_object_unref (ets->sort_info);
ets->sort_info = NULL;
}
diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c
index 022c27a3a1..2815d13b1b 100644
--- a/widgets/table/e-table-sorter.c
+++ b/widgets/table/e-table-sorter.c
@@ -69,26 +69,33 @@ ets_dispose (GObject *object)
if (ets->sort_info) {
if (ets->table_model_changed_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_changed_id);
+ g_signal_handler_disconnect (
+ ets->source,
+ ets->table_model_changed_id);
if (ets->table_model_row_changed_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_row_changed_id);
+ g_signal_handler_disconnect (
+ ets->source,
+ ets->table_model_row_changed_id);
if (ets->table_model_cell_changed_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_cell_changed_id);
+ g_signal_handler_disconnect (
+ ets->source,
+ ets->table_model_cell_changed_id);
if (ets->table_model_rows_inserted_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_rows_inserted_id);
+ g_signal_handler_disconnect (
+ ets->source,
+ ets->table_model_rows_inserted_id);
if (ets->table_model_rows_deleted_id)
- g_signal_handler_disconnect (ets->source,
- ets->table_model_rows_deleted_id);
+ g_signal_handler_disconnect (
+ ets->source,
+ ets->table_model_rows_deleted_id);
if (ets->sort_info_changed_id)
- g_signal_handler_disconnect (ets->sort_info,
- ets->sort_info_changed_id);
+ g_signal_handler_disconnect (
+ ets->sort_info,
+ ets->sort_info_changed_id);
if (ets->group_info_changed_id)
- g_signal_handler_disconnect (ets->sort_info,
- ets->group_info_changed_id);
+ g_signal_handler_disconnect (
+ ets->sort_info,
+ ets->group_info_changed_id);
ets->table_model_changed_id = 0;
ets->table_model_row_changed_id = 0;
@@ -177,12 +184,15 @@ ets_class_init (ETableSorterClass *class)
sorter_class->get_sorted_to_model_array = ets_get_sorted_to_model_array;
sorter_class->needs_sorting = ets_needs_sorting;
- g_object_class_install_property (object_class, PROP_SORT_INFO,
- g_param_spec_object ("sort_info",
- "Sort Info",
- NULL,
- E_TYPE_TABLE_SORT_INFO,
- G_PARAM_READWRITE));
+ g_object_class_install_property (
+ object_class,
+ PROP_SORT_INFO,
+ g_param_spec_object (
+ "sort_info",
+ "Sort Info",
+ NULL,
+ E_TYPE_TABLE_SORT_INFO,
+ G_PARAM_READWRITE));
}
static void
diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c
index e5f5b17757..9f301f6852 100644
--- a/widgets/table/e-table-specification.c
+++ b/widgets/table/e-table-specification.c
@@ -159,7 +159,7 @@ e_table_specification_load_from_string (ETableSpecification *specification,
const gchar *xml)
{
xmlDoc *doc;
- doc = xmlParseMemory ( (gchar *) xml, strlen (xml));
+ doc = xmlParseMemory ((gchar *) xml, strlen (xml));
if (doc) {
xmlNode *node = xmlDocGetRootElement (doc);
e_table_specification_load_from_node (specification, node);
diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c
index ae4e891ac9..411102eac1 100644
--- a/widgets/table/e-table-subset.c
+++ b/widgets/table/e-table-subset.c
@@ -114,20 +114,27 @@ etss_dispose (GObject *object)
ETableSubset *etss = E_TABLE_SUBSET (object);
if (etss->source) {
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_pre_change_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_no_change_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_row_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_cell_changed_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_rows_inserted_id);
- g_signal_handler_disconnect (G_OBJECT (etss->source),
- etss->table_model_rows_deleted_id);
+ g_signal_handler_disconnect (
+ etss->source,
+ etss->table_model_pre_change_id);
+ g_signal_handler_disconnect (
+ etss->source,
+ etss->table_model_no_change_id);
+ g_signal_handler_disconnect (
+ etss->source,
+ etss->table_model_changed_id);
+ g_signal_handler_disconnect (
+ etss->source,
+ etss->table_model_row_changed_id);
+ g_signal_handler_disconnect (
+ etss->source,
+ etss->table_model_cell_changed_id);
+ g_signal_handler_disconnect (
+ etss->source,
+ etss->table_model_rows_inserted_id);
+ g_signal_handler_disconnect (
+ etss->source,
+ etss->table_model_rows_deleted_id);
g_object_unref (etss->source);
etss->source = NULL;
diff --git a/widgets/table/e-table-utils.c b/widgets/table/e-table-utils.c
index 8b10837b3f..d233a4d16f 100644
--- a/widgets/table/e-table-utils.c
+++ b/widgets/table/e-table-utils.c
@@ -135,9 +135,10 @@ et_col_spec_to_col (ETableColumnSpecification *col_spec,
g_free (title);
}
if (col && col_spec->compare_col != col_spec->model_col)
- g_object_set (col,
- "compare_col", col_spec->compare_col,
- NULL);
+ g_object_set (
+ col,
+ "compare_col", col_spec->compare_col,
+ NULL);
return col;
}
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index a555353193..b73ae55ba6 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -224,10 +224,11 @@ current_search_col (ETable *et)
{
if (!et->search_col_set) {
et->current_search_col =
- e_table_util_calculate_current_search_col (et->header,
- et->full_header,
- et->sort_info,
- et->always_search);
+ e_table_util_calculate_current_search_col (
+ et->header,
+ et->full_header,
+ et->sort_info,
+ et->always_search);
et->search_col_set = TRUE;
}
@@ -471,9 +472,10 @@ et_search_search (ETableSearch *search,
rows = e_table_model_row_count (et->model);
- g_object_get (et->selection,
- "cursor_row", &cursor,
- NULL);
+ g_object_get (
+ et->selection,
+ "cursor_row", &cursor,
+ NULL);
if ((flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST) &&
cursor < rows && cursor >= 0 &&
@@ -650,17 +652,19 @@ set_header_canvas_width (ETable *e_table)
if (!(e_table->header_item && e_table->header_canvas && e_table->table_canvas))
return;
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->table_canvas),
- NULL, NULL, &width, NULL);
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->header_canvas),
- NULL, NULL, &oldwidth, &oldheight);
+ gnome_canvas_get_scroll_region (
+ GNOME_CANVAS (e_table->table_canvas),
+ NULL, NULL, &width, NULL);
+ gnome_canvas_get_scroll_region (
+ GNOME_CANVAS (e_table->header_canvas),
+ NULL, NULL, &oldwidth, &oldheight);
if (oldwidth != width ||
oldheight != E_TABLE_HEADER_ITEM (e_table->header_item)->height - 1)
gnome_canvas_set_scroll_region (
- GNOME_CANVAS (e_table->header_canvas),
- 0, 0, width, /* COLUMN_HEADER_HEIGHT - 1 */
- E_TABLE_HEADER_ITEM (e_table->header_item)->height - 1);
+ GNOME_CANVAS (e_table->header_canvas),
+ 0, 0, width, /* COLUMN_HEADER_HEIGHT - 1 */
+ E_TABLE_HEADER_ITEM (e_table->header_item)->height - 1);
}
@@ -759,13 +763,15 @@ table_canvas_reflow_idle (ETable *e_table)
height = MAX ((gint) height, allocation.height);
width = MAX ((gint) width, allocation.width);
/* I have no idea why this needs to be -1, but it works. */
- gnome_canvas_get_scroll_region (GNOME_CANVAS (e_table->table_canvas),
- NULL, NULL, &oldwidth, &oldheight);
+ gnome_canvas_get_scroll_region (
+ GNOME_CANVAS (e_table->table_canvas),
+ NULL, NULL, &oldwidth, &oldheight);
if (oldwidth != width - 1 ||
oldheight != height - 1) {
- gnome_canvas_set_scroll_region (GNOME_CANVAS (e_table->table_canvas),
- 0, 0, width - 1, height - 1);
+ gnome_canvas_set_scroll_region (
+ GNOME_CANVAS (e_table->table_canvas),
+ 0, 0, width - 1, height - 1);
set_header_canvas_width (e_table);
}
e_table->reflow_idle_id = 0;
@@ -784,14 +790,16 @@ table_canvas_size_allocate (GtkWidget *widget,
width = alloc->width;
g_value_set_double (val, width);
- g_object_get (e_table->canvas_vbox,
- "height", &height,
- NULL);
+ g_object_get (
+ e_table->canvas_vbox,
+ "height", &height,
+ NULL);
height = MAX ((gint) height, alloc->height);
- g_object_set (e_table->canvas_vbox,
- "width", width,
- NULL);
+ g_object_set (
+ e_table->canvas_vbox,
+ "width", width,
+ NULL);
g_object_set_property (G_OBJECT (e_table->header), "width", val);
g_free (val);
if (e_table->reflow_idle_id)
@@ -1065,12 +1073,13 @@ et_build_groups (ETable *et)
et->is_grouped = e_table_sort_info_grouping_get_count (et->sort_info) > 0;
- et->group = e_table_group_new (GNOME_CANVAS_GROUP (et->canvas_vbox),
- et->full_header,
- et->header,
- et->model,
- et->sort_info,
- 0);
+ et->group = e_table_group_new (
+ GNOME_CANVAS_GROUP (et->canvas_vbox),
+ et->full_header,
+ et->header,
+ et->model,
+ et->sort_info,
+ 0);
if (et->use_click_to_add_end)
e_canvas_vbox_add_item_start (
@@ -1549,18 +1558,21 @@ e_table_set_state_object (ETable *e_table,
e_table->sort_info = NULL;
if (e_table->sorter)
- g_object_set (e_table->sorter,
- "sort_info", e_table->sort_info,
- NULL);
+ g_object_set (
+ e_table->sorter,
+ "sort_info", e_table->sort_info,
+ NULL);
if (e_table->header_item)
- g_object_set (e_table->header_item,
- "ETableHeader", e_table->header,
- "sort_info", e_table->sort_info,
- NULL);
+ g_object_set (
+ e_table->header_item,
+ "ETableHeader", e_table->header,
+ "sort_info", e_table->sort_info,
+ NULL);
if (e_table->click_to_add)
- g_object_set (e_table->click_to_add,
- "header", e_table->header,
- NULL);
+ g_object_set (
+ e_table->click_to_add,
+ "header", e_table->header,
+ NULL);
e_table->need_rebuild = TRUE;
if (!e_table->rebuild_idle_id)
@@ -1746,7 +1758,8 @@ et_real_construct (ETable *e_table,
e_table->use_click_to_add = specification->click_to_add;
e_table->use_click_to_add_end = specification->click_to_add_end;
e_table->click_to_add_message = specification->click_to_add_message ?
- g_strdup (dgettext (e_table->domain,
+ g_strdup (
+ dgettext (e_table->domain,
specification->click_to_add_message)) : NULL;
e_table->alternating_row_colors = specification->alternating_row_colors;
e_table->horizontal_draw_grid = specification->horizontal_draw_grid;
@@ -1826,17 +1839,19 @@ et_real_construct (ETable *e_table,
if (!specification->no_headers) {
/* The header */
- gtk_table_attach (GTK_TABLE (e_table), GTK_WIDGET (e_table->header_canvas),
- 0, 1, 0 + row, 1 + row,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL, 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (e_table), GTK_WIDGET (e_table->header_canvas),
+ 0, 1, 0 + row, 1 + row,
+ GTK_FILL | GTK_EXPAND,
+ GTK_FILL, 0, 0);
row++;
}
- gtk_table_attach (GTK_TABLE (e_table), GTK_WIDGET (e_table->table_canvas),
- 0, 1, 0 + row, 1 + row,
- GTK_FILL | GTK_EXPAND,
- GTK_FILL | GTK_EXPAND,
- 0, 0);
+ gtk_table_attach (
+ GTK_TABLE (e_table), GTK_WIDGET (e_table->table_canvas),
+ 0, 1, 0 + row, 1 + row,
+ GTK_FILL | GTK_EXPAND,
+ GTK_FILL | GTK_EXPAND,
+ 0, 0);
g_object_unref (ete);
@@ -2057,9 +2072,10 @@ e_table_set_cursor_row (ETable *e_table,
g_return_if_fail (E_IS_TABLE (e_table));
g_return_if_fail (row >= 0);
- g_object_set (e_table->selection,
- "cursor_row", row,
- NULL);
+ g_object_set (
+ e_table->selection,
+ "cursor_row", row,
+ NULL);
}
/**
@@ -2077,9 +2093,10 @@ e_table_get_cursor_row (ETable *e_table)
gint row;
g_return_val_if_fail (E_IS_TABLE (e_table), -1);
- g_object_get (e_table->selection,
- "cursor_row", &row,
- NULL);
+ g_object_get (
+ e_table->selection,
+ "cursor_row", &row,
+ NULL);
return row;
}
@@ -2686,10 +2703,11 @@ e_table_drag_get_data (ETable *table,
{
g_return_if_fail (E_IS_TABLE (table));
- gtk_drag_get_data (GTK_WIDGET (table),
- context,
- target,
- time);
+ gtk_drag_get_data (
+ GTK_WIDGET (table),
+ context,
+ target,
+ time);
}
/**
@@ -2740,12 +2758,13 @@ e_table_drag_highlight (ETable *table,
"outline_color_gdk", &style->fg[GTK_STATE_NORMAL],
NULL);
}
- gnome_canvas_item_set (table->drop_highlight,
- "x1", (gdouble) x,
- "x2", (gdouble) x + width - 1,
- "y1", (gdouble) y,
- "y2", (gdouble) y + height - 1,
- NULL);
+ gnome_canvas_item_set (
+ table->drop_highlight,
+ "x1", (gdouble) x,
+ "x2", (gdouble) x + width - 1,
+ "y1", (gdouble) y,
+ "y2", (gdouble) y + height - 1,
+ NULL);
} else {
if (table->drop_highlight) {
g_object_run_dispose (G_OBJECT (table->drop_highlight));
@@ -2825,19 +2844,21 @@ et_real_start_drag (ETable *table,
site = table->site;
site->state = 0;
- context = e_table_drag_begin (table, row, col,
- site->target_list,
- site->actions,
- 1, event);
+ context = e_table_drag_begin (
+ table, row, col,
+ site->target_list,
+ site->actions,
+ 1, event);
if (context) {
info = g_dataset_get_data (context, "gtk-info");
if (info && !info->icon_window) {
if (site->pixbuf)
- gtk_drag_set_icon_pixbuf (context,
- site->pixbuf,
- -2, -2);
+ gtk_drag_set_icon_pixbuf (
+ context,
+ site->pixbuf,
+ -2, -2);
else
gtk_drag_set_icon_default (context);
}
@@ -2872,10 +2893,11 @@ e_table_drag_source_set (ETable *table,
canvas = GTK_WIDGET (table->table_canvas);
site = table->site;
- gtk_widget_add_events (canvas,
- gtk_widget_get_events (canvas) |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK);
+ gtk_widget_add_events (
+ canvas,
+ gtk_widget_get_events (canvas) |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK);
table->do_drag = TRUE;
diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c
index ec7092433a..f779405d0e 100644
--- a/widgets/table/e-tree-memory.c
+++ b/widgets/table/e-tree-memory.c
@@ -89,7 +89,7 @@ check_children (ETreeMemory *memory,
{
ETreeMemoryPath *path = node;
if (!path->children_computed) {
- g_signal_emit (G_OBJECT (memory), signals[FILL_IN_CHILDREN], 0, node);
+ g_signal_emit (memory, signals[FILL_IN_CHILDREN], 0, node);
path->children_computed = TRUE;
}
}
@@ -101,7 +101,7 @@ e_tree_memory_path_depth (ETreeMemoryPath *path)
g_return_val_if_fail (path != NULL, -1);
- for ( path = path->parent; path; path = path->parent)
+ for (path = path->parent; path; path = path->parent)
depth++;
return depth;
}
@@ -392,14 +392,15 @@ e_tree_memory_class_init (ETreeMemoryClass *class)
class->fill_in_children = NULL;
- signals[FILL_IN_CHILDREN] =
- g_signal_new ("fill_in_children",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeMemoryClass, fill_in_children),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
+ signals[FILL_IN_CHILDREN] = g_signal_new (
+ "fill_in_children",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeMemoryClass, fill_in_children),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
}
static void
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c
index 9280f3c302..944572dfb4 100644
--- a/widgets/table/e-tree-model.c
+++ b/widgets/table/e-tree-model.c
@@ -66,95 +66,106 @@ e_tree_model_class_init (ETreeModelClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
- signals[PRE_CHANGE] =
- g_signal_new ("pre_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, pre_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- signals[NO_CHANGE] =
- g_signal_new ("no_change",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, no_change),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- signals[REBUILT] =
- g_signal_new ("rebuilt",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, rebuilt),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- signals[NODE_CHANGED] =
- g_signal_new ("node_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- signals[NODE_DATA_CHANGED] =
- g_signal_new ("node_data_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_data_changed),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- signals[NODE_COL_CHANGED] =
- g_signal_new ("node_col_changed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_col_changed),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__POINTER_INT,
- G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT);
-
- signals[NODE_INSERTED] =
- g_signal_new ("node_inserted",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_inserted),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__POINTER_POINTER,
- G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
-
- signals[NODE_REMOVED] =
- g_signal_new ("node_removed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_removed),
- (GSignalAccumulator) NULL, NULL,
- e_marshal_VOID__POINTER_POINTER_INT,
- G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_INT);
-
- signals[NODE_DELETED] =
- g_signal_new ("node_deleted",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_deleted),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
- signals[NODE_REQUEST_COLLAPSE] =
- g_signal_new ("node_request_collapse",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeModelClass, node_request_collapse),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
+ signals[PRE_CHANGE] = g_signal_new (
+ "pre_change",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, pre_change),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[NO_CHANGE] = g_signal_new (
+ "no_change",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, no_change),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[REBUILT] = g_signal_new (
+ "rebuilt",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, rebuilt),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals[NODE_CHANGED] = g_signal_new (
+ "node_changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, node_changed),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
+
+ signals[NODE_DATA_CHANGED] = g_signal_new (
+ "node_data_changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, node_data_changed),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
+
+ signals[NODE_COL_CHANGED] = g_signal_new (
+ "node_col_changed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, node_col_changed),
+ (GSignalAccumulator) NULL, NULL,
+ e_marshal_VOID__POINTER_INT,
+ G_TYPE_NONE, 2,
+ G_TYPE_POINTER,
+ G_TYPE_INT);
+
+ signals[NODE_INSERTED] = g_signal_new (
+ "node_inserted",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, node_inserted),
+ (GSignalAccumulator) NULL, NULL,
+ e_marshal_VOID__POINTER_POINTER,
+ G_TYPE_NONE, 2,
+ G_TYPE_POINTER,
+ G_TYPE_POINTER);
+
+ signals[NODE_REMOVED] = g_signal_new (
+ "node_removed",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, node_removed),
+ (GSignalAccumulator) NULL, NULL,
+ e_marshal_VOID__POINTER_POINTER_INT,
+ G_TYPE_NONE, 3,
+ G_TYPE_POINTER,
+ G_TYPE_POINTER,
+ G_TYPE_INT);
+
+ signals[NODE_DELETED] = g_signal_new (
+ "node_deleted",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, node_deleted),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
+
+ signals[NODE_REQUEST_COLLAPSE] = g_signal_new (
+ "node_request_collapse",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeModelClass, node_request_collapse),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
class->get_root = NULL;
diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c
index e88deb469b..0b8f1c4447 100644
--- a/widgets/table/e-tree-sorted.c
+++ b/widgets/table/e-tree-sorted.c
@@ -512,11 +512,12 @@ resort_node (ETreeSorted *ets,
if (needs_regen)
regenerate_children (ets, path);
d (g_print ("Regened sort of node %p\n", path));
- e_table_sorting_utils_tree_sort (E_TREE_MODEL (ets),
- ets->priv->sort_info,
- ets->priv->full_header,
- (ETreePath *) path->children,
- path->num_children);
+ e_table_sorting_utils_tree_sort (
+ E_TREE_MODEL (ets),
+ ets->priv->sort_info,
+ ets->priv->full_header,
+ (ETreePath *) path->children,
+ path->num_children);
d (g_print ("Renumbering sort of node %p\n", path));
for (i = 0; i < path->num_children; i++) {
path->children[i]->position = i;
@@ -1258,14 +1259,15 @@ e_tree_sorted_class_init (ETreeSortedClass *class)
tree_model_class->value_is_empty = ets_value_is_empty;
tree_model_class->value_to_string = ets_value_to_string;
- signals[NODE_RESORTED] =
- g_signal_new ("node_resorted",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeSortedClass, node_resorted),
- (GSignalAccumulator) NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
+ signals[NODE_RESORTED] = g_signal_new (
+ "node_resorted",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeSortedClass, node_resorted),
+ (GSignalAccumulator) NULL, NULL,
+ g_cclosure_marshal_VOID__POINTER,
+ G_TYPE_NONE, 1,
+ G_TYPE_POINTER);
}
static void
@@ -1393,7 +1395,7 @@ e_tree_sorted_node_resorted (ETreeSorted *sorted,
g_return_if_fail (sorted != NULL);
g_return_if_fail (E_IS_TREE_SORTED (sorted));
- g_signal_emit (G_OBJECT (sorted), signals[NODE_RESORTED], 0, node);
+ g_signal_emit (sorted, signals[NODE_RESORTED], 0, node);
}
void
@@ -1405,8 +1407,9 @@ e_tree_sorted_set_sort_info (ETreeSorted *ets,
if (ets->priv->sort_info) {
if (ets->priv->sort_info_changed_id != 0)
- g_signal_handler_disconnect (G_OBJECT (ets->priv->sort_info),
- ets->priv->sort_info_changed_id);
+ g_signal_handler_disconnect (
+ ets->priv->sort_info,
+ ets->priv->sort_info_changed_id);
ets->priv->sort_info_changed_id = 0;
g_object_unref (ets->priv->sort_info);
}
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index 4a668d1ba3..c610039c83 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -779,14 +779,15 @@ etta_class_init (ETreeTableAdapterClass *class)
class->sorting_changed = NULL;
- signals[SORTING_CHANGED] =
- g_signal_new ("sorting_changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeTableAdapterClass, sorting_changed),
- NULL, NULL,
- e_marshal_BOOLEAN__NONE,
- G_TYPE_BOOLEAN, 0, G_TYPE_NONE);
+ signals[SORTING_CHANGED] = g_signal_new (
+ "sorting_changed",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeTableAdapterClass, sorting_changed),
+ NULL, NULL,
+ e_marshal_BOOLEAN__NONE,
+ G_TYPE_BOOLEAN, 0,
+ G_TYPE_NONE);
}
static void
@@ -1360,8 +1361,9 @@ e_tree_table_adapter_set_sort_info (ETreeTableAdapter *etta,
ETableSortInfo *sort_info)
{
if (etta->priv->sort_info) {
- g_signal_handler_disconnect (G_OBJECT (etta->priv->sort_info),
- etta->priv->sort_info_changed_id);
+ g_signal_handler_disconnect (
+ etta->priv->sort_info,
+ etta->priv->sort_info_changed_id);
g_object_unref (etta->priv->sort_info);
}
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index a25ef8cac4..3f3351d840 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -266,17 +266,21 @@ static void
et_disconnect_from_etta (ETree *et)
{
if (et->priv->table_model_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->priv->etta),
- et->priv->table_model_change_id);
+ g_signal_handler_disconnect (
+ et->priv->etta,
+ et->priv->table_model_change_id);
if (et->priv->table_row_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->priv->etta),
- et->priv->table_row_change_id);
+ g_signal_handler_disconnect (
+ et->priv->etta,
+ et->priv->table_row_change_id);
if (et->priv->table_cell_change_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->priv->etta),
- et->priv->table_cell_change_id);
+ g_signal_handler_disconnect (
+ et->priv->etta,
+ et->priv->table_cell_change_id);
if (et->priv->table_rows_delete_id != 0)
- g_signal_handler_disconnect (G_OBJECT (et->priv->etta),
- et->priv->table_rows_delete_id);
+ g_signal_handler_disconnect (
+ et->priv->etta,
+ et->priv->table_rows_delete_id);
et->priv->table_model_change_id = 0;
et->priv->table_row_change_id = 0;
@@ -295,10 +299,11 @@ current_search_col (ETree *et)
{
if (!et->priv->search_col_set) {
et->priv->current_search_col =
- e_table_util_calculate_current_search_col (et->priv->header,
- et->priv->full_header,
- et->priv->sort_info,
- et->priv->always_search);
+ e_table_util_calculate_current_search_col (
+ et->priv->header,
+ et->priv->full_header,
+ et->priv->sort_info,
+ et->priv->always_search);
et->priv->search_col_set = TRUE;
}
@@ -311,7 +316,7 @@ e_tree_state_change (ETree *et)
if (et->priv->state_change_freeze)
et->priv->state_changed = TRUE;
else
- g_signal_emit (G_OBJECT (et), et_signals[STATE_CHANGE], 0);
+ g_signal_emit (et, et_signals[STATE_CHANGE], 0);
}
static void
@@ -336,18 +341,22 @@ disconnect_header (ETree *e_tree)
return;
if (e_tree->priv->structure_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_tree->priv->header),
- e_tree->priv->structure_change_id);
+ g_signal_handler_disconnect (
+ e_tree->priv->header,
+ e_tree->priv->structure_change_id);
if (e_tree->priv->expansion_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_tree->priv->header),
- e_tree->priv->expansion_change_id);
+ g_signal_handler_disconnect (
+ e_tree->priv->header,
+ e_tree->priv->expansion_change_id);
if (e_tree->priv->sort_info) {
if (e_tree->priv->sort_info_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_tree->priv->sort_info),
- e_tree->priv->sort_info_change_id);
+ g_signal_handler_disconnect (
+ e_tree->priv->sort_info,
+ e_tree->priv->sort_info_change_id);
if (e_tree->priv->group_info_change_id)
- g_signal_handler_disconnect (G_OBJECT (e_tree->priv->sort_info),
- e_tree->priv->group_info_change_id);
+ g_signal_handler_disconnect (
+ e_tree->priv->sort_info,
+ e_tree->priv->group_info_change_id);
g_object_unref (e_tree->priv->sort_info);
}
@@ -847,14 +856,16 @@ tree_canvas_size_allocate (GtkWidget *widget,
width = alloc->width;
g_value_set_double (val, width);
- g_object_get (e_tree->priv->item,
- "height", &height,
- NULL);
+ g_object_get (
+ e_tree->priv->item,
+ "height", &height,
+ NULL);
height = MAX ((gint) height, alloc->height);
- g_object_set (e_tree->priv->item,
- "width", width,
- NULL);
+ g_object_set (
+ e_tree->priv->item,
+ "width", width,
+ NULL);
g_object_set_property (G_OBJECT (e_tree->priv->header), "width", val);
g_free (val);
@@ -1051,9 +1062,10 @@ item_key_press (ETableItem *eti,
e_table_search_input_character (et->priv->search, key->keyval);
}
path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
- g_signal_emit (et,
- et_signals[KEY_PRESS], 0,
- row, path, col, event, &return_val);
+ g_signal_emit (
+ et,
+ et_signals[KEY_PRESS], 0,
+ row, path, col, event, &return_val);
break;
}
return return_val;
@@ -1155,9 +1167,10 @@ white_item_event (GnomeCanvasItem *white_item,
ETree *e_tree)
{
gboolean return_val = 0;
- g_signal_emit (e_tree,
- et_signals[WHITE_SPACE_EVENT], 0,
- event, &return_val);
+ g_signal_emit (
+ e_tree,
+ et_signals[WHITE_SPACE_EVENT], 0,
+ event, &return_val);
return return_val;
}
@@ -1327,15 +1340,17 @@ e_tree_set_state_object (ETree *e_tree,
g_free (val);
if (e_tree->priv->header_item)
- g_object_set (e_tree->priv->header_item,
- "ETableHeader", e_tree->priv->header,
- "sort_info", e_tree->priv->sort_info,
- NULL);
+ g_object_set (
+ e_tree->priv->header_item,
+ "ETableHeader", e_tree->priv->header,
+ "sort_info", e_tree->priv->sort_info,
+ NULL);
if (e_tree->priv->item)
- g_object_set (e_tree->priv->item,
- "ETableHeader", e_tree->priv->header,
- NULL);
+ g_object_set (
+ e_tree->priv->item,
+ "ETableHeader", e_tree->priv->header,
+ NULL);
if (e_tree->priv->etta)
e_tree_table_adapter_set_sort_info (
@@ -1607,17 +1622,18 @@ et_real_construct (ETree *e_tree,
e_tree->priv->sorter = e_sorter_new ();
- g_object_set (e_tree->priv->selection,
- "sorter", e_tree->priv->sorter,
+ g_object_set (
+ e_tree->priv->selection,
+ "sorter", e_tree->priv->sorter,
#ifdef E_TREE_USE_TREE_SELECTION
- "model", e_tree->priv->model,
- "etta", e_tree->priv->etta,
+ "model", e_tree->priv->model,
+ "etta", e_tree->priv->etta,
#else
- "model", e_tree->priv->etta,
+ "model", e_tree->priv->etta,
#endif
- "selection_mode", specification->selection_mode,
- "cursor_mode", specification->cursor_mode,
- NULL);
+ "selection_mode", specification->selection_mode,
+ "cursor_mode", specification->cursor_mode,
+ NULL);
g_signal_connect (
e_tree->priv->selection, "selection_changed",
@@ -1913,9 +1929,10 @@ e_tree_set_cursor (ETree *e_tree,
if (row == -1)
return;
- g_object_set (e_tree->priv->selection,
- "cursor_row", row,
- NULL);
+ g_object_set (
+ e_tree->priv->selection,
+ "cursor_row", row,
+ NULL);
#endif
}
@@ -1930,9 +1947,10 @@ e_tree_get_cursor (ETree *e_tree)
g_return_val_if_fail (e_tree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE (e_tree), NULL);
- g_object_get (e_tree->priv->selection,
- "cursor_row", &row,
- NULL);
+ g_object_get (
+ e_tree->priv->selection,
+ "cursor_row", &row,
+ NULL);
if (row == -1)
return NULL;
@@ -2622,10 +2640,11 @@ e_tree_drag_get_data (ETree *tree,
g_return_if_fail (tree != NULL);
g_return_if_fail (E_IS_TREE (tree));
- gtk_drag_get_data (GTK_WIDGET (tree),
- context,
- target,
- time);
+ gtk_drag_get_data (
+ GTK_WIDGET (tree),
+ context,
+ target,
+ time);
}
@@ -2712,11 +2731,12 @@ void e_tree_drag_dest_set (ETree *tree,
g_return_if_fail (tree != NULL);
g_return_if_fail (E_IS_TREE (tree));
- gtk_drag_dest_set (GTK_WIDGET (tree),
- flags,
- targets,
- n_targets,
- actions);
+ gtk_drag_dest_set (
+ GTK_WIDGET (tree),
+ flags,
+ targets,
+ n_targets,
+ actions);
}
void e_tree_drag_dest_set_proxy (ETree *tree,
@@ -2727,10 +2747,11 @@ void e_tree_drag_dest_set_proxy (ETree *tree,
g_return_if_fail (tree != NULL);
g_return_if_fail (E_IS_TREE (tree));
- gtk_drag_dest_set_proxy (GTK_WIDGET (tree),
- proxy_window,
- protocol,
- use_coordinates);
+ gtk_drag_dest_set_proxy (
+ GTK_WIDGET (tree),
+ proxy_window,
+ protocol,
+ use_coordinates);
}
/*
@@ -2764,19 +2785,21 @@ et_real_start_drag (ETree *tree,
site = tree->priv->site;
site->state = 0;
- context = e_tree_drag_begin (tree, row, col,
- site->target_list,
- site->actions,
- 1, event);
+ context = e_tree_drag_begin (
+ tree, row, col,
+ site->target_list,
+ site->actions,
+ 1, event);
if (context) {
info = g_dataset_get_data (context, "gtk-info");
if (info && !info->icon_window) {
if (site->pixbuf)
- gtk_drag_set_icon_pixbuf (context,
- site->pixbuf,
- -2, -2);
+ gtk_drag_set_icon_pixbuf (
+ context,
+ site->pixbuf,
+ -2, -2);
else
gtk_drag_set_icon_default (context);
}
@@ -2804,10 +2827,11 @@ e_tree_drag_source_set (ETree *tree,
tree->priv->do_drag = TRUE;
- gtk_widget_add_events (canvas,
- gtk_widget_get_events (canvas) |
- GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK);
+ gtk_widget_add_events (
+ canvas,
+ gtk_widget_get_events (canvas) |
+ GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
+ GDK_BUTTON_MOTION_MASK | GDK_STRUCTURE_MASK);
if (site) {
if (site->target_list)
@@ -2868,11 +2892,12 @@ e_tree_drag_begin (ETree *tree,
tree->priv->drag_path = path;
tree->priv->drag_col = col;
- return gtk_drag_begin (GTK_WIDGET (tree->priv->table_canvas),
- targets,
- actions,
- button,
- event);
+ return gtk_drag_begin (
+ GTK_WIDGET (tree->priv->table_canvas),
+ targets,
+ actions,
+ button,
+ event);
}
/**
@@ -2994,12 +3019,13 @@ et_drag_begin (GtkWidget *widget,
{
et->priv->is_dragging = TRUE;
- g_signal_emit (et,
- et_signals[TREE_DRAG_BEGIN], 0,
- et->priv->drag_row,
- et->priv->drag_path,
- et->priv->drag_col,
- context);
+ g_signal_emit (
+ et,
+ et_signals[TREE_DRAG_BEGIN], 0,
+ et->priv->drag_row,
+ et->priv->drag_path,
+ et->priv->drag_col,
+ context);
}
static void
@@ -3009,12 +3035,13 @@ et_drag_end (GtkWidget *widget,
{
et->priv->is_dragging = FALSE;
- g_signal_emit (et,
- et_signals[TREE_DRAG_END], 0,
- et->priv->drag_row,
- et->priv->drag_path,
- et->priv->drag_col,
- context);
+ g_signal_emit (
+ et,
+ et_signals[TREE_DRAG_END], 0,
+ et->priv->drag_row,
+ et->priv->drag_path,
+ et->priv->drag_col,
+ context);
}
static void
@@ -3025,15 +3052,16 @@ et_drag_data_get (GtkWidget *widget,
guint time,
ETree *et)
{
- g_signal_emit (et,
- et_signals[TREE_DRAG_DATA_GET], 0,
- et->priv->drag_row,
- et->priv->drag_path,
- et->priv->drag_col,
- context,
- selection_data,
- info,
- time);
+ g_signal_emit (
+ et,
+ et_signals[TREE_DRAG_DATA_GET], 0,
+ et->priv->drag_row,
+ et->priv->drag_path,
+ et->priv->drag_col,
+ context,
+ selection_data,
+ info,
+ time);
}
static void
@@ -3041,12 +3069,13 @@ et_drag_data_delete (GtkWidget *widget,
GdkDragContext *context,
ETree *et)
{
- g_signal_emit (et,
- et_signals[TREE_DRAG_DATA_DELETE], 0,
- et->priv->drag_row,
- et->priv->drag_path,
- et->priv->drag_col,
- context);
+ g_signal_emit (
+ et,
+ et_signals[TREE_DRAG_DATA_DELETE], 0,
+ et->priv->drag_row,
+ et->priv->drag_path,
+ et->priv->drag_col,
+ context);
}
static gboolean
@@ -3060,19 +3089,16 @@ do_drag_motion (ETree *et,
gint row, col;
ETreePath path;
- e_tree_get_cell_at (et,
- x,
- y,
- &row,
- &col);
+ e_tree_get_cell_at (et, x, y, &row, &col);
+
if (row != et->priv->drop_row && col != et->priv->drop_col) {
- g_signal_emit (et,
- et_signals[TREE_DRAG_LEAVE], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- time);
+ g_signal_emit (
+ et, et_signals[TREE_DRAG_LEAVE], 0,
+ et->priv->drop_row,
+ et->priv->drop_path,
+ et->priv->drop_col,
+ context,
+ time);
}
path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
@@ -3080,16 +3106,15 @@ do_drag_motion (ETree *et,
et->priv->drop_row = row;
et->priv->drop_path = path;
et->priv->drop_col = col;
- g_signal_emit (et,
- et_signals[TREE_DRAG_MOTION], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- x,
- y,
- time,
- &ret_val);
+ g_signal_emit (
+ et, et_signals[TREE_DRAG_MOTION], 0,
+ et->priv->drop_row,
+ et->priv->drop_path,
+ et->priv->drop_col,
+ context,
+ x, y,
+ time,
+ &ret_val);
return ret_val;
}
@@ -3185,11 +3210,7 @@ hover_timeout (gpointer data)
gint row, col;
ETreePath path;
- e_tree_get_cell_at (et,
- x,
- y,
- &row,
- &col);
+ e_tree_get_cell_at (et, x, y, &row, &col);
path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
if (path && e_tree_model_node_is_expandable (et->priv->model, path)) {
@@ -3310,13 +3331,14 @@ et_drag_leave (GtkWidget *widget,
guint time,
ETree *et)
{
- g_signal_emit (et,
- et_signals[TREE_DRAG_LEAVE], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- time);
+ g_signal_emit (
+ et,
+ et_signals[TREE_DRAG_LEAVE], 0,
+ et->priv->drop_row,
+ et->priv->drop_path,
+ et->priv->drop_col,
+ context,
+ time);
et->priv->drop_row = -1;
et->priv->drop_col = -1;
@@ -3383,46 +3405,44 @@ et_drag_drop (GtkWidget *widget,
gboolean ret_val = FALSE;
gint row, col;
ETreePath path;
- e_tree_get_cell_at (et,
- x,
- y,
- &row,
- &col);
+
+ e_tree_get_cell_at (et, x, y, &row, &col);
+
path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
if (row != et->priv->drop_row && col != et->priv->drop_row) {
- g_signal_emit (et,
- et_signals[TREE_DRAG_LEAVE], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- time);
- g_signal_emit (et,
- et_signals[TREE_DRAG_MOTION], 0,
- row,
- path,
- col,
- context,
- x,
- y,
- time,
- &ret_val);
+ g_signal_emit (
+ et, et_signals[TREE_DRAG_LEAVE], 0,
+ et->priv->drop_row,
+ et->priv->drop_path,
+ et->priv->drop_col,
+ context,
+ time);
+ g_signal_emit (
+ et, et_signals[TREE_DRAG_MOTION], 0,
+ row,
+ path,
+ col,
+ context,
+ x,
+ y,
+ time,
+ &ret_val);
}
et->priv->drop_row = row;
et->priv->drop_path = path;
et->priv->drop_col = col;
- g_signal_emit (et,
- et_signals[TREE_DRAG_DROP], 0,
- et->priv->drop_row,
- et->priv->drop_path,
- et->priv->drop_col,
- context,
- x,
- y,
- time,
- &ret_val);
+ g_signal_emit (
+ et, et_signals[TREE_DRAG_DROP], 0,
+ et->priv->drop_row,
+ et->priv->drop_path,
+ et->priv->drop_col,
+ context,
+ x,
+ y,
+ time,
+ &ret_val);
et->priv->drop_row = -1;
et->priv->drop_path = NULL;
@@ -3446,23 +3466,21 @@ et_drag_data_received (GtkWidget *widget,
{
gint row, col;
ETreePath path;
- e_tree_get_cell_at (et,
- x,
- y,
- &row,
- &col);
+
+ e_tree_get_cell_at (et, x, y, &row, &col);
+
path = e_tree_table_adapter_node_at_row (et->priv->etta, row);
- g_signal_emit (et,
- et_signals[TREE_DRAG_DATA_RECEIVED], 0,
- row,
- path,
- col,
- context,
- x,
- y,
- selection_data,
- info,
- time);
+ g_signal_emit (
+ et, et_signals[TREE_DRAG_DATA_RECEIVED], 0,
+ row,
+ path,
+ col,
+ context,
+ x,
+ y,
+ selection_data,
+ info,
+ time);
}
static void
@@ -3486,284 +3504,318 @@ e_tree_class_init (ETreeClass *class)
class->start_drag = et_real_start_drag;
- et_signals[CURSOR_CHANGE] =
- g_signal_new ("cursor_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, cursor_change),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER);
-
- et_signals[CURSOR_ACTIVATED] =
- g_signal_new ("cursor_activated",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, cursor_activated),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER,
- G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_POINTER);
-
- et_signals[SELECTION_CHANGE] =
- g_signal_new ("selection_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, selection_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- et_signals[DOUBLE_CLICK] =
- g_signal_new ("double_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, double_click),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_BOXED,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[RIGHT_CLICK] =
- g_signal_new ("right_click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, right_click),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_POINTER_INT_BOXED,
- G_TYPE_BOOLEAN, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[CLICK] =
- g_signal_new ("click",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, click),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_POINTER_INT_BOXED,
- G_TYPE_BOOLEAN, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[KEY_PRESS] =
- g_signal_new ("key_press",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, key_press),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__INT_POINTER_INT_BOXED,
- G_TYPE_BOOLEAN, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[START_DRAG] =
- g_signal_new ("start_drag",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, start_drag),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_BOXED,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[STATE_CHANGE] =
- g_signal_new ("state_change",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, state_change),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- et_signals[WHITE_SPACE_EVENT] =
- g_signal_new ("white_space_event",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, white_space_event),
- g_signal_accumulator_true_handled, NULL,
- e_marshal_BOOLEAN__POINTER,
- G_TYPE_BOOLEAN, 1,
- GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
-
- et_signals[TREE_DRAG_BEGIN] =
- g_signal_new ("tree_drag_begin",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_begin),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_BOXED,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
- et_signals[TREE_DRAG_END] =
- g_signal_new ("tree_drag_end",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_end),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_BOXED,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
- et_signals[TREE_DRAG_DATA_GET] =
- g_signal_new ("tree_drag_data_get",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_data_get),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_OBJECT_BOXED_UINT_UINT,
- G_TYPE_NONE, 7,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
- G_TYPE_UINT,
- G_TYPE_UINT);
- et_signals[TREE_DRAG_DATA_DELETE] =
- g_signal_new ("tree_drag_data_delete",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_data_delete),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_OBJECT,
- G_TYPE_NONE, 4,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT);
-
- et_signals[TREE_DRAG_LEAVE] =
- g_signal_new ("tree_drag_leave",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_leave),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_OBJECT_UINT,
- G_TYPE_NONE, 5,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_UINT);
- et_signals[TREE_DRAG_MOTION] =
- g_signal_new ("tree_drag_motion",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_motion),
- NULL, NULL,
- e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT,
- G_TYPE_BOOLEAN, 7,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_UINT);
- et_signals[TREE_DRAG_DROP] =
- g_signal_new ("tree_drag_drop",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_drop),
- NULL, NULL,
- e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT,
- G_TYPE_BOOLEAN, 7,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- G_TYPE_UINT);
- et_signals[TREE_DRAG_DATA_RECEIVED] =
- g_signal_new ("tree_drag_data_received",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (ETreeClass, tree_drag_data_received),
- NULL, NULL,
- e_marshal_NONE__INT_POINTER_INT_OBJECT_INT_INT_BOXED_UINT_UINT,
- G_TYPE_NONE, 9,
- G_TYPE_INT,
- G_TYPE_POINTER,
- G_TYPE_INT,
- GDK_TYPE_DRAG_CONTEXT,
- G_TYPE_INT,
- G_TYPE_INT,
- GTK_TYPE_SELECTION_DATA,
- G_TYPE_UINT,
- G_TYPE_UINT);
-
- g_object_class_install_property (object_class, PROP_LENGTH_THRESHOLD,
- g_param_spec_int ("length_threshold",
- "Length Threshold",
- "Length Threshold",
- 0, G_MAXINT, 0,
- G_PARAM_WRITABLE));
- g_object_class_install_property (object_class, PROP_HORIZONTAL_DRAW_GRID,
- g_param_spec_boolean ("horizontal_draw_grid",
- "Horizontal Draw Grid",
- "Horizontal Draw Grid",
- FALSE,
- G_PARAM_WRITABLE));
- g_object_class_install_property (object_class, PROP_VERTICAL_DRAW_GRID,
- g_param_spec_boolean ("vertical_draw_grid",
- "Vertical Draw Grid",
- "Vertical Draw Grid",
- FALSE,
- G_PARAM_WRITABLE));
- g_object_class_install_property (object_class, PROP_DRAW_FOCUS,
- g_param_spec_boolean ("drawfocus",
- "Draw focus",
- "Draw focus",
- FALSE,
- G_PARAM_WRITABLE));
-
- g_object_class_install_property (object_class, PROP_ETTA,
- g_param_spec_object ("ETreeTableAdapter",
- "ETree table adapter",
- "ETree table adapter",
- E_TYPE_TREE_TABLE_ADAPTER,
- G_PARAM_READABLE));
-
- g_object_class_install_property (object_class, PROP_UNIFORM_ROW_HEIGHT,
- g_param_spec_boolean ("uniform_row_height",
- "Uniform row height",
- "Uniform row height",
- FALSE,
- G_PARAM_READWRITE));
-
- g_object_class_install_property (object_class, PROP_ALWAYS_SEARCH,
- g_param_spec_boolean ("always_search",
- "Always search",
- "Always search",
- FALSE,
- G_PARAM_READWRITE));
-
- gtk_widget_class_install_style_property (widget_class,
- g_param_spec_int ("expander_size",
- "Expander Size",
- "Size of the expander arrow",
- 0,
- G_MAXINT,
- 10,
- G_PARAM_READABLE));
+ et_signals[CURSOR_CHANGE] = g_signal_new (
+ "cursor_change",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, cursor_change),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER,
+ G_TYPE_NONE, 2,
+ G_TYPE_INT,
+ G_TYPE_POINTER);
+
+ et_signals[CURSOR_ACTIVATED] = g_signal_new (
+ "cursor_activated",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, cursor_activated),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER,
+ G_TYPE_NONE, 2,
+ G_TYPE_INT,
+ G_TYPE_POINTER);
+
+ et_signals[SELECTION_CHANGE] = g_signal_new (
+ "selection_change",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, selection_change),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ et_signals[DOUBLE_CLICK] = g_signal_new (
+ "double_click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, double_click),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER_INT_BOXED,
+ G_TYPE_NONE, 4,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[RIGHT_CLICK] = g_signal_new (
+ "right_click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, right_click),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_POINTER_INT_BOXED,
+ G_TYPE_BOOLEAN, 4,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[CLICK] = g_signal_new (
+ "click",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, click),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_POINTER_INT_BOXED,
+ G_TYPE_BOOLEAN, 4,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[KEY_PRESS] = g_signal_new (
+ "key_press",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, key_press),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__INT_POINTER_INT_BOXED,
+ G_TYPE_BOOLEAN, 4,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[START_DRAG] = g_signal_new (
+ "start_drag",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, start_drag),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER_INT_BOXED,
+ G_TYPE_NONE, 4,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[STATE_CHANGE] = g_signal_new (
+ "state_change",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, state_change),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ et_signals[WHITE_SPACE_EVENT] = g_signal_new (
+ "white_space_event",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, white_space_event),
+ g_signal_accumulator_true_handled, NULL,
+ e_marshal_BOOLEAN__POINTER,
+ G_TYPE_BOOLEAN, 1,
+ GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ et_signals[TREE_DRAG_BEGIN] = g_signal_new (
+ "tree_drag_begin",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, tree_drag_begin),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER_INT_BOXED,
+ G_TYPE_NONE, 4,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT);
+
+ et_signals[TREE_DRAG_END] = g_signal_new (
+ "tree_drag_end",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, tree_drag_end),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER_INT_BOXED,
+ G_TYPE_NONE, 4,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT);
+
+ et_signals[TREE_DRAG_DATA_GET] = g_signal_new (
+ "tree_drag_data_get",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, tree_drag_data_get),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER_INT_OBJECT_BOXED_UINT_UINT,
+ G_TYPE_NONE, 7,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ GTK_TYPE_SELECTION_DATA | G_SIGNAL_TYPE_STATIC_SCOPE,
+ G_TYPE_UINT,
+ G_TYPE_UINT);
+
+ et_signals[TREE_DRAG_DATA_DELETE] = g_signal_new (
+ "tree_drag_data_delete",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, tree_drag_data_delete),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER_INT_OBJECT,
+ G_TYPE_NONE, 4,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT);
+
+ et_signals[TREE_DRAG_LEAVE] = g_signal_new (
+ "tree_drag_leave",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, tree_drag_leave),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER_INT_OBJECT_UINT,
+ G_TYPE_NONE, 5,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ G_TYPE_UINT);
+
+ et_signals[TREE_DRAG_MOTION] = g_signal_new (
+ "tree_drag_motion",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, tree_drag_motion),
+ NULL, NULL,
+ e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT,
+ G_TYPE_BOOLEAN, 7,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_UINT);
+
+ et_signals[TREE_DRAG_DROP] = g_signal_new (
+ "tree_drag_drop",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, tree_drag_drop),
+ NULL, NULL,
+ e_marshal_BOOLEAN__INT_POINTER_INT_OBJECT_INT_INT_UINT,
+ G_TYPE_BOOLEAN, 7,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ G_TYPE_UINT);
+
+ et_signals[TREE_DRAG_DATA_RECEIVED] = g_signal_new (
+ "tree_drag_data_received",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ETreeClass, tree_drag_data_received),
+ NULL, NULL,
+ e_marshal_NONE__INT_POINTER_INT_OBJECT_INT_INT_BOXED_UINT_UINT,
+ G_TYPE_NONE, 9,
+ G_TYPE_INT,
+ G_TYPE_POINTER,
+ G_TYPE_INT,
+ GDK_TYPE_DRAG_CONTEXT,
+ G_TYPE_INT,
+ G_TYPE_INT,
+ GTK_TYPE_SELECTION_DATA,
+ G_TYPE_UINT,
+ G_TYPE_UINT);
+
+ g_object_class_install_property (
+ object_class,
+ PROP_LENGTH_THRESHOLD,
+ g_param_spec_int (
+ "length_threshold",
+ "Length Threshold",
+ "Length Threshold",
+ 0, G_MAXINT, 0,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_HORIZONTAL_DRAW_GRID,
+ g_param_spec_boolean (
+ "horizontal_draw_grid",
+ "Horizontal Draw Grid",
+ "Horizontal Draw Grid",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_VERTICAL_DRAW_GRID,
+ g_param_spec_boolean (
+ "vertical_draw_grid",
+ "Vertical Draw Grid",
+ "Vertical Draw Grid",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_DRAW_FOCUS,
+ g_param_spec_boolean (
+ "drawfocus",
+ "Draw focus",
+ "Draw focus",
+ FALSE,
+ G_PARAM_WRITABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_ETTA,
+ g_param_spec_object (
+ "ETreeTableAdapter",
+ "ETree table adapter",
+ "ETree table adapter",
+ E_TYPE_TREE_TABLE_ADAPTER,
+ G_PARAM_READABLE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_UNIFORM_ROW_HEIGHT,
+ g_param_spec_boolean (
+ "uniform_row_height",
+ "Uniform row height",
+ "Uniform row height",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_object_class_install_property (
+ object_class,
+ PROP_ALWAYS_SEARCH,
+ g_param_spec_boolean (
+ "always_search",
+ "Always search",
+ "Always search",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ gtk_widget_class_install_style_property (
+ widget_class,
+ g_param_spec_int (
+ "expander_size",
+ "Expander Size",
+ "Size of the expander arrow",
+ 0, G_MAXINT, 10,
+ G_PARAM_READABLE));
gtk_widget_class_install_style_property (
widget_class,
diff --git a/widgets/table/gal-a11y-e-cell-popup.c b/widgets/table/gal-a11y-e-cell-popup.c
index b1232a6b84..1c97ee3198 100644
--- a/widgets/table/gal-a11y-e-cell-popup.c
+++ b/widgets/table/gal-a11y-e-cell-popup.c
@@ -100,31 +100,34 @@ gal_a11y_e_cell_popup_new (ETableItem *item,
child_view = popupcell->popup_cell_view->child_view;
if (child_view && child_view->ecell) {
- a11y = gal_a11y_e_cell_registry_get_object (NULL,
- item,
- child_view,
- parent,
- model_col,
- view_col,
- row);
+ a11y = gal_a11y_e_cell_registry_get_object (
+ NULL,
+ item,
+ child_view,
+ parent,
+ model_col,
+ view_col,
+ row);
} else {
a11y = g_object_new (GAL_A11Y_TYPE_E_CELL_POPUP, NULL);
- gal_a11y_e_cell_construct (a11y,
- item,
- cell_view,
- parent,
- model_col,
- view_col,
- row);
+ gal_a11y_e_cell_construct (
+ a11y,
+ item,
+ cell_view,
+ parent,
+ model_col,
+ view_col,
+ row);
}
g_return_val_if_fail (a11y != NULL, NULL);
cell = GAL_A11Y_E_CELL (a11y);
- gal_a11y_e_cell_add_action (cell,
- "popup",
- /* Translators: description of a "popup" action */
- _("popup a child"),
- "<Alt>Down", /* action keybinding */
- popup_cell_action);
+ gal_a11y_e_cell_add_action (
+ cell,
+ "popup",
+ /* Translators: description of a "popup" action */
+ _("popup a child"),
+ "<Alt>Down", /* action keybinding */
+ popup_cell_action);
a11y->role = ATK_ROLE_TABLE_CELL;
return a11y;
diff --git a/widgets/table/gal-a11y-e-cell-toggle.c b/widgets/table/gal-a11y-e-cell-toggle.c
index 046f3f52d1..33d9e4fd32 100644
--- a/widgets/table/gal-a11y-e-cell-toggle.c
+++ b/widgets/table/gal-a11y-e-cell-toggle.c
@@ -164,28 +164,31 @@ gal_a11y_e_cell_toggle_new (ETableItem *item,
toggle_cell = GAL_A11Y_E_CELL_TOGGLE (a11y);
a11y->role = ATK_ROLE_TABLE_CELL;
- gal_a11y_e_cell_construct (a11y,
- item,
- cell_view,
- parent,
- model_col,
- view_col,
- row);
-
- gal_a11y_e_cell_add_action (cell,
- "toggle",
- /* Translators: description of a "toggle" action */
- _("toggle the cell"),
- NULL, /* action keybinding */
- toggle_cell_action);
+ gal_a11y_e_cell_construct (
+ a11y,
+ item,
+ cell_view,
+ parent,
+ model_col,
+ view_col,
+ row);
+
+ gal_a11y_e_cell_add_action (
+ cell,
+ "toggle",
+ /* Translators: description of a "toggle" action */
+ _("toggle the cell"),
+ NULL, /* action keybinding */
+ toggle_cell_action);
toggle_cell->model_id = g_signal_connect (
item->table_model, "model_cell_changed",
(GCallback) model_change_cb, a11y);
value = GPOINTER_TO_INT (
- e_table_model_value_at (cell->cell_view->e_table_model,
- cell->model_col, cell->row));
+ e_table_model_value_at (
+ cell->cell_view->e_table_model,
+ cell->model_col, cell->row));
if (value)
gal_a11y_e_cell_add_state (cell, ATK_STATE_CHECKED, FALSE);
else
diff --git a/widgets/table/gal-a11y-e-cell-tree.c b/widgets/table/gal-a11y-e-cell-tree.c
index 32085fbfba..599b660ca5 100644
--- a/widgets/table/gal-a11y-e-cell-tree.c
+++ b/widgets/table/gal-a11y-e-cell-tree.c
@@ -94,8 +94,9 @@ ectr_subcell_weak_ref (GalA11yECellTree *a11y,
if (subcell_a11y && subcell_view && subcell_view->kill_view_cb_data)
subcell_view->kill_view_cb_data = g_list_remove (subcell_view->kill_view_cb_data, subcell_a11y);
- g_signal_handler_disconnect (GAL_A11Y_E_CELL (a11y)->item->table_model,
- a11y->model_row_changed_id);
+ g_signal_handler_disconnect (
+ GAL_A11Y_E_CELL (a11y)->item->table_model,
+ a11y->model_row_changed_id);
g_object_unref (a11y);
}
@@ -115,9 +116,8 @@ ectr_do_action_expand (AtkAction *action)
tree_table_adapter = e_table_model_value_at (table_model, -3, a11y->row);
if (e_tree_model_node_is_expandable (tree_model, node)) {
- e_tree_table_adapter_node_set_expanded (tree_table_adapter,
- node,
- TRUE);
+ e_tree_table_adapter_node_set_expanded (
+ tree_table_adapter, node, TRUE);
gal_a11y_e_cell_add_state (a11y, ATK_STATE_EXPANDED, TRUE);
}
}
@@ -138,9 +138,8 @@ ectr_do_action_collapse (AtkAction *action)
tree_table_adapter = e_table_model_value_at (table_model, -3, a11y->row);
if (e_tree_model_node_is_expandable (tree_model, node)) {
- e_tree_table_adapter_node_set_expanded (tree_table_adapter,
- node,
- FALSE);
+ e_tree_table_adapter_node_set_expanded (
+ tree_table_adapter, node, FALSE);
gal_a11y_e_cell_remove_state (a11y, ATK_STATE_EXPANDED, TRUE);
}
}
@@ -201,26 +200,29 @@ gal_a11y_e_cell_tree_new (ETableItem *item,
subcell_view = e_cell_tree_view_get_subcell_view (cell_view);
if (subcell_view->ecell) {
- subcell_a11y = gal_a11y_e_cell_registry_get_object (NULL,
- item,
- subcell_view,
- parent,
- model_col,
- view_col,
- row);
- gal_a11y_e_cell_add_action (GAL_A11Y_E_CELL (subcell_a11y),
- "expand",
- /* Translators: description of an "expand" action */
- _("expands the row in the ETree containing this cell"),
- NULL,
- (ACTION_FUNC) ectr_do_action_expand);
-
- gal_a11y_e_cell_add_action (GAL_A11Y_E_CELL (subcell_a11y),
- "collapse",
- /* Translators: description of a "collapse" action */
- _("collapses the row in the ETree containing this cell"),
- NULL,
- (ACTION_FUNC) ectr_do_action_collapse);
+ subcell_a11y = gal_a11y_e_cell_registry_get_object (
+ NULL,
+ item,
+ subcell_view,
+ parent,
+ model_col,
+ view_col,
+ row);
+ gal_a11y_e_cell_add_action (
+ GAL_A11Y_E_CELL (subcell_a11y),
+ "expand",
+ /* Translators: description of an "expand" action */
+ _("expands the row in the ETree containing this cell"),
+ NULL,
+ (ACTION_FUNC) ectr_do_action_expand);
+
+ gal_a11y_e_cell_add_action (
+ GAL_A11Y_E_CELL (subcell_a11y),
+ "collapse",
+ /* Translators: description of a "collapse" action */
+ _("collapses the row in the ETree containing this cell"),
+ NULL,
+ (ACTION_FUNC) ectr_do_action_collapse);
/* init AtkStates for the cell's a11y object */
node = e_table_model_value_at (item->table_model, -1, row);
@@ -239,13 +241,14 @@ gal_a11y_e_cell_tree_new (ETableItem *item,
* and it connects to some signals to determine whether a tree cell is
* expanded or collapsed */
a11y = g_object_new (gal_a11y_e_cell_tree_get_type (), NULL);
- gal_a11y_e_cell_construct (ATK_OBJECT (a11y),
- item,
- cell_view,
- parent,
- model_col,
- view_col,
- row);
+ gal_a11y_e_cell_construct (
+ ATK_OBJECT (a11y),
+ item,
+ cell_view,
+ parent,
+ model_col,
+ view_col,
+ row);
a11y->model_row_changed_id = g_signal_connect (
item->table_model, "model_row_changed",
G_CALLBACK (ectr_model_row_changed_cb), subcell_a11y);
diff --git a/widgets/table/gal-a11y-e-cell-vbox.c b/widgets/table/gal-a11y-e-cell-vbox.c
index d0b9d26036..d00547c877 100644
--- a/widgets/table/gal-a11y-e-cell-vbox.c
+++ b/widgets/table/gal-a11y-e-cell-vbox.c
@@ -80,7 +80,8 @@ ecv_ref_child (AtkObject *a11y,
subcell_view = ecvv->subcell_views[i];
/* FIXME Should the view column use a fake
* one or the same as its parent? */
- ret = gal_a11y_e_cell_registry_get_object (NULL,
+ ret = gal_a11y_e_cell_registry_get_object (
+ NULL,
gaec->item,
subcell_view,
a11y,
@@ -89,9 +90,10 @@ ecv_ref_child (AtkObject *a11y,
row);
gaev->a11y_subcells[i] = ret;
g_object_ref (ret);
- g_object_weak_ref (G_OBJECT (ret),
- (GWeakNotify) subcell_destroyed,
- ret);
+ g_object_weak_ref (
+ G_OBJECT (ret),
+ (GWeakNotify) subcell_destroyed,
+ ret);
} else {
ret = (AtkObject *) gaev->a11y_subcells[i];
if (ATK_IS_OBJECT (ret))
@@ -140,7 +142,7 @@ ecv_ref_accessible_at_point (AtkComponent *component,
subcell_height = e_cell_height (
ecvv->subcell_views[i], ecvv->model_cols[i],
gaec->view_col, gaec->row);
- if ( 0 <= y && y <= subcell_height) {
+ if (0 <= y && y <= subcell_height) {
return ecv_ref_child ((AtkObject *) component, i);
} else
y -= subcell_height;
diff --git a/widgets/table/gal-a11y-e-cell.c b/widgets/table/gal-a11y-e-cell.c
index 4a75c97ce4..d42aa6425f 100644
--- a/widgets/table/gal-a11y-e-cell.c
+++ b/widgets/table/gal-a11y-e-cell.c
@@ -87,9 +87,9 @@ gal_a11y_e_cell_dispose (GObject *object)
#if 0
if (a11y->item)
- g_object_unref (G_OBJECT (a11y->item)); /*, unref_item, a11y); */
+ g_object_unref (a11y->item); /*, unref_item, a11y); */
if (a11y->cell_view)
- g_object_unref (G_OBJECT (a11y->cell_view)); /*, unref_cell, a11y); */
+ g_object_unref (a11y->cell_view); /*, unref_cell, a11y); */
if (a11y->parent)
g_object_unref (a11y->parent);
#endif
@@ -174,17 +174,20 @@ gal_a11y_e_cell_get_extents (AtkComponent *component,
tableOrTree = gtk_widget_get_parent (GTK_WIDGET (a11y->item->parent.canvas));
if (E_IS_TREE (tableOrTree)) {
- e_tree_get_cell_geometry (E_TREE (tableOrTree),
- row, col, &xval, &yval,
- width, height);
+ e_tree_get_cell_geometry (
+ E_TREE (tableOrTree),
+ row, col, &xval, &yval,
+ width, height);
} else {
- e_table_get_cell_geometry (E_TABLE (tableOrTree),
- row, col, &xval, &yval,
- width, height);
+ e_table_get_cell_geometry (
+ E_TABLE (tableOrTree),
+ row, col, &xval, &yval,
+ width, height);
}
- atk_component_get_position (ATK_COMPONENT (a11y->parent),
- x, y, coord_type);
+ atk_component_get_position (
+ ATK_COMPONENT (a11y->parent),
+ x, y, coord_type);
if (x && *x != G_MININT)
*x += xval;
if (y && *y != G_MININT)
@@ -490,8 +493,9 @@ gal_a11y_e_cell_type_add_action_interface (GType type)
NULL
};
- g_type_add_interface_static (type, ATK_TYPE_ACTION,
- &atk_action_info);
+ g_type_add_interface_static (
+ type, ATK_TYPE_ACTION,
+ &atk_action_info);
}
gboolean
@@ -604,13 +608,14 @@ gal_a11y_e_cell_new (ETableItem *item,
a11y = g_object_new (gal_a11y_e_cell_get_type (), NULL);
- gal_a11y_e_cell_construct (a11y,
- item,
- cell_view,
- parent,
- model_col,
- view_col,
- row);
+ gal_a11y_e_cell_construct (
+ a11y,
+ item,
+ cell_view,
+ parent,
+ model_col,
+ view_col,
+ row);
return a11y;
}
@@ -633,14 +638,14 @@ gal_a11y_e_cell_construct (AtkObject *object,
ATK_OBJECT (a11y) ->role = ATK_ROLE_TABLE_CELL;
if (item)
- g_object_ref (G_OBJECT (item));
+ g_object_ref (item);
#if 0
if (parent)
g_object_ref (parent);
if (cell_view)
- g_object_ref (G_OBJECT (cell_view));
+ g_object_ref (cell_view);
#endif
}
diff --git a/widgets/table/gal-a11y-e-table-click-to-add.c b/widgets/table/gal-a11y-e-table-click-to-add.c
index 1f116ee6b3..52466cd7cb 100644
--- a/widgets/table/gal-a11y-e-table-click-to-add.c
+++ b/widgets/table/gal-a11y-e-table-click-to-add.c
@@ -82,7 +82,7 @@ idle_do_action (gpointer data)
ETableClickToAdd * etcta;
gint finished;
- g_return_val_if_fail ( data!= NULL, FALSE);
+ g_return_val_if_fail (data!= NULL, FALSE);
etcta = E_TABLE_CLICK_TO_ADD (
atk_gobject_accessible_get_object (
@@ -242,9 +242,9 @@ gal_a11y_e_table_click_to_add_get_type (void)
GNOME_TYPE_CANVAS_ITEM);
parent_type = atk_object_factory_get_accessible_type (factory);
- type = gal_a11y_type_register_static_with_private (PARENT_TYPE,
- "GalA11yETableClickToAdd", &info, 0,
- sizeof (GalA11yETableClickToAddPrivate), &priv_offset);
+ type = gal_a11y_type_register_static_with_private (
+ PARENT_TYPE, "GalA11yETableClickToAdd", &info, 0,
+ sizeof (GalA11yETableClickToAddPrivate), &priv_offset);
g_type_add_interface_static (type, ATK_TYPE_ACTION, &atk_action_info);
diff --git a/widgets/table/gal-a11y-e-table-item.c b/widgets/table/gal-a11y-e-table-item.c
index 1806011875..d5a0edefdc 100644
--- a/widgets/table/gal-a11y-e-table-item.c
+++ b/widgets/table/gal-a11y-e-table-item.c
@@ -304,9 +304,11 @@ eti_get_extents (AtkComponent *component,
parent = ATK_OBJECT (component)->accessible_parent;
if (parent && ATK_IS_COMPONENT (parent))
- atk_component_get_extents (ATK_COMPONENT (parent), x, y,
- width, height,
- coord_type);
+ atk_component_get_extents (
+ ATK_COMPONENT (parent),
+ x, y,
+ width, height,
+ coord_type);
if (parent && GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD (parent)) {
ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (
@@ -335,10 +337,11 @@ eti_ref_accessible_at_point (AtkComponent *component,
if (!item)
return NULL;
- atk_component_get_position (component,
- &x_origin,
- &y_origin,
- coord_type);
+ atk_component_get_position (
+ component,
+ &x_origin,
+ &y_origin,
+ coord_type);
x -= x_origin;
y -= y_origin;
@@ -397,17 +400,19 @@ eti_ref_at (AtkTable *table,
item->cell_views_realized) {
ECellView *cell_view = item->cell_views[column];
ETableCol *ecol = e_table_header_get_column (item->header, column);
- ret = gal_a11y_e_cell_registry_get_object (NULL,
- item,
- cell_view,
- ATK_OBJECT (table),
- ecol->col_idx,
- column,
- row);
+ ret = gal_a11y_e_cell_registry_get_object (
+ NULL,
+ item,
+ cell_view,
+ ATK_OBJECT (table),
+ ecol->col_idx,
+ column,
+ row);
if (ATK_IS_OBJECT (ret)) {
- g_object_weak_ref (G_OBJECT (ret),
- (GWeakNotify) cell_destroyed,
- ret);
+ g_object_weak_ref (
+ G_OBJECT (ret),
+ (GWeakNotify) cell_destroyed,
+ ret);
/* if current cell is focused, add FOCUSED state */
if (e_selection_model_cursor_row (item->selection) ==
GAL_A11Y_E_CELL (ret)->row &&
@@ -501,13 +506,14 @@ eti_get_column_extent_at (AtkTable *table,
if (!item)
return -1;
- e_table_item_get_cell_geometry (item,
- &row,
- &column,
- NULL,
- NULL,
- &width,
- NULL);
+ e_table_item_get_cell_geometry (
+ item,
+ &row,
+ &column,
+ NULL,
+ NULL,
+ &width,
+ NULL);
return width;
}
@@ -524,13 +530,14 @@ eti_get_row_extent_at (AtkTable *table,
if (!item)
return -1;
- e_table_item_get_cell_geometry (item,
- &row,
- &column,
- NULL,
- NULL,
- NULL,
- &height);
+ e_table_item_get_cell_geometry (
+ item,
+ &row,
+ &column,
+ NULL,
+ NULL,
+ NULL,
+ &height);
return height;
}
@@ -672,8 +679,9 @@ table_add_row_selection (AtkTable *table,
if (table_is_row_selected (table, row))
return TRUE;
- e_selection_model_toggle_single_row (item->selection,
- view_to_model_row (item, row));
+ e_selection_model_toggle_single_row (
+ item->selection,
+ view_to_model_row (item, row));
return TRUE;
}
@@ -758,14 +766,16 @@ eti_rows_inserted (ETableModel *model,
GET_PRIVATE (table_item)->rows = n_rows;
- g_signal_emit_by_name (table_item, "row-inserted", row,
- count, NULL);
+ g_signal_emit_by_name (
+ table_item, "row-inserted", row,
+ count, NULL);
for (i = row; i < (row + count); i++) {
for (j = 0; j < n_cols; j++) {
- g_signal_emit_by_name (table_item,
- "children_changed::add",
- ( ((i + 1) * n_cols) + j), NULL, NULL);
+ g_signal_emit_by_name (
+ table_item,
+ "children_changed::add",
+ (((i + 1) * n_cols) + j), NULL, NULL);
}
}
@@ -788,18 +798,20 @@ eti_rows_deleted (ETableModel *model,
old_nrows = GET_PRIVATE (table_item)->rows;
- g_return_if_fail ( row + count <= old_nrows);
+ g_return_if_fail (row + count <= old_nrows);
g_return_if_fail (old_nrows == n_rows + count);
GET_PRIVATE (table_item)->rows = n_rows;
- g_signal_emit_by_name (table_item, "row-deleted", row,
- count, NULL);
+ g_signal_emit_by_name (
+ table_item, "row-deleted", row,
+ count, NULL);
for (i = row; i < (row + count); i++) {
for (j = 0; j < n_cols; j++) {
- g_signal_emit_by_name (table_item,
- "children_changed::remove",
- ( ((i + 1) * n_cols) + j), NULL, NULL);
+ g_signal_emit_by_name (
+ table_item,
+ "children_changed::remove",
+ (((i + 1) * n_cols) + j), NULL, NULL);
}
}
g_signal_emit_by_name (table_item, "visible-data-changed");
@@ -909,17 +921,16 @@ eti_header_structure_changed (ETableHeader *eth,
/* Emit signals */
if (reorder_found)
- g_signal_emit_by_name (G_OBJECT (a11y_item), "column_reordered");
+ g_signal_emit_by_name (a11y_item, "column_reordered");
if (removed_found) {
- for (i = 0; i < prev_n_cols; i ++ ) {
+ for (i = 0; i < prev_n_cols; i++) {
if (prev_state[i] == ETI_HEADER_REMOVED) {
g_signal_emit_by_name (
- G_OBJECT (a11y_item),
- "column-deleted", i, 1);
+ a11y_item, "column-deleted", i, 1);
for (j = 0; j < n_rows; j++)
g_signal_emit_by_name (
- G_OBJECT (a11y_item),
+ a11y_item,
"children_changed::remove",
((j + 1) * prev_n_cols + i),
NULL, NULL);
@@ -931,11 +942,10 @@ eti_header_structure_changed (ETableHeader *eth,
for (i = 0; i < n_cols; i++) {
if (state[i] == ETI_HEADER_NEW_ADDED) {
g_signal_emit_by_name (
- G_OBJECT (a11y_item),
- "column-inserted", i, 1);
+ a11y_item, "column-inserted", i, 1);
for (j = 0; j < n_rows; j++)
g_signal_emit_by_name (
- G_OBJECT (a11y_item),
+ a11y_item,
"children_changed::add",
((j + 1) * n_cols + i),
NULL, NULL);
@@ -1127,7 +1137,7 @@ gal_a11y_e_table_item_new (ETableItem *item)
GET_PRIVATE (a11y)->rows = item->rows;
GET_PRIVATE (a11y)->columns = e_table_header_get_columns (item->header);
- if ( GET_PRIVATE (a11y)->columns == NULL)
+ if (GET_PRIVATE (a11y)->columns == NULL)
return NULL;
if (item) {
@@ -1138,8 +1148,9 @@ gal_a11y_e_table_item_new (ETableItem *item)
item, "selection_model_added",
G_CALLBACK (eti_a11y_selection_model_added_cb), NULL);
if (item->selection)
- gal_a11y_e_table_item_ref_selection (a11y,
- item->selection);
+ gal_a11y_e_table_item_ref_selection (
+ a11y,
+ item->selection);
/* find the TableItem's parent: table or tree */
GET_PRIVATE (a11y)->widget = gtk_widget_get_parent (
@@ -1184,11 +1195,11 @@ gal_a11y_e_table_item_ref_selection (GalA11yETableItem *a11y,
priv = GET_PRIVATE (a11y);
priv->selection_change_id = g_signal_connect (
- G_OBJECT (selection), "selection_changed",
- G_CALLBACK (eti_a11y_selection_changed_cb), a11y);
+ selection, "selection_changed",
+ G_CALLBACK (eti_a11y_selection_changed_cb), a11y);
priv->cursor_change_id = g_signal_connect (
- G_OBJECT (selection), "cursor_changed",
- G_CALLBACK (eti_a11y_cursor_changed_cb), a11y);
+ selection, "cursor_changed",
+ G_CALLBACK (eti_a11y_cursor_changed_cb), a11y);
priv->selection = selection;
g_object_ref (selection);
@@ -1208,10 +1219,12 @@ gal_a11y_e_table_item_unref_selection (GalA11yETableItem *a11y)
g_return_val_if_fail (priv->selection_change_id != 0, FALSE);
g_return_val_if_fail (priv->cursor_change_id != 0, FALSE);
- g_signal_handler_disconnect (priv->selection,
- priv->selection_change_id);
- g_signal_handler_disconnect (priv->selection,
- priv->cursor_change_id);
+ g_signal_handler_disconnect (
+ priv->selection,
+ priv->selection_change_id);
+ g_signal_handler_disconnect (
+ priv->selection,
+ priv->cursor_change_id);
priv->cursor_change_id = 0;
priv->selection_change_id = 0;
@@ -1345,15 +1358,18 @@ selection_add_selection (AtkSelection *selection,
atk_table_add_row_selection (table, row);
}
- e_selection_model_change_cursor (item->selection,
- model_row,
- model_col);
- e_selection_model_cursor_changed (item->selection,
- model_row,
- model_col);
- e_selection_model_cursor_activated (item->selection,
- model_row,
- model_col);
+ e_selection_model_change_cursor (
+ item->selection,
+ model_row,
+ model_col);
+ e_selection_model_cursor_changed (
+ item->selection,
+ model_row,
+ model_col);
+ e_selection_model_cursor_activated (
+ item->selection,
+ model_row,
+ model_col);
return TRUE;
}
@@ -1413,8 +1429,9 @@ void
gal_a11y_e_table_item_init (void)
{
if (atk_get_root ())
- atk_registry_set_factory_type (atk_get_default_registry (),
- E_TYPE_TABLE_ITEM,
- gal_a11y_e_table_item_factory_get_type ());
+ atk_registry_set_factory_type (
+ atk_get_default_registry (),
+ E_TYPE_TABLE_ITEM,
+ gal_a11y_e_table_item_factory_get_type ());
}
diff --git a/widgets/table/gal-a11y-e-table.c b/widgets/table/gal-a11y-e-table.c
index 6ba51303ed..ec0025c6b8 100644
--- a/widgets/table/gal-a11y-e-table.c
+++ b/widgets/table/gal-a11y-e-table.c
@@ -268,8 +268,9 @@ gal_a11y_e_table_get_type (void)
factory = atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET);
parent_type = atk_object_factory_get_accessible_type (factory);
- type = gal_a11y_type_register_static_with_private (PARENT_TYPE, "GalA11yETable", &info, 0,
- sizeof (GalA11yETablePrivate), &priv_offset);
+ type = gal_a11y_type_register_static_with_private (
+ PARENT_TYPE, "GalA11yETable", &info, 0,
+ sizeof (GalA11yETablePrivate), &priv_offset);
g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info);
}
@@ -305,7 +306,8 @@ void
gal_a11y_e_table_init (void)
{
if (atk_get_root ())
- atk_registry_set_factory_type (atk_get_default_registry (),
+ atk_registry_set_factory_type (
+ atk_get_default_registry (),
E_TYPE_TABLE,
gal_a11y_e_table_factory_get_type ());
diff --git a/widgets/table/gal-a11y-e-tree.c b/widgets/table/gal-a11y-e-tree.c
index 12697f4535..26d2f24e7b 100644
--- a/widgets/table/gal-a11y-e-tree.c
+++ b/widgets/table/gal-a11y-e-tree.c
@@ -163,8 +163,9 @@ gal_a11y_e_tree_get_type (void)
factory = atk_registry_get_factory (atk_get_default_registry (), GTK_TYPE_WIDGET);
parent_type = atk_object_factory_get_accessible_type (factory);
- type = gal_a11y_type_register_static_with_private (PARENT_TYPE, "GalA11yETree", &info, 0,
- sizeof (GalA11yETreePrivate), &priv_offset);
+ type = gal_a11y_type_register_static_with_private (
+ PARENT_TYPE, "GalA11yETree", &info, 0,
+ sizeof (GalA11yETreePrivate), &priv_offset);
g_type_add_interface_static (type, ATK_TYPE_COMPONENT, &atk_component_info);
}
@@ -187,9 +188,9 @@ void
gal_a11y_e_tree_init (void)
{
if (atk_get_root ())
- atk_registry_set_factory_type (atk_get_default_registry (),
- E_TYPE_TREE,
- gal_a11y_e_tree_factory_get_type ());
-
+ atk_registry_set_factory_type (
+ atk_get_default_registry (),
+ E_TYPE_TREE,
+ gal_a11y_e_tree_factory_get_type ());
}