forked from external/yambar
module: provide a "common" constructor and destructor
Also, provide a lock for module to use (to ensure run() and content() doesn't step on each other's toes).
This commit is contained in:
parent
3618b863ff
commit
edc418b22d
2 changed files with 29 additions and 0 deletions
6
module.h
6
module.h
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <threads.h>
|
||||
#include <cairo.h>
|
||||
|
||||
#include "particle.h"
|
||||
|
@ -21,6 +22,7 @@ struct module_expose_context {
|
|||
|
||||
struct module {
|
||||
const struct bar *bar;
|
||||
mtx_t lock;
|
||||
|
||||
void *private;
|
||||
|
||||
|
@ -35,6 +37,10 @@ struct module {
|
|||
void (*end_expose)(const struct module *mod, struct module_expose_context *ctx);
|
||||
};
|
||||
|
||||
struct module *module_common_new(void);
|
||||
|
||||
void module_default_destroy(struct module *mod);
|
||||
|
||||
struct module_expose_context module_default_begin_expose(
|
||||
const struct module *mod, cairo_t *cr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue