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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
#include <stdio.h>
enum logger_level : int {
LOG_TRACE = 0,
LOG_DEBUG = 10,
LOG_INFO = 20,
LOG_WARN = 30,
LOG_ERROR = 40,
};
[[clang::import_module("logger")]] [[clang::import_name("log")]]
extern void logger_log(void);
[[clang::import_module("logger")]] [[clang::import_name("log-message")]]
extern void logger_log_message(char *message);
[[clang::import_module("logger")]] [[clang::import_name("add-argument-int")]]
extern void logger_add_argument_int(int arg);
[[clang::import_module("logger")]] [[clang::import_name("begin")]]
extern void logger_log_begin(enum logger_level level);
[[clang::import_module("screen")]] [[clang::import_name("set-background-size")]]
extern void set_background_size(int width, int height);
[[clang::import_module("screen")]] [[clang::import_name("set-background-texture-size")]]
extern void set_background_texture_size(int width, int height);
[[clang::import_module("text")]] [[clang::import_name("free")]]
extern void text_free(int handle);
[[clang::import_module("text")]] [[clang::import_name("literal")]]
extern int text_literal(char *text);
[[clang::import_module("text")]] [[clang::import_name("translatable")]]
extern int text_translatable(char *key);
[[clang::import_module("text")]] [[clang::import_name("translatable-arguments")]]
extern int text_arguments(char *key, int size, int *args);
[[clang::import_module("screen")]] [[clang::import_name("render-text-object")]]
extern void render_text_object(int handle, int x, int y, int color, bool shadow);
enum simulator_mode : int {
SIMULATOR_FULL = 0,
SIMULATOR_FAST = 1,
SIMULATOR_DEAF = 2,
};
[[clang::import_module("simulator")]] [[clang::import_name("get-mode")]]
extern enum simulator_mode simulator_get_mode();
[[clang::import_module("simulator")]] [[clang::import_name("get-volume")]]
extern int simulator_get_volume();
[[clang::import_module("simulator")]] [[clang::import_name("get-frequency")]]
extern int simulator_get_frequency();
[[clang::import_module("screen")]] [[clang::import_name("get-width")]]
extern int screen_get_width();
[[clang::import_module("screen")]] [[clang::import_name("get-height")]]
extern int screen_get_height();
[[clang::import_module("buttons")]] [[clang::import_name("set-dimensions")]]
extern int buttons_set_dimensions(int button, int x, int y, int width, int height);
[[clang::import_module("buttons")]] [[clang::import_name("set-base-layout")]]
extern void buttons_set_base_layout(int layout);
#define BACKGROUND_WIDTH 320
#define BACKGROUND_HEIGHT 100
void init() {
logger_log_begin(LOG_INFO);
logger_log_message("placeholder radio skin.");
set_background_size(BACKGROUND_WIDTH, BACKGROUND_HEIGHT);
buttons_set_base_layout(1);
int width = screen_get_width();
int height = screen_get_height();
int base_x = (width - BACKGROUND_WIDTH) / 2;
int base_y = (height - BACKGROUND_HEIGHT) / 2;
buttons_set_dimensions(0, base_x, base_y + 0, 320, 20);
buttons_set_dimensions(1, base_x, base_y + 20, 320, 20);
buttons_set_dimensions(2, base_x, base_y + 40, 320, 20);
buttons_set_dimensions(3, base_x, base_y + 60, 320, 20);
}
void render(int mouseX, int mouseY, float delta) {
}
|