FLTK 1.4.4

Loading...
Searching...
No Matches
Fl.H
Go to the documentation of this file.
1//
2// Main header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2024 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
20
21#ifndef Fl_H
22# define Fl_H
23
24#include <FL/fl_config.h> // build configuration
25#include <FL/Fl_Export.H>
26#include <FL/platform_types.h> // for FL_SOCKET
27#include <FL/fl_casts.H> // experimental
28
29#ifdef FLTK_HAVE_CAIRO
30# include <FL/Fl_Cairo.H>
31#endif
32
33# include "fl_utf8.h"
34# include "Enumerations.H"
35# ifndef Fl_Object
36# define Fl_Object Fl_Widget
37# endif
38
39# ifdef check
40# undef check
41# endif
42
43# ifdef BSD
44# undef BSD
45# endif
46
47#include <string.h> // FIXME: Fl::is_scheme(): strcmp needs string.h
48
49 class Fl_Widget;
50 class Fl_Window;
51 class Fl_Image;
52 struct Fl_Label;
53 class Fl_Screen_Driver;
54 class Fl_System_Driver;
55
56// Pointers you can use to change FLTK to another language.
57// Note: Similar pointers are defined in FL/fl_ask.H and src/fl_ask.cxx
58
59 extern FL_EXPORT const char* fl_local_alt;
60 extern FL_EXPORT const char* fl_local_ctrl;
61 extern FL_EXPORT const char* fl_local_meta;
62 extern FL_EXPORT const char* fl_local_shift;
63
81
83 typedef void (Fl_Label_Draw_F)(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align);
84
86 typedef void (Fl_Label_Measure_F)(const Fl_Label *label, int &width, int &height);
87
89 typedef void (Fl_Box_Draw_F)(int x, int y, int w, int h, Fl_Color color);
90
92 typedef void (Fl_Box_Draw_Focus_F)(Fl_Boxtype bt, int x, int y, int w, int h, Fl_Color fg, Fl_Color bg);
93
97 typedef void (*Fl_Timeout_Handler)(void *data);
98
100 typedef void (*Fl_Awake_Handler)(void *data);
101
103 typedef void (*Fl_Idle_Handler)(void *data);
104
106 typedef void (*Fl_Old_Idle_Handler)();
107
109 typedef void (*Fl_FD_Handler)(FL_SOCKET fd, void *data);
110
112 typedef int (*Fl_Event_Handler)(int event);
113
115 typedef int (*Fl_System_Handler)(void *event, void *data);
116
118 typedef void (*Fl_Abort_Handler)(const char *format,...);
119
121 typedef void (*Fl_Atclose_Handler)(Fl_Window *window, void *data);
122
124 typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i);
125
128 typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w);
129
131 typedef void (*Fl_Clipboard_Notify_Handler)(int source, void *data);
132 /* group callback_functions */
134
135
140 class FL_EXPORT Fl {
141 friend class Fl_System_Driver;
142 Fl() {} // no constructor!
143
144 private:
145
146 static int use_high_res_GL_;
147 static int draw_GL_text_with_textures_;
148 static int box_shadow_width_;
149 static int box_border_radius_max_;
150 static int selection_to_clipboard_;
151
152 public:
153
154 static Fl_Screen_Driver *screen_driver();
155 static Fl_System_Driver *system_driver();
156#ifdef __APPLE__ // deprecated in 1.4 - only for compatibility with 1.3
157 static void reset_marked_text();
158 static void insertion_point_location(int x, int y, int height);
159#endif
160
161
165 static int box_shadow_width() { return box_shadow_width_; }
170 static void box_shadow_width(int W) { box_shadow_width_ = W < 1 ? 1 : W; }
171
175 static int box_border_radius_max() { return box_border_radius_max_; }
188 static void box_border_radius_max(int R) { box_border_radius_max_ = R < 5 ? 5 : R; }
189
190 public: // should be private!
191
192#ifndef FL_DOXYGEN
193 static int e_number;
194 static int e_x;
195 static int e_y;
196 static int e_x_root;
197 static int e_y_root;
198 static int e_dx;
199 static int e_dy;
200 static int e_state;
201 static int e_clicks;
202 static int e_is_click;
203 static int e_keysym;
204 static char* e_text;
205 static int e_length;
206 static void *e_clipboard_data;
207 static const char *e_clipboard_type;
208 static Fl_Event_Dispatch e_dispatch;
209 static Fl_Callback_Reason callback_reason_;
210 static Fl_Widget* belowmouse_;
211 static Fl_Widget* pushed_;
212 static Fl_Widget* focus_;
213 static int damage_;
214 static Fl_Widget* selection_owner_;
215 static Fl_Window* modal_;
216 static Fl_Window* grab_;
217 static int compose_state; // used for dead keys (Windows) or marked text (MacOS)
218 static void call_screen_init(); // recompute screen number and dimensions
219#endif // FL_DOXYGEN
220
221
225 static void damage(int d) {damage_ = d;}
226
227 public:
234 typedef enum {
244 OPTION_ARROW_FOCUS = 0,
245 // When switched on, FLTK will use the file chooser dialog that comes
246 // with your operating system whenever possible. When switched off, FLTK
247 // will present its own file chooser.
248 // \todo implement me
249 // OPTION_NATIVE_FILECHOOSER,
250 // When Filechooser Preview is enabled, the FLTK or native file chooser
251 // will show a preview of a selected file (if possible) before the user
252 // decides to choose the file.
253 // \todo implement me
254 //OPTION_FILECHOOSER_PREVIEW,
259 OPTION_VISIBLE_FOCUS,
263 OPTION_DND_TEXT,
267 OPTION_SHOW_TOOLTIPS,
271 OPTION_FNFC_USES_GTK,
274 OPTION_FNFC_USES_ZENITY,
278 OPTION_FNFC_USES_KDIALOG,
282 OPTION_PRINTER_USES_GTK,
286 OPTION_SHOW_SCALING,
292 OPTION_SIMPLE_ZOOM_SHORTCUT,
293 // don't change this, leave it always as the last element
295 OPTION_LAST
296 } Fl_Option;
297
298 private:
299 static unsigned char options_[OPTION_LAST];
300 static unsigned char options_read_;
301 static int program_should_quit_; // non-zero means the program was asked to cleanly terminate
302
303 public:
304 /*
305 Return a global setting for all FLTK applications, possibly overridden
306 by a setting specifically for this application.
307 */
308 static bool option(Fl_Option opt);
309
310 /*
311 Override an option while the application is running.
312 */
313 static void option(Fl_Option opt, bool val);
314
322 static void (*idle)();
323
324#ifndef FL_DOXYGEN
325 private:
326 static Fl_Awake_Handler *awake_ring_;
327 static void **awake_data_;
328 static int awake_ring_size_;
329 static int awake_ring_head_;
330 static int awake_ring_tail_;
331 public:
332 static const char* scheme_;
333 static Fl_Image* scheme_bg_;
334
335 static int e_original_keysym; // late addition
336 static int scrollbar_size_;
337 static int menu_linespacing_; // STR #2927
338#endif
339
340
341 static int add_awake_handler_(Fl_Awake_Handler, void*);
342 static int get_awake_handler_(Fl_Awake_Handler&, void*&);
343
344 public:
345
346 // API version number
347 static double version();
348 static int api_version();
349
350 // ABI version number
351 static int abi_version();
352
375 static inline int abi_check(const int val = FL_ABI_VERSION) {
376 return val == abi_version();
377 }
378
379 // argument parsers:
380 static int arg(int argc, char **argv, int& i);
381 static int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0);
382 static void args(int argc, char **argv);
387 static const char* const help;
388
389 // things called by initialization:
390 static void display(const char*);
391 static int visual(int);
401 static int gl_visual(int, int *alist=0); // platform dependent
402 static void own_colormap();
403 static void get_system_colors();
404 static void foreground(uchar, uchar, uchar);
405 static void background(uchar, uchar, uchar);
406 static void background2(uchar, uchar, uchar);
407
408 // schemes:
409 static int scheme(const char *name);
411 static const char* scheme() {return scheme_;}
412
440 static int is_scheme(const char *name) {
441 return (scheme_ && name && !strcmp(name,scheme_));
442 }
443
444 static int reload_scheme(); // defined in 'src/Fl_get_system_colors.cxx'
445
446 static int scrollbar_size();
447 static void scrollbar_size(int W);
448 static int menu_linespacing();
449 static void menu_linespacing(int H);
450
451 // execution:
452 static int wait();
453 static double wait(double time);
454 static int check();
455 static int ready();
456 static int run();
463 static int program_should_quit() {return program_should_quit_;}
469 static void program_should_quit(int should_i) { program_should_quit_ = should_i; }
470 static void hide_all_windows();
471
472 static Fl_Widget* readqueue();
473
474 //
475 // cross-platform timer support
476 //
477
478 static void add_timeout(double t, Fl_Timeout_Handler cb, void *data = 0);
479 static void repeat_timeout(double t, Fl_Timeout_Handler cb, void *data = 0);
480 static int has_timeout(Fl_Timeout_Handler cb, void *data = 0);
481 static void remove_timeout(Fl_Timeout_Handler cb, void *data = 0);
482 static int remove_next_timeout(Fl_Timeout_Handler cb, void *data = 0, void **data_return = 0);
483
484 static void add_check(Fl_Timeout_Handler, void* = 0);
485 static int has_check(Fl_Timeout_Handler, void* = 0);
486 static void remove_check(Fl_Timeout_Handler, void* = 0);
487
488 static Fl_Timestamp now(double offset = 0);
489 static double seconds_since(Fl_Timestamp& then);
490 static double seconds_between(Fl_Timestamp& back, Fl_Timestamp& further_back);
491 static long ticks_since(Fl_Timestamp& then);
492 static long ticks_between(Fl_Timestamp& back, Fl_Timestamp& further_back);
493
494 // private
495 static void run_idle();
496 static void run_checks();
497 static void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0); // platform dependent
498 static void add_fd(int fd, Fl_FD_Handler cb, void* = 0); // platform dependent
500 static void remove_fd(int, int when); // platform dependent
502 static void remove_fd(int); // platform dependent
503
504 static void add_idle(Fl_Idle_Handler cb, void* data = 0);
505 static int has_idle(Fl_Idle_Handler cb, void* data = 0);
506 static void remove_idle(Fl_Idle_Handler cb, void* data = 0);
508 static int damage() {return damage_;}
509 static void redraw();
510 static void flush();
531 static void (*warning)(const char*, ...);
546 static void (*error)(const char*, ...);
563 static void (*fatal)(const char*, ...);
565
569 static Fl_Window* first_window();
570 static void first_window(Fl_Window*);
571 static Fl_Window* next_window(const Fl_Window*);
572
582 static Fl_Window* modal() {return modal_;}
588 static Fl_Window* grab() {return grab_;}
613 static void grab(Fl_Window*); // platform dependent
615
620 // event information:
626 static int event() {return e_number;}
631 static int event_x() {return e_x;}
636 static int event_y() {return e_y;}
643 static int event_x_root() {return e_x_root;}
650 static int event_y_root() {return e_y_root;}
655 static int event_dx() {return e_dx;}
660 static int event_dy() {return e_dy;}
669 static void get_mouse(int &,int &);
678 static int event_clicks() {return e_clicks;}
686 static void event_clicks(int i) {e_clicks = i;}
694 static int event_is_click() {return e_is_click;}
701 static void event_is_click(int i) {e_is_click = i;}
713 static int event_button() { return e_keysym - FL_Button; }
754 static int event_state() {return e_state;}
755
761 static int event_state(int mask) {return e_state&mask;}
773 static int event_key() {return e_keysym;}
782 static int event_original_key(){return e_original_keysym;}
822 static int event_key(int key);
828 static int get_key(int key); // platform dependent
843 static const char* event_text() {return e_text;}
850 static int event_length() {return e_length;}
851
855 static void *event_clipboard() { return e_clipboard_data; }
859 static const char *event_clipboard_type() {return e_clipboard_type; }
860
861
862 static int compose(int &del);
863 static void compose_reset();
864 static int event_inside(int,int,int,int);
865 static int event_inside(const Fl_Widget*);
866 static int test_shortcut(Fl_Shortcut);
867
868 static void enable_im();
869 static void disable_im();
870
871 // event destinations:
872 static int handle(int, Fl_Window*);
873 static int handle_(int, Fl_Window*);
876 static Fl_Widget* belowmouse() {return belowmouse_;}
877 static void belowmouse(Fl_Widget*);
880 static Fl_Widget* pushed() {return pushed_;}
881 static void pushed(Fl_Widget*);
883 static Fl_Widget* focus() {return focus_;}
884 static void focus(Fl_Widget*);
885 static void add_handler(Fl_Event_Handler ha);
886 static void add_handler(Fl_Event_Handler ha, Fl_Event_Handler before);
887 static Fl_Event_Handler last_handler();
888 static void remove_handler(Fl_Event_Handler h);
889 static void add_system_handler(Fl_System_Handler h, void *data);
890 static void remove_system_handler(Fl_System_Handler h);
891 static void event_dispatch(Fl_Event_Dispatch d);
892 static Fl_Event_Dispatch event_dispatch();
893 static Fl_Callback_Reason callback_reason();
895
899
939 static void copy(const char *stuff, int len, int destination = 0,
940 const char *type = Fl::clipboard_plain_text);
941
969 static void selection_to_clipboard(int mode) {
970 selection_to_clipboard_ = mode ? 1 : 0;
971 }
972
978 static int selection_to_clipboard() { return selection_to_clipboard_; }
979
1022 static void paste(Fl_Widget &receiver, int source, const char *type = Fl::clipboard_plain_text);
1023
1045 static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data = 0);
1050 static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h);
1059 static int clipboard_contains(const char *type);
1062 static char const * const clipboard_plain_text;
1065 static char const * const clipboard_image;
1066
1076 static int dnd(); // platform dependent
1077
1078 // These are for back-compatibility only:
1081 static Fl_Widget* selection_owner() {return selection_owner_;}
1082 static void selection_owner(Fl_Widget*);
1083 static void selection(Fl_Widget &owner, const char*, int len);
1084 static void paste(Fl_Widget &receiver);
1086
1087
1101 static int x(); // via screen driver
1102 static int y(); // via screen driver
1103 static int w(); // via screen driver
1104 static int h(); // via screen driver
1105
1106 // multi-head support:
1107 static int screen_count(); // via screen driver
1108 static void screen_xywh(int &X, int &Y, int &W, int &H); // via screen driver
1109 static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver
1110 static void screen_xywh(int &X, int &Y, int &W, int &H, int n); // via screen driver
1111 static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh); // via screen driver
1112 static int screen_num(int x, int y); // via screen driver
1113 static int screen_num(int x, int y, int w, int h); // via screen driver
1114 static void screen_dpi(float &h, float &v, int n=0); // via screen driver
1115 static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver
1116 static void screen_work_area(int &X, int &Y, int &W, int &H, int n); // via screen driver
1117 static void screen_work_area(int &X, int &Y, int &W, int &H); // via screen driver
1118 static float screen_scale(int n); // via screen driver
1119 static void screen_scale(int n, float factor); // via screen driver
1120 static int screen_scaling_supported();
1121 static void keyboard_screen_scaling(int value);
1122
1124
1125
1130
1131 // color map:
1132 static void set_color(Fl_Color, uchar, uchar, uchar);
1133 static void set_color(Fl_Color, uchar, uchar, uchar, uchar);
1138 static void set_color(Fl_Color i, unsigned c); // platform dependent
1139 static unsigned get_color(Fl_Color i);
1140 static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue);
1141 static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue, uchar &alpha);
1147 static void free_color(Fl_Color i, int overlay = 0); // platform dependent
1148
1149 // fonts:
1150 static const char* get_font(Fl_Font);
1163 static const char* get_font_name(Fl_Font, int* attributes = 0);
1175 static int get_font_sizes(Fl_Font, int*& sizep);
1176 static void set_font(Fl_Font, const char*);
1177 static void set_font(Fl_Font, Fl_Font);
1205 static Fl_Font set_fonts(const char* = 0); // platform dependent
1206
1213 // <Hack to re-order the 'Drawing functions' group>
1215
1216 // labeltypes:
1217 static void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
1219 static void set_labeltype(Fl_Labeltype, Fl_Labeltype from); // is it defined ?
1220
1221 // boxtypes:
1222 static Fl_Box_Draw_F *get_boxtype(Fl_Boxtype);
1223 static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*,
1224 uchar, uchar, uchar, uchar,
1225 Fl_Box_Draw_Focus_F* =NULL);
1226 static void set_boxtype(Fl_Boxtype, Fl_Boxtype from);
1227 static int box_dx(Fl_Boxtype);
1228 static int box_dy(Fl_Boxtype);
1229 static int box_dw(Fl_Boxtype);
1230 static int box_dh(Fl_Boxtype);
1231
1232 static int draw_box_active();
1233 static Fl_Color box_color(Fl_Color);
1234 static void set_box_color(Fl_Color);
1235
1236 // back compatibility:
1240 static void set_abort(Fl_Abort_Handler f) {fatal = f;}
1241 static void (*atclose)(Fl_Window*,void*);
1242 static void default_atclose(Fl_Window*,void*);
1246 static void set_atclose(Fl_Atclose_Handler f) {atclose = f;}
1248
1252 static int event_shift() {return e_state&FL_SHIFT;}
1254 static int event_ctrl() {return e_state&FL_CTRL;}
1256 static int event_command() {return e_state&FL_COMMAND;}
1258 static int event_alt() {return e_state&FL_ALT;}
1267 static int event_buttons() {return e_state & FL_BUTTONS;}
1272 static int event_button1() {return e_state & FL_BUTTON1;}
1277 static int event_button2() {return e_state & FL_BUTTON2;}
1282 static int event_button3() {return e_state & FL_BUTTON3;}
1287 static int event_button4() {return e_state & FL_BUTTON4;}
1292 static int event_button5() {return e_state & FL_BUTTON5;}
1294
1300 static void set_idle(Fl_Old_Idle_Handler cb) {idle = cb;}
1302 static void grab(Fl_Window& win) {grab(&win);}
1306 static void release() {grab(0);}
1307
1308 // Visible focus methods...
1314 static void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); }
1320 static int visible_focus() { return option(OPTION_VISIBLE_FOCUS); }
1321
1322 // Drag-n-drop text operation methods...
1329 static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); }
1336 static int dnd_text_ops() { return option(OPTION_DND_TEXT); }
1340
1341 // Multithreading support:
1342 static int lock();
1343 static void unlock();
1344 static void awake(void* message = 0);
1346 static int awake(Fl_Awake_Handler cb, void* message = 0);
1353 static void* thread_message(); // platform dependent
1355
1385 // Widget deletion:
1386 static void delete_widget(Fl_Widget *w);
1387 static void do_widget_deletion();
1388 static void watch_widget_pointer(Fl_Widget *&w);
1389 static void release_widget_pointer(Fl_Widget *&w);
1390 static void clear_widget_pointer(Fl_Widget const *w);
1392
1397 static void use_high_res_GL(int val) { use_high_res_GL_ = val; }
1403 static int use_high_res_GL() { return use_high_res_GL_; }
1404
1416 static void draw_GL_text_with_textures(int val) { draw_GL_text_with_textures_ = val; }
1417
1423 static int draw_GL_text_with_textures() { return draw_GL_text_with_textures_; }
1424
1425 static int system(const char *command);
1426
1427 // Convert Windows commandline arguments to UTF-8 (documented in src/Fl.cxx)
1428 static int args_to_utf8(int argc, char ** &argv);
1429
1430#ifdef FLTK_HAVE_CAIRO
1434 public:
1435 // Cairo support API
1436
1437 static cairo_t *cairo_make_current(Fl_Window *w);
1438
1454 static void cairo_autolink_context(bool alink) {
1455 cairo_state_.autolink(alink);
1456 }
1457
1465 static bool cairo_autolink_context() {
1466 return cairo_state_.autolink();
1467 }
1468
1470 static cairo_t *cairo_cc() {
1471 return cairo_state_.cc();
1472 }
1473
1478 static void cairo_cc(cairo_t *c, bool own=false) {
1479 cairo_state_.cc(c, own);
1480 }
1481
1515 static void cairo_flush(cairo_t *c) {
1516 // flush Cairo drawings: necessary at least for Windows
1517 cairo_surface_t *s = cairo_get_target(c);
1518 cairo_surface_flush(s);
1519 }
1520
1521 private:
1522 static cairo_t *cairo_make_current(void *gc);
1523 static cairo_t *cairo_make_current(void *gc, int W, int H);
1524 static Fl_Cairo_State cairo_state_;
1525
1526 public:
1528
1529#endif // FLTK_HAVE_CAIRO
1530
1531};
1532
1575 class FL_EXPORT Fl_Widget_Tracker {
1576
1577 Fl_Widget* wp_;
1578
1579 public:
1580
1581 Fl_Widget_Tracker(Fl_Widget *wi);
1582 ~Fl_Widget_Tracker();
1583
1589 Fl_Widget *widget() {return wp_;}
1590
1600 int deleted() {return wp_ == 0;}
1601
1611 int exists() {return wp_ != 0;}
1612
1613};
1614
1619
1620#endif // !Fl_H
Enumerations.H
This file contains type definitions and general enumerations.
FL_BUTTON2
#define FL_BUTTON2
Mouse button 2 is pushed (M)
Definition Enumerations.H:592
FL_Button
#define FL_Button
A mouse button; use FL_Button + n for mouse button n.
Definition Enumerations.H:486
FL_CTRL
#define FL_CTRL
One of the ctrl keys is down.
Definition Enumerations.H:581
Fl_Font
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:1063
Fl_Align
unsigned Fl_Align
FLTK type for alignment control.
Definition Enumerations.H:986
FL_ALT
#define FL_ALT
One of the alt keys is down.
Definition Enumerations.H:582
FL_ABI_VERSION
#define FL_ABI_VERSION
The FLTK ABI (Application Binary Interface) version number as an int.
Definition Enumerations.H:180
FL_BUTTONS
#define FL_BUTTONS
Bitmask: any mouse button (1-5) is pushed.
Definition Enumerations.H:596
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition Enumerations.H:1120
FL_BUTTON5
#define FL_BUTTON5
Mouse button 5 is pushed (FORWARD)
Definition Enumerations.H:595
FL_BUTTON3
#define FL_BUTTON3
Mouse button 3 is pushed (R)
Definition Enumerations.H:593
FL_SHIFT
#define FL_SHIFT
One of the shift keys is down.
Definition Enumerations.H:579
FL_BUTTON4
#define FL_BUTTON4
Mouse button 4 is pushed (BACK)
Definition Enumerations.H:594
Fl_Labeltype
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition Enumerations.H:835
Fl_Boxtype
Fl_Boxtype
FLTK standard box types.
Definition Enumerations.H:644
Fl_Callback_Reason
Fl_Callback_Reason
These constants describe why a callback is performed.
Definition Enumerations.H:455
FL_BUTTON1
#define FL_BUTTON1
Mouse button 1 is pushed (L)
Definition Enumerations.H:591
fl_local_shift
const char * fl_local_shift
string pointer used in shortcuts, you can change it to another language
Definition Fl.cxx:2440
fl_local_ctrl
const char * fl_local_ctrl
string pointer used in shortcuts, you can change it to another language
Definition Fl.cxx:2443
fl_local_meta
const char * fl_local_meta
string pointer used in shortcuts, you can change it to another language
Definition Fl.cxx:2441
fl_local_alt
const char * fl_local_alt
string pointer used in shortcuts, you can change it to another language
Definition Fl.cxx:2442
Fl_Cairo.H
Cairo is currently supported for the following platforms: Windows, macOS, Unix/Linux (X11 + Wayland).
Fl_Cairo_State
Contains all the necessary info on the current cairo context.
Definition Fl_Cairo.H:56
Fl_Image
Base class for image caching, scaling and drawing.
Definition Fl_Image.H:60
Fl_Widget_Tracker::exists
int exists()
Returns 1, if the watched widget exists (has not been deleted).
Definition Fl.H:1611
Fl_Widget_Tracker::deleted
int deleted()
Returns 1, if the watched widget has been deleted.
Definition Fl.H:1600
Fl_Widget_Tracker::widget
Fl_Widget * widget()
Returns a pointer to the watched widget.
Definition Fl.H:1589
Fl_Widget_Tracker::Fl_Widget_Tracker
Fl_Widget_Tracker(Fl_Widget *wi)
The constructor adds a widget to the watch list.
Definition Fl.cxx:2158
Fl_Widget
Fl_Widget is the base class for all widgets in FLTK.
Definition Fl_Widget.H:112
Fl_Window
This widget produces an actual window.
Definition Fl_Window.H:55
Fl::is_scheme
static int is_scheme(const char *name)
Returns whether the current scheme is the given name.
Definition Fl.H:440
Fl::scheme
static const char * scheme()
See void scheme(const char *name)
Definition Fl.H:411
Fl::own_colormap
static void own_colormap()
Makes FLTK use its own colormap.
Definition Fl_own_colormap.cxx:35
Fl::box_dx
static int box_dx(Fl_Boxtype)
Returns the X offset for the given boxtype.
Definition fl_boxtype.cxx:379
Fl::draw_GL_text_with_textures
static int draw_GL_text_with_textures()
returns whether whether OpenGL uses textures to draw all text.
Definition Fl.H:1423
Fl::program_should_quit
static int program_should_quit()
Returns non-zero when a request for program termination was received and accepted.
Definition Fl.H:463
Fl::use_high_res_GL
static void use_high_res_GL(int val)
sets whether GL windows should be drawn at high resolution on Apple computers with retina displays
Definition Fl.H:1397
Fl::background
static void background(uchar, uchar, uchar)
Changes fl_color(FL_BACKGROUND_COLOR) to the given color, and changes the gray ramp from 32 to 56 to ...
Definition Fl_get_system_colors.cxx:42
Fl::box_border_radius_max
static int box_border_radius_max()
Get the maximum border radius of all "rounded" boxtypes in pixels.
Definition Fl.H:175
Fl::OPTION_FNFC_USES_GTK
@ OPTION_FNFC_USES_GTK
When switched on (default), Fl_Native_File_Chooser runs GTK file dialogs if the GTK library is availa...
Definition Fl.H:271
Fl::OPTION_ARROW_FOCUS
@ OPTION_ARROW_FOCUS
When switched on, moving the text cursor beyond the start or end of a text in a text widget will chan...
Definition Fl.H:244
Fl::OPTION_SIMPLE_ZOOM_SHORTCUT
@ OPTION_SIMPLE_ZOOM_SHORTCUT
When switched on and when the keyboard in use has '+' in the shifted position of its key,...
Definition Fl.H:292
Fl::OPTION_FNFC_USES_ZENITY
@ OPTION_FNFC_USES_ZENITY
Meaningful for the Wayland/X11 platform only.
Definition Fl.H:274
Fl::OPTION_LAST
@ OPTION_LAST
For internal use only.
Definition Fl.H:295
Fl::OPTION_DND_TEXT
@ OPTION_DND_TEXT
If text drag-and-drop is enabled (default), the user can select and drag text from any text widget.
Definition Fl.H:263
Fl::OPTION_FNFC_USES_KDIALOG
@ OPTION_FNFC_USES_KDIALOG
Meaningful for the Wayland/X11 platform only.
Definition Fl.H:278
Fl::OPTION_PRINTER_USES_GTK
@ OPTION_PRINTER_USES_GTK
When switched on (default), Fl_Printer runs the GTK printer dialog if the GTK library is available on...
Definition Fl.H:282
Fl::OPTION_SHOW_SCALING
@ OPTION_SHOW_SCALING
When switched on (default), the library shows in a transient yellow window the zoom factor value.
Definition Fl.H:286
Fl::OPTION_VISIBLE_FOCUS
@ OPTION_VISIBLE_FOCUS
If visible focus is switched on (default), FLTK will draw a dotted rectangle inside the widget that w...
Definition Fl.H:259
Fl::OPTION_SHOW_TOOLTIPS
@ OPTION_SHOW_TOOLTIPS
If tooltips are enabled (default), hovering the mouse over a widget with a tooltip text will open a l...
Definition Fl.H:267
Fl::damage
static void damage(int d)
If true then flush() will do something.
Definition Fl.H:225
Fl::box_shadow_width
static int box_shadow_width()
Get the box shadow width of all "shadow" boxtypes in pixels.
Definition Fl.H:165
Fl::dnd_text_ops
static void dnd_text_ops(int v)
Sets whether drag and drop text operations are supported.
Definition Fl.H:1329
Fl::screen_driver
static Fl_Screen_Driver * screen_driver()
Returns a pointer to the unique Fl_Screen_Driver object of the platform.
Definition Fl.cxx:95
Fl::idle
static void(* idle)()
The currently executing idle callback function: DO NOT USE THIS DIRECTLY!
Definition Fl.H:322
Fl::get_boxtype
static Fl_Box_Draw_F * get_boxtype(Fl_Boxtype)
Gets the current box drawing function for the specified box type.
Definition fl_boxtype.cxx:433
Fl::help
static const char *const help
Usage string displayed if Fl::args() detects an invalid argument.
Definition Fl.H:387
Fl::box_border_radius_max
static void box_border_radius_max(int R)
Set the maximum border radius of all "rounded" boxtypes in pixels.
Definition Fl.H:188
Fl::release
static void release()
Releases the current grabbed window, equals grab(0).
Definition Fl.H:1306
Fl::visual
static int visual(int)
Selects a visual so that your graphics are drawn correctly.
Definition Fl_visual.cxx:49
Fl::api_version
static int api_version()
Returns the compiled-in value of the FL_API_VERSION constant.
Definition Fl.cxx:128
Fl::set_idle
static void set_idle(Fl_Old_Idle_Handler cb)
Sets an idle callback.
Definition Fl.H:1300
Fl::gl_visual
static int gl_visual(int, int *alist=0)
This does the same thing as Fl::visual(int) but also requires OpenGL drawing to work.
Fl::display
static void display(const char *)
Sets the X or Wayland display to use for all windows.
Definition Fl_display.cxx:31
Fl::program_should_quit
static void program_should_quit(int should_i)
Indicate to the FLTK library whether a program termination request was received and accepted.
Definition Fl.H:469
Fl::system_driver
static Fl_System_Driver * system_driver()
Returns a pointer to the unique Fl_System_Driver object of the platform.
Definition Fl.cxx:102
Fl::get_awake_handler_
static int get_awake_handler_(Fl_Awake_Handler &, void *&)
Gets the last stored awake handler for use in awake().
Definition Fl_lock.cxx:102
Fl::use_high_res_GL
static int use_high_res_GL()
returns whether GL windows should be drawn at high resolution on Apple computers with retina displays...
Definition Fl.H:1403
Fl::draw_GL_text_with_textures
static void draw_GL_text_with_textures(int val)
sets whether OpenGL uses textures to draw all text.
Definition Fl.H:1416
Fl::set_boxtype
static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F *, uchar, uchar, uchar, uchar, Fl_Box_Draw_Focus_F *=NULL)
Sets the function to call to draw a specific box type.
Definition fl_boxtype.cxx:448
Fl::background2
static void background2(uchar, uchar, uchar)
Changes the alternative background color.
Definition Fl_get_system_colors.cxx:76
Fl::box_dw
static int box_dw(Fl_Boxtype)
Returns the width offset for the given boxtype.
Definition fl_boxtype.cxx:410
Fl::scheme
static int scheme(const char *name)
Sets the current widget scheme.
Definition Fl_get_system_colors.cxx:196
Fl::box_dy
static int box_dy(Fl_Boxtype)
Returns the Y offset for the given boxtype.
Definition fl_boxtype.cxx:404
Fl::abi_version
static int abi_version()
Returns the compiled-in value of the FL_ABI_VERSION constant.
Definition Fl.cxx:136
Fl::box_color
static Fl_Color box_color(Fl_Color)
Gets the drawing color to be used for the background of a box.
Definition fl_boxtype.cxx:72
Fl::dnd_text_ops
static int dnd_text_ops()
Gets whether drag and drop text operations are supported.
Definition Fl.H:1336
Fl::grab
static void grab(Fl_Window &win)
See grab(Fl_Window*)
Definition Fl.H:1302
Fl::option
static bool option(Fl_Option opt)
FLTK library options management.
Definition Fl.cxx:2047
Fl::damage
static int damage()
If true then flush() will do something.
Definition Fl.H:508
Fl::box_shadow_width
static void box_shadow_width(int W)
Set the box shadow width of all "shadow" boxtypes in pixels.
Definition Fl.H:170
Fl::set_labeltype
static void set_labeltype(Fl_Labeltype, Fl_Labeltype from)
Sets the functions to call to draw and measure a specific labeltype.
Fl::draw_box_active
static int draw_box_active()
Determines if the currently drawn box is active or inactive.
Definition fl_boxtype.cxx:59
Fl::version
static double version()
Returns the compiled-in value of the FL_VERSION constant.
Definition Fl.cxx:120
Fl::visible_focus
static void visible_focus(int v)
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition Fl.H:1314
Fl::set_box_color
static void set_box_color(Fl_Color)
Sets the drawing color for the box that is currently drawn.
Definition fl_boxtype.cxx:96
Fl::visible_focus
static int visible_focus()
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition Fl.H:1320
Fl::get_system_colors
static void get_system_colors()
Read the user preference colors from the system and use them to call Fl::foreground(),...
Definition Fl_get_system_colors.cxx:131
Fl::abi_check
static int abi_check(const int val=FL_ABI_VERSION)
Returns whether the runtime library ABI version is correct.
Definition Fl.H:375
Fl::box_dh
static int box_dh(Fl_Boxtype)
Returns the height offset for the given boxtype.
Definition fl_boxtype.cxx:416
Fl::foreground
static void foreground(uchar, uchar, uchar)
Changes fl_color(FL_FOREGROUND_COLOR).
Definition Fl_get_system_colors.cxx:63
Fl::add_awake_handler_
static int add_awake_handler_(Fl_Awake_Handler, void *)
Adds an awake handler for use in awake().
Definition Fl_lock.cxx:70
Fl_Shortcut
unsigned int Fl_Shortcut
16-bit Unicode character + 8-bit indicator for keyboard flags.
Definition fl_types.h:55
uchar
unsigned char uchar
unsigned char
Definition fl_types.h:30
fl_utf8.h
header for Unicode and UTF-8 character handling
Fl_System_Handler
int(* Fl_System_Handler)(void *event, void *data)
Signature of add_system_handler functions passed as parameters.
Definition Fl.H:115
Fl_Timeout_Handler
void(* Fl_Timeout_Handler)(void *data)
Signature of timeout callback functions passed as parameters.
Definition Fl.H:97
Fl_Event_Handler
int(* Fl_Event_Handler)(int event)
Signature of add_handler functions passed as parameters.
Definition Fl.H:112
Fl_Old_Idle_Handler
void(* Fl_Old_Idle_Handler)()
Signature of set_idle callback functions passed as parameters.
Definition Fl.H:106
Fl_Awake_Handler
void(* Fl_Awake_Handler)(void *data)
Signature of some wakeup callback functions passed as parameters.
Definition Fl.H:100
Fl_FD_Handler
void(* Fl_FD_Handler)(FL_SOCKET fd, void *data)
Signature of add_fd functions passed as parameters.
Definition Fl.H:109
Fl_Event_Dispatch
int(* Fl_Event_Dispatch)(int event, Fl_Window *w)
Signature of event_dispatch functions passed as parameters.
Definition Fl.H:128
Fl_Label_Draw_F
void Fl_Label_Draw_F(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align)
Signature of some label drawing functions passed as parameters.
Definition Fl.H:83
Fl_Box_Draw_Focus_F
void Fl_Box_Draw_Focus_F(Fl_Boxtype bt, int x, int y, int w, int h, Fl_Color fg, Fl_Color bg)
Signature of box focus frame drawing functions.
Definition Fl.H:92
Fl_Args_Handler
int(* Fl_Args_Handler)(int argc, char **argv, int &i)
Signature of args functions passed as parameters.
Definition Fl.H:124
Fl_Label_Measure_F
void Fl_Label_Measure_F(const Fl_Label *label, int &width, int &height)
Signature of some label measurement functions passed as parameters.
Definition Fl.H:86
Fl_Abort_Handler
void(* Fl_Abort_Handler)(const char *format,...)
Signature of set_abort functions passed as parameters.
Definition Fl.H:118
Fl_Box_Draw_F
void Fl_Box_Draw_F(int x, int y, int w, int h, Fl_Color color)
Signature of some box drawing functions passed as parameters.
Definition Fl.H:89
Fl_Atclose_Handler
void(* Fl_Atclose_Handler)(Fl_Window *window, void *data)
Signature of set_atclose functions passed as parameters.
Definition Fl.H:121
Fl_Idle_Handler
void(* Fl_Idle_Handler)(void *data)
Signature of add_idle callback functions passed as parameters.
Definition Fl.H:103
Fl_Clipboard_Notify_Handler
void(* Fl_Clipboard_Notify_Handler)(int source, void *data)
Signature of add_clipboard_notify functions passed as parameters.
Definition Fl.H:131
Fl::clipboard_image
static char const *const clipboard_image
Denotes image data.
Definition Fl.H:1065
Fl::selection_owner
static Fl_Widget * selection_owner()
back-compatibility only: Gets the widget owning the current selection
Definition Fl.H:1081
Fl::dnd
static int dnd()
Initiate a Drag And Drop operation.
Definition Fl.cxx:2176
Fl::selection_to_clipboard
static int selection_to_clipboard()
Returns the current selection_to_clipboard mode.
Definition Fl.H:978
Fl::clipboard_plain_text
static char const *const clipboard_plain_text
Denotes plain textual data.
Definition Fl.H:1062
Fl::selection_to_clipboard
static void selection_to_clipboard(int mode)
Copies selections on X11 directly to the clipboard if enabled.
Definition Fl.H:969
Fl::event_clicks
static void event_clicks(int i)
Manually sets the number returned by Fl::event_clicks().
Definition Fl.H:686
Fl::event_is_click
static void event_is_click(int i)
Clears the value returned by Fl::event_is_click().
Definition Fl.H:701
Fl::event_button4
static int event_button4()
Returns non-zero if mouse button 4 is currently held down.
Definition Fl.H:1287
Fl::event_y
static int event_y()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition Fl.H:636
Fl::event_key
static int event_key()
Gets which key on the keyboard was last pushed.
Definition Fl.H:773
Fl::event_alt
static int event_alt()
Returns non-zero if the Alt key is pressed.
Definition Fl.H:1258
Fl::focus
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition Fl.H:883
Fl::event_length
static int event_length()
Returns the length of the text in Fl::event_text().
Definition Fl.H:850
Fl::event_state
static int event_state(int mask)
Returns non-zero if any of the passed event state bits are turned on.
Definition Fl.H:761
Fl::event_button5
static int event_button5()
Returns non-zero if mouse button 5 is currently held down.
Definition Fl.H:1292
Fl::event_dy
static int event_dy()
Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition Fl.H:660
Fl::event_x_root
static int event_x_root()
Returns the mouse position on the screen of the event.
Definition Fl.H:643
Fl::pushed
static Fl_Widget * pushed()
Gets the widget that is being pushed.
Definition Fl.H:880
Fl::event_clipboard_type
static const char * event_clipboard_type()
Returns the type of the pasted data during an FL_PASTE event.
Definition Fl.H:859
Fl::event_button1
static int event_button1()
Returns non-zero if mouse button 1 is currently held down.
Definition Fl.H:1272
Fl::event_button3
static int event_button3()
Returns non-zero if mouse button 3 is currently held down.
Definition Fl.H:1282
Fl::event_command
static int event_command()
Returns non-zero if the FL_COMMAND key is pressed, either FL_CTRL or on OSX FL_META.
Definition Fl.H:1256
Fl::event_button
static int event_button()
Gets which particular mouse button caused the current event.
Definition Fl.H:713
Fl::event_x
static int event_x()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition Fl.H:631
Fl::event_y_root
static int event_y_root()
Returns the mouse position on the screen of the event.
Definition Fl.H:650
Fl::event_clipboard
static void * event_clipboard()
During an FL_PASTE event of non-textual data, returns a pointer to the pasted data.
Definition Fl.H:855
Fl::event_shift
static int event_shift()
Returns non-zero if the Shift key is pressed.
Definition Fl.H:1252
Fl::event
static int event()
Returns the last event that was processed.
Definition Fl.H:626
Fl::event_ctrl
static int event_ctrl()
Returns non-zero if the Control key is pressed.
Definition Fl.H:1254
Fl::belowmouse
static Fl_Widget * belowmouse()
Gets the widget that is below the mouse.
Definition Fl.H:876
Fl::event_button2
static int event_button2()
Returns non-zero if mouse button 2 is currently held down.
Definition Fl.H:1277
Fl::event_dx
static int event_dx()
Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition Fl.H:655
Fl::event_original_key
static int event_original_key()
Returns the keycode of the last key event, regardless of the NumLock state.
Definition Fl.H:782
Fl::event_is_click
static int event_is_click()
Returns non-zero if the mouse has not moved far enough and not enough time has passed since the last ...
Definition Fl.H:694
Fl::event_text
static const char * event_text()
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events.
Definition Fl.H:843
Fl::event_buttons
static int event_buttons()
Returns the mouse buttons state bits; if non-zero, then at least one button is pressed now.
Definition Fl.H:1267
Fl::event_state
static int event_state()
Returns the keyboard and mouse button states of the last event.
Definition Fl.H:754
Fl::event_clicks
static int event_clicks()
Returns non zero if we had a double click event.
Definition Fl.H:678
Fl::x
static int x()
Returns the leftmost x coordinate of the main screen work area.
Definition screen_xywh.cxx:31
Fl::y
static int y()
Returns the topmost y coordinate of the main screen work area.
Definition screen_xywh.cxx:38
Fl::first_window
static Fl_Window * first_window()
Returns the first top-level window in the list of shown() windows.
Definition Fl.cxx:761
Fl::next_window
static Fl_Window * next_window(const Fl_Window *)
Returns the next top-level window in the list of shown() windows.
Definition Fl.cxx:771
Fl::atclose
static void(* atclose)(Fl_Window *, void *)
Back compatibility: default window callback handler.
Definition Fl.H:1241
Fl::modal
static Fl_Window * modal()
Returns the top-most modal() window currently shown.
Definition Fl.H:582
Fl::set_abort
static void set_abort(Fl_Abort_Handler f)
For back compatibility, sets the void Fl::fatal handler callback.
Definition Fl.H:1240
Fl::grab
static Fl_Window * grab()
Returns the window that currently receives all events.
Definition Fl.H:588
Fl::default_atclose
static void default_atclose(Fl_Window *, void *)
Default callback for window widgets.
Definition Fl_Window.cxx:172
Fl::set_atclose
static void set_atclose(Fl_Atclose_Handler f)
For back compatibility, sets the Fl::atclose handler callback.
Definition Fl.H:1246
Fl::cairo_cc
static cairo_t * cairo_cc()
Gets the current Cairo context linked with a fltk window.
Definition Fl.H:1470
Fl::cairo_cc
static void cairo_cc(cairo_t *c, bool own=false)
Sets the current Cairo context to c.
Definition Fl.H:1478
Fl::cairo_autolink_context
static bool cairo_autolink_context()
Gets the current autolink mode for Cairo support.
Definition Fl.H:1465
Fl::cairo_flush
static void cairo_flush(cairo_t *c)
Flush Cairo drawings on Cairo context c.
Definition Fl.H:1515
Fl::cairo_autolink_context
static void cairo_autolink_context(bool alink)
When FLTK_HAVE_CAIRO is defined and cairo_autolink_context() is true, any current window dc is linked...
Definition Fl.H:1454
Fl::error
static void(* error)(const char *,...)
FLTK calls Fl::error() to output a normal error message.
Definition Fl.H:546
Fl::fatal
static void(* fatal)(const char *,...)
FLTK calls Fl::fatal() to output a fatal error message.
Definition Fl.H:563
Fl::warning
static void(* warning)(const char *,...)
FLTK calls Fl::warning() to output a warning message.
Definition Fl.H:531
platform_types.h
Definitions of platform-dependent types.
FL_COMMAND
#define FL_COMMAND
An alias for FL_CTRL on Windows and X11, or FL_META on MacOS X.
Definition platform_types.h:75
Fl_Timestamp
opaque Fl_Timestamp
Platform-specific point in time, used for delta time calculation.
Definition platform_types.h:73
FL_SOCKET
opaque FL_SOCKET
socket or file descriptor
Definition platform_types.h:57
Fl_Label
This struct stores all information for a text or mixed graphics label.
Definition Fl_Widget.H:49