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_click (GtkButton *b);
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 GtkButtonClass *button_class = GTK_BUTTON_CLASS (class);
222 GParamSpec *orientation_spec =
223 g_param_spec_enum ("orientation",
225 "Where the selector is relative to its subjects",
226 PSPPIRE_TYPE_SELECTOR_ORIENTATION,
227 PSPPIRE_SELECT_SOURCE_BEFORE_DEST /* default value */,
228 G_PARAM_CONSTRUCT_ONLY |G_PARAM_READWRITE);
231 /* Meaningfull only if more than one selector shares this selectors source */
232 GParamSpec *primary_spec =
233 g_param_spec_boolean ("primary",
235 "Whether this selector should be the primary selector for the source",
239 GParamSpec *source_widget_spec =
240 g_param_spec_object ("source-widget",
242 "The widget to be used as the source for this selector",
246 GParamSpec *dest_widget_spec =
247 g_param_spec_object ("dest-widget",
248 "Destination Widget",
249 "The widget to be used as the destination for this selector",
254 button_class->clicked = on_click;
256 object_class->set_property = psppire_selector_set_property;
257 object_class->get_property = psppire_selector_get_property;
259 g_object_class_install_property (object_class,
263 g_object_class_install_property (object_class,
267 g_object_class_install_property (object_class,
271 g_object_class_install_property (object_class,
275 parent_class = g_type_class_peek_parent (class);
278 g_signal_new ("selected",
279 G_TYPE_FROM_CLASS (class),
283 g_cclosure_marshal_VOID__VOID,
287 signals [DE_SELECTED] =
288 g_signal_new ("de-selected",
289 G_TYPE_FROM_CLASS (class),
293 g_cclosure_marshal_VOID__VOID,
297 class->default_selection_funcs = g_hash_table_new (g_direct_hash, g_direct_equal);
302 psppire_selector_base_init (PsppireSelectorClass *class)
304 GObjectClass *object_class = G_OBJECT_CLASS (class);
306 object_class->finalize = psppire_selector_finalize;
307 object_class->dispose = psppire_selector_dispose;
309 class->source_hash = g_hash_table_new (g_direct_hash, g_direct_equal);
315 psppire_selector_base_finalize(PsppireSelectorClass *class,
318 g_hash_table_destroy (class->source_hash);
319 g_hash_table_destroy (class->default_selection_funcs);
322 /* Callback for when the source treeview is activated (double clicked) */
324 on_row_activate (GtkTreeView *tree_view,
326 GtkTreeViewColumn *column,
329 on_click (GTK_BUTTON (data));
332 /* Callback for when the source selection changes */
334 on_source_select (GtkTreeSelection *treeselection, gpointer data)
336 PsppireSelector *selector = data;
338 set_direction (selector, PSPPIRE_SELECTOR_SOURCE_TO_DEST);
340 if ( selector->allow_selection )
342 gtk_widget_set_sensitive (GTK_WIDGET (selector),
343 selector->allow_selection (selector->source, selector->dest));
345 else if ( GTK_IS_ENTRY (selector->dest) )
347 gtk_widget_set_sensitive (GTK_WIDGET (selector),
348 gtk_tree_selection_count_selected_rows
349 (treeselection) <= 1 );
355 on_realize (PsppireSelector *selector)
357 PsppireSelectorClass *class = g_type_class_peek (PSPPIRE_SELECTOR_TYPE);
358 GtkTreeSelection* selection ;
360 GList *list = g_hash_table_lookup (class->source_hash, selector->source);
365 if ( g_list_first (list)->data == selector)
367 if ( selector->row_activate_id )
368 g_signal_handler_disconnect (selector->source, selector->row_activate_id);
370 selector->row_activate_id =
371 g_signal_connect (selector->source, "row-activated", G_CALLBACK (on_row_activate), selector);
374 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (selector->source));
376 if ( selector->source_select_id )
377 g_signal_handler_disconnect (selection, selector->source_select_id);
379 selector->source_select_id =
380 g_signal_connect (selection, "changed", G_CALLBACK (on_source_select), selector);
385 psppire_selector_init (PsppireSelector *selector)
387 selector->primary_requested = FALSE;
388 selector->select_user_data = NULL;
389 selector->select_items = NULL;
390 selector->allow_selection = NULL;
391 selector->filter = NULL;
393 selector->arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE);
394 selector->filtered_source = NULL;
397 gtk_container_add (GTK_CONTAINER (selector), selector->arrow);
399 gtk_widget_show (selector->arrow);
401 selector->selecting = FALSE;
403 selector->source = NULL;
404 selector->dest = NULL;
405 selector->dispose_has_run = FALSE;
408 selector->row_activate_id = 0;
409 selector->source_select_id = 0;
411 g_signal_connect (selector, "realize",
412 G_CALLBACK (on_realize), NULL);
418 psppire_selector_new (void)
420 return GTK_WIDGET (g_object_new (psppire_selector_get_type (), NULL));
425 set_direction (PsppireSelector *selector, enum psppire_selector_dir d)
427 selector->direction = d;
429 /* FIXME: Need to reverse the arrow direction if an RTL locale is in
431 if ( d == PSPPIRE_SELECTOR_SOURCE_TO_DEST )
433 switch (selector->orientation)
435 case PSPPIRE_SELECT_SOURCE_BEFORE_DEST:
436 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_RIGHT, NULL);
438 case PSPPIRE_SELECT_SOURCE_AFTER_DEST:
439 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_LEFT, NULL);
441 case PSPPIRE_SELECT_SOURCE_ABOVE_DEST:
442 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_DOWN, NULL);
444 case PSPPIRE_SELECT_SOURCE_BELOW_DEST:
445 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_UP, NULL);
448 g_assert_not_reached ();
454 switch (selector->orientation)
456 case PSPPIRE_SELECT_SOURCE_BEFORE_DEST:
457 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_LEFT, NULL);
459 case PSPPIRE_SELECT_SOURCE_AFTER_DEST:
460 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_RIGHT, NULL);
462 case PSPPIRE_SELECT_SOURCE_ABOVE_DEST:
463 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_UP, NULL);
465 case PSPPIRE_SELECT_SOURCE_BELOW_DEST:
466 g_object_set (selector->arrow, "arrow-type", GTK_ARROW_DOWN, NULL);
469 g_assert_not_reached ();
476 /* Callback for when the destination treeview selection changes */
478 on_dest_treeview_select (GtkTreeSelection *treeselection, gpointer data)
480 PsppireSelector *selector = data;
482 gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (selector->source)));
484 set_direction (selector, PSPPIRE_SELECTOR_DEST_TO_SOURCE);
487 /* Callback for source deselection, when the dest is GtkEntry */
489 de_select_selection_entry (PsppireSelector *selector)
491 gtk_entry_set_text (GTK_ENTRY (selector->dest), "");
494 /* Callback for source deselection, when the dest is GtkTreeView */
496 de_select_selection_tree_view (PsppireSelector *selector)
500 GtkTreeSelection* selection =
501 gtk_tree_view_get_selection ( GTK_TREE_VIEW (selector->dest));
503 GtkTreeModel *model =
504 gtk_tree_view_get_model (GTK_TREE_VIEW (selector->dest));
506 GList *selected_rows =
507 gtk_tree_selection_get_selected_rows (selection, NULL);
509 g_return_if_fail (selector->select_items);
511 /* Convert paths to RowRefs */
512 for (item = g_list_first (selected_rows);
514 item = g_list_next (item))
516 GtkTreeRowReference* rowref;
517 GtkTreePath *path = item->data;
519 rowref = gtk_tree_row_reference_new (GTK_TREE_MODEL (model), path);
521 item->data = rowref ;
522 gtk_tree_path_free (path);
525 /* Remove each selected row from the dest widget */
526 for (item = g_list_first (selected_rows);
528 item = g_list_next (item))
531 GtkTreeRowReference *rr = item->data;
533 GtkTreePath *path = gtk_tree_row_reference_get_path (rr);
535 gtk_tree_model_get_iter (GTK_TREE_MODEL (model), &iter, path);
537 gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
539 gtk_tree_path_free (path);
542 /* Delete list of RowRefs and its contents */
543 g_list_foreach (selected_rows, (GFunc) gtk_tree_row_reference_free, NULL);
544 g_list_free (selected_rows);
548 /* Removes something from the DEST widget */
550 de_select_selection (PsppireSelector *selector)
552 selector->selecting = TRUE;
554 if ( GTK_IS_TREE_VIEW (selector->dest ) )
555 de_select_selection_tree_view (selector);
557 else if ( GTK_IS_ENTRY (selector->dest))
558 de_select_selection_entry (selector);
561 g_assert_not_reached ();
563 selector->selecting = FALSE;
565 gtk_tree_model_filter_refilter (selector->filtered_source);
567 g_signal_emit (selector, signals [DE_SELECTED], 0);
571 /* Puts something into the DEST widget */
573 select_selection (PsppireSelector *selector)
576 GtkTreeSelection* selection =
577 gtk_tree_view_get_selection ( GTK_TREE_VIEW (selector->source));
579 GList *selected_rows =
580 gtk_tree_selection_get_selected_rows (selection, NULL);
582 GtkTreeModel *childmodel = gtk_tree_model_filter_get_model
583 (selector->filtered_source);
585 g_return_if_fail (selector->select_items);
587 selector->selecting = TRUE;
589 for (item = g_list_first (selected_rows);
591 item = g_list_next (item))
593 GtkTreeIter child_iter;
595 GtkTreePath *path = item->data;
597 gtk_tree_model_get_iter (GTK_TREE_MODEL (selector->filtered_source),
600 gtk_tree_model_filter_convert_iter_to_child_iter
601 (selector->filtered_source,
605 selector->select_items (child_iter,
608 selector->select_user_data
612 g_list_foreach (selected_rows, (GFunc) gtk_tree_path_free, NULL);
613 g_list_free (selected_rows);
615 gtk_tree_model_filter_refilter (selector->filtered_source);
617 g_signal_emit (selector, signals [SELECTED], 0);
619 selector->selecting = FALSE;
622 /* Callback for when the selector button is clicked,
623 or other event which causes the selector's action to occur.
626 on_click (GtkButton *b)
628 PsppireSelector *selector = PSPPIRE_SELECTOR (b);
630 switch (selector->direction)
632 case PSPPIRE_SELECTOR_SOURCE_TO_DEST:
633 select_selection (selector);
635 case PSPPIRE_SELECTOR_DEST_TO_SOURCE:
636 de_select_selection (selector);
639 g_assert_not_reached ();
643 if (GTK_BUTTON_CLASS (parent_class)->clicked)
644 GTK_BUTTON_CLASS (parent_class)->clicked (b);
649 is_item_in_dest (GtkTreeModel *model, GtkTreeIter *iter, PsppireSelector *selector)
651 gboolean result = FALSE;
652 GtkTreeIter source_iter;
653 GtkTreeModel *source_model;
656 if (GTK_IS_TREE_MODEL_FILTER (model))
658 source_model = gtk_tree_model_filter_get_model
659 (GTK_TREE_MODEL_FILTER (model));
661 gtk_tree_model_filter_convert_iter_to_child_iter
662 (GTK_TREE_MODEL_FILTER (model), &source_iter, iter);
666 source_model = model;
670 gtk_tree_model_get_value (source_model, &source_iter, DICT_TVM_COL_VAR, &value);
672 result = psppire_select_dest_widget_contains_var (PSPPIRE_SELECT_DEST_WIDGET (selector->dest),
675 g_value_unset (&value);
682 /* Visibility function for items in the SOURCE widget.
683 Returns TRUE iff *all* the selectors for which SOURCE is associated
686 is_source_item_visible (GtkTreeModel *childmodel,
687 GtkTreeIter *iter, gpointer data)
689 PsppireSelector *selector = data;
690 PsppireSelectorClass *class = g_type_class_peek (PSPPIRE_SELECTOR_TYPE);
694 list = g_hash_table_lookup (class->source_hash, selector->source);
698 PsppireSelector *selector = list->data;
700 if ( selector->filter && selector->filter (childmodel, iter, selector))
710 /* set the source widget to SOURCE */
712 set_tree_view_source (PsppireSelector *selector,
717 PsppireSelectorClass *class = g_type_class_peek (PSPPIRE_SELECTOR_TYPE);
719 GtkTreeModel *model = gtk_tree_view_get_model (source);
721 if ( ! (list = g_hash_table_lookup (class->source_hash, source)))
723 selector->filtered_source =
724 GTK_TREE_MODEL_FILTER (gtk_tree_model_filter_new (model, NULL));
726 gtk_tree_view_set_model (source,
727 GTK_TREE_MODEL (selector->filtered_source));
729 list = g_list_append (list, selector);
730 g_hash_table_insert (class->source_hash, source, list);
733 gtk_tree_model_filter_set_visible_func (selector->filtered_source,
734 is_source_item_visible,
739 { /* Append this selector to the list and push the <source,list>
740 pair onto the hash table */
742 selector->filtered_source = GTK_TREE_MODEL_FILTER (model);
744 if ( NULL == g_list_find (list, selector) )
746 if ( selector->primary_requested )
747 list = g_list_prepend (list, selector);
749 list = g_list_append (list, selector);
750 g_hash_table_replace (class->source_hash, source, list);
757 Callback for when the destination treeview's data changes
760 on_dest_data_change (GtkTreeModel *tree_model,
765 PsppireSelector *selector = user_data;
767 if ( selector->selecting) return;
769 gtk_tree_model_filter_refilter (selector->filtered_source);
774 on_dest_data_delete (GtkTreeModel *tree_model,
778 PsppireSelector *selector = user_data;
780 if ( selector->selecting ) return;
782 gtk_tree_model_filter_refilter (selector->filtered_source);
787 on_dest_model_changed (PsppireSelector *selector)
789 GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector->dest));
791 g_signal_connect (model, "row-changed", G_CALLBACK (on_dest_data_change),
794 g_signal_connect (model, "row-deleted", G_CALLBACK (on_dest_data_delete),
798 /* Set the destination widget to DEST */
800 set_tree_view_dest (PsppireSelector *selector,
803 GtkTreeSelection* selection = gtk_tree_view_get_selection (dest);
806 gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
808 g_signal_connect (selection, "changed", G_CALLBACK (on_dest_treeview_select),
811 on_dest_model_changed (selector);
812 g_signal_connect_swapped (dest, "notify::model",
813 G_CALLBACK (on_dest_model_changed), selector);
817 /* Callback which causes the filter to be refiltered.
818 Called when the DEST GtkEntry is activated (Enter is pressed), or when it
822 refilter (PsppireSelector *selector)
824 gtk_tree_model_filter_refilter (selector->filtered_source);
829 /* Callback for when the DEST GtkEntry is selected (clicked) */
831 on_entry_dest_select (GtkWidget *widget, GdkEventFocus *event, gpointer data)
833 PsppireSelector * selector = data;
835 gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (selector->source)));
836 set_direction (selector, PSPPIRE_SELECTOR_DEST_TO_SOURCE);
842 /* Callback for when an item disappears from the source list.
843 By implication, this means that the item has been inserted into the
847 on_row_deleted (PsppireSelector *selector)
849 g_signal_emit (selector, signals [SELECTED], 0);
852 /* Callback for when a new item appears in the source list.
853 By implication, this means that an item has been deleted from the
857 on_row_inserted (PsppireSelector *selector)
859 g_signal_emit (selector, signals [DE_SELECTED], 0);
864 /* Set DEST to be the destination GtkEntry widget */
866 set_entry_dest (PsppireSelector *selector,
869 g_signal_connect_swapped (dest, "activate", G_CALLBACK (refilter),
872 g_signal_connect_swapped (dest, "changed", G_CALLBACK (refilter),
875 g_signal_connect (dest, "focus-in-event", G_CALLBACK (on_entry_dest_select),
878 g_signal_connect_swapped (dest, "focus-out-event", G_CALLBACK (refilter),
882 g_signal_connect_swapped (selector->filtered_source, "row-deleted",
883 G_CALLBACK (on_row_deleted), selector);
885 g_signal_connect_swapped (selector->filtered_source, "row-inserted",
886 G_CALLBACK (on_row_inserted), selector);
890 set_default_filter (PsppireSelector *selector)
892 if ( selector->filter == NULL)
894 if (GTK_IS_TREE_VIEW (selector->dest))
895 selector->filter = is_item_in_dest;
900 update_subjects (PsppireSelector *selector)
902 GtkTreeModel *model = NULL;
904 if ( NULL == selector->dest )
907 set_default_filter (selector);
909 if ( NULL == selector->source )
912 g_signal_connect_swapped (selector->source, "notify::model",
913 G_CALLBACK (update_subjects), selector);
915 model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector->source));
921 if ( GTK_IS_TREE_VIEW (selector->source))
922 set_tree_view_source (selector, GTK_TREE_VIEW (selector->source) );
924 g_error ("Unsupported source widget: %s", G_OBJECT_TYPE_NAME (selector->source));
926 if ( NULL == selector->dest)
928 else if ( GTK_IS_TREE_VIEW (selector->dest))
930 set_tree_view_dest (selector, GTK_TREE_VIEW (selector->dest));
933 else if ( GTK_IS_ENTRY (selector->dest))
934 set_entry_dest (selector, GTK_ENTRY (selector->dest));
936 else if (GTK_IS_TEXT_VIEW (selector->dest))
938 /* Nothing to be done */
941 g_error ("Unsupported destination widget: %s", G_OBJECT_TYPE_NAME (selector->dest));
944 /* FIXME: Remove this dependency */
945 if ( PSPPIRE_IS_DICT_VIEW (selector->source) )
947 GObjectClass *class = G_OBJECT_GET_CLASS (selector);
948 GType type = G_OBJECT_TYPE (selector->dest);
950 SelectItemsFunc *func =
951 g_hash_table_lookup (PSPPIRE_SELECTOR_CLASS (class)->default_selection_funcs, (gpointer) type);
954 psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
961 psppire_selector_set_default_selection_func (GType type, SelectItemsFunc *func)
963 GObjectClass *class = g_type_class_ref (PSPPIRE_SELECTOR_TYPE);
965 g_hash_table_insert (PSPPIRE_SELECTOR_CLASS (class)->default_selection_funcs, (gpointer) type, func);
967 g_type_class_unref (class);
973 /* Set FILTER_FUNC for this selector */
975 psppire_selector_set_filter_func (PsppireSelector *selector,
976 FilterItemsFunc *filter_func)
978 selector->filter = filter_func ;
982 /* Set SELECT_FUNC for this selector */
984 psppire_selector_set_select_func (PsppireSelector *selector,
985 SelectItemsFunc *select_func,
988 selector->select_user_data = user_data;
989 selector->select_items = select_func;
995 psppire_selector_set_allow (PsppireSelector *selector, AllowSelectionFunc *allow)
997 selector->allow_selection = allow;
1002 psppire_selector_orientation_get_type (void)
1004 static GType etype = 0;
1006 static const GEnumValue values[] = {
1007 { PSPPIRE_SELECT_SOURCE_BEFORE_DEST, "PSPPIRE_SELECT_SOURCE_BEFORE_DEST", "source before destination" },
1008 { PSPPIRE_SELECT_SOURCE_AFTER_DEST, "PSPPIRE_SELECT_SOURCE_AFTER_DEST", "source after destination" },
1009 { PSPPIRE_SELECT_SOURCE_ABOVE_DEST, "PSPPIRE_SELECT_SOURCE_ABOVE_DEST", "source above destination" },
1010 { PSPPIRE_SELECT_SOURCE_BELOW_DEST, "PSPPIRE_SELECT_SOURCE_BELOW_DEST", "source below destination" },
1013 etype = g_enum_register_static (g_intern_static_string ("PsppireSelectorOrientation"), values);