mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-19 19:25:41 +02:00
particle/module: pass a cairo context to all begin_expose()
This commit is contained in:
parent
35e9d0e25c
commit
ea38ab3b2f
10 changed files with 16 additions and 16 deletions
4
module.c
4
module.c
|
@ -20,9 +20,9 @@ module_default_destroy(struct module *mod)
|
|||
}
|
||||
|
||||
struct exposable *
|
||||
module_begin_expose(struct module *mod)
|
||||
module_begin_expose(struct module *mod, cairo_t *cr)
|
||||
{
|
||||
struct exposable *e = mod->content(mod);
|
||||
e->begin_expose(e);
|
||||
e->begin_expose(e, cr);
|
||||
return e;
|
||||
}
|
||||
|
|
2
module.h
2
module.h
|
@ -30,7 +30,7 @@ struct module {
|
|||
|
||||
struct module *module_common_new(void);
|
||||
void module_default_destroy(struct module *mod);
|
||||
struct exposable *module_begin_expose(struct module *mod);
|
||||
struct exposable *module_begin_expose(struct module *mod, cairo_t *cr);
|
||||
|
||||
/* List of attributes *all* modules implement */
|
||||
#define MODULE_COMMON_ATTRS \
|
||||
|
|
|
@ -36,7 +36,7 @@ struct exposable {
|
|||
char *on_click;
|
||||
|
||||
void (*destroy)(struct exposable *exposable);
|
||||
int (*begin_expose)(struct exposable *exposable);
|
||||
int (*begin_expose)(struct exposable *exposable, cairo_t *cr);
|
||||
void (*expose)(const struct exposable *exposable, cairo_t *cr,
|
||||
int x, int y, int height);
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ dynlist_destroy(struct exposable *exposable)
|
|||
}
|
||||
|
||||
static int
|
||||
dynlist_begin_expose(struct exposable *exposable)
|
||||
dynlist_begin_expose(struct exposable *exposable, cairo_t *cr)
|
||||
{
|
||||
const struct private *e = exposable->private;
|
||||
|
||||
|
@ -39,7 +39,7 @@ dynlist_begin_expose(struct exposable *exposable)
|
|||
|
||||
for (size_t i = 0; i < e->count; i++) {
|
||||
struct exposable *ee = e->exposables[i];
|
||||
e->widths[i] = ee->begin_expose(ee);
|
||||
e->widths[i] = ee->begin_expose(ee, cr);
|
||||
|
||||
exposable->width += e->left_spacing + e->widths[i] + e->right_spacing;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "../plugin.h"
|
||||
|
||||
static int
|
||||
begin_expose(struct exposable *exposable)
|
||||
begin_expose(struct exposable *exposable, cairo_t *cr)
|
||||
{
|
||||
exposable->width = exposable->particle->left_margin +
|
||||
exposable->particle->right_margin;
|
||||
|
|
|
@ -36,7 +36,7 @@ exposable_destroy(struct exposable *exposable)
|
|||
}
|
||||
|
||||
static int
|
||||
begin_expose(struct exposable *exposable)
|
||||
begin_expose(struct exposable *exposable, cairo_t *cr)
|
||||
{
|
||||
const struct eprivate *e = exposable->private;
|
||||
|
||||
|
@ -44,7 +44,7 @@ begin_expose(struct exposable *exposable)
|
|||
|
||||
for (size_t i = 0; i < e->count; i++) {
|
||||
struct exposable *ee = e->exposables[i];
|
||||
e->widths[i] = ee->begin_expose(ee);
|
||||
e->widths[i] = ee->begin_expose(ee, cr);
|
||||
|
||||
exposable->width += e->left_spacing + e->widths[i] + e->right_spacing;
|
||||
}
|
||||
|
|
|
@ -36,13 +36,13 @@ exposable_destroy(struct exposable *exposable)
|
|||
}
|
||||
|
||||
static int
|
||||
begin_expose(struct exposable *exposable)
|
||||
begin_expose(struct exposable *exposable, cairo_t *cr)
|
||||
{
|
||||
struct eprivate *e = exposable->private;
|
||||
|
||||
exposable->width = (
|
||||
exposable->particle->left_margin +
|
||||
e->exposable->begin_expose(e->exposable) +
|
||||
e->exposable->begin_expose(e->exposable, cr) +
|
||||
exposable->particle->right_margin);
|
||||
|
||||
return exposable->width;
|
||||
|
|
|
@ -54,7 +54,7 @@ exposable_destroy(struct exposable *exposable)
|
|||
}
|
||||
|
||||
static int
|
||||
begin_expose(struct exposable *exposable)
|
||||
begin_expose(struct exposable *exposable, cairo_t *cr)
|
||||
{
|
||||
struct eprivate *e = exposable->private;
|
||||
|
||||
|
@ -64,7 +64,7 @@ begin_expose(struct exposable *exposable)
|
|||
|
||||
/* Sub-exposables */
|
||||
for (size_t i = 0; i < e->count; i++)
|
||||
exposable->width += e->exposables[i]->begin_expose(e->exposables[i]);
|
||||
exposable->width += e->exposables[i]->begin_expose(e->exposables[i], cr);
|
||||
|
||||
return exposable->width;
|
||||
}
|
||||
|
|
|
@ -30,13 +30,13 @@ exposable_destroy(struct exposable *exposable)
|
|||
}
|
||||
|
||||
static int
|
||||
begin_expose(struct exposable *exposable)
|
||||
begin_expose(struct exposable *exposable, cairo_t *cr)
|
||||
{
|
||||
struct eprivate *e = exposable->private;
|
||||
|
||||
exposable->width = (
|
||||
exposable->particle->left_margin +
|
||||
e->exposable->begin_expose(e->exposable) +
|
||||
e->exposable->begin_expose(e->exposable, cr) +
|
||||
exposable->particle->right_margin);
|
||||
|
||||
return exposable->width;
|
||||
|
|
|
@ -44,7 +44,7 @@ exposable_destroy(struct exposable *exposable)
|
|||
}
|
||||
|
||||
static int
|
||||
begin_expose(struct exposable *exposable)
|
||||
begin_expose(struct exposable *exposable, cairo_t *cr)
|
||||
{
|
||||
struct eprivate *e = exposable->private;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue