Hotpot-proto/btk/btk-utils.h
2022-07-06 22:11:17 -04:00

76 lines
1.4 KiB
C

#include <cairo/cairo.h>
#include <stdint.h>
#define BTK_MIN(a, b) (a < b ? a : b)
#define BTK_MAX(a, b) (a > b ? a : b)
enum btk_label_justify {
BTK_JUSTIFY_LEFT,
BTK_JUSTIFY_RIGHT
};
typedef struct {
float r, g, b;
} btk_rgb_t;
typedef struct {
float r, g, b, a;
} btk_rgba_t;
typedef struct {
int x, y;
} btk_pos_t;
typedef struct {
unsigned int w, h;
} btk_size_t;
typedef struct {
int x, y;
unsigned int w, h;
} btk_area_t;
/* cairo related */
typedef struct {
cairo_surface_t *c_srf;
cairo_t *c_ctx;
} btk_field_t;
typedef struct {
int i;
float f;
char *c;
void *p;
} btk_arg_t;
/* xcb related */
typedef struct
{
uint32_t flags;
int32_t x, y;
int32_t w, h;
int32_t min_w, min_h;
int32_t max_w, max_h;
int32_t w_inc, h_inc;
int32_t min_aspect_num, min_aspect_den;
int32_t max_aspect_num, max_aspect_den;
int32_t base_w, base_h;
uint32_t gravity;
} btk_wm_size_hint_t;
enum btk_wm_size_hint_flags
{
BTK_WM_SIZE_HINT_US_POSITION = 1U << 0,
BTK_WM_SIZE_HINT_US_SIZE = 1U << 1,
BTK_WM_SIZE_HINT_P_POSITION = 1U << 2,
BTK_WM_SIZE_HINT_P_SIZE = 1U << 3,
BTK_WM_SIZE_HINT_P_MIN_SIZE = 1U << 4,
BTK_WM_SIZE_HINT_P_MAX_SIZE = 1U << 5,
BTK_WM_SIZE_HINT_P_RESIZE_INC = 1U << 6,
BTK_WM_SIZE_HINT_P_ASPECT = 1U << 7,
BTK_WM_SIZE_HINT_BASE_SIZE = 1U << 8,
BTK_WM_SIZE_HINT_P_WIN_GRAVITY = 1U << 9
};