FLTK 1.3.8
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Main header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2016 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
23 #ifndef Fl_H
24 # define Fl_H
26 #include <FL/Fl_Export.H>
29 # include <FL/Fl_Cairo.H>
30 #endif
32 # include "fl_utf8.h"
33 # include "Enumerations.H"
34 # ifndef Fl_Object
35 # define Fl_Object Fl_Widget
36 # endif
38 # ifdef check
39 # undef check
40 # endif
43 class Fl_Widget;
44 class Fl_Window;
45 class Fl_Image;
46 struct Fl_Label;
48 // Keep avoiding having the socket deps at that level but mke sure it will work in both 32 & 64 bit builds
49 #if defined(WIN32) && !defined(__CYGWIN__)
50 # if defined(_WIN64)
51 # define FL_SOCKET unsigned __int64
52 # else
53 # define FL_SOCKET int
54 # endif
55 #else
56 # define FL_SOCKET int
57 #endif
60 // Pointers you can use to change FLTK to a foreign language.
61 // Note: Similar pointers are defined in FL/fl_ask.H and src/fl_ask.cxx
62 extern FL_EXPORT const char* fl_local_ctrl;
63 extern FL_EXPORT const char* fl_local_meta;
64 extern FL_EXPORT const char* fl_local_alt;
65 extern FL_EXPORT const char* fl_local_shift;
83 typedef void (Fl_Label_Draw_F)(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align);
86 typedef void (Fl_Label_Measure_F)(const Fl_Label *label, int &width, int &height);
89 typedef void (Fl_Box_Draw_F)(int x, int y, int w, int h, Fl_Color color);
92 typedef void (*Fl_Timeout_Handler)(void *data);
95 typedef void (*Fl_Awake_Handler)(void *data);
98 typedef void (*Fl_Idle_Handler)(void *data);
101 typedef void (*Fl_Old_Idle_Handler)();
104 typedef void (*Fl_FD_Handler)(FL_SOCKET fd, void *data);
107 typedef int (*Fl_Event_Handler)(int event);
110 typedef int (*Fl_System_Handler)(void *event, void *data);
113 typedef void (*Fl_Abort_Handler)(const char *format,...);
116 typedef void (*Fl_Atclose_Handler)(Fl_Window *window, void *data);
119 typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i);
123 typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w);
126 typedef void (*Fl_Clipboard_Notify_Handler)(int source, void *data);
127  /* group callback_functions */
135 class FL_EXPORT Fl {
136  Fl() {}; // no constructor!
138 private:
139  static int use_high_res_GL_;
141 public: // should be private!
142 #ifndef FL_DOXYGEN
143  static int e_number;
144  static int e_x;
145  static int e_y;
146  static int e_x_root;
147  static int e_y_root;
148  static int e_dx;
149  static int e_dy;
150  static int e_state;
151  static int e_clicks;
152  static int e_is_click;
153  static int e_keysym;
154  static char* e_text;
155  static int e_length;
156  static void *e_clipboard_data;
157  static const char *e_clipboard_type;
158  static Fl_Event_Dispatch e_dispatch;
159  static Fl_Widget* belowmouse_;
160  static Fl_Widget* pushed_;
161  static Fl_Widget* focus_;
162  static int damage_;
163  static Fl_Widget* selection_owner_;
164  static Fl_Window* modal_;
165  static Fl_Window* grab_;
166  static int compose_state; // used for dead keys (WIN32) or marked text (MacOS)
167  static void call_screen_init(); // recompute screen number and dimensions
168 #ifdef __APPLE__
169  static void reset_marked_text(); // resets marked text
170  static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point
171 #endif
172 #endif // FL_DOXYGEN
178  static void damage(int d) {damage_ = d;}
180 public:
187  typedef enum {
198  // When switched on, FLTK will use the file chooser dialog that comes
199  // with your operating system whenever possible. When switched off, FLTK
200  // will present its own file chooser.
201  // \todo implement me
203  // When Filechooser Preview is enabled, the FLTK or native file chooser
204  // will show a preview of a selected file (if possible) before the user
205  // decides to choose the file.
206  // \todo implement me
225  // don't change this, leave it always as the last element
228  } Fl_Option;
230 private:
231  static unsigned char options_[OPTION_LAST];
232  static unsigned char options_read_;
234 public:
235  /*
236  Return a global setting for all FLTK applications, possibly overridden
237  by a setting specifically for this application.
238  */
239  static bool option(Fl_Option opt);
241  /*
242  Override an option while the application is running.
243  */
244  static void option(Fl_Option opt, bool val);
253  static void (*idle)();
255 #ifndef FL_DOXYGEN
256  static Fl_Awake_Handler *awake_ring_;
257  static void **awake_data_;
258  static int awake_ring_size_;
259  static int awake_ring_head_;
260  static int awake_ring_tail_;
261  static const char* scheme_;
262  static Fl_Image* scheme_bg_;
264  static int e_original_keysym; // late addition
265  static int scrollbar_size_;
266 #endif
269  static int add_awake_handler_(Fl_Awake_Handler, void*);
270  static int get_awake_handler_(Fl_Awake_Handler&, void*&);
272 public:
274  // API version number
275  static double version();
276  static int api_version();
278  // ABI version number
279  static int abi_version();
303  static inline int abi_check(const int val = FL_ABI_VERSION) {
304  return val == abi_version();
305  }
307  // argument parsers:
308  static int arg(int argc, char **argv, int& i);
309  static int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0);
310  static void args(int argc, char **argv);
315  static const char* const help;
317  // things called by initialization:
318  static void display(const char*);
319  static int visual(int);
329  static int gl_visual(int, int *alist=0); // platform dependent
330  static void own_colormap();
331  static void get_system_colors();
332  static void foreground(uchar, uchar, uchar);
333  static void background(uchar, uchar, uchar);
334  static void background2(uchar, uchar, uchar);
336  // schemes:
337  static int scheme(const char *name);
339  static const char* scheme() {return scheme_;}
368  static int is_scheme(const char *name) {
369  return (scheme_ && name && !strcmp(name,scheme_));
370  }
376  static int reload_scheme(); // platform dependent
377  static int scrollbar_size();
378  static void scrollbar_size(int W);
380  // execution:
381  static int wait();
382  static double wait(double time);
383  static int check();
384  static int ready();
385  static int run();
386  static Fl_Widget* readqueue();
417  static void add_timeout(double t, Fl_Timeout_Handler,void* = 0); // platform dependent
438  static void repeat_timeout(double t, Fl_Timeout_Handler, void* = 0); // platform dependent
439  static int has_timeout(Fl_Timeout_Handler, void* = 0);
440  static void remove_timeout(Fl_Timeout_Handler, void* = 0);
441  static void add_check(Fl_Timeout_Handler, void* = 0);
442  static int has_check(Fl_Timeout_Handler, void* = 0);
443  static void remove_check(Fl_Timeout_Handler, void* = 0);
463  static void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0); // platform dependent
465  static void add_fd(int fd, Fl_FD_Handler cb, void* = 0); // platform dependent
467  static void remove_fd(int, int when); // platform dependent
469  static void remove_fd(int); // platform dependent
471  static void add_idle(Fl_Idle_Handler cb, void* data = 0);
472  static int has_idle(Fl_Idle_Handler cb, void* data = 0);
473  static void remove_idle(Fl_Idle_Handler cb, void* data = 0);
475  static int damage() {return damage_;}
476  static void redraw();
477  static void flush();
498  static void (*warning)(const char*, ...);
513  static void (*error)(const char*, ...);
530  static void (*fatal)(const char*, ...);
536  static Fl_Window* first_window();
537  static void first_window(Fl_Window*);
538  static Fl_Window* next_window(const Fl_Window*);
549  static Fl_Window* modal() {return modal_;}
555  static Fl_Window* grab() {return grab_;}
580  static void grab(Fl_Window*); // platform dependent
587  // event information:
593  static int event() {return e_number;}
598  static int event_x() {return e_x;}
603  static int event_y() {return e_y;}
610  static int event_x_root() {return e_x_root;}
617  static int event_y_root() {return e_y_root;}
622  static int event_dx() {return e_dx;}
627  static int event_dy() {return e_dy;}
636  static void get_mouse(int &,int &); // platform dependent
645  static int event_clicks() {return e_clicks;}
653  static void event_clicks(int i) {e_clicks = i;}
661  static int event_is_click() {return e_is_click;}
668  static void event_is_click(int i) {e_is_click = i;}
678  static int event_button() {return e_keysym-FL_Button;}
704  static int event_state() {return e_state;}
711  static int event_state(int mask) {return e_state&mask;}
723  static int event_key() {return e_keysym;}
732  static int event_original_key(){return e_original_keysym;}
771  static int event_key(int key);
777  static int get_key(int key); // platform dependent
792  static const char* event_text() {return e_text;}
799  static int event_length() {return e_length;}
804  static void *event_clipboard() { return e_clipboard_data; }
808  static const char *event_clipboard_type() {return e_clipboard_type; }
811  static int compose(int &del);
812  static void compose_reset();
813  static int event_inside(int,int,int,int);
814  static int event_inside(const Fl_Widget*);
815  static int test_shortcut(Fl_Shortcut);
821  static void enable_im();
826  static void disable_im();
828  // event destinations:
829  static int handle(int, Fl_Window*);
830  static int handle_(int, Fl_Window*);
833  static Fl_Widget* belowmouse() {return belowmouse_;}
834  static void belowmouse(Fl_Widget*);
837  static Fl_Widget* pushed() {return pushed_;}
838  static void pushed(Fl_Widget*);
840  static Fl_Widget* focus() {return focus_;}
841  static void focus(Fl_Widget*);
842  static void add_handler(Fl_Event_Handler h);
843  static void remove_handler(Fl_Event_Handler h);
844  static void add_system_handler(Fl_System_Handler h, void *data);
845  static void remove_system_handler(Fl_System_Handler h);
846  static void event_dispatch(Fl_Event_Dispatch d);
847  static Fl_Event_Dispatch event_dispatch();
853  // cut/paste:
869 #if FLTK_ABI_VERSION >= 10303 || defined(FL_DOXYGEN)
870  static void copy(const char* stuff, int len, int destination = 0, const char *type = Fl::clipboard_plain_text); // platform dependent
871 #else
872  static void copy(const char* stuff, int len, int destination, const char *type);
873  static void copy(const char* stuff, int len, int destination = 0);
874 #endif
876 #if !(defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN))
877  static void copy_image(const unsigned char* data, int W, int H, int destination = 0); // platform dependent
878 #endif
917 #if FLTK_ABI_VERSION >= 10303 || defined(FL_DOXYGEN)
918  static void paste(Fl_Widget &receiver, int source, const char *type = Fl::clipboard_plain_text); // platform dependent
919 #else
920  static void paste(Fl_Widget &receiver, int source, const char *type);
921  static void paste(Fl_Widget &receiver, int source /*=0*/);
922 #endif
944  static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data = 0);
949  static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h);
953  static int clipboard_contains(const char *type);
956  static char const * const clipboard_plain_text;
959  static char const * const clipboard_image;
970  static int dnd(); // platform dependent
972  // These are for back-compatibility only:
975  static Fl_Widget* selection_owner() {return selection_owner_;}
976  static void selection_owner(Fl_Widget*);
977  static void selection(Fl_Widget &owner, const char*, int len);
978  static void paste(Fl_Widget &receiver);
983  // screen size:
985  static int x(); // platform dependent
987  static int y(); // platform dependent
989  static int w(); // platform dependent
991  static int h(); // platform dependent
993  // multi-head support:
994  static int screen_count();
1000  static void screen_xywh(int &X, int &Y, int &W, int &H) {
1001  int x, y;
1002  Fl::get_mouse(x, y);
1003  screen_xywh(X, Y, W, H, x, y);
1004  }
1005  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
1006  static void screen_xywh(int &X, int &Y, int &W, int &H, int n);
1007  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
1008  static int screen_num(int x, int y);
1009  static int screen_num(int x, int y, int w, int h);
1010  static void screen_dpi(float &h, float &v, int n=0);
1011  static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my);
1012  static void screen_work_area(int &X, int &Y, int &W, int &H, int n);
1018  static void screen_work_area(int &X, int &Y, int &W, int &H) {
1019  int x, y;
1020  Fl::get_mouse(x, y);
1021  screen_work_area(X, Y, W, H, x, y);
1022  }
1031  // color map:
1032  static void set_color(Fl_Color, uchar, uchar, uchar);
1037  static void set_color(Fl_Color i, unsigned c); // platform dependent
1038  static unsigned get_color(Fl_Color i);
1039  static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue);
1045  static void free_color(Fl_Color i, int overlay = 0); // platform dependent
1047  // fonts:
1048  static const char* get_font(Fl_Font);
1061  static const char* get_font_name(Fl_Font, int* attributes = 0);
1073  static int get_font_sizes(Fl_Font, int*& sizep);
1074  static void set_font(Fl_Font, const char*);
1075  static void set_font(Fl_Font, Fl_Font);
1094  static Fl_Font set_fonts(const char* = 0); // platform dependent
1102  // <Hack to re-order the 'Drawing functions' group>
1105  // labeltypes:
1106  static void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
1108  static void set_labeltype(Fl_Labeltype, Fl_Labeltype from); // is it defined ?
1110  // boxtypes:
1111  static Fl_Box_Draw_F *get_boxtype(Fl_Boxtype);
1112  static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*,uchar,uchar,uchar,uchar);
1113  static void set_boxtype(Fl_Boxtype, Fl_Boxtype from);
1114  static int box_dx(Fl_Boxtype);
1115  static int box_dy(Fl_Boxtype);
1116  static int box_dw(Fl_Boxtype);
1117  static int box_dh(Fl_Boxtype);
1119  static int draw_box_active();
1120  static Fl_Color box_color(Fl_Color);
1121  static void set_box_color(Fl_Color);
1123  // back compatibility:
1127  static void set_abort(Fl_Abort_Handler f) {fatal = f;}
1128  static void (*atclose)(Fl_Window*,void*);
1129  static void default_atclose(Fl_Window*,void*);
1133  static void set_atclose(Fl_Atclose_Handler f) {atclose = f;}
1139  static int event_shift() {return e_state&FL_SHIFT;}
1141  static int event_ctrl() {return e_state&FL_CTRL;}
1143  static int event_command() {return e_state&FL_COMMAND;}
1145  static int event_alt() {return e_state&FL_ALT;}
1154  static int event_buttons() {return e_state&0x7f000000;}
1159  static int event_button1() {return e_state&FL_BUTTON1;}
1164  static int event_button2() {return e_state&FL_BUTTON2;}
1169  static int event_button3() {return e_state&FL_BUTTON3;}
1177  static void set_idle(Fl_Old_Idle_Handler cb) {idle = cb;}
1179  static void grab(Fl_Window& win) {grab(&win);}
1183  static void release() {grab(0);}
1185  // Visible focus methods...
1191  static void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); }
1197  static int visible_focus() { return option(OPTION_VISIBLE_FOCUS); }
1199  // Drag-n-drop text operation methods...
1206  static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); }
1213  static int dnd_text_ops() { return option(OPTION_DND_TEXT); }
1218  // Multithreading support:
1219  static int lock();
1220  static void unlock();
1221  static void awake(void* message = 0);
1223  static int awake(Fl_Awake_Handler cb, void* message = 0);
1230  static void* thread_message(); // platform dependent
1262  // Widget deletion:
1263  static void delete_widget(Fl_Widget *w);
1264  static void do_widget_deletion();
1265  static void watch_widget_pointer(Fl_Widget *&w);
1266  static void release_widget_pointer(Fl_Widget *&w);
1267  static void clear_widget_pointer(Fl_Widget const *w);
1274  static void use_high_res_GL(int val) { use_high_res_GL_ = val; }
1280  static int use_high_res_GL() { return use_high_res_GL_; }
1282 #ifdef FLTK_HAVE_CAIRO
1286 public:
1287  // Cairo support API
1288  static cairo_t * cairo_make_current(Fl_Window* w);
1303  static void cairo_autolink_context(bool alink) {cairo_state_.autolink(alink);}
1311  static bool cairo_autolink_context() {return cairo_state_.autolink();}
1313  static cairo_t * cairo_cc() { return cairo_state_.cc(); }
1318  static void cairo_cc(cairo_t * c, bool own=false){ cairo_state_.cc(c, own); }
1320 private:
1321  static cairo_t * cairo_make_current(void* gc);
1322  static cairo_t * cairo_make_current(void* gc, int W, int H);
1323  static Fl_Cairo_State cairo_state_;
1324 public:
1327 #endif // FLTK_HAVE_CAIRO
1329 };
1371 class FL_EXPORT Fl_Widget_Tracker {
1373  Fl_Widget* wp_;
1375 public:
1378  ~Fl_Widget_Tracker();
1385  Fl_Widget *widget() {return wp_;}
1396  int deleted() {return wp_ == 0;}
1407  int exists() {return wp_ != 0;}
1409 };
1416 #endif // !Fl_H
1418 //
1419 // End of "$Id$".
1420 //
This file contains type definitions and general enumerations.
#define FL_BUTTON2
Mouse button 2 is pushed.
Definition: Enumerations.H:566
#define FL_Button
A mouse button; use Fl_Button + n for mouse button n.
Definition: Enumerations.H:465
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:557
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:875
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:826
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:558
#define FL_COMMAND
An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X.
Definition: Enumerations.H:578
The FLTK ABI (Application Binary Interface) version number as an int.
Definition: Enumerations.H:181
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition: Enumerations.H:932
#define FL_BUTTON3
Mouse button 3 is pushed.
Definition: Enumerations.H:567
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:555
The labeltype() method sets the type of the label.
Definition: Enumerations.H:761
Definition: Enumerations.H:601
#define FL_BUTTON1
Mouse button 1 is pushed.
Definition: Enumerations.H:565
FL_EXPORT const char * fl_local_meta
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:97
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
FL_EXPORT const char * fl_local_alt
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:95
Contains all the necessary info on the current cairo context.
Definition: Fl_Cairo.H:46
Base class for image caching and drawing.
Definition: Fl_Image.H:55
This class should be used to control safe widget deletion.
Definition: Fl.H:1371
int exists()
Returns 1, if the watched widget exists (has not been deleted).
Definition: Fl.H:1407
int deleted()
Returns 1, if the watched widget has been deleted.
Definition: Fl.H:1396
Fl_Widget * widget()
Returns a pointer to the watched widget.
Definition: Fl.H:1385
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:101
This widget produces an actual window.
Definition: Fl_Window.H:57
The Fl is the FLTK global (static) class containing state information and global methods for the curr...
Definition: Fl.H:135
static int is_scheme(const char *name)
Returns whether the current scheme is the given name.
Definition: Fl.H:368
static void remove_fd(int, int when)
Removes a file descriptor handler.
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:1274
static void remove_fd(int)
Removes a file descriptor handler.
When switched on (default), Fl_Native_File_Chooser runs GTK file dialogs if the GTK library is availa...
Definition: Fl.H:224
If text drag-and-drop is enabled (default), the user can select and drag text from any text widget.
Definition: Fl.H:216
If visible focus is switched on (default), FLTK will draw a dotted rectangle inside the widget that w...
Definition: Fl.H:212
If tooltips are enabled (default), hovering the mouse over a widget with a tooltip text will open a l...
Definition: Fl.H:220
static void damage(int d)
If true then flush() will do something.
Definition: Fl.H:178
static const char * scheme()
See void scheme(const char *name)
Definition: Fl.H:339
static void dnd_text_ops(int v)
Gets or sets whether drag and drop text operations are supported.
Definition: Fl.H:1206
static const char *const help
Usage string displayed if Fl::args() detects an invalid argument.
Definition: Fl.H:315
static void release()
Releases the current grabbed window, equals grab(0).
Definition: Fl.H:1183
static void set_idle(Fl_Old_Idle_Handler cb)
Sets an idle callback.
Definition: Fl.H:1177
static void add_fd(int fd, int when, Fl_FD_Handler cb, void *=0)
Adds file descriptor fd to listen to.
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:1280
static int dnd_text_ops()
Gets or sets whether drag and drop text operations are supported.
Definition: Fl.H:1213
static void grab(Fl_Window &win)
See grab(Fl_Window*)
Definition: Fl.H:1179
static int damage()
If true then flush() will do something.
Definition: Fl.H:475
static void set_labeltype(Fl_Labeltype, Fl_Labeltype from)
Sets the functions to call to draw and measure a specific labeltype.
static void add_fd(int fd, Fl_FD_Handler cb, void *=0)
See void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0)
static void visible_focus(int v)
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:1191
static int visible_focus()
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:1197
static int abi_check(const int val=FL_ABI_VERSION)
Returns whether the runtime library ABI version is correct.
Definition: Fl.H:303
unsigned int Fl_Shortcut
24-bit Unicode character + 8-bit indicator for keyboard flags
Definition: fl_types.h:46
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:110
void(* Fl_Timeout_Handler)(void *data)
Signature of some timeout callback functions passed as parameters.
Definition: Fl.H:92
int(* Fl_Event_Handler)(int event)
Signature of add_handler functions passed as parameters.
Definition: Fl.H:107
void(* Fl_Old_Idle_Handler)()
Signature of set_idle callback functions passed as parameters.
Definition: Fl.H:101
void(* Fl_Awake_Handler)(void *data)
Signature of some wakeup callback functions passed as parameters.
Definition: Fl.H:95
void(* Fl_FD_Handler)(FL_SOCKET fd, void *data)
Signature of add_fd functions passed as parameters.
Definition: Fl.H:104
int(* Fl_Event_Dispatch)(int event, Fl_Window *w)
Signature of event_dispatch functions passed as parameters.
Definition: Fl.H:123
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:119
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:113
void(* Fl_Atclose_Handler)(Fl_Window *window, void *data)
Signature of set_atclose functions passed as parameters.
Definition: Fl.H:116
void(* Fl_Idle_Handler)(void *data)
Signature of add_idle callback functions passed as parameters.
Definition: Fl.H:98
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:126
static void paste(Fl_Widget &receiver, int source, const char *type=Fl::clipboard_plain_text)
Pastes the data from the selection buffer (source is 0) or the clipboard (source is 1) into receiver.
static void copy(const char *stuff, int len, int destination=0, const char *type=Fl::clipboard_plain_text)
Copies the data pointed to by stuff to the selection buffer (destination is 0), the clipboard (destin...
static char const *const clipboard_image
Denotes image data.
Definition: Fl.H:959
static char const *const clipboard_plain_text
Denotes plain textual data.
Definition: Fl.H:956
static Fl_Widget * selection_owner()
back-compatibility only: Gets the widget owning the current selection
Definition: Fl.H:975
static int clipboard_contains(const char *type)
Returns non 0 if the clipboard contains data matching type.
static void event_clicks(int i)
Manually sets the number returned by Fl::event_clicks().
Definition: Fl.H:653
static void event_is_click(int i)
Clears the value returned by Fl::event_is_click().
Definition: Fl.H:668
static int event_y()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:603
static int event_key()
Gets which key on the keyboard was last pushed.
Definition: Fl.H:723
static int event_alt()
Returns non-zero if the Alt key is pressed.
Definition: Fl.H:1145
static int event_length()
Returns the length of the text in Fl::event_text().
Definition: Fl.H:799
static int event_state(int mask)
Returns non-zero if any of the passed event state bits are turned on.
Definition: Fl.H:711
static int event_dy()
Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:627
static const char * event_clipboard_type()
Returns the type of the pasted data during an FL_PASTE event.
Definition: Fl.H:808
static int event_x_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:610
static void * event_clipboard()
During an FL_PASTE event of non-textual data, returns a pointer to the pasted data.
Definition: Fl.H:804
static Fl_Widget * belowmouse()
Gets the widget that is below the mouse.
Definition: Fl.H:833
static const char * event_text()
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events.
Definition: Fl.H:792
static int event_button1()
Returns non-zero if mouse button 1 is currently held down.
Definition: Fl.H:1159
static int event_button3()
Returns non-zero if button 3 is currently held down.
Definition: Fl.H:1169
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:1143
static void disable_im()
Disables the system input methods facilities.
static void get_mouse(int &, int &)
Return where the mouse is on the screen by doing a round-trip query to the server.
static int event_button()
Gets which particular mouse button caused the current event.
Definition: Fl.H:678
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition: Fl.H:840
static int event_x()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:598
static void enable_im()
Enables the system input methods facilities.
static int event_y_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:617
static int event_shift()
Returns non-zero if the Shift key is pressed.
Definition: Fl.H:1139
static int event()
Returns the last event that was processed.
Definition: Fl.H:593
static int event_ctrl()
Returns non-zero if the Control key is pressed.
Definition: Fl.H:1141
static int event_button2()
Returns non-zero if button 2 is currently held down.
Definition: Fl.H:1164
static Fl_Widget * pushed()
Gets the widget that is being pushed.
Definition: Fl.H:837
static int event_dx()
Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:622
static int event_original_key()
Returns the keycode of the last key event, regardless of the NumLock state.
Definition: Fl.H:732
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:661
static int event_buttons()
Returns the mouse buttons state bits; if non-zero, then at least one button is pressed now.
Definition: Fl.H:1154
static int event_state()
Returns the keyboard and mouse button states of the last event.
Definition: Fl.H:704
static int event_clicks()
Returns non zero if we had a double click event.
Definition: Fl.H:645
static int h()
Returns the height in pixels of the main screen work area.
static int x()
Returns the leftmost x coordinate of the main screen work area.
static int w()
Returns the width in pixels of the main screen work area.
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:1000
static int y()
Returns the topmost y coordinate of the main screen work area.
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:1018
static Fl_Window * grab()
Returns the window that currently receives all events.
Definition: Fl.H:555
static void set_abort(Fl_Abort_Handler f)
For back compatibility, sets the void Fl::fatal handler callback.
Definition: Fl.H:1127
static Fl_Window * modal()
Returns the top-most modal() window currently shown.
Definition: Fl.H:549
static void set_atclose(Fl_Atclose_Handler f)
For back compatibility, sets the Fl::atclose handler callback.
Definition: Fl.H:1133
static void cairo_cc(cairo_t *c, bool own=false)
Sets the current cairo context to c.
Definition: Fl.H:1318
static cairo_t * cairo_cc()
Gets the current cairo context linked with a fltk window.
Definition: Fl.H:1313
static bool cairo_autolink_context()
Gets the current autolink mode for cairo support.
Definition: Fl.H:1311
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:1303
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:65
Fl_Color color
text color
Definition: Fl_Widget.H:77