logo

inaban

Unnamed repository; edit this file 'description' to name the repository.
commit: f14354458c15e9924786764e152367f6f2c6d888
parent: f1a06988e7274a54af77aadce2600d46c2b00932
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon,  1 Jul 2019 07:33:43 +0200

Move structs and their needed includes to inaban.h

Diffstat:

Minaban.c93++-----------------------------------------------------------------------------
Ainaban.h91+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+), 91 deletions(-)

diff --git a/inaban.c b/inaban.c @@ -1,100 +1,11 @@ // Based on wlroots's TinyWL which is distributed under CC0 +#include "inaban.h" + #include <getopt.h> -#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> -#include <wayland-server.h> -#include <wlr/backend.h> -#include <wlr/render/wlr_renderer.h> -#include <wlr/types/wlr_compositor.h> -#include <wlr/types/wlr_cursor.h> -#include <wlr/types/wlr_data_device.h> -#include <wlr/types/wlr_input_device.h> -#include <wlr/types/wlr_keyboard.h> -#include <wlr/types/wlr_matrix.h> -#include <wlr/types/wlr_output.h> -#include <wlr/types/wlr_output_layout.h> -#include <wlr/types/wlr_pointer.h> -#include <wlr/types/wlr_seat.h> -#include <wlr/types/wlr_xcursor_manager.h> -#include <wlr/types/wlr_xdg_shell.h> -#include <wlr/util/log.h> -#include <xkbcommon/xkbcommon.h> - -/* For brevity's sake, struct members are annotated where they are used. */ -enum inaban_cursor_mode -{ - INABAN_CURSOR_PASSTHROUGH, - INABAN_CURSOR_MOVE, - INABAN_CURSOR_RESIZE, -}; - -struct inaban_server -{ - struct wl_display *wl_display; - struct wlr_backend *backend; - struct wlr_renderer *renderer; - - struct wlr_xdg_shell *xdg_shell; - struct wl_listener new_xdg_surface; - struct wl_list views; - - struct wlr_cursor *cursor; - struct wlr_xcursor_manager *cursor_mgr; - struct wl_listener cursor_motion; - struct wl_listener cursor_motion_absolute; - struct wl_listener cursor_button; - struct wl_listener cursor_axis; - struct wl_listener cursor_frame; - - struct wlr_seat *seat; - struct wl_listener new_input; - struct wl_listener request_cursor; - struct wl_list keyboards; - enum inaban_cursor_mode cursor_mode; - struct inaban_view *grabbed_view; - double grab_x, grab_y; - int grab_width, grab_height; - uint32_t resize_edges; - - struct wlr_output_layout *output_layout; - struct wl_list outputs; - struct wl_listener new_output; -}; - -struct inaban_output -{ - struct wl_list link; - struct inaban_server *server; - struct wlr_output *wlr_output; - struct wl_listener frame; -}; - -struct inaban_view -{ - struct wl_list link; - struct inaban_server *server; - struct wlr_xdg_surface *xdg_surface; - struct wl_listener map; - struct wl_listener unmap; - struct wl_listener destroy; - struct wl_listener request_move; - struct wl_listener request_resize; - bool mapped; - int x, y; -}; - -struct inaban_keyboard -{ - struct wl_list link; - struct inaban_server *server; - struct wlr_input_device *device; - - struct wl_listener modifiers; - struct wl_listener key; -}; static void focus_view(struct inaban_view *view, struct wlr_surface *surface) diff --git a/inaban.h b/inaban.h @@ -0,0 +1,91 @@ +#include <stdbool.h> +#include <wayland-server.h> +#include <wlr/backend.h> +#include <wlr/render/wlr_renderer.h> +#include <wlr/types/wlr_compositor.h> +#include <wlr/types/wlr_cursor.h> +#include <wlr/types/wlr_data_device.h> +#include <wlr/types/wlr_input_device.h> +#include <wlr/types/wlr_keyboard.h> +#include <wlr/types/wlr_matrix.h> +#include <wlr/types/wlr_output.h> +#include <wlr/types/wlr_output_layout.h> +#include <wlr/types/wlr_pointer.h> +#include <wlr/types/wlr_seat.h> +#include <wlr/types/wlr_xcursor_manager.h> +#include <wlr/types/wlr_xdg_shell.h> +#include <wlr/util/log.h> +#include <xkbcommon/xkbcommon.h> + +/* For brevity's sake, struct members are annotated where they are used. */ +enum inaban_cursor_mode +{ + INABAN_CURSOR_PASSTHROUGH, + INABAN_CURSOR_MOVE, + INABAN_CURSOR_RESIZE, +}; + +struct inaban_server +{ + struct wl_display *wl_display; + struct wlr_backend *backend; + struct wlr_renderer *renderer; + + struct wlr_xdg_shell *xdg_shell; + struct wl_listener new_xdg_surface; + struct wl_list views; + + struct wlr_cursor *cursor; + struct wlr_xcursor_manager *cursor_mgr; + struct wl_listener cursor_motion; + struct wl_listener cursor_motion_absolute; + struct wl_listener cursor_button; + struct wl_listener cursor_axis; + struct wl_listener cursor_frame; + + struct wlr_seat *seat; + struct wl_listener new_input; + struct wl_listener request_cursor; + struct wl_list keyboards; + enum inaban_cursor_mode cursor_mode; + struct inaban_view *grabbed_view; + double grab_x, grab_y; + int grab_width, grab_height; + uint32_t resize_edges; + + struct wlr_output_layout *output_layout; + struct wl_list outputs; + struct wl_listener new_output; +}; + +struct inaban_output +{ + struct wl_list link; + struct inaban_server *server; + struct wlr_output *wlr_output; + struct wl_listener frame; +}; + +struct inaban_view +{ + struct wl_list link; + struct inaban_server *server; + struct wlr_xdg_surface *xdg_surface; + struct wl_listener map; + struct wl_listener unmap; + struct wl_listener destroy; + struct wl_listener request_move; + struct wl_listener request_resize; + bool mapped; + int x, y; +}; + +struct inaban_keyboard +{ + struct wl_list link; + struct inaban_server *server; + struct wlr_input_device *device; + + struct wl_listener modifiers; + struct wl_listener key; +};