Adjust to ObjFW changes

FossilOrigin-Name: 9c69939020d3573683bd3e3df6eb85a7e11a3696872253e59942b6c7905ead03
This commit is contained in:
Jonathan Schleifer 2021-04-29 23:37:37 +00:00
parent 5b48e3eb1e
commit 12ed78335c
11 changed files with 123 additions and 140 deletions

View file

@ -54,13 +54,13 @@
- (void)takeOwnership - (void)takeOwnership
{ {
OF_ENSURE(!_ownsEvent); OFEnsure(!_ownsEvent);
_ownsEvent = true; _ownsEvent = true;
} }
- (void)giveUpOwnership - (void)giveUpOwnership
{ {
OF_ENSURE(_ownsEvent); OFEnsure(_ownsEvent);
_ownsEvent = false; _ownsEvent = false;
} }

View file

@ -58,13 +58,13 @@ using ObjQt::toQt;
- (void)takeOwnership - (void)takeOwnership
{ {
OF_ENSURE(!_ownsObject); OFEnsure(!_ownsObject);
_ownsObject = true; _ownsObject = true;
} }
- (void)giveUpOwnership - (void)giveUpOwnership
{ {
OF_ENSURE(_ownsObject); OFEnsure(_ownsObject);
_ownsObject = false; _ownsObject = false;
} }
@ -241,7 +241,7 @@ using ObjQt::toQt;
- (void)deleteLater - (void)deleteLater
{ {
OF_ENSURE(!_ownsObject); OFEnsure(!_ownsObject);
_qObject->deleteLater(); _qObject->deleteLater();
} }
@end @end

View file

@ -34,7 +34,7 @@
@property (nonatomic, getter=isChecked) bool checked; @property (nonatomic, getter=isChecked) bool checked;
@property (nonatomic, getter=isDown) bool down; @property (nonatomic, getter=isDown) bool down;
@property (nonatomic) QIcon icon; @property (nonatomic) QIcon icon;
@property (nonatomic) of_dimension_t iconSize; @property (nonatomic) OFSize iconSize;
@property (nonatomic) QKeySequence shortcut; @property (nonatomic) QKeySequence shortcut;
@property (nonatomic, copy) OFString *text; @property (nonatomic, copy) OFString *text;
@property (readonly, nonatomic) QButtonGroup *group; @property (readonly, nonatomic) QButtonGroup *group;

View file

@ -124,12 +124,12 @@ using ObjQt::toQt;
toQt(self)->setIcon(icon); toQt(self)->setIcon(icon);
} }
- (of_dimension_t)iconSize - (OFSize)iconSize
{ {
return toOF(toQt(self)->iconSize()); return toOF(toQt(self)->iconSize());
} }
- (void)setIconSize: (of_dimension_t)iconSize - (void)setIconSize: (OFSize)iconSize
{ {
toQt(self)->setIconSize(toQt(iconSize).toSize()); toQt(self)->setIconSize(toQt(iconSize).toSize());
} }

View file

@ -29,7 +29,7 @@
@property (nonatomic) bool autoSIPEnabled; @property (nonatomic) bool autoSIPEnabled;
@property (nonatomic) int cursorFlashTime; @property (nonatomic) int cursorFlashTime;
@property (nonatomic) int doubleClickInterval; @property (nonatomic) int doubleClickInterval;
@property (nonatomic) of_dimension_t globalStrut; @property (nonatomic) OFSize globalStrut;
@property (nonatomic) int keyboardInputInterval; @property (nonatomic) int keyboardInputInterval;
@property (nonatomic) int startDragDistance; @property (nonatomic) int startDragDistance;
@property (nonatomic) int startDragTime; @property (nonatomic) int startDragTime;

View file

@ -74,12 +74,12 @@ using ObjQt::toQt;
toQt(self)->setDoubleClickInterval(doubleClickInterval); toQt(self)->setDoubleClickInterval(doubleClickInterval);
} }
- (of_dimension_t)globalStrut - (OFSize)globalStrut
{ {
return toOF(toQt(self)->globalStrut()); return toOF(toQt(self)->globalStrut());
} }
- (void)setGlobalStrut: (of_dimension_t)globalStrut - (void)setGlobalStrut: (OFSize)globalStrut
{ {
toQt(self)->setGlobalStrut(toQt(globalStrut).toSize()); toQt(self)->setGlobalStrut(toQt(globalStrut).toSize());
} }

View file

@ -35,22 +35,22 @@
@property (readonly, nonatomic) QGraphicsWidget *qGraphicsWidget; @property (readonly, nonatomic) QGraphicsWidget *qGraphicsWidget;
@property (nonatomic) bool autoFillBackground; @property (nonatomic) bool autoFillBackground;
@property (nonatomic) Qt::FocusPolicy focusPolicy; @property (nonatomic) Qt::FocusPolicy focusPolicy;
@property (nonatomic) of_rectangle_t geometry; @property (nonatomic) OFRect geometry;
@property (nonatomic) QGraphicsLayout *layout; @property (nonatomic) QGraphicsLayout *layout;
@property (nonatomic) Qt::LayoutDirection layoutDirection; @property (nonatomic) Qt::LayoutDirection layoutDirection;
@property (nonatomic) of_dimension_t maximumSize; @property (nonatomic) OFSize maximumSize;
@property (nonatomic) of_dimension_t minimumSize; @property (nonatomic) OFSize minimumSize;
@property (nonatomic) QPalette palette; @property (nonatomic) QPalette palette;
@property (nonatomic) of_dimension_t preferredSize; @property (nonatomic) OFSize preferredSize;
@property (readonly, nonatomic) of_dimension_t size; @property (readonly, nonatomic) OFSize size;
@property (nonatomic) QSizePolicy sizePolicy; @property (nonatomic) QSizePolicy sizePolicy;
@property (nonatomic) Qt::WindowFlags windowFlags; @property (nonatomic) Qt::WindowFlags windowFlags;
@property (copy, nonatomic) OFString *windowTitle; @property (copy, nonatomic) OFString *windowTitle;
@property (readonly, nonatomic) OFArray OF_GENERIC(QtAction *) *actions; @property (readonly, nonatomic) OFArray OF_GENERIC(QtAction *) *actions;
@property (readonly, nonatomic) bool isActiveWindow; @property (readonly, nonatomic) bool isActiveWindow;
@property (nonatomic) QStyle *style; @property (nonatomic) QStyle *style;
@property (readonly, nonatomic) of_rectangle_t windowFrameGeometry; @property (readonly, nonatomic) OFRect windowFrameGeometry;
@property (readonly, nonatomic) of_rectangle_t windowFrameRect; @property (readonly, nonatomic) OFRect windowFrameRect;
- (instancetype)initWithQObject: (QObject *)qObject OF_UNAVAILABLE; - (instancetype)initWithQObject: (QObject *)qObject OF_UNAVAILABLE;
- (instancetype)initWithQGraphicsWidget: (QGraphicsWidget *)qGraphicsWidget - (instancetype)initWithQGraphicsWidget: (QGraphicsWidget *)qGraphicsWidget
@ -76,9 +76,8 @@
widget: (QtWidget *)widget; widget: (QtWidget *)widget;
- (void)releaseShortcut: (int)ID; - (void)releaseShortcut: (int)ID;
- (void)removeAction: (QtAction *)action; - (void)removeAction: (QtAction *)action;
- (void)resizeTo: (of_dimension_t)size; - (void)resizeTo: (OFSize)size;
- (void)setAttribute: (Qt::WidgetAttribute)attribute - (void)setAttribute: (Qt::WidgetAttribute)attribute to: (bool)on;
to: (bool)on;
- (void)setContentsMarginsWithLeft: (qreal)left - (void)setContentsMarginsWithLeft: (qreal)left
top: (qreal)top top: (qreal)top
right: (qreal)right right: (qreal)right

View file

@ -68,12 +68,12 @@ using ObjQt::toQt;
toQt(self)->setFocusPolicy(focusPolicy); toQt(self)->setFocusPolicy(focusPolicy);
} }
- (of_rectangle_t)geometry - (OFRect)geometry
{ {
return toOF(toQt(self)->geometry()); return toOF(toQt(self)->geometry());
} }
- (void)setGeometry: (of_rectangle_t)geometry - (void)setGeometry: (OFRect)geometry
{ {
toQt(self)->setGeometry(toQt(geometry)); toQt(self)->setGeometry(toQt(geometry));
} }
@ -98,22 +98,22 @@ using ObjQt::toQt;
toQt(self)->setLayoutDirection(layoutDirection); toQt(self)->setLayoutDirection(layoutDirection);
} }
- (of_dimension_t)maximumSize - (OFSize)maximumSize
{ {
return toOF(toQt(self)->maximumSize()); return toOF(toQt(self)->maximumSize());
} }
- (void)setMaximumSize: (of_dimension_t)maximumSize - (void)setMaximumSize: (OFSize)maximumSize
{ {
toQt(self)->setMaximumSize(toQt(maximumSize)); toQt(self)->setMaximumSize(toQt(maximumSize));
} }
- (of_dimension_t)minimumSize - (OFSize)minimumSize
{ {
return toOF(toQt(self)->minimumSize()); return toOF(toQt(self)->minimumSize());
} }
- (void)setMinimumSize: (of_dimension_t)minimumSize - (void)setMinimumSize: (OFSize)minimumSize
{ {
toQt(self)->setMinimumSize(toQt(minimumSize)); toQt(self)->setMinimumSize(toQt(minimumSize));
} }
@ -128,17 +128,17 @@ using ObjQt::toQt;
toQt(self)->setPalette(palette); toQt(self)->setPalette(palette);
} }
- (of_dimension_t)preferredSize - (OFSize)preferredSize
{ {
return toOF(toQt(self)->preferredSize()); return toOF(toQt(self)->preferredSize());
} }
- (void)setPreferredSize: (of_dimension_t)preferredSize - (void)setPreferredSize: (OFSize)preferredSize
{ {
toQt(self)->setPreferredSize(toQt(preferredSize)); toQt(self)->setPreferredSize(toQt(preferredSize));
} }
- (of_dimension_t)size - (OFSize)size
{ {
return toOF(toQt(self)->size()); return toOF(toQt(self)->size());
} }
@ -205,12 +205,12 @@ using ObjQt::toQt;
toQt(self)->setStyle(style); toQt(self)->setStyle(style);
} }
- (of_rectangle_t)windowFrameGeometry - (OFRect)windowFrameGeometry
{ {
return toOF(toQt(self)->windowFrameGeometry()); return toOF(toQt(self)->windowFrameGeometry());
} }
- (of_rectangle_t)windowFrameRect - (OFRect)windowFrameRect
{ {
return toOF(toQt(self)->windowFrameRect()); return toOF(toQt(self)->windowFrameRect());
} }
@ -290,13 +290,12 @@ using ObjQt::toQt;
toQt(self)->removeAction(toQt(action)); toQt(self)->removeAction(toQt(action));
} }
- (void)resizeTo: (of_dimension_t)size - (void)resizeTo: (OFSize)size
{ {
toQt(self)->resize(toQt(size)); toQt(self)->resize(toQt(size));
} }
- (void)setAttribute: (Qt::WidgetAttribute)attribute - (void)setAttribute: (Qt::WidgetAttribute)attribute to: (bool)on
to: (bool)on
{ {
toQt(self)->setAttribute(attribute, on); toQt(self)->setAttribute(attribute, on);
} }

View file

@ -33,18 +33,18 @@
@property (copy, nonatomic) OFString *accessibleDescription; @property (copy, nonatomic) OFString *accessibleDescription;
@property (copy, nonatomic) OFString *accessibleName; @property (copy, nonatomic) OFString *accessibleName;
@property (nonatomic) bool autoFillBackground; @property (nonatomic) bool autoFillBackground;
@property (nonatomic) of_dimension_t baseSize; @property (nonatomic) OFSize baseSize;
@property (readonly, nonatomic) of_rectangle_t childrenRect; @property (readonly, nonatomic) OFRect childrenRect;
@property (readonly, nonatomic) QRegion childrenRegion; @property (readonly, nonatomic) QRegion childrenRegion;
@property (nonatomic) Qt::ContextMenuPolicy contextMenuPolicy; @property (nonatomic) Qt::ContextMenuPolicy contextMenuPolicy;
@property (nonatomic) QCursor cursor; @property (nonatomic) QCursor cursor;
@property (nonatomic, getter=isEnabled) bool enabled; @property (nonatomic, getter=isEnabled) bool enabled;
@property (nonatomic) Qt::FocusPolicy focusPolicy; @property (nonatomic) Qt::FocusPolicy focusPolicy;
@property (nonatomic) const QFont &font; @property (nonatomic) const QFont &font;
@property (readonly, nonatomic) of_rectangle_t frameGeometry; @property (readonly, nonatomic) OFRect frameGeometry;
@property (readonly, nonatomic) of_dimension_t frameSize; @property (readonly, nonatomic) OFSize frameSize;
@property (readonly, nonatomic, getter=isFullScreen) bool fullScreen; @property (readonly, nonatomic, getter=isFullScreen) bool fullScreen;
@property (nonatomic) of_rectangle_t geometry; @property (nonatomic) OFRect geometry;
@property (readonly, nonatomic) int height; @property (readonly, nonatomic) int height;
@property (nonatomic) Qt::InputMethodHints inputMethodHints; @property (nonatomic) Qt::InputMethodHints inputMethodHints;
@property (readonly, nonatomic) bool isActiveWindow; @property (readonly, nonatomic) bool isActiveWindow;
@ -52,22 +52,22 @@
@property (nonatomic) QLocale locale; @property (nonatomic) QLocale locale;
@property (readonly, nonatomic, getter=isMaximized) bool maximized; @property (readonly, nonatomic, getter=isMaximized) bool maximized;
@property (nonatomic) int maximumHeight; @property (nonatomic) int maximumHeight;
@property (nonatomic) of_dimension_t maximumSize; @property (nonatomic) OFSize maximumSize;
@property (nonatomic) int maximumWidth; @property (nonatomic) int maximumWidth;
@property (readonly, nonatomic, getter=isMinimized) bool minimized; @property (readonly, nonatomic, getter=isMinimized) bool minimized;
@property (nonatomic) int minimumHeight; @property (nonatomic) int minimumHeight;
@property (nonatomic) of_dimension_t minimumSize; @property (nonatomic) OFSize minimumSize;
@property (readonly, nonatomic) of_dimension_t minimumSizeHint; @property (readonly, nonatomic) OFSize minimumSizeHint;
@property (nonatomic) int minimumWidth; @property (nonatomic) int minimumWidth;
@property (readonly, nonatomic, getter=isModal) bool modal; @property (readonly, nonatomic, getter=isModal) bool modal;
@property (nonatomic, getter=hasMouseTracking) bool mouseTracking; @property (nonatomic, getter=hasMouseTracking) bool mouseTracking;
@property (readonly, nonatomic) of_rectangle_t normalGeometry; @property (readonly, nonatomic) OFRect normalGeometry;
@property (nonatomic) const QPalette &palette; @property (nonatomic) const QPalette &palette;
@property (nonatomic, setter=moveToPosition:) of_point_t pos; @property (nonatomic, setter=moveToPosition:) OFPoint pos;
@property (readonly, nonatomic) of_rectangle_t rect; @property (readonly, nonatomic) OFRect rect;
@property (nonatomic, setter=resizeTo:) of_dimension_t size; @property (nonatomic, setter=resizeTo:) OFSize size;
@property (readonly, nonatomic) of_dimension_t sizeHint; @property (readonly, nonatomic) OFSize sizeHint;
@property (nonatomic) of_dimension_t sizeIncrement; @property (nonatomic) OFSize sizeIncrement;
@property (nonatomic) QSizePolicy sizePolicy; @property (nonatomic) QSizePolicy sizePolicy;
@property (copy, nonatomic) OFString *statusTip; @property (copy, nonatomic) OFString *statusTip;
@property (copy, nonatomic) OFString *styleSheet; @property (copy, nonatomic) OFString *styleSheet;
@ -86,7 +86,7 @@
@property (readonly, nonatomic) int x; @property (readonly, nonatomic) int x;
@property (readonly, nonatomic) int y; @property (readonly, nonatomic) int y;
@property (readonly, nonatomic) OFArray OF_GENERIC(QtAction *) *actions; @property (readonly, nonatomic) OFArray OF_GENERIC(QtAction *) *actions;
@property (readonly, nonatomic) of_rectangle_t contentsRect; @property (readonly, nonatomic) OFRect contentsRect;
@property (readonly, nonatomic) QtWidget *focusProxy; @property (readonly, nonatomic) QtWidget *focusProxy;
@property (readonly, nonatomic) QtWidget *focusWidget; @property (readonly, nonatomic) QtWidget *focusWidget;
@property (readonly, nonatomic, getter=isHidden) bool hidden; @property (readonly, nonatomic, getter=isHidden) bool hidden;
@ -106,7 +106,7 @@
- (void)adjustSize; - (void)adjustSize;
- (QPalette::ColorRole)backgroundRole; - (QPalette::ColorRole)backgroundRole;
- (QBackingStore *)backingStore; - (QBackingStore *)backingStore;
- (QtWidget *)childAt: (of_point_t)point; - (QtWidget *)childAt: (OFPoint)point;
- (void)clearFocus; - (void)clearFocus;
- (void)clearMask; - (void)clearMask;
- (QMargins)contentsMargins; - (QMargins)contentsMargins;
@ -115,10 +115,9 @@
- (QFontInfo)fontInfo; - (QFontInfo)fontInfo;
- (QFontMetrics)fontMetrics; - (QFontMetrics)fontMetrics;
- (QPalette::ColorRole)foregroundRole; - (QPalette::ColorRole)foregroundRole;
- (QPixmap)grabRectangle: (of_rectangle_t)rectangle; - (QPixmap)grabRectangle: (OFRect)rectangle;
- (void)grabGesture: (Qt::GestureType)gesture; - (void)grabGesture: (Qt::GestureType)gesture;
- (void)grabGesture: (Qt::GestureType)gesture - (void)grabGesture: (Qt::GestureType)gesture flags: (Qt::GestureFlags)flags;
flags: (Qt::GestureFlags)flags;
- (void)grabKeyboard; - (void)grabKeyboard;
- (void)grabMouse; - (void)grabMouse;
- (void)grabMouseWithCursor: (const QCursor &)cursor; - (void)grabMouseWithCursor: (const QCursor &)cursor;
@ -134,21 +133,18 @@
- (bool)hasHeightForWidth; - (bool)hasHeightForWidth;
- (int)heightForWidth: (int)w; - (int)heightForWidth: (int)w;
- (QVariant)queryInputMethod: (Qt::InputMethodQuery)query; - (QVariant)queryInputMethod: (Qt::InputMethodQuery)query;
- (void)insertAction: (QtAction *)action - (void)insertAction: (QtAction *)action before: (QtAction *)before;
before: (QtAction *)before;
- (void)insertActions: (OFArray OF_GENERIC(QtAction *) *)actions - (void)insertActions: (OFArray OF_GENERIC(QtAction *) *)actions
before: (QtAction *)before; before: (QtAction *)before;
- (bool)isAncestorOf: (QtWidget *)child; - (bool)isAncestorOf: (QtWidget *)child;
- (bool)isEnabledTo: (QtWidget *)ancestor; - (bool)isEnabledTo: (QtWidget *)ancestor;
- (bool)isVisibleTo: (QtWidget *)ancestor; - (bool)isVisibleTo: (QtWidget *)ancestor;
- (of_point_t)mapPosition: (of_point_t)pos - (OFPoint)mapPosition: (OFPoint)pos from: (QtWidget *)parent;
from: (QtWidget *)parent; - (OFPoint)mapPositionFromGlobal: (OFPoint)pos;
- (of_point_t)mapPositionFromGlobal: (of_point_t)pos; - (OFPoint)mapPositionFromParent: (OFPoint)pos;
- (of_point_t)mapPositionFromParent: (of_point_t)pos; - (OFPoint)mapPosition: (OFPoint)pos to: (QtWidget *)parent;
- (of_point_t)mapPosition: (of_point_t)pos - (OFPoint)mapPositionToGlobal: (OFPoint)pos;
to: (QtWidget *)parent; - (OFPoint)mapPositionToParent: (OFPoint)pos;
- (of_point_t)mapPositionToGlobal: (of_point_t)pos;
- (of_point_t)mapPositionToParent: (of_point_t)pos;
- (QRegion)mask; - (QRegion)mask;
- (void)overrideWindowFlags: (Qt::WindowFlags)flags; - (void)overrideWindowFlags: (Qt::WindowFlags)flags;
- (void)releaseKeyboard; - (void)releaseKeyboard;
@ -156,36 +152,32 @@
- (void)releaseShortcut: (int)ID; - (void)releaseShortcut: (int)ID;
- (void)removeAction: (QtAction *)action; - (void)removeAction: (QtAction *)action;
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target
targetOffset: (of_point_t)targetOffset targetOffset: (OFPoint)targetOffset
sourceRegion: (QRegion)sourceRegion; sourceRegion: (QRegion)sourceRegion;
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target
targetOffset: (of_point_t)targetOffset targetOffset: (OFPoint)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
flags: (QWidget::RenderFlags)renderFlags; flags: (QWidget::RenderFlags)renderFlags;
- (void)renderIntoPainter: (QPainter *)target - (void)renderIntoPainter: (QPainter *)target
targetOffset: (of_point_t)targetOffset targetOffset: (OFPoint)targetOffset
sourceRegion: (QRegion)sourceRegion; sourceRegion: (QRegion)sourceRegion;
- (void)renderIntoPainter: (QPainter *)target - (void)renderIntoPainter: (QPainter *)target
targetOffset: (of_point_t)targetOffset targetOffset: (OFPoint)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
flags: (QWidget::RenderFlags)renderFlags; flags: (QWidget::RenderFlags)renderFlags;
- (void)repaintInRectangle: (of_rectangle_t)rect; - (void)repaintInRectangle: (OFRect)rect;
- (void)repaintInRegion: (const QRegion &)region; - (void)repaintInRegion: (const QRegion &)region;
- (bool)restoreGeometry: (OFData *)geometry; - (bool)restoreGeometry: (OFData *)geometry;
- (OFData *)saveGeometry; - (OFData *)saveGeometry;
- (void)scrollRight: (int)dx - (void)scrollRight: (int)dx down: (int)dy;
down: (int)dy; - (void)scrollRight: (int)dx down: (int)dy inRectangle: (OFRect)rect;
- (void)scrollRight: (int)dx - (void)setAttribute: (Qt::WidgetAttribute)attribute to: (bool)on;
down: (int)dy
inRectangle: (of_rectangle_t)rect;
- (void)setAttribute: (Qt::WidgetAttribute)attribute
to: (bool)on;
- (void)setFocus: (Qt::FocusReason)reason; - (void)setFocus: (Qt::FocusReason)reason;
#ifdef QT_KEYPAD_NAVIGATION #ifdef QT_KEYPAD_NAVIGATION
- (void)setEditFocus: (bool)enable; - (void)setEditFocus: (bool)enable;
#endif #endif
- (void)setFixedHeight: (int)height; - (void)setFixedHeight: (int)height;
- (void)setFixedSize: (of_dimension_t)size; - (void)setFixedSize: (OFSize)size;
- (void)setFixedWidth: (int)width; - (void)setFixedWidth: (int)width;
- (void)setFocusProxy: (QtWidget *)widget; - (void)setFocusProxy: (QtWidget *)widget;
- (void)setForegroundRole: (QPalette::ColorRole)role; - (void)setForegroundRole: (QPalette::ColorRole)role;
@ -211,7 +203,7 @@
- (void)unsetCursor; - (void)unsetCursor;
- (void)unsetLayoutDirection; - (void)unsetLayoutDirection;
- (void)unsetLocale; - (void)unsetLocale;
- (void)updateInRectangle: (of_rectangle_t)rect; - (void)updateInRectangle: (OFRect)rect;
- (void)updateInRegion: (const QRegion &)region; - (void)updateInRegion: (const QRegion &)region;
- (void)updateGeometry; - (void)updateGeometry;
- (QRegion)visibleRegion; - (QRegion)visibleRegion;

View file

@ -95,17 +95,17 @@ using ObjQt::toQt;
toQt(self)->setAutoFillBackground(autoFillBackground); toQt(self)->setAutoFillBackground(autoFillBackground);
} }
- (of_dimension_t)baseSize - (OFSize)baseSize
{ {
return toOF(toQt(self)->baseSize()); return toOF(toQt(self)->baseSize());
} }
- (void)setBaseSize: (of_dimension_t)baseSize - (void)setBaseSize: (OFSize)baseSize
{ {
toQt(self)->setBaseSize(toQt(baseSize).toSize()); toQt(self)->setBaseSize(toQt(baseSize).toSize());
} }
- (of_rectangle_t)childrenRect - (OFRect)childrenRect
{ {
return toOF(toQt(self)->childrenRect()); return toOF(toQt(self)->childrenRect());
} }
@ -175,12 +175,12 @@ using ObjQt::toQt;
toQt(self)->setFont(font); toQt(self)->setFont(font);
} }
- (of_rectangle_t)frameGeometry - (OFRect)frameGeometry
{ {
return toOF(toQt(self)->frameGeometry()); return toOF(toQt(self)->frameGeometry());
} }
- (of_dimension_t)frameSize - (OFSize)frameSize
{ {
return toOF(toQt(self)->frameSize()); return toOF(toQt(self)->frameSize());
} }
@ -190,12 +190,12 @@ using ObjQt::toQt;
return toQt(self)->isFullScreen(); return toQt(self)->isFullScreen();
} }
- (of_rectangle_t)geometry - (OFRect)geometry
{ {
return toOF(toQt(self)->geometry()); return toOF(toQt(self)->geometry());
} }
- (void)setGeometry: (of_rectangle_t)geometry - (void)setGeometry: (OFRect)geometry
{ {
toQt(self)->setGeometry(toQt(geometry).toRect()); toQt(self)->setGeometry(toQt(geometry).toRect());
} }
@ -265,12 +265,12 @@ using ObjQt::toQt;
toQt(self)->setMaximumHeight(maximumHeight); toQt(self)->setMaximumHeight(maximumHeight);
} }
- (of_dimension_t)maximumSize - (OFSize)maximumSize
{ {
return toOF(toQt(self)->maximumSize()); return toOF(toQt(self)->maximumSize());
} }
- (void)setMaximumSize: (of_dimension_t)maximumSize - (void)setMaximumSize: (OFSize)maximumSize
{ {
toQt(self)->setMaximumSize(toQt(maximumSize).toSize()); toQt(self)->setMaximumSize(toQt(maximumSize).toSize());
} }
@ -300,17 +300,17 @@ using ObjQt::toQt;
toQt(self)->setMinimumHeight(minimumHeight); toQt(self)->setMinimumHeight(minimumHeight);
} }
- (of_dimension_t)minimumSize - (OFSize)minimumSize
{ {
return toOF(toQt(self)->minimumSize()); return toOF(toQt(self)->minimumSize());
} }
- (void)setMinimumSize: (of_dimension_t)minimumSize - (void)setMinimumSize: (OFSize)minimumSize
{ {
toQt(self)->setMinimumSize(toQt(minimumSize).toSize()); toQt(self)->setMinimumSize(toQt(minimumSize).toSize());
} }
- (of_dimension_t)minimumSizeHint - (OFSize)minimumSizeHint
{ {
return toOF(toQt(self)->minimumSizeHint()); return toOF(toQt(self)->minimumSizeHint());
} }
@ -340,7 +340,7 @@ using ObjQt::toQt;
toQt(self)->setMouseTracking(mouseTracking); toQt(self)->setMouseTracking(mouseTracking);
} }
- (of_rectangle_t)normalGeometry - (OFRect)normalGeometry
{ {
return toOF(toQt(self)->normalGeometry()); return toOF(toQt(self)->normalGeometry());
} }
@ -355,42 +355,42 @@ using ObjQt::toQt;
toQt(self)->setPalette(palette); toQt(self)->setPalette(palette);
} }
- (of_point_t)pos - (OFPoint)pos
{ {
return toOF(toQt(self)->pos()); return toOF(toQt(self)->pos());
} }
- (void)moveToPosition: (of_point_t)pos - (void)moveToPosition: (OFPoint)pos
{ {
toQt(self)->move(toQt(pos)); toQt(self)->move(toQt(pos));
} }
- (of_rectangle_t)rect - (OFRect)rect
{ {
return toOF(toQt(self)->rect()); return toOF(toQt(self)->rect());
} }
- (of_dimension_t)size - (OFSize)size
{ {
return toOF(toQt(self)->size()); return toOF(toQt(self)->size());
} }
- (void)resizeTo: (of_dimension_t)size - (void)resizeTo: (OFSize)size
{ {
toQt(self)->resize(toQt(size).toSize()); toQt(self)->resize(toQt(size).toSize());
} }
- (of_dimension_t)sizeHint - (OFSize)sizeHint
{ {
return toOF(toQt(self)->sizeHint()); return toOF(toQt(self)->sizeHint());
} }
- (of_dimension_t)sizeIncrement - (OFSize)sizeIncrement
{ {
return toOF(toQt(self)->sizeIncrement()); return toOF(toQt(self)->sizeIncrement());
} }
- (void)setSizeIncrement: (of_dimension_t)sizeIncrement - (void)setSizeIncrement: (OFSize)sizeIncrement
{ {
toQt(self)->setSizeIncrement(toQt(sizeIncrement).toSize()); toQt(self)->setSizeIncrement(toQt(sizeIncrement).toSize());
} }
@ -612,7 +612,7 @@ using ObjQt::toQt;
return toQt(self)->backingStore(); return toQt(self)->backingStore();
} }
- (QtWidget *)childAt: (of_point_t)point - (QtWidget *)childAt: (OFPoint)point
{ {
return toOF(toQt(self)->childAt(toQt(point))); return toOF(toQt(self)->childAt(toQt(point)));
} }
@ -632,7 +632,7 @@ using ObjQt::toQt;
return toQt(self)->contentsMargins(); return toQt(self)->contentsMargins();
} }
- (of_rectangle_t)contentsRect - (OFRect)contentsRect
{ {
return toOF(toQt(self)->contentsRect()); return toOF(toQt(self)->contentsRect());
} }
@ -672,7 +672,7 @@ using ObjQt::toQt;
return toQt(self)->foregroundRole(); return toQt(self)->foregroundRole();
} }
- (QPixmap)grabRectangle: (of_rectangle_t)rectangle - (QPixmap)grabRectangle: (OFRect)rectangle
{ {
return toQt(self)->grab(toQt(rectangle).toRect()); return toQt(self)->grab(toQt(rectangle).toRect());
} }
@ -788,34 +788,32 @@ using ObjQt::toQt;
return toQt(self)->isWindow(); return toQt(self)->isWindow();
} }
- (of_point_t)mapPosition: (of_point_t)pos - (OFPoint)mapPosition: (OFPoint)pos from: (QtWidget *)parent
from: (QtWidget *)parent
{ {
return toOF(toQt(self)->mapFrom(toQt(parent), toQt(pos))); return toOF(toQt(self)->mapFrom(toQt(parent), toQt(pos)));
} }
- (of_point_t)mapPositionFromGlobal: (of_point_t)pos - (OFPoint)mapPositionFromGlobal: (OFPoint)pos
{ {
return toOF(toQt(self)->mapFromGlobal(toQt(pos))); return toOF(toQt(self)->mapFromGlobal(toQt(pos)));
} }
- (of_point_t)mapPositionFromParent: (of_point_t)pos - (OFPoint)mapPositionFromParent: (OFPoint)pos
{ {
return toOF(toQt(self)->mapFromParent(toQt(pos))); return toOF(toQt(self)->mapFromParent(toQt(pos)));
} }
- (of_point_t)mapPosition: (of_point_t)pos - (OFPoint)mapPosition: (OFPoint)pos to: (QtWidget *)parent
to: (QtWidget *)parent
{ {
return toOF(toQt(self)->mapTo(toQt(parent), toQt(pos))); return toOF(toQt(self)->mapTo(toQt(parent), toQt(pos)));
} }
- (of_point_t)mapPositionToGlobal: (of_point_t)pos - (OFPoint)mapPositionToGlobal: (OFPoint)pos
{ {
return toOF(toQt(self)->mapToGlobal(toQt(pos))); return toOF(toQt(self)->mapToGlobal(toQt(pos)));
} }
- (of_point_t)mapPositionToParent: (of_point_t)pos - (OFPoint)mapPositionToParent: (OFPoint)pos
{ {
return toOF(toQt(self)->mapToParent(toQt(pos))); return toOF(toQt(self)->mapToParent(toQt(pos)));
} }
@ -871,7 +869,7 @@ using ObjQt::toQt;
} }
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target
targetOffset: (of_point_t)targetOffset targetOffset: (OFPoint)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
{ {
toQt(self)->render([target qPaintDevice], toQt(targetOffset), toQt(self)->render([target qPaintDevice], toQt(targetOffset),
@ -879,7 +877,7 @@ using ObjQt::toQt;
} }
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target - (void)renderIntoPaintDevice: (QtObject <QtPaintDevice> *)target
targetOffset: (of_point_t)targetOffset targetOffset: (OFPoint)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
flags: (QWidget::RenderFlags)renderFlags flags: (QWidget::RenderFlags)renderFlags
{ {
@ -888,14 +886,14 @@ using ObjQt::toQt;
} }
- (void)renderIntoPainter: (QPainter *)target - (void)renderIntoPainter: (QPainter *)target
targetOffset: (of_point_t)targetOffset targetOffset: (OFPoint)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
{ {
toQt(self)->render(target, toQt(targetOffset), sourceRegion); toQt(self)->render(target, toQt(targetOffset), sourceRegion);
} }
- (void)renderIntoPainter: (QPainter *)target - (void)renderIntoPainter: (QPainter *)target
targetOffset: (of_point_t)targetOffset targetOffset: (OFPoint)targetOffset
sourceRegion: (QRegion)sourceRegion sourceRegion: (QRegion)sourceRegion
flags: (QWidget::RenderFlags)renderFlags flags: (QWidget::RenderFlags)renderFlags
{ {
@ -903,7 +901,7 @@ using ObjQt::toQt;
renderFlags); renderFlags);
} }
- (void)repaintInRectangle: (of_rectangle_t)rect - (void)repaintInRectangle: (OFRect)rect
{ {
toQt(self)->repaint(toQt(rect).toRect()); toQt(self)->repaint(toQt(rect).toRect());
} }
@ -923,21 +921,17 @@ using ObjQt::toQt;
return toOF(toQt(self)->saveGeometry()); return toOF(toQt(self)->saveGeometry());
} }
- (void)scrollRight: (int)dx - (void)scrollRight: (int)dx down: (int)dy
down: (int)dy
{ {
toQt(self)->scroll(dx, dy); toQt(self)->scroll(dx, dy);
} }
- (void)scrollRight: (int)dx - (void)scrollRight: (int)dx down: (int)dy inRectangle: (OFRect)rect
down: (int)dy
inRectangle: (of_rectangle_t)rect
{ {
toQt(self)->scroll(dx, dy, toQt(rect).toRect()); toQt(self)->scroll(dx, dy, toQt(rect).toRect());
} }
- (void)setAttribute: (Qt::WidgetAttribute)attribute - (void)setAttribute: (Qt::WidgetAttribute)attribute to: (bool)on
to: (bool)on
{ {
toQt(self)->setAttribute(attribute, on); toQt(self)->setAttribute(attribute, on);
} }
@ -954,7 +948,7 @@ using ObjQt::toQt;
toQt(self)->setFixedHeight(height); toQt(self)->setFixedHeight(height);
} }
- (void)setFixedSize: (of_dimension_t)size - (void)setFixedSize: (OFSize)size
{ {
toQt(self)->setFixedSize(toQt(size).toSize()); toQt(self)->setFixedSize(toQt(size).toSize());
} }
@ -1062,7 +1056,7 @@ using ObjQt::toQt;
toQt(self)->ungrabGesture(gesture); toQt(self)->ungrabGesture(gesture);
} }
- (void)updateInRectangle: (of_rectangle_t)rect - (void)updateInRectangle: (OFRect)rect
{ {
toQt(self)->update(toQt(rect).toRect()); toQt(self)->update(toQt(rect).toRect());
} }

View file

@ -34,55 +34,54 @@
namespace ObjQt { namespace ObjQt {
static OF_INLINE of_point_t static OF_INLINE OFPoint
toOF(const QPoint &qPoint) toOF(const QPoint &qPoint)
{ {
return of_point(qPoint.x(), qPoint.y()); return OFPointMake(qPoint.x(), qPoint.y());
} }
static OF_INLINE QPoint static OF_INLINE QPoint
toQt(const of_point_t &point) toQt(const OFPoint &point)
{ {
return QPoint(point.x, point.y); return QPoint(point.x, point.y);
} }
static OF_INLINE of_dimension_t static OF_INLINE OFSize
toOF(const QSize &qSize) toOF(const QSize &qSize)
{ {
return of_dimension(qSize.width(), qSize.height()); return OFSizeMake(qSize.width(), qSize.height());
} }
static OF_INLINE of_dimension_t static OF_INLINE OFSize
toOF(const QSizeF &qSizeF) toOF(const QSizeF &qSizeF)
{ {
return of_dimension(qSizeF.width(), qSizeF.height()); return OFSizeMake(qSizeF.width(), qSizeF.height());
} }
static OF_INLINE QSizeF static OF_INLINE QSizeF
toQt(const of_dimension_t &dimension) toQt(const OFSize &dimension)
{ {
return QSizeF(dimension.width, dimension.height); return QSizeF(dimension.width, dimension.height);
} }
static OF_INLINE of_rectangle_t static OF_INLINE OFRect
toOF(const QRect &qRect) toOF(const QRect &qRect)
{ {
return of_rectangle(qRect.x(), qRect.y(), return OFRectMake(qRect.x(), qRect.y(), qRect.width(), qRect.height());
qRect.width(), qRect.height());
} }
static OF_INLINE of_rectangle_t static OF_INLINE OFRect
toOF(const QRectF &qRectF) toOF(const QRectF &qRectF)
{ {
return of_rectangle(qRectF.x(), qRectF.y(), return OFRectMake(qRectF.x(), qRectF.y(),
qRectF.width(), qRectF.height()); qRectF.width(), qRectF.height());
} }
static OF_INLINE QRectF static OF_INLINE QRectF
toQt(const of_rectangle_t &rectangle) toQt(const OFRect &rect)
{ {
return QRectF(rectangle.origin.x, rectangle.origin.y, return QRectF(rect.origin.x, rect.origin.y,
rectangle.size.width, rectangle.size.height); rect.size.width, rect.size.height);
} }
} }