From 7c185c1a8520684369bd73d1aacd1465e1cc9c44 Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Tue, 2 Sep 2025 23:02:27 -0400 Subject: [PATCH] include: reduce unnecessary #includes --- include/common/nodename.h | 1 - include/config/rcxml.h | 3 ++- include/img/img.h | 1 - include/input/ime.h | 1 - include/input/tablet.h | 2 +- include/placement.h | 3 ++- include/resistance.h | 6 +++++- include/scaled-buffer/scaled-img-buffer.h | 2 -- include/snap.h | 4 ++-- include/ssd.h | 1 - src/action.c | 1 + src/config/rcxml.c | 1 + src/input/ime.c | 1 + src/osd/osd-field.c | 1 + src/resize-outlines.c | 1 + 15 files changed, 17 insertions(+), 12 deletions(-) diff --git a/include/common/nodename.h b/include/common/nodename.h index f05c1283..89a4fb1a 100644 --- a/include/common/nodename.h +++ b/include/common/nodename.h @@ -4,7 +4,6 @@ #include #include -#include /** * nodename - give xml node an ascii name diff --git a/include/config/rcxml.h b/include/config/rcxml.h index 42b60f10..33c49376 100644 --- a/include/config/rcxml.h +++ b/include/config/rcxml.h @@ -8,7 +8,6 @@ #include #include "common/border.h" -#include "common/buf.h" #include "common/font.h" #include "common/node-type.h" #include "config/types.h" @@ -42,6 +41,8 @@ enum tiling_events_mode { (LAB_TILING_EVENTS_REGION | LAB_TILING_EVENTS_EDGE), }; +struct buf; + struct button_map_entry { uint32_t from; uint32_t to; diff --git a/include/img/img.h b/include/img/img.h index f299335e..82c695b6 100644 --- a/include/img/img.h +++ b/include/img/img.h @@ -4,7 +4,6 @@ #include #include -#include #include enum lab_img_type { diff --git a/include/input/ime.h b/include/input/ime.h index fcd292ce..ebf30c36 100644 --- a/include/input/ime.h +++ b/include/input/ime.h @@ -5,7 +5,6 @@ #include #include -#include "labwc.h" struct keyboard; diff --git a/include/input/tablet.h b/include/input/tablet.h index e6c1373e..094dad9a 100644 --- a/include/input/tablet.h +++ b/include/input/tablet.h @@ -4,7 +4,7 @@ #include #include -#include "config/tablet-tool.h" +#include "config/types.h" struct seat; struct wlr_device; diff --git a/include/placement.h b/include/placement.h index 99f1ca28..5210117e 100644 --- a/include/placement.h +++ b/include/placement.h @@ -4,7 +4,8 @@ #include #include -#include "view.h" + +struct view; bool placement_find_best(struct view *view, struct wlr_box *geometry); diff --git a/include/resistance.h b/include/resistance.h index 6a155ceb..0a6c2783 100644 --- a/include/resistance.h +++ b/include/resistance.h @@ -1,7 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #ifndef LABWC_RESISTANCE_H #define LABWC_RESISTANCE_H -#include "labwc.h" + +#include +#include + +struct view; /** * resistance_unsnap_apply() - Apply resistance when dragging a diff --git a/include/scaled-buffer/scaled-img-buffer.h b/include/scaled-buffer/scaled-img-buffer.h index 48cbd9c4..23fb9e17 100644 --- a/include/scaled-buffer/scaled-img-buffer.h +++ b/include/scaled-buffer/scaled-img-buffer.h @@ -2,8 +2,6 @@ #ifndef LABWC_SCALED_IMG_BUFFER_H #define LABWC_SCALED_IMG_BUFFER_H -#include - struct wlr_scene_tree; struct wlr_scene_node; struct wlr_scene_buffer; diff --git a/include/snap.h b/include/snap.h index f5c2e229..09bf6baf 100644 --- a/include/snap.h +++ b/include/snap.h @@ -2,9 +2,9 @@ #ifndef LABWC_SNAP_H #define LABWC_SNAP_H -#include "common/border.h" -#include "view.h" +#include "common/edge.h" +struct view; struct wlr_box; void snap_move_to_edge(struct view *view, diff --git a/include/ssd.h b/include/ssd.h index 7ae9ff1a..1340c8dc 100644 --- a/include/ssd.h +++ b/include/ssd.h @@ -2,7 +2,6 @@ #ifndef LABWC_SSD_H #define LABWC_SSD_H -#include "common/border.h" #include "common/node-type.h" #include "config/types.h" diff --git a/src/action.c b/src/action.c index 69e4e66b..d02bf541 100644 --- a/src/action.c +++ b/src/action.c @@ -9,6 +9,7 @@ #include #include #include "action-prompt-codes.h" +#include "common/buf.h" #include "common/macros.h" #include "common/list.h" #include "common/mem.h" diff --git a/src/config/rcxml.c b/src/config/rcxml.c index a2b31922..08a70edf 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -16,6 +16,7 @@ #include #include #include "action.h" +#include "common/buf.h" #include "common/dir.h" #include "common/list.h" #include "common/macros.h" diff --git a/src/input/ime.c b/src/input/ime.c index fb88ee15..36bc8252 100644 --- a/src/input/ime.c +++ b/src/input/ime.c @@ -8,6 +8,7 @@ #include #include "common/mem.h" #include "input/keyboard.h" +#include "labwc.h" #include "node.h" #include "output.h" #include "view.h" diff --git a/src/osd/osd-field.c b/src/osd/osd-field.c index c27b9379..c8f796d1 100644 --- a/src/osd/osd-field.c +++ b/src/osd/osd-field.c @@ -2,6 +2,7 @@ #include #include #include +#include "common/buf.h" #include "common/mem.h" #include "config/rcxml.h" #include "view.h" diff --git a/src/resize-outlines.c b/src/resize-outlines.c index a32351ac..fdb8baa1 100644 --- a/src/resize-outlines.c +++ b/src/resize-outlines.c @@ -2,6 +2,7 @@ #include "resize-outlines.h" #include +#include "common/border.h" #include "common/lab-scene-rect.h" #include "labwc.h" #include "resize-indicator.h"