Updating branch refs/heads/master to 2b103d2cc906b55829e3f8b0064e2f241127018f (commit) from 4d487fd7e4d18f5308297b05282fcb8974941b8a (commit)
commit 2b103d2cc906b55829e3f8b0064e2f241127018f Author: Nick Schermer <n...@xfce.org> Date: Tue Sep 18 22:26:33 2012 +0200 Add function to invert selection in icon view. docs/reference/exo-sections.txt | 1 + exo/exo-icon-view.c | 35 +++++++++++++++++++++++++++++++++++ exo/exo-icon-view.h | 1 + exo/exo.symbols | 1 + 4 files changed, 38 insertions(+), 0 deletions(-) diff --git a/docs/reference/exo-sections.txt b/docs/reference/exo-sections.txt index 842fc1c..a1fe34f 100644 --- a/docs/reference/exo-sections.txt +++ b/docs/reference/exo-sections.txt @@ -198,6 +198,7 @@ exo_icon_view_get_item_row exo_icon_view_get_selected_items exo_icon_view_select_all exo_icon_view_unselect_all +exo_icon_view_selection_invert exo_icon_view_item_activated exo_icon_view_get_cursor exo_icon_view_set_cursor diff --git a/exo/exo-icon-view.c b/exo/exo-icon-view.c index 9587596..39bf93c 100644 --- a/exo/exo-icon-view.c +++ b/exo/exo-icon-view.c @@ -5627,6 +5627,41 @@ exo_icon_view_select_all (ExoIconView *icon_view) /** + * exo_icon_view_selection_invert: + * @icon_view : A #ExoIconView. + * + * Selects all the icons that are currently not selected. @icon_view must + * has its selection mode set to #GTK_SELECTION_MULTIPLE. + **/ +void +exo_icon_view_selection_invert (ExoIconView *icon_view) +{ + GList *items; + gboolean dirty = FALSE; + ExoIconViewItem *item; + + g_return_if_fail (EXO_IS_ICON_VIEW (icon_view)); + + if (icon_view->priv->selection_mode != GTK_SELECTION_MULTIPLE) + return; + + for (items = icon_view->priv->items; items; items = items->next) + { + item = items->data; + + item->selected = !item->selected; + exo_icon_view_queue_draw_item (icon_view, item); + + dirty = TRUE; + } + + if (dirty) + g_signal_emit (icon_view, icon_view_signals[SELECTION_CHANGED], 0); +} + + + +/** * exo_icon_view_unselect_all: * @icon_view : A #ExoIconView. * diff --git a/exo/exo-icon-view.h b/exo/exo-icon-view.h index 0dec327..6a8df23 100644 --- a/exo/exo-icon-view.h +++ b/exo/exo-icon-view.h @@ -260,6 +260,7 @@ gboolean exo_icon_view_path_is_selected (const ExoIconView GList *exo_icon_view_get_selected_items (const ExoIconView *icon_view); void exo_icon_view_select_all (ExoIconView *icon_view); void exo_icon_view_unselect_all (ExoIconView *icon_view); +void exo_icon_view_selection_invert (ExoIconView *icon_view); void exo_icon_view_item_activated (ExoIconView *icon_view, GtkTreePath *path); diff --git a/exo/exo.symbols b/exo/exo.symbols index 74511cb..9c3a659 100644 --- a/exo/exo.symbols +++ b/exo/exo.symbols @@ -197,6 +197,7 @@ exo_icon_view_get_item_row exo_icon_view_get_selected_items exo_icon_view_select_all exo_icon_view_unselect_all +exo_icon_view_selection_invert exo_icon_view_item_activated exo_icon_view_get_cursor exo_icon_view_set_cursor _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits