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
|
// Programmed by Jedidiah Barber
// Released into the public domain
#include <FL/Fl_Input_Choice.H>
#include "c_fl_input_choice.h"
// Exports from Ada
extern "C" void widget_draw_hook(void * ud);
extern "C" int widget_handle_hook(void * ud, int e);
// Attaching all relevant hooks and friends
class My_Input_Choice : public Fl_Input_Choice {
public:
using Fl_Input_Choice::Fl_Input_Choice;
friend void fl_input_choice_draw(INPUTCHOICE n);
friend int fl_input_choice_handle(INPUTCHOICE n, int e);
void draw();
int handle(int e);
};
void My_Input_Choice::draw() {
widget_draw_hook(this->user_data());
}
int My_Input_Choice::handle(int e) {
return widget_handle_hook(this->user_data(), e);
}
// Flattened C API
INPUTCHOICE new_fl_input_choice(int x, int y, int w, int h, char* label) {
My_Input_Choice *n = new My_Input_Choice(x, y, w, h, label);
return n;
}
void free_fl_input_choice(INPUTCHOICE n) {
delete reinterpret_cast<My_Input_Choice*>(n);
}
void * fl_input_choice_input(INPUTCHOICE n) {
return reinterpret_cast<Fl_Input_Choice*>(n)->input();
}
void * fl_input_choice_menubutton(INPUTCHOICE n) {
return reinterpret_cast<Fl_Input_Choice*>(n)->menubutton();
}
void fl_input_choice_clear(INPUTCHOICE n) {
reinterpret_cast<Fl_Input_Choice*>(n)->clear();
}
int fl_input_choice_changed(INPUTCHOICE n) {
return reinterpret_cast<Fl_Input_Choice*>(n)->changed();
}
void fl_input_choice_clear_changed(INPUTCHOICE n) {
reinterpret_cast<Fl_Input_Choice*>(n)->clear_changed();
}
void fl_input_choice_set_changed(INPUTCHOICE n) {
reinterpret_cast<Fl_Input_Choice*>(n)->set_changed();
}
int fl_input_choice_get_down_box(INPUTCHOICE n) {
return reinterpret_cast<Fl_Input_Choice*>(n)->down_box();
}
void fl_input_choice_set_down_box(INPUTCHOICE n, int t) {
reinterpret_cast<Fl_Input_Choice*>(n)->down_box(static_cast<Fl_Boxtype>(t));
}
unsigned int fl_input_choice_get_textcolor(INPUTCHOICE n) {
return reinterpret_cast<Fl_Input_Choice*>(n)->textcolor();
}
void fl_input_choice_set_textcolor(INPUTCHOICE n, unsigned int t) {
reinterpret_cast<Fl_Input_Choice*>(n)->textcolor(t);
}
int fl_input_choice_get_textfont(INPUTCHOICE n) {
return reinterpret_cast<Fl_Input_Choice*>(n)->textfont();
}
void fl_input_choice_set_textfont(INPUTCHOICE n, int t) {
reinterpret_cast<Fl_Input_Choice*>(n)->textfont(t);
}
int fl_input_choice_get_textsize(INPUTCHOICE n) {
return reinterpret_cast<Fl_Input_Choice*>(n)->textsize();
}
void fl_input_choice_set_textsize(INPUTCHOICE n, int t) {
reinterpret_cast<Fl_Input_Choice*>(n)->textsize(t);
}
const char * fl_input_choice_get_value(INPUTCHOICE n) {
return reinterpret_cast<Fl_Input_Choice*>(n)->value();
}
void fl_input_choice_set_value(INPUTCHOICE n, const char * t) {
reinterpret_cast<Fl_Input_Choice*>(n)->value(t);
}
void fl_input_choice_set_value2(INPUTCHOICE n, int t) {
reinterpret_cast<Fl_Input_Choice*>(n)->value(t);
}
void fl_input_choice_resize(INPUTCHOICE n, int x, int y, int w, int h) {
reinterpret_cast<Fl_Input_Choice*>(n)->resize(x, y, w, h);
}
void fl_input_choice_draw(INPUTCHOICE n) {
reinterpret_cast<My_Input_Choice*>(n)->Fl_Input_Choice::draw();
}
int fl_input_choice_handle(INPUTCHOICE n, int e) {
return reinterpret_cast<My_Input_Choice*>(n)->Fl_Input_Choice::handle(e);
}
|