labwc/include/ssd.h

75 lines
2 KiB
C
Raw Normal View History

2021-11-13 21:56:53 +00:00
/* SPDX-License-Identifier: GPL-2.0-only */
2021-03-21 20:54:55 +00:00
#ifndef __LABWC_SSD_H
#define __LABWC_SSD_H
#include "labwc.h"
/*
* Sequence these according to the order they should be processed for
* press and hover events. Bear in mind that some of their respective
* interactive areas overlap, so for example buttons need to come before title.
*/
enum ssd_part_type {
2021-03-21 20:54:55 +00:00
LAB_SSD_NONE = 0,
LAB_SSD_BUTTON_CLOSE,
LAB_SSD_BUTTON_MAXIMIZE,
LAB_SSD_BUTTON_ICONIFY,
2022-01-26 02:54:03 +01:00
LAB_SSD_BUTTON_WINDOW_MENU,
LAB_SSD_PART_TITLEBAR,
2021-03-21 20:54:55 +00:00
LAB_SSD_PART_TITLE,
LAB_SSD_PART_CORNER_TOP_LEFT,
LAB_SSD_PART_CORNER_TOP_RIGHT,
LAB_SSD_PART_CORNER_BOTTOM_RIGHT,
LAB_SSD_PART_CORNER_BOTTOM_LEFT,
2021-03-21 20:54:55 +00:00
LAB_SSD_PART_TOP,
LAB_SSD_PART_RIGHT,
LAB_SSD_PART_BOTTOM,
LAB_SSD_PART_LEFT,
LAB_SSD_CLIENT,
LAB_SSD_FRAME,
LAB_SSD_ROOT,
2021-03-21 20:54:55 +00:00
LAB_SSD_END_MARKER
};
struct ssd_part {
struct wlr_box box;
enum ssd_part_type type;
/*
* The texture pointers are often held in other places such as the
* theme struct, so here we use ** in order to keep the code
* simple and avoid updating pointers as textures change.
*/
2021-03-27 21:04:12 +00:00
struct {
struct wlr_texture **active;
struct wlr_texture **inactive;
2021-03-27 21:04:12 +00:00
} texture;
/*
* If a part does not contain textures, it'll just be rendered as a
* rectangle with the following colors.
*/
2021-03-27 21:04:12 +00:00
struct {
float *active;
float *inactive;
} color;
struct wl_list link;
};
2021-03-21 20:54:55 +00:00
struct view;
struct border ssd_thickness(struct view *view);
struct wlr_box ssd_max_extents(struct view *view);
struct wlr_box ssd_visible_box(struct view *view, enum ssd_part_type type);
enum ssd_part_type ssd_at(struct view *view, double lx, double ly);
uint32_t ssd_resize_edges(enum ssd_part_type type);
void ssd_update_title(struct view *view);
void ssd_create(struct view *view);
void ssd_destroy(struct view *view);
void ssd_update_geometry(struct view *view, bool force);
bool ssd_part_contains(enum ssd_part_type whole, enum ssd_part_type candidate);
bool ssd_is_button(enum ssd_part_type type);
2021-03-21 20:54:55 +00:00
#endif /* __LABWC_SSD_H */