summaryrefslogtreecommitdiff
path: root/body/c_fl.cpp
blob: 24119a6cfa644a9ff3ba0a43210dfdf9ea30dbc4 (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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168


//  Programmed by Jedidiah Barber
//  Released into the public domain


#include <FL/Enumerations.H>
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include "c_fl.h"




const short fl_align_center             = FL_ALIGN_CENTER;
const short fl_align_top                = FL_ALIGN_TOP;
const short fl_align_bottom             = FL_ALIGN_BOTTOM;
const short fl_align_left               = FL_ALIGN_LEFT;
const short fl_align_right              = FL_ALIGN_RIGHT;
const short fl_align_inside             = FL_ALIGN_INSIDE;
const short fl_align_text_over_image    = FL_ALIGN_TEXT_OVER_IMAGE;
const short fl_align_image_over_text    = FL_ALIGN_IMAGE_OVER_TEXT;
const short fl_align_clip               = FL_ALIGN_CLIP;
const short fl_align_wrap               = FL_ALIGN_WRAP;
const short fl_align_image_next_to_text = FL_ALIGN_IMAGE_NEXT_TO_TEXT;
const short fl_align_text_next_to_image = FL_ALIGN_TEXT_NEXT_TO_IMAGE;
const short fl_align_image_backdrop     = FL_ALIGN_IMAGE_BACKDROP;
const short fl_align_top_left           = FL_ALIGN_TOP_LEFT;
const short fl_align_top_right          = FL_ALIGN_TOP_RIGHT;
const short fl_align_bottom_left        = FL_ALIGN_BOTTOM_LEFT;
const short fl_align_bottom_right       = FL_ALIGN_BOTTOM_RIGHT;
const short fl_align_left_top           = FL_ALIGN_LEFT_TOP;
const short fl_align_right_top          = FL_ALIGN_RIGHT_TOP;
const short fl_align_left_bottom        = FL_ALIGN_LEFT_BOTTOM;
const short fl_align_right_bottom       = FL_ALIGN_RIGHT_BOTTOM;
const short fl_align_nowrap             = FL_ALIGN_NOWRAP;
const short fl_align_all_position       = FL_ALIGN_POSITION_MASK;
const short fl_align_all_image          = FL_ALIGN_IMAGE_MASK;




const short fl_mod_command = FL_COMMAND >> 16;




size_t c_pointer_size() {
    return sizeof(void*);
}




unsigned int fl_enum_rgb_color(unsigned char r, unsigned char g, unsigned char b) {
    return fl_rgb_color(r, g, b);
}

unsigned int fl_enum_contrast(unsigned int f, unsigned int b) {
    return fl_contrast(f, b);
}




int fl_abi_check(int v) {
    return Fl::abi_check(v);
}

int fl_abi_version() {
    return Fl::abi_version();
}

int fl_api_version() {
    return Fl::api_version();
}

double fl_version() {
    return Fl::version();
}




void fl_awake() {
    Fl::awake();
}

void fl_lock() {
    Fl::lock();
}

void fl_unlock() {
    Fl::unlock();
}




int fl_get_damage() {
    return Fl::damage();
}

void fl_set_damage(int v) {
    Fl::damage(v);
}

void fl_flush() {
    Fl::flush();
}

void fl_redraw() {
    Fl::redraw();
}




short fl_inside_callback = 0;

void fl_delete_widget(void * w) {
    Fl::delete_widget(static_cast<Fl_Widget*>(w));
}




int fl_check() {
    short temp = fl_inside_callback;
    fl_inside_callback = 1;
    int ret = Fl::check();
    fl_inside_callback = temp;
    return ret;
}

int fl_ready() {
    short temp = fl_inside_callback;
    fl_inside_callback = 1;
    int ret = Fl::ready();
    fl_inside_callback = temp;
    return ret;
}

int fl_wait() {
    short temp = fl_inside_callback;
    fl_inside_callback = 1;
    int ret = Fl::wait();
    fl_inside_callback = temp;
    return ret;
}

double fl_wait2(double s) {
    short temp = fl_inside_callback;
    fl_inside_callback = 1;
    double ret = Fl::wait(s);
    fl_inside_callback = temp;
    return ret;
}

int fl_run() {
    short temp = fl_inside_callback;
    fl_inside_callback = 1;
    int ret = Fl::run();
    fl_inside_callback = temp;
    return ret;
}