[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/x-dnd.el
From: |
Kim F . Storm |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/x-dnd.el |
Date: |
Wed, 09 Feb 2005 10:52:56 -0500 |
Index: emacs/lisp/x-dnd.el
diff -c emacs/lisp/x-dnd.el:1.12 emacs/lisp/x-dnd.el:1.13
*** emacs/lisp/x-dnd.el:1.12 Sat Feb 5 16:53:00 2005
--- emacs/lisp/x-dnd.el Wed Feb 9 15:50:40 2005
***************
*** 47,53 ****
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"
:type 'symbol
:group 'x)
--- 47,53 ----
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 "22.1"
:type 'symbol
:group 'x)
***************
*** 70,76 ****
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"
:type 'alist
:group 'x)
--- 70,76 ----
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 "22.1"
:type 'alist
:group 'x)
***************
*** 98,110 ****
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"
: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"
:type 'boolean
:group 'x)
--- 98,110 ----
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 "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 "22.1"
:type 'boolean
:group 'x)
***************
*** 124,130 ****
)
"The types accepted by default for dropped data.
The types are chosen in the order they appear in the list."
! :version "21.4"
:type '(repeat string)
:group 'x
)
--- 124,130 ----
)
"The types accepted by default for dropped data.
The types are chosen in the order they appear in the list."
! :version "22.1"
:type '(repeat string)
:group 'x
)
***************
*** 135,144 ****
"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:
Last buffer drag was in,
last window drag was in,
! types available for drop,
the action suggested by the source,
the type we want for the drop,
the action we want for the drop,
--- 135,144 ----
"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:
Last buffer drag was in,
last window drag was in,
! 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,215 ****
(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
action
(when handler action-type)))))))
(let ((current-state (x-dnd-get-state-for-frame window)))
--- 209,215 ----
(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
action
(when handler action-type)))))))
(let ((current-state (x-dnd-get-state-for-frame window)))
***************
*** 300,312 ****
((string-match "^file:" uri) ; Old KDE, Motif, Sun
(substring uri (match-end 0))))))
(when (and f must-exist)
! (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.
--- 300,312 ----
((string-match "^file:" uri) ; Old KDE, Motif, Sun
(substring uri (match-end 0))))))
(when (and f must-exist)
! (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,596 ****
(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
frame window (eq accept 1))
(or reply-action 0)
)))
--- 590,596 ----
(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
frame window (eq accept 1))
(or reply-action 0)
)))
***************
*** 612,620 ****
(setq action (if value
(condition-case info
! (x-dnd-drop-data event frame window value
(x-dnd-current-type window))
! (error
(message "Error: %s" info)
nil))))
--- 612,620 ----
(setq action (if value
(condition-case info
! (x-dnd-drop-data event frame window value
(x-dnd-current-type window))
! (error
(message "Error: %s" info)
nil))))
***************
*** 738,744 ****
((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
source-byteorder)
4 my-byteorder))
(x (x-dnd-motif-value-to-list
--- 738,744 ----
((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
source-byteorder)
4 my-byteorder))
(x (x-dnd-motif-value-to-list
***************
*** 757,763 ****
(reply-flags
(x-dnd-motif-value-to-list
(if reply-action
! (+ reply-action
?\x30 ; 30: valid drop site
?\x700) ; 700: can do copy, move or link
?\x30) ; 30: drop site, but noop.
--- 757,763 ----
(reply-flags
(x-dnd-motif-value-to-list
(if reply-action
! (+ reply-action
?\x30 ; 30: valid drop site
?\x700) ; 700: can do copy, move or link
?\x30) ; 30: drop site, but noop.
***************
*** 794,800 ****
(reply-flags
(x-dnd-motif-value-to-list
(if reply-action
! (+ reply-action
?\x30 ; 30: valid drop site
?\x700) ; 700: can do copy, move or link
?\x30) ; 30: drop site, but noop
--- 794,800 ----
(reply-flags
(x-dnd-motif-value-to-list
(if reply-action
! (+ reply-action
?\x30 ; 30: valid drop site
?\x700) ; 700: can do copy, move or link
?\x30) ; 30: drop site, but noop
***************
*** 833,839 ****
(reply-flags
(x-dnd-motif-value-to-list
(if reply-action
! (+ reply-action
?\x30 ; 30: valid drop site
?\x700) ; 700: can do copy, move or link
(+ ?\x30 ; 30: drop site, but noop.
--- 833,839 ----
(reply-flags
(x-dnd-motif-value-to-list
(if reply-action
! (+ reply-action
?\x30 ; 30: valid drop site
?\x700) ; 700: can do copy, move or link
(+ ?\x30 ; 30: drop site, but noop.
***************
*** 847,853 ****
reply-flags
x
y))
! (timestamp (x-dnd-get-motif-value
data 4 4 source-byteorder))
action)
--- 847,853 ----
reply-flags
x
y))
! (timestamp (x-dnd-get-motif-value
data 4 4 source-byteorder))
action)
***************
*** 857,882 ****
"_MOTIF_DRAG_AND_DROP_MESSAGE"
8
reply)
! (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-current-type window))
(error
(message "Error: %s" info)
nil))))))
(x-get-selection-internal
! (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)))))
!
;;;
--- 857,882 ----
"_MOTIF_DRAG_AND_DROP_MESSAGE"
8
reply)
! (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-current-type window))
(error
(message "Error: %s" info)
nil))))))
(x-get-selection-internal
! (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)))))
!
;;;