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
176
177
178
179
180
181
#include <cfltk/cfl_input.h>
#include <cfltk/cfl_lock.h>
#include <cfltk/cfl_widget.hpp>
#include <FL/Fl.H>
#include <FL/Fl_File_Input.H>
#include <FL/Fl_Float_Input.H>
#include <FL/Fl_Image.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Int_Input.H>
#include <FL/Fl_Multiline_Input.H>
#include <FL/Fl_Multiline_Output.H>
#include <FL/Fl_Output.H>
#include <FL/Fl_Secret_Input.H>
#include <FL/Fl_Value_Output.H>
#define INPUT_DEFINE(widget) \
int widget##_set_value(widget *self, const char *t) { \
LOCK(auto ret = self->value(t)); \
return ret; \
} \
const char *widget##_value(widget *self) { \
LOCK(auto ret = self->value()); \
return ret; \
} \
int widget##_maximum_size(widget *self) { \
LOCK(auto ret = self->maximum_size()); \
return ret; \
} \
void widget##_set_maximum_size(widget *self, int m) { \
LOCK(self->maximum_size(m)); \
} \
int widget##_position(widget *self) { \
LOCK(auto ret = self->insert_position()); \
return ret; \
} \
int widget##_set_position(widget *self, int p) { \
LOCK(auto ret = self->insert_position(p)); \
return ret; \
} \
int widget##_set_mark(widget *self, int m) { \
LOCK(auto ret = self->mark(m)); \
return ret; \
} \
int widget##_mark(widget *self) { \
LOCK(auto ret = self->mark()); \
return ret; \
} \
int widget##_replace( \
widget *self, int b, int e, const char *text, int ilen \
) { \
LOCK(auto ret = self->replace(b, e, text, ilen)); \
return ret; \
} \
int widget##_insert(widget *self, const char *t, int l) { \
LOCK(auto ret = self->insert(t, l)); \
return ret; \
} \
int widget##_append( \
widget *self, const char *t, int l, char keep_selection \
) { \
LOCK(auto ret = self->append(t, l, keep_selection)); \
return ret; \
} \
int widget##_copy(widget *self, int clipboard) { \
LOCK(auto ret = self->copy(clipboard)); \
return ret; \
} \
int widget##_undo(widget *self) { \
LOCK(auto ret = self->undo()); \
return ret; \
} \
int widget##_copy_cuts(widget *self) { \
LOCK(auto ret = self->cut()); \
return ret; \
} \
unsigned int widget##_cursor_color(const widget *self) { \
LOCK(auto ret = self->cursor_color()); \
return ret; \
} \
void widget##_set_cursor_color(widget *self, unsigned int s) { \
LOCK(self->cursor_color(s)); \
} \
int widget##_text_font(widget *self) { \
LOCK(auto ret = self->textfont()); \
return ret; \
} \
void widget##_set_text_font(widget *self, int s) { \
LOCK(self->textfont(s)); \
} \
unsigned int widget##_text_color(widget *self) { \
LOCK(auto ret = self->textcolor()); \
return ret; \
} \
void widget##_set_text_color(widget *self, unsigned int s) { \
LOCK(self->textcolor(s)); \
} \
int widget##_text_size(widget *self) { \
LOCK(auto ret = self->textsize()); \
return ret; \
} \
void widget##_set_text_size(widget *self, int s) { \
LOCK(self->textsize(s)); \
} \
int widget##_readonly(widget *self) { \
LOCK(auto ret = self->readonly()); \
return ret; \
} \
void widget##_set_readonly(widget *self, int boolean) { \
LOCK(self->readonly(boolean)); \
} \
int widget##_wrap(widget *self) { \
LOCK(auto ret = self->wrap()); \
return ret; \
} \
void widget##_set_wrap(widget *self, int boolean) { \
LOCK(self->wrap(boolean)); \
}; \
void widget##_set_tab_nav(widget *self, int flag) { \
LOCK(self->tab_nav(flag)); \
} \
int widget##_tab_nav(const widget *self) { \
LOCK(auto ret = self->tab_nav()); \
return ret; \
}
WIDGET_CLASS(Fl_Input)
WIDGET_DEFINE(Fl_Input)
INPUT_DEFINE(Fl_Input)
WIDGET_CLASS(Fl_Int_Input)
WIDGET_DEFINE(Fl_Int_Input)
INPUT_DEFINE(Fl_Int_Input)
WIDGET_CLASS(Fl_Float_Input)
WIDGET_DEFINE(Fl_Float_Input)
INPUT_DEFINE(Fl_Float_Input)
WIDGET_CLASS(Fl_Multiline_Input)
WIDGET_DEFINE(Fl_Multiline_Input)
INPUT_DEFINE(Fl_Multiline_Input)
WIDGET_CLASS(Fl_Secret_Input)
WIDGET_DEFINE(Fl_Secret_Input)
INPUT_DEFINE(Fl_Secret_Input)
WIDGET_CLASS(Fl_File_Input)
WIDGET_DEFINE(Fl_File_Input)
void Fl_File_Input_set_down_box(Fl_File_Input *self, int box) {
LOCK(self->down_box(static_cast<Fl_Boxtype>(box)));
}
int Fl_File_Input_down_box(const Fl_File_Input *self) {
LOCK(auto ret = self->down_box());
return ret;
}
INPUT_DEFINE(Fl_File_Input)
WIDGET_CLASS(Fl_Output)
WIDGET_DEFINE(Fl_Output)
INPUT_DEFINE(Fl_Output)
WIDGET_CLASS(Fl_Multiline_Output)
WIDGET_DEFINE(Fl_Multiline_Output)
INPUT_DEFINE(Fl_Multiline_Output)