创建每个屏幕对应的信息条窗口
This commit is contained in:
@@ -8,3 +8,7 @@ uint32_t *generate_wallpaper(const wallpaper_config_t *wallpaper_config,
|
||||
const monitor_t *monitors, const uint32_t index,
|
||||
const uint32_t screen_width,
|
||||
const uint32_t screen_height);
|
||||
|
||||
uint32_t get_font_height(const char *font_family, const uint32_t font_size,
|
||||
const uint32_t dpi);
|
||||
void clean_pango_context(void);
|
||||
|
||||
@@ -24,7 +24,6 @@ struct monitor_t {
|
||||
|
||||
/* 为了避免引入 cairo 相关头文件,这里用 void *
|
||||
* 指针代替实际的指针类型,使用时强转为相应指针类型使用即可 */
|
||||
void *surface; /* cairo_surface_t */
|
||||
void *cr; /* cairo_t */
|
||||
|
||||
const layout_t *layout;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <X11/cursorfont.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <xcb/xproto.h>
|
||||
@@ -7,6 +8,28 @@
|
||||
bool has_other_wm_running(void);
|
||||
int get_xcb_connection_fd(void);
|
||||
|
||||
typedef enum cursor_t {
|
||||
cursor_normal = XC_left_ptr,
|
||||
cursor_resize = XC_bottom_right_corner,
|
||||
cursor_move = XC_fleur,
|
||||
} cursor_t;
|
||||
void change_window_cursor(xcb_window_t window, cursor_t cursor);
|
||||
void set_root_cursor(cursor_t cursor);
|
||||
|
||||
typedef struct bar_cairo_params_t {
|
||||
xcb_connection_t *conn;
|
||||
xcb_window_t window;
|
||||
xcb_visualtype_t *visual;
|
||||
} bar_cairo_params_t;
|
||||
/**
|
||||
* @brief 创建每个屏幕的 bar 窗口
|
||||
* @returns 返回创建 cairo surface 需要的参数,使用完记得使用 free 释放内存
|
||||
*/
|
||||
bar_cairo_params_t *create_bar_window(int16_t x, int16_t y, uint16_t width,
|
||||
uint16_t height, uint32_t background_argb,
|
||||
cursor_t cursor);
|
||||
void destroy_window(xcb_window_t window);
|
||||
|
||||
typedef struct monitor_rect_t monitor_rect_t;
|
||||
struct monitor_rect_t {
|
||||
int32_t x;
|
||||
|
||||
Reference in New Issue
Block a user