62 lines
1.3 KiB
C
62 lines
1.3 KiB
C
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct monitor_t monitor_t;
|
|
typedef struct client_t client_t;
|
|
|
|
typedef struct layout_t {
|
|
const char *symbol;
|
|
void (*arrange)(monitor_t *monitor);
|
|
} layout_t;
|
|
|
|
#define TAG_SYMBOL_LENGTH 32
|
|
|
|
/* 避免引入 xcb 头文件 */
|
|
typedef uint32_t xcb_window_t;
|
|
|
|
struct monitor_t {
|
|
uint32_t index;
|
|
int32_t monitor_x, monitor_y, window_x, window_y;
|
|
uint32_t monitor_width, monitor_height, window_width, window_height;
|
|
|
|
uint32_t selected_tag;
|
|
uint32_t tag_count;
|
|
char (*tags)[TAG_SYMBOL_LENGTH];
|
|
|
|
/* 为了避免引入 cairo 相关头文件,这里用 void *
|
|
* 指针代替实际的指针类型,使用时强转为相应指针类型使用即可 */
|
|
void *surface; /* cairo_surface_t */
|
|
void *cr; /* cairo_t */
|
|
|
|
const layout_t *layout;
|
|
monitor_t *next;
|
|
|
|
client_t *clients;
|
|
client_t *clients_stack;
|
|
client_t *selected_client;
|
|
|
|
xcb_window_t bar_window;
|
|
};
|
|
|
|
struct client_t {
|
|
char name[256];
|
|
int32_t x, y;
|
|
uint32_t width, height, border_width;
|
|
uint32_t tags;
|
|
bool fullscreen;
|
|
bool floating;
|
|
|
|
monitor_t *monitor;
|
|
client_t *next;
|
|
client_t *stack_next;
|
|
|
|
xcb_window_t window;
|
|
};
|
|
|
|
typedef struct wallpaper_config_t {
|
|
uint32_t count;
|
|
char **path_list;
|
|
} wallpaper_config_t;
|