1#define __STDC_WANT_LIB_EXT1__ 1
18 if (surface->
id ==
id)
113 if (width <= 0 || height <= 0)
196 if (surface->
width != width || surface->
height != height)
258 RECT_FIT(&invalidRect, &surfaceRect);
388 printf(
"dwm client: invalid command buffer size, got %lu\n", cmds->
size);
401 printf(
"dwm client: corrupt command detected amount=%lu size=%lu magic=%x type=%u\n", amount, cmd->
size,
408 if (amount != cmds->
amount)
410 printf(
"dwm client: invalid command amount, expected %lu, got %lu\n", cmds->
amount, amount);
419 printf(
"dwm client: command type %u caused error\n", cmd->
type);
433 printf(
"dwm client: receive buffer full\n");
445 perror(
"dwm client: read error");
451 printf(
"dwm client: end of file\n");
488 const char* p = (
const char*)
data;
499 perror(
"dwm client: write error");
506 perror(
"dwm client: write error (0 bytes written)");
518 if (client->
bitmask[type / 64] & (1ULL << (type % 64)))
#define MAX_NAME
Maximum length of names.
static uint64_t client_action_surface_timer_set(client_t *client, const cmd_header_t *header)
static uint64_t client_action_surface_report(client_t *client, const cmd_header_t *header)
uint64_t client_receive_cmds(client_t *client)
static surface_t * client_surface_find(client_t *client, surface_id_t id)
static uint64_t client_action_surface_new(client_t *client, const cmd_header_t *header)
void client_free(client_t *client)
static uint64_t client_action_surface_free(client_t *client, const cmd_header_t *header)
static uint64_t client_process_cmds(client_t *client, cmd_buffer_t *cmds)
static uint64_t client_action_surface_invalidate(client_t *client, const cmd_header_t *header)
static uint64_t(* actions[])(client_t *, const cmd_header_t *)
uint64_t client_send_event(client_t *client, surface_id_t target, event_type_t type, void *data, uint64_t size)
static uint64_t client_action_subscribe(client_t *client, const cmd_header_t *header)
static uint64_t client_action_surface_move(client_t *client, const cmd_header_t *header)
static uint64_t client_action_screen_info(client_t *client, const cmd_header_t *header)
static uint64_t client_action_surface_focus_set(client_t *client, const cmd_header_t *header)
static uint64_t client_action_unsubscribe(client_t *client, const cmd_header_t *header)
static uint64_t client_send_all(fd_t fd, const void *data, size_t size)
client_t * client_new(fd_t fd)
static uint64_t client_action_surface_visible_set(client_t *client, const cmd_header_t *header)
#define CLIENT_RECV_BUFFER_SIZE
@ CMD_SURFACE_VISIBLE_SET
#define CMD_BUFFER_MAX_DATA
#define CMD_BUFFER_FOR_EACH(buffer, cmd)
void compositor_invalidate(const rect_t *rect)
#define EVENT_SURFACE_NEW
uint16_t event_type_t
Event type.
#define EVENT_SCREEN_INFO
#define ENOENT
No such file or directory.
#define EINVAL
Invalid argument.
#define ENAMETOOLONG
File name too long.
#define ENOSYS
Function not implemented.
#define EINTR
Interrupted system call.
#define EWOULDBLOCK
Operation would block.
#define EPROTO
Protocol error.
#define EPIPE
Broken pipe.
#define ENOMEM
Out of memory.
#define errno
Error number variable.
#define EMSGSIZE
Message too long.
uint64_t close(fd_t fd)
System call for closing files.
uint64_t read(fd_t fd, void *buffer, uint64_t count)
System call for reading from files.
uint64_t share(key_t *key, fd_t fd, clock_t timeout)
System call for sharing a file descriptor with another process.
uint64_t write(fd_t fd, const void *buffer, uint64_t count)
System call for writing to files.
#define LIST_FOR_EACH(elem, list, member)
Iterates over a list.
#define LIST_FOR_EACH_SAFE(elem, temp, list, member)
Safely iterates over a list, allowing for element removal during iteration.
static void list_remove(list_t *list, list_entry_t *entry)
Removes a list entry from its current list.
static void list_push(list_t *list, list_entry_t *entry)
Pushes an entry to the end of the list.
static void list_entry_init(list_entry_t *entry)
Initializes a list entry.
static void list_init(list_t *list)
Initializes a list.
clock_t uptime(void)
System call for retreving the time since boot.
#define NULL
Pointer error value.
#define ERR
Integer error value.
__UINT64_TYPE__ fd_t
A file descriptor.
void dwm_focus_set(surface_t *surface)
uint64_t dwm_attach(surface_t *surface)
void dwm_report_produce(surface_t *surface, client_t *client, report_flags_t flags)
void dwm_detach(surface_t *surface)
surface_t * dwm_surface_find(surface_id_t id)
#define RECT_FIT(rect, parent)
#define RECT_HAS_NEGATIVE_DIMS(rect)
#define RECT_INIT_DIM(x, y, width, height)
#define RECT_HEIGHT(rect)
uint64_t screen_height(void)
uint64_t screen_width(void)
#define SURFACE_SCREEN_RECT(surface)
#define SURFACE_CONTENT_RECT(surface)
_PUBLIC int printf(const char *_RESTRICT format,...)
_PUBLIC void perror(const char *s)
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
_PUBLIC void * memmove(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
_PUBLIC void * memcpy(void *_RESTRICT s1, const void *_RESTRICT s2, size_t n)
size_t strnlen_s(const char *s, size_t maxsize)
char recvBuffer[CLIENT_RECV_BUFFER_SIZE]
key_t shmemKey
Key that can be claim()ed to access the surface's shared memory.
surface_t * surface_new(client_t *client, const char *name, const point_t *point, uint64_t width, uint64_t height, surface_type_t type)
void surface_free(surface_t *surface)