Add QtPaintDevice and initial QtWidget
This commit is contained in:
parent
f38ff5fbc2
commit
1d907ed62d
8 changed files with 764 additions and 7 deletions
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
|
Loading…
Add table
Add a link
Reference in a new issue