forked from external/yambar
35 lines
948 B
C
35 lines
948 B
C
#include "empty.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
static int
|
|
begin_expose(struct exposable *exposable, cairo_t *cr)
|
|
{
|
|
exposable->width = exposable->particle->left_margin +
|
|
exposable->particle->right_margin;
|
|
return exposable->width;
|
|
}
|
|
|
|
static void
|
|
expose(const struct exposable *exposable, cairo_t *cr, int x, int y, int height)
|
|
{
|
|
exposable_render_deco(exposable, cr, x, y, height);
|
|
}
|
|
|
|
static struct exposable *
|
|
instantiate(const struct particle *particle, const struct tag_set *tags)
|
|
{
|
|
struct exposable *exposable = exposable_common_new(particle, NULL);
|
|
exposable->begin_expose = &begin_expose;
|
|
exposable->expose = &expose;
|
|
return exposable;
|
|
}
|
|
|
|
struct particle *
|
|
particle_empty_new(int left_margin, int right_margin)
|
|
{
|
|
struct particle *particle = particle_common_new(left_margin, right_margin, NULL);
|
|
particle->destroy = &particle_default_destroy;
|
|
particle->instantiate = &instantiate;
|
|
return particle;
|
|
}
|