From e13bc7fc51e394c6a0b681c1d0017a9f3326a81a Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sun, 21 Oct 2018 02:56:50 +0100 Subject: [PATCH] Move common types to types.h Signed-off-by: Yuxuan Shui --- src/common.h | 26 +------------------------- src/region.h | 1 + src/types.h | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 src/types.h diff --git a/src/common.h b/src/common.h index 55fff91..bf97d38 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 e347d2e..a42f9f2 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 0000000..58d198c --- /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 }