diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-11-15 06:04:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-11-15 06:04:21 +0800 |
commit | 9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91 (patch) | |
tree | 2e1e96f33404781354c422a7e9beaf458ebeb655 /widgets/table | |
parent | 7e8f8bb9e5167b0219b48ab3e8062080d3740b0a (diff) | |
download | gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.gz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.zst gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.zip |
** Remove trailing whitespace from source code.
2007-11-14 Matthew Barnes <mbarnes@redhat.com>
** Remove trailing whitespace from source code.
svn path=/trunk/; revision=34537
Diffstat (limited to 'widgets/table')
125 files changed, 1445 insertions, 1445 deletions
diff --git a/widgets/table/e-cell-checkbox.c b/widgets/table/e-cell-checkbox.c index a8b251bbbb..b00b101afa 100644 --- a/widgets/table/e-cell-checkbox.c +++ b/widgets/table/e-cell-checkbox.c @@ -39,15 +39,15 @@ G_DEFINE_TYPE (ECellCheckbox, e_cell_checkbox, E_CELL_TOGGLE_TYPE) static GdkPixbuf *checks [2]; static void -ecc_print (ECellView *ecell_view, GtkPrintContext *context, +ecc_print (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, - double width, double height) + double width, double height) { cairo_t *cr = gtk_print_context_get_cairo_context (context); const int value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); - cairo_save (cr); - + cairo_save (cr); + if ( value == 1) { cairo_set_line_width (cr, 2); @@ -55,8 +55,8 @@ ecc_print (ECellView *ecell_view, GtkPrintContext *context, cairo_line_to (cr, 7, 14); cairo_line_to (cr, 11, 5); cairo_stroke (cr); - } - cairo_restore (cr); + } + cairo_restore (cr); } static void @@ -80,7 +80,7 @@ e_cell_checkbox_init (ECellCheckbox *eccb) * Creates a new ECell renderer that can be used to render check * boxes. the data provided from the model is cast to an integer. * zero is used for the off display, and non-zero for checked status. - * + * * Returns: an ECell object that can be used to render checkboxes. */ ECell * @@ -89,6 +89,6 @@ e_cell_checkbox_new (void) ECellCheckbox *eccb = g_object_new (E_CELL_CHECKBOX_TYPE, NULL); e_cell_toggle_construct (E_CELL_TOGGLE (eccb), 2, 2, checks); - + return (ECell *) eccb; } diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 764a2c2031..6a8992d119 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -140,7 +140,7 @@ e_cell_combo_init (ECellCombo *ecc) gtk_window_set_policy (GTK_WINDOW (ecc->popup_window), TRUE, TRUE, FALSE); - + frame = gtk_frame_new (NULL); gtk_container_add (GTK_CONTAINER (ecc->popup_window), frame); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT); @@ -226,7 +226,7 @@ e_cell_combo_dispose (GObject *object) void -e_cell_combo_set_popdown_strings (ECellCombo *ecc, +e_cell_combo_set_popdown_strings (ECellCombo *ecc, GList *strings) { GList *elem; @@ -278,7 +278,7 @@ e_cell_combo_do_popup (ECellPopup *ecp, error_code = gdk_pointer_grab (ecc->popup_list->window, TRUE, GDK_ENTER_NOTIFY_MASK | - GDK_BUTTON_PRESS_MASK | + GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON1_MOTION_MASK, @@ -388,11 +388,11 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, gint column_width, row_height, scrollbar_width; double x1, y1; double wx, wy; - + /* This code is practically copied from GtkCombo. */ popup = GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window); popwin = GTK_BIN (ecc->popup_window); - + gdk_window_get_origin (canvas->window, x, y); x1 = e_table_header_col_diff (eti->header, 0, view_col + 1); @@ -427,13 +427,13 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, the vertical scrollbar in case we need to show that. */ screen_width = gdk_screen_width (); avail_width = screen_width - scrollbar_width; - + gtk_widget_size_request (ecc->popup_list, &list_requisition); - min_height = MIN (list_requisition.height, + min_height = MIN (list_requisition.height, popup->vscrollbar->requisition.height); if (!GTK_LIST (ecc->popup_list)->children) list_requisition.height += E_CELL_COMBO_LIST_EMPTY_HEIGHT; - + /* Calculate the desired width. */ *width = list_requisition.width + 2 * popwin->child->style->xthickness @@ -587,7 +587,7 @@ e_cell_combo_button_release (GtkWidget *popup_window, GtkWidget *event_widget; event_widget = gtk_get_event_widget ((GdkEvent*) event); - + /* See if the button was released in the list (or its children). */ while (event_widget && event_widget != ecc->popup_list) event_widget = event_widget->parent; diff --git a/widgets/table/e-cell-combo.h b/widgets/table/e-cell-combo.h index ed8803f655..9be7f18c80 100644 --- a/widgets/table/e-cell-combo.h +++ b/widgets/table/e-cell-combo.h @@ -57,7 +57,7 @@ GType e_cell_combo_get_type (void); ECell *e_cell_combo_new (void); /* These must be UTF-8. */ -void e_cell_combo_set_popdown_strings (ECellCombo *ecc, +void e_cell_combo_set_popdown_strings (ECellCombo *ecc, GList *strings); #endif /* _E_CELL_COMBO_H_ */ diff --git a/widgets/table/e-cell-date.c b/widgets/table/e-cell-date.c index 0d185310cc..eb8312b290 100644 --- a/widgets/table/e-cell-date.c +++ b/widgets/table/e-cell-date.c @@ -1,4 +1,4 @@ -/* +/* * e-cell-date.c - Date item for e-table. * Copyright 2001, Ximian, Inc. * @@ -151,7 +151,7 @@ e_cell_date_init (ECellDate *ecd) * rendered with strikeout, underline, or bolded. In the case of the * "color_column" argument, the column in the model is expected to * have a string that can be parsed by gdk_color_parse(). - * + * * Returns: an ECell object that can be used to render dates. */ ECell * @@ -160,7 +160,7 @@ e_cell_date_new (const char *fontname, GtkJustification justify) ECellDate *ecd = g_object_new (E_CELL_DATE_TYPE, NULL); e_cell_text_construct(E_CELL_TEXT(ecd), fontname, justify); - + return (ECell *) ecd; } diff --git a/widgets/table/e-cell-date.h b/widgets/table/e-cell-date.h index e6ca4964d5..a99f1ddd6d 100644 --- a/widgets/table/e-cell-date.h +++ b/widgets/table/e-cell-date.h @@ -1,4 +1,4 @@ -/* +/* * e-cell-date.h - Date item for e-table. * Copyright 2001, Ximian, Inc. * diff --git a/widgets/table/e-cell-float.c b/widgets/table/e-cell-float.c index 1cd61efcbb..281000af23 100644 --- a/widgets/table/e-cell-float.c +++ b/widgets/table/e-cell-float.c @@ -40,9 +40,9 @@ static char * ecf_get_text(ECellText *cell, ETableModel *model, int col, int row) { gfloat *fvalue; - + fvalue = e_table_model_value_at (model, col, row); - + return e_format_number_float (*fvalue); } @@ -76,7 +76,7 @@ e_cell_float_init (ECellFloat *cell_float) * interpreted as being an int. * * See ECellText for other features. - * + * * Returns: an ECell object that can be used to render floats. */ ECell * @@ -85,7 +85,7 @@ e_cell_float_new (const char *fontname, GtkJustification justify) ECellFloat *ecn = g_object_new (E_CELL_FLOAT_TYPE, NULL); e_cell_text_construct(E_CELL_TEXT(ecn), fontname, justify); - + return (ECell *) ecn; } diff --git a/widgets/table/e-cell-hbox.c b/widgets/table/e-cell-hbox.c index 0dbee373cb..0f49d035c9 100644 --- a/widgets/table/e-cell-hbox.c +++ b/widgets/table/e-cell-hbox.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-hbox.c - Hbox cell object. * Copyright 2006 Novell, Inc. * @@ -55,13 +55,13 @@ ecv_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) ECellHbox *ecv = E_CELL_HBOX (ecell); ECellHboxView *hbox_view = g_new0 (ECellHboxView, 1); int i; - + hbox_view->cell_view.ecell = ecell; hbox_view->cell_view.e_table_model = table_model; hbox_view->cell_view.e_table_item_view = e_table_item_view; hbox_view->cell_view.kill_view_cb = NULL; hbox_view->cell_view.kill_view_cb_data = NULL; - + /* create our subcell view */ hbox_view->subcell_view_count = ecv->subcell_count; hbox_view->subcell_views = g_new (ECellView *, hbox_view->subcell_view_count); @@ -149,7 +149,7 @@ ecv_draw (ECellView *ecell_view, GdkDrawable *drawable, int subcell_offset = 0; int i; int allotted_width = x2-x1; - + for (i = 0; i < hbox_view->subcell_view_count; i++) { /* Now cause our subcells to draw their contents, shifted by subcell_offset pixels */ @@ -207,7 +207,7 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, * ECell::height method */ static int -ecv_height (ECellView *ecell_view, int model_col, int view_col, int row) +ecv_height (ECellView *ecell_view, int model_col, int view_col, int row) { ECellHboxView *hbox_view = (ECellHboxView *)ecell_view; int height = 0, max_height = 0; @@ -232,9 +232,9 @@ ecv_max_width (ECellView *ecell_view, int model_col, int view_col) for (i = 0; i < hbox_view->subcell_view_count; i++) { int cell_width = e_cell_max_width (hbox_view->subcell_views[i], hbox_view->model_cols[i], view_col); - + if (cell_width < hbox_view->def_size_cols[i]) - cell_width = hbox_view->def_size_cols[i]; + cell_width = hbox_view->def_size_cols[i]; width += cell_width; } @@ -291,10 +291,10 @@ e_cell_hbox_init (ECellHbox *ecv) /** * e_cell_hbox_new: - * + * * Creates a new ECell renderer that can be used to render multiple * child cells. - * + * * Return value: an ECell object that can be used to render multiple * child cells. **/ @@ -314,7 +314,7 @@ e_cell_hbox_append (ECellHbox *hbox, ECell *subcell, int model_col, int size) hbox->subcells = g_renew (ECell *, hbox->subcells, hbox->subcell_count); hbox->model_cols = g_renew (int, hbox->model_cols, hbox->subcell_count); hbox->def_size_cols = g_renew (int, hbox->def_size_cols, hbox->subcell_count); - + hbox->subcells[hbox->subcell_count - 1] = subcell; hbox->model_cols[hbox->subcell_count - 1] = model_col; hbox->def_size_cols[hbox->subcell_count - 1] = size; diff --git a/widgets/table/e-cell-hbox.h b/widgets/table/e-cell-hbox.h index 448ed7c425..8965f2b1da 100644 --- a/widgets/table/e-cell-hbox.h +++ b/widgets/table/e-cell-hbox.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-hbox.h - Hbox cell object. * Copyright 2006, Novell, Inc. * @@ -54,7 +54,7 @@ typedef struct { int subcell_view_count; ECellView **subcell_views; int *model_cols; - int *def_size_cols; + int *def_size_cols; } ECellHboxView; typedef struct { diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c index d87ffced8e..b4b7119c6b 100644 --- a/widgets/table/e-cell-number.c +++ b/widgets/table/e-cell-number.c @@ -1,4 +1,4 @@ -/* +/* * e-cell-number.c - Number item for e-table. * Copyright 2001, Ximian, Inc. * @@ -68,7 +68,7 @@ e_cell_number_init (ECellNumber *cell_number) * interpreted as being an int. * * See ECellText for other features. - * + * * Returns: an ECell object that can be used to render numbers. */ ECell * @@ -77,7 +77,7 @@ e_cell_number_new (const char *fontname, GtkJustification justify) ECellNumber *ecn = g_object_new (E_CELL_NUMBER_TYPE, NULL); e_cell_text_construct(E_CELL_TEXT(ecn), fontname, justify); - + return (ECell *) ecn; } diff --git a/widgets/table/e-cell-number.h b/widgets/table/e-cell-number.h index 573f589108..ff9736f201 100644 --- a/widgets/table/e-cell-number.h +++ b/widgets/table/e-cell-number.h @@ -1,4 +1,4 @@ -/* +/* * e-cell-number.h - Number item for e-table. * Copyright 2001, Ximian, Inc. * diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c index 9963a2d361..36fd8a49b3 100644 --- a/widgets/table/e-cell-pixbuf.c +++ b/widgets/table/e-cell-pixbuf.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-pixbuf.c - An ECell that displays a GdkPixbuf * Copyright 2001, Ximian, Inc. * @@ -215,14 +215,14 @@ pixbuf_height (ECellView *ecell_view, int model_col, int view_col, int row) * ECell::print method */ static void -pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, +pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width, double height) { GdkPixbuf *pixbuf; int scale; cairo_t *cr = gtk_print_context_get_cairo_context (context); - + pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, model_col, row); if (pixbuf == NULL) return; @@ -231,12 +231,12 @@ pixbuf_print (ECellView *ecell_view, GtkPrintContext *context, cairo_save (cr); cairo_translate (cr, 0, (double)(height - scale) / (double)2); gdk_cairo_set_source_pixbuf (cr, pixbuf, (double)scale, (double)scale); - cairo_paint (cr); + cairo_paint (cr); cairo_restore (cr); } static gdouble -pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, +pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width) { @@ -249,11 +249,11 @@ pixbuf_print_height (ECellView *ecell_view, GtkPrintContext *context, return 6; } } - + pixbuf = (GdkPixbuf *) e_table_model_value_at (ecell_view->e_table_model, model_col, row); if (!pixbuf) return 0; - + /* We give ourselves 3 pixels of padding on either side */ return gdk_pixbuf_get_height (pixbuf); } @@ -331,7 +331,7 @@ pixbuf_get_property (GObject *object, ECellPixbuf *pixbuf; pixbuf = E_CELL_PIXBUF (object); - + switch (prop_id) { case PROP_SELECTED_COLUMN: g_value_set_int (value, pixbuf->selected_column); diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c index c082c2416e..29eaafba4a 100644 --- a/widgets/table/e-cell-popup.c +++ b/widgets/table/e-cell-popup.c @@ -87,14 +87,14 @@ static void ecp_leave_edit (ECellView *ecv, int row, void *edit_context); static void ecp_print (ECellView *ecv, - GtkPrintContext *context, + GtkPrintContext *context, int model_col, int view_col, int row, double width, double height); static gdouble ecp_print_height (ECellView *ecv, - GtkPrintContext *context, + GtkPrintContext *context, int model_col, int view_col, int row, @@ -102,7 +102,7 @@ static gdouble ecp_print_height (ECellView *ecv, static int ecp_max_width (ECellView *ecv, int model_col, int view_col); -static void ecp_show_tooltip (ECellView *ecv, +static void ecp_show_tooltip (ECellView *ecv, int model_col, int view_col, int row, @@ -194,7 +194,7 @@ ecp_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) { ECellPopup *ecp = E_CELL_POPUP (ecell); ECellPopupView *ecp_view; - + /* We must have a child ECell before we create any views. */ g_return_val_if_fail (ecp->child != NULL, NULL); @@ -370,7 +370,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, int model_col, int view_col, * ECell::height method */ static int -ecp_height (ECellView *ecv, int model_col, int view_col, int row) +ecp_height (ECellView *ecv, int model_col, int view_col, int row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -405,7 +405,7 @@ ecp_leave_edit (ECellView *ecv, int model_col, int view_col, int row, static void -ecp_print (ECellView *ecv, GtkPrintContext *context, +ecp_print (ECellView *ecv, GtkPrintContext *context, int model_col, int view_col, int row, double width, double height) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; @@ -416,7 +416,7 @@ ecp_print (ECellView *ecv, GtkPrintContext *context, static gdouble -ecp_print_height (ECellView *ecv, GtkPrintContext *context, +ecp_print_height (ECellView *ecv, GtkPrintContext *context, int model_col, int view_col, int row, double width) { @@ -439,7 +439,7 @@ ecp_max_width (ECellView *ecv, static void -ecp_show_tooltip (ECellView *ecv, +ecp_show_tooltip (ECellView *ecv, int model_col, int view_col, int row, @@ -454,7 +454,7 @@ ecp_show_tooltip (ECellView *ecv, static char * ecp_get_bg_color (ECellView *ecell_view, int row) -{ +{ ECellPopupView *ecp_view = (ECellPopupView *) ecell_view; return e_cell_get_bg_color (ecp_view->child_view, row); diff --git a/widgets/table/e-cell-progress.c b/widgets/table/e-cell-progress.c index d22978c09d..943cc769d2 100644 --- a/widgets/table/e-cell-progress.c +++ b/widgets/table/e-cell-progress.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-progress.c - Progress display cell object. * Copyright 1999-2002, Ximian, Inc. * Copyright 2001, 2002, Krisztian Pifko <monsta@users.sourceforge.net> @@ -64,14 +64,14 @@ eprog_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) ECellProgressView *progress_view = g_new0 (ECellProgressView, 1); ETableItem *eti = E_TABLE_ITEM (e_table_item_view); GnomeCanvas *canvas = GNOME_CANVAS_ITEM (eti)->canvas; - + progress_view->cell_view.ecell = ecell; progress_view->cell_view.e_table_model = table_model; progress_view->cell_view.e_table_item_view = e_table_item_view; progress_view->cell_view.kill_view_cb = NULL; progress_view->cell_view.kill_view_cb_data = NULL; progress_view->canvas = canvas; - + return (ECellView *) progress_view; } @@ -87,7 +87,7 @@ eprog_kill_view (ECellView *ecell_view) g_list_free(progress_view->cell_view.kill_view_cb_data); g_free (ecell_view); -} +} static void eprog_realize (ECellView *ecell_view) @@ -112,7 +112,7 @@ eprog_unrealize (ECellView *ecv) static void eprog_clear (ECellProgress *progress) { - memset(progress->buffer,0x00,progress->width*progress->height*4); + memset(progress->buffer,0x00,progress->width*progress->height*4); } static void @@ -158,7 +158,7 @@ static void eprog_draw_bar (ECellProgress *progress, guchar red, guchar green, guchar blue, gint value) { gint i, j, w; - + w=value*(progress->width-2*(progress->padding+progress->border+1))/progress->max; for (i=(progress->padding+progress->border+1)*4;i<(progress->padding+progress->border+1+w)*4;i+=4){ for (j=0;j<progress->height-2*(progress->padding+progress->border+1);j++){ @@ -180,10 +180,10 @@ eprog_draw (ECellView *ecell_view, GdkDrawable *drawable, { ECellProgress *progress = E_CELL_PROGRESS (ecell_view->ecell); int x, y; - + const int value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); - + if ((value > progress->max)||(value < progress->min)){ g_warning ("Value from the table model is %d, the states we support are [%d..%d]\n", value, progress->min, progress->max); @@ -257,7 +257,7 @@ eprog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col case GDK_BUTTON_PRESS: if (!e_table_model_is_cell_editable(ecell_view->e_table_model, model_col, row)) return FALSE; - + eprog_set_value (progress_view, model_col, view_col, row, value + 1); return TRUE; @@ -292,7 +292,7 @@ static void eprog_dispose (GObject *object) { ECellProgress *eprog = E_CELL_PROGRESS (object); - + g_object_unref (eprog->image); g_free (eprog->image); g_free (eprog->buffer); @@ -371,7 +371,7 @@ e_cell_progress_construct (ECellProgress *eprog, int padding, int border, int mi * Creates a new ECell renderer that can be used to render progress * bars displaying the percentage of the current value between min * and max. - * + * * Returns: an ECell object that can be used to render progress cells. */ ECell * diff --git a/widgets/table/e-cell-progress.h b/widgets/table/e-cell-progress.h index 9339038594..212d498f3b 100644 --- a/widgets/table/e-cell-progress.h +++ b/widgets/table/e-cell-progress.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-progress.h - Progress display cell object. * Copyright 1999-2002, Ximian, Inc. * Copyright 2001, 2002, Krisztian Pifko <monsta@users.sourceforge.net> diff --git a/widgets/table/e-cell-size.c b/widgets/table/e-cell-size.c index 038ff9dc28..227592c4e3 100644 --- a/widgets/table/e-cell-size.c +++ b/widgets/table/e-cell-size.c @@ -37,7 +37,7 @@ ecd_get_text(ECellText *cell, ETableModel *model, int col, int row) { gint size = GPOINTER_TO_INT(e_table_model_value_at(model, col, row)); gfloat fsize; - + if (size < 1024) { return g_strdup_printf ("%d bytes", size); } else { @@ -94,7 +94,7 @@ e_cell_size_init (ECellSize *e_cell_size) * rendered with strikeout, underline, or bolded. In the case of the * "color_column" argument, the column in the model is expected to * have a string that can be parsed by gdk_color_parse(). - * + * * Returns: an ECell object that can be used to render file sizes. */ ECell * e_cell_size_new (const char *fontname, GtkJustification justify) @@ -102,7 +102,7 @@ e_cell_size_new (const char *fontname, GtkJustification justify) ECellSize *ecd = g_object_new (E_CELL_SIZE_TYPE, NULL); e_cell_text_construct(E_CELL_TEXT(ecd), fontname, justify); - + return (ECell *) ecd; } diff --git a/widgets/table/e-cell-spin-button.c b/widgets/table/e-cell-spin-button.c index 7f04af9358..ea7f294cfa 100644 --- a/widgets/table/e-cell-spin-button.c +++ b/widgets/table/e-cell-spin-button.c @@ -7,9 +7,9 @@ * Authors: * Mikael Hallendal <micke@codefactory.se> * - * Celltype for drawing a spinbutton in a cell. + * Celltype for drawing a spinbutton in a cell. * - * Used ECellPopup by Damon Chaplin <damon@ximian.com> as base for + * Used ECellPopup by Damon Chaplin <damon@ximian.com> as base for * buttondrawings. * * This library is free software; you can redistribute it and/or @@ -54,24 +54,24 @@ static ECellView * ecsb_new_view (ECell *ecell, static void ecsb_realize (ECellView *ecv); static void ecsb_kill_view (ECellView *ecv); static void ecsb_unrealize (ECellView *ecv); -static void ecsb_draw (ECellView *ecv, - GdkDrawable *drawable, - int model_col, - int view_col, - int row, - ECellFlags flags, - int x1, - int y1, - int x2, - int y2); - -static gint ecsb_event (ECellView *ecv, - GdkEvent *event, - int model_col, - int view_col, +static void ecsb_draw (ECellView *ecv, + GdkDrawable *drawable, + int model_col, + int view_col, + int row, + ECellFlags flags, + int x1, + int y1, + int x2, + int y2); + +static gint ecsb_event (ECellView *ecv, + GdkEvent *event, + int model_col, + int view_col, int row, - ECellFlags flags, - ECellActions *actions); + ECellFlags flags, + ECellActions *actions); static gint ecsb_height (ECellView *ecv, int model_col, @@ -79,14 +79,14 @@ static gint ecsb_height (ECellView *ecv, int row); static void * ecsb_enter_edit (ECellView *ecv, - int model_col, - int view_col, + int model_col, + int view_col, int row); static void ecsb_leave_edit (ECellView *ecv, - int model_col, - int view_col, - int row, + int model_col, + int view_col, + int row, void *context); static void ecsb_focus (ECellView *ecell_view, int model_col, @@ -99,15 +99,15 @@ static void ecsb_focus (ECellView *ecell_view, static void ecsb_unfocus (ECellView *ecell_view); static void ecsb_show_tooltip (ECellView *ecv, - int model_col, - int view_col, - int row, - int col_width, + int model_col, + int view_col, + int row, + int col_width, ETableTooltip *tooltip); typedef struct { ECellView cell_view; - + ECellView *child_view; } ECellSpinButtonView; @@ -118,12 +118,12 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -static void +static void e_cell_spin_button_class_init (ECellSpinButtonClass *klass) { ECellClass *ecc = E_CELL_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass); - + object_class->dispose = ecsb_dispose; ecc->realize = ecsb_realize; @@ -151,20 +151,20 @@ e_cell_spin_button_class_init (ECellSpinButtonClass *klass) NULL, NULL, e_util_marshal_NONE__POINTER_INT_INT_INT, G_TYPE_NONE, - 4, G_TYPE_POINTER, G_TYPE_INT, + 4, G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); } -static void +static void e_cell_spin_button_init (ECellSpinButton *ecsb) { g_return_if_fail (M_IS_CELL_SPIN_BUTTON (ecsb)); - + ecsb->up_pressed = FALSE; ecsb->down_pressed = FALSE; } -static ECellView * +static ECellView * ecsb_new_view (ECell *ecell, ETableModel *etm, void *eti_view) @@ -187,23 +187,23 @@ ecsb_new_view (ECell *ecell, return (ECellView *) ecsb_view; } -static void +static void ecsb_realize (ECellView *ecv) -{ +{ ECellSpinButtonView *ecsb_view; - + g_return_if_fail (ecv != NULL); ecsb_view = (ECellSpinButtonView *) ecv; e_cell_realize (ecsb_view->child_view); -} +} -static void +static void ecsb_kill_view (ECellView *ecv) { ECellSpinButtonView *ecsb_view; - + g_return_if_fail (ecv != NULL); ecsb_view = (ECellSpinButtonView *) ecv; @@ -211,15 +211,15 @@ ecsb_kill_view (ECellView *ecv) if (ecsb_view->child_view) { e_cell_kill_view (ecsb_view->child_view); } - + g_free (ecsb_view); } -static void +static void ecsb_unrealize (ECellView *ecv) -{ +{ ECellSpinButtonView *ecsb_view; - + g_return_if_fail (ecv != NULL); ecsb_view = (ECellSpinButtonView *) ecv; @@ -227,16 +227,16 @@ ecsb_unrealize (ECellView *ecv) e_cell_unrealize (ecsb_view->child_view); } -static void -ecsb_draw (ECellView *ecv, - GdkDrawable *drawable, - int model_col, - int view_col, - int row, - ECellFlags flags, - int x1, - int y1, - int x2, +static void +ecsb_draw (ECellView *ecv, + GdkDrawable *drawable, + int model_col, + int view_col, + int row, + ECellFlags flags, + int x1, + int y1, + int x2, int y2) { ECellSpinButton *ecsb; @@ -245,38 +245,38 @@ ecsb_draw (ECellView *ecv, GtkWidget *canvas; GtkShadowType shadow = GTK_SHADOW_OUT; GdkRectangle rect; - + g_return_if_fail (ecv != NULL); - + ecsb_view = (ECellSpinButtonView *) ecv; ecsb = E_CELL_SPIN_BUTTON (ecsb_view->cell_view.ecell); - + eti = E_TABLE_ITEM (ecsb_view->cell_view.e_table_item_view); canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (eti)->canvas); - - if (eti->editing_col == view_col && + + if (eti->editing_col == view_col && eti->editing_row == row) { /* Draw child (Whats shown under the buttons) */ - e_cell_draw (ecsb_view->child_view, + e_cell_draw (ecsb_view->child_view, drawable, model_col, view_col, - row, flags, - x1, y1, - x2 - E_CELL_SPIN_BUTTON_ARROW_WIDTH, y2); + row, flags, + x1, y1, + x2 - E_CELL_SPIN_BUTTON_ARROW_WIDTH, y2); /* Draw down-arrow */ rect.x = x2 - E_CELL_SPIN_BUTTON_ARROW_WIDTH; rect.y = y1 + (y2 - y1) / 2; rect.width = E_CELL_SPIN_BUTTON_ARROW_WIDTH; rect.height = (y2 - y1) / 2; - + if (ecsb->down_pressed) { shadow = GTK_SHADOW_IN; } else { shadow = GTK_SHADOW_OUT; } - - gtk_paint_box (canvas->style, drawable, + + gtk_paint_box (canvas->style, drawable, GTK_STATE_NORMAL, shadow, &rect, canvas, "ecellspinbutton_down", rect.x, rect.y, rect.width, rect.height); @@ -292,14 +292,14 @@ ecsb_draw (ECellView *ecv, /* Draw up-arrow */ rect.y = y1; - + if (ecsb->up_pressed) { shadow = GTK_SHADOW_IN; } else { shadow = GTK_SHADOW_OUT; } - gtk_paint_box (canvas->style, drawable, + gtk_paint_box (canvas->style, drawable, GTK_STATE_NORMAL, shadow, &rect, canvas, "ecellspinbutton_up", rect.x, rect.y, rect.width, rect.height); @@ -314,34 +314,34 @@ ecsb_draw (ECellView *ecv, rect.height); } else { /* Draw child */ - e_cell_draw (ecsb_view->child_view, + e_cell_draw (ecsb_view->child_view, drawable, model_col, view_col, - row, flags, - x1, y1, - x2, y2); + row, flags, + x1, y1, + x2, y2); } } -static gint -ecsb_event (ECellView *ecv, - GdkEvent *event, - int model_col, - int view_col, +static gint +ecsb_event (ECellView *ecv, + GdkEvent *event, + int model_col, + int view_col, int row, - ECellFlags flags, + ECellFlags flags, ECellActions *actions) { ECellSpinButton *ecsb; ECellSpinButtonView *ecsb_view; ETableItem *eti; gint height, width; - + g_return_val_if_fail (ecv != NULL, FALSE); - + ecsb_view = (ECellSpinButtonView *) ecv; ecsb = E_CELL_SPIN_BUTTON (ecsb_view->cell_view.ecell); eti = E_TABLE_ITEM (ecsb_view->cell_view.e_table_item_view); - + switch (event->type) { case GDK_BUTTON_PRESS: if (eti->editing_col == view_col && @@ -377,10 +377,10 @@ ecsb_event (ECellView *ecv, row, view_col, row); - + } - } - + } + break; case GDK_BUTTON_RELEASE: ecsb->up_pressed = FALSE; @@ -401,29 +401,29 @@ ecsb_event (ECellView *ecv, view_col, row, flags, actions); } -static gint +static gint ecsb_height (ECellView *ecv, int model_col, int view_col, int row) { ECellSpinButtonView *ecsb_view; - + g_return_val_if_fail (ecv != NULL, -1); - + ecsb_view = (ECellSpinButtonView *) ecv; return e_cell_height (ecsb_view->child_view, model_col, view_col, row); } -static void * +static void * ecsb_enter_edit (ECellView *ecv, - int model_col, - int view_col, + int model_col, + int view_col, int row) { ECellSpinButtonView *ecsb_view; - + g_return_val_if_fail (ecv != NULL, NULL); ecsb_view = (ECellSpinButtonView *) ecv; @@ -433,20 +433,20 @@ ecsb_enter_edit (ECellView *ecv, } -static void +static void ecsb_leave_edit (ECellView *ecv, - int model_col, - int view_col, - int row, + int model_col, + int view_col, + int row, void *context) { ECellSpinButtonView *ecsb_view; - + g_return_if_fail (ecv != NULL); - + ecsb_view = (ECellSpinButtonView *) ecv; - e_cell_leave_edit (ecsb_view->child_view, model_col, view_col, + e_cell_leave_edit (ecsb_view->child_view, model_col, view_col, row, context); } @@ -461,11 +461,11 @@ ecsb_focus (ECellView *ecell_view, int y2) { ECellClass *klass; - + klass = E_CELL_GET_CLASS (ecell_view->ecell); if (klass->focus) - klass->focus (ecell_view, model_col, view_col, row, + klass->focus (ecell_view, model_col, view_col, row, x1, y1, x2, y2); } @@ -473,37 +473,37 @@ static void ecsb_unfocus (ECellView *ecell_view) { ECellClass *klass; - + klass = E_CELL_GET_CLASS (ecell_view->ecell); if (klass->unfocus) klass->unfocus (ecell_view); } -static void +static void ecsb_show_tooltip (ECellView *ecv, - int model_col, - int view_col, - int row, - int col_width, + int model_col, + int view_col, + int row, + int col_width, ETableTooltip *tooltip) { ECellSpinButtonView *ecsb_view; - + g_return_if_fail (ecv != NULL); ecsb_view = (ECellSpinButtonView *) ecv; - - e_cell_show_tooltip (ecsb_view->child_view, model_col, view_col, + + e_cell_show_tooltip (ecsb_view->child_view, model_col, view_col, row, col_width, tooltip); } -static void +static void ecsb_dispose (GObject *object) { g_return_if_fail (object != NULL); g_return_if_fail (M_IS_CELL_SPIN_BUTTON (object)); - + G_OBJECT_CLASS (e_cell_spin_button_parent_class)->dispose (object); } @@ -514,18 +514,18 @@ e_cell_spin_button_new (gint min, ECell *child_cell) { ECellSpinButton *ecsb; - + ecsb = g_object_new (E_CELL_SPIN_BUTTON_TYPE, NULL); if (!child_cell) { - child_cell = e_cell_number_new (NULL, + child_cell = e_cell_number_new (NULL, GTK_JUSTIFY_LEFT); - + g_signal_connect (ecsb, "step", G_CALLBACK (e_cell_spin_button_step), NULL); } - + ecsb->child = child_cell; ecsb->min.i = min; ecsb->max.i = max; @@ -541,7 +541,7 @@ e_cell_spin_button_new_float (gfloat min, ECell *child_cell) { ECellSpinButton *ecsb; - + ecsb = g_object_new (E_CELL_SPIN_BUTTON_TYPE, NULL); if (!child_cell) { @@ -550,7 +550,7 @@ e_cell_spin_button_new_float (gfloat min, G_CALLBACK (e_cell_spin_button_step_float), NULL); } - + ecsb->child = child_cell; ecsb->min.f = min; ecsb->max.f = max; @@ -566,30 +566,30 @@ e_cell_spin_button_step (ECellSpinButton *ecsb, gint col, gint row) { - ECellSpinButtonView *ecsb_view; - + ECellSpinButtonView *ecsb_view; + ETableModel *etm; gint value; gint new_value; gchar *str_value; - + g_return_if_fail (ecsb != NULL); g_return_if_fail (M_IS_CELL_SPIN_BUTTON (ecsb)); g_return_if_fail (ecv != NULL); - - ecsb_view = (ECellSpinButtonView *) ecv; + + ecsb_view = (ECellSpinButtonView *) ecv; etm = ecsb_view->cell_view.e_table_model; - + value = GPOINTER_TO_INT (e_table_model_value_at (etm, col, row)); new_value = value; - + switch (direction) { case STEP_UP: - new_value = CLAMP (value + ecsb->step.i, + new_value = CLAMP (value + ecsb->step.i, ecsb->min.i, ecsb->max.i); break; case STEP_DOWN: - new_value = CLAMP (value - ecsb->step.i, + new_value = CLAMP (value - ecsb->step.i, ecsb->min.i, ecsb->max.i); break; default: @@ -610,40 +610,40 @@ e_cell_spin_button_step_float (ECellSpinButton *ecsb, gint col, gint row) { - ECellSpinButtonView *ecsb_view; - + ECellSpinButtonView *ecsb_view; + ETableModel *etm; gfloat value; gfloat new_value; gchar *str_value; - + g_return_if_fail (ecsb != NULL); g_return_if_fail (M_IS_CELL_SPIN_BUTTON (ecsb)); g_return_if_fail (ecv != NULL); - - ecsb_view = (ECellSpinButtonView *) ecv; + + ecsb_view = (ECellSpinButtonView *) ecv; etm = ecsb_view->cell_view.e_table_model; - + value = *(gfloat *) e_table_model_value_at (etm, col, row); switch (direction) { case STEP_UP: - new_value = CLAMP (value + ecsb->step.f, + new_value = CLAMP (value + ecsb->step.f, ecsb->min.f, ecsb->max.f); break; case STEP_DOWN: - new_value = CLAMP (value - ecsb->step.f, + new_value = CLAMP (value - ecsb->step.f, ecsb->min.f, ecsb->max.f); break; default: new_value = value; break; }; - + str_value = g_strdup_printf ("%f", new_value); e_table_model_set_value_at (etm, col, row, str_value); - + g_free (str_value); } diff --git a/widgets/table/e-cell-spin-button.h b/widgets/table/e-cell-spin-button.h index 9294857074..6bbd79bc99 100644 --- a/widgets/table/e-cell-spin-button.h +++ b/widgets/table/e-cell-spin-button.h @@ -7,9 +7,9 @@ * Authors: * Mikael Hallendal <micke@codefactory.se> * - * Celltype for drawing a spinbutton in a cell. + * Celltype for drawing a spinbutton in a cell. * - * Used ECellPopup by Damon Chaplin <damon@ximian.com> as base for + * Used ECellPopup by Damon Chaplin <damon@ximian.com> as base for * buttondrawings. * * This library is free software; you can redistribute it and/or @@ -58,7 +58,7 @@ typedef struct { ECellSpinButtonData min; ECellSpinButtonData max; ECellSpinButtonData step; - + gboolean up_pressed; gboolean down_pressed; @@ -66,7 +66,7 @@ typedef struct { typedef struct { ECellClass parent_class; - + /* Functions */ void (*step) (ECellSpinButton *mcsb, ECellView *ecv, @@ -82,9 +82,9 @@ ECell * e_cell_spin_button_new (gint min, ECell *child_cell); ECell * e_cell_spin_button_new_float (gfloat min, - gfloat max, + gfloat max, gfloat step, - ECell *child_cell); + ECell *child_cell); void e_cell_spin_button_step (ECellSpinButton *mcsb, diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index 9c548b620f..5a55a51982 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -120,7 +120,7 @@ typedef struct { int max_width; int ref_count; } ECellTextLineBreaks; - + typedef struct _CellEdit CellEdit; @@ -129,7 +129,7 @@ typedef struct { GdkGC *gc; GdkCursor *i_cursor; GdkBitmap *stipple; /* Stipple for text */ - + GnomeCanvas *canvas; /* @@ -288,7 +288,7 @@ ect_stop_editing (ECellTextView *text_view, gboolean commit) row = edit->row; view_col = edit->view_col; model_col = edit->model_col; - + old_text = edit->old_text; text = edit->text; if (edit->tep) @@ -306,7 +306,7 @@ ect_stop_editing (ECellTextView *text_view, gboolean commit) g_timer_destroy (edit->timer); edit->timer = NULL; } - + g_signal_handlers_disconnect_matched ( edit->im_context, G_SIGNAL_MATCH_DATA, 0, 0, @@ -354,20 +354,20 @@ ect_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) { ECellTextView *text_view = g_new0 (ECellTextView, 1); GnomeCanvas *canvas = GNOME_CANVAS_ITEM (e_table_item_view)->canvas; - + text_view->cell_view.ecell = ecell; text_view->cell_view.e_table_model = table_model; text_view->cell_view.e_table_item_view = e_table_item_view; text_view->cell_view.kill_view_cb = NULL; text_view->cell_view.kill_view_cb_data = NULL; - + text_view->canvas = canvas; text_view->xofs = 0.0; text_view->yofs = 0.0; - + return (ECellView *)text_view; } @@ -395,11 +395,11 @@ static void ect_realize (ECellView *ecell_view) { ECellTextView *text_view = (ECellTextView *) ecell_view; - + text_view->gc = gdk_gc_new (GTK_WIDGET (text_view->canvas)->window); text_view->i_cursor = gdk_cursor_new (GDK_XTERM); - + if (E_CELL_CLASS (e_cell_text_parent_class)->realize) (* E_CELL_CLASS (e_cell_text_parent_class)->realize) (ecell_view); } @@ -456,7 +456,7 @@ ect_free_color (gchar *color_spec, GdkColor *color, GdkColormap *colormap) static PangoAttrList* -build_attr_list (ECellTextView *text_view, int row, int text_length) +build_attr_list (ECellTextView *text_view, int row, int text_length) { ECellView *ecell_view = (ECellView *) text_view; @@ -512,7 +512,7 @@ layout_with_preedit (ECellTextView *text_view, int row, const char *text, gint w gint preedit_length = 0; 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, @@ -521,10 +521,10 @@ layout_with_preedit (ECellTextView *text_view, int row, const char *text, gint w layout = edit->layout; - g_string_prepend_len (tmp_string, text,text_length); + g_string_prepend_len (tmp_string, text,text_length); if (preedit_length) { - + /* mlen is the text_length in bytes, not chars * check whether we are not inserting into * the middle of a utf8 character @@ -541,7 +541,7 @@ layout_with_preedit (ECellTextView *text_view, int row, const char *text, gint w } g_string_insert (tmp_string, mlen, preedit_string); - } + } pango_layout_set_text (layout, tmp_string->str, tmp_string->len); @@ -594,13 +594,13 @@ build_layout (ECellTextView *text_view, int row, const char *text, gint width) PangoFontDescription *desc = NULL, *fixed_desc = NULL; char *fixed_family = NULL; gint fixed_size = 0; - + fixed_desc = pango_font_description_from_string (ect->font_name); if (fixed_desc) { fixed_family = (char *)pango_font_description_get_family (fixed_desc); fixed_size = pango_font_description_get_size (fixed_desc); - } - + } + desc = pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (((GnomeCanvasItem *)ecell_view->e_table_item_view)->canvas))->font_desc); pango_font_description_set_family (desc, fixed_family); pango_font_description_set_size (desc, fixed_size); @@ -609,7 +609,7 @@ build_layout (ECellTextView *text_view, int row, const char *text, gint width) pango_font_description_free (desc); pango_font_description_free (fixed_desc); } - + pango_layout_set_width (layout, width * PANGO_SCALE); pango_layout_set_wrap (layout, PANGO_WRAP_CHAR); @@ -780,7 +780,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, if (edit && edit->view_col == view_col && edit->row == row) { layout = layout_with_preedit (text_view, row, edit->text ? edit->text : "?", x2 - x1); - } + } gdk_draw_layout (drawable, text_view->gc, x_origin, y_origin, @@ -836,7 +836,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, gdk_region_destroy (rect_region); gdk_gc_set_clip_region (text_gc, clip_region); - gdk_draw_layout (drawable, text_gc, + gdk_draw_layout (drawable, text_gc, x_origin, y_origin, layout); gdk_gc_set_clip_region (text_gc, NULL); @@ -848,7 +848,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, if (edit->show_cursor) { PangoRectangle strong_pos, weak_pos; pango_layout_get_cursor_pos (layout, edit->selection_start + edit->preedit_length, &strong_pos, &weak_pos); - + draw_pango_rectangle (drawable, text_view->gc, x_origin, y_origin, strong_pos); if (strong_pos.x != weak_pos.x || strong_pos.y != weak_pos.y || @@ -889,7 +889,7 @@ static void ect_edit_select_all (ECellTextView *text_view) { g_return_if_fail (text_view->edit); - + text_view->edit->selection_start = 0; text_view->edit->selection_end = strlen (text_view->edit->text); } @@ -920,7 +920,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, if (!(flags & E_CELL_EDITING)) return 0; - + if ( edit && !edit->preedit_length && flags & E_CELL_PREEDIT) return 1; @@ -934,31 +934,31 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, break; case GDK_KEY_PRESS: /* Fall Through */ if (edit_display) { - if (edit->im_context && + if (edit->im_context && !edit->im_context_signals_registered) { - g_signal_connect (edit->im_context, + g_signal_connect (edit->im_context, "preedit_changed", G_CALLBACK (\ e_cell_text_preedit_changed_cb), text_view); - g_signal_connect (edit->im_context, + g_signal_connect (edit->im_context, "commit", G_CALLBACK (\ - e_cell_text_commit_cb), + e_cell_text_commit_cb), text_view); - g_signal_connect (edit->im_context, + g_signal_connect (edit->im_context, "retrieve_surrounding", G_CALLBACK (\ - e_cell_text_retrieve_surrounding_cb), + e_cell_text_retrieve_surrounding_cb), text_view); - g_signal_connect (edit->im_context, + g_signal_connect (edit->im_context, "delete_surrounding", G_CALLBACK (\ - e_cell_text_delete_surrounding_cb), + e_cell_text_delete_surrounding_cb), text_view); edit->im_context_signals_registered = TRUE; @@ -969,8 +969,8 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, } else { if (edit && edit->im_context) { g_signal_handlers_disconnect_matched ( - edit->im_context, - G_SIGNAL_MATCH_DATA, 0, 0, + edit->im_context, + G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, edit); edit->im_context_signals_registered = FALSE; } @@ -992,7 +992,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, else return 1; } - + if (event->key.keyval == GDK_Escape){ /* if not changed, then pass this even to parent */ return_val = text_view->edit != NULL && text_view->edit->text && text_view->edit->old_text && 0 != strcmp (text_view->edit->text, text_view->edit->old_text); @@ -1007,7 +1007,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, ect_edit_select_all (text_view); edit = text_view->edit; edit_display = TRUE; - } + } if (edit_display) { GdkEventKey key = event->key; if (key.type == GDK_KEY_PRESS && @@ -1033,7 +1033,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, #endif _get_tep (edit); return_val = e_text_event_processor_handle_event (edit->tep, &e_tep_event); - if (e_tep_event.key.string) + if (e_tep_event.key.string) g_free (e_tep_event.key.string); break; } @@ -1046,7 +1046,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, d(g_print ("%s: %s\n", __FUNCTION__, press ? "GDK_BUTTON_PRESS" : "GDK_BUTTON_RELEASE")); event->button.x -= 4; event->button.y -= 1; - if ((!edit_display) + if ((!edit_display) && e_table_model_is_cell_editable (ecell_view->e_table_model, model_col, row) && event->type == GDK_BUTTON_RELEASE && event->button.button == 1) { @@ -1055,7 +1055,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, e_table_item_enter_edit (text_view->cell_view.e_table_item_view, view_col, row); edit = text_view->edit; edit_display = TRUE; - + e_tep_event.button.type = GDK_BUTTON_PRESS; e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; @@ -1151,7 +1151,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, * ECell::height method */ static int -ect_height (ECellView *ecell_view, int model_col, int view_col, int row) +ect_height (ECellView *ecell_view, int model_col, int view_col, int row) { ECellTextView *text_view = (ECellTextView *) ecell_view; gint height; @@ -1193,10 +1193,10 @@ ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) view_col)->width - 8; edit->layout = generate_layout (text_view, model_col, view_col, row, edit->cell_width); - + edit->xofs_edit = 0.0; edit->yofs_edit = 0.0; - + edit->selection_start = 0; edit->selection_end = 0; edit->select_by_word = FALSE; @@ -1213,14 +1213,14 @@ ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) edit->scroll_start = 0; edit->show_cursor = TRUE; edit->button_down = FALSE; - + edit->tep = NULL; edit->has_selection = FALSE; - + edit->pointer_in = FALSE; edit->default_cursor_shown = TRUE; - + temp = e_cell_text_get_text(ect, ecell_view->e_table_model, model_col, row); edit->old_text = g_strdup (temp); e_cell_text_free_text(ect, temp); @@ -1235,7 +1235,7 @@ ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) } #endif ect_queue_redraw (text_view, view_col, row); - + return NULL; } @@ -1332,7 +1332,7 @@ get_font_size (PangoLayout *layout, PangoFontDescription *font, const char *text } static void -ect_print (ECellView *ecell_view, GtkPrintContext *context, +ect_print (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width, double height) { @@ -1342,7 +1342,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, PangoFontMetrics *font_metrics; ECellText *ect = E_CELL_TEXT(ecell_view->ecell); ECellTextView *ectView = (ECellTextView *)ecell_view; - GtkWidget *canvas = GTK_WIDGET(ectView->canvas); + GtkWidget *canvas = GTK_WIDGET(ectView->canvas); PangoDirection dir; gboolean strikeout, underline; cairo_t *cr; @@ -1357,19 +1357,19 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, layout = gtk_print_context_create_pango_layout (context); font_des = pango_font_description_from_string ("sans 12"); /* fix me font hardcoded */ pango_layout_set_font_description (layout, font_des); - + pango_layout_set_text (layout, string, -1); get_font_size (layout, font_des, string, &text_width, &text_height); - + cairo_move_to(cr, 2, 2); cairo_rectangle (cr, 2, 2, width + 2, height + 2); - cairo_clip(cr); + cairo_clip(cr); pango_context = gtk_widget_get_pango_context (canvas); font_metrics = pango_context_get_metrics (pango_context, canvas->style->font_desc, pango_context_get_language(pango_context)); - ty = (double)(text_height - - pango_font_metrics_get_ascent (font_metrics) + ty = (double)(text_height + - pango_font_metrics_get_ascent (font_metrics) - pango_font_metrics_get_descent (font_metrics)) / 2.0 /(double)PANGO_SCALE; strikeout = ect->strikeout_column >= 0 && row >= 0 && @@ -1378,7 +1378,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, e_table_model_value_at(ecell_view->e_table_model, ect->underline_column, row); dir = pango_find_base_dir (string, strlen(string)); - + if (underline) { ly = ty + (double)pango_font_metrics_get_underline_position (font_metrics)/(double)PANGO_SCALE; cairo_new_path (cr); @@ -1408,10 +1408,10 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, cairo_set_line_width (cr,(double)pango_font_metrics_get_strikethrough_thickness (font_metrics)/(double)PANGO_SCALE); cairo_stroke (cr); - } + } cairo_move_to(cr, 2, text_height- 5); - pango_layout_set_width (layout, (width - 4)*PANGO_SCALE); + pango_layout_set_width (layout, (width - 4)*PANGO_SCALE); pango_cairo_show_layout(cr, layout); cairo_restore (cr); @@ -1421,15 +1421,15 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -ect_print_height (ECellView *ecell_view, GtkPrintContext *context, +ect_print_height (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width) { - /* - * Font size is 16 by default. To leave some margin for cell - * text area, 2 for footer, 2 for header, actual print height + /* + * Font size is 16 by default. To leave some margin for cell + * text area, 2 for footer, 2 for header, actual print height * should be 16 + 4. - * Height of some special font is much higher than others, + * Height of some special font is much higher than others, * such as Arabic. So leave some more margin for cell. ` */ return 16 + 8; @@ -1457,7 +1457,7 @@ ect_max_width (ECellView *ecell_view, max_width = MAX (max_width, width); g_object_unref (layout); } - + return max_width + 8; } @@ -1478,7 +1478,7 @@ ect_max_width_by_row (ECellView *ecell_view, layout = generate_layout (text_view, model_col, view_col, row, 0); pango_layout_get_pixel_size (layout, &width, NULL); g_object_unref (layout); - + return width + 8; } @@ -1488,7 +1488,7 @@ tooltip_event (GtkWidget *window, ETableTooltip *tooltip) { gint ret_val = FALSE; - + switch (event->type) { case GDK_LEAVE_NOTIFY: e_canvas_hide_tooltip (E_CANVAS(GNOME_CANVAS_ITEM(tooltip->eti)->canvas)); @@ -1523,7 +1523,7 @@ tooltip_event (GtkWidget *window, } static void -ect_show_tooltip (ECellView *ecell_view, +ect_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, @@ -1775,7 +1775,7 @@ e_cell_text_class_init (ECellTextClass *klass) object_class->get_property = ect_get_property; object_class->set_property = ect_set_property; - signals [TEXT_INSERTED] = + signals [TEXT_INSERTED] = g_signal_new ("text_inserted", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_FIRST, @@ -1786,7 +1786,7 @@ e_cell_text_class_init (ECellTextClass *klass) G_TYPE_POINTER, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); - signals [TEXT_DELETED] = + signals [TEXT_DELETED] = g_signal_new ("text_deleted", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_FIRST, @@ -1852,7 +1852,7 @@ e_cell_text_class_init (ECellTextClass *klass) use_ellipsis_default = FALSE; } } - + gal_a11y_e_cell_registry_add_cell_type (NULL, E_CELL_TEXT_TYPE, gal_a11y_e_cell_text_new); } @@ -1883,12 +1883,12 @@ e_cell_text_get_cursor_locations (ECellTextView *tv, &x, &y, NULL, &area.height); gnome_canvas_item_get_bounds (GNOME_CANVAS_ITEM (parent_item), &x1, &y1, NULL, NULL); - + gnome_canvas_get_scroll_offsets (GNOME_CANVAS (GNOME_CANVAS_ITEM (parent_item)->canvas), &cx, &cy); index = edit->selection_end + edit->preedit_pos; - pango_layout_get_cursor_pos (edit->layout, + pango_layout_get_cursor_pos (edit->layout, index, strong_pos ? &pango_strong_pos : NULL, weak_pos ? &pango_weak_pos : NULL); @@ -1913,7 +1913,7 @@ update_im_cursor_location (ECellTextView *tv) { CellEdit *edit=tv->edit; GdkRectangle area; - + e_cell_text_get_cursor_locations (tv, &area, NULL); gtk_im_context_set_cursor_location (edit->im_context, &area); @@ -1926,7 +1926,7 @@ 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, + gtk_im_context_get_preedit_string (edit->im_context, &preedit_string, NULL, &cursor_pos); edit->preedit_length = strlen (preedit_string); @@ -1944,7 +1944,7 @@ e_cell_text_commit_cb (GtkIMContext *context, { CellEdit *edit = tv->edit; ETextEventProcessorCommand command; - + if (g_utf8_validate (str, strlen (str), NULL)) { command.action = E_TEP_INSERT; command.position = E_TEP_SELECTION; @@ -1966,7 +1966,7 @@ e_cell_text_retrieve_surrounding_cb (GtkIMContext *context, strlen (edit->text), MIN (edit->selection_start, edit->selection_end) ); - + return TRUE; } @@ -2056,7 +2056,7 @@ e_cell_text_construct (ECellText *cell, const char *fontname, GtkJustification j * rendered with strikeout, or bolded. In the case of the * "color_column" argument, the column in the model is expected to * have a string that can be parsed by gdk_color_parse(). - * + * * Returns: an ECell object that can be used to render strings. */ ECell * @@ -2107,7 +2107,7 @@ _blink_scroll_timeout (gpointer data) gboolean scroll = FALSE; gboolean redraw = FALSE; int width, height; - + g_timer_elapsed (edit->timer, ¤t_time); if (edit->scroll_start + SCROLL_WAIT_TIME > 1000000) { @@ -2198,9 +2198,9 @@ _get_position (ECellTextView *text_view, ETextEventProcessorCommand *command) int unival; int index; int trailing; - + switch (command->position) { - + case E_TEP_VALUE: return command->value; @@ -2321,7 +2321,7 @@ _get_position (ECellTextView *text_view, ETextEventProcessorCommand *command) return index; case E_TEP_FORWARD_PARAGRAPH: case E_TEP_BACKWARD_PARAGRAPH: - + case E_TEP_FORWARD_PAGE: case E_TEP_BACKWARD_PAGE: return edit->selection_end; @@ -2451,7 +2451,7 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * gboolean redraw = FALSE; int sel_start, sel_end; - + /* If the EText isn't editable, then ignore any commands that would modify the text. */ if (!ect->editable && (command->action == E_TEP_DELETE @@ -2589,9 +2589,9 @@ e_cell_text_view_supply_selection (CellEdit *edit, guint time, GdkAtom selection { #if DO_SELECTION GtkClipboard *clipboard; - + clipboard = gtk_widget_get_clipboard (GTK_WIDGET (edit->text_view->canvas), selection); - + if (selection == GDK_SELECTION_PRIMARY) { edit->has_selection = TRUE; } @@ -2700,7 +2700,7 @@ e_cell_text_get_color (ECellTextView *cell_view, gchar *color_spec) * If success, the [start, end) part of the text will be selected. * * This API is most likely to be used by a11y implementations. - * + * * Returns: whether the action is successful. */ gboolean @@ -2748,7 +2748,7 @@ e_cell_text_set_selection (ECellView *cell_view, * will return FALSE; * * This API is most likely to be used by a11y implementations. - * + * * Returns: whether the action is successful. */ gboolean @@ -2871,7 +2871,7 @@ e_cell_text_delete_selection (ECellView *cell_view, gint col, gint row) * @cell_view: the given cell view * @col: column of the given cell in the model * @row: row of the given cell in the model - * + * * Get the cell's text directly from CellEdit, * during editting this cell, the cell's text value maybe inconsistant * with the text got from table_model. @@ -2888,11 +2888,11 @@ e_cell_text_get_text_by_view (ECellView *cell_view, gint col, gint row) ectv = (ECellTextView *)cell_view; edit = ectv->edit; - + 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), + 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-text.h b/widgets/table/e-cell-text.h index 040c794829..93b958be0d 100644 --- a/widgets/table/e-cell-text.h +++ b/widgets/table/e-cell-text.h @@ -8,7 +8,7 @@ * Chris Lahey <clahey@ximian.com> * * A lot of code taken from: - * + * * Text item type for GnomeCanvas widget * * GnomeCanvas is basically a port of the Tk toolkit's most excellent @@ -63,7 +63,7 @@ typedef struct { guint use_ellipsis : 1; /* Whether to use the ellipsis. */ guint editable : 1; /* Whether the text can be edited. */ - + int strikeout_column; int underline_column; int bold_column; diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index 9ae6cb2b56..ce98cbeb89 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -89,7 +89,7 @@ etog_kill_view (ECellView *ecell_view) g_object_unref (toggle_view->pixmap_cache[i]); g_free (toggle_view->pixmap_cache); g_free (ecell_view); -} +} static void etog_realize (ECellView *ecell_view) @@ -134,7 +134,7 @@ check_cache (ECellToggleView *toggle_view, int image_seq, int cache_seq) gdk_pixmap_new (toggle_view->canvas->layout.bin_window, width, height, gtk_widget_get_visual (GTK_WIDGET (toggle_view->canvas))->depth); - + switch (cache_seq % 3) { case 0: color = GTK_WIDGET (toggle_view->canvas)->style->bg [GTK_STATE_SELECTED]; @@ -187,7 +187,7 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable, const int value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); - + if (value < 0 || value >= toggle->n_states){ g_warning ("Value from the table model is %d, the states we support are [0..%d)\n", value, toggle->n_states); @@ -261,7 +261,7 @@ etog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, return FALSE; #endif - switch (event->type){ + switch (event->type){ case GDK_KEY_PRESS: if (event->key.keyval != GDK_space) return FALSE; @@ -269,7 +269,7 @@ etog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, case GDK_BUTTON_PRESS: if (!e_table_model_is_cell_editable(ecell_view->e_table_model, model_col, row)) return FALSE; - + etog_set_value (toggle_view, model_col, view_col, row, value + 1); return TRUE; @@ -293,7 +293,7 @@ etog_height (ECellView *ecell_view, int model_col, int view_col, int row) * ECell::print method */ static void -etog_print (ECellView *ecell_view, GtkPrintContext *context, +etog_print (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width, double height) { @@ -303,7 +303,7 @@ etog_print (ECellView *ecell_view, GtkPrintContext *context, const int value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); - cairo_t *cr; + cairo_t *cr; if (value >= toggle->n_states){ g_warning ("Value from the table model is %d, the states we support are [0..%d)\n", value, toggle->n_states); @@ -313,13 +313,13 @@ etog_print (ECellView *ecell_view, GtkPrintContext *context, cr = gtk_print_context_get_cairo_context (context); cairo_save(cr); image = toggle->images[value]; - cairo_translate (cr, 0 , 0); + cairo_translate (cr, 0 , 0); image = gdk_pixbuf_add_alpha (image, TRUE, 255, 255, 255); image_width = (double)gdk_pixbuf_get_width (image); image_height = (double)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); @@ -327,7 +327,7 @@ etog_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -etog_print_height (ECellView *ecell_view, GtkPrintContext *context, +etog_print_height (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width) { @@ -377,7 +377,7 @@ etog_finalize (GObject *object) { ECellToggle *etog = E_CELL_TOGGLE (object); int i; - + for (i = 0; i < etog->n_states; i++) g_object_unref (etog->images [i]); @@ -435,7 +435,7 @@ e_cell_toggle_construct (ECellToggle *etog, int border, int n_states, GdkPixbuf { int max_height = 0; int i; - + etog->border = border; etog->n_states = n_states; @@ -459,10 +459,10 @@ e_cell_toggle_construct (ECellToggle *etog, int border, int n_states, GdkPixbuf * @images: a collection of @n_states images, one for each state. * * Creates a new ECell renderer that can be used to render toggle - * buttons with the images specified in @images. The value returned + * buttons with the images specified in @images. The value returned * by ETableModel::get_value is typecase into an integer and clamped * to the [0..n_states) range. That will select the image rendered. - * + * * Returns: an ECell object that can be used to render multi-state * toggle cells. */ diff --git a/widgets/table/e-cell-toggle.h b/widgets/table/e-cell-toggle.h index f2355410d4..3797248a5b 100644 --- a/widgets/table/e-cell-toggle.h +++ b/widgets/table/e-cell-toggle.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-toggle.h - Multi-state image toggle cell object. * Copyright 1999, 2000, Ximian, Inc. * diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c index d0c74e17a0..f56ee02bc5 100644 --- a/widgets/table/e-cell-tree.c +++ b/widgets/table/e-cell-tree.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-tree.c - Tree cell object. * Copyright 1999, 2000, 2001, Ximian, Inc. * @@ -128,13 +128,13 @@ ect_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) ECellTree *ect = E_CELL_TREE (ecell); ECellTreeView *tree_view = g_new0 (ECellTreeView, 1); GnomeCanvas *canvas = GNOME_CANVAS_ITEM (e_table_item_view)->canvas; - + tree_view->cell_view.ecell = ecell; tree_view->cell_view.e_table_model = table_model; tree_view->cell_view.e_table_item_view = e_table_item_view; tree_view->cell_view.kill_view_cb = NULL; tree_view->cell_view.kill_view_cb_data = NULL; - + /* create our subcell view */ tree_view->subcell_view = e_cell_new_view (ect->subcell, table_model, e_table_item_view /* XXX */); @@ -176,7 +176,7 @@ ect_realize (ECellView *ecell_view) tree_view->gc = gdk_gc_new (GTK_WIDGET (tree_view->canvas)->window); - gdk_gc_set_line_attributes (tree_view->gc, 1, + gdk_gc_set_line_attributes (tree_view->gc, 1, GDK_LINE_ON_OFF_DASH, GDK_CAP_NOT_LAST, GDK_JOIN_MITER); @@ -220,7 +220,7 @@ draw_retro_expander (ECellTreeView *ectv, GdkDrawable *drawable, gboolean expand NULL, image, rect->x, rect->y, - rect->width - image_width / 2, + rect->width - image_width / 2, rect->height - image_height / 2, image_width, image_height, GDK_RGB_DITHER_NORMAL, @@ -290,7 +290,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, rect.y = y1; rect.width = subcell_offset + node_image_width; rect.height = y2 - y1; - + gdk_gc_set_clip_rectangle (tree_view->gc, &rect); gdk_gc_set_clip_rectangle (fg_gc, &rect); clip_rect = ▭ @@ -427,7 +427,7 @@ event_in_expander (GdkEvent *event, gint offset, gint height) * ECell::height method */ static int -ect_height (ECellView *ecell_view, int model_col, int view_col, int row) +ect_height (ECellView *ecell_view, int model_col, int view_col, int row) { ECellTreeView *tree_view = (ECellTreeView *) ecell_view; @@ -489,7 +489,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, GdkRectangle area; animate_closure_t *closure = g_new0 (animate_closure_t, 1); int 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); area.width = offset - 2; @@ -497,7 +497,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, if (hgt != area.height) /* Composite cells */ area.height += hgt; - + draw_expander (tree_view, GTK_LAYOUT (tree_view->canvas)->bin_window, expanded ? GTK_EXPANDER_SEMI_EXPANDED : GTK_EXPANDER_SEMI_COLLAPSED, GTK_STATE_NORMAL, &area); @@ -581,21 +581,21 @@ ect_max_width (ECellView *ecell_view, int model_col, int view_col) if (!per_row) subcell_max_width = e_cell_max_width (tree_view->subcell_view, model_col, view_col); - + for (row = 0; row < number_of_rows; row++) { ETreeModel *tree_model = e_cell_tree_get_tree_model(ecell_view->e_table_model, row); ETreePath node; GdkPixbuf *node_image; int node_image_width = 0; - + int offset, subcell_offset; #if 0 gboolean expanded, expandable; ETreeTableAdapter *tree_table_adapter = e_cell_tree_get_tree_table_adapter(ecell_view->e_table_model, row); #endif - + node = e_cell_tree_get_node (ecell_view->e_table_model, row); - + offset = offset_of_node (ecell_view->e_table_model, row); subcell_offset = offset; @@ -623,7 +623,7 @@ ect_max_width (ECellView *ecell_view, int model_col, int view_col) if (expandable) { GdkPixbuf *image; - image = (expanded + image = (expanded ? E_CELL_TREE(tree_view->cell_view.ecell)->open_pixbuf : E_CELL_TREE(tree_view->cell_view.ecell)->closed_pixbuf); @@ -643,7 +643,7 @@ ect_max_width (ECellView *ecell_view, int model_col, int view_col) static void ect_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, int col_width, ETableTooltip *tooltip) -{ +{ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row); ETreePath node = e_cell_tree_get_node (ecell_view->e_table_model, row); @@ -663,12 +663,12 @@ ect_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, */ static char * ect_get_bg_color (ECellView *ecell_view, int row) -{ +{ ECellTreeView *tree_view = (ECellTreeView *) ecell_view; return e_cell_get_bg_color (tree_view->subcell_view, row); } - + /* * ECellView::enter_edit method */ @@ -694,7 +694,7 @@ ect_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, voi } static void -ect_print (ECellView *ecell_view, GtkPrintContext *context, +ect_print (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width, double height) { @@ -789,7 +789,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context, } static gdouble -ect_print_height (ECellView *ecell_view, GtkPrintContext *context, +ect_print_height (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width) { @@ -859,10 +859,10 @@ e_cell_tree_init (ECellTree *ect) * @closed_pixbuf: pixbuf to be used instead of the '+' icon. * @draw_lines: whether or not to draw the lines between parents/children/siblings. * @subcell: the ECell to render to the right of the tree effects. - * + * * Constructs an ECellTree. used by subclasses that need to * initialize a nested ECellTree. See e_cell_tree_new() for more info. - * + * **/ void e_cell_tree_construct (ECellTree *ect, @@ -870,7 +870,7 @@ e_cell_tree_construct (ECellTree *ect, GdkPixbuf *closed_pixbuf, gboolean draw_lines, ECell *subcell) -{ +{ ect->subcell = subcell; if (subcell) g_object_ref_sink (subcell); @@ -893,14 +893,14 @@ e_cell_tree_construct (ECellTree *ect, * @closed_pixbuf: pixbuf to be used instead of the '+' icon. * @draw_lines: whether or not to draw the lines between parents/children/siblings. * @subcell: the ECell to render to the right of the tree effects. - * + * * Creates a new ECell renderer that can be used to render tree * effects that come from an ETreeModel. Various assumptions are made * as to the fact that the ETableModel the ETable this cell is * associated with is in fact an ETreeModel. The cell uses special * columns to get at structural information (needed to draw the * lines/icons. - * + * * Return value: an ECell object that can be used to render trees. **/ ECell * diff --git a/widgets/table/e-cell-tree.h b/widgets/table/e-cell-tree.h index 8c59920c27..3b03990024 100644 --- a/widgets/table/e-cell-tree.h +++ b/widgets/table/e-cell-tree.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-tree.h - Tree cell object. * Copyright 1999, 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-cell-vbox.c b/widgets/table/e-cell-vbox.c index ff060b9a86..e9033b4f23 100644 --- a/widgets/table/e-cell-vbox.c +++ b/widgets/table/e-cell-vbox.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-vbox.c - Vbox cell object. * Copyright 1999, 2000, 2001, Ximian, Inc. * @@ -55,13 +55,13 @@ ecv_new_view (ECell *ecell, ETableModel *table_model, void *e_table_item_view) ECellVbox *ecv = E_CELL_VBOX (ecell); ECellVboxView *vbox_view = g_new0 (ECellVboxView, 1); int i; - + vbox_view->cell_view.ecell = ecell; vbox_view->cell_view.e_table_model = table_model; vbox_view->cell_view.e_table_item_view = e_table_item_view; vbox_view->cell_view.kill_view_cb = NULL; vbox_view->cell_view.kill_view_cb_data = NULL; - + /* create our subcell view */ vbox_view->subcell_view_count = ecv->subcell_count; vbox_view->subcell_views = g_new (ECellView *, vbox_view->subcell_view_count); @@ -198,7 +198,7 @@ ecv_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, * ECell::height method */ static int -ecv_height (ECellView *ecell_view, int model_col, int view_col, int row) +ecv_height (ECellView *ecell_view, int model_col, int view_col, int row) { ECellVboxView *vbox_view = (ECellVboxView *)ecell_view; int height = 0; @@ -235,7 +235,7 @@ ecv_max_width (ECellView *ecell_view, int model_col, int view_col) static void ecv_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, int col_width, ETableTooltip *tooltip) -{ +{ ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; EVboxModel *vbox_model = e_cell_vbox_get_vbox_model (ecell_view->e_table_model, row); EVboxPath node = e_cell_vbox_get_node (ecell_view->e_table_model, row); @@ -255,12 +255,12 @@ ecv_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, */ static char * ecv_get_bg_color (ECellView *ecell_view, int row) -{ +{ ECellVboxView *vbox_view = (ECellVboxView *) ecell_view; return e_cell_get_bg_color (vbox_view->subcell_views[0], row); } - + /* * ECellView::enter_edit method */ @@ -286,7 +286,7 @@ ecv_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, voi } static void -ecv_print (ECellView *ecell_view, GnomePrintContext *context, +ecv_print (ECellView *ecell_view, GnomePrintContext *context, int model_col, int view_col, int row, double width, double height) { @@ -351,7 +351,7 @@ ecv_print (ECellView *ecell_view, GnomePrintContext *context, /* now draw our icon if we're expandable */ if (expandable) { double image_matrix [6] = {16, 0, 0, 16, 0, 0}; - GdkPixbuf *image = (expanded + GdkPixbuf *image = (expanded ? E_CELL_VBOX(vbox_view->cell_view.ecell)->open_pixbuf : E_CELL_VBOX(vbox_view->cell_view.ecell)->closed_pixbuf); int image_width, image_height, image_rowstride; @@ -384,7 +384,7 @@ ecv_print (ECellView *ecell_view, GnomePrintContext *context, } static gdouble -ecv_print_height (ECellView *ecell_view, GnomePrintContext *context, +ecv_print_height (ECellView *ecell_view, GnomePrintContext *context, int model_col, int view_col, int row, double width) { @@ -463,10 +463,10 @@ e_cell_vbox_init (ECellVbox *ecv) /** * e_cell_vbox_new: - * + * * Creates a new ECell renderer that can be used to render multiple * child cells. - * + * * Return value: an ECell object that can be used to render multiple * child cells. **/ diff --git a/widgets/table/e-cell-vbox.h b/widgets/table/e-cell-vbox.h index 5d57122402..e80f23cba6 100644 --- a/widgets/table/e-cell-vbox.h +++ b/widgets/table/e-cell-vbox.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell-vbox.h - Vbox cell object. * Copyright 1999 - 2002, Ximian, Inc. * diff --git a/widgets/table/e-cell.c b/widgets/table/e-cell.c index 69d787f8eb..6d04c756ec 100644 --- a/widgets/table/e-cell.c +++ b/widgets/table/e-cell.c @@ -78,7 +78,7 @@ ec_height (ECellView *ecell_view, int model_col, int view_col, int row) static void ec_focus (ECellView *ecell_view, int model_col, int view_col, int row, int x1, int y1, int x2, int y2) { - ecell_view->focus_col = view_col; + ecell_view->focus_col = view_col; ecell_view->focus_row = row; ecell_view->focus_x1 = x1; ecell_view->focus_y1 = y1; @@ -180,7 +180,7 @@ e_cell_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_co ecell_view, event, model_col, view_col, row, flags, actions); } -/** +/** * e_cell_new_view: * @ecell: the Ecell that will create the new view * @table_model: the table model the ecell is bound to @@ -280,13 +280,13 @@ e_cell_draw (ECellView *ecell_view, GdkDrawable *drawable, * @model_col: the column in the model being drawn. * @view_col: the column in the view being drawn (what the model maps to). * @row: the row being drawn - * @width: width + * @width: width * @height: height * * FIXME: */ void -e_cell_print (ECellView *ecell_view, GtkPrintContext *context, +e_cell_print (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width, double height) { @@ -300,7 +300,7 @@ e_cell_print (ECellView *ecell_view, GtkPrintContext *context, * FIXME: */ gdouble -e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, +e_cell_print_height (ECellView *ecell_view, GtkPrintContext *context, int model_col, int view_col, int row, double width) { @@ -431,7 +431,7 @@ e_cell_free_state (ECellView *ecell_view, int model_col, int view_col, int row, int e_cell_max_width (ECellView *ecell_view, int model_col, int view_col) { - return ECVIEW_EC_CLASS(ecell_view)->max_width + return ECVIEW_EC_CLASS(ecell_view)->max_width (ecell_view, model_col, view_col); } @@ -470,9 +470,9 @@ e_cell_max_width_by_row_implemented (ECellView *ecell_view) { return (ECVIEW_EC_CLASS(ecell_view)->max_width_by_row != NULL); } - + void -e_cell_show_tooltip (ECellView *ecell_view, int model_col, int view_col, +e_cell_show_tooltip (ECellView *ecell_view, int model_col, int view_col, int row, int col_width, ETableTooltip *tooltip) { ECVIEW_EC_CLASS(ecell_view)->show_tooltip @@ -494,4 +494,4 @@ e_cell_style_set(ECellView *ecell_view, GtkStyle *previous_style) if (ECVIEW_EC_CLASS(ecell_view)->style_set) ECVIEW_EC_CLASS(ecell_view)->style_set (ecell_view, previous_style); } - + diff --git a/widgets/table/e-cell.h b/widgets/table/e-cell.h index 338695cb9e..b92e493e19 100644 --- a/widgets/table/e-cell.h +++ b/widgets/table/e-cell.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-cell.h * Copyright 1999, 2000, 2001, Ximian, Inc. * @@ -76,7 +76,7 @@ typedef struct _ECellView { ECell *ecell; ETableModel *e_table_model; void *e_table_item_view; - + gint focus_x1, focus_y1, focus_x2, focus_y2; gint focus_col, focus_row; @@ -88,7 +88,7 @@ typedef struct _ECellView { typedef struct { GtkObjectClass parent_class; - + ECellView *(*new_view) (ECell *ecell, ETableModel *table_model, void *e_table_item_view); void (*kill_view) (ECellView *ecell_view); diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index 572d79acc1..663d6f3a67 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -81,7 +81,7 @@ etcta_style_set (ETableClickToAdd *etcta, GtkStyle *previous_style) if (etcta->rect) { gnome_canvas_item_set (etcta->rect, - "outline_color_gdk", &widget->style->fg[GTK_STATE_NORMAL], + "outline_color_gdk", &widget->style->fg[GTK_STATE_NORMAL], "fill_color_gdk", &widget->style->bg[GTK_STATE_NORMAL], NULL ); @@ -248,7 +248,7 @@ create_rect_and_text (ETableClickToAdd *etcta) "y1", (double) 0, "x2", (double) etcta->width - 1, "y2", (double) etcta->height - 1, - "outline_color_gdk", &widget->style->fg[GTK_STATE_NORMAL], + "outline_color_gdk", &widget->style->fg[GTK_STATE_NORMAL], "fill_color_gdk", &widget->style->bg[GTK_STATE_NORMAL], NULL); @@ -332,8 +332,8 @@ item_key_press (ETableItem *item, int row, int col, GdkEvent *event, ETableClick 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), + e_selection_model_do_something (E_SELECTION_MODEL(etcta->selection), + 0, e_table_header_prioritized_column (etcta->eth), 0); } @@ -401,7 +401,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) one = e_table_one_new(etcta->model); etcta_add_one (etcta, one); g_object_unref (one); - + e_selection_model_clear(E_SELECTION_MODEL(etcta->selection)); etcta->row = gnome_canvas_item_new(GNOME_CANVAS_GROUP(item), @@ -445,7 +445,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) break; } break; - + default: return FALSE; } @@ -456,7 +456,7 @@ static void etcta_reflow (GnomeCanvasItem *item, int flags) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); - + double old_height = etcta->height; if (etcta->text) { @@ -498,35 +498,35 @@ etcta_class_init (ETableClickToAddClass *klass) item_class->unrealize = etcta_unrealize; item_class->event = etcta_event; - g_object_class_install_property (object_class, PROP_HEADER, + g_object_class_install_property (object_class, PROP_HEADER, g_param_spec_object ("header", _("Header"), /*_( */"XXX blurb" /*)*/, E_TABLE_HEADER_TYPE, G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_MODEL, + g_object_class_install_property (object_class, PROP_MODEL, g_param_spec_object ("model", _("Model"), /*_( */"XXX blurb" /*)*/, E_TABLE_MODEL_TYPE, G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_MESSAGE, + g_object_class_install_property (object_class, PROP_MESSAGE, g_param_spec_string ("message", _("Message"), /*_( */"XXX blurb" /*)*/, NULL, G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_WIDTH, + g_object_class_install_property (object_class, PROP_WIDTH, g_param_spec_double ("width", _("Width"), /*_( */"XXX blurb" /*)*/, 0.0, G_MAXDOUBLE, 0.0, G_PARAM_READWRITE | G_PARAM_LAX_VALIDATION)); - g_object_class_install_property (object_class, PROP_HEIGHT, + g_object_class_install_property (object_class, PROP_HEIGHT, g_param_spec_double ("height", _("Height"), /*_( */"XXX blurb" /*)*/, @@ -586,7 +586,7 @@ etcta_init (ETableClickToAdd *etcta) /** * e_table_click_to_add_commit: * @etcta: The %ETableClickToAdd to commit. - * + * * This routine commits the current thing being edited and returns to * just displaying the click to add message. **/ diff --git a/widgets/table/e-table-click-to-add.h b/widgets/table/e-table-click-to-add.h index 3ef30e2587..d05bddbda2 100644 --- a/widgets/table/e-table-click-to-add.h +++ b/widgets/table/e-table-click-to-add.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-click-to-add.h * Copyright 2000, 2001, Ximian, Inc. * @@ -52,7 +52,7 @@ typedef struct { GnomeCanvasItem *row; /* If row is NULL, we're sitting with no data and a "Click here" message. */ GnomeCanvasItem *text; /* If text is NULL, row shouldn't be. */ GnomeCanvasItem *rect; /* What the heck. Why not. */ - + gdouble width; gdouble height; diff --git a/widgets/table/e-table-col-dnd.h b/widgets/table/e-table-col-dnd.h index d47c97d3d9..50c3caa9ac 100644 --- a/widgets/table/e-table-col-dnd.h +++ b/widgets/table/e-table-col-dnd.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-col-dnd.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c index b53bc299e0..224334ad77 100644 --- a/widgets/table/e-table-col.c +++ b/widgets/table/e-table-col.c @@ -51,7 +51,7 @@ etc_dispose (GObject *object) if (etc->text) g_free (etc->text); etc->text = NULL; - + if (G_OBJECT_CLASS (e_table_col_parent_class)->dispose) G_OBJECT_CLASS (e_table_col_parent_class)->dispose (object); } @@ -84,11 +84,11 @@ etc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp break; } } - + static void e_table_col_class_init (ETableColClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->dispose = etc_dispose; object_class->set_property = etc_set_property; @@ -97,9 +97,9 @@ e_table_col_class_init (ETableColClass *klass) g_object_class_install_property (object_class, PROP_COMPARE_COL, g_param_spec_int ("compare_col", _( "Width" ), - "Width", + "Width", 0, G_MAXINT, 0, - G_PARAM_READWRITE)); + G_PARAM_READWRITE)); } static void @@ -112,7 +112,7 @@ e_table_col_init (ETableCol *etc) etc->priority = 0; } -/** +/** * e_table_col_new: * @col_idx: the column we represent in the model * @text: a title for this column @@ -126,7 +126,7 @@ e_table_col_init (ETableCol *etc) * The ETableCol represents a column to be used inside an ETable. The * ETableCol objects are inserted inside an ETableHeader (which is just a collection * of ETableCols). The ETableHeader is the definition of the order in which - * columns are shown to the user. + * columns are shown to the user. * * The @text argument is the the text that will be shown as a header to the * user. @col_idx reflects where the data for this ETableCol object will @@ -135,7 +135,7 @@ e_table_col_init (ETableCol *etc) * column will always point to the same column inside the ETableModel. * * The @ecell argument is an ECell object that needs to know how to render the - * data in the ETableModel for this specific row. + * data in the ETableModel for this specific row. * * Returns: the newly created ETableCol object. */ @@ -144,7 +144,7 @@ e_table_col_new (int col_idx, const char *text, double expansion, int min_width, ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, int priority) { ETableCol *etc; - + g_return_val_if_fail (expansion >= 0, NULL); g_return_val_if_fail (min_width >= 0, NULL); g_return_val_if_fail (ecell != NULL, NULL); @@ -152,7 +152,7 @@ e_table_col_new (int col_idx, const char *text, double expansion, int min_width, g_return_val_if_fail (text != NULL, NULL); etc = g_object_new (E_TABLE_COL_TYPE, NULL); - + etc->is_pixbuf = FALSE; etc->col_idx = col_idx; @@ -174,7 +174,7 @@ e_table_col_new (int col_idx, const char *text, double expansion, int min_width, return etc; } -/** +/** * e_table_col_new_with_pixbuf: * @col_idx: the column we represent in the model * @pixbuf: the image to be used for the header @@ -187,7 +187,7 @@ e_table_col_new (int col_idx, const char *text, double expansion, int min_width, * The ETableCol represents a column to be used inside an ETable. The * ETableCol objects are inserted inside an ETableHeader (which is just a collection * of ETableCols). The ETableHeader is the definition of the order in which - * columns are shown to the user. + * columns are shown to the user. * * The @text argument is the the text that will be shown as a header to the * user. @col_idx reflects where the data for this ETableCol object will @@ -196,7 +196,7 @@ e_table_col_new (int col_idx, const char *text, double expansion, int min_width, * column will always point to the same column inside the ETableModel. * * The @ecell argument is an ECell object that needs to know how to render the - * data in the ETableModel for this specific row. + * data in the ETableModel for this specific row. * * Returns: the newly created ETableCol object. */ @@ -205,7 +205,7 @@ e_table_col_new_with_pixbuf (int col_idx, const char *text, GdkPixbuf *pixbuf, d ECell *ecell, GCompareFunc compare, gboolean resizable, gboolean disabled, int priority) { ETableCol *etc; - + g_return_val_if_fail (expansion >= 0, NULL); g_return_val_if_fail (min_width >= 0, NULL); g_return_val_if_fail (ecell != NULL, NULL); diff --git a/widgets/table/e-table-col.h b/widgets/table/e-table-col.h index f41713a973..3dae732469 100644 --- a/widgets/table/e-table-col.h +++ b/widgets/table/e-table-col.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-col.h * Copyright 1999, 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-column-specification.c b/widgets/table/e-table-column-specification.c index 85497e51dd..8371176738 100644 --- a/widgets/table/e-table-column-specification.c +++ b/widgets/table/e-table-column-specification.c @@ -77,12 +77,12 @@ etcs_init (ETableColumnSpecification *specification) specification->compare_col = 0; specification->title = g_strdup(""); specification->pixbuf = NULL; - + specification->expansion = 0; specification->minimum_width = 0; specification->resizable = FALSE; specification->disabled = FALSE; - + specification->cell = NULL; specification->compare = NULL; specification->search = NULL; diff --git a/widgets/table/e-table-column-specification.h b/widgets/table/e-table-column-specification.h index 9fc0db5737..54cd683d3d 100644 --- a/widgets/table/e-table-column-specification.h +++ b/widgets/table/e-table-column-specification.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-column-specification.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-column.c b/widgets/table/e-table-column.c index 653f33beff..b4a2bc5126 100644 --- a/widgets/table/e-table-column.c +++ b/widgets/table/e-table-column.c @@ -54,7 +54,7 @@ e_table_column_finalize (GObject *object) */ for (i = 0; i < cols; i++) e_table_column_remove (etc, i); - + G_OBJECT_CLASS (e_table_column_parent_class)->finalize (object); } @@ -73,8 +73,8 @@ e_table_column_class_init (GtkObjectClass *object_class) NULL, NULL, e_util_marshal_NONE__NONE, G_TYPE_NONE, 0); - etc_signals [DIMENSION_CHANGE] = - g_signal_new ("dimension_change", + etc_signals [DIMENSION_CHANGE] = + g_signal_new ("dimension_change", G_OBJECT_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ETableColumn, dimension_change), @@ -94,7 +94,7 @@ void e_table_column_add_column (ETableColumn *etc, ETableCol *tc, int pos) { ETableCol **new_ptr; - + g_return_if_fail (etc != NULL); g_return_if_fail (E_IS_TABLE_COLUMN (etc)); g_return_if_fail (tc != NULL); @@ -137,14 +137,14 @@ int e_table_column_index (ETableColumn *etc, const char *identifier) { int i; - + g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); g_return_val_if_fail (identifier != NULL, 0); for (i = 0; i < etc->col_count; i++){ ETableCol *tc = etc->columns [i]; - + if (strcmp (i->id, identifier) == 0) return i; } @@ -156,7 +156,7 @@ int e_table_column_get_index_at (ETableColumn *etc, int x_offset) { int i, total; - + g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); g_return_val_if_fail (identifier != NULL, 0); @@ -177,7 +177,7 @@ e_table_column_get_columns (ETableColumn *etc) { ETableCol **ret; int i; - + g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); @@ -202,7 +202,7 @@ ve_table_column_get_selected (ETableColumn *etc) { int i; int selected = 0; - + g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); @@ -218,7 +218,7 @@ int e_table_column_total_width (ETableColumn *etc) { int total; - + g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); diff --git a/widgets/table/e-table-config-field.h b/widgets/table/e-table-config-field.h index 5439a67f18..9ad8f76b6e 100644 --- a/widgets/table/e-table-config-field.h +++ b/widgets/table/e-table-config-field.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-config-field.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 9bada0a0cf..796f2e4a59 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -131,8 +131,8 @@ config_get_property (GObject *object, static void e_table_config_class_init (ETableConfigClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - + GObjectClass *object_class = G_OBJECT_CLASS (klass); + klass->changed = NULL; object_class->finalize = config_finalize; @@ -279,11 +279,11 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) config->temp_state->sort_info); widgets = &config->group [0]; } - + for (i = 0; i < 4; i++){ gboolean sensitive = (i <= count); char *text = ""; - + gtk_widget_set_sensitive (widgets [i].frames, sensitive); /* @@ -295,7 +295,7 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) g_signal_handler_block ( widgets [i].combo, widgets [i].changed_id); - + if (i < count){ GtkToggleButton *a, *d; ETableSortColumn col = @@ -306,7 +306,7 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) : e_table_sort_info_grouping_get_nth ( config->temp_state->sort_info, i); - + ETableColumnSpecification *column = find_column_in_spec (config->source_spec, col.column); @@ -329,11 +329,11 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) widgets [i].radio_ascending); d = GTK_TOGGLE_BUTTON ( widgets [i].radio_descending); - + gtk_toggle_button_set_active (col.ascending ? a:d, 1); } else { GtkToggleButton *t; - + t = GTK_TOGGLE_BUTTON ( widgets [i].radio_ascending); @@ -370,13 +370,13 @@ config_sort_info_update (ETableConfig *config) for (i = 0; i < count; i++) { ETableSortColumn col = e_table_sort_info_sorting_get_nth (info, i); ETableColumnSpecification *column; - + column = find_column_in_spec (config->source_spec, col.column); if (!column){ g_warning ("Could not find column model in specification"); continue; } - + g_string_append (res, dgettext (config->domain, (column)->title)); g_string_append_c (res, ' '); g_string_append ( @@ -387,10 +387,10 @@ config_sort_info_update (ETableConfig *config) if ((i + 1) != count) g_string_append (res, ", "); } - + if (res->str [0] == 0) g_string_append (res, _("Not sorted")); - + gtk_label_set_text (GTK_LABEL(config->sort_label), res->str); g_string_free (res, TRUE); @@ -484,7 +484,7 @@ config_fields_info_update (ETableConfig *config) break; } } - + gtk_label_set_text (GTK_LABEL (config->fields_label), res->str); g_string_free (res, TRUE); } @@ -503,13 +503,13 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) is_sort ? config->sort [0].combo : config->group [0].combo)); - + if (is_sort) dialog = GTK_DIALOG (config->dialog_sort); else dialog = GTK_DIALOG (config->dialog_group_by); - + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (config->dialog_toplevel)); do { @@ -541,10 +541,10 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) running = 0; break; } - + } while (running); gtk_widget_hide (GTK_WIDGET (dialog)); - + if (is_sort) config_sort_info_update (config); else @@ -585,7 +585,7 @@ do_fields_config_dialog (ETableConfig *config) running = 0; break; } - + } while (running); gtk_widget_hide (GTK_WIDGET (config->dialog_show_fields)); @@ -619,51 +619,51 @@ create_global_store (ETableConfig *config) } } -static char *spec = "<ETableSpecification gettext-domain=\"" GETTEXT_PACKAGE "\" no-headers=\"true\" cursor-mode=\"line\" " -" draw-grid=\"false\" draw-focus=\"true\" selection-mode=\"browse\">" -"<ETableColumn model_col= \"0\" _title=\"Name\" minimum_width=\"30\" resizable=\"true\" cell=\"string\" compare=\"string\"/>" -"<ETableState> <column source=\"0\"/>" -"<grouping/>" -"</ETableState>" -"</ETableSpecification>"; - -GtkWidget *e_table_proxy_etable_shown_new (void); - -GtkWidget * -e_table_proxy_etable_shown_new (void) -{ - ETableModel *model = NULL; - GtkWidget *widget; - ETableScrolled *ets; - - model = e_table_subset_variable_new (global_store); - - widget = e_table_scrolled_new (model, NULL, spec, NULL); - ets = E_TABLE_SCROLLED (widget); - atk_object_set_name (gtk_widget_get_accessible ((GtkWidget *)ets->table), _("Show Fields")); - - return widget; -} - -GtkWidget *e_table_proxy_etable_available_new (void); - -GtkWidget * -e_table_proxy_etable_available_new (void) -{ - ETableModel *model; - GtkWidget *widget; - ETableScrolled *ets; - - model = e_table_without_new (global_store, - NULL, NULL, NULL, NULL, NULL, NULL, NULL); - - e_table_without_show_all (E_TABLE_WITHOUT (model)); - - widget = e_table_scrolled_new (model, NULL, spec, NULL); - ets = E_TABLE_SCROLLED (widget); - atk_object_set_name (gtk_widget_get_accessible ((GtkWidget *)ets->table), _("Available Fields")); - - return widget; +static char *spec = "<ETableSpecification gettext-domain=\"" GETTEXT_PACKAGE "\" no-headers=\"true\" cursor-mode=\"line\" " +" draw-grid=\"false\" draw-focus=\"true\" selection-mode=\"browse\">" +"<ETableColumn model_col= \"0\" _title=\"Name\" minimum_width=\"30\" resizable=\"true\" cell=\"string\" compare=\"string\"/>" +"<ETableState> <column source=\"0\"/>" +"<grouping/>" +"</ETableState>" +"</ETableSpecification>"; + +GtkWidget *e_table_proxy_etable_shown_new (void); + +GtkWidget * +e_table_proxy_etable_shown_new (void) +{ + ETableModel *model = NULL; + GtkWidget *widget; + ETableScrolled *ets; + + model = e_table_subset_variable_new (global_store); + + widget = e_table_scrolled_new (model, NULL, spec, NULL); + ets = E_TABLE_SCROLLED (widget); + atk_object_set_name (gtk_widget_get_accessible ((GtkWidget *)ets->table), _("Show Fields")); + + return widget; +} + +GtkWidget *e_table_proxy_etable_available_new (void); + +GtkWidget * +e_table_proxy_etable_available_new (void) +{ + ETableModel *model; + GtkWidget *widget; + ETableScrolled *ets; + + model = e_table_without_new (global_store, + NULL, NULL, NULL, NULL, NULL, NULL, NULL); + + e_table_without_show_all (E_TABLE_WITHOUT (model)); + + widget = e_table_scrolled_new (model, NULL, spec, NULL); + ets = E_TABLE_SCROLLED (widget); + atk_object_set_name (gtk_widget_get_accessible ((GtkWidget *)ets->table), _("Available Fields")); + + return widget; } static void @@ -703,7 +703,7 @@ dialog_response (GtkWidget *dialog, int response_id, ETableConfig *config) || response_id == GTK_RESPONSE_OK) { gtk_widget_destroy (dialog); } -} +} /* * Invoked by the Glade auto-connect code @@ -743,7 +743,7 @@ static GtkWidget * configure_dialog (GladeXML *gui, const char *widget_name, ETableConfig *config) { GtkWidget *w; - + w = glade_xml_get_widget (gui, widget_name); return w; @@ -768,7 +768,7 @@ get_source_model_col_index (ETableConfig *config, gint idx) ETableModel *src_model = E_TABLE_SUBSET (config->available_model)->source; visible_index = e_table_subset_view_to_model_row (E_TABLE_SUBSET (config->available_model), idx); - + return GPOINTER_TO_INT (e_table_model_value_at (src_model, 1, visible_index)); } @@ -786,7 +786,7 @@ sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) if (s != NULL) { ETableSortColumn c; int col; - + col = find_model_column_by_name (config->source_spec, s); if (col == -1){ g_warning ("sort: This should not happen (%s)", s); @@ -798,7 +798,7 @@ sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) config->sort [idx].radio_ascending)->active; c.column = col; e_table_sort_info_sorting_set_nth (sort_info, idx, c); - + update_sort_and_group_config_dialog (config, TRUE); } else { e_table_sort_info_sorting_truncate (sort_info, idx); @@ -816,7 +816,7 @@ sort_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *sort) ETableConfigSortWidgets *base = &config->sort[0]; int idx = sort - base; ETableSortColumn c; - + c = e_table_sort_info_sorting_get_nth (si, idx); c.ascending = t->active; e_table_sort_info_sorting_set_nth (si, idx, c); @@ -827,7 +827,7 @@ configure_sort_dialog (ETableConfig *config, GladeXML *gui) { GSList *l; int i; - + for (i = 0; i < 4; i++){ char buffer [80]; @@ -838,7 +838,7 @@ configure_sort_dialog (ETableConfig *config, GladeXML *gui) GTK_COMBO_BOX (config->sort[i].combo), "", ""); snprintf (buffer, sizeof (buffer), "frame-sort-%d", i + 1); - config->sort [i].frames = + config->sort [i].frames = glade_xml_get_widget (gui, buffer); snprintf ( @@ -896,7 +896,7 @@ group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) if (s != NULL) { ETableSortColumn c; int col; - + col = find_model_column_by_name (config->source_spec, s); if (col == -1){ g_warning ("grouping: this should not happen, %s", s); @@ -908,7 +908,7 @@ group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) config->group [idx].radio_ascending)->active; c.column = col; e_table_sort_info_grouping_set_nth (sort_info, idx, c); - + update_sort_and_group_config_dialog (config, FALSE); } else { e_table_sort_info_grouping_truncate (sort_info, idx); @@ -926,7 +926,7 @@ group_ascending_toggled (GtkToggleButton *t, ETableConfigSortWidgets *group) ETableConfigSortWidgets *base = &config->group[0]; int idx = group - base; ETableSortColumn c; - + c = e_table_sort_info_grouping_get_nth (si, idx); c.ascending = t->active; e_table_sort_info_grouping_set_nth (si, idx, c); @@ -937,7 +937,7 @@ configure_group_dialog (ETableConfig *config, GladeXML *gui) { GSList *l; int i; - + for (i = 0; i < 4; i++){ char buffer [80]; @@ -949,7 +949,7 @@ configure_group_dialog (ETableConfig *config, GladeXML *gui) GTK_COMBO_BOX (config->group[i].combo), "", ""); snprintf (buffer, sizeof (buffer), "frame-group-%d", i + 1); - config->group [i].frames = + config->group [i].frames = glade_xml_get_widget (gui, buffer); snprintf ( @@ -969,11 +969,11 @@ configure_group_dialog (ETableConfig *config, GladeXML *gui) "checkbutton-group-%d", i+1); config->group [i].view_check = glade_xml_get_widget ( gui, buffer); - + config->group [i].e_table_config = config; } - + for (l = config->column_names; l; l = l->next){ char *label = l->data; @@ -1211,7 +1211,7 @@ setup_gui (ETableConfig *config) g_free (filename); g_object_unref (global_store); - + config->dialog_toplevel = glade_xml_get_widget ( gui, "e-table-config"); @@ -1284,7 +1284,7 @@ e_table_config_construct (ETableConfig *config, g_return_val_if_fail (header != NULL, NULL); g_return_val_if_fail (spec != NULL, NULL); g_return_val_if_fail (state != NULL, NULL); - + config->source_spec = spec; config->source_state = state; config->header = g_strdup (header); @@ -1314,7 +1314,7 @@ e_table_config_construct (ETableConfig *config, config_sort_info_update (config); config_group_info_update (config); config_fields_info_update (config); - + return E_TABLE_CONFIG (config); } diff --git a/widgets/table/e-table-config.h b/widgets/table/e-table-config.h index 1ece37aabf..ca81b5bb6d 100644 --- a/widgets/table/e-table-config.h +++ b/widgets/table/e-table-config.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-config.h * Copyright 2000, 2001, Ximian, Inc. * @@ -49,7 +49,7 @@ typedef struct { GtkWidget *view_check; /* Only for group dialog */ guint changed_id, toggled_id; void *e_table_config; -} ETableConfigSortWidgets; +} ETableConfigSortWidgets; typedef struct { diff --git a/widgets/table/e-table-defines.h b/widgets/table/e-table-defines.h index 71b59202e5..7048cfa8fa 100644 --- a/widgets/table/e-table-defines.h +++ b/widgets/table/e-table-defines.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-defines.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-example-1.c b/widgets/table/e-table-example-1.c index f482062c9e..d4fefa27ef 100644 --- a/widgets/table/e-table-example-1.c +++ b/widgets/table/e-table-example-1.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-example-1.c * Copyright 2000, 2001, Ximian, Inc. * @@ -42,16 +42,16 @@ * the ETableSimple class. Instead of creating your own ETableModel * class, you simply create a new object of the ETableSimple class. You * give it a bunch of functions that act as callbacks. - * + * * You also get to pass a void * to ETableSimple and it gets passed to * your callbacks. This would be for having multiple models of the same * type. This is just an example though, so we statically define all the * data and ignore the void *data parameter. - * + * * In our example we will be creating a table model with 6 columns and 10 * rows. This corresponds to having 6 different types of information and * 10 different sets of data in our database. - * + * * The headers will be hard coded, as will be the example data. * */ @@ -219,7 +219,7 @@ create_table (void) e_table_model = e_table_simple_new ( my_col_count, my_row_count, my_value_at, my_set_value_at, my_is_cell_editable, - my_duplicate_value, my_free_value, + my_duplicate_value, my_free_value, my_initialize_value, my_value_is_empty, my_value_to_string, NULL); @@ -234,7 +234,7 @@ create_table (void) * First we create the header. */ e_table_header = e_table_header_new (); - + /* * Next we have to build renderers for all of the columns. * Since all our columns are text columns, we can simply use @@ -243,7 +243,7 @@ create_table (void) * each column. */ cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); - + /* * Next we create a column object for each view column and add * them to the header. We don't create a column object for @@ -299,7 +299,7 @@ main (int argc, char *argv []) gtk_widget_push_colormap (gdk_rgb_get_cmap ()); create_table (); - + gtk_main (); e_cursors_shutdown (); diff --git a/widgets/table/e-table-example-2.c b/widgets/table/e-table-example-2.c index 17126e7572..328be5fcde 100644 --- a/widgets/table/e-table-example-2.c +++ b/widgets/table/e-table-example-2.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-example-2.c * Copyright 2000, 2001, Ximian, Inc. * @@ -165,7 +165,7 @@ my_value_at (ETableModel *etc, int col, int row, void *data) static void my_set_value_at (ETableModel *etc, int col, int row, const void *val, void *data) { - if (col == COLOR_COLUMN){ + if (col == COLOR_COLUMN){ } else if (col == IMPORTANCE_COLUMN){ importance_data[row] = (gboolean) val; } else { @@ -280,14 +280,14 @@ create_table () First we create the header. */ e_table_header = e_table_header_new (); - + /* Next we have to build renderers for all of the columns. Since all our columns are text columns, we can simply use the same renderer over and over again. If we had different types of columns, we could use a different renderer for each column. */ cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); - + /* Next we create a column object for each view column and add them to the header. We don't create a column object for the importance column since it will not be shown. */ @@ -300,7 +300,7 @@ create_table () /* Add it to the header. */ e_table_header_add_column (e_table_header, ecol, i); } - + /* Next we add a special column for the check box. */ cell_checkbox = e_cell_checkbox_new (); @@ -343,7 +343,7 @@ main (int argc, char *argv []) gtk_widget_push_colormap (gdk_rgb_get_cmap ()); create_table (); - + gtk_main (); e_cursors_shutdown (); diff --git a/widgets/table/e-table-extras.h b/widgets/table/e-table-extras.h index f0ae91eefc..78cdccf918 100644 --- a/widgets/table/e-table-extras.h +++ b/widgets/table/e-table-extras.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-extras.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index b56096f4a4..eeb34dd6ef 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-field-chooser-dialog.c * Copyright 2000, 2001, Ximian, Inc. * @@ -101,13 +101,13 @@ 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); - + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(e_table_field_chooser_dialog)->vbox), widget, TRUE, TRUE, 0); diff --git a/widgets/table/e-table-field-chooser-dialog.h b/widgets/table/e-table-field-chooser-dialog.h index 930c68f1af..32012e4494 100644 --- a/widgets/table/e-table-field-chooser-dialog.h +++ b/widgets/table/e-table-field-chooser-dialog.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-field-chooser-dialog.h * Copyright 2000, 2001, Ximian, Inc. * @@ -54,7 +54,7 @@ typedef struct _ETableFieldChooserDialogClass ETableFieldChooserDialogClass; struct _ETableFieldChooserDialog { GtkDialog parent; - + /* item specific fields */ ETableFieldChooser *etfc; gchar *dnd_code; diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index d7da7e89da..e5d3afc201 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -171,10 +171,10 @@ etfci_reflow (GnomeCanvasItem *item, gint flags) } etfci->height = height; - + if (old_height != etfci->height) e_canvas_item_request_parent_reflow(item); - + gnome_canvas_item_request_update(item); } @@ -184,7 +184,7 @@ etfci_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flag ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); double i2c [6]; ArtPoint c1, c2, i1, i2; - + if (GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->update) (*GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->update)(item, affine, clip_path, flags); @@ -230,7 +230,7 @@ static void etfci_drop_full_header (ETableFieldChooserItem *etfci) { GObject *header; - + if (!etfci->full_header) return; @@ -249,7 +249,7 @@ etfci_drop_full_header (ETableFieldChooserItem *etfci) e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); } -static void +static void full_header_structure_changed (ETableHeader *header, ETableFieldChooserItem *etfci) { e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); @@ -280,7 +280,7 @@ static void etfci_drop_table_header (ETableFieldChooserItem *etfci) { GObject *header; - + if (!etfci->header) return; @@ -299,7 +299,7 @@ etfci_drop_table_header (ETableFieldChooserItem *etfci) e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); } -static void +static void table_header_structure_changed (ETableHeader *header, ETableFieldChooserItem *etfci) { e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(etfci)); @@ -404,7 +404,7 @@ etfci_drag_data_get (GtkWidget *widget, } static void -etfci_drag_end (GtkWidget *canvas, +etfci_drag_end (GtkWidget *canvas, GdkDragContext *context, ETableFieldChooserItem *etfci) { @@ -444,7 +444,7 @@ etfci_unrealize (GnomeCanvasItem *item) etfci->drag_end_id = 0; g_signal_handler_disconnect (item->canvas, etfci->drag_data_get_id); etfci->drag_data_get_id = 0; - + if (GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->unrealize) (*GNOME_CANVAS_ITEM_CLASS (etfci_parent_class)->unrealize)(item); } @@ -478,7 +478,7 @@ etfci_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int widt continue; y2 += e_table_header_compute_height (ecol, GTK_WIDGET (canvas)); - + if (y1 > (y + height)) break; @@ -582,7 +582,7 @@ etfci_event (GnomeCanvasItem *item, GdkEvent *e) ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item); GnomeCanvas *canvas = item->canvas; int x, y; - + switch (e->type){ case GDK_MOTION_NOTIFY: gnome_canvas_w2c (canvas, e->motion.x, e->motion.y, &x, &y); @@ -590,22 +590,22 @@ etfci_event (GnomeCanvasItem *item, GdkEvent *e) if (etfci_maybe_start_drag (etfci, x, y)) etfci_start_drag (etfci, e, x, y); break; - + case GDK_BUTTON_PRESS: gnome_canvas_w2c (canvas, e->button.x, e->button.y, &x, &y); - + if (e->button.button == 1){ etfci->click_x = x; etfci->click_y = y; etfci->maybe_drag = TRUE; } break; - + case GDK_BUTTON_RELEASE: { etfci->maybe_drag = FALSE; break; } - + default: return FALSE; } @@ -671,7 +671,7 @@ etfci_init (ETableFieldChooserItem *etfci) etfci->full_header = NULL; etfci->header = NULL; etfci->combined_header = NULL; - + etfci->height = etfci->width = 0; etfci->font_desc = NULL; diff --git a/widgets/table/e-table-field-chooser-item.h b/widgets/table/e-table-field-chooser-item.h index 374df211a5..f2e97750f5 100644 --- a/widgets/table/e-table-field-chooser-item.h +++ b/widgets/table/e-table-field-chooser-item.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-field-chooser-item.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index e3031072f6..67fd47708b 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-field-chooser.c * Copyright 2000, 2001, Ximian, Inc. * @@ -95,7 +95,7 @@ ensure_nonzero_step_increments (ETableFieldChooser *etfc) /* it looks pretty complicated to get height of column header so use 16 pixels which should be OK - */ + */ if (va) va->step_increment = 16.0; if (ha) @@ -134,7 +134,7 @@ static void resize(GnomeCanvas *canvas, ETableFieldChooser *etfc) gnome_canvas_item_set( etfc->rect, "x2", (double) etfc->last_alloc.width, "y2", (double) height, - NULL ); + NULL ); ensure_nonzero_step_increments (etfc); } @@ -206,7 +206,7 @@ e_table_field_chooser_dispose (GObject *object) if (etfc->full_header) g_object_unref (etfc->full_header); etfc->full_header = NULL; - + if (etfc->header) g_object_unref (etfc->header); etfc->header = NULL; diff --git a/widgets/table/e-table-field-chooser.h b/widgets/table/e-table-field-chooser.h index 992ed189b4..f6dca643d7 100644 --- a/widgets/table/e-table-field-chooser.h +++ b/widgets/table/e-table-field-chooser.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-field-chooser.h * Copyright 2000, 2001, Ximian, Inc. * @@ -51,7 +51,7 @@ typedef struct _ETableFieldChooserClass ETableFieldChooserClass; struct _ETableFieldChooser { GtkVBox parent; - + /* item specific fields */ GladeXML *gui; GnomeCanvas *canvas; diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 114bcbfc04..57dd2d18a8 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -128,7 +128,7 @@ etgc_dispose (GObject *object) G_OBJECT_CLASS (etgc_parent_class)->dispose (object); } -/** +/** * e_table_group_container_construct * @parent: The %GnomeCanvasGroup to create a child of. * @etgc: The %ETableGroupContainer. @@ -168,7 +168,7 @@ e_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContaine etgc->open = TRUE; } -/** +/** * e_table_group_container_new * @parent: The %GnomeCanvasGroup to create a child of. * @full_header: The full header of the %ETable. @@ -191,7 +191,7 @@ e_table_group_container_new (GnomeCanvasGroup *parent, ETableHeader *full_header ETableGroupContainer *etgc; g_return_val_if_fail (parent != NULL, NULL); - + etgc = g_object_new (E_TABLE_GROUP_CONTAINER_TYPE, NULL); e_table_group_container_construct (parent, etgc, full_header, header, @@ -213,8 +213,8 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) switch (event->type) { case GDK_KEY_PRESS: - if (event->key.keyval == GDK_Tab || - event->key.keyval == GDK_KP_Tab || + if (event->key.keyval == GDK_Tab || + event->key.keyval == GDK_KP_Tab || event->key.keyval == GDK_ISO_Left_Tab) { change_focus = TRUE; use_col = TRUE; @@ -248,7 +248,7 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) use_col = FALSE; direction = E_FOCUS_START; } - if (change_focus){ + if (change_focus){ GList *list; for (list = etgc->children; list; list = list->next) { ETableGroupContainerChildNode *child_node; @@ -263,12 +263,12 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) old_col = 0; if (start_col == -1) start_col = e_table_header_count (e_table_group_get_header (child)) - 1; - + if (direction == E_FOCUS_END) list = list->prev; else list = list->next; - + if (list) { child_node = (ETableGroupContainerChildNode *)list->data; child = child_node->child; @@ -311,7 +311,7 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) return GNOME_CANVAS_ITEM_CLASS (etgc_parent_class)->event (item, event); } return return_val; - + } /* Realize handler for the text item */ @@ -354,7 +354,7 @@ compute_text (ETableGroupContainer *etgc, ETableGroupContainerChildNode *child_n child_node->string, (gint) child_node->count); } - gnome_canvas_item_set (child_node->text, + gnome_canvas_item_set (child_node->text, "text", text, NULL); g_free (text); @@ -848,7 +848,7 @@ etgc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps case PROP_HEIGHT: g_value_set_double (value, etgc->height); break; - case PROP_WIDTH: + case PROP_WIDTH: g_value_set_double (value, etgc->width); break; case PROP_MINIMUM_WIDTH: @@ -894,7 +894,7 @@ etgc_class_init (ETableGroupContainerClass *klass) 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" ), + _( "Alternating Row Colors" ), FALSE, G_PARAM_WRITABLE)); @@ -988,14 +988,14 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) if (frozen) return; - + if (GTK_OBJECT_FLAGS(etgc)& GNOME_CANVAS_ITEM_REALIZED){ gdouble running_height = 0; gdouble running_width = 0; gdouble old_height; gdouble old_width; - + old_height = etgc->height; old_width = etgc->width; if (etgc->children == NULL){ @@ -1004,7 +1004,7 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) gdouble extra_height = 0; gdouble item_height = 0; gdouble item_width = 0; - + if (etgc->font_desc) { PangoContext *context; PangoFontMetrics *metrics; @@ -1017,15 +1017,15 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) BUTTON_PADDING * 2; pango_font_metrics_unref (metrics); } - + extra_height = MAX(extra_height, BUTTON_HEIGHT + BUTTON_PADDING * 2); - + running_height = extra_height; - + 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); @@ -1039,22 +1039,22 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) g_object_get (child, "height", &item_height, NULL); - + e_canvas_item_move_absolute (GNOME_CANVAS_ITEM(child_node->text), GROUP_INDENT, running_height - 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", (double) 0, "x2", (double) running_width + GROUP_INDENT, "y1", (double) running_height - extra_height, "y2", (double) running_height + item_height, NULL); - + running_height += item_height + extra_height; } running_height -= extra_height; @@ -1142,7 +1142,7 @@ e_table_group_container_print_page (EPrintable *ep, gdouble height, gboolean quantize, ETGCPrintContext *groupcontext) -{ +{ cairo_t *cr; gdouble yd = height; gdouble child_height; @@ -1156,7 +1156,7 @@ e_table_group_container_print_page (EPrintable *ep, child_printable = groupcontext->child_printable; child = groupcontext->child; yd = 6.5 * 72; - height = 5 * 72; + height = 5 * 72; if (child_printable) { if (child) @@ -1185,7 +1185,7 @@ e_table_group_container_print_page (EPrintable *ep, pango_font_description_free (desc); while (1) { - child_height = e_printable_height(child_printable, context, width,yd + 2 * TEXT_AREA_HEIGHT, quantize); + child_height = e_printable_height(child_printable, context, width,yd + 2 * TEXT_AREA_HEIGHT, quantize); cr = gtk_print_context_get_cairo_context (context); cairo_save (cr); cairo_rectangle (cr, 0, 0, width,TEXT_AREA_HEIGHT); @@ -1198,7 +1198,7 @@ e_table_group_container_print_page (EPrintable *ep, cairo_rectangle (cr, 0, 0, width, TEXT_AREA_HEIGHT); cairo_clip (cr); cairo_restore (cr); - + cairo_move_to(cr, 0, 0); if (groupcontext->etgc->ecol->text) string = g_strdup_printf ("%s : %s (%d item%s)", @@ -1214,13 +1214,13 @@ e_table_group_container_print_page (EPrintable *ep, pango_layout_set_text (layout, string, -1); pango_cairo_show_layout (cr, layout); g_free(string); - + cairo_translate(cr, 2 * TEXT_AREA_HEIGHT, TEXT_AREA_HEIGHT) ; cairo_move_to(cr, 0, 0); cairo_rectangle (cr, 0, 0, width - 2 * TEXT_AREA_HEIGHT,child_height); cairo_clip(cr); - - e_printable_print_page (child_printable, context, width-2 * TEXT_AREA_HEIGHT, 0, quantize); + + e_printable_print_page (child_printable, context, width-2 * TEXT_AREA_HEIGHT, 0, quantize); yd += child_height + TEXT_AREA_HEIGHT; if (e_printable_data_left(child_printable)) @@ -1301,7 +1301,7 @@ e_table_group_container_height (EPrintable *ep, if (yd != -1 && yd < TEXT_AREA_HEIGHT) return 0; - + while (1) { child_height = e_printable_height(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize); @@ -1319,7 +1319,7 @@ e_table_group_container_height (EPrintable *ep, if (!child) { break; } - + child_node = child->data; if (child_printable) g_object_unref (child_printable); @@ -1366,27 +1366,27 @@ e_table_group_container_will_fit (EPrintable *ep, e_printable_reset(child_printable); } } - + if (yd != -1 && yd < TEXT_AREA_HEIGHT) will_fit = FALSE; else { while (1) { child_height = e_printable_height(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize); - + if (yd != -1) { if (!e_printable_will_fit(child_printable, context, width - 36, yd - (yd == -1 ? 0 : TEXT_AREA_HEIGHT), quantize)) { will_fit = FALSE; break; } - + yd += child_height + TEXT_AREA_HEIGHT; } - + child = child->next; if (!child) { break; } - + child_node = child->data; if (child_printable) g_object_unref (child_printable); @@ -1407,7 +1407,7 @@ e_table_group_container_will_fit (EPrintable *ep, static void e_table_group_container_printable_destroy (gpointer data, GObject *where_object_was) - + { ETGCPrintContext *groupcontext = data; diff --git a/widgets/table/e-table-group-container.h b/widgets/table/e-table-group-container.h index a4f203b596..999e5a154e 100644 --- a/widgets/table/e-table-group-container.h +++ b/widgets/table/e-table-group-container.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-group-container.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index 17dabeaee3..c21a5ffcbd 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -570,7 +570,7 @@ etgl_class_init (ETableGroupLeafClass *klass) 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" ), + _( "Alternating Row Colors" ), FALSE, G_PARAM_WRITABLE)); diff --git a/widgets/table/e-table-group-leaf.h b/widgets/table/e-table-group-leaf.h index b7139d98c5..1a8a3ebb3d 100644 --- a/widgets/table/e-table-group-leaf.h +++ b/widgets/table/e-table-group-leaf.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-group-leaf.h * Copyright 2000, 2001, Ximian, Inc. * @@ -40,7 +40,7 @@ G_BEGIN_DECLS typedef struct { ETableGroup group; - /* + /* * Item. */ ETableItem *item; diff --git a/widgets/table/e-table-group.h b/widgets/table/e-table-group.h index ec57184c26..a7993dc6f8 100644 --- a/widgets/table/e-table-group.h +++ b/widgets/table/e-table-group.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-group.h * Copyright 2000, 2001, Ximian, Inc. * @@ -48,7 +48,7 @@ typedef struct { */ ETableHeader *full_header; ETableHeader *header; - + /* * The model we pull data from. */ @@ -61,7 +61,7 @@ typedef struct { guint transparent : 1; guint has_focus : 1; - + guint frozen : 1; } ETableGroup; diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index a477f127ae..70e56a1933 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -85,7 +85,7 @@ static void ethi_drop_table_header (ETableHeaderItem *ethi); /* * They display the arrows for the drop location. */ - + static GtkWidget *arrow_up, *arrow_down; /* @@ -148,7 +148,7 @@ ethi_dispose (GObject *object){ if (ethi->config) g_object_unref (ethi->config); ethi->config = NULL; - + if (G_OBJECT_CLASS (ethi_parent_class)->dispose) (*G_OBJECT_CLASS (ethi_parent_class)->dispose) (object); } @@ -162,7 +162,7 @@ e_table_header_item_get_height (ETableHeaderItem *ethi) g_return_val_if_fail (ethi != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER_ITEM (ethi), 0); - + eth = ethi->eth; numcols = e_table_header_count (eth); @@ -186,10 +186,10 @@ static void ethi_update (GnomeCanvasItem *item, double *affine, ArtSVP *clip_path, int flags) { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item); - + double i2c [6]; ArtPoint c1, c2, i1, i2; - + if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update) (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->update)(item, affine, clip_path, flags); @@ -242,7 +242,7 @@ static void ethi_drop_table_header (ETableHeaderItem *ethi) { GObject *header; - + if (!ethi->eth) return; @@ -255,7 +255,7 @@ ethi_drop_table_header (ETableHeaderItem *ethi) ethi->width = 0; } -static void +static void structure_changed (ETableHeader *header, ETableHeaderItem *ethi) { gnome_canvas_item_request_update(GNOME_CANVAS_ITEM(ethi)); @@ -395,11 +395,11 @@ ethi_find_col_by_x (ETableHeaderItem *ethi, int x) const int cols = e_table_header_count (ethi->eth); int x1 = 0; int col; - + d(g_print ("%s:%d: x = %d, x1 = %d\n", __FUNCTION__, __LINE__, x, x1)); x1 += ethi->group_indent_width; - + if (x < x1) { d(g_print ("%s:%d: Returning 0\n", __FUNCTION__, __LINE__)); return 0; @@ -427,7 +427,7 @@ ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, int x) int col; x1 += ethi->group_indent_width; - + if (x < x1) return 0; @@ -452,7 +452,7 @@ ethi_remove_drop_marker (ETableHeaderItem *ethi) gtk_widget_hide (arrow_up); gtk_widget_hide (arrow_down); - + ethi->drag_mark = -1; } @@ -463,7 +463,7 @@ make_shaped_window_from_xpm (const char **xpm) GdkPixmap *pixmap; GdkBitmap *bitmap; GtkWidget *win, *pix; - + pixbuf = gdk_pixbuf_new_from_xpm_data (xpm); gdk_pixbuf_render_pixmap_and_mask (pixbuf, &pixmap, &bitmap, 128); g_object_unref (pixbuf); @@ -476,10 +476,10 @@ make_shaped_window_from_xpm (const char **xpm) gtk_container_add (GTK_CONTAINER (win), pix); gtk_widget_shape_combine_mask (win, bitmap, 0, 0); gtk_widget_pop_colormap (); - + g_object_unref (pixmap); g_object_unref (bitmap); - + return win; } @@ -488,7 +488,7 @@ ethi_add_drop_marker (ETableHeaderItem *ethi, int col, gboolean recreate) { int rx, ry; int x; - + if (!recreate && ethi->drag_mark == col) return; @@ -497,7 +497,7 @@ ethi_add_drop_marker (ETableHeaderItem *ethi, int col, gboolean recreate) x = e_table_header_col_diff (ethi->eth, 0, col); if (col > 0) x += ethi->group_indent_width; - + if (!arrow_up){ arrow_up = make_shaped_window_from_xpm (arrow_up_xpm); arrow_down = make_shaped_window_from_xpm (arrow_down_xpm); @@ -526,18 +526,18 @@ static void ethi_add_destroy_marker (ETableHeaderItem *ethi) { double x1; - + if (ethi->remove_item) gtk_object_destroy (GTK_OBJECT (ethi->remove_item)); if (!ethi->stipple) ethi->stipple = gdk_bitmap_create_from_data ( NULL, gray50_bits, gray50_width, gray50_height); - + x1 = (double) e_table_header_col_diff (ethi->eth, 0, ethi->drag_col); if (ethi->drag_col > 0) x1 += ethi->group_indent_width; - + ethi->remove_item = gnome_canvas_item_new ( GNOME_CANVAS_GROUP (GNOME_CANVAS_ITEM (ethi)->canvas->root), gnome_canvas_rect_get_type (), @@ -557,7 +557,7 @@ ethi_remove_destroy_marker (ETableHeaderItem *ethi) { if (!ethi->remove_item) return; - + gtk_object_destroy (GTK_OBJECT (ethi->remove_item)); ethi->remove_item = NULL; } @@ -595,16 +595,16 @@ do_drag_motion(ETableHeaderItem *ethi, (y >= 0) && (y <= (ethi->height))){ int col; d(g_print("In header\n")); - + col = ethi_find_col_by_x_nearest (ethi, x); if (ethi->drag_col != -1 && (col == ethi->drag_col || col == ethi->drag_col + 1)) { if (ethi->drag_col != -1) ethi_remove_destroy_marker (ethi); - + ethi_remove_drop_marker (ethi); gdk_drag_status (context, context->suggested_action, time); - } + } else if (col != -1){ if (ethi->drag_col != -1) ethi_remove_destroy_marker (ethi); @@ -816,7 +816,7 @@ ethi_drag_data_get (GtkWidget *canvas, { if (ethi->drag_col != -1) { 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, @@ -840,13 +840,13 @@ ethi_drag_drop (GtkWidget *canvas, if ((x >= 0) && (x <= (ethi->width)) && (y >= 0) && (y <= (ethi->height))){ int col; - + col = ethi_find_col_by_x_nearest (ethi, x); - + ethi_add_drop_marker (ethi, col, FALSE); ethi->drop_col = col; - + if (col != -1) { char *target = g_strdup_printf ("%s-%s", TARGET_ETABLE_COL_TYPE, ethi->dnd_code); d(g_print ("ethi - %s\n", target)); @@ -875,7 +875,7 @@ ethi_realize (GnomeCanvasItem *item) { TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER }, }; - + if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)-> realize) (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->realize)(item); @@ -889,7 +889,7 @@ ethi_realize (GnomeCanvasItem *item) gtk_drag_dest_set (GTK_WIDGET (item->canvas), 0, ethi_drop_types, ELEMENTS (ethi_drop_types), GDK_ACTION_MOVE); - g_free(ethi_drop_types[0].target); + g_free(ethi_drop_types[0].target); /* Drop signals */ ethi->drag_motion_id = g_signal_connect (item->canvas, "drag_motion", @@ -930,7 +930,7 @@ ethi_unrealize (GnomeCanvasItem *item) g_object_unref (ethi->stipple); ethi->stipple = NULL; } - + if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->unrealize) (*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->unrealize)(item); } @@ -951,19 +951,19 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width int i; for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i); - g_hash_table_insert (arrows, + 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_DOWN : E_TABLE_COL_ARROW_UP)); } length = e_table_sort_info_sorting_get_count(ethi->sort_info); for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_sorting_get_nth(ethi->sort_info, i); - g_hash_table_insert (arrows, + 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_DOWN : E_TABLE_COL_ARROW_UP)); } } @@ -976,9 +976,9 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width int col_width; col_width = ecol->width; - + x2 += col_width; - + if (x1 > (x + width)) break; @@ -1029,7 +1029,7 @@ is_pointer_on_division (ETableHeaderItem *ethi, int pos, int *the_total, int *re if (col == 0) total += ethi->group_indent_width; - + total += ecol->width; if ((total - TOLERANCE < pos)&& (pos < total + TOLERANCE)){ @@ -1058,7 +1058,7 @@ set_cursor (ETableHeaderItem *ethi, int pos) int col; GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (ethi)->canvas); gboolean resizable = FALSE; - + /* We might be invoked before we are realized */ if (!canvas->window) return; @@ -1084,7 +1084,7 @@ set_cursor (ETableHeaderItem *ethi, int pos) } } } - + if (resizable) e_cursor_set (canvas->window, E_CURSOR_SIZE_X); else @@ -1111,7 +1111,7 @@ ethi_maybe_start_drag (ETableHeaderItem *ethi, GdkEventMotion *event) ethi->maybe_drag = FALSE; return FALSE; } - + if (MAX (abs (ethi->click_x - event->x), abs (ethi->click_y - event->y)) <= 3) return FALSE; @@ -1149,10 +1149,10 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) ethi->sort_info, i); group_indent ++; g_hash_table_insert ( - arrows, + arrows, GINT_TO_POINTER ((gint) column.column), GINT_TO_POINTER (column.ascending ? - E_TABLE_COL_ARROW_DOWN : + E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP)); } length = e_table_sort_info_sorting_get_count(ethi->sort_info); @@ -1162,10 +1162,10 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) ethi->sort_info, i); g_hash_table_insert ( - arrows, + arrows, GINT_TO_POINTER ((gint) column.column), GINT_TO_POINTER (column.ascending ? - E_TABLE_COL_ARROW_DOWN : + E_TABLE_COL_ARROW_DOWN : E_TABLE_COL_ARROW_UP)); } } @@ -1363,15 +1363,15 @@ ethi_popup_field_chooser(GtkWidget *widget, EthiHeaderInfo *info) if (etfcd) { gtk_window_present (GTK_WINDOW (etfcd)); - + return; } - + info->ethi->etfcd.widget = e_table_field_chooser_dialog_new (); etfcd = info->ethi->etfcd.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, @@ -1397,7 +1397,7 @@ ethi_popup_best_fit(GtkWidget *widget, EthiHeaderInfo *info) info->col, &width); /* Add 10 to stop it from "..."ing */ e_table_header_set_size (ethi->eth, info->col, width + 10); - + gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi)); } @@ -1435,7 +1435,7 @@ ethi_popup_customize_view(GtkWidget *widget, EthiHeaderInfo *info) ETableHeaderItem *ethi = info->ethi; ETableState *state; ETableSpecification *spec; - + if (ethi->config) e_table_config_raise (E_TABLE_CONFIG (ethi->config)); else { @@ -1526,7 +1526,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) ETableSortColumn column; gboolean ascending = TRUE; d( g_print("ethi_header_context_menu: \n") ); - + info->ethi = ethi; info->col = ethi_find_col_by_x (ethi, event->x); col = e_table_header_get_column (ethi->eth, info->col); @@ -1534,11 +1534,11 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) popup = e_popup_menu_create_with_domain (ethi_context_menu, 1 + 0 + - ((ethi->table || ethi->tree) ? 0 : 4) + + ((ethi->table || ethi->tree) ? 0 : 4) + ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + 128, info, GETTEXT_PACKAGE); - + menu_item = gtk_menu_item_new_with_label (_("Sort By")); gtk_widget_show (menu_item); sub_menu = gtk_menu_new (); @@ -1555,7 +1555,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) sort_col = column.column; ascending = column.ascending; } - + /* Custom */ menu_item = gtk_check_menu_item_new_with_label (_("Custom")); gtk_widget_show (menu_item); @@ -1564,7 +1564,7 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE); gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (menu_item), TRUE); g_signal_connect (menu_item, "activate", G_CALLBACK (popup_custom), info); - + /* Show a seperator */ menu_item = gtk_separator_menu_item_new (); gtk_widget_show (menu_item); @@ -1577,17 +1577,17 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) if (!ethi->full_header->columns[ncol]->sortable || ethi->full_header->columns[ncol]->disabled) continue; - + if (ncol == sort_col) { text = g_strdup_printf("%s (%s)", ethi->full_header->columns[ncol]->text, ascending ? _("Ascending"):_("Descending")); menu_item = gtk_check_menu_item_new_with_label (text); g_free (text); } else menu_item = gtk_check_menu_item_new_with_label (ethi->full_header->columns[ncol]->text); - + gtk_widget_show (menu_item); gtk_menu_shell_prepend (GTK_MENU_SHELL (sub_menu), menu_item); - + if (ncol == sort_col) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menu_item), TRUE); gtk_check_menu_item_set_draw_as_radio (GTK_CHECK_MENU_ITEM (menu_item), TRUE); @@ -1615,13 +1615,13 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) int length; int i; gboolean found = FALSE; - + if (col == NULL) return; if (col->sortable) model_col = col->col_idx; - + length = e_table_sort_info_grouping_get_count(ethi->sort_info); for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i); @@ -1635,7 +1635,7 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) break; } } - + if (!found) { length = e_table_sort_info_sorting_get_count(ethi->sort_info); for (i = 0; i < length; i++) { @@ -1643,7 +1643,7 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) if (model_col == column.column || model_col == -1){ int ascending = column.ascending; - + if (ascending == 0 && model_col != -1){ /* * This means the user has clicked twice @@ -1691,7 +1691,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) const gboolean resizing = ETHI_RESIZING (ethi); int x, y, start, col; int was_maybe_drag = 0; - + switch (e->type){ case GDK_ENTER_NOTIFY: convert (canvas, e->crossing.x, e->crossing.y, &x, &y); @@ -1702,17 +1702,17 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) gdk_window_set_cursor (GTK_WIDGET (canvas)->window, NULL); /* e_cursor_set (GTK_WIDGET (canvas)->window, E_CURSOR_ARROW);*/ break; - + case GDK_MOTION_NOTIFY: convert (canvas, e->motion.x, e->motion.y, &x, &y); if (resizing){ int new_width; - + if (ethi->resize_guide == NULL){ /* 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, @@ -1730,16 +1730,16 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) } else set_cursor (ethi, x); break; - + case GDK_BUTTON_PRESS: if (e->button.button > 3) return FALSE; convert (canvas, e->button.x, e->button.y, &x, &y); - + if (is_pointer_on_division (ethi, x, &start, &col) && e->button.button == 1){ ETableCol *ecol; - + /* * Record the important bits. * @@ -1748,7 +1748,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) * other event handlers). */ ecol = e_table_header_get_column (ethi->eth, col); - + if (!ecol->resizable) break; ethi->resize_col = col; @@ -1769,11 +1769,11 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ethi_button_pressed (ethi, &e->button); } break; - + case GDK_2BUTTON_PRESS: if (!resizing) break; - + if (e->button.button != 1) break; else { @@ -1788,12 +1788,12 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ethi->maybe_drag = FALSE; } break; - + case GDK_BUTTON_RELEASE: { gboolean needs_ungrab = FALSE; - + was_maybe_drag = ethi->maybe_drag; - + ethi->maybe_drag = FALSE; if (ethi->resize_col != -1){ @@ -1801,11 +1801,11 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ethi_end_resize (ethi); } else if (was_maybe_drag && ethi->sort_info) { ETableCol *ecol; - + ecol = e_table_header_get_column (ethi->eth, ethi_find_col_by_x (ethi, e->button.x)); ethi_change_sort_state (ethi, ecol); } - + if (needs_ungrab) gnome_canvas_item_ungrab (item, e->button.time); @@ -1816,15 +1816,15 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) EthiHeaderInfo *info = g_new(EthiHeaderInfo, 1); ETableCol *ecol; GtkMenu *popup; - + info->ethi = ethi; info->col = ethi->selected_col; ecol = e_table_header_get_column (ethi->eth, info->col); - + popup = e_popup_menu_create_with_domain (ethi_context_menu, 1 + (ecol->sortable ? 0 : 2) + - ((ethi->table || ethi->tree) ? 0 : 4) + + ((ethi->table || ethi->tree) ? 0 : 4) + ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + 128, info, GETTEXT_PACKAGE); @@ -1834,7 +1834,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) e_popup_menu (popup, NULL); } else if (e->key.keyval == GDK_space) { ETableCol *ecol; - + ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); ethi_change_sort_state (ethi, ecol); } else if ((e->key.keyval == GDK_Right) || (e->key.keyval == GDK_KP_Right)) { @@ -1842,7 +1842,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) if ((ethi->selected_col < 0) || (ethi->selected_col >= ethi->eth->col_count - 1)) ethi->selected_col = 0; - else + else ethi->selected_col++; ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); ethi_change_sort_state (ethi, ecol); @@ -1851,13 +1851,13 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) if ((ethi->selected_col <= 0) || (ethi->selected_col >= ethi->eth->col_count)) ethi->selected_col = ethi->eth->col_count - 1; - else + else ethi->selected_col--; ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); ethi_change_sort_state (ethi, ecol); } break; - + default: return FALSE; } @@ -1966,7 +1966,7 @@ ethi_init (ETableHeaderItem *ethi) ethi->drag_col = -1; ethi->drag_mark = -1; - + ethi->sort_info = NULL; ethi->sort_info_changed_id = 0; diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h index fe3733bbdf..824c6e0178 100644 --- a/widgets/table/e-table-header-item.h +++ b/widgets/table/e-table-header-item.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-header-item.h * Copyright 1999, 2000, 2001, Ximian, Inc. * @@ -55,7 +55,7 @@ typedef struct { int resize_col; int resize_start_pos; int resize_min_width; - + GtkObject *resize_guide; int group_indent_width; @@ -83,7 +83,7 @@ typedef struct { * For column sorting info */ ETableSortInfo *sort_info; - + guint scroll_direction : 4; int last_drop_x; int last_drop_y; diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index c36e8d11b3..0cc6c65030 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-header-utils.h * Copyright 2000, 2001, Ximian, Inc. * @@ -232,13 +232,13 @@ make_composite_pixmap (GdkDrawable *drawable, GdkGC *gc, * @str: the string we're drawing, passed in so we can change the layout if it needs eliding. * @max_width: Maximum width in which the string must fit. * @center: Whether to center the string in the available area if it does fit. - * + * * Draws a string, possibly trimming it so that it fits inside the specified * maximum width. If it does not fit, an elision indicator is drawn after the * last character that does fit. **/ static void -e_table_draw_elided_string (GdkDrawable *drawable, GdkGC *gc, GtkWidget *widget, +e_table_draw_elided_string (GdkDrawable *drawable, GdkGC *gc, GtkWidget *widget, int x, int y, PangoLayout *layout, char *str, int max_width, gboolean center) { @@ -317,7 +317,7 @@ e_table_draw_elided_string (GdkDrawable *drawable, GdkGC *gc, GtkWidget *widget, * @button_width: Width for the complete button. * @button_height: Height for the complete button. * @arrow: Arrow type to use as a sort indicator. - * + * * Draws a button suitable for a table header. **/ void @@ -462,7 +462,7 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol, g_object_unref (pixmap); } } else { - e_table_draw_elided_string (drawable, gc, widget, + e_table_draw_elided_string (drawable, gc, widget, inner_x, inner_y, layout, ecol->text, inner_width, TRUE); } diff --git a/widgets/table/e-table-header-utils.h b/widgets/table/e-table-header-utils.h index 2b44309eec..084291c39d 100644 --- a/widgets/table/e-table-header-utils.h +++ b/widgets/table/e-table-header-utils.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-header-utils.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 2a4e77014a..535a52c0aa 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -115,7 +115,7 @@ enqueue (ETableHeader *eth, int column, int width) store = g_new(struct two_ints, 1); store->column = column; store->width = width; - + eth->change_tail = g_slist_last(g_slist_append(eth->change_tail, store)); if (!eth->change_queue) eth->change_queue = eth->change_tail; @@ -139,7 +139,7 @@ eth_do_remove (ETableHeader *eth, int idx, gboolean do_unref) { if (do_unref) g_object_unref (eth->columns [idx]); - + memmove (ð->columns [idx], ð->columns [idx+1], sizeof (ETableCol *) * (eth->col_count - idx - 1)); eth->col_count--; @@ -151,7 +151,7 @@ eth_finalize (GObject *object) ETableHeader *eth = E_TABLE_HEADER (object); const int cols = eth->col_count; int i; - + if (eth->sort_info) { if (eth->sort_info_group_change_id) g_signal_handler_disconnect(G_OBJECT(eth->sort_info), @@ -169,7 +169,7 @@ eth_finalize (GObject *object) g_slist_free(eth->change_queue); eth->change_queue = NULL; } - + /* * Destroy columns */ @@ -214,7 +214,7 @@ eth_set_property (GObject *object, guint prop_id, const GValue *val, GParamSpec eth->sort_info = E_TABLE_SORT_INFO(g_value_get_object (val)); if (eth->sort_info) { g_object_ref(eth->sort_info); - eth->sort_info_group_change_id + eth->sort_info_group_change_id = g_signal_connect(G_OBJECT(eth->sort_info), "group_info_changed", G_CALLBACK(eth_group_info_changed), eth); } @@ -259,21 +259,21 @@ e_table_header_class_init (ETableHeaderClass *klass) 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_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)); + 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", + g_param_spec_object ("sort_info", "Sort Info", "Sort Info", E_TABLE_SORT_INFO_TYPE, - G_PARAM_READWRITE)); + G_PARAM_READWRITE)); eth_signals [STRUCTURE_CHANGE] = g_signal_new ("structure_change", @@ -283,23 +283,23 @@ e_table_header_class_init (ETableHeaderClass *klass) (GSignalAccumulator) NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); - eth_signals [DIMENSION_CHANGE] = - g_signal_new ("dimension_change", + 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", + 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] = + eth_signals [REQUEST_WIDTH] = g_signal_new ("request_width", G_TYPE_FROM_CLASS (object_class), G_SIGNAL_RUN_LAST, @@ -324,7 +324,7 @@ e_table_header_init (ETableHeader *eth) eth->sort_info_group_change_id = 0; eth->columns = NULL; - + eth->change_queue = NULL; eth->change_tail = NULL; @@ -348,7 +348,7 @@ eth_update_offsets (ETableHeader *eth) { int i; int x = 0; - + for (i = 0; i < eth->col_count; i++){ ETableCol *etc = eth->columns [i]; @@ -378,7 +378,7 @@ eth_do_insert (ETableHeader *eth, int pos, ETableCol *val) * unref it after you add it. * * This function will emit the "structure_change" signal on the @eth object. - * The ETableCol is assumed + * The ETableCol is assumed */ void e_table_header_add_column (ETableHeader *eth, ETableCol *tc, int pos) @@ -397,7 +397,7 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, int pos) * We are the primary owners of the column */ g_object_ref (tc); - + eth_do_insert (eth, pos, tc); enqueue(eth, -1, eth->nominal_width); @@ -464,7 +464,7 @@ e_table_header_count (ETableHeader *eth) return eth->col_count; } -/** +/** * e_table_header_index: * @eth: the ETableHeader to query * @col: the column to fetch. @@ -501,7 +501,7 @@ int e_table_header_get_index_at (ETableHeader *eth, int x_offset) { int i, total; - + g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); @@ -531,7 +531,7 @@ e_table_header_get_columns (ETableHeader *eth) { ETableCol **ret; int i; - + g_return_val_if_fail (eth != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), NULL); @@ -557,7 +557,7 @@ e_table_header_get_selected (ETableHeader *eth) { int i; int selected = 0; - + g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); @@ -580,7 +580,7 @@ int e_table_header_total_width (ETableHeader *eth) { int total, i; - + g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); @@ -601,7 +601,7 @@ int e_table_header_min_width (ETableHeader *eth) { int total, i; - + g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); @@ -626,7 +626,7 @@ void e_table_header_move (ETableHeader *eth, int source_index, int target_index) { ETableCol *old; - + g_return_if_fail (eth != NULL); g_return_if_fail (E_IS_TABLE_HEADER (eth)); g_return_if_fail (source_index >= 0); @@ -641,7 +641,7 @@ e_table_header_move (ETableHeader *eth, int source_index, int target_index) eth_do_remove (eth, source_index, FALSE); 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); } @@ -692,7 +692,7 @@ eth_set_size (ETableHeader *eth, int idx, int size) g_return_if_fail (E_IS_TABLE_HEADER (eth)); g_return_if_fail (idx >= 0); g_return_if_fail (idx < eth->col_count); - + /* If this column is not resizable, don't do anything. */ if (!eth->columns[idx]->resizable) return; @@ -713,7 +713,7 @@ eth_set_size (ETableHeader *eth, int idx, int size) usable_width -= e_table_sort_info_grouping_get_count(eth->sort_info) * GROUP_INDENT; /* Calculate minimum_width of stuff on the right as well as - * total usable expansion on the right. + * total usable expansion on the right. */ for (; i < eth->col_count; i++) { min_width += eth->columns[i]->min_width + eth->width_extras; @@ -765,7 +765,7 @@ eth_set_size (ETableHeader *eth, int idx, int size) g_signal_emit (G_OBJECT (eth), eth_signals [EXPANSION_CHANGE], 0); return; } - + /* The old_expansion used by columns to the right. */ old_expansion = expansion; old_expansion -= eth->columns[idx]->expansion; @@ -829,7 +829,7 @@ e_table_header_col_diff (ETableHeader *eth, int start_col, int end_col) total = 0; for (col = start_col; col < end_col; col++){ - + total += eth->columns [col]->width; } @@ -895,7 +895,7 @@ e_table_header_update_horizontal (ETableHeader *eth) for (i = 0; i < cols; i++) { int width = 0; - + g_signal_emit_by_name (G_OBJECT (eth), "request_width", i, &width); diff --git a/widgets/table/e-table-header.h b/widgets/table/e-table-header.h index 396eed77d6..172a2da314 100644 --- a/widgets/table/e-table-header.h +++ b/widgets/table/e-table-header.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-header.h * Copyright 1999, 2000, 2001, Ximian, Inc. * @@ -58,7 +58,7 @@ struct _ETableHeader { int sort_info_group_change_id; ETableCol **columns; - + GSList *change_queue, *change_tail; gint idle; }; diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index ecdfc52c6e..4957e1d86a 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -235,7 +235,7 @@ inline static gboolean eti_editing (ETableItem *eti) { d(g_print("%s: %s\n", __FUNCTION__, (eti->editing_col == -1) ? "false":"true")); - + if (eti->editing_col == -1) return FALSE; else @@ -273,7 +273,7 @@ eti_get_cell_background_color (ETableItem *eti, int row, int col, gboolean selec if (eti->alternating_row_colors) { if (row % 2) { - + } else { if (!allocated) { background = gdk_color_copy (background); @@ -343,7 +343,7 @@ eti_realize_cell_views ( ETableItem *eti) if (!(GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED)) return; - + for (i = 0; i < eti->n_cells; i++) e_cell_realize (eti->cell_views [i]); eti->cell_views_realized = 1; @@ -373,7 +373,7 @@ eti_attach_cell_views (ETableItem *eti) for (i = 0; i < eti->n_cells; i++){ ETableCol *ecol = e_table_header_get_column (eti->header, i); - + eti->cell_views [i] = e_cell_new_view (ecol->ecell, eti->table_model, eti); } @@ -394,7 +394,7 @@ eti_unrealize_cell_views (ETableItem *eti) if (eti->cell_views_realized == 0) return; - + eti_free_save_state (eti); for (i = 0; i < eti->n_cells; i++) @@ -406,14 +406,14 @@ static void eti_detach_cell_views (ETableItem *eti) { int i; - + eti_free_save_state (eti); for (i = 0; i < eti->n_cells; i++){ e_cell_kill_view (eti->cell_views [i]); eti->cell_views [i] = NULL; } - + g_free (eti->cell_views); eti->cell_views = NULL; eti->n_cells = 0; @@ -429,14 +429,14 @@ eti_bounds (GnomeCanvasItem *item, double *x1, double *y1, double *x2, double *y /* Wrong BBox's are the source of redraw nightmares */ gnome_canvas_item_i2c_affine (GNOME_CANVAS_ITEM (eti), i2c); - + i1.x = eti->x1; i1.y = eti->y1; i2.x = eti->x1 + eti->width; i2.y = eti->y1 + eti->height; art_affine_point (&c1, &i1, i2c); art_affine_point (&c2, &i2, i2c); - + *x1 = c1.x; *y1 = c1.y; *x2 = c2.x + 1; @@ -589,7 +589,7 @@ eti_remove_header_model (ETableItem *eti) eti->header_dim_change_id); g_signal_handler_disconnect (G_OBJECT (eti->header), eti->header_request_width_id); - + if (eti->cell_views){ eti_unrealize_cell_views (eti); eti_detach_cell_views (eti); @@ -617,9 +617,9 @@ eti_row_height_real (ETableItem *eti, int row) int h, max_h; g_return_val_if_fail (cols == 0 || eti->cell_views, 0); - + max_h = 0; - + for (col = 0; col < cols; col++){ h = e_cell_height (eti->cell_views [col], view_to_model_col(eti, col), col, row); @@ -661,7 +661,7 @@ height_cache_idle(ETableItem *eti) return TRUE; } eti->height_cache_idle_id = 0; - return FALSE; + return FALSE; } static void @@ -710,8 +710,8 @@ eti_row_height (ETableItem *eti, int row) } if (eti->height_cache[row] == -1) { eti->height_cache[row] = eti_row_height_real(eti, row); - if (row > 0 && - eti->length_threshold != -1 && + if (row > 0 && + eti->length_threshold != -1 && eti->rows > eti->length_threshold && eti->height_cache[row] != eti_row_height(eti, 0)) { eti->needs_compute_height = 1; @@ -729,7 +729,7 @@ eti_row_height (ETableItem *eti, int row) * * The ETableItem might compute the whole height by asking every row its * size. There is a special mode (designed to work when there are too - * many rows in the table that performing the previous step could take + * many rows in the table that performing the previous step could take * too long) set by the ETableItem->length_threshold that would determine * when the height is computed by using the first row as the size for * every other row in the ETableItem. @@ -786,7 +786,7 @@ eti_item_region_redraw (ETableItem *eti, int x0, int y0, int x1, int y1) GnomeCanvasItem *item = GNOME_CANVAS_ITEM (eti); ArtDRect rect; double i2c [6]; - + rect.x0 = x0; rect.y0 = y0; rect.x1 = x1; @@ -831,7 +831,7 @@ eti_get_region (ETableItem *eti, int *x2p, int *y2p) { int x1, y1, x2, y2; - + x1 = e_table_header_col_diff (eti->header, 0, start_col); y1 = e_table_item_row_diff (eti, 0, start_row); x2 = x1 + e_table_header_col_diff (eti->header, start_col, end_col + 1); @@ -869,7 +869,7 @@ eti_request_region_redraw (ETableItem *eti, start_col, start_row, end_col, end_row, &x1, &y1, &x2, &y2); - + eti_item_region_redraw (eti, eti->x1 + x1 - border, eti->y1 + y1 - border, eti->x1 + x2 + 1 + border, @@ -905,7 +905,7 @@ static void eti_show_cursor (ETableItem *eti, int delay) { int cursor_row; - + if (!((GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) && eti->cell_views_realized)) return; @@ -913,7 +913,7 @@ eti_show_cursor (ETableItem *eti, int delay) eti->queue_show_cursor = TRUE; return; } - + #if 0 g_object_get(eti->selection, "cursor_row", &cursor_row, @@ -962,14 +962,14 @@ eti_check_cursor_bounds (ETableItem *eti) if (eti->frozen_count > 0) { return; } - + if (!((GTK_OBJECT_FLAGS(eti) & GNOME_CANVAS_ITEM_REALIZED) && eti->cell_views_realized)) return; if (eti->frozen_count > 0) { return; } - + g_object_get(eti->selection, "cursor_row", &cursor_row, NULL); @@ -1208,7 +1208,7 @@ eti_table_model_rows_deleted (ETableModel *table_model, int row, int count, ETab gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti)); } -/** +/** * e_table_item_redraw_range * @eti: %ETableItem which will be redrawn * @start_col: The first col to redraw. @@ -1226,10 +1226,10 @@ e_table_item_redraw_range (ETableItem *eti, { int border; int cursor_col, cursor_row; - + 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, @@ -1258,7 +1258,7 @@ static void eti_add_table_model (ETableItem *eti, ETableModel *table_model) { g_return_if_fail (eti->table_model == NULL); - + eti->table_model = table_model; g_object_ref (eti->table_model); @@ -1303,7 +1303,7 @@ eti_add_table_model (ETableItem *eti, ETableModel *table_model) } eti_freeze (eti); - + eti_table_model_changed (table_model, eti); } @@ -1311,7 +1311,7 @@ static void eti_add_selection_model (ETableItem *eti, ESelectionModel *selection) { g_return_if_fail (eti->selection == NULL); - + eti->selection = selection; g_object_ref (eti->selection); @@ -1376,7 +1376,7 @@ static int eti_request_column_width (ETableHeader *eth, int col, ETableItem *eti) { int width = 0; - + if (eti->cell_views && eti->cell_views_realized) { width = e_cell_max_width (eti->cell_views[col], view_to_model_col(eti, col), col); } @@ -1388,12 +1388,12 @@ static void eti_add_header_model (ETableItem *eti, ETableHeader *header) { g_return_if_fail (eti->header == NULL); - + eti->header = header; g_object_ref (header); eti_header_structure_changed (header, eti); - + eti->header_dim_change_id = g_signal_connect ( G_OBJECT (header), "dimension_change", G_CALLBACK (eti_header_dim_changed), eti); @@ -1402,7 +1402,7 @@ eti_add_header_model (ETableItem *eti, ETableHeader *header) G_OBJECT (header), "structure_change", G_CALLBACK (eti_header_structure_changed), eti); - eti->header_request_width_id = g_signal_connect + eti->header_request_width_id = g_signal_connect (G_OBJECT (header), "request_width", G_CALLBACK (eti_request_column_width), eti); } @@ -1476,7 +1476,7 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe eti_remove_table_model (eti); eti_add_table_model (eti, E_TABLE_MODEL(g_value_get_object (value))); break; - + case PROP_SELECTION_MODEL: g_signal_emit_by_name (G_OBJECT(eti), "selection_model_removed", eti->selection); @@ -1484,7 +1484,7 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe if (g_value_get_object (value)) eti_add_selection_model (eti, E_SELECTION_MODEL(g_value_get_object(value))); break; - + case PROP_LENGTH_THRESHOLD: eti->length_threshold = g_value_get_int (value); break; @@ -1595,13 +1595,13 @@ eti_init (ETableItem *eti) eti->height_cache = NULL; eti->height_cache_idle_id = 0; eti->height_cache_idle_count = 0; - + eti->length_threshold = -1; eti->uniform_row_height = FALSE; eti->uses_source_model = 0; eti->source_model = NULL; - + eti->row_guess = -1; eti->cursor_mode = E_CURSOR_SIMPLE; @@ -1682,7 +1682,7 @@ eti_realize (GnomeCanvasItem *item) ETableItem *eti = E_TABLE_ITEM (item); GtkWidget *canvas_widget = GTK_WIDGET (item->canvas); GdkWindow *window; - + if (GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->realize) (*GNOME_CANVAS_ITEM_CLASS (eti_parent_class)->realize)(item); @@ -1723,7 +1723,7 @@ eti_realize (GnomeCanvasItem *item) if (eti->cell_views == NULL) eti_attach_cell_views (eti); - + eti_realize_cell_views (eti); free_height_cache(eti); @@ -1929,23 +1929,23 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, } yd += height_extra; - + for (row = first_row; row < last_row; row++){ int xd; gboolean selected; gint cursor_col, cursor_row; - + height = ETI_ROW_HEIGHT (eti, row); xd = x_offset; - + 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); - + for (col = first_col; col < last_col; col++){ ETableCol *ecol = e_table_header_get_column (eti->header, col); ECellView *ecell_view = eti->cell_views [col]; @@ -1998,7 +1998,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, e_cell_draw (ecell_view, drawable, ecol->col_idx, col, row, flags, xd, yd, xd + ecol->width, yd + height); - + if (!f_found) { switch (eti->cursor_mode) { case E_CURSOR_LINE: @@ -2038,7 +2038,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, if (eti->vertical_draw_grid){ int xd = x_offset; - + for (col = first_col; col <= last_col; col++){ ETableCol *ecol = e_table_header_get_column (eti->header, col); @@ -2053,7 +2053,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width, xd += ecol->width; } } - + /* * Draw focus */ @@ -2092,20 +2092,20 @@ find_cell (ETableItem *eti, double x, double y, int *view_col_res, int *view_row *y1_res = y - eti->y1 - e_table_item_row_diff (eti, 0, eti->grabbed_row); return TRUE; } - + if (cols == 0 || rows == 0) return FALSE; x -= eti->x1; y -= eti->y1; - + x1 = 0; for (col = 0; col < cols - 1; col++, x1 = x2){ ETableCol *ecol = e_table_header_get_column (eti->header, col); if (x < x1) return FALSE; - + x2 = x1 + ecol->width; if (x <= x2) @@ -2121,7 +2121,7 @@ find_cell (ETableItem *eti, double x, double y, int *view_col_res, int *view_row return FALSE; } else { y1 = y2 = height_extra; - if (y < height_extra) + if (y < height_extra) return FALSE; for (row = 0; row < rows - 1; row++, y1 = y2){ y2 += ETI_ROW_HEIGHT (eti, row) + height_extra; @@ -2225,7 +2225,7 @@ _do_tooltip (ETableItem *eti) if (!free_color) eti->tooltip->foreground = gdk_color_copy(eti->tooltip->foreground); - e_cell_show_tooltip (ecell_view, + e_cell_show_tooltip (ecell_view, view_to_model_col (eti, eti->tooltip->col), eti->tooltip->col, eti->tooltip->row, @@ -2339,7 +2339,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) "cursor_col", &cursor_col, NULL); - eti->maybe_did_something = + 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, @@ -2361,7 +2361,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) */ if (eti_editing (eti)) { - return_val = eti_e_cell_event (eti, ecell_view, (GdkEvent *) &button, button.time, + 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; @@ -2399,7 +2399,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case 4: case 5: return FALSE; - + } break; } @@ -2445,7 +2445,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } #endif - + if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1)) return TRUE; @@ -2483,7 +2483,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case 4: case 5: return FALSE; - + } break; } @@ -2579,7 +2579,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) 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), + view_to_model_col(eti, eti->motion_col), eti->motion_col, eti->motion_row, 0); } @@ -2652,8 +2652,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) handled = FALSE; break; } - - + + g_signal_emit (eti, eti_signals [KEY_PRESS], 0, model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); if ((!return_val) && @@ -2678,15 +2678,15 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) eti_cursor_move_right (eti); return_val = 1; break; - + case GDK_Up: case GDK_KP_Up: case GDK_Down: case GDK_KP_Down: if ((e->key.state & GDK_MOD1_MASK) && ((e->key.keyval == GDK_Down ) || (e->key.keyval == GDK_KP_Down))) { - gint view_col = model_to_view_col(eti, cursor_col); - + gint view_col = model_to_view_col(eti, cursor_col); + if ((view_col >= 0) && (view_col < eti->cols)) if (eti_e_cell_event (eti, eti->cell_views [view_col], e, ((GdkEventKey *)e)->time, cursor_col, view_col, model_to_view_row(eti, cursor_row), E_CELL_CURSOR)) return TRUE; @@ -2698,7 +2698,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti->cursor_mode != E_CURSOR_LINE) { eti_cursor_move (eti, model_to_view_row(eti, cursor_row), 0); return_val = TRUE; - } else + } else return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; case GDK_End: @@ -2706,7 +2706,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti->cursor_mode != E_CURSOR_LINE) { eti_cursor_move (eti, model_to_view_row(eti, cursor_row), eti->cols - 1); return_val = TRUE; - } else + } else return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; case GDK_Tab: @@ -2730,7 +2730,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) eti_cursor_move_right (eti); else if (cursor_row != view_to_model_row(eti, eti->rows - 1)) eti_cursor_move (eti, model_to_view_row(eti, cursor_row) + 1, 0); - else + else return_val = FALSE; } g_object_get(eti->selection, @@ -2766,7 +2766,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (!return_val) return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e); break; - + default: handled = FALSE; break; @@ -2798,7 +2798,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) gint col, row; row = model_to_view_row(eti, cursor_row); col = model_to_view_col(eti, cursor_col); - if (col != -1 && row != -1 && e_table_model_is_cell_editable(eti->table_model, cursor_col, row)) { + if (col != -1 && row != -1 && e_table_model_is_cell_editable(eti->table_model, cursor_col, row)) { e_table_item_enter_edit (eti, col, row); } } @@ -2821,7 +2821,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) eti->in_key_press = FALSE; break; } - + case GDK_KEY_RELEASE: { gint cursor_row, cursor_col; @@ -2854,7 +2854,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) 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), + view_to_model_col(eti, eti->motion_col), eti->motion_col, eti->motion_row, 0); eti->motion_row = -1; eti->motion_col = -1; @@ -2867,7 +2867,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (eti->save_row != -1 && eti->save_col != -1 && !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_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); @@ -2934,7 +2934,7 @@ eti_class_init (ETableItemClass *klass) item_class->draw = eti_draw; item_class->point = eti_point; item_class->event = eti_event; - + klass->cursor_change = NULL; klass->cursor_activated = NULL; klass->double_click = NULL; @@ -2970,7 +2970,7 @@ eti_class_init (ETableItemClass *klass) 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" ), + _( "Alternating Row Colors" ), FALSE, G_PARAM_WRITABLE)); @@ -3144,7 +3144,7 @@ eti_class_init (ETableItemClass *klass) gal_a11y_e_table_item_init (); } -/** +/** * e_table_item_set_cursor: * @eti: %ETableItem which will have the cursor set. * @col: Column to select. -1 means the last column. @@ -3163,7 +3163,7 @@ e_table_item_focus (ETableItem *eti, int col, int row, GdkModifierType state) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); - + if (row == -1) { row = view_to_model_row(eti, eti->rows - 1); } @@ -3179,7 +3179,7 @@ e_table_item_focus (ETableItem *eti, int col, int row, GdkModifierType state) } } -/** +/** * e_table_item_get_focused_column: * @eti: %ETableItem which will have the cursor retrieved. * @@ -3189,12 +3189,12 @@ e_table_item_focus (ETableItem *eti, int col, int row, GdkModifierType state) */ gint e_table_item_get_focused_column (ETableItem *eti) -{ +{ int cursor_col; 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); @@ -3211,7 +3211,7 @@ eti_cursor_change (ESelectionModel *selection, int row, int col, ETableItem *eti return; view_row = model_to_view_row(eti, row); - + if (eti->old_cursor_row != -1 && view_row != eti->old_cursor_row) e_table_item_redraw_row (eti, eti->old_cursor_row); @@ -3251,7 +3251,7 @@ eti_cursor_activated (ESelectionModel *selection, int row, int col, ETableItem * view_row = model_to_view_row(eti, row); view_col = model_to_view_col(eti, col); - + if (view_row != -1 && view_col != -1) { if (! e_table_model_has_change_pending (eti->table_model)) { if (!eti->in_key_press) { @@ -3293,7 +3293,7 @@ eti_selection_row_change (ESelectionModel *selection, int row, ETableItem *eti) } -/** +/** * e_table_item_enter_edit * @eti: %ETableItem which will start being edited * @col: The view col to edit. @@ -3307,7 +3307,7 @@ e_table_item_enter_edit (ETableItem *eti, int col, int row) { g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); - + d(g_print("%s: %d, %d, eti_editing() = %s\n", __FUNCTION__, col, row, eti_editing(eti)?"true":"false")); if (eti_editing (eti)) @@ -3319,7 +3319,7 @@ e_table_item_enter_edit (ETableItem *eti, int col, int row) eti->edit_ctx = e_cell_enter_edit (eti->cell_views [col], view_to_model_col(eti, col), col, row); } -/** +/** * e_table_item_leave_edit_ * @eti: %ETableItem which will stop being edited * @@ -3330,7 +3330,7 @@ e_table_item_leave_edit (ETableItem *eti) { int col, row; void *edit_ctx; - + g_return_if_fail (eti != NULL); g_return_if_fail (E_IS_TABLE_ITEM (eti)); @@ -3352,7 +3352,7 @@ e_table_item_leave_edit (ETableItem *eti) col, row, edit_ctx); } -/** +/** * e_table_item_compute_location * @eti: %ETableItem to look in. * @x: A pointer to the x location to find in the %ETableItem. @@ -3366,7 +3366,7 @@ e_table_item_leave_edit (ETableItem *eti) * location is not in the %ETableItem, the height of the %ETableItem * is removed from the value y points to. */ -void +void e_table_item_compute_location (ETableItem *eti, int *x, int *y, @@ -3449,7 +3449,7 @@ eti_printed_row_height (ETableItem *eti, gdouble *widths, GtkPrintContext *conte 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, + 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; @@ -3463,12 +3463,12 @@ static gint gp_draw_rect (GtkPrintContext *context, double x, double y, double width, double height) { cairo_t *cr; - cr = gtk_print_context_get_cairo_context (context); + cr = gtk_print_context_get_cairo_context (context); cairo_save (cr); - cairo_rectangle (cr, x, y, width, height); + cairo_rectangle (cr, x, y, width, height); cairo_set_line_width (cr, 0.5); cairo_stroke (cr); - cairo_restore (cr); + cairo_restore (cr); return 0; } @@ -3486,18 +3486,18 @@ e_table_item_print_page (EPrintable *ep, gdouble max_height; int rows_printed = itemcontext->rows_printed; int row, col, next_page = 0; - double yd = height; + double yd = height; cairo_t *cr; gdouble *widths; - cr = gtk_print_context_get_cairo_context (context); + cr = gtk_print_context_get_cairo_context (context); max_height = gtk_print_context_get_height (context); widths = e_table_item_calculate_print_widths (itemcontext->item->header, width); /* * Draw cells */ - + if (eti->horizontal_draw_grid){ gp_draw_rect(context, 0, yd, width, 1); } @@ -3506,7 +3506,7 @@ e_table_item_print_page (EPrintable *ep, for (row = rows_printed; row < rows ; row++){ gdouble xd = 1, row_height; row_height = eti_printed_row_height(eti, widths, context, row); - + if (quantize) { if (yd + row_height + 1 > max_height && row != rows_printed) { next_page = 1; @@ -3514,36 +3514,36 @@ e_table_item_print_page (EPrintable *ep, } } else { if (yd > max_height) { - next_page = 1; + next_page = 1; break; - } - } - + } + } + for (col = 0; col < cols; col++){ ECellView *ecell_view = eti->cell_views [col]; - - cairo_save(cr); + + cairo_save(cr); cairo_translate(cr, xd, yd); 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 ); - + cairo_clip(cr); + + e_cell_print (ecell_view, context, + view_to_model_col(eti, col), + col, + row, + widths[col] - 1, + row_height + 2 ); + cairo_restore (cr); xd += widths[col]; } - + yd += row_height; if (eti->horizontal_draw_grid){ gp_draw_rect(context, 0, yd, width, 1); } yd ++; - } + } itemcontext->rows_printed = row; if (eti->vertical_draw_grid){ @@ -3558,7 +3558,7 @@ e_table_item_print_page (EPrintable *ep, if (next_page) { cairo_show_page (cr); next_page = 0; - } + } g_free (widths); } @@ -3595,17 +3595,17 @@ e_table_item_height (EPrintable *ep, gdouble *widths; int row; gdouble yd = 0; - + widths = e_table_item_calculate_print_widths (itemcontext->item->header, width); /* * Draw cells */ yd++; - + for (row = rows_printed; row < rows; row++){ gdouble row_height; - + row_height = eti_printed_row_height(item, widths, context, row); if (quantize) { if (max_height != -1 && yd + row_height + 1 > max_height && row != rows_printed) { @@ -3623,7 +3623,7 @@ e_table_item_height (EPrintable *ep, } g_free (widths); - + if (max_height != -1 && (!quantize) && yd > max_height) yd = max_height; @@ -3646,17 +3646,17 @@ e_table_item_will_fit (EPrintable *ep, int row; gdouble yd = 0; gboolean ret_val = TRUE; - + widths = e_table_item_calculate_print_widths (itemcontext->item->header, width); /* * Draw cells */ yd++; - + for (row = rows_printed; row < rows; row++){ gdouble row_height; - + row_height = eti_printed_row_height(item, widths, context, row); if (quantize) { if (max_height != -1 && yd + row_height + 1 > max_height && row != rows_printed) { @@ -3691,14 +3691,14 @@ e_table_item_printable_destroy (gpointer data, g_free(itemcontext); } -/** +/** * e_table_item_get_printable * @eti: %ETableItem which will be printed * * This routine creates and returns an %EPrintable that can be used to * print the given %ETableItem. * - * Returns: The %EPrintable. + * Returns: The %EPrintable. */ EPrintable * e_table_item_get_printable (ETableItem *item) diff --git a/widgets/table/e-table-item.h b/widgets/table/e-table-item.h index 6937ed61b3..caabfe5581 100644 --- a/widgets/table/e-table-item.h +++ b/widgets/table/e-table-item.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-item.h * Copyright 1999, 2000, 2001, Ximian, Inc. * @@ -55,7 +55,7 @@ typedef struct { int cols, rows; int click_count; - + /* * Ids for the signals we connect to */ @@ -84,7 +84,7 @@ typedef struct { int hadjustment_value_change_id; int vadjustment_change_id; int vadjustment_value_change_id; - + GdkGC *fill_gc; GdkGC *grid_gc; GdkGC *focus_gc; @@ -96,7 +96,7 @@ typedef struct { guint draw_focus:1; guint uniform_row_height:1; guint cell_views_realized:1; - + guint needs_redraw : 1; guint needs_compute_height : 1; guint needs_compute_width : 1; @@ -146,7 +146,7 @@ typedef struct { * the size */ int length_threshold; - + gint row_guess; ECursorMode cursor_mode; diff --git a/widgets/table/e-table-memory-callbacks.c b/widgets/table/e-table-memory-callbacks.c index 2b0fdaec21..4b05a42120 100644 --- a/widgets/table/e-table-memory-callbacks.c +++ b/widgets/table/e-table-memory-callbacks.c @@ -96,7 +96,7 @@ static void * etmc_initialize_value (ETableModel *etm, int col) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); - + if (etmc->initialize_value) return etmc->initialize_value (etm, col, etmc->data); else @@ -107,7 +107,7 @@ static gboolean etmc_value_is_empty (ETableModel *etm, int col, const void *value) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); - + if (etmc->value_is_empty) return etmc->value_is_empty (etm, col, value, etmc->data); else @@ -118,7 +118,7 @@ static char * etmc_value_to_string (ETableModel *etm, int col, const void *value) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); - + if (etmc->value_to_string) return etmc->value_to_string (etm, col, value, etmc->data); else @@ -129,7 +129,7 @@ static void etmc_append_row (ETableModel *etm, ETableModel *source, int row) { ETableMemoryCalbacks *etmc = E_TABLE_MEMORY_CALLBACKS(etm); - + if (etmc->append_row) etmc->append_row (etm, source, row, etmc->data); } @@ -179,7 +179,7 @@ e_table_memory_callbacks_init (ETableMemoryCalbacks *etmc) * Instead, ETableMemoryCalbacksModel uses a setup based in callback functions, every * callback function signature mimics the signature of each ETableModel method * and passes the extra @data pointer to each one of the method to provide them - * with any context they might want to use. + * with any context they might want to use. * * Returns: An ETableMemoryCalbacksModel object (which is also an ETableModel * object). @@ -210,6 +210,6 @@ e_table_memory_callbacks_new (ETableMemoryCalbacksColumnCountFn col_count, et->value_is_empty = value_is_empty; et->value_to_string = value_to_string; et->data = data; - + return (ETableModel *) et; } diff --git a/widgets/table/e-table-memory-callbacks.h b/widgets/table/e-table-memory-callbacks.h index 6a75008a94..1a43b02bdd 100644 --- a/widgets/table/e-table-memory-callbacks.h +++ b/widgets/table/e-table-memory-callbacks.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-memory-callbacks.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-memory-store.c b/widgets/table/e-table-memory-store.c index b4fe2d2a16..7ebbcbd70c 100644 --- a/widgets/table/e-table-memory-store.c +++ b/widgets/table/e-table-memory-store.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-memory-store.c * Copyright 2000, 2001, Ximian, Inc. * @@ -145,7 +145,7 @@ static void * etms_initialize_value (ETableModel *etm, int col) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); - + switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: return g_strdup (""); @@ -166,7 +166,7 @@ static gboolean etms_value_is_empty (ETableModel *etm, int col, const void *value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); - + switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: return !(value && *(char *) value); @@ -187,7 +187,7 @@ static char * etms_value_to_string (ETableModel *etm, int col, const void *value) { ETableMemoryStore *etms = E_TABLE_MEMORY_STORE(etm); - + switch (etms->priv->columns[col].type) { case E_TABLE_MEMORY_STORE_COLUMN_TYPE_STRING: return g_strdup (value); @@ -239,7 +239,7 @@ etms_finalize (GObject *obj) if (G_OBJECT_CLASS (e_table_memory_store_parent_class)->finalize) G_OBJECT_CLASS (e_table_memory_store_parent_class)->finalize (obj); } - + static void e_table_memory_store_init (ETableMemoryStore *etms) { @@ -291,7 +291,7 @@ e_table_memory_store_class_init (ETableMemoryStoreClass *klass) * Instead, ETableMemoryStoreModel uses a setup based in callback functions, every * callback function signature mimics the signature of each ETableModel method * and passes the extra @data pointer to each one of the method to provide them - * with any context they might want to use. + * with any context they might want to use. * * Returns: An ETableMemoryStoreModel object (which is also an ETableModel * object). @@ -323,7 +323,7 @@ e_table_memory_store_construct (ETableMemoryStore *etms, ETableMemoryStoreColumn return E_TABLE_MODEL (etms); } - + void e_table_memory_store_adopt_value_at (ETableMemoryStore *etms, int col, int row, void *value) diff --git a/widgets/table/e-table-memory-store.h b/widgets/table/e-table-memory-store.h index c95486fcd6..fe67e10d3d 100644 --- a/widgets/table/e-table-memory-store.h +++ b/widgets/table/e-table-memory-store.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-memory-store.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-memory.c b/widgets/table/e-table-memory.c index 824b8082cd..b708811cc5 100644 --- a/widgets/table/e-table-memory.c +++ b/widgets/table/e-table-memory.c @@ -113,12 +113,12 @@ e_table_memory_new (void) /** * e_table_memory_get_data: - * @etmm: - * @row: - * - * - * - * Return value: + * @etmm: + * @row: + * + * + * + * Return value: **/ gpointer e_table_memory_get_data (ETableMemory *etmm, int row) @@ -131,11 +131,11 @@ e_table_memory_get_data (ETableMemory *etmm, int row) /** * e_table_memory_set_data: - * @etmm: - * @row: - * @data: - * - * + * @etmm: + * @row: + * @data: + * + * **/ void e_table_memory_set_data (ETableMemory *etmm, int row, gpointer data) @@ -148,14 +148,14 @@ e_table_memory_set_data (ETableMemory *etmm, int row, gpointer data) /** * e_table_memory_insert: - * @table_model: - * @parent_path: - * @position: - * @data: - * - * - * - * Return value: + * @table_model: + * @parent_path: + * @position: + * @data: + * + * + * + * Return value: **/ void e_table_memory_insert (ETableMemory *etmm, @@ -182,12 +182,12 @@ e_table_memory_insert (ETableMemory *etmm, /** * e_table_memory_remove: - * @etable: - * @path: - * - * - * - * Return value: + * @etable: + * @path: + * + * + * + * Return value: **/ gpointer e_table_memory_remove (ETableMemory *etmm, int row) @@ -209,12 +209,12 @@ e_table_memory_remove (ETableMemory *etmm, int row) /** * e_table_memory_clear: - * @etable: - * @path: - * - * - * - * Return value: + * @etable: + * @path: + * + * + * + * Return value: **/ void e_table_memory_clear (ETableMemory *etmm) @@ -231,11 +231,11 @@ e_table_memory_clear (ETableMemory *etmm) /** * e_table_memory_freeze: * @etmm: the ETableModel to freeze. - * + * * This function prepares an ETableModel for a period of much change. * All signals regarding changes to the table are deferred until we * thaw the table. - * + * **/ void e_table_memory_freeze(ETableMemory *etmm) @@ -251,11 +251,11 @@ e_table_memory_freeze(ETableMemory *etmm) /** * e_table_memory_thaw: * @etmm: the ETableMemory to thaw. - * + * * This function thaws an ETableMemory. All the defered signals can add * up to a lot, we don't know - so we just emit a model_changed * signal. - * + * **/ void e_table_memory_thaw(ETableMemory *etmm) diff --git a/widgets/table/e-table-memory.h b/widgets/table/e-table-memory.h index aba80e0520..d1f382cd6b 100644 --- a/widgets/table/e-table-memory.h +++ b/widgets/table/e-table-memory.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-memory.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-model.c b/widgets/table/e-table-model.c index 3d73bbf83a..36dd691a86 100644 --- a/widgets/table/e-table-model.c +++ b/widgets/table/e-table-model.c @@ -134,7 +134,7 @@ e_table_model_value_at (ETableModel *e_table_model, int col, int row) * e_table_model_set_value_at: * @e_table_model: the table model to operate on. * @col: the column where the data will be stored in the model. - * @row: the row where the data will be stored in the model. + * @row: the row where the data will be stored in the model. * @value: the data to be stored. * * This function instructs the model to store the value in @data in the @@ -277,8 +277,8 @@ e_table_model_finalize (GObject *object) static void e_table_model_class_init (ETableModelClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - + GObjectClass *object_class = G_OBJECT_CLASS (klass); + object_class->finalize = e_table_model_finalize; e_table_model_signals [MODEL_NO_CHANGE] = @@ -345,27 +345,27 @@ e_table_model_class_init (ETableModelClass *klass) e_util_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT); - klass->column_count = NULL; - klass->row_count = NULL; + klass->column_count = NULL; + klass->row_count = NULL; klass->append_row = NULL; - klass->value_at = NULL; - klass->set_value_at = NULL; - klass->is_cell_editable = NULL; + klass->value_at = NULL; + klass->set_value_at = NULL; + klass->is_cell_editable = NULL; klass->has_save_id = NULL; klass->get_save_id = NULL; klass->has_change_pending = NULL; - klass->duplicate_value = NULL; - klass->free_value = NULL; - klass->initialize_value = NULL; - klass->value_is_empty = NULL; + klass->duplicate_value = NULL; + klass->free_value = NULL; + klass->initialize_value = NULL; + klass->value_is_empty = NULL; klass->value_to_string = NULL; - klass->model_no_change = NULL; - klass->model_changed = NULL; + klass->model_no_change = NULL; + klass->model_changed = NULL; klass->model_row_changed = NULL; klass->model_cell_changed = NULL; klass->model_rows_inserted = NULL; @@ -396,11 +396,11 @@ e_table_model_pre_change (ETableModel *e_table_model) if (ETM_FROZEN (e_table_model)) return; - + d(print_tabs()); d(g_print("Emitting pre_change on model 0x%p, a %s.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type))); d(depth++); - g_signal_emit (G_OBJECT (e_table_model), + g_signal_emit (G_OBJECT (e_table_model), e_table_model_signals [MODEL_PRE_CHANGE], 0); d(depth--); } @@ -423,10 +423,10 @@ e_table_model_no_change (ETableModel *e_table_model) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); - + if (ETM_FROZEN (e_table_model)) return; - + d(print_tabs()); d(g_print("Emitting model_no_change on model 0x%p, a %s.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type))); d(depth++); @@ -453,10 +453,10 @@ e_table_model_changed (ETableModel *e_table_model) { g_return_if_fail (e_table_model != NULL); g_return_if_fail (E_IS_TABLE_MODEL (e_table_model)); - + if (ETM_FROZEN (e_table_model)) return; - + d(print_tabs()); d(g_print("Emitting model_changed on model 0x%p, a %s.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type))); d(depth++); @@ -483,7 +483,7 @@ e_table_model_row_changed (ETableModel *e_table_model, int row) if (ETM_FROZEN (e_table_model)) return; - + d(print_tabs()); d(g_print("Emitting row_changed on model 0x%p, a %s, row %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row)); d(depth++); @@ -511,7 +511,7 @@ e_table_model_cell_changed (ETableModel *e_table_model, int col, int row) if (ETM_FROZEN (e_table_model)) return; - + d(print_tabs()); d(g_print("Emitting cell_changed on model 0x%p, a %s, row %d, col %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row, col)); d(depth++); @@ -539,7 +539,7 @@ e_table_model_rows_inserted (ETableModel *e_table_model, int row, int count) if (ETM_FROZEN (e_table_model)) return; - + d(print_tabs()); d(g_print("Emitting row_inserted on model 0x%p, a %s, row %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row)); d(depth++); @@ -582,7 +582,7 @@ e_table_model_rows_deleted (ETableModel *e_table_model, int row, int count) if (ETM_FROZEN (e_table_model)) return; - + d(print_tabs()); d(g_print("Emitting row_deleted on model 0x%p, a %s, row %d.\n", e_table_model, gtk_type_name (GTK_OBJECT(e_table_model)->klass->type), row)); d(depth++); diff --git a/widgets/table/e-table-model.h b/widgets/table/e-table-model.h index ba8e9f91b5..3bc5a2f526 100644 --- a/widgets/table/e-table-model.h +++ b/widgets/table/e-table-model.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-model.h * Copyright 2000, 2001, Ximian, Inc. * @@ -69,7 +69,7 @@ typedef struct { /* Return an allocated string. */ char *(*value_to_string) (ETableModel *etm, int col, const void *value); - + /* * Signals */ diff --git a/widgets/table/e-table-one.c b/widgets/table/e-table-one.c index 817dcfd2dd..b374fd9cb3 100644 --- a/widgets/table/e-table-one.c +++ b/widgets/table/e-table-one.c @@ -104,7 +104,7 @@ static void * one_initialize_value (ETableModel *etm, int col) { ETableOne *one = E_TABLE_ONE(etm); - + if (one->source) return e_table_model_initialize_value (one->source, col); else @@ -115,7 +115,7 @@ static gboolean one_value_is_empty (ETableModel *etm, int col, const void *value) { ETableOne *one = E_TABLE_ONE(etm); - + if (one->source) return e_table_model_value_is_empty (one->source, col, value); else @@ -126,7 +126,7 @@ static char * one_value_to_string (ETableModel *etm, int col, const void *value) { ETableOne *one = E_TABLE_ONE(etm); - + if (one->source) return e_table_model_value_to_string (one->source, col, value); else @@ -155,7 +155,7 @@ one_dispose (GObject *object) for (i = 0; i < col_count; i++) e_table_model_free_value(one->source, i, one->data[i]); } - + g_free (one->data); } one->data = NULL; @@ -204,16 +204,16 @@ e_table_one_new (ETableModel *source) eto = g_object_new (E_TABLE_ONE_TYPE, NULL); eto->source = source; - + col_count = e_table_model_column_count(source); eto->data = g_new(void *, col_count); for (i = 0; i < col_count; i++) { eto->data[i] = e_table_model_initialize_value(source, i); } - + if (source) g_object_ref(source); - + return (ETableModel *) eto; } diff --git a/widgets/table/e-table-one.h b/widgets/table/e-table-one.h index 44d0ed22a9..f32d8cc0d4 100644 --- a/widgets/table/e-table-one.h +++ b/widgets/table/e-table-one.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-one.h * Copyright 2000, 2001, Ximian, Inc. * @@ -37,7 +37,7 @@ G_BEGIN_DECLS typedef struct { ETableModel parent; - + ETableModel *source; void **data; } ETableOne; diff --git a/widgets/table/e-table-scrolled.h b/widgets/table/e-table-scrolled.h index d5671f28a3..1c7c0b48fd 100644 --- a/widgets/table/e-table-scrolled.h +++ b/widgets/table/e-table-scrolled.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-scrolled.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c index 50c319c66d..891ba665e4 100644 --- a/widgets/table/e-table-search.c +++ b/widgets/table/e-table-search.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-search.c * Copyright 2000, 2001, Ximian, Inc. * @@ -56,9 +56,9 @@ e_table_search_search (ETableSearch *e_table_search, char *string, ETableSearchF gboolean ret_val; g_return_val_if_fail (e_table_search != NULL, FALSE); 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], + e_table_search_signals [SEARCH_SEARCH], 0, string, flags, &ret_val); return ret_val; @@ -69,7 +69,7 @@ e_table_search_accept (ETableSearch *e_table_search) { g_return_if_fail (e_table_search != NULL); 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); } @@ -108,11 +108,11 @@ static void e_table_search_finalize (GObject *object) { ETableSearch *ets = (ETableSearch *) object; - + drop_timeout (ets); g_free (ets->priv->search_string); g_free (ets->priv); - + if (G_OBJECT_CLASS (e_table_search_parent_class)->finalize) (*G_OBJECT_CLASS (e_table_search_parent_class)->finalize)(object); } diff --git a/widgets/table/e-table-search.h b/widgets/table/e-table-search.h index eff681e0aa..ecb3efa6e9 100644 --- a/widgets/table/e-table-search.h +++ b/widgets/table/e-table-search.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-search.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index 2b8ec0fa99..2706fd4ba4 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -105,7 +105,7 @@ model_changed_idle(ETableSelectionModel *etsm) char *save_id = e_table_model_get_save_id(etm, i); if (g_hash_table_lookup(etsm->hash, save_id)) e_selection_model_change_one_row(E_SELECTION_MODEL(etsm), i, TRUE); - + if (etsm->cursor_id && !strcmp(etsm->cursor_id, save_id)) { cursor_row = i; cursor_col = e_selection_model_cursor_col(E_SELECTION_MODEL(etsm)); @@ -261,7 +261,7 @@ static void etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object); - + switch (prop_id){ case PROP_MODEL: drop_model(etsm); @@ -298,14 +298,14 @@ e_table_selection_model_class_init (ETableSelectionModelClass *klass) esma_class->get_row_count = etsm_get_row_count; - g_object_class_install_property (object_class, PROP_MODEL, + g_object_class_install_property (object_class, PROP_MODEL, g_param_spec_object ("model", _("Model"), /*_( */"XXX blurb" /*)*/, E_TABLE_MODEL_TYPE, G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_HEADER, + g_object_class_install_property (object_class, PROP_HEADER, g_param_spec_object ("header", _("Header"), /*_( */"XXX blurb" /*)*/, @@ -313,7 +313,7 @@ e_table_selection_model_class_init (ETableSelectionModelClass *klass) G_PARAM_READWRITE)); } -/** +/** * e_table_selection_model_new * * This routine creates a new #ETableSelectionModel. diff --git a/widgets/table/e-table-selection-model.h b/widgets/table/e-table-selection-model.h index ce98bd4b4e..60b7812413 100644 --- a/widgets/table/e-table-selection-model.h +++ b/widgets/table/e-table-selection-model.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-selection-model.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-simple.c b/widgets/table/e-table-simple.c index f47786e7b7..41ce63f943 100644 --- a/widgets/table/e-table-simple.c +++ b/widgets/table/e-table-simple.c @@ -56,7 +56,7 @@ static void simple_append_row (ETableModel *etm, ETableModel *source, int row) { ETableSimple *simple = E_TABLE_SIMPLE(etm); - + if (simple->append_row) simple->append_row (etm, source, row, simple->data); } @@ -139,7 +139,7 @@ static void * simple_initialize_value (ETableModel *etm, int col) { ETableSimple *simple = E_TABLE_SIMPLE(etm); - + if (simple->initialize_value) return simple->initialize_value (etm, col, simple->data); else @@ -150,7 +150,7 @@ static gboolean simple_value_is_empty (ETableModel *etm, int col, const void *value) { ETableSimple *simple = E_TABLE_SIMPLE(etm); - + if (simple->value_is_empty) return simple->value_is_empty (etm, col, value, simple->data); else @@ -161,7 +161,7 @@ static char * simple_value_to_string (ETableModel *etm, int col, const void *value) { ETableSimple *simple = E_TABLE_SIMPLE(etm); - + if (simple->value_to_string) return simple->value_to_string (etm, col, value, simple->data); else @@ -219,7 +219,7 @@ e_table_simple_init (ETableSimple *simple) * Instead, ETableSimpleModel uses a setup based in callback functions, every * callback function signature mimics the signature of each ETableModel method * and passes the extra @data pointer to each one of the method to provide them - * with any context they might want to use. + * with any context they might want to use. * * Returns: An ETableSimpleModel object (which is also an ETableModel * object). diff --git a/widgets/table/e-table-simple.h b/widgets/table/e-table-simple.h index db49cc6ced..fd489b5b54 100644 --- a/widgets/table/e-table-simple.h +++ b/widgets/table/e-table-simple.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-simple.h * Copyright 2000, 2001, Ximian, Inc. * @@ -71,7 +71,7 @@ typedef struct { ETableSimpleFreeValueFn free_value; ETableSimpleInitializeValueFn initialize_value; ETableSimpleValueIsEmptyFn value_is_empty; - ETableSimpleValueToStringFn value_to_string; + ETableSimpleValueToStringFn value_to_string; void *data; } ETableSimple; diff --git a/widgets/table/e-table-size-test.c b/widgets/table/e-table-size-test.c index b70e890f1d..3260f9621f 100644 --- a/widgets/table/e-table-size-test.c +++ b/widgets/table/e-table-size-test.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-size-test.c * Copyright 2000, 2001, Ximian, Inc. * @@ -41,16 +41,16 @@ * the ETableSimple class. Instead of creating your own ETableModel * class, you simply create a new object of the ETableSimple class. You * give it a bunch of functions that act as callbacks. - * + * * You also get to pass a void * to ETableSimple and it gets passed to * your callbacks. This would be for having multiple models of the same * type. This is just an example though, so we statically define all the * data and ignore the void *data parameter. - * + * * In our example we will be creating a table model with 6 columns and 10 * rows. This corresponds to having 6 different types of information and * 10 different sets of data in our database. - * + * * The headers will be hard coded, as will be the example data. * */ @@ -234,7 +234,7 @@ create_table (void) * First we create the header. */ e_table_header = e_table_header_new (); - + /* * Next we have to build renderers for all of the columns. * Since all our columns are text columns, we can simply use @@ -298,7 +298,7 @@ main (int argc, char *argv []) gtk_widget_push_colormap (gdk_rgb_get_cmap ()); create_table (); - + gtk_main (); e_cursors_shutdown (); diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index 8d8d8fe580..e91ade2381 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -46,7 +46,7 @@ static void etsi_finalize (GObject *object) { ETableSortInfo *etsi = E_TABLE_SORT_INFO (object); - + if (etsi->groupings) g_free(etsi->groupings); etsi->groupings = NULL; @@ -107,7 +107,7 @@ e_table_sort_info_sort_info_changed (ETableSortInfo *info) { g_return_if_fail (info != NULL); g_return_if_fail (E_IS_TABLE_SORT_INFO (info)); - + if (info->frozen) { info->sort_info_changed = 1; } else { @@ -120,7 +120,7 @@ e_table_sort_info_group_info_changed (ETableSortInfo *info) { g_return_if_fail (info != NULL); g_return_if_fail (E_IS_TABLE_SORT_INFO (info)); - + if (info->frozen) { info->group_info_changed = 1; } else { @@ -139,7 +139,7 @@ e_table_sort_info_group_info_changed (ETableSortInfo *info) * To thaw, invoke the e_table_sort_info_thaw() function, which will * trigger any signals that might have been queued. */ -void +void e_table_sort_info_freeze (ETableSortInfo *info) { info->frozen++; @@ -162,7 +162,7 @@ e_table_sort_info_thaw (ETableSortInfo *info) info->frozen--; if (info->frozen != 0) return; - + if (info->sort_info_changed) { info->sort_info_changed = 0; e_table_sort_info_sort_info_changed(info); @@ -206,7 +206,7 @@ e_table_sort_info_grouping_real_truncate (ETableSortInfo *info, int length) * @lenght: position where the truncation happens. * * This routine can be used to reduce or grow the number of grouping - * criteria in the object. + * criteria in the object. */ void e_table_sort_info_grouping_truncate (ETableSortInfo *info, int length) @@ -283,7 +283,7 @@ e_table_sort_info_sorting_real_truncate (ETableSortInfo *info, int length) * @lenght: position where the truncation happens. * * This routine can be used to reduce or grow the number of sort - * criteria in the object. + * criteria in the object. */ void e_table_sort_info_sorting_truncate (ETableSortInfo *info, int length) @@ -335,7 +335,7 @@ e_table_sort_info_sorting_set_nth (ETableSortInfo *info, int n, ETableSortColu * This creates a new e_table_sort_info object that contains no * grouping and no sorting defined as of yet. This object is used * to keep track of multi-level sorting and multi-level grouping of - * the ETable. + * the ETable. * * Returns: A new %ETableSortInfo object */ @@ -418,7 +418,7 @@ e_table_sort_info_save_to_node (ETableSortInfo *info, int i; const int sort_count = e_table_sort_info_sorting_get_count (info); const int group_count = e_table_sort_info_grouping_get_count (info); - + grouping = xmlNewChild (parent, NULL, (const unsigned char *)"grouping", NULL); for (i = 0; i < group_count; i++) { @@ -432,7 +432,7 @@ e_table_sort_info_save_to_node (ETableSortInfo *info, for (i = 0; i < sort_count; i++) { ETableSortColumn column = e_table_sort_info_sorting_get_nth(info, i); xmlNode *new_node = xmlNewChild(grouping, NULL, (const unsigned char *)"leaf", NULL); - + e_xml_set_integer_prop_by_name (new_node, (const unsigned char *)"column", column.column); e_xml_set_bool_prop_by_name (new_node, (const unsigned char *)"ascending", column.ascending); } diff --git a/widgets/table/e-table-sort-info.h b/widgets/table/e-table-sort-info.h index 5140b40d5a..81e02cae17 100644 --- a/widgets/table/e-table-sort-info.h +++ b/widgets/table/e-table-sort-info.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-sort-info.h * Copyright 2000, 2001, Ximian, Inc. * @@ -45,12 +45,12 @@ struct _ETableSortColumn { typedef struct { GObject base; - + gint group_count; ETableSortColumn *groupings; gint sort_count; ETableSortColumn *sortings; - + guint frozen : 1; guint sort_info_changed : 1; guint group_info_changed : 1; diff --git a/widgets/table/e-table-sorted-variable.h b/widgets/table/e-table-sorted-variable.h index f2cc695bc5..5c91c11aa1 100644 --- a/widgets/table/e-table-sorted-variable.h +++ b/widgets/table/e-table-sorted-variable.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-sorted-variable.h * Copyright 2000, 2001, Ximian, Inc. * @@ -43,7 +43,7 @@ typedef struct { ETableSubsetVariable base; ETableSortInfo *sort_info; - + ETableHeader *full_header; int sort_info_changed_id; diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c index 32985a5dd8..e2a5ecdde9 100644 --- a/widgets/table/e-table-sorted.c +++ b/widgets/table/e-table-sorted.c @@ -182,7 +182,7 @@ ets_proxy_model_row_changed (ETableSubset *subset, ETableModel *source, int row) { if (!E_TABLE_SORTED(subset)->sort_idle_id) E_TABLE_SORTED(subset)->sort_idle_id = g_idle_add_full(50, (GSourceFunc) ets_sort_idle, subset, NULL); - + if (E_TABLE_SUBSET_CLASS (ets_parent_class)->proxy_model_row_changed) (E_TABLE_SUBSET_CLASS (ets_parent_class)->proxy_model_row_changed) (subset, source, row); } diff --git a/widgets/table/e-table-sorted.h b/widgets/table/e-table-sorted.h index 297e622587..2fa1cafbdb 100644 --- a/widgets/table/e-table-sorted.h +++ b/widgets/table/e-table-sorted.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-sorted.h * Copyright 2000, 2001, Ximian, Inc. * @@ -43,7 +43,7 @@ typedef struct { ETableSubset base; ETableSortInfo *sort_info; - + ETableHeader *full_header; int sort_info_changed_id; diff --git a/widgets/table/e-table-sorter.c b/widgets/table/e-table-sorter.c index 1d70c4959c..365b869795 100644 --- a/widgets/table/e-table-sorter.c +++ b/widgets/table/e-table-sorter.c @@ -165,10 +165,10 @@ ets_class_init (ETableSorterClass *klass) sorter_class->model_to_sorted = ets_model_to_sorted ; sorter_class->sorted_to_model = ets_sorted_to_model ; sorter_class->get_model_to_sorted_array = ets_get_model_to_sorted_array ; - sorter_class->get_sorted_to_model_array = ets_get_sorted_to_model_array ; + 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_object_class_install_property (object_class, PROP_SORT_INFO, g_param_spec_object ("sort_info", _("Sort Info"), /*_( */"XXX blurb" /*)*/, @@ -198,7 +198,7 @@ ETableSorter * e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) { ETableSorter *ets = g_object_new (E_TABLE_SORTER_TYPE, NULL); - + ets->sort_info = sort_info; g_object_ref(ets->sort_info); ets->full_header = full_header; @@ -220,7 +220,7 @@ e_table_sorter_new (ETableModel *source, ETableHeader *full_header, ETableSortIn G_CALLBACK (ets_sort_info_changed), ets); ets->group_info_changed_id = g_signal_connect (sort_info, "group_info_changed", G_CALLBACK (ets_sort_info_changed), ets); - + return ets; } diff --git a/widgets/table/e-table-sorter.h b/widgets/table/e-table-sorter.h index e9bce1bfe7..e4c389c148 100644 --- a/widgets/table/e-table-sorter.h +++ b/widgets/table/e-table-sorter.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-sorter.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-sorting-utils.c b/widgets/table/e-table-sorting-utils.c index 9a3f1913d8..b2fb86958c 100644 --- a/widgets/table/e-table-sorting-utils.c +++ b/widgets/table/e-table-sorting-utils.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-sorting-utils.c * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-sorting-utils.h b/widgets/table/e-table-sorting-utils.h index d4ed88876b..cfcde6091b 100644 --- a/widgets/table/e-table-sorting-utils.h +++ b/widgets/table/e-table-sorting-utils.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-sorting-utils.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index 8ee2eb3c8c..47bc9c4a13 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -106,7 +106,7 @@ etsp_init (ETableSpecification *etsp) * * Creates a new %ETableSpecification object. This object is used to hold the * information about the rendering information for ETable. - * + * * Returns: a newly created %ETableSpecification object. */ ETableSpecification * @@ -123,7 +123,7 @@ e_table_specification_new (void) * @filename: a filename that contains an ETableSpecification * * This routine modifies @specification to reflect the state described - * by the file @filename. + * by the file @filename. * * Returns: TRUE on success, FALSE on failure. */ @@ -279,7 +279,7 @@ e_table_specification_load_from_node (ETableSpecification *specification, * @specification: An %ETableSpecification that you want to save * @filename: a file name to store the specification. * - * This routine stores the @specification into @filename. + * This routine stores the @specification into @filename. * * Returns: 0 on success or -1 on error. */ @@ -289,20 +289,20 @@ e_table_specification_save_to_file (ETableSpecification *specification, { xmlDoc *doc; int ret; - + g_return_val_if_fail (specification != NULL, -1); g_return_val_if_fail (filename != NULL, -1); g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), -1); - + if ((doc = xmlNewDoc ((const unsigned char *)"1.0")) == NULL) return -1; - + xmlDocSetRootElement (doc, e_table_specification_save_to_node (specification, doc)); - + ret = e_xml_save_file (filename, doc); - + xmlFreeDoc (doc); - + return ret; } @@ -312,7 +312,7 @@ e_table_specification_save_to_file (ETableSpecification *specification, * * Saves the state of @specification to a string. * - * Returns: an g_alloc() allocated string containing the stringified + * Returns: an g_alloc() allocated string containing the stringified * representation of @specification. This stringified representation * uses XML as a convenience. */ @@ -326,7 +326,7 @@ e_table_specification_save_to_string (ETableSpecification *specification) g_return_val_if_fail (specification != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (specification), NULL); - + doc = xmlNewDoc ((const unsigned char *)"1.0"); xmlDocSetRootElement (doc, e_table_specification_save_to_node (specification, doc)); xmlDocDumpMemory (doc, &string, &length); @@ -342,7 +342,7 @@ e_table_specification_save_to_string (ETableSpecification *specification) * @doc: Node where the specification is saved * * This routine saves the %ETableSpecification state in the object @specification - * into the xmlDoc represented by @doc. + * into the xmlDoc represented by @doc. * * Returns: The node that has been attached to @doc with the contents * of the ETableSpecification. @@ -393,7 +393,7 @@ e_table_specification_save_to_node (ETableSpecification *specification, if (specification->columns){ int i; - + for (i = 0; specification->columns [i]; i++) e_table_column_specification_save_to_node ( specification->columns [i], @@ -422,7 +422,7 @@ e_table_specification_duplicate (ETableSpecification *spec) g_return_val_if_fail (spec != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_SPECIFICATION (spec), NULL); - + new_spec = e_table_specification_new (); spec_str = e_table_specification_save_to_string (spec); if (!e_table_specification_load_from_string (new_spec, spec_str)) { @@ -431,6 +431,6 @@ e_table_specification_duplicate (ETableSpecification *spec) new_spec = NULL; } g_free (spec_str); - + return new_spec; } diff --git a/widgets/table/e-table-specification.h b/widgets/table/e-table-specification.h index bd2de91c67..75d07c7154 100644 --- a/widgets/table/e-table-specification.h +++ b/widgets/table/e-table-specification.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-specification.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c index 5e15a02c4b..57d4376612 100644 --- a/widgets/table/e-table-state.c +++ b/widgets/table/e-table-state.c @@ -52,7 +52,7 @@ etst_dispose (GObject *object) G_OBJECT_CLASS (e_table_state_parent_class)->dispose (object); } - + static void etst_finalize (GObject *object) { @@ -67,7 +67,7 @@ etst_finalize (GObject *object) g_free (etst->expansions); etst->expansions = NULL; } - + G_OBJECT_CLASS (e_table_state_parent_class)->finalize (object); } @@ -130,7 +130,7 @@ e_table_state_load_from_file (ETableState *state, return FALSE; } -void +void e_table_state_load_from_string (ETableState *state, const char *xml) { @@ -192,7 +192,7 @@ e_table_state_load_from_node (ETableState *state, for (iterator = list, i = 0; iterator; i++) { int_and_double *column_info = iterator->data; - + state->columns [i] = column_info->column; state->expansions [i] = column_info->expansion; g_free (column_info); @@ -206,14 +206,14 @@ e_table_state_save_to_file (ETableState *state, const char *filename) { xmlDoc *doc; - + if ((doc = xmlNewDoc ((const unsigned char *)"1.0")) == NULL) return; - + xmlDocSetRootElement (doc, e_table_state_save_to_node (state, NULL)); - + e_xml_save_file (filename, doc); - + xmlFreeDoc (doc); } @@ -279,7 +279,7 @@ e_table_state_duplicate (ETableState *state) { ETableState *new_state; char *copy; - + g_return_val_if_fail (state != NULL, NULL); g_return_val_if_fail (E_IS_TABLE_STATE (state), NULL); diff --git a/widgets/table/e-table-state.h b/widgets/table/e-table-state.h index 2c155eaa19..5612d3fe49 100644 --- a/widgets/table/e-table-state.h +++ b/widgets/table/e-table-state.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-state.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index f8548139fe..14adabec8b 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -44,7 +44,7 @@ etssv_add (ETableSubsetVariable *etssv, { ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); - + e_table_model_pre_change(etm); if (etss->n_map + 1 > etssv->n_vals_allocated){ @@ -67,7 +67,7 @@ etssv_add_array (ETableSubsetVariable *etssv, int i; e_table_model_pre_change(etm); - + if (etss->n_map + count > etssv->n_vals_allocated){ etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, count); etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(int)); @@ -87,7 +87,7 @@ etssv_add_all (ETableSubsetVariable *etssv) int i; e_table_model_pre_change(etm); - + rows = e_table_model_row_count(etss->source); if (etss->n_map + rows > etssv->n_vals_allocated){ etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, rows); @@ -106,13 +106,13 @@ etssv_remove (ETableSubsetVariable *etssv, ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); int i; - + for (i = 0; i < etss->n_map; i++){ if (etss->map_table[i] == row) { e_table_model_pre_change (etm); memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof(int)); etss->n_map --; - + e_table_model_row_deleted (etm, i); return TRUE; } @@ -216,7 +216,7 @@ e_table_subset_variable_clear (ETableSubsetVariable *etssv) g_free (etss->map_table); etss->map_table = (int *)g_new (unsigned int, 1); etssv->n_vals_allocated = 1; - + e_table_model_changed (etm); } diff --git a/widgets/table/e-table-subset-variable.h b/widgets/table/e-table-subset-variable.h index a02b096dbb..5789e0696a 100644 --- a/widgets/table/e-table-subset-variable.h +++ b/widgets/table/e-table-subset-variable.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-subset-variable.h * Copyright 2000, 2001, Ximian, Inc. * @@ -44,7 +44,7 @@ typedef struct { typedef struct { ETableSubsetClass parent_class; - + void (*add) (ETableSubsetVariable *ets, gint row); void (*add_array) (ETableSubsetVariable *ets, diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index 7c7e8a6def..0c4849a649 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -403,7 +403,7 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, int nvals) etss->n_map = nvals; etss->source = source; g_object_ref (source); - + /* Init */ for (i = 0; i < nvals; i++) etss->map_table [i] = i; @@ -422,7 +422,7 @@ e_table_subset_construct (ETableSubset *etss, ETableModel *source, int nvals) G_CALLBACK (etss_proxy_model_rows_inserted), etss); etss->table_model_rows_deleted_id = g_signal_connect (G_OBJECT (source), "model_rows_deleted", G_CALLBACK (etss_proxy_model_rows_deleted), etss); - + return E_TABLE_MODEL (etss); } diff --git a/widgets/table/e-table-subset.h b/widgets/table/e-table-subset.h index 04f1c7efe5..a17b0af976 100644 --- a/widgets/table/e-table-subset.h +++ b/widgets/table/e-table-subset.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-subset.h - Implements a table that contains a subset of another table. * Copyright 1999, 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-tooltip.h b/widgets/table/e-table-tooltip.h index 40fbd5c7d2..2761fccb06 100644 --- a/widgets/table/e-table-tooltip.h +++ b/widgets/table/e-table-tooltip.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-tooltip.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-tree.h b/widgets/table/e-table-tree.h index dd9b844943..0261eb1b6c 100644 --- a/widgets/table/e-table-tree.h +++ b/widgets/table/e-table-tree.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-tree.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-utils.h b/widgets/table/e-table-utils.h index 1a2c213d2d..989a38945e 100644 --- a/widgets/table/e-table-utils.h +++ b/widgets/table/e-table-utils.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-utils.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index f3c5965716..16e94b2505 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -50,7 +50,7 @@ struct _ETableWithoutPrivate { void *closure; }; -static gboolean +static gboolean check (ETableWithout *etw, int model_row) { gboolean ret_val; @@ -67,7 +67,7 @@ check (ETableWithout *etw, int model_row) return ret_val; } -static gboolean +static gboolean check_with_key (ETableWithout *etw, void *key, int model_row) { gboolean ret_val; diff --git a/widgets/table/e-table-without.h b/widgets/table/e-table-without.h index c0241dae2d..57d6a4cfe2 100644 --- a/widgets/table/e-table-without.h +++ b/widgets/table/e-table-without.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table-without.h * Copyright 2000, 2001, Ximian, Inc. * @@ -54,7 +54,7 @@ typedef struct { typedef struct { ETableSubsetClass parent_class; - + } ETableWithoutClass; GType e_table_without_get_type (void); diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index 0925e399f9..a6adf312cf 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -206,7 +206,7 @@ static ETableCol * current_search_col (ETable *et) { if (!et->search_col_set) { - et->current_search_col = + et->current_search_col = e_table_util_calculate_current_search_col (et->header, et->full_header, et->sort_info, @@ -319,7 +319,7 @@ et_dispose (GObject *object) et->group_info_change_id); et->group_info_change_id = 0; } - + if (et->sort_info_change_id) { g_signal_handler_disconnect (G_OBJECT (et->sort_info), et->sort_info_change_id); @@ -480,10 +480,10 @@ init_search (ETable *e_table) e_table->search = e_table_search_new(); - e_table->search_search_id = + e_table->search_search_id = g_signal_connect (G_OBJECT (e_table->search), "search", G_CALLBACK (et_search_search), e_table); - e_table->search_accept_id = + e_table->search_accept_id = g_signal_connect (G_OBJECT (e_table->search), "accept", G_CALLBACK (et_search_accept), e_table); } @@ -925,7 +925,7 @@ et_build_groups (ETable *et) et->model, et->sort_info, 0); - + if (et->use_click_to_add_end) e_canvas_vbox_add_item_start(E_CANVAS_VBOX(et->canvas_vbox), GNOME_CANVAS_ITEM(et->group)); else @@ -1092,7 +1092,7 @@ static gint table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data) { GnomeCanvas *canvas; - ECanvas *ecanvas; + ECanvas *ecanvas; ETable *etable; gtk_widget_queue_draw (widget); @@ -1108,8 +1108,8 @@ table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer d etable = E_TABLE (data); - if (e_table_model_row_count(etable->model) < 1 - && (etable->click_to_add) + if (e_table_model_row_count(etable->model) < 1 + && (etable->click_to_add) && !(E_TABLE_CLICK_TO_ADD(etable->click_to_add)->row)) { gnome_canvas_item_grab_focus (etable->canvas_vbox); gnome_canvas_item_grab_focus (etable->click_to_add); @@ -1160,7 +1160,7 @@ click_to_add_event (ETableClickToAdd *etcta, GdkEventKey *key, ETable *etable) if (key->type != GDK_KEY_PRESS && key->type != GDK_KEY_RELEASE) { return FALSE; - } + } switch (key->keyval) { case GDK_Tab: case GDK_KP_Tab: @@ -1305,7 +1305,7 @@ e_table_set_state_object(ETable *e_table, ETableState *state) connect_header (e_table, state); - g_value_set_double (val, (double) (GTK_WIDGET(e_table->table_canvas)->allocation.width)); + g_value_set_double (val, (double) (GTK_WIDGET(e_table->table_canvas)->allocation.width)); g_object_set_property (G_OBJECT (e_table->header), "width", val); g_free (val); @@ -1344,7 +1344,7 @@ e_table_set_state_object(ETable *e_table, ETableState *state) g_object_set(e_table->click_to_add, "header", e_table->header, NULL); - + e_table->need_rebuild = TRUE; if (!e_table->rebuild_idle_id) e_table->rebuild_idle_id = g_idle_add_full (20, changed_idle, e_table, NULL); @@ -1452,11 +1452,11 @@ e_table_get_state_object (ETable *e_table) /** * e_table_get_state: * @e_table: The #ETable to act on. - * + * * Builds a state object based on the current state and returns the * string corresponding to that state. - * - * Return value: + * + * Return value: * A string describing the current state of the #ETable. **/ gchar *e_table_get_state (ETable *e_table) @@ -1623,11 +1623,11 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, * @ete: An optional #ETableExtras. (%NULL is valid.) * @spec_str: The spec. * @state_str: An optional state. (%NULL is valid.) - * + * * This is the internal implementation of e_table_new() for use by * subclasses or language bindings. See e_table_new() for details. - * - * Return value: + * + * Return value: * The passed in value @e_table or %NULL if there's an error. **/ ETable * @@ -1686,8 +1686,8 @@ e_table_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, * This is the internal implementation of e_table_new_from_spec_file() * for use by subclasses or language bindings. See * e_table_new_from_spec_file() for details. - * - * Return value: + * + * Return value: * The passed in value @e_table or %NULL if there's an error. **/ ETable * @@ -1752,8 +1752,8 @@ e_table_construct_from_spec_file (ETable *e_table, ETableModel *etm, ETableExtra * default sorting state and such. @state is an optional string * specifying the current sorting state and such. If @state is NULL, * then the default state from the spec will be used. - * - * Return value: + * + * Return value: * The newly created #ETable or %NULL if there's an error. **/ GtkWidget * @@ -1779,7 +1779,7 @@ e_table_new (ETableModel *etm, ETableExtras *ete, const char *spec, const char * * @ete: An optional #ETableExtras. (%NULL is valid.) * @spec_fn: The filename of the spec. * @state_fn: An optional state file. (%NULL is valid.) - * + * * This is very similar to e_table_new(), except instead of passing in * strings you pass in the file names of the spec and state to load. * @@ -1789,8 +1789,8 @@ e_table_new (ETableModel *etm, ETableExtras *ete, const char *spec, const char * * @state_fn is the filename of the initial state to load. If this is * %NULL or if the specified file doesn't exist, the default state * from the spec file is used. - * - * Return value: + * + * Return value: * The newly created #ETable or %NULL if there's an error. **/ GtkWidget * @@ -1920,13 +1920,13 @@ void e_table_save_specification (ETable *e_table, const char *filename) { xmlDoc *doc = et_build_tree (e_table); - + g_return_if_fail(e_table != NULL); g_return_if_fail(E_IS_TABLE(e_table)); g_return_if_fail(filename != NULL); - + e_xml_save_file (filename, doc); - + xmlFreeDoc (doc); } @@ -1961,7 +1961,7 @@ e_table_load_specification (ETable *e_table, gchar *filename) * e_table_set_cursor_row: * @e_table: The #ETable to set the cursor row of * @row: The row number - * + * * Sets the cursor row and the selection to the given row number. **/ void @@ -1979,10 +1979,10 @@ e_table_set_cursor_row (ETable *e_table, int row) /** * e_table_get_cursor_row: * @e_table: The #ETable to query - * + * * Calculates the cursor row. -1 means that we don't have a cursor. - * - * Return value: + * + * Return value: * Cursor row **/ int @@ -2003,7 +2003,7 @@ e_table_get_cursor_row (ETable *e_table) * @e_table: The #ETable to act on * @callback: The callback function to call * @closure: The value passed to the callback's closure argument - * + * * Calls the given @callback function once for every selected row. * * If you change the selection or delete or add rows to the table @@ -2027,10 +2027,10 @@ e_table_selected_row_foreach (ETable *e_table, /** * e_table_selected_count: * @e_table: The #ETable to query - * + * * Counts the number of selected rows. - * - * Return value: + * + * Return value: * The number of rows selected. **/ gint @@ -2045,7 +2045,7 @@ e_table_selected_count (ETable *e_table) /** * e_table_select_all: * @table: The #ETable to modify - * + * * Selects all the rows in @table. **/ void @@ -2060,7 +2060,7 @@ e_table_select_all (ETable *table) /** * e_table_invert_selection: * @table: The #ETable to modify - * + * * Inverts the selection in @table. **/ void @@ -2076,10 +2076,10 @@ e_table_invert_selection (ETable *table) /** * e_table_get_printable: * @e_table: #ETable to query - * + * * Used for printing your #ETable. - * - * Return value: + * + * Return value: * The #EPrintable to print. **/ EPrintable * @@ -2094,7 +2094,7 @@ e_table_get_printable (ETable *e_table) /** * e_table_right_click_up: * @table: The #ETable to modify. - * + * * Call this function when you're done handling the right click if you * return TRUE from the "right_click" signal. **/ @@ -2107,7 +2107,7 @@ e_table_right_click_up (ETable *table) /** * e_table_commit_click_to_add: * @table: The #ETable to modify - * + * * Commits the current values in the click to add to the table. **/ void @@ -2244,11 +2244,11 @@ set_scroll_adjustments (ETable *table, * e_table_get_next_row: * @e_table: The #ETable to query * @model_row: The model row to go from - * + * * This function is used when your table is sorted, but you're using * model row numbers. It returns the next row in sorted order as a model row. - * - * Return value: + * + * Return value: * The model row number. **/ gint @@ -2277,12 +2277,12 @@ e_table_get_next_row (ETable *e_table, * e_table_get_prev_row: * @e_table: The #ETable to query * @model_row: The model row to go from - * + * * This function is used when your table is sorted, but you're using * model row numbers. It returns the previous row in sorted order as * a model row. - * - * Return value: + * + * Return value: * The model row number. **/ gint @@ -2308,10 +2308,10 @@ e_table_get_prev_row (ETable *e_table, * e_table_model_to_view_row: * @e_table: The #ETable to query * @model_row: The model row number - * + * * Turns a model row into a view row. - * - * Return value: + * + * Return value: * The view row number. **/ gint @@ -2331,10 +2331,10 @@ e_table_model_to_view_row (ETable *e_table, * e_table_view_to_model_row: * @e_table: The #ETable to query * @view_row: The view row number - * + * * Turns a view row into a model row. - * - * Return value: + * + * Return value: * The model row number. **/ gint @@ -2357,7 +2357,7 @@ e_table_view_to_model_row (ETable *e_table, * @y: Y coordinate for the pixel * @row_return: Pointer to return the row value * @col_return: Pointer to return the column value - * + * * Return the row and column for the cell in which the pixel at (@x, @y) is * contained. **/ @@ -2388,7 +2388,7 @@ e_table_get_cell_at (ETable *table, * @y_return: Returns the y coordinate of the upper left hand corner of the cell with respect to the widget. * @width_return: Returns the width of the cell. * @height_return: Returns the height of the cell. - * + * * Returns the x, y, width, and height of the given cell. These can * all be #NULL and they just won't be set. **/ @@ -2416,11 +2416,11 @@ e_table_get_cell_geometry (ETable *table, /** * e_table_get_selection_model: * @table: The #ETable to query - * + * * Returns the table's #ESelectionModel in case you want to access it * directly. - * - * Return value: + * + * Return value: * The #ESelectionModel. **/ ESelectionModel * @@ -2504,14 +2504,14 @@ struct _GtkDragSourceInfo /** * e_table_drag_get_data: - * @table: - * @row: - * @col: - * @context: - * @target: - * @time: - * - * + * @table: + * @row: + * @col: + * @context: + * @target: + * @time: + * + * **/ void e_table_drag_get_data (ETable *table, @@ -2586,7 +2586,7 @@ e_table_drag_highlight (ETable *table, /** * e_table_drag_unhighlight: * @table: The #ETable to unhighlight - * + * * Removes the highlight from an #ETable. **/ void @@ -2688,7 +2688,7 @@ et_real_start_drag (ETable *table, int row, int col, GdkEvent *event) * @targets: Table of targets for this source * @n_targets: Number of targets in @targets * @actions: Actions allowed for this source - * + * * Registers this table as a drag site, and possibly adds default behaviors. **/ void @@ -2735,7 +2735,7 @@ e_table_drag_source_set (ETable *table, /** * e_table_drag_source_unset: * @table: The #ETable to un set up as a drag site - * + * * Unregisters this #ETable as a drag site. **/ void @@ -2770,10 +2770,10 @@ e_table_drag_source_unset (ETable *table) * @actions: The available actions supported by the drag * @button: The button held down for the drag * @event: The event that initiated the drag - * + * * Start a drag from this cell. - * - * Return value: + * + * Return value: * The drag context. **/ GdkDragContext * @@ -2896,7 +2896,7 @@ scroll_timeout (gpointer data) et->last_drop_x, et->last_drop_y, et->last_drop_time); - + return TRUE; } diff --git a/widgets/table/e-table.h b/widgets/table/e-table.h index 6be18b462d..7d6bb2a97e 100644 --- a/widgets/table/e-table.h +++ b/widgets/table/e-table.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-table.h - A graphical view of a Table. * Copyright 1999, 2000, 2001, Ximian, Inc. * @@ -129,7 +129,7 @@ typedef struct { guint uniform_row_height : 1; guint allow_grouping : 1; - + guint always_search : 1; guint search_col_set : 1; @@ -195,8 +195,8 @@ typedef struct { int row, int col, GdkDragContext *context); - - /* Target side drag signals */ + + /* Target side drag signals */ void (* table_drag_leave) (ETable *table, int row, int col, diff --git a/widgets/table/e-tree-memory-callbacks.c b/widgets/table/e-tree-memory-callbacks.c index 7be5be153c..b10e14c262 100644 --- a/widgets/table/e-tree-memory-callbacks.c +++ b/widgets/table/e-tree-memory-callbacks.c @@ -102,7 +102,7 @@ etmc_sort_value_at (ETreeModel *etm, ETreePath node, int col) if (etmc->sort_value_at) return etmc->sort_value_at (etm, node, col, etmc->model_data); - else + else return etmc->value_at (etm, node, col, etmc->model_data); } @@ -156,7 +156,7 @@ static void * etmc_initialize_value (ETreeModel *etm, int col) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); - + if (etmc->initialize_value) return etmc->initialize_value (etm, col, etmc->model_data); else @@ -167,7 +167,7 @@ static gboolean etmc_value_is_empty (ETreeModel *etm, int col, const void *value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); - + if (etmc->value_is_empty) return etmc->value_is_empty (etm, col, value, etmc->model_data); else @@ -178,7 +178,7 @@ static char * etmc_value_to_string (ETreeModel *etm, int col, const void *value) { ETreeMemoryCallbacks *etmc = E_TREE_MEMORY_CALLBACKS(etm); - + if (etmc->value_to_string) return etmc->value_to_string (etm, col, value, etmc->model_data); else @@ -220,7 +220,7 @@ e_tree_memory_callbacks_init (ETreeMemoryCallbacks *etmc) /** * e_tree_memory_callbacks_new: - * + * * This initializes a new ETreeMemoryCallbacksModel object. * ETreeMemoryCallbacksModel is an implementaiton of the somewhat * abstract class ETreeMemory. The ETreeMemoryCallbacksModel is @@ -231,8 +231,8 @@ e_tree_memory_callbacks_init (ETreeMemoryCallbacks *etmc) * Instead, ETreeMemoryCallbacksModel uses a setup based in callback functions, every * callback function signature mimics the signature of each ETreeModel method * and passes the extra @data pointer to each one of the method to provide them - * with any context they might want to use. - * + * with any context they might want to use. + * * ETreeMemoryCallbacks is to ETreeMemory as ETableSimple is to ETableModel. * * Return value: An ETreeMemoryCallbacks object (which is also an diff --git a/widgets/table/e-tree-memory-callbacks.h b/widgets/table/e-tree-memory-callbacks.h index 04df18ae7a..dcec18a8ba 100644 --- a/widgets/table/e-tree-memory-callbacks.h +++ b/widgets/table/e-tree-memory-callbacks.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-memory-callbacks.h * Copyright 2000, 2001, Ximian, Inc. * @@ -71,7 +71,7 @@ typedef struct { ETreeMemoryCallbacksHasGetNodeByIdFn has_get_node_by_id; ETreeMemoryCallbacksGetNodeByIdFn get_node_by_id; - ETreeMemoryCallbacksValueAtFn sort_value_at; + ETreeMemoryCallbacksValueAtFn sort_value_at; ETreeMemoryCallbacksValueAtFn value_at; ETreeMemoryCallbacksSetValueAtFn set_value_at; ETreeMemoryCallbacksIsEditableFn is_editable; diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 4ea1e01c3d..301468c3d4 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -166,11 +166,11 @@ e_tree_path_unlink (ETreeMemoryPath *path) /** * e_tree_memory_freeze: * @etmm: the ETreeModel to freeze. - * + * * This function prepares an ETreeModel for a period of much change. * All signals regarding changes to the tree are deferred until we * thaw the tree. - * + * **/ void e_tree_memory_freeze(ETreeMemory *etmm) @@ -186,11 +186,11 @@ e_tree_memory_freeze(ETreeMemory *etmm) /** * e_tree_memory_thaw: * @etmm: the ETreeMemory to thaw. - * + * * This function thaws an ETreeMemory. All the defered signals can add * up to a lot, we don't know - so we just emit a model_changed * signal. - * + * **/ void e_tree_memory_thaw(ETreeMemory *etmm) @@ -399,9 +399,9 @@ e_tree_memory_init (ETreeMemory *etmm) /** * e_tree_memory_construct: - * @etree: - * - * + * @etree: + * + * **/ void e_tree_memory_construct (ETreeMemory *etmm) @@ -432,18 +432,18 @@ void e_tree_memory_set_expanded_default (ETreeMemory *etree, gboolean expanded) { g_return_if_fail (etree != NULL); - + etree->priv->expanded_default = expanded; } /** * e_tree_memory_node_get_data: - * @etmm: - * @node: - * - * - * - * Return value: + * @etmm: + * @node: + * + * + * + * Return value: **/ gpointer e_tree_memory_node_get_data (ETreeMemory *etmm, ETreePath node) @@ -457,11 +457,11 @@ e_tree_memory_node_get_data (ETreeMemory *etmm, ETreePath node) /** * e_tree_memory_node_set_data: - * @etmm: - * @node: - * @node_data: - * - * + * @etmm: + * @node: + * @node_data: + * + * **/ void e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_data) @@ -475,14 +475,14 @@ e_tree_memory_node_set_data (ETreeMemory *etmm, ETreePath node, gpointer node_da /** * e_tree_memory_node_insert: - * @tree_model: - * @parent_path: - * @position: - * @node_data: - * - * - * - * Return value: + * @tree_model: + * @parent_path: + * @position: + * @node_data: + * + * + * + * Return value: **/ ETreePath e_tree_memory_node_insert (ETreeMemory *tree_model, @@ -530,14 +530,14 @@ ETreePath e_tree_memory_node_insert_id (ETreeMemory *etree, ETreePath parent /** * e_tree_memory_node_insert_before: - * @etree: - * @parent: - * @sibling: - * @node_data: - * - * - * - * Return value: + * @etree: + * @parent: + * @sibling: + * @node_data: + * + * + * + * Return value: **/ ETreePath e_tree_memory_node_insert_before (ETreeMemory *etree, @@ -585,12 +585,12 @@ child_free(ETreeMemory *etree, ETreeMemoryPath *node) /** * e_tree_memory_node_remove: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ gpointer e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) @@ -606,7 +606,7 @@ e_tree_memory_node_remove (ETreeMemory *etree, ETreePath node) if (!etree->priv->frozen) { e_tree_model_pre_change(E_TREE_MODEL(etree)); for (old_position = 0, sibling = path; - sibling; + sibling; old_position++, sibling = sibling->prev_sibling) /* Empty intentionally*/; old_position --; @@ -661,7 +661,7 @@ e_tree_memory_sort_node (ETreeMemory *etmm, ETreeMemoryPath *last; e_tree_model_pre_change (E_TREE_MODEL (etmm)); - + i = 0; for (child = path->first_child; child; child = child->next_sibling) i++; diff --git a/widgets/table/e-tree-memory.h b/widgets/table/e-tree-memory.h index ca498c99eb..a1318e28d3 100644 --- a/widgets/table/e-tree-memory.h +++ b/widgets/table/e-tree-memory.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-memory.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c index b694536763..54cece5d00 100644 --- a/widgets/table/e-tree-model.c +++ b/widgets/table/e-tree-model.c @@ -203,19 +203,19 @@ e_tree_model_init (ETreeModel *tree_model) /** * e_tree_model_node_changed: - * @tree_model: - * @node: - * - * - * - * Return value: + * @tree_model: + * @node: + * + * + * + * Return value: **/ void e_tree_model_pre_change (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); - + d(g_print("Emitting pre_change on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [PRE_CHANGE], 0); @@ -223,19 +223,19 @@ e_tree_model_pre_change (ETreeModel *tree_model) /** * e_tree_model_node_changed: - * @tree_model: - * @node: - * - * - * - * Return value: + * @tree_model: + * @node: + * + * + * + * Return value: **/ void e_tree_model_no_change (ETreeModel *tree_model) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); - + d(g_print("Emitting no_change on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NO_CHANGE], 0); @@ -243,19 +243,19 @@ e_tree_model_no_change (ETreeModel *tree_model) /** * e_tree_model_node_changed: - * @tree_model: - * @node: - * - * - * - * Return value: + * @tree_model: + * @node: + * + * + * + * Return value: **/ void e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); - + d(g_print("Emitting node_changed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_CHANGED], 0, node); @@ -263,19 +263,19 @@ e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node) /** * e_tree_model_node_data_changed: - * @tree_model: - * @node: - * - * - * - * Return value: + * @tree_model: + * @node: + * + * + * + * Return value: **/ void e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); - + d(g_print("Emitting node_data_changed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_DATA_CHANGED], 0, node); @@ -283,19 +283,19 @@ e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node) /** * e_tree_model_node_col_changed: - * @tree_model: - * @node: - * - * - * - * Return value: + * @tree_model: + * @node: + * + * + * + * Return value: **/ void e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, int col) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); - + d(g_print("Emitting node_col_changed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_COL_CHANGED], 0, node, col); @@ -303,11 +303,11 @@ e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, int col) /** * e_tree_model_node_inserted: - * @tree_model: - * @parent_node: - * @inserted_node: - * - * + * @tree_model: + * @parent_node: + * @inserted_node: + * + * **/ void e_tree_model_node_inserted (ETreeModel *tree_model, @@ -325,18 +325,18 @@ e_tree_model_node_inserted (ETreeModel *tree_model, /** * e_tree_model_node_removed: - * @tree_model: - * @parent_node: - * @removed_node: - * - * + * @tree_model: + * @parent_node: + * @removed_node: + * + * **/ void e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETreePath removed_node, int old_position) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); - + d(g_print("Emitting node_removed on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_REMOVED], 0, @@ -345,17 +345,17 @@ e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETree /** * e_tree_model_node_deleted: - * @tree_model: - * @deleted_node: - * - * + * @tree_model: + * @deleted_node: + * + * **/ void e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); - + d(g_print("Emitting node_deleted on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_DELETED], 0, deleted_node); @@ -363,17 +363,17 @@ e_tree_model_node_deleted (ETreeModel *tree_model, ETreePath deleted_node) /** * e_tree_model_node_request_collapse: - * @tree_model: - * @collapsed_node: - * - * + * @tree_model: + * @collapsed_node: + * + * **/ void e_tree_model_node_request_collapse (ETreeModel *tree_model, ETreePath collapsed_node) { g_return_if_fail (tree_model != NULL); g_return_if_fail (E_IS_TREE_MODEL (tree_model)); - + d(g_print("Emitting node_request_collapse on model 0x%p, a %s.\n", tree_model, gtk_type_name (GTK_OBJECT(tree_model)->klass->type))); g_signal_emit (G_OBJECT (tree_model), e_tree_model_signals [NODE_REQUEST_COLLAPSE], 0, collapsed_node); @@ -402,7 +402,7 @@ e_tree_model_new (void) * * return values: the ETreePath corresponding to the root node. */ -ETreePath +ETreePath e_tree_model_get_root (ETreeModel *etree) { g_return_val_if_fail (etree != NULL, NULL); @@ -416,14 +416,14 @@ e_tree_model_get_root (ETreeModel *etree) /** * e_tree_model_node_get_parent: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ -ETreePath +ETreePath e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node) { g_return_val_if_fail(etree != NULL, NULL); @@ -435,14 +435,14 @@ e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node) /** * e_tree_model_node_get_first_child: - * @etree: - * @node: - * - * - * - * Return value: + * @etree: + * @node: + * + * + * + * Return value: **/ -ETreePath +ETreePath e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); @@ -456,14 +456,14 @@ e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node) /** * e_tree_model_node_get_last_child: - * @etree: - * @node: - * - * - * - * Return value: + * @etree: + * @node: + * + * + * + * Return value: **/ -ETreePath +ETreePath e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); @@ -478,14 +478,14 @@ e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node) /** * e_tree_model_node_get_next: - * @etree: - * @node: - * - * - * - * Return value: + * @etree: + * @node: + * + * + * + * Return value: **/ -ETreePath +ETreePath e_tree_model_node_get_next (ETreeModel *etree, ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); @@ -499,14 +499,14 @@ e_tree_model_node_get_next (ETreeModel *etree, ETreePath node) /** * e_tree_model_node_get_prev: - * @etree: - * @node: - * - * - * - * Return value: + * @etree: + * @node: + * + * + * + * Return value: **/ -ETreePath +ETreePath e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) { g_return_val_if_fail (etree != NULL, NULL); @@ -520,12 +520,12 @@ e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node) /** * e_tree_model_node_is_root: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ gboolean e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) @@ -540,12 +540,12 @@ e_tree_model_node_is_root (ETreeModel *etree, ETreePath node) /** * e_tree_model_node_is_expandable: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ gboolean e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node) @@ -571,12 +571,12 @@ e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **n /** * e_tree_model_node_depth: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ guint e_tree_model_node_depth (ETreeModel *etree, ETreePath node) @@ -761,12 +761,12 @@ e_tree_model_has_change_pending (ETreeModel *etree) * @etree: The ETreeModel. * @node: The ETreePath to the node we're getting the data from. * @col: the column to retrieve data from - * + * * Return value: This function returns the value that is stored by the * @etree in column @col and node @node. The data returned can be a * pointer or any data value that can be stored inside a pointer. * - * The data returned is typically used by an sort renderer if it wants + * The data returned is typically used by an sort renderer if it wants * to proxy the data of cell value_at at a better sorting order. * * The data returned must be valid until the model sends a signal that @@ -793,7 +793,7 @@ e_tree_model_sort_value_at (ETreeModel *etree, ETreePath node, int col) * @etree: The ETreeModel. * @node: The ETreePath to the node we're getting the data from. * @col: the column to retrieve data from - * + * * Return value: This function returns the value that is stored by the * @etree in column @col and node @node. The data returned can be a * pointer or any data value that can be stored inside a pointer. @@ -831,12 +831,12 @@ e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, int col, const voi /** * e_tree_model_node_is_editable: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ gboolean e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, int col) @@ -851,12 +851,12 @@ e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, int col) /** * e_tree_model_duplicate_value: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ void * e_tree_model_duplicate_value (ETreeModel *etree, int col, const void *value) @@ -871,12 +871,12 @@ e_tree_model_duplicate_value (ETreeModel *etree, int col, const void *value) /** * e_tree_model_free_value: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ void e_tree_model_free_value (ETreeModel *etree, int col, void *value) @@ -889,12 +889,12 @@ e_tree_model_free_value (ETreeModel *etree, int col, void *value) /** * e_tree_model_initialize_value: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ void * e_tree_model_initialize_value (ETreeModel *etree, int col) @@ -909,12 +909,12 @@ e_tree_model_initialize_value (ETreeModel *etree, int col) /** * e_tree_model_value_is_empty: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ gboolean e_tree_model_value_is_empty (ETreeModel *etree, int col, const void *value) @@ -929,12 +929,12 @@ e_tree_model_value_is_empty (ETreeModel *etree, int col, const void *value) /** * e_tree_model_value_to_string: - * @etree: - * @path: - * - * - * - * Return value: + * @etree: + * @path: + * + * + * + * Return value: **/ char * e_tree_model_value_to_string (ETreeModel *etree, int col, const void *value) @@ -949,12 +949,12 @@ e_tree_model_value_to_string (ETreeModel *etree, int col, const void *value) /** * e_tree_model_node_traverse: - * @model: - * @path: - * @func: - * @data: - * - * + * @model: + * @path: + * @func: + * @data: + * + * **/ void e_tree_model_node_traverse (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data) @@ -981,12 +981,12 @@ e_tree_model_node_traverse (ETreeModel *model, ETreePath path, ETreePathFunc fun /** * e_tree_model_node_traverse_preorder: - * @model: - * @path: - * @func: - * @data: - * - * + * @model: + * @path: + * @func: + * @data: + * + * **/ void e_tree_model_node_traverse_preorder (ETreeModel *model, ETreePath path, ETreePathFunc func, gpointer data) @@ -1014,12 +1014,12 @@ e_tree_model_node_traverse_preorder (ETreeModel *model, ETreePath path, ETreePat /** * e_tree_model_node_traverse_preorder: - * @model: - * @path: - * @func: - * @data: - * - * + * @model: + * @path: + * @func: + * @data: + * + * **/ static ETreePath e_tree_model_node_real_traverse (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data) @@ -1057,12 +1057,12 @@ e_tree_model_node_real_traverse (ETreeModel *model, ETreePath path, ETreePath en /** * e_tree_model_node_traverse_preorder: - * @model: - * @path: - * @func: - * @data: - * - * + * @model: + * @path: + * @func: + * @data: + * + * **/ ETreePath e_tree_model_node_find (ETreeModel *model, ETreePath path, ETreePath end_path, gboolean forward_direction, ETreePathFunc func, gpointer data) diff --git a/widgets/table/e-tree-model.h b/widgets/table/e-tree-model.h index ae20775fca..1d6168ff6f 100644 --- a/widgets/table/e-tree-model.h +++ b/widgets/table/e-tree-model.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-model.h * Copyright 2000, 2001, Ximian, Inc. * @@ -88,7 +88,7 @@ struct ETreeModelClass { void *(*value_at) (ETreeModel *etm, ETreePath node, int col); void (*set_value_at) (ETreeModel *etm, ETreePath node, int col, const void *val); gboolean (*is_editable) (ETreeModel *etm, ETreePath node, int col); - + void *(*duplicate_value) (ETreeModel *etm, int col, const void *value); void (*free_value) (ETreeModel *etm, int col, void *value); void *(*initialize_value) (ETreeModel *etm, int col); diff --git a/widgets/table/e-tree-scrolled.h b/widgets/table/e-tree-scrolled.h index 21d543e2d0..9671061222 100644 --- a/widgets/table/e-tree-scrolled.h +++ b/widgets/table/e-tree-scrolled.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-scrolled.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index be6be84dbe..2cd81690a5 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -357,7 +357,7 @@ etsm_is_path_selected (ETreeSelectionModel *etsm, ETreePath path) return FALSE; } -/** +/** * e_selection_model_is_row_selected * @selection: #ESelectionModel to check * @n: The row to check @@ -398,7 +398,7 @@ etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) mac->callback(row, mac->closure); } -/** +/** * e_selection_model_foreach * @selection: #ESelectionModel to traverse * @callback: The callback function to call back. @@ -407,7 +407,7 @@ etsm_row_foreach_cb (gpointer key, gpointer value, gpointer user_data) * This routine calls the given callback function once for each * selected row, passing closure as the closure. */ -static void +static void etsm_foreach (ESelectionModel *selection, EForeachFunc callback, gpointer closure) @@ -422,7 +422,7 @@ etsm_foreach (ESelectionModel *selection, g_hash_table_foreach(etsm->priv->paths, etsm_row_foreach_cb, &mac); } -/** +/** * e_selection_model_clear * @selection: #ESelectionModel to clear * @@ -440,7 +440,7 @@ etsm_clear(ESelectionModel *selection) e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), -1, -1); } -/** +/** * e_selection_model_selected_count * @selection: #ESelectionModel to count * @@ -463,7 +463,7 @@ etsm_row_count (ESelectionModel *selection) return e_table_model_row_count(E_TABLE_MODEL(etsm->priv->etta)); } -/** +/** * e_selection_model_select_all * @selection: #ESelectionModel to select all * @@ -490,7 +490,7 @@ etsm_select_all (ESelectionModel *selection) e_selection_model_cursor_changed(E_SELECTION_MODEL(etsm), get_cursor_row(etsm), etsm->priv->cursor_col); } -/** +/** * e_selection_model_invert_selection * @selection: #ESelectionModel to invert * @@ -802,28 +802,28 @@ e_tree_selection_model_class_init (ETreeSelectionModelClass *klass) esm_class->move_selection_end = etsm_move_selection_end ; esm_class->set_selection_end = etsm_set_selection_end ; - g_object_class_install_property (object_class, PROP_CURSOR_ROW, + g_object_class_install_property (object_class, PROP_CURSOR_ROW, g_param_spec_int ("cursor_row", _("Cursor Row"), /*_( */"XXX blurb" /*)*/, 0, G_MAXINT, 0, G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_CURSOR_COL, + g_object_class_install_property (object_class, PROP_CURSOR_COL, g_param_spec_int ("cursor_col", _("Cursor Column"), /*_( */"XXX blurb" /*)*/, 0, G_MAXINT, 0, G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_MODEL, + g_object_class_install_property (object_class, PROP_MODEL, g_param_spec_object ("model", _("Model"), "XXX blurb", E_TREE_MODEL_TYPE, G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_ETTA, + g_object_class_install_property (object_class, PROP_ETTA, g_param_spec_object ("etta", "ETTA", "XXX blurb", diff --git a/widgets/table/e-tree-selection-model.h b/widgets/table/e-tree-selection-model.h index d574bf3ab6..2920ac6a9e 100644 --- a/widgets/table/e-tree-selection-model.h +++ b/widgets/table/e-tree-selection-model.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-selection-model.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-tree-simple.c b/widgets/table/e-tree-simple.c index f63e991ec1..8d77ca7078 100644 --- a/widgets/table/e-tree-simple.c +++ b/widgets/table/e-tree-simple.c @@ -63,7 +63,7 @@ static void * simple_initialize_value (ETableModel *etm, int col) { ETreeSimple *simple = E_TREE_SIMPLE(etm); - + if (simple->initialize_value) return simple->initialize_value (etm, col, simple->model_data); else @@ -74,7 +74,7 @@ static gboolean simple_value_is_empty (ETableModel *etm, int col, const void *value) { ETreeSimple *simple = E_TREE_SIMPLE(etm); - + if (simple->value_is_empty) return simple->value_is_empty (etm, col, value, simple->model_data); else @@ -85,7 +85,7 @@ static char * simple_value_to_string (ETableModel *etm, int col, const void *value) { ETreeSimple *simple = E_TREE_SIMPLE(etm); - + if (simple->value_to_string) return simple->value_to_string (etm, col, value, simple->model_data); else @@ -147,18 +147,18 @@ G_DEFINE_TYPE (ETreeSimple, e_tree_simple, E_TREE_MODEL_TYPE) /** * e_tree_simple_new: - * @col_count: - * @duplicate_value: - * @free_value: - * @initialize_value: - * @value_is_empty: - * @value_to_string: - * @icon_at: - * @value_at: - * @set_value_at: - * @is_editable: - * @model_data: - * + * @col_count: + * @duplicate_value: + * @free_value: + * @initialize_value: + * @value_is_empty: + * @value_to_string: + * @icon_at: + * @value_at: + * @set_value_at: + * @is_editable: + * @model_data: + * * This initializes a new ETreeSimpleModel object. ETreeSimpleModel is * an implementaiton of the abstract class ETreeModel. The ETreeSimpleModel * is designed to allow people to easily create ETreeModels without having @@ -167,8 +167,8 @@ G_DEFINE_TYPE (ETreeSimple, e_tree_simple, E_TREE_MODEL_TYPE) * Instead, ETreeSimpleModel uses a setup based in callback functions, every * callback function signature mimics the signature of each ETreeModel method * and passes the extra @data pointer to each one of the method to provide them - * with any context they might want to use. - * + * with any context they might want to use. + * * ETreeSimple is to ETreeModel as ETableSimple is to ETableModel. * * Return value: An ETreeSimple object (which is also an ETreeModel diff --git a/widgets/table/e-tree-simple.h b/widgets/table/e-tree-simple.h index d0b4f14828..c96acbcfe8 100644 --- a/widgets/table/e-tree-simple.h +++ b/widgets/table/e-tree-simple.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-simple.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-tree-sorted-variable.c b/widgets/table/e-tree-sorted-variable.c index 0145a409d1..4bb9d9ada7 100644 --- a/widgets/table/e-tree-sorted-variable.c +++ b/widgets/table/e-tree-sorted-variable.c @@ -84,7 +84,7 @@ etsv_dispose (GObject *object) if (etsv->sort_idle_id) g_source_remove(etsv->sort_idle_id); etsv->sort_idle_id = 0; - + if (etsv->insert_idle_id) g_source_remove(etsv->insert_idle_id); etsv->insert_idle_id = 0; @@ -359,7 +359,7 @@ etsv_sort_tree(ETreeSortedVariable *etsv, GNode *root) GNode *childr; etsv_sort_node(etsv, node); - + for (child = node->child; child; child = child->next) { etsv_sort_tree(etsv, child); } diff --git a/widgets/table/e-tree-sorted-variable.h b/widgets/table/e-tree-sorted-variable.h index bf599a0b2d..e737b87e02 100644 --- a/widgets/table/e-tree-sorted-variable.h +++ b/widgets/table/e-tree-sorted-variable.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-sorted-variable.h * Copyright 2000, 2001, Ximian, Inc. * @@ -43,7 +43,7 @@ typedef struct { ETreeModel base; ETableSortInfo *sort_info; - + ETableHeader *full_header; int table_model_changed_id; diff --git a/widgets/table/e-tree-sorted.c b/widgets/table/e-tree-sorted.c index ea8f024dd4..62496a301f 100644 --- a/widgets/table/e-tree-sorted.c +++ b/widgets/table/e-tree-sorted.c @@ -519,7 +519,7 @@ resort_node (ETreeSorted *ets, ETreeSortedPath *path, gboolean resort_all_childr path->child_needs_resort = 0; } } - path->needs_resort = 0; + path->needs_resort = 0; path->child_needs_resort = 0; path->needs_regen_to_sort = 0; path->resort_all_children = 0; @@ -920,7 +920,7 @@ static void * ets_initialize_value (ETreeModel *etm, int col) { ETreeSorted *ets = E_TREE_SORTED(etm); - + return e_tree_model_initialize_value (ets->priv->source, col); } @@ -928,7 +928,7 @@ static gboolean ets_value_is_empty (ETreeModel *etm, int col, const void *value) { ETreeSorted *ets = E_TREE_SORTED(etm); - + return e_tree_model_value_is_empty (ets->priv->source, col, value); } @@ -936,7 +936,7 @@ static char * ets_value_to_string (ETreeModel *etm, int col, const void *value) { ETreeSorted *ets = E_TREE_SORTED(etm); - + return e_tree_model_value_to_string (ets->priv->source, col, value); } @@ -1153,7 +1153,7 @@ e_tree_sorted_class_init (ETreeSortedClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); klass->node_resorted = NULL; - + object_class->dispose = ets_dispose; object_class->finalize = ets_finalize; @@ -1239,9 +1239,9 @@ e_tree_sorted_init (ETreeSorted *ets) /** * e_tree_sorted_construct: - * @etree: - * - * + * @etree: + * + * **/ void e_tree_sorted_construct (ETreeSorted *ets, ETreeModel *source, ETableHeader *full_header, ETableSortInfo *sort_info) @@ -1340,7 +1340,7 @@ e_tree_sorted_node_resorted (ETreeSorted *sorted, ETreePath node) { 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); } diff --git a/widgets/table/e-tree-sorted.h b/widgets/table/e-tree-sorted.h index d866bbd8fc..fce505f672 100644 --- a/widgets/table/e-tree-sorted.h +++ b/widgets/table/e-tree-sorted.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-sorted.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c index afaf5f57fc..17e1987e86 100644 --- a/widgets/table/e-tree-table-adapter.c +++ b/widgets/table/e-tree-table-adapter.c @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-table-adapter.c * Copyright 2000, 2001, Ximian, Inc. * @@ -168,8 +168,8 @@ resort_node(ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) sort_needed = etta->priv->sort_info && e_table_sort_info_sorting_get_count (etta->priv->sort_info) > 0; - for (i = 0, path = e_tree_model_node_get_first_child(etta->priv->source, node->path); path; - path = e_tree_model_node_get_next(etta->priv->source, path), i++); + for (i = 0, path = e_tree_model_node_get_first_child(etta->priv->source, node->path); path; + path = e_tree_model_node_get_next(etta->priv->source, path), i++); count = i; if (count <= 1) @@ -177,7 +177,7 @@ resort_node(ETreeTableAdapter *etta, GNode *gnode, gboolean recurse) paths = g_new0(ETreePath, count); - for (i = 0, path = e_tree_model_node_get_first_child(etta->priv->source, node->path); path; + for (i = 0, path = e_tree_model_node_get_first_child(etta->priv->source, node->path); path; path = e_tree_model_node_get_next(etta->priv->source, path), i++) paths[i] = path; @@ -805,7 +805,7 @@ etta_proxy_node_inserted (ETreeModel *etm, ETreePath parent, ETreePath child, ET generate_tree(etta, child); else insert_node(etta, parent, child); - + e_table_model_changed(E_TABLE_MODEL(etta)); } @@ -918,7 +918,7 @@ e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const char *f TreeAndRoot tar; xmlDocPtr doc; xmlNode *root; - + g_return_if_fail(etta != NULL); doc = xmlNewDoc ((const unsigned char *)"1.0"); @@ -928,7 +928,7 @@ e_tree_table_adapter_save_expanded_state (ETreeTableAdapter *etta, const char *f tar.model = etta->priv->source; tar.root = root; tar.expanded_default = e_tree_model_get_expanded_default(etta->priv->source); - + e_xml_set_integer_prop_by_name (root, (const unsigned char *)"vers", 2); e_xml_set_bool_prop_by_name (root, (const unsigned char *)"default", tar.expanded_default); @@ -1012,7 +1012,7 @@ set_collapsed_state_func (gpointer keyp, gpointer value, gpointer data) void e_tree_table_adapter_load_all_expanded_state (ETreeTableAdapter *etta, gboolean state) { - + g_return_if_fail(etta != NULL); if (state) @@ -1038,7 +1038,7 @@ e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const char *f root = xmlDocGetRootElement (doc); e_table_model_pre_change(E_TABLE_MODEL(etta)); - + model_default = e_tree_model_get_expanded_default(etta->priv->source); if (!strcmp ((char *)root->name, "expanded_state")) { @@ -1048,10 +1048,10 @@ e_tree_table_adapter_load_expanded_state (ETreeTableAdapter *etta, const char *f if (state[0] == 't') file_default = TRUE; - else + else file_default = FALSE; /* Even unspecified we'll consider as false */ } - + /* Incase the default is changed, lets forget the changes and stick to default */ if (file_default != model_default) { @@ -1136,7 +1136,7 @@ e_tree_table_adapter_node_set_expanded (ETreeTableAdapter *etta, ETreePath path, return; node->expanded = expanded; - + row = get_row(etta, path); if (row == -1) return; @@ -1178,8 +1178,8 @@ e_tree_table_adapter_node_set_expanded_recurse (ETreeTableAdapter *etta, ETreePa e_tree_table_adapter_node_set_expanded(etta, path, expanded); - for (children = e_tree_model_node_get_first_child(etta->priv->source, path); - children; + for (children = e_tree_model_node_get_first_child(etta->priv->source, path); + children; children = e_tree_model_node_get_next(etta->priv->source, children)) { e_tree_table_adapter_node_set_expanded_recurse(etta, children, expanded); } @@ -1197,13 +1197,13 @@ e_tree_table_adapter_row_of_node (ETreeTableAdapter *etta, ETreePath path) return get_row(etta, path); } -gboolean +gboolean e_tree_table_adapter_root_node_is_visible(ETreeTableAdapter *etta) { return etta->priv->root_visible; } -void +void e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path) { ETreePath parent; @@ -1216,7 +1216,7 @@ e_tree_table_adapter_show_node (ETreeTableAdapter *etta, ETreePath path) } } -gboolean +gboolean e_tree_table_adapter_node_is_expanded (ETreeTableAdapter *etta, ETreePath path) { node_t *node = get_node(etta, path); diff --git a/widgets/table/e-tree-table-adapter.h b/widgets/table/e-tree-table-adapter.h index 36cbd09f27..0a57b593e8 100644 --- a/widgets/table/e-tree-table-adapter.h +++ b/widgets/table/e-tree-table-adapter.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree-table-adapter.h * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 24ee33ff73..2c5f991bdc 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -275,7 +275,7 @@ static ETableCol * current_search_col (ETree *et) { if (!et->priv->search_col_set) { - et->priv->current_search_col = + et->priv->current_search_col = e_table_util_calculate_current_search_col (et->priv->header, et->priv->full_header, et->priv->sort_info, @@ -608,10 +608,10 @@ e_tree_init (ETree *e_tree) e_tree->priv->search = e_table_search_new(); - e_tree->priv->search_search_id = + e_tree->priv->search_search_id = g_signal_connect (G_OBJECT (e_tree->priv->search), "search", G_CALLBACK (et_search_search), e_tree); - e_tree->priv->search_accept_id = + e_tree->priv->search_accept_id = g_signal_connect (G_OBJECT (e_tree->priv->search), "accept", G_CALLBACK (et_search_accept), e_tree); @@ -1124,7 +1124,7 @@ e_tree_setup_table (ETree *e_tree) /** * e_tree_set_search_column: * @e_tree: #ETree object that will be modified - * @col: Column index to use for searches + * @col: Column index to use for searches * * This routine sets the current search column to be used for keypress * searches of the #ETree. If -1 is passed in for column, the current @@ -1269,11 +1269,11 @@ e_tree_get_state_object (ETree *e_tree) /** * e_tree_get_state: * @e_tree: The #ETree to act on - * + * * Builds a state object based on the current state and returns the * string corresponding to that state. - * - * Return value: + * + * Return value: * A string describing the current state of the #ETree. **/ gchar * @@ -1310,9 +1310,9 @@ e_tree_save_state (ETree *e_tree, /** * e_tree_get_spec: * @e_tree: The #ETree to query - * + * * Returns the specification object. - * + * * Return value: **/ ETableSpecification * @@ -1352,7 +1352,7 @@ et_table_rows_deleted (ETableModel *table_model, int row, int count, ETree *et) prev_node = e_tree_node_at_row (et, row-1); node = e_tree_get_cursor (et); - + /* Check if the cursor is a child of the node directly before the * deleted region (implying that an expander was collapsed with * the cursor inside it) */ @@ -1377,7 +1377,7 @@ et_connect_to_etta (ETree *et) et->priv->table_cell_change_id = g_signal_connect (et->priv->etta, "model_cell_changed", G_CALLBACK (et_table_cell_changed), et); - + et->priv->table_rows_delete_id = g_signal_connect (et->priv->etta, "model_rows_deleted", G_CALLBACK (et_table_rows_deleted), et); @@ -1473,10 +1473,10 @@ et_real_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, * @ete: An optional #ETableExtras. (%NULL is valid.) * @spec_str: The spec. * @state_str: An optional state. (%NULL is valid.) - * + * * This is the internal implementation of e_tree_new() for use by * subclasses or language bindings. See e_tree_new() for details. - * + * * Return value: %TRUE on success, %FALSE if an error occurred **/ gboolean @@ -1535,7 +1535,7 @@ e_tree_construct (ETree *e_tree, ETreeModel *etm, ETableExtras *ete, * This is the internal implementation of e_tree_new_from_spec_file() * for use by subclasses or language bindings. See * e_tree_new_from_spec_file() for details. - * + * * Return value: %TRUE on success, %FALSE if an error occurred **/ gboolean @@ -1593,7 +1593,7 @@ e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *e * @ete: An optional #ETableExtras (%NULL is valid.) * @spec: The spec * @state: An optional state (%NULL is valid.) - * + * * This function creates an #ETree from the given parameters. The * #ETreeModel is a tree model to be represented. The #ETableExtras * is an optional set of pixbufs, cells, and sorting functions to be @@ -1604,8 +1604,8 @@ e_tree_construct_from_spec_file (ETree *e_tree, ETreeModel *etm, ETableExtras *e * default sorting state and such. @state is an optional string * specifying the current sorting state and such. If @state is NULL, * then the default state from the spec will be used. - * - * Return value: + * + * Return value: * The newly created #ETree or %NULL if there's an error. **/ GtkWidget * @@ -1634,7 +1634,7 @@ e_tree_new (ETreeModel *etm, ETableExtras *ete, const char *spec, const char *st * @ete: An optional #ETableExtras. (%NULL is valid.) * @spec_fn: The filename of the spec. * @state_fn: An optional state file. (%NULL is valid.) - * + * * This is very similar to e_tree_new(), except instead of passing in * strings you pass in the file names of the spec and state to load. * @@ -1644,8 +1644,8 @@ e_tree_new (ETreeModel *etm, ETableExtras *ete, const char *spec, const char *st * @state_fn is the filename of the initial state to load. If this is * %NULL or if the specified file doesn't exist, the default state * from the spec file is used. - * - * Return value: + * + * Return value: * The newly created #ETree or %NULL if there's an error. **/ GtkWidget * @@ -1851,7 +1851,7 @@ et_set_property (GObject *object, NULL); } break; - + case PROP_DRAW_FOCUS: etree->priv->draw_focus = g_value_get_boolean (value); if (etree->priv->item) { @@ -2111,12 +2111,12 @@ e_tree_find_next (ETree *et, ETreeFindNextParams params, ETreePathFunc func, gpo cursor = e_tree_get_cursor (et); row = e_tree_table_adapter_row_of_node (et->priv->etta, cursor); row_count = e_table_model_row_count (E_TABLE_MODEL (et->priv->etta)); - + if (params & E_TREE_FIND_NEXT_FORWARD) found = find_next_in_range (et, row + 1, row_count - 1, func, data); else found = find_prev_in_range (et, row == -1 ? -1 : row - 1, 0, func, data); - + if (found) { e_tree_table_adapter_show_node (et->priv->etta, found); e_tree_set_cursor (et, found); @@ -2541,7 +2541,7 @@ e_tree_drag_begin (ETree *tree, * @y: Y coordinate for the pixel * @row_return: Pointer to return the row value * @col_return: Pointer to return the column value - * + * * Return the row and column for the cell in which the pixel at (@x, @y) is * contained. **/ @@ -2577,7 +2577,7 @@ e_tree_get_cell_at (ETree *tree, * @y_return: Returns the y coordinate of the upper right hand corner of the cell with respect to the widget. * @width_return: Returns the width of the cell. * @height_return: Returns the height of the cell. - * + * * Computes the data about this cell. **/ void @@ -2739,7 +2739,7 @@ scroll_timeout (gpointer data) et->priv->last_drop_x, et->priv->last_drop_y, et->priv->last_drop_time); - + return TRUE; } @@ -2866,8 +2866,8 @@ context_connect (ETree *et, GdkDragContext *context) { if (context == et->priv->last_drop_context) return; - - if (et->priv->last_drop_context) + + if (et->priv->last_drop_context) g_object_weak_unref (G_OBJECT(et->priv->last_drop_context), context_destroyed, et); else g_object_ref (et); @@ -3000,7 +3000,7 @@ et_drag_drop(GtkWidget *widget, et->priv->drop_path = NULL; et->priv->drop_col = -1; - collapse_drag (et, path); + collapse_drag (et, path); scroll_off (et); return ret_val; @@ -3222,7 +3222,7 @@ e_tree_class_init (ETreeClass *class) 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), diff --git a/widgets/table/e-tree.h b/widgets/table/e-tree.h index e25110a0e6..2b3de1b042 100644 --- a/widgets/table/e-tree.h +++ b/widgets/table/e-tree.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * e-tree.h * Copyright 2000, 2001, Ximian, Inc. * @@ -101,8 +101,8 @@ typedef struct { ETreePath path, int col, GdkDragContext *context); - - /* Target side drag signals */ + + /* Target side drag signals */ void (* tree_drag_leave) (ETree *tree, int row, ETreePath path, diff --git a/widgets/table/table-test.h b/widgets/table/table-test.h index 60d62e8dc3..21696df835 100644 --- a/widgets/table/table-test.h +++ b/widgets/table/table-test.h @@ -1,5 +1,5 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* +/* * table-test.c * Copyright 2000, 2001, Ximian, Inc. * diff --git a/widgets/table/test-check.c b/widgets/table/test-check.c index 0fb1d38279..89f2af1ec2 100644 --- a/widgets/table/test-check.c +++ b/widgets/table/test-check.c @@ -78,7 +78,7 @@ value_at (ETableModel *etc, int col, int row, void *data) return GINT_TO_POINTER (my_table [row].value); else return my_table [row].string; - + } static void @@ -165,11 +165,11 @@ check_test (void) GnomeCanvasItem *item; gtk_widget_push_colormap (gdk_rgb_get_cmap ()); - + e_table_model = e_table_simple_new ( col_count, row_count, value_at, - set_value_at, is_cell_editable, - duplicate_value, free_value, + set_value_at, is_cell_editable, + duplicate_value, free_value, initialize_value, value_is_empty, value_to_string, NULL); @@ -186,7 +186,7 @@ check_test (void) col_0 = e_table_col_new_with_pixbuf (0, pixbuf, 0.0, 18, cell_image_check, e_int_compare, TRUE); gdk_pixbuf_unref (pixbuf); e_table_header_add_column (e_table_header, col_0, 0); - + col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, e_str_compare, TRUE); e_table_header_add_column (e_table_header, col_1, 1); e_table_col_set_arrow (col_1, E_TABLE_COL_ARROW_DOWN); @@ -199,7 +199,7 @@ check_test (void) g_signal_connect (canvas, "size_allocate", G_CALLBACK (set_canvas_size), NULL); - + gtk_container_add (GTK_CONTAINER (window), canvas); gtk_widget_show_all (window); gnome_canvas_item_new ( diff --git a/widgets/table/test-cols.c b/widgets/table/test-cols.c index f0f0c970ae..b1dd6c4e6d 100644 --- a/widgets/table/test-cols.c +++ b/widgets/table/test-cols.c @@ -78,7 +78,7 @@ value_at (ETableModel *etc, int col, int row, void *data) return GINT_TO_POINTER (my_table [row].value); else return my_table [row].string; - + } static void @@ -164,7 +164,7 @@ multi_cols_test (void) GnomeCanvasItem *item; gtk_widget_push_colormap (gdk_rgb_get_cmap ()); - + e_table_model = e_table_simple_new ( col_count, row_count, value_at, set_value_at, is_cell_editable, @@ -183,7 +183,7 @@ multi_cols_test (void) { GdkPixbuf **images = g_new (GdkPixbuf *, 3); int i; - + images [0] = gdk_pixbuf_new_from_file ("image1.png"); images [1] = gdk_pixbuf_new_from_file ("image2.png"); images [2] = gdk_pixbuf_new_from_file ("image3.png"); @@ -192,10 +192,10 @@ multi_cols_test (void) for (i = 0; i < 3; i++) gdk_pixbuf_unref (images [i]); - + g_free (images); - } - + } + col_1 = e_table_col_new (1, "Item Name", 1.0, 20, cell_left_just, e_str_compare, TRUE); e_table_header_add_column (e_table_header, col_1, 0); @@ -209,7 +209,7 @@ multi_cols_test (void) e_table_header_add_column (e_table_header_multiple, col_0, 0); e_table_header_add_column (e_table_header_multiple, col_1, 1); e_table_header_add_column (e_table_header_multiple, col_1, 2); - + /* * GUI */ @@ -218,7 +218,7 @@ multi_cols_test (void) g_signal_connect (canvas, "size_allocate", G_CALLBACK (set_canvas_size), NULL); - + gtk_container_add (GTK_CONTAINER (window), canvas); gtk_widget_show_all (window); @@ -242,7 +242,7 @@ multi_cols_test (void) NULL); e_canvas_item_move_absolute (item, 0, 30); - + gnome_canvas_item_new ( gnome_canvas_root (GNOME_CANVAS (canvas)), e_table_header_item_get_type (), |