1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
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
45
46
47
48
49
50
51
52
53
54
55
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
#import <ObjFW/ObjFW.h>
#include <QString>
#include <QSize>
#include <QRect>
inline OFString*
QToOFString(const QString &qString)
{
return [OFString stringWithUTF8String: qString.toUtf8()];
}
inline QString
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);
}
|