summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/kernel.pri
blob: a8d09b0bc11cf9c706071de60be73acf35985116 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# Qt kernel module

# Only used on platforms with CONFIG += precompile_header
PRECOMPILED_HEADER = kernel/qt_gui_pch.h


KERNEL_P= kernel
HEADERS += \
	kernel/qaction.h \
	kernel/qactiongroup.h \
	kernel/qapplication.h \
	kernel/qapplication_p.h \
	kernel/qboxlayout.h \
	kernel/qclipboard.h \
	kernel/qcursor.h \
	kernel/qdesktopwidget.h \
	kernel/qdrag.h \
	kernel/qdnd_p.h \
	kernel/qevent.h \
	kernel/qevent_p.h \
	kernel/qformlayout.h \
	kernel/qgridlayout.h \
	kernel/qkeysequence.h \
	kernel/qlayout.h \
	kernel/qlayout_p.h \
	kernel/qlayoutengine_p.h \
	kernel/qlayoutitem.h \
	kernel/qmime.h \
	kernel/qsessionmanager.h \
	kernel/qshortcut.h \
	kernel/qshortcutmap_p.h \
	kernel/qsizepolicy.h \
	kernel/qpalette.h \
	kernel/qsound.h \
	kernel/qsound_p.h \
	kernel/qstackedlayout.h \
	kernel/qtooltip.h \
	kernel/qwhatsthis.h \
        kernel/qwidget.h \
        kernel/qwidget_p.h \
	kernel/qwidgetaction.h \
	kernel/qwidgetaction_p.h \
	kernel/qwindowdefs.h \
	kernel/qkeymapper_p.h \
	kernel/qgesture.h \
	kernel/qgesture_p.h \
	kernel/qgesturemanager_p.h \
	kernel/qgesturerecognizer_p.h \
	kernel/qgesturerecognizer.h \
	kernel/qgesturestandardrecognizers_p.h \
	kernel/qdirectionrecognizer_p.h \
	kernel/qdirectionsimplificator_p.h

SOURCES += \
	kernel/qaction.cpp \
	kernel/qactiongroup.cpp \
	kernel/qapplication.cpp \
	kernel/qboxlayout.cpp \
	kernel/qclipboard.cpp \
	kernel/qcursor.cpp \
	kernel/qdrag.cpp \
	kernel/qdnd.cpp \
	kernel/qevent.cpp \
	kernel/qformlayout.cpp \
	kernel/qgridlayout.cpp \
	kernel/qkeysequence.cpp \
	kernel/qlayout.cpp \
	kernel/qlayoutengine.cpp \
	kernel/qlayoutitem.cpp \
	kernel/qmime.cpp \
	kernel/qpalette.cpp \
	kernel/qshortcut.cpp \
	kernel/qshortcutmap.cpp \
	kernel/qsound.cpp \
	kernel/qstackedlayout.cpp \
	kernel/qtooltip.cpp \
	kernel/qguivariant.cpp \
	kernel/qwhatsthis.cpp \
	kernel/qwidget.cpp \
	kernel/qwidgetaction.cpp \
	kernel/qkeymapper.cpp \
	kernel/qgesture.cpp \
	kernel/qgesturemanager.cpp \
	kernel/qgesturerecognizer.cpp \
	kernel/qgesturestandardrecognizers.cpp \
	kernel/qdirectionrecognizer.cpp

win32 {
	DEFINES += QT_NO_DIRECTDRAW

	SOURCES += \
		kernel/qapplication_win.cpp \
		kernel/qclipboard_win.cpp \
		kernel/qcursor_win.cpp \
		kernel/qdesktopwidget_win.cpp \
		kernel/qdnd_win.cpp \
		kernel/qmime_win.cpp \
		kernel/qsound_win.cpp \
		kernel/qwidget_win.cpp \
		kernel/qole_win.cpp \
		kernel/qkeymapper_win.cpp

        !contains(DEFINES, QT_NO_DIRECTDRAW):LIBS += ddraw.lib
}

symbian {
        SOURCES += \
                kernel/qapplication_s60.cpp \
                kernel/qeventdispatcher_s60.cpp \
                kernel/qwidget_s60.cpp \
                kernel/qcursor_s60.cpp \
                kernel/qdesktopwidget_s60.cpp \
                kernel/qkeymapper_s60.cpp\
                kernel/qclipboard_s60.cpp\
                kernel/qdnd_s60.cpp \
                kernel/qsound_s60.cpp
                
        HEADERS += \
                kernel/qt_s60_p.h \
                kernel/qeventdispatcher_s60_p.h
        LIBS += -lbafl -lestor

        INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
}


unix:x11 {
	INCLUDEPATH += ../3rdparty/xorg
	HEADERS += \
		kernel/qx11embed_x11.h \
		kernel/qx11info_x11.h

	SOURCES += \
		kernel/qapplication_x11.cpp \
		kernel/qclipboard_x11.cpp \
		kernel/qcursor_x11.cpp \
		kernel/qdnd_x11.cpp \
		kernel/qdesktopwidget_x11.cpp \
		kernel/qmotifdnd_x11.cpp \
		kernel/qsound_x11.cpp \
		kernel/qwidget_x11.cpp \
		kernel/qwidgetcreate_x11.cpp \
		kernel/qx11embed_x11.cpp \
		kernel/qx11info_x11.cpp \
		kernel/qkeymapper_x11.cpp

        contains(QT_CONFIG, glib) {
            SOURCES += \
		kernel/qguieventdispatcher_glib.cpp
            HEADERS += \
                kernel/qguieventdispatcher_glib_p.h
            QMAKE_CXXFLAGS += $$QT_CFLAGS_GLIB
	    LIBS +=$$QT_LIBS_GLIB
	}
            SOURCES += \
		kernel/qeventdispatcher_x11.cpp
            HEADERS += \
                kernel/qeventdispatcher_x11_p.h
}

embedded {
	HEADERS += \
		kernel/qeventdispatcher_qws_p.h

	SOURCES += \
		kernel/qapplication_qws.cpp \
		kernel/qclipboard_qws.cpp \
		kernel/qcursor_qws.cpp \
		kernel/qdesktopwidget_qws.cpp \
		kernel/qdnd_qws.cpp \
		kernel/qeventdispatcher_qws.cpp \
		kernel/qsound_qws.cpp \
		kernel/qwidget_qws.cpp \
		kernel/qkeymapper_qws.cpp \
		kernel/qsessionmanager_qws.cpp

        contains(QT_CONFIG, glib) {
            SOURCES += \
		kernel/qeventdispatcher_glib_qws.cpp
            HEADERS += \
                kernel/qeventdispatcher_glib_qws_p.h
            QMAKE_CXXFLAGS += $$QT_CFLAGS_GLIB
	}


}

!embedded:!x11:mac {
	SOURCES += \
		kernel/qclipboard_mac.cpp \
		kernel/qmime_mac.cpp \
		kernel/qt_mac.cpp \
		kernel/qkeymapper_mac.cpp

        OBJECTIVE_HEADERS += \
                qcocoawindow_mac_p.h \
                qcocoawindowdelegate_mac_p.h \
                qcocoaview_mac_p.h \
                qcocoaapplication_mac_p.h \
                qcocoaapplicationdelegate_mac_p.h \
                qmultitouch_mac_p.h 

        OBJECTIVE_SOURCES += \
                kernel/qcursor_mac.mm \
                kernel/qdnd_mac.mm \
                kernel/qsound_mac.mm  \
                kernel/qapplication_mac.mm \
		        kernel/qwidget_mac.mm \
		        kernel/qcocoapanel_mac.mm \
                kernel/qcocoaview_mac.mm \
                kernel/qcocoawindow_mac.mm \
                kernel/qcocoawindowdelegate_mac.mm \
                kernel/qcocoamenuloader_mac.mm \
                kernel/qcocoaapplication_mac.mm \
                kernel/qcocoaapplicationdelegate_mac.mm \
                kernel/qt_cocoa_helpers_mac.mm \
                kernel/qdesktopwidget_mac.mm \
                kernel/qeventdispatcher_mac.mm \
                kernel/qcocoawindowcustomthemeframe_mac.mm \   
                kernel/qmultitouch_mac.mm \

        HEADERS += \
                kernel/qt_cocoa_helpers_mac_p.h \
                kernel/qcocoaapplication_mac_p.h \
                kernel/qcocoaapplicationdelegate_mac_p.h \
                kernel/qeventdispatcher_mac_p.h

        MENU_NIB.files = mac/qt_menu.nib 
        MENU_NIB.path = Resources 
        MENU_NIB.version = Versions
        QMAKE_BUNDLE_DATA += MENU_NIB 
        RESOURCES += mac/macresources.qrc

        LIBS += -framework AppKit
}

wince*: {
        HEADERS += \
                ../corelib/kernel/qfunctions_wince.h \
                kernel/qguifunctions_wince.h

        SOURCES += \
                ../corelib/kernel/qfunctions_wince.cpp \
                kernel/qguifunctions_wince.cpp
}
an>toInt(&ok); if (!ok) return false; const int minor = rx.cap(2).toInt(&ok); if (!ok) return false; // return (major > 3 || (major == 3 && minor >= 3)); // v >= 3.3 for --callgrind-out-file option Q_UNUSED(major); Q_UNUSED(minor); return true; // skip version restriction for now #endif } // Reruns this program through callgrind. // Returns true upon success, otherwise false. bool QBenchmarkValgrindUtils::rerunThroughCallgrind(const QStringList &origAppArgs, int &exitCode) { if (!QBenchmarkValgrindUtils::runCallgrindSubProcess(origAppArgs, exitCode)) { qWarning("failed to run callgrind subprocess"); return false; } return true; } static void dumpOutput(const QByteArray &data, FILE *fh) { QFile file; file.open(fh, QIODevice::WriteOnly); file.write(data); } qint64 QBenchmarkValgrindUtils::extractResult(const QString &fileName) { QFile file(fileName); const bool openOk = file.open(QIODevice::ReadOnly | QIODevice::Text); Q_ASSERT(openOk); Q_UNUSED(openOk); qint64 val = -1; bool valSeen = false; const QRegExp rxValue(QLatin1String("^summary: (\\d+)")); while (!file.atEnd()) { const QString line(QLatin1String(file.readLine())); if (rxValue.indexIn(line) != -1) { Q_ASSERT(rxValue.captureCount() == 1); bool ok; val = rxValue.cap(1).toLongLong(&ok); Q_ASSERT(ok); valSeen = true; break; } } Q_ASSERT(valSeen); return val; } // Gets the newest file name (i.e. the one with the highest integer suffix). QString QBenchmarkValgrindUtils::getNewestFileName() { QStringList nameFilters; QString base = QBenchmarkGlobalData::current->callgrindOutFileBase; Q_ASSERT(!base.isEmpty()); nameFilters << QString::fromLatin1("%1.*").arg(base); QFileInfoList fiList = QDir().entryInfoList(nameFilters, QDir::Files | QDir::Readable); Q_ASSERT(!fiList.empty()); int hiSuffix = -1; QFileInfo lastFileInfo; const QString pattern = QString::fromLatin1("%1.(\\d+)").arg(base); const QRegExp rx(pattern); foreach (QFileInfo fileInfo, fiList) { const int index = rx.indexIn(fileInfo.fileName()); Q_ASSERT(index == 0); Q_UNUSED(index); bool ok; const int suffix = rx.cap(1).toInt(&ok); Q_ASSERT(ok); Q_ASSERT(suffix >= 0); if (suffix > hiSuffix) { lastFileInfo = fileInfo; hiSuffix = suffix; } } return lastFileInfo.fileName(); } qint64 QBenchmarkValgrindUtils::extractLastResult() { return extractResult(getNewestFileName()); } void QBenchmarkValgrindUtils::cleanup() { QStringList nameFilters; QString base = QBenchmarkGlobalData::current->callgrindOutFileBase; Q_ASSERT(!base.isEmpty()); nameFilters << base // overall summary << QString::fromLatin1("%1.*").arg(base); // individual dumps QFileInfoList fiList = QDir().entryInfoList(nameFilters, QDir::Files | QDir::Readable); foreach (QFileInfo fileInfo, fiList) { const bool removeOk = QFile::remove(fileInfo.fileName()); Q_ASSERT(removeOk); Q_UNUSED(removeOk); } } QString QBenchmarkValgrindUtils::outFileBase(qint64 pid) { return QString::fromLatin1("callgrind.out.%1").arg( pid != -1 ? pid : QCoreApplication::applicationPid()); } // Reruns this program through callgrind, storing callgrind result files in the // current directory. // Returns true upon success, otherwise false. bool QBenchmarkValgrindUtils::runCallgrindSubProcess(const QStringList &origAppArgs, int &exitCode) { const QString execFile(origAppArgs.at(0)); QStringList args; args << QLatin1String("--tool=callgrind") << QLatin1String("--instr-atstart=yes") << QLatin1String("--quiet") << execFile << QLatin1String("-callgrindchild"); #if (defined Q_WS_QWS) // While running the child process, we aren't processing events, and hence aren't // acting as the QWS server. Therefore it's necessary to tell the child to act // as its own server instead of connecting to us. args << QLatin1String("-qws"); #endif // pass on original arguments that make sense (e.g. avoid wasting time producing output // that will be ignored anyway) ... for (int i = 1; i < origAppArgs.size(); ++i) { const QString arg(origAppArgs.at(i)); if (arg == QLatin1String("-callgrind")) continue; args << arg; // ok to pass on } QProcess process; process.start(QLatin1String("valgrind"), args); process.waitForStarted(-1); QBenchmarkGlobalData::current->callgrindOutFileBase = QBenchmarkValgrindUtils::outFileBase(process.pid()); const bool finishedOk = process.waitForFinished(-1); exitCode = process.exitCode(); dumpOutput(process.readAllStandardOutput(), stdout); dumpOutput(process.readAllStandardError(), stderr); return finishedOk; } void QBenchmarkCallgrindMeasurer::start() { CALLGRIND_ZERO_STATS; } qint64 QBenchmarkCallgrindMeasurer::checkpoint() { CALLGRIND_DUMP_STATS; const qint64 result = QBenchmarkValgrindUtils::extractLastResult(); return result; } qint64 QBenchmarkCallgrindMeasurer::stop() { return checkpoint(); } bool QBenchmarkCallgrindMeasurer::isMeasurementAccepted(qint64 measurement) { Q_UNUSED(measurement); return true; } int QBenchmarkCallgrindMeasurer::adjustIterationCount(int) { return 1; } int QBenchmarkCallgrindMeasurer::adjustMedianCount(int) { return 1; } bool QBenchmarkCallgrindMeasurer::needsWarmupIteration() { return true; } QTest::QBenchmarkMetric QBenchmarkCallgrindMeasurer::metricType() { return QTest::InstructionReads; } QT_END_NAMESPACE #endif // QTESTLIB_USE_VALGRIND