aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/backend/drm/drm.h1
-rw-r--r--include/rootston/config.h27
-rw-r--r--include/rootston/desktop.h2
-rw-r--r--include/rootston/input.h11
-rw-r--r--include/rootston/view.h3
-rw-r--r--include/wlr/types/wlr_server_decoration.h44
6 files changed, 78 insertions, 10 deletions
diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h
index 4d23f963..a6dd247c 100644
--- a/include/backend/drm/drm.h
+++ b/include/backend/drm/drm.h
@@ -33,6 +33,7 @@ struct wlr_drm_plane {
float matrix[16];
struct wlr_texture *wlr_tex;
struct gbm_bo *cursor_bo;
+ bool cursor_enabled;
union wlr_drm_plane_props props;
};
diff --git a/include/rootston/config.h b/include/rootston/config.h
index 5fa4890f..ecbdd88b 100644
--- a/include/rootston/config.h
+++ b/include/rootston/config.h
@@ -26,6 +26,17 @@ struct binding_config {
struct wl_list link;
};
+struct keyboard_config {
+ char *name;
+ uint32_t meta_key;
+ char *rules;
+ char *model;
+ char *layout;
+ char *variant;
+ char *options;
+ struct wl_list link;
+};
+
struct roots_config {
bool xwayland;
// TODO: Multiple cursors, multiseat
@@ -34,13 +45,10 @@ struct roots_config {
struct wlr_box *mapped_box;
} cursor;
- struct {
- uint32_t meta_key;
- } keyboard;
-
struct wl_list outputs;
struct wl_list devices;
struct wl_list bindings;
+ struct wl_list keyboards;
char *config_path;
char *startup_cmd;
};
@@ -54,13 +62,20 @@ void roots_config_destroy(struct roots_config *config);
* NULL.
*/
struct output_config *config_get_output(struct roots_config *config,
- struct wlr_output *output);
+ struct wlr_output *output);
/**
* Get configuration for the device. If the device is not configured, returns
* NULL.
*/
struct device_config *config_get_device(struct roots_config *config,
- struct wlr_input_device *device);
+ struct wlr_input_device *device);
+
+/**
+ * Get configuration for the keyboard. If the keyboard is not configured,
+ * returns NULL. A NULL device returns the default config for keyboards.
+ */
+struct keyboard_config *config_get_keyboard(struct roots_config *config,
+ struct wlr_input_device *device);
#endif
diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h
index c3859afb..376412fb 100644
--- a/include/rootston/desktop.h
+++ b/include/rootston/desktop.h
@@ -37,11 +37,13 @@ struct roots_desktop {
struct wlr_xdg_shell_v6 *xdg_shell_v6;
struct wlr_gamma_control_manager *gamma_control_manager;
struct wlr_screenshooter *screenshooter;
+ struct wlr_server_decoration_manager *server_decoration_manager;
struct wl_listener output_add;
struct wl_listener output_remove;
struct wl_listener xdg_shell_v6_surface;
struct wl_listener wl_shell_surface;
+ struct wl_listener decoration_new;
#ifdef HAS_XWAYLAND
struct wlr_xwayland *xwayland;
diff --git a/include/rootston/input.h b/include/rootston/input.h
index 33750d7b..b9af5028 100644
--- a/include/rootston/input.h
+++ b/include/rootston/input.h
@@ -88,14 +88,13 @@ struct roots_input {
// TODO: multiseat, multicursor
struct wlr_cursor *cursor;
- struct wlr_xcursor_theme *theme;
- struct wlr_xcursor *xcursor;
+ struct wlr_xcursor_theme *xcursor_theme;
struct wlr_seat *wl_seat;
struct wl_list drag_icons;
struct wl_client *cursor_client;
enum roots_cursor_mode mode;
- struct roots_view *active_view, *last_active_view;
+ struct roots_view *active_view;
int offs_x, offs_y;
int view_x, view_y, view_width, view_height;
float view_rotation;
@@ -158,6 +157,12 @@ void view_begin_move(struct roots_input *input, struct wlr_cursor *cursor,
void view_begin_resize(struct roots_input *input, struct wlr_cursor *cursor,
struct roots_view *view, uint32_t edges);
+struct wlr_xcursor *get_default_xcursor(struct wlr_xcursor_theme *theme);
+struct wlr_xcursor *get_move_xcursor(struct wlr_xcursor_theme *theme);
+struct wlr_xcursor *get_resize_xcursor(struct wlr_xcursor_theme *theme,
+ uint32_t edges);
+struct wlr_xcursor *get_rotate_xcursor(struct wlr_xcursor_theme *theme);
+
void set_view_focus(struct roots_input *input, struct roots_desktop *desktop,
struct roots_view *view);
diff --git a/include/rootston/view.h b/include/rootston/view.h
index 53a2e133..993ff654 100644
--- a/include/rootston/view.h
+++ b/include/rootston/view.h
@@ -84,6 +84,7 @@ void view_resize(struct roots_view *view, uint32_t width, uint32_t height);
void view_set_position(struct roots_view *view, double x, double y);
void view_close(struct roots_view *view);
bool view_center(struct roots_view *view);
-void view_initialize(struct roots_view *view);
+void view_setup(struct roots_view *view);
+void view_teardown(struct roots_view *view);
#endif
diff --git a/include/wlr/types/wlr_server_decoration.h b/include/wlr/types/wlr_server_decoration.h
new file mode 100644
index 00000000..b4cac5b7
--- /dev/null
+++ b/include/wlr/types/wlr_server_decoration.h
@@ -0,0 +1,44 @@
+#ifndef WLR_TYPES_WLR_SERVER_DECORATION_H
+#define WLR_TYPES_WLR_SERVER_DECORATION_H
+
+#include <wayland-server.h>
+
+struct wlr_server_decoration_manager {
+ struct wl_global *wl_global;
+ struct wl_list wl_resources;
+ struct wl_list decorations; // wlr_server_decoration::link
+
+ uint32_t default_mode; // enum org_kde_kwin_server_decoration_manager_mode
+
+ struct {
+ struct wl_signal new_decoration;
+ } events;
+
+ void *data;
+};
+
+struct wlr_server_decoration {
+ struct wl_resource *resource;
+ struct wlr_surface *surface;
+ struct wl_list link;
+
+ uint32_t mode; // enum org_kde_kwin_server_decoration_manager_mode
+
+ struct {
+ struct wl_signal destroy;
+ struct wl_signal mode;
+ } events;
+
+ struct wl_listener surface_destroy_listener;
+
+ void *data;
+};
+
+struct wlr_server_decoration_manager *wlr_server_decoration_manager_create(
+ struct wl_display *display);
+void wlr_server_decoration_manager_set_default_mode(
+ struct wlr_server_decoration_manager *manager, uint32_t default_mode);
+void wlr_server_decoration_manager_destroy(
+ struct wlr_server_decoration_manager *manager);
+
+#endif