cagebreak/ipc_server.h
project-repo d19c32d7a4 Release 2.3.0
Functionality:
  * Add configuration to anchor position of messages (#60, 71 in Bugs.md).
  * Add output priorisation (#38, 68 in Bugs.md).
  * Print whether output is active in dump.

Bug Fixes:
  * Fix gamma control (72 in Bugs.md).
  * Add missing commands to example config.
  * Add message_config to dump output.

Example Scripts:
  * Add screenshot script.
  * Make example scripts standalone.

Documentation:
  * Escape html tags in config man page. (#68, 69 in Bugs.md)
  * Improve README.md (#62, 70 in Bugs.md).
  * Improve SECURITY.md.
  * Add CONTRIBUTING.md (#62, 70 in Bugs.md).
  * FAQ: Add Firefox screenshare instructions for wayland.
  * FAQ: Add wlroots downgrading instructions for workaround in case of temporary wlroots incompatibility.
  * Update copyright notices to 2024.

Development Tooling:
  * Add new gpg keys (signed by the old ones).
  * Add PR template.
  * Add dev-FAQ.
  * Remove now-unnecessary fanalyzer pragmas.
2024-01-26 10:53:03 +00:00

56 lines
1.4 KiB
C

// Copyright 2020 - 2024, project-repo and the cagebreak contributors
// SPDX-License-Identifier: MIT
#ifndef CG_IPC_SERVER_H
#define CG_IPC_SERVER_H
#include "config.h"
#include <stdint.h>
#include <stdlib.h>
#include <wayland-server-core.h>
struct cg_server;
struct cg_ipc_client {
struct wl_event_source *event_source;
struct wl_event_source *writable_event_source;
struct cg_server *server;
struct wl_list link;
int fd;
uint32_t security_policy;
size_t write_buffer_len;
size_t write_buffer_size;
char *write_buffer;
// The following is for storing data between event_loop calls
uint16_t read_buf_len;
size_t read_buf_cap;
uint8_t read_discard; // 1 if the current line is to be discarded
char *read_buffer;
};
struct cg_ipc_handle {
int socket;
struct wl_event_source *event_source;
struct wl_list client_list;
struct wl_listener display_destroy;
struct sockaddr_un *sockaddr;
};
void
ipc_send_event(struct cg_server *server, const char *fmt, ...);
int
ipc_init(struct cg_server *server);
int
ipc_handle_connection(int fd, uint32_t mask, void *data);
int
ipc_client_handle_readable(int client_fd, uint32_t mask, void *data);
// int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data);
void
ipc_client_disconnect(struct cg_ipc_client *client);
void
ipc_client_handle_command(struct cg_ipc_client *client);
// bool ipc_send_reply(struct ipc_client *client, const char *payload, uint32_t
// payload_length);
#endif