FLTK 1.3.9
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-2023 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 // http://www.fltk.org/COPYING.php
11 //
12 // Please report all bugs and problems on the following page:
13 //
14 // http://www.fltk.org/str.php
15 //
16 
21 #ifndef Fl_H
22 # define Fl_H
23 
24 // In FLTK 1.3.x WIN32 must be defined on Windows (if not using CYGWIN).
25 // Since FLTK 1.3.9 we define WIN32 if it's not defined on Windows
26 // to avoid common user errors, for instance GitHub Issue #686.
27 // Note: since FLTK 1.4.0 we use '_WIN32' anyway, no need to define WIN32.
28 
29 #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(WIN32)
30 #define WIN32
31 #endif
32 
33 #include <FL/Fl_Export.H>
34 
35 #ifdef FLTK_HAVE_CAIRO
36 # include <FL/Fl_Cairo.H>
37 #endif
38 
39 # include "fl_utf8.h"
40 # include "Enumerations.H"
41 # ifndef Fl_Object
42 # define Fl_Object Fl_Widget
43 # endif
44 
45 # ifdef check
46 # undef check
47 # endif
48 
49 
50 class Fl_Widget;
51 class Fl_Window;
52 class Fl_Image;
53 struct Fl_Label;
54 
55 // Keep avoiding having the socket deps at that level but mke sure it will work in both 32 & 64 bit builds
56 #if defined(WIN32) && !defined(__CYGWIN__)
57 # if defined(_WIN64)
58 # define FL_SOCKET unsigned __int64
59 # else
60 # define FL_SOCKET int
61 # endif
62 #else
63 # define FL_SOCKET int
64 #endif
65 
66 
67 // Pointers you can use to change FLTK to a foreign language.
68 // Note: Similar pointers are defined in FL/fl_ask.H and src/fl_ask.cxx
69 extern FL_EXPORT const char* fl_local_ctrl;
70 extern FL_EXPORT const char* fl_local_meta;
71 extern FL_EXPORT const char* fl_local_alt;
72 extern FL_EXPORT const char* fl_local_shift;
73 
90 typedef void (Fl_Label_Draw_F)(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align);
91 
93 typedef void (Fl_Label_Measure_F)(const Fl_Label *label, int &width, int &height);
94 
96 typedef void (Fl_Box_Draw_F)(int x, int y, int w, int h, Fl_Color color);
97 
99 typedef void (*Fl_Timeout_Handler)(void *data);
100 
102 typedef void (*Fl_Awake_Handler)(void *data);
103 
105 typedef void (*Fl_Idle_Handler)(void *data);
106 
108 typedef void (*Fl_Old_Idle_Handler)();
109 
111 typedef void (*Fl_FD_Handler)(FL_SOCKET fd, void *data);
112 
114 typedef int (*Fl_Event_Handler)(int event);
115 
117 typedef int (*Fl_System_Handler)(void *event, void *data);
118 
120 typedef void (*Fl_Abort_Handler)(const char *format,...);
121 
123 typedef void (*Fl_Atclose_Handler)(Fl_Window *window, void *data);
124 
126 typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i);
127 
130 typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w);
131 
133 typedef void (*Fl_Clipboard_Notify_Handler)(int source, void *data);
134  /* group callback_functions */
136 
137 
142 class FL_EXPORT Fl {
143  Fl() {}; // no constructor!
144 
145 private:
146  static int use_high_res_GL_;
147 
148 public: // should be private!
149 #ifndef FL_DOXYGEN
150  static int e_number;
151  static int e_x;
152  static int e_y;
153  static int e_x_root;
154  static int e_y_root;
155  static int e_dx;
156  static int e_dy;
157  static int e_state;
158  static int e_clicks;
159  static int e_is_click;
160  static int e_keysym;
161  static char* e_text;
162  static int e_length;
163  static void *e_clipboard_data;
164  static const char *e_clipboard_type;
165  static Fl_Event_Dispatch e_dispatch;
166  static Fl_Widget* belowmouse_;
167  static Fl_Widget* pushed_;
168  static Fl_Widget* focus_;
169  static int damage_;
170  static Fl_Widget* selection_owner_;
171  static Fl_Window* modal_;
172  static Fl_Window* grab_;
173  static int compose_state; // used for dead keys (WIN32) or marked text (MacOS)
174  static void call_screen_init(); // recompute screen number and dimensions
175 #ifdef __APPLE__
176  static void reset_marked_text(); // resets marked text
177  static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point
178 #endif
179 #endif // FL_DOXYGEN
180 
181 
185  static void damage(int d) {damage_ = d;}
186 
187 public:
194  typedef enum {
204  OPTION_ARROW_FOCUS = 0,
205  // When switched on, FLTK will use the file chooser dialog that comes
206  // with your operating system whenever possible. When switched off, FLTK
207  // will present its own file chooser.
208  // \todo implement me
209  // OPTION_NATIVE_FILECHOOSER,
210  // When Filechooser Preview is enabled, the FLTK or native file chooser
211  // will show a preview of a selected file (if possible) before the user
212  // decides to choose the file.
213  // \todo implement me
214  //OPTION_FILECHOOSER_PREVIEW,
232  // don't change this, leave it always as the last element
234  OPTION_LAST
235  } Fl_Option;
236 
237 private:
238  static unsigned char options_[OPTION_LAST];
239  static unsigned char options_read_;
240 
241 public:
242  /*
243  Return a global setting for all FLTK applications, possibly overridden
244  by a setting specifically for this application.
245  */
246  static bool option(Fl_Option opt);
247 
248  /*
249  Override an option while the application is running.
250  */
251  static void option(Fl_Option opt, bool val);
252 
260  static void (*idle)();
261 
262 #ifndef FL_DOXYGEN
263  static Fl_Awake_Handler *awake_ring_;
264  static void **awake_data_;
265  static int awake_ring_size_;
266  static int awake_ring_head_;
267  static int awake_ring_tail_;
268  static const char* scheme_;
269  static Fl_Image* scheme_bg_;
270 
271  static int e_original_keysym; // late addition
272  static int scrollbar_size_;
273 #endif
274 
275 
276  static int add_awake_handler_(Fl_Awake_Handler, void*);
277  static int get_awake_handler_(Fl_Awake_Handler&, void*&);
278 
279 public:
280 
281  // API version number
282  static double version();
283  static int api_version();
284 
285  // ABI version number
286  static int abi_version();
287 
310  static inline int abi_check(const int val = FL_ABI_VERSION) {
311  return val == abi_version();
312  }
313 
314  // argument parsers:
315  static int arg(int argc, char **argv, int& i);
316  static int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0);
317  static void args(int argc, char **argv);
322  static const char* const help;
323 
324  // things called by initialization:
325  static void display(const char*);
326  static int visual(int);
336  static int gl_visual(int, int *alist=0); // platform dependent
337  static void own_colormap();
338  static void get_system_colors();
339  static void foreground(uchar, uchar, uchar);
340  static void background(uchar, uchar, uchar);
341  static void background2(uchar, uchar, uchar);
342 
343  // schemes:
344  static int scheme(const char *name);
346  static const char* scheme() {return scheme_;}
347 
375  static int is_scheme(const char *name) {
376  return (scheme_ && name && !strcmp(name,scheme_));
377  }
383  static int reload_scheme(); // platform dependent
384  static int scrollbar_size();
385  static void scrollbar_size(int W);
386 
387  // execution:
388  static int wait();
389  static double wait(double time);
390  static int check();
391  static int ready();
392  static int run();
393  static Fl_Widget* readqueue();
424  static void add_timeout(double t, Fl_Timeout_Handler,void* = 0); // platform dependent
445  static void repeat_timeout(double t, Fl_Timeout_Handler, void* = 0); // platform dependent
446  static int has_timeout(Fl_Timeout_Handler, void* = 0);
447  static void remove_timeout(Fl_Timeout_Handler, void* = 0);
448  static void add_check(Fl_Timeout_Handler, void* = 0);
449  static int has_check(Fl_Timeout_Handler, void* = 0);
450  static void remove_check(Fl_Timeout_Handler, void* = 0);
470  static void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0); // platform dependent
472  static void add_fd(int fd, Fl_FD_Handler cb, void* = 0); // platform dependent
474  static void remove_fd(int, int when); // platform dependent
476  static void remove_fd(int); // platform dependent
477 
478  static void add_idle(Fl_Idle_Handler cb, void* data = 0);
479  static int has_idle(Fl_Idle_Handler cb, void* data = 0);
480  static void remove_idle(Fl_Idle_Handler cb, void* data = 0);
482  static int damage() {return damage_;}
483  static void redraw();
484  static void flush();
505  static void (*warning)(const char*, ...);
520  static void (*error)(const char*, ...);
537  static void (*fatal)(const char*, ...);
543  static Fl_Window* first_window();
544  static void first_window(Fl_Window*);
545  static Fl_Window* next_window(const Fl_Window*);
546 
556  static Fl_Window* modal() {return modal_;}
562  static Fl_Window* grab() {return grab_;}
587  static void grab(Fl_Window*); // platform dependent
594  // event information:
600  static int event() {return e_number;}
605  static int event_x() {return e_x;}
610  static int event_y() {return e_y;}
617  static int event_x_root() {return e_x_root;}
624  static int event_y_root() {return e_y_root;}
629  static int event_dx() {return e_dx;}
634  static int event_dy() {return e_dy;}
643  static void get_mouse(int &,int &); // platform dependent
652  static int event_clicks() {return e_clicks;}
660  static void event_clicks(int i) {e_clicks = i;}
668  static int event_is_click() {return e_is_click;}
675  static void event_is_click(int i) {e_is_click = i;}
685  static int event_button() {return e_keysym-FL_Button;}
711  static int event_state() {return e_state;}
712 
718  static int event_state(int mask) {return e_state&mask;}
730  static int event_key() {return e_keysym;}
739  static int event_original_key(){return e_original_keysym;}
778  static int event_key(int key);
784  static int get_key(int key); // platform dependent
799  static const char* event_text() {return e_text;}
806  static int event_length() {return e_length;}
807 
811  static void *event_clipboard() { return e_clipboard_data; }
815  static const char *event_clipboard_type() {return e_clipboard_type; }
816 
817 
818  static int compose(int &del);
819  static void compose_reset();
820  static int event_inside(int,int,int,int);
821  static int event_inside(const Fl_Widget*);
822  static int test_shortcut(Fl_Shortcut);
823 
828  static void enable_im();
833  static void disable_im();
834 
835  // event destinations:
836  static int handle(int, Fl_Window*);
837  static int handle_(int, Fl_Window*);
840  static Fl_Widget* belowmouse() {return belowmouse_;}
841  static void belowmouse(Fl_Widget*);
844  static Fl_Widget* pushed() {return pushed_;}
845  static void pushed(Fl_Widget*);
847  static Fl_Widget* focus() {return focus_;}
848  static void focus(Fl_Widget*);
849  static void add_handler(Fl_Event_Handler h);
850  static void remove_handler(Fl_Event_Handler h);
851  static void add_system_handler(Fl_System_Handler h, void *data);
852  static void remove_system_handler(Fl_System_Handler h);
853  static void event_dispatch(Fl_Event_Dispatch d);
854  static Fl_Event_Dispatch event_dispatch();
860  // cut/paste:
876 #if FLTK_ABI_VERSION >= 10303 || defined(FL_DOXYGEN)
877  static void copy(const char* stuff, int len, int destination = 0, const char *type = Fl::clipboard_plain_text); // platform dependent
878 #else
879  static void copy(const char* stuff, int len, int destination, const char *type);
880  static void copy(const char* stuff, int len, int destination = 0);
881 #endif
882 
883 #if !(defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN))
884  static void copy_image(const unsigned char* data, int W, int H, int destination = 0); // platform dependent
885 #endif
886 
924 #if FLTK_ABI_VERSION >= 10303 || defined(FL_DOXYGEN)
925  static void paste(Fl_Widget &receiver, int source, const char *type = Fl::clipboard_plain_text); // platform dependent
926 #else
927  static void paste(Fl_Widget &receiver, int source, const char *type);
928  static void paste(Fl_Widget &receiver, int source /*=0*/);
929 #endif
930 
951  static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data = 0);
956  static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h);
960  static int clipboard_contains(const char *type);
963  static char const * const clipboard_plain_text;
966  static char const * const clipboard_image;
967 
977  static int dnd(); // platform dependent
978 
979  // These are for back-compatibility only:
982  static Fl_Widget* selection_owner() {return selection_owner_;}
983  static void selection_owner(Fl_Widget*);
984  static void selection(Fl_Widget &owner, const char*, int len);
985  static void paste(Fl_Widget &receiver);
990  // screen size:
992  static int x(); // platform dependent
994  static int y(); // platform dependent
996  static int w(); // platform dependent
998  static int h(); // platform dependent
999 
1000  // multi-head support:
1001  static int screen_count();
1007  static void screen_xywh(int &X, int &Y, int &W, int &H) {
1008  int x, y;
1009  Fl::get_mouse(x, y);
1010  screen_xywh(X, Y, W, H, x, y);
1011  }
1012  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
1013  static void screen_xywh(int &X, int &Y, int &W, int &H, int n);
1014  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
1015  static int screen_num(int x, int y);
1016  static int screen_num(int x, int y, int w, int h);
1017  static void screen_dpi(float &h, float &v, int n=0);
1018  static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my);
1019  static void screen_work_area(int &X, int &Y, int &W, int &H, int n);
1025  static void screen_work_area(int &X, int &Y, int &W, int &H) {
1026  int x, y;
1027  Fl::get_mouse(x, y);
1028  screen_work_area(X, Y, W, H, x, y);
1029  }
1030 
1038  // color map:
1039  static void set_color(Fl_Color, uchar, uchar, uchar);
1044  static void set_color(Fl_Color i, unsigned c); // platform dependent
1045  static unsigned get_color(Fl_Color i);
1046  static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue);
1052  static void free_color(Fl_Color i, int overlay = 0); // platform dependent
1053 
1054  // fonts:
1055  static const char* get_font(Fl_Font);
1068  static const char* get_font_name(Fl_Font, int* attributes = 0);
1080  static int get_font_sizes(Fl_Font, int*& sizep);
1081  static void set_font(Fl_Font, const char*);
1082  static void set_font(Fl_Font, Fl_Font);
1101  static Fl_Font set_fonts(const char* = 0); // platform dependent
1102 
1109  // <Hack to re-order the 'Drawing functions' group>
1112  // labeltypes:
1113  static void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
1115  static void set_labeltype(Fl_Labeltype, Fl_Labeltype from); // is it defined ?
1116 
1117  // boxtypes:
1118  static Fl_Box_Draw_F *get_boxtype(Fl_Boxtype);
1119  static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*,uchar,uchar,uchar,uchar);
1120  static void set_boxtype(Fl_Boxtype, Fl_Boxtype from);
1121  static int box_dx(Fl_Boxtype);
1122  static int box_dy(Fl_Boxtype);
1123  static int box_dw(Fl_Boxtype);
1124  static int box_dh(Fl_Boxtype);
1125 
1126  static int draw_box_active();
1127  static Fl_Color box_color(Fl_Color);
1128  static void set_box_color(Fl_Color);
1129 
1130  // back compatibility:
1134  static void set_abort(Fl_Abort_Handler f) {fatal = f;}
1135  static void (*atclose)(Fl_Window*,void*);
1136  static void default_atclose(Fl_Window*,void*);
1140  static void set_atclose(Fl_Atclose_Handler f) {atclose = f;}
1146  static int event_shift() {return e_state&FL_SHIFT;}
1148  static int event_ctrl() {return e_state&FL_CTRL;}
1150  static int event_command() {return e_state&FL_COMMAND;}
1152  static int event_alt() {return e_state&FL_ALT;}
1161  static int event_buttons() {return e_state&0x7f000000;}
1166  static int event_button1() {return e_state&FL_BUTTON1;}
1171  static int event_button2() {return e_state&FL_BUTTON2;}
1176  static int event_button3() {return e_state&FL_BUTTON3;}
1184  static void set_idle(Fl_Old_Idle_Handler cb) {idle = cb;}
1186  static void grab(Fl_Window& win) {grab(&win);}
1190  static void release() {grab(0);}
1191 
1192  // Visible focus methods...
1198  static void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); }
1204  static int visible_focus() { return option(OPTION_VISIBLE_FOCUS); }
1205 
1206  // Drag-n-drop text operation methods...
1213  static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); }
1220  static int dnd_text_ops() { return option(OPTION_DND_TEXT); }
1225  // Multithreading support:
1226  static int lock();
1227  static void unlock();
1228  static void awake(void* message = 0);
1230  static int awake(Fl_Awake_Handler cb, void* message = 0);
1237  static void* thread_message(); // platform dependent
1269  // Widget deletion:
1270  static void delete_widget(Fl_Widget *w);
1271  static void do_widget_deletion();
1272  static void watch_widget_pointer(Fl_Widget *&w);
1273  static void release_widget_pointer(Fl_Widget *&w);
1274  static void clear_widget_pointer(Fl_Widget const *w);
1281  static void use_high_res_GL(int val) { use_high_res_GL_ = val; }
1287  static int use_high_res_GL() { return use_high_res_GL_; }
1288 
1289 #ifdef FLTK_HAVE_CAIRO
1290 
1293 public:
1294  // Cairo support API
1295  static cairo_t * cairo_make_current(Fl_Window* w);
1310  static void cairo_autolink_context(bool alink) {cairo_state_.autolink(alink);}
1318  static bool cairo_autolink_context() {return cairo_state_.autolink();}
1320  static cairo_t * cairo_cc() { return cairo_state_.cc(); }
1325  static void cairo_cc(cairo_t * c, bool own=false){ cairo_state_.cc(c, own); }
1326 
1327 private:
1328  static cairo_t * cairo_make_current(void* gc);
1329  static cairo_t * cairo_make_current(void* gc, int W, int H);
1330  static Fl_Cairo_State cairo_state_;
1331 public:
1334 #endif // FLTK_HAVE_CAIRO
1335 
1336 };
1337 
1378 class FL_EXPORT Fl_Widget_Tracker {
1379 
1380  Fl_Widget* wp_;
1381 
1382 public:
1383 
1385  ~Fl_Widget_Tracker();
1386 
1392  Fl_Widget *widget() {return wp_;}
1393 
1403  int deleted() {return wp_ == 0;}
1404 
1414  int exists() {return wp_ != 0;}
1415 
1416 };
1417 
1423 #endif // !Fl_H
static Fl_Window * modal()
Returns the top-most modal() window currently shown.
Definition: Fl.H:556
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:101
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:93
static int event_state(int mask)
Returns non-zero if any of the passed event state bits are turned on.
Definition: Fl.H:718
int(* Fl_Event_Dispatch)(int event, Fl_Window *w)
Signature of event_dispatch functions passed as parameters.
Definition: Fl.H:130
This widget produces an actual window.
Definition: Fl_Window.H:57
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:668
#define FL_BUTTON2
Mouse button 2 is pushed.
Definition: Enumerations.H:566
static const char * scheme()
See void scheme(const char *name)
Definition: Fl.H:346
int deleted()
Returns 1, if the watched widget has been deleted.
Definition: Fl.H:1403
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition: Fl.H:847
static const char * event_text()
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events...
Definition: Fl.H:799
static void * event_clipboard()
During an FL_PASTE event of non-textual data, returns a pointer to the pasted data.
Definition: Fl.H:811
static Fl_Widget * selection_owner()
back-compatibility only: Gets the widget owning the current selection
Definition: Fl.H:982
int(* Fl_Args_Handler)(int argc, char **argv, int &i)
Signature of args functions passed as parameters.
Definition: Fl.H:126
static int event_button1()
Returns non-zero if mouse button 1 is currently held down.
Definition: Fl.H:1166
static int is_scheme(const char *name)
Returns whether the current scheme is the given name.
Definition: Fl.H:375
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:1310
The Fl is the FLTK global (static) class containing state information and global methods for the curr...
Definition: Fl.H:142
static void release()
Releases the current grabbed window, equals grab(0).
Definition: Fl.H:1190
int exists()
Returns 1, if the watched widget exists (has not been deleted).
Definition: Fl.H:1414
void(* Fl_Abort_Handler)(const char *format,...)
Signature of set_abort functions passed as parameters.
Definition: Fl.H:120
static const char * event_clipboard_type()
Returns the type of the pasted data during an FL_PASTE event.
Definition: Fl.H:815
static int event_y_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:624
If visible focus is switched on (default), FLTK will draw a dotted rectangle inside the widget that w...
Definition: Fl.H:219
FL_EXPORT const char * fl_local_meta
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:97
static Fl_Widget * belowmouse()
Gets the widget that is below the mouse.
Definition: Fl.H:840
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:90
static int event()
Returns the last event that was processed.
Definition: Fl.H:600
header for Unicode and UTF-8 character handling
static char const *const clipboard_plain_text
Denotes plain textual data.
Definition: Fl.H:963
#define FL_BUTTON3
Mouse button 3 is pushed.
Definition: Enumerations.H:567
static char const *const clipboard_image
Denotes image data.
Definition: Fl.H:966
#define FL_ABI_VERSION
The FLTK ABI (Application Binary Interface) version number as an int.
Definition: Enumerations.H:181
static int event_y()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:610
Base class for image caching and drawing.
Definition: Fl_Image.H:55
static int event_dx()
Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:629
int(* Fl_Event_Handler)(int event)
Signature of add_handler functions passed as parameters.
Definition: Fl.H:114
static void screen_work_area(int &X, int &Y, int &W, int &H)
Gets the bounding box of the work area of the screen that contains the mouse pointer.
Definition: Fl.H:1025
If tooltips are enabled (default), hovering the mouse over a widget with a tooltip text will open a l...
Definition: Fl.H:227
Fl_Boxtype
Definition: Enumerations.H:601
static int event_button()
Gets which particular mouse button caused the current event.
Definition: Fl.H:685
static bool cairo_autolink_context()
Gets the current autolink mode for cairo support.
Definition: Fl.H:1318
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:1287
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:555
This file contains type definitions and general enumerations.
#define FL_COMMAND
An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X.
Definition: Enumerations.H:578
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:1281
#define FL_Button
A mouse button; use Fl_Button + n for mouse button n.
Definition: Enumerations.H:465
FL_EXPORT const char * fl_local_shift
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:98
FL_EXPORT const char * fl_local_ctrl
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:96
If text drag-and-drop is enabled (default), the user can select and drag text from any text widget...
Definition: Fl.H:223
Fl_Widget * widget()
Returns a pointer to the watched widget.
Definition: Fl.H:1392
static void event_clicks(int i)
Manually sets the number returned by Fl::event_clicks().
Definition: Fl.H:660
static int event_clicks()
Returns non zero if we had a double click event.
Definition: Fl.H:652
static const char *const help
Usage string displayed if Fl::args() detects an invalid argument.
Definition: Fl.H:322
When switched on (default), Fl_Native_File_Chooser runs GTK file dialogs if the GTK library is availa...
Definition: Fl.H:231
static int event_state()
Returns the keyboard and mouse button states of the last event.
Definition: Fl.H:711
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:65
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:557
static int event_original_key()
Returns the keycode of the last key event, regardless of the NumLock state.
Definition: Fl.H:739
static void screen_xywh(int &X, int &Y, int &W, int &H)
Gets the bounding box of a screen that contains the mouse pointer.
Definition: Fl.H:1007
FL_EXPORT const char * fl_local_alt
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:95
static int event_button3()
Returns non-zero if button 3 is currently held down.
Definition: Fl.H:1176
static int visible_focus()
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:1204
static int event_dy()
Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:634
This class should be used to control safe widget deletion.
Definition: Fl.H:1378
void(* Fl_Atclose_Handler)(Fl_Window *window, void *data)
Signature of set_atclose functions passed as parameters.
Definition: Fl.H:123
static void get_mouse(int &, int &)
Return where the mouse is on the screen by doing a round-trip query to the server.
static void grab(Fl_Window &win)
See grab(Fl_Window*)
Definition: Fl.H:1186
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:558
static int event_length()
Returns the length of the text in Fl::event_text().
Definition: Fl.H:806
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:1150
static void event_is_click(int i)
Clears the value returned by Fl::event_is_click().
Definition: Fl.H:675
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition: Enumerations.H:932
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition: Enumerations.H:761
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:875
static int abi_check(const int val=FL_ABI_VERSION)
Returns whether the runtime library ABI version is correct.
Definition: Fl.H:310
static int event_x_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:617
#define FL_BUTTON1
Mouse button 1 is pushed.
Definition: Enumerations.H:565
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:826
static void dnd_text_ops(int v)
Gets or sets whether drag and drop text operations are supported.
Definition: Fl.H:1213
static void cairo_cc(cairo_t *c, bool own=false)
Sets the current cairo context to c.
Definition: Fl.H:1325
static Fl_Window * grab()
Returns the window that currently receives all events.
Definition: Fl.H:562
void(* Fl_Old_Idle_Handler)()
Signature of set_idle callback functions passed as parameters.
Definition: Fl.H:108
static void damage(int d)
If true then flush() will do something.
Definition: Fl.H:185
void(* Fl_Idle_Handler)(void *data)
Signature of add_idle callback functions passed as parameters.
Definition: Fl.H:105
int(* Fl_System_Handler)(void *event, void *data)
Signature of add_system_handler functions passed as parameters.
Definition: Fl.H:117
static void visible_focus(int v)
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:1198
static int event_button2()
Returns non-zero if button 2 is currently held down.
Definition: Fl.H:1171
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:96
static Fl_Widget * pushed()
Gets the widget that is being pushed.
Definition: Fl.H:844
void(* Fl_Awake_Handler)(void *data)
Signature of some wakeup callback functions passed as parameters.
Definition: Fl.H:102
static void set_atclose(Fl_Atclose_Handler f)
For back compatibility, sets the Fl::atclose handler callback.
Definition: Fl.H:1140
static cairo_t * cairo_cc()
Gets the current cairo context linked with a fltk window.
Definition: Fl.H:1320
Contains all the necessary info on the current cairo context.
Definition: Fl_Cairo.H:46
static int event_x()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:605
Fl_Color color
text color
Definition: Fl_Widget.H:77
static int dnd_text_ops()
Gets or sets whether drag and drop text operations are supported.
Definition: Fl.H:1220
static int event_shift()
Returns non-zero if the Shift key is pressed.
Definition: Fl.H:1146
void(* Fl_FD_Handler)(FL_SOCKET fd, void *data)
Signature of add_fd functions passed as parameters.
Definition: Fl.H:111
static int event_ctrl()
Returns non-zero if the Control key is pressed.
Definition: Fl.H:1148
static int damage()
If true then flush() will do something.
Definition: Fl.H:482
void(* Fl_Timeout_Handler)(void *data)
Signature of some timeout callback functions passed as parameters.
Definition: Fl.H:99
static void set_idle(Fl_Old_Idle_Handler cb)
Sets an idle callback.
Definition: Fl.H:1184
unsigned char uchar
unsigned char
Definition: fl_types.h:30
static int event_buttons()
Returns the mouse buttons state bits; if non-zero, then at least one button is pressed now...
Definition: Fl.H:1161
void(* Fl_Clipboard_Notify_Handler)(int source, void *data)
Signature of add_clipboard_notify functions passed as parameters.
Definition: Fl.H:133
unsigned int Fl_Shortcut
24-bit Unicode character + 8-bit indicator for keyboard flags
Definition: fl_types.h:46
static int event_key()
Gets which key on the keyboard was last pushed.
Definition: Fl.H:730
static void set_abort(Fl_Abort_Handler f)
For back compatibility, sets the void Fl::fatal handler callback.
Definition: Fl.H:1134
static int event_alt()
Returns non-zero if the Alt key is pressed.
Definition: Fl.H:1152