1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2007, 2009, 2010 Free Software Foundation
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 This module provides a widget, PsppireSelector derived from
22 It contains a GtkArrow, and is used for selecting objects from a
23 GtkTreeView and putting them into a destination widget (often
24 another GtkTreeView). Typically this is used in psppire for
25 selecting variables, thus:
28 +----------------------------------------------------------+
30 | Source Widget Dest Widget |
31 | +----------------+ +----------------+ |
32 | | Variable0 | | Variable2 | |
47 | +----------------+ +----------------+ |
49 +----------------------------------------------------------+
51 The Source Widget is always a GtkTreeView. The Dest Widget may be a
52 GtkTreeView or a GtkEntry (other destination widgets may be
53 supported in the future).
55 Widgets may be source to more than one PsppireSelector.
61 #include "psppire-dictview.h"
62 #include "psppire-var-view.h"
63 #include "psppire-dict.h"
64 #include "psppire-select-dest.h"
68 #include "psppire-selector.h"
70 static void psppire_selector_base_finalize (PsppireSelectorClass *, gpointer);
71 static void psppire_selector_base_init (PsppireSelectorClass *class);
72 static void psppire_selector_class_init (PsppireSelectorClass *class);
73 static void psppire_selector_init (PsppireSelector *selector);
76 static void set_direction (PsppireSelector *, enum psppire_selector_dir);
79 enum {SELECTED, /* Emitted when an item is inserted into dest */
80 DE_SELECTED, /* Emitted when an item is removed from dest */
83 static guint signals [n_SIGNALS];
87 psppire_selector_get_type (void)
89 static GType psppire_selector_type = 0;
91 if (!psppire_selector_type)
93 static const GTypeInfo psppire_selector_info =
95 sizeof (PsppireSelectorClass),
96 (GBaseInitFunc) psppire_selector_base_init,
97 (GBaseFinalizeFunc) psppire_selector_base_finalize,
98 (GClassInitFunc)psppire_selector_class_init,
99 (GClassFinalizeFunc) NULL,
101 sizeof (PsppireSelector),
103 (GInstanceInitFunc) psppire_selector_init,
106 psppire_selector_type =
107 g_type_register_static (GTK_TYPE_BUTTON, "PsppireSelector",
108 &psppire_selector_info, 0);
111 return psppire_selector_type;
114 static GObjectClass * parent_class = NULL;
117 psppire_selector_finalize (GObject *obj)
119 /* Chain up to the parent class */
120 G_OBJECT_CLASS (parent_class)->finalize (obj);
125 psppire_selector_dispose (GObject *obj)
127 PsppireSelector *sel = PSPPIRE_SELECTOR (obj);
129 if (sel->dispose_has_run)
132 /* Make sure dispose does not run twice. */
133 sel->dispose_has_run = TRUE;
135 g_object_unref (sel->dest);
136 g_object_unref (sel->source);
138 /* Chain up to the parent class */
139 G_OBJECT_CLASS (parent_class)->dispose (obj);
154 static void on_activate (PsppireSelector *selector, gpointer data);
156 static void update_subjects (PsppireSelector *selector);
160 psppire_selector_set_property (GObject *object,
165 PsppireSelector *selector = PSPPIRE_SELECTOR (object);
169 case PROP_ORIENTATION:
170 selector->orientation = g_value_get_enum (value);
171 set_direction (selector, selector->direction);
174 selector->primary_requested = TRUE;
175 update_subjects (selector);
177 case PROP_SOURCE_WIDGET:
178 selector->source = g_value_dup_object (value);
179 update_subjects (selector);
181 case PROP_DEST_WIDGET:
182 selector->dest = g_value_dup_object (value);
183 update_subjects (selector);
186 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
193 psppire_selector_get_property (GObject *object,
198 PsppireSelector *selector = PSPPIRE_SELECTOR (object);
202 case PROP_ORIENTATION:
203 g_value_set_enum (value, selector->orientation);
205 case PROP_SOURCE_WIDGET:
206 g_value_take_object (value, selector->source);
208 case PROP_DEST_WIDGET:
209 g_value_take_object (value, selector->dest);
212 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
218 psppire_selector_class_init (PsppireSelectorClass *class)
220 GObjectClass *object_class = G_OBJECT_CLASS (class);
221 GParamSpec *orientation_spec =
222 g_param_spec_enum ("orientation",
224 "Where the selector is relative to its subjects",
225 PSPPIRE_TYPE_SELECTOR_ORIENTATION,
226 PSPPIRE_SELECT_SOURCE_BEFORE_DEST /* default value */,
227 G_PARAM_CONSTRUCT_ONLY |G_PARAM_READWRITE);
230 /* Meaningfull only if more than one selector shares this selectors source */
231 GParamSpec *primary_spec =
232 g_param_spec_boolean ("primary",
234 "Whether this selector should be the primary selector for the source",
238 GParamSpec *source_widget_spec =
239 g_param_spec_object ("source-widget",
241 "The widget to be used as the source for this selector",
245 GParamSpec *dest_widget_spec =
246 g_param_spec_object ("dest-widget",
247 "Destination Widget",
248 "The widget to be used as the destination for this selector",
253 object_class->set_property = psppire_selector_set_property;
254 object_class->get_property = psppire_selector_get_property;
256 g_object_class_install_property (object_class,
260 g_object_class_install_property (object_class,
264 g_object_class_install_property (object_class,
268 g_object_class_install_property (object_class,
272 parent_class = g_type_class_peek_parent (class);
275 g_signal_new ("selected",
276 G_TYPE_FROM_CLASS (class),
280 g_cclosure_marshal_VOID__VOID,
284 signals [DE_SELECTED] =
285 g_signal_new ("de-selected",
286 G_TYPE_FROM_CLASS (class),
290 g_cclosure_marshal_VOID__VOID,
294 class->default_selection_funcs = g_hash_table_new (g_direct_hash, g_direct_equal);
299 psppire_selector_base_init (PsppireSelectorClass *class)
301 GObjectClass *object_class = G_OBJECT_CLASS (class);
303 object_class->finalize = psppire_selector_finalize;
304 object_class->dispose = psppire_selector_dispose;
306 class->source_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
312 psppire_selector_base_finalize(PsppireSelectorClass *class,
315 g_hash_table_destroy (class->source_hash);
316 g_hash_table_destroy (class->default_selection_funcs);
319 /* Callback for when the source treeview is activated (double clicked) */
321 on_row_activate (GtkTreeView *tree_view,
323 GtkTreeViewColumn *column,
326 PsppireSelector *selector = data;
328 gtk_action_activate (selector->action);
331 /* Callback for when the source selection changes */
333 on_source_select (GtkTreeSelection *treeselection, gpointer data)
335 PsppireSelector *selector = data;
337 set_direction (selector, PSPPIRE_SELECTOR_SOURCE_TO_DEST);
339 if ( selector->allow_selection )
341 gtk_action_set_sensitive (selector->action,
342 selector->allow_selection (selector->source, selector->dest));
344 else if ( GTK_IS_ENTRY (selector->dest) )
346 gtk_action_set_sensitive (selector->action,
347 gtk_tree_selection_count_selected_rows
348 (treeselection) <= 1 );
354 on_realize (PsppireSelector *selector)
356 PsppireSelectorClass *class = g_type_class_peek (PSPPIRE_SELECTOR_TYPE);
357 GtkTreeSelection* selection ;
359 GList *list = g_hash_table_lookup (class->source_hash, selector->source);
364 if ( g_list_first (list)->data == selector)
366 if ( selector->row_activate_id )
367 g_signal_handler_disconnect (selector->source, selector->row_activate_id);
369 selector->row_activate_id =
370 g_signal_connect (selector->source, "row-activated", G_CALLBACK (on_row_activate), selector);
373 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (selector->source));
375 if ( selector->source_select_id )
376 g_signal_handler_disconnect (selection, selector->source_select_id);
378 selector->source_select_id =
379 g_signal_connect (selection, "changed", G_CALLBACK (on_source_select), selector);
384 psppire_selector_init (PsppireSelector *selector)
386 selector->primary_requested = FALSE;
387 selector->select_user_data = NULL;
388 selector->select_items = NULL;
389 selector->allow_selection = NULL;
390 selector->filter = NULL;
392 selector->arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
393 selector->filtered_source = NULL;
395 selector->action = gtk_action_new ("select", NULL, NULL, "pspp-stock-select");
397 gtk_action_connect_proxy (selector->action, GTK_WIDGET (selector));
399 gtk_container_add (GTK_CONTAINER (selector), selector->arrow);
401 gtk_widget_show (selector->arrow);
403 g_signal_connect_swapped (selector->action, "activate", G_CALLBACK (on_activate), selector);
405 selector->selecting = FALSE;
407 selector->source = NULL;
408 selector->dest = NULL;
409 selector->dispose_has_run = FALSE;
412 selector->row_activate_id = 0;
413 selector->source_select_id = 0;
415 g_signal_connect (selector, "realize",
416 G_CALLBACK (on_realize), NULL);
422 psppire_selector_new (void)
424 return GTK_WIDGET (g_object_new (psppire_selector_get_type (), NULL));
429 set_direction (PsppireSelector *selector, enum psppire_selector_dir d)
431 selector->direction = d;
433 /* FIXME: Need to reverse the arrow direction if an RTL locale is in
435 if ( d == PSPPIRE_SELECTOR_SOURCE_TO_DEST )
437 switch (selector->orientation)
439 case PSPPIRE_SELECT_SOURCE_BEFORE_DEST:
440 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_RIGHT, NULL);
442 case PSPPIRE_SELECT_SOURCE_AFTER_DEST:
443 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_LEFT, NULL);
445 case PSPPIRE_SELECT_SOURCE_ABOVE_DEST:
446 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_DOWN, NULL);
448 case PSPPIRE_SELECT_SOURCE_BELOW_DEST:
449 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_UP, NULL);
452 g_assert_not_reached ();
458 switch (selector->orientation)
460 case PSPPIRE_SELECT_SOURCE_BEFORE_DEST:
461 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_LEFT, NULL);
463 case PSPPIRE_SELECT_SOURCE_AFTER_DEST:
464 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_RIGHT, NULL);
466 case PSPPIRE_SELECT_SOURCE_ABOVE_DEST:
467 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_UP, NULL);
469 case PSPPIRE_SELECT_SOURCE_BELOW_DEST:
470 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_DOWN, NULL);
473 g_assert_not_reached ();
480 /* Callback for when the destination treeview selection changes */
482 on_dest_treeview_select (GtkTreeSelection *treeselection, gpointer data)
484 PsppireSelector *selector = data;
486 gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (selector->source)));
488 set_direction (selector, PSPPIRE_SELECTOR_DEST_TO_SOURCE);
491 /* Callback for source deselection, when the dest is GtkEntry */
493 de_select_selection_entry (PsppireSelector *selector)
495 gtk_entry_set_text (GTK_ENTRY (selector->dest), "");
498 /* Callback for source deselection, when the dest is GtkTreeView */
500 de_select_selection_tree_view (PsppireSelector *selector)
504 GtkTreeSelection* selection =
505 gtk_tree_view_get_selection ( GTK_TREE_VIEW (selector->dest));
507 GtkTreeModel *model =
508 gtk_tree_view_get_model (GTK_TREE_VIEW (selector->dest));
510 GList *selected_rows =
511 gtk_tree_selection_get_selected_rows (selection, NULL);
513 g_return_if_fail (selector->select_items);
515 /* Convert paths to RowRefs */
516 for (item = g_list_first (selected_rows);
518 item = g_list_next (item))
520 GtkTreeRowReference* rowref;
521 GtkTreePath *path = item->data;
523 rowref = gtk_tree_row_reference_new (GTK_TREE_MODEL (model), path);
525 item->data = rowref ;
526 gtk_tree_path_free (path);
529 /* Remove each selected row from the dest widget */
530 for (item = g_list_first (selected_rows);
532 item = g_list_next (item))
535 GtkTreeRowReference *rr = item->data;
537 GtkTreePath *path = gtk_tree_row_reference_get_path (rr);
539 gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
541 gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
543 gtk_tree_path_free (path);
546 /* Delete list of RowRefs and its contents */
547 g_list_foreach (selected_rows, (GFunc) gtk_tree_row_reference_free, NULL);
548 g_list_free (selected_rows);
552 /* Removes something from the DEST widget */
554 de_select_selection (PsppireSelector *selector)
556 selector->selecting = TRUE;
558 if ( GTK_IS_TREE_VIEW (selector->dest ) )
559 de_select_selection_tree_view (selector);
561 else if ( GTK_IS_ENTRY (selector->dest))
562 de_select_selection_entry (selector);
565 g_assert_not_reached ();
567 selector->selecting = FALSE;
569 gtk_tree_model_filter_refilter (selector->filtered_source);
571 g_signal_emit (selector, signals [DE_SELECTED], 0);
575 /* Puts something into the DEST widget */
577 select_selection (PsppireSelector *selector)
580 GtkTreeSelection* selection =
581 gtk_tree_view_get_selection ( GTK_TREE_VIEW (selector->source));
583 GList *selected_rows =
584 gtk_tree_selection_get_selected_rows (selection, NULL);
586 GtkTreeModel *childmodel = gtk_tree_model_filter_get_model
587 (selector->filtered_source);
589 g_return_if_fail (selector->select_items);
591 selector->selecting = TRUE;
593 for (item = g_list_first (selected_rows);
595 item = g_list_next (item))
597 GtkTreeIter child_iter;
599 GtkTreePath *path = item->data;
601 gtk_tree_model_get_iter (GTK_TREE_MODEL (selector->filtered_source),
604 gtk_tree_model_filter_convert_iter_to_child_iter
605 (selector->filtered_source,
609 selector->select_items (child_iter,
612 selector->select_user_data
616 g_list_foreach (selected_rows, (GFunc) gtk_tree_path_free, NULL);
617 g_list_free (selected_rows);
619 gtk_tree_model_filter_refilter (selector->filtered_source);
621 g_signal_emit (selector, signals [SELECTED], 0);
623 selector->selecting = FALSE;
626 /* Callback for when the selector button is clicked,
627 or other event which causes the selector's action to occur.
630 on_activate (PsppireSelector *selector, gpointer data)
632 switch (selector->direction)
634 case PSPPIRE_SELECTOR_SOURCE_TO_DEST:
635 select_selection (selector);
637 case PSPPIRE_SELECTOR_DEST_TO_SOURCE:
638 de_select_selection (selector);
641 g_assert_not_reached ();
647 is_item_in_dest (GtkTreeModel *model, GtkTreeIter *iter, PsppireSelector *selector)
649 gboolean result = FALSE;
650 GtkTreeIter source_iter;
651 GtkTreeModel *source_model;
654 if (GTK_IS_TREE_MODEL_FILTER (model))
656 source_model = gtk_tree_model_filter_get_model
657 (GTK_TREE_MODEL_FILTER (model));
659 gtk_tree_model_filter_convert_iter_to_child_iter
660 (GTK_TREE_MODEL_FILTER (model), &source_iter, iter);
664 source_model = model;
668 gtk_tree_model_get_value (source_model, &source_iter, DICT_TVM_COL_VAR, &value);
670 result = psppire_select_dest_widget_contains_var (PSPPIRE_SELECT_DEST_WIDGET (selector->dest),
673 g_value_unset (&value);
680 /* Visibility function for items in the SOURCE widget.
681 Returns TRUE iff *all* the selectors for which SOURCE is associated
684 is_source_item_visible (GtkTreeModel *childmodel,
685 GtkTreeIter *iter, gpointer data)
687 PsppireSelector *selector = data;
688 PsppireSelectorClass *class = g_type_class_peek (PSPPIRE_SELECTOR_TYPE);
692 list = g_hash_table_lookup (class->source_hash, selector->source);
696 PsppireSelector *selector = list->data;
698 if ( selector->filter && selector->filter (childmodel, iter, selector))
708 /* set the source widget to SOURCE */
710 set_tree_view_source (PsppireSelector *selector,
715 PsppireSelectorClass *class = g_type_class_peek (PSPPIRE_SELECTOR_TYPE);
717 GtkTreeModel *model = gtk_tree_view_get_model (source);
719 if ( ! (list = g_hash_table_lookup (class->source_hash, source)))
721 selector->filtered_source =
722 GTK_TREE_MODEL_FILTER (gtk_tree_model_filter_new (model, NULL));
724 gtk_tree_view_set_model (source,
725 GTK_TREE_MODEL (selector->filtered_source));
727 list = g_list_append (list, selector);
728 g_hash_table_insert (class->source_hash, source, list);
731 gtk_tree_model_filter_set_visible_func (selector->filtered_source,
732 is_source_item_visible,
737 { /* Append this selector to the list and push the <source,list>
738 pair onto the hash table */
740 selector->filtered_source = GTK_TREE_MODEL_FILTER (model);
742 if ( NULL == g_list_find (list, selector) )
744 if ( selector->primary_requested )
745 list = g_list_prepend (list, selector);
747 list = g_list_append (list, selector);
748 g_hash_table_replace (class->source_hash, source, list);
755 Callback for when the destination treeview's data changes
758 on_dest_data_change (GtkTreeModel *tree_model,
763 PsppireSelector *selector = user_data;
765 if ( selector->selecting) return;
767 gtk_tree_model_filter_refilter (selector->filtered_source);
772 on_dest_data_delete (GtkTreeModel *tree_model,
776 PsppireSelector *selector = user_data;
778 if ( selector->selecting ) return;
780 gtk_tree_model_filter_refilter (selector->filtered_source);
785 on_dest_model_changed (PsppireSelector *selector)
787 GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector->dest));
789 g_signal_connect (model, "row-changed", G_CALLBACK (on_dest_data_change),
792 g_signal_connect (model, "row-deleted", G_CALLBACK (on_dest_data_delete),
796 /* Set the destination widget to DEST */
798 set_tree_view_dest (PsppireSelector *selector,
801 GtkTreeSelection* selection = gtk_tree_view_get_selection (dest);
804 gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
806 g_signal_connect (selection, "changed", G_CALLBACK (on_dest_treeview_select),
809 on_dest_model_changed (selector);
810 g_signal_connect_swapped (dest, "notify::model",
811 G_CALLBACK (on_dest_model_changed), selector);
815 /* Callback which causes the filter to be refiltered.
816 Called when the DEST GtkEntry is activated (Enter is pressed), or when it
820 refilter (PsppireSelector *selector)
822 gtk_tree_model_filter_refilter (selector->filtered_source);
827 /* Callback for when the DEST GtkEntry is selected (clicked) */
829 on_entry_dest_select (GtkWidget *widget, GdkEventFocus *event, gpointer data)
831 PsppireSelector * selector = data;
833 gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (selector->source)));
834 set_direction (selector, PSPPIRE_SELECTOR_DEST_TO_SOURCE);
840 /* Callback for when an item disappears from the source list.
841 By implication, this means that the item has been inserted into the
845 on_row_deleted (PsppireSelector *selector)
847 g_signal_emit (selector, signals [SELECTED], 0);
850 /* Callback for when a new item appears in the source list.
851 By implication, this means that an item has been deleted from the
855 on_row_inserted (PsppireSelector *selector)
857 g_signal_emit (selector, signals [DE_SELECTED], 0);
862 /* Set DEST to be the destination GtkEntry widget */
864 set_entry_dest (PsppireSelector *selector,
867 g_signal_connect_swapped (dest, "activate", G_CALLBACK (refilter),
870 g_signal_connect_swapped (dest, "changed", G_CALLBACK (refilter),
873 g_signal_connect (dest, "focus-in-event", G_CALLBACK (on_entry_dest_select),
876 g_signal_connect_swapped (dest, "focus-out-event", G_CALLBACK (refilter),
880 g_signal_connect_swapped (selector->filtered_source, "row-deleted",
881 G_CALLBACK (on_row_deleted), selector);
883 g_signal_connect_swapped (selector->filtered_source, "row-inserted",
884 G_CALLBACK (on_row_inserted), selector);
888 set_default_filter (PsppireSelector *selector)
890 if ( selector->filter == NULL)
892 if (GTK_IS_TREE_VIEW (selector->dest))
893 selector->filter = is_item_in_dest;
898 update_subjects (PsppireSelector *selector)
900 GtkTreeModel *model = NULL;
902 if ( NULL == selector->dest )
905 set_default_filter (selector);
907 if ( NULL == selector->source )
910 g_signal_connect_swapped (selector->source, "notify::model",
911 G_CALLBACK (update_subjects), selector);
913 model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector->source));
919 if ( GTK_IS_TREE_VIEW (selector->source))
920 set_tree_view_source (selector, GTK_TREE_VIEW (selector->source) );
922 g_error ("Unsupported source widget: %s", G_OBJECT_TYPE_NAME (selector->source));
924 if ( NULL == selector->dest)
926 else if ( GTK_IS_TREE_VIEW (selector->dest))
928 set_tree_view_dest (selector, GTK_TREE_VIEW (selector->dest));
931 else if ( GTK_IS_ENTRY (selector->dest))
932 set_entry_dest (selector, GTK_ENTRY (selector->dest));
934 else if (GTK_IS_TEXT_VIEW (selector->dest))
936 /* Nothing to be done */
939 g_error ("Unsupported destination widget: %s", G_OBJECT_TYPE_NAME (selector->dest));
942 /* FIXME: Remove this dependency */
943 if ( PSPPIRE_IS_DICT_VIEW (selector->source) )
945 GObjectClass *class = G_OBJECT_GET_CLASS (selector);
946 GType type = G_OBJECT_TYPE (selector->dest);
948 SelectItemsFunc *func =
949 g_hash_table_lookup (PSPPIRE_SELECTOR_CLASS (class)->default_selection_funcs, (gpointer) type);
952 psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
959 psppire_selector_set_default_selection_func (GType type, SelectItemsFunc *func)
961 GObjectClass *class = g_type_class_ref (PSPPIRE_SELECTOR_TYPE);
963 g_hash_table_insert (PSPPIRE_SELECTOR_CLASS (class)->default_selection_funcs, (gpointer) type, func);
965 g_type_class_unref (class);
971 /* Set FILTER_FUNC for this selector */
973 psppire_selector_set_filter_func (PsppireSelector *selector,
974 FilterItemsFunc *filter_func)
976 selector->filter = filter_func ;
980 /* Set SELECT_FUNC for this selector */
982 psppire_selector_set_select_func (PsppireSelector *selector,
983 SelectItemsFunc *select_func,
986 selector->select_user_data = user_data;
987 selector->select_items = select_func;
993 psppire_selector_set_allow (PsppireSelector *selector, AllowSelectionFunc *allow)
995 selector->allow_selection = allow;
1000 psppire_selector_orientation_get_type (void)
1002 static GType etype = 0;
1004 static const GEnumValue values[] = {
1005 { PSPPIRE_SELECT_SOURCE_BEFORE_DEST, "PSPPIRE_SELECT_SOURCE_BEFORE_DEST", "source before destination" },
1006 { PSPPIRE_SELECT_SOURCE_AFTER_DEST, "PSPPIRE_SELECT_SOURCE_AFTER_DEST", "source after destination" },
1007 { PSPPIRE_SELECT_SOURCE_ABOVE_DEST, "PSPPIRE_SELECT_SOURCE_ABOVE_DEST", "source above destination" },
1008 { PSPPIRE_SELECT_SOURCE_BELOW_DEST, "PSPPIRE_SELECT_SOURCE_BELOW_DEST", "source below destination" },
1011 etype = g_enum_register_static (g_intern_static_string ("PsppireSelectorOrientation"), values);