File: connector.h

package info (click to toggle)
ciborium 1.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,928 kB
  • sloc: cpp: 2,199; sh: 75; makefile: 20
file content (58 lines) | stat: -rw-r--r-- 1,221 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef CONNECTOR_H
#define CONNECTOR_H

#include <QObject>

#include <stdint.h>

class Connector : public QObject
{
    Q_OBJECT

    public:

    Connector(QObject *sender, QMetaMethod method, QQmlEngine *engine, GoRef func, int argsLen)
        : QObject(sender), engine(engine), method(method), func(func), argsLen(argsLen) {};

    virtual ~Connector();

    // MOC HACK: s/Connector::qt_metacall/Connector::standard_qt_metacall/
    int standard_qt_metacall(QMetaObject::Call c, int idx, void **a);

    public slots:

    void invoke();

    private:

    QQmlEngine *engine;
    QMetaMethod method;
    GoRef func;
    int argsLen;
};

class PlainObject : public QObject
{
    Q_OBJECT

    Q_PROPERTY(QString plainType READ getPlainType)
    Q_PROPERTY(void *plainAddr READ getPlainAddr)

    QString plainType;
    void *plainAddr;

    public:

    PlainObject(QObject *parent = 0)
        : QObject(parent) {};

    PlainObject(const char *plainType, void *plainAddr, QObject *parent = 0)
        : QObject(parent), plainType(plainType), plainAddr(plainAddr) {};

    QString getPlainType() { return plainType; };
    void *getPlainAddr() { return plainAddr; };
};

#endif // CONNECTOR_H

// vim:ts=4:sw=4:et