Changeset main,31 for main/output.lisp
- Timestamp:
- 11/05/2007 08:06:48 PM (19 years ago)
- branch-nick:
- tui-new
- revision id:
- dsowen@fugue88.ws-20071105200648-7juihmioe0ruvmln
- File:
-
- 1 edited
-
main/output.lisp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
main/output.lisp
r28 r31 1 1 (defpackage #:tui-output 2 2 (:use #:cl #:cffi #:tui-cursor #:tui-window) 3 (:export #:add-string #:move-and-add-string #:add-clipped-string)) 3 (:export #:background #:add-string #:move-and-add-string 4 #:add-clipped-string)) 4 5 5 6 (in-package #:tui-output) … … 13 14 (attr chtype) 14 15 (char wchar :count 5)) 16 17 18 19 (defcfun "wgetbkgrnd" :int 20 (window :pointer) 21 (wch :pointer)) 22 23 (defcfun "wbkgrnd" :void 24 (window :pointer) 25 (wch :pointer)) 26 27 ;;(defgeneric background (window)) 28 29 (defgeneric (setf background) (pair window) 30 (:method (pair (window window)) 31 (destructuring-bind (ch color) pair 32 (with-foreign-object (wch 'cchar_t) 33 (with-foreign-slots ((attr char) wch cchar_t) 34 (dotimes (i 5) 35 (setf (mem-aref char 'wchar i) 0)) 36 (setf attr (cdk::color-pair color) 37 (mem-aref char 'wchar) (char-code ch))) 38 (wbkgrnd (window-pointer window) wch))))) 15 39 16 40 … … 34 58 35 59 (defun add-clipped-string (window y x s) 60 ;; TODO: double check for ob1 in OVER. 36 61 (multiple-value-bind (maxy maxx) (size window) 37 62 (unless (<= 0 y maxy) (return-from add-clipped-string)) … … 103 128 (clear-complex-char cc) 104 129 (set-complex-char cc (aref s i)))) 105 (wadd-wchnstr windowa n))))130 (wadd-wchnstr (window-pointer window) a n)))) 106 131 107 132 … … 122 147 (bl chtype) 123 148 (br chtype)) 124 125 (defcfun ("wbkgd" c-set-window-background) :int126 (window :pointer)127 (ch chtype))128 129 (defcfun "wbkgrnd" :int130 (window :pointer)131 (wch :pointer))
Note: See TracChangeset
for help on using the changeset viewer.
