Changeset main,22.1.1 for main/cdk.lisp
- Timestamp:
- 11/03/2007 01:59:12 AM (19 years ago)
- branch-nick:
- tui
- revision id:
- dsowen@fugue88.ws-20071103015912-8vledq756a3oa45e
- File:
-
- 1 edited
-
main/cdk.lisp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
main/cdk.lisp
r18 r22.1.1 1 1 (defpackage #:cdk 2 2 (:use #:cl #:cffi) 3 (:export #:with-screen #:with-der-window ))3 (:export #:with-screen #:with-der-window #:add-ch #:add-string #:wmove)) 4 4 5 5 (in-package #:cdk) … … 127 127 (x :int)) 128 128 129 (defcfun ("mvwadd_wch" c-move-and-add-char) :int 130 (window :pointer) 131 (y :int) 132 (x :int) 129 (defcfun "wadd_wch" :int 130 (window :pointer) 133 131 (wch :pointer)) 134 132 … … 157 155 (inc-pointer nc-wacs (* (foreign-type-size 'cchar_t) code)))) 158 156 159 (defun move-and-add-char (window y x ch) 157 (defcfun ("wmove" c-wmove) :int 158 (window :pointer) 159 (y :int) 160 (x :int)) 161 162 (defun add-char (window ch) 160 163 (with-foreign-object (s 'cchar_t) 161 164 (with-foreign-slots ((attr char) s cchar_t) … … 164 167 (setf (mem-aref char :uint32 i) 0)) 165 168 (setf (mem-aref char :uint32) (char-code ch))) 166 (c-move-and-add-char window y x s))) 169 (wadd-wch window s))) 170 171 (defun add-string (window s) 172 (dotimes (i (length s)) 173 (add-char window (aref s i)))) 174 175 (defun move-and-add-char (window y x ch) 176 (wmove window y x) 177 (add-char window ch)) 167 178 168 179 (defun move-and-add-string (window y x s) 169 (dotimes (i (length s)) 170 (move-and-add-char window y (+ x i) (aref s i)))) 171 172 (defcfun ("wmove" c-wmove) :int 173 (window :pointer) 174 (y :int) 175 (x :int)) 180 (wmove window y x) 181 (add-string window s)) 176 182 177 183 (defcfun ("wrefresh" c-refresh-window) :int
Note: See TracChangeset
for help on using the changeset viewer.
