diff --git a/bar.c b/bar.c index c3d658f..007fbf2 100644 --- a/bar.c +++ b/bar.c @@ -148,7 +148,7 @@ expose(const struct bar *_bar) if (e != NULL) e->destroy(e); - bar->left.exps[i] = m->begin_expose(m); + bar->left.exps[i] = module_begin_expose(m); } for (size_t i = 0; i < bar->center.count; i++) { @@ -158,7 +158,7 @@ expose(const struct bar *_bar) if (e != NULL) e->destroy(e); - bar->center.exps[i] = m->begin_expose(m); + bar->center.exps[i] = module_begin_expose(m); } for (size_t i = 0; i < bar->right.count; i++) { @@ -168,7 +168,7 @@ expose(const struct bar *_bar) if (e != NULL) e->destroy(e); - bar->right.exps[i] = m->begin_expose(m); + bar->right.exps[i] = module_begin_expose(m); } int left_width, center_width, right_width; diff --git a/module.c b/module.c index f999cc2..be2099d 100644 --- a/module.c +++ b/module.c @@ -10,9 +10,7 @@ module_common_new(void) mod->bar = NULL; mtx_init(&mod->lock, mtx_plain); mod->private = NULL; - mod->destroy = &module_default_destroy; - mod->begin_expose = &module_default_begin_expose; /* No defaults for these; must be provided by implementation */ mod->run = NULL; @@ -36,7 +34,7 @@ module_signal_ready(struct module_run_context *ctx) } struct exposable * -module_default_begin_expose(struct module *mod) +module_begin_expose(struct module *mod) { struct exposable *e = mod->content(mod); e->begin_expose(e); diff --git a/module.h b/module.h index c942b7a..c82ef76 100644 --- a/module.h +++ b/module.h @@ -38,7 +38,7 @@ struct module { void (*destroy)(struct module *module); /* - * Called by module_default_begin_expose(). Should return an + * Called by module_begin_expose(). Should return an * exposable (an instantiated particle). * * You may also choose to implement begin_expose(), expose() and @@ -50,28 +50,10 @@ struct module { /* refresh_in() should schedule a module content refresh after the * specified number of milliseconds */ bool (*refresh_in)(struct module *mod, long milli_seconds); - - /* - * Called by bar when it needs to refresh - * - * begin_expose() should return a module_expose_context, where the - * 'exposable' member is an instantiated particle, 'width' is the - * total width of the module, and 'private' is context data for - * the module (i.e. it's not touched by the bar). - * - * expose() should render the exposable - * - * end_expose() performs cleanup (destroy exposable etc) - * - * Note that for most modules, using the default implementations - * (module_default_*) is good enough. In this case, implement - * 'content()' instead (see above). - */ - struct exposable *(*begin_expose)(struct module *mod); }; struct module *module_common_new(void); void module_default_destroy(struct module *mod); void module_signal_ready(struct module_run_context *ctx); -struct exposable *module_default_begin_expose(struct module *mod); +struct exposable *module_begin_expose(struct module *mod);