QVector translations
Sat Jan 23 20:48:00 CET 2010 Tobias Rautenkranz <tobias@rautenkranz.ch>
* QVector translations
diff -rN -u old-qt.gui/cl-smoke.qt.gui.asd new-qt.gui/cl-smoke.qt.gui.asd
--- old-qt.gui/cl-smoke.qt.gui.asd 2014-10-30 07:00:27.000000000 +0100
+++ new-qt.gui/cl-smoke.qt.gui.asd 2014-10-30 07:00:27.000000000 +0100
@@ -13,6 +13,7 @@
(:file "qt.gui" :depends-on ("package"))
(:file "ownership" :depends-on ("qt.gui"))
(:file "application" :depends-on ("qt.gui"))
+ (:file "translations" :depends-on ("qt.gui"))
(:file "painter" :depends-on ("qt.gui"))))))
(defmethod perform ((operation test-op) (c (eql (find-system :cl-smoke.qt.gui))))
diff -rN -u old-qt.gui/src/application.lisp new-qt.gui/src/application.lisp
--- old-qt.gui/src/application.lisp 2014-10-30 07:00:27.000000000 +0100
+++ new-qt.gui/src/application.lisp 2014-10-30 07:00:27.000000000 +0100
@@ -27,8 +27,8 @@
(assert (null options)
(options)
"Currently no options can be passed to QT:WITH-APP.")
- `(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))
,@body))
(defun qt:exec ()
diff -rN -u old-qt.gui/src/painter.lisp new-qt.gui/src/painter.lisp
--- old-qt.gui/src/painter.lisp 2014-10-30 07:00:27.000000000 +0100
+++ new-qt.gui/src/painter.lisp 2014-10-30 07:00:27.000000000 +0100
@@ -1,16 +1,22 @@
(in-package :cl-smoke.qt.gui)
-(defmacro qt:with-painter ((painter paint-device) &body body)
+(defmacro qt:with-painter ((painter &optional paint-device) &body body)
"Binds a PAINTER instance for PAINT-DEVICE to PAINTER
- 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.
Makes sure the painter ends after BODY; thus preventing problems with
still active and not yet garbage collected painters in CXX:PAINT-EVENT."
- `(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)))))
diff -rN -u old-qt.gui/src/translations.lisp new-qt.gui/src/translations.lisp
--- old-qt.gui/src/translations.lisp 1970-01-01 01:00:00.000000000 +0100
+++ new-qt.gui/src/translations.lisp 2014-10-30 07:00:27.000000000 +0100
@@ -0,0 +1,8 @@
+(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))