Split up in qt.core.
Annotate for file /src/qstring.lisp
2010-01-10 tobias 1 (in-package :cl-smoke.qt.core)
2009-04-05 tobias 2
2010-01-10 tobias 3 (defcfun cl-smoke-string-to-qstring :pointer
2009-04-05 tobias 4 (data :string)
17:56:16 ' 5 (length :int))
' 6
2010-01-10 tobias 7 (defcfun cl-smoke-free-qstring :void
2009-04-05 tobias 8 (string :pointer))
17:56:16 ' 9
2010-01-10 tobias 10 (defcfun cl-smoke-qstring-to-byte-array :pointer
2009-04-05 tobias 11 (qstring :pointer))
17:56:16 ' 12
2009-07-01 tobias 13 ;;; make sure, that you have configured slime correctly.
2009-07-22 tobias 14 ;;; e.g.:
2009-04-05 tobias 15 ;;; (string #\U9999) crashed slime for me. Adding
17:56:16 ' 16 ;;; (set-language-environment "UTF-8")
' 17 ;;; (setq slime-net-coding-system 'utf-8-unix)
' 18 ;;; to .emacs helps.
2009-07-22 tobias 19 ;;; Use emacs 23 for better unicode support.
2009-05-14 tobias 20 (smoke:eval-startup (:compile-toplevel :execute)
2009-06-11 tobias 21 (qt:text-codec.set-codec-for-cstrings
14:59:48 ' 22 (qt:text-codec.codec-for-name (string *default-foreign-encoding*)))
' 23 (qt:text-codec.set-codec-for-locale
' 24 (qt:text-codec.codec-for-name (string *default-foreign-encoding*))))
2009-04-05 tobias 25
2009-05-14 tobias 26 (smoke:eval-startup (:compile-toplevel :execute)
2009-08-02 tobias 27 (let ((method (smoke::make-smoke-method-from-name (find-class 'qt:byte-array)
2009-08-27 tobias 28 "constData")))
08:37:36 ' 29 (defmethod cxx:const-data ((array qt:byte-array))
2009-08-02 tobias 30 (values ;; Discharge second return value (length of string)
11:15:21 ' 31 (foreign-string-to-lisp (smoke::pointer-call method
' 32 (smoke::pointer array))
' 33 :count (cxx:size array))))))
2009-04-05 tobias 34
2009-08-02 tobias 35 (defun from-qstring (qstring)
2009-08-27 tobias 36 (cxx:const-data (make-instance 'qt:byte-array
2010-01-10 tobias 37 :pointer (cl-smoke-qstring-to-byte-array qstring))))
2009-04-05 tobias 38
2009-08-02 tobias 39 (define-to-lisp-translation ("QString" "const QString&")
2010-01-10 tobias 40 from-qstring cl-smoke-free-qstring)
2009-05-11 tobias 41 (defun coerce-qstring (string)
2009-05-11 tobias 42 (make-cleanup-pointer
2009-05-27 tobias 43 (with-foreign-string ((data length) string :null-terminated-p nil)
2010-01-10 tobias 44 (cl-smoke-string-to-qstring data length))
08:52:09 ' 45 #'cl-smoke-free-qstring))
2009-05-11 tobias 46
2009-05-26 tobias 47 (define-from-lisp-translation ("const QString&" "QString") string
2009-05-11 tobias 48 coerce-qstring)
11:18:36 ' 49
2009-08-02 tobias 50 (defmethod print-object ((object qt:byte-array) stream)
11:29:13 ' 51 (if (null-pointer-p (pointer object))
' 52 (call-next-method)
' 53 (print-unreadable-object (object stream :type t :identity t)
2009-08-27 tobias 54 (when (smoke::const-p object)
08:37:36 ' 55 (princ "CONST " stream))
' 56 (prin1 (cxx:const-data object) stream))))
2009-08-02 tobias 57