Commit Graph

1102 Commits

Author SHA1 Message Date
Jeroen van Rijn
a6977ac733 Remove stray import. 2025-04-05 19:25:39 +02:00
Jeroen van Rijn
4b203d0c78 Fix segfault in core:sys/info on WSL2 2025-04-05 19:23:58 +02:00
Laytan Laats
ff7d55a8e1 net: rework errors to be cross-platform 2025-04-05 17:35:19 +02:00
Harold Brenes
c5980ba6c4 Add linux build tag to core/sys/linux/sys.odin 2025-04-02 16:39:25 -04:00
Jonathan Tron
1b5e83bfb6 Prevent odin.js from printing empty line in the console for the ending "\n" 2025-03-26 21:58:58 +01:00
gingerBill
6fd752f647 Merge pull request #4959 from wisonye/master
Fixed: Freebsd syscall 'getpeername' is missing.
2025-03-24 10:10:15 +00:00
Yawning Angel
982ab11aa1 core/crypto/sha2: Use hardware SHA224/256 when available (AMD64) 2025-03-23 19:14:33 +09:00
Wison Ye
61acb15529 #4959, fixed the broken CI build. 2025-03-23 13:32:11 +13:00
Wison Ye
2af691f587 Fixed: Freebsd syscall 'getpeername' is missing. 2025-03-23 13:22:19 +13:00
Wison Ye
17a01dcebf Merge remote-tracking branch 'upstream/master' 2025-03-22 17:52:43 +13:00
Wison Ye
01e81fe597 Fixed #4892: 'EPoll_Event.events' should be bit set. 2025-03-22 17:51:08 +13:00
Laytan Laats
cf0f73e0cf fix typo for freebsd arm64 MINSIGSTKSZ
Fixes #4878
2025-03-21 23:52:52 +01:00
Laytan Laats
73fd564634 fix tabs 2025-03-21 23:02:00 +01:00
Jonathan Tron
2bccd07426 Prevent registering the same event listener twice on the same element with the exact same data in wasm. 2025-03-21 09:38:23 +01:00
Jonathan Tron
dbe53d053a Fix add/remove event listeners in core:sys/wasm
There were multiple issues here:

1. listeners stored in the same key overwriting the previous one
2. missing `use_capture` parameter in `remove_event_listener`/`remove_window_event_listener`

The key used to store the listener function in `listenerMap` was a
javascript `Object`, when used as a key it was thus serialized to
the string `"[object Object]"`, meaning all listeners where effectively
set to the same key when calling `add_event_listener`/`add_window_event_listener`.
Later on when calling `remove_event_listener`/`remove_window_event_listener`,
it then tried to remove the incorrect one or none at all if there was a
mix of the same event name registered on an element or the window.

To fix I implemented a function `listener_key` in the javascript code
which will generate a different key based on the event's:
- `id`: dom element's id or 'window' (when event listener added to the
  window)
- `name`: the event name (eg: `click`), each event handler should be
  removed for the event name it was register on.
- `data`: we can register events with different data, each one generate
  a new listener which has to be removed.
- `callback`: same as `data`, if you register two similar handler but
  with two different callback, each one should be removed.
- `useCapture`: this one is a bit tricky, but when you register an event
  handler in javascript, if you don't pass `useCapture`, it defaults to `false`.
  When you remove an handler, you have to pass the exact same
  `useCapture` option you registered it with. In this case, we allowed
  to register an event with different `useCapture`, but didn't allow to
  pass the `useCapture` when removing it. We always called `removeEventListener`
  without the `useCapture` parameter which removed the handler properly
  only when it was registered with `useCapture=false`.

I also switched the `WasmMemoryInterface.listenerMap` from `{}`
(javascript object) to a `new Map()`, which is available everywhere
nowadays.
2025-03-20 16:43:49 +01:00
gingerBill
408b3af550 Merge pull request #4933 from laytan/js-open-binding
core/sys/wasm/js: add `open` binding to `window.open`
2025-03-13 09:22:20 +00:00
gingerBill
35340de928 Merge pull request #4932 from laytan/js-pointer-event-and-charcode
core/sys/wasm/js: add pointer event info and add charCode to keyboard
2025-03-13 09:22:03 +00:00
gingerBill
5a12190f51 Merge pull request #4931 from laytan/webgl-improvements
webgl: add `BlendEquationSeparate` and `GetParameter4i`
2025-03-13 09:21:44 +00:00
Laytan Laats
6691acfa03 core/sys/wasm/js: add open binding to window.open 2025-03-12 18:43:03 +01:00
Laytan Laats
b76fd84084 webgl: add BlendEquationSeparate and GetParameter4i
`GetParameter4i` can be used to retrieve the current scissor rect, or
the curent viewport, which was previously impossible.

Also adds `BlendEquationSeparate` which seemed to be missing.

Also removes an instance of `do`.
2025-03-12 18:39:57 +01:00
Laytan Laats
00ac48c06c core/sys/wasm/js: add pointer event info and add charCode to keyboard events 2025-03-12 18:37:42 +01:00
Laytan Laats
d349c96071 core/sys/wasm/js: improve gamepad API
1. Properly set `id` and `mapping` on the `get_gamepad_state` result
2. Increase `id` limit to 96 bytes, connecting my DualShock 4 made it crash
3. If an `id` or `mapping` is longer than the limits, slice it and add `...`
2025-03-12 18:32:51 +01:00
jason
ae02ced175 Fix linux.rt_sigaction
Add missing polymorphic parameter to Sig_Action
2025-03-10 20:27:59 -04:00
latedeployment
0491ad55f4 Add missing syscalls from map_shadow_stack to removexattrat 2025-03-07 21:54:51 +02:00
Laytan Laats
05add96fc8 sys/windows: fix tabs 2025-03-03 19:30:22 +01:00
Jeroen van Rijn
7841d0b14b Merge pull request #4884 from Dzentsetsu/master
Add DWM_WINDOW_CORNER_PREFERENCE enum for window corner preferences
2025-03-02 13:50:00 +01:00
gingerBill
3963ad1cc1 Update core/sys/windows/dwmapi.odin
Co-authored-by: Laytan <laytanlaats@hotmail.com>
2025-03-02 12:24:45 +00:00
Michael Kutowski
57a1264450 proper enums 2025-03-01 13:33:23 +01:00
Michael Kutowski
43c54d4de8 Update to newest orca bindings (UI Update), remove logging due to cyclic import (fmt usage) 2025-02-26 23:03:44 +01:00
Roman Osipov
a1597022af Add DWM_WINDOW_CORNER_PREFERENCE enum for window corner preferences 2025-02-26 12:23:49 +03:00
Keenan Woodall
a709876788 SavePanel_URL returns ^URL instead of ^Array 2025-02-23 19:00:27 -06:00
Laytan Laats
435f77b16b fix space indentations 2025-02-12 19:33:41 +01:00
Laytan Laats
55302280d8 fix addrinfo struct def
Fixes #4816
2025-02-12 19:24:27 +01:00
gingerBill
4678186cd2 Merge pull request #4815 from NotKyon/master
Win32 API: Add common comctl32 definitions and surrounding support structures.
2025-02-10 08:57:44 +00:00
kjdslf
a14a4d9de7 Add more win32 STARTF_* constants 2025-02-09 15:01:23 +01:00
NotKyon
ba9e723643 Win32: Fix strict style conformance. 2025-02-09 04:02:00 -08:00
NotKyon
2b36849004 Win32: Fix cross-platform compilation. 2025-02-09 03:50:51 -08:00
NotKyon
ba280c8993 Win32: Fix -vet errors. 2025-02-09 03:36:37 -08:00
NotKyon
a6188eda60 Add common Windows control messages, constants, structures, macros, and support. 2025-02-09 03:11:13 -08:00
gingerBill
0e1c89e99b Merge pull request #4781 from NotKyon/master
Add miscellaneous missing WinAPI functions, constants, and structures (comctl32, user32, uxtheme)
2025-02-03 08:15:34 +00:00
gingerBill
dc7cd21986 Merge pull request #4782 from Daxode/nsstring-appendingstring
Add stringByAppendingString to NSString
2025-02-02 07:01:16 +00:00
daniel.andersen
c8a537aad9 Add stringByAppendingString to NSString 2025-02-02 03:26:07 +01:00
NotKyon
bdf2a587c3 Add miscellaneous missing WinAPI functions, constants, and structures for comctl32, user32, and ux_theme. 2025-02-01 16:17:28 -08:00
gingerBill
539a74c2a9 Fix bindings for sys/linux and posix/unistd.odin 2025-01-31 08:37:43 +00:00
gingerBill
f6001e1b0c Merge pull request #4775 from duffn/duffn/nssavepanel-tabs
Fix tab indents in NSSavePanel
2025-01-31 07:31:52 +00:00
candtechsoftware
97db18c09a Added IP_ADD_MEMBERSHIP Socket Option on Linux 2025-01-29 23:12:32 -05:00
duffn
af63db5075 Fix tab indents in NSSavePanel 2025-01-29 16:06:19 -07:00
gingerBill
0e27acd755 Update NSSavelPanel 2025-01-28 11:38:06 +00:00
Jeroen van Rijn
d85c2c1ca7 Add mDNS/Bonjour/Avahi (.local) support for Windows 2025-01-27 22:16:24 +01:00
wrathdoesthat
57b8da79f4 Add GetTempFileNameW 2025-01-22 04:33:33 -05:00