;;; Copyright (C) 1991 Christopher J. Love
;;;
;;; This file is for use with Epoch, a modified version of GNU Emacs.
;;; Requires Epoch 4.0 or later.
;;;
;;; This code is distributed in the hope that it will be useful,
;;; bute WITHOUT ANY WARRANTY. No author or distributor accepts
;;; responsibility to anyone for the consequences of using this code
;;; or for whether it serves any particular purpose or works at all,
;;; unless explicitly stated in a written agreement.
;;;
;;; Everyone is granted permission to copy, modify and redistribute
;;; this code, but only under the conditions described in the
;;; GNU Emacs General Public License, except the original author nor his
;;; agents are bound by the License in their use of this code.
;;; (These special rights for the author in no way restrict the rights of
;;;  others given in the License or this prologue)
;;; A copy of this license is supposed to have been given to you along
;;; with Epoch so you can know your rights and responsibilities. 
;;; It should be in a file named COPYING.  Among other things, the
;;; copyright notice and this notice must be preserved on all copies. 
;;;
;;; $Revision: 1.12 $
;;; $Source: /import/kaplan/stable/distrib/epoch-4.1/epoch-lisp/RCS/wrapper.el,v $
;;; $Date: 92/04/10 10:45:01 $
;;; $Author: love $
;;;
;;; wrapper.el - define "wrappers" for all epoch:: functions
;;;
(provide 'wrapper)

(defun functionp (thing)
"Returns t if the argument is a function, nil otherwise"
  (cond
    ((symbolp thing) (fboundp thing))
    ((consp thing)
      (and (eq (car thing) 'lambda) (listp (cadr thing)))
    )
    (t nil)
  )
)
;;;
(fset 'screen-height (symbol-function 'epoch::screen-height))
(fset 'screen-width (symbol-function 'epoch::screen-width))
(fset 'redisplay-screen (symbol-function 'epoch::redisplay-screen))
(fset 'set-screen-modified (symbol-function 'epoch::set-screen-modified))
(fset 'next-screen (symbol-function 'epoch::next-screen))
(fset 'prev-screen (symbol-function 'epoch::prev-screen))
(fset 'current-screen (symbol-function 'epoch::current-screen))
(fset 'minibuf-screen (symbol-function 'epoch::minibuf-screen))
(fset 'raise-screen (symbol-function 'epoch::raise-screen))
(fset 'lower-screen (symbol-function 'epoch::lower-screen))
(fset 'map-screen (symbol-function 'epoch::map-screen))
(fset 'background (symbol-function 'epoch::background))
(fset 'foreground (symbol-function 'epoch::foreground))
(fset 'cursor-foreground (symbol-function 'epoch::cursor-foreground))
(fset 'cursor-background (symbol-function 'epoch::cursor-background))
; for compatibility (next 1)
(fset 'cursor-color (symbol-function 'epoch::cursor-background))
(fset 'cursor-glyph (symbol-function 'epoch::cursor-glyph))
(fset 'set-update (symbol-function 'epoch::set-update))
(fset 'update-p (symbol-function 'epoch::update-p))
(fset 'icon-name (symbol-function 'epoch::icon-name))
(fset 'title (symbol-function 'epoch::title))
(fset 'screenp (symbol-function 'epoch::screen-p))
(fset 'screen-p (symbol-function 'epoch::screen-p))
(fset 'screen-of-window (symbol-function 'epoch::screen-of-window))
(fset 'screens-of-buffer (symbol-function 'epoch::screens-of-buffer))
(fset 'get-screen (symbol-function 'epoch::get-screen))
(fset 'get-screen-id (symbol-function 'epoch::get-screen-id))
; for compatibility (next 2)
(fset 'epoch::make-id (symbol-function 'epoch::get-screen-id))
(fset 'epoch::make-screen (symbol-function 'epoch::get-screen))
;
(fset 'font (symbol-function 'epoch::font))
(fset 'query-mouse (symbol-function 'epoch::query-mouse))
(fset 'query-pointer (symbol-function 'epoch::query-pointer))
(fset 'query-cursor (symbol-function 'epoch::query-cursor))
(fset 'query-cursor-pixels (symbol-function 'epoch::query-cursor-pixels))
(fset 'ungrab-pointer (symbol-function 'epoch::ungrab-pointer))
(fset 'warp-mouse (symbol-function 'epoch::warp-mouse))
(fset 'warp-pointer (symbol-function 'epoch::warp-pointer))
(fset 'coords-to-point (symbol-function 'epoch::coords-to-point))
(fset 'screen-list (symbol-function 'epoch::screen-list))
(fset 'move-screen (symbol-function 'epoch::move-screen))
(fset 'mapraised-screen (symbol-function 'epoch::mapraised-screen))
(fset 'screen-information (symbol-function 'epoch::screen-information))
(fset 'plane-size (symbol-function 'epoch::plane-size))
(fset 'screen-mapped-p (symbol-function 'epoch::screen-mapped-p))
(fset 'change-screen-size (symbol-function 'epoch::change-screen-size))

(fset 'intern-atom (symbol-function 'epoch::intern-atom))
(fset 'unintern-atom (symbol-function 'epoch::unintern-atom))
(fset 'resourcep (symbol-function 'epoch::resourcep))
(fset 'string-to-resource (symbol-function 'epoch::string-to-resource))
(fset 'resource-to-string (symbol-function 'epoch::resource-to-string))
(fset 'resource-to-type (symbol-function 'epoch::resource-to-type))
(fset 'set-resource-type (symbol-function 'epoch::set-resource-type))
(fset 'get-property (symbol-function 'epoch::get-property))
(fset 'set-property (symbol-function 'epoch::set-property))
(fset 'get-cut-buffer (symbol-function 'epoch::get-cut-buffer))
(fset 'store-cut-buffer (symbol-function 'epoch::store-cut-buffer))
(fset 'send-client-message (symbol-function 'epoch::send-client-message))
(fset 'xid-of-screen (symbol-function 'epoch::xid-of-screen))
(fset 'query-tree (symbol-function 'epoch::query-tree))
(fset 'rebind-key (symbol-function 'epoch::rebind-key))
(fset 'mod-to-shiftmask (symbol-function 'epoch::mod-to-shiftmask))

(fset 'get-font (symbol-function 'epoch::get-font))

(fset 'flash-screen (symbol-function 'epoch::flash-screen))
(fset 'set-bell (symbol-function 'epoch::set-bell))

(fset 'move-zone (symbol-function 'epoch::move-zone))
(fset 'make-zone (symbol-function 'epoch::make-zone))
(fset 'zone-style (symbol-function 'epoch::zone-style))
(fset 'zone-data (symbol-function 'epoch::zone-data))
(fset 'zone-start (symbol-function 'epoch::zone-start))
(fset 'zone-end (symbol-function 'epoch::zone-end))
(fset 'zone-at (symbol-function 'epoch::zone-at))
(fset 'zones-at (symbol-function 'epoch::zones-at))
(fset 'delete-zone (symbol-function 'epoch::delete-zone))
(fset 'delete-zone-at (symbol-function 'epoch::delete-zone-at))
(fset 'zonep (symbol-function 'epoch::zonep))
(fset 'zone-list (symbol-function 'epoch::zone-list))
(fset 'zones-in-region (symbol-function 'epoch::zones-in-region))
(fset 'read-only-region-p (symbol-function 'epoch::read-only-region-p))
(fset 'zone-buffer (symbol-function 'epoch::zone-buffer))
(fset 'set-zone-style (symbol-function 'epoch::set-zone-style))
(fset 'set-zone-data (symbol-function 'epoch::set-zone-data))
(fset 'zone-read-only-p (symbol-function 'epoch::zone-read-only-p))
(fset 'set-zone-read-only (symbol-function 'epoch::set-zone-read-only))
(fset 'zone-transient-p (symbol-function 'epoch::zone-transient-p))
(fset 'set-zone-transient (symbol-function 'epoch::set-zone-transient))
(fset 'clear-zones (symbol-function 'epoch::clear-zones))
(fset 'number-of-colors (symbol-function 'epoch::number-of-colors))
(fset 'color-components (symbol-function 'epoch::color-components))
(fset 'get-color (symbol-function 'epoch::get-color))
(fset 'free-color (symbol-function 'epoch::free-color))
(fset 'get-color-rw (symbol-function 'epoch::get-color-rw))
(fset 'set-color-rw (symbol-function 'epoch::set-color-rw))
;;;
(fset 'stylep (symbol-function 'epoch::stylep))
(fset 'make-style (symbol-function 'epoch::make-style))
(fset 'style-foreground (symbol-function 'epoch::style-foreground))
(fset 'style-background (symbol-function 'epoch::style-background))
(fset 'style-cursor-foreground (symbol-function 'epoch::style-cursor-foreground))
(fset 'style-cursor-background (symbol-function 'epoch::style-cursor-background))
(fset 'style-underline (symbol-function 'epoch::style-underline))
(fset 'style-font (symbol-function 'epoch::style-font))
(fset 'style-stipple (symbol-function 'epoch::style-stipple))
(fset 'style-cursor-stipple (symbol-function 'epoch::style-cursor-stipple))
(fset 'style-background-stipple (symbol-function 'epoch::style-background-stipple))
(fset 'set-style-foreground (symbol-function 'epoch::set-style-foreground))
(fset 'set-style-background (symbol-function 'epoch::set-style-background))
(fset 'set-style-cursor-foreground (symbol-function 'epoch::set-style-cursor-foreground))
(fset 'set-style-cursor-background (symbol-function 'epoch::set-style-cursor-background))
(fset 'set-style-underline (symbol-function 'epoch::set-style-underline))
(fset 'set-style-font (symbol-function 'epoch::set-style-font))
(fset 'set-style-stipple (symbol-function 'epoch::set-style-stipple))
(fset 'set-style-cursor-stipple (symbol-function 'epoch::set-style-cursor-stipple))
(fset 'set-style-background-stipple (symbol-function 'epoch::set-style-background-stipple))
(fset 'set-style-tag (symbol-function 'epoch::set-style-tag))
(fset 'style-tag (symbol-function 'epoch::style-tag))
;;;
(fset 'make-bitmap (symbol-function 'epoch::make-bitmap))
(fset 'load-bitmap (symbol-function 'epoch::load-bitmap))
(fset 'free-bitmap (symbol-function 'epoch::free-bitmap))

(fset 'acquire-selection (symbol-function 'epoch::acquire-selection))
(fset 'get-selection-owner (symbol-function 'epoch::get-selection-owner))
(fset 'convert-selection (symbol-function 'epoch::convert-selection))
(fset 'get-default (symbol-function 'epoch::get-default))
(fset 'reparent-screen (symbol-function 'epoch::reparent-screen))

;; Graphical zone primitives
(if (functionp 'epoch::query-pixmap)
  (progn
    (fset 'query-pixmap (symbol-function 'epoch::query-pixmap))
    (fset 'define-opaque-font (symbol-function 'epoch::define-opaque-font))
    (fset 'read-pixmap-file (symbol-function 'epoch::read-pixmap-file))
    (fset 'set-style-pixmap (symbol-function 'epoch::set-style-pixmap))
    (fset 'style-pixmap (symbol-function 'epoch::style-pixmap))
))