Comment: | Make toOF/toQt more powerful and complete QtWidget |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
3ece549448f7cfd39600c8f90d4c7fcc |
User & Date: | js on 2017-04-15 17:18:52 |
Other Links: | manifest | tags |
2017-04-16
| ||
19:09 | Make the Qt project work on Windows check-in: 38d57b4977 user: js tags: trunk | |
2017-04-15
| ||
17:18 | Make toOF/toQt more powerful and complete QtWidget check-in: 3ece549448 user: js tags: trunk | |
02:42 | Make Qt project work on non-Mac systems check-in: 0df95396ff user: js tags: trunk | |
Modified ObjQt.pro from [34f4d80068] to [f5d1613e99].
1 2 3 4 5 6 7 8 9 10 11 | TEMPLATE = lib TARGET = ObjQt DESTDIR = build OBJECTS_DIR = build QT += core gui widgets INCLUDEPATH += common \ QtCore \ QtGui \ QtWidgets | | > | | | | | | | | | | | > | | | | | | | | | | | 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 | TEMPLATE = lib TARGET = ObjQt DESTDIR = build OBJECTS_DIR = build QT += core gui widgets INCLUDEPATH += common \ QtCore \ QtGui \ QtWidgets HEADERS += common/helpers.h \ common/OFDataArray+QByteArray.h \ common/OFString+QString.h \ common/QtOwnershipManaging.h \ QtCore/QtChildEvent.h \ QtCore/QtCoreApplication.h \ QtCore/QtEvent.h \ QtCore/QtObject.h \ QtCore/QtThread.h \ QtGui/QtGUIApplication.h \ QtGui/QtPaintDevice.h \ QtWidgets/QtAction.h \ QtWidgets/QtApplication.h \ QtWidgets/QtWidget.h SOURCES += common/OFDataArray+QByteArray.mm \ common/OFString+QString.mm \ QtCore/QtChildEvent.mm \ QtCore/QtCoreApplication.mm \ QtCore/QtEvent.mm \ QtCore/QtObject.mm \ QtCore/QtThread.mm \ QtGui/QtGUIApplication.mm \ QtGui/QtPaintDevice.mm \ QtWidgets/QtAction.mm \ QtWidgets/QtApplication.mm \ QtWidgets/QtWidget.mm OBJCFLAGS += $$system("objfw-config --cppflags --objcflags --cxxflags") OBJCFLAGS_WARN_ON = -Wall \ -Werror \ -Wsemicolon-before-method-body \ -Wobjc-missing-property-synthesis |
︙ | ︙ |
Modified QtCore/QtChildEvent.h from [9dc2585a76] to [53abd485c2].
︙ | ︙ | |||
31 32 33 34 35 36 37 | @property (readonly, getter=isPolished) bool polished; @property (readonly, getter=isRemoved) bool removed; - initWithQChildEvent: (QChildEvent*)qChildEvent; - initWithType: (QChildEvent::Type)type child: (QtObject*)child; @end | > > > > > > > > > > > > > > > > > | 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | @property (readonly, getter=isPolished) bool polished; @property (readonly, getter=isRemoved) bool removed; - 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 QtCore/QtChildEvent.mm from [f611af8c09] to [0050860fa4].
︙ | ︙ | |||
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtChildEvent.h" #import "QtObject.h" @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: | > > > | | | < | | | 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #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(); } - (bool)isRemoved { return toQt(self)->removed(); } @end |
Modified QtCore/QtCoreApplication.h from [4f441fa3cb] to [dfc55ef348].
︙ | ︙ | |||
33 34 35 36 37 38 39 | - initWithQCoreApplication: (QCoreApplication*)qCoreApplication; - (void)installNativeEventFilter: (QAbstractNativeEventFilter*)filterObject; - (void)quit; - (void)removeNativeEventFilter: (QAbstractNativeEventFilter*)filterObject; - (bool)sendEvent: (QtEvent*)event receiver: (QtObject*)receiver; @end | > > > > > > > > > > > > > > > > > | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | - 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 QtCore/QtCoreApplication.mm from [948643ef9b] to [b055a533da].
︙ | ︙ | |||
18 19 20 21 22 23 24 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtCoreApplication.h" #import "QtEvent.h" | > < > > | | | | | < | < | | | | | | | | < | 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 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 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtCoreApplication.h" #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 QtCore/QtEvent.h from [227e728850] to [6eeefe4604].
︙ | ︙ | |||
38 39 40 41 42 43 44 | @property (readonly) QEvent::Type type; + (int)registerEventType: (int)hint; - initWithQEvent: (QEvent*)qEvent; - (void)accept; - (void)ignore; @end | > > > > > > > > > > > > > > > > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | @property (readonly) QEvent::Type type; + (int)registerEventType: (int)hint; - 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 QtCore/QtObject.h from [a3fdff21da] to [6c34637edf].
︙ | ︙ | |||
76 77 78 79 80 81 82 | forName: (OFString*)name; - (bool)signalsBlocked; - (int)startTimerWithInterval: (int)interval type: (Qt::TimerType)type; - (QtThread*)thread; - (void)deleteLater; @end | > > > > > > > > > > > > > > > > | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | 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 QtCore/QtObject.mm from [d103de14ea] to [c04c6365a3].
︙ | ︙ | |||
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 "QtObject.h" #import "QtEvent.h" #import "QtThread.h" | | | > > > | 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 "QtObject.h" #import "QtEvent.h" #import "QtThread.h" #import "OFString+QString.h" #import "OFDataArray+QByteArray.h" #include <QVariant> using ObjQt::toOF; using ObjQt::toQt; @implementation QtObject @synthesize qObject = _qObject; - init { OF_INVALID_INIT_METHOD |
︙ | ︙ | |||
84 85 86 87 88 89 90 | { const QObjectList &qChildren = _qObject->children(); OFMutableArray *children = [OFMutableArray arrayWithCapacity: qChildren.count()]; void *pool = objc_autoreleasePoolPush(); for (QObject *qChild: qChildren) | | < | | | | | | | < < | < | < | | | | | | 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 | { 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(); } |
︙ | ︙ | |||
192 193 194 195 196 197 198 | - (const QMetaObject*)metaObject { return _qObject->metaObject(); } - (void)moveToThread: (QtThread*)targetThread { | | < | | | | 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 | - (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); } |
︙ | ︙ | |||
235 236 237 238 239 240 241 | type: (Qt::TimerType)type { return _qObject->startTimer(interval, type); } - (QtThread*)thread { | < | | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | type: (Qt::TimerType)type { return _qObject->startTimer(interval, type); } - (QtThread*)thread { return toOF(_qObject->thread()); } - (void)deleteLater { OF_ENSURE(!_ownsObject); _qObject->deleteLater(); } @end |
Modified QtCore/QtThread.h from [149eabc8dd] to [c9467afda7].
︙ | ︙ | |||
38 39 40 41 42 43 44 | - (void)exitWithReturnCode: (int)returnCode; - (void)requestInterruption; - (bool)waitForMilliseconds: (unsigned long)time; - (void)quit; - (void)startWithPriority: (QThread::Priority)priority; - (void)terminate; @end | > > > > > > > > > > > > > > > > | 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | - (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 QtCore/QtThread.mm from [c9293dd1ab] to [117e62c463].
︙ | ︙ | |||
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 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtThread.h" @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 { | > > | | | | | | | | | | | | | | | | | 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 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 117 118 119 120 121 122 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #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); } - (bool)isFinished { return toQt(self)->isFinished(); } - (bool)isInterruptionRequested { return toQt(self)->isInterruptionRequested(); } - (bool)isRunning { return toQt(self)->isRunning(); } - (int)loopLevel { return toQt(self)->loopLevel(); } - (QThread::Priority)priority { return toQt(self)->priority(); } - (void)setPriority: (QThread::Priority)priority { toQt(self)->setPriority(priority); } - (void)requestInterruption { toQt(self)->requestInterruption(); } - (unsigned int)stackSize { return toQt(self)->stackSize(); } - (void)setStackSize: (unsigned int)stackSize { toQt(self)->setStackSize(stackSize); } - (bool)waitForMilliseconds: (unsigned long)time { return toQt(self)->wait(time); } - (void)quit { toQt(self)->quit(); } - (void)startWithPriority: (QThread::Priority)priority { toQt(self)->start(priority); } - (void)terminate { toQt(self)->terminate(); } @end |
Added QtGui/QtGUIApplication.h version [94e433c5c3].
Added QtGui/QtGUIApplication.mm version [d51001d0be].
Deleted QtGui/QtGuiApplication.h version [e6af0fcbec].
Deleted QtGui/QtGuiApplication.mm version [a4dbea1f9e].
Modified QtGui/QtPaintDevice.h from [0228d0430e] to [7d8d2afd79].
︙ | ︙ | |||
41 42 43 44 45 46 47 | - (int)width; - (int)widthMM; @end @interface QtPaintDevice: OFObject <QtPaintDevice> @property (readonly) QObject *qObject; @end | > > > > > > > > > > | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | - (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 QtGui/QtPaintDevice.mm from [6e4c1498e8] to [e4cb504292].
︙ | ︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtPaintDevice.h" #include <QObject> @implementation QtPaintDevice @dynamic qObject; - (QPaintDevice*)qPaintDevice { return dynamic_cast<QPaintDevice*>([self qObject]); } - (int)colorCount { | > > | | | | | | | | | | | | | | | 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 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 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtPaintDevice.h" #include <QObject> using ObjQt::toQt; @implementation QtPaintDevice @dynamic qObject; - (QPaintDevice*)qPaintDevice { return dynamic_cast<QPaintDevice*>([self qObject]); } - (int)colorCount { return toQt(self)->colorCount(); } - (int)depth { return toQt(self)->depth(); } - (int)devicePixelRatio { return toQt(self)->devicePixelRatio(); } - (double)devicePixelRatioF { return toQt(self)->devicePixelRatioF(); } - (int)height { return toQt(self)->height(); } - (int)heightMM { return toQt(self)->heightMM(); } - (int)logicalDPIX { return toQt(self)->logicalDpiX(); } - (int)logicalDPIY { return toQt(self)->logicalDpiY(); } - (QPaintEngine*)paintEngine { return toQt(self)->paintEngine(); } - (bool)paintingActive { return toQt(self)->paintingActive(); } - (int)physicalDPIX { return toQt(self)->physicalDpiX(); } - (int)physicalDPIY { return toQt(self)->physicalDpiY(); } - (int)width { return toQt(self)->width(); } - (int)widthMM { return toQt(self)->widthMM(); } @end |
Modified QtWidgets/QtAction.h from [c64a4c6e90] to [f6acd86617].
︙ | ︙ | |||
52 53 54 55 56 57 58 59 60 61 62 63 64 65 | - (QList<QGraphicsWidget*>)associatedGraphicsWidgets; - (OFArray OF_GENERIC(QtWidget*)*)associatedWidgets; - (QVariant)data; - (bool)isSeparator; - (QMenu*)menu; - (QtWidget*)parentWidget; - (void)setActionGroup: (QActionGroup*)group; - (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 | > > > > > > > > > > > > > > > > > | 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 | - (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 QtWidgets/QtAction.mm from [122eed180b] to [d6c33d3e64].
︙ | ︙ | |||
18 19 20 21 22 23 24 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtAction.h" #import "QtWidget.h" | > < > > | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | < | | > > > > > | | | | | | | 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 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 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 248 249 250 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 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtAction.h" #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(); } - (void)setAutoRepeat: (bool)autoRepeat { toQt(self)->setAutoRepeat(autoRepeat); } - (bool)isCheckable { return toQt(self)->isCheckable(); } - (void)setCheckable: (bool)checkable { toQt(self)->setCheckable(checkable); } - (bool)isChecked { return toQt(self)->isChecked(); } - (void)setChecked: (bool)checked { toQt(self)->setChecked(checked); } - (bool)isEnabled { return toQt(self)->isEnabled(); } - (void)setEnabled: (bool)enabled { toQt(self)->setEnabled(enabled); } - (QFont)font { return toQt(self)->font(); } - (void)setFont: (QFont)font { toQt(self)->setFont(font); } - (QIcon)icon { return toQt(self)->icon(); } - (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(); } - (void)setIconVisibleInMenu: (bool)iconVisibleInMenu { toQt(self)->setIconVisibleInMenu(iconVisibleInMenu); } - (QAction::MenuRole)menuRole { return toQt(self)->menuRole(); } - (void)setMenuRole: (QAction::MenuRole)menuRole { toQt(self)->setMenuRole(menuRole); } - (QAction::Priority)priority { return toQt(self)->priority(); } - (void)setPriority: (QAction::Priority)priority { toQt(self)->setPriority(priority); } - (QKeySequence)shortcut { return toQt(self)->shortcut(); } - (void)setShortcut: (QKeySequence)shortcut { toQt(self)->setShortcut(shortcut); } - (Qt::ShortcutContext)shortcutContext { return toQt(self)->shortcutContext(); } - (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)]; [ret makeImmutable]; objc_autoreleasePoolPop(pool); return ret; } - (QVariant)data { return toQt(self)->data(); } - (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 QtWidgets/QtApplication.h from [997e3bde7c] to [4e836c2280].
︙ | ︙ | |||
16 17 18 19 20 21 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ | | | | < < > > > > > > > > > > > > > > > > > | 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 59 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtGUIApplication.h" #include <QApplication> @interface QtApplication: QtGUIApplication @property (readonly) QApplication *qApplication; @property bool autoSIPEnabled; @property int cursorFlashTime; @property int doubleClickInterval; @property of_dimension_t globalStrut; @property int keyboardInputInterval; @property int startDragDistance; @property int startDragTime; @property (copy) OFString *styleSheet; @property int wheelScrollLines; - 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 QtWidgets/QtApplication.mm from [35f02118d0] to [56fa6f8c8c].
︙ | ︙ | |||
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 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtApplication.h" #import "helpers.h" @implementation QtApplication - initWithQGuiApplication: (QGuiApplication*)qGuiApplication { OF_INVALID_INIT_METHOD } - initWithQApplication: (QApplication*)qApplication { return [super initWithQGuiApplication: qApplication]; } - (QApplication*)qApplication { return qobject_cast<QApplication*>(_qObject); } | > > > > | | | | | | | | | | | | | | | | | | | | | | | 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 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 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 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtApplication.h" #import "OFString+QString.h" #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(); } - (void)setAutoSIPEnabled: (bool)autoSIPEnabled { toQt(self)->setAutoSipEnabled(autoSIPEnabled); } - (int)cursorFlashTime { return toQt(self)->cursorFlashTime(); } - (void)setCursorFlashTime: (int)cursorFlashTime { toQt(self)->setCursorFlashTime(cursorFlashTime); } - (int)doubleClickInterval { return toQt(self)->doubleClickInterval(); } - (void)setDoubleClickInterval: (int)doubleClickInterval { toQt(self)->setDoubleClickInterval(doubleClickInterval); } - (of_dimension_t)globalStrut { return toOF(toQt(self)->globalStrut()); } - (void)setGlobalStrut: (of_dimension_t)globalStrut { toQt(self)->setGlobalStrut(toQt(globalStrut)); } - (int)keyboardInputInterval { return toQt(self)->keyboardInputInterval(); } - (void)setKeyboardInputInterval: (int)keyboardInputInterval { toQt(self)->setKeyboardInputInterval(keyboardInputInterval); } - (int)startDragDistance { return toQt(self)->startDragDistance(); } - (void)setStartDragDistance: (int)startDragDistance { toQt(self)->setStartDragDistance(startDragDistance); } - (int)startDragTime { return toQt(self)->startDragTime(); } - (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(); } - (void)setWheelScrollLines: (int)wheelScrollLines { toQt(self)->setWheelScrollLines(wheelScrollLines); } - (void)aboutQt { toQt(self)->aboutQt(); } - (void)closeAllWindows { toQt(self)->closeAllWindows(); } @end |
Modified QtWidgets/QtWidget.h from [61a5454776] to [986333abc0].
︙ | ︙ | |||
35 36 37 38 39 40 41 | @property bool autoFillBackground; @property of_dimension_t baseSize; @property (readonly) of_rectangle_t childrenRect; @property (readonly) QRegion childrenRegion; @property Qt::ContextMenuPolicy contextMenuPolicy; @property QCursor cursor; @property (getter=isEnabled) bool enabled; | < | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | @property bool autoFillBackground; @property of_dimension_t baseSize; @property (readonly) of_rectangle_t childrenRect; @property (readonly) QRegion childrenRegion; @property Qt::ContextMenuPolicy contextMenuPolicy; @property QCursor cursor; @property (getter=isEnabled) bool enabled; @property Qt::FocusPolicy focusPolicy; @property const QFont &font; @property (readonly) of_rectangle_t frameGeometry; @property (readonly) of_dimension_t frameSize; @property (readonly, getter=isFullScreen) bool fullScreen; @property of_rectangle_t geometry; @property (readonly) int height; |
︙ | ︙ | |||
74 75 76 77 78 79 80 | @property (copy) OFString *styleSheet; @property (copy) OFString *toolTip; @property int toolTipDuration; @property bool updatesEnabled; @property (getter=isVisible) bool visible; @property (copy) OFString *whatsThis; @property (readonly) int width; | < | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | @property (copy) OFString *styleSheet; @property (copy) OFString *toolTip; @property int toolTipDuration; @property bool updatesEnabled; @property (getter=isVisible) bool visible; @property (copy) OFString *whatsThis; @property (readonly) int width; @property Qt::WindowFlags windowFlags; @property QIcon windowIcon; @property Qt::WindowModality windowModality; @property (getter=isWindowModified) bool windowModified; @property double windowOpacity; @property (copy) OFString *windowTitle; @property (readonly) int x; |
︙ | ︙ | |||
97 98 99 100 101 102 103 | - (QPalette::ColorRole)backgroundRole; - (QBackingStore*)backingStore; - (QtWidget*)childAt: (of_point_t)point; - (void)clearFocus; - (void)clearMask; - (QMargins)contentsMargins; - (of_rectangle_t)contentsRect; | | | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | - (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; |
︙ | ︙ | |||
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | - (int)grabShortcutWithKey: (const QKeySequence&)key context: (Qt::ShortcutContext)context; - (QGraphicsEffect*)graphicsEffect; - (QGraphicsProxyWidget*)graphicsProxyWidget; #ifdef QT_KEYPAD_NAVIGATION - (bool)hasEditFocus; #endif - (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; | > > | | | > | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 | - (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 QtWidgets/QtWidget.mm from [87d02fdba3] to [f374133c3b].
︙ | ︙ | |||
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtWidget.h" #import "QtAction.h" #import "helpers.h" #include <QIcon> #include <QLocale> @implementation QtWidget + (void)initialize { if (self == [QtWidget class]) [self inheritMethodsFromClass: [QtPaintDevice class]]; } | > > > > > | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "QtWidget.h" #import "QtAction.h" #import "OFString+QString.h" #import "OFDataArray+QByteArray.h" #import "helpers.h" #include <QIcon> #include <QLocale> using ObjQt::toOF; using ObjQt::toQt; @implementation QtWidget + (void)initialize { if (self == [QtWidget class]) [self inheritMethodsFromClass: [QtPaintDevice class]]; } |
︙ | ︙ | |||
48 49 50 51 52 53 54 | - (QWidget*)qWidget { return qobject_cast<QWidget*>(_qObject); } - (bool)acceptDrops { | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | < | | | | | | | < | | | | | | | | < | < | | | | | | | | | | | | | | | | | | | | | | | | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 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 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 248 249 250 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 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 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 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 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 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 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 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 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 730 731 732 733 734 735 736 737 738 739 740 741 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 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 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 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 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 1108 1109 1110 1111 1112 1113 1114 | - (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(); } - (void)setAutoFillBackground: (bool)autoFillBackground { toQt(self)->setAutoFillBackground(autoFillBackground); } - (of_dimension_t)baseSize { return toOF(toQt(self)->baseSize()); } - (void)setBaseSize: (of_dimension_t)baseSize { toQt(self)->setBaseSize(toQt(baseSize)); } - (of_rectangle_t)childrenRect { return toOF(toQt(self)->childrenRect()); } - (QRegion)childrenRegion { return toQt(self)->childrenRegion(); } - (Qt::ContextMenuPolicy)contextMenuPolicy { return toQt(self)->contextMenuPolicy(); } - (void)setContextMenuPolicy: (Qt::ContextMenuPolicy)contextMenuPolicy { toQt(self)->setContextMenuPolicy(contextMenuPolicy); } - (QCursor)cursor { return toQt(self)->cursor(); } - (void)setCursor: (QCursor)cursor { toQt(self)->setCursor(cursor); } - (void)unsetCursor { toQt(self)->unsetCursor(); } - (bool)isEnabled { return toQt(self)->isEnabled(); } - (void)setEnabled: (bool)enabled { toQt(self)->setEnabled(enabled); } - (bool)hasFocus { return toQt(self)->hasFocus(); } - (Qt::FocusPolicy)focusPolicy { return toQt(self)->focusPolicy(); } - (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()); } - (of_dimension_t)frameSize { return toOF(toQt(self)->frameSize()); } - (bool)isFullScreen { return toQt(self)->isFullScreen(); } - (of_rectangle_t)geometry { return toOF(toQt(self)->geometry()); } - (void)setGeometry: (of_rectangle_t)geometry { toQt(self)->setGeometry(toQt(geometry)); } - (int)height { return toQt(self)->height(); } - (Qt::InputMethodHints)inputMethodHints { return toQt(self)->inputMethodHints(); } - (void)setInputMethodHints: (Qt::InputMethodHints)inputMethodHints { toQt(self)->setInputMethodHints(inputMethodHints); } - (bool)isActiveWindow { return toQt(self)->isActiveWindow(); } - (Qt::LayoutDirection)layoutDirection { return toQt(self)->layoutDirection(); } - (void)setLayoutDirection: (Qt::LayoutDirection)layoutDirection { toQt(self)->setLayoutDirection(layoutDirection); } - (void)unsetLayoutDirection { toQt(self)->unsetLayoutDirection(); } - (QLocale)locale { return toQt(self)->locale(); } - (void)setLocale: (QLocale)locale { toQt(self)->setLocale(locale); } - (void)unsetLocale { toQt(self)->unsetLocale(); } - (bool)isMaximized { return toQt(self)->isMaximized(); } - (int)maximumHeight { return toQt(self)->maximumHeight(); } - (void)setMaximumHeight: (int)maximumHeight { toQt(self)->setMaximumHeight(maximumHeight); } - (of_dimension_t)maximumSize { return toOF(toQt(self)->maximumSize()); } - (void)setMaximumSize: (of_dimension_t)maximumSize { toQt(self)->setMaximumSize(toQt(maximumSize)); } - (int)maximumWidth { return toQt(self)->maximumWidth(); } - (void)setMaximumWidth: (int)maximumWidth { toQt(self)->setMaximumWidth(maximumWidth); } - (bool)isMinimized { return toQt(self)->isMinimized(); } - (int)minimumHeight { return toQt(self)->minimumHeight(); } - (void)setMinimumHeight: (int)minimumHeight { toQt(self)->setMinimumHeight(minimumHeight); } - (of_dimension_t)minimumSize { return toOF(toQt(self)->minimumSize()); } - (void)setMinimumSize: (of_dimension_t)minimumSize { toQt(self)->setMinimumSize(toQt(minimumSize)); } - (of_dimension_t)minimumSizeHint { return toOF(toQt(self)->minimumSizeHint()); } - (int)minimumWidth { return toQt(self)->minimumWidth(); } - (void)setMinimumWidth: (int)minimumWidth { toQt(self)->setMinimumWidth(minimumWidth); } - (bool)isModal { return toQt(self)->isModal(); } - (bool)hasMouseTracking { return toQt(self)->hasMouseTracking(); } - (void)setMouseTracking: (bool)mouseTracking { toQt(self)->setMouseTracking(mouseTracking); } - (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()); } - (void)moveToPosition: (of_point_t)pos { toQt(self)->move(toQt(pos)); } - (of_rectangle_t)rect { return toOF(toQt(self)->rect()); } - (of_dimension_t)size { return toOF(toQt(self)->size()); } - (void)resizeTo: (of_dimension_t)size { toQt(self)->resize(toQt(size)); } - (of_dimension_t)sizeHint { return toOF(toQt(self)->sizeHint()); } - (of_dimension_t)sizeIncrement { return toOF(toQt(self)->sizeIncrement()); } - (void)setSizeIncrement: (of_dimension_t)sizeIncrement { toQt(self)->setSizeIncrement(toQt(sizeIncrement)); } - (QSizePolicy)sizePolicy { return toQt(self)->sizePolicy(); } - (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(); } - (void)setToolTipDuration: (int)toolTipDuration { toQt(self)->setToolTipDuration(toolTipDuration); } - (bool)updatesEnabled { return toQt(self)->updatesEnabled(); } - (void)setUpdatesEnabled: (bool)updatesEnabled { toQt(self)->setUpdatesEnabled(updatesEnabled); } - (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)); } - (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(); } - (void)setWindowFlags: (Qt::WindowFlags)windowFlags { toQt(self)->setWindowFlags(windowFlags); } - (QIcon)windowIcon { return toQt(self)->windowIcon(); } - (void)setWindowIcon: (QIcon)windowIcon { toQt(self)->setWindowIcon(windowIcon); } - (Qt::WindowModality)windowModality { return toQt(self)->windowModality(); } - (void)setWindowModality: (Qt::WindowModality)windowModality { toQt(self)->setWindowModality(windowModality); } - (bool)isWindowModified { return toQt(self)->isWindowModified(); } - (void)setWindowModified: (bool)windowModified { toQt(self)->setWindowModified(windowModified); } - (double)windowOpacity { return toQt(self)->windowOpacity(); } - (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(); } - (void)clearMask { toQt(self)->clearMask(); } - (QMargins)contentsMargins { return toQt(self)->contentsMargins(); } - (of_rectangle_t)contentsRect { return toOF(toQt(self)->contentsRect()); } - (WId)effectiveWinID { return toQt(self)->effectiveWinId(); } - (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(); } - (QFontMetrics)fontMetrics { return toQt(self)->fontMetrics(); } - (QPalette::ColorRole)foregroundRole { return toQt(self)->foregroundRole(); } - (QPixmap)grabRectangle: (of_rectangle_t)rectangle { return toQt(self)->grab(toQt(rectangle)); } - (void)grabGesture: (Qt::GestureType)gesture { toQt(self)->grabGesture(gesture); } - (void)grabGesture: (Qt::GestureType)gesture flags: (Qt::GestureFlags)flags { toQt(self)->grabGesture(gesture, flags); } - (void)grabKeyboard { toQt(self)->grabKeyboard(); } - (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 { return toQt(self)->hasEditFocus(); } #endif - (bool)hasHeightForWidth { return toQt(self)->hasHeightForWidth(); } - (int)heightForWidth: (int)w { return toQt(self)->heightForWidth(w); } - (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 { toQt(self)->scroll(dx, dy); } - (void)scrollRight: (int)dx down: (int)dy inRectangle: (of_rectangle_t)rect { toQt(self)->scroll(dx, dy, toQt(rect)); } - (void)setAttribute: (Qt::WidgetAttribute)attribute to: (bool)on { toQt(self)->setAttribute(attribute, on); } #ifdef QT_KEYPAD_NAVIGATION - (void)setEditFocus: (bool)enable { toQt(self)->setEditFocus(enable); } #endif - (void)setFixedHeight: (int)height { toQt(self)->setFixedHeight(height); } - (void)setFixedSize: (of_dimension_t)size { toQt(self)->setFixedSize(toQt(size)); } - (void)setFixedWidth: (int)width { toQt(self)->setFixedWidth(width); } - (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); } - (bool)isUnderMouse { return toQt(self)->underMouse(); } - (void)ungrabGesture: (Qt::GestureType)gesture { toQt(self)->ungrabGesture(gesture); } - (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(); } - (Qt::WindowType)windowType { return toQt(self)->windowType(); } @end |
Added common/OFDataArray+QByteArray.h version [f43313841c].
Added common/OFDataArray+QByteArray.mm version [37ebb8afd0].
Modified common/OFString+QString.h from [8f5d08de4a] to [dd6dc45afe].
︙ | ︙ | |||
25 26 27 28 29 30 31 | #include <QString> @interface OFString (QString) + (instancetype)stringWithQString: (const QString&)qString; - initWithQString: (const QString&)qString; - (QString)qString; @end | > > > > > > > > > > > > > > > > | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #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) { return [string qString]; } } |
Modified common/helpers.h from [b9c441bfd0] to [07b560bcd3].
︙ | ︙ | |||
18 19 20 21 22 23 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import <ObjFW/ObjFW.h> | < | | | | < < < | < | | < < > | 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 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import <ObjFW/ObjFW.h> #include <QSize> #include <QRect> #import "QtObject.h" #import "QtAction.h" #import "QtEvent.h" #import "QtChildEvent.h" #import "QtThread.h" #import "QtWidget.h" namespace ObjQt { static OF_INLINE of_point_t toOF(const QPoint &qPoint) { return of_point(qPoint.x(), qPoint.y()); } |
︙ | ︙ | |||
72 73 74 75 76 77 78 79 | } static OF_INLINE QRect toQt(of_rectangle_t rectangle) { return QRect(rectangle.origin.x, rectangle.origin.y, rectangle.size.width, rectangle.size.height); } | > > | 66 67 68 69 70 71 72 73 74 75 | } static OF_INLINE QRect toQt(of_rectangle_t rectangle) { return QRect(rectangle.origin.x, rectangle.origin.y, rectangle.size.width, rectangle.size.height); } } |