quickwin 2.1.1 → 2.3.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 +9 -9
- package/README.md +9 -9
- package/constants.ts +1063 -0
- package/enum_map.d.ts +129 -0
- package/examples/PdfCanvas.js +2 -2
- package/examples/PdfCanvas.tsx +3 -2
- package/examples/{exec_server.js → execd/main.js} +1114 -287
- package/examples/execd/tray.js +192 -0
- package/examples/execd/worker.js +122 -0
- package/examples/pdf_preview2.js +46 -46
- package/examples/pdf_preview2.ts +55 -54
- package/examples/pdf_viewer.js +134 -130
- package/examples/pdf_viewer.tsx +6 -5
- package/examples/test_gallery.js +135 -131
- package/examples/test_gallery.tsx +9 -8
- package/examples/test_react_lazy.js +130 -128
- package/examples/test_react_lazy.tsx +7 -6
- package/examples/test_react_listbox.js +130 -128
- package/examples/test_react_listbox.tsx +8 -7
- package/examples/test_root_window.js +130 -128
- package/examples/test_root_window.tsx +5 -5
- package/examples/test_tab.js +130 -128
- package/examples/test_tab.tsx +7 -6
- package/examples/tray_demo.js +8 -8
- package/examples/tray_demo.tsx +9 -8
- package/lib/dumpRects.js +2 -2
- package/lib/dumpRects.ts +3 -2
- package/lib/fetch.js +15 -15
- package/lib/fetch.ts +16 -15
- package/lib/ffi/bind.js +3 -3
- package/lib/ffi/bind.ts +3 -3
- package/lib/ffi/ctype.ts +3 -1
- package/lib/ffi/struct.js +23 -7
- package/lib/ffi/struct.ts +50 -23
- package/lib/http-server.js +5 -5
- package/lib/http-server.ts +6 -5
- package/lib/react-qw/components/Button.js +2 -2
- package/lib/react-qw/components/CheckBox.js +4 -4
- package/lib/react-qw/components/ComboBox.js +10 -10
- package/lib/react-qw/components/DateTimePicker.js +12 -12
- package/lib/react-qw/components/Input.js +7 -7
- package/lib/react-qw/components/Link.js +4 -4
- package/lib/react-qw/components/ListBox.js +12 -12
- package/lib/react-qw/components/ListView.js +35 -35
- package/lib/react-qw/components/PathPicker.js +3 -3
- package/lib/react-qw/components/ProgressBar.js +4 -4
- package/lib/react-qw/components/RadioButton.js +4 -4
- package/lib/react-qw/components/ScrollView.js +28 -28
- package/lib/react-qw/components/Slider.js +11 -11
- package/lib/react-qw/components/Tab.js +10 -10
- package/lib/react-qw/components/Tooltip.js +8 -8
- package/lib/react-qw/components/TreeView.js +20 -20
- package/lib/react-qw/index.js +5 -5
- package/lib/react-qw/index.ts +6 -5
- package/lib/react-qw/props.js +4 -4
- package/lib/react-qw/props.ts +5 -4
- package/lib/react-qw/reconciler.js +10 -10
- package/lib/react-qw/reconciler.ts +11 -10
- package/lib/text-measure.js +3 -3
- package/lib/text-measure.ts +4 -3
- package/lib/websocket.js +17 -17
- package/lib/websocket.ts +18 -17
- package/lib/windows/advapi32.js +7 -7
- package/lib/windows/advapi32.ts +7 -7
- package/lib/windows/gdi32.js +17 -17
- package/lib/windows/gdi32.ts +17 -17
- package/lib/windows/kernel32.js +41 -2
- package/lib/windows/kernel32.ts +45 -2
- package/lib/windows/shell32.js +24 -3
- package/lib/windows/shell32.ts +27 -4
- package/lib/windows/structs.js +230 -92
- package/lib/windows/structs.ts +278 -92
- package/lib/windows/user32.js +18 -6
- package/lib/windows/user32.ts +18 -6
- package/lib/windows/winspool.js +3 -3
- package/lib/windows/winspool.ts +3 -3
- package/package.json +4 -3
- package/quickwin.d.ts +32 -10
- 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/test_ffi_bind.js +12 -10
- package/test/test_ffi_bind.ts +14 -12
- package/test/test_ffi_struct.js +60 -26
- package/test/test_ffi_struct.ts +58 -28
- package/test/test_ffi_windows.js +1 -1
- package/test/test_ffi_windows.ts +1 -1
- package/test/test_files.js +7 -7
- package/test/test_files.ts +8 -8
- package/test/test_gdi_draw.js +51 -51
- package/test/test_gdi_draw.ts +57 -57
- package/test/test_http_server.js +3 -3
- package/test/test_http_server.ts +4 -3
- package/test/test_ipv6.js +3 -3
- package/test/test_ipv6.ts +4 -3
- package/test/test_net_event.js +3 -3
- package/test/test_net_event.ts +4 -3
- package/test/test_printer.js +4 -4
- package/test/test_printer.ts +5 -5
- package/test/test_react_complex.js +132 -130
- package/test/test_react_counter.js +130 -128
- package/test/test_react_flex.js +132 -130
- package/test/test_react_hidden.js +130 -128
- package/test/test_react_listview_link.js +131 -129
- package/test/test_react_notify.js +148 -146
- package/test/test_react_render.js +130 -128
- package/test/test_registry.js +6 -6
- package/test/test_registry.ts +8 -8
- package/test/test_wolfssl_read.js +8 -8
- package/test/test_wolfssl_read.ts +9 -8
- package/examples/exec_server.tsx +0 -488
- package/examples/exec_server_worker.js +0 -395
- package/examples/exec_server_worker.ts +0 -417
- package/examples/setres.js +0 -79
- package/examples/setres.ts +0 -86
- package/quickwin_const.d.ts +0 -1037
package/enum_map.d.ts
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// Auto-generated by tools/gen_enum_map.sh from constants.ts. DO NOT EDIT.
|
|
2
|
+
// Regenerate with: make enum-map (run after regenerating constants.ts)
|
|
3
|
+
//
|
|
4
|
+
// EnumMap — token 枚举标注 ('u32@Name' / '<>ptr@Name') 的值域表:全局
|
|
5
|
+
// interface 声明合并(详见 lib/ffi/ctype.ts),用户可在自己的 .d.ts 里直接扩展。
|
|
6
|
+
interface EnumMap {
|
|
7
|
+
GetWindowCmd: import('./constants').GetWindowCmd
|
|
8
|
+
SetWindowPosFlag: import('./constants').SetWindowPosFlag
|
|
9
|
+
SetWindowPosHwnd: import('./constants').SetWindowPosHwnd
|
|
10
|
+
NotifyIconCmd: import('./constants').NotifyIconCmd
|
|
11
|
+
NotifyIconFlag: import('./constants').NotifyIconFlag
|
|
12
|
+
MenuFlag: import('./constants').MenuFlag
|
|
13
|
+
WindowStyle: import('./constants').WindowStyle
|
|
14
|
+
WmMsg: import('./constants').WmMsg
|
|
15
|
+
ScrollBar: import('./constants').ScrollBar
|
|
16
|
+
ScrollCmd: import('./constants').ScrollCmd
|
|
17
|
+
ScrollInfoFlag: import('./constants').ScrollInfoFlag
|
|
18
|
+
SysMetrics: import('./constants').SysMetrics
|
|
19
|
+
ButtonStyle: import('./constants').ButtonStyle
|
|
20
|
+
MouseKeyFlag: import('./constants').MouseKeyFlag
|
|
21
|
+
LbMsg: import('./constants').LbMsg
|
|
22
|
+
StaticStyle: import('./constants').StaticStyle
|
|
23
|
+
EditStyle: import('./constants').EditStyle
|
|
24
|
+
ComboBoxStyle: import('./constants').ComboBoxStyle
|
|
25
|
+
ListBoxStyle: import('./constants').ListBoxStyle
|
|
26
|
+
LbnCode: import('./constants').LbnCode
|
|
27
|
+
TabStyle: import('./constants').TabStyle
|
|
28
|
+
TcMsg: import('./constants').TcMsg
|
|
29
|
+
TcNotifyCode: import('./constants').TcNotifyCode
|
|
30
|
+
TcItemFlag: import('./constants').TcItemFlag
|
|
31
|
+
ListViewStyle: import('./constants').ListViewStyle
|
|
32
|
+
LvExStyle: import('./constants').LvExStyle
|
|
33
|
+
LvMsg: import('./constants').LvMsg
|
|
34
|
+
LvImageList: import('./constants').LvImageList
|
|
35
|
+
ImageListFlag: import('./constants').ImageListFlag
|
|
36
|
+
HitTest: import('./constants').HitTest
|
|
37
|
+
StandardCursor: import('./constants').StandardCursor
|
|
38
|
+
LvItemFlag: import('./constants').LvItemFlag
|
|
39
|
+
LvItemState: import('./constants').LvItemState
|
|
40
|
+
LvColumnMask: import('./constants').LvColumnMask
|
|
41
|
+
LvColumnFormat: import('./constants').LvColumnFormat
|
|
42
|
+
FontWeight: import('./constants').FontWeight
|
|
43
|
+
LvNavFlag: import('./constants').LvNavFlag
|
|
44
|
+
LvColumnWidthCmd: import('./constants').LvColumnWidthCmd
|
|
45
|
+
HdmMsg: import('./constants').HdmMsg
|
|
46
|
+
LvNotifyCode: import('./constants').LvNotifyCode
|
|
47
|
+
CustomDrawStage: import('./constants').CustomDrawStage
|
|
48
|
+
CustomDrawFlag: import('./constants').CustomDrawFlag
|
|
49
|
+
ShowWindowCmd: import('./constants').ShowWindowCmd
|
|
50
|
+
ButtonMsg: import('./constants').ButtonMsg
|
|
51
|
+
ButtonCheckState: import('./constants').ButtonCheckState
|
|
52
|
+
ButtonExtMsg: import('./constants').ButtonExtMsg
|
|
53
|
+
EditMsg: import('./constants').EditMsg
|
|
54
|
+
EditNotify: import('./constants').EditNotify
|
|
55
|
+
ComboBoxMsg: import('./constants').ComboBoxMsg
|
|
56
|
+
CbnCode: import('./constants').CbnCode
|
|
57
|
+
ProgressMsg: import('./constants').ProgressMsg
|
|
58
|
+
ProgressStyle: import('./constants').ProgressStyle
|
|
59
|
+
TrackBarStyle: import('./constants').TrackBarStyle
|
|
60
|
+
TbMsg: import('./constants').TbMsg
|
|
61
|
+
DtStyle: import('./constants').DtStyle
|
|
62
|
+
DtMsg: import('./constants').DtMsg
|
|
63
|
+
DtNotifyCode: import('./constants').DtNotifyCode
|
|
64
|
+
DtFlag: import('./constants').DtFlag
|
|
65
|
+
TreeViewStyle: import('./constants').TreeViewStyle
|
|
66
|
+
TvInsertAfter: import('./constants').TvInsertAfter
|
|
67
|
+
TvMsg: import('./constants').TvMsg
|
|
68
|
+
TvExStyle: import('./constants').TvExStyle
|
|
69
|
+
TvNotifyCode: import('./constants').TvNotifyCode
|
|
70
|
+
TvExpandCmd: import('./constants').TvExpandCmd
|
|
71
|
+
TvIfFlag: import('./constants').TvIfFlag
|
|
72
|
+
TvGnRelative: import('./constants').TvGnRelative
|
|
73
|
+
Gwlp: import('./constants').Gwlp
|
|
74
|
+
SysLinkMsg: import('./constants').SysLinkMsg
|
|
75
|
+
SysLinkNotifyCode: import('./constants').SysLinkNotifyCode
|
|
76
|
+
LinkStyle: import('./constants').LinkStyle
|
|
77
|
+
TtMsg: import('./constants').TtMsg
|
|
78
|
+
TooltipStyle: import('./constants').TooltipStyle
|
|
79
|
+
CreatePos: import('./constants').CreatePos
|
|
80
|
+
TtToolFlag: import('./constants').TtToolFlag
|
|
81
|
+
RasterOp: import('./constants').RasterOp
|
|
82
|
+
PenStyle: import('./constants').PenStyle
|
|
83
|
+
BackgroundMode: import('./constants').BackgroundMode
|
|
84
|
+
StockObject: import('./constants').StockObject
|
|
85
|
+
HatchStyle: import('./constants').HatchStyle
|
|
86
|
+
PolyFillMode: import('./constants').PolyFillMode
|
|
87
|
+
RasterMode: import('./constants').RasterMode
|
|
88
|
+
TextAlign: import('./constants').TextAlign
|
|
89
|
+
TextOutOptions: import('./constants').TextOutOptions
|
|
90
|
+
ArcDirection: import('./constants').ArcDirection
|
|
91
|
+
StretchBltMode: import('./constants').StretchBltMode
|
|
92
|
+
OpenFileNameFlag: import('./constants').OpenFileNameFlag
|
|
93
|
+
HKey: import('./constants').HKey
|
|
94
|
+
RegAccess: import('./constants').RegAccess
|
|
95
|
+
RegType: import('./constants').RegType
|
|
96
|
+
FileCreation: import('./constants').FileCreation
|
|
97
|
+
FileSeekFrom: import('./constants').FileSeekFrom
|
|
98
|
+
PrinterEnum: import('./constants').PrinterEnum
|
|
99
|
+
DeviceCap: import('./constants').DeviceCap
|
|
100
|
+
DevModeField: import('./constants').DevModeField
|
|
101
|
+
ChangeDisplayFlag: import('./constants').ChangeDisplayFlag
|
|
102
|
+
EnumDisplaySetting: import('./constants').EnumDisplaySetting
|
|
103
|
+
DisplayChangeResult: import('./constants').DisplayChangeResult
|
|
104
|
+
StaticMsg: import('./constants').StaticMsg
|
|
105
|
+
StaticStyleEx: import('./constants').StaticStyleEx
|
|
106
|
+
ImageType: import('./constants').ImageType
|
|
107
|
+
LoadImageFlag: import('./constants').LoadImageFlag
|
|
108
|
+
IDI: import('./constants').IDI
|
|
109
|
+
DrawTextFlag: import('./constants').DrawTextFlag
|
|
110
|
+
ProcessCreationFlag: import('./constants').ProcessCreationFlag
|
|
111
|
+
ErrorCode: import('./constants').ErrorCode
|
|
112
|
+
PowerBroadcast: import('./constants').PowerBroadcast
|
|
113
|
+
DevMode: import('./constants').DevMode
|
|
114
|
+
Guid: import('./constants').Guid
|
|
115
|
+
AddrFamily: import('./constants').AddrFamily
|
|
116
|
+
SockType: import('./constants').SockType
|
|
117
|
+
Protocol: import('./constants').Protocol
|
|
118
|
+
Shutdown: import('./constants').Shutdown
|
|
119
|
+
FdEvent: import('./constants').FdEvent
|
|
120
|
+
VerifyMode: import('./constants').VerifyMode
|
|
121
|
+
SniType: import('./constants').SniType
|
|
122
|
+
FileType: import('./constants').FileType
|
|
123
|
+
ReturnCode: import('./constants').ReturnCode
|
|
124
|
+
WolfsslErrorCode: import('./constants').WolfsslErrorCode
|
|
125
|
+
|
|
126
|
+
// 聚合消息枚举(脚本按 *Msg 后缀自动收集):SendMessage/DefWindowProc 的
|
|
127
|
+
// msg 位值域 = 窗口消息 ∪ 各控件消息;标志位组合、通知码不在此域。
|
|
128
|
+
AnyMsg: import('./constants').WmMsg | import('./constants').LbMsg | import('./constants').TcMsg | import('./constants').LvMsg | import('./constants').HdmMsg | import('./constants').ButtonMsg | import('./constants').ButtonExtMsg | import('./constants').EditMsg | import('./constants').ComboBoxMsg | import('./constants').ProgressMsg | import('./constants').TbMsg | import('./constants').DtMsg | import('./constants').TvMsg | import('./constants').SysLinkMsg | import('./constants').TtMsg | import('./constants').StaticMsg
|
|
129
|
+
}
|
package/examples/PdfCanvas.js
CHANGED
|
@@ -11,7 +11,7 @@ export const PdfCanvas = forwardRef(({ pixmap, style }, ref) => {
|
|
|
11
11
|
const canvasRef = useRef(null);
|
|
12
12
|
const pixmapRef = useRef(pixmap);
|
|
13
13
|
pixmapRef.current = pixmap;
|
|
14
|
-
return (_jsx("w", { type: "STATIC", ws: 268435456 /*
|
|
14
|
+
return (_jsx("w", { type: "STATIC", ws: 268435456 /* WindowStyle.VISIBLE */ | 33554432 /* WindowStyle.CLIPCHILDREN */, style: style, ref: (h) => {
|
|
15
15
|
canvasRef.current = h;
|
|
16
16
|
if (typeof ref === 'function')
|
|
17
17
|
ref(h);
|
|
@@ -21,7 +21,7 @@ export const PdfCanvas = forwardRef(({ pixmap, style }, ref) => {
|
|
|
21
21
|
const hwnd = e.hwnd;
|
|
22
22
|
if (e.msg === 0x14)
|
|
23
23
|
return 1;
|
|
24
|
-
if (e.msg === 15 /*
|
|
24
|
+
if (e.msg === 15 /* WmMsg.PAINT */) {
|
|
25
25
|
const pm = pixmapRef.current;
|
|
26
26
|
if (!pm)
|
|
27
27
|
return 0;
|
package/examples/PdfCanvas.tsx
CHANGED
|
@@ -5,6 +5,7 @@ import { GetDC, ReleaseDC } from '../lib/windows/user32.js'
|
|
|
5
5
|
import { SetDIBitsToDevice } from '../lib/windows/gdi32.js'
|
|
6
6
|
import { BITMAPINFOHEADER } from '../lib/windows/structs.js'
|
|
7
7
|
import type { WStyle } from '../lib/react-qw/jsx.d.ts'
|
|
8
|
+
import { WindowStyle, WmMsg } from '../constants'
|
|
8
9
|
|
|
9
10
|
function makeBitmapInfo(w: number, h: number) {
|
|
10
11
|
// biHeight 负 = 自顶向下(DIB 原点左上);biCompression 缺省 0 = BI_RGB 无压缩
|
|
@@ -24,7 +25,7 @@ export const PdfCanvas = forwardRef<gui.HWND, PdfCanvasProps>(
|
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
27
|
<w type="STATIC"
|
|
27
|
-
ws={
|
|
28
|
+
ws={WindowStyle.VISIBLE | WindowStyle.CLIPCHILDREN}
|
|
28
29
|
style={style}
|
|
29
30
|
ref={(h: gui.HWND) => {
|
|
30
31
|
canvasRef.current = h
|
|
@@ -34,7 +35,7 @@ export const PdfCanvas = forwardRef<gui.HWND, PdfCanvasProps>(
|
|
|
34
35
|
onEvent={(e) => {
|
|
35
36
|
const hwnd = e.hwnd
|
|
36
37
|
if (e.msg === 0x14) return 1
|
|
37
|
-
if (e.msg ===
|
|
38
|
+
if (e.msg === WmMsg.PAINT) {
|
|
38
39
|
const pm = pixmapRef.current
|
|
39
40
|
if (!pm) return 0
|
|
40
41
|
const hdc = GetDC(hwnd)
|