|
|
|
@ -2,7 +2,7 @@
|
|
|
|
#define UHDK_H_INCLUDED
|
|
|
|
#define UHDK_H_INCLUDED
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Uhdk desktop platform API — v0.1, macOS, Windows and Linux backends.
|
|
|
|
* Uhdk desktop platform API — 0.1.0 (alpha). macOS, Windows and Linux backends.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Implementation: Zig. ABI: C. Header baseline: C99 (also usable from C++).
|
|
|
|
* Implementation: Zig. ABI: C. Header baseline: C99 (also usable from C++).
|
|
|
|
* No libc runtime objects or allocation contract.
|
|
|
|
* No libc runtime objects or allocation contract.
|
|
|
|
@ -13,6 +13,9 @@
|
|
|
|
* - UHDK_ENABLE_OPENGL: include bundled GLAD types and session GL function-table declarations.
|
|
|
|
* - UHDK_ENABLE_OPENGL: include bundled GLAD types and session GL function-table declarations.
|
|
|
|
* - UHDK_ENABLE_NATIVE: declare the experimental borrowed native-handle API.
|
|
|
|
* - UHDK_ENABLE_NATIVE: declare the experimental borrowed native-handle API.
|
|
|
|
* - UHDK_PROFILE_BACKEND: quoted consumer instrumentation adapter header.
|
|
|
|
* - UHDK_PROFILE_BACKEND: quoted consumer instrumentation adapter header.
|
|
|
|
|
|
|
|
* - UHDK_SHARED: use shared-library symbol visibility declarations.
|
|
|
|
|
|
|
|
* - UHDK_BUILD: with UHDK_SHARED, export rather than import symbols on Windows;
|
|
|
|
|
|
|
|
* reserved for building the library itself.
|
|
|
|
* Presence enables each feature flag; leave it undefined to disable it.
|
|
|
|
* Presence enables each feature flag; leave it undefined to disable it.
|
|
|
|
* These select declarations only, not library backend/build features.
|
|
|
|
* These select declarations only, not library backend/build features.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -54,24 +57,33 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
/* Optional, consumer-owned instrumentation; no exported UHDK ABI or dependency.
|
|
|
|
|
|
|
|
* Define UHDK_PROFILE_BACKEND to a quoted adapter header before including uhdk.h.
|
|
|
|
|
|
|
|
* That header implements the macros below. Without it, arguments are not evaluated.
|
|
|
|
|
|
|
|
* Names (zone, thread, pool) must be string literals or have static lifetime.
|
|
|
|
|
|
|
|
* C zones: UHDK_PROFILE_BEGIN(token, "name"); ... UHDK_PROFILE_END(token);
|
|
|
|
|
|
|
|
* End on the same thread, in reverse nesting order, including early exits.
|
|
|
|
|
|
|
|
* C++ may use UHDK_PROFILE_SCOPE("name") for automatic scope exit.
|
|
|
|
|
|
|
|
* Memory: report successful non-null allocations, then free BEFORE releasing
|
|
|
|
|
|
|
|
* storage. A successful resize is free + alloc; failed allocations emit nothing.
|
|
|
|
|
|
|
|
* A pointer must use the same pool name for allocation and free. These hooks do
|
|
|
|
|
|
|
|
* not allocate/free memory themselves, intercept malloc, or transfer ownership.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Typed event payload convenience; see uhdk_event. */
|
|
|
|
/* Return event_ptr->data as const payload_type * only when event_ptr has
|
|
|
|
|
|
|
|
* expected_type and data_size is at least sizeof(payload_type); otherwise NULL.
|
|
|
|
|
|
|
|
* event_ptr may be evaluated more than once. See uhdk_event for the macro-free
|
|
|
|
|
|
|
|
* equivalent and payload lifetime rules. */
|
|
|
|
#define UHDK_EVENT_PAYLOAD(event_ptr, expected_type, payload_type) (((event_ptr)->type == (expected_type) && (event_ptr)->data_size >= sizeof(payload_type)) ? (const payload_type *)(event_ptr)->data : (const payload_type *)0)
|
|
|
|
#define UHDK_EVENT_PAYLOAD(event_ptr, expected_type, payload_type) (((event_ptr)->type == (expected_type) && (event_ptr)->data_size >= sizeof(payload_type)) ? (const payload_type *)(event_ptr)->data : (const payload_type *)0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Revision of the public C ABI described by this header. */
|
|
|
|
#define UHDK_ABI_VERSION 1u
|
|
|
|
#define UHDK_ABI_VERSION 1u
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Consumer instrumentation hooks. Defining UHDK_PROFILE_BACKEND includes that
|
|
|
|
|
|
|
|
* quoted header in place of the no-op definitions below. The adapter must define
|
|
|
|
|
|
|
|
* the same macros. Without an adapter, arguments are not evaluated. Names must
|
|
|
|
|
|
|
|
* be string literals or have static lifetime. Zones end on the same thread in
|
|
|
|
|
|
|
|
* reverse nesting order, including on early exits. These hooks report activity;
|
|
|
|
|
|
|
|
* they do not allocate, free, intercept allocation, or transfer ownership.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* UHDK_PROFILE_BEGIN(token, name): begin a named C zone and declare token.
|
|
|
|
|
|
|
|
* UHDK_PROFILE_END(token): end that zone on the same thread.
|
|
|
|
|
|
|
|
* UHDK_PROFILE_SCOPE(name): begin a C++ zone ending at scope exit.
|
|
|
|
|
|
|
|
* UHDK_PROFILE_FRAME(): mark a profiler frame boundary.
|
|
|
|
|
|
|
|
* UHDK_PROFILE_THREAD(name): assign the current thread a display name.
|
|
|
|
|
|
|
|
* UHDK_PROFILE_ALLOC(ptr, size, pool): report a successful non-NULL allocation.
|
|
|
|
|
|
|
|
* UHDK_PROFILE_FREE(ptr, pool): report a free before releasing its storage,
|
|
|
|
|
|
|
|
* using the same pool as its allocation. Report a successful resize as free then
|
|
|
|
|
|
|
|
* alloc; report nothing for a failed allocation.
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifdef UHDK_PROFILE_BACKEND
|
|
|
|
#ifdef UHDK_PROFILE_BACKEND
|
|
|
|
#include UHDK_PROFILE_BACKEND
|
|
|
|
#include UHDK_PROFILE_BACKEND
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
@ -84,6 +96,10 @@
|
|
|
|
#define UHDK_PROFILE_FREE(ptr, pool) ((void)0)
|
|
|
|
#define UHDK_PROFILE_FREE(ptr, pool) ((void)0)
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Public symbol decoration. Consumers may define UHDK_API before including this
|
|
|
|
|
|
|
|
* header to supply a platform-specific visibility attribute. The default exports
|
|
|
|
|
|
|
|
* while building a Windows shared library, imports while consuming one, uses
|
|
|
|
|
|
|
|
* default visibility for GNU-compatible shared builds, and is empty otherwise. */
|
|
|
|
#ifndef UHDK_API
|
|
|
|
#ifndef UHDK_API
|
|
|
|
#if defined(_WIN32) && defined(UHDK_SHARED)
|
|
|
|
#if defined(_WIN32) && defined(UHDK_SHARED)
|
|
|
|
#if defined(UHDK_BUILD)
|
|
|
|
#if defined(UHDK_BUILD)
|
|
|
|
@ -97,6 +113,8 @@
|
|
|
|
#define UHDK_API
|
|
|
|
#define UHDK_API
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Calling convention for every exported UHDK function. On 32-bit Windows this
|
|
|
|
|
|
|
|
* is __cdecl; it is empty on other targets. */
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
|
|
#define UHDK_CALL __cdecl
|
|
|
|
#define UHDK_CALL __cdecl
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
@ -107,6 +125,13 @@
|
|
|
|
extern "C" {
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Library version 0.1.0 (alpha). Distinct from UHDK_ABI_VERSION. A 0.x library
|
|
|
|
|
|
|
|
* version is an alpha release.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define UHDK_VERSION_MAJOR 0u
|
|
|
|
|
|
|
|
#define UHDK_VERSION_MINOR 1u
|
|
|
|
|
|
|
|
#define UHDK_VERSION_PATCH 0u
|
|
|
|
|
|
|
|
|
|
|
|
typedef char uhdk_bool; /* Values are UHDK_FALSE (0) or UHDK_TRUE (1). */
|
|
|
|
typedef char uhdk_bool; /* Values are UHDK_FALSE (0) or UHDK_TRUE (1). */
|
|
|
|
enum {
|
|
|
|
enum {
|
|
|
|
UHDK_FALSE = 0,
|
|
|
|
UHDK_FALSE = 0,
|
|
|
|
@ -132,10 +157,34 @@ enum {
|
|
|
|
/* Opaque unless UHDK_ENABLE_OPENGL is defined; then this is the bundled
|
|
|
|
/* Opaque unless UHDK_ENABLE_OPENGL is defined; then this is the bundled
|
|
|
|
* GladGLContext function table. Owned by the session and valid until close. */
|
|
|
|
* GladGLContext function table. Owned by the session and valid until close. */
|
|
|
|
typedef struct GladGLContext uhdk_gl_functions;
|
|
|
|
typedef struct GladGLContext uhdk_gl_functions;
|
|
|
|
|
|
|
|
/* Opaque handle for one running application. Create it with `uhdk_open` and
|
|
|
|
|
|
|
|
* destroy it with `uhdk_close`.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* The session owns the primary `uhdk_window` and, unless `no_opengl` is set, a
|
|
|
|
|
|
|
|
* current OpenGL context. The primary window cannot be destroyed separately.
|
|
|
|
|
|
|
|
* `uhdk_close` releases all session resources and invalidates child handles,
|
|
|
|
|
|
|
|
* including retained files and menus.
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* Calls that take a session belong to OS main except `uhdk_wake`. Native events
|
|
|
|
|
|
|
|
* are pumped by `uhdk_next_frame`. Filesystem work runs on an internal I/O
|
|
|
|
|
|
|
|
* worker. See [Using UHDK](#using-uhdk).
|
|
|
|
|
|
|
|
*/
|
|
|
|
typedef struct uhdk_session uhdk_session;
|
|
|
|
typedef struct uhdk_session uhdk_session;
|
|
|
|
|
|
|
|
/* Opaque native window owned by a session. The session owns its primary window;
|
|
|
|
|
|
|
|
* additional windows are created and destroyed explicitly. All window handles
|
|
|
|
|
|
|
|
* become invalid when the session closes. */
|
|
|
|
typedef struct uhdk_window uhdk_window;
|
|
|
|
typedef struct uhdk_window uhdk_window;
|
|
|
|
|
|
|
|
/* Reference-counted file or directory identity, including any native access
|
|
|
|
|
|
|
|
* grant. Retain borrowed references before keeping them beyond their documented
|
|
|
|
|
|
|
|
* lifetime, release owned references, and do not use them after session close. */
|
|
|
|
typedef struct uhdk_file uhdk_file;
|
|
|
|
typedef struct uhdk_file uhdk_file;
|
|
|
|
|
|
|
|
/* Opaque nonrecursive filesystem observation created asynchronously from a file
|
|
|
|
|
|
|
|
* or directory reference. Destroy it with uhdk_watch_destroy; session close also
|
|
|
|
|
|
|
|
* invalidates it. */
|
|
|
|
typedef struct uhdk_watch uhdk_watch;
|
|
|
|
typedef struct uhdk_watch uhdk_watch;
|
|
|
|
|
|
|
|
/* Reference-counted native menu tree. Creation copies its item descriptions;
|
|
|
|
|
|
|
|
* attached menus are retained by UHDK. Release owned references and do not use
|
|
|
|
|
|
|
|
* them after session close. */
|
|
|
|
typedef struct uhdk_menu uhdk_menu;
|
|
|
|
typedef struct uhdk_menu uhdk_menu;
|
|
|
|
/* Caller-chosen, nonzero. Unique in the session until REQUEST_DONE is delivered.
|
|
|
|
/* Caller-chosen, nonzero. Unique in the session until REQUEST_DONE is delivered.
|
|
|
|
* Duplicates return BUSY, including while a completion is queued. A failed submit
|
|
|
|
* Duplicates return BUSY, including while a completion is queued. A failed submit
|
|
|
|
@ -145,6 +194,7 @@ typedef struct uhdk_menu uhdk_menu;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef uint64_t uhdk_request_tag;
|
|
|
|
typedef uint64_t uhdk_request_tag;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* UTF-8 byte span, not implicitly NUL-terminated. */
|
|
|
|
typedef struct uhdk_text {
|
|
|
|
typedef struct uhdk_text {
|
|
|
|
const char *ptr;
|
|
|
|
const char *ptr;
|
|
|
|
uint64_t len;
|
|
|
|
uint64_t len;
|
|
|
|
@ -187,15 +237,20 @@ typedef struct uhdk_rect {
|
|
|
|
float height;
|
|
|
|
float height;
|
|
|
|
} uhdk_rect;
|
|
|
|
} uhdk_rect;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Tightly packed image for desktop services. pixels must contain at least
|
|
|
|
|
|
|
|
* width * height * 4 bytes; width and height must be nonzero and at most 4096. */
|
|
|
|
typedef struct uhdk_image {
|
|
|
|
typedef struct uhdk_image {
|
|
|
|
uint32_t struct_size;
|
|
|
|
uint32_t struct_size;
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
uint32_t height;
|
|
|
|
uint32_t reserved;
|
|
|
|
uint32_t reserved;
|
|
|
|
uint64_t stride_bytes;
|
|
|
|
uhdk_bytes pixels; /* Tightly packed, top-down, straight-alpha RGBA8 in sRGB. */
|
|
|
|
uhdk_bytes pixels; /* Top-down, straight-alpha RGBA8 in sRGB. */
|
|
|
|
|
|
|
|
} uhdk_image;
|
|
|
|
} uhdk_image;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Native display backend. AUTO selects the compiled platform default.
|
|
|
|
|
|
|
|
* X11 is not available in 0.1.0; an explicit request returns
|
|
|
|
|
|
|
|
* UHDK_STATUS_UNSUPPORTED.
|
|
|
|
|
|
|
|
*/
|
|
|
|
typedef uint32_t uhdk_backend;
|
|
|
|
typedef uint32_t uhdk_backend;
|
|
|
|
enum {
|
|
|
|
enum {
|
|
|
|
UHDK_BACKEND_AUTO = 0,
|
|
|
|
UHDK_BACKEND_AUTO = 0,
|
|
|
|
@ -329,10 +384,8 @@ typedef struct uhdk_window_metrics {
|
|
|
|
uhdk_bool suspended;
|
|
|
|
uhdk_bool suspended;
|
|
|
|
} uhdk_window_metrics;
|
|
|
|
} uhdk_window_metrics;
|
|
|
|
|
|
|
|
|
|
|
|
/* Primary application API. All calls except wake belong to OS main. Native events
|
|
|
|
/* Wait policy for `uhdk_next_frame`. CONTINUOUS polls while the window is
|
|
|
|
* are pumped by next_frame; filesystem work runs independently on I/O workers.
|
|
|
|
* drawable; ON_DEMAND blocks until an event or wake.
|
|
|
|
* The session owns its primary window and optional GL context. The primary
|
|
|
|
|
|
|
|
* window cannot be destroyed separately; close releases all session resources.
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef uint32_t uhdk_render_mode;
|
|
|
|
typedef uint32_t uhdk_render_mode;
|
|
|
|
enum {
|
|
|
|
enum {
|
|
|
|
@ -436,6 +489,8 @@ UHDK_API void UHDK_CALL uhdk_window_invalidate(uhdk_window *window); /* Coalesce
|
|
|
|
* offscreen buffers, textures, depth attachments and viewport/scissor state.
|
|
|
|
* offscreen buffers, textures, depth attachments and viewport/scissor state.
|
|
|
|
* Use get_gl for the bundled 3.3 API and get_gl_proc for additional procedures.
|
|
|
|
* Use get_gl for the bundled 3.3 API and get_gl_proc for additional procedures.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Calling convention for OpenGL procedure pointers. This is __stdcall on
|
|
|
|
|
|
|
|
* Windows and empty on other targets. */
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#define UHDK_GL_CALL __stdcall
|
|
|
|
#define UHDK_GL_CALL __stdcall
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
@ -811,38 +866,65 @@ typedef struct uhdk_preferences {
|
|
|
|
} uhdk_preferences;
|
|
|
|
} uhdk_preferences;
|
|
|
|
UHDK_API uhdk_status UHDK_CALL uhdk_get_preferences(uhdk_session *session, uhdk_preferences *out);
|
|
|
|
UHDK_API uhdk_status UHDK_CALL uhdk_get_preferences(uhdk_session *session, uhdk_preferences *out);
|
|
|
|
|
|
|
|
|
|
|
|
/* Event payloads. Window is NULL for app-wide events. time_ns is monotonic time
|
|
|
|
/* Tag stored in `uhdk_event.type`. Payload structs are listed in
|
|
|
|
* relative to app creation, not wall time. Do not persist event pointers.
|
|
|
|
* [Event payloads](#event-payloads). Window is NULL for app-wide events.
|
|
|
|
* Destroying a window suppresses queued window input/redraw events and cancels
|
|
|
|
* time_ns is monotonic time relative to app creation, not wall time. Do not
|
|
|
|
* its requests. REQUEST_DONE never includes a dangling window pointer.
|
|
|
|
* persist event pointers. Destroying a window suppresses queued window
|
|
|
|
|
|
|
|
* input/redraw events and cancels its requests. REQUEST_DONE never includes a
|
|
|
|
|
|
|
|
* dangling window pointer.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
typedef uint32_t uhdk_event_type;
|
|
|
|
typedef uint32_t uhdk_event_type;
|
|
|
|
enum {
|
|
|
|
enum {
|
|
|
|
|
|
|
|
/* Normal shutdown has drained accepted requests and active input cycles. */
|
|
|
|
UHDK_EVENT_STOPPED = 1,
|
|
|
|
UHDK_EVENT_STOPPED = 1,
|
|
|
|
|
|
|
|
/* A coalesced uhdk_wake call or scheduled wake deadline became observable. */
|
|
|
|
UHDK_EVENT_WAKE,
|
|
|
|
UHDK_EVENT_WAKE,
|
|
|
|
|
|
|
|
/* The OS or user requested application termination; call uhdk_quit to accept. */
|
|
|
|
UHDK_EVENT_QUIT_REQUESTED,
|
|
|
|
UHDK_EVENT_QUIT_REQUESTED,
|
|
|
|
|
|
|
|
/* The operating system changed the application's active state. */
|
|
|
|
UHDK_EVENT_APP_ACTIVATION,
|
|
|
|
UHDK_EVENT_APP_ACTIVATION,
|
|
|
|
|
|
|
|
/* The operating system asked the application to open one or more documents. */
|
|
|
|
UHDK_EVENT_OPEN_FILES,
|
|
|
|
UHDK_EVENT_OPEN_FILES,
|
|
|
|
|
|
|
|
/* System appearance or accessibility preferences changed. */
|
|
|
|
UHDK_EVENT_PREFERENCES_CHANGED,
|
|
|
|
UHDK_EVENT_PREFERENCES_CHANGED,
|
|
|
|
|
|
|
|
/* The user requested that this window close; destroy it or quit to accept. */
|
|
|
|
UHDK_EVENT_WINDOW_CLOSE_REQUESTED,
|
|
|
|
UHDK_EVENT_WINDOW_CLOSE_REQUESTED,
|
|
|
|
|
|
|
|
/* Window size, scale, state, focus, visibility, or observation flags changed. */
|
|
|
|
UHDK_EVENT_WINDOW_METRICS,
|
|
|
|
UHDK_EVENT_WINDOW_METRICS,
|
|
|
|
|
|
|
|
/* The window needs a complete repaint during a drawable frame. */
|
|
|
|
UHDK_EVENT_WINDOW_REDRAW,
|
|
|
|
UHDK_EVENT_WINDOW_REDRAW,
|
|
|
|
|
|
|
|
/* A physical/logical key was pressed, repeated, or released. */
|
|
|
|
UHDK_EVENT_KEY,
|
|
|
|
UHDK_EVENT_KEY,
|
|
|
|
|
|
|
|
/* The pointer entered the window's content area. */
|
|
|
|
UHDK_EVENT_POINTER_ENTER,
|
|
|
|
UHDK_EVENT_POINTER_ENTER,
|
|
|
|
|
|
|
|
/* The pointer left the window's content area. */
|
|
|
|
UHDK_EVENT_POINTER_LEAVE,
|
|
|
|
UHDK_EVENT_POINTER_LEAVE,
|
|
|
|
|
|
|
|
/* The pointer position changed, including movement during capture. */
|
|
|
|
UHDK_EVENT_POINTER_MOVE,
|
|
|
|
UHDK_EVENT_POINTER_MOVE,
|
|
|
|
|
|
|
|
/* A pointer button was pressed or released. */
|
|
|
|
UHDK_EVENT_POINTER_BUTTON,
|
|
|
|
UHDK_EVENT_POINTER_BUTTON,
|
|
|
|
|
|
|
|
/* The effective pointer mode changed, including forced capture loss. */
|
|
|
|
UHDK_EVENT_POINTER_MODE_CHANGED,
|
|
|
|
UHDK_EVENT_POINTER_MODE_CHANGED,
|
|
|
|
|
|
|
|
/* A wheel or touchpad produced a discrete or phased scroll update. */
|
|
|
|
UHDK_EVENT_SCROLL,
|
|
|
|
UHDK_EVENT_SCROLL,
|
|
|
|
|
|
|
|
/* Text input committed UTF-8 text to the application document. */
|
|
|
|
UHDK_EVENT_TEXT_COMMIT,
|
|
|
|
UHDK_EVENT_TEXT_COMMIT,
|
|
|
|
|
|
|
|
/* Text input supplied the current in-progress composition text. */
|
|
|
|
UHDK_EVENT_TEXT_PREEDIT,
|
|
|
|
UHDK_EVENT_TEXT_PREEDIT,
|
|
|
|
|
|
|
|
/* The current text composition ended by commit or cancellation. */
|
|
|
|
UHDK_EVENT_TEXT_COMPOSITION_END,
|
|
|
|
UHDK_EVENT_TEXT_COMPOSITION_END,
|
|
|
|
|
|
|
|
/* Native text handling requested a semantic editing operation. */
|
|
|
|
UHDK_EVENT_EDIT_COMMAND,
|
|
|
|
UHDK_EVENT_EDIT_COMMAND,
|
|
|
|
|
|
|
|
/* The user activated an application-defined menu command. */
|
|
|
|
UHDK_EVENT_MENU_COMMAND,
|
|
|
|
UHDK_EVENT_MENU_COMMAND,
|
|
|
|
|
|
|
|
/* The user dropped one or more files onto the window. */
|
|
|
|
UHDK_EVENT_DROP_FILES,
|
|
|
|
UHDK_EVENT_DROP_FILES,
|
|
|
|
|
|
|
|
/* A filesystem watch observed changes or encountered a failure. */
|
|
|
|
UHDK_EVENT_WATCH,
|
|
|
|
UHDK_EVENT_WATCH,
|
|
|
|
|
|
|
|
/* An accepted asynchronous request reached its terminal result. */
|
|
|
|
UHDK_EVENT_REQUEST_DONE,
|
|
|
|
UHDK_EVENT_REQUEST_DONE,
|
|
|
|
UHDK_EVENT_CYCLE_END /* uhdk_cycle_end_event; cycle_id identifies the interaction. */
|
|
|
|
/* The input interaction identified by cycle_id reached its terminal state. */
|
|
|
|
|
|
|
|
UHDK_EVENT_CYCLE_END
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef uint32_t uhdk_request_kind;
|
|
|
|
typedef uint32_t uhdk_request_kind;
|
|
|
|
@ -989,9 +1071,13 @@ typedef struct uhdk_watch_event {
|
|
|
|
uhdk_file *file; /* Nullable when only the watched root is known. */
|
|
|
|
uhdk_file *file; /* Nullable when only the watched root is known. */
|
|
|
|
} uhdk_watch_event;
|
|
|
|
} uhdk_watch_event;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct uhdk_activation_event {
|
|
|
|
/* Application-wide activation transition. This reports whether the operating
|
|
|
|
uhdk_bool active;
|
|
|
|
* system considers the application active, not focus for an individual window;
|
|
|
|
} uhdk_activation_event;
|
|
|
|
* event.window is NULL. Before a transition to inactive, UHDK emits CYCLE_END
|
|
|
|
|
|
|
|
* for active input cycles with UHDK_CYCLE_FOCUS_LOST. */
|
|
|
|
|
|
|
|
typedef struct uhdk_app_activation_event {
|
|
|
|
|
|
|
|
uhdk_bool active; /* UHDK_TRUE when active; UHDK_FALSE when inactive. */
|
|
|
|
|
|
|
|
} uhdk_app_activation_event;
|
|
|
|
typedef struct uhdk_pointer_mode_event {
|
|
|
|
typedef struct uhdk_pointer_mode_event {
|
|
|
|
uhdk_pointer_mode mode;
|
|
|
|
uhdk_pointer_mode mode;
|
|
|
|
} uhdk_pointer_mode_event;
|
|
|
|
} uhdk_pointer_mode_event;
|
|
|
|
|