FLTK
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-2020 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 
21 #ifndef Fl_H
22 # define Fl_H
23 
24 #include <FL/Fl_Export.H>
25 
26 #include <FL/platform_types.h> // for FL_SOCKET
27 #ifdef FLTK_HAVE_CAIRO
28 # include <FL/Fl_Cairo.H>
29 #endif
30 
31 # include "fl_utf8.h"
32 # include "Enumerations.H"
33 # ifndef Fl_Object
34 # define Fl_Object Fl_Widget
35 # endif
36 
37 # ifdef check
38 # undef check
39 # endif
40 
41 # ifdef BSD
42 # undef BSD
43 # endif
44 
45 
46 class Fl_Widget;
47 class Fl_Window;
48 class Fl_Image;
49 struct Fl_Label;
50 class Fl_Screen_Driver;
51 class Fl_System_Driver;
52 
53 // Pointers you can use to change FLTK to another language.
54 // Note: Similar pointers are defined in FL/fl_ask.H and src/fl_ask.cxx
55 
56 extern FL_EXPORT const char* fl_local_alt;
57 extern FL_EXPORT const char* fl_local_ctrl;
58 extern FL_EXPORT const char* fl_local_meta;
59 extern FL_EXPORT const char* fl_local_shift;
60 
77 typedef void (Fl_Label_Draw_F)(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align);
78 
80 typedef void (Fl_Label_Measure_F)(const Fl_Label *label, int &width, int &height);
81 
83 typedef void (Fl_Box_Draw_F)(int x, int y, int w, int h, Fl_Color color);
84 
86 typedef void (*Fl_Timeout_Handler)(void *data);
87 
89 typedef void (*Fl_Awake_Handler)(void *data);
90 
92 typedef void (*Fl_Idle_Handler)(void *data);
93 
95 typedef void (*Fl_Old_Idle_Handler)();
96 
98 typedef void (*Fl_FD_Handler)(FL_SOCKET fd, void *data);
99 
101 typedef int (*Fl_Event_Handler)(int event);
102 
104 typedef int (*Fl_System_Handler)(void *event, void *data);
105 
107 typedef void (*Fl_Abort_Handler)(const char *format,...);
108 
110 typedef void (*Fl_Atclose_Handler)(Fl_Window *window, void *data);
111 
113 typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i);
114 
117 typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w);
118 
120 typedef void (*Fl_Clipboard_Notify_Handler)(int source, void *data);
121  /* group callback_functions */
123 
124 
129 class FL_EXPORT Fl {
130  Fl() {}; // no constructor!
131 
132 private:
133 
134  static int use_high_res_GL_;
135  static int draw_GL_text_with_textures_;
136  static int box_shadow_width_;
137  static int box_border_radius_max_;
138 
139 public:
140 
141  static Fl_Screen_Driver *screen_driver();
142  static Fl_System_Driver *system_driver();
143  static void reset_marked_text(); // resets marked text
144  static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point
145 
149  static int box_shadow_width() { return box_shadow_width_; }
154  static void box_shadow_width(int W) { box_shadow_width_ = W < 1 ? 1 : W; }
155 
159  static int box_border_radius_max() { return box_border_radius_max_; }
172  static void box_border_radius_max(int R) { box_border_radius_max_ = R < 5 ? 5 : R; }
173 
174 public: // run time information about compile time configuration
177  static bool cfg_gfx_xlib;
178  static bool cfg_gfx_quartz;
179  static bool cfg_gfx_gdi;
180  static bool cfg_gfx_opengl;
181  static bool cfg_gfx_cairo;
182  static bool cfg_gfx_directx;
183 
186  static bool cfg_prn_ps;
187  static bool cfg_prn_quartz;
188  static bool cfg_prn_gdi;
189 
192  static bool cfg_win_x11;
193  static bool cfg_win_cocoa;
194  static bool cfg_win_win32;
195 
198  static bool cfg_sys_posix;
199  static bool cfg_sys_win32;
200 
202 public: // should be private!
203 
204 #ifndef FL_DOXYGEN
205  static int e_number;
206  static int e_x;
207  static int e_y;
208  static int e_x_root;
209  static int e_y_root;
210  static int e_dx;
211  static int e_dy;
212  static int e_state;
213  static int e_clicks;
214  static int e_is_click;
215  static int e_keysym;
216  static char* e_text;
217  static int e_length;
218  static void *e_clipboard_data;
219  static const char *e_clipboard_type;
220  static Fl_Event_Dispatch e_dispatch;
221  static Fl_Widget* belowmouse_;
222  static Fl_Widget* pushed_;
223  static Fl_Widget* focus_;
224  static int damage_;
225  static Fl_Widget* selection_owner_;
226  static Fl_Window* modal_;
227  static Fl_Window* grab_;
228  static int compose_state; // used for dead keys (Windows) or marked text (MacOS)
229  static void call_screen_init(); // recompute screen number and dimensions
230 #endif // FL_DOXYGEN
231 
232 
236  static void damage(int d) {damage_ = d;}
237 
238 public:
245  typedef enum {
255  OPTION_ARROW_FOCUS = 0,
256  // When switched on, FLTK will use the file chooser dialog that comes
257  // with your operating system whenever possible. When switched off, FLTK
258  // will present its own file chooser.
259  // \todo implement me
260  // OPTION_NATIVE_FILECHOOSER,
261  // When Filechooser Preview is enabled, the FLTK or native file chooser
262  // will show a preview of a selected file (if possible) before the user
263  // decides to choose the file.
264  // \todo implement me
265  //OPTION_FILECHOOSER_PREVIEW,
291  // don't change this, leave it always as the last element
293  OPTION_LAST
294  } Fl_Option;
295 
296 private:
297  static unsigned char options_[OPTION_LAST];
298  static unsigned char options_read_;
299  static int program_should_quit_; // non-zero means the program was asked to cleanly terminate
300 
301 public:
302  /*
303  Return a global setting for all FLTK applications, possibly overridden
304  by a setting specifically for this application.
305  */
306  static bool option(Fl_Option opt);
307 
308  /*
309  Override an option while the application is running.
310  */
311  static void option(Fl_Option opt, bool val);
312 
320  static void (*idle)();
321 
322 #ifndef FL_DOXYGEN
323  static Fl_Awake_Handler *awake_ring_;
324  static void **awake_data_;
325  static int awake_ring_size_;
326  static int awake_ring_head_;
327  static int awake_ring_tail_;
328  static const char* scheme_;
329  static Fl_Image* scheme_bg_;
330 
331  static int e_original_keysym; // late addition
332  static int scrollbar_size_;
333  static int menu_linespacing_; // STR #2927
334 #endif
335 
336 
337  static int add_awake_handler_(Fl_Awake_Handler, void*);
338  static int get_awake_handler_(Fl_Awake_Handler&, void*&);
339 
340 public:
341 
342  // API version number
343  static double version();
344  static int api_version();
345 
346  // ABI version number
347  static int abi_version();
348 
371  static inline int abi_check(const int val = FL_ABI_VERSION) {
372  return val == abi_version();
373  }
374 
375  // argument parsers:
376  static int arg(int argc, char **argv, int& i);
377  static int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0);
378  static void args(int argc, char **argv);
383  static const char* const help;
384 
385  // things called by initialization:
386  static void display(const char*);
387  static int visual(int);
397  static int gl_visual(int, int *alist=0); // platform dependent
398  static void own_colormap();
399  static void get_system_colors();
400  static void foreground(uchar, uchar, uchar);
401  static void background(uchar, uchar, uchar);
402  static void background2(uchar, uchar, uchar);
403 
404  // schemes:
405  static int scheme(const char *name);
407  static const char* scheme() {return scheme_;}
408 
436  static int is_scheme(const char *name) {
437  return (scheme_ && name && !strcmp(name,scheme_));
438  }
444  static int reload_scheme(); // platform dependent
445  static int scrollbar_size();
446  static void scrollbar_size(int W);
447  static int menu_linespacing();
448  static void menu_linespacing(int H);
449 
450  // execution:
451  static int wait();
452  static double wait(double time);
453  static int check();
454  static int ready();
455  static int run();
462  static int program_should_quit() {return program_should_quit_;}
468  static void program_should_quit(int should_i) { program_should_quit_ = should_i; }
469 
470  static Fl_Widget* readqueue();
501  static void add_timeout(double t, Fl_Timeout_Handler,void* = 0); // platform dependent
525  static void repeat_timeout(double t, Fl_Timeout_Handler, void* = 0); // platform dependent
526  static int has_timeout(Fl_Timeout_Handler, void* = 0);
527  static void remove_timeout(Fl_Timeout_Handler, void* = 0);
528  static void add_check(Fl_Timeout_Handler, void* = 0);
529  static int has_check(Fl_Timeout_Handler, void* = 0);
530  static void remove_check(Fl_Timeout_Handler, void* = 0);
531  // private
532  static void run_checks();
533  static void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0); // platform dependent
534  static void add_fd(int fd, Fl_FD_Handler cb, void* = 0); // platform dependent
536  static void remove_fd(int, int when); // platform dependent
538  static void remove_fd(int); // platform dependent
539 
540  static void add_idle(Fl_Idle_Handler cb, void* data = 0);
541  static int has_idle(Fl_Idle_Handler cb, void* data = 0);
542  static void remove_idle(Fl_Idle_Handler cb, void* data = 0);
544  static int damage() {return damage_;}
545  static void redraw();
546  static void flush();
567  static void (*warning)(const char*, ...);
582  static void (*error)(const char*, ...);
599  static void (*fatal)(const char*, ...);
605  static Fl_Window* first_window();
606  static void first_window(Fl_Window*);
607  static Fl_Window* next_window(const Fl_Window*);
608 
618  static Fl_Window* modal() {return modal_;}
624  static Fl_Window* grab() {return grab_;}
649  static void grab(Fl_Window*); // platform dependent
656  // event information:
662  static int event() {return e_number;}
667  static int event_x() {return e_x;}
672  static int event_y() {return e_y;}
679  static int event_x_root() {return e_x_root;}
686  static int event_y_root() {return e_y_root;}
691  static int event_dx() {return e_dx;}
696  static int event_dy() {return e_dy;}
705  static void get_mouse(int &,int &);
714  static int event_clicks() {return e_clicks;}
722  static void event_clicks(int i) {e_clicks = i;}
730  static int event_is_click() {return e_is_click;}
737  static void event_is_click(int i) {e_is_click = i;}
747  static int event_button() {return e_keysym-FL_Button;}
773  static int event_state() {return e_state;}
774 
780  static int event_state(int mask) {return e_state&mask;}
792  static int event_key() {return e_keysym;}
801  static int event_original_key(){return e_original_keysym;}
840  static int event_key(int key);
846  static int get_key(int key); // platform dependent
861  static const char* event_text() {return e_text;}
868  static int event_length() {return e_length;}
869 
873  static void *event_clipboard() { return e_clipboard_data; }
877  static const char *event_clipboard_type() {return e_clipboard_type; }
878 
879 
880  static int compose(int &del);
881  static void compose_reset();
882  static int event_inside(int,int,int,int);
883  static int event_inside(const Fl_Widget*);
884  static int test_shortcut(Fl_Shortcut);
885 
886  static void enable_im();
887  static void disable_im();
888 
889  // event destinations:
890  static int handle(int, Fl_Window*);
891  static int handle_(int, Fl_Window*);
894  static Fl_Widget* belowmouse() {return belowmouse_;}
895  static void belowmouse(Fl_Widget*);
898  static Fl_Widget* pushed() {return pushed_;}
899  static void pushed(Fl_Widget*);
901  static Fl_Widget* focus() {return focus_;}
902  static void focus(Fl_Widget*);
903  static void add_handler(Fl_Event_Handler h);
904  static void remove_handler(Fl_Event_Handler h);
905  static void add_system_handler(Fl_System_Handler h, void *data);
906  static void remove_system_handler(Fl_System_Handler h);
907  static void event_dispatch(Fl_Event_Dispatch d);
908  static Fl_Event_Dispatch event_dispatch();
914  // cut/paste:
930  static void copy(const char* stuff, int len, int destination = 0, const char *type = Fl::clipboard_plain_text); // platform dependent
931 
974  static void paste(Fl_Widget &receiver, int source, const char *type = Fl::clipboard_plain_text);
975 
997  static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data = 0);
1002  static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h);
1006  static int clipboard_contains(const char *type);
1009  static char const * const clipboard_plain_text;
1012  static char const * const clipboard_image;
1013 
1023  static int dnd(); // platform dependent
1024 
1025  // These are for back-compatibility only:
1028  static Fl_Widget* selection_owner() {return selection_owner_;}
1029  static void selection_owner(Fl_Widget*);
1030  static void selection(Fl_Widget &owner, const char*, int len);
1031  static void paste(Fl_Widget &receiver);
1051  static int x(); // via screen driver
1052  static int y(); // via screen driver
1053  static int w(); // via screen driver
1054  static int h(); // via screen driver
1055 
1056  // multi-head support:
1057  static int screen_count(); // via screen driver
1058  static void screen_xywh(int &X, int &Y, int &W, int &H); // via screen driver
1059  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver
1060  static void screen_xywh(int &X, int &Y, int &W, int &H, int n); // via screen driver
1061  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh); // via screen driver
1062  static int screen_num(int x, int y); // via screen driver
1063  static int screen_num(int x, int y, int w, int h); // via screen driver
1064  static void screen_dpi(float &h, float &v, int n=0); // via screen driver
1065  static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my); // via screen driver
1066  static void screen_work_area(int &X, int &Y, int &W, int &H, int n); // via screen driver
1067  static void screen_work_area(int &X, int &Y, int &W, int &H); // via screen driver
1068  static float screen_scale(int n); // via screen driver
1069  static void screen_scale(int n, float factor); // via screen driver
1070  static int screen_scaling_supported();
1071  static void keyboard_screen_scaling(int value);
1072 
1081  // color map:
1082  static void set_color(Fl_Color, uchar, uchar, uchar);
1087  static void set_color(Fl_Color i, unsigned c); // platform dependent
1088  static unsigned get_color(Fl_Color i);
1089  static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue);
1095  static void free_color(Fl_Color i, int overlay = 0); // platform dependent
1096 
1097  // fonts:
1098  static const char* get_font(Fl_Font);
1111  static const char* get_font_name(Fl_Font, int* attributes = 0);
1123  static int get_font_sizes(Fl_Font, int*& sizep);
1124  static void set_font(Fl_Font, const char*);
1125  static void set_font(Fl_Font, Fl_Font);
1144  static Fl_Font set_fonts(const char* = 0); // platform dependent
1145 
1152  // <Hack to re-order the 'Drawing functions' group>
1155  // labeltypes:
1156  static void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
1158  static void set_labeltype(Fl_Labeltype, Fl_Labeltype from); // is it defined ?
1159 
1160  // boxtypes:
1161  static Fl_Box_Draw_F *get_boxtype(Fl_Boxtype);
1162  static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*,uchar,uchar,uchar,uchar);
1163  static void set_boxtype(Fl_Boxtype, Fl_Boxtype from);
1164  static int box_dx(Fl_Boxtype);
1165  static int box_dy(Fl_Boxtype);
1166  static int box_dw(Fl_Boxtype);
1167  static int box_dh(Fl_Boxtype);
1168 
1169  static int draw_box_active();
1170  static Fl_Color box_color(Fl_Color);
1171  static void set_box_color(Fl_Color);
1172 
1173  // back compatibility:
1177  static void set_abort(Fl_Abort_Handler f) {fatal = f;}
1178  static void (*atclose)(Fl_Window*,void*);
1179  static void default_atclose(Fl_Window*,void*);
1183  static void set_atclose(Fl_Atclose_Handler f) {atclose = f;}
1189  static int event_shift() {return e_state&FL_SHIFT;}
1191  static int event_ctrl() {return e_state&FL_CTRL;}
1193  static int event_command() {return e_state&FL_COMMAND;}
1195  static int event_alt() {return e_state&FL_ALT;}
1204  static int event_buttons() {return e_state&0x7f000000;}
1209  static int event_button1() {return e_state&FL_BUTTON1;}
1214  static int event_button2() {return e_state&FL_BUTTON2;}
1219  static int event_button3() {return e_state&FL_BUTTON3;}
1227  static void set_idle(Fl_Old_Idle_Handler cb) {idle = cb;}
1229  static void grab(Fl_Window& win) {grab(&win);}
1233  static void release() {grab(0);}
1234 
1235  // Visible focus methods...
1241  static void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); }
1247  static int visible_focus() { return option(OPTION_VISIBLE_FOCUS); }
1248 
1249  // Drag-n-drop text operation methods...
1256  static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); }
1263  static int dnd_text_ops() { return option(OPTION_DND_TEXT); }
1268  // Multithreading support:
1269  static int lock();
1270  static void unlock();
1271  static void awake(void* message = 0);
1273  static int awake(Fl_Awake_Handler cb, void* message = 0);
1280  static void* thread_message(); // platform dependent
1312  // Widget deletion:
1313  static void delete_widget(Fl_Widget *w);
1314  static void do_widget_deletion();
1315  static void watch_widget_pointer(Fl_Widget *&w);
1316  static void release_widget_pointer(Fl_Widget *&w);
1317  static void clear_widget_pointer(Fl_Widget const *w);
1324  static void use_high_res_GL(int val) { use_high_res_GL_ = val; }
1330  static int use_high_res_GL() { return use_high_res_GL_; }
1331 
1343  static void draw_GL_text_with_textures(int val) { draw_GL_text_with_textures_ = val; }
1344 
1350  static int draw_GL_text_with_textures() { return draw_GL_text_with_textures_; }
1351 
1352 
1353 #ifdef FLTK_HAVE_CAIRO
1354 
1357 public:
1358  // Cairo support API
1359  static cairo_t * cairo_make_current(Fl_Window* w);
1374  static void cairo_autolink_context(bool alink) {cairo_state_.autolink(alink);}
1382  static bool cairo_autolink_context() {return cairo_state_.autolink();}
1384  static cairo_t * cairo_cc() { return cairo_state_.cc(); }
1389  static void cairo_cc(cairo_t * c, bool own=false){ cairo_state_.cc(c, own); }
1390 
1391 private:
1392  static cairo_t * cairo_make_current(void* gc);
1393  static cairo_t * cairo_make_current(void* gc, int W, int H);
1394  static Fl_Cairo_State cairo_state_;
1395 public:
1398 #endif // FLTK_HAVE_CAIRO
1399 
1400 };
1401 
1444 class FL_EXPORT Fl_Widget_Tracker {
1445 
1446  Fl_Widget* wp_;
1447 
1448 public:
1449 
1451  ~Fl_Widget_Tracker();
1452 
1458  Fl_Widget *widget() {return wp_;}
1459 
1469  int deleted() {return wp_ == 0;}
1470 
1480  int exists() {return wp_ != 0;}
1481 
1482 };
1483 
1489 #endif // !Fl_H
static Fl_Window * modal()
Returns the top-most modal() window currently shown.
Definition: Fl.H:618
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:85
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:80
static int event_state(int mask)
Returns non-zero if any of the passed event state bits are turned on.
Definition: Fl.H:780
static int draw_GL_text_with_textures()
returns whether whether OpenGL uses textures to draw all text.
Definition: Fl.H:1350
int(* Fl_Event_Dispatch)(int event, Fl_Window *w)
Signature of event_dispatch functions passed as parameters.
Definition: Fl.H:117
static bool cfg_gfx_directx
DirectX rendering available, usually on Windows systems.
Definition: Fl.H:182
This widget produces an actual window.
Definition: Fl_Window.H:53
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:730
static bool cfg_win_win32
Windows window management available, on low level Windows.
Definition: Fl.H:194
#define FL_BUTTON2
Mouse button 2 is pushed.
Definition: Enumerations.H:550
When switched on (default), the library shows in a transient yellow window the zoom factor value...
Definition: Fl.H:290
static const char * scheme()
See void scheme(const char *name)
Definition: Fl.H:407
int deleted()
Returns 1, if the watched widget has been deleted.
Definition: Fl.H:1469
static void box_border_radius_max(int R)
Set the maximum border radius of all "rounded" boxtypes in pixels.
Definition: Fl.H:172
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition: Fl.H:901
static const char * event_text()
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events...
Definition: Fl.H:861
static void * event_clipboard()
During an FL_PASTE event of non-textual data, returns a pointer to the pasted data.
Definition: Fl.H:873
static Fl_Widget * selection_owner()
back-compatibility only: Gets the widget owning the current selection
Definition: Fl.H:1028
int(* Fl_Args_Handler)(int argc, char **argv, int &i)
Signature of args functions passed as parameters.
Definition: Fl.H:113
static int event_button1()
Returns non-zero if mouse button 1 is currently held down.
Definition: Fl.H:1209
static bool cfg_prn_quartz
Quartz rendering available, usually on OS X systems.
Definition: Fl.H:187
static int is_scheme(const char *name)
Returns whether the current scheme is the given name.
Definition: Fl.H:436
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:1374
The Fl is the FLTK global (static) class containing state information and global methods for the curr...
Definition: Fl.H:129
static void release()
Releases the current grabbed window, equals grab(0).
Definition: Fl.H:1233
int exists()
Returns 1, if the watched widget exists (has not been deleted).
Definition: Fl.H:1480
static int box_border_radius_max()
Get the maximum border radius of all "rounded" boxtypes in pixels.
Definition: Fl.H:159
void(* Fl_Abort_Handler)(const char *format,...)
Signature of set_abort functions passed as parameters.
Definition: Fl.H:107
static const char * event_clipboard_type()
Returns the type of the pasted data during an FL_PASTE event.
Definition: Fl.H:877
static int event_y_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:686
If visible focus is switched on (default), FLTK will draw a dotted rectangle inside the widget that w...
Definition: Fl.H:270
FL_EXPORT const char * fl_local_meta
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:2180
static Fl_Widget * belowmouse()
Gets the widget that is below the mouse.
Definition: Fl.H:894
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:77
static int event()
Returns the last event that was processed.
Definition: Fl.H:662
static bool cfg_prn_gdi
GDI rendering available, usually on Windows systems.
Definition: Fl.H:188
header for Unicode and UTF-8 character handling
static char const *const clipboard_plain_text
Denotes plain textual data.
Definition: Fl.H:1009
#define FL_BUTTON3
Mouse button 3 is pushed.
Definition: Enumerations.H:551
static char const *const clipboard_image
Denotes image data.
Definition: Fl.H:1012
Definitions of platform-dependent types.
#define FL_ABI_VERSION
The FLTK ABI (Application Binary Interface) version number as an int.
Definition: Enumerations.H:171
static int event_y()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:672
Base class for image caching, scaling and drawing.
Definition: Fl_Image.H:62
static int event_dx()
Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:691
int(* Fl_Event_Handler)(int event)
Signature of add_handler functions passed as parameters.
Definition: Fl.H:101
static bool cfg_gfx_quartz
Quartz rendering available, usually on OS X systems.
Definition: Fl.H:178
If tooltips are enabled (default), hovering the mouse over a widget with a tooltip text will open a l...
Definition: Fl.H:278
Fl_Boxtype
FLTK standard box types.
Definition: Enumerations.H:598
static bool cfg_prn_ps
PostScript rendering available, usually on Linux systems.
Definition: Fl.H:186
static int event_button()
Gets which particular mouse button caused the current event.
Definition: Fl.H:747
static bool cairo_autolink_context()
Gets the current autolink mode for cairo support.
Definition: Fl.H:1382
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:1330
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:539
This file contains type definitions and general enumerations.
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:1324
#define FL_Button
A mouse button; use Fl_Button + n for mouse button n.
Definition: Enumerations.H:449
static bool cfg_gfx_gdi
GDI rendering available, usually on Windows systems.
Definition: Fl.H:179
FL_EXPORT const char * fl_local_shift
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:2179
FL_EXPORT const char * fl_local_ctrl
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:2182
If text drag-and-drop is enabled (default), the user can select and drag text from any text widget...
Definition: Fl.H:274
static int program_should_quit()
Returns non-zero when a request for program termination was received and accepted.
Definition: Fl.H:462
Fl_Widget * widget()
Returns a pointer to the watched widget.
Definition: Fl.H:1458
static void event_clicks(int i)
Manually sets the number returned by Fl::event_clicks().
Definition: Fl.H:722
static bool cfg_gfx_xlib
X11 Xlib rendering available, usually on Linux systems.
Definition: Fl.H:177
#define FL_COMMAND
An alias for FL_CTRL on Windows and X11, or FL_META on MacOS X.
Definition: platform_types.h:41
static bool cfg_win_x11
X11 window management available, usually on Linux systems.
Definition: Fl.H:192
static int event_clicks()
Returns non zero if we had a double click event.
Definition: Fl.H:714
static void box_shadow_width(int W)
Set the box shadow width of all "shadow" boxtypes in pixels.
Definition: Fl.H:154
static const char *const help
Usage string displayed if Fl::args() detects an invalid argument.
Definition: Fl.H:383
static bool cfg_gfx_cairo
Cairo rendering available, available on many platforms.
Definition: Fl.H:181
When switched on (default), Fl_Native_File_Chooser runs GTK file dialogs if the GTK library is availa...
Definition: Fl.H:282
static int event_state()
Returns the keyboard and mouse button states of the last event.
Definition: Fl.H:773
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:48
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:541
static int event_original_key()
Returns the keycode of the last key event, regardless of the NumLock state.
Definition: Fl.H:801
FL_EXPORT const char * fl_local_alt
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:2181
static int event_button3()
Returns non-zero if button 3 is currently held down.
Definition: Fl.H:1219
static void draw_GL_text_with_textures(int val)
sets whether OpenGL uses textures to draw all text.
Definition: Fl.H:1343
static int visible_focus()
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:1247
static int event_dy()
Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:696
This class should be used to control safe widget deletion.
Definition: Fl.H:1444
static bool cfg_win_cocoa
Cocoa window management available, usually on OS X systems.
Definition: Fl.H:193
void(* Fl_Atclose_Handler)(Fl_Window *window, void *data)
Signature of set_atclose functions passed as parameters.
Definition: Fl.H:110
static void grab(Fl_Window &win)
See grab(Fl_Window*)
Definition: Fl.H:1229
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:468
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:542
static int event_length()
Returns the length of the text in Fl::event_text().
Definition: Fl.H:868
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:1193
static void event_is_click(int i)
Clears the value returned by Fl::event_is_click().
Definition: Fl.H:737
static bool cfg_gfx_opengl
OpenGL rendering available, available on many platforms.
Definition: Fl.H:180
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition: Enumerations.H:1042
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition: Enumerations.H:757
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:985
static int box_shadow_width()
Get the box shadow width of all "shadow" boxtypes in pixels.
Definition: Fl.H:149
static int abi_check(const int val=FL_ABI_VERSION)
Returns whether the runtime library ABI version is correct.
Definition: Fl.H:371
Fl_Option
Enumerator for global FLTK options.
Definition: Fl.H:245
static int event_x_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:679
#define FL_BUTTON1
Mouse button 1 is pushed.
Definition: Enumerations.H:549
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:908
static bool cfg_sys_posix
Posix system available, usually on Linux and OS X systems, but also Cygwin.
Definition: Fl.H:198
When switched on (default), Fl_Printer runs the GTK printer dialog if the GTK library is available on...
Definition: Fl.H:286
static void dnd_text_ops(int v)
Sets whether drag and drop text operations are supported.
Definition: Fl.H:1256
static void cairo_cc(cairo_t *c, bool own=false)
Sets the current cairo context to c.
Definition: Fl.H:1389
static Fl_Window * grab()
Returns the window that currently receives all events.
Definition: Fl.H:624
void(* Fl_Old_Idle_Handler)()
Signature of set_idle callback functions passed as parameters.
Definition: Fl.H:95
static void damage(int d)
If true then flush() will do something.
Definition: Fl.H:236
void(* Fl_Idle_Handler)(void *data)
Signature of add_idle callback functions passed as parameters.
Definition: Fl.H:92
int(* Fl_System_Handler)(void *event, void *data)
Signature of add_system_handler functions passed as parameters.
Definition: Fl.H:104
static void visible_focus(int v)
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:1241
static int event_button2()
Returns non-zero if button 2 is currently held down.
Definition: Fl.H:1214
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:83
static Fl_Widget * pushed()
Gets the widget that is being pushed.
Definition: Fl.H:898
void(* Fl_Awake_Handler)(void *data)
Signature of some wakeup callback functions passed as parameters.
Definition: Fl.H:89
static void set_atclose(Fl_Atclose_Handler f)
For back compatibility, sets the Fl::atclose handler callback.
Definition: Fl.H:1183
opaque FL_SOCKET
socket or file descriptor
Definition: platform_types.h:38
static cairo_t * cairo_cc()
Gets the current cairo context linked with a fltk window.
Definition: Fl.H:1384
Contains all the necessary info on the current cairo context.
Definition: Fl_Cairo.H:44
static int event_x()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:667
static int dnd_text_ops()
Gets whether drag and drop text operations are supported.
Definition: Fl.H:1263
static int event_shift()
Returns non-zero if the Shift key is pressed.
Definition: Fl.H:1189
void(* Fl_FD_Handler)(FL_SOCKET fd, void *data)
Signature of add_fd functions passed as parameters.
Definition: Fl.H:98
static int event_ctrl()
Returns non-zero if the Control key is pressed.
Definition: Fl.H:1191
static bool cfg_sys_win32
Windows system available, on Windows.
Definition: Fl.H:199
static int damage()
If true then flush() will do something.
Definition: Fl.H:544
void(* Fl_Timeout_Handler)(void *data)
Signature of some timeout callback functions passed as parameters.
Definition: Fl.H:86
static void set_idle(Fl_Old_Idle_Handler cb)
Sets an idle callback.
Definition: Fl.H:1227
unsigned char uchar
unsigned char
Definition: fl_types.h:28
static int event_buttons()
Returns the mouse buttons state bits; if non-zero, then at least one button is pressed now...
Definition: Fl.H:1204
void(* Fl_Clipboard_Notify_Handler)(int source, void *data)
Signature of add_clipboard_notify functions passed as parameters.
Definition: Fl.H:120
unsigned int Fl_Shortcut
16-bit Unicode character + 8-bit indicator for keyboard flags.
Definition: fl_types.h:53
static int event_key()
Gets which key on the keyboard was last pushed.
Definition: Fl.H:792
static void set_abort(Fl_Abort_Handler f)
For back compatibility, sets the void Fl::fatal handler callback.
Definition: Fl.H:1177
static int event_alt()
Returns non-zero if the Alt key is pressed.
Definition: Fl.H:1195