9#ifndef GP_WIDGET_SIZE_UNITS_H
10#define GP_WIDGET_SIZE_UNITS_H
12#include <widgets/gp_widget_types.h>
13#include <widgets/gp_widget_render.h>
25struct gp_widget_size {
39static inline unsigned int gp_widget_size_units_get(gp_widget_size *size,
40 const gp_widget_render_ctx *ctx)
42 return size->px + ctx->padd * size->pad +
43 gp_text_ascent(ctx->font) * size->asc;
54int gp_widget_size_units_parse(
const char *size, gp_widget_size *ret);
63#define GP_WIDGET_SIZE(px_val, pad_val, asc_val) \
64 ((gp_widget_size){.px = px_val, .pad = pad_val, .asc = asc_val})
70#define GP_WIDGET_SIZE_DEFAULT ((gp_widget_size){0xffff, 0xff, 0xff})
72#define GP_WIDGET_SIZE_EQ(a, b) (((a).px == (b).px) && \
73 ((a).pad == (b).pad) && \