Improve the include situation

Slightly clean up header inclusion with the help of clang's module system.
It's better for files to include the things you need directly.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-01-18 23:30:44 +00:00
parent c93789f5e9
commit 1e0deea57f
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
17 changed files with 39 additions and 30 deletions

View File

@ -2,6 +2,7 @@
#include "backend.h"
#include "backend_common.h"
#include "kernel.h"
#include "common.h"
#include "x.h"

View File

@ -30,6 +30,7 @@
#include "common.h"
#include "win.h"
#include "c2.h"
#include "config.h"
#include "string_utils.h"
#include "utils.h"
#include "log.h"

View File

@ -27,29 +27,6 @@
// #define DEBUG_GLX_MARK 1
// #define DEBUG_GLX_PAINTREG 1
// Whether to enable PCRE regular expression support in blacklists, enabled
// by default
// #define CONFIG_REGEX_PCRE 1
// Whether to enable JIT support of libpcre. This may cause problems on PaX
// kernels.
// #define CONFIG_REGEX_PCRE_JIT 1
// Whether to enable parsing of configuration files using libconfig.
// #define CONFIG_LIBCONFIG 1
// Whether to enable DRM VSync support
// #define CONFIG_VSYNC_DRM 1
// Whether to enable OpenGL support (include GLSL, FBO)
// #define CONFIG_OPENGL 1
// Whether to enable DBus support with libdbus.
// #define CONFIG_DBUS 1
// Whether to enable X Sync support.
// #define CONFIG_XSYNC 1
// Whether to enable GLX Sync support.
// #define CONFIG_GLX_XSYNC 1
#ifndef COMPTON_VERSION
#define COMPTON_VERSION "unknown"
#endif
#define MAX_ALPHA (255)
// === Includes ===
@ -112,13 +89,10 @@
// FIXME This list of includes should get shorter
#include "types.h"
#include "win.h"
#include "x.h"
#include "region.h"
#include "log.h"
#include "utils.h"
#include "compiler.h"
#include "kernel.h"
#include "options.h"
#include "render.h"
#include "config.h"
// === Constants ===

View File

@ -23,6 +23,7 @@
#include <ev.h>
#include "common.h"
#include "compiler.h"
#include "compton.h"
#ifdef CONFIG_OPENGL
@ -35,6 +36,9 @@
#include "string_utils.h"
#include "render.h"
#include "utils.h"
#include "region.h"
#include "types.h"
#include "c2.h"
#include "kernel.h"
#include "vsync.h"
#include "log.h"

View File

@ -34,6 +34,10 @@
#include "x.h"
#include "c2.h"
#include "log.h" // XXX clean up
#include "region.h"
#include "compiler.h"
#include "types.h"
#include "utils.h"
#include "render.h"
// == Functions ==

View File

@ -8,12 +8,21 @@
/// Used for command line arguments and config files
#include <stdbool.h>
#include <ctype.h>
#include <strings.h>
#include <xcb/xfixes.h>
#ifdef CONFIG_LIBCONFIG
#include <libconfig.h>
#endif
#include "common.h"
#include "region.h"
#include "log.h"
#include "compiler.h"
#include "win.h"
#include "types.h"
typedef struct session session_t;
/// VSync modes.
typedef enum {

View File

@ -14,6 +14,7 @@
#include <sys/types.h>
#include "common.h"
#include "config.h"
#include "compiler.h"
#include "win.h"
#include "string_utils.h"

View File

@ -2,6 +2,7 @@
// Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com>
#include "diagnostic.h"
#include "config.h"
#include "common.h"
void print_diagnostics(session_t *ps) {

View File

@ -12,6 +12,7 @@
#include "compiler.h"
#include "string_utils.h"
#include "log.h"
#include "config.h"
#include "opengl.h"

View File

@ -12,6 +12,10 @@
#pragma once
#include "common.h"
#include "region.h"
#include "render.h"
#include "compiler.h"
#include "win.h"
#include "log.h"
#include <ctype.h>

View File

@ -12,6 +12,7 @@
#include "vsync.h"
#include "win.h"
#include "kernel.h"
#include "backend/backend_common.h"
#include "render.h"

View File

@ -3,7 +3,7 @@
#pragma once
#include <xcb/render.h>
#include <xcb/xcb_image.h>
#include <stdbool.h>
#include "region.h"
typedef struct _glx_texture glx_texture_t;

View File

@ -19,6 +19,7 @@
#include <sys/ioctl.h>
#endif
#include "config.h"
#include "vsync.h"
#ifdef CONFIG_VSYNC_DRM

View File

@ -10,6 +10,7 @@
#include "compiler.h"
#include "common.h"
#include "config.h"
#include "compton.h"
#include "c2.h"
#include "x.h"

View File

@ -11,6 +11,8 @@
#endif
#include "x.h"
#include "compiler.h"
#include "region.h"
#include "types.h"
#include "c2.h"
#include "render.h"

View File

@ -8,6 +8,8 @@
#include <xcb/sync.h>
#include <pixman.h>
#include "utils.h"
#include "region.h"
#include "compiler.h"
#include "common.h"
#include "x.h"

View File

@ -3,12 +3,14 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <xcb/xcb.h>
#include <xcb/render.h>
#include <xcb/sync.h>
#include <xcb/xfixes.h>
#include <xcb/xcb_renderutil.h>
#include "compiler.h"
#include "region.h"
typedef struct session session_t;