Subversion Repositories freemyipod

Rev

Rev 509 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
504 theseven 1
//
2
//
3
//    Copyright 2011 TheSeven
4
//
5
//
6
//    This file is part of emCORE.
7
//
8
//    emCORE is free software: you can redistribute it and/or
9
//    modify it under the terms of the GNU General Public License as
10
//    published by the Free Software Foundation, either version 2 of the
11
//    License, or (at your option) any later version.
12
//
13
//    emCORE is distributed in the hope that it will be useful,
14
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
//    See the GNU General Public License for more details.
17
//
18
//    You should have received a copy of the GNU General Public License along
19
//    with emCORE.  If not, see <http://www.gnu.org/licenses/>.
20
//
21
//
22
 
23
 
24
#ifndef __LIBUI_H__
25
#define __LIBUI_H__
26
 
27
 
28
struct libui_buffer
29
{
30
    void* addr;
31
    int stride;
32
};
509 theseven 33
#define LIBUI_BUFFER(a, b) \
34
{                          \
35
    .addr = a,             \
36
    .stride = b            \
37
}
820 theseven 38
#define LIBUI_BUFFER_NULL LIBUI_BUFFER(NULL, 0)
504 theseven 39
 
40
struct libui_point
41
{
42
    int x;
43
    int y;
44
};
509 theseven 45
#define LIBUI_POINT(a, b) \
46
{                         \
47
    .x = a,               \
48
    .y = b                \
49
}
820 theseven 50
#define LIBUI_POINT_NULL LIBUI_POINT(0, 0)
504 theseven 51
 
52
struct libui_box
53
{
54
    struct libui_point pos;
55
    struct libui_point size;
56
};
509 theseven 57
#define LIBUI_BOX(a, b) \
58
{                       \
59
    .pos = a,           \
60
    .size = b           \
61
}
820 theseven 62
#define LIBUI_BOX_NULL LIBUI_BOX(LIBUI_POINT_NULL, LIBUI_POINT_NULL)
504 theseven 63
 
64
struct libui_location
65
{
66
    struct libui_buffer buf;
67
    struct libui_point pos;
68
};
509 theseven 69
#define LIBUI_LOCATION(a, b) \
70
{                            \
71
    .buf = a,                \
72
    .pos = b                 \
73
}
820 theseven 74
#define LIBUI_LOCATION_NULL LIBUI_LOCATION(LIBUI_BUFFER_NULL, LIBUI_POINT_NULL)
504 theseven 75
 
76
struct libui_surface
77
{
78
    struct libui_location loc;
79
    struct libui_point size;
80
};
509 theseven 81
#define LIBUI_SURFACE(a, b) \
82
{                           \
83
    .loc = a,               \
84
    .size = b               \
85
}
820 theseven 86
#define LIBUI_SURFACE_NULL LIBUI_SURFACE(LIBUI_LOCATION_NULL, LIBUI_POINT_NULL)
504 theseven 87
 
88
#endif