particle: fix from_conf() function pointer prototype

and add macro for common attributes (shared by all particles)
This commit is contained in:
Daniel Eklöf 2019-01-12 22:47:46 +01:00
parent 72edcf608c
commit c2db518a4f

View file

@ -15,9 +15,20 @@ struct exposable;
struct particle_info {
struct particle *(*from_conf)(const struct yml_node *node,
const struct font *parent_font);
const struct font *parent_font,
int left_margin, int right_margin,
const char *on_click_template);
size_t attr_count; /* TODO: reomve, NULL-terminate attr list instead */
const struct attr_info attrs[];
#define PARTICLE_COMMON_ATTRS_COUNT 4
#define PARTICLE_COMMON_ATTRS \
{"margin", false, &conf_verify_int}, \
{"left-margin", false, &conf_verify_int}, \
{"right-margin", false, &conf_verify_int}, \
{"on-click", false, &conf_verify_string}
};
struct particle {