]> git.mdlowis.com Git - proto/labwc.git/commitdiff
include: reduce global includes in labwc.h
authorJohn Lindgren <john@jlindgren.net>
Mon, 28 Jul 2025 05:22:10 +0000 (01:22 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 30 Jul 2025 20:04:31 +0000 (21:04 +0100)
30 files changed:
include/labwc.h
src/action.c
src/config/keybind.c
src/decorations/kde-deco.c
src/desktop.c
src/input/cursor.c
src/input/ime.c
src/input/keyboard.c
src/input/tablet-pad.c
src/input/touch.c
src/layers.c
src/magnifier.c
src/main.c
src/menu/menu.c
src/output.c
src/overlay.c
src/seat.c
src/server.c
src/ssd/ssd-border.c
src/ssd/ssd-extents.c
src/ssd/ssd-shadow.c
src/ssd/ssd.c
src/tearing.c
src/theme.c
src/view.c
src/workspaces.c
src/xdg-popup.c
src/xdg.c
src/xwayland-unmanaged.c
src/xwayland.c

index 642cf4cb07ba280e829da1aedf86de6260542801..b05d519d42b62a8eb73173009afe08c92541431f 100644 (file)
@@ -2,53 +2,10 @@
 #ifndef LABWC_H
 #define LABWC_H
 #include "config.h"
-#include <getopt.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
-#include <wayland-server-core.h>
-#include <wlr/backend.h>
-#include <wlr/render/allocator.h>
-#include <wlr/render/wlr_renderer.h>
-#include <wlr/types/wlr_compositor.h>
-#include <wlr/types/wlr_buffer.h>
-#include <wlr/types/wlr_cursor.h>
-#include <wlr/types/wlr_data_device.h>
-#include <wlr/types/wlr_gamma_control_v1.h>
-#include <wlr/types/wlr_input_device.h>
-#include <wlr/types/wlr_keyboard.h>
-#include <wlr/types/wlr_keyboard_group.h>
-#include <wlr/types/wlr_layer_shell_v1.h>
-#include <wlr/types/wlr_output.h>
-#include <wlr/types/wlr_output_management_v1.h>
-#include <wlr/types/wlr_output_power_management_v1.h>
-#include <wlr/types/wlr_output_layout.h>
-#include <wlr/types/wlr_scene.h>
-#include <wlr/types/wlr_relative_pointer_v1.h>
-#include <wlr/types/wlr_pointer.h>
-#include <wlr/types/wlr_pointer_constraints_v1.h>
-#include <wlr/types/wlr_seat.h>
-#include <wlr/types/wlr_subcompositor.h>
-#include <wlr/types/wlr_xcursor_manager.h>
-#include <wlr/types/wlr_xdg_activation_v1.h>
-#include <wlr/types/wlr_xdg_shell.h>
-#include <wlr/types/wlr_drm_lease_v1.h>
-#include <wlr/types/wlr_virtual_pointer_v1.h>
-#include <wlr/types/wlr_virtual_keyboard_v1.h>
-#include <wlr/types/wlr_tearing_control_v1.h>
-#include <wlr/types/wlr_text_input_v3.h>
-#include <wlr/types/wlr_input_method_v2.h>
-#include <wlr/types/wlr_tablet_v2.h>
 #include <wlr/util/log.h>
 #include "common/set.h"
-#include "config/keybind.h"
-#include "config/rcxml.h"
 #include "input/cursor.h"
 #include "overlay.h"
-#include "regions.h"
-#include "session-lock.h"
 #if HAVE_NLS
 #include <libintl.h>
 #include <locale.h>
@@ -60,6 +17,8 @@
 #define XCURSOR_DEFAULT "left_ptr"
 #define XCURSOR_SIZE 24
 
+struct wlr_xdg_popup;
+
 enum input_mode {
        LAB_INPUT_STATE_PASSTHROUGH = 0,
        LAB_INPUT_STATE_MOVE,
index ec1914c4a31a8f5fec51e3e48b777c016b53846a..c4fd131ab0907e0eaa8d367bb78234076755a999 100644 (file)
@@ -6,6 +6,7 @@
 #include <string.h>
 #include <strings.h>
 #include <unistd.h>
+#include <wlr/types/wlr_scene.h>
 #include <wlr/util/log.h>
 #include "common/macros.h"
 #include "common/list.h"
index 7560cb16bfa9e7ddb91b9d0d3503f9447c5f5f38..9003e5ee4594a0d2ba8d2d23f0c454cdb4108501 100644 (file)
@@ -6,6 +6,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <wlr/types/wlr_keyboard_group.h>
 #include <wlr/util/log.h>
 #include "common/list.h"
 #include "common/mem.h"
index a615811b1e0e0b60b91f021d30e5a5463a6d713a..123173df48ef221e70e76c989d0100dc7d090e6f 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <assert.h>
 #include <wlr/types/wlr_server_decoration.h>
+#include <wlr/types/wlr_xdg_shell.h>
 #include "common/list.h"
 #include "common/mem.h"
 #include "decorations.h"
index 739cc3ef367ce76788d4215ffb2641f0ccd33542..a7cd86a2aab3429748924ddbf5922678ca944a0f 100644 (file)
@@ -1,6 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include "config.h"
 #include <assert.h>
+#include <wlr/types/wlr_seat.h>
+#include <wlr/types/wlr_subcompositor.h>
+#include <wlr/types/wlr_xdg_shell.h>
 #include "common/scene-helpers.h"
 #include "common/surface-helpers.h"
 #include "dnd.h"
index d7eabb7595db3eb59ed91b3d02abda85a14de891..852eca3f2aa9800bfb6368dd75c1bdd95e3fe236 100644 (file)
@@ -7,7 +7,14 @@
 #include <time.h>
 #include <wlr/backend/libinput.h>
 #include <wlr/types/wlr_cursor_shape_v1.h>
+#include <wlr/types/wlr_data_device.h>
+#include <wlr/types/wlr_pointer_constraints_v1.h>
 #include <wlr/types/wlr_primary_selection.h>
+#include <wlr/types/wlr_relative_pointer_v1.h>
+#include <wlr/types/wlr_scene.h>
+#include <wlr/types/wlr_subcompositor.h>
+#include <wlr/types/wlr_xcursor_manager.h>
+#include <wlr/types/wlr_xdg_shell.h>
 #include <wlr/util/region.h>
 #include "action.h"
 #include "common/macros.h"
@@ -15,7 +22,6 @@
 #include "common/scene-helpers.h"
 #include "common/surface-helpers.h"
 #include "config/mousebind.h"
-#include "config/tablet-tool.h"
 #include "dnd.h"
 #include "idle.h"
 #include "input/gestures.h"
index 1e4cddc4b4938a51c09d9b71c393fa705b81a60b..bbb8723a650014751e940d5615994de9b0064b67 100644 (file)
@@ -3,6 +3,9 @@
 
 #include "input/ime.h"
 #include <assert.h>
+#include <wlr/types/wlr_layer_shell_v1.h>
+#include <wlr/types/wlr_virtual_keyboard_v1.h>
+#include <wlr/types/wlr_xdg_shell.h>
 #include "common/mem.h"
 #include "node.h"
 #include "output.h"
index 4c2a0704dc5388ec1aece2936562cc5854f186e1..8d1b9ae3511fad00ae5cb0ea1d9eff2140bdbd66 100644 (file)
@@ -6,9 +6,11 @@
 #include <wlr/backend/multi.h>
 #include <wlr/backend/session.h>
 #include <wlr/interfaces/wlr_keyboard.h>
+#include <wlr/types/wlr_keyboard_group.h>
 #include "action.h"
 #include "common/macros.h"
 #include "common/three-state.h"
+#include "config/keybind.h"
 #include "idle.h"
 #include "input/ime.h"
 #include "input/key-state.h"
@@ -16,6 +18,7 @@
 #include "menu/menu.h"
 #include "osd.h"
 #include "regions.h"
+#include "session-lock.h"
 #include "view.h"
 #include "workspaces.h"
 
index 19127058e6ffd1a9c98e3b018959119077d82b6c..c2992ef9544b01234fdea79805d072440895a749 100644 (file)
@@ -3,6 +3,7 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <wlr/backend/libinput.h>
+#include <wlr/types/wlr_compositor.h>
 #include <wlr/types/wlr_tablet_pad.h>
 #include <wlr/types/wlr_tablet_tool.h>
 #include <wlr/util/log.h>
index 2cc797849de0b3dbe67b9c196efddf2d15d6f019..c0745f37a2aef529e0c57e825091503d9c208efd 100644 (file)
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include "input/touch.h"
 #include <wayland-util.h>
+#include <wlr/types/wlr_scene.h>
+#include <wlr/types/wlr_seat.h>
 #include <wlr/types/wlr_touch.h>
 #include <linux/input-event-codes.h>
 #include "common/macros.h"
index 7ed3f84da7efedd8d26970ee1c73ef499c73e963..d22c16ad9f3cbb935479c7676fb8fc269b23905e 100644 (file)
@@ -15,6 +15,7 @@
 #include <wayland-server.h>
 #include <wlr/types/wlr_fractional_scale_v1.h>
 #include <wlr/types/wlr_layer_shell_v1.h>
+#include <wlr/types/wlr_xdg_shell.h>
 #include <wlr/util/log.h>
 #include "common/macros.h"
 #include "common/mem.h"
index 49499211fbb7c43f1b3c9de58b45fb158c40ae8a..d9704c808603c2a73e67d859da33fb443e58e1d8 100644 (file)
@@ -2,8 +2,10 @@
 
 #include "magnifier.h"
 #include <assert.h>
+#include <wlr/render/allocator.h>
 #include <wlr/render/swapchain.h>
 #include <wlr/types/wlr_output.h>
+#include <wlr/types/wlr_scene.h>
 #include <wlr/util/transform.h>
 #include "common/box.h"
 #include "labwc.h"
index ef0931121116d788235b4ea3ffdb72a52a45d2e4..c69090bc24f5ea491712dc982a48876339e2ebd0 100644 (file)
@@ -1,13 +1,11 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #define _POSIX_C_SOURCE 200809L
+#include <getopt.h>
 #include <pango/pangocairo.h>
 #include <signal.h>
-#include <string.h>
 #include <unistd.h>
-#include "common/dir.h"
 #include "common/fd-util.h"
 #include "common/font.h"
-#include "common/mem.h"
 #include "common/spawn.h"
 #include "config/session.h"
 #include "labwc.h"
index f8695a2a0a3f9e4264d59ea3b7422d2924ec7030..dd902bc24f3612d89eb7ba0b69533bfc5ff9456c 100644 (file)
@@ -9,6 +9,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
+#include <unistd.h>
 #include <wayland-server-core.h>
 #include <wlr/types/wlr_xdg_shell.h>
 #include <wlr/util/log.h>
index 99c1b847ab1fe859348ca3cdc4fc0446f43c0ba0..5288b6e97bab44e8b4602a53b972907a30f91f9a 100644 (file)
 #include <wlr/backend/wayland.h>
 #include <wlr/types/wlr_buffer.h>
 #include <wlr/types/wlr_drm_lease_v1.h>
+#include <wlr/types/wlr_gamma_control_v1.h>
 #include <wlr/types/wlr_output.h>
+#include <wlr/types/wlr_output_management_v1.h>
+#include <wlr/types/wlr_output_power_management_v1.h>
+#include <wlr/types/wlr_xcursor_manager.h>
 #include <wlr/types/wlr_xdg_output_v1.h>
 #include <wlr/types/wlr_scene.h>
 #include <wlr/util/region.h>
@@ -31,6 +35,7 @@
 #include "protocols/cosmic-workspaces.h"
 #include "protocols/ext-workspace.h"
 #include "regions.h"
+#include "session-lock.h"
 #include "view.h"
 #include "xwayland.h"
 
index cf7b96b1d3b123be066e80787fe47a828e5b017e..4b1c33cd6ed7cbd6531e37043b0b3fed2e520153 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include "overlay.h"
 #include <assert.h>
+#include <wlr/types/wlr_scene.h>
 #include "common/lab-scene-rect.h"
 #include "labwc.h"
 #include "output.h"
index 1b3b7a3f1014b4989d4f1bef49b733ce9a692aad..a932b903463427ceca1998979b134103b8dbdd92 100644 (file)
@@ -5,8 +5,14 @@
 #include <wlr/backend/libinput.h>
 #include <wlr/types/wlr_input_device.h>
 #include <wlr/types/wlr_keyboard.h>
+#include <wlr/types/wlr_keyboard_group.h>
+#include <wlr/types/wlr_layer_shell_v1.h>
 #include <wlr/types/wlr_pointer.h>
+#include <wlr/types/wlr_pointer_constraints_v1.h>
 #include <wlr/types/wlr_touch.h>
+#include <wlr/types/wlr_virtual_keyboard_v1.h>
+#include <wlr/types/wlr_virtual_pointer_v1.h>
+#include <wlr/types/wlr_xdg_shell.h>
 #include <wlr/util/log.h>
 #include "common/macros.h"
 #include "common/mem.h"
@@ -18,6 +24,7 @@
 #include "input/key-state.h"
 #include "labwc.h"
 #include "output.h"
+#include "session-lock.h"
 #include "view.h"
 
 static void
index ca24392af4c10a00abfddf5a5326533b8ee6cbe4..a9e021dc7640c54df1497a3a1f58920810531b4b 100644 (file)
@@ -6,25 +6,36 @@
 #include <sys/wait.h>
 #include <wlr/backend/headless.h>
 #include <wlr/backend/multi.h>
+#include <wlr/render/allocator.h>
 #include <wlr/types/wlr_alpha_modifier_v1.h>
 #include <wlr/types/wlr_data_control_v1.h>
-#include <wlr/types/wlr_ext_data_control_v1.h>
+#include <wlr/types/wlr_data_device.h>
 #include <wlr/types/wlr_drm.h>
+#include <wlr/types/wlr_drm_lease_v1.h>
 #include <wlr/types/wlr_export_dmabuf_v1.h>
+#include <wlr/types/wlr_ext_data_control_v1.h>
 #include <wlr/types/wlr_ext_foreign_toplevel_list_v1.h>
+#include <wlr/types/wlr_ext_image_capture_source_v1.h>
+#include <wlr/types/wlr_ext_image_copy_capture_v1.h>
 #include <wlr/types/wlr_foreign_toplevel_management_v1.h>
 #include <wlr/types/wlr_fractional_scale_v1.h>
 #include <wlr/types/wlr_gamma_control_v1.h>
+#include <wlr/types/wlr_input_method_v2.h>
 #include <wlr/types/wlr_linux_drm_syncobj_v1.h>
+#include <wlr/types/wlr_output_power_management_v1.h>
+#include <wlr/types/wlr_pointer_constraints_v1.h>
 #include <wlr/types/wlr_presentation_time.h>
 #include <wlr/types/wlr_primary_selection_v1.h>
+#include <wlr/types/wlr_relative_pointer_v1.h>
+#include <wlr/types/wlr_scene.h>
 #include <wlr/types/wlr_screencopy_v1.h>
-#include <wlr/types/wlr_ext_image_capture_source_v1.h>
-#include <wlr/types/wlr_ext_image_copy_capture_v1.h>
 #include <wlr/types/wlr_security_context_v1.h>
 #include <wlr/types/wlr_single_pixel_buffer_v1.h>
-#include <wlr/types/wlr_viewporter.h>
+#include <wlr/types/wlr_subcompositor.h>
 #include <wlr/types/wlr_tablet_v2.h>
+#include <wlr/types/wlr_tearing_control_v1.h>
+#include <wlr/types/wlr_text_input_v3.h>
+#include <wlr/types/wlr_viewporter.h>
 #include <wlr/types/wlr_xdg_foreign_registry.h>
 #include <wlr/types/wlr_xdg_foreign_v1.h>
 #include <wlr/types/wlr_xdg_foreign_v2.h>
@@ -52,6 +63,7 @@
 #include "output-virtual.h"
 #include "regions.h"
 #include "resize-indicator.h"
+#include "session-lock.h"
 #include "theme.h"
 #include "view.h"
 #include "workspaces.h"
index e96c65c69bfddd50dd6f8dd8fb82cf113f73e93e..26216ed6a02a59fe9180e5c7526ae9a8e3bff8d5 100644 (file)
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 #include <assert.h>
+#include <wlr/types/wlr_scene.h>
 #include "common/scene-helpers.h"
 #include "labwc.h"
 #include "ssd-internal.h"
index 90f12ce6993d5201fe25ee1fcaa13ab294565894..f8fdd9f0ffd5d491a7a2e267f6fdb9ec51149340 100644 (file)
@@ -2,6 +2,7 @@
 
 #include <assert.h>
 #include <pixman.h>
+#include <wlr/types/wlr_scene.h>
 #include "common/scene-helpers.h"
 #include "config/rcxml.h"
 #include "labwc.h"
index 29ee1ca2d5a9f720745cea80b00a6fb8284add79..8c1f88396db7393c75af2bd19e5e6efcd19a53ea 100644 (file)
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 #include <assert.h>
-#include "common/scene-helpers.h"
+#include <wlr/types/wlr_scene.h>
 #include "labwc.h"
 #include "buffer.h"
 #include "ssd-internal.h"
index 48d416b96300b9e25eecea6f2494b6a2c6264368..ac37f15ba6ca0fe8bea76cbc05e9c0e8b7283ed2 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <assert.h>
 #include <strings.h>
+#include <wlr/types/wlr_scene.h>
 #include "common/mem.h"
 #include "common/scene-helpers.h"
 #include "labwc.h"
index 50b0611cb2365de21e98ae7cee68f66d044f78ca..eaba51a01546be592156c2deb2606185b3dbde7c 100644 (file)
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
+#include <wlr/types/wlr_tearing_control_v1.h>
 #include "common/mem.h"
 #include "labwc.h"
 #include "view.h"
index 961c640b49353f62e035cabe6b8da5eb10681983..2d5ac12b9e883bdfe40078ec609abb35777725a4 100644 (file)
@@ -16,6 +16,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #include <wlr/util/box.h>
 #include <wlr/util/log.h>
 #include <wlr/render/pixman.h>
index 45b87458167826af0ab79674278795fc79d2ce6c..d6ac89b9c87d2312dc6b7f00ca2470587e735a0d 100644 (file)
@@ -2,8 +2,11 @@
 #include "view.h"
 #include <assert.h>
 #include <strings.h>
+#include <wlr/types/wlr_keyboard_group.h>
 #include <wlr/types/wlr_output_layout.h>
+#include <wlr/types/wlr_scene.h>
 #include <wlr/types/wlr_security_context_v1.h>
+#include <wlr/types/wlr_xdg_shell.h>
 #include "action.h"
 #include "buffer.h"
 #include "common/box.h"
@@ -21,6 +24,7 @@
 #include "placement.h"
 #include "regions.h"
 #include "resize-indicator.h"
+#include "session-lock.h"
 #include "snap-constraints.h"
 #include "snap.h"
 #include "ssd.h"
index 2057adf05b88431d8b9c3d7a08e22e407b81ec79..70215b80fecd93ca4208db6357097214ac2ffbfb 100644 (file)
@@ -8,6 +8,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <strings.h>
+#include <wlr/types/wlr_scene.h>
 #include "buffer.h"
 #include "common/font.h"
 #include "common/graphic-helpers.h"
index 23942b691167fcb1ca3497232cdd91147689e800..cc14d920dbe4fdfcdbb8f809ba79687daa8631a9 100644 (file)
@@ -7,6 +7,7 @@
  *     - keeping non-layer-shell xdg-popups outside the layers.c code
  */
 
+#include <wlr/types/wlr_xdg_shell.h>
 #include "common/macros.h"
 #include "common/mem.h"
 #include "labwc.h"
index f551c20445d5e9913fe2303cd80d2df68554fdf9..5a7a6176866eec127a81b7affb6fe75e568c379d 100644 (file)
--- a/src/xdg.c
+++ b/src/xdg.c
@@ -2,6 +2,8 @@
 
 #include <assert.h>
 #include <wlr/types/wlr_fractional_scale_v1.h>
+#include <wlr/types/wlr_xdg_activation_v1.h>
+#include <wlr/types/wlr_xdg_shell.h>
 #include <wlr/types/wlr_xdg_toplevel_icon_v1.h>
 #include "buffer.h"
 #include "common/array.h"
index 2fc15cfea8a2996957918deafccce2376fb32b13..b003e4ec58b09a4683a604a8aa4baa90cfdd6ff6 100644 (file)
@@ -1,5 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <assert.h>
+#include <wlr/types/wlr_compositor.h>
+#include <wlr/types/wlr_scene.h>
+#include <wlr/types/wlr_seat.h>
 #include <wlr/xwayland.h>
 #include "common/list.h"
 #include "common/macros.h"
index 097fc73104eeba3e6d3f3e064c0cd4a6537db779..e793916f8b3b9cdc76a596147b0eb9d2fe9a9f3d 100644 (file)
@@ -3,6 +3,9 @@
 #include "xwayland.h"
 #include <assert.h>
 #include <stdlib.h>
+#include <wlr/types/wlr_compositor.h>
+#include <wlr/types/wlr_seat.h>
+#include <wlr/types/wlr_xcursor_manager.h>
 #include <wlr/xwayland.h>
 #include "buffer.h"
 #include "common/array.h"