diff --git a/examples/advanced-qml-auto-reload/lisp/swank-quicklisp.lisp b/examples/advanced-qml-auto-reload/lisp/swank-quicklisp.lisp index 55c4244..3f95f8f 100644 --- a/examples/advanced-qml-auto-reload/lisp/swank-quicklisp.lisp +++ b/examples/advanced-qml-auto-reload/lisp/swank-quicklisp.lisp @@ -72,7 +72,6 @@ (define-symbol-macro :q (quicklisp))) (export - (list #+ios - 'start-swank + (list 'start-swank 'stop-swank 'quicklisp)) diff --git a/examples/cl-repl/lisp/dialogs.lisp b/examples/cl-repl/lisp/dialogs.lisp index 0752b64..49ef9fa 100644 --- a/examples/cl-repl/lisp/dialogs.lisp +++ b/examples/cl-repl/lisp/dialogs.lisp @@ -5,6 +5,7 @@ #:debug-dialog #:get-file-name #:exited + #:help #:push-dialog #:pop-dialog #:*file-name*)) @@ -26,8 +27,7 @@ (disable-clipboard-menu) (prog1 (> (q< |depth| ui:*main*) 1) - (qjs |popDialog| ui:*main*) - (exited))) + (qjs |popDialog| ui:*main*))) (defun wait-while-transition () ;; needed for evtl. recursive calls @@ -43,7 +43,6 @@ (q! |forceActiveFocus| ui:*query-input*) (q! |showKeyboard| ui:*main* t) ; needed on recursive calls (wait-for-closed) - (pop-dialog) (qlater (lambda () (editor:ensure-focus :show))) (q< |text| ui:*query-input*)) @@ -66,18 +65,20 @@ (q! |forceActiveFocus| ui:*debug-input*) (qsingle-shot 500 (lambda () (q! |positionViewAtEnd| ui:*debug-text*))) (wait-for-closed) - (pop-dialog) (qlater (lambda () (editor:ensure-focus :show))) (q< |text| ui:*debug-input*)) -(let ((exited t)) +(let (waiting) (defun wait-for-closed () - (setf exited nil) + (setf waiting t) ;; busy waiting is safer than suspending a thread, especially on mobile - (x:while (not exited) - (qsleep 0.1))) + (x:while waiting + (qsleep 0.1)) + (pop-dialog)) (defun exited () ; called from QML - (setf exited t))) + (unless waiting + (pop-dialog)) + (setf waiting nil))) ;; file browser @@ -99,8 +100,9 @@ (qsingle-shot 500 (lambda () (q! |forceActiveFocus| ui:*path*)))))) (defun directory-p (path) - (not (or (pathname-name path) - (pathname-type path)))) + (unless (equal "" path) + (not (or (pathname-name path) + (pathname-type path))))) (defun set-file-name (file-name) ; called from QML (let ((name (remove-if (lambda (ch) (find ch "*?\\")) file-name))) @@ -134,3 +136,7 @@ (unless (x:ends-with "/" url) (setf path* (x:cc url "/"))) (q> |folder| ui:*folder-model* url))) + +(defun help () + (push-dialog :help)) + diff --git a/examples/cl-repl/lisp/editor.lisp b/examples/cl-repl/lisp/editor.lisp index e9874f7..788cf05 100644 --- a/examples/cl-repl/lisp/editor.lisp +++ b/examples/cl-repl/lisp/editor.lisp @@ -658,19 +658,13 @@ (print-eval-output :values "kill: eval thread not running"))) (t (let ((cmd (cond ((cmd ":h") - "(qml:help)") + "(dialogs:help)") ((cmd ":s") "(qml:start-swank)") ((cmd ":q") "(qml:quicklisp)") - ((cmd ":a") - "(require :asdf)") - ((cmd ":f") - "(dialogs:get-file-name)") ((cmd ":c") "(progn (qml:q! |clear| ui:*output-model*) (values))") - ((cmd ":r") - "(editor:reload-qml)") ((cmd "*") (format nil "(progn~% (editor::set-clipboard-text (prin1-to-string *))~% *)")) ((x:starts-with ":? " text*) @@ -1133,7 +1127,8 @@ (change-font :smaller 3)) (eval:ini :output 'print-eval-output :query-dialog 'dialogs:query-dialog - :debug-dialog 'dialogs:debug-dialog)) + :debug-dialog 'dialogs:debug-dialog) + (append-output (format nil "~% :h for help") :bold t)) ;;; quit app diff --git a/examples/cl-repl/lisp/swank-quicklisp.lisp b/examples/cl-repl/lisp/swank-quicklisp.lisp index 55c4244..3f95f8f 100644 --- a/examples/cl-repl/lisp/swank-quicklisp.lisp +++ b/examples/cl-repl/lisp/swank-quicklisp.lisp @@ -72,7 +72,6 @@ (define-symbol-macro :q (quicklisp))) (export - (list #+ios - 'start-swank + (list 'start-swank 'stop-swank 'quicklisp)) diff --git a/examples/cl-repl/qml/ext/DebugDialog.qml b/examples/cl-repl/qml/ext/DebugDialog.qml index dc69bc1..0614eef 100644 --- a/examples/cl-repl/qml/ext/DebugDialog.qml +++ b/examples/cl-repl/qml/ext/DebugDialog.qml @@ -14,12 +14,8 @@ Rectangle { Ext.MenuBack { id: menuBack + Layout.fillWidth: true label: "Debug Dialog" - - onPressed: { - debugInput.text = ":q" - Lisp.call("dialogs:exited") - } } TextField { diff --git a/examples/cl-repl/qml/ext/FileBrowser.qml b/examples/cl-repl/qml/ext/FileBrowser.qml index df25c77..b4075c3 100644 --- a/examples/cl-repl/qml/ext/FileBrowser.qml +++ b/examples/cl-repl/qml/ext/FileBrowser.qml @@ -26,11 +26,6 @@ Rectangle { Ext.MenuBack { id: menuBack - onPressed: { - Lisp.call("dialogs:set-file-name", "") - Lisp.call("dialogs:pop-dialog") - } - Row { id: buttonRow spacing: 4 diff --git a/examples/cl-repl/qml/ext/Help.qml b/examples/cl-repl/qml/ext/Help.qml new file mode 100644 index 0000000..8c9ad6f --- /dev/null +++ b/examples/cl-repl/qml/ext/Help.qml @@ -0,0 +1,43 @@ +import QtQuick 2.15 +import "." as Ext + +Rectangle { + color: "lightyellow" + + Column { + anchors.fill: parent + + Ext.MenuBack { + label: "Help" + } + + Ext.Flickable { + id: flick + width: parent.width + height: parent.height + contentWidth: help.paintedWidth + contentHeight: help.paintedHeight + 75 + + Text { + id: help + width: flick.width + height: flick.height + padding: 20 + wrapMode: Text.WordWrap + font.pixelSize: 20 + text: + "

Help

+ " + } + } + } +} diff --git a/examples/cl-repl/qml/ext/MenuBack.qml b/examples/cl-repl/qml/ext/MenuBack.qml index 42b4ea9..a12bd66 100644 --- a/examples/cl-repl/qml/ext/MenuBack.qml +++ b/examples/cl-repl/qml/ext/MenuBack.qml @@ -7,9 +7,7 @@ Rectangle { height: backButton.height color: "#f0f0f0" - property string label - - signal pressed() + property alias label: label.text Button { id: backButton @@ -27,15 +25,27 @@ Rectangle { color: "#007aff" text: "\uf104" } + + Text { + x: 30 + height: backButton.height * 1.1 // align correction (different font from above) + verticalAlignment: Text.AlignVCenter + font.weight: Font.DemiBold + color: iconBack.color + text: "Repl" + visible: (Qt.platform.os === "ios") + } + + implicitWidth: 90 color: menuBack.color } - onPressed: parent.pressed() + onPressed: Lisp.call("dialogs:exited") } Text { + id: label anchors.centerIn: parent - text: menuBack.label font.weight: Font.DemiBold } } diff --git a/examples/cl-repl/qml/ext/QueryDialog.qml b/examples/cl-repl/qml/ext/QueryDialog.qml index e90c2a2..b104e77 100644 --- a/examples/cl-repl/qml/ext/QueryDialog.qml +++ b/examples/cl-repl/qml/ext/QueryDialog.qml @@ -14,11 +14,6 @@ Rectangle { Ext.MenuBack { id: menuBack label: "Query Dialog" - - onPressed: { - queryInput.clear() - Lisp.call("dialogs:exited") - } } TextField { @@ -44,29 +39,4 @@ Rectangle { font.pixelSize: queryInput.font.pixelSize - (main.small ? 2 : 0) } } - - Row { - anchors.horizontalCenter: parent.horizontalCenter - y: queryInput.y + queryInput.height + (main.small ? 7 : 10) - spacing: 20 - visible: queryInput.focus - - // cursor back - Ext.ArrowButton { - opacity: 0.15 - text: "\uf137" - - onPressed: queryInput.cursorPosition-- - onPressAndHold: queryInput.cursorPosition = 0 - } - - // cursor forward - Ext.ArrowButton { - opacity: 0.15 - text: "\uf138" - - onPressed: queryInput.cursorPosition++ - onPressAndHold: queryInput.cursorPosition = queryInput.length - } - } } diff --git a/examples/cl-repl/qml/main.qml b/examples/cl-repl/qml/main.qml index f733a55..1e44843 100644 --- a/examples/cl-repl/qml/main.qml +++ b/examples/cl-repl/qml/main.qml @@ -33,6 +33,7 @@ StackView { case "file": main.push(dialogFile); break; case "debug": main.push(dialogDebug); break; case "query": main.push(dialogQuery); break; + case "help": main.push(dialogHelp); break; } } @@ -616,6 +617,7 @@ StackView { Ext.FileBrowser { id: dialogFile; opacity: 0 } Ext.QueryDialog { id: dialogQuery; opacity: 0 } Ext.DebugDialog { id: dialogDebug; opacity: 0 } + Ext.Help { id: dialogHelp; opacity: 0 } Ext.ClipboardMenu {} diff --git a/examples/clog-demo/lisp/swank-quicklisp.lisp b/examples/clog-demo/lisp/swank-quicklisp.lisp index 55c4244..3f95f8f 100644 --- a/examples/clog-demo/lisp/swank-quicklisp.lisp +++ b/examples/clog-demo/lisp/swank-quicklisp.lisp @@ -72,7 +72,6 @@ (define-symbol-macro :q (quicklisp))) (export - (list #+ios - 'start-swank + (list 'start-swank 'stop-swank 'quicklisp)) diff --git a/examples/swank-server/lisp/swank-quicklisp.lisp b/examples/swank-server/lisp/swank-quicklisp.lisp index 55c4244..3f95f8f 100644 --- a/examples/swank-server/lisp/swank-quicklisp.lisp +++ b/examples/swank-server/lisp/swank-quicklisp.lisp @@ -72,7 +72,6 @@ (define-symbol-macro :q (quicklisp))) (export - (list #+ios - 'start-swank + (list 'start-swank 'stop-swank 'quicklisp)) diff --git a/screenshots/cl-repl.jpg b/screenshots/cl-repl.jpg new file mode 100644 index 0000000..cc104ca Binary files /dev/null and b/screenshots/cl-repl.jpg differ diff --git a/src/cpp/lqml.cpp b/src/cpp/lqml.cpp index 6eec35b..a976b71 100644 --- a/src/cpp/lqml.cpp +++ b/src/cpp/lqml.cpp @@ -7,7 +7,7 @@ #include #include -const char LQML::version[] = "22.4.1"; // Apr 2022 +const char LQML::version[] = "22.4.2"; // Apr 2022 extern "C" void ini_LQML(cl_object);