lqml/examples/clog-demo/lisp/clog-bridge.lisp

19 lines
580 B
Common Lisp

;;; this requires a CLOG fork prepared for mobile
(in-package :clog)
(setf clog-connection::*send-to-webview*
(lambda (js) (qml:qjs |send| ui:*server* js)))
(defun webview/on-new-connection ()
(clog-connection::handle-new-connection 'qml-webview nil))
(defun webview/on-message (message)
(clog-connection::handle-message 'qml-webview message))
(defun boot ()
(qml:q> |url| ui:*browser*
#+android "file:///android_asset/lib/static-files/boot.html"
#-android (format nil "file://~A" (merge-pathnames "static-files/boot.html"))))
(export 'boot)