Commit Graph

1116 Commits

Author SHA1 Message Date
Krzesimir Nowak
3519cecb7c Formatting fixes 2025-05-18 15:25:17 +02:00
Krzesimir Nowak
306d3a16c4 sys/linux: Improve documentation for Dirent and related procedures 2025-05-17 20:05:51 +02:00
Jeroen van Rijn
d6210ae76f Fix -vet complaints in core:sys/darwin/Foundation 2025-05-17 16:36:10 +02:00
gingerBill
5454e120fe Add NSMenuItem.odin 2025-05-17 13:27:54 +01:00
gingerBill
d77124feae Add Objective-C helper for creating subclasses 2025-05-17 11:36:24 +01:00
Jeroen van Rijn
be24feb862 Move things to constants.odin 2025-05-12 17:13:59 +02:00
Jeroen van Rijn
dec3d6959d Update linux.Map_Flags_Bits
Fixes #5151

- Removes `SHARED_VALIDATE` from the enum and turns it into `Map_Shared_Validate :: Map_Flags{.SHARED, .PRIVATE}` so it has the proper value of 0x03.
- Adds `DROPPABLE`.
- Adds constants `MAP_HUGE_SHIFT` and `MAP_HUGE_MASK`.
- Adds the huge page precomputed constants from `mman.h`, defined as the log2 of the size shifted left by `MAP_HUGE_SHIFT`:
	Map_Huge_16KB
	Map_Huge_64KB
	Map_Huge_512KB
	Map_Huge_1MB
	Map_Huge_2MB
	Map_Huge_8MB
	Map_Huge_16MB
	Map_Huge_32MB
	Map_Huge_256MB
	Map_Huge_512MB
	Map_Huge_1GB
	Map_Huge_2GB
	Map_Huge_16GB
2025-05-12 16:45:51 +02:00
Laytan Laats
cacb9f9f54 os2: better copy_directory, and add native copy_file and copy_directory variants on MacOS 2025-05-08 19:32:30 +02:00
gingerBill
edbe7aa06e Merge pull request #5091 from Badaxis/badaxis/windows-scancodes
Adding windows keyboard scan codes
2025-05-08 16:33:14 +01:00
Jeroen van Rijn
8032db3484 Fix CreateDibSection binding 2025-05-05 23:23:39 +02:00
omark96
1b8a65c327 win/sys: Add GetWindowThreadProcessId 2025-05-03 23:44:55 +02:00
Vincent Billet
d24bac8a36 Adding windows keyboard scan codes 2025-04-29 18:00:41 +02:00
Harold Brenes
040d8b1d48 Fix 2 selectors in NSDictionary 2025-04-17 15:22:10 -04:00
jason
4998d4ebd0 Fix linux.dirent_name
Was not searching the first possible byte for 0.
2025-04-13 12:05:39 -04:00
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