Add QtPaintDevice and initial QtWidget
This commit is contained in:
parent
f38ff5fbc2
commit
1d907ed62d
8 changed files with 764 additions and 7 deletions
|
@ -17,7 +17,9 @@ HEADERS += common/helpers.h \
|
|||
QtCore/QtObject.h \
|
||||
QtCore/QtThread.h \
|
||||
QtGui/QtGuiApplication.h \
|
||||
QtWidgets/QtApplication.h
|
||||
QtGui/QtPaintDevice.h \
|
||||
QtWidgets/QtApplication.h \
|
||||
QtWidgets/QtWidget.h
|
||||
|
||||
SOURCES += QtCore/QtChildEvent.mm \
|
||||
QtCore/QtCoreApplication.mm \
|
||||
|
@ -25,7 +27,9 @@ SOURCES += QtCore/QtChildEvent.mm \
|
|||
QtCore/QtObject.mm \
|
||||
QtCore/QtThread.mm \
|
||||
QtGui/QtGuiApplication.mm \
|
||||
QtWidgets/QtApplication.mm
|
||||
QtGui/QtPaintDevice.mm \
|
||||
QtWidgets/QtApplication.mm \
|
||||
QtWidgets/QtWidget.mm
|
||||
|
||||
QMAKE_CXXFLAGS += $$system("objfw-config --cppflags --objcflags --cxxflags")
|
||||
QMAKE_CXXFLAGS_WARN_ON = -Wall \
|
||||
|
|
25
QtGui/QtPaintDevice.h
Normal file
25
QtGui/QtPaintDevice.h
Normal file
|
@ -0,0 +1,25 @@
|
|||
#import <ObjFW/ObjFW.h>
|
||||
|
||||
#include <QPaintDevice>
|
||||
|
||||
@protocol QtPaintDevice
|
||||
- (QPaintDevice*)qPaintDevice;
|
||||
- (int)colorCount;
|
||||
- (int)depth;
|
||||
- (int)devicePixelRatio;
|
||||
- (double)devicePixelRatioF;
|
||||
- (int)height;
|
||||
- (int)heightMM;
|
||||
- (int)logicalDPIX;
|
||||
- (int)logicalDPIY;
|
||||
- (QPaintEngine*)paintEngine;
|
||||
- (bool)paintingActive;
|
||||
- (int)physicalDPIX;
|
||||
- (int)physicalDPIY;
|
||||
- (int)width;
|
||||
- (int)widthMM;
|
||||
@end
|
||||
|
||||
@interface QtPaintDevice: OFObject <QtPaintDevice>
|
||||
@property (readonly) QObject *qObject;
|
||||
@end
|
82
QtGui/QtPaintDevice.mm
Normal file
82
QtGui/QtPaintDevice.mm
Normal file
|
@ -0,0 +1,82 @@
|
|||
#import "QtPaintDevice.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
@implementation QtPaintDevice
|
||||
@dynamic qObject;
|
||||
|
||||
- (QPaintDevice*)qPaintDevice
|
||||
{
|
||||
return dynamic_cast<QPaintDevice*>([self qObject]);
|
||||
}
|
||||
|
||||
- (int)colorCount
|
||||
{
|
||||
return [self qPaintDevice]->colorCount();
|
||||
}
|
||||
|
||||
- (int)depth
|
||||
{
|
||||
return [self qPaintDevice]->depth();
|
||||
}
|
||||
|
||||
- (int)devicePixelRatio
|
||||
{
|
||||
return [self qPaintDevice]->devicePixelRatio();
|
||||
}
|
||||
|
||||
- (double)devicePixelRatioF
|
||||
{
|
||||
return [self qPaintDevice]->devicePixelRatioF();
|
||||
}
|
||||
|
||||
- (int)height
|
||||
{
|
||||
return [self qPaintDevice]->height();
|
||||
}
|
||||
|
||||
- (int)heightMM
|
||||
{
|
||||
return [self qPaintDevice]->heightMM();
|
||||
}
|
||||
|
||||
- (int)logicalDPIX
|
||||
{
|
||||
return [self qPaintDevice]->logicalDpiX();
|
||||
}
|
||||
|
||||
- (int)logicalDPIY
|
||||
{
|
||||
return [self qPaintDevice]->logicalDpiY();
|
||||
}
|
||||
|
||||
- (QPaintEngine*)paintEngine
|
||||
{
|
||||
return [self qPaintDevice]->paintEngine();
|
||||
}
|
||||
|
||||
- (bool)paintingActive
|
||||
{
|
||||
return [self qPaintDevice]->paintingActive();
|
||||
}
|
||||
|
||||
- (int)physicalDPIX
|
||||
{
|
||||
return [self qPaintDevice]->physicalDpiX();
|
||||
}
|
||||
|
||||
- (int)physicalDPIY
|
||||
{
|
||||
return [self qPaintDevice]->physicalDpiY();
|
||||
}
|
||||
|
||||
- (int)width
|
||||
{
|
||||
return [self qPaintDevice]->width();
|
||||
}
|
||||
|
||||
- (int)widthMM
|
||||
{
|
||||
return [self qPaintDevice]->widthMM();
|
||||
}
|
||||
@end
|
|
@ -7,7 +7,7 @@
|
|||
@property bool autoSipEnabled;
|
||||
@property int cursorFlashTime;
|
||||
@property int doubleClickInterval;
|
||||
@property QSize globalStrut;
|
||||
@property of_dimension_t globalStrut;
|
||||
@property int keyboardInputInterval;
|
||||
@property int startDragDistance;
|
||||
@property int startDragTime;
|
||||
|
|
|
@ -48,14 +48,14 @@
|
|||
[self qApplication]->setDoubleClickInterval(doubleClickInterval);
|
||||
}
|
||||
|
||||
- (QSize)globalStrut
|
||||
- (of_dimension_t)globalStrut
|
||||
{
|
||||
return [self qApplication]->globalStrut();
|
||||
return QToOFDimension([self qApplication]->globalStrut());
|
||||
}
|
||||
|
||||
- (void)setGlobalStrut: (QSize)globalStrut
|
||||
- (void)setGlobalStrut: (of_dimension_t)globalStrut
|
||||
{
|
||||
[self qApplication]->setGlobalStrut(globalStrut);
|
||||
[self qApplication]->setGlobalStrut(OFToQSize(globalStrut));
|
||||
}
|
||||
|
||||
- (int)keyboardInputInterval
|
||||
|
|
76
QtWidgets/QtWidget.h
Normal file
76
QtWidgets/QtWidget.h
Normal file
|
@ -0,0 +1,76 @@
|
|||
#import "QtObject.h"
|
||||
#import "QtPaintDevice.h"
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
@interface QtWidget: QtObject
|
||||
@property (readonly) QWidget *qWidget;
|
||||
@property bool acceptDrops;
|
||||
@property (copy) OFString *accessibleDescription;
|
||||
@property (copy) OFString *accessibleName;
|
||||
@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 (readonly, getter=hasFocus) bool focus;
|
||||
@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;
|
||||
@property Qt::InputMethodHints inputMethodHints;
|
||||
@property (readonly) bool isActiveWindow;
|
||||
@property Qt::LayoutDirection layoutDirection;
|
||||
@property QLocale locale;
|
||||
@property (readonly, getter=isMaximized) bool maximized;
|
||||
@property int maximumHeight;
|
||||
@property of_dimension_t maximumSize;
|
||||
@property int maximumWidth;
|
||||
@property (readonly, getter=isMinimized) bool minimized;
|
||||
@property int minimumHeight;
|
||||
@property of_dimension_t minimumSize;
|
||||
@property (readonly) of_dimension_t minimumSizeHint;
|
||||
@property int minimumWidth;
|
||||
@property (readonly, getter=isModal) bool modal;
|
||||
@property (getter=hasMouseTracking) bool mouseTracking;
|
||||
@property (readonly) of_rectangle_t normalGeometry;
|
||||
@property const QPalette &palette;
|
||||
@property (setter=moveToPosition:) of_point_t pos;
|
||||
@property (readonly) of_rectangle_t rect;
|
||||
@property (setter=resizeTo:) of_dimension_t size;
|
||||
@property (readonly) of_dimension_t sizeHint;
|
||||
@property of_dimension_t sizeIncrement;
|
||||
@property QSizePolicy sizePolicy;
|
||||
@property (copy) OFString *statusTip;
|
||||
@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 (copy) OFString *windowFilePath;
|
||||
@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;
|
||||
@property (readonly) int y;
|
||||
|
||||
// TODO: Member functions
|
||||
|
||||
- initWithQWidget: (QWidget*)qWidget;
|
||||
- (void)unsetCursor;
|
||||
- (void)unsetLayoutDirection;
|
||||
- (void)unsetLocale;
|
||||
@end
|
||||
|
||||
@interface QtWidget (QtPaintDevice) <QtPaintDevice>
|
||||
@end
|
530
QtWidgets/QtWidget.mm
Normal file
530
QtWidgets/QtWidget.mm
Normal file
|
@ -0,0 +1,530 @@
|
|||
#import "QtWidget.h"
|
||||
|
||||
#import "helpers.h"
|
||||
|
||||
#include <QIcon>
|
||||
#include <QLocale>
|
||||
|
||||
@implementation QtWidget
|
||||
+ (void)initialize
|
||||
{
|
||||
if (self == [QtWidget class])
|
||||
[self inheritMethodsFromClass: [QtPaintDevice class]];
|
||||
}
|
||||
|
||||
- initWithQWidget: (QWidget*)qWidget
|
||||
{
|
||||
return [super initWithQObject: qWidget];
|
||||
}
|
||||
|
||||
- (QWidget*)qWidget
|
||||
{
|
||||
return qobject_cast<QWidget*>(_qObject);
|
||||
}
|
||||
|
||||
- (bool)acceptDrops
|
||||
{
|
||||
return [self qWidget]->acceptDrops();
|
||||
}
|
||||
|
||||
- (void)setAcceptDrops: (bool)acceptDrops
|
||||
{
|
||||
[self qWidget]->setAcceptDrops(acceptDrops);
|
||||
}
|
||||
|
||||
- (OFString*)accessibleDescription
|
||||
{
|
||||
return QToOFString([self qWidget]->accessibleDescription());
|
||||
}
|
||||
|
||||
- (void)setAccessibleDescription: (OFString*)accessibleDescription
|
||||
{
|
||||
[self qWidget]->setAccessibleDescription(
|
||||
OFToQString(accessibleDescription));
|
||||
}
|
||||
|
||||
- (OFString*)accessibleName
|
||||
{
|
||||
return QToOFString([self qWidget]->accessibleName());
|
||||
}
|
||||
|
||||
- (void)setAccessibleName: (OFString*)accessibleName
|
||||
{
|
||||
[self qWidget]->setAccessibleName(OFToQString(accessibleName));
|
||||
}
|
||||
|
||||
- (bool)autoFillBackground
|
||||
{
|
||||
return [self qWidget]->autoFillBackground();
|
||||
}
|
||||
|
||||
- (void)setAutoFillBackground: (bool)autoFillBackground
|
||||
{
|
||||
[self qWidget]->setAutoFillBackground(autoFillBackground);
|
||||
}
|
||||
|
||||
- (of_dimension_t)baseSize
|
||||
{
|
||||
return QToOFDimension([self qWidget]->baseSize());
|
||||
}
|
||||
|
||||
- (void)setBaseSize: (of_dimension_t)baseSize
|
||||
{
|
||||
[self qWidget]->setBaseSize(OFToQSize(baseSize));
|
||||
}
|
||||
|
||||
- (of_rectangle_t)childrenRect
|
||||
{
|
||||
return QToOFRectangle([self qWidget]->childrenRect());
|
||||
}
|
||||
|
||||
- (QRegion)childrenRegion
|
||||
{
|
||||
return [self qWidget]->childrenRegion();
|
||||
}
|
||||
|
||||
- (Qt::ContextMenuPolicy)contextMenuPolicy
|
||||
{
|
||||
return [self qWidget]->contextMenuPolicy();
|
||||
}
|
||||
|
||||
- (void)setContextMenuPolicy: (Qt::ContextMenuPolicy)contextMenuPolicy
|
||||
{
|
||||
[self qWidget]->setContextMenuPolicy(contextMenuPolicy);
|
||||
}
|
||||
|
||||
- (QCursor)cursor
|
||||
{
|
||||
return [self qWidget]->cursor();
|
||||
}
|
||||
|
||||
- (void)setCursor: (QCursor)cursor
|
||||
{
|
||||
[self qWidget]->setCursor(cursor);
|
||||
}
|
||||
|
||||
- (void)unsetCursor
|
||||
{
|
||||
[self qWidget]->unsetCursor();
|
||||
}
|
||||
|
||||
- (bool)isEnabled
|
||||
{
|
||||
return [self qWidget]->isEnabled();
|
||||
}
|
||||
|
||||
- (void)setEnabled: (bool)enabled
|
||||
{
|
||||
[self qWidget]->setEnabled(enabled);
|
||||
}
|
||||
|
||||
- (bool)hasFocus
|
||||
{
|
||||
return [self qWidget]->hasFocus();
|
||||
}
|
||||
|
||||
- (Qt::FocusPolicy)focusPolicy
|
||||
{
|
||||
return [self qWidget]->focusPolicy();
|
||||
}
|
||||
|
||||
- (void)setFocusPolicy: (Qt::FocusPolicy)focusPolicy
|
||||
{
|
||||
[self qWidget]->setFocusPolicy(focusPolicy);
|
||||
}
|
||||
|
||||
- (const QFont&)font
|
||||
{
|
||||
return [self qWidget]->font();
|
||||
}
|
||||
|
||||
- (void)setFont: (const QFont&)font
|
||||
{
|
||||
[self qWidget]->setFont(font);
|
||||
}
|
||||
|
||||
- (of_rectangle_t)frameGeometry
|
||||
{
|
||||
return QToOFRectangle([self qWidget]->frameGeometry());
|
||||
}
|
||||
|
||||
- (of_dimension_t)frameSize
|
||||
{
|
||||
return QToOFDimension([self qWidget]->frameSize());
|
||||
}
|
||||
|
||||
- (bool)isFullScreen
|
||||
{
|
||||
return [self qWidget]->isFullScreen();
|
||||
}
|
||||
|
||||
- (of_rectangle_t)geometry
|
||||
{
|
||||
return QToOFRectangle([self qWidget]->geometry());
|
||||
}
|
||||
|
||||
- (void)setGeometry: (of_rectangle_t)geometry
|
||||
{
|
||||
[self qWidget]->setGeometry(OFToQRect(geometry));
|
||||
}
|
||||
|
||||
- (int)height
|
||||
{
|
||||
return [self qWidget]->height();
|
||||
}
|
||||
|
||||
- (Qt::InputMethodHints)inputMethodHints
|
||||
{
|
||||
return [self qWidget]->inputMethodHints();
|
||||
}
|
||||
|
||||
- (void)setInputMethodHints: (Qt::InputMethodHints)inputMethodHints
|
||||
{
|
||||
[self qWidget]->setInputMethodHints(inputMethodHints);
|
||||
}
|
||||
|
||||
- (bool)isActiveWindow
|
||||
{
|
||||
return [self qWidget]->isActiveWindow();
|
||||
}
|
||||
|
||||
- (Qt::LayoutDirection)layoutDirection
|
||||
{
|
||||
return [self qWidget]->layoutDirection();
|
||||
}
|
||||
|
||||
- (void)setLayoutDirection: (Qt::LayoutDirection)layoutDirection
|
||||
{
|
||||
[self qWidget]->setLayoutDirection(layoutDirection);
|
||||
}
|
||||
|
||||
- (void)unsetLayoutDirection
|
||||
{
|
||||
[self qWidget]->unsetLayoutDirection();
|
||||
}
|
||||
|
||||
- (QLocale)locale
|
||||
{
|
||||
return [self qWidget]->locale();
|
||||
}
|
||||
|
||||
- (void)setLocale: (QLocale)locale
|
||||
{
|
||||
[self qWidget]->setLocale(locale);
|
||||
}
|
||||
|
||||
- (void)unsetLocale
|
||||
{
|
||||
[self qWidget]->unsetLocale();
|
||||
}
|
||||
|
||||
- (bool)isMaximized
|
||||
{
|
||||
return [self qWidget]->isMaximized();
|
||||
}
|
||||
|
||||
- (int)maximumHeight
|
||||
{
|
||||
return [self qWidget]->maximumHeight();
|
||||
}
|
||||
|
||||
- (void)setMaximumHeight: (int)maximumHeight
|
||||
{
|
||||
[self qWidget]->setMaximumHeight(maximumHeight);
|
||||
}
|
||||
|
||||
- (of_dimension_t)maximumSize
|
||||
{
|
||||
return QToOFDimension([self qWidget]->maximumSize());
|
||||
}
|
||||
|
||||
- (void)setMaximumSize: (of_dimension_t)maximumSize
|
||||
{
|
||||
[self qWidget]->setMaximumSize(OFToQSize(maximumSize));
|
||||
}
|
||||
|
||||
- (int)maximumWidth
|
||||
{
|
||||
return [self qWidget]->maximumWidth();
|
||||
}
|
||||
|
||||
- (void)setMaximumWidth: (int)maximumWidth
|
||||
{
|
||||
[self qWidget]->setMaximumWidth(maximumWidth);
|
||||
}
|
||||
|
||||
- (bool)isMinimized
|
||||
{
|
||||
return [self qWidget]->isMinimized();
|
||||
}
|
||||
|
||||
- (int)minimumHeight
|
||||
{
|
||||
return [self qWidget]->minimumHeight();
|
||||
}
|
||||
|
||||
- (void)setMinimumHeight: (int)minimumHeight
|
||||
{
|
||||
[self qWidget]->setMinimumHeight(minimumHeight);
|
||||
}
|
||||
|
||||
- (of_dimension_t)minimumSize
|
||||
{
|
||||
return QToOFDimension([self qWidget]->minimumSize());
|
||||
}
|
||||
|
||||
- (void)setMinimumSize: (of_dimension_t)minimumSize
|
||||
{
|
||||
[self qWidget]->setMinimumSize(OFToQSize(minimumSize));
|
||||
}
|
||||
|
||||
- (of_dimension_t)minimumSizeHint
|
||||
{
|
||||
return QToOFDimension([self qWidget]->minimumSizeHint());
|
||||
}
|
||||
|
||||
- (int)minimumWidth
|
||||
{
|
||||
return [self qWidget]->minimumWidth();
|
||||
}
|
||||
|
||||
- (void)setMinimumWidth: (int)minimumWidth
|
||||
{
|
||||
[self qWidget]->setMinimumWidth(minimumWidth);
|
||||
}
|
||||
|
||||
- (bool)isModal
|
||||
{
|
||||
return [self qWidget]->isModal();
|
||||
}
|
||||
|
||||
- (bool)hasMouseTracking
|
||||
{
|
||||
return [self qWidget]->hasMouseTracking();
|
||||
}
|
||||
|
||||
- (void)setMouseTracking: (bool)mouseTracking
|
||||
{
|
||||
[self qWidget]->setMouseTracking(mouseTracking);
|
||||
}
|
||||
|
||||
- (of_rectangle_t)normalGeometry
|
||||
{
|
||||
return QToOFRectangle([self qWidget]->normalGeometry());
|
||||
}
|
||||
|
||||
- (const QPalette&)palette
|
||||
{
|
||||
return [self qWidget]->palette();
|
||||
}
|
||||
|
||||
- (void)setPalette: (const QPalette&)palette
|
||||
{
|
||||
[self qWidget]->setPalette(palette);
|
||||
}
|
||||
|
||||
- (of_point_t)pos
|
||||
{
|
||||
return QToOFPoint([self qWidget]->pos());
|
||||
}
|
||||
|
||||
- (void)moveToPosition: (of_point_t)pos
|
||||
{
|
||||
[self qWidget]->move(OFToQPoint(pos));
|
||||
}
|
||||
|
||||
- (of_rectangle_t)rect
|
||||
{
|
||||
return QToOFRectangle([self qWidget]->rect());
|
||||
}
|
||||
|
||||
- (of_dimension_t)size
|
||||
{
|
||||
return QToOFDimension([self qWidget]->size());
|
||||
}
|
||||
|
||||
- (void)resizeTo: (of_dimension_t)size
|
||||
{
|
||||
[self qWidget]->resize(OFToQSize(size));
|
||||
}
|
||||
|
||||
- (of_dimension_t)sizeHint
|
||||
{
|
||||
return QToOFDimension([self qWidget]->sizeHint());
|
||||
}
|
||||
|
||||
- (of_dimension_t)sizeIncrement
|
||||
{
|
||||
return QToOFDimension([self qWidget]->sizeIncrement());
|
||||
}
|
||||
|
||||
- (void)setSizeIncrement: (of_dimension_t)sizeIncrement
|
||||
{
|
||||
[self qWidget]->setSizeIncrement(OFToQSize(sizeIncrement));
|
||||
}
|
||||
|
||||
- (QSizePolicy)sizePolicy
|
||||
{
|
||||
return [self qWidget]->sizePolicy();
|
||||
}
|
||||
|
||||
- (void)setSizePolicy: (QSizePolicy)sizePolicy
|
||||
{
|
||||
[self qWidget]->setSizePolicy(sizePolicy);
|
||||
}
|
||||
|
||||
- (OFString*)statusTip
|
||||
{
|
||||
return QToOFString([self qWidget]->statusTip());
|
||||
}
|
||||
|
||||
- (void)setStatusTip: (OFString*)statusTip
|
||||
{
|
||||
[self qWidget]->setStatusTip(OFToQString(statusTip));
|
||||
}
|
||||
|
||||
- (OFString*)styleSheet
|
||||
{
|
||||
return QToOFString([self qWidget]->styleSheet());
|
||||
}
|
||||
|
||||
- (void)setStyleSheet: (OFString*)styleSheet
|
||||
{
|
||||
[self qWidget]->setStyleSheet(OFToQString(styleSheet));
|
||||
}
|
||||
|
||||
- (OFString*)toolTip
|
||||
{
|
||||
return QToOFString([self qWidget]->toolTip());
|
||||
}
|
||||
|
||||
- (void)setToolTip: (OFString*)toolTip
|
||||
{
|
||||
[self qWidget]->setToolTip(OFToQString(toolTip));
|
||||
}
|
||||
|
||||
- (int)toolTipDuration
|
||||
{
|
||||
return [self qWidget]->toolTipDuration();
|
||||
}
|
||||
|
||||
- (void)setToolTipDuration: (int)toolTipDuration
|
||||
{
|
||||
[self qWidget]->setToolTipDuration(toolTipDuration);
|
||||
}
|
||||
|
||||
- (bool)updatesEnabled
|
||||
{
|
||||
return [self qWidget]->updatesEnabled();
|
||||
}
|
||||
|
||||
- (void)setUpdatesEnabled: (bool)updatesEnabled
|
||||
{
|
||||
[self qWidget]->setUpdatesEnabled(updatesEnabled);
|
||||
}
|
||||
|
||||
- (bool)isVisible
|
||||
{
|
||||
return [self qWidget]->isVisible();
|
||||
}
|
||||
|
||||
- (void)setVisible: (bool)visible
|
||||
{
|
||||
[self qWidget]->setVisible(visible);
|
||||
}
|
||||
|
||||
- (OFString*)whatsThis
|
||||
{
|
||||
return QToOFString([self qWidget]->whatsThis());
|
||||
}
|
||||
|
||||
- (void)setWhatsThis: (OFString*)whatsThis
|
||||
{
|
||||
[self qWidget]->setWhatsThis(OFToQString(whatsThis));
|
||||
}
|
||||
|
||||
- (int)width
|
||||
{
|
||||
return [self qWidget]->width();
|
||||
}
|
||||
|
||||
- (OFString*)windowFilePath
|
||||
{
|
||||
return QToOFString([self qWidget]->windowFilePath());
|
||||
}
|
||||
|
||||
- (void)setWindowFilePath: (OFString*)windowFilePath
|
||||
{
|
||||
[self qWidget]->setWindowFilePath(OFToQString(windowFilePath));
|
||||
}
|
||||
|
||||
- (Qt::WindowFlags)windowFlags
|
||||
{
|
||||
return [self qWidget]->windowFlags();
|
||||
}
|
||||
|
||||
- (void)setWindowFlags: (Qt::WindowFlags)windowFlags
|
||||
{
|
||||
[self qWidget]->setWindowFlags(windowFlags);
|
||||
}
|
||||
|
||||
- (QIcon)windowIcon
|
||||
{
|
||||
return [self qWidget]->windowIcon();
|
||||
}
|
||||
|
||||
- (void)setWindowIcon: (QIcon)windowIcon
|
||||
{
|
||||
[self qWidget]->setWindowIcon(windowIcon);
|
||||
}
|
||||
|
||||
- (Qt::WindowModality)windowModality
|
||||
{
|
||||
return [self qWidget]->windowModality();
|
||||
}
|
||||
|
||||
- (void)setWindowModality: (Qt::WindowModality)windowModality
|
||||
{
|
||||
[self qWidget]->setWindowModality(windowModality);
|
||||
}
|
||||
|
||||
- (bool)isWindowModified
|
||||
{
|
||||
return [self qWidget]->isWindowModified();
|
||||
}
|
||||
|
||||
- (void)setWindowModified: (bool)windowModified
|
||||
{
|
||||
[self qWidget]->setWindowModified(windowModified);
|
||||
}
|
||||
|
||||
- (double)windowOpacity
|
||||
{
|
||||
return [self qWidget]->windowOpacity();
|
||||
}
|
||||
|
||||
- (void)setWindowOpacity: (double)windowOpacity
|
||||
{
|
||||
[self qWidget]->setWindowOpacity(windowOpacity);
|
||||
}
|
||||
|
||||
- (OFString*)windowTitle
|
||||
{
|
||||
return QToOFString([self qWidget]->windowTitle());
|
||||
}
|
||||
|
||||
- (void)setWindowTitle: (OFString*)windowTitle
|
||||
{
|
||||
[self qWidget]->setWindowTitle(OFToQString(windowTitle));
|
||||
}
|
||||
|
||||
- (int)x
|
||||
{
|
||||
return [self qWidget]->x();
|
||||
}
|
||||
|
||||
- (int)y
|
||||
{
|
||||
return [self qWidget]->y();
|
||||
}
|
||||
@end
|
|
@ -1,6 +1,8 @@
|
|||
#import <ObjFW/ObjFW.h>
|
||||
|
||||
#include <QString>
|
||||
#include <QSize>
|
||||
#include <QRect>
|
||||
|
||||
inline OFString*
|
||||
QToOFString(const QString &qString)
|
||||
|
@ -13,3 +15,41 @@ OFToQString(OFString *string)
|
|||
{
|
||||
return QString::fromUtf8([string UTF8String]);
|
||||
}
|
||||
|
||||
inline of_dimension_t
|
||||
QToOFDimension(const QSize &qSize)
|
||||
{
|
||||
return of_dimension(qSize.width(), qSize.height());
|
||||
}
|
||||
|
||||
inline of_point_t
|
||||
QToOFPoint(const QPoint &qPoint)
|
||||
{
|
||||
return of_point(qPoint.x(), qPoint.y());
|
||||
}
|
||||
|
||||
inline QPoint
|
||||
OFToQPoint(of_point_t point)
|
||||
{
|
||||
return QPoint(point.x, point.y);
|
||||
}
|
||||
|
||||
inline QSize
|
||||
OFToQSize(of_dimension_t dimension)
|
||||
{
|
||||
return QSize(dimension.width, dimension.height);
|
||||
}
|
||||
|
||||
inline of_rectangle_t
|
||||
QToOFRectangle(const QRect &qRect)
|
||||
{
|
||||
return of_rectangle(qRect.x(), qRect.y(),
|
||||
qRect.width(), qRect.height());
|
||||
}
|
||||
|
||||
inline QRect
|
||||
OFToQRect(of_rectangle_t rectangle)
|
||||
{
|
||||
return QRect(rectangle.origin.x, rectangle.origin.y,
|
||||
rectangle.size.width, rectangle.size.height);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue