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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
// Programmed by Jedidiah Barber
// Released into the public domain
#include <FL/Fl_Group.H>
#include <FL/Fl_Help_View.H>
#include <FL/Enumerations.H>
#include "c_fl_help_view.h"
#include "c_fl_type.h"
class My_Help_View : public Fl_Help_View {
public:
using Fl_Help_View::Fl_Help_View;
friend void help_view_set_draw_hook(HELPVIEW v, void * d);
friend void fl_help_view_draw(HELPVIEW v);
friend void help_view_set_handle_hook(HELPVIEW v, void * h);
friend int fl_help_view_handle(HELPVIEW v, int e);
protected:
void draw();
void real_draw();
int handle(int e);
int real_handle(int e);
d_hook_p draw_hook;
h_hook_p handle_hook;
};
void My_Help_View::draw() {
(*draw_hook)(this->user_data());
}
void My_Help_View::real_draw() {
#if FL_ABI_VERSION >= 10303
Fl_Help_View::draw();
#else
Fl_Group::draw();
#endif
}
int My_Help_View::handle(int e) {
return (*handle_hook)(this->user_data(), e);
}
int My_Help_View::real_handle(int e) {
#if FL_ABI_VERSION >= 10303
return Fl_Help_View::handle(e);
#else
return Fl_Group::handle(e);
#endif
}
void help_view_set_draw_hook(HELPVIEW v, void * d) {
reinterpret_cast<My_Help_View*>(v)->draw_hook = reinterpret_cast<d_hook_p>(d);
}
void fl_help_view_draw(HELPVIEW v) {
reinterpret_cast<My_Help_View*>(v)->real_draw();
}
void help_view_set_handle_hook(HELPVIEW v, void * h) {
reinterpret_cast<My_Help_View*>(v)->handle_hook = reinterpret_cast<h_hook_p>(h);
}
int fl_help_view_handle(HELPVIEW v, int e) {
return reinterpret_cast<My_Help_View*>(v)->real_handle(e);
}
HELPVIEW new_fl_help_view(int x, int y, int w, int h, char * label) {
My_Help_View *v = new My_Help_View(x, y, w, h, label);
return v;
}
void free_fl_help_view(HELPVIEW v) {
delete reinterpret_cast<My_Help_View*>(v);
}
void fl_help_view_clear_selection(HELPVIEW v) {
reinterpret_cast<Fl_Help_View*>(v)->clear_selection();
}
void fl_help_view_select_all(HELPVIEW v) {
reinterpret_cast<Fl_Help_View*>(v)->select_all();
}
int fl_help_view_find(HELPVIEW v, const char * s, int p) {
return reinterpret_cast<Fl_Help_View*>(v)->find(s, p);
}
int fl_help_view_get_leftline(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->leftline();
}
void fl_help_view_set_leftline(HELPVIEW v, int t) {
reinterpret_cast<Fl_Help_View*>(v)->leftline(t);
}
int fl_help_view_get_topline(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->topline();
}
void fl_help_view_set_topline(HELPVIEW v, int t) {
reinterpret_cast<Fl_Help_View*>(v)->topline(t);
}
void fl_help_view_set_topline_target(HELPVIEW v, const char * t) {
reinterpret_cast<Fl_Help_View*>(v)->topline(t);
}
const char * fl_help_view_directory(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->directory();
}
const char * fl_help_view_filename(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->filename();
}
int fl_help_view_load(HELPVIEW v, const char * f) {
return reinterpret_cast<Fl_Help_View*>(v)->load(f);
}
const char * fl_help_view_title(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->title();
}
const char * fl_help_view_get_value(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->value();
}
void fl_help_view_set_value(HELPVIEW v, const char * t) {
reinterpret_cast<Fl_Help_View*>(v)->value(t);
}
void fl_help_view_link(HELPVIEW v, void * f) {
reinterpret_cast<Fl_Help_View*>(v)->link(reinterpret_cast<Fl_Help_Func*>(f));
}
int fl_help_view_get_scrollbar_size(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->scrollbar_size();
}
void fl_help_view_set_scrollbar_size(HELPVIEW v, int s) {
reinterpret_cast<Fl_Help_View*>(v)->scrollbar_size(s);
}
int fl_help_view_get_size(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->size();
}
void fl_help_view_set_size(HELPVIEW v, int w, int h) {
reinterpret_cast<Fl_Help_View*>(v)->size(w, h);
}
unsigned int fl_help_view_get_textcolor(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->textcolor();
}
void fl_help_view_set_textcolor(HELPVIEW v, unsigned int c) {
reinterpret_cast<Fl_Help_View*>(v)->textcolor(c);
}
int fl_help_view_get_textfont(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->textfont();
}
void fl_help_view_set_textfont(HELPVIEW v, int f) {
reinterpret_cast<Fl_Help_View*>(v)->textfont(f);
}
int fl_help_view_get_textsize(HELPVIEW v) {
return reinterpret_cast<Fl_Help_View*>(v)->textsize();
}
void fl_help_view_set_textsize(HELPVIEW v, int s) {
reinterpret_cast<Fl_Help_View*>(v)->textsize(s);
}
|