Comment: | Update to recent ObjFW changes |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
860515ac5a679e872004d1e402754566 |
User & Date: | js on 2017-05-08 00:11:18 |
Other Links: | manifest | tags |
2017-05-14
| ||
00:50 | Make all properties nonatomic check-in: b2aa2ffc1d user: js tags: trunk | |
2017-05-08
| ||
00:11 | Update to recent ObjFW changes check-in: 860515ac5a user: js tags: trunk | |
2017-04-30
| ||
11:49 | configure: Fix the OBJCFLAGS vs OBJCXXFLAGS mess check-in: 820b470b77 user: js tags: trunk | |
Modified src/QtCore/QtChildEvent.h from [53abd485c2] to [c15e46d342].
︙ | ︙ | |||
27 28 29 30 31 32 33 | @interface QtChildEvent: QtEvent @property (readonly) QChildEvent *qChildEvent; @property (readonly, getter=isAdded) bool added; @property (readonly, retain) QtObject *child; @property (readonly, getter=isPolished) bool polished; @property (readonly, getter=isRemoved) bool removed; | > | | | | | 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 | @interface QtChildEvent: QtEvent @property (readonly) QChildEvent *qChildEvent; @property (readonly, getter=isAdded) bool added; @property (readonly, retain) QtObject *child; @property (readonly, getter=isPolished) bool polished; @property (readonly, getter=isRemoved) bool removed; - initWithQEvent: (QEvent *)event OF_UNAVAILABLE; - initWithQChildEvent: (QChildEvent *)qChildEvent; - initWithType: (QChildEvent::Type)type child: (QtObject *)child; @end namespace ObjQt { static OF_INLINE QtChildEvent * toOF(QChildEvent *qChildEvent) { return [[[QtChildEvent alloc] initWithQChildEvent: qChildEvent] autorelease]; } static OF_INLINE QChildEvent * toQt(QtChildEvent *childEvent) { return [childEvent qChildEvent]; } } |
Modified src/QtCore/QtChildEvent.mm from [0050860fa4] to [77e90608b8].
︙ | ︙ | |||
23 24 25 26 27 28 29 | #import "QtChildEvent.h" #import "QtObject.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtChildEvent | | | | | | | | 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | #import "QtChildEvent.h" #import "QtObject.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtChildEvent - initWithQEvent: (QEvent *)event { OF_INVALID_INIT_METHOD } - initWithQChildEvent: (QChildEvent *)event { return [super initWithQEvent: event]; } - initWithType: (QChildEvent::Type)type child: (QtObject *)child { try { self = [self initWithQChildEvent: new QChildEvent(type, toQt(child))]; [self takeOwnership]; return self; } catch (const std::bad_alloc &e) { self = [super initWithQEvent: NULL]; [self release]; throw; } } - (QChildEvent *)qChildEvent { return dynamic_cast<QChildEvent *>(_qEvent); } - (bool)isAdded { return toQt(self)->added(); } - (QtObject *)child { return toOF(toQt(self)->child()); } - (bool)isPolished { return toQt(self)->polished(); |
︙ | ︙ |
Modified src/QtCore/QtCoreApplication.h from [dfc55ef348] to [96e4d8b08f].
︙ | ︙ | |||
26 27 28 29 30 31 32 | @interface QtCoreApplication: QtObject @property (readonly) QCoreApplication *qCoreApplication; @property (copy) OFString *applicationName, *applicationVersion; @property (copy) OFString *organizationDomain, *organizationName; @property (getter=isQuitLockEnabled) bool quitLockEnabled; | > | | | | | | | | 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 | @interface QtCoreApplication: QtObject @property (readonly) QCoreApplication *qCoreApplication; @property (copy) OFString *applicationName, *applicationVersion; @property (copy) OFString *organizationDomain, *organizationName; @property (getter=isQuitLockEnabled) bool quitLockEnabled; - initWithQObject: (QObject *)qObject OF_UNAVAILABLE; - initWithQCoreApplication: (QCoreApplication *)qCoreApplication; - (void)installNativeEventFilter: (QAbstractNativeEventFilter *)filterObject; - (void)quit; - (void)removeNativeEventFilter: (QAbstractNativeEventFilter *)filterObject; - (bool)sendEvent: (QtEvent *)event receiver: (QtObject *)receiver; @end namespace ObjQt { static OF_INLINE QtCoreApplication * toOF(QCoreApplication *qCoreApplication) { return [[[QtCoreApplication alloc] initWithQCoreApplication: qCoreApplication] autorelease]; } static OF_INLINE QCoreApplication * toQt(QtCoreApplication *coreApplication) { return [coreApplication qCoreApplication]; } } |
Modified src/QtCore/QtCoreApplication.mm from [b055a533da] to [efe4224b0c].
︙ | ︙ | |||
24 25 26 27 28 29 30 | #import "QtEvent.h" #import "OFString+QString.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtCoreApplication | | | | | | | | | | | | | | | | | | 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | #import "QtEvent.h" #import "OFString+QString.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtCoreApplication - initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } - initWithQCoreApplication: (QCoreApplication *)qCoreApplication { return [super initWithQObject: qCoreApplication]; } - (QCoreApplication *)qCoreApplication { return qobject_cast<QCoreApplication *>(_qObject); } - (OFString *)applicationName { return toOF(toQt(self)->applicationName()); } - (void)setApplicationName: (OFString *)applicationName { toQt(self)->setApplicationName(toQt(applicationName)); } - (OFString *)applicationVersion { return toOF(toQt(self)->applicationVersion()); } - (void)installNativeEventFilter: (QAbstractNativeEventFilter *)filterObject { toQt(self)->installNativeEventFilter(filterObject); } - (void)setApplicationVersion: (OFString *)applicationVersion { toQt(self)->setApplicationVersion(toQt(applicationVersion)); } - (OFString *)organizationDomain { return toOF(toQt(self)->organizationDomain()); } - (void)setOrganizationDomain: (OFString *)organizationDomain { toQt(self)->setOrganizationDomain(toQt(organizationDomain)); } - (OFString *)organizationName { return toOF(toQt(self)->organizationName()); } - (void)setOrganizationName: (OFString *)organizationName { toQt(self)->setOrganizationName(toQt(organizationName)); } - (void)quit { toQt(self)->quit(); } - (bool)isQuitLockEnabled { return toQt(self)->isQuitLockEnabled(); } - (void)setQuitLockEnabled: (bool)quitLockEnabled { toQt(self)->setQuitLockEnabled(quitLockEnabled); } - (void)removeNativeEventFilter: (QAbstractNativeEventFilter *)filterObject { toQt(self)->removeNativeEventFilter(filterObject); } - (bool)sendEvent: (QtEvent *)event receiver: (QtObject *)receiver { return toQt(self)->notify(toQt(receiver), toQt(event)); } @end |
Modified src/QtCore/QtEvent.h from [6eeefe4604] to [6e6d3c6c45].
︙ | ︙ | |||
34 35 36 37 38 39 40 | @property (readonly) QEvent *qEvent; @property (getter=isAccepted) bool accepted; @property (readonly, getter=isSpontaneous) bool spontaneous; @property (readonly) QEvent::Type type; + (int)registerEventType: (int)hint; | > | | | | 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 59 60 61 | @property (readonly) QEvent *qEvent; @property (getter=isAccepted) bool accepted; @property (readonly, getter=isSpontaneous) bool spontaneous; @property (readonly) QEvent::Type type; + (int)registerEventType: (int)hint; - init OF_UNAVAILABLE; - initWithQEvent: (QEvent *)qEvent; - (void)accept; - (void)ignore; @end namespace ObjQt { static OF_INLINE QtEvent * toOF(QEvent *qEvent) { return [[[QtEvent alloc] initWithQEvent: qEvent] autorelease]; } static OF_INLINE QEvent * toQt(QtEvent *event) { return [event qEvent]; } } |
Modified src/QtCore/QtEvent.mm from [a8eec8c991] to [8e511e2d99].
︙ | ︙ | |||
31 32 33 34 35 36 37 | } - init { OF_INVALID_INIT_METHOD } | | | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | } - init { OF_INVALID_INIT_METHOD } - initWithQEvent: (QEvent *)qEvent { self = [super init]; _qEvent = qEvent; return self; } |
︙ | ︙ |
Modified src/QtCore/QtObject.h from [6c34637edf] to [ba457e33e9].
︙ | ︙ | |||
36 37 38 39 40 41 42 | } @property (readonly) QObject *qObject; @property (readonly) const QMetaObject *metaObject; @property (retain) QtObject *parent; @property (copy) OFString *objectName; | > | | | | | | | | | | | | | | | | | | | | | | | | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | } @property (readonly) QObject *qObject; @property (readonly) const QMetaObject *metaObject; @property (retain) QtObject *parent; @property (copy) OFString *objectName; - init OF_UNAVAILABLE; - initWithQObject: (QObject *)qObject; - (bool)setBlockSignals: (bool)block; - (OFArray OF_GENERIC(QtObject *) *)children; - (QMetaObject::Connection)connectSignal: (OFString *)signal sender: (QtObject *)sender method: (OFString *)method type: (Qt::ConnectionType)type; - (bool)disconnectSignal: (OFString *)signal receiver: (QtObject *)receiver method: (OFString *)method; - (bool)disconnectAllSignalsForReceiver: (QtObject *)receiver method: (OFString *)method; - (void)dumpObjectInfo; - (void)dumpObjectTree; - (OFArray OF_GENERIC(OFDataArray *) *)dynamicPropertyNames; - (bool)handleEvent: (QtEvent *)event; - (bool)filterEvent: (QtEvent *)event forObject: (QtObject *)watched; // MISSING: T findChild(const QString &name = QString(), // Qt::FindChildOptions options = Qt::FindChildrenRecursively) const; // MISSING QList<T> findChildren(const QString &name = QString(), // Qt::FindChildOptions options = Qt::FindChildrenRecursively) const; // MISSING: QList<T> findChildren(const QRegExp ®Exp, // Qt::FindChildOptions options = Qt::FindChildrenRecursively) const; - (bool)inheritsClassWithName: (OFString *)className; - (void)installEventFilter: (QtObject *)filterObj; - (bool)isWidgetType; - (bool)isWindowType; - (void)killTimerWithID: (int)ID; - (void)moveToThread: (QtThread *)targetThread; - (QVariant)propertyForName: (OFString *)name; - (void)removeEventFilter: (QtObject *)obj; - (bool)setProperty: (QVariant&)value forName: (OFString *)name; - (bool)signalsBlocked; - (int)startTimerWithInterval: (int)interval type: (Qt::TimerType)type; - (QtThread *)thread; - (void)deleteLater; @end namespace ObjQt { static OF_INLINE QtObject * toOF(QObject *qObject) { return [[[QtObject alloc] initWithQObject: qObject] autorelease]; } static OF_INLINE QObject * toQt(QtObject *object) { return [object qObject]; } } |
Modified src/QtCore/QtObject.mm from [c04c6365a3] to [e59a1442ac].
︙ | ︙ | |||
35 36 37 38 39 40 41 | @synthesize qObject = _qObject; - init { OF_INVALID_INIT_METHOD } | | | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | @synthesize qObject = _qObject; - init { OF_INVALID_INIT_METHOD } - initWithQObject: (QObject *)qObject { self = [super init]; _qObject = qObject; return self; } |
︙ | ︙ | |||
64 65 66 67 68 69 70 | - (void)giveUpOwnership { OF_ENSURE(_ownsObject); _ownsObject = false; } | | | | | | | | | | | | | | | | | | | | | | | | | | | | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | - (void)giveUpOwnership { OF_ENSURE(_ownsObject); _ownsObject = false; } - (OFString *)objectName { return toOF(_qObject->objectName()); } - (void)setObjectName: (OFString *)objectName { _qObject->setObjectName(toQt(objectName)); } - (bool)setBlockSignals: (bool)block { return _qObject->blockSignals(block); } - (OFArray OF_GENERIC(QtObject *) *)children { const QObjectList &qChildren = _qObject->children(); OFMutableArray *children = [OFMutableArray arrayWithCapacity: qChildren.count()]; void *pool = objc_autoreleasePoolPush(); for (QObject *qChild: qChildren) [children addObject: toOF(qChild)]; [children makeImmutable]; objc_autoreleasePoolPop(pool); return children; } - (QMetaObject::Connection)connectSignal: (OFString *)signal sender: (QtObject *)sender method: (OFString *)method type: (Qt::ConnectionType)type { return _qObject->connect(toQt(sender), [signal UTF8String], [method UTF8String], type); } - (bool)disconnectSignal: (OFString *)signal receiver: (QtObject *)receiver method: (OFString *)method { return _qObject->disconnect([signal UTF8String], toQt(receiver), [method UTF8String]); } - (bool)disconnectAllSignalsForReceiver: (QtObject *)receiver method: (OFString *)method { return _qObject->disconnect(toQt(receiver), [method UTF8String]); } - (void)dumpObjectInfo { _qObject->dumpObjectInfo(); } - (void)dumpObjectTree { _qObject->dumpObjectTree(); } - (OFArray OF_GENERIC(OFDataArray *) *)dynamicPropertyNames { const QList<QByteArray> &dynamicPropertyNames = _qObject->dynamicPropertyNames(); OFMutableArray *ret = [OFMutableArray arrayWithCapacity: dynamicPropertyNames.count()]; void *pool = objc_autoreleasePoolPush(); for (const QByteArray &dynamicPropertyName: dynamicPropertyNames) [ret addObject: toOF(dynamicPropertyName)]; [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } - (bool)handleEvent: (QtEvent *)event { return _qObject->event(toQt(event)); } - (bool)filterEvent: (QtEvent *)event forObject: (QtObject *)watched { return _qObject->eventFilter(toQt(watched), toQt(event)); } - (bool)inheritsClassWithName: (OFString *)className { return _qObject->inherits([className UTF8String]); } - (void)installEventFilter: (QtObject *)filterObj { _qObject->installEventFilter(toQt(filterObj)); } - (bool)isWidgetType { return _qObject->isWidgetType(); } - (bool)isWindowType { return _qObject->isWindowType(); } - (void)killTimerWithID: (int)ID { _qObject->killTimer(ID); } - (const QMetaObject *)metaObject { return _qObject->metaObject(); } - (void)moveToThread: (QtThread *)targetThread { _qObject->moveToThread(toQt(targetThread)); } - (QtObject *)parent { return toOF(_qObject->parent()); } - (void)setParent: (QtObject *)parent { _qObject->setParent(toQt(parent)); } - (QVariant)propertyForName: (OFString *)name { return _qObject->property([name UTF8String]); } - (void)removeEventFilter: (QtObject *)obj { _qObject->removeEventFilter(toQt(obj)); } - (bool)setProperty: (QVariant &)value forName: (OFString *)name { return _qObject->setProperty([name UTF8String], value); } - (bool)signalsBlocked { return _qObject->signalsBlocked(); } - (int)startTimerWithInterval: (int)interval type: (Qt::TimerType)type { return _qObject->startTimer(interval, type); } - (QtThread *)thread { return toOF(_qObject->thread()); } - (void)deleteLater { OF_ENSURE(!_ownsObject); _qObject->deleteLater(); } @end |
Modified src/QtCore/QtThread.h from [c9467afda7] to [43325aa0ce].
︙ | ︙ | |||
30 31 32 33 34 35 36 | @property (readonly, getter=isFinished) bool finished; @property (readonly, getter=isInterruptionRequested) bool interruptionRequested; @property (readonly, getter=isRunning) bool running; @property (readonly) int loopLevel; @property QThread::Priority priority; @property unsigned int stackSize; | > | | | | 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 59 60 61 | @property (readonly, getter=isFinished) bool finished; @property (readonly, getter=isInterruptionRequested) bool interruptionRequested; @property (readonly, getter=isRunning) bool running; @property (readonly) int loopLevel; @property QThread::Priority priority; @property unsigned int stackSize; - initWithQObject: (QObject *)qObject OF_UNAVAILABLE; - initWithQThread: (QThread *)qThread; - (void)exitWithReturnCode: (int)returnCode; - (void)requestInterruption; - (bool)waitForMilliseconds: (unsigned long)time; - (void)quit; - (void)startWithPriority: (QThread::Priority)priority; - (void)terminate; @end namespace ObjQt { static OF_INLINE QtThread * toOF(QThread *qThread) { return [[[QtThread alloc] initWithQThread: qThread] autorelease]; } static OF_INLINE QThread * toQt(QtThread *thread) { return [thread qThread]; } } |
Modified src/QtCore/QtThread.mm from [117e62c463] to [fd57508770].
︙ | ︙ | |||
21 22 23 24 25 26 27 | */ #import "QtThread.h" using ObjQt::toQt; @implementation QtThread: QtObject | | | | | | | | 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 | */ #import "QtThread.h" using ObjQt::toQt; @implementation QtThread: QtObject - initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } - initWithQThread: (QThread *)qThread { return [super initWithQObject: qThread]; } - (QThread *)qThread { return qobject_cast<QThread *>(_qObject); } - (QAbstractEventDispatcher *)eventDispatcher { return toQt(self)->eventDispatcher(); } - (void)setEventDispatcher: (QAbstractEventDispatcher *)eventDispatcher { toQt(self)->setEventDispatcher(eventDispatcher); } - (void)exitWithReturnCode: (int)returnCode { toQt(self)->exit(returnCode); |
︙ | ︙ |
Modified src/QtGui/QtGUIApplication.h from [39d7116def] to [8f1cb558e8].
︙ | ︙ | |||
32 33 34 35 36 37 38 | #endif @property Qt::LayoutDirection layoutDirection; @property (readonly, copy) OFString *platformName; @property (readonly) QScreen *primaryScreen; @property bool quitsOnLastWindowClosed; @property QIcon windowIcon; | > | | | | | | 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 59 60 61 62 63 | #endif @property Qt::LayoutDirection layoutDirection; @property (readonly, copy) OFString *platformName; @property (readonly) QScreen *primaryScreen; @property bool quitsOnLastWindowClosed; @property QIcon windowIcon; - initWithQCoreApplication: (QCoreApplication *)qCoreApplication OF_UNAVAILABLE; - initWithQGuiApplication: (QGuiApplication *)qGuiApplication; - (double)devicePixelRatio; - (bool)isSavingSession; - (bool)isSessionRestored; - (OFString *)sessionID; - (OFString *)sessionKey; @end namespace ObjQt { static OF_INLINE QtGUIApplication * toOF(QGuiApplication *qGuiApplication) { return [[[QtGUIApplication alloc] initWithQGuiApplication: qGuiApplication] autorelease]; } static OF_INLINE QGuiApplication * toQt(QtGUIApplication *GUIApplication) { return [GUIApplication qGuiApplication]; } } |
Modified src/QtGui/QtGUIApplication.mm from [f0fdef84ef] to [69d747a94f].
︙ | ︙ | |||
25 26 27 28 29 30 31 | #include <QIcon> using ObjQt::toOF; using ObjQt::toQt; @implementation QtGUIApplication | | | | | | | | | | 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 59 60 61 62 63 64 65 66 67 68 69 70 | #include <QIcon> using ObjQt::toOF; using ObjQt::toQt; @implementation QtGUIApplication - initWithQCoreApplication: (QCoreApplication *)qCoreApplication { OF_INVALID_INIT_METHOD } - initWithQGuiApplication: (QGuiApplication *)qGuiApplication { return [super initWithQCoreApplication: qGuiApplication]; } - (QGuiApplication *)qGuiApplication { return qobject_cast<QGuiApplication *>(_qObject); } - (OFString *)applicationDisplayName { return toOF(toQt(self)->applicationDisplayName()); } - (void)setApplicationDisplayName: (OFString *)applicationDisplayName { toQt(self)->setApplicationDisplayName(toQt(applicationDisplayName)); } #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) - (OFString *)desktopFileName { return toOF(toQt(self)->desktopFileName()); } - (void)setDesktopFileName: (OFString *)desktopFileName { toQt(self)->setDesktopFileName(toQt(desktopFileName)); } #endif - (double)devicePixelRatio { |
︙ | ︙ | |||
87 88 89 90 91 92 93 | } - (void)setLayoutDirection: (Qt::LayoutDirection)layoutDirection { toQt(self)->setLayoutDirection(layoutDirection); } | | | | | | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | } - (void)setLayoutDirection: (Qt::LayoutDirection)layoutDirection { toQt(self)->setLayoutDirection(layoutDirection); } - (OFString *)platformName { return toOF(toQt(self)->platformName()); } - (QScreen *)primaryScreen { return toQt(self)->primaryScreen(); } - (bool)quitsOnLastWindowClosed { return toQt(self)->quitOnLastWindowClosed(); } - (void)setQuitsOnLastWindowClosed: (bool)quitsOnLastWindowClosed { toQt(self)->setQuitOnLastWindowClosed(quitsOnLastWindowClosed); } - (OFString *)sessionID { return toOF(toQt(self)->sessionId()); } - (OFString *)sessionKey { return toOF(toQt(self)->sessionKey()); } - (QIcon)windowIcon { return toQt(self)->windowIcon(); |
︙ | ︙ |
Modified src/QtGui/QtPaintDevice.h from [de5420f5ab] to [ac14220fb1].
︙ | ︙ | |||
21 22 23 24 25 26 27 | */ #import <ObjFW/ObjFW.h> #include <QPaintDevice> @protocol QtPaintDevice | | | | | 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 59 | */ #import <ObjFW/ObjFW.h> #include <QPaintDevice> @protocol QtPaintDevice - (QPaintDevice *)qPaintDevice; - (int)colorCount; - (int)depth; - (int)devicePixelRatio; #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) - (double)devicePixelRatioF; #endif - (int)height; - (int)heightMM; - (int)logicalDPIX; - (int)logicalDPIY; - (QPaintEngine *)paintEngine; - (bool)paintingActive; - (int)physicalDPIX; - (int)physicalDPIY; - (int)width; - (int)widthMM; @end @interface QtPaintDevice: OFObject <QtPaintDevice> @property (readonly) QObject *qObject; @end namespace ObjQt { static OF_INLINE QPaintDevice * toQt(QtPaintDevice *paintDevice) { return [paintDevice qPaintDevice]; } } |
Modified src/QtGui/QtPaintDevice.mm from [16b48401ce] to [dfb9eb98ed].
︙ | ︙ | |||
25 26 27 28 29 30 31 | #include <QObject> using ObjQt::toQt; @implementation QtPaintDevice @dynamic qObject; | | | | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #include <QObject> using ObjQt::toQt; @implementation QtPaintDevice @dynamic qObject; - (QPaintDevice *)qPaintDevice { return dynamic_cast<QPaintDevice *>([self qObject]); } - (int)colorCount { return toQt(self)->colorCount(); } |
︙ | ︙ | |||
72 73 74 75 76 77 78 | } - (int)logicalDPIY { return toQt(self)->logicalDpiY(); } | | | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | } - (int)logicalDPIY { return toQt(self)->logicalDpiY(); } - (QPaintEngine *)paintEngine { return toQt(self)->paintEngine(); } - (bool)paintingActive { return toQt(self)->paintingActive(); |
︙ | ︙ |
Modified src/QtWidgets/QtAbstractButton.h from [de5ca4911a] to [b2c785da49].
︙ | ︙ | |||
34 35 36 37 38 39 40 | @property (getter=isChecked) bool checked; @property (getter=isDown) bool down; @property QIcon icon; @property of_dimension_t iconSize; @property QKeySequence shortcut; @property (copy) OFString *text; | > | | | | | 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 59 60 61 | @property (getter=isChecked) bool checked; @property (getter=isDown) bool down; @property QIcon icon; @property of_dimension_t iconSize; @property QKeySequence shortcut; @property (copy) OFString *text; - initWithQWidget: (QWidget *)qWidget OF_UNAVAILABLE; - initWithQAbstractButton: (QAbstractButton *)qAbstractButton; - (QButtonGroup *)group; @end namespace ObjQt { static OF_INLINE QtAbstractButton * toOF(QAbstractButton *qAbstractButton) { return [[[QtAbstractButton alloc] initWithQAbstractButton: qAbstractButton] autorelease]; } static OF_INLINE QAbstractButton * toQt(QtAbstractButton *abstractButton) { return [abstractButton qAbstractButton]; } } |
Modified src/QtWidgets/QtAbstractButton.mm from [7722808b16] to [16048af6f6].
︙ | ︙ | |||
25 26 27 28 29 30 31 | #import "helpers.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtAbstractButton | | | | | | 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 | #import "helpers.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtAbstractButton - initWithQWidget: (QWidget *)qWidget { OF_INVALID_INIT_METHOD } - initWithQAbstractButton: (QAbstractButton *)qAbstractButton { return [super initWithQWidget: qAbstractButton]; } - (QAbstractButton *)qAbstractButton { return qobject_cast<QAbstractButton *>(_qObject); } - (bool)autoExclusive { return toQt(self)->autoExclusive(); } |
︙ | ︙ | |||
140 141 142 143 144 145 146 | } - (void)setShortcut: (QKeySequence)shortcut { toQt(self)->setShortcut(shortcut); } | | | | | 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | } - (void)setShortcut: (QKeySequence)shortcut { toQt(self)->setShortcut(shortcut); } - (OFString *)text { return toOF(toQt(self)->text()); } - (void)setText: (OFString *)text { toQt(self)->setText(toQt(text)); } - (QButtonGroup *)group { return toQt(self)->group(); } @end |
Modified src/QtWidgets/QtAction.h from [f6acd86617] to [786b963eba].
︙ | ︙ | |||
42 43 44 45 46 47 48 | @property Qt::ShortcutContext shortcutContext; @property (copy) OFString *statusTip; @property (copy) OFString *text; @property (copy) OFString *toolTip; @property (getter=isVisible) bool visible; @property (copy) OFString *whatsThis; | > | | | | | | | | | | | | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | @property Qt::ShortcutContext shortcutContext; @property (copy) OFString *statusTip; @property (copy) OFString *text; @property (copy) OFString *toolTip; @property (getter=isVisible) bool visible; @property (copy) OFString *whatsThis; - initWithQObject: (QObject *)qObject OF_UNAVAILABLE; - initWithQAction: (QAction *)qAction; - (QActionGroup *)actionGroup; - (void)activate: (QAction::ActionEvent)event; - (QList<QGraphicsWidget *>)associatedGraphicsWidgets; - (OFArray OF_GENERIC(QtWidget *) *)associatedWidgets; - (QVariant)data; - (bool)isSeparator; - (QMenu *)menu; - (QtWidget *)parentWidget; - (void)setActionGroup: (QActionGroup *)group; - (void)setData: (const QVariant&)data; - (void)setMenu: (QMenu *)menu; - (void)setSeparator: (bool)isSeparator; - (void)setShortcuts: (const QList<QKeySequence>&)shortcuts; - (void)setShortcutsWithStandardKey: (QKeySequence::StandardKey)key; - (QList<QKeySequence>)shortcuts; - (bool)showStatusText: (QtWidget *)widget; @end namespace ObjQt { static OF_INLINE QtAction * toOF(QAction *qAction) { return [[[QtAction alloc] initWithQAction: qAction] autorelease]; } static OF_INLINE QAction * toQt(QtAction *action) { return [action qAction]; } } |
Modified src/QtWidgets/QtAction.mm from [d6c33d3e64] to [7055d441a2].
︙ | ︙ | |||
24 25 26 27 28 29 30 | #import "QtWidget.h" #import "OFString+QString.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtAction | | | | | | 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 | #import "QtWidget.h" #import "OFString+QString.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtAction - initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } - initWithQAction: (QAction *)qAction { return [super initWithQObject: qAction]; } - (QAction *)qAction { return qobject_cast<QAction *>(_qObject); } - (bool)autoRepeat { return toQt(self)->autoRepeat(); } |
︙ | ︙ | |||
99 100 101 102 103 104 105 | } - (void)setIcon: (QIcon)icon { toQt(self)->setIcon(icon); } | | | | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | } - (void)setIcon: (QIcon)icon { toQt(self)->setIcon(icon); } - (OFString *)iconText { return toOF(toQt(self)->iconText()); } - (void)setIconText: (OFString *)iconText { toQt(self)->setIconText(toQt(iconText)); } - (bool)isIconVisibleInMenu { return toQt(self)->isIconVisibleInMenu(); |
︙ | ︙ | |||
159 160 161 162 163 164 165 | } - (void)setShortcutContext: (Qt::ShortcutContext)shortcutContext { toQt(self)->setShortcutContext(shortcutContext); } | | | | | | | | | | | | | | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | } - (void)setShortcutContext: (Qt::ShortcutContext)shortcutContext { toQt(self)->setShortcutContext(shortcutContext); } - (OFString *)statusTip { return toOF(toQt(self)->statusTip()); } - (void)setStatusTip: (OFString *)statusTip { toQt(self)->setStatusTip(toQt(statusTip)); } - (OFString *)text { return toOF(toQt(self)->text()); } - (void)setText: (OFString *)text { toQt(self)->setText(toQt(text)); } - (OFString *)toolTip { return toOF(toQt(self)->toolTip()); } - (void)setToolTip: (OFString *)toolTip { toQt(self)->setToolTip(toQt(toolTip)); } - (bool)isVisible { return toQt(self)->isVisible(); } - (void)setVisible: (bool)visible { toQt(self)->setVisible(visible); } - (OFString *)whatsThis { return toOF(toQt(self)->whatsThis()); } - (void)setWhatsThis: (OFString *)whatsThis { toQt(self)->setWhatsThis(toQt(whatsThis)); } - (QActionGroup *)actionGroup { return toQt(self)->actionGroup(); } - (void)activate: (QAction::ActionEvent)event { toQt(self)->activate(event); } - (QList<QGraphicsWidget *>)associatedGraphicsWidgets { return toQt(self)->associatedGraphicsWidgets(); } - (OFArray OF_GENERIC(QtWidget *) *)associatedWidgets { const QList<QWidget *> &widgets = toQt(self)->associatedWidgets(); OFMutableArray *ret = [OFMutableArray arrayWithCapacity: widgets.count()]; void *pool = objc_autoreleasePoolPush(); for (QWidget *widget: widgets) [ret addObject: toOF(widget)]; |
︙ | ︙ | |||
251 252 253 254 255 256 257 | } - (bool)isSeparator { return toQt(self)->isSeparator(); } | | | | | | | | | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | } - (bool)isSeparator { return toQt(self)->isSeparator(); } - (QMenu *)menu { return toQt(self)->menu(); } - (QtWidget *)parentWidget { return toOF(toQt(self)->parentWidget()); } - (void)setActionGroup: (QActionGroup *)group { toQt(self)->setActionGroup(group); } - (void)setData: (const QVariant &)userData { toQt(self)->setData(userData); } - (void)setMenu: (QMenu *)menu { toQt(self)->setMenu(menu); } - (void)setSeparator: (bool)isSeparator { toQt(self)->setSeparator(isSeparator); } - (void)setShortcuts: (const QList<QKeySequence> &)shortcuts { toQt(self)->setShortcuts(shortcuts); } - (void)setShortcutsWithStandardKey: (QKeySequence::StandardKey)key { toQt(self)->setShortcuts(key); } - (QList<QKeySequence>)shortcuts { return toQt(self)->shortcuts(); } - (bool)showStatusText: (QtWidget *)widget { return toQt(self)->showStatusText(toQt(widget)); } @end |
Modified src/QtWidgets/QtApplication.h from [4e836c2280] to [f8eefb765d].
︙ | ︙ | |||
32 33 34 35 36 37 38 | @property of_dimension_t globalStrut; @property int keyboardInputInterval; @property int startDragDistance; @property int startDragTime; @property (copy) OFString *styleSheet; @property int wheelScrollLines; | > | | | | 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 59 60 | @property of_dimension_t globalStrut; @property int keyboardInputInterval; @property int startDragDistance; @property int startDragTime; @property (copy) OFString *styleSheet; @property int wheelScrollLines; - initWithQGuiApplication: (QGuiApplication *)qGuiApplication OF_UNAVAILABLE; - initWithQApplication: (QApplication *)qApplication; - (void)aboutQt; - (void)closeAllWindows; @end namespace ObjQt { static OF_INLINE QtApplication * toOF(QApplication *qApplication) { return [[[QtApplication alloc] initWithQApplication: qApplication] autorelease]; } static OF_INLINE QApplication * toQt(QtApplication *application) { return [application qApplication]; } } |
Modified src/QtWidgets/QtApplication.mm from [56fa6f8c8c] to [579279b5d5].
︙ | ︙ | |||
25 26 27 28 29 30 31 | #import "helpers.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtApplication | | | | | | 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 | #import "helpers.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtApplication - initWithQGuiApplication: (QGuiApplication *)qGuiApplication { OF_INVALID_INIT_METHOD } - initWithQApplication: (QApplication *)qApplication { return [super initWithQGuiApplication: qApplication]; } - (QApplication *)qApplication { return qobject_cast<QApplication *>(_qObject); } - (bool)autoSIPEnabled { return toQt(self)->autoSipEnabled(); } |
︙ | ︙ | |||
110 111 112 113 114 115 116 | } - (void)setStartDragTime: (int)startDragTime { toQt(self)->setStartDragTime(startDragTime); } | | | | 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | } - (void)setStartDragTime: (int)startDragTime { toQt(self)->setStartDragTime(startDragTime); } - (OFString *)styleSheet { return toOF(toQt(self)->styleSheet()); } - (void)setStyleSheet: (OFString *)styleSheet { toQt(self)->setStyleSheet(toQt(styleSheet)); } - (int)wheelScrollLines { return toQt(self)->wheelScrollLines(); |
︙ | ︙ |
Modified src/QtWidgets/QtPushButton.h from [7a67030b98] to [6a47526835].
︙ | ︙ | |||
24 25 26 27 28 29 30 | #import "QtAbstractButton.h" #include <QMenu> #include <QPushButton> @interface QtPushButton: QtAbstractButton @property (readonly) QPushButton *qPushButton; | | > | | | | | | 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 | #import "QtAbstractButton.h" #include <QMenu> #include <QPushButton> @interface QtPushButton: QtAbstractButton @property (readonly) QPushButton *qPushButton; @property QMenu *menu; @property bool autoDefault; @property (getter=isDefault, setter=setDefault:) bool default_; @property (getter=isFlat) bool flat; - initWithQAbstractButton: (QAbstractButton *)qAbstractButton OF_UNAVAILABLE; - initWithQPushButton: (QPushButton *)qPushButton; - initWithText: (OFString *)text; - initWithIcon: (QIcon)icon text: (OFString *)text; @end namespace ObjQt { static OF_INLINE QtPushButton * toOF(QPushButton *qPushButton) { return [[[QtPushButton alloc] initWithQPushButton: qPushButton] autorelease]; } static OF_INLINE QPushButton * toQt(QtPushButton *pushButton) { return [pushButton qPushButton]; } } |
Modified src/QtWidgets/QtPushButton.mm from [9e8bdaad72] to [ddd71ab879].
︙ | ︙ | |||
26 27 28 29 30 31 32 | #import "helpers.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtPushButton | < | | | | | | | | | 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | #import "helpers.h" using ObjQt::toOF; using ObjQt::toQt; @implementation QtPushButton - initWithQAbstractButton: (QAbstractButton *)qAbstractButton { OF_INVALID_INIT_METHOD } - initWithQPushButton: (QPushButton *)qPushButton { return [super initWithQAbstractButton: qPushButton]; } - initWithText: (OFString *)text { try { self = [self initWithQPushButton: new QPushButton(toQt(text))]; [self takeOwnership]; return self; } catch (const std::bad_alloc &e) { self = [super initWithQAbstractButton: NULL]; [self release]; throw; } } - initWithIcon: (QIcon)icon text: (OFString *)text { try { self = [self initWithQPushButton: new QPushButton(icon, toQt(text))]; [self takeOwnership]; return self; } catch (const std::bad_alloc &e) { self = [super initWithQAbstractButton: NULL]; [self release]; throw; } } - (QPushButton *)qPushButton { return qobject_cast<QPushButton *>(_qObject); } - (QMenu *)menu { return toQt(self)->menu(); } - (void)setMenu: (QMenu *)menu { toQt(self)->setMenu(menu); } - (bool)autoDefault { return toQt(self)->autoDefault(); |
︙ | ︙ |
Modified src/QtWidgets/QtWidget.h from [986333abc0] to [5ea63b6548].
︙ | ︙ | |||
82 83 84 85 86 87 88 | @property Qt::WindowModality windowModality; @property (getter=isWindowModified) bool windowModified; @property double windowOpacity; @property (copy) OFString *windowTitle; @property (readonly) int x; @property (readonly) int y; | > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | @property Qt::WindowModality windowModality; @property (getter=isWindowModified) bool windowModified; @property double windowOpacity; @property (copy) OFString *windowTitle; @property (readonly) int x; @property (readonly) int y; - initWithQObject: (QObject *)qObject OF_UNAVAILABLE; - initWithQWidget: (QWidget *)qWidget; - (OFArray OF_GENERIC(QtAction *) *)actions; - (void)activateWindow; - (void)addAction: (QtAction *)action; - (void)addActions: (OFArray OF_GENERIC(QtAction *) *)actions; - (void)adjustSize; - (QPalette::ColorRole)backgroundRole; - (QBackingStore *)backingStore; - (QtWidget *)childAt: (of_point_t)point; - (void)clearFocus; - (void)clearMask; - (QMargins)contentsMargins; - (of_rectangle_t)contentsRect; - (WId)effectiveWinID; - (void)ensurePolished; - (QtWidget *)focusProxy; - (QtWidget *)focusWidget; - (QFontInfo)fontInfo; - (QFontMetrics)fontMetrics; - (QPalette::ColorRole)foregroundRole; - (QPixmap)grabRectangle: (of_rectangle_t)rectangle; - (void)grabGesture: (Qt::GestureType)gesture; - (void)grabGesture: (Qt::GestureType)gesture flags: (Qt::GestureFlags)flags; - (void)grabKeyboard; - (void)grabMouse; - (void)grabMouseWithCursor: (const QCursor &)cursor; - (int)grabShortcutWithKey: (const QKeySequence &)key; - (int)grabShortcutWithKey: (const QKeySequence &)key context: (Qt::ShortcutContext)context; - (QGraphicsEffect *)graphicsEffect; - (QGraphicsProxyWidget *)graphicsProxyWidget; #ifdef QT_KEYPAD_NAVIGATION - (bool)hasEditFocus; #endif - (bool)hasFocus; - (bool)hasHeightForWidth; - (int)heightForWidth: (int)w; - (QVariant)queryInputMethod: (Qt::InputMethodQuery)query; - (void)insertAction: (QtAction *)action before: (QtAction *)before; - (void)insertActions: (OFArray OF_GENERIC(QtAction *) *)actions before: (QtAction *)before; - (bool)isAncestorOf: (QtWidget *)child; - (bool)isEnabledTo: (QtWidget *)ancestor; - (bool)isHidden; - (bool)isVisibleTo: (QtWidget *)ancestor; - (bool)isWindow; - (of_point_t)mapPosition: (of_point_t)pos from: (QtWidget *)parent; - (of_point_t)mapPositionFromGlobal: (of_point_t)pos; - (of_point_t)mapPositionFromParent: (of_point_t)pos; - (of_point_t)mapPosition: (of_point_t)pos to: (QtWidget *)parent; - (of_point_t)mapPositionToGlobal: (of_point_t)pos; - (of_point_t)mapPositionToParent: (of_point_t)pos; - (QRegion)mask; - (QtWidget *)nativeParentWidget; - (QtWidget *)nextInFocusChain; - (void)overrideWindowFlags: (Qt::WindowFlags)flags; - (QtWidget *)parentWidget; - (QtWidget *)previousInFocusChain; - (void)releaseKeyboard; - (void)releaseMouse; - (void)releaseShortcut: (int)ID; - (void)removeAction: (QtAction *)action; - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion; - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion flags: (QWidget::RenderFlags)renderFlags; - (void)renderIntoPainter: (QPainter *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion; - (void)renderIntoPainter: (QPainter *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion flags: (QWidget::RenderFlags)renderFlags; - (void)repaintInRectangle: (of_rectangle_t)rect; - (void)repaintInRegion: (const QRegion &)region; - (bool)restoreGeometry: (OFDataArray *)geometry; - (OFDataArray *)saveGeometry; - (void)scrollRight: (int)dx down: (int)dy; - (void)scrollRight: (int)dx down: (int)dy inRectangle: (of_rectangle_t)rect; - (void)setAttribute: (Qt::WidgetAttribute)attribute to: (bool)on; #ifdef QT_KEYPAD_NAVIGATION - (void)setEditFocus: (bool)enable; #endif - (void)setFixedHeight: (int)height; - (void)setFixedSize: (of_dimension_t)size; - (void)setFixedWidth: (int)width; - (void)setFocus: (Qt::FocusReason)reason; - (void)setFocusProxy: (QtWidget *)widget; - (void)setForegroundRole: (QPalette::ColorRole)role; - (void)setGraphicsEffect: (QGraphicsEffect *)effect; - (void)setLayout: (QLayout *)layout; - (void)setMaskFromBitmap: (const QBitmap &)bitmap; - (void)setMask: (const QRegion &)region; - (void)setParent: (QtWidget *)parent; - (void)setParent: (QtWidget *)parent flags: (Qt::WindowFlags)flags; - (void)setAutoRepeat: (bool)enable forShortcut: (int)ID; - (void)setEnabled: (bool)enable forShortcut: (int)ID; - (void)setStyle: (QStyle *)style; - (void)setWindowRole: (OFString *)role; - (void)setWindowState: (Qt::WindowStates)windowState; - (void)stackUnder: (QtWidget *)widget; - (QStyle *)style; - (bool)testAttribute: (Qt::WidgetAttribute)attribute; - (bool)isUnderMouse; - (void)ungrabGesture: (Qt::GestureType)gesture; - (void)unsetCursor; - (void)unsetLayoutDirection; - (void)unsetLocale; - (void)updateInRectangle: (of_rectangle_t)rect; - (void)updateInRegion: (const QRegion &)region; - (void)updateGeometry; - (QRegion)visibleRegion; - (WId)winID; - (QtWidget *)window; - (QWindow *)windowHandle; - (OFString *)windowRole; - (Qt::WindowStates)windowState; - (Qt::WindowType)windowType; @end @interface QtWidget (QtPaintDevice) <QtPaintDevice> @end namespace ObjQt { static OF_INLINE QtWidget * toOF(QWidget *qWidget) { return [[[QtWidget alloc] initWithQWidget: qWidget] autorelease]; } static OF_INLINE QWidget * toQt(QtWidget *widget) { return [widget qWidget]; } } |
Modified src/QtWidgets/QtWidget.mm from [f374133c3b] to [df0e867276].
︙ | ︙ | |||
36 37 38 39 40 41 42 | @implementation QtWidget + (void)initialize { if (self == [QtWidget class]) [self inheritMethodsFromClass: [QtPaintDevice class]]; } | | | | | | | | | | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | @implementation QtWidget + (void)initialize { if (self == [QtWidget class]) [self inheritMethodsFromClass: [QtPaintDevice class]]; } - initWithQObject: (QObject *)qObject { OF_INVALID_INIT_METHOD } - initWithQWidget: (QWidget *)qWidget { return [super initWithQObject: qWidget]; } - (QWidget *)qWidget { return qobject_cast<QWidget *>(_qObject); } - (bool)acceptDrops { return toQt(self)->acceptDrops(); } - (void)setAcceptDrops: (bool)acceptDrops { toQt(self)->setAcceptDrops(acceptDrops); } - (OFString *)accessibleDescription { return toOF(toQt(self)->accessibleDescription()); } - (void)setAccessibleDescription: (OFString *)accessibleDescription { toQt(self)->setAccessibleDescription(toQt(accessibleDescription)); } - (OFString *)accessibleName { return toOF(toQt(self)->accessibleName()); } - (void)setAccessibleName: (OFString *)accessibleName { toQt(self)->setAccessibleName(toQt(accessibleName)); } - (bool)autoFillBackground { return toQt(self)->autoFillBackground(); |
︙ | ︙ | |||
161 162 163 164 165 166 167 | } - (void)setFocusPolicy: (Qt::FocusPolicy)focusPolicy { toQt(self)->setFocusPolicy(focusPolicy); } | | | | 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | } - (void)setFocusPolicy: (Qt::FocusPolicy)focusPolicy { toQt(self)->setFocusPolicy(focusPolicy); } - (const QFont &)font { return toQt(self)->font(); } - (void)setFont: (const QFont &)font { toQt(self)->setFont(font); } - (of_rectangle_t)frameGeometry { return toOF(toQt(self)->frameGeometry()); |
︙ | ︙ | |||
341 342 343 344 345 346 347 | } - (of_rectangle_t)normalGeometry { return toOF(toQt(self)->normalGeometry()); } | | | | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 | } - (of_rectangle_t)normalGeometry { return toOF(toQt(self)->normalGeometry()); } - (const QPalette &)palette { return toQt(self)->palette(); } - (void)setPalette: (const QPalette &)palette { toQt(self)->setPalette(palette); } - (of_point_t)pos { return toOF(toQt(self)->pos()); |
︙ | ︙ | |||
401 402 403 404 405 406 407 | } - (void)setSizePolicy: (QSizePolicy)sizePolicy { toQt(self)->setSizePolicy(sizePolicy); } | | | | | | | | 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | } - (void)setSizePolicy: (QSizePolicy)sizePolicy { toQt(self)->setSizePolicy(sizePolicy); } - (OFString *)statusTip { return toOF(toQt(self)->statusTip()); } - (void)setStatusTip: (OFString *)statusTip { toQt(self)->setStatusTip(toQt(statusTip)); } - (OFString *)styleSheet { return toOF(toQt(self)->styleSheet()); } - (void)setStyleSheet: (OFString *)styleSheet { toQt(self)->setStyleSheet(toQt(styleSheet)); } - (OFString *)toolTip { return toOF(toQt(self)->toolTip()); } - (void)setToolTip: (OFString *)toolTip { toQt(self)->setToolTip(toQt(toolTip)); } - (int)toolTipDuration { return toQt(self)->toolTipDuration(); |
︙ | ︙ | |||
461 462 463 464 465 466 467 | } - (void)setVisible: (bool)visible { toQt(self)->setVisible(visible); } | | | | | | 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 | } - (void)setVisible: (bool)visible { toQt(self)->setVisible(visible); } - (OFString *)whatsThis { return toOF(toQt(self)->whatsThis()); } - (void)setWhatsThis: (OFString *)whatsThis { toQt(self)->setWhatsThis(toQt(whatsThis)); } - (int)width { return toQt(self)->width(); } - (OFString *)windowFilePath { return toOF(toQt(self)->windowFilePath()); } - (void)setWindowFilePath: (OFString *)windowFilePath { toQt(self)->setWindowFilePath(toQt(windowFilePath)); } - (Qt::WindowFlags)windowFlags { return toQt(self)->windowFlags(); |
︙ | ︙ | |||
536 537 538 539 540 541 542 | } - (void)setWindowOpacity: (double)windowOpacity { toQt(self)->setWindowOpacity(windowOpacity); } | | | | | | | | | | | 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | } - (void)setWindowOpacity: (double)windowOpacity { toQt(self)->setWindowOpacity(windowOpacity); } - (OFString *)windowTitle { return toOF(toQt(self)->windowTitle()); } - (void)setWindowTitle: (OFString *)windowTitle { toQt(self)->setWindowTitle(toQt(windowTitle)); } - (int)x { return toQt(self)->x(); } - (int)y { return toQt(self)->y(); } - (OFArray OF_GENERIC(QtAction *) *)actions { const QList<QAction *> &actions = toQt(self)->actions(); OFMutableArray *ret = [OFMutableArray arrayWithCapacity: actions.count()]; void *pool = objc_autoreleasePoolPush(); for (QAction *action: actions) [ret addObject: toOF(action)]; [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } - (void)activateWindow { toQt(self)->activateWindow(); } - (void)addAction: (QtAction *)action { toQt(self)->addAction(toQt(action)); } - (void)addActions: (OFArray OF_GENERIC(QtAction *) *)actions { QList<QAction *> list; for (QtAction *action in actions) list.append(toQt(action)); toQt(self)->addActions(list); } - (void)adjustSize { toQt(self)->adjustSize(); } - (QPalette::ColorRole)backgroundRole { return toQt(self)->backgroundRole(); } - (QBackingStore *)backingStore { return toQt(self)->backingStore(); } - (QtWidget *)childAt: (of_point_t)point { return toOF(toQt(self)->childAt(toQt(point))); } - (void)clearFocus { return toQt(self)->clearFocus(); |
︙ | ︙ | |||
643 644 645 646 647 648 649 | } - (void)ensurePolished { toQt(self)->ensurePolished(); } | | | | 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | } - (void)ensurePolished { toQt(self)->ensurePolished(); } - (QtWidget *)focusProxy { return toOF(toQt(self)->focusProxy()); } - (QtWidget *)focusWidget { return toOF(toQt(self)->focusWidget()); } - (QFontInfo)fontInfo { return toQt(self)->fontInfo(); |
︙ | ︙ | |||
694 695 696 697 698 699 700 | } - (void)grabMouse { toQt(self)->grabMouse(); } | | | | | | | 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 | } - (void)grabMouse { toQt(self)->grabMouse(); } - (void)grabMouseWithCursor: (const QCursor &)cursor { toQt(self)->grabMouse(cursor); } - (int)grabShortcutWithKey: (const QKeySequence &)key { return toQt(self)->grabShortcut(key); } - (int)grabShortcutWithKey: (const QKeySequence &)key context: (Qt::ShortcutContext)context { return toQt(self)->grabShortcut(key, context); } - (QGraphicsEffect *)graphicsEffect { return toQt(self)->graphicsEffect(); } - (QGraphicsProxyWidget *)graphicsProxyWidget { return toQt(self)->graphicsProxyWidget(); } #ifdef QT_KEYPAD_NAVIGATION - (bool)hasEditFocus { |
︙ | ︙ | |||
742 743 744 745 746 747 748 | } - (QVariant)queryInputMethod: (Qt::InputMethodQuery)query { return toQt(self)->inputMethodQuery(query); } | | | | | | | | | | | | | | | | | | | | | | | | 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 | } - (QVariant)queryInputMethod: (Qt::InputMethodQuery)query { return toQt(self)->inputMethodQuery(query); } - (void)insertAction: (QtAction *)action before: (QtAction *)before { toQt(self)->insertAction(toQt(before), toQt(action)); } - (void)insertActions: (OFArray OF_GENERIC(QtAction *) *)actions before: (QtAction *)before { QList<QAction *> list; for (QtAction *action in actions) list.append(toQt(action)); toQt(self)->insertActions(toQt(before), list); } - (bool)isAncestorOf: (QtWidget *)child { return toQt(self)->isAncestorOf(toQt(child)); } - (bool)isEnabledTo: (QtWidget *)ancestor { return toQt(self)->isEnabledTo(toQt(ancestor)); } - (bool)isHidden { return toQt(self)->isHidden(); } - (bool)isVisibleTo: (QtWidget *)ancestor { return toQt(self)->isVisibleTo(toQt(ancestor)); } - (bool)isWindow { return toQt(self)->isWindow(); } - (of_point_t)mapPosition: (of_point_t)pos from: (QtWidget *)parent { return toOF(toQt(self)->mapFrom(toQt(parent), toQt(pos))); } - (of_point_t)mapPositionFromGlobal: (of_point_t)pos { return toOF(toQt(self)->mapFromGlobal(toQt(pos))); } - (of_point_t)mapPositionFromParent: (of_point_t)pos { return toOF(toQt(self)->mapFromParent(toQt(pos))); } - (of_point_t)mapPosition: (of_point_t)pos to: (QtWidget *)parent { return toOF(toQt(self)->mapTo(toQt(parent), toQt(pos))); } - (of_point_t)mapPositionToGlobal: (of_point_t)pos { return toOF(toQt(self)->mapToGlobal(toQt(pos))); } - (of_point_t)mapPositionToParent: (of_point_t)pos { return toOF(toQt(self)->mapToParent(toQt(pos))); } - (QRegion)mask { return toQt(self)->mask(); } - (QtWidget *)nativeParentWidget { return toOF(toQt(self)->nativeParentWidget()); } - (QtWidget *)nextInFocusChain { return toOF(toQt(self)->nextInFocusChain()); } - (void)overrideWindowFlags: (Qt::WindowFlags)flags { toQt(self)->overrideWindowFlags(flags); } - (QtWidget *)parentWidget { return toOF(toQt(self)->parentWidget()); } - (QtWidget *)previousInFocusChain { return toOF(toQt(self)->previousInFocusChain()); } - (void)releaseKeyboard { toQt(self)->releaseKeyboard(); } - (void)releaseMouse { toQt(self)->releaseMouse(); } - (void)releaseShortcut: (int)ID { toQt(self)->releaseShortcut(ID); } - (void)removeAction: (QtAction *)action { toQt(self)->removeAction(toQt(action)); } - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion { toQt(self)->render([target qPaintDevice], toQt(targetOffset), sourceRegion); } - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion flags: (QWidget::RenderFlags)renderFlags { toQt(self)->render([target qPaintDevice], toQt(targetOffset), sourceRegion, renderFlags); } - (void)renderIntoPainter: (QPainter *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion { toQt(self)->render(target, toQt(targetOffset), sourceRegion); } - (void)renderIntoPainter: (QPainter *)target targetOffset: (of_point_t)targetOffset sourceRegion: (QRegion)sourceRegion flags: (QWidget::RenderFlags)renderFlags { toQt(self)->render(target, toQt(targetOffset), sourceRegion, renderFlags); } - (void)repaintInRectangle: (of_rectangle_t)rect { toQt(self)->repaint(toQt(rect)); } - (void)repaintInRegion: (const QRegion &)region { toQt(self)->repaint(region); } - (bool)restoreGeometry: (OFDataArray *)geometry { return toQt(self)->restoreGeometry(toQt(geometry)); } - (OFDataArray *)saveGeometry { return toOF(toQt(self)->saveGeometry()); } - (void)scrollRight: (int)dx down: (int)dy { |
︙ | ︙ | |||
965 966 967 968 969 970 971 | } - (void)setFocus: (Qt::FocusReason)reason { toQt(self)->setFocus(reason); } | | | | | | | | | | | | | 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 | } - (void)setFocus: (Qt::FocusReason)reason { toQt(self)->setFocus(reason); } - (void)setFocusProxy: (QtWidget *)widget { toQt(self)->setFocusProxy(toQt(widget)); } - (void)setForegroundRole: (QPalette::ColorRole)role { toQt(self)->setForegroundRole(role); } - (void)setGraphicsEffect: (QGraphicsEffect *)effect { toQt(self)->setGraphicsEffect(effect); } - (void)setLayout: (QLayout *)layout { toQt(self)->setLayout(layout); } - (void)setMaskFromBitmap: (const QBitmap &)bitmap { toQt(self)->setMask(bitmap); } - (void)setMask: (const QRegion &)region { toQt(self)->setMask(region); } - (void)setParent: (QtWidget *)parent { toQt(self)->setParent(toQt(parent)); } - (void)setParent: (QtWidget *)parent flags: (Qt::WindowFlags)flags { toQt(self)->setParent(toQt(parent), flags); } - (void)setAutoRepeat: (bool)enable forShortcut: (int)ID { toQt(self)->setShortcutAutoRepeat(ID, enable); } - (void)setEnabled: (bool)enable forShortcut: (int)ID { toQt(self)->setShortcutEnabled(ID, enable); } - (void)setStyle: (QStyle *)style { toQt(self)->setStyle(style); } - (void)setWindowRole: (OFString *)role { toQt(self)->setWindowRole(toQt(role)); } - (void)setWindowState: (Qt::WindowStates)windowState { toQt(self)->setWindowState(windowState); } - (void)stackUnder: (QtWidget *)widget { toQt(self)->stackUnder(toQt(widget)); } - (QStyle *)style { return toQt(self)->style(); } - (bool)testAttribute: (Qt::WidgetAttribute)attribute { return toQt(self)->testAttribute(attribute); |
︙ | ︙ | |||
1063 1064 1065 1066 1067 1068 1069 | } - (void)updateInRectangle: (of_rectangle_t)rect { toQt(self)->update(toQt(rect)); } | | | | | | 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 | } - (void)updateInRectangle: (of_rectangle_t)rect { toQt(self)->update(toQt(rect)); } - (void)updateInRegion: (const QRegion &)region { toQt(self)->update(region); } - (void)updateGeometry { toQt(self)->updateGeometry(); } - (QRegion)visibleRegion { return toQt(self)->visibleRegion(); } - (WId)winID { return toQt(self)->winId(); } - (QtWidget *)window { return toOF(toQt(self)->window()); } - (QWindow *)windowHandle { return toQt(self)->windowHandle(); } - (OFString *)windowRole { return toOF(toQt(self)->windowRole()); } - (Qt::WindowStates)windowState { return toQt(self)->windowState(); |
︙ | ︙ |
Modified src/common/OFDataArray+QByteArray.h from [f43313841c] to [f833005f89].
︙ | ︙ | |||
21 22 23 24 25 26 27 | */ #import <ObjFW/ObjFW.h> #include <QByteArray> @interface OFDataArray (QByteArray) | | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | */ #import <ObjFW/ObjFW.h> #include <QByteArray> @interface OFDataArray (QByteArray) + (instancetype)dataArrayWithQByteArray: (const QByteArray &)qByteArray; - (QByteArray)qByteArray; @end namespace ObjQt { static OF_INLINE OFDataArray * toOF(const QByteArray &qByteArray) { return [OFDataArray dataArrayWithQByteArray: qByteArray]; } static OF_INLINE QByteArray toQt(OFDataArray *dataArray) |
︙ | ︙ |
Modified src/common/OFDataArray+QByteArray.mm from [37ebb8afd0] to [d8eb348c3a].
︙ | ︙ | |||
19 20 21 22 23 24 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "OFDataArray+QByteArray.h" @implementation OFDataArray (QByteArray) | | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "OFDataArray+QByteArray.h" @implementation OFDataArray (QByteArray) + (instancetype)dataArrayWithQByteArray: (const QByteArray &)qByteArray { OFDataArray *ret = [OFDataArray dataArray]; [ret addItems: qByteArray.data() count: qByteArray.count()]; return ret; } - (QByteArray)qByteArray { return QByteArray((char *)[self items], [self count] * [self itemSize]); } @end |
Modified src/common/OFString+QString.h from [dd6dc45afe] to [fc2a76aadc].
︙ | ︙ | |||
21 22 23 24 25 26 27 | */ #import <ObjFW/ObjFW.h> #include <QString> @interface OFString (QString) | | | | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | */ #import <ObjFW/ObjFW.h> #include <QString> @interface OFString (QString) + (instancetype)stringWithQString: (const QString &)qString; - initWithQString: (const QString &)qString; - (QString)qString; @end namespace ObjQt { static OF_INLINE OFString * toOF(const QString &qString) { return [OFString stringWithQString: qString]; } static OF_INLINE QString toQt(OFString *string) |
︙ | ︙ |
Modified src/common/OFString+QString.mm from [0c44cda950] to [5b64399c2b].
︙ | ︙ | |||
19 20 21 22 23 24 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "OFString+QString.h" @implementation OFString (QString) | | | | | | | | | | 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 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "OFString+QString.h" @implementation OFString (QString) + stringWithQString: (const QString &)qString { return [[[self alloc] initWithQString: qString] autorelease]; } - initWithQString: (const QString &)qString { static_assert(sizeof(QChar) == sizeof(char16_t), "QChar and char16_t have a different size!"); return [self initWithUTF16String: (char16_t *)qString.data() length: qString.length()]; } - (QString)qString { static_assert(sizeof(char16_t) == sizeof(QChar), "char16_t and QChar have a different size!"); void *pool = objc_autoreleasePoolPush(); QString ret = QString((QChar *)[self UTF16String]); objc_autoreleasePoolPop(pool); return ret; } @end |