mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-09 07:09:11 +02:00
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.
77 lines
1.8 KiB
C
77 lines
1.8 KiB
C
// Copyright 2020 - 2024, project-repo and the cagebreak contributors
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#ifndef CG_VIEW_H
|
|
#define CG_VIEW_H
|
|
|
|
#include "config.h"
|
|
|
|
#include <stdbool.h>
|
|
#include <wayland-server-core.h>
|
|
#include <wlr/types/wlr_compositor.h>
|
|
|
|
struct cg_server;
|
|
struct wlr_box;
|
|
|
|
enum cg_view_type {
|
|
CG_XDG_SHELL_VIEW,
|
|
#if CG_HAS_XWAYLAND
|
|
CG_XWAYLAND_VIEW,
|
|
#endif
|
|
};
|
|
|
|
struct cg_view {
|
|
struct cg_workspace *workspace;
|
|
struct cg_server *server;
|
|
struct wl_list link; // server::views
|
|
struct wlr_surface *wlr_surface;
|
|
struct cg_tile *tile;
|
|
struct wlr_scene_tree *scene_tree;
|
|
|
|
struct wl_listener destroy;
|
|
struct wl_listener unmap;
|
|
struct wl_listener map;
|
|
|
|
/* The view has a position in output coordinates. */
|
|
int ox, oy;
|
|
|
|
enum cg_view_type type;
|
|
const struct cg_view_impl *impl;
|
|
|
|
uint32_t id;
|
|
};
|
|
|
|
struct cg_view_impl {
|
|
pid_t (*get_pid)(const struct cg_view *view);
|
|
char *(*get_title)(const struct cg_view *view);
|
|
bool (*is_primary)(const struct cg_view *view);
|
|
void (*activate)(struct cg_view *view, bool activate);
|
|
void (*close)(struct cg_view *view);
|
|
void (*maximize)(struct cg_view *view, int width, int height);
|
|
void (*destroy)(struct cg_view *view);
|
|
};
|
|
|
|
struct cg_tile *
|
|
view_get_tile(const struct cg_view *view);
|
|
bool
|
|
view_is_primary(const struct cg_view *view);
|
|
bool
|
|
view_is_visible(const struct cg_view *view);
|
|
void
|
|
view_activate(struct cg_view *view, bool activate);
|
|
void
|
|
view_unmap(struct cg_view *view);
|
|
void
|
|
view_maximize(struct cg_view *view, struct cg_tile *tile);
|
|
void
|
|
view_map(struct cg_view *view, struct wlr_surface *surface,
|
|
struct cg_workspace *ws);
|
|
void
|
|
view_destroy(struct cg_view *view);
|
|
void
|
|
view_init(struct cg_view *view, enum cg_view_type type,
|
|
const struct cg_view_impl *impl, struct cg_server *server);
|
|
struct cg_view *
|
|
view_get_prev_view(struct cg_view *view);
|
|
|
|
#endif
|