Untangle headers

Thanks, clang -fmodules.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-08-10 00:56:04 +01:00
parent a01ec1ec94
commit 0ba7761bd5
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
20 changed files with 129 additions and 88 deletions

View File

@ -1,8 +1,10 @@
#include <string.h>
#include <xcb/xcb.h>
#include "atom.h"
#include "common.h"
#include "utils.h"
#include "log.h"
static inline void *atom_getter(void *ud, const char *atom_name, int *err) {
xcb_connection_t *c = ud;

View File

@ -8,6 +8,7 @@
#include "config.h"
#include "log.h"
#include "region.h"
#include "types.h"
#include "win.h"
extern struct backend_operations xrender_ops, dummy_ops;

View File

@ -5,6 +5,7 @@
#include <stdbool.h>
#include "config.h"
#include "compiler.h"
#include "driver.h"
#include "kernel.h"
@ -48,14 +49,6 @@ enum image_operations {
IMAGE_OP_RESIZE_TILE,
};
enum blur_method {
BLUR_METHOD_NONE = 0,
BLUR_METHOD_KERNEL,
BLUR_METHOD_BOX,
BLUR_METHOD_GAUSSIAN,
BLUR_METHOD_INVALID,
};
struct gaussian_blur_args {
int size;
double deviation;

View File

@ -1,6 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
#include <string.h>
#include <math.h>
#include <xcb/render.h>
#include <xcb/xcb_image.h>
#include <xcb/xcb_renderutil.h>
@ -9,6 +10,8 @@
#include "backend/backend_common.h"
#include "common.h"
#include "kernel.h"
#include "config.h"
#include "utils.h"
#include "log.h"
#include "win.h"
#include "x.h"

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) Yuxuan Shui <yshuiv7@gmail.com>
#include <stdlib.h>
#include <string.h>
#include <xcb/randr.h>
#include <xcb/xcb.h>
@ -7,6 +9,8 @@
#include "backend/backend.h"
#include "backend/driver.h"
#include "common.h"
#include "compiler.h"
#include "log.h"
enum driver detect_driver(xcb_connection_t *c, backend_t *backend_data, xcb_window_t window) {
enum driver ret = 0;

View File

@ -1,11 +1,17 @@
#include <uthash.h>
#include <xcb/xcb.h>
#include "backend/backend.h"
#include "backend/backend_common.h"
#include "common.h"
#include "compiler.h"
#include "config.h"
#include "log.h"
#include "region.h"
#include "types.h"
#include "uthash_extra.h"
#include "utils.h"
#include "x.h"
struct dummy_image {
xcb_pixmap_t pixmap;
@ -132,7 +138,6 @@ void *dummy_create_blur_context(struct backend_base *base attr_unused,
}
void dummy_destroy_blur_context(struct backend_base *base attr_unused, void *ctx attr_unused) {
}
void dummy_get_blur_size(void *ctx attr_unused, int *width, int *height) {

View File

@ -8,6 +8,7 @@
#include <string.h>
#include <xcb/render.h> // for xcb_render_fixed_t, XXX
#include "backend/backend.h"
#include "common.h"
#include "compiler.h"
#include "config.h"
@ -15,6 +16,7 @@
#include "log.h"
#include "region.h"
#include "string_utils.h"
#include "types.h"
#include "utils.h"
#include "backend/backend_common.h"

View File

@ -7,7 +7,6 @@
#include <string.h>
#include "backend/backend.h"
#include "config.h"
#include "log.h"
#include "region.h"

View File

@ -22,6 +22,7 @@
#include "utils.h"
#include "win.h"
#include "x.h"
#include "types.h"
typedef struct _xrender_data {
backend_t base;

View File

@ -1,5 +1,6 @@
#include <uthash.h>
#include "compiler.h"
#include "utils.h"
#include "cache.h"

View File

@ -36,6 +36,9 @@
#include <X11/Xlib.h>
#include <ev.h>
#include <pixman.h>
#include <xcb/xproto.h>
#include <xcb/render.h>
#include <xcb/sync.h>
#include "uthash_extra.h"
#ifdef CONFIG_OPENGL
@ -55,6 +58,8 @@
#include "region.h"
#include "types.h"
#include "utils.h"
#include "list.h"
#include "render.h"
#include "x.h"
// === Constants ===0
@ -75,6 +80,7 @@
typedef struct glx_fbconfig glx_fbconfig_t;
struct glx_session;
struct atom;
struct conv;
typedef struct _ignore {
struct _ignore *next;
@ -269,7 +275,7 @@ typedef struct session {
/// 1x1 white Picture.
xcb_render_picture_t white_picture;
/// Gaussian map of shadow.
conv *gaussian_map;
struct conv *gaussian_map;
// for shadow precomputation
/// A region in which shadow is not painted on.
region_t shadow_exclude_reg;

View File

@ -12,6 +12,7 @@
#include <X11/Xlib-xcb.h>
#include <X11/Xlib.h>
#include <X11/extensions/sync.h>
#include <X11/Xutil.h>
#include <fcntl.h>
#include <inttypes.h>
#include <stdio.h>

View File

@ -63,6 +63,9 @@ module config {
module xrescheck {
header "xrescheck.h"
}
module cache {
header "cache.h"
}
module backend {
module gl {
module gl_common {

View File

@ -19,13 +19,12 @@
#include <libconfig.h>
#endif
#include "backend/backend.h"
#include "compiler.h"
#include "kernel.h"
#include "log.h"
#include "region.h"
#include "win_defs.h"
#include "types.h"
#include "win.h"
typedef struct session session_t;
@ -56,6 +55,14 @@ typedef struct win_option {
double opacity;
} win_option_t;
enum blur_method {
BLUR_METHOD_NONE = 0,
BLUR_METHOD_KERNEL,
BLUR_METHOD_BOX,
BLUR_METHOD_GAUSSIAN,
BLUR_METHOD_INVALID,
};
typedef struct _c2_lptr c2_lptr_t;
/// Structure representing all options.

View File

@ -1,9 +1,12 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2019, Yuxuan Shui <yshuiv7@gmail.com>
#include <stdio.h>
#include <X11/Xlibint.h>
#include <X11/extensions/sync.h>
#include <xcb/randr.h>
#include <xcb/damage.h>
#include "atom.h"
#include "common.h"
@ -11,6 +14,11 @@
#include "compton.h"
#include "event.h"
#include "utils.h"
#include "region.h"
#include "config.h"
#include "x.h"
#include "win.h"
#include "log.h"
/// Event handling with X is complicated. Handling events with other events possibly
/// in-flight is no good. Because your internal state won't be up to date. Also, querying

View File

@ -19,6 +19,7 @@
#include "win.h"
#include <GL/gl.h>
#include <GL/glx.h>
#include <ctype.h>
#include <locale.h>
#include <stdlib.h>

View File

@ -33,6 +33,7 @@
#include "win.h"
#include "x.h"
#include "backend/backend.h"
#include "backend/backend_common.h"
#include "render.h"

View File

@ -14,7 +14,7 @@
#include <GL/gl.h>
#endif
#include "backend/backend.h"
#include "win_defs.h"
#include "c2.h"
#include "compiler.h"
#include "list.h"
@ -24,6 +24,7 @@
#include "utils.h"
#include "x.h"
struct backend_base;
typedef struct session session_t;
typedef struct _glx_texture glx_texture_t;
@ -49,79 +50,6 @@ typedef struct {
} glx_blur_cache_t;
#endif
typedef enum {
WINTYPE_UNKNOWN,
WINTYPE_DESKTOP,
WINTYPE_DOCK,
WINTYPE_TOOLBAR,
WINTYPE_MENU,
WINTYPE_UTILITY,
WINTYPE_SPLASH,
WINTYPE_DIALOG,
WINTYPE_NORMAL,
WINTYPE_DROPDOWN_MENU,
WINTYPE_POPUP_MENU,
WINTYPE_TOOLTIP,
WINTYPE_NOTIFICATION,
WINTYPE_COMBO,
WINTYPE_DND,
NUM_WINTYPES
} wintype_t;
/// Enumeration type of window painting mode.
typedef enum {
WMODE_TRANS, // The window body is (potentially) transparent
WMODE_FRAME_TRANS, // The window body is opaque, but the frame is not
WMODE_SOLID, // The window is opaque including the frame
} winmode_t;
/// Transition table:
/// (DESTROYED is when the win struct is destroyed and freed)
/// ('o' means in all other cases)
/// (Window is created in the UNMAPPED state)
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | |UNMAPPING|DESTROYING|MAPPING|FADING |UNMAPPED| MAPPED |DESTROYED|
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | UNMAPPING | o | Window |Window | - | Fading | - | - |
/// | | |destroyed |mapped | |finished| | |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | DESTROYING | - | o | - | - | - | - | Fading |
/// | | | | | | | |finished |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | MAPPING | Window | Window | o | - | - | Fading | - |
/// | |unmapped |destroyed | | | |finished| |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | FADING | Window | Window | - | o | - | Fading | - |
/// | |unmapped |destroyed | | | |finished| |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | UNMAPPED | - | - |Window | - | o | - | Window |
/// | | | |mapped | | | |destroyed|
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | MAPPED | Window | Window | - |Opacity| - | o | - |
/// | |unmapped |destroyed | |change | | | |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
typedef enum {
// The window is being faded out because it's unmapped.
WSTATE_UNMAPPING,
// The window is being faded out because it's destroyed,
WSTATE_DESTROYING,
// The window is being faded in
WSTATE_MAPPING,
// Window opacity is not at the target level
WSTATE_FADING,
// The window is mapped, no fading is in progress.
WSTATE_MAPPED,
// The window is unmapped, no fading is in progress.
WSTATE_UNMAPPED,
} winstate_t;
enum win_flags {
/// win_image/shadow_image is out of date
WIN_FLAGS_IMAGE_STALE = 1,
/// there was an error trying to bind the images
WIN_FLAGS_IMAGE_ERROR = 2,
};
/// An entry in the window stack. May or may not correspond to a window we know about.
struct window_stack_entry {
struct list_node stack_neighbour;
@ -324,7 +252,7 @@ struct managed_win {
#endif
};
void win_release_image(backend_t *base, struct managed_win *w);
void win_release_image(struct backend_base *base, struct managed_win *w);
bool must_use win_bind_image(session_t *ps, struct managed_win *w);
/// Attempt a rebind of window's images. If that failed, the original images are kept.

74
src/win_defs.h Normal file
View File

@ -0,0 +1,74 @@
#pragma once
typedef enum {
WINTYPE_UNKNOWN,
WINTYPE_DESKTOP,
WINTYPE_DOCK,
WINTYPE_TOOLBAR,
WINTYPE_MENU,
WINTYPE_UTILITY,
WINTYPE_SPLASH,
WINTYPE_DIALOG,
WINTYPE_NORMAL,
WINTYPE_DROPDOWN_MENU,
WINTYPE_POPUP_MENU,
WINTYPE_TOOLTIP,
WINTYPE_NOTIFICATION,
WINTYPE_COMBO,
WINTYPE_DND,
NUM_WINTYPES
} wintype_t;
/// Enumeration type of window painting mode.
typedef enum {
WMODE_TRANS, // The window body is (potentially) transparent
WMODE_FRAME_TRANS, // The window body is opaque, but the frame is not
WMODE_SOLID, // The window is opaque including the frame
} winmode_t;
/// Transition table:
/// (DESTROYED is when the win struct is destroyed and freed)
/// ('o' means in all other cases)
/// (Window is created in the UNMAPPED state)
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | |UNMAPPING|DESTROYING|MAPPING|FADING |UNMAPPED| MAPPED |DESTROYED|
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | UNMAPPING | o | Window |Window | - | Fading | - | - |
/// | | |destroyed |mapped | |finished| | |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | DESTROYING | - | o | - | - | - | - | Fading |
/// | | | | | | | |finished |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | MAPPING | Window | Window | o | - | - | Fading | - |
/// | |unmapped |destroyed | | | |finished| |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | FADING | Window | Window | - | o | - | Fading | - |
/// | |unmapped |destroyed | | | |finished| |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | UNMAPPED | - | - |Window | - | o | - | Window |
/// | | | |mapped | | | |destroyed|
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
/// | MAPPED | Window | Window | - |Opacity| - | o | - |
/// | |unmapped |destroyed | |change | | | |
/// +-------------+---------+----------+-------+-------+--------+--------+---------+
typedef enum {
// The window is being faded out because it's unmapped.
WSTATE_UNMAPPING,
// The window is being faded out because it's destroyed,
WSTATE_DESTROYING,
// The window is being faded in
WSTATE_MAPPING,
// Window opacity is not at the target level
WSTATE_FADING,
// The window is mapped, no fading is in progress.
WSTATE_MAPPED,
// The window is unmapped, no fading is in progress.
WSTATE_UNMAPPED,
} winstate_t;
enum win_flags {
/// win_image/shadow_image is out of date
WIN_FLAGS_IMAGE_STALE = 1,
/// there was an error trying to bind the images
WIN_FLAGS_IMAGE_ERROR = 2,
};

View File

@ -13,6 +13,7 @@
#include "compiler.h"
#include "kernel.h"
#include "region.h"
#include "log.h"
typedef struct session session_t;