Commit graph

24 commits

Author SHA1 Message Date
Daniel Eklöf
ea38ab3b2f particle/module: pass a cairo context to all begin_expose() 2019-02-28 20:10:26 +01:00
Daniel Eklöf
1cce649f06 Reduce header intra-dependencies 2019-01-13 19:42:16 +01:00
Daniel Eklöf
bc62843c91 modules: get rid of struct module_info
Since this struct only contained function pointers, make all modules
export those functions directly.

The plugin manager now defines a module interface struct, and fills it
it by dlsym:ing the functions that used to be in module_info.
2019-01-13 17:09:11 +01:00
Daniel Eklöf
8d26ff7de2 module: module->begin_expose() have been removed 2019-01-13 16:45:35 +01:00
Daniel Eklöf
76d135e257 module: remove module_run_context
Store abort_fd directly in the module struct instead. This then allows
us to pass the module pointer as-is to the modules' run functions.
2019-01-13 15:34:59 +01:00
Daniel Eklöf
acdeff3b6e module: remove ready_fd
All modules are expected to handle a call to content() after having
been instantiated.

I.e. modules *cannot* even expect run() to have started running.
2019-01-13 15:25:39 +01:00
Daniel Eklöf
825b0a16f8 module: remove module->begin_expose()
Replace with module_begin_expose()
2019-01-13 14:58:30 +01:00
Daniel Eklöf
4c577766d1 module: remove module->expose() and module->end_expose()
Bar now calls exposable->expose() and exposable->destroy() directly
2019-01-13 14:55:21 +01:00
Daniel Eklöf
33cba8b0ba module: remove module_expose_context 2019-01-13 14:52:28 +01:00
Daniel Eklöf
9276724113 module: remove 'with' from expose-context 2019-01-13 14:33:58 +01:00
Daniel Eklöf
a425378576 config: allow font/foreground attributes on modules too
Previously we allowed it on the bar, and on all particles. Now we also
allow it on all modules.

This allows us to specify a "default" font/foreground on a per-module
basis, having it applied to all the modules particles.
2019-01-13 14:24:44 +01:00
Daniel Eklöf
8dc278aaf2 config: pass a struct with inheritable values
For now, font and foreground color
2019-01-13 14:13:14 +01:00
Daniel Eklöf
9944a8f972 modules: don't assume module content is a dictionary
This is done by having each module implement a top-level verifier
function.
2019-01-13 11:54:57 +01:00
Daniel Eklöf
71515e4079 config: conf_verify_dict() now assumes attr list is NULL-terminated 2019-01-13 11:37:05 +01:00
Daniel Eklöf
eaf061ee57 module: define a struct for module meta data
* Function pointer; instantiates the module from a yml conf node
* Its (top-level) configuration attributes
2019-01-12 11:52:46 +01:00
Daniel Eklöf
558f75a54b module/particle: remove cairo context from begin_expose() 2019-01-09 18:50:26 +01:00
Daniel Eklöf
acda1a4b21 module: re-order function pointer declarations 2018-12-29 12:49:25 +01:00
Daniel Eklöf
5008008079 module: add a refresh_in() interface function
Modules can implement this to allow e.g. particles to force a refresh
after a certain amount of time.
2018-12-28 12:42:08 +01:00
Daniel Eklöf
3413232ed6 module: add new function module_signal_ready() 2018-12-19 20:23:53 +01:00
Daniel Eklöf
a3eb7ebc08 bar: wait for all modules to have started up before continuing
After starting all the module threads, wait for all modules to have
signalled "ready" before continuing.

This will allow modules to do initial setup, and knowing that
content() will *not* be called until they've signalled "ready".
2018-12-19 19:41:25 +01:00
Daniel Eklöf
7f0f096ba4 module: begin_expose() and content() take a non-const module pointer 2018-12-19 19:03:19 +01:00
Daniel Eklöf
edc418b22d 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).
2018-12-18 20:12:04 +01:00
Daniel Eklöf
5a155d1a8d module: add a 'private' member to expose context
This allows modules that override begin/end_context to supply their
own auxiliary data.
2018-11-17 17:14:53 +01:00
Daniel Eklöf
8bf8a398b9 initial commit: wip 2018-11-17 11:30:33 +01:00