add QML example "palindrome-2" (dynamic version)
27
examples/M-modules/quick/palindrome-2/README.txt
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
INFO
|
||||
====
|
||||
|
||||
This is a QML port of "examples/X-extras/palindrome/".
|
||||
|
||||
Instead of generating static QML (see "palinfrome-1"), it uses a QTimer from
|
||||
Lisp to change the item positions, and a 'Behavior' in QML for the animations.
|
||||
|
||||
|
||||
RUN
|
||||
===
|
||||
|
||||
Run "palindrome.lisp" from this directory.
|
||||
|
||||
|
||||
HELP
|
||||
====
|
||||
|
||||
For inspecting the single items, run
|
||||
|
||||
(show-properties-dialog) ; see "properties.lisp"
|
||||
|
||||
and use button [Select] to select an item.
|
||||
|
||||
You can use QML-GET and QML-SET on a selected item:
|
||||
|
||||
(qml-set qsel:*q* "opacity" 2/3)
|
||||
77
examples/M-modules/quick/palindrome-2/definitions.lisp
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
;;; palindrome definitions
|
||||
|
||||
(defparameter *items*
|
||||
'(("P" "gs")
|
||||
("A" "djpv")
|
||||
("T" "ckow")
|
||||
("E" "hlnr")
|
||||
("R" "aiqy")
|
||||
("N" "m")
|
||||
("O" "bftx")
|
||||
("S" "eu")))
|
||||
|
||||
(defparameter *state-1*
|
||||
'("..............."
|
||||
"..............."
|
||||
"..............."
|
||||
"..............."
|
||||
"..............."
|
||||
".....abcde....."
|
||||
".....fghij....."
|
||||
".....klmno....."
|
||||
".....pqrst....."
|
||||
".....uvwxy....."
|
||||
"..............."
|
||||
"..............."
|
||||
"..............."
|
||||
"..............."
|
||||
"..............."))
|
||||
|
||||
(defparameter *state-2*
|
||||
'(".......d......."
|
||||
"..............."
|
||||
".......g......."
|
||||
".......j......."
|
||||
".......c......."
|
||||
".......h......."
|
||||
".......a......."
|
||||
"p.svklqmbeoni.t"
|
||||
".......f......."
|
||||
".......u......."
|
||||
".......w......."
|
||||
".......r......."
|
||||
".......y......."
|
||||
"..............."
|
||||
".......x......."))
|
||||
|
||||
(let (ex)
|
||||
(defun rotated (&optional (state ex))
|
||||
(let* ((width (length (first state)))
|
||||
(height (length state))
|
||||
(array (make-array (list width height))))
|
||||
(loop :for string :in state
|
||||
:for y :upfrom 0
|
||||
:do (loop :for ch :across string
|
||||
:for x :upfrom 0
|
||||
:do (setf (aref array x (- (1- width) y)) ; rotate
|
||||
ch)))
|
||||
(setf ex (loop :for y :below height
|
||||
:collect (coerce (loop :for x :below width
|
||||
:collect (aref array y x))
|
||||
'string)))))
|
||||
(defun ex-rotated ()
|
||||
ex))
|
||||
|
||||
(defparameter *states*
|
||||
(list *state-1* ; 1
|
||||
*state-2*
|
||||
*state-1*
|
||||
(rotated *state-1*) ; 2
|
||||
*state-2*
|
||||
(ex-rotated)
|
||||
(rotated) ; 3
|
||||
*state-2*
|
||||
(ex-rotated)
|
||||
(rotated) ; 4
|
||||
*state-2*
|
||||
(ex-rotated)))
|
||||
60
examples/M-modules/quick/palindrome-2/generate-qml.lisp
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
;;; generates a QML animation (see "definitions.lisp")
|
||||
|
||||
(require :utils "utils")
|
||||
|
||||
(defmacro with-qml-file ((file) &body body)
|
||||
(let ((text (gensym)))
|
||||
`(let ((,text (with-output-to-string (s)
|
||||
,@(mapcar (lambda (x) (if (stringp x) `(write-line ,x s) x))
|
||||
body))))
|
||||
(with-open-file (s ,file :direction :output :if-exists :supersede)
|
||||
(format s "// THIS FILE IS GENERATED~%~%")
|
||||
(write-string (indent ,text) s)
|
||||
(qlater (lambda () (format t "~%QML file generated, see ~S~%~%" ,file)))))))
|
||||
|
||||
(defmacro qml (first &body body)
|
||||
(let ((open-close (and (upper-case-p (char first 0))
|
||||
(not (find #\{ first)))))
|
||||
(if body
|
||||
`(progn
|
||||
,(if open-close
|
||||
`(format s "~%~A {~%" ,first)
|
||||
(if (find #\{ first)
|
||||
`(format s "~%~A~%" ,first)
|
||||
`(write-line ,first s)))
|
||||
,@(mapcar (lambda (x) (if (stringp x) `(write-line ,x s) x))
|
||||
body)
|
||||
,(when open-close `(write-line "}" s)))
|
||||
(if (find #\{ first)
|
||||
`(format s "~%~A~%" ,first)
|
||||
`(write-line ,first s)))))
|
||||
|
||||
(defun indent (text)
|
||||
(with-output-to-string (out)
|
||||
(let ((in (make-string-input-stream text))
|
||||
(depth 0))
|
||||
(x:while-it (read-line in nil nil)
|
||||
(let ((open (count #\{ x:it))
|
||||
(close (count #\} x:it)))
|
||||
(write-string (make-string (* 4 (- depth (if (= (- open close) -1) 1 0)))) out)
|
||||
(write-line (string-left-trim " " x:it) out)
|
||||
(setf depth (+ depth open (- close))))))))
|
||||
|
||||
;; qml file
|
||||
|
||||
(with-qml-file ("qml/palindrome.qml")
|
||||
"import QtQuick 2.0"
|
||||
"import 'ext/'"
|
||||
(qml "Rectangle"
|
||||
"width: 527; height: 527"
|
||||
"color: 'black'"
|
||||
(let ((num 0))
|
||||
(mapc (lambda (char xy)
|
||||
(incf num)
|
||||
(qml "PalindromeImage"
|
||||
(format s "objectName: 'img~A'; source: 'img/~A.png'; x: ~D; y: ~D~%"
|
||||
num
|
||||
(image-of-char char)
|
||||
(* 31 (first xy))
|
||||
(* 31 (second xy)))))
|
||||
*chars* (first *move-to-positions*)))))
|
||||
379
examples/M-modules/quick/palindrome-2/lib/Makefile
Normal file
|
|
@ -0,0 +1,379 @@
|
|||
#############################################################################
|
||||
# Makefile for building: libqml_lisp.so
|
||||
# Generated by qmake (3.0) (Qt 5.5.1)
|
||||
# Project: qml_lisp.pro
|
||||
# Template: lib
|
||||
# Command: /usr/lib/x86_64-linux-gnu/qt5/bin/qmake -o Makefile qml_lisp.pro
|
||||
#############################################################################
|
||||
|
||||
MAKEFILE = Makefile
|
||||
|
||||
####### Compiler, tools and options
|
||||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
DEFINES = -DQT_NO_DEBUG -DQT_PLUGIN -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB
|
||||
CFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
|
||||
CXXFLAGS = -m64 -pipe -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES)
|
||||
INCPATH = -I. -I../../../../../src -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtQuick -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtQml -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -Itmp -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64
|
||||
QMAKE = /usr/lib/x86_64-linux-gnu/qt5/bin/qmake
|
||||
DEL_FILE = rm -f
|
||||
CHK_DIR_EXISTS= test -d
|
||||
MKDIR = mkdir -p
|
||||
COPY = cp -f
|
||||
COPY_FILE = cp -f
|
||||
COPY_DIR = cp -f -R
|
||||
INSTALL_FILE = install -m 644 -p
|
||||
INSTALL_PROGRAM = install -m 755 -p
|
||||
INSTALL_DIR = cp -f -R
|
||||
DEL_FILE = rm -f
|
||||
SYMLINK = ln -f -s
|
||||
DEL_DIR = rmdir
|
||||
MOVE = mv -f
|
||||
TAR = tar -cf
|
||||
COMPRESS = gzip -9f
|
||||
DISTNAME = qml_lisp1.0.0
|
||||
DISTDIR = /home/polos/eql5/examples/M-modules/quick/tmp/lib/tmp/qml_lisp1.0.0
|
||||
LINK = g++
|
||||
LFLAGS = -m64 -Wl,-O1 -shared
|
||||
LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -L../../../../.. -leql5 -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGL -lpthread
|
||||
AR = ar cqs
|
||||
RANLIB =
|
||||
SED = sed
|
||||
STRIP = strip
|
||||
|
||||
####### Output directory
|
||||
|
||||
OBJECTS_DIR = tmp/
|
||||
|
||||
####### Files
|
||||
|
||||
SOURCES = qml_lisp.cpp tmp/moc_qml_lisp.cpp
|
||||
OBJECTS = tmp/qml_lisp.o \
|
||||
tmp/moc_qml_lisp.o
|
||||
DIST = /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/sanitize.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_designer.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfs_device_lib_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_help.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_qml.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_qmltest.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_quick.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_quickwidgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uiplugin.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uitools.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webkit.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \
|
||||
/home/polos/eql5/src/windows.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \
|
||||
qml_lisp.pro qml_lisp.h qml_lisp.cpp
|
||||
QMAKE_TARGET = qml_lisp
|
||||
DESTDIR = #avoid trailing-slash linebreak
|
||||
TARGET = libqml_lisp.so
|
||||
TARGETD = libqml_lisp.so
|
||||
|
||||
|
||||
first: all
|
||||
####### Implicit rules
|
||||
|
||||
.SUFFIXES: .o .c .cpp .cc .cxx .C
|
||||
|
||||
.cpp.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
.cc.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
.cxx.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
.C.o:
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
|
||||
|
||||
####### Build rules
|
||||
|
||||
$(TARGET): $(OBJECTS) $(SUBLIBS) $(OBJCOMP)
|
||||
-$(DEL_FILE) $(TARGET)
|
||||
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP)
|
||||
|
||||
|
||||
|
||||
Makefile: qml_lisp.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf /usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/sanitize.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_designer.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfs_device_lib_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_help.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_qml.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_qmltest.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_quick.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_quickwidgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uiplugin.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uitools.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webkit.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf \
|
||||
/home/polos/eql5/src/windows.pri \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf \
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf \
|
||||
qml_lisp.pro \
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Quick.prl \
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Gui.prl \
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Qml.prl \
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Network.prl \
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Core.prl
|
||||
$(QMAKE) -o Makefile qml_lisp.pro
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_pre.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/unix.conf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/linux.conf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/sanitize.conf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base.conf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/gcc-base-unix.conf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-base.conf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/common/g++-unix.conf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/qconfig.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_concurrent_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_core_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dbus_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_designer.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_eglfs_device_lib_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_gui_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_help.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimedia.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_network_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_opengl_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_printsupport_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_qml.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_qmltest.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_quick.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_quickwidgets.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_sql_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_svg.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_testlib_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uiplugin.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uitools.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webkit.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_widgets_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xcb_qpa_lib_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_functions.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_config.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64/qmake.conf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/spec_post.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exclusive_builds.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_pre.prf:
|
||||
/home/polos/eql5/src/windows.pri:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resolve_config.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/default_post.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/warn_on.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/resources.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/moc.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/opengl.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/unix/thread.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/testcase_targets.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/exceptions.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/yacc.prf:
|
||||
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/lex.prf:
|
||||
qml_lisp.pro:
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Quick.prl:
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Gui.prl:
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Qml.prl:
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Network.prl:
|
||||
/usr/lib/x86_64-linux-gnu/libQt5Core.prl:
|
||||
qmake: FORCE
|
||||
@$(QMAKE) -o Makefile qml_lisp.pro
|
||||
|
||||
qmake_all: FORCE
|
||||
|
||||
|
||||
all: Makefile $(TARGET)
|
||||
|
||||
dist: distdir FORCE
|
||||
(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)
|
||||
|
||||
distdir: FORCE
|
||||
@test -d $(DISTDIR) || mkdir -p $(DISTDIR)
|
||||
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
|
||||
$(COPY_FILE) --parents qml_lisp.h $(DISTDIR)/
|
||||
$(COPY_FILE) --parents qml_lisp.cpp $(DISTDIR)/
|
||||
|
||||
|
||||
clean: compiler_clean
|
||||
-$(DEL_FILE) $(OBJECTS)
|
||||
-$(DEL_FILE) *~ core *.core
|
||||
|
||||
|
||||
distclean: clean
|
||||
-$(DEL_FILE) $(TARGET)
|
||||
-$(DEL_FILE) Makefile
|
||||
|
||||
|
||||
####### Sub-libraries
|
||||
|
||||
mocclean: compiler_moc_header_clean compiler_moc_source_clean
|
||||
|
||||
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
|
||||
|
||||
check: first
|
||||
|
||||
compiler_rcc_make_all:
|
||||
compiler_rcc_clean:
|
||||
compiler_moc_header_make_all: tmp/moc_qml_lisp.cpp
|
||||
compiler_moc_header_clean:
|
||||
-$(DEL_FILE) tmp/moc_qml_lisp.cpp
|
||||
tmp/moc_qml_lisp.cpp: qml_lisp.h
|
||||
/usr/lib/x86_64-linux-gnu/qt5/bin/moc $(DEFINES) -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I/home/polos/eql5/examples/M-modules/quick/tmp/lib -I/home/polos/eql5/src -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtQuick -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtQml -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/5 -I/usr/include/x86_64-linux-gnu/c++/5 -I/usr/include/c++/5/backward -I/usr/lib/gcc/x86_64-linux-gnu/5/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include qml_lisp.h -o tmp/moc_qml_lisp.cpp
|
||||
|
||||
compiler_moc_source_make_all:
|
||||
compiler_moc_source_clean:
|
||||
compiler_yacc_decl_make_all:
|
||||
compiler_yacc_decl_clean:
|
||||
compiler_yacc_impl_make_all:
|
||||
compiler_yacc_impl_clean:
|
||||
compiler_lex_make_all:
|
||||
compiler_lex_clean:
|
||||
compiler_clean: compiler_moc_header_clean
|
||||
|
||||
####### Compile
|
||||
|
||||
tmp/qml_lisp.o: qml_lisp.cpp qml_lisp.h \
|
||||
../../../../../src/eql_fun.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/qml_lisp.o qml_lisp.cpp
|
||||
|
||||
tmp/moc_qml_lisp.o: tmp/moc_qml_lisp.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o tmp/moc_qml_lisp.o tmp/moc_qml_lisp.cpp
|
||||
|
||||
####### Install
|
||||
|
||||
install: FORCE
|
||||
|
||||
uninstall: FORCE
|
||||
|
||||
FORCE:
|
||||
|
||||
BIN
examples/M-modules/quick/palindrome-2/lib/libqml_lisp.so
Executable file
108
examples/M-modules/quick/palindrome-2/lib/qml_lisp.cpp
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
#include "qml_lisp.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
static Lisp* lisp = 0;
|
||||
|
||||
static QObject* lisp_provider(QQmlEngine*, QJSEngine*) { return lisp; }
|
||||
|
||||
QObject* ini() {
|
||||
if(!lisp) {
|
||||
lisp = new Lisp;
|
||||
qmlRegisterSingletonType<Lisp>("EQL5", 1, 0, "Lisp", lisp_provider);
|
||||
qmlRegisterType<EQLPaintedItem>("EQL5", 1, 0, "PaintedItem"); }
|
||||
return lisp; }
|
||||
|
||||
static QQmlContext* rootContext() {
|
||||
QVariant var = eql_fun("qml:root-context", QMetaType::VoidStar);
|
||||
return Q_PTR(QQmlContext*, var); }
|
||||
|
||||
static QVariant qmlApply(QObject* caller, const QString& function, const QVariantList& arguments) {
|
||||
QVariant var =
|
||||
eql_fun("qml:qml-apply", QVariant::String,
|
||||
Q_ARG(QObject*, caller),
|
||||
Q_ARG(QString, function),
|
||||
Q_ARG(QVariantList, arguments));
|
||||
QString str(var.toString());
|
||||
if(str.startsWith("#<>")) { // prepared in Lisp for JS eval
|
||||
QQmlExpression exp(rootContext(), caller, str.mid(3));
|
||||
return exp.evaluate(); }
|
||||
return var; }
|
||||
|
||||
QVariant Lisp::call(const QJSValue& caller_or_function, const QJSValue& function_or_arg0,
|
||||
const QJSValue& arg1,
|
||||
const QJSValue& arg2,
|
||||
const QJSValue& arg3,
|
||||
const QJSValue& arg4,
|
||||
const QJSValue& arg5,
|
||||
const QJSValue& arg6,
|
||||
const QJSValue& arg7,
|
||||
const QJSValue& arg8,
|
||||
const QJSValue& arg9,
|
||||
const QJSValue& arg10,
|
||||
const QJSValue& arg11,
|
||||
const QJSValue& arg12,
|
||||
const QJSValue& arg13,
|
||||
const QJSValue& arg14,
|
||||
const QJSValue& arg15,
|
||||
const QJSValue& arg16) {
|
||||
QObject* caller = 0;
|
||||
QString function;
|
||||
QVariantList arguments;
|
||||
if(caller_or_function.isQObject()) {
|
||||
caller = caller_or_function.toQObject();
|
||||
function = function_or_arg0.toString(); }
|
||||
else if(caller_or_function.isString()) {
|
||||
function = caller_or_function.toString();
|
||||
if(!function_or_arg0.isUndefined()) {
|
||||
arguments << function_or_arg0.toVariant(); }}
|
||||
if(!arg1.isUndefined()) {
|
||||
arguments << arg1.toVariant();
|
||||
if(!arg2.isUndefined()) {
|
||||
arguments << arg2.toVariant();
|
||||
if(!arg3.isUndefined()) {
|
||||
arguments << arg3.toVariant();
|
||||
if(!arg4.isUndefined()) {
|
||||
arguments << arg4.toVariant();
|
||||
if(!arg5.isUndefined()) {
|
||||
arguments << arg5.toVariant();
|
||||
if(!arg6.isUndefined()) {
|
||||
arguments << arg6.toVariant();
|
||||
if(!arg7.isUndefined()) {
|
||||
arguments << arg7.toVariant();
|
||||
if(!arg8.isUndefined()) {
|
||||
arguments << arg8.toVariant();
|
||||
if(!arg9.isUndefined()) {
|
||||
arguments << arg9.toVariant();
|
||||
if(!arg10.isUndefined()) {
|
||||
arguments << arg10.toVariant();
|
||||
if(!arg11.isUndefined()) {
|
||||
arguments << arg11.toVariant();
|
||||
if(!arg12.isUndefined()) {
|
||||
arguments << arg12.toVariant();
|
||||
if(!arg13.isUndefined()) {
|
||||
arguments << arg13.toVariant();
|
||||
if(!arg14.isUndefined()) {
|
||||
arguments << arg14.toVariant();
|
||||
if(!arg15.isUndefined()) {
|
||||
arguments << arg15.toVariant();
|
||||
if(!arg16.isUndefined()) {
|
||||
arguments << arg16.toVariant(); }}}}}}}}}}}}}}}}
|
||||
return qmlApply(caller, function, arguments); }
|
||||
|
||||
QVariant Lisp::apply(const QJSValue& caller_or_function,
|
||||
const QJSValue& function_or_arguments,
|
||||
const QJSValue& arguments_or_undefined) {
|
||||
QObject* caller = 0;
|
||||
QString function;
|
||||
QVariantList arguments;
|
||||
if(caller_or_function.isQObject()) {
|
||||
caller = caller_or_function.toQObject();
|
||||
function = function_or_arguments.toString();
|
||||
arguments = arguments_or_undefined.toVariant().value<QVariantList>(); }
|
||||
else if(caller_or_function.isString()) {
|
||||
function = caller_or_function.toString();
|
||||
arguments = function_or_arguments.toVariant().value<QVariantList>(); }
|
||||
return qmlApply(caller, function, arguments); }
|
||||
|
||||
QT_END_NAMESPACE
|
||||
60
examples/M-modules/quick/palindrome-2/lib/qml_lisp.h
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
#ifndef LIB_H
|
||||
#define LIB_H
|
||||
|
||||
#include <QtQml>
|
||||
#include <QQuickPaintedItem>
|
||||
#include <eql_fun.h>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#define LIB_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define LIB_EXPORT
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
extern "C" { LIB_EXPORT QObject* ini(); }
|
||||
|
||||
class Lisp : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_INVOKABLE QVariant call(const QJSValue&,
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue());
|
||||
|
||||
Q_INVOKABLE QVariant apply(const QJSValue&,
|
||||
const QJSValue& = QJSValue(),
|
||||
const QJSValue& = QJSValue());
|
||||
};
|
||||
|
||||
class EQLPaintedItem : public QQuickPaintedItem {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
EQLPaintedItem(QQuickItem* parent = 0) : QQuickPaintedItem(parent) {}
|
||||
|
||||
void paint(QPainter* painter) {
|
||||
eql_fun("qml:paint",
|
||||
Q_ARG(QQuickPaintedItem*, this),
|
||||
Q_ARG(QPainter*, painter)); }
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif
|
||||
15
examples/M-modules/quick/palindrome-2/lib/qml_lisp.pro
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
QT += qml quick
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin release
|
||||
INCLUDEPATH += ../../../../../src
|
||||
LIBS += -L../../../../.. -leql5
|
||||
DESTDIR = ./
|
||||
TARGET = qml_lisp
|
||||
OBJECTS_DIR = ./tmp/
|
||||
MOC_DIR = ./tmp/
|
||||
|
||||
include(../../../../../src/windows.pri)
|
||||
|
||||
HEADERS += qml_lisp.h
|
||||
SOURCES += qml_lisp.cpp
|
||||
|
||||
568
examples/M-modules/quick/palindrome-2/lib/tmp/moc_qml_lisp.cpp
Normal file
|
|
@ -0,0 +1,568 @@
|
|||
/****************************************************************************
|
||||
** Meta object code from reading C++ file 'qml_lisp.h'
|
||||
**
|
||||
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.5.1)
|
||||
**
|
||||
** WARNING! All changes made in this file will be lost!
|
||||
*****************************************************************************/
|
||||
|
||||
#include "../qml_lisp.h"
|
||||
#include <QtCore/qbytearray.h>
|
||||
#include <QtCore/qmetatype.h>
|
||||
#if !defined(Q_MOC_OUTPUT_REVISION)
|
||||
#error "The header file 'qml_lisp.h' doesn't include <QObject>."
|
||||
#elif Q_MOC_OUTPUT_REVISION != 67
|
||||
#error "This file was generated using the moc from 5.5.1. It"
|
||||
#error "cannot be used with the include files from this version of Qt."
|
||||
#error "(The moc has changed too much.)"
|
||||
#endif
|
||||
|
||||
QT_BEGIN_MOC_NAMESPACE
|
||||
struct qt_meta_stringdata_Lisp_t {
|
||||
QByteArrayData data[5];
|
||||
char stringdata0[26];
|
||||
};
|
||||
#define QT_MOC_LITERAL(idx, ofs, len) \
|
||||
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
|
||||
qptrdiff(offsetof(qt_meta_stringdata_Lisp_t, stringdata0) + ofs \
|
||||
- idx * sizeof(QByteArrayData)) \
|
||||
)
|
||||
static const qt_meta_stringdata_Lisp_t qt_meta_stringdata_Lisp = {
|
||||
{
|
||||
QT_MOC_LITERAL(0, 0, 4), // "Lisp"
|
||||
QT_MOC_LITERAL(1, 5, 4), // "call"
|
||||
QT_MOC_LITERAL(2, 10, 0), // ""
|
||||
QT_MOC_LITERAL(3, 11, 8), // "QJSValue"
|
||||
QT_MOC_LITERAL(4, 20, 5) // "apply"
|
||||
|
||||
},
|
||||
"Lisp\0call\0\0QJSValue\0apply"
|
||||
};
|
||||
#undef QT_MOC_LITERAL
|
||||
|
||||
static const uint qt_meta_data_Lisp[] = {
|
||||
|
||||
// content:
|
||||
7, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
21, 14, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
// methods: name, argc, parameters, tag, flags
|
||||
1, 18, 119, 2, 0x02 /* Public */,
|
||||
1, 17, 156, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 16, 191, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 15, 224, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 14, 255, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 13, 284, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 12, 311, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 11, 336, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 10, 359, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 9, 380, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 8, 399, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 7, 416, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 6, 431, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 5, 444, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 4, 455, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 3, 464, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 2, 471, 2, 0x22 /* Public | MethodCloned */,
|
||||
1, 1, 476, 2, 0x22 /* Public | MethodCloned */,
|
||||
4, 3, 479, 2, 0x02 /* Public */,
|
||||
4, 2, 486, 2, 0x22 /* Public | MethodCloned */,
|
||||
4, 1, 491, 2, 0x22 /* Public | MethodCloned */,
|
||||
|
||||
// methods: parameters
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 0x80000000 | 3, 2, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 0x80000000 | 3, 2, 2,
|
||||
QMetaType::QVariant, 0x80000000 | 3, 2,
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
void Lisp::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
Lisp *_t = static_cast<Lisp *>(_o);
|
||||
Q_UNUSED(_t)
|
||||
switch (_id) {
|
||||
case 0: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])),(*reinterpret_cast< const QJSValue(*)>(_a[10])),(*reinterpret_cast< const QJSValue(*)>(_a[11])),(*reinterpret_cast< const QJSValue(*)>(_a[12])),(*reinterpret_cast< const QJSValue(*)>(_a[13])),(*reinterpret_cast< const QJSValue(*)>(_a[14])),(*reinterpret_cast< const QJSValue(*)>(_a[15])),(*reinterpret_cast< const QJSValue(*)>(_a[16])),(*reinterpret_cast< const QJSValue(*)>(_a[17])),(*reinterpret_cast< const QJSValue(*)>(_a[18])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 1: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])),(*reinterpret_cast< const QJSValue(*)>(_a[10])),(*reinterpret_cast< const QJSValue(*)>(_a[11])),(*reinterpret_cast< const QJSValue(*)>(_a[12])),(*reinterpret_cast< const QJSValue(*)>(_a[13])),(*reinterpret_cast< const QJSValue(*)>(_a[14])),(*reinterpret_cast< const QJSValue(*)>(_a[15])),(*reinterpret_cast< const QJSValue(*)>(_a[16])),(*reinterpret_cast< const QJSValue(*)>(_a[17])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 2: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])),(*reinterpret_cast< const QJSValue(*)>(_a[10])),(*reinterpret_cast< const QJSValue(*)>(_a[11])),(*reinterpret_cast< const QJSValue(*)>(_a[12])),(*reinterpret_cast< const QJSValue(*)>(_a[13])),(*reinterpret_cast< const QJSValue(*)>(_a[14])),(*reinterpret_cast< const QJSValue(*)>(_a[15])),(*reinterpret_cast< const QJSValue(*)>(_a[16])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 3: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])),(*reinterpret_cast< const QJSValue(*)>(_a[10])),(*reinterpret_cast< const QJSValue(*)>(_a[11])),(*reinterpret_cast< const QJSValue(*)>(_a[12])),(*reinterpret_cast< const QJSValue(*)>(_a[13])),(*reinterpret_cast< const QJSValue(*)>(_a[14])),(*reinterpret_cast< const QJSValue(*)>(_a[15])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 4: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])),(*reinterpret_cast< const QJSValue(*)>(_a[10])),(*reinterpret_cast< const QJSValue(*)>(_a[11])),(*reinterpret_cast< const QJSValue(*)>(_a[12])),(*reinterpret_cast< const QJSValue(*)>(_a[13])),(*reinterpret_cast< const QJSValue(*)>(_a[14])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 5: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])),(*reinterpret_cast< const QJSValue(*)>(_a[10])),(*reinterpret_cast< const QJSValue(*)>(_a[11])),(*reinterpret_cast< const QJSValue(*)>(_a[12])),(*reinterpret_cast< const QJSValue(*)>(_a[13])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 6: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])),(*reinterpret_cast< const QJSValue(*)>(_a[10])),(*reinterpret_cast< const QJSValue(*)>(_a[11])),(*reinterpret_cast< const QJSValue(*)>(_a[12])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 7: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])),(*reinterpret_cast< const QJSValue(*)>(_a[10])),(*reinterpret_cast< const QJSValue(*)>(_a[11])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 8: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])),(*reinterpret_cast< const QJSValue(*)>(_a[10])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 9: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])),(*reinterpret_cast< const QJSValue(*)>(_a[9])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 10: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])),(*reinterpret_cast< const QJSValue(*)>(_a[8])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 11: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])),(*reinterpret_cast< const QJSValue(*)>(_a[7])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 12: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])),(*reinterpret_cast< const QJSValue(*)>(_a[6])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 13: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])),(*reinterpret_cast< const QJSValue(*)>(_a[5])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 14: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])),(*reinterpret_cast< const QJSValue(*)>(_a[4])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 15: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 16: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 17: { QVariant _r = _t->call((*reinterpret_cast< const QJSValue(*)>(_a[1])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 18: { QVariant _r = _t->apply((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])),(*reinterpret_cast< const QJSValue(*)>(_a[3])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 19: { QVariant _r = _t->apply((*reinterpret_cast< const QJSValue(*)>(_a[1])),(*reinterpret_cast< const QJSValue(*)>(_a[2])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
case 20: { QVariant _r = _t->apply((*reinterpret_cast< const QJSValue(*)>(_a[1])));
|
||||
if (_a[0]) *reinterpret_cast< QVariant*>(_a[0]) = _r; } break;
|
||||
default: ;
|
||||
}
|
||||
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||
switch (_id) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 0:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 17:
|
||||
case 16:
|
||||
case 15:
|
||||
case 14:
|
||||
case 13:
|
||||
case 12:
|
||||
case 11:
|
||||
case 10:
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 16:
|
||||
case 15:
|
||||
case 14:
|
||||
case 13:
|
||||
case 12:
|
||||
case 11:
|
||||
case 10:
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 15:
|
||||
case 14:
|
||||
case 13:
|
||||
case 12:
|
||||
case 11:
|
||||
case 10:
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 14:
|
||||
case 13:
|
||||
case 12:
|
||||
case 11:
|
||||
case 10:
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 13:
|
||||
case 12:
|
||||
case 11:
|
||||
case 10:
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 12:
|
||||
case 11:
|
||||
case 10:
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 11:
|
||||
case 10:
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 10:
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 9:
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 8:
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 7:
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 5:
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 4:
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 3:
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 15:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 16:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 17:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 2:
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 19:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 1:
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
case 20:
|
||||
switch (*reinterpret_cast<int*>(_a[1])) {
|
||||
default: *reinterpret_cast<int*>(_a[0]) = -1; break;
|
||||
case 0:
|
||||
*reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< QJSValue >(); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const QMetaObject Lisp::staticMetaObject = {
|
||||
{ &QObject::staticMetaObject, qt_meta_stringdata_Lisp.data,
|
||||
qt_meta_data_Lisp, qt_static_metacall, Q_NULLPTR, Q_NULLPTR}
|
||||
};
|
||||
|
||||
|
||||
const QMetaObject *Lisp::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *Lisp::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return Q_NULLPTR;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_Lisp.stringdata0))
|
||||
return static_cast<void*>(const_cast< Lisp*>(this));
|
||||
return QObject::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int Lisp::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QObject::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
if (_c == QMetaObject::InvokeMetaMethod) {
|
||||
if (_id < 21)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 21;
|
||||
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
|
||||
if (_id < 21)
|
||||
qt_static_metacall(this, _c, _id, _a);
|
||||
_id -= 21;
|
||||
}
|
||||
return _id;
|
||||
}
|
||||
struct qt_meta_stringdata_EQLPaintedItem_t {
|
||||
QByteArrayData data[1];
|
||||
char stringdata0[15];
|
||||
};
|
||||
#define QT_MOC_LITERAL(idx, ofs, len) \
|
||||
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
|
||||
qptrdiff(offsetof(qt_meta_stringdata_EQLPaintedItem_t, stringdata0) + ofs \
|
||||
- idx * sizeof(QByteArrayData)) \
|
||||
)
|
||||
static const qt_meta_stringdata_EQLPaintedItem_t qt_meta_stringdata_EQLPaintedItem = {
|
||||
{
|
||||
QT_MOC_LITERAL(0, 0, 14) // "EQLPaintedItem"
|
||||
|
||||
},
|
||||
"EQLPaintedItem"
|
||||
};
|
||||
#undef QT_MOC_LITERAL
|
||||
|
||||
static const uint qt_meta_data_EQLPaintedItem[] = {
|
||||
|
||||
// content:
|
||||
7, // revision
|
||||
0, // classname
|
||||
0, 0, // classinfo
|
||||
0, 0, // methods
|
||||
0, 0, // properties
|
||||
0, 0, // enums/sets
|
||||
0, 0, // constructors
|
||||
0, // flags
|
||||
0, // signalCount
|
||||
|
||||
0 // eod
|
||||
};
|
||||
|
||||
void EQLPaintedItem::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
Q_UNUSED(_o);
|
||||
Q_UNUSED(_id);
|
||||
Q_UNUSED(_c);
|
||||
Q_UNUSED(_a);
|
||||
}
|
||||
|
||||
const QMetaObject EQLPaintedItem::staticMetaObject = {
|
||||
{ &QQuickPaintedItem::staticMetaObject, qt_meta_stringdata_EQLPaintedItem.data,
|
||||
qt_meta_data_EQLPaintedItem, qt_static_metacall, Q_NULLPTR, Q_NULLPTR}
|
||||
};
|
||||
|
||||
|
||||
const QMetaObject *EQLPaintedItem::metaObject() const
|
||||
{
|
||||
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
|
||||
}
|
||||
|
||||
void *EQLPaintedItem::qt_metacast(const char *_clname)
|
||||
{
|
||||
if (!_clname) return Q_NULLPTR;
|
||||
if (!strcmp(_clname, qt_meta_stringdata_EQLPaintedItem.stringdata0))
|
||||
return static_cast<void*>(const_cast< EQLPaintedItem*>(this));
|
||||
return QQuickPaintedItem::qt_metacast(_clname);
|
||||
}
|
||||
|
||||
int EQLPaintedItem::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
|
||||
{
|
||||
_id = QQuickPaintedItem::qt_metacall(_c, _id, _a);
|
||||
if (_id < 0)
|
||||
return _id;
|
||||
return _id;
|
||||
}
|
||||
QT_END_MOC_NAMESPACE
|
||||
BIN
examples/M-modules/quick/palindrome-2/lib/tmp/moc_qml_lisp.o
Normal file
BIN
examples/M-modules/quick/palindrome-2/lib/tmp/qml_lisp.o
Normal file
36
examples/M-modules/quick/palindrome-2/palindrome.lisp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
;;; palindrome
|
||||
|
||||
#-qt-wrapper-functions ; see README-OPTIONAL.txt
|
||||
(load (in-home "src/lisp/all-wrappers"))
|
||||
|
||||
(qrequire :quick)
|
||||
|
||||
(require :qml-lisp "qml-lisp")
|
||||
(require :properties "properties")
|
||||
(require :utils "utils")
|
||||
|
||||
(use-package :qml)
|
||||
|
||||
(defvar *timer* (qnew "QTimer"))
|
||||
|
||||
(defun run-animation ()
|
||||
(dolist (move-to (rest *move-to-positions*))
|
||||
(let ((target 0))
|
||||
(dolist (xy move-to)
|
||||
(incf target)
|
||||
(let ((img (find-quick-item (format nil "img~D" target))))
|
||||
(qml-set img "x" (* 31 (first xy)))
|
||||
(qml-set img "y" (* 31 (second xy)))
|
||||
(qsleep 0.03)))) ; delay between item start (in sec)
|
||||
(qsleep 4)) ; duration of animation + pause (in sec)
|
||||
(qsingle-shot 500 'run-animation)) ; pause (in msec)
|
||||
|
||||
(defun run ()
|
||||
(setf qml:*quick-view* (qnew "QQuickView"))
|
||||
(x:do-with qml:*quick-view*
|
||||
(|setSource| (|fromLocalFile.QUrl| "qml/palindrome.qml"))
|
||||
(|setResizeMode| |QQuickView.SizeRootObjectToView|)
|
||||
(|show|))
|
||||
(qlater 'run-animation)) ; don't block REPL (for eql5 -qtpl)
|
||||
|
||||
(run)
|
||||
14
examples/M-modules/quick/palindrome-2/properties.lisp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
;;; properties dialog
|
||||
|
||||
(defun sym (name package)
|
||||
(find-symbol (symbol-name name) package))
|
||||
|
||||
(defun show-properties-dialog (&optional item)
|
||||
"Lists all instance properties of a QML item (either a QQuickItem or an 'objectName'). If no item is passed, QML:*CALLER* will be used."
|
||||
(unless (find-package :properties)
|
||||
(load (in-home "gui/properties")))
|
||||
(funcall (sym :show :properties)
|
||||
(or (if (stringp item)
|
||||
(qml:find-quick-item item)
|
||||
item)
|
||||
qml:*caller*)))
|
||||
148
examples/M-modules/quick/palindrome-2/qml-lisp.lisp
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
;;;
|
||||
;;; * enables QML to call Lisp functions
|
||||
;;; * allows to get/set any QML property from Lisp (needs 'objectName' to be set)
|
||||
;;; * allows to evaluate JS code from Lisp (needs 'objectName' to be set)
|
||||
;;;
|
||||
;;; (requires a C++ plugin, see "lib/")
|
||||
|
||||
(defpackage :qml-lisp
|
||||
(:use :common-lisp :eql)
|
||||
(:nicknames :qml)
|
||||
(:export
|
||||
#:*quick-view*
|
||||
#:*caller*
|
||||
#:children
|
||||
#:find-quick-item
|
||||
#:js
|
||||
#:qml-get
|
||||
#:qml-set
|
||||
#:paint
|
||||
#:reload
|
||||
#:root-context
|
||||
#:root-item))
|
||||
|
||||
(provide :qml-lisp)
|
||||
|
||||
(in-package :qml-lisp)
|
||||
|
||||
(defvar *qml-lisp* (qload-c++ "lib/qml_lisp"))
|
||||
(defvar *caller* nil)
|
||||
(defvar *quick-view* nil)
|
||||
|
||||
(defun string-to-symbol (name)
|
||||
(let ((upper (string-upcase name))
|
||||
(p (position #\: name)))
|
||||
(if p
|
||||
(find-symbol (subseq upper (1+ (position #\: name :from-end t)))
|
||||
(subseq upper 0 p))
|
||||
(find-symbol upper))))
|
||||
|
||||
;;; function calls from QML
|
||||
|
||||
(defun print-js-readably (object)
|
||||
"Prints (nested) lists, vectors, T, NIL, floats in JS notation, which will be passed to JS 'eval()'."
|
||||
(if (and (not (stringp object))
|
||||
(vectorp object))
|
||||
(print-js-readably (coerce object 'list))
|
||||
(typecase object
|
||||
(cons
|
||||
(write-char #\[)
|
||||
(do ((list object (rest list)))
|
||||
((null list) (write-char #\]))
|
||||
(print-js-readably (first list))
|
||||
(when (rest list)
|
||||
(write-char #\,))))
|
||||
(float
|
||||
;; cut off Lisp specific notations
|
||||
(princ (string-right-trim "dl0" (princ-to-string object))))
|
||||
(t
|
||||
(cond ((eql 't object)
|
||||
(princ "true"))
|
||||
((eql 'nil object)
|
||||
(princ "false"))
|
||||
(t
|
||||
(prin1 object)))))))
|
||||
|
||||
(defun print-to-js-string (object)
|
||||
(with-output-to-string (*standard-output*)
|
||||
(princ "#<>") ; mark for passing to JS "eval()"
|
||||
(print-js-readably object)))
|
||||
|
||||
(defun qml-apply (caller function arguments)
|
||||
"Every 'Lisp.call()' or 'Lisp.apply()' function call in QML will call this function. The variable *CALLER* will be bound to the calling QQuickItem, if passed with 'this' as first argument to 'Lisp.call()' / 'Lisp.apply()'."
|
||||
(let* ((*caller* (if (qnull caller) *caller* (qt-object-? caller)))
|
||||
(object (apply (string-to-symbol function)
|
||||
arguments)))
|
||||
(if (stringp object)
|
||||
object
|
||||
(print-to-js-string object))))
|
||||
|
||||
;;; utils
|
||||
|
||||
(defun root-item ()
|
||||
(when *quick-view*
|
||||
(qt-object-? (|rootObject| *quick-view*))))
|
||||
|
||||
(defun root-context ()
|
||||
(when *quick-view*
|
||||
(|rootContext| *quick-view*)))
|
||||
|
||||
(defun find-quick-item (object-name)
|
||||
"Finds the first QQuickItem matching OBJECT-NAME."
|
||||
(if (string= (|objectName| (root-item)) object-name)
|
||||
(root-item)
|
||||
(qt-object-? (qfind-child (root-item) object-name))))
|
||||
|
||||
(defun quick-item (item/name)
|
||||
(cond ((stringp item/name)
|
||||
(find-quick-item item/name))
|
||||
((qt-object-p item/name)
|
||||
item/name)
|
||||
((not item/name)
|
||||
(root-item))))
|
||||
|
||||
(defun children (item/name)
|
||||
"Like QML function 'children'."
|
||||
(mapcar 'qt-object-? (|childItems| (quick-item item/name))))
|
||||
|
||||
(defun reload ()
|
||||
"Force reloading of QML file after changes made to it."
|
||||
(|clearComponentCache| (|engine| *quick-view*))
|
||||
(|setSource| *quick-view* (|source| *quick-view*)))
|
||||
|
||||
;;; get/set QQmlProperty
|
||||
|
||||
(defun qml-get (item/name property-name)
|
||||
"Gets QQmlProperty of either ITEM or first object matching NAME."
|
||||
(qlet ((property "QQmlProperty(QObject*,QString)"
|
||||
(quick-item item/name)
|
||||
property-name))
|
||||
(if (|isValid| property)
|
||||
(qlet ((variant (|read| property)))
|
||||
(values (qvariant-value variant)
|
||||
t))
|
||||
(eql::%error-msg "QML-GET" (list item/name property-name)))))
|
||||
|
||||
(defun qml-set (item/name property-name value &optional update)
|
||||
"Sets QQmlProperty of either ITEM, or first object matching NAME. Returns T on success. If UPDATE is not NIL and ITEM is a QQuickPaintedItem, |update| will be called on it."
|
||||
(let ((item (quick-item item/name)))
|
||||
(qlet ((property "QQmlProperty(QObject*,QString)" item property-name))
|
||||
(if (|isValid| property)
|
||||
(qlet ((variant (qvariant-from-value value (|propertyTypeName| property))))
|
||||
(prog1
|
||||
(|write| property variant)
|
||||
(when (and update (= (qt-object-id item) #.(qid "QQuickPaintedItem")))
|
||||
(|update| item))))
|
||||
(eql::%error-msg "QML-SET" (list item/name property-name value))))))
|
||||
|
||||
;;; JS
|
||||
|
||||
(defun js (item/name js-format-string &rest arguments)
|
||||
"Evaluates a JS string, with 'this' bound to either ITEM, or first object matching NAME. Arguments are passed through FORMAT."
|
||||
(qlet ((qml-exp "QQmlExpression(QQmlContext*,QObject*,QString)"
|
||||
(root-context)
|
||||
(quick-item item/name)
|
||||
(apply 'format nil js-format-string arguments))
|
||||
(variant (|evaluate| qml-exp)))
|
||||
(qvariant-value variant)))
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
import QtQuick 2.0
|
||||
|
||||
Image {
|
||||
Behavior on x { NumberAnimation { duration: 3000; easing.type: Easing.InOutSine } }
|
||||
Behavior on y { NumberAnimation { duration: 3000; easing.type: Easing.InOutSine } }
|
||||
}
|
||||
|
||||
BIN
examples/M-modules/quick/palindrome-2/qml/img/A.png
Normal file
|
After Width: | Height: | Size: 576 B |
BIN
examples/M-modules/quick/palindrome-2/qml/img/E.png
Normal file
|
After Width: | Height: | Size: 271 B |
BIN
examples/M-modules/quick/palindrome-2/qml/img/N.png
Normal file
|
After Width: | Height: | Size: 400 B |
BIN
examples/M-modules/quick/palindrome-2/qml/img/O.png
Normal file
|
After Width: | Height: | Size: 717 B |
BIN
examples/M-modules/quick/palindrome-2/qml/img/P.png
Normal file
|
After Width: | Height: | Size: 464 B |
BIN
examples/M-modules/quick/palindrome-2/qml/img/R.png
Normal file
|
After Width: | Height: | Size: 551 B |
BIN
examples/M-modules/quick/palindrome-2/qml/img/S.png
Normal file
|
After Width: | Height: | Size: 633 B |
BIN
examples/M-modules/quick/palindrome-2/qml/img/T.png
Normal file
|
After Width: | Height: | Size: 233 B |
109
examples/M-modules/quick/palindrome-2/qml/palindrome.qml
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
// THIS FILE IS GENERATED
|
||||
|
||||
import QtQuick 2.0
|
||||
import 'ext/'
|
||||
|
||||
Rectangle {
|
||||
width: 527; height: 527
|
||||
color: 'black'
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img1'; source: 'img/R.png'; x: 186; y: 186
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img2'; source: 'img/O.png'; x: 217; y: 186
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img3'; source: 'img/T.png'; x: 248; y: 186
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img4'; source: 'img/A.png'; x: 279; y: 186
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img5'; source: 'img/S.png'; x: 310; y: 186
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img6'; source: 'img/O.png'; x: 186; y: 217
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img7'; source: 'img/P.png'; x: 217; y: 217
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img8'; source: 'img/E.png'; x: 248; y: 217
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img9'; source: 'img/R.png'; x: 279; y: 217
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img10'; source: 'img/A.png'; x: 310; y: 217
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img11'; source: 'img/T.png'; x: 186; y: 248
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img12'; source: 'img/E.png'; x: 217; y: 248
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img13'; source: 'img/N.png'; x: 248; y: 248
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img14'; source: 'img/E.png'; x: 279; y: 248
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img15'; source: 'img/T.png'; x: 310; y: 248
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img16'; source: 'img/A.png'; x: 186; y: 279
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img17'; source: 'img/R.png'; x: 217; y: 279
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img18'; source: 'img/E.png'; x: 248; y: 279
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img19'; source: 'img/P.png'; x: 279; y: 279
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img20'; source: 'img/O.png'; x: 310; y: 279
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img21'; source: 'img/S.png'; x: 186; y: 310
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img22'; source: 'img/A.png'; x: 217; y: 310
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img23'; source: 'img/T.png'; x: 248; y: 310
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img24'; source: 'img/O.png'; x: 279; y: 310
|
||||
}
|
||||
|
||||
PalindromeImage {
|
||||
objectName: 'img25'; source: 'img/R.png'; x: 310; y: 310
|
||||
}
|
||||
}
|
||||
32
examples/M-modules/quick/palindrome-2/utils.lisp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
;;; utils for palindrome
|
||||
|
||||
(require :definitions "definitions")
|
||||
|
||||
(defun item-count ()
|
||||
(loop :for item :in *items*
|
||||
:sum (length (second item))))
|
||||
|
||||
(defvar *chars* (loop :for i :below (item-count) :collect (code-char (+ i #.(char-code #\a)))))
|
||||
|
||||
(defun image-of-char (char)
|
||||
(dolist (item *items*)
|
||||
(x:when-it (find char (second item))
|
||||
(return-from image-of-char (first item)))))
|
||||
|
||||
(defun compute-move-to-positions ()
|
||||
(flet ((item-pos (char list)
|
||||
(let ((y 0))
|
||||
(dolist (state list)
|
||||
(incf y)
|
||||
(x:when-it (position char state)
|
||||
(return-from item-pos (list (1+ x:it) y)))))))
|
||||
(let (states)
|
||||
(dolist (state *states*)
|
||||
(let (positions)
|
||||
(dolist (char *chars*)
|
||||
(push (item-pos char state)
|
||||
positions))
|
||||
(push (nreverse positions) states)))
|
||||
(nreverse states))))
|
||||
|
||||
(defvar *move-to-positions* (compute-move-to-positions))
|
||||