Lisp image loading
Thu May 14 14:11:11 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* Lisp image loading
hunk ./src/i18n.lisp 17
-(defmacro with-translator (base-name &body body)
- "Loads the translations in the BASE-NAME_LANGCODE.qm file.
+(defmacro with-translator ((base-name &rest paths) &body body)
+ "Loads the translations in the BASE-NAME_LANGCODE.qm file;
+searching PATHS.
hunk ./src/i18n.lisp 24
- (unless (cxx:load ,translator (format nil "~A_~A"
- ,base-name
- (cxx:name (qt:locale.system))))
+ (unless [_$_]
+ (find-if #'(lambda (path)
+ (cxx:load ,translator
+ (format nil "~A_~A" ,base-name
+ (cxx:name (qt:locale.system)))))
+ (list ,@paths))
hunk ./src/i18n.lisp 47
+
+(defun search-file (name &rest paths)
+ "Searches the file NAME in PATHS and returns its path."
+ (let ((file-path (find-if #'(lambda (path)
+ (probe-file (merge-pathnames name path)))
+ paths)))
+ (unless file-path
+ (error "The file ~S not found in the paths ~S" name paths))
+ (merge-pathnames name file-path)))
+
hunk ./src/lisp-object.lisp 33
-(eval-when (:load-toplevel)
+(eval-startup ()
hunk ./src/object.lisp 27
- (if (null-pointer-p (pointer object))
+ (if (or (not (slot-boundp object 'pointer))
+ (null-pointer-p (pointer object)))
hunk ./src/object.lisp 86
-(let ((get-parent (smoke::make-smoke-method (smoke::make-smoke-class
+(smoke:eval-startup (:compile-toplevel :execute)
+(defparameter *get-parent*
+ (smoke::make-smoke-method (smoke::make-smoke-class
hunk ./src/object.lisp 94
- (delete-later (smoke::make-smoke-method (smoke::make-smoke-class
+(defparameter *delete-later*
+ (smoke::make-smoke-method (smoke::make-smoke-class
hunk ./src/object.lisp 99
+
hunk ./src/object.lisp 109
- (if (null-pointer-p (smoke::pointer-call get-parent pointer))
- (smoke::pointer-call delete-later pointer)
+ (if (null-pointer-p (smoke::pointer-call *get-parent* pointer))
+ (smoke::pointer-call *delete-later* pointer)
hunk ./src/object.lisp 119
- (when (null-pointer-p (smoke::pointer-call get-parent pointer))
+ (when (null-pointer-p (smoke::pointer-call *get-parent* pointer))
hunk ./src/object.lisp 124
- condition)))))))
+ condition))))))
hunk ./src/object.lisp 177
-(eval-when (:load-toplevel)
+(smoke:eval-startup ()
hunk ./src/package.lisp 36
+ #:search-file
+
hunk ./src/qstring.lisp 30
-(eval-when (:compile-toplevel :load-toplevel :execute)
+(smoke:eval-startup (:compile-toplevel :execute)
hunk ./src/qstring.lisp 44
+(smoke:eval-startup (:compile-toplevel :execute)
hunk ./src/qstring.lisp 51
- :count (cxx:size array)))))
+ :count (cxx:size array))))))
hunk ./src/qt.lisp 30
-(eval-when (:load-toplevel :compile-toplevel :execute)
- (define-foreign-library libsmokeqt
- (:unix "libsmokeqt.so.2")
- (t (:default "libsmokeqt")))
-
- (use-foreign-library libsmokeqt)
-
- (use-foreign-library libqt-smoke-extra)
- [_$_]
- (defcvar ("qt_Smoke" :read-only t) :pointer
- "The Smoke Qt binding")
-
- (defcfun (init-qt-smoke "_Z13init_qt_Smokev") :void)
-
- (defvar *qt-binding* (null-pointer))
-
- (init-qt-smoke))
-
-(eval-when (:load-toplevel :compile-toplevel)
- (when (null-pointer-p *qt-binding*)
- (setf *qt-binding* (init *qt-smoke*))))
-
-(define-methods *qt-smoke*)
+(define-smoke-module libsmokeqt
+ (*qt-smoke* "qt_Smoke")
+ (init-qt-smoke "init_qt_Smoke"))
hunk ./src/qt.lisp 34
+(smoke:eval-startup (:compile-toplevel :execute)
+ (use-foreign-library libqt-smoke-extra))
hunk ./src/qt.lisp 38
- (apply #'new-object *qt-binding* class-name method-name args))
+ (apply #'new-object (smoke::binding *qt-smoke*) class-name method-name args))
hunk ./src/variant.lisp 58
- "Returns a new VARIANT that wraps VALUE."
+ "Returns a new VARIANT that wraps VALUE.
+
+The variant contains the actual Lisp object
+and not its C++ value like in MAKE-VARIANT."