2018-10-21 01:56:50 +00:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
// Copyright (c) 2018 Yuxuan Shui <yshuiv7@gmail.com>
|
|
|
|
|
2018-10-21 02:10:12 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-10-21 01:56:50 +00:00
|
|
|
/// Some common types
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/// Enumeration type to represent switches.
|
|
|
|
typedef enum {
|
2019-03-10 12:34:37 +00:00
|
|
|
OFF = 0, // false
|
|
|
|
ON, // true
|
|
|
|
UNSET
|
2018-10-21 01:56:50 +00:00
|
|
|
} switch_t;
|
|
|
|
|
|
|
|
/// A structure representing margins around a rectangle.
|
|
|
|
typedef struct {
|
2019-03-30 10:19:31 +00:00
|
|
|
int top;
|
|
|
|
int left;
|
|
|
|
int bottom;
|
|
|
|
int right;
|
2018-10-21 01:56:50 +00:00
|
|
|
} margin_t;
|
|
|
|
|
2019-05-10 07:34:58 +00:00
|
|
|
struct color {
|
|
|
|
double red, green, blue, alpha;
|
|
|
|
};
|
|
|
|
|
2018-10-21 01:56:50 +00:00
|
|
|
typedef uint32_t opacity_t;
|
|
|
|
|
2019-03-10 12:34:37 +00:00
|
|
|
#define MARGIN_INIT \
|
|
|
|
{ 0, 0, 0, 0 }
|