Changeset 15167


Ignore:
Timestamp:
Jan 21, 2012, 6:35:35 PM (8 years ago)
Author:
gz
Message:

Have the inspector update ccl:@ in the listener instead of in the cocoa thread.

Some tweaks to ease using the inspector in client/server mode.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/inspector.lisp

    r14700 r15167  
    3939Make preferences for fonts, key commands
    4040|#
    41 
    42 (defvar @ nil)
    43 (defvar @@ nil)
    44 (defvar @@@ nil)
    4541
    4642(defclass ninspector-window-controller (ns:ns-window-controller)
     
    179175
    180176(defun inspector-object-nsstring (li)
    181   (let ((ob (inspector::inspector-object li))
    182         (*print-readably* nil)
    183         (*signal-printing-errors* nil)
    184         (*print-circle* t)
    185         (*print-length* 20)
    186         (*print-pretty* nil))
    187     (%make-nsstring (prin1-to-string ob))))
     177  (%make-nsstring (inspector::inspector-object-string li)))
    188178
    189179(defun make-inspector-item (li &optional label-string value-string)
     
    207197    wc))
    208198
     199(defmethod ccl::spawn-inspector ((app cocoa-application) inspector)
     200  (queue-for-gui (lambda () (make-inspector-window inspector))))
     201
    209202(defmethod push-inspector-item ((wc ninspector-window-controller) (ii inspector-item))
    210203  (with-slots (next-index viewed-inspector-items) wc
     
    217210
    218211(defmethod (setf inspector-item) ((ii inspector-item) (wc ninspector-window-controller))
    219   (setf @@@ @@
    220         @@ @
    221         @ (inspector-object ii))
     212  (let ((proc (top-listener-process))
     213        (li (lisp-inspector ii)))
     214    (when proc
     215      (process-interrupt proc #'inspector::note-inspecting-item li)))
    222216  (setf (slot-value wc 'inspector-item) ii)
    223217  (let* ((w (#/window wc))
  • trunk/source/lib/describe.lisp

    r15115 r15167  
    3030(in-package "INSPECTOR")
    3131
    32 (defvar ccl::@)
     32(defvar ccl::@ nil)
     33(defvar ccl::@@ nil)
     34(defvar ccl::@@@ nil)
    3335
    3436;;; The basic inspector object.
     
    6769      (values line-i label-string value-string))))
    6870
     71(defmethod inspector-object-string ((i inspector))
     72  (let ((ob (inspector-object i))
     73        (*print-readably* nil)
     74        (*signal-printing-errors* nil)
     75        (*print-circle* t)
     76        (*print-length* 20)
     77        (*print-pretty* nil))
     78    (prin1-to-string ob)))
     79
    6980;; for a comment value = nil, label = "the comment" type = :comment
    7081;;; => line-i = nil
     
    8091;;; Return the type of inspector for an object
    8192(defmethod inspector-class (object)
    82   (cond ((method-exists-p #'line-n object 0) 'usual-inspector)
     93  (cond ((or (method-exists-p #'line-n object 0)
     94             (method-exists-p #'inspector-line 0))
     95         'usual-inspector)
    8396        ((and (uvectorp object)
    8497              (find-class 'uvector-inspector nil))
     
    19031916                                         :level 0)))
    19041917
    1905 (defparameter *default-inspector-ui-creation-function* 'tty-inspect)
    1906        
     1918(defparameter *default-inspector-ui-creation-function* (lambda (thing)
     1919                                                         (ccl::application-ui-operation *application* :inspect thing)))
     1920
     1921(defmethod ccl::ui-object-do-operation ((o ccl::ui-object) (operation (eql :inspect)) &rest args)
     1922  (apply #'tty-inspect args))
    19071923
    19081924(defun inspect (thing)
    1909   (let* ((ccl::@ thing))
     1925  (let* ((ccl::@@@ nil)
     1926         (ccl::@@ nil)
     1927         (ccl::@ thing))
    19101928    (restart-case (funcall *default-inspector-ui-creation-function* thing)
    19111929      (end-inspect () thing))))
     1930
     1931(defmethod note-inspecting-item ((i inspector))
     1932  (setq ccl::@@@ ccl::@@
     1933        ccl::@@ ccl::@
     1934        ccl::@ (inspector-object i)))
Note: See TracChangeset for help on using the changeset viewer.