]> code.delx.au - gnu-emacs/blobdiff - lisp/dframe.el
(avl-tree-del-balance1, avl-tree-del-balance2)
[gnu-emacs] / lisp / dframe.el
index f0aa72d0f1f7f869ecc9fd34f0f6ad8450e6df89..6d811a6a500cf386783158a10ba03886a27fbff4 100644 (file)
@@ -1,6 +1,7 @@
 ;;; dframe --- dedicate frame support modes
 
-;;; Copyright (C) 1996, 97, 98, 99, 2000, 01, 02, 03, 04 Free Software Foundation
+;;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+;;    2005, 2006, 2007 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: file, tags, tools
@@ -12,7 +13,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,
 ;;  * The timer managers doesn't handle multiple different timeouts.
 ;;  * You can't specify continuous timouts (as opposed to just lidle timers.)
 
+(defvar x-pointer-hand2)
+(defvar x-pointer-top-left-arrow)
+
 ;;; Code:
 (defvar dframe-xemacsp (string-match "XEmacs" emacs-version)
   "Non-nil if we are running in the XEmacs environment.")
 \f
 ;;; Compatibility functions
 ;;
-(if (fboundp 'frame-parameter)
-
-    (defalias 'dframe-frame-parameter 'frame-parameter)
-  
-  (defun dframe-frame-parameter (frame parameter)
-    "Return FRAME's PARAMETER value."
-    (cdr (assoc parameter (frame-parameters frame)))))
+(defun dframe-frame-parameter (frame parameter)
+  "Return FRAME's PARAMETER value."
+  (if (fboundp 'frame-parameter)
+      (frame-parameter frame parameter)
+    (cdr (assoc parameter (frame-parameters frame))))) ; XEmacs
 
 \f
 ;;; Variables
@@ -296,7 +298,7 @@ This frame is either resurrected, hidden, killed, etc based on
 the value.
 CACHE-VAR is a variable used to cache a cached frame.
 BUFFER-VAR is a variable used to cache the buffer being used in dframe.
-This buffer will have `dframe-mode' run on it.
+This buffer will have `dframe-frame-mode' run on it.
 FRAME-NAME is the name of the frame to create.
 LOCAL-MODE-FN is the function used to call this one.
 PARAMETERS are frame parameters to apply to this dframe.
@@ -350,9 +352,7 @@ CREATE-HOOK are hooks to run after creating a frame."
                          t))))
        ;; Enable mouse tracking in emacs
        (if dframe-track-mouse-function
-           (set (make-local-variable 'track-mouse) t)) ;this could be messy.
-       ;; disable auto-show-mode for Emacs
-       (setq auto-show-mode nil))
+           (set (make-local-variable 'track-mouse) t))) ;this could be messy.
 ;;;; DISABLED: This causes problems for users with multiple frames.
 ;;;;       ;; Set this up special just for the passed in buffer
 ;;;;       ;; Terminal minibuffer stuff does not require this.
@@ -418,7 +418,7 @@ CREATE-HOOK are hooks to run after creating a frame."
                            parameters
                          (append
                           parameters
-                          (list (cons 'height (+ mh (frame-height)))))))
+                          (list (cons 'height (+ (or mh 0) (frame-height)))))))
                       (params
                        ;; Only add a guessed width if one is not specified
                        ;; in the input parameters.
@@ -506,7 +506,7 @@ a cons cell indicationg a position of the form (LEFT . TOP)."
             (setq newleft (+ pfx pfw 5)
                   newtop pfy))
            ((eq location 'left)
-            (setq newleft (+ pfx 10 nfw)
+            (setq newleft (- pfx 10 nfw)
                   newtop pfy))
            ((eq location 'left-right)
             (setq newleft
@@ -603,7 +603,7 @@ The function must take an EVENT.")
 
 (defun dframe-handle-make-frame-visible (e)
   "Handle a `make-frame-visible' event.
-Should enables auto-updating if the last state was also enabled.
+Should enable auto-updating if the last state was also enabled.
 Argument E is the event making the frame visible."
   (interactive "e")
   (let ((f last-event-frame))
@@ -614,7 +614,7 @@ Argument E is the event making the frame visible."
 
 (defun dframe-handle-iconify-frame (e)
   "Handle a `iconify-frame' event.
-Should disables auto-updating if the last state was also enabled.
+Should disable auto-updating if the last state was also enabled.
 Argument E is the event iconifying the frame."
   (interactive "e")
   (let ((f last-event-frame))
@@ -649,7 +649,7 @@ If the selected frame is not in the symbol FRAME-VAR, then FRAME-VAR
 frame is selected.  If the FRAME-VAR is active, then select the
 attached frame.  If FRAME-VAR is nil, ACTIVATOR is called to
 created it.  HOOK is an optional argument of hooks to run when
-selecting FRAME."
+selecting FRAME-VAR."
   (interactive)
   (if (eq (selected-frame) (symbol-value frame-var))
       (if (frame-live-p dframe-attached-frame)
@@ -693,10 +693,10 @@ If optional arg FRAME is nil just return `dframe-attached-frame'."
     dframe-attached-frame))
 
 (defun dframe-select-attached-frame (&optional frame)
-  "Switch to the frame the dframe controlled frame FRAME was started from. If
-optional arg FRAME is nil assume the attached frame is already selected and
-just run the hooks `dframe-after-select-attached-frame-hook'. Return the
-attached frame."
+  "Switch to the frame the dframe controlled frame FRAME was started from.
+If optional arg FRAME is nil assume the attached frame is already selected
+and just run the hooks `dframe-after-select-attached-frame-hook'.  Return
+the attached frame."
   (let ((frame (dframe-attached-frame frame)))
     (if frame (select-frame frame))
     (prog1 frame
@@ -716,7 +716,7 @@ Optionally select that frame if necessary."
   (when (or (not (dframe-mouse-event-p last-input-event))
             dframe-activity-change-focus-flag)
     (dframe-select-attached-frame)
-    ;; KB: For what is this - raising the frame?? 
+    ;; KB: For what is this - raising the frame??
     (other-frame 0)))
 
 
@@ -885,10 +885,10 @@ Must be bound to event E."
 
 ;;; Interactive user functions for the mouse
 ;;
-(if dframe-xemacsp
-    (defalias 'dframe-mouse-event-p 'button-press-event-p)
-  (defun dframe-mouse-event-p (event)
-    "Return t if the event is a mouse related event."
+(defun dframe-mouse-event-p (event)
+  "Return t if the event is a mouse related event."
+  (if (fboundp 'button-press-event-p)
+      (button-press-event-p event)      ; XEmacs
     (if (and (listp event)
             (member (event-basic-type event)
                     '(mouse-1 mouse-2 mouse-3)))
@@ -903,7 +903,7 @@ Must be bound to event E."
                 (windowp (posn-window (event-end event))) ; Sometimes
                                        ; there is no window to jump into.
                 ))
-            
+
     (funcall dframe-track-mouse-function event)))
 
 (defun dframe-track-mouse-xemacs (event)
@@ -954,7 +954,7 @@ This should be bound to mouse event E."
       (funcall dframe-mouse-position-function)))
 
 (defun dframe-power-click (e)
-  "Activate any `dframe' mouse click as a power click.
+  "Activate any dframe mouse click as a power click.
 A power click will dispose of cached data (if available) or bring a buffer
 up into a different window.
 This should be bound to mouse event E."