/[cmucl]/src/interface/inspect.lisp
ViewVC logotype

Diff of /src/interface/inspect.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by garland, Thu Nov 12 14:08:40 1992 UTC revision 1.2 by garland, Tue Mar 9 13:13:15 1993 UTC
# Line 1  Line 1 
1  ;;;; -*- Mode: Lisp ; Package: Interface -*-  ;;;; -*- Mode: Lisp ; Package: Interface -*-
2  ;;;  ;;;
3    ;;; **********************************************************************
4    ;;; This code was written as part of the CMU Common Lisp project at
5    ;;; Carnegie Mellon University, and has been placed in the public domain.
6    ;;; If you want to use this code or any part of CMU Common Lisp, please contact
7    ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
8    ;;;
9    ;;; **********************************************************************
10    ;;;
11    ;;; Written by Michael Garland
12    ;;;
13    ;;; This file implements the methods used in graphically inspecting Lisp
14    ;;; objects.
15    ;;;
16    ;;; The inspector mechanism revolves around two generic functions:
17    ;;;      - INSPECTOR-PANE-TITLE which returns a string meant to be the
18    ;;; title of the inspection pane displaying the given object
19    ;;;      - DISPLAY-INSPECTOR-PANE which creates a window pane displaying
20    ;;; the relevant information about the given object
21    ;;;
22    ;;; You can add new display mechanisms by defining new methods for these
23    ;;; generic functions.  Specific functions for aiding in the construction
24    ;;; of inspection panes are given below.
25  ;;;  ;;;
26    
27  (in-package "INTERFACE")  (in-package "INTERFACE")
# Line 14  Line 36 
36    
37  (defun destroy-pane-callback (widget call-data object)  (defun destroy-pane-callback (widget call-data object)
38    (declare (ignore widget call-data))    (declare (ignore widget call-data))
39      (setf *current-inspector-objects*
40            (delete object *current-inspector-objects*))
41    (destroy-interface-pane object))    (destroy-interface-pane object))
42    
43  (defun inspect-object-callback (widget call-data object)  (defun inspect-object-callback (widget call-data object)
# Line 101  Line 125 
125    
126  ;;;; Methods for constructing the title of inspection panes  ;;;; Methods for constructing the title of inspection panes
127    
128    ;;; INSPECTOR-PANE-TITLE -- Public
129    ;;;
130    ;;; This function takes a Lisp object and returns a string which is meant
131    ;;; to be the title of the inspection pane displaying the given object.
132    
133    ;;; This particular method is a catch-all for the types which PCL does not
134    ;;; allow us to discriminate.
135    ;;;
136  (defmethod inspector-pane-title (object)  (defmethod inspector-pane-title (object)
137    (typecase object    (typecase object
138      (pcl::std-instance      (pcl::std-instance
# Line 144  Line 176 
176    
177  ;;;; Methods for displaying object inspection panes  ;;;; Methods for displaying object inspection panes
178    
179    ;;; WITH-INSPECTOR-PANE -- Public
180    ;;;
181    ;;; This macro is the primary tool for building inspection panes.  It
182    ;;; creates all the fundamental pieces of the display pane and then calls
183    ;;; the supplied body to create the rest.  A typical display method would
184    ;;; like something like:
185    ;;;    (defmethod display-inspector-pane ((x mytype))
186    ;;;      (with-inspector-pane (x)
187    ;;;        ... custom forms ...
188    ;;;      ))
189    ;;;
190  (defmacro with-inspector-pane ((object) &body forms)  (defmacro with-inspector-pane ((object) &body forms)
191    `(multiple-value-bind    `(multiple-value-bind
192         (pane is-new)         (pane is-new)
# Line 158  Line 201 
201                (obmenu (create-interface-menu                (obmenu (create-interface-menu
202                         menu-bar "Object"                         menu-bar "Object"
203                         ,``(("Eval Expression" popup-eval-callback ,pane ,,object)                         ,``(("Eval Expression" popup-eval-callback ,pane ,,object)
204                             ("Close Pane" destroy-pane-callback ,,object))))                             ("Close Pane" destroy-pane-callback ,,object)
205                               ("Close All Panes" close-all-callback))))
206                (title (create-label-gadget                (title (create-label-gadget
207                        over-form "inspectTitle"                        over-form "inspectTitle"
208                        :label-string (inspector-pane-title ,object)                        :label-string (inspector-pane-title ,object)
# Line 181  Line 225 
225           (manage-children menu-bar title form)))           (manage-children menu-bar title form)))
226       (popup-interface-pane pane)))       (popup-interface-pane pane)))
227    
228    ;;; DISPLAY-INSPECTOR-PANE -- Public
229    ;;;
230    ;;; This function takes an object and creates a graphical inspection pane
231    ;;; for displaying it.
232    
233    ;;; This particular method is a catch all for the types which PCL won't
234    ;;; specialize on.
235    ;;;
236  (defmethod display-inspector-pane (object)  (defmethod display-inspector-pane (object)
237    (typecase object    (typecase object
238      (pcl::std-instance (display-clos-pane object))      (pcl::std-instance (display-clos-pane object))
# Line 480  Line 532 
532      (with-motif-connection (connection)      (with-motif-connection (connection)
533        (verify-control-pane-displayed)        (verify-control-pane-displayed)
534        (display-inspector-pane object)        (display-inspector-pane object)
535          (push object *current-inspector-objects*)
536        (inspector-add-history-item object)))        (inspector-add-history-item object)))
537    object)    object)
538    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.5