quickwin 2.3.1 → 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 +15 -0
- package/enum_map.d.ts +3 -0
- package/examples/PdfCanvas.js +1 -1
- package/examples/PdfCanvas.tsx +2 -2
- package/examples/execd/main.js +334 -188
- 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/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
|
@@ -6,13 +6,16 @@ import {
|
|
|
6
6
|
ListView, type Column, ListBox, ScrollView, RadioButton, Slider,
|
|
7
7
|
TreeView, type TreeNode, DateTimePicker, Link, Tooltip, PathPicker,
|
|
8
8
|
} from '../lib/react-qw/index.js'
|
|
9
|
-
import { WindowStyle, WmMsg } from '../constants'
|
|
9
|
+
import { ShowWindowCmd, WindowStyle, WmMsg } from '../constants'
|
|
10
|
+
import { GetClientRect, PostQuitMessage, ShowWindow } from '../lib/windows/user32.js'
|
|
11
|
+
import { getScaleFactor } from '../lib/dpi.js'
|
|
12
|
+
import { RECT } from '../lib/windows/structs.js'
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
gui.RegisterClass('Gallery', (hwnd, msg, wParam, lParam) => {
|
|
13
16
|
if (!hwnd) return gui.DefWindowProc(hwnd, msg, wParam, lParam)
|
|
14
17
|
if (msg === WmMsg.DESTROY) {
|
|
15
|
-
|
|
18
|
+
PostQuitMessage(0)
|
|
16
19
|
return 0
|
|
17
20
|
}
|
|
18
21
|
return gui.DefWindowProc(hwnd, msg, wParam, lParam)
|
|
@@ -275,12 +278,14 @@ const hwnd = gui.CreateWindow(
|
|
|
275
278
|
)
|
|
276
279
|
|
|
277
280
|
if (hwnd) {
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
const
|
|
281
|
-
const
|
|
281
|
+
const crBuf = RECT.alloc()
|
|
282
|
+
if (!GetClientRect(hwnd, crBuf.ptr)) throw new Error('gallery: GetClientRect failed')
|
|
283
|
+
const { left, top, right, bottom } = RECT.decode(crBuf)
|
|
284
|
+
const scale = getScaleFactor()
|
|
285
|
+
const svW = Math.round((right - left) / scale)
|
|
286
|
+
const svH = Math.round((bottom - top) / scale)
|
|
282
287
|
render(<App svW={svW} svH={svH} />, hwnd)
|
|
283
288
|
setTimeout(() => {
|
|
284
|
-
|
|
289
|
+
ShowWindow(hwnd, ShowWindowCmd.SHOWNORMAL)
|
|
285
290
|
}, 0)
|
|
286
291
|
}
|