quickwin 2.2.0 → 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.
Files changed (111) hide show
  1. package/README.en.md +7 -7
  2. package/README.md +7 -7
  3. package/constants.ts +1063 -0
  4. package/enum_map.d.ts +129 -0
  5. package/examples/PdfCanvas.js +2 -2
  6. package/examples/PdfCanvas.tsx +3 -2
  7. package/examples/{execd.js → execd/main.js} +563 -122
  8. package/examples/execd/tray.js +192 -0
  9. package/examples/{execd_worker.js → execd/worker.js} +7 -7
  10. package/examples/pdf_preview2.js +46 -46
  11. package/examples/pdf_preview2.ts +55 -54
  12. package/examples/pdf_viewer.js +34 -19
  13. package/examples/pdf_viewer.tsx +6 -5
  14. package/examples/test_gallery.js +35 -20
  15. package/examples/test_gallery.tsx +9 -8
  16. package/examples/test_react_lazy.js +34 -19
  17. package/examples/test_react_lazy.tsx +7 -6
  18. package/examples/test_react_listbox.js +34 -19
  19. package/examples/test_react_listbox.tsx +8 -7
  20. package/examples/test_root_window.js +34 -19
  21. package/examples/test_root_window.tsx +5 -5
  22. package/examples/test_tab.js +34 -19
  23. package/examples/test_tab.tsx +7 -6
  24. package/examples/tray_demo.js +8 -8
  25. package/examples/tray_demo.tsx +9 -8
  26. package/lib/dumpRects.js +2 -2
  27. package/lib/dumpRects.ts +3 -2
  28. package/lib/fetch.js +15 -15
  29. package/lib/fetch.ts +16 -15
  30. package/lib/ffi/bind.js +3 -3
  31. package/lib/ffi/bind.ts +3 -3
  32. package/lib/http-server.js +4 -4
  33. package/lib/http-server.ts +5 -4
  34. package/lib/react-qw/components/Button.js +2 -2
  35. package/lib/react-qw/components/CheckBox.js +4 -4
  36. package/lib/react-qw/components/ComboBox.js +10 -10
  37. package/lib/react-qw/components/DateTimePicker.js +12 -12
  38. package/lib/react-qw/components/Input.js +7 -7
  39. package/lib/react-qw/components/Link.js +4 -4
  40. package/lib/react-qw/components/ListBox.js +12 -12
  41. package/lib/react-qw/components/ListView.js +35 -35
  42. package/lib/react-qw/components/PathPicker.js +3 -3
  43. package/lib/react-qw/components/ProgressBar.js +4 -4
  44. package/lib/react-qw/components/RadioButton.js +4 -4
  45. package/lib/react-qw/components/ScrollView.js +28 -28
  46. package/lib/react-qw/components/Slider.js +11 -11
  47. package/lib/react-qw/components/Tab.js +10 -10
  48. package/lib/react-qw/components/Tooltip.js +8 -8
  49. package/lib/react-qw/components/TreeView.js +20 -20
  50. package/lib/react-qw/index.js +5 -5
  51. package/lib/react-qw/index.ts +6 -5
  52. package/lib/react-qw/props.js +4 -4
  53. package/lib/react-qw/props.ts +5 -4
  54. package/lib/react-qw/reconciler.js +10 -10
  55. package/lib/react-qw/reconciler.ts +11 -10
  56. package/lib/text-measure.js +3 -3
  57. package/lib/text-measure.ts +4 -3
  58. package/lib/websocket.js +17 -17
  59. package/lib/websocket.ts +18 -17
  60. package/lib/windows/advapi32.js +7 -7
  61. package/lib/windows/advapi32.ts +7 -7
  62. package/lib/windows/gdi32.js +16 -16
  63. package/lib/windows/gdi32.ts +16 -16
  64. package/lib/windows/kernel32.js +41 -2
  65. package/lib/windows/kernel32.ts +45 -2
  66. package/lib/windows/shell32.js +24 -3
  67. package/lib/windows/shell32.ts +27 -4
  68. package/lib/windows/structs.js +54 -0
  69. package/lib/windows/structs.ts +63 -1
  70. package/lib/windows/user32.js +18 -6
  71. package/lib/windows/user32.ts +18 -6
  72. package/lib/windows/winspool.js +3 -3
  73. package/lib/windows/winspool.ts +3 -3
  74. package/package.json +4 -3
  75. package/quickwin.d.ts +32 -10
  76. package/qwin-nowasm-x86.exe +0 -0
  77. package/qwin-nowasm.exe +0 -0
  78. package/qwin-x86.exe +0 -0
  79. package/qwin.exe +0 -0
  80. package/test/test_ffi_bind.js +7 -7
  81. package/test/test_ffi_bind.ts +8 -8
  82. package/test/test_ffi_struct.js +2 -2
  83. package/test/test_ffi_struct.ts +3 -3
  84. package/test/test_ffi_windows.js +1 -1
  85. package/test/test_ffi_windows.ts +1 -1
  86. package/test/test_files.js +7 -7
  87. package/test/test_files.ts +8 -8
  88. package/test/test_gdi_draw.js +51 -51
  89. package/test/test_gdi_draw.ts +57 -57
  90. package/test/test_http_server.js +3 -3
  91. package/test/test_http_server.ts +4 -3
  92. package/test/test_ipv6.js +3 -3
  93. package/test/test_ipv6.ts +4 -3
  94. package/test/test_net_event.js +3 -3
  95. package/test/test_net_event.ts +4 -3
  96. package/test/test_printer.js +4 -4
  97. package/test/test_printer.ts +5 -5
  98. package/test/test_react_complex.js +36 -21
  99. package/test/test_react_counter.js +34 -19
  100. package/test/test_react_flex.js +36 -21
  101. package/test/test_react_hidden.js +34 -19
  102. package/test/test_react_listview_link.js +35 -20
  103. package/test/test_react_notify.js +52 -37
  104. package/test/test_react_render.js +34 -19
  105. package/test/test_registry.js +6 -6
  106. package/test/test_registry.ts +8 -8
  107. package/test/test_wolfssl_read.js +8 -8
  108. package/test/test_wolfssl_read.ts +9 -8
  109. package/examples/execd.tsx +0 -798
  110. package/examples/execd_worker.ts +0 -127
  111. package/quickwin_const.d.ts +0 -1063
@@ -3,6 +3,7 @@ import * as wolfssl from 'wolfssl'
3
3
  import * as os from 'os'
4
4
  import * as std from 'std'
5
5
  import { Tester } from './test_helper.js'
6
+ import { FdEvent, ReturnCode, SniType, VerifyMode } from '../constants'
6
7
 
7
8
  const HTTPS_PORT = 18924
8
9
  const WANT_READ = 2
@@ -110,7 +111,7 @@ export const suite = {
110
111
  sock.set_on_event(s, (event: { lNetworkEvents: number; iErrorCode: number[] }) => {
111
112
  if (done) return
112
113
 
113
- if (event.lNetworkEvents & sock.FdEvent.FD_CONNECT) {
114
+ if (event.lNetworkEvents & FdEvent.FD_CONNECT) {
114
115
  if (event.iErrorCode[0] !== 0) {
115
116
  assert('connect error code 0', false)
116
117
  finish()
@@ -120,15 +121,15 @@ export const suite = {
120
121
  const method = wolfssl.wolfTLSv1_2_client_method()
121
122
  ctx = wolfssl.wolfSSL_CTX_new(method)
122
123
  if (!ctx) { assert('CTX_new', false); finish(); return }
123
- wolfssl.wolfSSL_CTX_set_verify(ctx, wolfssl.VerifyMode.SSL_VERIFY_NONE)
124
+ wolfssl.wolfSSL_CTX_set_verify(ctx, VerifyMode.SSL_VERIFY_NONE)
124
125
  ssl = wolfssl.wolfSSL_new(ctx)
125
126
  if (!ssl) { assert('SSL_new', false); finish(); return }
126
127
  wolfssl.wolfSSL_set_fd(ssl, sock.get_fd(s))
127
- wolfssl.wolfSSL_UseSNI(ssl, wolfssl.SniType.WOLFSSL_SNI_HOST_NAME, 'localhost')
128
+ wolfssl.wolfSSL_UseSNI(ssl, SniType.WOLFSSL_SNI_HOST_NAME, 'localhost')
128
129
  // kick handshake immediately (FD_WRITE may not re-fire)
129
130
  {
130
131
  const ret = wolfssl.wolfSSL_connect(ssl)
131
- if (ret === wolfssl.ReturnCode.SSL_SUCCESS) {
132
+ if (ret === ReturnCode.SSL_SUCCESS) {
132
133
  handshakeDone = true
133
134
  sendReq()
134
135
  } else {
@@ -141,12 +142,12 @@ export const suite = {
141
142
  }
142
143
  }
143
144
 
144
- if ((event.lNetworkEvents & sock.FdEvent.FD_READ) ||
145
- (event.lNetworkEvents & sock.FdEvent.FD_WRITE)) {
145
+ if ((event.lNetworkEvents & FdEvent.FD_READ) ||
146
+ (event.lNetworkEvents & FdEvent.FD_WRITE)) {
146
147
  if (!ssl) return
147
148
  if (!handshakeDone) {
148
149
  const ret = wolfssl.wolfSSL_connect(ssl)
149
- if (ret === wolfssl.ReturnCode.SSL_SUCCESS) {
150
+ if (ret === ReturnCode.SSL_SUCCESS) {
150
151
  handshakeDone = true
151
152
  sendReq()
152
153
  } else {
@@ -161,7 +162,7 @@ export const suite = {
161
162
  if (sentRequest) onReadable()
162
163
  }
163
164
 
164
- if (event.lNetworkEvents & sock.FdEvent.FD_CLOSE) {
165
+ if (event.lNetworkEvents & FdEvent.FD_CLOSE) {
165
166
  // drain remaining then finish
166
167
  if (ssl && sentRequest && !sawNonNumber) {
167
168
  onReadable()