tree-wide: use forward declarations for wlr types

This commit is contained in:
John Lindgren 2025-09-06 20:06:32 -04:00 committed by Hiroaki Yamamoto
parent b00873a988
commit d2ce31fcc9
40 changed files with 63 additions and 12 deletions

View file

@ -2,7 +2,8 @@
#ifndef LABWC_KEYBIND_H #ifndef LABWC_KEYBIND_H
#define LABWC_KEYBIND_H #define LABWC_KEYBIND_H
#include <wlr/types/wlr_keyboard.h> #include <stdbool.h>
#include <wayland-util.h>
#include <xkbcommon/xkbcommon.h> #include <xkbcommon/xkbcommon.h>
#define MAX_KEYSYMS 32 #define MAX_KEYSYMS 32

View file

@ -2,13 +2,15 @@
#ifndef LABWC_CURSOR_H #ifndef LABWC_CURSOR_H
#define LABWC_CURSOR_H #define LABWC_CURSOR_H
#include <wlr/types/wlr_cursor.h> #include <wayland-server-protocol.h>
#include "common/edge.h" #include "common/edge.h"
#include "common/node-type.h" #include "common/node-type.h"
struct view; struct view;
struct seat; struct seat;
struct server; struct server;
struct wlr_input_device;
struct wlr_cursor;
struct wlr_surface; struct wlr_surface;
struct wlr_scene_node; struct wlr_scene_node;

View file

@ -3,10 +3,10 @@
#ifndef LABWC_IME_H #ifndef LABWC_IME_H
#define LABWC_IME_H #define LABWC_IME_H
#include <wlr/types/wlr_text_input_v3.h> #include <wayland-server-core.h>
#include <wlr/types/wlr_input_method_v2.h>
struct keyboard; struct keyboard;
struct wlr_keyboard_key_event;
/* /*
* The relay structure manages the relationship between text-inputs and * The relay structure manages the relationship between text-inputs and

View file

@ -3,7 +3,6 @@
#define LABWC_TABLET_PAD_H #define LABWC_TABLET_PAD_H
#include <wayland-server-core.h> #include <wayland-server-core.h>
#include <wlr/types/wlr_tablet_v2.h>
struct seat; struct seat;
struct wlr_device; struct wlr_device;

View file

@ -3,7 +3,6 @@
#define LABWC_TABLET_H #define LABWC_TABLET_H
#include <wayland-server-core.h> #include <wayland-server-core.h>
#include <wlr/types/wlr_tablet_v2.h>
#include "config/types.h" #include "config/types.h"
struct seat; struct seat;

View file

@ -2,6 +2,7 @@
#ifndef LABWC_H #ifndef LABWC_H
#define LABWC_H #define LABWC_H
#include "config.h" #include "config.h"
#include <wlr/util/box.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include "common/set.h" #include "common/set.h"
#include "input/cursor.h" #include "input/cursor.h"

View file

@ -1,8 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_LAYERS_H #ifndef LABWC_LAYERS_H
#define LABWC_LAYERS_H #define LABWC_LAYERS_H
#include <wayland-server.h>
#include <wlr/types/wlr_layer_shell_v1.h> #include <wayland-server-core.h>
#include <wlr/util/box.h>
struct server; struct server;
struct output; struct output;

View file

@ -1,9 +1,12 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_NODE_DESCRIPTOR_H #ifndef LABWC_NODE_DESCRIPTOR_H
#define LABWC_NODE_DESCRIPTOR_H #define LABWC_NODE_DESCRIPTOR_H
#include <wlr/types/wlr_scene.h>
#include <wayland-server-core.h>
#include "common/node-type.h" #include "common/node-type.h"
struct wlr_scene_node;
struct node_descriptor { struct node_descriptor {
enum lab_node_type type; enum lab_node_type type;
struct view *view; struct view *view;

View file

@ -2,7 +2,7 @@
#ifndef LABWC_SESSION_LOCK_H #ifndef LABWC_SESSION_LOCK_H
#define LABWC_SESSION_LOCK_H #define LABWC_SESSION_LOCK_H
#include <wlr/types/wlr_session_lock_v1.h> #include <wayland-server-core.h>
struct output; struct output;
struct server; struct server;

View file

@ -9,7 +9,7 @@
#define LABWC_THEME_H #define LABWC_THEME_H
#include <cairo.h> #include <cairo.h>
#include <wlr/render/wlr_renderer.h> #include <stdbool.h>
#include "common/node-type.h" #include "common/node-type.h"
struct lab_img; struct lab_img;

View file

@ -6,6 +6,7 @@
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h> #include <unistd.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include "action-prompt-codes.h" #include "action-prompt-codes.h"

View file

@ -1,6 +1,10 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#include "config.h" #include "config.h"
#include <assert.h> #include <assert.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_seat.h> #include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_subcompositor.h> #include <wlr/types/wlr_subcompositor.h>
#include <wlr/types/wlr_xdg_shell.h> #include <wlr/types/wlr_xdg_shell.h>

View file

@ -3,6 +3,8 @@
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>
#include <pixman.h> #include <pixman.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/util/box.h> #include <wlr/util/box.h>
#include "common/border.h" #include "common/border.h"
#include "common/box.h" #include "common/box.h"

View file

@ -4,8 +4,10 @@
#include <assert.h> #include <assert.h>
#include <time.h> #include <time.h>
#include <wlr/backend/libinput.h> #include <wlr/backend/libinput.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_cursor_shape_v1.h> #include <wlr/types/wlr_cursor_shape_v1.h>
#include <wlr/types/wlr_data_device.h> #include <wlr/types/wlr_data_device.h>
#include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/types/wlr_pointer_constraints_v1.h> #include <wlr/types/wlr_pointer_constraints_v1.h>
#include <wlr/types/wlr_primary_selection.h> #include <wlr/types/wlr_primary_selection.h>
#include <wlr/types/wlr_relative_pointer_v1.h> #include <wlr/types/wlr_relative_pointer_v1.h>

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#include "input/gestures.h" #include "input/gestures.h"
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_pointer_gestures_v1.h> #include <wlr/types/wlr_pointer_gestures_v1.h>
#include "common/macros.h" #include "common/macros.h"
#include "labwc.h" #include "labwc.h"

View file

@ -3,7 +3,12 @@
#include "input/ime.h" #include "input/ime.h"
#include <assert.h> #include <assert.h>
#include <wlr/types/wlr_input_method_v2.h>
#include <wlr/types/wlr_layer_shell_v1.h> #include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_text_input_v3.h>
#include <wlr/types/wlr_virtual_keyboard_v1.h> #include <wlr/types/wlr_virtual_keyboard_v1.h>
#include <wlr/types/wlr_xdg_shell.h> #include <wlr/types/wlr_xdg_shell.h>
#include "common/mem.h" #include "common/mem.h"

View file

@ -6,6 +6,7 @@
#include <wlr/backend/session.h> #include <wlr/backend/session.h>
#include <wlr/interfaces/wlr_keyboard.h> #include <wlr/interfaces/wlr_keyboard.h>
#include <wlr/types/wlr_keyboard_group.h> #include <wlr/types/wlr_keyboard_group.h>
#include <wlr/types/wlr_seat.h>
#include "action.h" #include "action.h"
#include "common/macros.h" #include "common/macros.h"
#include "config/keybind.h" #include "config/keybind.h"

View file

@ -4,6 +4,7 @@
#include <wlr/backend/libinput.h> #include <wlr/backend/libinput.h>
#include <wlr/types/wlr_compositor.h> #include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_tablet_pad.h> #include <wlr/types/wlr_tablet_pad.h>
#include <wlr/types/wlr_tablet_v2.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include "common/macros.h" #include "common/macros.h"
#include "common/mem.h" #include "common/mem.h"

View file

@ -2,7 +2,9 @@
#include "input/tablet.h" #include "input/tablet.h"
#include <stdlib.h> #include <stdlib.h>
#include <linux/input-event-codes.h> #include <linux/input-event-codes.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_tablet_tool.h> #include <wlr/types/wlr_tablet_tool.h>
#include <wlr/types/wlr_tablet_v2.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>
#include "common/macros.h" #include "common/macros.h"

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#include "input/touch.h" #include "input/touch.h"
#include <wayland-util.h> #include <wayland-util.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_seat.h> #include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_touch.h> #include <wlr/types/wlr_touch.h>

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#include <assert.h> #include <assert.h>
#include <wlr/types/wlr_cursor.h>
#include "config/rcxml.h" #include "config/rcxml.h"
#include "edges.h" #include "edges.h"
#include "input/keyboard.h" #include "input/keyboard.h"

View file

@ -11,8 +11,10 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdlib.h> #include <stdlib.h>
#include <strings.h> #include <strings.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_fractional_scale_v1.h> #include <wlr/types/wlr_fractional_scale_v1.h>
#include <wlr/types/wlr_layer_shell_v1.h> #include <wlr/types/wlr_layer_shell_v1.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_xdg_shell.h> #include <wlr/types/wlr_xdg_shell.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include "common/macros.h" #include "common/macros.h"

View file

@ -4,6 +4,7 @@
#include <assert.h> #include <assert.h>
#include <wlr/render/allocator.h> #include <wlr/render/allocator.h>
#include <wlr/render/swapchain.h> #include <wlr/render/swapchain.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_output.h> #include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>
#include <wlr/util/transform.h> #include <wlr/util/transform.h>

View file

@ -9,7 +9,7 @@
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <unistd.h> #include <unistd.h>
#include <wayland-server-core.h> #include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_xdg_shell.h> #include <wlr/types/wlr_xdg_shell.h>
#include <wlr/util/log.h> #include <wlr/util/log.h>
#include "action.h" #include "action.h"

View file

@ -2,6 +2,7 @@
#include "node.h" #include "node.h"
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <wlr/types/wlr_scene.h>
#include "common/mem.h" #include "common/mem.h"
#include "ssd.h" #include "ssd.h"

View file

@ -3,6 +3,7 @@
#include <assert.h> #include <assert.h>
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>
#include <wlr/util/box.h> #include <wlr/util/box.h>
#include <wlr/util/log.h>
#include "common/array.h" #include "common/array.h"
#include "common/lab-scene-rect.h" #include "common/lab-scene-rect.h"
#include "common/scene-helpers.h" #include "common/scene-helpers.h"

View file

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <wlr/backend/headless.h> #include <wlr/backend/headless.h>
#include <wlr/types/wlr_output.h> #include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_layout.h>
#include "common/string-helpers.h" #include "common/string-helpers.h"
#include "labwc.h" #include "labwc.h"
#include "output.h" #include "output.h"

View file

@ -12,6 +12,7 @@
#include <strings.h> #include <strings.h>
#include <wlr/backend/drm.h> #include <wlr/backend/drm.h>
#include <wlr/backend/wayland.h> #include <wlr/backend/wayland.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_gamma_control_v1.h> #include <wlr/types/wlr_gamma_control_v1.h>
#include <wlr/types/wlr_output.h> #include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_management_v1.h> #include <wlr/types/wlr_output_management_v1.h>

View file

@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#include "overlay.h" #include "overlay.h"
#include <assert.h> #include <assert.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>
#include "common/lab-scene-rect.h" #include "common/lab-scene-rect.h"
#include "config/rcxml.h" #include "config/rcxml.h"

View file

@ -6,6 +6,7 @@
#include <float.h> #include <float.h>
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/util/box.h> #include <wlr/util/box.h>
#include "common/list.h" #include "common/list.h"
#include "common/mem.h" #include "common/mem.h"

View file

@ -3,6 +3,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <strings.h> #include <strings.h>
#include <wlr/backend/libinput.h> #include <wlr/backend/libinput.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_input_device.h> #include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_keyboard.h> #include <wlr/types/wlr_keyboard.h>
#include <wlr/types/wlr_keyboard_group.h> #include <wlr/types/wlr_keyboard_group.h>

View file

@ -2,6 +2,9 @@
#define _POSIX_C_SOURCE 200809L #define _POSIX_C_SOURCE 200809L
#include "session-lock.h" #include "session-lock.h"
#include <assert.h> #include <assert.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_session_lock_v1.h>
#include "common/mem.h" #include "common/mem.h"
#include "labwc.h" #include "labwc.h"
#include "node.h" #include "node.h"

View file

@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#include <assert.h> #include <assert.h>
#include <wlr/types/wlr_scene.h>
#include "config/rcxml.h" #include "config/rcxml.h"
#include "common/list.h" #include "common/list.h"
#include "common/mem.h" #include "common/mem.h"

View file

@ -4,6 +4,7 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <wlr/render/pixman.h> #include <wlr/render/pixman.h>
#include <wlr/types/wlr_scene.h>
#include "buffer.h" #include "buffer.h"
#include "common/mem.h" #include "common/mem.h"
#include "common/string-helpers.h" #include "common/string-helpers.h"

View file

@ -9,6 +9,7 @@
#include "ssd.h" #include "ssd.h"
#include <assert.h> #include <assert.h>
#include <strings.h> #include <strings.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>
#include "common/mem.h" #include "common/mem.h"
#include "config/rcxml.h" #include "config/rcxml.h"

View file

@ -2,6 +2,7 @@
#include "view.h" #include "view.h"
#include <assert.h> #include <assert.h>
#include <strings.h> #include <strings.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_keyboard_group.h> #include <wlr/types/wlr_keyboard_group.h>
#include <wlr/types/wlr_output_layout.h> #include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>

View file

@ -8,6 +8,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h> #include <wlr/types/wlr_scene.h>
#include "buffer.h" #include "buffer.h"
#include "common/font.h" #include "common/font.h"

View file

@ -7,6 +7,7 @@
* - keeping non-layer-shell xdg-popups outside the layers.c code * - keeping non-layer-shell xdg-popups outside the layers.c code
*/ */
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_xdg_shell.h> #include <wlr/types/wlr_xdg_shell.h>
#include "common/macros.h" #include "common/macros.h"
#include "common/mem.h" #include "common/mem.h"

View file

@ -1,7 +1,9 @@
// SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only
#include <assert.h> #include <assert.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_fractional_scale_v1.h> #include <wlr/types/wlr_fractional_scale_v1.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_xdg_activation_v1.h> #include <wlr/types/wlr_xdg_activation_v1.h>
#include <wlr/types/wlr_xdg_shell.h> #include <wlr/types/wlr_xdg_shell.h>
#include <wlr/types/wlr_xdg_toplevel_icon_v1.h> #include <wlr/types/wlr_xdg_toplevel_icon_v1.h>

View file

@ -4,6 +4,8 @@
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <wlr/types/wlr_compositor.h> #include <wlr/types/wlr_compositor.h>
#include <wlr/types/wlr_output_layout.h>
#include <wlr/types/wlr_scene.h>
#include <wlr/types/wlr_seat.h> #include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_xcursor_manager.h> #include <wlr/types/wlr_xcursor_manager.h>
#include <wlr/xwayland.h> #include <wlr/xwayland.h>