Fix up comment convention on the arch-tag lines.
[bpt/emacs.git] / lisp / x-dnd.el
index 055e430..dd91458 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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
@@ -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
-;; 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,
@@ -117,7 +117,7 @@ any protocol specific data.")
 
 (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)."
@@ -172,7 +172,7 @@ FRAME-OR-WINDOW is the frame or window that the mouse is over."
 WINDOW is the window the mouse is over.  ACTION is the suggested
 action from the source.  If nothing has changed, return the last
 action and type we got from `x-dnd-test-function'."
-  (let ((buffer (when (and (windowp window) (window-live-p window))
+  (let ((buffer (when (window-live-p window)
                  (window-buffer window)))
        (current-state (x-dnd-get-state-for-frame window)))
     (when (or (not (equal buffer (aref current-state 0)))
@@ -207,9 +207,7 @@ EXTRA-DATA is data needed for a specific protocol."
     (when types (aset current-state 2 types))
     (when extra-data (aset current-state 6 extra-data))
     (aset current-state 1 window)
-    (aset current-state 0 (if (and (windowp window)
-                                  (window-live-p window))
-                             (window-buffer window) nil))
+    (aset current-state 0 (and (window-live-p window) (window-buffer window)))
     (setcdr (x-dnd-get-state-cons-for-frame window) current-state)))
 
 
@@ -320,7 +318,7 @@ nil if not."
         (action (aref state 5))
         (w (posn-window (event-start event))))
     (when handler
-      (if (and (windowp w) (window-live-p w)
+      (if (and (window-live-p w)
               (not (window-minibuffer-p w))
               (not (window-dedicated-p w)))
          ;; If dropping in an ordinary window which we could use,
@@ -424,6 +422,9 @@ otherwise return the frame coordinates."
           (+ 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.
@@ -755,5 +756,5 @@ FORMAT is 32 (not used).  MESSAGE is the data part of an XClientMessageEvent."
 
 (provide 'x-dnd)
 
-;;; arch-tag: b621fb7e-50da-4323-850b-5fc71ae64621
+;; arch-tag: b621fb7e-50da-4323-850b-5fc71ae64621
 ;;; x-dnd.el ends here