Changeset 7931


Ignore:
Timestamp:
Dec 22, 2007, 11:48:19 AM (12 years ago)
Author:
gz
Message:

remove unused code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/event-ide/ccl/cocoa-ide/cocoa-listener.lisp

    r7929 r7931  
    188188    ((filehandle :foreign-type :id)     ;Filehandle for I/O
    189189     (clientfd :foreign-type :int)      ;Client (listener)'s side of pty
    190      (nextra :foreign-type :int)        ;count of untranslated bytes remaining
    191      (translatebuf :foreign-type :address) ;buffer for utf8 translation
    192      (bufsize :foreign-type :int)       ;size of translatebuf
    193190     )
    194191  (:metaclass ns:+ns-object)
     
    213210                      :close-on-dealloc t)))
    214211            (setf (slot-value new 'filehandle) fh)
    215             (setf (slot-value new 'clientfd) (setup-client-pty client))
    216             (let* ((bufsize #$BUFSIZ)
    217                    (buffer (#_malloc bufsize)))
    218               (setf (slot-value new 'translatebuf) buffer
    219                     (slot-value new 'bufsize) bufsize
    220                     (slot-value new 'nextra) 0))
    221             (#/addObserver:selector:name:object:
    222              (#/defaultCenter ns:ns-notification-center)
    223              new
    224              (@selector #/gotData:)
    225              #&NSFileHandleReadCompletionNotification
    226              fh)
    227             (#/readInBackgroundAndNotify fh)))))
     212            (setf (slot-value new 'clientfd) (setup-client-pty client))))))
    228213    new))
    229 
    230 (objc:defmethod (#/gotData: :void) ((self hemlock-listener-window-controller)
    231                                     notification)
    232   (with-slots (filehandle nextra translatebuf bufsize) self
    233     (let* ((data (#/objectForKey: (#/userInfo notification)
    234                                   #&NSFileHandleNotificationDataItem))
    235            (encoding (load-time-value (get-character-encoding :utf-8)))
    236            (data-length (#/length data))
    237            (n nextra)
    238            (cursize bufsize)
    239            (need (+ n data-length))
    240            (xlate translatebuf)
    241            (fh filehandle))
    242       (when (> need cursize)
    243         (let* ((new (#_malloc need)))
    244           (dotimes (i n) (setf (%get-unsigned-byte new i)
    245                                (%get-unsigned-byte xlate i)))
    246           (#_free xlate)
    247           (setq xlate new translatebuf new bufsize need)))
    248       #+debug :GZ (#_NSLog #@"got %d bytes of data" :int data-length)
    249       (with-macptrs ((target (%inc-ptr xlate n)))
    250         (#/getBytes:range: data target (ns:make-ns-range 0 data-length)))
    251       (let* ((total (+ n data-length)))
    252         (multiple-value-bind (nchars noctets-used)
    253             (funcall (ccl::character-encoding-length-of-memory-encoding-function encoding)
    254                      xlate
    255                      total
    256                      0)
    257           (let* ((string (make-string nchars)))
    258             (funcall (ccl::character-encoding-memory-decode-function encoding)
    259                      xlate
    260                      noctets-used
    261                      0
    262                      string)
    263             (unless (zerop (setq n (- total noctets-used)))
    264               ;; By definition, the number of untranslated octets
    265               ;; can't be more than 3.
    266               (dotimes (i n)
    267                 (setf (%get-unsigned-byte xlate i)
    268                       (%get-unsigned-byte xlate (+ noctets-used i)))))
    269             (setq nextra n)
    270             (let ((view (hemlock-view self)))
    271               (queue-for-gui #'(lambda () (append-output view string))))
    272             (#/readInBackgroundAndNotify fh)))))))
    273              
    274 
    275 
    276 (objc:defmethod (#/dealloc :void) ((self hemlock-listener-window-controller))
    277   (#/removeObserver: (#/defaultCenter ns:ns-notification-center) self)
    278   (call-next-method))
    279214
    280215(objc:defmethod #/windowTitleForDocumentDisplayName: ((self hemlock-listener-window-controller) name)
Note: See TracChangeset for help on using the changeset viewer.