Index: ccl/examples/cocoa-editor.lisp =================================================================== RCS file: /usr/local/tmpcvs/ccl-0.14-dev/ccl/examples/cocoa-editor.lisp,v retrieving revision 1.29 diff -c -r1.29 cocoa-editor.lisp *** ccl/examples/cocoa-editor.lisp 25 Sep 2004 21:13:55 -0000 1.29 --- ccl/examples/cocoa-editor.lisp 6 Oct 2004 16:28:22 -0000 *************** *** 396,402 **** ;;; hemlock-text-storage objects (defclass hemlock-text-storage (ns:ns-text-storage) ((string :foreign-type :id) ! (edit-count :foreign-type :int)) (:metaclass ns:+ns-object)) (define-objc-method ((:unsigned :line-break-before-index (:unsigned index) --- 396,403 ---- ;;; hemlock-text-storage objects (defclass hemlock-text-storage (ns:ns-text-storage) ((string :foreign-type :id) ! (edit-count :foreign-type :int) ! (append-edits :foreign-type :int)) (:metaclass ns:+ns-object)) (define-objc-method ((:unsigned :line-break-before-index (:unsigned index) *************** *** 532,553 **** (svref *styles* style)))) (define-objc-method ((:void :replace-characters-in-range (:ange r) ! :with-string string) ! hemlock-text-storage) ! (let* ((cache (hemlock-buffer-string-cache (send self 'string))) ! (buffer (if cache (buffer-cache-buffer cache))) ! (hi::*buffer-gap-context* (hi::buffer-gap-context buffer)) ! (location (pref r :ange.location)) ! (length (pref r :ange.length)) ! (mark (hi::buffer-%mark buffer)) ! (point (hi::buffer-point buffer))) (cond ((> length 0) ! (move-hemlock-mark-to-absolute-position mark cache location) ! (move-hemlock-mark-to-absolute-position point cache (+ location length)) ! (hemlock::%buffer-activate-region buffer)) ! (t ! (move-hemlock-mark-to-absolute-position point cache location))) ! (hi::insert-string point (lisp-string-from-nsstring string)))) ;;; I'm not sure if we want the text system to be able to change --- 533,569 ---- (svref *styles* style)))) (define-objc-method ((:void :replace-characters-in-range (:ange r) ! :with-string string) ! hemlock-text-storage) ! (let* ((cache (hemlock-buffer-string-cache (send self 'string))) ! (buffer (if cache (buffer-cache-buffer cache))) ! (hi::*buffer-gap-context* (hi::buffer-gap-context buffer)) ! (location (pref r :ange.location)) ! (length (pref r :ange.length)) ! (mark (hi::buffer-%mark buffer)) ! (point (hi::buffer-point buffer)) ! input-mark) ! ! ;; ! ;; special behavior for listener windows. ! ;; ! (if (and (> (slot-value self 'append-edits) 0) ! (progn ! (setf input-mark (hi::variable-value 'hemlock::buffer-input-mark :buffer buffer)) ! (not (hi::same-line-p point input-mark)))) ! (progn ! ;; ! ;; move the point to the end of the buffer ! ;; ! (setf (hi::buffer-region-active buffer) nil) ! (move-hemlock-mark-to-absolute-position point cache (hemlock-buffer-length buffer))) (cond ((> length 0) ! (move-hemlock-mark-to-absolute-position mark cache location) ! (move-hemlock-mark-to-absolute-position point cache (+ location length)) ! (hemlock::%buffer-activate-region buffer)) ! (t ! (move-hemlock-mark-to-absolute-position point cache location)))) ! (hi::insert-string point (lisp-string-from-nsstring string)))) ;;; I'm not sure if we want the text system to be able to change Index: ccl/examples/cocoa-listener.lisp =================================================================== RCS file: /usr/local/tmpcvs/ccl-0.14-dev/ccl/examples/cocoa-listener.lisp,v retrieving revision 1.20 diff -c -r1.20 cocoa-listener.lisp *** ccl/examples/cocoa-listener.lisp 30 Aug 2004 21:33:22 -0000 1.20 --- ccl/examples/cocoa-listener.lisp 6 Oct 2004 16:28:22 -0000 *************** *** 188,193 **** --- 188,194 ---- (format nil "Listener-~d" *cocoa-listener-count*))) (buffer (hemlock-document-buffer doc))) + (setf (slot-value (slot-value self 'textstorage) 'append-edits) 1) (send doc :set-file-name (%make-nsstring listener-name)) (setf (hi::buffer-pathname buffer) nil (hi::buffer-minor-mode buffer "Listener") t Index: ccl/examples/cocoa-typeout.lisp =================================================================== RCS file: /usr/local/tmpcvs/ccl-0.14-dev/ccl/examples/cocoa-typeout.lisp,v retrieving revision 1.1 diff -c -r1.1 cocoa-typeout.lisp *** ccl/examples/cocoa-typeout.lisp 25 Sep 2004 21:08:58 -0000 1.1 --- ccl/examples/cocoa-typeout.lisp 6 Oct 2004 16:28:22 -0000 *************** *** 76,81 **** --- 76,85 ---- :title "Typeout" :width 600 :activate nil))) + (rlet ((size :ize :width 600.0f0 :height 10000.0f0)) + (send panel :set-max-size size) + (setf (pref size :ize.height) 1.0f0) + (send panel :set-min-size size)) (slet ((bounds (send (send panel 'content-view) 'bounds))) (let* ((view (make-instance 'typeout-view :with-frame bounds))) (send panel :set-content-view view)