forked from external/yambar
particle: fix from_conf() function pointer prototype
and add macro for common attributes (shared by all particles)
This commit is contained in:
parent
72edcf608c
commit
c2db518a4f
1 changed files with 12 additions and 1 deletions
13
particle.h
13
particle.h
|
@ -15,9 +15,20 @@ struct exposable;
|
||||||
|
|
||||||
struct particle_info {
|
struct particle_info {
|
||||||
struct particle *(*from_conf)(const struct yml_node *node,
|
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 */
|
size_t attr_count; /* TODO: reomve, NULL-terminate attr list instead */
|
||||||
const struct attr_info attrs[];
|
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 {
|
struct particle {
|
||||||
|
|
Loading…
Add table
Reference in a new issue