mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 16:50:41 +01:00
Replayed as touch, a phone drag scrolled in browsers but still selected text in VTE terminals (Ptyxis, GNOME Terminal), as on a real touchscreen. By default on the portal backend the host now decides per press: moving past 12 px within 450 ms scrolls smoothly (NotifyPointerAxis or EIS scroll, content follows the finger, `finish` on release so clients may coast), holding still selects with button 1 down, and a short press clicks. This works in terminals too and needs no touchscreen consent. UU_TOUCH_INPUT=touch keeps the touchscreen replay (with its one-time consent upgrade); UU_TOUCH_INPUT=0 keeps plain mouse drags.
37 lines
2.5 KiB
C
37 lines
2.5 KiB
C
#ifndef UU_PORTAL_ENGINE_H
|
|
#define UU_PORTAL_ENGINE_H
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
struct uu_portal;
|
|
typedef int (*uu_portal_cancelled_fn)(void *data);
|
|
/* One object owns one consent/session and one PipeWire stream. */
|
|
struct uu_portal *uu_portal_open(int *error, uint32_t *width, uint32_t *height);
|
|
/* Saves the rotated token immediately after Start, before video initialization. */
|
|
struct uu_portal *uu_portal_open_persist(const char *restore, void (*save_token)(const char *, void *), void *data, int *error, uint32_t *width, uint32_t *height);
|
|
/* The cancellation callback and data are used only until this call returns. */
|
|
struct uu_portal *uu_portal_open_persist_cancellable(const char *restore, void (*save_token)(const char *, void *), void *save_data, uu_portal_cancelled_fn cancelled, void *cancel_data, int *error, uint32_t *width, uint32_t *height);
|
|
struct uu_portal *uu_portal_open_restore(const char *restore, int *error, uint32_t *width, uint32_t *height);
|
|
const char *uu_portal_restore_token(struct uu_portal *portal);
|
|
void uu_portal_close(struct uu_portal *portal);
|
|
int uu_portal_clipboard_ready(struct uu_portal *portal);
|
|
int uu_portal_clipboard_set(struct uu_portal *portal, const uint8_t *text, size_t length);
|
|
int uu_portal_clipboard_poll(struct uu_portal *portal, uint8_t *text, size_t capacity);
|
|
int uu_portal_alive(struct uu_portal *portal);
|
|
int uu_portal_capture_alive(struct uu_portal *portal);
|
|
void uu_portal_input_dispatch(struct uu_portal *portal);
|
|
void uu_portal_logical_size(struct uu_portal *portal, uint32_t *width, uint32_t *height);
|
|
void uu_portal_reset_frame(struct uu_portal *portal);
|
|
int uu_portal_capture(struct uu_portal *portal, uint8_t *bgra, size_t length);
|
|
int uu_portal_capture_since(struct uu_portal *portal, uint8_t *bgra, size_t length, uint64_t *revision);
|
|
int uu_portal_move(struct uu_portal *portal, double x, double y, int relative);
|
|
int uu_portal_button(struct uu_portal *portal, int button, int pressed);
|
|
int uu_portal_scroll(struct uu_portal *portal, double dx, double dy, int finish);
|
|
int uu_portal_touch_supported(struct uu_portal *portal);
|
|
int uu_portal_touch_available(struct uu_portal *portal);
|
|
int uu_portal_touch(struct uu_portal *portal, int phase, double x, double y);
|
|
int uu_portal_key(struct uu_portal *portal, uint32_t keysym, int keycode, int pressed);
|
|
int uu_portal_stream_position(struct uu_portal *portal, int32_t *x, int32_t *y);
|
|
int uu_portal_monitors(char *out, size_t length);
|
|
void uu_portal_end(struct uu_portal *portal);
|
|
#endif
|