(diary-file): Doc fix.
[bpt/emacs.git] / lisp / x-dnd.el
index a215faa..7e5368f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; x-dnd.el --- drag and drop support for X.
 
 ;;; x-dnd.el --- drag and drop support for X.
 
-;; Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
 ;; Maintainer: FSF
 
 ;; Author: Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
 ;; Maintainer: FSF
@@ -10,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -117,18 +117,19 @@ any protocol specific data.")
 
 (defvar x-dnd-empty-state [nil nil nil nil nil nil nil])
 
 
 (defvar x-dnd-empty-state [nil nil nil nil nil nil nil])
 
-
+(declare-function x-register-dnd-atom "xselect.c")
 
 (defun x-dnd-init-frame (&optional frame)
   "Setup drag and drop for FRAME (i.e. create appropriate properties)."
 
 (defun x-dnd-init-frame (&optional frame)
   "Setup drag and drop for FRAME (i.e. create appropriate properties)."
-  (x-register-dnd-atom "DndProtocol" frame)
-  (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame)
-  (x-register-dnd-atom "XdndEnter" frame)
-  (x-register-dnd-atom "XdndPosition" frame)
-  (x-register-dnd-atom "XdndLeave" frame)
-  (x-register-dnd-atom "XdndDrop" frame)
-  (x-dnd-init-xdnd-for-frame frame)
-  (x-dnd-init-motif-for-frame frame))
+  (when (eq 'x (window-system frame))
+    (x-register-dnd-atom "DndProtocol" frame)
+    (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame)
+    (x-register-dnd-atom "XdndEnter" frame)
+    (x-register-dnd-atom "XdndPosition" frame)
+    (x-register-dnd-atom "XdndLeave" frame)
+    (x-register-dnd-atom "XdndDrop" frame)
+    (x-dnd-init-xdnd-for-frame frame)
+    (x-dnd-init-motif-for-frame frame)))
 
 (defun x-dnd-get-state-cons-for-frame (frame-or-window)
   "Return the entry in x-dnd-current-state for a frame or window."
 
 (defun x-dnd-get-state-cons-for-frame (frame-or-window)
   "Return the entry in x-dnd-current-state for a frame or window."
@@ -421,6 +422,9 @@ otherwise return the frame coordinates."
           (+ frame-real-top (nth 1 edges))))
       (cons frame-real-left frame-real-top))))
 
           (+ frame-real-top (nth 1 edges))))
       (cons frame-real-left frame-real-top))))
 
+(declare-function x-get-atom-name "xselect.c")
+(declare-function x-send-client-message "xselect.c")
+
 (defun x-dnd-handle-xdnd (event frame window message format data)
   "Receive one XDND event (client message) and send the appropriate reply.
 EVENT is the client message.  FRAME is where the mouse is now.
 (defun x-dnd-handle-xdnd (event frame window message format data)
   "Receive one XDND event (client message) and send the appropriate reply.
 EVENT is the client message.  FRAME is where the mouse is now.