mirror of
https://gitlab.com/eql/EQL5.git
synced 2026-02-02 05:43:54 -08:00
better "connection" handling to Lisp functions; make disconnect work properly; some revisions;
This commit is contained in:
parent
09e0f53f28
commit
7b03ef56fd
25 changed files with 246 additions and 138 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>VideoSettingsUi</class>
|
||||
<class>dialog</class>
|
||||
<widget class="QDialog" name="dialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>543</width>
|
||||
<height>250</height>
|
||||
<height>251</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="grid_layout_3">
|
||||
|
|
@ -67,6 +67,12 @@
|
|||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSlider" name="audio_quality_slider">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>4</number>
|
||||
</property>
|
||||
|
|
@ -123,6 +129,12 @@
|
|||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QSlider" name="video_quality_slider">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>4</number>
|
||||
</property>
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
(qfun *scroll-area* "setWidgetResizable" t)
|
||||
(setf *scroll-area-widget-contents* (qnew "QWidget"))
|
||||
(qfun *scroll-area-widget-contents* "setObjectName" "scroll_area_widget_contents")
|
||||
(qfun *scroll-area-widget-contents* "setGeometry" 0 0 543 250)
|
||||
(qfun *scroll-area-widget-contents* "setGeometry" 0 0 543 251)
|
||||
(setf *grid-layout-3* (qnew "QGridLayout(QWidget*)" *scroll-area-widget-contents*))
|
||||
(qfun *grid-layout-3* "setObjectName" "grid_layout_3")
|
||||
(setf *group-box* (qnew "QGroupBox(QWidget*)" *scroll-area-widget-contents*))
|
||||
|
|
@ -98,6 +98,7 @@
|
|||
(qfun *grid-layout* "addWidget" *label-3* 4 0 1 1)
|
||||
(setf *audio-quality-slider* (qnew "QSlider(QWidget*)" *group-box*))
|
||||
(qfun *audio-quality-slider* "setObjectName" "audio_quality_slider")
|
||||
(qfun *audio-quality-slider* "setMinimumSize" 100 0)
|
||||
(qfun *audio-quality-slider* "setMaximum" 4)
|
||||
(qfun *audio-quality-slider* "setOrientation" |Qt.Horizontal|)
|
||||
(qfun *grid-layout* "addWidget" *audio-quality-slider* 4 1 1 1)
|
||||
|
|
@ -129,6 +130,7 @@
|
|||
(qfun *grid-layout-2* "addWidget" *label-7* 6 0 1 1)
|
||||
(setf *video-quality-slider* (qnew "QSlider(QWidget*)" *groupbox-2*))
|
||||
(qfun *video-quality-slider* "setObjectName" "video_quality_slider")
|
||||
(qfun *video-quality-slider* "setMinimumSize" 100 0)
|
||||
(qfun *video-quality-slider* "setMaximum" 4)
|
||||
(qfun *video-quality-slider* "setOrientation" |Qt.Horizontal|)
|
||||
(qfun *grid-layout-2* "addWidget" *video-quality-slider* 6 1 1 1)
|
||||
|
|
|
|||
|
|
@ -121,6 +121,11 @@
|
|||
|
||||
;;; UI
|
||||
|
||||
(defmacro connect-clicked (&rest args)
|
||||
`(progn
|
||||
,@(loop :for arg :in args :collect
|
||||
`(qconnect ,arg "clicked()" ',(intern (string-upcase (format nil "~A-clicked" arg)))))))
|
||||
|
||||
(defun run ()
|
||||
(flet ((b ()
|
||||
(qnew "QToolButton"
|
||||
|
|
@ -185,12 +190,7 @@
|
|||
(qconnect (svref digits n) "clicked()" 'digit-clicked))
|
||||
(dolist (w (list plus minus multiply divide))
|
||||
(qconnect w "clicked()" 'operation-clicked))
|
||||
;; the following lines are crying for a macro like:
|
||||
;; (connect-clicked (list clear back sign point reci words equal))
|
||||
(mapc (lambda (w fun)
|
||||
(qconnect w "clicked()" fun))
|
||||
(list clear back sign point reci words equal)
|
||||
(list 'clear-clicked 'back-clicked 'sign-clicked 'point-clicked 'reci-clicked 'words-clicked 'equal-clicked))
|
||||
(connect-clicked clear back sign point reci words equal) ; see macro above
|
||||
(clear-display)
|
||||
(|setFocus| *real*)
|
||||
(x:do-with *main* |show| |raise|))))
|
||||
|
|
|
|||
|
|
@ -1123,9 +1123,17 @@
|
|||
"float"
|
||||
"int"
|
||||
"long"
|
||||
"qint32"
|
||||
"qint64"
|
||||
"quint8"
|
||||
"quint16"
|
||||
"quint32"
|
||||
"quint64"
|
||||
"qlonglong"
|
||||
"qreal"
|
||||
"qulonglong"
|
||||
"short"
|
||||
"ushort"
|
||||
"uchar"
|
||||
"uint"
|
||||
"ulong"
|
||||
|
|
|
|||
|
|
@ -74,12 +74,5 @@ QVector<QSslEllipticCurve>
|
|||
QVector<QStaticPlugin>
|
||||
QVector<QVariant>
|
||||
QWindowList
|
||||
qint32
|
||||
qint64
|
||||
quint16
|
||||
quint64
|
||||
quint8
|
||||
quintptr
|
||||
short
|
||||
sockaddr
|
||||
ushort
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
"NSMenu"
|
||||
"NSURL"
|
||||
"qintptr"
|
||||
"quint32"
|
||||
"qwsSet"
|
||||
"uchar *"
|
||||
"void *"
|
||||
|
|
|
|||
|
|
@ -1332,6 +1332,7 @@
|
|||
"new QHideEvent ()")
|
||||
(("QHostAddress" . NIL)
|
||||
"new QHostAddress ()"
|
||||
"new QHostAddress ( quint32 )"
|
||||
"new QHostAddress ( quint8 * )"
|
||||
"new QHostAddress ( const quint8 * )"
|
||||
"new QHostAddress ( const sockaddr * )"
|
||||
|
|
@ -1344,11 +1345,14 @@
|
|||
"bool isNull () const"
|
||||
"QAbstractSocket::NetworkLayerProtocol protocol () const"
|
||||
"QString scopeId () const"
|
||||
"void setAddress ( quint32 )"
|
||||
"void setAddress ( quint8 * )"
|
||||
"void setAddress ( const quint8 * )"
|
||||
"bool setAddress ( const QString & )"
|
||||
"void setAddress ( const sockaddr * )"
|
||||
"void setScopeId ( const QString & )"
|
||||
"quint32 toIPv4Address () const"
|
||||
"quint32 toIPv4Address ( bool * ) const"
|
||||
"QString toString () const")
|
||||
(("QHostInfo" . NIL)
|
||||
"new QHostInfo ( int = -1 )"
|
||||
|
|
@ -1532,11 +1536,15 @@
|
|||
"int width () const")
|
||||
(("QKeyEvent" . "QInputEvent")
|
||||
"new QKeyEvent ( Type , int , Qt::KeyboardModifiers , const QString & = QString() , bool = false , ushort = 1 )"
|
||||
"new QKeyEvent ( Type , int , Qt::KeyboardModifiers , quint32 , quint32 , quint32 , const QString & = QString() , bool = false , ushort = 1 )"
|
||||
"int count () const"
|
||||
"bool isAutoRepeat () const"
|
||||
"int key () const"
|
||||
"bool matches ( QKeySequence::StandardKey ) const"
|
||||
"Qt::KeyboardModifiers modifiers () const"
|
||||
"quint32 nativeModifiers () const"
|
||||
"quint32 nativeScanCode () const"
|
||||
"quint32 nativeVirtualKey () const"
|
||||
"QString text () const")
|
||||
(("QKeySequence" . NIL)
|
||||
"new QKeySequence ()"
|
||||
|
|
|
|||
|
|
@ -2,78 +2,96 @@
|
|||
|
||||
#include "dyn_object.h"
|
||||
#include "ecl_fun.h"
|
||||
#include "gen/_lobjects.h"
|
||||
#include <QMetaMethod>
|
||||
#include <QEvent>
|
||||
#include <QApplication>
|
||||
#include <QtDebug>
|
||||
|
||||
int DynObject::event_filter_handle = 0; // will never be reset to 0 to avoid subtle bugs
|
||||
int DynObject::slot_id = 0;
|
||||
int DynObject::event_filter_handle = 0;
|
||||
QObject* DynObject::currentSender = 0;
|
||||
|
||||
DynObject::DynObject(QObject* par) : QObject(par), filters(false) {
|
||||
DynObject::DynObject(QObject* par) : QObject(par), event_filters(false) {
|
||||
qApp->installEventFilter(this); }
|
||||
|
||||
int DynObject::qt_metacall(QMetaObject::Call c, int id, void** args) {
|
||||
if((QMetaObject::InvokeMetaMethod == c) && (id < functions.size())) {
|
||||
currentSender = senders.at(id);
|
||||
callConnectFun(functions.at(id), types.at(id), args); }
|
||||
if(QMetaObject::InvokeMetaMethod == c) {
|
||||
int slot_id = slot_ids.indexOf(id);
|
||||
if(slot_id != -1) {
|
||||
currentSender = signal_senders.at(slot_id);
|
||||
callConnectFun(slot_functions.at(slot_id), slot_types.at(slot_id), args); }}
|
||||
return -1; }
|
||||
|
||||
bool DynObject::connect(QObject* from, const char* signal, DynObject* dyn, void* fun) {
|
||||
int id_sig = from->metaObject()->indexOfSignal(signal + 1);
|
||||
if(id_sig != -1) {
|
||||
int id_slot = dyn->functions.size();
|
||||
dyn->functions << fun;
|
||||
dyn->types << from->metaObject()->method(id_sig).parameterTypes();
|
||||
dyn->senders << from;
|
||||
return QMetaObject::connect(from, id_sig, dyn, id_slot); }
|
||||
bool DynObject::connect(QObject* from, const char* signal, DynObject* dyn, void* function) {
|
||||
int signal_id = from->metaObject()->indexOfSignal(signal + 1);
|
||||
if(signal_id != -1) {
|
||||
int new_slot_id = ++slot_id;
|
||||
dyn->signal_senders << from;
|
||||
dyn->signal_ids << signal_id;
|
||||
dyn->slot_ids << new_slot_id;
|
||||
dyn->slot_functions << function;
|
||||
dyn->slot_types << from->metaObject()->method(signal_id).parameterTypes();
|
||||
return QMetaObject::connect(from, signal_id, dyn, new_slot_id); }
|
||||
return false; }
|
||||
|
||||
bool DynObject::disconnect(QObject* from, const char* signal, DynObject* dyn, void* fun) {
|
||||
int id_sig = signal ? from->metaObject()->indexOfSignal(signal + 1) : -1;
|
||||
int id_slot = -1;
|
||||
bool DynObject::disconnect(QObject* from, const char* signal, DynObject* dyn, void* function) {
|
||||
bool ok = false;
|
||||
Q_FOREACH(void* curr, dyn->functions) {
|
||||
++id_slot;
|
||||
if(curr == fun) {
|
||||
dyn->functions[id_slot] = 0;
|
||||
dyn->types[id_slot].clear();
|
||||
dyn->senders[id_slot] = 0;
|
||||
if(QMetaObject::disconnect(from, id_sig, dyn, id_slot)) {
|
||||
ok = true; }}}
|
||||
int signal_id = signal ? from->metaObject()->indexOfSignal(signal + 1) : -1;
|
||||
int i = 0;
|
||||
while(i < dyn->slot_ids.size()) {
|
||||
bool remove = false;
|
||||
if(from == dyn->signal_senders.at(i)) {
|
||||
remove = (signal_id == -1) ? true : (dyn->signal_ids.at(i) == signal_id);
|
||||
if(remove && function) {
|
||||
remove = (dyn->slot_functions.at(i) == function); }
|
||||
if(remove) {
|
||||
if(QMetaObject::disconnect(from, signal_id, dyn, dyn->slot_ids.at(i))) {
|
||||
ok = true; }
|
||||
dyn->signal_senders.removeAt(i);
|
||||
dyn->signal_ids.removeAt(i);
|
||||
dyn->slot_ids.removeAt(i);
|
||||
dyn->slot_functions.removeAt(i);
|
||||
dyn->slot_types.removeAt(i); }}
|
||||
if(!remove) {
|
||||
i++; }}
|
||||
return ok; }
|
||||
|
||||
int DynObject::addEventFilter(QObject* obj, int type, void* fun) {
|
||||
filters = true;
|
||||
ev_ids << ++event_filter_handle;
|
||||
ev_types << type;
|
||||
ev_funs << fun;
|
||||
ev_objects << obj;
|
||||
void DynObject::removeConnections(QObject* object) {
|
||||
disconnect(object, 0, LObjects::dynObject, 0); }
|
||||
|
||||
int DynObject::addEventFilter(QObject* object, int type, void* function) {
|
||||
event_filters = true;
|
||||
event_ids << ++event_filter_handle;
|
||||
event_types << type;
|
||||
event_funs << function;
|
||||
event_objects << object;
|
||||
return event_filter_handle; }
|
||||
|
||||
bool DynObject::removeEventFilter(int id) {
|
||||
int i = ev_ids.indexOf(id);
|
||||
int i = event_ids.indexOf(id);
|
||||
if(i != -1) {
|
||||
ev_ids.remove(i);
|
||||
ev_types.remove(i);
|
||||
ev_funs.remove(i);
|
||||
ev_objects.remove(i);
|
||||
if(!ev_ids.size()) {
|
||||
filters = false; }
|
||||
event_ids.remove(i);
|
||||
event_types.remove(i);
|
||||
event_funs.remove(i);
|
||||
event_objects.remove(i);
|
||||
if(!event_ids.size()) {
|
||||
event_filters = false; }
|
||||
return true; }
|
||||
return false; }
|
||||
|
||||
void DynObject::clearEventFilters() {
|
||||
filters = false;
|
||||
ev_ids.clear();
|
||||
ev_types.clear();
|
||||
ev_funs.clear();
|
||||
ev_objects.clear(); }
|
||||
event_filters = false;
|
||||
event_ids.clear();
|
||||
event_types.clear();
|
||||
event_funs.clear();
|
||||
event_objects.clear(); }
|
||||
|
||||
bool DynObject::eventFilter(QObject* obj, QEvent* ev) {
|
||||
if(filters && obj->isWidgetType()) {
|
||||
for(int i = 0; i < ev_objects.size(); ++i) {
|
||||
if(!ev_objects.at(i) || (obj == ev_objects.at(i))) {
|
||||
if(ev->type() == ev_types.at(i)) {
|
||||
if(callEventFun(ev_funs.at(i), obj, ev)) {
|
||||
bool DynObject::eventFilter(QObject* object, QEvent* event) {
|
||||
if(event_filters && object->isWidgetType()) {
|
||||
for(int i = 0; i < event_objects.size(); ++i) {
|
||||
if(!event_objects.at(i) || (object == event_objects.at(i))) {
|
||||
if(event->type() == event_types.at(i)) {
|
||||
if(callEventFun(event_funs.at(i), object, event)) {
|
||||
return true; }}}}}
|
||||
return QObject::eventFilter(obj, ev); }
|
||||
return QObject::eventFilter(object, event); }
|
||||
|
|
|
|||
|
|
@ -16,20 +16,26 @@ class DynObject: public QObject {
|
|||
public:
|
||||
DynObject(QObject* par = 0);
|
||||
|
||||
static int event_filter_handle;
|
||||
static QObject* currentSender;
|
||||
bool event_filters;
|
||||
|
||||
bool filters;
|
||||
QList<void*> functions;
|
||||
QList<StrList> types;
|
||||
QList<QObject*> senders;
|
||||
QVector<int> ev_ids;
|
||||
QVector<int> ev_types;
|
||||
QVector<void*> ev_funs;
|
||||
QVector<QObject*> ev_objects;
|
||||
static QObject* currentSender;
|
||||
static int slot_id;
|
||||
static int event_filter_handle;
|
||||
|
||||
QVector<QObject*> signal_senders;
|
||||
QVector<int> signal_ids;
|
||||
QVector<int> slot_ids;
|
||||
QVector<void*> slot_functions;
|
||||
QVector<StrList> slot_types;
|
||||
|
||||
QVector<int> event_ids;
|
||||
QVector<int> event_types;
|
||||
QVector<void*> event_funs;
|
||||
QVector<QObject*> event_objects;
|
||||
|
||||
static bool connect(QObject*, const char*, DynObject*, void*);
|
||||
static bool disconnect(QObject*, const char*, DynObject*, void*);
|
||||
static void removeConnections(QObject*);
|
||||
|
||||
int qt_metacall(QMetaObject::Call, int, void**);
|
||||
int addEventFilter(QObject*, int, void*);
|
||||
|
|
|
|||
|
|
@ -24,8 +24,15 @@ META_TYPE (T_bool_ok_pointer, bool*)
|
|||
META_TYPE (T_GLint, GLint)
|
||||
META_TYPE (T_GLuint, GLuint)
|
||||
META_TYPE (T_GLenum, GLenum)
|
||||
META_TYPE (T_short, short)
|
||||
META_TYPE (T_ushort, ushort)
|
||||
META_TYPE (T_GLfloat, GLfloat)
|
||||
META_TYPE (T_qint32, qint32)
|
||||
META_TYPE (T_qint64, qint64)
|
||||
META_TYPE (T_quint8, quint8)
|
||||
META_TYPE (T_quint16, quint16)
|
||||
META_TYPE (T_quint32, quint32)
|
||||
META_TYPE (T_quint64, quint64)
|
||||
META_TYPE (T_QFileInfo, QFileInfo)
|
||||
META_TYPE (T_QFileInfoList, QFileInfoList)
|
||||
META_TYPE (T_QGradient, QGradient)
|
||||
|
|
@ -607,7 +614,7 @@ static QByteArray qtObjectName(cl_object l_obj, const QByteArray& type = QByteAr
|
|||
name = QtObject::idToClassName(toInt(cl_funcall(2, s_qt_object_id, l_obj))); }
|
||||
return name; }
|
||||
|
||||
QtObject toQtObject(cl_object l_obj, cl_object l_cast, bool* qobject_align) {
|
||||
QtObject toQtObject(cl_object l_obj, cl_object l_cast, bool* qobject_align, bool quiet) {
|
||||
STATIC_SYMBOL_PKG (s_ensure_qt_object, "ENSURE-QT-OBJECT", "EQL")
|
||||
STATIC_SYMBOL_PKG (s_qt_object_pointer, "QT-OBJECT-POINTER", "EQL")
|
||||
STATIC_SYMBOL_PKG (s_qt_object_unique, "QT-OBJECT-UNIQUE", "EQL")
|
||||
|
|
@ -616,7 +623,10 @@ QtObject toQtObject(cl_object l_obj, cl_object l_cast, bool* qobject_align) {
|
|||
if(ECL_STRINGP(l_obj)) { // string name, for static methods
|
||||
o.id = classId(l_obj); }
|
||||
else {
|
||||
l_obj = cl_funcall(2, s_ensure_qt_object, l_obj);
|
||||
if(quiet) {
|
||||
l_obj = cl_funcall(3, s_ensure_qt_object, l_obj, Ct); }
|
||||
else {
|
||||
l_obj = cl_funcall(2, s_ensure_qt_object, l_obj); }
|
||||
if(l_obj != Cnil) {
|
||||
o.pointer = (void*)fixnnint(cl_funcall(2, s_qt_object_pointer, l_obj));
|
||||
o.unique = fixnnint(cl_funcall(2, s_qt_object_unique, l_obj));
|
||||
|
|
@ -1220,7 +1230,14 @@ static MetaArg toMetaArg(const QByteArray& sType, cl_object l_arg) {
|
|||
else if(T_GLuint == n) p = new GLuint(toUInt<GLuint>(l_arg));
|
||||
else if(T_GLenum == n) p = new GLenum(toUInt<GLenum>(l_arg));
|
||||
else if(T_GLfloat == n) p = new GLfloat(toFloat<GLfloat>(l_arg));
|
||||
else if(T_short == n) p = new short(toInt<short>(l_arg));
|
||||
else if(T_ushort == n) p = new ushort(toUInt<ushort>(l_arg));
|
||||
else if(T_qint32 == n) p = new qint32(toInt<qint32>(l_arg));
|
||||
else if(T_qint64 == n) p = new qint64(toInt<qint64>(l_arg));
|
||||
else if(T_quint8 == n) p = new quint8(toUInt<quint8>(l_arg));
|
||||
else if(T_quint16 == n) p = new quint16(toUInt<quint16>(l_arg));
|
||||
else if(T_quint32 == n) p = new quint32(toUInt<quint32>(l_arg));
|
||||
else if(T_quint64 == n) p = new quint64(toUInt<quint64>(l_arg));
|
||||
// module types
|
||||
else {
|
||||
bool found = false;
|
||||
|
|
@ -1374,7 +1391,14 @@ cl_object to_lisp_arg(const MetaArg& arg) {
|
|||
else if(T_GLuint == n) l_ret = ecl_make_unsigned_integer(*(GLuint*)p);
|
||||
else if(T_GLenum == n) l_ret = ecl_make_unsigned_integer(*(GLenum*)p);
|
||||
else if(T_GLfloat == n) l_ret = ecl_make_singlefloat(*(GLfloat*)p);
|
||||
else if(T_short == n) l_ret = ecl_make_integer(*(short*)p);
|
||||
else if(T_ushort == n) l_ret = ecl_make_unsigned_integer(*(ushort*)p);
|
||||
else if(T_qint32 == n) l_ret = ecl_make_integer(*(qint32*)p);
|
||||
else if(T_qint64 == n) l_ret = ecl_make_integer(*(qint64*)p);
|
||||
else if(T_quint8 == n) l_ret = ecl_make_unsigned_integer(*(quint8*)p);
|
||||
else if(T_quint16 == n) l_ret = ecl_make_unsigned_integer(*(quint16*)p);
|
||||
else if(T_quint32 == n) l_ret = ecl_make_unsigned_integer(*(quint32*)p);
|
||||
else if(T_quint64 == n) l_ret = ecl_make_unsigned_integer(*(quint64*)p);
|
||||
// module types
|
||||
else {
|
||||
bool found = false;
|
||||
|
|
@ -2064,7 +2088,11 @@ cl_object qconnect2(cl_object l_caller, cl_object l_signal, cl_object l_receiver
|
|||
else if(Cnil == l_slot) {
|
||||
void* fun = ensurePersistentFunction(l_receiver);
|
||||
if(fun) {
|
||||
if(DynObject::connect((QObject*)o1.pointer, SIG + signal, LObjects::dynObject, fun)) {
|
||||
QObject* object = (QObject*)o1.pointer;
|
||||
if(DynObject::connect(object, SIG + signal, LObjects::dynObject, fun)) {
|
||||
// when object gets deleted, remove all Lisp connections
|
||||
QObject::connect(object, QSIGNAL(destroyed(QObject*)),
|
||||
LObjects::eql, QSLOT(removeConnections(QObject*)));
|
||||
return Ct; }}}}}
|
||||
error_msg("QCONNECT", LIST4(l_caller, l_signal, l_receiver, l_slot));
|
||||
return Cnil; }
|
||||
|
|
@ -2079,7 +2107,7 @@ cl_object qdisconnect2(cl_object l_caller, cl_object l_signal, cl_object l_recei
|
|||
ecl_process_env()->nvalues = 1;
|
||||
QtObject o1 = toQtObject(l_caller);
|
||||
if(o1.isQObject() && o1.pointer) {
|
||||
QtObject o2 = toQtObject(l_receiver);
|
||||
QtObject o2 = toQtObject(l_receiver, Cnil, 0, true); // quiet
|
||||
QByteArray signal(toCString(l_signal));
|
||||
QByteArray slot(toCString(l_slot));
|
||||
if(!signal.isEmpty()) {
|
||||
|
|
@ -2088,20 +2116,19 @@ cl_object qdisconnect2(cl_object l_caller, cl_object l_signal, cl_object l_recei
|
|||
if(!slot.isEmpty()) {
|
||||
slot = QMetaObject::normalizedSignature(slot);
|
||||
slot.prepend(SLO); }
|
||||
bool lisp = (l_receiver != Cnil) && !o2.pointer;
|
||||
void* lisp_fun = lisp ? ensurePersistentFunction(l_receiver) : 0;
|
||||
bool disconnected = false;
|
||||
if(!lisp) {
|
||||
bool null_receiver = (l_receiver == Cnil);
|
||||
if(null_receiver || o2.isQObject()) {
|
||||
if(QObject::disconnect((QObject*)o1.pointer,
|
||||
signal.isEmpty() ? 0: signal.constData(),
|
||||
o2.isQObject() ? (QObject*)o2.pointer : 0,
|
||||
slot.isEmpty() ? 0 : slot.constData())) {
|
||||
disconnected = true; }}
|
||||
if(lisp_fun) {
|
||||
if(null_receiver || !o2.isQObject()) {
|
||||
if(DynObject::disconnect((QObject*)o1.pointer,
|
||||
signal.isEmpty() ? 0 : signal.constData(),
|
||||
LObjects::dynObject,
|
||||
lisp_fun)) {
|
||||
l_receiver)) {
|
||||
disconnected = true; }}
|
||||
return disconnected ? Ct : Cnil; }
|
||||
error_msg("QDISCONNECT", LIST4(l_caller, l_signal, l_receiver, l_slot));
|
||||
|
|
|
|||
|
|
@ -13,6 +13,9 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#define QSLOT(x) "1"#x
|
||||
#define QSIGNAL(x) "2"#x
|
||||
|
||||
#define META_TYPE(constant, type) \
|
||||
static const int constant = qRegisterMetaType< type >(#type);
|
||||
|
||||
|
|
@ -309,7 +312,7 @@ cl_object to_lisp_arg(const MetaArg&);
|
|||
|
||||
EQL_EXPORT QVariant callOverrideFun(void*, int, const void**, quint64);
|
||||
EQL_EXPORT cl_object qt_object_from_name(const QByteArray&, void*, uint = 0, bool = false);
|
||||
EQL_EXPORT QtObject toQtObject(cl_object, cl_object = Cnil, bool* = 0);
|
||||
EQL_EXPORT QtObject toQtObject(cl_object, cl_object = Cnil, bool* = 0, bool = false);
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <QTimer>
|
||||
#include <QStringList>
|
||||
|
||||
const char EQL::version[] = "16.12.2"; // Dec 2016
|
||||
const char EQL::version[] = "16.12.3"; // Dec 2016
|
||||
|
||||
extern "C" void ini_EQL(cl_object);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <QStringList>
|
||||
#include <QCoreApplication>
|
||||
#include <ecl/ecl.h>
|
||||
#include "dyn_object.h"
|
||||
#include "eql_global.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
|
@ -45,6 +46,7 @@ public:
|
|||
|
||||
public Q_SLOTS:
|
||||
void exitEventLoop() { eventLoop->exit(); }
|
||||
void removeConnections(QObject* object) { DynObject::removeConnections(object); }
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -981,6 +981,7 @@ class LKeyEvent : public QKeyEvent {
|
|||
friend class N85;
|
||||
public:
|
||||
LKeyEvent(uint u, Type x1, int x2, Qt::KeyboardModifiers x3, const QString& x4 = QString(), bool x5 = false, ushort x6 = 1) : QKeyEvent(x1, x2, x3, x4, x5, x6), unique(u) {}
|
||||
LKeyEvent(uint u, Type x1, int x2, Qt::KeyboardModifiers x3, quint32 x4, quint32 x5, quint32 x6, const QString& x7 = QString(), bool x8 = false, ushort x9 = 1) : QKeyEvent(x1, x2, x3, x4, x5, x6, x7, x8, x9), unique(u) {}
|
||||
|
||||
static NumList overrideIds;
|
||||
uint unique;
|
||||
|
|
|
|||
|
|
@ -3671,11 +3671,15 @@ class EQL_EXPORT N85 : public N81 { // QKeyEvent
|
|||
Q_OBJECT
|
||||
public:
|
||||
Q_INVOKABLE void* C(uint u, QKeyEvent::Type x1, int x2, Qt::KeyboardModifiers x3, const QString& x4 = QString(), bool x5 = false, ushort x6 = 1) { return new LKeyEvent(u, x1, x2, x3, x4, x5, x6); }
|
||||
Q_INVOKABLE void* C(uint u, QKeyEvent::Type x1, int x2, Qt::KeyboardModifiers x3, quint32 x4, quint32 x5, quint32 x6, const QString& x7 = QString(), bool x8 = false, ushort x9 = 1) { return new LKeyEvent(u, x1, x2, x3, x4, x5, x6, x7, x8, x9); }
|
||||
Q_INVOKABLE int Mcount(QKeyEvent* o) const { return o->count(); }
|
||||
Q_INVOKABLE bool MisAutoRepeat(QKeyEvent* o) const { return o->isAutoRepeat(); }
|
||||
Q_INVOKABLE int Mkey(QKeyEvent* o) const { return o->key(); }
|
||||
Q_INVOKABLE bool Mmatches(QKeyEvent* o, QKeySequence::StandardKey x1) const { return o->matches(x1); }
|
||||
Q_INVOKABLE int Mmodifiers(QKeyEvent* o) const { return o->modifiers(); }
|
||||
Q_INVOKABLE quint32 MnativeModifiers(QKeyEvent* o) const { return o->nativeModifiers(); }
|
||||
Q_INVOKABLE quint32 MnativeScanCode(QKeyEvent* o) const { return o->nativeScanCode(); }
|
||||
Q_INVOKABLE quint32 MnativeVirtualKey(QKeyEvent* o) const { return o->nativeVirtualKey(); }
|
||||
Q_INVOKABLE QString Mtext(QKeyEvent* o) const { return o->text(); }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class LHostAddress : public QHostAddress {
|
|||
friend class N74;
|
||||
public:
|
||||
LHostAddress(uint u) : unique(u) {}
|
||||
LHostAddress(uint u, quint32 x1) : QHostAddress(x1), unique(u) {}
|
||||
LHostAddress(uint u, quint8* x1) : QHostAddress(x1), unique(u) {}
|
||||
LHostAddress(uint u, const quint8* x1) : QHostAddress(x1), unique(u) {}
|
||||
LHostAddress(uint u, const sockaddr* x1) : QHostAddress(x1), unique(u) {}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ class N74 : public QObject { // QHostAddress
|
|||
Q_OBJECT
|
||||
public:
|
||||
Q_INVOKABLE void* C(uint u) { return new LHostAddress(u); }
|
||||
Q_INVOKABLE void* C(uint u, quint32 x1) { return new LHostAddress(u, x1); }
|
||||
Q_INVOKABLE void* C(uint u, quint8* x1) { return new LHostAddress(u, x1); }
|
||||
Q_INVOKABLE void* C(uint u, const quint8* x1) { return new LHostAddress(u, x1); }
|
||||
Q_INVOKABLE void* C(uint u, const sockaddr* x1) { return new LHostAddress(u, x1); }
|
||||
|
|
@ -43,11 +44,14 @@ public:
|
|||
Q_INVOKABLE bool MisNull(QHostAddress* o) const { return o->isNull(); }
|
||||
Q_INVOKABLE int Mprotocol(QHostAddress* o) const { return o->protocol(); }
|
||||
Q_INVOKABLE QString MscopeId(QHostAddress* o) const { return o->scopeId(); }
|
||||
Q_INVOKABLE void MsetAddress(QHostAddress* o, quint32 x1) { o->setAddress(x1); }
|
||||
Q_INVOKABLE void MsetAddress(QHostAddress* o, quint8* x1) { o->setAddress(x1); }
|
||||
Q_INVOKABLE void MsetAddress(QHostAddress* o, const quint8* x1) { o->setAddress(x1); }
|
||||
Q_INVOKABLE bool MsetAddress(QHostAddress* o, const QString& x1) { return o->setAddress(x1); }
|
||||
Q_INVOKABLE void MsetAddress(QHostAddress* o, const sockaddr* x1) { o->setAddress(x1); }
|
||||
Q_INVOKABLE void MsetScopeId(QHostAddress* o, const QString& x1) { o->setScopeId(x1); }
|
||||
Q_INVOKABLE quint32 MtoIPv4Address(QHostAddress* o) const { return o->toIPv4Address(); }
|
||||
Q_INVOKABLE quint32 MtoIPv4Address(QHostAddress* o, bool* x1) const { return o->toIPv4Address(x1); }
|
||||
Q_INVOKABLE QString MtoString(QHostAddress* o) const { return o->toString(); }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
(in-package :eql)
|
||||
|
||||
(defun |selectNameFilter| (object &rest arguments)
|
||||
(%qinvoke-method object nil "selectNameFilter" arguments))
|
||||
|
||||
(defun |selectRow| (object &rest arguments)
|
||||
(%qinvoke-method object nil "selectRow" arguments))
|
||||
|
||||
(defun |selectUrl| (object &rest arguments)
|
||||
(%qinvoke-method object nil "selectUrl" arguments))
|
||||
|
||||
(defun |selectedColor| (object &rest arguments)
|
||||
(%qinvoke-method object nil "selectedColor" arguments))
|
||||
|
||||
|
|
@ -216,6 +225,9 @@
|
|||
(defun |setAddress(quint8*)| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setAddress(quint8*)" arguments))
|
||||
|
||||
(defun |setAddress(uint)| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setAddress(uint)" arguments))
|
||||
|
||||
(defun |setAddresses| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setAddresses" arguments))
|
||||
|
||||
|
|
@ -3587,15 +3599,3 @@
|
|||
|
||||
(defun |setStyleHint| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyleHint" arguments))
|
||||
|
||||
(defun |setStyleName| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyleName" arguments))
|
||||
|
||||
(defun |setStyleProperty| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyleProperty" arguments))
|
||||
|
||||
(defun |setStyleSheet| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyleSheet" arguments))
|
||||
|
||||
(defun |setStyleStrategy| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyleStrategy" arguments))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,17 @@
|
|||
(in-package :eql)
|
||||
|
||||
(defun |setStyleName| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyleName" arguments))
|
||||
|
||||
(defun |setStyleProperty| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyleProperty" arguments))
|
||||
|
||||
(defun |setStyleSheet| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyleSheet" arguments))
|
||||
|
||||
(defun |setStyleStrategy| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyleStrategy" arguments))
|
||||
|
||||
(defun |setStyle| (object &rest arguments)
|
||||
(%qinvoke-method object nil "setStyle" arguments))
|
||||
|
||||
|
|
@ -2163,6 +2175,9 @@
|
|||
(defun |toHtml| (object &rest arguments)
|
||||
(%qinvoke-method object nil "toHtml" arguments))
|
||||
|
||||
(defun |toIPv4Address| (object &rest arguments)
|
||||
(%qinvoke-method object nil "toIPv4Address" arguments))
|
||||
|
||||
(defun |toImageFormat.QImage| (&rest arguments)
|
||||
(%qinvoke-method "QImage" nil "toImageFormat" arguments))
|
||||
|
||||
|
|
@ -3584,18 +3599,3 @@
|
|||
|
||||
(defun |yellow| (object &rest arguments)
|
||||
(%qinvoke-method object nil "yellow" arguments))
|
||||
|
||||
(defun |y| (object &rest arguments)
|
||||
(%qinvoke-method object (%auto-cast object) "y" arguments))
|
||||
|
||||
(defun |zChanged| (object &rest arguments)
|
||||
(%qinvoke-method object nil "zChanged" arguments))
|
||||
|
||||
(defun |zScaleChanged| (object &rest arguments)
|
||||
(%qinvoke-method object nil "zScaleChanged" arguments))
|
||||
|
||||
(defun |zScale| (object &rest arguments)
|
||||
(%qinvoke-method object nil "zScale" arguments))
|
||||
|
||||
(defun |zValue| (object &rest arguments)
|
||||
(%qinvoke-method object (%auto-cast object) "zValue" arguments))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,20 @@
|
|||
(in-package :eql)
|
||||
|
||||
(defun |y| (object &rest arguments)
|
||||
(%qinvoke-method object (%auto-cast object) "y" arguments))
|
||||
|
||||
(defun |zChanged| (object &rest arguments)
|
||||
(%qinvoke-method object nil "zChanged" arguments))
|
||||
|
||||
(defun |zScaleChanged| (object &rest arguments)
|
||||
(%qinvoke-method object nil "zScaleChanged" arguments))
|
||||
|
||||
(defun |zScale| (object &rest arguments)
|
||||
(%qinvoke-method object nil "zScale" arguments))
|
||||
|
||||
(defun |zValue| (object &rest arguments)
|
||||
(%qinvoke-method object (%auto-cast object) "zValue" arguments))
|
||||
|
||||
(defun |zeroDigit| (object &rest arguments)
|
||||
(%qinvoke-method object nil "zeroDigit" arguments))
|
||||
|
||||
|
|
|
|||
|
|
@ -437,12 +437,15 @@
|
|||
#:|nativeCountryName|
|
||||
#:|nativeErrorCode|
|
||||
#:|nativeLanguageName|
|
||||
#:|nativeModifiers|
|
||||
#:|nativeOrientation|
|
||||
#:|nativeParentWidget|
|
||||
#:|nativeResolutionChanged|
|
||||
#:|nativeResolution|
|
||||
#:|nativeScanCode|
|
||||
#:|nativeSizeChanged|
|
||||
#:|nativeSize|
|
||||
#:|nativeVirtualKey|
|
||||
#:|naturalTextRect|
|
||||
#:|naturalTextWidth|
|
||||
#:|nearestFormat|
|
||||
|
|
@ -1196,7 +1199,4 @@
|
|||
#:|selectAll|
|
||||
#:|selectColumn|
|
||||
#:|selectFile|
|
||||
#:|selectMimeTypeFilter|
|
||||
#:|selectNameFilter|
|
||||
#:|selectRow|
|
||||
#:|selectUrl|))
|
||||
#:|selectMimeTypeFilter|))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
(defpackage :eql
|
||||
(:export
|
||||
#:|selectNameFilter|
|
||||
#:|selectRow|
|
||||
#:|selectUrl|
|
||||
#:|selectedColor|
|
||||
#:|selectedColumns|
|
||||
#:|selectedDate|
|
||||
|
|
@ -72,6 +75,7 @@
|
|||
#:|setAddress(const quint8*)|
|
||||
#:|setAddress(const sockaddr*)|
|
||||
#:|setAddress(quint8*)|
|
||||
#:|setAddress(uint)|
|
||||
#:|setAddresses|
|
||||
#:|setAddress|
|
||||
#:|setAlignment(QLayout*...)|
|
||||
|
|
@ -1195,8 +1199,4 @@
|
|||
#:|setStyle(QString).QApplication|
|
||||
#:|setStyle(QStyle*).QApplication|
|
||||
#:|setStyle.QApplication|
|
||||
#:|setStyleHint|
|
||||
#:|setStyleName|
|
||||
#:|setStyleProperty|
|
||||
#:|setStyleSheet|
|
||||
#:|setStyleStrategy|))
|
||||
#:|setStyleHint|))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
(defpackage :eql
|
||||
(:export
|
||||
#:|setStyleName|
|
||||
#:|setStyleProperty|
|
||||
#:|setStyleSheet|
|
||||
#:|setStyleStrategy|
|
||||
#:|setStyle|
|
||||
#:|setSubTitleFormat|
|
||||
#:|setSubTitle|
|
||||
|
|
@ -721,6 +725,7 @@
|
|||
#:|toHsl|
|
||||
#:|toHsv|
|
||||
#:|toHtml|
|
||||
#:|toIPv4Address|
|
||||
#:|toImageFormat.QImage|
|
||||
#:|toImageFormat|
|
||||
#:|toImage|
|
||||
|
|
@ -1194,9 +1199,4 @@
|
|||
#:|yearShown|
|
||||
#:|year|
|
||||
#:|yellowF|
|
||||
#:|yellow|
|
||||
#:|y|
|
||||
#:|zChanged|
|
||||
#:|zScaleChanged|
|
||||
#:|zScale|
|
||||
#:|zValue|))
|
||||
#:|yellow|))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
(defpackage :eql
|
||||
(:export
|
||||
#:|y|
|
||||
#:|zChanged|
|
||||
#:|zScaleChanged|
|
||||
#:|zScale|
|
||||
#:|zValue|
|
||||
#:|zeroDigit|
|
||||
#:|zoomFactor|
|
||||
#:|zoomIn|
|
||||
|
|
|
|||
|
|
@ -1311,6 +1311,9 @@
|
|||
(defun |nativeLanguageName| (object &rest arguments)
|
||||
(%qinvoke-method object nil "nativeLanguageName" arguments))
|
||||
|
||||
(defun |nativeModifiers| (object &rest arguments)
|
||||
(%qinvoke-method object nil "nativeModifiers" arguments))
|
||||
|
||||
(defun |nativeOrientation| (object &rest arguments)
|
||||
(%qinvoke-method object nil "nativeOrientation" arguments))
|
||||
|
||||
|
|
@ -1323,12 +1326,18 @@
|
|||
(defun |nativeResolution| (object &rest arguments)
|
||||
(%qinvoke-method object nil "nativeResolution" arguments))
|
||||
|
||||
(defun |nativeScanCode| (object &rest arguments)
|
||||
(%qinvoke-method object nil "nativeScanCode" arguments))
|
||||
|
||||
(defun |nativeSizeChanged| (object &rest arguments)
|
||||
(%qinvoke-method object nil "nativeSizeChanged" arguments))
|
||||
|
||||
(defun |nativeSize| (object &rest arguments)
|
||||
(%qinvoke-method object nil "nativeSize" arguments))
|
||||
|
||||
(defun |nativeVirtualKey| (object &rest arguments)
|
||||
(%qinvoke-method object nil "nativeVirtualKey" arguments))
|
||||
|
||||
(defun |naturalTextRect| (object &rest arguments)
|
||||
(%qinvoke-method object nil "naturalTextRect" arguments))
|
||||
|
||||
|
|
@ -3590,12 +3599,3 @@
|
|||
|
||||
(defun |selectMimeTypeFilter| (object &rest arguments)
|
||||
(%qinvoke-method object nil "selectMimeTypeFilter" arguments))
|
||||
|
||||
(defun |selectNameFilter| (object &rest arguments)
|
||||
(%qinvoke-method object nil "selectNameFilter" arguments))
|
||||
|
||||
(defun |selectRow| (object &rest arguments)
|
||||
(%qinvoke-method object nil "selectRow" arguments))
|
||||
|
||||
(defun |selectUrl| (object &rest arguments)
|
||||
(%qinvoke-method object nil "selectUrl" arguments))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue