/[mcclim]/mcclim/frames.lisp
ViewVC logotype

Diff of /mcclim/frames.lisp

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

revision 1.12 by adejneka, Wed Jul 18 05:54:17 2001 UTC revision 1.13 by adejneka, Fri Jul 20 07:01:02 2001 UTC
# Line 106  Line 106 
106    (declare (ignore args))    (declare (ignore args))
107    )    )
108    
109    ;;; Generic operations
110    ; (defgeneric frame-name (frame))
111    ; (defgeneric frame-pretty-name (frame))
112    ; (defgeneric (setf frame-pretty-name) (name frame))
113    ; (defgeneric frame-command-table (frame))
114    ; (defgeneric (setf frame-command-table) (command-table frame))
115    (defgeneric frame-standard-output (frame)
116      (:documentation
117       "Returns the stream that will be used for *standard-output* for the FRAME."))
118    (defgeneric frame-standard-input (frame)
119      (:documentation
120       "Returns the stream that will be used for *standard-input* for the FRAME."))
121    (defgeneric frame-query-io (frame)
122      (:documentation
123       "Returns the stream that will be used for *query-io* for the FRAME."))
124    (defgeneric frame-error-output (frame)
125      (:documentation
126       "Returns the stream that will be used for *error-output* for the FRAME."))
127    (defgeneric frame-pointer-documentation-output (frame)
128      (:documentation
129       "Returns the stream that will be used for *pointer-documentation-output*
130    for the FRAME."))
131    (defgeneric frame-calling-frame (frame)
132      (:documentation
133       "Returns the application frame that invoked the FRAME."))
134    (defgeneric frame-parent (frame)
135      (:documentation
136       "Returns the object that acts as the parent for the FRAME."))
137    ;(defgeneric frame-pane (frame) ; XXX Is it in Spec?
138    ;  (:documentation
139    ;   "Returns the pane that is the top-level pane in the current layout
140    ;of the FRAME's named panes."))
141    (defgeneric frame-top-level-sheet (frame)
142      (:documentation
143       "Returns the shhet that is the top-level sheet for the FRAME. This
144    is the sheet that has as its descendants all of the panes of the FRAME."))
145    (defgeneric frame-current-panes (frame)
146      (:documentation
147       "Returns a list of those named panes in the FRAME's current layout.
148    If there are no named panes, only the single, top level pane is returned."))
149    (defgeneric get-frame-pane (frame pane-name)
150      (:documentation
151       "Returns the named CLIM stream pane in the FRAME whose name is PANE-NAME."))
152    (defgeneric find-pane-named (frame pane-name)
153      (:documentation
154       "Returns the pane in the FRAME whose name is PANE-NAME."))
155    ;(defgeneric frame-current-layout (frame))
156    ;(defgeneric frame-all-layouts (frame)) ; XXX Is it in Spec?
157    (defgeneric layout-frame (frame &optional width height))
158    ;(defgeneric frame-exit-frame (condition) ; XXX Is it in Spec?
159    ;  (:documentation
160    ;   "Returns the frame that is being exited from associated with the
161    ;FRAME-EXIT condition."))
162    (defgeneric frame-exit (frame) ; XXX Is it in Spec?
163      (:documentation
164       "Exits from the FRAME."))
165    (defgeneric pane-needs-redisplay (pane))
166    (defgeneric (setf pane-needs-redisplay) (value pane))
167    (defgeneric redisplay-frame-pane (frame pane &key force-p))
168    (defgeneric redisplay-frame-panes (frame &key force-p))
169    (defgeneric frame-replay (frame stream &optional region))
170    (defgeneric notify-user (frame message &key associated-window title
171                             documentation exit-boxes name style text-style))
172    ;(defgeneric frame-properties (frame property))
173    ;(defgeneric (setf frame-properties) (value frame property))
174    
175    
176  (defclass standard-application-frame (application-frame)  (defclass standard-application-frame (application-frame)
177    ())    ())
178    
# Line 142  Line 209 
209                                     (space-requirement-width space)                                     (space-requirement-width space)
210                                     (space-requirement-height space)))))                                     (space-requirement-height space)))))
211    
 (defmethod find-pane-named ((frame application-frame) name)  
   (find name (frame-panes frame) :test #'eq :key #'pane-name))  
   
212  (defmethod layout-frame ((frame application-frame) &optional width height)  (defmethod layout-frame ((frame application-frame) &optional width height)
213    (let ((pane (frame-pane frame)))    (let ((pane (frame-pane frame)))
214      (if (and  width (not height))      (if (and  width (not height))
# Line 155  Line 219 
219            (setq height (space-requirement-height space))))            (setq height (space-requirement-height space))))
220      (allocate-space pane width height)))      (allocate-space pane width height)))
221    
222  (defun find-pane-of-type (panes type)  (defun find-pane-if (predicate panes)
223      "Returns a pane satisfying PREDICATE in the forest growing from PANES"
224    (setq panes (copy-list panes))    (setq panes (copy-list panes))
225    (do ((pane (pop panes)(pop panes)))    (do ((pane (pop panes)(pop panes)))
226        ((null pane) nil)        ((null pane) nil)
227      (if (typep pane type)      (if (funcall predicate pane)
228          (return pane)          (return pane)
229        (setq panes (nconc panes (copy-list (sheet-children pane)))))))        (setq panes (nconc panes (copy-list (sheet-children pane)))))))
230    
231    (defun find-pane-of-type (panes type)
232      (find-pane-if #'(lambda (pane) (typep pane type)) panes))
233    
234    (defmethod frame-current-panes ((frame application-frame))
235      (find-pane-if #'(lambda (pane) (pane-name pane))
236                    (frame-current-layout frame)))
237    
238    (defmethod get-frame-pane ((frame application-frame) pane-name)
239      (find-pane-if #'(lambda (pane)
240                        (and (typep pane 'clim-stream-pane)
241                             (eq pane-name
242                                 (pane-name pane))))
243                    (frame-panes frame)))
244    
245    (defmethod find-pane-named ((frame application-frame) pane-name)
246      (find-pane-if #'(lambda (pane)
247                        (eq pane-name
248                            (pane-name pane)))
249                    (frame-panes frame)))
250    
251  (defmethod frame-standard-output ((frame application-frame))  (defmethod frame-standard-output ((frame application-frame))
252    (or (find-pane-of-type (frame-panes frame) 'application-pane)    (or (find-pane-of-type (frame-panes frame) 'application-pane)
253        (find-pane-of-type (frame-panes frame) 'interactor-pane)))        (find-pane-of-type (frame-panes frame) 'interactor-pane)))
# Line 181  Line 266 
266  (defvar *pointer-documentation-output* nil)  (defvar *pointer-documentation-output* nil)
267    
268  (defmethod frame-pointer-documentation-output ((frame application-frame))  (defmethod frame-pointer-documentation-output ((frame application-frame))
269    (loop for pane in (frame-panes frame)    (find-pane-of-type (frame-panes frame) 'pointer-documentation-pane))
       if (typep pane 'pointer-documentation-pane)  
       return pane  
       finally (return nil)))  
270    
271  ;;; Command loop interface  ;;; Command loop interface
272    

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.5