AtlatestRepositorysigil-wm
1
/* SPDX-License-Identifier: BSD-3-Clause */2
#ifndef SIGIL_WM_API_H3
#define SIGIL_WM_API_H4
#include <stdint.h>5
/* Copied, fixed-width ABI. Public identifiers never contain native pointers. */6
struct wm_message { int64_t word[16]; };7
int wm_start(void);8
void wm_latency_mark(int stage, uint64_t token);9
void wm_trace_enable(int enabled);10
uint64_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. */17
int wm_inventory_size(void);18
int 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 preserve22
* exact timestamps across FFI runtimes which convert wide int64 reads to double.23
* Trace saturation/contended writers drop records; input never waits for tracing. */24
int wm_submit_traced(int64_t kind,int64_t token,const int64_t *words,int64_t count,const uint64_t *causes,int trace_count);25
int wm_pixels_traced(int64_t id,const int64_t *metadata,const void *data,const int64_t *options,const uint64_t *causes,int trace_count);26
int wm_options(int64_t protocols, int64_t request_deadline);27
int wm_decoration_default(int mode);28
int wm_socket_name(const char *name);29
int wm_state(void);30
int wm_event_fd(void);31
int wm_next(struct wm_message *event);32
int wm_event_text(void *bytes, int capacity);33
int wm_send(const struct wm_message *command);34
enum 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. */36
int wm_input_reply(const struct wm_message *command,int input_kind);37
int 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. */41
int 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 resources45
* (positive windows, negative pixels, zero drag), including this pixel's -ID.46
* The copied upload is inserted next to its nearest live ordered neighbour47
* before rendering; other resources are not reordered. */48
int wm_pixels_with_options(int64_t id, const int64_t *metadata, const void *data, const int64_t *options);49
const char *wm_socket(void);50
uint64_t wm_stat(int index);51
/* Statistic 12 counts native maintenance timer callbacks, independently of52
* backend frames, client key repeat and other Wayland event-loop timers. */53
int wm_join(void);54
#endif