42 for (
int i = 0;
i < children.
size(); ++
i) {
46 if (
c.tagName() == tagName)
56 return find(
"name", configItem).
text();
64 for (
int i = 0;
i < children.
size(); ++
i) {
93 for (
int i = 0;
i < children.
size(); ++
i) {
105 static bool initialized =
false;
107 map[
"U.S. English"] =
"UnitedStates";
108 map[
"PC-98xx Series"] =
"Japan";
109 map[
"Bosnia and Herzegovina"] =
"BosniaAndHerzegowina";
110 map[
"Czechia"] =
"CzechRepublic";
111 map[
"Faroe Islands"] =
"FaroeIslands";
112 map[
"Laos"] =
"Laos";
113 map[
"Latin American"] =
"Mexico";
114 map[
"Russia"] =
"Russia";
115 map[
"Syria"] =
"Syria";
116 map[
"Sri Lanka"] =
"SriLanka";
117 map[
"United Kingdom"] =
"UnitedKingdom";
118 map[
"Vietnam"] =
"Vietnam";
119 map[
"Macedonian"] =
"Macedonia";
120 map[
"Serbian"] =
"Serbia";
121 map[
"Turkish "] =
"Turkey";
122 map[
"Maori"] =
"NewZealand";
123 map[
"Arabic"] =
"UnitedArabEmirates";
132 static bool initialized =
false;
134 map[
"us"] =
"English";
135 map[
"us:intl"] =
"English";
136 map[
"us:alt-intl"] =
"English";
137 map[
"us:dvorak"] =
"English";
138 map[
"us:rus"] =
"Russian";
139 map[
"ara"] =
"Arabic";
140 map[
"ara:azerty"] =
"Arabic";
141 map[
"ara:azerty_digits"] =
"Arabic";
142 map[
"ara:digits"] =
"Arabic";
143 map[
"ara:qwerty"] =
"Arabic";
144 map[
"ara:qwerty_digits"] =
"Arabic";
145 map[
"al"] =
"Albanian";
146 map[
"am"] =
"Armenian";
147 map[
"am:phonetic"] =
"Armenian";
148 map[
"az"] =
"Azerbaijani";
149 map[
"az:cyrillic"] =
"Azerbaijani";
150 map[
"by"] =
"Belarusian";
151 map[
"by:winkeys"] =
"Belarusian";
153 map[
"be:iso-alternate"] =
"Dutch";
154 map[
"be:nodeadkeys"] =
"Dutch";
155 map[
"be:sundeadkeys"] =
"Dutch";
156 map[
"bd"] =
"Bengali";
157 map[
"bd:probhat"] =
"Bengali";
159 map[
"in:ben"] =
"Bengali";
160 map[
"in:ben_probhat"] =
"Bengali";
161 map[
"in:guj"] =
"Gujarati";
162 map[
"in:guru"] =
"Punjabi";
163 map[
"in:kan"] =
"Kannada";
164 map[
"in:mal"] =
"Malayalam";
165 map[
"in:ori"] =
"Oriya";
166 map[
"in:tam_unicode"] =
"Tamil";
167 map[
"in:tam_TAB"] =
"Tamil";
168 map[
"in:tam_TSCII"] =
"Tamil";
169 map[
"in:tam"] =
"Tamil";
170 map[
"in:tel"] =
"Telugu";
171 map[
"in:urd"] =
"Urdu";
172 map[
"ba"] =
"Bosnian";
173 map[
"br"] =
"Portuguese";
174 map[
"br:nodeadkeys"] =
"Portuguese";
175 map[
"bg"] =
"Bulgarian";
176 map[
"bg:phonetic"] =
"Bulgarian";
177 map[
"mm"] =
"Burmese";
178 map[
"ca"] =
"English";
179 map[
"ca:fr-dvorak"] =
"French";
180 map[
"ca:fr-legacy"] =
"French";
181 map[
"ca:multi"] =
"English";
182 map[
"ca:multi-2gr"] =
"English";
183 map[
"ca:ike"] =
"Inuktitut";
184 map[
"hr"] =
"Croatian";
185 map[
"hr:us"] =
"Croatian";
187 map[
"cz:bksl"] =
"Czech";
188 map[
"cz:qwerty"] =
"Czech";
189 map[
"cz:qwerty_bksl"] =
"Czech";
190 map[
"dk"] =
"Danish";
191 map[
"dk:nodeadkeys"] =
"Danish";
193 map[
"bt"] =
"Bhutani";
194 map[
"ee"] =
"Estonian";
195 map[
"ee:nodeadkeys"] =
"Estonian";
196 map[
"ir"] =
"Persian";
197 map[
"fo"] =
"Faroese";
198 map[
"fo:nodeadkeys"] =
"Faroese";
199 map[
"fi"] =
"Finnish";
200 map[
"fi:nodeadkeys"] =
"Finnish";
201 map[
"fi:smi"] =
"Finnish";
202 map[
"fr"] =
"French";
203 map[
"fr:nodeadkeys"] =
"French";
204 map[
"fr:sundeadkeys"] =
"French";
205 map[
"fr:latin9"] =
"French";
206 map[
"fr:latin9_nodeadkeys"] =
"French";
207 map[
"fr:latin9_sundeadkeys"] =
"French";
208 map[
"fr:dvorak"] =
"French";
209 map[
"ge"] =
"Georgian";
210 map[
"ge:ru"] =
"Russian";
211 map[
"de"] =
"German";
212 map[
"de:deadacute"] =
"German";
213 map[
"de:deadgraveacute"] =
"German";
214 map[
"de:nodeadkeys"] =
"German";
215 map[
"de:ro"] =
"Romanian";
216 map[
"de:ro_nodeadkeys"] =
"Romanian";
217 map[
"de:dvorak"] =
"German";
219 map[
"gr:extended"] =
"Greek";
220 map[
"gr:nodeadkeys"] =
"Greek";
221 map[
"gr:polytonic"] =
"Greek";
222 map[
"hu"] =
"Hungarian";
223 map[
"hu:standard"] =
"Hungarian";
224 map[
"hu:nodeadkeys"] =
"Hungarian";
225 map[
"hu:qwerty"] =
"Hungarian";
226 map[
"hu:101_qwertz_comma_dead"] =
"Hungarian";
227 map[
"hu:101_qwertz_comma_nodead"] =
"Hungarian";
228 map[
"hu:101_qwertz_dot_dead"] =
"Hungarian";
229 map[
"hu:101_qwertz_dot_nodead"] =
"Hungarian";
230 map[
"hu:101_qwerty_comma_dead"] =
"Hungarian";
231 map[
"hu:101_qwerty_comma_nodead"] =
"Hungarian";
232 map[
"hu:101_qwerty_dot_dead"] =
"Hungarian";
233 map[
"hu:101_qwerty_dot_nodead"] =
"Hungarian";
234 map[
"hu:102_qwertz_comma_dead"] =
"Hungarian";
235 map[
"hu:102_qwertz_comma_nodead"] =
"Hungarian";
236 map[
"hu:102_qwertz_dot_dead"] =
"Hungarian";
237 map[
"hu:102_qwertz_dot_nodead"] =
"Hungarian";
238 map[
"hu:102_qwerty_comma_dead"] =
"Hungarian";
239 map[
"hu:102_qwerty_comma_nodead"] =
"Hungarian";
240 map[
"hu:102_qwerty_dot_dead"] =
"Hungarian";
241 map[
"hu:102_qwerty_dot_nodead"] =
"Hungarian";
242 map[
"is"] =
"Icelandic";
243 map[
"is:Sundeadkeys"] =
"Icelandic";
244 map[
"is:nodeadkeys"] =
"Icelandic";
245 map[
"il"] =
"Hebrew";
246 map[
"il:lyx"] =
"Hebrew";
247 map[
"il:si1452"] =
"Hebrew";
248 map[
"il:phonetic"] =
"Hebrew";
249 map[
"it"] =
"Italian";
250 map[
"it:nodeadkeys"] =
"Italian";
251 map[
"jp"] =
"Japanese";
252 map[
"kg"] =
"Kirghiz";
253 map[
"la"] =
"Laothian";
254 map[
"latam"] =
"Spanish";
255 map[
"latam:nodeadkeys"] =
"Spanish";
256 map[
"latam:sundeadkeys"] =
"Spanish";
257 map[
"lt"] =
"Lithuanian";
258 map[
"lt:std"] =
"Lithuanian";
259 map[
"lt:us"] =
"Lithuanian";
260 map[
"lv"] =
"Latvian";
261 map[
"lv:apostrophe"] =
"Latvian";
262 map[
"lv:tilde"] =
"Latvian";
263 map[
"lv:fkey"] =
"Latvian";
264 map[
"mao"] =
"Maori";
265 map[
"mkd"] =
"Macedonian";
266 map[
"mkd:nodeadkeys"] =
"Macedonian";
267 map[
"mt"] =
"Maltese";
268 map[
"mt:us"] =
"Maltese";
269 map[
"mn"] =
"Mongolian";
270 map[
"no"] =
"Norwegian";
271 map[
"no:nodeadkeys"] =
"Norwegian";
272 map[
"no:dvorak"] =
"Norwegian";
273 map[
"no:smi"] =
"Norwegian";
274 map[
"no:smi_nodeadkeys"] =
"Norwegian";
275 map[
"pl"] =
"Polish";
276 map[
"pl:qwertz"] =
"Polish";
277 map[
"pl:dvorak"] =
"Polish";
278 map[
"pl:dvorak_quotes"] =
"Polish";
279 map[
"pl:dvorak_altquotes"] =
"Polish";
280 map[
"pt"] =
"Portuguese";
281 map[
"pt:nodeadkeys"] =
"Portuguese";
282 map[
"pt:sundeadkeys"] =
"Portuguese";
283 map[
"ro"] =
"Romanian";
284 map[
"ro:us"] =
"English";
285 map[
"ro:de"] =
"German";
286 map[
"ru"] =
"Russian";
287 map[
"ru:phonetic"] =
"Russian";
288 map[
"ru:typewriter"] =
"Russian";
289 map[
"ru:winkeys"] =
"Russian";
290 map[
"srp"] =
"Serbian";
291 map[
"srp:yz"] =
"Serbian";
292 map[
"srp:latin"] =
"Serbian";
293 map[
"srp:latinunicode"] =
"Serbian";
294 map[
"srp:latinyz"] =
"Serbian";
295 map[
"srp:latinunicodeyz"] =
"Serbian";
296 map[
"srp:alternatequotes"] =
"Serbian";
297 map[
"srp:latinalternatequotes"] =
"Serbian";
298 map[
"si"] =
"Slovenian";
299 map[
"sk"] =
"Slovak";
300 map[
"sk:bksl"] =
"Slovak";
301 map[
"sk:qwerty"] =
"Slovak";
302 map[
"sk:qwerty_bksl"] =
"Slovak";
303 map[
"es"] =
"Spanish";
304 map[
"es:nodeadkeys"] =
"Spanish";
305 map[
"es:sundeadkeys"] =
"Spanish";
306 map[
"es:dvorak"] =
"Spanish";
307 map[
"se"] =
"Swedish";
308 map[
"se:nodeadkeys"] =
"Swedish";
309 map[
"se:dvorak"] =
"Swedish";
310 map[
"se:rus"] =
"Russian";
311 map[
"se:rus_nodeadkeys"] =
"Russian";
312 map[
"se:smi"] =
"Swedish";
313 map[
"ch"] =
"German";
314 map[
"ch:de_nodeadkeys"] =
"German";
315 map[
"ch:de_sundeadkeys"] =
"German";
316 map[
"ch:fr"] =
"French";
317 map[
"ch:fr_nodeadkeys"] =
"French";
318 map[
"ch:fr_sundeadkeys"] =
"French";
319 map[
"sy"] =
"Arabic";
320 map[
"sy:syc"] =
"Arabic";
321 map[
"sy:syc_phonetic"] =
"Arabic";
323 map[
"lk"] =
"Sinhala";
324 map[
"lk:tam_unicode"] =
"Tamil";
325 map[
"lk:tam_TAB"] =
"Tamil";
326 map[
"lk:tam_TSCII"] =
"Tamil";
327 map[
"lk:sin_phonetic"] =
"Sinhala";
329 map[
"th:tis"] =
"Thai";
330 map[
"th:pat"] =
"Thai";
331 map[
"tr"] =
"Turkish";
332 map[
"tr:f"] =
"Turkish";
333 map[
"tr:alt"] =
"Turkish";
334 map[
"ua"] =
"Ukrainian";
335 map[
"ua:phonetic"] =
"Ukrainian";
336 map[
"ua:typewriter"] =
"Ukrainian";
337 map[
"ua:winkeys"] =
"Ukrainian";
338 map[
"ua:rstu"] =
"Ukrainian";
339 map[
"ua:rstu_ru"] =
"Ukrainian";
340 map[
"gb"] =
"English";
341 map[
"gb:intl"] =
"English";
342 map[
"gb:dvorak"] =
"English";
344 map[
"vn"] =
"Vietnamese";
345 map[
"nec_vndr/jp"] =
"Japanese";
347 map[
"ie:CloGaelach"] =
"Gaelic";
348 map[
"ie:UnicodeExpert"] =
"Irish";
349 map[
"ie:ogam"] =
"Gaelic";
350 map[
"ie:ogam_is434"] =
"Gaelic";
360 static bool initialized =
false;
363 map[
"Arabic"] =
"Qt::RightToLeft";
364 map[
"Persian"] =
"Qt::RightToLeft";
365 map[
"Urdu"] =
"Qt::RightToLeft";
371 int main(
int argc,
char **argv)
374 fprintf(stderr,
"usage: %s <xml input file>\n", argv[0]);
391 fprintf(stderr,
"cannot parse %s, this is not an XKB config file\n", qPrintable(
file.
fileName()));
396 if (layoutList.
isNull()) {
397 fprintf(stderr,
"cannot parse %s, this is not an XKB config file\n", qPrintable(
file.
fileName()));
404 printf(
"/****************************************************************************\n"
406 "** Copyright (C) 2016 The Qt Company Ltd.\n"
407 "** Contact: https://www.qt.io/licensing/\n"
409 "** This file is part of the QtGui module of the Qt Toolkit.\n"
411 "** $QT_BEGIN_LICENSE:LGPL$\n"
412 "** Commercial License Usage\n"
413 "** Licensees holding valid commercial Qt licenses may use this file in\n"
414 "** accordance with the commercial license agreement provided with the\n"
415 "** Software or, alternatively, in accordance with the terms contained in\n"
416 "** a written agreement between you and The Qt Company. For licensing terms\n"
417 "** and conditions see https://www.qt.io/terms-conditions. For further\n"
418 "** information use the contact form at https://www.qt.io/contact-us.\n"
420 "** GNU Lesser General Public License Usage\n"
421 "** Alternatively, this file may be used under the terms of the GNU Lesser\n"
422 "** General Public License version 3 as published by the Free Software\n"
423 "** Foundation and appearing in the file LICENSE.LGPL3 included in the\n"
424 "** packaging of this file. Please review the following information to\n"
425 "** ensure the GNU Lesser General Public License version 3 requirements\n"
426 "** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.\n"
428 "** GNU General Public License Usage\n"
429 "** Alternatively, this file may be used under the terms of the GNU\n"
430 "** General Public License version 2.0 or (at your option) the GNU General\n"
431 "** Public license version 3 or any later version approved by the KDE Free\n"
432 "** Qt Foundation. The licenses are as published by the Free Software\n"
433 "** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3\n"
434 "** included in the packaging of this file. Please review the following\n"
435 "** information to ensure the GNU General Public License requirements will\n"
436 "** be met: https://www.gnu.org/licenses/gpl-2.0.html and\n"
437 "** https://www.gnu.org/licenses/gpl-3.0.html.\n"
439 "** $QT_END_LICENSE$\n"
441 "****************************************************************************/\n"
443 "// This file is auto-generated, do not edit!\n"
444 "// (Generated using util/xkbdatagen)\n"
448 printf(
"static struct {\n"
449 " const char *layout;\n"
450 " const char *variant; // 0 means any variant\n"
451 " Qt::LayoutDirection direction;\n"
452 " QLocale::Language language;\n"
453 " QLocale::Territory territory;\n"
454 "} xkbLayoutData[] = {\n");
462 printf(
" // name = %s, description = %s\n"
463 " { \"%s\", \"\", %s, QLocale::%s, QLocale::%s },\n",
464 l.name.toLatin1().constData(),
465 l.description.toLatin1().constData(),
466 l.name.toLatin1().constData(),
474 printf(
" // name = %s:%s, description = %s\n"
475 " { \"%s\", \"%s\", %s, QLocale::%s, QLocale::%s },\n",
476 l.name.toLatin1().constData(),
477 v.toLatin1().constData(),
478 l.description.toLatin1().constData(),
479 l.name.toLatin1().constData(),
480 v.toLatin1().constData(),
488 printf(
" { 0, 0, Qt::LeftToRight, QLocale::C, QLocale::AnyTerritory }\n"
small capitals from c petite p scientific i
[1]
const char * constData() const noexcept
The QCoreApplication class provides an event loop for Qt applications without UI.
The QDomDocument class represents an XML document.
bool setContent(const QByteArray &text, bool namespaceProcessing, QString *errorMsg=nullptr, int *errorLine=nullptr, int *errorColumn=nullptr)
QDomElement documentElement() const
The QDomElement class represents one element in the DOM tree.
The QDomNode class is the base class for all the nodes in a DOM tree.
QDomNodeList childNodes() const
QDomElement toElement() const
The QDomNodeList class is a list of QDomNode objects.
QDomNode at(int index) const
The QFile class provides an interface for reading from and writing to files.
bool open(OpenMode flags) override
void setFileName(const QString &name)
QString fileName() const override
QString errorString() const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
T value(const Key &key, const T &defaultValue=T()) const
The QString class provides a Unicode character string.
QByteArray toLatin1() const &
The QStringList class provides a list of strings.
int main(int argc, char **argv)
QMap< QString, QString > map
[6]
GLsizei const GLfloat * v
[13]
QApplication app(argc, argv)
[0]
QDomElement find(const QString &tagName, const QDomElement &e)
QList< XKBLayout > findLayouts(const QDomElement &layoutList)
XKBLayout parseLayout(const QDomElement &e)
QStringList findVariants(const QDomElement &e)
QString mapLanguage(const QString &v)
QString parseVariant(const QDomElement &e)
QString mapCountry(const QString &v)
QString mapDirection(const QString &v)