mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-20 03:35:41 +02:00
modules: move 'content' and 'anchors' to MODULE_COMMON_ATTRS
All modules implement these. The only one that differs is the i3 module. It still implements them, but 'content' uses an internal verifier function.
This commit is contained in:
parent
36e5dc0df8
commit
86522d653d
13 changed files with 3 additions and 23 deletions
2
module.h
2
module.h
|
@ -34,6 +34,8 @@ struct exposable *module_begin_expose(struct module *mod);
|
||||||
|
|
||||||
/* List of attributes *all* modules implement */
|
/* List of attributes *all* modules implement */
|
||||||
#define MODULE_COMMON_ATTRS \
|
#define MODULE_COMMON_ATTRS \
|
||||||
|
{"content", true, &conf_verify_particle}, \
|
||||||
|
{"anchors", false, NULL}, \
|
||||||
{"font", false, &conf_verify_font}, \
|
{"font", false, &conf_verify_font}, \
|
||||||
{"foreground", false, &conf_verify_color}, \
|
{"foreground", false, &conf_verify_color}, \
|
||||||
{NULL, false, NULL}
|
{NULL, false, NULL}
|
||||||
|
|
|
@ -302,8 +302,6 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
static const struct attr_info attrs[] = {
|
static const struct attr_info attrs[] = {
|
||||||
{"card", true, &conf_verify_string},
|
{"card", true, &conf_verify_string},
|
||||||
{"mixer", true, &conf_verify_string},
|
{"mixer", true, &conf_verify_string},
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -233,8 +233,6 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
{
|
{
|
||||||
static const struct attr_info attrs[] = {
|
static const struct attr_info attrs[] = {
|
||||||
{"name", true, &conf_verify_string},
|
{"name", true, &conf_verify_string},
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -360,8 +360,6 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
static const struct attr_info attrs[] = {
|
static const struct attr_info attrs[] = {
|
||||||
{"name", true, &conf_verify_string},
|
{"name", true, &conf_verify_string},
|
||||||
{"poll-interval", false, &conf_verify_int},
|
{"poll-interval", false, &conf_verify_int},
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -114,8 +114,6 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
static const struct attr_info attrs[] = {
|
static const struct attr_info attrs[] = {
|
||||||
{"date-format", false, &conf_verify_string},
|
{"date-format", false, &conf_verify_string},
|
||||||
{"time-format", false, &conf_verify_string},
|
{"time-format", false, &conf_verify_string},
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -651,7 +651,7 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
{"right-spacing", false, &conf_verify_int},
|
{"right-spacing", false, &conf_verify_int},
|
||||||
{"content", true, &verify_content},
|
{"content", true, &verify_content},
|
||||||
{"anchors", false, NULL},
|
{"anchors", false, NULL},
|
||||||
MODULE_COMMON_ATTRS,
|
{NULL, false, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
return conf_verify_dict(chain, node, attrs);
|
return conf_verify_dict(chain, node, attrs);
|
||||||
|
|
|
@ -59,8 +59,6 @@ static bool
|
||||||
verify_conf(keychain_t *chain, const struct yml_node *node)
|
verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
{
|
{
|
||||||
static const struct attr_info attrs[] = {
|
static const struct attr_info attrs[] = {
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -610,8 +610,6 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
static const struct attr_info attrs[] = {
|
static const struct attr_info attrs[] = {
|
||||||
{"host", true, &conf_verify_string},
|
{"host", true, &conf_verify_string},
|
||||||
{"port", false, &conf_verify_int},
|
{"port", false, &conf_verify_int},
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -544,8 +544,6 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
{
|
{
|
||||||
static const struct attr_info attrs[] = {
|
static const struct attr_info attrs[] = {
|
||||||
{"name", true, &conf_verify_string},
|
{"name", true, &conf_verify_string},
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -582,8 +582,6 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
{"spacing", false, &conf_verify_int},
|
{"spacing", false, &conf_verify_int},
|
||||||
{"left-spacing", false, &conf_verify_int},
|
{"left-spacing", false, &conf_verify_int},
|
||||||
{"right-spacing", false, &conf_verify_int},
|
{"right-spacing", false, &conf_verify_int},
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -350,8 +350,6 @@ verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
{"left-spacing", false, &conf_verify_int},
|
{"left-spacing", false, &conf_verify_int},
|
||||||
{"right-spacing", false, &conf_verify_int},
|
{"right-spacing", false, &conf_verify_int},
|
||||||
{"identifiers", true, &verify_identifiers},
|
{"identifiers", true, &verify_identifiers},
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -664,8 +664,6 @@ static bool
|
||||||
verify_conf(keychain_t *chain, const struct yml_node *node)
|
verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
{
|
{
|
||||||
static const struct attr_info attrs[] = {
|
static const struct attr_info attrs[] = {
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -346,8 +346,6 @@ static bool
|
||||||
verify_conf(keychain_t *chain, const struct yml_node *node)
|
verify_conf(keychain_t *chain, const struct yml_node *node)
|
||||||
{
|
{
|
||||||
static const struct attr_info attrs[] = {
|
static const struct attr_info attrs[] = {
|
||||||
{"content", true, &conf_verify_particle},
|
|
||||||
{"anchors", false, NULL},
|
|
||||||
MODULE_COMMON_ATTRS,
|
MODULE_COMMON_ATTRS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue