aboutsummaryrefslogtreecommitdiff
path: root/src/gui/src/button_sprite.c
blob: 5bdc1b03a699bcf9e010b8e13f59f875b8095392 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <gui.h>
#include <gui/button.h>
#include <gui_private.h>
#include <gui_button_private.h>
#include <gfx.h>
#include <stdio.h>

int gui_button_render_sprite(const struct gui_button *const b)
{
    sprite_get_or_ret(s, -1);

    if (sprite_clone(b->u.sprite.s, s))
        return -1;

    gui_coords(&b->common, &s->x, &s->y);
    sprite_sort(s);
    return 0;
}

void gui_button_get_dim_sprite(const struct gui_button *const b,
    short *const w, short *const h)
{
    const struct sprite *const s = b->u.sprite.s;

    *w = s->w;
    *h = s->h;
}

void gui_button_init_sprite(struct gui_button *const b)
{
}