diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 01:55:22 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 01:55:32 -0300 |
| commit | 75db3e84e24ee75626074d93927261249b646386 (patch) | |
| tree | f794df2c86801e23191f4c8ef08d40106bd22d85 /src/gui/macos_trackpad.h | |
| parent | 428898ae93543ab47f977b2f6f287a6bb9287625 (diff) | |
| download | pardes-75db3e84e24ee75626074d93927261249b646386.tar.gz pardes-75db3e84e24ee75626074d93927261249b646386.zip | |
macos: the AppKit trackpad adapter for the SDL window (upstream a41360e3's Trackpad.zig, macos_trackpad.{h,m} and their test as they were), its gui.zig hooks on today's names (pointAt, view().jumps and active, one setFontPx for a key's step and a pinch) and the build's shim per gui module with macos-trackpad-test registered once after the loop, all gated to macOS so a Linux touchpad's pinch and the goldens stay as they were
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/gui/macos_trackpad.h')
| -rw-r--r-- | src/gui/macos_trackpad.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/macos_trackpad.h b/src/gui/macos_trackpad.h new file mode 100644 index 00000000..f5266084 --- /dev/null +++ b/src/gui/macos_trackpad.h @@ -0,0 +1,21 @@ +#ifndef PARDES_MACOS_TRACKPAD_H +#define PARDES_MACOS_TRACKPAD_H +#include <SDL3/SDL.h> + +enum { UI_TRACKPAD_FINGERS = 1, UI_TRACKPAD_PRESSURE, UI_TRACKPAD_ROTATE, + UI_TRACKPAD_PINCH, UI_TRACKPAD_SCROLL, UI_TRACKPAD_HISTORY }; +/* Same prefix as SDL_UserEvent; the rest lives inside SDL_Event's storage. */ +typedef struct { + Uint32 type, reserved; + Uint64 timestamp; + SDL_WindowID windowID; + int kind; + float x, y, a, b; + Uint32 phase; + int fingers; +} UITrackpadEvent; + +Uint32 ui_macos_trackpad_event_type(void); +void ui_macos_trackpad_attach(SDL_Window *window); +void ui_macos_trackpad_haptic(void); +#endif |
