QVector translations
Sat Jan 23 20:48:00 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* QVector translations
hunk ./cl-smoke.qt.gui.asd 16
+ (:file "translations" :depends-on ("qt.gui"))
hunk ./src/application.lisp 30
- `(cl-smoke.qt.core::with-application ((cl-smoke.qt.core::ensure-app 'qt:application)
- (cl-smoke.qt.core::kill-app))
+ `(cl-smoke.qt.core:with-application ((cl-smoke.qt.core:ensure-app 'qt:application)
+ (cl-smoke.qt.core:kill-app))
hunk ./src/painter.lisp 3
-(defmacro qt:with-painter ((painter paint-device) &body body)
+(defmacro qt:with-painter ((painter &optional paint-device) &body body)
hunk ./src/painter.lisp 5
- during the evaluation of BODY.
+ during the evaluation of BODY. Or when PAINT-DEVICE is not
+specified, saves and restored the state of PAINTER around BODY.
hunk ./src/painter.lisp 10
- `(let ((,painter (make-instance 'qt:painter :arg0 ,paint-device)))
- (assert (cxx:is-active ,painter)
- (,painter)
- "Painter ~A for ~A is not active"
- ,painter ,paint-device)
- (unwind-protect
- (progn ,@body)
- (cxx:end ,painter))))
+ (when paint-device
+ `(let ((,painter (make-instance 'qt:painter :arg0 ,paint-device)))
+ (assert (cxx:is-active ,painter)
+ (,painter)
+ "Painter ~A for ~A is not active"
+ ,painter ,paint-device)
+ (unwind-protect
+ (progn ,@body)
+ (cxx:end ,painter)))
+ `(progn (cxx:save ,painter)
+ (unwind-protect
+ (progn ,@body)
+ (cxx:restore ,painter)))))
addfile ./src/translations.lisp
hunk ./src/translations.lisp 1
+(in-package :cl-smoke.qt.gui)
+
+;; QPoint has a trivial copy ctor and destructor, thus memcpying it
+;; should be fine.
+(cl-smoke.qt.core:define-qvector-translations "QPoint" qt:point)
+
+(cl-smoke.qt.core:define-qvector-translations "unsigned int"
+ (smoke:c-integer :unsigned-int))