24#include <FL/fl_config.h>
25#include <FL/Fl_Export.H>
27#include <FL/fl_casts.H>
36# define Fl_Object Fl_Widget
53class Fl_Screen_Driver;
54class Fl_System_Driver;
141 friend class Fl_System_Driver;
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_;
154 static Fl_Screen_Driver *screen_driver();
155 static Fl_System_Driver *system_driver();
157 static void reset_marked_text();
158 static void insertion_point_location(
int x,
int y,
int height);
202 static int e_is_click;
206 static void *e_clipboard_data;
207 static const char *e_clipboard_type;
217 static int compose_state;
218 static void call_screen_init();
244 OPTION_ARROW_FOCUS = 0,
299 static unsigned char options_[OPTION_LAST];
300 static unsigned char options_read_;
301 static int program_should_quit_;
308 static bool option(Fl_Option opt);
313 static void option(Fl_Option opt,
bool val);
322 static void (*idle)();
327 static void **awake_data_;
328 static int awake_ring_size_;
329 static int awake_ring_head_;
330 static int awake_ring_tail_;
332 static const char* scheme_;
335 static int e_original_keysym;
336 static int scrollbar_size_;
337 static int menu_linespacing_;
347 static double version();
348 static int api_version();
351 static int abi_version();
376 return val == abi_version();
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);
390 static void display(
const char*);
391 static int visual(
int);
402 static void own_colormap();
403 static void get_system_colors();
409 static int scheme(
const char *name);
411 static const char*
scheme() {
return scheme_;}
441 return (scheme_ && name && !strcmp(name,scheme_));
444 static int reload_scheme();
446 static int scrollbar_size();
447 static void scrollbar_size(
int W);
448 static int menu_linespacing();
449 static void menu_linespacing(
int H);
453 static double wait(
double time);
470 static void hide_all_windows();
482 static int remove_next_timeout(
Fl_Timeout_Handler cb,
void *data = 0,
void **data_return = 0);
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);
500 static void remove_fd(
int,
int when);
502 static void remove_fd(
int);
509 static void redraw();
531 static void (*warning)(
const char*, ...);
546 static void (*error)(
const char*, ...);
563 static void (*fatal)(
const char*, ...);
626 static int event() {
return e_number;}
669 static void get_mouse(
int &,
int &);
822 static int event_key(
int key);
828 static int get_key(
int key);
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*);
868 static void enable_im();
869 static void disable_im();
955 static void copy(
const char *stuff,
int len,
int destination = 0,
986 selection_to_clipboard_ = mode ? 1 : 0;
1075 static int clipboard_contains(
const char *type);
1098 static void selection_owner(
Fl_Widget*);
1099 static void selection(
Fl_Widget &owner,
const char*,
int len);
1123 static int screen_count();
1124 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H);
1125 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H,
int mx,
int my);
1126 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H,
int n);
1127 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H,
int mx,
int my,
int mw,
int mh);
1128 static int screen_num(
int x,
int y);
1129 static int screen_num(
int x,
int y,
int w,
int h);
1130 static void screen_dpi(
float &h,
float &v,
int n=0);
1131 static void screen_work_area(
int &X,
int &Y,
int &W,
int &H,
int mx,
int my);
1132 static void screen_work_area(
int &X,
int &Y,
int &W,
int &H,
int n);
1133 static void screen_work_area(
int &X,
int &Y,
int &W,
int &H);
1134 static float screen_scale(
int n);
1135 static void screen_scale(
int n,
float factor);
1136 static int screen_scaling_supported();
1137 static void keyboard_screen_scaling(
int value);
1154 static void set_color(
Fl_Color i,
unsigned c);
1155 static unsigned get_color(
Fl_Color i);
1163 static void free_color(
Fl_Color i,
int overlay = 0);
1166 static const char* get_font(
Fl_Font);
1179 static const char* get_font_name(
Fl_Font,
int* attributes = 0);
1191 static int get_font_sizes(
Fl_Font,
int*& sizep);
1192 static void set_font(
Fl_Font,
const char*);
1221 static Fl_Font set_fonts(
const char* = 0);
1248 static int draw_box_active();
1250 static void set_box_color(
Fl_Color);
1258 static void default_atclose(
Fl_Window*,
void*);
1359 static void unlock();
1360 static void awake(
void* message = 0);
1369 static void* thread_message();
1402 static void delete_widget(
Fl_Widget *w);
1403 static void do_widget_deletion();
1404 static void watch_widget_pointer(
Fl_Widget *&w);
1405 static void release_widget_pointer(
Fl_Widget *&w);
1406 static void clear_widget_pointer(
Fl_Widget const *w);
1441 static int system(
const char *command);
1444 static int args_to_utf8(
int argc,
char ** &argv);
1446#ifdef FLTK_HAVE_CAIRO
1453 static cairo_t *cairo_make_current(
Fl_Window *w);
1471 cairo_state_.autolink(alink);
1482 return cairo_state_.autolink();
1487 return cairo_state_.cc();
1495 cairo_state_.cc(c, own);
1533 cairo_surface_t *s = cairo_get_target(c);
1534 cairo_surface_flush(s);
1538 static cairo_t *cairo_make_current(
void *gc);
1539 static cairo_t *cairo_make_current(
void *gc,
int W,
int H);
This file contains type definitions and general enumerations.
#define FL_BUTTON2
Mouse button 2 is pushed (M)
Definition: Enumerations.H:583
#define FL_Button
A mouse button; use FL_Button + n for mouse button n.
Definition: Enumerations.H:477
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:572
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:1054
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:977
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:573
#define FL_ABI_VERSION
The FLTK ABI (Application Binary Interface) version number as an int.
Definition: Enumerations.H:171
#define FL_BUTTONS
Bitmask: any mouse button (1-5) is pushed.
Definition: Enumerations.H:587
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition: Enumerations.H:1111
#define FL_BUTTON5
Mouse button 5 is pushed (FORWARD)
Definition: Enumerations.H:586
#define FL_BUTTON3
Mouse button 3 is pushed (R)
Definition: Enumerations.H:584
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:570
#define FL_BUTTON4
Mouse button 4 is pushed (BACK)
Definition: Enumerations.H:585
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition: Enumerations.H:826
Fl_Boxtype
FLTK standard box types.
Definition: Enumerations.H:635
Fl_Callback_Reason
These constants describe why a callback is performed.
Definition: Enumerations.H:446
#define FL_BUTTON1
Mouse button 1 is pushed (L)
Definition: Enumerations.H:582
const char * fl_local_shift
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:2388
const char * fl_local_ctrl
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:2391
const char * fl_local_meta
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:2389
const char * fl_local_alt
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:2390
Cairo is currently supported for the following platforms: Windows, macOS, Unix/Linux (X11 + Wayland).
Contains all the necessary info on the current cairo context.
Definition: Fl_Cairo.H:56
Base class for image caching, scaling and drawing.
Definition: Fl_Image.H:60
This widget produces an actual window.
Definition: Fl_Window.H:55
The Fl is the FLTK global (static) class containing state information and global methods for the curr...
Definition: Fl.H:140
static int is_scheme(const char *name)
Returns whether the current scheme is the given name.
Definition: Fl.H:440
static const char * scheme()
See void scheme(const char *name)
Definition: Fl.H:411
static int draw_GL_text_with_textures()
returns whether whether OpenGL uses textures to draw all text.
Definition: Fl.H:1439
static int program_should_quit()
Returns non-zero when a request for program termination was received and accepted.
Definition: Fl.H:463
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:1413
static int box_border_radius_max()
Get the maximum border radius of all "rounded" boxtypes in pixels.
Definition: Fl.H:175
@ 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
@ 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
@ OPTION_FNFC_USES_ZENITY
Meaningful for the Wayland/X11 platform only.
Definition: Fl.H:274
@ 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
@ OPTION_FNFC_USES_KDIALOG
Meaningful for the Wayland/X11 platform only.
Definition: Fl.H:278
@ 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
@ OPTION_SHOW_SCALING
When switched on (default), the library shows in a transient yellow window the zoom factor value.
Definition: Fl.H:286
@ 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
@ 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
static void damage(int d)
If true then flush() will do something.
Definition: Fl.H:225
static int box_shadow_width()
Get the box shadow width of all "shadow" boxtypes in pixels.
Definition: Fl.H:165
static void dnd_text_ops(int v)
Sets whether drag and drop text operations are supported.
Definition: Fl.H:1345
static const char *const help
Usage string displayed if Fl::args() detects an invalid argument.
Definition: Fl.H:387
static void box_border_radius_max(int R)
Set the maximum border radius of all "rounded" boxtypes in pixels.
Definition: Fl.H:188
static void release()
Releases the current grabbed window, equals grab(0).
Definition: Fl.H:1322
static void set_idle(Fl_Old_Idle_Handler cb)
Sets an idle callback.
Definition: Fl.H:1316
static int gl_visual(int, int *alist=0)
This does the same thing as Fl::visual(int) but also requires OpenGL drawing to work.
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
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:1419
static void draw_GL_text_with_textures(int val)
sets whether OpenGL uses textures to draw all text.
Definition: Fl.H:1432
static int dnd_text_ops()
Gets whether drag and drop text operations are supported.
Definition: Fl.H:1352
static void grab(Fl_Window &win)
See grab(Fl_Window*)
Definition: Fl.H:1318
static int damage()
If true then flush() will do something.
Definition: Fl.H:508
static void box_shadow_width(int W)
Set the box shadow width of all "shadow" boxtypes in pixels.
Definition: Fl.H:170
static void set_labeltype(Fl_Labeltype, Fl_Labeltype from)
Sets the functions to call to draw and measure a specific labeltype.
static void visible_focus(int v)
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:1330
static int visible_focus()
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:1336
static int abi_check(const int val=FL_ABI_VERSION)
Returns whether the runtime library ABI version is correct.
Definition: Fl.H:375
unsigned int Fl_Shortcut
16-bit Unicode character + 8-bit indicator for keyboard flags.
Definition: fl_types.h:55
unsigned char uchar
unsigned char
Definition: fl_types.h:30
header for Unicode and UTF-8 character handling
int(* Fl_System_Handler)(void *event, void *data)
Signature of add_system_handler functions passed as parameters.
Definition: Fl.H:115
void(* Fl_Timeout_Handler)(void *data)
Signature of timeout callback functions passed as parameters.
Definition: Fl.H:97
int(* Fl_Event_Handler)(int event)
Signature of add_handler functions passed as parameters.
Definition: Fl.H:112
void(* Fl_Old_Idle_Handler)()
Signature of set_idle callback functions passed as parameters.
Definition: Fl.H:106
void(* Fl_Awake_Handler)(void *data)
Signature of some wakeup callback functions passed as parameters.
Definition: Fl.H:100
void(* Fl_FD_Handler)(FL_SOCKET fd, void *data)
Signature of add_fd functions passed as parameters.
Definition: Fl.H:109
int(* Fl_Event_Dispatch)(int event, Fl_Window *w)
Signature of event_dispatch functions passed as parameters.
Definition: Fl.H:128
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
int(* Fl_Args_Handler)(int argc, char **argv, int &i)
Signature of args functions passed as parameters.
Definition: Fl.H:124
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
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
void(* Fl_Abort_Handler)(const char *format,...)
Signature of set_abort functions passed as parameters.
Definition: Fl.H:118
void(* Fl_Atclose_Handler)(Fl_Window *window, void *data)
Signature of set_atclose functions passed as parameters.
Definition: Fl.H:121
void(* Fl_Idle_Handler)(void *data)
Signature of add_idle callback functions passed as parameters.
Definition: Fl.H:103
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
void(* Fl_Clipboard_Notify_Handler)(int source, void *data)
Signature of add_clipboard_notify functions passed as parameters.
Definition: Fl.H:131
static char const *const clipboard_image
Denotes image data.
Definition: Fl.H:1081
static Fl_Widget * selection_owner()
back-compatibility only: Gets the widget owning the current selection
Definition: Fl.H:1097
static int selection_to_clipboard()
Returns the current selection_to_clipboard mode.
Definition: Fl.H:994
static char const *const clipboard_plain_text
Denotes plain textual data.
Definition: Fl.H:1078
static void selection_to_clipboard(int mode)
Copies selections on X11 directly to the clipboard if enabled.
Definition: Fl.H:985
static void event_clicks(int i)
Manually sets the number returned by Fl::event_clicks().
Definition: Fl.H:686
static void event_is_click(int i)
Clears the value returned by Fl::event_is_click().
Definition: Fl.H:701
static int event_button4()
Returns non-zero if mouse button 4 is currently held down.
Definition: Fl.H:1303
static int event_y()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:636
static int event_key()
Gets which key on the keyboard was last pushed.
Definition: Fl.H:773
static int event_alt()
Returns non-zero if the Alt key is pressed.
Definition: Fl.H:1274
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition: Fl.H:883
static int event_length()
Returns the length of the text in Fl::event_text().
Definition: Fl.H:850
static int event_state(int mask)
Returns non-zero if any of the passed event state bits are turned on.
Definition: Fl.H:761
static int event_button5()
Returns non-zero if mouse button 5 is currently held down.
Definition: Fl.H:1308
static int event_dy()
Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:660
static int event_x_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:643
static Fl_Widget * pushed()
Gets the widget that is being pushed.
Definition: Fl.H:880
static const char * event_clipboard_type()
Returns the type of the pasted data during an FL_PASTE event.
Definition: Fl.H:859
static int event_button1()
Returns non-zero if mouse button 1 is currently held down.
Definition: Fl.H:1288
static int event_button3()
Returns non-zero if mouse button 3 is currently held down.
Definition: Fl.H:1298
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:1272
static int event_button()
Gets which particular mouse button caused the current event.
Definition: Fl.H:713
static int event_x()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:631
static int event_y_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:650
static void * event_clipboard()
During an FL_PASTE event of non-textual data, returns a pointer to the pasted data.
Definition: Fl.H:855
static int event_shift()
Returns non-zero if the Shift key is pressed.
Definition: Fl.H:1268
static int event()
Returns the last event that was processed.
Definition: Fl.H:626
static int event_ctrl()
Returns non-zero if the Control key is pressed.
Definition: Fl.H:1270
static Fl_Widget * belowmouse()
Gets the widget that is below the mouse.
Definition: Fl.H:876
static int event_button2()
Returns non-zero if mouse button 2 is currently held down.
Definition: Fl.H:1293
static int event_dx()
Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:655
static int event_original_key()
Returns the keycode of the last key event, regardless of the NumLock state.
Definition: Fl.H:782
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
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
static int event_buttons()
Returns the mouse buttons state bits; if non-zero, then at least one button is pressed now.
Definition: Fl.H:1283
static int event_state()
Returns the keyboard and mouse button states of the last event.
Definition: Fl.H:754
static int event_clicks()
Returns non zero if we had a double click event.
Definition: Fl.H:678
static Fl_Window * modal()
Returns the top-most modal() window currently shown.
Definition: Fl.H:582
static void set_abort(Fl_Abort_Handler f)
For back compatibility, sets the void Fl::fatal handler callback.
Definition: Fl.H:1256
static Fl_Window * grab()
Returns the window that currently receives all events.
Definition: Fl.H:588
static void set_atclose(Fl_Atclose_Handler f)
For back compatibility, sets the Fl::atclose handler callback.
Definition: Fl.H:1262
static cairo_t * cairo_cc()
Gets the current Cairo context linked with a fltk window.
Definition: Fl.H:1486
static void cairo_cc(cairo_t *c, bool own=false)
Sets the current Cairo context to c.
Definition: Fl.H:1494
static bool cairo_autolink_context()
Gets the current autolink mode for Cairo support.
Definition: Fl.H:1481
static void cairo_flush(cairo_t *c)
Flush Cairo drawings on Cairo context c.
Definition: Fl.H:1531
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:1470
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:49