Changeset 722


Ignore:
Timestamp:
Mar 25, 2004, 1:07:25 AM (16 years ago)
Author:
gb
Message:

EVAL-SELECTION ui methods.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/cocoa-listener.lisp

    r715 r722  
    253253          (setq name nick len nicklen))))))
    254254
    255 (defun cocoa-ide-note-package (package)
     255(defmethod ui-object-note-package ((app ns:ns-application) package)
    256256  (with-autorelease-pool
    257257      (process-interrupt *cocoa-event-process*
     
    270270                                          (make-string-input-stream string))))
    271271    (enqueue-input-selection (cocoa-listener-process-input-stream process) selection)))
     272
     273
     274(defun hemlock::evaluate-input-selection (selection)
     275  (application-ui-operation *application* :eval-selection selection))
     276                           
     277(defmethod ui-object-choose-listener-for-selection ((app ns:ns-application)
     278                                                    selection)
     279  (declare (ignore selection))
     280  (let* ((top-listener-document (send (find-class 'hemlock-listener-document)
     281                                      'top-listener)))
     282    (if top-listener-document
     283      (let* ((buffer (hemlock-document-buffer top-listener-document)))
     284        (if buffer
     285          (let* ((proc (hi::buffer-process buffer)))
     286            (if (typep proc 'cocoa-listener-process)
     287              proc)))))))
     288
     289(defmethod ui-object-eval-selection ((app ns:ns-application)
     290                                     selection)
     291  (let* ((target-listener (ui-object-choose-listener-for-selection
     292                           app selection)))
     293    (if (typep target-listener 'cocoa-listener-process)
     294      (enqueue-input-selection (cocoa-listener-process-input-stream
     295                                target-listener)
     296                               selection))))
    272297 
    273298
     
    275300                                   operation &rest args)
    276301  (case operation
    277     (:note-current-package (cocoa-ide-note-package (car args)))))
     302    (:note-current-package (ui-object-note-package o (car args)))
     303    (:eval-selection (ui-object-eval-selection o (car args)))))
     304
    278305
    279306       
Note: See TracChangeset for help on using the changeset viewer.