Move common types to types.h

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2018-10-21 02:56:50 +01:00
parent 3ffc0c77ed
commit e13bc7fc51
3 changed files with 35 additions and 25 deletions

View File

@ -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 {

View File

@ -5,6 +5,7 @@
#include <pixman.h>
#include <stdio.h>
#include "utils.h"
typedef struct pixman_region32 pixman_region32_t;
typedef struct pixman_box32 pixman_box32_t;
typedef pixman_region32_t region_t;

33
src/types.h Normal file
View File

@ -0,0 +1,33 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com>
/// Some common types
#include <stdint.h>
/// 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 }