diff --git a/src/common.h b/src/common.h index 55fff919..bf97d382 100644 --- a/src/common.h +++ b/src/common.h @@ -167,6 +167,7 @@ #include "xrescheck.h" #endif +#include "types.h" #include "x.h" #include "region.h" @@ -220,7 +221,6 @@ // === Types === -typedef uint32_t opacity_t; typedef long time_ms_t; typedef struct _c2_lptr c2_lptr_t; @@ -243,31 +243,7 @@ typedef enum { NUM_WINTYPES } wintype_t; -/// Enumeration type to represent switches. -typedef enum { - OFF, // false - ON, // true - UNSET -} switch_t; - -/// Structure representing a X geometry. -typedef struct { - int wid; - int hei; - int x; - int y; -} geometry_t; - -/// A structure representing margins around a rectangle. -typedef struct { - int top; - int left; - int bottom; - int right; -} margin_t; - // Or use cmemzero(). -#define MARGIN_INIT { 0, 0, 0, 0 } /// Enumeration type of window painting mode. typedef enum { diff --git a/src/region.h b/src/region.h index e347d2ed..a42f9f2e 100644 --- a/src/region.h +++ b/src/region.h @@ -5,6 +5,7 @@ #include #include #include "utils.h" + typedef struct pixman_region32 pixman_region32_t; typedef struct pixman_box32 pixman_box32_t; typedef pixman_region32_t region_t; diff --git a/src/types.h b/src/types.h new file mode 100644 index 00000000..58d198c7 --- /dev/null +++ b/src/types.h @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: MPL-2.0 +// Copyright (c) 2018 Yuxuan Shui + +/// Some common types + +#include + +/// Enumeration type to represent switches. +typedef enum { + OFF, // false + ON, // true + UNSET +} switch_t; + +/// Structure representing a X geometry. +typedef struct { + int wid; + int hei; + int x; + int y; +} geometry_t; + +/// A structure representing margins around a rectangle. +typedef struct { + int top; + int left; + int bottom; + int right; +} margin_t; + +typedef uint32_t opacity_t; + +#define MARGIN_INIT { 0, 0, 0, 0 }