#include "include.h" #define TRACE_EN 0 #if TRACE_EN #define TRACE(...) printf(__VA_ARGS__) #else #define TRACE(...) #endif //创建一个形状 compo_shape_t *compo_shape_create(compo_form_t *frm, u8 shape_type) { compo_shape_t *shape = compo_create(frm, COMPO_TYPE_SHAPE); void *rect = widget_rect_create(frm->page); shape->rect = rect; shape->shape_type = shape_type; return shape; } //设置形状的坐标及大小 void compo_shape_set_location(compo_shape_t *shape, s16 x, s16 y, s16 width, s16 height) { widget_set_location(shape->rect, x, y, width, height); } //设置形状的坐标 void compo_shape_set_pos(compo_shape_t *shape, s16 x, s16 y) { widget_set_pos(shape->rect, x, y); } //设置形状的颜色 void compo_shape_set_color(compo_shape_t *shape, u16 color) { widget_rect_set_color(shape->rect, color); } //设置形状的透明度 void compo_shape_set_alpha(compo_shape_t *shape, u8 alpha) { widget_set_alpha(shape->rect, alpha); }