Compare commits
No commits in common. "e0fca00772900c8890b76a2771d2d190eb5a3eaa" and "694da457b071d33d64337333807e8ba55c947c24" have entirely different histories.
e0fca00772
...
694da457b0
5
main.cpp
5
main.cpp
|
@ -3,7 +3,6 @@
|
|||
|
||||
#include <QtGui>
|
||||
#include <QtUiTools>
|
||||
#include <QLayout>
|
||||
#include <QOpenGLWidget>
|
||||
#include <QtMultimedia/QSoundEffect>
|
||||
#include <chicken.h>
|
||||
|
@ -71,7 +70,6 @@ protected:
|
|||
#define qtsound QSoundEffect *
|
||||
#define qttextedit QTextEdit *
|
||||
#define qtaction QAction *
|
||||
#define qtlayout QLayout *
|
||||
|
||||
extern "C" {
|
||||
#include "prototypes.h"
|
||||
|
@ -466,7 +464,6 @@ int qt_propertytype(qtwidget w, char *prop)
|
|||
|
||||
|
||||
const char *qt_classname(qtobject w) { return w->metaObject()->className(); }
|
||||
___bool qt_inherits(qtobject w, const char *classname) { return w->inherits(classname); }
|
||||
qtwidget qt_gl(char *name, qtwidget parent, C_word proc) { return new OpenGLWidget(name, parent, proc); }
|
||||
void qt_update(qtwidget w) { w->update(); }
|
||||
|
||||
|
@ -496,8 +493,6 @@ char *qt_listwidgetitem(qtwidget w, int i) {
|
|||
return qstrdata(((QListWidget *)w)->item(i)->text());
|
||||
}
|
||||
|
||||
void qt_addlayoutwidget(qtlayout l, qtwidget w) { l->addWidget(w); }
|
||||
|
||||
qtsound qt_sound(char *filename) {
|
||||
QSoundEffect* sound = new QSoundEffect();
|
||||
sound->setSource(QUrl::fromLocalFile(filename));
|
||||
|
|
|
@ -19,7 +19,6 @@ qtobject qt_find(qtobject parent, char *name);
|
|||
qtobject qt_receiver(char *name, C_word proc);
|
||||
int qt_message(char *caption, char *text, qtwidget parent, char *b0, char *b1, char *b2, int msg_type);
|
||||
const char *qt_classname(qtobject w);
|
||||
___bool qt_inherits(qtobject w, const char *classname);
|
||||
___bool qt_setstringproperty(qtwidget w, char *prop, char *val);
|
||||
___bool qt_setboolproperty(qtwidget w, char *prop, ___bool val);
|
||||
___bool qt_setintproperty(qtwidget w, char *prop, int val);
|
||||
|
@ -56,7 +55,6 @@ void qt_addcomboboxitem(qtwidget w, char *s);
|
|||
void qt_addlistwidgetitem(qtwidget w, char *s);
|
||||
void qt_addtreewidgetitem(qtwidget w, char *s);
|
||||
char *qt_listwidgetitem(qtwidget w, int i);
|
||||
void qt_addlayoutwidget(qtlayout l, qtwidget w);
|
||||
char *qt_getexistingdirectory(qtwidget p, char *cap, char *dir, int opts);
|
||||
char *qt_getopenfilename(qtwidget p, char *cap, char *dir, char *filter, int opts);
|
||||
char *qt_getsavefilename(qtwidget p, char *cap, char *dir, char *filter, int opts);
|
||||
|
|
29
qt-light.scm
29
qt-light.scm
|
@ -7,7 +7,7 @@
|
|||
qt:widget qt:receiver qt:pixmap qt:icon qt:theme-icon qt:timer
|
||||
qt:icon->pixmap qt:pixmap->icon
|
||||
qt:property qt:gl qt:update qt:start qt:stop
|
||||
qt:clear qt:add qt:item <qt> qt:classname qt:inherits
|
||||
qt:clear qt:add qt:item <qt> qt:classname
|
||||
<qt-object> <qt-widget> <qt-pixmap> <qt-icon> <qt-application>
|
||||
<qt-receiver> <qt-timer> <qt-sound> <qt-text-edit>
|
||||
<qt-action>
|
||||
|
@ -49,11 +49,9 @@
|
|||
(define <qt-timer> (% <qt-object> (class 'qt-timer)))
|
||||
(define <qt-text-edit> (% <qt-widget> (class 'qt-text-edit)))
|
||||
(define <qt-action> (% <qt-object> (class 'qt-action)))
|
||||
(define <qt-layout> (% <qt-object> (class 'qt-layout)))
|
||||
|
||||
(define (qt:->pointer i) (and i (? i pointer)))
|
||||
(define (qt:pointer->widget p) (and p (% <qt-widget> (pointer p))))
|
||||
(define (qt:pointer->layout p) (and p (% <qt-layout> (pointer p))))
|
||||
(define (qt:pointer->object p) (and p (% <qt-object> (pointer p))))
|
||||
(define (qt:pointer->timer p) (and p (% <qt-timer> (pointer p))))
|
||||
(define (qt:pointer->application p) (and p (% <qt-application> (pointer p))))
|
||||
|
@ -70,7 +68,6 @@
|
|||
(bind-type qtapplication c-pointer qt:->pointer qt:pointer->application)
|
||||
(bind-type qtpixmap c-pointer qt:->pointer qt:pointer->pixmap)
|
||||
(bind-type qticon c-pointer qt:->pointer qt:pointer->icon)
|
||||
(bind-type qtlayout c-pointer qt:->pointer qt:pointer->layout)
|
||||
(bind-type qtobject c-pointer qt:->pointer qt:pointer->object)
|
||||
(bind-type qttimer c-pointer qt:->pointer qt:pointer->timer)
|
||||
(bind-type qtreceiver c-pointer qt:->pointer qt:pointer->receiver)
|
||||
|
@ -110,23 +107,6 @@ extern "C" {
|
|||
(if (procedure? to) (qt:receiver to) to)
|
||||
(string-append "1" slot)) ) ) )
|
||||
|
||||
(define qt:find
|
||||
(let ((qt:find qt:find))
|
||||
(lambda (o name)
|
||||
(let ((result (qt:find o name)))
|
||||
(if result
|
||||
(cond ((qt:inherits result "QTextEdit")
|
||||
(qt:pointer->textedit (qt:->pointer result)))
|
||||
((qt:inherits result "QWidget")
|
||||
(qt:pointer->widget (qt:->pointer result)))
|
||||
((qt:inherits result "QAction")
|
||||
(qt:pointer->action (qt:->pointer result)))
|
||||
((qt:inherits result "QLayout")
|
||||
(qt:pointer->layout (qt:->pointer result)))
|
||||
(#t
|
||||
result))
|
||||
result)))))
|
||||
|
||||
(define qt:receiver
|
||||
(let ((qt:receiver qt:receiver))
|
||||
(lambda (thunk #!optional (name (gensym "qt:receiver")))
|
||||
|
@ -217,10 +197,9 @@ extern "C" {
|
|||
(qt:run once) ) ) )
|
||||
|
||||
(define (qt:add w x)
|
||||
(cond ((qt:inherits w "QComboBox") (qt:addcomboboxitem w x))
|
||||
((qt:inherits w "QListWidget") (qt:addlistwidgetitem w x))
|
||||
((qt:inherits w "QTreeWidget") (qt:addtreewidgetitem w x))
|
||||
((qt:inherits w "QLayout") (qt:addlayoutwidget w x))
|
||||
(cond ((string=? "QComboBox" (qt:classname w)) (qt:addcomboboxitem w x))
|
||||
((string=? "QListWidget" (qt:classname w)) (qt:addlistwidgetitem w x))
|
||||
((string=? "QTreeWidget" (qt:classname w)) (qt:addtreewidgetitem w x))
|
||||
(else (error 'qt:add "invalid widget" w x)) ) )
|
||||
|
||||
(define (qt:item w i) (and (positive? i) (qt:listwidgetitem w i)))
|
||||
|
|
Ŝarĝante…
Reference in New Issue