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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
// Programmed by Jedidiah Barber
// Released into the public domain
#include <FL/Fl_Spinner.H>
#include "c_fl_spinner.h"
// Exports from Ada
extern "C" void widget_draw_hook(void * ud);
extern "C" int widget_handle_hook(void * ud, int e);
// Attaching all hooks and friends
class My_Spinner : public Fl_Spinner {
public:
using Fl_Spinner::Fl_Spinner;
friend void fl_spinner_draw(SPINNER n);
friend int fl_spinner_handle(SPINNER n, int e);
void draw();
int handle(int e);
};
void My_Spinner::draw() {
widget_draw_hook(this->user_data());
}
int My_Spinner::handle(int e) {
return widget_handle_hook(this->user_data(), e);
}
// Flattened C API
SPINNER new_fl_spinner(int x, int y, int w, int h, char* label) {
My_Spinner *n = new My_Spinner(x, y, w, h, label);
return n;
}
void free_fl_spinner(SPINNER n) {
delete reinterpret_cast<My_Spinner*>(n);
}
unsigned int fl_spinner_get_color(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->color();
}
void fl_spinner_set_color(SPINNER n, unsigned int t) {
reinterpret_cast<Fl_Spinner*>(n)->color(t);
}
unsigned int fl_spinner_get_selection_color(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->selection_color();
}
void fl_spinner_set_selection_color(SPINNER n, unsigned int t) {
reinterpret_cast<Fl_Spinner*>(n)->selection_color(t);
}
unsigned int fl_spinner_get_textcolor(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->textcolor();
}
void fl_spinner_set_textcolor(SPINNER n, unsigned int t) {
reinterpret_cast<Fl_Spinner*>(n)->textcolor(t);
}
int fl_spinner_get_textfont(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->textfont();
}
void fl_spinner_set_textfont(SPINNER n, int t) {
reinterpret_cast<Fl_Spinner*>(n)->textfont(t);
}
int fl_spinner_get_textsize(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->textsize();
}
void fl_spinner_set_textsize(SPINNER n, int t) {
reinterpret_cast<Fl_Spinner*>(n)->textsize(t);
}
double fl_spinner_get_minimum(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->minimum();
}
void fl_spinner_set_minimum(SPINNER n, double t) {
reinterpret_cast<Fl_Spinner*>(n)->minimum(t);
}
double fl_spinner_get_maximum(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->maximum();
}
void fl_spinner_set_maximum(SPINNER n, double t) {
reinterpret_cast<Fl_Spinner*>(n)->maximum(t);
}
void fl_spinner_range(SPINNER n, double a, double b) {
reinterpret_cast<Fl_Spinner*>(n)->range(a,b);
}
double fl_spinner_get_step(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->step();
}
void fl_spinner_set_step(SPINNER n, double t) {
reinterpret_cast<Fl_Spinner*>(n)->step(t);
}
double fl_spinner_get_value(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->value();
}
void fl_spinner_set_value(SPINNER n, double t) {
reinterpret_cast<Fl_Spinner*>(n)->value(t);
}
const char * fl_spinner_get_format(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->format();
}
void fl_spinner_set_format(SPINNER n, const char * f) {
reinterpret_cast<Fl_Spinner*>(n)->format(f);
}
int fl_spinner_get_type(SPINNER n) {
return reinterpret_cast<Fl_Spinner*>(n)->type();
}
void fl_spinner_set_type(SPINNER n, int t) {
reinterpret_cast<Fl_Spinner*>(n)->type(t);
}
void fl_spinner_resize(SPINNER n, int x, int y, int w, int h) {
reinterpret_cast<Fl_Spinner*>(n)->resize(x, y, w, h);
}
void fl_spinner_draw(SPINNER n) {
reinterpret_cast<My_Spinner*>(n)->Fl_Spinner::draw();
}
int fl_spinner_handle(SPINNER n, int e) {
return reinterpret_cast<My_Spinner*>(n)->Fl_Spinner::handle(e);
}
|