ObjQt  Check-in [142cffefb2]

Overview
Comment:Adjust to ObjFW changes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 142cffefb282c7d4464309c544b0d2866ce8f0b2d91940c1552d4afa417772fc
User & Date: js on 2017-07-23 12:15:23
Other Links: manifest | tags
Context
2017-11-19
15:05
Make more things properties check-in: ddbc7922c5 user: js tags: trunk
2017-07-23
12:15
Adjust to ObjFW changes check-in: 142cffefb2 user: js tags: trunk
2017-05-14
01:07
Handle NULL / nil in toOF() / toQt() check-in: 6c336e34d7 user: js tags: trunk
Changes

Modified configure.ac from [37d4e702b4] to [4d56fc9241].

31
32
33
34
35
36
37


38
39
40
41
42
43
44
	AC_MSG_ERROR(You need a compiler that supports C++11!)
])

AX_CHECK_COMPILER_FLAGS(-pipe, [OBJCXXFLAGS="$OBJCXXFLAGS -pipe"])
AX_CHECK_COMPILER_FLAGS(-fno-common, [OBJCXXFLAGS="$OBJCXXFLAGS -fno-common"])
AX_CHECK_COMPILER_FLAGS(-Wobjc-missing-property-synthesis -Werror,
	[OBJCXXFLAGS="$OBJCXXFLAGS -Wobjc-missing-property-synthesis"])


AX_CHECK_COMPILER_FLAGS(-Wno-ignored-attributes -Werror,
	[OBJCXXFLAGS="$OBJCXXFLAGS -Wno-ignored-attributes"])

AC_CHECK_TOOL(AR, ar)
AC_PROG_RANLIB
AC_ARG_ENABLE(shared,
	AS_HELP_STRING([--disable-shared], [do not build shared library]))







>
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
	AC_MSG_ERROR(You need a compiler that supports C++11!)
])

AX_CHECK_COMPILER_FLAGS(-pipe, [OBJCXXFLAGS="$OBJCXXFLAGS -pipe"])
AX_CHECK_COMPILER_FLAGS(-fno-common, [OBJCXXFLAGS="$OBJCXXFLAGS -fno-common"])
AX_CHECK_COMPILER_FLAGS(-Wobjc-missing-property-synthesis -Werror,
	[OBJCXXFLAGS="$OBJCXXFLAGS -Wobjc-missing-property-synthesis"])
AX_CHECK_COMPILER_FLAGS(-Watomic-properties,
	[OBJCXXFLAGS="$OBJCXXFLAGS -Watomic-properties"])
AX_CHECK_COMPILER_FLAGS(-Wno-ignored-attributes -Werror,
	[OBJCXXFLAGS="$OBJCXXFLAGS -Wno-ignored-attributes"])

AC_CHECK_TOOL(AR, ar)
AC_PROG_RANLIB
AC_ARG_ENABLE(shared,
	AS_HELP_STRING([--disable-shared], [do not build shared library]))

Modified src/QtCore/QtObject.h from [76db7e3c84] to [054b094c22].

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
- (bool)disconnectSignal: (OFString *)signal
		receiver: (QtObject *)receiver
		  method: (OFString *)method;
- (bool)disconnectAllSignalsForReceiver: (QtObject *)receiver
				 method: (OFString *)method;
- (void)dumpObjectInfo;
- (void)dumpObjectTree;
- (OFArray OF_GENERIC(OFDataArray *) *)dynamicPropertyNames;
- (bool)handleEvent: (QtEvent *)event;
- (bool)filterEvent: (QtEvent *)event
	  forObject: (QtObject *)watched;
// MISSING: T findChild(const QString &name = QString(),
//     Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;
// MISSING QList<T> findChildren(const QString &name = QString(),
//     Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;







|







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
- (bool)disconnectSignal: (OFString *)signal
		receiver: (QtObject *)receiver
		  method: (OFString *)method;
- (bool)disconnectAllSignalsForReceiver: (QtObject *)receiver
				 method: (OFString *)method;
- (void)dumpObjectInfo;
- (void)dumpObjectTree;
- (OFArray OF_GENERIC(OFData *) *)dynamicPropertyNames;
- (bool)handleEvent: (QtEvent *)event;
- (bool)filterEvent: (QtEvent *)event
	  forObject: (QtObject *)watched;
// MISSING: T findChild(const QString &name = QString(),
//     Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;
// MISSING QList<T> findChildren(const QString &name = QString(),
//     Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;

Modified src/QtCore/QtObject.mm from [e59a1442ac] to [6d3b19433b].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 * 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







|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtObject.h"
#import "QtEvent.h"
#import "QtThread.h"
#import "OFString+QString.h"
#import "OFData+QByteArray.h"

#include <QVariant>

using ObjQt::toOF;
using ObjQt::toQt;

@implementation QtObject
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
}

- (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();








|







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
}

- (void)dumpObjectTree
{
	_qObject->dumpObjectTree();
}

- (OFArray OF_GENERIC(OFData *) *)dynamicPropertyNames
{
	const QList<QByteArray> &dynamicPropertyNames =
	    _qObject->dynamicPropertyNames();
	OFMutableArray *ret =
	    [OFMutableArray arrayWithCapacity: dynamicPropertyNames.count()];
	void *pool = objc_autoreleasePoolPush();

Modified src/QtWidgets/QtWidget.h from [5d9835a3dd] to [b33956c62e].

165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
	     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;







|
|







165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
	     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: (OFData *)geometry;
- (OFData *)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;

Modified src/QtWidgets/QtWidget.mm from [df0e867276] to [e8759548d3].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 * 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;







|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 * 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 "OFData+QByteArray.h"

#import "helpers.h"

#include <QIcon>
#include <QLocale>

using ObjQt::toOF;
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
}

- (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
{







|




|







909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
}

- (void)repaintInRegion: (const QRegion &)region
{
	toQt(self)->repaint(region);
}

- (bool)restoreGeometry: (OFData *)geometry
{
	return toQt(self)->restoreGeometry(toQt(geometry));
}

- (OFData *)saveGeometry
{
	return toOF(toQt(self)->saveGeometry());
}

- (void)scrollRight: (int)dx
	       down: (int)dy
{

Modified src/common/Makefile from [f19191576a] to [aaebe78678].

1
2
3
4
5
6
7
8
9
10
11
include ../../extra.mk

STATIC_PIC_LIB_NOINST = ${COMMON_LIB_A}
STATIC_LIB_NOINST = ${COMMON_A}

SRCS = OFDataArray+QByteArray.mm	\
       OFString+QString.mm

include ../../buildsys.mk

CPPFLAGS += -I. -I../QtCore





|





1
2
3
4
5
6
7
8
9
10
11
include ../../extra.mk

STATIC_PIC_LIB_NOINST = ${COMMON_LIB_A}
STATIC_LIB_NOINST = ${COMMON_A}

SRCS = OFData+QByteArray.mm	\
       OFString+QString.mm

include ../../buildsys.mk

CPPFLAGS += -I. -I../QtCore

Added src/common/OFData+QByteArray.h version [77e4ae805c].









































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * 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 <ObjFW/ObjFW.h>

#include <QByteArray>

@interface OFData (QByteArray)
+ (instancetype)dataWithQByteArray: (const QByteArray &)qByteArray;
- (QByteArray)qByteArray;
@end

namespace ObjQt {

static OF_INLINE OFData *
toOF(const QByteArray &qByteArray)
{
	if (qByteArray.isNull())
		return nil;

	return [OFData dataWithQByteArray: qByteArray];
}

static OF_INLINE QByteArray
toQt(OFData *data)
{
	if (data == nil)
		return QByteArray();

	return [data qByteArray];
}

}

Added src/common/OFData+QByteArray.mm version [5791aa6b1b].











































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * 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 "OFData+QByteArray.h"

@implementation OFData (QByteArray)
+ (instancetype)dataWithQByteArray: (const QByteArray &)qByteArray
{
	return [OFData dataWithItems: qByteArray.data()
			       count: qByteArray.count()];
}

- (QByteArray)qByteArray
{
	return QByteArray((const char *)[self items],
	    [self count] * [self itemSize]);
}
@end

Deleted src/common/OFDataArray+QByteArray.h version [0d699d1d90].

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
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * 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 <ObjFW/ObjFW.h>

#include <QByteArray>

@interface OFDataArray (QByteArray)
+ (instancetype)dataArrayWithQByteArray: (const QByteArray &)qByteArray;
- (QByteArray)qByteArray;
@end

namespace ObjQt {

static OF_INLINE OFDataArray *
toOF(const QByteArray &qByteArray)
{
	if (qByteArray.isNull())
		return nil;

	return [OFDataArray dataArrayWithQByteArray: qByteArray];
}

static OF_INLINE QByteArray
toQt(OFDataArray *dataArray)
{
	if (dataArray == nil)
		return QByteArray();

	return [dataArray qByteArray];
}

}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































Deleted src/common/OFDataArray+QByteArray.mm version [d8eb348c3a].

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
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * 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 "OFDataArray+QByteArray.h"

@implementation OFDataArray (QByteArray)
+ (instancetype)dataArrayWithQByteArray: (const QByteArray &)qByteArray
{
	OFDataArray *ret = [OFDataArray dataArray];
	[ret addItems: qByteArray.data()
		count: qByteArray.count()];

	return ret;
}

- (QByteArray)qByteArray
{
	return QByteArray((char *)[self items], [self count] * [self itemSize]);
}
@end
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<