quickwin 2.3.0 → 3.0.0
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/README.en.md +1 -2
- package/README.md +1 -2
- package/constants.ts +22 -0
- package/enum_map.d.ts +4 -0
- package/examples/PdfCanvas.js +1 -1
- package/examples/PdfCanvas.tsx +2 -2
- package/examples/execd/main.js +491 -217
- package/examples/pdf_preview2.js +76 -67
- package/examples/pdf_preview2.ts +84 -64
- package/examples/pdf_viewer.js +4932 -1029
- package/examples/pdf_viewer.tsx +11 -22
- package/examples/test_gallery.js +308 -143
- package/examples/test_gallery.tsx +12 -7
- package/examples/test_react_lazy.js +295 -133
- package/examples/test_react_lazy.tsx +4 -3
- package/examples/test_react_listbox.js +293 -132
- package/examples/test_react_listbox.tsx +3 -2
- package/examples/test_root_window.js +283 -126
- package/examples/test_tab.js +295 -133
- package/examples/test_tab.tsx +4 -3
- package/examples/tray_demo.js +37 -30
- package/examples/tray_demo.tsx +39 -32
- package/lib/bitmap.js +40 -0
- package/lib/bitmap.ts +39 -0
- package/lib/certs.js +31 -3
- package/lib/certs.ts +32 -3
- package/lib/dpi.js +30 -0
- package/lib/dpi.ts +31 -0
- package/lib/dumpRects.js +14 -7
- package/lib/dumpRects.ts +14 -6
- package/lib/ffi/bind.js +5 -4
- package/lib/ffi/bind.ts +9 -8
- package/lib/http-server.js +50 -25
- package/lib/http-server.ts +51 -23
- package/lib/react-qw/components/DateTimePicker.js +6 -7
- package/lib/react-qw/components/Input.js +5 -1
- package/lib/react-qw/components/ListView.js +8 -6
- package/lib/react-qw/components/ScrollView.js +28 -22
- package/lib/react-qw/index.js +7 -5
- package/lib/react-qw/index.ts +5 -5
- package/lib/react-qw/props.js +3 -3
- package/lib/react-qw/props.ts +3 -3
- package/lib/react-qw/reconciler.js +12 -17
- package/lib/react-qw/reconciler.ts +12 -16
- package/lib/text-measure.js +9 -6
- package/lib/text-measure.ts +9 -6
- package/lib/windows/comctl32.js +3 -2
- package/lib/windows/comctl32.ts +3 -2
- package/lib/windows/gdi32.js +28 -6
- package/lib/windows/gdi32.ts +30 -6
- package/lib/windows/kernel32.js +9 -0
- package/lib/windows/kernel32.ts +9 -0
- package/lib/windows/shell32.js +11 -2
- package/lib/windows/shell32.ts +13 -2
- package/lib/windows/structs.js +51 -0
- package/lib/windows/structs.ts +55 -0
- package/lib/windows/user32.js +6 -5
- package/lib/windows/user32.ts +6 -5
- package/main.js +13 -5
- package/package.json +2 -2
- package/quickwin.d.ts +13 -115
- package/qwin-nowasm-x86.exe +0 -0
- package/qwin-nowasm.exe +0 -0
- package/qwin-x86.exe +0 -0
- package/qwin.exe +0 -0
- package/test/bench_ffi_callraw.js +3 -4
- package/test/bench_ffi_callraw.ts +3 -4
- package/test/debug/mupdf_debug.js +4 -22
- package/test/debug/wasm_export_debug.js +2 -12
- package/test/debug/wasm_names.js +3 -13
- package/test/example.pdf +0 -0
- package/test/mupdf-cdn.js +40 -0
- package/test/mupdf-cdn.ts +43 -0
- package/test/test_ffi.js +8 -9
- package/test/test_ffi.ts +8 -9
- package/test/test_ffi_abi.js +6 -6
- package/test/test_ffi_abi.ts +8 -8
- package/test/test_ffi_windows.js +82 -11
- package/test/test_ffi_windows.ts +85 -11
- package/test/test_gdi_draw.js +3 -3
- package/test/test_gdi_draw.ts +4 -4
- package/test/test_mupdf_render.js +4 -22
- package/test/test_mupdf_render.ts +4 -23
- package/test/test_mupdf_twice.js +4 -19
- package/test/test_mupdf_twice.ts +4 -20
- package/test/test_mupdf_wasm.js +10 -4
- package/test/test_mupdf_wasm.ts +6 -4
- package/test/test_react_complex.js +316 -140
- package/test/test_react_counter.js +295 -133
- package/test/test_react_flex.js +297 -138
- package/test/test_react_hidden.js +296 -134
- package/test/test_react_listview_link.js +288 -131
- package/test/test_react_notify.js +290 -133
- package/test/test_react_render.js +295 -133
- package/vendor/mupdf-wasm/mupdf-wasm.d.ts +0 -571
- package/vendor/mupdf-wasm/mupdf-wasm.js +0 -2749
- package/vendor/mupdf-wasm/mupdf-wasm.wasm +0 -0
- package/vendor/mupdf-wasm/mupdf.d.ts +0 -939
- package/vendor/mupdf-wasm/mupdf.js +0 -3317
|
@@ -1367,9 +1367,9 @@ var require_scheduler_development = __commonJS({
|
|
|
1367
1367
|
}
|
|
1368
1368
|
return first;
|
|
1369
1369
|
}
|
|
1370
|
-
function compare(a,
|
|
1371
|
-
var diff = a.sortIndex -
|
|
1372
|
-
return 0 !== diff ? diff : a.id -
|
|
1370
|
+
function compare(a, b7) {
|
|
1371
|
+
var diff = a.sortIndex - b7.sortIndex;
|
|
1372
|
+
return 0 !== diff ? diff : a.id - b7.id;
|
|
1373
1373
|
}
|
|
1374
1374
|
function advanceTimers(currentTime) {
|
|
1375
1375
|
for (var timer = peek(timerQueue); null !== timer; ) {
|
|
@@ -1667,14 +1667,14 @@ var require_react_reconciler_development = __commonJS({
|
|
|
1667
1667
|
throw Error("Unable to find node on an unmounted component.");
|
|
1668
1668
|
return alternate !== fiber ? null : fiber;
|
|
1669
1669
|
}
|
|
1670
|
-
for (var a = fiber,
|
|
1670
|
+
for (var a = fiber, b7 = alternate; ; ) {
|
|
1671
1671
|
var parentA = a.return;
|
|
1672
1672
|
if (null === parentA) break;
|
|
1673
1673
|
var parentB = parentA.alternate;
|
|
1674
1674
|
if (null === parentB) {
|
|
1675
|
-
|
|
1676
|
-
if (null !==
|
|
1677
|
-
a =
|
|
1675
|
+
b7 = parentA.return;
|
|
1676
|
+
if (null !== b7) {
|
|
1677
|
+
a = b7;
|
|
1678
1678
|
continue;
|
|
1679
1679
|
}
|
|
1680
1680
|
break;
|
|
@@ -1682,23 +1682,23 @@ var require_react_reconciler_development = __commonJS({
|
|
|
1682
1682
|
if (parentA.child === parentB.child) {
|
|
1683
1683
|
for (parentB = parentA.child; parentB; ) {
|
|
1684
1684
|
if (parentB === a) return assertIsMounted(parentA), fiber;
|
|
1685
|
-
if (parentB ===
|
|
1685
|
+
if (parentB === b7) return assertIsMounted(parentA), alternate;
|
|
1686
1686
|
parentB = parentB.sibling;
|
|
1687
1687
|
}
|
|
1688
1688
|
throw Error("Unable to find node on an unmounted component.");
|
|
1689
1689
|
}
|
|
1690
|
-
if (a.return !==
|
|
1690
|
+
if (a.return !== b7.return) a = parentA, b7 = parentB;
|
|
1691
1691
|
else {
|
|
1692
1692
|
for (var didFindChild = false, _child = parentA.child; _child; ) {
|
|
1693
1693
|
if (_child === a) {
|
|
1694
1694
|
didFindChild = true;
|
|
1695
1695
|
a = parentA;
|
|
1696
|
-
|
|
1696
|
+
b7 = parentB;
|
|
1697
1697
|
break;
|
|
1698
1698
|
}
|
|
1699
|
-
if (_child ===
|
|
1699
|
+
if (_child === b7) {
|
|
1700
1700
|
didFindChild = true;
|
|
1701
|
-
|
|
1701
|
+
b7 = parentA;
|
|
1702
1702
|
a = parentB;
|
|
1703
1703
|
break;
|
|
1704
1704
|
}
|
|
@@ -1709,12 +1709,12 @@ var require_react_reconciler_development = __commonJS({
|
|
|
1709
1709
|
if (_child === a) {
|
|
1710
1710
|
didFindChild = true;
|
|
1711
1711
|
a = parentB;
|
|
1712
|
-
|
|
1712
|
+
b7 = parentA;
|
|
1713
1713
|
break;
|
|
1714
1714
|
}
|
|
1715
|
-
if (_child ===
|
|
1715
|
+
if (_child === b7) {
|
|
1716
1716
|
didFindChild = true;
|
|
1717
|
-
|
|
1717
|
+
b7 = parentB;
|
|
1718
1718
|
a = parentA;
|
|
1719
1719
|
break;
|
|
1720
1720
|
}
|
|
@@ -1726,7 +1726,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
1726
1726
|
);
|
|
1727
1727
|
}
|
|
1728
1728
|
}
|
|
1729
|
-
if (a.alternate !==
|
|
1729
|
+
if (a.alternate !== b7)
|
|
1730
1730
|
throw Error(
|
|
1731
1731
|
"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."
|
|
1732
1732
|
);
|
|
@@ -15071,10 +15071,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
15071
15071
|
setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = prevTransition;
|
|
15072
15072
|
}
|
|
15073
15073
|
};
|
|
15074
|
-
exports2.discreteUpdates = function(fn, a,
|
|
15074
|
+
exports2.discreteUpdates = function(fn, a, b7, c, d) {
|
|
15075
15075
|
var prevTransition = ReactSharedInternals.T, previousPriority = getCurrentUpdatePriority();
|
|
15076
15076
|
try {
|
|
15077
|
-
return setCurrentUpdatePriority(2), ReactSharedInternals.T = null, fn(a,
|
|
15077
|
+
return setCurrentUpdatePriority(2), ReactSharedInternals.T = null, fn(a, b7, c, d);
|
|
15078
15078
|
} finally {
|
|
15079
15079
|
setCurrentUpdatePriority(previousPriority), ReactSharedInternals.T = prevTransition, executionContext === NoContext && (workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS);
|
|
15080
15080
|
}
|
|
@@ -15360,7 +15360,7 @@ import "../lib/polyfill.js";
|
|
|
15360
15360
|
import * as std2 from "std";
|
|
15361
15361
|
|
|
15362
15362
|
// _build/lib/react-qw/index.js
|
|
15363
|
-
import * as
|
|
15363
|
+
import * as gui16 from "gui";
|
|
15364
15364
|
|
|
15365
15365
|
// _build/lib/windows/user32.js
|
|
15366
15366
|
import * as os3 from "os";
|
|
@@ -15369,7 +15369,6 @@ import * as os3 from "os";
|
|
|
15369
15369
|
import * as ffi from "ffi";
|
|
15370
15370
|
import * as os2 from "os";
|
|
15371
15371
|
import * as std from "std";
|
|
15372
|
-
import * as win from "win";
|
|
15373
15372
|
|
|
15374
15373
|
// _build/lib/text-codec.js
|
|
15375
15374
|
var _labelMap = {
|
|
@@ -15391,19 +15390,19 @@ function _normalizeLabel(label) {
|
|
|
15391
15390
|
function _decodeUTF8(buf, fatal) {
|
|
15392
15391
|
let out = "";
|
|
15393
15392
|
for (let i = 0; i < buf.length; ) {
|
|
15394
|
-
const
|
|
15395
|
-
if (
|
|
15396
|
-
out += String.fromCharCode(
|
|
15393
|
+
const b7 = buf[i++];
|
|
15394
|
+
if (b7 < 128) {
|
|
15395
|
+
out += String.fromCharCode(b7);
|
|
15397
15396
|
continue;
|
|
15398
15397
|
}
|
|
15399
|
-
if (
|
|
15398
|
+
if (b7 < 192) {
|
|
15400
15399
|
out += fatal ? (() => {
|
|
15401
15400
|
throw new TypeError("unexpected continuation byte");
|
|
15402
15401
|
})() : "\uFFFD";
|
|
15403
15402
|
continue;
|
|
15404
15403
|
}
|
|
15405
15404
|
let c, min;
|
|
15406
|
-
if (
|
|
15405
|
+
if (b7 < 224) {
|
|
15407
15406
|
if (i >= buf.length) {
|
|
15408
15407
|
out += fatal ? (() => {
|
|
15409
15408
|
throw new TypeError("incomplete utf-8");
|
|
@@ -15415,9 +15414,9 @@ function _decodeUTF8(buf, fatal) {
|
|
|
15415
15414
|
out += "\uFFFD";
|
|
15416
15415
|
continue;
|
|
15417
15416
|
}
|
|
15418
|
-
c = (
|
|
15417
|
+
c = (b7 & 31) << 6 | b22 & 63;
|
|
15419
15418
|
min = 128;
|
|
15420
|
-
} else if (
|
|
15419
|
+
} else if (b7 < 240) {
|
|
15421
15420
|
if (i + 1 >= buf.length) {
|
|
15422
15421
|
out += fatal ? (() => {
|
|
15423
15422
|
throw new TypeError("incomplete utf-8");
|
|
@@ -15430,9 +15429,9 @@ function _decodeUTF8(buf, fatal) {
|
|
|
15430
15429
|
out += "\uFFFD";
|
|
15431
15430
|
continue;
|
|
15432
15431
|
}
|
|
15433
|
-
c = (
|
|
15432
|
+
c = (b7 & 15) << 12 | (b22 & 63) << 6 | b32 & 63;
|
|
15434
15433
|
min = 2048;
|
|
15435
|
-
} else if (
|
|
15434
|
+
} else if (b7 < 248) {
|
|
15436
15435
|
if (i + 2 >= buf.length) {
|
|
15437
15436
|
out += fatal ? (() => {
|
|
15438
15437
|
throw new TypeError("incomplete utf-8");
|
|
@@ -15446,7 +15445,7 @@ function _decodeUTF8(buf, fatal) {
|
|
|
15446
15445
|
out += "\uFFFD";
|
|
15447
15446
|
continue;
|
|
15448
15447
|
}
|
|
15449
|
-
c = (
|
|
15448
|
+
c = (b7 & 7) << 18 | (b22 & 63) << 12 | (b32 & 63) << 6 | b42 & 63;
|
|
15450
15449
|
min = 65536;
|
|
15451
15450
|
} else {
|
|
15452
15451
|
out += fatal ? (() => {
|
|
@@ -15750,7 +15749,7 @@ function loadDll(dll) {
|
|
|
15750
15749
|
const cached = _dllCache.get(dll);
|
|
15751
15750
|
if (cached !== void 0)
|
|
15752
15751
|
return cached;
|
|
15753
|
-
const loaded =
|
|
15752
|
+
const loaded = ffi.LoadLibrary(dll);
|
|
15754
15753
|
if (!loaded)
|
|
15755
15754
|
throw new Error(`ffi-bind: LoadLibrary("${dll}") failed`);
|
|
15756
15755
|
_dllCache.set(dll, loaded);
|
|
@@ -15960,7 +15959,7 @@ var BYTE = {
|
|
|
15960
15959
|
};
|
|
15961
15960
|
var builtinCodecs = { WCHAR, BYTE };
|
|
15962
15961
|
function bind(dll, name, sig, encoders, decoders) {
|
|
15963
|
-
const proc =
|
|
15962
|
+
const proc = ffi.GetProcAddress(loadDll(dll), name);
|
|
15964
15963
|
if (!proc)
|
|
15965
15964
|
throw new Error(`ffi-bind: proc "${name}" not found in ${dll}`);
|
|
15966
15965
|
const effDec = decoders ?? encoders;
|
|
@@ -16000,13 +15999,13 @@ function lower(v) {
|
|
|
16000
15999
|
type: { tag: "array", elementType: el.type, elementSize: el.size }
|
|
16001
16000
|
};
|
|
16002
16001
|
}
|
|
16003
|
-
const
|
|
16004
|
-
if (
|
|
16005
|
-
const rawUnit =
|
|
16002
|
+
const b7 = /^([A-Za-z_]\w*):(\d+)$/.exec(v);
|
|
16003
|
+
if (b7) {
|
|
16004
|
+
const rawUnit = b7[1];
|
|
16006
16005
|
const unit = normToken(rawUnit);
|
|
16007
16006
|
if (!isCNumberToken(unit) || unit === "f32" || unit === "f64")
|
|
16008
16007
|
throw new Error(`ffi-struct: bitfield unit must be an integer type, got "${rawUnit}"`);
|
|
16009
|
-
const width = Number(
|
|
16008
|
+
const width = Number(b7[2]);
|
|
16010
16009
|
const s2 = SizeAlign[unit];
|
|
16011
16010
|
const cap = s2 * 8;
|
|
16012
16011
|
if (!Number.isInteger(width) || width < 1)
|
|
@@ -16322,10 +16321,10 @@ function buildDecl(kind, member, pack) {
|
|
|
16322
16321
|
decl[k] = v;
|
|
16323
16322
|
return decl;
|
|
16324
16323
|
}
|
|
16325
|
-
function struct(a,
|
|
16324
|
+
function struct(a, b7, c) {
|
|
16326
16325
|
const isNamed = typeof a === "string";
|
|
16327
|
-
const raw = isNamed ?
|
|
16328
|
-
const opts = isNamed ? c :
|
|
16326
|
+
const raw = isNamed ? b7 : a;
|
|
16327
|
+
const opts = isNamed ? c : b7;
|
|
16329
16328
|
return createStruct(buildDecl("struct", raw, opts?.pack));
|
|
16330
16329
|
}
|
|
16331
16330
|
|
|
@@ -16350,6 +16349,17 @@ var SIZE_DECL = {
|
|
|
16350
16349
|
cy: "i32"
|
|
16351
16350
|
};
|
|
16352
16351
|
var SIZE = /* @__PURE__ */ struct("SIZE", SIZE_DECL);
|
|
16352
|
+
var SCROLLINFO_DECL = {
|
|
16353
|
+
"#": "struct",
|
|
16354
|
+
cbSize: "u32",
|
|
16355
|
+
fMask: "u32",
|
|
16356
|
+
nMin: "i32",
|
|
16357
|
+
nMax: "i32",
|
|
16358
|
+
nPage: "u32",
|
|
16359
|
+
nPos: "i32",
|
|
16360
|
+
nTrackPos: "i32"
|
|
16361
|
+
};
|
|
16362
|
+
var SCROLLINFO = /* @__PURE__ */ struct("SCROLLINFO", SCROLLINFO_DECL);
|
|
16353
16363
|
var LOGFONTW_DECL = {
|
|
16354
16364
|
"#": "struct",
|
|
16355
16365
|
lfHeight: "i32",
|
|
@@ -16368,6 +16378,41 @@ var LOGFONTW_DECL = {
|
|
|
16368
16378
|
lfFaceName: "u16[32]@utf-16le"
|
|
16369
16379
|
};
|
|
16370
16380
|
var LOGFONTW = /* @__PURE__ */ struct("LOGFONTW", LOGFONTW_DECL);
|
|
16381
|
+
var NONCLIENTMETRICSW_DECL = {
|
|
16382
|
+
"#": "struct",
|
|
16383
|
+
cbSize: "u32",
|
|
16384
|
+
iBorderWidth: "i32",
|
|
16385
|
+
iScrollWidth: "i32",
|
|
16386
|
+
iScrollHeight: "i32",
|
|
16387
|
+
iCaptionWidth: "i32",
|
|
16388
|
+
iCaptionHeight: "i32",
|
|
16389
|
+
lfCaptionFont: LOGFONTW_DECL,
|
|
16390
|
+
iSmCaptionWidth: "i32",
|
|
16391
|
+
iSmCaptionHeight: "i32",
|
|
16392
|
+
lfSmCaptionFont: LOGFONTW_DECL,
|
|
16393
|
+
iMenuWidth: "i32",
|
|
16394
|
+
iMenuHeight: "i32",
|
|
16395
|
+
lfMenuFont: LOGFONTW_DECL,
|
|
16396
|
+
lfStatusFont: LOGFONTW_DECL,
|
|
16397
|
+
lfMessageFont: LOGFONTW_DECL,
|
|
16398
|
+
iPaddedBorderWidth: "i32"
|
|
16399
|
+
};
|
|
16400
|
+
var NONCLIENTMETRICSW = /* @__PURE__ */ struct("NONCLIENTMETRICSW", NONCLIENTMETRICSW_DECL);
|
|
16401
|
+
var BITMAPINFOHEADER_DECL = {
|
|
16402
|
+
"#": "struct",
|
|
16403
|
+
biSize: "u32",
|
|
16404
|
+
biWidth: "i32",
|
|
16405
|
+
biHeight: "i32",
|
|
16406
|
+
biPlanes: "u16",
|
|
16407
|
+
biBitCount: "u16",
|
|
16408
|
+
biCompression: "u32",
|
|
16409
|
+
biSizeImage: "u32",
|
|
16410
|
+
biXPelsPerMeter: "i32",
|
|
16411
|
+
biYPelsPerMeter: "i32",
|
|
16412
|
+
biClrUsed: "u32",
|
|
16413
|
+
biClrImportant: "u32"
|
|
16414
|
+
};
|
|
16415
|
+
var BITMAPINFOHEADER = /* @__PURE__ */ struct("BITMAPINFOHEADER", BITMAPINFOHEADER_DECL);
|
|
16371
16416
|
var OPENFILENAMEW_DECL = {
|
|
16372
16417
|
"#": "struct",
|
|
16373
16418
|
lStructSize: "u32",
|
|
@@ -16574,8 +16619,13 @@ var NOTIFYICONIDENTIFIER = /* @__PURE__ */ struct("NOTIFYICONIDENTIFIER", NOTIFY
|
|
|
16574
16619
|
var b = (name, sig, encoders) => bind("user32.dll", name, sig, encoders);
|
|
16575
16620
|
var _bProbe = b("GetDesktopWindow", " -> <HWND>ptr");
|
|
16576
16621
|
var LONG_PTR_SYM = os3.arch === "x64" ? "PtrW" : "W";
|
|
16622
|
+
var ShowWindow = /* @__PURE__ */ b("ShowWindow", "<HWND>ptr i32@ShowWindowCmd -> i32");
|
|
16577
16623
|
var SetWindowPos = /* @__PURE__ */ b("SetWindowPos", "<HWND>ptr <>ptr@SetWindowPosHwnd i32 i32 i32 i32 u32 -> i32");
|
|
16624
|
+
var GetWindowRect = /* @__PURE__ */ b("GetWindowRect", "<HWND>ptr <RECT>ptr -> i32");
|
|
16625
|
+
var GetClientRect = /* @__PURE__ */ b("GetClientRect", "<HWND>ptr <RECT>ptr -> i32");
|
|
16626
|
+
var GetWindowText = /* @__PURE__ */ b("GetWindowTextW", "<HWND>ptr <BYTE>ptr i32 -> i32");
|
|
16578
16627
|
var SetWindowText = /* @__PURE__ */ b("SetWindowTextW", "<HWND>ptr <WCHAR>ptr -> i32");
|
|
16628
|
+
var GetWindowTextLength = /* @__PURE__ */ b("GetWindowTextLengthW", "<HWND>ptr -> i32");
|
|
16579
16629
|
var GetWindowLongPtr = /* @__PURE__ */ b("GetWindowLong" + LONG_PTR_SYM, "<HWND>ptr i32@Gwlp -> <>ptr");
|
|
16580
16630
|
var SetWindowLongPtr = /* @__PURE__ */ b("SetWindowLong" + LONG_PTR_SYM, "<HWND>ptr i32@Gwlp <>ptr -> <>ptr");
|
|
16581
16631
|
var EnableWindow = /* @__PURE__ */ b("EnableWindow", "<HWND>ptr i32 -> i32");
|
|
@@ -16586,12 +16636,16 @@ var GetDC = /* @__PURE__ */ b("GetDC", "<HWND>ptr -> <HDC>ptr");
|
|
|
16586
16636
|
var ReleaseDC = /* @__PURE__ */ b("ReleaseDC", "<HWND>ptr <HDC>ptr! -> i32");
|
|
16587
16637
|
var DrawText = /* @__PURE__ */ b("DrawTextW", "<HDC>ptr! <WCHAR>ptr i32 <RECT>ptr i32 -> i32");
|
|
16588
16638
|
var InvalidateRect = /* @__PURE__ */ b("InvalidateRect", "<HWND>ptr <RECT>ptr i32 -> i32", { RECT });
|
|
16639
|
+
var UpdateWindow = /* @__PURE__ */ b("UpdateWindow", "<HWND>ptr -> i32");
|
|
16589
16640
|
var SetCursor = /* @__PURE__ */ b("SetCursor", "<HCURSOR>ptr -> <HCURSOR>ptr");
|
|
16590
16641
|
var LoadCursor = /* @__PURE__ */ b("LoadCursorW", "<HMODULE>ptr <>ptr -> <HCURSOR>ptr");
|
|
16591
16642
|
var GetCursorPos = /* @__PURE__ */ b("GetCursorPos", "<POINT>ptr -> i32");
|
|
16592
16643
|
var ScreenToClient = /* @__PURE__ */ b("ScreenToClient", "<HWND>ptr <POINT>ptr -> i32");
|
|
16644
|
+
var SetScrollInfo = /* @__PURE__ */ b("SetScrollInfo", "<HWND>ptr u32 <SCROLLINFO>ptr i32 -> i32", { SCROLLINFO });
|
|
16645
|
+
var GetScrollInfo = /* @__PURE__ */ b("GetScrollInfo", "<HWND>ptr u32 <SCROLLINFO>ptr -> i32");
|
|
16593
16646
|
var ShowScrollBar = /* @__PURE__ */ b("ShowScrollBar", "<HWND>ptr u32 i32 -> i32");
|
|
16594
16647
|
var GetSystemMetrics = /* @__PURE__ */ b("GetSystemMetrics", "i32 -> i32");
|
|
16648
|
+
var SystemParametersInfo = /* @__PURE__ */ b("SystemParametersInfoW", "u32 u32 <BYTE>ptr u32 -> i32");
|
|
16595
16649
|
|
|
16596
16650
|
// _build/lib/react-qw/reconciler.js
|
|
16597
16651
|
var import_react_reconciler = __toESM(require_react_reconciler(), 1);
|
|
@@ -16606,8 +16660,33 @@ var DeleteObject = /* @__PURE__ */ b2("DeleteObject", "<HGDIOBJ>ptr -> i32");
|
|
|
16606
16660
|
var GetDeviceCaps = /* @__PURE__ */ b2("GetDeviceCaps", "<HDC>ptr! i32@DeviceCap -> i32");
|
|
16607
16661
|
var CreateFontIndirect = /* @__PURE__ */ b2("CreateFontIndirectW", "<LOGFONTW>ptr -> <HGDIOBJ>ptr", { LOGFONTW });
|
|
16608
16662
|
var SelectObject = /* @__PURE__ */ b2("SelectObject", "<HDC>ptr! <HGDIOBJ>ptr -> <HGDIOBJ>ptr");
|
|
16663
|
+
var CreateDIBSection = /* @__PURE__ */ b2("CreateDIBSection", "<HDC>ptr <>ptr u32@ColorUse <>ptr <>ptr u32 -> <HGDIOBJ>ptr");
|
|
16664
|
+
var SetDIBits = /* @__PURE__ */ b2("SetDIBits", "<HDC>ptr <HGDIOBJ>ptr! u32 u32 <BYTE>ptr <>ptr u32@ColorUse -> i32");
|
|
16609
16665
|
var GetObject = /* @__PURE__ */ b2("GetObjectW", "<HGDIOBJ>ptr i32 <BYTE>ptr -> i32");
|
|
16610
16666
|
|
|
16667
|
+
// _build/lib/dpi.js
|
|
16668
|
+
function getScaleFactor() {
|
|
16669
|
+
const hdc = GetDC(NULL);
|
|
16670
|
+
const dpi = hdc ? GetDeviceCaps(
|
|
16671
|
+
hdc,
|
|
16672
|
+
88
|
|
16673
|
+
/* DeviceCap.LOGPIXELSX */
|
|
16674
|
+
) : 96;
|
|
16675
|
+
if (hdc)
|
|
16676
|
+
ReleaseDC(NULL, hdc);
|
|
16677
|
+
return dpi / 96;
|
|
16678
|
+
}
|
|
16679
|
+
function createSystemDpiFont() {
|
|
16680
|
+
const ncm = NONCLIENTMETRICSW.encode({ cbSize: NONCLIENTMETRICSW.size });
|
|
16681
|
+
if (!SystemParametersInfo(41, NONCLIENTMETRICSW.size, ncm, 0)) {
|
|
16682
|
+
const legacySize = NONCLIENTMETRICSW.size - 4;
|
|
16683
|
+
NONCLIENTMETRICSW.encode({ cbSize: legacySize }, ncm);
|
|
16684
|
+
if (!SystemParametersInfo(41, legacySize, ncm, 0))
|
|
16685
|
+
return NULL;
|
|
16686
|
+
}
|
|
16687
|
+
return CreateFontIndirect(NONCLIENTMETRICSW.decode(ncm).lfMessageFont);
|
|
16688
|
+
}
|
|
16689
|
+
|
|
16611
16690
|
// _build/lib/react-qw/props.js
|
|
16612
16691
|
import * as gui from "gui";
|
|
16613
16692
|
function applyProps(instance, newProps, _oldProps) {
|
|
@@ -16631,14 +16710,14 @@ function applyProps(instance, newProps, _oldProps) {
|
|
|
16631
16710
|
EnableWindow(hwnd, !newProps.disabled ? 1 : 0);
|
|
16632
16711
|
}
|
|
16633
16712
|
if ("hidden" in newProps) {
|
|
16634
|
-
|
|
16713
|
+
ShowWindow(
|
|
16635
16714
|
hwnd,
|
|
16636
16715
|
newProps.hidden ? 0 : 5
|
|
16637
16716
|
/* ShowWindowCmd.SHOW */
|
|
16638
16717
|
);
|
|
16639
16718
|
}
|
|
16640
16719
|
if ("visible" in newProps) {
|
|
16641
|
-
|
|
16720
|
+
ShowWindow(
|
|
16642
16721
|
hwnd,
|
|
16643
16722
|
newProps.visible ? 5 : 0
|
|
16644
16723
|
/* ShowWindowCmd.HIDE */
|
|
@@ -16758,24 +16837,21 @@ function measureTextForHwnd(hwnd, text) {
|
|
|
16758
16837
|
if (hFont)
|
|
16759
16838
|
SelectObject(hdc, oldFont);
|
|
16760
16839
|
ReleaseDC(hwnd, hdc);
|
|
16761
|
-
const wr =
|
|
16762
|
-
const cr =
|
|
16763
|
-
|
|
16764
|
-
|
|
16765
|
-
|
|
16840
|
+
const wr = RECT.alloc();
|
|
16841
|
+
const cr = RECT.alloc();
|
|
16842
|
+
const okWr = GetWindowRect(hwnd, wr.ptr);
|
|
16843
|
+
const okCr = GetClientRect(hwnd, cr.ptr);
|
|
16844
|
+
if (okWr && okCr) {
|
|
16845
|
+
const w = RECT.decode(wr), c = RECT.decode(cr);
|
|
16846
|
+
result.width += w.right - w.left - (c.right - c.left);
|
|
16847
|
+
result.height += w.bottom - w.top - (c.bottom - c.top);
|
|
16766
16848
|
}
|
|
16767
16849
|
return result;
|
|
16768
16850
|
}
|
|
16769
16851
|
|
|
16770
16852
|
// _build/lib/react-qw/reconciler.js
|
|
16771
|
-
var dpiFont =
|
|
16772
|
-
var scaleFactor = (
|
|
16773
|
-
const hdc = GetDC(NULL);
|
|
16774
|
-
const dpi = hdc ? GetDeviceCaps(hdc, 88) : 96;
|
|
16775
|
-
if (hdc)
|
|
16776
|
-
ReleaseDC(NULL, hdc);
|
|
16777
|
-
return dpi / 96;
|
|
16778
|
-
})();
|
|
16853
|
+
var dpiFont = createSystemDpiFont();
|
|
16854
|
+
var scaleFactor = getScaleFactor();
|
|
16779
16855
|
var DELAYED_CONTROLS = /* @__PURE__ */ new Set(["SysListView32", "SysTreeView32", "LISTBOX", "COMBOBOX", "msctls_trackbar32", "SysDateTimePick32", "SysLink"]);
|
|
16780
16856
|
function isDelayedControl(winClass) {
|
|
16781
16857
|
return DELAYED_CONTROLS.has(winClass);
|
|
@@ -16821,11 +16897,12 @@ function runFlexLayout(inst) {
|
|
|
16821
16897
|
const visible = children.filter((c) => !c.props.hidden);
|
|
16822
16898
|
if (visible.length === 0)
|
|
16823
16899
|
return;
|
|
16824
|
-
const
|
|
16825
|
-
if (!
|
|
16900
|
+
const rcBuf = RECT.alloc();
|
|
16901
|
+
if (!GetClientRect(inst.hwnd, rcBuf.ptr)) {
|
|
16826
16902
|
console.log("flex: no rect for", inst.hwnd, inst.type);
|
|
16827
16903
|
return;
|
|
16828
16904
|
}
|
|
16905
|
+
const rect = RECT.decode(rcBuf);
|
|
16829
16906
|
const pw = (rect.right - rect.left) / scaleFactor;
|
|
16830
16907
|
const ph = (rect.bottom - rect.top) / scaleFactor;
|
|
16831
16908
|
if (pw <= 0 || ph <= 0) {
|
|
@@ -17026,7 +17103,7 @@ var hostConfig = {
|
|
|
17026
17103
|
},
|
|
17027
17104
|
hideInstance(instance) {
|
|
17028
17105
|
if (instance.hwnd !== null)
|
|
17029
|
-
|
|
17106
|
+
ShowWindow(
|
|
17030
17107
|
instance.hwnd,
|
|
17031
17108
|
0
|
|
17032
17109
|
/* ShowWindowCmd.HIDE */
|
|
@@ -17034,7 +17111,7 @@ var hostConfig = {
|
|
|
17034
17111
|
},
|
|
17035
17112
|
hideTextInstance(instance) {
|
|
17036
17113
|
if (instance.hwnd !== null)
|
|
17037
|
-
|
|
17114
|
+
ShowWindow(
|
|
17038
17115
|
instance.hwnd,
|
|
17039
17116
|
0
|
|
17040
17117
|
/* ShowWindowCmd.HIDE */
|
|
@@ -17042,7 +17119,7 @@ var hostConfig = {
|
|
|
17042
17119
|
},
|
|
17043
17120
|
unhideInstance(instance, _props) {
|
|
17044
17121
|
if (instance.hwnd !== null)
|
|
17045
|
-
|
|
17122
|
+
ShowWindow(
|
|
17046
17123
|
instance.hwnd,
|
|
17047
17124
|
5
|
|
17048
17125
|
/* ShowWindowCmd.SHOW */
|
|
@@ -17050,7 +17127,7 @@ var hostConfig = {
|
|
|
17050
17127
|
},
|
|
17051
17128
|
unhideTextInstance(instance, _text) {
|
|
17052
17129
|
if (instance.hwnd !== null)
|
|
17053
|
-
|
|
17130
|
+
ShowWindow(
|
|
17054
17131
|
instance.hwnd,
|
|
17055
17132
|
5
|
|
17056
17133
|
/* ShowWindowCmd.SHOW */
|
|
@@ -17297,11 +17374,10 @@ var DateTimePicker = (0, import_react5.forwardRef)(function DateTimePicker2({ va
|
|
|
17297
17374
|
if (!h)
|
|
17298
17375
|
return;
|
|
17299
17376
|
InvalidateRect(h, NULL, 1);
|
|
17300
|
-
const cr =
|
|
17301
|
-
if (cr) {
|
|
17302
|
-
const
|
|
17303
|
-
|
|
17304
|
-
gui6.SendMessage(h, 5, 0, hh << 16 | w);
|
|
17377
|
+
const cr = RECT.alloc();
|
|
17378
|
+
if (GetClientRect(h, cr.ptr)) {
|
|
17379
|
+
const { left, top, right, bottom } = RECT.decode(cr);
|
|
17380
|
+
gui6.SendMessage(h, 5, 0, bottom - top << 16 | right - left);
|
|
17305
17381
|
}
|
|
17306
17382
|
}, []);
|
|
17307
17383
|
return (0, import_jsx_runtime4.jsx)("w", { type: "STATIC", ws: 268435456 | 33554432, style: { ...style, flexDirection: "column", alignItems: "stretch" }, ref, onEvent: (e) => {
|
|
@@ -17362,7 +17438,10 @@ var Input = (0, import_react6.forwardRef)(({ value: controlledValue, defaultValu
|
|
|
17362
17438
|
const h = inputRef.current;
|
|
17363
17439
|
if (!h)
|
|
17364
17440
|
return;
|
|
17365
|
-
const
|
|
17441
|
+
const cap = GetWindowTextLength(h) + 1;
|
|
17442
|
+
const buf = WCHAR.alloc(cap);
|
|
17443
|
+
GetWindowText(h, buf, cap);
|
|
17444
|
+
const newText = WCHAR.decode(buf);
|
|
17366
17445
|
if (!isControlled)
|
|
17367
17446
|
setInternalValue(newText);
|
|
17368
17447
|
onChange?.(newText);
|
|
@@ -17450,15 +17529,58 @@ var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
|
|
|
17450
17529
|
var import_react9 = __toESM(require_react(), 1);
|
|
17451
17530
|
import * as gui9 from "gui";
|
|
17452
17531
|
import * as ffi3 from "ffi";
|
|
17532
|
+
|
|
17533
|
+
// _build/lib/bitmap.js
|
|
17534
|
+
function createBitmapFromPixels(width, height, pixels) {
|
|
17535
|
+
if (width <= 0 || height <= 0)
|
|
17536
|
+
return NULL;
|
|
17537
|
+
const len = width * height * 4;
|
|
17538
|
+
if (pixels.byteLength < len)
|
|
17539
|
+
return NULL;
|
|
17540
|
+
const bi = BITMAPINFOHEADER.encode({
|
|
17541
|
+
biSize: BITMAPINFOHEADER.size,
|
|
17542
|
+
biWidth: width,
|
|
17543
|
+
biHeight: -height,
|
|
17544
|
+
biPlanes: 1,
|
|
17545
|
+
biBitCount: 32
|
|
17546
|
+
});
|
|
17547
|
+
const hbm = CreateDIBSection(NULL, bi.ptr, 0, NULL, NULL, 0);
|
|
17548
|
+
if (!hbm)
|
|
17549
|
+
return NULL;
|
|
17550
|
+
const src = new PtrArrayBuffer(len);
|
|
17551
|
+
new Uint8Array(src).set(new Uint8Array(pixels, 0, len));
|
|
17552
|
+
if (SetDIBits(
|
|
17553
|
+
NULL,
|
|
17554
|
+
hbm,
|
|
17555
|
+
0,
|
|
17556
|
+
height,
|
|
17557
|
+
src,
|
|
17558
|
+
bi.ptr,
|
|
17559
|
+
0
|
|
17560
|
+
/* ColorUse.RGB_COLORS */
|
|
17561
|
+
) !== height) {
|
|
17562
|
+
DeleteObject(hbm);
|
|
17563
|
+
return NULL;
|
|
17564
|
+
}
|
|
17565
|
+
return hbm;
|
|
17566
|
+
}
|
|
17567
|
+
|
|
17568
|
+
// _build/lib/windows/comctl32.js
|
|
17569
|
+
var b3 = (name, sig) => bind("comctl32.dll", name, sig);
|
|
17570
|
+
var ImageListCreate = /* @__PURE__ */ b3("ImageList_Create", "i32 i32 u32 i32 i32 -> <HIMAGELIST>ptr");
|
|
17571
|
+
var ImageListAdd = /* @__PURE__ */ b3("ImageList_Add", "<HIMAGELIST>ptr <HGDIOBJ>ptr <HGDIOBJ>ptr -> i32");
|
|
17572
|
+
var ImageListDestroy = /* @__PURE__ */ b3("ImageList_Destroy", "<HIMAGELIST>ptr -> i32");
|
|
17573
|
+
|
|
17574
|
+
// _build/lib/react-qw/components/ListView.js
|
|
17453
17575
|
function makeColorBlock(size, bgra) {
|
|
17454
17576
|
const n = size * size;
|
|
17455
17577
|
const buf = new ArrayBuffer(n * 4);
|
|
17456
|
-
const
|
|
17578
|
+
const b7 = new Uint8Array(buf);
|
|
17457
17579
|
for (let i = 0; i < n; i++) {
|
|
17458
|
-
|
|
17459
|
-
|
|
17460
|
-
|
|
17461
|
-
|
|
17580
|
+
b7[i * 4] = bgra & 255;
|
|
17581
|
+
b7[i * 4 + 1] = bgra >> 8 & 255;
|
|
17582
|
+
b7[i * 4 + 2] = bgra >> 16 & 255;
|
|
17583
|
+
b7[i * 4 + 3] = 255;
|
|
17462
17584
|
}
|
|
17463
17585
|
return buf;
|
|
17464
17586
|
}
|
|
@@ -17551,7 +17673,7 @@ function resolveCellStyle(columns2, data2, row, colIndex) {
|
|
|
17551
17673
|
}
|
|
17552
17674
|
function makeLVItem(i, sub, text, image) {
|
|
17553
17675
|
const textBuf = WCHAR.encode(text);
|
|
17554
|
-
const
|
|
17676
|
+
const b7 = LVITEMW.encode({
|
|
17555
17677
|
mask: 1 | (image !== void 0 ? 2 : 0),
|
|
17556
17678
|
iItem: i,
|
|
17557
17679
|
iSubItem: sub,
|
|
@@ -17568,32 +17690,32 @@ function makeLVItem(i, sub, text, image) {
|
|
|
17568
17690
|
piColFmt: 0,
|
|
17569
17691
|
iGroup: 0
|
|
17570
17692
|
});
|
|
17571
|
-
|
|
17572
|
-
return
|
|
17693
|
+
b7.__textBuf = textBuf;
|
|
17694
|
+
return b7;
|
|
17573
17695
|
}
|
|
17574
17696
|
var ListView = (0, import_react9.forwardRef)(function ListViewInner({ columns: columns2, data: data2, style, icons: icons2, iconSize, getIcon }, ref) {
|
|
17575
17697
|
const lvRef = (0, import_react9.useRef)(null);
|
|
17576
|
-
const iconListRef = (0, import_react9.useRef)(
|
|
17698
|
+
const iconListRef = (0, import_react9.useRef)(NULL);
|
|
17577
17699
|
(0, import_react9.useEffect)(() => {
|
|
17578
17700
|
const h = lvRef.current;
|
|
17579
17701
|
if (!h)
|
|
17580
17702
|
return;
|
|
17581
17703
|
const il = iconListRef.current;
|
|
17582
|
-
iconListRef.current =
|
|
17704
|
+
iconListRef.current = NULL;
|
|
17583
17705
|
if (il) {
|
|
17584
17706
|
gui9.SendMessage(h, 4099, 1, 0);
|
|
17585
|
-
|
|
17707
|
+
ImageListDestroy(il);
|
|
17586
17708
|
}
|
|
17587
17709
|
if (!icons2 || icons2.length === 0)
|
|
17588
17710
|
return;
|
|
17589
17711
|
const size = iconSize ?? 32;
|
|
17590
|
-
const img =
|
|
17712
|
+
const img = ImageListCreate(size, size, 32, icons2.length, 1);
|
|
17591
17713
|
if (!img)
|
|
17592
17714
|
return;
|
|
17593
17715
|
for (const p of icons2) {
|
|
17594
|
-
const hbm =
|
|
17716
|
+
const hbm = createBitmapFromPixels(size, size, p);
|
|
17595
17717
|
if (hbm) {
|
|
17596
|
-
|
|
17718
|
+
ImageListAdd(img, hbm, NULL);
|
|
17597
17719
|
DeleteObject(hbm);
|
|
17598
17720
|
}
|
|
17599
17721
|
}
|
|
@@ -17774,22 +17896,19 @@ var RadioButton = (0, import_react11.forwardRef)(({ checked: controlledChecked,
|
|
|
17774
17896
|
// _build/lib/react-qw/components/ScrollView.js
|
|
17775
17897
|
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
17776
17898
|
var import_react12 = __toESM(require_react(), 1);
|
|
17777
|
-
import * as gui12 from "gui";
|
|
17778
17899
|
var ScrollView = (0, import_react12.forwardRef)(({ children, style, contentWidth, contentHeight }, ref) => {
|
|
17779
17900
|
const svRef = (0, import_react12.useRef)(null);
|
|
17780
17901
|
const contentRef = (0, import_react12.useRef)(null);
|
|
17781
17902
|
const scrollXRef = (0, import_react12.useRef)(0);
|
|
17782
17903
|
const scrollYRef = (0, import_react12.useRef)(0);
|
|
17783
17904
|
function updateScroll(sv, content) {
|
|
17784
|
-
const
|
|
17785
|
-
if (!
|
|
17905
|
+
const svBuf = RECT.alloc();
|
|
17906
|
+
if (!GetClientRect(sv, svBuf.ptr))
|
|
17786
17907
|
return;
|
|
17787
|
-
const
|
|
17788
|
-
const
|
|
17789
|
-
const
|
|
17790
|
-
const scale =
|
|
17791
|
-
if (hdc)
|
|
17792
|
-
ReleaseDC(NULL, hdc);
|
|
17908
|
+
const { left, top, right, bottom } = RECT.decode(svBuf);
|
|
17909
|
+
const svW = right - left;
|
|
17910
|
+
const svH = bottom - top;
|
|
17911
|
+
const scale = getScaleFactor();
|
|
17793
17912
|
const natW = Math.round((contentWidth ?? svW / scale) * scale);
|
|
17794
17913
|
const natH = Math.round((contentHeight ?? svH / scale) * scale);
|
|
17795
17914
|
scrollXRef.current = Math.max(0, Math.min(scrollXRef.current, natW - svW));
|
|
@@ -17806,14 +17925,28 @@ var ScrollView = (0, import_react12.forwardRef)(({ children, style, contentWidth
|
|
|
17806
17925
|
);
|
|
17807
17926
|
forceFlexLayout(content);
|
|
17808
17927
|
if (natW > svW) {
|
|
17809
|
-
|
|
17928
|
+
SetScrollInfo(sv, 0, {
|
|
17929
|
+
cbSize: SCROLLINFO.size,
|
|
17930
|
+
fMask: 1 | 2 | 4,
|
|
17931
|
+
nMin: 0,
|
|
17932
|
+
nMax: natW - 1,
|
|
17933
|
+
nPage: svW,
|
|
17934
|
+
nPos: scrollXRef.current
|
|
17935
|
+
}, 1);
|
|
17810
17936
|
ShowScrollBar(sv, 0, 1);
|
|
17811
17937
|
} else {
|
|
17812
17938
|
scrollXRef.current = 0;
|
|
17813
17939
|
ShowScrollBar(sv, 0, 0);
|
|
17814
17940
|
}
|
|
17815
17941
|
if (natH > svH) {
|
|
17816
|
-
|
|
17942
|
+
SetScrollInfo(sv, 1, {
|
|
17943
|
+
cbSize: SCROLLINFO.size,
|
|
17944
|
+
fMask: 1 | 2 | 4,
|
|
17945
|
+
nMin: 0,
|
|
17946
|
+
nMax: natH - 1,
|
|
17947
|
+
nPage: svH,
|
|
17948
|
+
nPos: scrollYRef.current
|
|
17949
|
+
}, 1);
|
|
17817
17950
|
ShowScrollBar(sv, 1, 1);
|
|
17818
17951
|
} else {
|
|
17819
17952
|
scrollYRef.current = 0;
|
|
@@ -17843,15 +17976,21 @@ var ScrollView = (0, import_react12.forwardRef)(({ children, style, contentWidth
|
|
|
17843
17976
|
1 | 4
|
|
17844
17977
|
/* SetWindowPosFlag.SWP_NOZORDER */
|
|
17845
17978
|
);
|
|
17846
|
-
|
|
17979
|
+
SetScrollInfo(sv, bar, { cbSize: SCROLLINFO.size, fMask: 4, nPos: newPos }, 1);
|
|
17847
17980
|
}
|
|
17848
17981
|
function handleScroll(e, bar) {
|
|
17849
17982
|
const sv = svRef.current;
|
|
17850
17983
|
const content = contentRef.current;
|
|
17851
17984
|
if (!sv || !content)
|
|
17852
17985
|
return;
|
|
17853
|
-
const
|
|
17854
|
-
|
|
17986
|
+
const si = SCROLLINFO.encode({
|
|
17987
|
+
cbSize: SCROLLINFO.size,
|
|
17988
|
+
fMask: 23
|
|
17989
|
+
/* ScrollInfoFlag.ALL */
|
|
17990
|
+
});
|
|
17991
|
+
GetScrollInfo(sv, bar, si.ptr);
|
|
17992
|
+
const info = SCROLLINFO.decode(si);
|
|
17993
|
+
const maxPos = info.nMax - info.nPage + 1;
|
|
17855
17994
|
const code = e.wParam & 65535;
|
|
17856
17995
|
const ref_ = bar === 1 ? scrollYRef : scrollXRef;
|
|
17857
17996
|
let newPos = ref_.current;
|
|
@@ -17862,9 +18001,9 @@ var ScrollView = (0, import_react12.forwardRef)(({ children, style, contentWidth
|
|
|
17862
18001
|
else if (code === 1)
|
|
17863
18002
|
newPos += 20;
|
|
17864
18003
|
else if (code === 2)
|
|
17865
|
-
newPos -= info.
|
|
18004
|
+
newPos -= info.nPage;
|
|
17866
18005
|
else if (code === 3)
|
|
17867
|
-
newPos += info.
|
|
18006
|
+
newPos += info.nPage;
|
|
17868
18007
|
else
|
|
17869
18008
|
return;
|
|
17870
18009
|
newPos = Math.max(0, Math.min(maxPos, newPos));
|
|
@@ -17884,8 +18023,14 @@ var ScrollView = (0, import_react12.forwardRef)(({ children, style, contentWidth
|
|
|
17884
18023
|
if (!isHorz && contentHeight === void 0)
|
|
17885
18024
|
return;
|
|
17886
18025
|
const bar = isHorz ? 0 : 1;
|
|
17887
|
-
const
|
|
17888
|
-
|
|
18026
|
+
const si = SCROLLINFO.encode({
|
|
18027
|
+
cbSize: SCROLLINFO.size,
|
|
18028
|
+
fMask: 23
|
|
18029
|
+
/* ScrollInfoFlag.ALL */
|
|
18030
|
+
});
|
|
18031
|
+
GetScrollInfo(sv, bar, si.ptr);
|
|
18032
|
+
const info = SCROLLINFO.decode(si);
|
|
18033
|
+
const maxPos = info.nMax - info.nPage + 1;
|
|
17889
18034
|
const ref_ = isHorz ? scrollXRef : scrollYRef;
|
|
17890
18035
|
let newPos = ref_.current + dy;
|
|
17891
18036
|
newPos = Math.max(0, Math.min(maxPos, newPos));
|
|
@@ -17933,7 +18078,7 @@ var ScrollView = (0, import_react12.forwardRef)(({ children, style, contentWidth
|
|
|
17933
18078
|
// _build/lib/react-qw/components/Slider.js
|
|
17934
18079
|
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
17935
18080
|
var import_react13 = __toESM(require_react(), 1);
|
|
17936
|
-
import * as
|
|
18081
|
+
import * as gui12 from "gui";
|
|
17937
18082
|
var Slider = (0, import_react13.forwardRef)(({ value, onChange, min = 0, max = 100, vertical = false, disabled, style }, ref) => {
|
|
17938
18083
|
const wrapperRef = (0, import_react13.useRef)(null);
|
|
17939
18084
|
const sliderRef = (0, import_react13.useRef)(null);
|
|
@@ -17942,14 +18087,14 @@ var Slider = (0, import_react13.forwardRef)(({ value, onChange, min = 0, max = 1
|
|
|
17942
18087
|
if (!h)
|
|
17943
18088
|
return;
|
|
17944
18089
|
const lParam = min & 65535 | (max & 65535) << 16;
|
|
17945
|
-
|
|
17946
|
-
|
|
18090
|
+
gui12.SendMessage(h, 1030, 0, lParam);
|
|
18091
|
+
gui12.SendMessage(h, 1029, 1, value);
|
|
17947
18092
|
}, [min, max]);
|
|
17948
18093
|
(0, import_react13.useEffect)(() => {
|
|
17949
18094
|
const h = sliderRef.current;
|
|
17950
18095
|
if (!h)
|
|
17951
18096
|
return;
|
|
17952
|
-
|
|
18097
|
+
gui12.SendMessage(h, 1029, 1, value);
|
|
17953
18098
|
}, [value]);
|
|
17954
18099
|
const tbStyle = 268435456 | 65536 | 1 | (vertical ? 2 : 0);
|
|
17955
18100
|
return (0, import_jsx_runtime12.jsx)("w", { type: "STATIC", ws: 268435456 | 33554432, style, ref: (h) => {
|
|
@@ -17966,7 +18111,7 @@ var Slider = (0, import_react13.forwardRef)(({ value, onChange, min = 0, max = 1
|
|
|
17966
18111
|
const h = sliderRef.current;
|
|
17967
18112
|
if (!h)
|
|
17968
18113
|
return 0;
|
|
17969
|
-
const pos =
|
|
18114
|
+
const pos = gui12.SendMessage(h, 1024, 0, 0);
|
|
17970
18115
|
onChange?.(pos);
|
|
17971
18116
|
return 0;
|
|
17972
18117
|
}
|
|
@@ -17979,7 +18124,7 @@ var Slider = (0, import_react13.forwardRef)(({ value, onChange, min = 0, max = 1
|
|
|
17979
18124
|
// _build/lib/react-qw/components/Tab.js
|
|
17980
18125
|
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
17981
18126
|
var import_react14 = __toESM(require_react(), 1);
|
|
17982
|
-
import * as
|
|
18127
|
+
import * as gui13 from "gui";
|
|
17983
18128
|
var Tab = (0, import_react14.forwardRef)(({ tabs, selectedIndex: controlledIndex, defaultSelectedIndex = 0, onChange, style }, ref) => {
|
|
17984
18129
|
const [internalIndex, setInternalIndex] = (0, import_react14.useState)(defaultSelectedIndex);
|
|
17985
18130
|
const isControlled = controlledIndex !== void 0;
|
|
@@ -17989,7 +18134,7 @@ var Tab = (0, import_react14.forwardRef)(({ tabs, selectedIndex: controlledIndex
|
|
|
17989
18134
|
const h = tabHwnd.current;
|
|
17990
18135
|
if (!h)
|
|
17991
18136
|
return;
|
|
17992
|
-
|
|
18137
|
+
gui13.SendMessage(h, 4873, 0, 0);
|
|
17993
18138
|
for (let i = 0; i < tabs.length; i++) {
|
|
17994
18139
|
const titleBuf = WCHAR.encode(tabs[i].title);
|
|
17995
18140
|
const tci = TCITEMW.encode({
|
|
@@ -18002,14 +18147,14 @@ var Tab = (0, import_react14.forwardRef)(({ tabs, selectedIndex: controlledIndex
|
|
|
18002
18147
|
lParam: 0
|
|
18003
18148
|
});
|
|
18004
18149
|
const tciPtr = tci.ptr;
|
|
18005
|
-
|
|
18150
|
+
gui13.SendMessage(h, 4926, i, tciPtr);
|
|
18006
18151
|
}
|
|
18007
|
-
|
|
18152
|
+
gui13.SendMessage(h, 4876, sel, 0);
|
|
18008
18153
|
}, [tabs]);
|
|
18009
18154
|
(0, import_react14.useEffect)(() => {
|
|
18010
18155
|
const h = tabHwnd.current;
|
|
18011
18156
|
if (h)
|
|
18012
|
-
|
|
18157
|
+
gui13.SendMessage(h, 4876, sel, 0);
|
|
18013
18158
|
}, [sel]);
|
|
18014
18159
|
return (0, import_jsx_runtime13.jsxs)("w", { type: "STATIC", ws: 268435456 | 33554432, style: { ...style, flexDirection: "column", alignItems: "stretch" }, ref, onEvent: (e) => {
|
|
18015
18160
|
if (e.msg === 78) {
|
|
@@ -18018,7 +18163,7 @@ var Tab = (0, import_react14.forwardRef)(({ tabs, selectedIndex: controlledIndex
|
|
|
18018
18163
|
return;
|
|
18019
18164
|
const code = nmCode(e.lParam);
|
|
18020
18165
|
if (code === -552 || code === -2) {
|
|
18021
|
-
const newSel =
|
|
18166
|
+
const newSel = gui13.SendMessage(h, 4875, 0, 0);
|
|
18022
18167
|
if (newSel !== sel) {
|
|
18023
18168
|
if (!isControlled)
|
|
18024
18169
|
setInternalIndex(newSel);
|
|
@@ -18031,12 +18176,12 @@ var Tab = (0, import_react14.forwardRef)(({ tabs, selectedIndex: controlledIndex
|
|
|
18031
18176
|
|
|
18032
18177
|
// _build/lib/react-qw/components/Tooltip.js
|
|
18033
18178
|
var import_react15 = __toESM(require_react(), 1);
|
|
18034
|
-
import * as
|
|
18179
|
+
import * as gui14 from "gui";
|
|
18035
18180
|
|
|
18036
18181
|
// _build/lib/react-qw/components/TreeView.js
|
|
18037
18182
|
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
|
|
18038
18183
|
var import_react16 = __toESM(require_react(), 1);
|
|
18039
|
-
import * as
|
|
18184
|
+
import * as gui15 from "gui";
|
|
18040
18185
|
function buildTvItem(textPtr, cChildren) {
|
|
18041
18186
|
let mask = 1;
|
|
18042
18187
|
if (cChildren > 0)
|
|
@@ -18061,20 +18206,20 @@ function insertItems(hTree, nodes, parentHandle, hItemMap, keyMap) {
|
|
|
18061
18206
|
const itemBuf = buildTvItem(textBuf.ptr, cChildren);
|
|
18062
18207
|
const item = TVITEM.decode(itemBuf);
|
|
18063
18208
|
const tvins = TVINSERTSTRUCT.encode({ hParent: parentHandle, hInsertAfter: -65536, item });
|
|
18064
|
-
const hItem =
|
|
18209
|
+
const hItem = gui15.SendMessage(hTree, 4402, 0, tvins.ptr);
|
|
18065
18210
|
hItemMap.set(hItem, node);
|
|
18066
18211
|
if (node.key)
|
|
18067
18212
|
keyMap.set(node.key, hItem);
|
|
18068
18213
|
if (node.children && node.children.length > 0) {
|
|
18069
18214
|
insertItems(hTree, node.children, hItem, hItemMap, keyMap);
|
|
18070
|
-
|
|
18215
|
+
gui15.SendMessage(hTree, 4354, 2, hItem);
|
|
18071
18216
|
}
|
|
18072
18217
|
}
|
|
18073
18218
|
}
|
|
18074
18219
|
function deleteAllItems(hTree) {
|
|
18075
|
-
const n =
|
|
18220
|
+
const n = gui15.SendMessage(hTree, 4357, 0, 0);
|
|
18076
18221
|
if (n > 0)
|
|
18077
|
-
|
|
18222
|
+
gui15.SendMessage(
|
|
18078
18223
|
hTree,
|
|
18079
18224
|
4353,
|
|
18080
18225
|
1,
|
|
@@ -18106,7 +18251,7 @@ var TreeView = (0, import_react16.forwardRef)(function TreeViewInner({ data: dat
|
|
|
18106
18251
|
const h = tvRef.current;
|
|
18107
18252
|
if (!h)
|
|
18108
18253
|
return;
|
|
18109
|
-
|
|
18254
|
+
gui15.SendMessage(
|
|
18110
18255
|
h,
|
|
18111
18256
|
4396,
|
|
18112
18257
|
0,
|
|
@@ -18122,7 +18267,7 @@ var TreeView = (0, import_react16.forwardRef)(function TreeViewInner({ data: dat
|
|
|
18122
18267
|
return;
|
|
18123
18268
|
const hItem = keyMapRef.current.get(selKey);
|
|
18124
18269
|
if (hItem !== void 0)
|
|
18125
|
-
|
|
18270
|
+
gui15.SendMessage(h, 4363, 9, hItem);
|
|
18126
18271
|
}, [selKey]);
|
|
18127
18272
|
return (0, import_jsx_runtime14.jsx)("w", { type: "STATIC", ws: 268435456 | 33554432, style: { ...style, flexDirection: "column", alignItems: "stretch" }, ref, onEvent: (e) => {
|
|
18128
18273
|
if (e.msg === 78) {
|
|
@@ -18131,7 +18276,7 @@ var TreeView = (0, import_react16.forwardRef)(function TreeViewInner({ data: dat
|
|
|
18131
18276
|
const h = tvRef.current;
|
|
18132
18277
|
if (!h)
|
|
18133
18278
|
return;
|
|
18134
|
-
const hCaret =
|
|
18279
|
+
const hCaret = gui15.SendMessage(h, 4362, 9, 0);
|
|
18135
18280
|
const node = hItemMapRef.current.get(hCaret) ?? null;
|
|
18136
18281
|
const key = node?.key ?? null;
|
|
18137
18282
|
if (!isControlled)
|
|
@@ -18149,24 +18294,24 @@ var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
|
18149
18294
|
var import_react17 = __toESM(require_react(), 1);
|
|
18150
18295
|
|
|
18151
18296
|
// _build/lib/windows/comdlg32.js
|
|
18152
|
-
var
|
|
18153
|
-
var GetOpenFileName = /* @__PURE__ */
|
|
18297
|
+
var b4 = (name, sig) => bind("comdlg32.dll", name, sig);
|
|
18298
|
+
var GetOpenFileName = /* @__PURE__ */ b4("GetOpenFileNameW", "<OPENFILENAMEW>ptr -> u32");
|
|
18154
18299
|
|
|
18155
18300
|
// _build/lib/windows/shell32.js
|
|
18156
|
-
var
|
|
18157
|
-
var SHBrowseForFolder = /* @__PURE__ */
|
|
18158
|
-
var SHGetPathFromIDList = /* @__PURE__ */
|
|
18301
|
+
var b5 = (name, sig, encoders) => bind("shell32.dll", name, sig, encoders);
|
|
18302
|
+
var SHBrowseForFolder = /* @__PURE__ */ b5("SHBrowseForFolderW", "<BROWSEINFOW>ptr -> <>ptr");
|
|
18303
|
+
var SHGetPathFromIDList = /* @__PURE__ */ b5("SHGetPathFromIDListW", "<>ptr <BYTE>ptr -> u32");
|
|
18159
18304
|
var Shell_NotifyIconGetRect = (() => {
|
|
18160
18305
|
try {
|
|
18161
|
-
return
|
|
18306
|
+
return b5("Shell_NotifyIconGetRect", "<NOTIFYICONIDENTIFIER>ptr <RECT>ptr -> i32", { NOTIFYICONIDENTIFIER });
|
|
18162
18307
|
} catch {
|
|
18163
18308
|
return null;
|
|
18164
18309
|
}
|
|
18165
18310
|
})();
|
|
18166
18311
|
|
|
18167
18312
|
// _build/lib/windows/ole32.js
|
|
18168
|
-
var
|
|
18169
|
-
var CoTaskMemFree = /* @__PURE__ */
|
|
18313
|
+
var b6 = (name, sig) => bind("ole32.dll", name, sig);
|
|
18314
|
+
var CoTaskMemFree = /* @__PURE__ */ b6("CoTaskMemFree", "<>ptr -> void");
|
|
18170
18315
|
|
|
18171
18316
|
// _build/lib/react-qw/components/PathPicker.js
|
|
18172
18317
|
function openFileDialog(owner, filter, title, multiple) {
|
|
@@ -18261,7 +18406,7 @@ var rootMap = /* @__PURE__ */ new Map();
|
|
|
18261
18406
|
function ensureDefaultClass() {
|
|
18262
18407
|
if (defaultClassRegistered)
|
|
18263
18408
|
return DEFAULT_CLASS;
|
|
18264
|
-
|
|
18409
|
+
gui16.RegisterClass(DEFAULT_CLASS, (hwnd, msg, wParam, lParam) => {
|
|
18265
18410
|
const entry = rootMap.get(hwnd);
|
|
18266
18411
|
if (msg === 2 && entry) {
|
|
18267
18412
|
rootMap.delete(hwnd);
|
|
@@ -18287,15 +18432,27 @@ function createRoot(container) {
|
|
|
18287
18432
|
const ws = (cfg.ws ?? 0) | 13565952;
|
|
18288
18433
|
const w = (cfg.width ?? 800) * scaleFactor;
|
|
18289
18434
|
const h = (cfg.height ?? 600) * scaleFactor;
|
|
18290
|
-
const [sw, sh] = [GetSystemMetrics(
|
|
18435
|
+
const [sw, sh] = [GetSystemMetrics(
|
|
18436
|
+
0
|
|
18437
|
+
/* SysMetrics.CXSCREEN */
|
|
18438
|
+
), GetSystemMetrics(
|
|
18439
|
+
1
|
|
18440
|
+
/* SysMetrics.CYSCREEN */
|
|
18441
|
+
)];
|
|
18291
18442
|
const x = cfg.x === void 0 ? (sw - w) / 2 | 0 : cfg.x === -2147483648 ? -2147483648 : cfg.x * scaleFactor;
|
|
18292
18443
|
const y = cfg.y === void 0 ? (sh - h) / 2 | 0 : cfg.y === -2147483648 ? -2147483648 : cfg.y * scaleFactor;
|
|
18293
|
-
const hwin =
|
|
18444
|
+
const hwin = gui16.CreateWindow(className, cfg.text || "", ws, x, y, w, h, null, null);
|
|
18294
18445
|
if (!hwin)
|
|
18295
18446
|
throw new Error("CreateWindow failed");
|
|
18296
18447
|
hwnd = hwin;
|
|
18297
|
-
if (!cfg.noShowWindow)
|
|
18298
|
-
|
|
18448
|
+
if (!cfg.noShowWindow) {
|
|
18449
|
+
ShowWindow(
|
|
18450
|
+
hwnd,
|
|
18451
|
+
1
|
|
18452
|
+
/* ShowWindowCmd.SHOWNORMAL */
|
|
18453
|
+
);
|
|
18454
|
+
UpdateWindow(hwnd);
|
|
18455
|
+
}
|
|
18299
18456
|
} else {
|
|
18300
18457
|
hwnd = container;
|
|
18301
18458
|
}
|