diff options
author | Kim F. Storm <storm@cua.dk> | 2005-02-09 15:50:47 +0000 |
---|---|---|
committer | Kim F. Storm <storm@cua.dk> | 2005-02-09 15:50:47 +0000 |
commit | bf247b6ed0b5e96845e785302bdaa97fcf6a8b84 (patch) | |
tree | 3e5225520dfe10e9394f68088de2fe22027aa53f /lisp/x-dnd.el | |
parent | 1de0ae85b33c8d8cb77ab839f66d2df4f9aa7b94 (diff) | |
download | emacs-bf247b6ed0b5e96845e785302bdaa97fcf6a8b84.tar.gz |
Change release version from 21.4 to 22.1 throughout.
Change development version from 21.3.50 to 22.0.50.
Diffstat (limited to 'lisp/x-dnd.el')
-rw-r--r-- | lisp/x-dnd.el | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index a540c1b7af3..ef7cc1ccc73 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -47,7 +47,7 @@ The function shall return nil to reject the drop or a cons with two values, the wanted action as car and the wanted type as cdr. The wanted action can be copy, move, link, ask or private. The default value for this variable is `x-dnd-default-test-function'." - :version "21.4" + :version "22.1" :type 'symbol :group 'x) @@ -70,7 +70,7 @@ Insertion of text is not handeled by these functions, see `x-dnd-types-alist' for that. The function shall return the action done (move, copy, link or private) if some action was made, or nil if the URL is ignored." - :version "21.4" + :version "22.1" :type 'alist :group 'x) @@ -98,13 +98,13 @@ this drop (copy, move, link, private or ask) as determined by a previous call to `x-dnd-test-function'. DATA is the drop data. The function shall return the action used (copy, move, link or private) if drop is successful, nil if not." - :version "21.4" + :version "22.1" :type 'alist :group 'x) (defcustom x-dnd-open-file-other-window nil "If non-nil, always use find-file-other-window to open dropped files." - :version "21.4" + :version "22.1" :type 'boolean :group 'x) @@ -124,7 +124,7 @@ is successful, nil if not." ) "The types accepted by default for dropped data. The types are chosen in the order they appear in the list." - :version "21.4" + :version "22.1" :type '(repeat string) :group 'x ) @@ -135,10 +135,10 @@ The types are chosen in the order they appear in the list." "The current state for a drop. This is an alist with one entry for each display. The value for each display is a vector that contains the state for drag and drop for that display. -Elements in the vector are: +Elements in the vector are: Last buffer drag was in, last window drag was in, -types available for drop, +types available for drop, the action suggested by the source, the type we want for the drop, the action we want for the drop, @@ -209,7 +209,7 @@ action and type we got from `x-dnd-test-function'." (handler (cdr (assoc (cdr action-type) x-dnd-types-alist)))) ;; Ignore action-type if we have no handler. (setq current-state - (x-dnd-save-state window + (x-dnd-save-state window action (when handler action-type))))))) (let ((current-state (x-dnd-get-state-for-frame window))) @@ -300,13 +300,13 @@ Return nil if URI is not a local file." ((string-match "^file:" uri) ; Old KDE, Motif, Sun (substring uri (match-end 0)))))) (when (and f must-exist) - (let* ((decoded-f (decode-coding-string + (let* ((decoded-f (decode-coding-string f (or file-name-coding-system default-file-name-coding-system))) (try-f (if (file-readable-p decoded-f) decoded-f f))) (when (file-readable-p try-f) try-f))))) - + (defun x-dnd-open-local-file (uri action) "Open a local file. @@ -590,7 +590,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." (frame-parameter frame 'outer-window-id)) accept ;; 1 = Accept, 0 = reject. (x-dnd-get-drop-x-y frame window) - (x-dnd-get-drop-width-height + (x-dnd-get-drop-width-height frame window (eq accept 1)) (or reply-action 0) ))) @@ -612,9 +612,9 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." (setq action (if value (condition-case info - (x-dnd-drop-data event frame window value + (x-dnd-drop-data event frame window value (x-dnd-current-type window)) - (error + (error (message "Error: %s" info) nil)))) @@ -738,7 +738,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." ((eq message-type 'XmDRAG_MOTION) (let* ((state (x-dnd-get-state-for-frame frame)) (timestamp (x-dnd-motif-value-to-list - (x-dnd-get-motif-value data 4 4 + (x-dnd-get-motif-value data 4 4 source-byteorder) 4 my-byteorder)) (x (x-dnd-motif-value-to-list @@ -757,7 +757,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." (reply-flags (x-dnd-motif-value-to-list (if reply-action - (+ reply-action + (+ reply-action ?\x30 ; 30: valid drop site ?\x700) ; 700: can do copy, move or link ?\x30) ; 30: drop site, but noop. @@ -794,7 +794,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." (reply-flags (x-dnd-motif-value-to-list (if reply-action - (+ reply-action + (+ reply-action ?\x30 ; 30: valid drop site ?\x700) ; 700: can do copy, move or link ?\x30) ; 30: drop site, but noop @@ -833,7 +833,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." (reply-flags (x-dnd-motif-value-to-list (if reply-action - (+ reply-action + (+ reply-action ?\x30 ; 30: valid drop site ?\x700) ; 700: can do copy, move or link (+ ?\x30 ; 30: drop site, but noop. @@ -847,7 +847,7 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." reply-flags x y)) - (timestamp (x-dnd-get-motif-value + (timestamp (x-dnd-get-motif-value data 4 4 source-byteorder)) action) @@ -857,26 +857,26 @@ FORMAT is 32 (not used). MESSAGE is the data part of an XClientMessageEvent." "_MOTIF_DRAG_AND_DROP_MESSAGE" 8 reply) - (setq action + (setq action (when (and reply-action atom-name) (let* ((value (x-get-selection-internal (intern atom-name) (intern (x-dnd-current-type window))))) (when value (condition-case info - (x-dnd-drop-data event frame window value + (x-dnd-drop-data event frame window value (x-dnd-current-type window)) (error (message "Error: %s" info) nil)))))) (x-get-selection-internal - (intern atom-name) + (intern atom-name) (if action 'XmTRANSFER_SUCCESS 'XmTRANSFER_FAILURE) timestamp) (x-dnd-forget-drop frame))) (t (error "Unknown Motif DND message %s %s" message-atom data))))) - + ;;; |