diff options
author | Miguel de Icaza <miguel@gnu.org> | 2001-01-19 12:48:04 +0800 |
---|---|---|
committer | Miguel de Icaza <miguel@src.gnome.org> | 2001-01-19 12:48:04 +0800 |
commit | a35fff26e83d1f36bd0027a3b9c701a2094b4a32 (patch) | |
tree | a6a446ed2dd6d16aadc4dd19c6702789e0a6ba01 | |
parent | 26f5efce64c121c990c3247e03b09df982c59385 (diff) | |
download | gsoc2013-evolution-a35fff26e83d1f36bd0027a3b9c701a2094b4a32.tar.gz gsoc2013-evolution-a35fff26e83d1f36bd0027a3b9c701a2094b4a32.tar.zst gsoc2013-evolution-a35fff26e83d1f36bd0027a3b9c701a2094b4a32.zip |
Keep track of the valid column names (not used right now).
2001-01-18 Miguel de Icaza <miguel@gnu.org>
* e-table-config.c (configure_sort_dialog): Keep track of the
valid column names (not used right now).
(config_destroy): release column names
(entry_changed): Handle invalid input to mean "Next entry is
grayed out".
* e-table-header-item.c (ethi_popup_customize_view): Hook up to
the "apply" signal on the dialog box to apply the changes.
(apply_changes): New function to apply the changes from the
ETableConfig object.
* e-table-sort-info.c (e_table_sort_info_load_from_node): Notify
of sort info changes.
* e-table-header-item.c: Swapped the way arrows were done, so that
they actually match the sorting that its expected.
* e-table.c: Added inline documentation for a few methods.
* e-table-config.h: Dropped ::spec, and temp_spec, we always use
::source_spec, as we never modify this variable.
svn path=/trunk/; revision=7633
-rw-r--r-- | widgets/table/e-table-config.c | 64 | ||||
-rw-r--r-- | widgets/table/e-table-config.h | 9 | ||||
-rw-r--r-- | widgets/table/e-table-header-item.c | 138 | ||||
-rw-r--r-- | widgets/table/e-table-sort-info.c | 3 | ||||
-rw-r--r-- | widgets/table/e-table.c | 203 |
5 files changed, 260 insertions, 157 deletions
diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index c1f0cce3f5..fe9f1b9cdc 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -32,10 +32,11 @@ config_destroy (GtkObject *object) ETableConfig *config = E_TABLE_CONFIG (object); gtk_object_destroy (GTK_OBJECT (config->state)); - gtk_object_destroy (GTK_OBJECT (config->spec)); + gtk_object_unref (GTK_OBJECT (config->source_state)); + gtk_object_unref (GTK_OBJECT (config->source_spec)); - gtk_object_unref (GTK_OBJECT (config->state)); - gtk_object_unref (GTK_OBJECT (config->spec)); + g_slist_free (config->column_names); + config->column_names = NULL; GTK_OBJECT_CLASS (config_parent_class)->destroy (object); } @@ -115,7 +116,7 @@ update_sort_config_dialog (ETableConfig *config) i); ETableColumnSpecification *column = - find_column_in_spec (config->temp_spec, col.column); + find_column_in_spec (config->source_spec, col.column); if (!column){ /* @@ -183,7 +184,7 @@ config_sort_info_update (ETableConfig *config) ETableSortColumn col = e_table_sort_info_sorting_get_nth (info, i); ETableColumnSpecification *column; - column = find_column_in_spec (config->spec, col.column); + column = find_column_in_spec (config->source_spec, col.column); if (!column){ g_warning ("Could not find column model in specification"); continue; @@ -215,7 +216,6 @@ config_sort_config_show (GtkWidget *widget, ETableConfig *config) GnomeDialog *dialog = GNOME_DIALOG (config->dialog_sort); int button, running = 1; - config->temp_spec = e_table_specification_duplicate (config->spec); config->temp_state = e_table_state_duplicate (config->state); update_sort_config_dialog (config); @@ -229,19 +229,20 @@ config_sort_config_show (GtkWidget *widget, ETableConfig *config) config->state->sort_info, 0); update_sort_config_dialog (config); continue; + + /* OK */ case 1: - gtk_object_unref (GTK_OBJECT (config->spec)); gtk_object_unref (GTK_OBJECT (config->state)); - config->spec = config->temp_spec; config->state = config->temp_state; running = 0; + gnome_property_box_changed ( + GNOME_PROPERTY_BOX (config->dialog_toplevel)); break; - + + /* CANCEL */ case 2: gtk_object_unref (GTK_OBJECT (config->temp_state)); - gtk_object_unref (GTK_OBJECT (config->temp_spec)); config->temp_state = 0; - config->temp_spec = 0; running = 0; break; } @@ -266,7 +267,7 @@ config_group_info_update (ETableConfig *config) ETableSortColumn col = e_table_sort_info_grouping_get_nth (info, i); ETableColumnSpecification *column; - column = find_column_in_spec (config->spec, col.column); + column = find_column_in_spec (config->source_spec, col.column); if (!column){ g_warning ("Could not find model column in specification"); continue; @@ -297,7 +298,7 @@ config_fields_info_update (ETableConfig *config) int i, items = 0; for (i = 0; i < config->state->col_count; i++){ - for (column = config->spec->columns; *column; column++){ + for (column = config->source_spec->columns; *column; column++){ if (config->state->columns [i] != (*column)->model_col) continue; @@ -317,12 +318,6 @@ config_fields_info_update (ETableConfig *config) } static void -apply_changes (ETableConfig *config) -{ - /* Do apply changes here */ -} - -static void dialog_destroyed (GtkObject *dialog, ETableConfig *config) { gtk_object_destroy (GTK_OBJECT (config)); @@ -368,29 +363,25 @@ entry_changed (GtkEntry *entry, ETableConfigSortWidgets *sort) char *s = gtk_entry_get_text (entry); - if (s [0] == 0){ - printf ("Entry %d is empty!\n", idx); - e_table_sort_info_sorting_truncate (sort_info, idx); - update_sort_config_dialog (config); - return; - } - if (g_hash_table_lookup (sort->combo->elements, s)){ ETableSortColumn c; int col; - col = find_model_column_by_name (config->temp_spec, s); + col = find_model_column_by_name (config->source_spec, s); if (col == -1){ g_warning ("This should not happen"); return; } - c.ascending = 1; + c.ascending = GTK_TOGGLE_BUTTON ( + config->sort [idx].radio_ascending)->active; c.column = col; e_table_sort_info_sorting_set_nth (sort_info, idx, c); update_sort_config_dialog (config); - return; + } else { + e_table_sort_info_sorting_truncate (sort_info, idx); + update_sort_config_dialog (config); } } @@ -442,7 +433,8 @@ configure_sort_dialog (ETableConfig *config, GladeXML *gui) config->sort [i].e_table_config = config; } - for (column = config->spec->columns; *column; column++){ + + for (column = config->source_spec->columns; *column; column++){ char *label = (*column)->title; for (i = 0; i < 4; i++){ @@ -450,6 +442,10 @@ configure_sort_dialog (ETableConfig *config, GladeXML *gui) config->sort [i].combo, gettext (label), label); } + + + config->column_names = g_slist_append ( + config->column_names, label); } /* @@ -480,11 +476,8 @@ setup_gui (ETableConfig *config) config->dialog_toplevel)->notebook), FALSE); - gtk_signal_connect ( - GTK_OBJECT (config->dialog_toplevel), "apply", - GTK_SIGNAL_FUNC (apply_changes), config); - - config->dialog_show_fields = configure_dialog (gui, "dialog-show-fields", config); + config->dialog_show_fields = configure_dialog ( +gui, "dialog-show-fields", config); config->dialog_group_by = configure_dialog (gui, "dialog-group-by", config); config->dialog_sort = configure_dialog (gui, "dialog-sort", config); @@ -530,7 +523,6 @@ e_table_config_construct (ETableConfig *config, gtk_object_ref (GTK_OBJECT (config->source_spec)); gtk_object_ref (GTK_OBJECT (config->source_state)); - config->spec = e_table_specification_duplicate (spec); config->state = e_table_state_duplicate (state); setup_gui (config); diff --git a/widgets/table/e-table-config.h b/widgets/table/e-table-config.h index 06252ab2bc..c66c01f9aa 100644 --- a/widgets/table/e-table-config.h +++ b/widgets/table/e-table-config.h @@ -36,7 +36,7 @@ typedef struct { /* * The state we manipulate */ - ETableSpecification *source_spec, *spec, *temp_spec; + ETableSpecification *source_spec; ETableState *source_state, *state, *temp_state; GtkWidget *sort_label; @@ -44,6 +44,11 @@ typedef struct { GtkWidget *fields_label; ETableConfigSortWidgets sort [4]; + + /* + * List of valid column names + */ + GSList *column_names; } ETableConfig; typedef struct { @@ -58,6 +63,6 @@ ETableConfig *e_table_config_construct (ETableConfig *etco, const char *header, ETableSpecification *spec, ETableState *state); -void e_table_config_raise (ETableConfig *config); +void e_table_config_raise (ETableConfig *config); #endif /* _E_TABLE_CONFIG_H */ diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index dae8d595b5..e1fb7f4b02 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -788,8 +788,8 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width g_hash_table_insert (arrows, (gpointer) column.column, (gpointer) (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + E_TABLE_COL_ARROW_UP : + E_TABLE_COL_ARROW_DOWN)); } length = e_table_sort_info_sorting_get_count(ethi->sort_info); for (i = 0; i < length; i++) { @@ -797,8 +797,8 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x, int y, int width g_hash_table_insert (arrows, (gpointer) column.column, (gpointer) (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + E_TABLE_COL_ARROW_UP : + E_TABLE_COL_ARROW_DOWN)); } } @@ -973,27 +973,36 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) int length = e_table_sort_info_grouping_get_count(ethi->sort_info); int i; for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i); + ETableSortColumn column = + e_table_sort_info_grouping_get_nth( + ethi->sort_info, i); group_indent ++; - g_hash_table_insert (arrows, - (gpointer) column.column, - (gpointer) (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + g_hash_table_insert ( + arrows, + (gpointer) column.column, + (gpointer) (column.ascending ? + E_TABLE_COL_ARROW_UP : + E_TABLE_COL_ARROW_DOWN)); } 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, - (gpointer) column.column, - (gpointer) (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + ETableSortColumn column = + e_table_sort_info_sorting_get_nth ( + ethi->sort_info, i); + + g_hash_table_insert ( + arrows, + (gpointer) column.column, + (gpointer) (column.ascending ? + E_TABLE_COL_ARROW_UP : + E_TABLE_COL_ARROW_DOWN)); } } - ethi_drag_types[0].target = g_strdup_printf("%s-%s", ethi_drag_types[0].target, ethi->dnd_code); - list = gtk_target_list_new (ethi_drag_types, ELEMENTS (ethi_drag_types)); + ethi_drag_types[0].target = g_strdup_printf( + "%s-%s", ethi_drag_types[0].target, ethi->dnd_code); + list = gtk_target_list_new ( + ethi_drag_types, ELEMENTS (ethi_drag_types)); context = gtk_drag_begin (widget, list, GDK_ACTION_MOVE, 1, event); g_free(ethi_drag_types[0].target); @@ -1001,21 +1010,23 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) col_width = ecol->width; pixmap = gdk_pixmap_new (widget->window, col_width, ethi->height, -1); - e_table_header_draw_button (pixmap, ecol, - widget->style, ethi->font, - GTK_WIDGET_STATE (widget), - widget, ethi->gc, - 0, 0, - col_width, ethi->height, - col_width, ethi->height, - (ETableColArrow) g_hash_table_lookup ( - arrows, (gpointer) ecol->col_idx)); - gtk_drag_set_icon_pixmap (context, - gdk_window_get_colormap (widget->window), - pixmap, - NULL, - col_width / 2, - ethi->height / 2); + e_table_header_draw_button ( + pixmap, ecol, + widget->style, ethi->font, + GTK_WIDGET_STATE (widget), + widget, ethi->gc, + 0, 0, + col_width, ethi->height, + col_width, ethi->height, + (ETableColArrow) g_hash_table_lookup ( + arrows, (gpointer) ecol->col_idx)); + gtk_drag_set_icon_pixmap ( + context, + gdk_window_get_colormap (widget->window), + pixmap, + NULL, + col_width / 2, + ethi->height / 2); gdk_pixmap_unref (pixmap); ethi->maybe_drag = FALSE; @@ -1042,21 +1053,28 @@ ethi_popup_sort_ascending(GtkWidget *widget, EthiHeaderInfo *info) 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); + ETableSortColumn column = e_table_sort_info_grouping_get_nth ( + ethi->sort_info, i); + if (model_col == column.column){ column.ascending = 1; - e_table_sort_info_grouping_set_nth(ethi->sort_info, i, column); + e_table_sort_info_grouping_set_nth ( + ethi->sort_info, i, column); found = 1; break; } } if (!found) { - length = e_table_sort_info_sorting_get_count(ethi->sort_info); + 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); + ETableSortColumn column = + e_table_sort_info_sorting_get_nth( + ethi->sort_info, i); if (model_col == column.column){ column.ascending = 1; - e_table_sort_info_sorting_set_nth(ethi->sort_info, i, column); + e_table_sort_info_sorting_set_nth ( + ethi->sort_info, i, column); found = 1; break; } @@ -1086,21 +1104,27 @@ ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info) 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); + ETableSortColumn column = e_table_sort_info_grouping_get_nth( + ethi->sort_info, i); if (model_col == column.column){ column.ascending = 0; - e_table_sort_info_grouping_set_nth(ethi->sort_info, i, column); + e_table_sort_info_grouping_set_nth( + ethi->sort_info, i, column); found = 1; break; } } if (!found) { - length = e_table_sort_info_sorting_get_count(ethi->sort_info); + 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); + ETableSortColumn column = + e_table_sort_info_sorting_get_nth( + ethi->sort_info, i); + if (model_col == column.column){ column.ascending = 0; - e_table_sort_info_sorting_set_nth(ethi->sort_info, i, column); + e_table_sort_info_sorting_set_nth ( + ethi->sort_info, i, column); found = 1; break; } @@ -1108,10 +1132,11 @@ ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info) } if (!found) { ETableSortColumn column = { model_col, 0 }; - length = e_table_sort_info_sorting_get_count(ethi->sort_info); + length = e_table_sort_info_sorting_get_count (ethi->sort_info); if (length == 0) length++; - e_table_sort_info_sorting_set_nth(ethi->sort_info, length - 1, column); + e_table_sort_info_sorting_set_nth ( + ethi->sort_info, length - 1, column); } } @@ -1196,6 +1221,19 @@ config_destroyed (GtkObject *object, ETableHeaderItem *ethi) } static void +apply_changes (GnomePropertyBox *pbox, gint page_num, ETableHeaderItem *ethi) +{ + ETableConfig *config = E_TABLE_CONFIG (ethi->config); + char *state = e_table_state_save_to_string (config->state); + + if (page_num != -1) + return; + + e_table_set_state (ethi->table, state); + g_free (state); +} + +static void ethi_popup_customize_view(GtkWidget *widget, EthiHeaderInfo *info) { ETableHeaderItem *ethi = info->ethi; @@ -1209,8 +1247,14 @@ ethi_popup_customize_view(GtkWidget *widget, EthiHeaderInfo *info) ethi->config = e_table_config_new ( _("Configuring view: FIXME"), ethi->table->spec, state); - gtk_signal_connect (GTK_OBJECT (ethi->config), "destroy", - GTK_SIGNAL_FUNC (config_destroyed), ethi); + gtk_signal_connect ( + GTK_OBJECT (ethi->config), "destroy", + GTK_SIGNAL_FUNC (config_destroyed), ethi); + gtk_signal_connect ( + GTK_OBJECT ( + E_TABLE_CONFIG (ethi->config)->dialog_toplevel), + "apply", + GTK_SIGNAL_FUNC (apply_changes), ethi); } } diff --git a/widgets/table/e-table-sort-info.c b/widgets/table/e-table-sort-info.c index 6e7c6d1697..47f22ee5ff 100644 --- a/widgets/table/e-table-sort-info.c +++ b/widgets/table/e-table-sort-info.c @@ -380,6 +380,9 @@ e_table_sort_info_load_from_node (ETableSortInfo *info, e_table_sort_info_sorting_set_nth(info, i++, column); } } + gtk_signal_emit (GTK_OBJECT (info), + e_table_sort_info_signals [SORT_INFO_CHANGED]); + } /** diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index fafdaf177a..892a764a70 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -515,9 +515,10 @@ et_table_row_deleted (ETableModel *table_model, int row, ETable *et) static void et_canvas_realize (GtkWidget *canvas, ETable *e_table) { - gnome_canvas_item_set(e_table->white_item, - "fill_color_gdk", >K_WIDGET(e_table->table_canvas)->style->base[GTK_STATE_NORMAL], - NULL); + gnome_canvas_item_set( + e_table->white_item, + "fill_color_gdk", >K_WIDGET(e_table->table_canvas)->style->base[GTK_STATE_NORMAL], + NULL); } static void @@ -566,32 +567,39 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h gtk_widget_show (GTK_WIDGET (e_table->table_canvas)); - e_table->white_item = gnome_canvas_item_new(gnome_canvas_root(e_table->table_canvas), - gnome_canvas_rect_get_type(), - "x1", (double) 0, - "y1", (double) 0, - "x2", (double) 100, - "y2", (double) 100, - "fill_color_gdk", >K_WIDGET(e_table->table_canvas)->style->base[GTK_STATE_NORMAL], - NULL); - gtk_signal_connect(GTK_OBJECT(e_table->table_canvas), "realize", - GTK_SIGNAL_FUNC(et_canvas_realize), e_table); - e_table->canvas_vbox = gnome_canvas_item_new(gnome_canvas_root(e_table->table_canvas), - e_canvas_vbox_get_type(), - "spacing", 10.0, - NULL); - + e_table->white_item = gnome_canvas_item_new( + gnome_canvas_root(e_table->table_canvas), + gnome_canvas_rect_get_type(), + "x1", (double) 0, + "y1", (double) 0, + "x2", (double) 100, + "y2", (double) 100, + "fill_color_gdk", >K_WIDGET(e_table->table_canvas)->style->base[GTK_STATE_NORMAL], + NULL); + gtk_signal_connect ( + GTK_OBJECT(e_table->table_canvas), "realize", + GTK_SIGNAL_FUNC(et_canvas_realize), e_table); + e_table->canvas_vbox = gnome_canvas_item_new( + gnome_canvas_root(e_table->table_canvas), + e_canvas_vbox_get_type(), + "spacing", 10.0, + NULL); + if (e_table->use_click_to_add) { - e_table->click_to_add = gnome_canvas_item_new (GNOME_CANVAS_GROUP(e_table->canvas_vbox), - e_table_click_to_add_get_type (), - "header", e_table->header, - "model", e_table->model, - "message", e_table->click_to_add_message, - NULL); + e_table->click_to_add = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP(e_table->canvas_vbox), + e_table_click_to_add_get_type (), + "header", e_table->header, + "model", e_table->model, + "message", e_table->click_to_add_message, + NULL); - e_canvas_vbox_add_item(E_CANVAS_VBOX(e_table->canvas_vbox), e_table->click_to_add); - gtk_signal_connect(GTK_OBJECT (e_table->click_to_add), "cursor_change", - GTK_SIGNAL_FUNC(click_to_add_cursor_change), e_table); + e_canvas_vbox_add_item ( + E_CANVAS_VBOX(e_table->canvas_vbox), + e_table->click_to_add); + gtk_signal_connect ( + GTK_OBJECT (e_table->click_to_add), "cursor_change", + GTK_SIGNAL_FUNC(click_to_add_cursor_change), e_table); } e_table->group = e_table_group_new ( @@ -600,14 +608,15 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h model, e_table->sort_info, 0); e_canvas_vbox_add_item(E_CANVAS_VBOX(e_table->canvas_vbox), GNOME_CANVAS_ITEM(e_table->group)); - gnome_canvas_item_set(GNOME_CANVAS_ITEM(e_table->group), - "drawgrid", e_table->draw_grid, - "drawfocus", e_table->draw_focus, - "cursor_mode", e_table->cursor_mode, - "length_threshold", e_table->length_threshold, - "table_selection_model", e_table->selection, - NULL); - + gnome_canvas_item_set( + GNOME_CANVAS_ITEM(e_table->group), + "drawgrid", e_table->draw_grid, + "drawfocus", e_table->draw_focus, + "cursor_mode", e_table->cursor_mode, + "length_threshold", e_table->length_threshold, + "table_selection_model", e_table->selection, + NULL); + gtk_signal_connect (GTK_OBJECT (e_table->group), "cursor_change", GTK_SIGNAL_FUNC(group_cursor_change), e_table); gtk_signal_connect (GTK_OBJECT (e_table->group), "double_click", @@ -766,10 +775,11 @@ e_table_set_state_object(ETable *e_table, ETableState *state) if (e_table->sort_info) { gtk_object_ref(GTK_OBJECT(e_table->sort_info)); e_table->group_info_change_id = - gtk_signal_connect (GTK_OBJECT (e_table->sort_info), - "group_info_changed", - GTK_SIGNAL_FUNC (sort_info_changed), - e_table); + gtk_signal_connect ( + GTK_OBJECT (e_table->sort_info), + "group_info_changed", + GTK_SIGNAL_FUNC (sort_info_changed), + e_table); } if (e_table->sorter) @@ -791,8 +801,17 @@ e_table_set_state_object(ETable *e_table, ETableState *state) e_table->rebuild_idle_id = g_idle_add_full (20, changed_idle, e_table, NULL); } -void e_table_set_state (ETable *e_table, - const gchar *state_str) +/** + * e_table_set_state: + * @e_table: %ETable object that will be modified + * @state_str: a string with the XML representation of the ETableState. + * + * This routine sets the state (as described by %ETableState) of the + * %ETable object. + */ +void +e_table_set_state (ETable *e_table, + const gchar *state_str) { ETableState *state; @@ -809,8 +828,17 @@ void e_table_set_state (ETable *e_table gtk_object_unref(GTK_OBJECT(state)); } -void e_table_load_state (ETable *e_table, - const gchar *filename) +/** + * e_table_load_state: + * @e_table: %ETable object that will be modified + * @filename: name of the file containing the state to be loaded into the %ETable + * + * An %ETableState will be loaded form the file pointed by @filename into the + * @e_table object. + */ +void +e_table_load_state (ETable *e_table, + const gchar *filename) { ETableState *state; @@ -827,6 +855,13 @@ void e_table_load_state (ETable *e_table gtk_object_unref(GTK_OBJECT(state)); } +/** + * e_table_get_state_object: + * @e_table: %ETable object that will be modified + * + * Returns: the %ETableState object that encapsulates the current + * state of the @e_table object + */ ETableState * e_table_get_state_object (ETable *e_table) { @@ -869,8 +904,17 @@ gchar *e_table_get_state (ETable *e_table return string; } -void e_table_save_state (ETable *e_table, - const gchar *filename) +/** + * e_table_save_state: + * @e_table: %ETable object that will be modified + * @filename: name of the file containing the state to be loaded into the %ETable + * + * This routine saves the state of the @e_table object into the file pointed + * by @filename + */ +void +e_table_save_state (ETable *e_table, + const gchar *filename) { ETableState *state; @@ -1496,12 +1540,13 @@ struct _GtkDragSourceInfo /* Drag & drop stuff. */ /* Target */ -void e_table_drag_get_data (ETable *table, - int row, - int col, - GdkDragContext *context, - GdkAtom target, - guint32 time) +void +e_table_drag_get_data (ETable *table, + int row, + int col, + GdkDragContext *context, + GdkAtom target, + guint32 time) { g_return_if_fail(table != NULL); g_return_if_fail(E_IS_TABLE(table)); @@ -1515,15 +1560,25 @@ void e_table_drag_get_data (ETable *table, } -void e_table_drag_highlight (ETable *table, - int row, - int col) /* col == -1 to highlight entire row. */ +/** + * e_table_drag_highlight: + * @table: + * @row: + * @col: + * + * Set col to -1 to highlight the entire row. + */ +void +e_table_drag_highlight (ETable *table, + int row, + int col) { g_return_if_fail(table != NULL); g_return_if_fail(E_IS_TABLE(table)); } -void e_table_drag_unhighlight (ETable *table) +void +e_table_drag_unhighlight (ETable *table) { g_return_if_fail(table != NULL); g_return_if_fail(E_IS_TABLE(table)); @@ -1559,11 +1614,13 @@ void e_table_drag_dest_set_proxy (ETable *table, use_coordinates); } -/* There probably should be functions for setting the targets +/* + * There probably should be functions for setting the targets * as a GtkTargetList */ -void e_table_drag_dest_unset (GtkWidget *widget) +void +e_table_drag_dest_unset (GtkWidget *widget) { g_return_if_fail(widget != NULL); g_return_if_fail(E_IS_TABLE(widget)); @@ -1573,11 +1630,12 @@ void e_table_drag_dest_unset (GtkWidget *widget) /* Source side */ -void e_table_drag_source_set (ETable *table, - GdkModifierType start_button_mask, - const GtkTargetEntry *targets, - gint n_targets, - GdkDragAction actions) +void +e_table_drag_source_set (ETable *table, + GdkModifierType start_button_mask, + const GtkTargetEntry *targets, + gint n_targets, + GdkDragAction actions) { ETableDragSourceSite *site; GtkWidget *canvas; @@ -1621,7 +1679,8 @@ void e_table_drag_source_set (ETable *table, site->actions = actions; } -void e_table_drag_source_unset (ETable *table) +void +e_table_drag_source_unset (ETable *table) { ETableDragSourceSite *site; @@ -1631,9 +1690,13 @@ void e_table_drag_source_unset (ETable *table) site = table->site; if (site) { - gtk_signal_disconnect (GTK_OBJECT (table->table_canvas), table->drag_source_button_press_event_id); - gtk_signal_disconnect (GTK_OBJECT (table->table_canvas), table->drag_source_motion_notify_event_id); - g_free(site); + gtk_signal_disconnect ( + GTK_OBJECT (table->table_canvas), + table->drag_source_button_press_event_id); + gtk_signal_disconnect ( + GTK_OBJECT (table->table_canvas), + table->drag_source_motion_notify_event_id); + g_free (site); table->site = NULL; } } @@ -1665,12 +1728,8 @@ e_table_drag_begin (ETable *table, } static void -e_table_compute_location(ETable *table, - GtkWidget *widget, - int x, - int y, - int *row, - int *col) +e_table_compute_location (ETable *table, GtkWidget *widget, + int x, int y, int *row, int *col) { if (!(row || col)) return; |