feat(bar): 实现 bar_draw 渲染骨架及文字排版绘制接口

This commit is contained in:
2026-06-08 22:57:34 +08:00
parent 62f6bab611
commit 8c145fb1b4
5 changed files with 126 additions and 0 deletions

View File

@@ -1,9 +1,27 @@
#pragma once
#include <cairo.h>
#include <stdint.h>
#include <zdwm/types.h>
#include "base/color.h"
typedef struct text_context_t text_context_t;
text_context_t *
text_context_create(const char *family, uint32_t size, uint32_t dpi);
void text_context_destory(text_context_t *context);
void text_context_get_text_size(
text_context_t *context,
const char *text,
int32_t *width,
int32_t *height
);
void draw_text(
cairo_t *cr,
text_context_t *context,
const char *text,
color_t *color,
zdwm_rect_t area
);
void draw_background(cairo_t *cr, color_t *color, zdwm_rect_t area);