1 ;;; gtk-select.el --- Lisp interface to GTK selections.
3 ;; Copyright (C) 1990, 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 1995 Sun Microsystems.
5 ;; Copyright (C) 2000 Free Software Foundation
7 ;; Maintainer: William Perry <wmperry@gnu.org>
8 ;; Keywords: extensions, dumped
10 ;; This file is part of SXEmacs.
12 ;; SXEmacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; SXEmacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
25 ;;; Synched up with: Not in FSF
29 ;; This file is dumped with SXEmacs (when GTK support is compiled in).
30 ;; #### Only copes with copying/pasting text
34 (defun gtk-get-secondary-selection ()
35 "Return text selected from some GTK window."
36 (get-selection 'SECONDARY))
38 (defun gtk-own-secondary-selection (selection &optional type)
39 "Make a secondary GTK Selection of the given argument. The argument may be a
40 string or a cons of two markers (in which case the selection is considered to
41 be the text between those markers)."
42 (interactive (if (not current-prefix-arg)
43 (list (read-string "Store text for pasting: "))
44 (list (cons ;; these need not be ordered.
45 (copy-marker (point-marker))
46 (copy-marker (mark-marker))))))
47 (own-selection selection 'SECONDARY))
49 (defun gtk-notice-selection-requests (selection type successful)
50 "for possible use as the value of `gtk-sent-selection-hooks'."
52 (message "Selection request failed to convert %s to %s"
54 (message "Sent selection %s as %s" selection type)))
56 (defun gtk-notice-selection-failures (selection type successful)
57 "for possible use as the value of `gtk-sent-selection-hooks'."
59 (message "Selection request failed to convert %s to %s"
62 ;(setq gtk-sent-selection-hooks 'gtk-notice-selection-requests)
63 ;(setq gtk-sent-selection-hooks 'gtk-notice-selection-failures)