-
Notifications
You must be signed in to change notification settings - Fork 1
/
module.h
43 lines (31 loc) · 1.12 KB
/
module.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include <threads.h>
#include "particle.h"
struct bar;
struct module {
const struct bar *bar;
int abort_fd;
mtx_t lock;
void *private;
int (*run)(struct module *mod);
void (*destroy)(struct module *module);
/*
* Called by module_begin_expose(). Should return an
* exposable (an instantiated particle).
*/
struct exposable *(*content)(struct module *mod);
/* refresh_in() should schedule a module content refresh after the
* specified number of milliseconds */
bool (*refresh_in)(struct module *mod, long milli_seconds);
const char *(*description)(struct module *mod);
};
struct module *module_common_new(void);
void module_default_destroy(struct module *mod);
struct exposable *module_begin_expose(struct module *mod);
/* List of attributes *all* modules implement */
#define MODULE_COMMON_ATTRS \
{"content", true, &conf_verify_particle}, \
{"anchors", false, NULL}, \
{"font", false, &conf_verify_font}, \
{"foreground", false, &conf_verify_color}, \
{NULL, false, NULL}