aboutsummaryrefslogtreecommitdiffstats
path: root/src/virtualkeyboard/virtualkeyboard.pro
blob: 2b2f2aac0b5a54c1cf7876e54e61acbafba0c41a (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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
TARGET  = qtvirtualkeyboardplugin
DATAPATH = $$[QT_INSTALL_DATA]/qtvirtualkeyboard

QMAKE_DOCS = $$PWD/doc/qtvirtualkeyboard.qdocconf
include(doc/doc.pri)

QT += qml quick gui gui-private core-private

win32 {
    CONFIG += no-pkg-config
    QMAKE_TARGET_PRODUCT = "Qt Virtual Keyboard (Qt $$QT_VERSION)"
    QMAKE_TARGET_DESCRIPTION = "Virtual Keyboard for Qt."
}

!no-pkg-config: CONFIG += link_pkgconfig

include(../config.pri)

SOURCES += platforminputcontext.cpp \
    inputcontext.cpp \
    abstractinputmethod.cpp \
    plaininputmethod.cpp \
    inputengine.cpp \
    shifthandler.cpp \
    plugin.cpp \
    inputmethod.cpp \
    inputselectionhandle.cpp \
    selectionlistmodel.cpp \
    defaultinputmethod.cpp \
    abstractinputpanel.cpp \
    enterkeyaction.cpp \
    enterkeyactionattachedtype.cpp \
    settings.cpp \
    virtualkeyboardsettings.cpp \
    trace.cpp \
    desktopinputselectioncontrol.cpp \
    shadowinputcontext.cpp \
    gesturerecognizer.cpp \
    handwritinggesturerecognizer.cpp

HEADERS += platforminputcontext.h \
    inputcontext.h \
    abstractinputmethod.h \
    plaininputmethod.h \
    inputengine.h \
    shifthandler.h \
    inputmethod.h \
    inputselectionhandle.h \
    selectionlistmodel.h \
    defaultinputmethod.h \
    abstractinputpanel.h \
    virtualkeyboarddebug.h \
    enterkeyaction.h \
    enterkeyactionattachedtype.h \
    settings.h \
    virtualkeyboardsettings.h \
    plugin.h \
    trace.h \
    desktopinputselectioncontrol.h \
    shadowinputcontext.h \
    gesturerecognizer.h \
    handwritinggesturerecognizer.h

RESOURCES += \
    content/styles/default/default_style.qrc \
    content/styles/retro/retro_style.qrc \
    content/content.qrc

# Fallback for languages which don't have these special layouts
LAYOUT_FILES += \
    content/layouts/en_GB/dialpad.qml \
    content/layouts/en_GB/digits.qml \
    content/layouts/en_GB/numbers.qml
contains(CONFIG, lang-en.*) {
    LAYOUT_FILES += \
        content/layouts/en_GB/main.qml \
        content/layouts/en_GB/symbols.qml
t9write-alphabetic|lipi-toolkit: LAYOUT_FILES += \
        content/layouts/en_GB/handwriting.qml
}
contains(CONFIG, lang-ar.*) {
    LAYOUT_FILES += \
        content/layouts/ar_AR/digits.qml \
        content/layouts/ar_AR/main.qml \
        content/layouts/ar_AR/numbers.qml \
        content/layouts/ar_AR/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/ar_AR/handwriting.qml
}
contains(CONFIG, lang-bg.*) {
    LAYOUT_FILES += \
        content/layouts/bg_BG/main.qml \
        content/layouts/bg_BG/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/bg_BG/handwriting.qml
}
contains(CONFIG, lang-cs.*) {
    LAYOUT_FILES += \
        content/layouts/cs_CZ/main.qml \
        content/layouts/cs_CZ/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/cs_CZ/handwriting.qml
}
contains(CONFIG, lang-da.*) {
    LAYOUT_FILES += \
        content/layouts/da_DK/main.qml \
        content/layouts/da_DK/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/da_DK/handwriting.qml
}
contains(CONFIG, lang-de.*) {
    LAYOUT_FILES += \
        content/layouts/de_DE/main.qml \
        content/layouts/de_DE/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/de_DE/handwriting.qml
}
contains(CONFIG, lang-el.*) {
    LAYOUT_FILES += \
        content/layouts/el_GR/main.qml \
        content/layouts/el_GR/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/el_GR/handwriting.qml
}
contains(CONFIG, lang-es.*) {
    LAYOUT_FILES += \
        content/layouts/es_ES/main.qml \
        content/layouts/es_ES/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/es_ES/handwriting.qml
}
contains(CONFIG, lang-et.*) {
    LAYOUT_FILES += \
        content/layouts/et_EE/main.qml \
        content/layouts/et_EE/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/et_EE/handwriting.qml
}
contains(CONFIG, lang-fa.*) {
    LAYOUT_FILES += \
        content/layouts/fa_FA/digits.qml \
        content/layouts/fa_FA/main.qml \
        content/layouts/fa_FA/numbers.qml \
        content/layouts/fa_FA/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/fa_FA/handwriting.qml
}
contains(CONFIG, lang-fi.*) {
    LAYOUT_FILES += \
        content/layouts/fi_FI/main.qml \
        content/layouts/fi_FI/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/fi_FI/handwriting.qml
}
contains(CONFIG, lang-fr.*) {
    LAYOUT_FILES += \
        content/layouts/fr_FR/main.qml \
        content/layouts/fr_FR/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/fr_FR/handwriting.qml
}
contains(CONFIG, lang-he.*) {
    LAYOUT_FILES += \
        content/layouts/he_IL/main.qml \
        content/layouts/he_IL/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/he_IL/handwriting.qml
}
contains(CONFIG, lang-hi.*) {
    LAYOUT_FILES += \
        content/layouts/hi_IN/main.qml \
        content/layouts/hi_IN/symbols.qml
}
contains(CONFIG, lang-hr.*) {
    LAYOUT_FILES += \
        content/layouts/hr_HR/main.qml \
        content/layouts/hr_HR/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/hr_HR/handwriting.qml
}
contains(CONFIG, lang-hu.*) {
    LAYOUT_FILES += \
        content/layouts/hu_HU/main.qml \
        content/layouts/hu_HU/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/hu_HU/handwriting.qml
}
contains(CONFIG, lang-it.*) {
    LAYOUT_FILES += \
        content/layouts/it_IT/main.qml \
        content/layouts/it_IT/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/it_IT/handwriting.qml
}
contains(CONFIG, lang-ja.*) {
    LAYOUT_FILES += \
        content/layouts/ja_JP/main.qml \
        content/layouts/ja_JP/symbols.qml
t9write-cjk: LAYOUT_FILES += \
        content/layouts/ja_JP/handwriting.qml
}
contains(CONFIG, lang-ko.*) {
    LAYOUT_FILES += \
        content/layouts/ko_KR/main.qml \
        content/layouts/ko_KR/symbols.qml
t9write-cjk: LAYOUT_FILES += \
        content/layouts/ko_KR/handwriting.qml
}
contains(CONFIG, lang-nb.*) {
    LAYOUT_FILES += \
        content/layouts/nb_NO/main.qml \
        content/layouts/nb_NO/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/nb_NO/handwriting.qml
}
contains(CONFIG, lang-nl.*) {
    LAYOUT_FILES += \
        content/layouts/nl_NL/main.qml \
        content/layouts/nl_NL/symbols.qml
t9write-alphabetic|lipi-toolkit: LAYOUT_FILES += \
        content/layouts/nl_NL/handwriting.qml
}
contains(CONFIG, lang-pl.*) {
    LAYOUT_FILES += \
        content/layouts/pl_PL/main.qml \
        content/layouts/pl_PL/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/pl_PL/handwriting.qml
}
contains(CONFIG, lang-pt.*) {
    LAYOUT_FILES += \
        content/layouts/pt_PT/main.qml \
        content/layouts/pt_PT/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/pt_PT/handwriting.qml
}
contains(CONFIG, lang-ro.*) {
    LAYOUT_FILES += \
        content/layouts/ro_RO/main.qml \
        content/layouts/ro_RO/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/ro_RO/handwriting.qml
}
contains(CONFIG, lang-ru.*) {
    LAYOUT_FILES += \
        content/layouts/ru_RU/main.qml \
        content/layouts/ru_RU/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/ru_RU/handwriting.qml
}
contains(CONFIG, lang-sr.*) {
    LAYOUT_FILES += \
        content/layouts/sr_SP/main.qml \
        content/layouts/sr_SP/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/sr_SP/handwriting.qml
}
contains(CONFIG, lang-sv.*) {
    LAYOUT_FILES += \
        content/layouts/sv_SE/main.qml \
        content/layouts/sv_SE/symbols.qml
t9write-alphabetic: LAYOUT_FILES += \
        content/layouts/sv_SE/handwriting.qml
}
contains(CONFIG, lang-zh(_CN)?) {
    LAYOUT_FILES += \
        content/layouts/zh_CN/main.qml \
        content/layouts/zh_CN/symbols.qml
t9write-cjk: LAYOUT_FILES += \
        content/layouts/zh_CN/handwriting.qml
}
contains(CONFIG, lang-zh(_TW)?) {
    LAYOUT_FILES += \
        content/layouts/zh_TW/main.qml \
        content/layouts/zh_TW/symbols.qml
t9write-cjk: LAYOUT_FILES += \
        content/layouts/zh_TW/handwriting.qml
}

retro-style {
    DEFINES += QT_VIRTUALKEYBOARD_DEFAULT_STYLE=\\\"retro\\\"
} else {
    DEFINES += QT_VIRTUALKEYBOARD_DEFAULT_STYLE=\\\"default\\\"
}

DEFINES += QT_VIRTUALKEYBOARD_DEFAULT_LAYOUTS_DIR=\\\"qrc:/QtQuick/VirtualKeyboard/content/layouts\\\"

OTHER_FILES += \
    content/styles/default/*.qml \
    content/styles/retro/*.qml \
    content/*.qml \
    content/components/*.qml \
    qtvirtualkeyboard.json

!disable-desktop:isEmpty(CROSS_COMPILE):!android-embedded:!qnx {
    SOURCES += desktopinputpanel.cpp inputview.cpp
    HEADERS += desktopinputpanel.h inputview.h
    DEFINES += QT_VIRTUALKEYBOARD_DESKTOP
    !no-pkg-config:packagesExist(xcb) {
        PKGCONFIG += xcb xcb-xfixes
        DEFINES += QT_VIRTUALKEYBOARD_HAVE_XCB
    }
}
SOURCES += appinputpanel.cpp
HEADERS += appinputpanel.h

qtquickcompiler: DEFINES += COMPILING_QML

!disable-hunspell {
    exists(3rdparty/hunspell/src/hunspell/hunspell.h) {
        SOURCES += hunspellinputmethod.cpp hunspellinputmethod_p.cpp hunspellworker.cpp
        HEADERS += hunspellinputmethod.h hunspellinputmethod_p.h hunspellworker.h
        DEFINES += HAVE_HUNSPELL
        QMAKE_USE += hunspell
        exists(3rdparty/hunspell/data) {
            hunspell_data.files = 3rdparty/hunspell/data/*.dic 3rdparty/hunspell/data/*.aff
            hunspell_data.path = $$DATAPATH/hunspell
            INSTALLS += hunspell_data
            !prefix_build: COPIES += hunspell_data
        } else {
            error("Hunspell dictionaries are missing! Please copy .dic and .aff" \
                  "files to src/virtualkeyboard/3rdparty/hunspell/data directory.")
        }
    } else:!no-pkg-config:packagesExist(hunspell) {
        SOURCES += hunspellinputmethod.cpp hunspellinputmethod_p.cpp hunspellworker.cpp
        HEADERS += hunspellinputmethod.h hunspellinputmethod_p.h hunspellworker.h
        DEFINES += HAVE_HUNSPELL
        PKGCONFIG += hunspell
    } else {
        message("Hunspell not found! Spell correction will not be available.")
    }
}

pinyin {
    SOURCES += \
        pinyininputmethod.cpp \
        pinyindecoderservice.cpp
    HEADERS += \
        pinyininputmethod.h \
        pinyindecoderservice.h
    DEFINES += HAVE_PINYIN
    QMAKE_USE += pinyin
    pinyin_data.files = $$PWD/3rdparty/pinyin/data/dict_pinyin.dat
    pinyin_data.path = $$DATAPATH/pinyin
    INSTALLS += pinyin_data
    !prefix_build: COPIES += pinyin_data
}

tcime {
    SOURCES += \
        tcinputmethod.cpp
    HEADERS += \
        tcinputmethod.h
    DEFINES += HAVE_TCIME
    cangjie: DEFINES += HAVE_TCIME_CANGJIE
    zhuyin: DEFINES += HAVE_TCIME_ZHUYIN
    QMAKE_USE += tcime
    tcime_data.files = \
        $$PWD/3rdparty/tcime/data/qt/dict_phrases.dat
    cangjie: tcime_data.files += \
        $$PWD/3rdparty/tcime/data/qt/dict_cangjie.dat
    zhuyin: tcime_data.files += \
        $$PWD/3rdparty/tcime/data/qt/dict_zhuyin.dat
    tcime_data.path = $$DATAPATH/tcime
    INSTALLS += tcime_data
    !prefix_build: COPIES += tcime_data
}

hangul {
    SOURCES += \
        hangulinputmethod.cpp \
        hangul.cpp
    HEADERS += \
        hangulinputmethod.h \
        hangul.h
    DEFINES += HAVE_HANGUL
}

openwnn {
    SOURCES += openwnninputmethod.cpp
    HEADERS += openwnninputmethod.h
    DEFINES += HAVE_OPENWNN
    QMAKE_USE += openwnn
}

lipi-toolkit:t9write: \
    error("Conflicting configuration flags: lipi-toolkit and t9write." \
          "Please use either one, but not both at the same time.")

lipi-toolkit {
    CONFIG += exceptions
    SOURCES += \
        lipiinputmethod.cpp \
        lipisharedrecognizer.cpp \
        lipiworker.cpp
    HEADERS += \
        lipiinputmethod.h \
        lipisharedrecognizer.h \
        lipiworker.h
    DEFINES += HAVE_LIPI_TOOLKIT
    INCLUDEPATH += \
        3rdparty/lipi-toolkit/src/include \
        3rdparty/lipi-toolkit/src/util/lib
    LIBS += -L$$OUT_PWD/../../lib \
        -lshaperecommon$$qtPlatformTargetSuffix() \
        -lltkcommon$$qtPlatformTargetSuffix() \
        -lltkutil$$qtPlatformTargetSuffix()
    win32: LIBS += Advapi32.lib
    else: QMAKE_USE += libdl
    ltk_projects.files = $$PWD/3rdparty/lipi-toolkit/projects
    ltk_projects.path = $$[QT_INSTALL_DATA]/qtvirtualkeyboard/lipi_toolkit
    INSTALLS += ltk_projects
    !prefix_build: COPIES += ltk_projects
}

t9write {
    include(3rdparty/t9write/t9write-build.pri)
    equals(T9WRITE_FOUND, 0): \
        error("T9Write SDK could not be found. For more information, see" \
              "the documentation in Building Qt Virtual Keyboard")
    SOURCES += \
        t9writeinputmethod.cpp \
        t9writeworker.cpp \
        t9writedictionary.cpp
    HEADERS += \
        t9writeinputmethod.h \
        t9writeworker.h \
        t9writedictionary.h \
        t9write.h
    DEFINES += HAVE_T9WRITE
    QMAKE_USE += t9write_db
    INCLUDEPATH += $$T9WRITE_INCLUDE_DIRS
    t9write-alphabetic {
        LIBS += $$T9WRITE_ALPHABETIC_LIBS
        DEFINES += HAVE_T9WRITE_ALPHABETIC
        !isEmpty(T9WRITE_ALPHABETIC_BINS) {
            t9write_alphabetic_bins.files = $$T9WRITE_ALPHABETIC_BINS
            t9write_alphabetic_bins.path = $$[QT_INSTALL_BINS]
            INSTALLS += t9write_alphabetic_bins
            !prefix_build: COPIES += t9write_alphabetic_bins
        }
    }
    t9write-cjk {
        LIBS += $$T9WRITE_CJK_LIBS
        DEFINES += HAVE_T9WRITE_CJK
        !isEmpty(T9WRITE_CJK_BINS) {
            t9write_cjk_bins.files = $$T9WRITE_CJK_BINS
            t9write_cjk_bins.path = $$[QT_INSTALL_BINS]
            INSTALLS += t9write_cjk_bins
            !prefix_build: COPIES += t9write_cjk_bins
        }
    }
    DEFINES += QT_VIRTUALKEYBOARD_DEBUG
}

record-trace-input {
    SOURCES += unipentrace.cpp
    HEADERS += unipentrace.h
    DEFINES += QT_VIRTUALKEYBOARD_RECORD_TRACE_INPUT
}

arrow-key-navigation: DEFINES += QT_VIRTUALKEYBOARD_ARROW_KEY_NAVIGATION

include(generateresource.pri)

!disable-layouts {
    RESOURCES += $$generate_resource(layouts.qrc, $$LAYOUT_FILES, /QtQuick/VirtualKeyboard)
    DEFINES += HAVE_LAYOUTS
}

PLUGIN_TYPE = platforminputcontexts
PLUGIN_EXTENDS = -
PLUGIN_CLASS_NAME = QVirtualKeyboardPlugin
load(qt_plugin)