diff --git a/doc/.make-doc.lisp b/doc/.make-doc.lisp new file mode 100644 index 0000000..0e6bdde --- /dev/null +++ b/doc/.make-doc.lisp @@ -0,0 +1,96 @@ +;;; hack to generate 'help.htm' from both Lisp and Qt/C++ doc strings. +;;; usage: 'lqml .make-doc.lisp' + +(in-package :qml-user) + +(defparameter *help* nil) + +(defun add-cpp-docu () + (with-open-file (s "../src/cpp/ecl_ext.cpp") + (let (curr ex) + (flet ((add-curr () + (when curr + (push (reverse curr) *help*) + (setf curr nil))) + (trim (str) + (string-trim '(#\/) str))) + (x:while-it (read-line s nil nil) + (let ((line (string-trim " " x:it))) + (when (x:starts-with "///" line) + (when (x:starts-with "cl_object " ex) + (add-curr) + (let* ((pos (search "///" ex :start2 3)) ; exception: Lisp name at end of line + (fun (if pos + (trim (subseq ex (+ 3 pos))) + (trim (subseq ex 10))))) + (push (if pos + fun + (substitute #\- #\_ (string-trim "2" (subseq fun 0 (position #\( fun))))) + curr))) + (push (x:cc " " (trim line)) curr)) + (setf ex line))) + (add-curr))))) + +(defun add-lisp-docu () + (do-external-symbols (sym (find-package :qml)) + (let ((name (symbol-name sym))) + (when (and (or (char= #\Q (char name 0)) + (find name '("DEFINE-QT-WRAPPERS" "TR" "FIND-QUICK-ITEM" "RELOAD" "ROOT-ITEM" + "ENSURE-PERMISSION" "VIEW-STATUS-CHANGED" "COPY-ALL-ASSET-FILES" + "WITH-ROOT-ITEM" "HEX") + :test 'string=)) + (not (find name '("QQ") :test 'string=))) + (print name) + (x:when-it (documentation sym 'function) + (print :doc) + (let ((fun (string-downcase (symbol-name sym))) + (docu (x:split x:it #\Newline))) + (unless (string= fun (subseq (second docu) 7)) + (push (cons fun docu) *help*)))))))) + +(defun help () + (setf *help* nil) + (add-cpp-docu) + (add-lisp-docu) + (with-open-file (s "help.htm" :direction :output :if-exists :supersede) + (format s "~%~ + ~%~ +
~%~ +LQML
~%~%") + (flet ((el (tag x) + (format nil "<~A>~A~A>" tag x tag)) + (! (x) + (format s "~A~%" x)) + (tab () + (write-string " " s))) + (setf *help* (sort *help* #'string< :key (lambda (x) (string-trim " " (first x))))) + (dolist (curr *help*) + (! (el "b" (format nil "~A ~A" (string-trim " " (first curr)) (subseq (string-trim " " (second curr)) 6)))) + (let ((n 2)) + (when (x:starts-with "alias:" (string-trim " " (third curr))) + (incf n) + (! (el "b" (subseq (string-trim " " (third curr)) 7)))) + (! "") + (let ((examples (nthcdr n curr)) + nl) + (when examples + (dolist (example examples) + (if (x:starts-with " " example) + (progn + (unless nl + (setf nl t) + (! "")) + (! example)) + (! example)))))) + (! "") + (! "")) + (format s "~%~%~%")))) + +(progn + (help) + (qq)) diff --git a/doc/help.htm b/doc/help.htm index d6c0e79..eb3be59 100644 --- a/doc/help.htm +++ b/doc/help.htm @@ -146,7 +146,7 @@ qexit () Calls QEventLoop::exit(), in order to exit event processing after a call - QEXEC with a timeout. Returns T if the event loop has effectively been + to QEXEC with a timeout. Returns T if the event loop has effectively been exited. diff --git a/examples/meshtastic/hacks/readme.md b/examples/meshtastic/hacks/readme.md index f4230e1..66ec62c 100644 --- a/examples/meshtastic/hacks/readme.md +++ b/examples/meshtastic/hacks/readme.md @@ -1,5 +1,9 @@ -Before applying this patch, please install latest ECL from development branch -(as of May 2023). +Before applying this patch, ensure you have ECL >= 23.9.9 installed. + +(Assuming you already copied :float-features from Quicklisp under +`~/quicklisp/local-projects/`.) Just copy **float-features** from Quicklisp under -`~/quicklisp/local-projects/` and apply patch (or copy `float-features.lisp`). +`~/quicklisp/local-projects/` and apply patch (or just copy +`float-features.lisp`). + diff --git a/examples/meshtastic/qml/img/logo-128.png b/examples/meshtastic/qml/img/logo-128.png deleted file mode 100644 index 8cd1f56..0000000 Binary files a/examples/meshtastic/qml/img/logo-128.png and /dev/null differ diff --git a/examples/meshtastic/qml/main.qml b/examples/meshtastic/qml/main.qml index 92a3088..6ee270b 100644 --- a/examples/meshtastic/qml/main.qml +++ b/examples/meshtastic/qml/main.qml @@ -47,7 +47,7 @@ Item { } Image { - source: "img/logo-128.png" + source: "img/logo.png" x: 2 y: 2 width: headerHeight diff --git a/examples/meshtastic/readme.md b/examples/meshtastic/readme.md index 18c5e62..0ee88e1 100644 --- a/examples/meshtastic/readme.md +++ b/examples/meshtastic/readme.md @@ -59,6 +59,9 @@ The macOS version must be compiled first, moved to `/Applications/` and started from Finder (not the console), otherwise BLE permissions will not work (if run from console, the app will show a BLE exception and consume 100% CPU). +TODO: SailfishOS, using the Qt5.15 port (that is, SailfishOS using Qt5.6, with +additional Qt5.15 installed). + How to use cl-meshtastic diff --git a/src/cpp/ecl_ext.cpp b/src/cpp/ecl_ext.cpp index e0b9cf5..6c3ff3c 100644 --- a/src/cpp/ecl_ext.cpp +++ b/src/cpp/ecl_ext.cpp @@ -217,9 +217,9 @@ cl_object qfind_children2(cl_object l_obj, cl_object l_name, cl_object l_class) QByteArray className(toCString(l_class)); QObject* qobject = toQObjectPointer(l_obj); if (qobject != nullptr) { - QObjectList children = qobject->findChildren