FLTK 1.3.2
Fl.H
Go to the documentation of this file.
1 //
2 // "$Id: Fl.H 9701 2012-10-18 12:56:31Z manolo $"
3 //
4 // Main header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2010 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 //
18 
23 #ifndef Fl_H
24 # define Fl_H
25 
26 #ifdef FLTK_HAVE_CAIRO
27 # include <FL/Fl_Cairo.H>
28 #endif
29 
30 # include "fl_utf8.h"
31 # include "Enumerations.H"
32 # ifndef Fl_Object
33 # define Fl_Object Fl_Widget
34 # endif
35 
36 # ifdef check
37 # undef check
38 # endif
39 
40 
41 class Fl_Widget;
42 class Fl_Window;
43 class Fl_Image;
44 struct Fl_Label;
45 
46 // Keep avoiding having the socket deps at that level but mke sure it will work in both 32 & 64 bit builds
47 #if defined(WIN32) && !defined(__CYGWIN__)
48 # if defined(_WIN64)
49 # define FL_SOCKET unsigned __int64
50 # else
51 # define FL_SOCKET int
52 # endif
53 #else
54 # define FL_SOCKET int
55 #endif
56 
73 typedef void (Fl_Label_Draw_F)(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align);
74 
76 typedef void (Fl_Label_Measure_F)(const Fl_Label *label, int &width, int &height);
77 
79 typedef void (Fl_Box_Draw_F)(int x, int y, int w, int h, Fl_Color color);
80 
82 typedef void (*Fl_Timeout_Handler)(void *data);
83 
85 typedef void (*Fl_Awake_Handler)(void *data);
86 
88 typedef void (*Fl_Idle_Handler)(void *data);
89 
91 typedef void (*Fl_Old_Idle_Handler)();
92 
94 typedef void (*Fl_FD_Handler)(FL_SOCKET fd, void *data);
95 
97 typedef int (*Fl_Event_Handler)(int event);
98 
100 typedef void (*Fl_Abort_Handler)(const char *format,...);
101 
103 typedef void (*Fl_Atclose_Handler)(Fl_Window *window, void *data);
104 
106 typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i);
107 
110 typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w);
111 
113 typedef void (*Fl_Clipboard_Notify_Handler)(int source, void *data);
114  /* group callback_functions */
116 
117 
122 class FL_EXPORT Fl {
123  Fl() {}; // no constructor!
124 
125 public: // should be private!
126 #ifndef FL_DOXYGEN
127  static int e_number;
128  static int e_x;
129  static int e_y;
130  static int e_x_root;
131  static int e_y_root;
132  static int e_dx;
133  static int e_dy;
134  static int e_state;
135  static int e_clicks;
136  static int e_is_click;
137  static int e_keysym;
138  static char* e_text;
139  static int e_length;
140  static Fl_Event_Dispatch e_dispatch;
141  static Fl_Widget* belowmouse_;
142  static Fl_Widget* pushed_;
143  static Fl_Widget* focus_;
144  static int damage_;
145  static Fl_Widget* selection_owner_;
146  static Fl_Window* modal_;
147  static Fl_Window* grab_;
148  static int compose_state;
149  static void call_screen_init(); // recompute screen number and dimensions
150 #endif
151 
154  static void damage(int d) {damage_ = d;}
155 
156 public:
163  typedef enum {
168  OPTION_ARROW_FOCUS = 0,
169  // When switched on, FLTK will use the file chooser dialog that comes
170  // with your operating system whenever possible. When switched off, FLTK
171  // will present its own file chooser.
172  // \todo implement me
173  // OPTION_NATIVE_FILECHOOSER,
174  // When Filechooser Preview is enabled, the FLTK or native file chooser
175  // will show a preview of a selected file (if possible) before the user
176  // decides to choose the file.
177  // \todo implement me
178  //OPTION_FILECHOOSER_PREVIEW,
192  // don't change this, leave it always as the last element
194  OPTION_LAST
195  } Fl_Option;
196 
197 private:
198  static unsigned char options_[OPTION_LAST];
199  static unsigned char options_read_;
200 
201 public:
202  /*
203  Return a global setting for all FLTK applications, possibly overridden
204  by a setting specifically for this application.
205  */
206  static bool option(Fl_Option opt);
207 
208  /*
209  Override an option while the application is running.
210  */
211  static void option(Fl_Option opt, bool val);
212 
220  static void (*idle)();
221 
222 #ifndef FL_DOXYGEN
223  static Fl_Awake_Handler *awake_ring_;
224  static void **awake_data_;
225  static int awake_ring_size_;
226  static int awake_ring_head_;
227  static int awake_ring_tail_;
228  static const char* scheme_;
229  static Fl_Image* scheme_bg_;
230 
231  static int e_original_keysym; // late addition
232  static int scrollbar_size_;
233 #endif
234 
235 
236  static int add_awake_handler_(Fl_Awake_Handler, void*);
237  static int get_awake_handler_(Fl_Awake_Handler&, void*&);
238 
239 public:
240 
241  // API version number
242  static double version();
243 
244  // argument parsers:
245  static int arg(int argc, char **argv, int& i);
246  static int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0);
247  static void args(int argc, char **argv);
252  static const char* const help;
253 
254  // things called by initialization:
255  static void display(const char*);
256  static int visual(int);
266  static int gl_visual(int, int *alist=0); // platform dependent
267  static void own_colormap();
268  static void get_system_colors();
269  static void foreground(uchar, uchar, uchar);
270  static void background(uchar, uchar, uchar);
271  static void background2(uchar, uchar, uchar);
272 
273  // schemes:
274  static int scheme(const char*);
276  static const char* scheme() {return scheme_;}
282  static int reload_scheme(); // platform dependent
283  static int scrollbar_size();
284  static void scrollbar_size(int W);
285 
286  // execution:
287  static int wait();
288  static double wait(double time);
289  static int check();
290  static int ready();
291  static int run();
292  static Fl_Widget* readqueue();
319  static void add_timeout(double t, Fl_Timeout_Handler,void* = 0); // platform dependent
340  static void repeat_timeout(double t, Fl_Timeout_Handler, void* = 0); // platform dependent
341  static int has_timeout(Fl_Timeout_Handler, void* = 0);
342  static void remove_timeout(Fl_Timeout_Handler, void* = 0);
343  static void add_check(Fl_Timeout_Handler, void* = 0);
344  static int has_check(Fl_Timeout_Handler, void* = 0);
345  static void remove_check(Fl_Timeout_Handler, void* = 0);
365  static void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0); // platform dependent
367  static void add_fd(int fd, Fl_FD_Handler cb, void* = 0); // platform dependent
369  static void remove_fd(int, int when); // platform dependent
371  static void remove_fd(int); // platform dependent
372 
373  static void add_idle(Fl_Idle_Handler cb, void* data = 0);
374  static int has_idle(Fl_Idle_Handler cb, void* data = 0);
375  static void remove_idle(Fl_Idle_Handler cb, void* data = 0);
377  static int damage() {return damage_;}
378  static void redraw();
379  static void flush();
400  static void (*warning)(const char*, ...);
415  static void (*error)(const char*, ...);
432  static void (*fatal)(const char*, ...);
438  static Fl_Window* first_window();
439  static void first_window(Fl_Window*);
440  static Fl_Window* next_window(const Fl_Window*);
441 
451  static Fl_Window* modal() {return modal_;}
457  static Fl_Window* grab() {return grab_;}
482  static void grab(Fl_Window*); // platform dependent
489  // event information:
495  static int event() {return e_number;}
500  static int event_x() {return e_x;}
505  static int event_y() {return e_y;}
512  static int event_x_root() {return e_x_root;}
519  static int event_y_root() {return e_y_root;}
524  static int event_dx() {return e_dx;}
529  static int event_dy() {return e_dy;}
538  static void get_mouse(int &,int &); // platform dependent
547  static int event_clicks() {return e_clicks;}
555  static void event_clicks(int i) {e_clicks = i;}
563  static int event_is_click() {return e_is_click;}
570  static void event_is_click(int i) {e_is_click = i;}
577  static int event_button() {return e_keysym-FL_Button;}
601  static int event_state() {return e_state;}
603  static int event_state(int i) {return e_state&i;}
615  static int event_key() {return e_keysym;}
624  static int event_original_key(){return e_original_keysym;}
663  static int event_key(int key);
669  static int get_key(int key); // platform dependent
684  static const char* event_text() {return e_text;}
691  static int event_length() {return e_length;}
692 
693  static int compose(int &del);
694  static void compose_reset();
695  static int event_inside(int,int,int,int);
696  static int event_inside(const Fl_Widget*);
697  static int test_shortcut(Fl_Shortcut);
698 
699  // event destinations:
700  static int handle(int, Fl_Window*);
701  static int handle_(int, Fl_Window*);
704  static Fl_Widget* belowmouse() {return belowmouse_;}
705  static void belowmouse(Fl_Widget*);
708  static Fl_Widget* pushed() {return pushed_;}
709  static void pushed(Fl_Widget*);
711  static Fl_Widget* focus() {return focus_;}
712  static void focus(Fl_Widget*);
713  static void add_handler(Fl_Event_Handler h);
714  static void remove_handler(Fl_Event_Handler h);
715  static void event_dispatch(Fl_Event_Dispatch d);
716  static Fl_Event_Dispatch event_dispatch();
722  // cut/paste:
732  static void copy(const char* stuff, int len, int destination = 0); // platform dependent
750  static void paste(Fl_Widget &receiver, int source /*=0*/); // platform dependent
758  static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data = 0);
763  static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h);
773  static int dnd(); // platform dependent
774 
775  // These are for back-compatibility only:
778  static Fl_Widget* selection_owner() {return selection_owner_;}
779  static void selection_owner(Fl_Widget*);
780  static void selection(Fl_Widget &owner, const char*, int len);
781  static void paste(Fl_Widget &receiver);
786  // screen size:
788  static int x(); // platform dependent
790  static int y(); // platform dependent
792  static int w(); // platform dependent
794  static int h(); // platform dependent
795 
796  // multi-head support:
797  static int screen_count();
803  static void screen_xywh(int &X, int &Y, int &W, int &H) {
804  int x, y;
805  Fl::get_mouse(x, y);
806  screen_xywh(X, Y, W, H, x, y);
807  }
808  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
809  static void screen_xywh(int &X, int &Y, int &W, int &H, int n);
810  static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
811  static void screen_dpi(float &h, float &v, int n=0);
812  static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my);
813  static void screen_work_area(int &X, int &Y, int &W, int &H, int n);
819  static void screen_work_area(int &X, int &Y, int &W, int &H) {
820  int x, y;
821  Fl::get_mouse(x, y);
822  screen_work_area(X, Y, W, H, x, y);
823  }
824 
832  // color map:
833  static void set_color(Fl_Color, uchar, uchar, uchar);
838  static void set_color(Fl_Color i, unsigned c); // platform dependent
839  static unsigned get_color(Fl_Color i);
840  static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue);
846  static void free_color(Fl_Color i, int overlay = 0); // platform dependent
847 
848  // fonts:
849  static const char* get_font(Fl_Font);
862  static const char* get_font_name(Fl_Font, int* attributes = 0);
874  static int get_font_sizes(Fl_Font, int*& sizep);
875  static void set_font(Fl_Font, const char*);
876  static void set_font(Fl_Font, Fl_Font);
895  static Fl_Font set_fonts(const char* = 0); // platform dependent
896 
903  // <Hack to re-order the 'Drawing functions' group>
906  // labeltypes:
907  static void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
909  static void set_labeltype(Fl_Labeltype, Fl_Labeltype from); // is it defined ?
910 
911  // boxtypes:
912  static Fl_Box_Draw_F *get_boxtype(Fl_Boxtype);
913  static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*,uchar,uchar,uchar,uchar);
914  static void set_boxtype(Fl_Boxtype, Fl_Boxtype from);
915  static int box_dx(Fl_Boxtype);
916  static int box_dy(Fl_Boxtype);
917  static int box_dw(Fl_Boxtype);
918  static int box_dh(Fl_Boxtype);
919  static int draw_box_active();
920 
921  // back compatibility:
925  static void set_abort(Fl_Abort_Handler f) {fatal = f;}
926  static void (*atclose)(Fl_Window*,void*);
927  static void default_atclose(Fl_Window*,void*);
931  static void set_atclose(Fl_Atclose_Handler f) {atclose = f;}
937  static int event_shift() {return e_state&FL_SHIFT;}
939  static int event_ctrl() {return e_state&FL_CTRL;}
941  static int event_command() {return e_state&FL_COMMAND;}
943  static int event_alt() {return e_state&FL_ALT;}
952  static int event_buttons() {return e_state&0x7f000000;}
957  static int event_button1() {return e_state&FL_BUTTON1;}
962  static int event_button2() {return e_state&FL_BUTTON2;}
967  static int event_button3() {return e_state&FL_BUTTON3;}
975  static void set_idle(Fl_Old_Idle_Handler cb) {idle = cb;}
977  static void grab(Fl_Window& win) {grab(&win);}
981  static void release() {grab(0);}
982 
983  // Visible focus methods...
989  static void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); }
995  static int visible_focus() { return option(OPTION_VISIBLE_FOCUS); }
996 
997  // Drag-n-drop text operation methods...
1004  static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); }
1011  static int dnd_text_ops() { return option(OPTION_DND_TEXT); }
1016  // Multithreading support:
1017  static int lock();
1018  static void unlock();
1019  static void awake(void* message = 0);
1021  static int awake(Fl_Awake_Handler cb, void* message = 0);
1028  static void* thread_message(); // platform dependent
1060  // Widget deletion:
1061  static void delete_widget(Fl_Widget *w);
1062  static void do_widget_deletion();
1063  static void watch_widget_pointer(Fl_Widget *&w);
1064  static void release_widget_pointer(Fl_Widget *&w);
1065  static void clear_widget_pointer(Fl_Widget const *w);
1068 #ifdef FLTK_HAVE_CAIRO
1069 
1072 public:
1073  // Cairo support API
1074  static cairo_t * cairo_make_current(Fl_Window* w);
1089  static void cairo_autolink_context(bool alink) {cairo_state_.autolink(alink);}
1097  static bool cairo_autolink_context() {return cairo_state_.autolink();}
1099  static cairo_t * cairo_cc() { return cairo_state_.cc(); }
1104  static void cairo_cc(cairo_t * c, bool own=false){ cairo_state_.cc(c, own); }
1105 
1106 private:
1107  static cairo_t * cairo_make_current(void* gc);
1108  static cairo_t * cairo_make_current(void* gc, int W, int H);
1109  static Fl_Cairo_State cairo_state_;
1110 public:
1113 #endif // FLTK_HAVE_CAIRO
1114 
1115 };
1116 
1157 class FL_EXPORT Fl_Widget_Tracker {
1158 
1159  Fl_Widget* wp_;
1160 
1161 public:
1162 
1164  ~Fl_Widget_Tracker();
1165 
1171  Fl_Widget *widget() {return wp_;}
1172 
1182  int deleted() {return wp_ == 0;}
1183 
1193  int exists() {return wp_ != 0;}
1194 
1195 };
1196 
1202 #endif // !Fl_H
1203 
1204 //
1205 // End of "$Id: Fl.H 9701 2012-10-18 12:56:31Z manolo $".
1206 //
static Fl_Window * modal()
Returns the top-most modal() window currently shown.
Definition: Fl.H:451
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:76
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:100
This widget produces an actual window.
Definition: Fl_Window.H:50
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:563
#define FL_BUTTON2
Mouse button 2 is pushed.
Definition: Enumerations.H:434
static const char * scheme()
See void scheme(const char *name)
Definition: Fl.H:276
int deleted()
Returns 1, if the watched widget has been deleted.
Definition: Fl.H:1182
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition: Fl.H:711
static const char * event_text()
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events...
Definition: Fl.H:684
static Fl_Widget * selection_owner()
back-compatibility only: Gets the widget owning the current selection
Definition: Fl.H:778
static int event_button1()
Returns non-zero if mouse button 1 is currently held down.
Definition: Fl.H:957
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:1089
The Fl is the FLTK global (static) class containing state information and global methods for the curr...
Definition: Fl.H:122
void(* Fl_Timeout_Handler)(void *data)
Signature of some timeout callback functions passed as parameters.
Definition: Fl.H:82
static void release()
Releases the current grabbed window, equals grab(0).
Definition: Fl.H:981
int exists()
Returns 1, if the watched widget exists (has not been deleted).
Definition: Fl.H:1193
static int event_y_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:519
void(* Fl_Idle_Handler)(void *data)
Signature of add_idle callback functions passed as parameters.
Definition: Fl.H:88
If visible focus is switched on, FLTK will draw a dotted rectangle inside the widget that will receiv...
Definition: Fl.H:183
static Fl_Widget * belowmouse()
Gets the widget that is below the mouse.
Definition: Fl.H:704
static int event()
Returns the last event that was processed.
Definition: Fl.H:495
header for Unicode and UTF8 chracter handling
#define FL_BUTTON3
Mouse button 3 is pushed.
Definition: Enumerations.H:435
static int event_y()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:505
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition: Fl_Image.H:44
static int event_dx()
Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:524
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:819
If tooltips are enabled, hovering the mouse over a widget with a tooltip text will open a little tool...
Definition: Fl.H:191
Fl_Boxtype
Definition: Enumerations.H:469
static int event_button()
Gets which particular mouse button caused the current event.
Definition: Fl.H:577
static bool cairo_autolink_context()
Gets the current autolink mode for cairo support.
Definition: Fl.H:1097
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:423
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:446
#define FL_Button
A mouse button; use Fl_Button + n for mouse button n.
Definition: Enumerations.H:337
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:73
void(* Fl_Atclose_Handler)(Fl_Window *window, void *data)
Signature of set_atclose functions passed as parameters.
Definition: Fl.H:103
void(* Fl_Clipboard_Notify_Handler)(int source, void *data)
Signature of add_clipboard_notify functions passed as parameters.
Definition: Fl.H:113
If text drag-and-drop is enabled, the user can select and drag text from any text widget...
Definition: Fl.H:187
Fl_Widget * widget()
Returns a pointer to the watched widget.
Definition: Fl.H:1171
static void event_clicks(int i)
Manually sets the number returned by Fl::event_clicks().
Definition: Fl.H:555
static int event_clicks()
Returns non zero if we had a double click event.
Definition: Fl.H:547
static const char *const help
Usage string displayed if Fl::args() detects an invalid argument.
Definition: Fl.H:252
static int event_state(int i)
See int event_state()
Definition: Fl.H:603
static int event_state()
This is a bitfield of what shift states were on and what mouse buttons were held down during the most...
Definition: Fl.H:601
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:64
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:425
static int event_original_key()
Returns the keycode of the last key event, regardless of the NumLock state.
Definition: Fl.H:624
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:803
static int event_button3()
Returns non-zero if button 3 is currently held down.
Definition: Fl.H:967
static int visible_focus()
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:995
static int event_dy()
Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:529
This class should be used to control safe widget deletion.
Definition: Fl.H:1157
void(* Fl_FD_Handler)(FL_SOCKET fd, void *data)
Signature of add_fd functions passed as parameters.
Definition: Fl.H:94
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:977
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:426
static int event_length()
Returns the length of the text in Fl::event_text().
Definition: Fl.H:691
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:941
static void event_is_click(int i)
Clears the value returned by Fl::event_is_click().
Definition: Fl.H:570
void(* Fl_Abort_Handler)(const char *format,...)
Signature of set_abort functions passed as parameters.
Definition: Fl.H:100
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:774
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition: Enumerations.H:611
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:717
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:79
static int event_x_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:512
#define FL_BUTTON1
Mouse button 1 is pushed.
Definition: Enumerations.H:433
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:668
static void dnd_text_ops(int v)
Gets or sets whether drag and drop text operations are supported.
Definition: Fl.H:1004
static void cairo_cc(cairo_t *c, bool own=false)
Sets the current cairo context to c.
Definition: Fl.H:1104
static Fl_Window * grab()
Returns the window that currently receives all events.
Definition: Fl.H:457
static void damage(int d)
If true then flush() will do something.
Definition: Fl.H:154
void(* Fl_Old_Idle_Handler)()
Signature of set_idle callback functions passed as parameters.
Definition: Fl.H:91
static void visible_focus(int v)
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:989
static int event_button2()
Returns non-zero if button 2 is currently held down.
Definition: Fl.H:962
void(* Fl_Awake_Handler)(void *data)
Signature of some wakeup callback functions passed as parameters.
Definition: Fl.H:85
int(* Fl_Event_Handler)(int event)
Signature of add_handler functions passed as parameters.
Definition: Fl.H:97
int(* Fl_Event_Dispatch)(int event, Fl_Window *w)
Signature of event_dispatch functions passed as parameters.
Definition: Fl.H:110
static Fl_Widget * pushed()
Gets the widget that is being pushed.
Definition: Fl.H:708
static void set_atclose(Fl_Atclose_Handler f)
For back compatibility, sets the Fl::atclose handler callback.
Definition: Fl.H:931
static cairo_t * cairo_cc()
Gets the current cairo context linked with a fltk window.
Definition: Fl.H:1099
Contains all the necessary info on the current cairo context.
Definition: Fl_Cairo.H:54
static int event_x()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:500
Fl_Color color
text color
Definition: Fl_Widget.H:76
static int dnd_text_ops()
Gets or sets whether drag and drop text operations are supported.
Definition: Fl.H:1011
static int event_shift()
Returns non-zero if the Shift key is pressed.
Definition: Fl.H:937
static int event_ctrl()
Returns non-zero if the Control key is pressed.
Definition: Fl.H:939
static int damage()
If true then flush() will do something.
Definition: Fl.H:377
static void set_idle(Fl_Old_Idle_Handler cb)
Sets an idle callback.
Definition: Fl.H:975
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:952
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:615
static void set_abort(Fl_Abort_Handler f)
For back compatibility, sets the void Fl::fatal handler callback.
Definition: Fl.H:925
static int event_alt()
Returns non-zero if the Alt key is pressed.
Definition: Fl.H:943
int(* Fl_Args_Handler)(int argc, char **argv, int &i)
Signature of args functions passed as parameters.
Definition: Fl.H:106