summaryrefslogtreecommitdiff
path: root/src/c_fl_input_choice.cpp
blob: a48a4bc0e9b02bca4e1d42c1bbad535bffb1f255 (plain)
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


#include <FL/Fl_Input_Choice.H>
#include "c_fl_input_choice.h"
#include "c_fl_type.h"




class My_Input_Choice : public Fl_Input_Choice {
    public:
        using Fl_Input_Choice::Fl_Input_Choice;
        friend void input_choice_set_draw_hook(INPUT_CHOICE n, void * d);
        friend void fl_input_choice_draw(INPUT_CHOICE n);
        friend void input_choice_set_handle_hook(INPUT_CHOICE n, void * h);
        friend int fl_input_choice_handle(INPUT_CHOICE n, 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_Input_Choice::draw() {
    (*draw_hook)(this->user_data());
}

void My_Input_Choice::real_draw() {
    Fl_Input_Choice::draw();
}

int My_Input_Choice::handle(int e) {
    return (*handle_hook)(this->user_data(), e);
}

int My_Input_Choice::real_handle(int e) {
    return Fl_Input_Choice::handle(e);
}

void input_choice_set_draw_hook(INPUT_CHOICE n, void * d) {
    reinterpret_cast<My_Input_Choice*>(n)->draw_hook = reinterpret_cast<d_hook_p>(d);
}

void fl_input_choice_draw(INPUT_CHOICE n) {
    reinterpret_cast<My_Input_Choice*>(n)->real_draw();
}

void input_choice_set_handle_hook(INPUT_CHOICE n, void * h) {
    reinterpret_cast<My_Input_Choice*>(n)->handle_hook = reinterpret_cast<h_hook_p>(h);
}

int fl_input_choice_handle(INPUT_CHOICE n, int e) {
    return reinterpret_cast<My_Input_Choice*>(n)->real_handle(e);
}




INPUT_CHOICE 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(INPUT_CHOICE n) {
    delete reinterpret_cast<My_Input_Choice*>(n);
}




void * fl_input_choice_input(INPUT_CHOICE n) {
    return reinterpret_cast<Fl_Input_Choice*>(n)->input();
}

void * fl_input_choice_menubutton(INPUT_CHOICE n) {
    return reinterpret_cast<Fl_Input_Choice*>(n)->menubutton();
}




void fl_input_choice_clear(INPUT_CHOICE n) {
    reinterpret_cast<Fl_Input_Choice*>(n)->clear();
}




int fl_input_choice_changed(INPUT_CHOICE n) {
    return reinterpret_cast<Fl_Input_Choice*>(n)->changed();
}

void fl_input_choice_clear_changed(INPUT_CHOICE n) {
    reinterpret_cast<Fl_Input_Choice*>(n)->clear_changed();
}

void fl_input_choice_set_changed(INPUT_CHOICE n) {
    reinterpret_cast<Fl_Input_Choice*>(n)->set_changed();
}

int fl_input_choice_get_down_box(INPUT_CHOICE n) {
    return reinterpret_cast<Fl_Input_Choice*>(n)->down_box();
}

void fl_input_choice_set_down_box(INPUT_CHOICE n, int t) {
    reinterpret_cast<Fl_Input_Choice*>(n)->down_box(static_cast<Fl_Boxtype>(t));
}

unsigned int fl_input_choice_get_textcolor(INPUT_CHOICE n) {
    return reinterpret_cast<Fl_Input_Choice*>(n)->textcolor();
}

void fl_input_choice_set_textcolor(INPUT_CHOICE n, unsigned int t) {
    reinterpret_cast<Fl_Input_Choice*>(n)->textcolor(t);
}

int fl_input_choice_get_textfont(INPUT_CHOICE n) {
    return reinterpret_cast<Fl_Input_Choice*>(n)->textfont();
}

void fl_input_choice_set_textfont(INPUT_CHOICE n, int t) {
    reinterpret_cast<Fl_Input_Choice*>(n)->textfont(t);
}

int fl_input_choice_get_textsize(INPUT_CHOICE n) {
    return reinterpret_cast<Fl_Input_Choice*>(n)->textsize();
}

void fl_input_choice_set_textsize(INPUT_CHOICE n, int t) {
    reinterpret_cast<Fl_Input_Choice*>(n)->textsize(t);
}

const char * fl_input_choice_get_value(INPUT_CHOICE n) {
    return reinterpret_cast<Fl_Input_Choice*>(n)->value();
}

void fl_input_choice_set_value(INPUT_CHOICE n, const char * t) {
    reinterpret_cast<Fl_Input_Choice*>(n)->value(t);
}

void fl_input_choice_set_value2(INPUT_CHOICE n, int t) {
    reinterpret_cast<Fl_Input_Choice*>(n)->value(t);
}