AtlatestRepositorysigil-wm

sigil-wm / tree / src / capi.h

1/* SPDX-License-Identifier: BSD-3-Clause */
2#ifndef SIGIL_WM_API_H
3#define SIGIL_WM_API_H
4#include <stdint.h>
5/* Copied, fixed-width ABI. Public identifiers never contain native pointers. */
6struct wm_message { int64_t word[16]; };
7int wm_start(void);
8void wm_latency_mark(int stage, uint64_t token);
9void wm_trace_enable(int enabled);
10uint64_t wm_trace_dropped(void);
11/* Detached fixed-width inventory v1. Four int64 header words (version,count,
12 * truncated,errors), then up to 256 records: int64[16], four UTF-8 char[256]
13 * strings (name,make,model,serial), 128 int64[4] modes (width,height,mHz,index).
14 * Record words: output ID,connected,enabled,powered,x,y,scale milli,transform,
15 * width,height,mHz,current mode index,mode count,DRM connector ID,device,unused.
16 * A zero output ID denotes a connector with no live wlroots output. */
17int wm_inventory_size(void);
18int wm_inventory_copy(void *buffer,int capacity);
19/* Correlation is copied with each command, never a global latest-input ID.
20 * wm_next delivers kind 129: correlation, stage, monotonic ns, object, commit sequence,
21 * whole monotonic seconds, nanosecond remainder. The final two fields preserve
22 * exact timestamps across FFI runtimes which convert wide int64 reads to double.
23 * Trace saturation/contended writers drop records; input never waits for tracing. */
24int wm_submit_traced(int64_t kind,int64_t token,const int64_t *words,int64_t count,const uint64_t *causes,int trace_count);
25int wm_pixels_traced(int64_t id,const int64_t *metadata,const void *data,const int64_t *options,const uint64_t *causes,int trace_count);
26int wm_options(int64_t protocols, int64_t request_deadline);
27int wm_decoration_default(int mode);
28int wm_socket_name(const char *name);
29int wm_state(void);
30int wm_event_fd(void);
31int wm_next(struct wm_message *event);
32int wm_event_text(void *bytes, int capacity);
33int wm_send(const struct wm_message *command);
34enum wm_send_result { WM_SEND_INVALID=-2, WM_SEND_STOPPED=-1, WM_SEND_FULL=0, WM_SEND_ACCEPTED=1, WM_SEND_STARTING=2 };
35/* Reply status preserves startup waits without changing wm_send's boolean contract. */
36int wm_input_reply(const struct wm_message *command,int input_kind);
37int wm_submit(int64_t kind, int64_t token, const int64_t *words, int64_t count);
38/* Pixel metadata: x,y,logical width/height,pixel width/height,stride,stack.
39 * stack is -1 bottom, 0 preserve, 1 top, 2 ordered insertion (options required).
40 * The bytes are copied before return. */
41int wm_pixels(int64_t id, const int64_t *metadata, const void *data);
42/* Input acceptance is explicit; the compatibility entrypoint passes through. */
43/* Options: input?, output ID, expected output x,y,width,height. Output 0 is unscoped. */
44/* For stack2 only: append resource count, then signed bottom-to-top resources
45 * (positive windows, negative pixels, zero drag), including this pixel's -ID.
46 * The copied upload is inserted next to its nearest live ordered neighbour
47 * before rendering; other resources are not reordered. */
48int wm_pixels_with_options(int64_t id, const int64_t *metadata, const void *data, const int64_t *options);
49const char *wm_socket(void);
50uint64_t wm_stat(int index);
51/* Statistic 12 counts native maintenance timer callbacks, independently of
52 * backend frames, client key repeat and other Wayland event-loop timers. */
53int wm_join(void);
54#endif