From c2db518a4f086c4eb068c5552724b53b11c09be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 12 Jan 2019 22:47:46 +0100 Subject: [PATCH] particle: fix from_conf() function pointer prototype and add macro for common attributes (shared by all particles) --- particle.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/particle.h b/particle.h index 8bbaa48..6bf1621 100644 --- a/particle.h +++ b/particle.h @@ -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 {