From: Ben Pfaff Date: Sun, 3 Mar 2013 04:47:24 +0000 (-0800) Subject: pspp-sheet-view: Rename GtkTreeSelectMode to PsppSheetSelectMode. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a44f03df973e8dbce11e5424efb74c7b5e68334a;p=pspp pspp-sheet-view: Rename GtkTreeSelectMode to PsppSheetSelectMode. This avoids invading GTK+ reserved namespace. --- diff --git a/src/ui/gui/pspp-sheet-private.h b/src/ui/gui/pspp-sheet-private.h index 80e15ccf13..89e246dadc 100644 --- a/src/ui/gui/pspp-sheet-private.h +++ b/src/ui/gui/pspp-sheet-private.h @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -55,10 +55,10 @@ typedef enum typedef enum { - GTK_TREE_SELECT_MODE_TOGGLE = 1 << 0, - GTK_TREE_SELECT_MODE_EXTEND = 1 << 1 + PSPP_SHEET_SELECT_MODE_TOGGLE = 1 << 0, + PSPP_SHEET_SELECT_MODE_EXTEND = 1 << 1 } -GtkTreeSelectMode; +PsppSheetSelectMode; enum { @@ -362,7 +362,7 @@ struct _PsppSheetViewPrivate void _pspp_sheet_selection_internal_select_node (PsppSheetSelection *selection, int node, GtkTreePath *path, - GtkTreeSelectMode mode, + PsppSheetSelectMode mode, gboolean override_browse_mode); void _pspp_sheet_selection_emit_changed (PsppSheetSelection *selection); void _pspp_sheet_view_find_node (PsppSheetView *tree_view, diff --git a/src/ui/gui/pspp-sheet-selection.c b/src/ui/gui/pspp-sheet-selection.c index 9cd65028b4..13c69c0ed6 100644 --- a/src/ui/gui/pspp-sheet-selection.c +++ b/src/ui/gui/pspp-sheet-selection.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2011, 2012 Free Software Foundation, Inc. + Copyright (C) 2011, 2012, 2013 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -547,7 +547,7 @@ pspp_sheet_selection_select_path (PsppSheetSelection *selection, GtkTreePath *path) { int node; - GtkTreeSelectMode mode = 0; + PsppSheetSelectMode mode = 0; g_return_if_fail (PSPP_IS_SHEET_SELECTION (selection)); g_return_if_fail (selection->tree_view != NULL); @@ -562,7 +562,7 @@ pspp_sheet_selection_select_path (PsppSheetSelection *selection, if (selection->type == PSPP_SHEET_SELECTION_MULTIPLE || selection->type == PSPP_SHEET_SELECTION_RECTANGLE) - mode = GTK_TREE_SELECT_MODE_TOGGLE; + mode = PSPP_SHEET_SELECT_MODE_TOGGLE; _pspp_sheet_selection_internal_select_node (selection, node, @@ -598,7 +598,7 @@ pspp_sheet_selection_unselect_path (PsppSheetSelection *selection, _pspp_sheet_selection_internal_select_node (selection, node, path, - GTK_TREE_SELECT_MODE_TOGGLE, + PSPP_SHEET_SELECT_MODE_TOGGLE, TRUE); } @@ -1001,7 +1001,7 @@ void _pspp_sheet_selection_internal_select_node (PsppSheetSelection *selection, int node, GtkTreePath *path, - GtkTreeSelectMode mode, + PsppSheetSelectMode mode, gboolean override_browse_mode) { gint dirty = FALSE; @@ -1025,7 +1025,7 @@ _pspp_sheet_selection_internal_select_node (PsppSheetSelection *selection, else if (selection->type == PSPP_SHEET_SELECTION_SINGLE && anchor_path && gtk_tree_path_compare (path, anchor_path) == 0) { - if ((mode & GTK_TREE_SELECT_MODE_TOGGLE) == GTK_TREE_SELECT_MODE_TOGGLE) + if ((mode & PSPP_SHEET_SELECT_MODE_TOGGLE) == PSPP_SHEET_SELECT_MODE_TOGGLE) { dirty = pspp_sheet_selection_real_unselect_all (selection); } @@ -1070,7 +1070,7 @@ _pspp_sheet_selection_internal_select_node (PsppSheetSelection *selection, else if (selection->type == PSPP_SHEET_SELECTION_MULTIPLE || selection->type == PSPP_SHEET_SELECTION_RECTANGLE) { - if ((mode & GTK_TREE_SELECT_MODE_EXTEND) == GTK_TREE_SELECT_MODE_EXTEND + if ((mode & PSPP_SHEET_SELECT_MODE_EXTEND) == PSPP_SHEET_SELECT_MODE_EXTEND && (anchor_path == NULL)) { if (selection->tree_view->priv->anchor) @@ -1080,13 +1080,13 @@ _pspp_sheet_selection_internal_select_node (PsppSheetSelection *selection, gtk_tree_row_reference_new_proxy (G_OBJECT (selection->tree_view), selection->tree_view->priv->model, path); dirty = pspp_sheet_selection_real_select_node (selection, node, TRUE); } - else if ((mode & (GTK_TREE_SELECT_MODE_EXTEND | GTK_TREE_SELECT_MODE_TOGGLE)) == (GTK_TREE_SELECT_MODE_EXTEND | GTK_TREE_SELECT_MODE_TOGGLE)) + else if ((mode & (PSPP_SHEET_SELECT_MODE_EXTEND | PSPP_SHEET_SELECT_MODE_TOGGLE)) == (PSPP_SHEET_SELECT_MODE_EXTEND | PSPP_SHEET_SELECT_MODE_TOGGLE)) { pspp_sheet_selection_select_range (selection, anchor_path, path); } - else if ((mode & GTK_TREE_SELECT_MODE_TOGGLE) == GTK_TREE_SELECT_MODE_TOGGLE) + else if ((mode & PSPP_SHEET_SELECT_MODE_TOGGLE) == PSPP_SHEET_SELECT_MODE_TOGGLE) { bool selected = pspp_sheet_view_node_is_selected (selection->tree_view, node); if (selection->tree_view->priv->anchor) @@ -1100,7 +1100,7 @@ _pspp_sheet_selection_internal_select_node (PsppSheetSelection *selection, else dirty |= pspp_sheet_selection_real_select_node (selection, node, TRUE); } - else if ((mode & GTK_TREE_SELECT_MODE_EXTEND) == GTK_TREE_SELECT_MODE_EXTEND) + else if ((mode & PSPP_SHEET_SELECT_MODE_EXTEND) == PSPP_SHEET_SELECT_MODE_EXTEND) { dirty = pspp_sheet_selection_real_unselect_all (selection); dirty |= pspp_sheet_selection_real_modify_range (selection, diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c index 0b99df2b02..0e389c9a79 100644 --- a/src/ui/gui/pspp-sheet-view.c +++ b/src/ui/gui/pspp-sheet-view.c @@ -8407,7 +8407,7 @@ pspp_sheet_view_real_select_cursor_row (PsppSheetView *tree_view, int new_node = -1; int cursor_node = -1; GtkTreePath *cursor_path = NULL; - GtkTreeSelectMode mode = 0; + PsppSheetSelectMode mode = 0; if (!gtk_widget_has_focus (GTK_WIDGET (tree_view))) return FALSE; @@ -8438,9 +8438,9 @@ pspp_sheet_view_real_select_cursor_row (PsppSheetView *tree_view, } if (tree_view->priv->ctrl_pressed) - mode |= GTK_TREE_SELECT_MODE_TOGGLE; + mode |= PSPP_SHEET_SELECT_MODE_TOGGLE; if (tree_view->priv->shift_pressed) - mode |= GTK_TREE_SELECT_MODE_EXTEND; + mode |= PSPP_SHEET_SELECT_MODE_EXTEND; _pspp_sheet_selection_internal_select_node (tree_view->priv->selection, cursor_node, @@ -8498,7 +8498,7 @@ pspp_sheet_view_real_toggle_cursor_row (PsppSheetView *tree_view) _pspp_sheet_selection_internal_select_node (tree_view->priv->selection, cursor_node, cursor_path, - GTK_TREE_SELECT_MODE_TOGGLE, + PSPP_SHEET_SELECT_MODE_TOGGLE, FALSE); /* We bail out if the original (tree, node) don't exist anymore after @@ -10027,12 +10027,12 @@ pspp_sheet_view_real_set_cursor (PsppSheetView *tree_view, if (clear_and_select && !tree_view->priv->ctrl_pressed) { - GtkTreeSelectMode mode = 0; + PsppSheetSelectMode mode = 0; if (tree_view->priv->ctrl_pressed) - mode |= GTK_TREE_SELECT_MODE_TOGGLE; + mode |= PSPP_SHEET_SELECT_MODE_TOGGLE; if (tree_view->priv->shift_pressed) - mode |= GTK_TREE_SELECT_MODE_EXTEND; + mode |= PSPP_SHEET_SELECT_MODE_EXTEND; _pspp_sheet_selection_internal_select_node (tree_view->priv->selection, node, path, mode,