mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-09 15:19:11 +02:00
This is a major release and includes BREAKING changes! Breaking Changes: * More intuitive switch of focus, next, prev and exchange (#20, 40 in Bugs.md) Cagebreak will probably still feel broadly the same though. * Remove -r flag - This is replaced by output configuration. * Socket disabled by default - The socket is enabled by invoking Cagebreak with the -e flag. * Socket permissions restricted to the user of the Cagebreak process (700) This may require modification of scripts interacting with the socket with different UIDs than the UID of the Cagebreak process. * Rename "Current frame" indicator to "Current tile" Changelog: * Move to wlr_scene * Add events displaying change over the socket * this enables scripting tools * Add support for scaling outputs (thanks to Oliver Friedmann) * Remove -r flag * Add rotation to output configuration * Add cursor enable|disable flag * Add input keyboard configuration * Custom path flag for configuration file * Restrict socket permissions to the user running cagebreak (700) * Fix Issue #31 (resolve some terminology) 38 in Bugs.md * Fix Issue #30 - 39 in Bugs.md * Fix Issue #20 - 40 in Bugs.md * Fix Issue #12 - 41 in Bugs.md (dump + events over socket) * Fix Bugs found via scan-build static analysis (42 - 45 in Bugs.md) * Fix Issue #33 - 46 in Bugs.md * Fix Issue #32 - 47 in Bugs.md * Fix Issue #16 - 48 in Bugs.md * Fix Issue #3 - 49 in Bugs.md (disabling keybinding interpretation for specific keyboards is now possible) * Fix Issue #26 - 50 in Bugs.md * Fix Issue #7 - 51 in Bugs.md (Change cursor to square while Cagebreak is waiting for a key) * Fix config bug for some commands - 52 in Bugs.md * Fix Issue #35 - 53 in Bugs.md (update to wlroots 0.16.1) * Improve FAQ.md (related to some Issues) * Disable outputs when unable to set any mode (crashed previously) * Add Code of Conduct * Print version number on startup
56 lines
1.4 KiB
C
56 lines
1.4 KiB
C
// Copyright 2020 - 2023, 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
|