@keymanapp/common-types 18.0.41-alpha → 18.0.46-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/consts/virtual-key-constants.d.ts +191 -191
- package/build/src/consts/virtual-key-constants.js +221 -221
- package/build/src/consts/virtual-key-constants.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts +5 -5
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js +72 -72
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts +28 -28
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js +120 -120
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.d.ts +95 -95
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.js +52 -52
- package/build/src/kmx/element-string.d.ts +23 -23
- package/build/src/kmx/element-string.js +125 -125
- package/build/src/kmx/element-string.js.map +1 -1
- package/build/src/kmx/keyman-targets.d.ts +20 -20
- package/build/src/kmx/keyman-targets.js +79 -79
- package/build/src/kmx/keyman-targets.js.map +1 -1
- package/build/src/kmx/kmx-builder.d.ts +32 -32
- package/build/src/kmx/kmx-builder.js +189 -189
- package/build/src/kmx/kmx-builder.js.map +1 -1
- package/build/src/kmx/kmx-file-reader.d.ts +13 -13
- package/build/src/kmx/kmx-file-reader.js +134 -134
- package/build/src/kmx/kmx-file-reader.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-disp.d.ts +18 -18
- package/build/src/kmx/kmx-plus-builder/build-disp.js +27 -27
- package/build/src/kmx/kmx-plus-builder/build-disp.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-elem.d.ts +28 -28
- package/build/src/kmx/kmx-plus-builder/build-elem.js +89 -89
- package/build/src/kmx/kmx-plus-builder/build-elem.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-keys.d.ts +56 -56
- package/build/src/kmx/kmx-plus-builder/build-keys.js +107 -107
- package/build/src/kmx/kmx-plus-builder/build-keys.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-layr.d.ts +53 -53
- package/build/src/kmx/kmx-plus-builder/build-layr.js +101 -101
- package/build/src/kmx/kmx-plus-builder/build-layr.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-list.d.ts +35 -35
- package/build/src/kmx/kmx-plus-builder/build-list.js +66 -66
- package/build/src/kmx/kmx-plus-builder/build-list.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-loca.d.ts +11 -11
- package/build/src/kmx/kmx-plus-builder/build-loca.js +21 -21
- package/build/src/kmx/kmx-plus-builder/build-loca.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-meta.d.ts +16 -16
- package/build/src/kmx/kmx-plus-builder/build-meta.js +20 -20
- package/build/src/kmx/kmx-plus-builder/build-sect.d.ts +15 -15
- package/build/src/kmx/kmx-plus-builder/build-sect.js +15 -15
- package/build/src/kmx/kmx-plus-builder/build-sect.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-strs.d.ts +22 -22
- package/build/src/kmx/kmx-plus-builder/build-strs.js +46 -46
- package/build/src/kmx/kmx-plus-builder/build-strs.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-tran.d.ts +32 -32
- package/build/src/kmx/kmx-plus-builder/build-tran.js +69 -69
- package/build/src/kmx/kmx-plus-builder/build-tran.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-uset.d.ts +30 -30
- package/build/src/kmx/kmx-plus-builder/build-uset.js +60 -60
- package/build/src/kmx/kmx-plus-builder/build-uset.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vars.d.ts +21 -21
- package/build/src/kmx/kmx-plus-builder/build-vars.js +48 -48
- package/build/src/kmx/kmx-plus-builder/build-vars.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/builder-section.d.ts +9 -9
- package/build/src/kmx/kmx-plus-builder/builder-section.js +2 -2
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.d.ts +42 -42
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js +137 -137
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js.map +1 -1
- package/build/src/kmx/kmx-plus.d.ts +322 -322
- package/build/src/kmx/kmx-plus.js +830 -830
- package/build/src/kmx/kmx-plus.js.map +1 -1
- package/build/src/kmx/kmx.d.ts +233 -233
- package/build/src/kmx/kmx.js +302 -302
- package/build/src/kmx/kmx.js.map +1 -1
- package/build/src/kmx/string-list.d.ts +35 -35
- package/build/src/kmx/string-list.js +88 -88
- package/build/src/kmx/string-list.js.map +1 -1
- package/build/src/kpj/keyman-developer-project.d.ts +78 -78
- package/build/src/kpj/keyman-developer-project.js +195 -195
- package/build/src/kpj/keyman-developer-project.js.map +1 -1
- package/build/src/kpj/kpj-file-reader.d.ts +18 -18
- package/build/src/kpj/kpj-file-reader.js +119 -119
- package/build/src/kpj/kpj-file-reader.js.map +1 -1
- package/build/src/kpj/kpj-file.d.ts +39 -39
- package/build/src/kpj/kpj-file.js +10 -10
- package/build/src/kvk/kvk-file-reader.d.ts +4 -4
- package/build/src/kvk/kvk-file-reader.js +37 -37
- package/build/src/kvk/kvk-file-reader.js.map +1 -1
- package/build/src/kvk/kvk-file-writer.d.ts +19 -19
- package/build/src/kvk/kvk-file-writer.js +77 -77
- package/build/src/kvk/kvk-file-writer.js.map +1 -1
- package/build/src/kvk/kvk-file.d.ts +66 -66
- package/build/src/kvk/kvk-file.d.ts.map +1 -1
- package/build/src/kvk/kvk-file.js +90 -90
- package/build/src/kvk/kvk-file.js.map +1 -1
- package/build/src/kvk/kvks-file-reader.d.ts +23 -23
- package/build/src/kvk/kvks-file-reader.js +175 -175
- package/build/src/kvk/kvks-file-reader.js.map +1 -1
- package/build/src/kvk/kvks-file-writer.d.ts +6 -6
- package/build/src/kvk/kvks-file-writer.js +106 -106
- package/build/src/kvk/kvks-file-writer.js.map +1 -1
- package/build/src/kvk/kvks-file.d.ts +43 -43
- package/build/src/kvk/kvks-file.js +9 -9
- package/build/src/kvk/visual-keyboard.d.ts +44 -44
- package/build/src/kvk/visual-keyboard.js +75 -75
- package/build/src/kvk/visual-keyboard.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts +60 -60
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.js +19 -19
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.d.ts +95 -95
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js +409 -409
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml.d.ts +170 -170
- package/build/src/ldml-keyboard/ldml-keyboard-xml.js +55 -55
- package/build/src/ldml-keyboard/pattern-parser.d.ts +201 -201
- package/build/src/ldml-keyboard/pattern-parser.js +490 -490
- package/build/src/ldml-keyboard/pattern-parser.js.map +1 -1
- package/build/src/ldml-keyboard/unicodeset-parser-api.d.ts +37 -37
- package/build/src/ldml-keyboard/unicodeset-parser-api.js +27 -27
- package/build/src/main.d.ts +33 -33
- package/build/src/main.js +32 -32
- package/build/src/package/kmp-json-file.d.ts +115 -115
- package/build/src/package/kmp-json-file.js +1 -1
- package/build/src/package/kps-file.d.ts +175 -175
- package/build/src/package/kps-file.js +15 -15
- package/build/src/schema-validators.d.ts +13 -13
- package/build/src/schema-validators.js +25 -25
- package/build/src/schemas/displaymap.schema.d.ts +57 -57
- package/build/src/schemas/displaymap.schema.js +35 -35
- package/build/src/schemas/displaymap.schema.validator.d.mts +2 -2
- package/build/src/schemas/displaymap.schema.validator.mjs +266 -266
- package/build/src/schemas/displaymap.schema.validator.mjs.map +1 -1
- package/build/src/schemas/keyboard_info.schema.d.ts +209 -209
- package/build/src/schemas/keyboard_info.schema.js +98 -98
- package/build/src/schemas/keyboard_info.schema.validator.d.mts +2 -2
- package/build/src/schemas/keyboard_info.schema.validator.mjs +1160 -1160
- package/build/src/schemas/keyboard_info.schema.validator.mjs.map +1 -1
- package/build/src/schemas/keyman-touch-layout.clean.spec.d.ts +227 -227
- package/build/src/schemas/keyman-touch-layout.clean.spec.js +151 -151
- package/build/src/schemas/keyman-touch-layout.clean.spec.validator.d.mts +2 -2
- package/build/src/schemas/keyman-touch-layout.clean.spec.validator.mjs +1094 -1094
- package/build/src/schemas/keyman-touch-layout.clean.spec.validator.mjs.map +1 -1
- package/build/src/schemas/keyman-touch-layout.spec.d.ts +229 -229
- package/build/src/schemas/keyman-touch-layout.spec.js +140 -140
- package/build/src/schemas/keyman-touch-layout.spec.validator.d.mts +2 -2
- package/build/src/schemas/keyman-touch-layout.spec.validator.mjs +1436 -1436
- package/build/src/schemas/keyman-touch-layout.spec.validator.mjs.map +1 -1
- package/build/src/schemas/kmp.schema.d.ts +324 -324
- package/build/src/schemas/kmp.schema.js +353 -353
- package/build/src/schemas/kmp.schema.validator.d.mts +2 -2
- package/build/src/schemas/kmp.schema.validator.mjs +1627 -1627
- package/build/src/schemas/kmp.schema.validator.mjs.map +1 -1
- package/build/src/schemas/kpj-9.0.schema.d.ts +152 -152
- package/build/src/schemas/kpj-9.0.schema.js +131 -131
- package/build/src/schemas/kpj-9.0.schema.validator.d.mts +2 -2
- package/build/src/schemas/kpj-9.0.schema.validator.mjs +655 -655
- package/build/src/schemas/kpj-9.0.schema.validator.mjs.map +1 -1
- package/build/src/schemas/kpj.schema.d.ts +122 -122
- package/build/src/schemas/kpj.schema.js +129 -129
- package/build/src/schemas/kpj.schema.validator.d.mts +2 -2
- package/build/src/schemas/kpj.schema.validator.mjs +515 -515
- package/build/src/schemas/kpj.schema.validator.mjs.map +1 -1
- package/build/src/schemas/kvks.schema.d.ts +160 -160
- package/build/src/schemas/kvks.schema.js +182 -182
- package/build/src/schemas/kvks.schema.validator.d.mts +2 -2
- package/build/src/schemas/kvks.schema.validator.mjs +625 -625
- package/build/src/schemas/kvks.schema.validator.mjs.map +1 -1
- package/build/src/schemas/ldml-keyboard3.schema.d.ts +635 -635
- package/build/src/schemas/ldml-keyboard3.schema.js +696 -696
- package/build/src/schemas/ldml-keyboard3.schema.validator.d.mts +2 -2
- package/build/src/schemas/ldml-keyboard3.schema.validator.mjs +3117 -3117
- package/build/src/schemas/ldml-keyboard3.schema.validator.mjs.map +1 -1
- package/build/src/schemas/ldml-keyboardtest3.schema.d.ts +192 -192
- package/build/src/schemas/ldml-keyboardtest3.schema.js +225 -225
- package/build/src/schemas/ldml-keyboardtest3.schema.validator.d.mts +2 -2
- package/build/src/schemas/ldml-keyboardtest3.schema.validator.mjs +744 -744
- package/build/src/schemas/ldml-keyboardtest3.schema.validator.mjs.map +1 -1
- package/build/src/schemas.d.ts +2300 -2300
- package/build/src/schemas.js +23 -23
- package/build/src/util/common-events.d.ts +44 -44
- package/build/src/util/common-events.js +26 -26
- package/build/src/util/compiler-interfaces.d.ts +371 -371
- package/build/src/util/compiler-interfaces.d.ts.map +1 -1
- package/build/src/util/compiler-interfaces.js +380 -380
- package/build/src/util/compiler-interfaces.js.map +1 -1
- package/build/src/util/errors.d.ts +5 -5
- package/build/src/util/errors.js +5 -5
- package/build/src/util/file-types.d.ts +93 -93
- package/build/src/util/file-types.d.ts.map +1 -1
- package/build/src/util/file-types.js +142 -142
- package/build/src/util/file-types.js.map +1 -1
- package/build/src/util/util.d.ts +98 -98
- package/build/src/util/util.js +368 -368
- package/build/src/util/util.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,191 +1,191 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import * as r from 'restructure';
|
|
4
|
-
import { KMXFile } from './kmx.js';
|
|
5
|
-
import { KMXPlusFile } from './kmx-plus.js';
|
|
6
|
-
import KMXPlusBuilder from './kmx-plus-builder/kmx-plus-builder.js';
|
|
7
|
-
export default class KMXBuilder {
|
|
8
|
-
file;
|
|
9
|
-
base_keyboard = 0;
|
|
10
|
-
base_kmxplus = 0;
|
|
11
|
-
comp_header;
|
|
12
|
-
comp_kmxplus;
|
|
13
|
-
comp_stores = [];
|
|
14
|
-
comp_groups = [];
|
|
15
|
-
comp_kmxplus_data;
|
|
16
|
-
writeDebug = false;
|
|
17
|
-
constructor(file, writeDebug) {
|
|
18
|
-
this.file = file;
|
|
19
|
-
this.writeDebug = writeDebug;
|
|
20
|
-
}
|
|
21
|
-
calculateStringOffsetAndSize(string, base, requireString = false) {
|
|
22
|
-
if (string.length == 0 && !requireString) {
|
|
23
|
-
// Zero length strings take up no space in the file, and
|
|
24
|
-
// are treated as a 'null string'
|
|
25
|
-
return [0, base];
|
|
26
|
-
}
|
|
27
|
-
return [base, base + string.length * 2 + 2]; // include trailing zero
|
|
28
|
-
}
|
|
29
|
-
build() {
|
|
30
|
-
this.base_keyboard = 0;
|
|
31
|
-
this.base_kmxplus = 0;
|
|
32
|
-
// Header
|
|
33
|
-
this.comp_header = {
|
|
34
|
-
dwIdentifier: KMXFile.FILEID_COMPILED,
|
|
35
|
-
dwFileVersion: KMXFile.VERSION_170,
|
|
36
|
-
dwCheckSum: 0,
|
|
37
|
-
KeyboardID: 0,
|
|
38
|
-
IsRegistered: 1,
|
|
39
|
-
version: 0,
|
|
40
|
-
cxStoreArray: 0,
|
|
41
|
-
cxGroupArray: 0,
|
|
42
|
-
dpStoreArray: 0,
|
|
43
|
-
dpGroupArray: 0,
|
|
44
|
-
StartGroup_ANSI: 0xFFFFFFFF,
|
|
45
|
-
StartGroup_Unicode: 0xFFFFFFFF,
|
|
46
|
-
dwFlags: 0,
|
|
47
|
-
dwHotKey: 0,
|
|
48
|
-
dpBitmapOffset: 0,
|
|
49
|
-
dwBitmapSize: 0
|
|
50
|
-
};
|
|
51
|
-
let size = KMXFile.COMP_KEYBOARD_SIZE;
|
|
52
|
-
if (this.file instanceof KMXPlusFile) {
|
|
53
|
-
// Reserve space for KMXPlus header; we'll come back and fill in details
|
|
54
|
-
// once we know base kmx file size.
|
|
55
|
-
this.comp_header.dwFlags |= KMXFile.KF_KMXPLUS;
|
|
56
|
-
this.base_kmxplus = size;
|
|
57
|
-
size += KMXFile.COMP_KEYBOARD_KMXPLUSINFO_SIZE;
|
|
58
|
-
}
|
|
59
|
-
// Stores
|
|
60
|
-
this.comp_header.cxStoreArray = this.file.keyboard.stores.length;
|
|
61
|
-
this.comp_header.dpStoreArray = this.comp_header.cxStoreArray ? size : 0;
|
|
62
|
-
let storeBase = size;
|
|
63
|
-
size += this.file.keyboard.stores.length * KMXFile.COMP_STORE_SIZE;
|
|
64
|
-
for (let store of this.file.keyboard.stores) {
|
|
65
|
-
let comp_store = {
|
|
66
|
-
dwSystemID: store.dwSystemID,
|
|
67
|
-
dpName: 0,
|
|
68
|
-
dpString: 0
|
|
69
|
-
};
|
|
70
|
-
this.comp_stores.push({ base: storeBase, store: store, obj: comp_store });
|
|
71
|
-
if (this.writeDebug /*TODO: || store.isOption*/) {
|
|
72
|
-
[comp_store.dpName, size] = this.calculateStringOffsetAndSize(store.dpName, size);
|
|
73
|
-
}
|
|
74
|
-
[comp_store.dpString, size] = this.calculateStringOffsetAndSize(store.dpString, size);
|
|
75
|
-
storeBase += KMXFile.COMP_STORE_SIZE;
|
|
76
|
-
}
|
|
77
|
-
// Groups
|
|
78
|
-
this.comp_header.cxGroupArray = this.file.keyboard.groups.length;
|
|
79
|
-
this.comp_header.dpGroupArray = this.comp_header.cxGroupArray ? size : 0;
|
|
80
|
-
let groupBase = size;
|
|
81
|
-
size += this.file.keyboard.groups.length * KMXFile.COMP_GROUP_SIZE;
|
|
82
|
-
for (let group of this.file.keyboard.groups) {
|
|
83
|
-
let comp_group = {
|
|
84
|
-
dpName: 0,
|
|
85
|
-
dpKeyArray: 0,
|
|
86
|
-
dpMatch: 0,
|
|
87
|
-
dpNoMatch: 0,
|
|
88
|
-
cxKeyArray: group.keys.length,
|
|
89
|
-
fUsingKeys: group.fUsingKeys ? 1 : 0
|
|
90
|
-
};
|
|
91
|
-
let comp_keys = [];
|
|
92
|
-
this.comp_groups.push({ base: groupBase, group: group, obj: comp_group, keys: comp_keys });
|
|
93
|
-
if (this.writeDebug) {
|
|
94
|
-
[comp_group.dpName, size] = this.calculateStringOffsetAndSize(group.dpName, size);
|
|
95
|
-
}
|
|
96
|
-
[comp_group.dpMatch, size] = this.calculateStringOffsetAndSize(group.dpMatch, size);
|
|
97
|
-
[comp_group.dpNoMatch, size] = this.calculateStringOffsetAndSize(group.dpNoMatch, size);
|
|
98
|
-
// Keys within a group
|
|
99
|
-
comp_group.dpKeyArray = group.keys.length ? size : 0;
|
|
100
|
-
let keyBase = size;
|
|
101
|
-
size += group.keys.length * KMXFile.COMP_KEY_SIZE;
|
|
102
|
-
for (let key of group.keys) {
|
|
103
|
-
let comp_key = {
|
|
104
|
-
Key: key.Key,
|
|
105
|
-
_padding: 0,
|
|
106
|
-
Line: key.Line,
|
|
107
|
-
ShiftFlags: key.ShiftFlags,
|
|
108
|
-
dpOutput: 0,
|
|
109
|
-
dpContext: 0
|
|
110
|
-
};
|
|
111
|
-
comp_keys.push({ base: keyBase, key: key, obj: comp_key });
|
|
112
|
-
[comp_key.dpOutput, size] = this.calculateStringOffsetAndSize(key.dpOutput, size, true);
|
|
113
|
-
[comp_key.dpContext, size] = this.calculateStringOffsetAndSize(key.dpContext, size, true);
|
|
114
|
-
keyBase += KMXFile.COMP_KEY_SIZE;
|
|
115
|
-
}
|
|
116
|
-
groupBase += KMXFile.COMP_GROUP_SIZE;
|
|
117
|
-
}
|
|
118
|
-
size += this.buildBitmap();
|
|
119
|
-
size += this.buildKMXPlus(size);
|
|
120
|
-
return size;
|
|
121
|
-
}
|
|
122
|
-
buildBitmap() {
|
|
123
|
-
// TODO
|
|
124
|
-
return 0;
|
|
125
|
-
}
|
|
126
|
-
buildKMXPlus(base) {
|
|
127
|
-
if (!(this.file instanceof KMXPlusFile)) {
|
|
128
|
-
return 0;
|
|
129
|
-
}
|
|
130
|
-
const plusbuilder = new KMXPlusBuilder(this.file, this.writeDebug);
|
|
131
|
-
this.comp_kmxplus_data = plusbuilder.compile();
|
|
132
|
-
this.comp_kmxplus = {
|
|
133
|
-
dpKMXPlus: base,
|
|
134
|
-
dwKMXPlusSize: this.comp_kmxplus_data.length
|
|
135
|
-
};
|
|
136
|
-
return this.comp_kmxplus.dwKMXPlusSize;
|
|
137
|
-
}
|
|
138
|
-
setString(file, pos, str, requireString = false) {
|
|
139
|
-
if (requireString && !str.length) {
|
|
140
|
-
// Just write zero terminator, as r.String for a zero-length string
|
|
141
|
-
// seems to fail.
|
|
142
|
-
let sbuf = r.uint16le;
|
|
143
|
-
file.set(sbuf.toBuffer(0), pos);
|
|
144
|
-
}
|
|
145
|
-
else if (pos && str.length) {
|
|
146
|
-
let sbuf = new r.String(null, 'utf16le'); // null-terminated string
|
|
147
|
-
file.set(sbuf.toBuffer(str), pos);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
compile() {
|
|
151
|
-
const fileSize = this.build();
|
|
152
|
-
let file = new Uint8Array(fileSize);
|
|
153
|
-
// Write headers
|
|
154
|
-
const header = this.file.COMP_KEYBOARD.toBuffer(this.comp_header);
|
|
155
|
-
file.set(header, this.base_keyboard);
|
|
156
|
-
if (this.file instanceof KMXPlusFile) {
|
|
157
|
-
const kmxplus = this.file.COMP_KEYBOARD_KMXPLUSINFO.toBuffer(this.comp_kmxplus);
|
|
158
|
-
file.set(kmxplus, this.base_kmxplus);
|
|
159
|
-
}
|
|
160
|
-
// Write store array and data
|
|
161
|
-
for (let store of this.comp_stores) {
|
|
162
|
-
file.set(this.file.COMP_STORE.toBuffer(store.obj), store.base);
|
|
163
|
-
if (this.writeDebug) {
|
|
164
|
-
this.setString(file, store.obj.dpName, store.store.dpName);
|
|
165
|
-
}
|
|
166
|
-
this.setString(file, store.obj.dpString, store.store.dpString);
|
|
167
|
-
}
|
|
168
|
-
// Write group array and data
|
|
169
|
-
for (let group of this.comp_groups) {
|
|
170
|
-
file.set(this.file.COMP_GROUP.toBuffer(group.obj), group.base);
|
|
171
|
-
if (this.writeDebug) {
|
|
172
|
-
this.setString(file, group.obj.dpName, group.group.dpName);
|
|
173
|
-
}
|
|
174
|
-
this.setString(file, group.obj.dpMatch, group.group.dpMatch);
|
|
175
|
-
this.setString(file, group.obj.dpNoMatch, group.group.dpNoMatch);
|
|
176
|
-
for (let key of group.keys) {
|
|
177
|
-
file.set(this.file.COMP_KEY.toBuffer(key.obj), key.base);
|
|
178
|
-
// for back-compat reasons, these are never NULL strings
|
|
179
|
-
this.setString(file, key.obj.dpContext, key.key.dpContext, true);
|
|
180
|
-
this.setString(file, key.obj.dpOutput, key.key.dpOutput, true);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
// Write KMXPlus data stream
|
|
184
|
-
if (this.file instanceof KMXPlusFile) {
|
|
185
|
-
file.set(this.comp_kmxplus_data, this.comp_kmxplus.dpKMXPlus);
|
|
186
|
-
}
|
|
187
|
-
return file;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="862c3ee8-5279-516a-9dc7-80048b1ba87c")}catch(e){}}();
|
|
3
|
+
import * as r from 'restructure';
|
|
4
|
+
import { KMXFile } from './kmx.js';
|
|
5
|
+
import { KMXPlusFile } from './kmx-plus.js';
|
|
6
|
+
import KMXPlusBuilder from './kmx-plus-builder/kmx-plus-builder.js';
|
|
7
|
+
export default class KMXBuilder {
|
|
8
|
+
file;
|
|
9
|
+
base_keyboard = 0;
|
|
10
|
+
base_kmxplus = 0;
|
|
11
|
+
comp_header;
|
|
12
|
+
comp_kmxplus;
|
|
13
|
+
comp_stores = [];
|
|
14
|
+
comp_groups = [];
|
|
15
|
+
comp_kmxplus_data;
|
|
16
|
+
writeDebug = false;
|
|
17
|
+
constructor(file, writeDebug) {
|
|
18
|
+
this.file = file;
|
|
19
|
+
this.writeDebug = writeDebug;
|
|
20
|
+
}
|
|
21
|
+
calculateStringOffsetAndSize(string, base, requireString = false) {
|
|
22
|
+
if (string.length == 0 && !requireString) {
|
|
23
|
+
// Zero length strings take up no space in the file, and
|
|
24
|
+
// are treated as a 'null string'
|
|
25
|
+
return [0, base];
|
|
26
|
+
}
|
|
27
|
+
return [base, base + string.length * 2 + 2]; // include trailing zero
|
|
28
|
+
}
|
|
29
|
+
build() {
|
|
30
|
+
this.base_keyboard = 0;
|
|
31
|
+
this.base_kmxplus = 0;
|
|
32
|
+
// Header
|
|
33
|
+
this.comp_header = {
|
|
34
|
+
dwIdentifier: KMXFile.FILEID_COMPILED,
|
|
35
|
+
dwFileVersion: KMXFile.VERSION_170,
|
|
36
|
+
dwCheckSum: 0, // Deprecated in Keyman 16.0
|
|
37
|
+
KeyboardID: 0,
|
|
38
|
+
IsRegistered: 1,
|
|
39
|
+
version: 0,
|
|
40
|
+
cxStoreArray: 0,
|
|
41
|
+
cxGroupArray: 0,
|
|
42
|
+
dpStoreArray: 0,
|
|
43
|
+
dpGroupArray: 0,
|
|
44
|
+
StartGroup_ANSI: 0xFFFFFFFF,
|
|
45
|
+
StartGroup_Unicode: 0xFFFFFFFF,
|
|
46
|
+
dwFlags: 0,
|
|
47
|
+
dwHotKey: 0,
|
|
48
|
+
dpBitmapOffset: 0,
|
|
49
|
+
dwBitmapSize: 0
|
|
50
|
+
};
|
|
51
|
+
let size = KMXFile.COMP_KEYBOARD_SIZE;
|
|
52
|
+
if (this.file instanceof KMXPlusFile) {
|
|
53
|
+
// Reserve space for KMXPlus header; we'll come back and fill in details
|
|
54
|
+
// once we know base kmx file size.
|
|
55
|
+
this.comp_header.dwFlags |= KMXFile.KF_KMXPLUS;
|
|
56
|
+
this.base_kmxplus = size;
|
|
57
|
+
size += KMXFile.COMP_KEYBOARD_KMXPLUSINFO_SIZE;
|
|
58
|
+
}
|
|
59
|
+
// Stores
|
|
60
|
+
this.comp_header.cxStoreArray = this.file.keyboard.stores.length;
|
|
61
|
+
this.comp_header.dpStoreArray = this.comp_header.cxStoreArray ? size : 0;
|
|
62
|
+
let storeBase = size;
|
|
63
|
+
size += this.file.keyboard.stores.length * KMXFile.COMP_STORE_SIZE;
|
|
64
|
+
for (let store of this.file.keyboard.stores) {
|
|
65
|
+
let comp_store = {
|
|
66
|
+
dwSystemID: store.dwSystemID,
|
|
67
|
+
dpName: 0,
|
|
68
|
+
dpString: 0
|
|
69
|
+
};
|
|
70
|
+
this.comp_stores.push({ base: storeBase, store: store, obj: comp_store });
|
|
71
|
+
if (this.writeDebug /*TODO: || store.isOption*/) {
|
|
72
|
+
[comp_store.dpName, size] = this.calculateStringOffsetAndSize(store.dpName, size);
|
|
73
|
+
}
|
|
74
|
+
[comp_store.dpString, size] = this.calculateStringOffsetAndSize(store.dpString, size);
|
|
75
|
+
storeBase += KMXFile.COMP_STORE_SIZE;
|
|
76
|
+
}
|
|
77
|
+
// Groups
|
|
78
|
+
this.comp_header.cxGroupArray = this.file.keyboard.groups.length;
|
|
79
|
+
this.comp_header.dpGroupArray = this.comp_header.cxGroupArray ? size : 0;
|
|
80
|
+
let groupBase = size;
|
|
81
|
+
size += this.file.keyboard.groups.length * KMXFile.COMP_GROUP_SIZE;
|
|
82
|
+
for (let group of this.file.keyboard.groups) {
|
|
83
|
+
let comp_group = {
|
|
84
|
+
dpName: 0,
|
|
85
|
+
dpKeyArray: 0,
|
|
86
|
+
dpMatch: 0,
|
|
87
|
+
dpNoMatch: 0,
|
|
88
|
+
cxKeyArray: group.keys.length,
|
|
89
|
+
fUsingKeys: group.fUsingKeys ? 1 : 0
|
|
90
|
+
};
|
|
91
|
+
let comp_keys = [];
|
|
92
|
+
this.comp_groups.push({ base: groupBase, group: group, obj: comp_group, keys: comp_keys });
|
|
93
|
+
if (this.writeDebug) {
|
|
94
|
+
[comp_group.dpName, size] = this.calculateStringOffsetAndSize(group.dpName, size);
|
|
95
|
+
}
|
|
96
|
+
[comp_group.dpMatch, size] = this.calculateStringOffsetAndSize(group.dpMatch, size);
|
|
97
|
+
[comp_group.dpNoMatch, size] = this.calculateStringOffsetAndSize(group.dpNoMatch, size);
|
|
98
|
+
// Keys within a group
|
|
99
|
+
comp_group.dpKeyArray = group.keys.length ? size : 0;
|
|
100
|
+
let keyBase = size;
|
|
101
|
+
size += group.keys.length * KMXFile.COMP_KEY_SIZE;
|
|
102
|
+
for (let key of group.keys) {
|
|
103
|
+
let comp_key = {
|
|
104
|
+
Key: key.Key,
|
|
105
|
+
_padding: 0,
|
|
106
|
+
Line: key.Line,
|
|
107
|
+
ShiftFlags: key.ShiftFlags,
|
|
108
|
+
dpOutput: 0,
|
|
109
|
+
dpContext: 0
|
|
110
|
+
};
|
|
111
|
+
comp_keys.push({ base: keyBase, key: key, obj: comp_key });
|
|
112
|
+
[comp_key.dpOutput, size] = this.calculateStringOffsetAndSize(key.dpOutput, size, true);
|
|
113
|
+
[comp_key.dpContext, size] = this.calculateStringOffsetAndSize(key.dpContext, size, true);
|
|
114
|
+
keyBase += KMXFile.COMP_KEY_SIZE;
|
|
115
|
+
}
|
|
116
|
+
groupBase += KMXFile.COMP_GROUP_SIZE;
|
|
117
|
+
}
|
|
118
|
+
size += this.buildBitmap();
|
|
119
|
+
size += this.buildKMXPlus(size);
|
|
120
|
+
return size;
|
|
121
|
+
}
|
|
122
|
+
buildBitmap() {
|
|
123
|
+
// TODO
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
buildKMXPlus(base) {
|
|
127
|
+
if (!(this.file instanceof KMXPlusFile)) {
|
|
128
|
+
return 0;
|
|
129
|
+
}
|
|
130
|
+
const plusbuilder = new KMXPlusBuilder(this.file, this.writeDebug);
|
|
131
|
+
this.comp_kmxplus_data = plusbuilder.compile();
|
|
132
|
+
this.comp_kmxplus = {
|
|
133
|
+
dpKMXPlus: base,
|
|
134
|
+
dwKMXPlusSize: this.comp_kmxplus_data.length
|
|
135
|
+
};
|
|
136
|
+
return this.comp_kmxplus.dwKMXPlusSize;
|
|
137
|
+
}
|
|
138
|
+
setString(file, pos, str, requireString = false) {
|
|
139
|
+
if (requireString && !str.length) {
|
|
140
|
+
// Just write zero terminator, as r.String for a zero-length string
|
|
141
|
+
// seems to fail.
|
|
142
|
+
let sbuf = r.uint16le;
|
|
143
|
+
file.set(sbuf.toBuffer(0), pos);
|
|
144
|
+
}
|
|
145
|
+
else if (pos && str.length) {
|
|
146
|
+
let sbuf = new r.String(null, 'utf16le'); // null-terminated string
|
|
147
|
+
file.set(sbuf.toBuffer(str), pos);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
compile() {
|
|
151
|
+
const fileSize = this.build();
|
|
152
|
+
let file = new Uint8Array(fileSize);
|
|
153
|
+
// Write headers
|
|
154
|
+
const header = this.file.COMP_KEYBOARD.toBuffer(this.comp_header);
|
|
155
|
+
file.set(header, this.base_keyboard);
|
|
156
|
+
if (this.file instanceof KMXPlusFile) {
|
|
157
|
+
const kmxplus = this.file.COMP_KEYBOARD_KMXPLUSINFO.toBuffer(this.comp_kmxplus);
|
|
158
|
+
file.set(kmxplus, this.base_kmxplus);
|
|
159
|
+
}
|
|
160
|
+
// Write store array and data
|
|
161
|
+
for (let store of this.comp_stores) {
|
|
162
|
+
file.set(this.file.COMP_STORE.toBuffer(store.obj), store.base);
|
|
163
|
+
if (this.writeDebug) {
|
|
164
|
+
this.setString(file, store.obj.dpName, store.store.dpName);
|
|
165
|
+
}
|
|
166
|
+
this.setString(file, store.obj.dpString, store.store.dpString);
|
|
167
|
+
}
|
|
168
|
+
// Write group array and data
|
|
169
|
+
for (let group of this.comp_groups) {
|
|
170
|
+
file.set(this.file.COMP_GROUP.toBuffer(group.obj), group.base);
|
|
171
|
+
if (this.writeDebug) {
|
|
172
|
+
this.setString(file, group.obj.dpName, group.group.dpName);
|
|
173
|
+
}
|
|
174
|
+
this.setString(file, group.obj.dpMatch, group.group.dpMatch);
|
|
175
|
+
this.setString(file, group.obj.dpNoMatch, group.group.dpNoMatch);
|
|
176
|
+
for (let key of group.keys) {
|
|
177
|
+
file.set(this.file.COMP_KEY.toBuffer(key.obj), key.base);
|
|
178
|
+
// for back-compat reasons, these are never NULL strings
|
|
179
|
+
this.setString(file, key.obj.dpContext, key.key.dpContext, true);
|
|
180
|
+
this.setString(file, key.obj.dpOutput, key.key.dpOutput, true);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// Write KMXPlus data stream
|
|
184
|
+
if (this.file instanceof KMXPlusFile) {
|
|
185
|
+
file.set(this.comp_kmxplus_data, this.comp_kmxplus.dpKMXPlus);
|
|
186
|
+
}
|
|
187
|
+
return file;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
190
|
//# sourceMappingURL=kmx-builder.js.map
|
|
191
|
-
//# debugId=
|
|
191
|
+
//# debugId=862c3ee8-5279-516a-9dc7-80048b1ba87c
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kmx-builder.js","sources":["../../../src/kmx/kmx-builder.ts"],"sourceRoot":"","names":[],"mappings":";;AAAA,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,OAAO,EAAyI,MAAM,UAAU,CAAC;AAC1K,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,cAAc,MAAM,wCAAwC,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,UAAU;IAC7B,IAAI,CAAU;IACd,aAAa,GAAW,CAAC,CAAC;IAC1B,YAAY,GAAW,CAAC,CAAC;IACzB,WAAW,CAAwB;IACnC,YAAY,CAAoC;IAChD,WAAW,GAA4D,EAAE,CAAC;IAC1E,WAAW,GAAqH,EAAE,CAAC;IACnI,iBAAiB,CAAa;IAC9B,UAAU,GAAY,KAAK,CAAC;IAE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I,KAAK,CAAC,IAAI,EAAE,CAAC;gBAC1B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;gBACzD,wDAAwD;gBACxD,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;gBACjE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;QAED,4BAA4B;QAE5B,IAAG,IAAI,CAAC,IAAI,YAAY,WAAW,EAAE,CAAC;YACpC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QAChE,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF","debug_id":"862c3ee8-5279-516a-9dc7-80048b1ba87c"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { KEYBOARD } from "./kmx.js";
|
|
2
|
-
import { KeymanTypesError } from "../util/errors.js";
|
|
3
|
-
export declare class KmxFileReaderError extends KeymanTypesError {
|
|
4
|
-
}
|
|
5
|
-
export declare class KmxFileReader {
|
|
6
|
-
private readonly rString;
|
|
7
|
-
private readString;
|
|
8
|
-
private isValidCodeUse;
|
|
9
|
-
private processSystemStore;
|
|
10
|
-
read(source: Uint8Array): KEYBOARD;
|
|
11
|
-
private readGroupsAndRules;
|
|
12
|
-
private readStores;
|
|
13
|
-
}
|
|
1
|
+
import { KEYBOARD } from "./kmx.js";
|
|
2
|
+
import { KeymanTypesError } from "../util/errors.js";
|
|
3
|
+
export declare class KmxFileReaderError extends KeymanTypesError {
|
|
4
|
+
}
|
|
5
|
+
export declare class KmxFileReader {
|
|
6
|
+
private readonly rString;
|
|
7
|
+
private readString;
|
|
8
|
+
private isValidCodeUse;
|
|
9
|
+
private processSystemStore;
|
|
10
|
+
read(source: Uint8Array): KEYBOARD;
|
|
11
|
+
private readGroupsAndRules;
|
|
12
|
+
private readStores;
|
|
13
|
+
}
|
|
14
14
|
//# sourceMappingURL=kmx-file-reader.d.ts.map
|