NTK 1.3.0
Fl.H
Go to the documentation of this file.
1//
2// "$Id: Fl.H 8724 2011-05-23 18:01:29Z 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; you can redistribute it and/or
9// modify it under the terms of the GNU Library General Public
10// License as published by the Free Software Foundation; either
11// version 2 of the License, or (at your option) any later version.
12//
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// Library General Public License for more details.
17//
18// You should have received a copy of the GNU Library General Public
19// License along with this library; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21// USA.
22//
23// Please report all bugs and problems on the following page:
24//
25// http://www.fltk.org/str.php
26//
27
31
32#ifndef Fl_H
33# define Fl_H
34
35# include <FL/Fl_Cairo.H>
36
37# include "fl_utf8.h"
38# include "Enumerations.H"
39# ifndef Fl_Object
40# define Fl_Object Fl_Widget
41# endif
42
43# ifdef check
44# undef check
45# endif
46
47
48class Fl_Widget;
49class Fl_Window;
50class Fl_Image;
51struct Fl_Label;
52
53
68
70typedef void (Fl_Label_Draw_F)(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align);
71
73typedef void (Fl_Label_Measure_F)(const Fl_Label *label, int &width, int &height);
74
76typedef void (Fl_Box_Draw_F)(int x, int y, int w, int h, Fl_Color color);
77
79typedef void (*Fl_Timeout_Handler)(void *data);
80
82typedef void (*Fl_Awake_Handler)(void *data);
83
85typedef void (*Fl_Idle_Handler)(void *data);
86
88typedef void (*Fl_Old_Idle_Handler)();
89
91typedef void (*Fl_FD_Handler)(int fd, void *data);
92
94typedef int (*Fl_Event_Handler)(int event);
95
97typedef void (*Fl_Abort_Handler)(const char *format,...);
98
100typedef void (*Fl_Atclose_Handler)(Fl_Window *window, void *data);
101
103typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i);
104
107typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w);
108 /* group callback_functions */
110
111
116class FL_EXPORT Fl {
117 Fl() {}; // no constructor!
118
119public: // should be private!
120#ifndef FL_DOXYGEN
121 static int e_number;
122 static int e_x;
123 static int e_y;
124 static int e_x_root;
125 static int e_y_root;
126 static int e_dx;
127 static int e_dy;
128 static int e_state;
129 static int e_clicks;
130 static int e_is_click;
131 static int e_keysym;
132 static char* e_text;
133 static int e_length;
134 static Fl_Event_Dispatch e_dispatch;
135 static Fl_Widget* belowmouse_;
136 static Fl_Widget* pushed_;
137 static Fl_Widget* focus_;
138 static int damage_;
139 static Fl_Widget* selection_owner_;
140 static Fl_Window* modal_;
141 static Fl_Window* grab_;
142 static int compose_state;
143#endif
147 static void damage(int d) {damage_ = d;}
148
149public:
156 typedef enum {
162 // When switched on, FLTK will use the file chooser dialog that comes
163 // with your operating system whenever possible. When switched off, FLTK
164 // will present its own file chooser.
165 // \todo implement me
166 // OPTION_NATIVE_FILECHOOSER,
167 // When Filechooser Preview is enabled, the FLTK or native file chooser
168 // will show a preview of a selected file (if possible) before the user
169 // decides to choose the file.
170 // \todo implement me
171 //OPTION_FILECHOOSER_PREVIEW,
185 // don't change this, leave it always as the last element
188 } Fl_Option;
189
190private:
191 static unsigned char options_[OPTION_LAST];
192 static unsigned char options_read_;
193
194public:
195 /*
196 Return a global setting for all FLTK applications, possibly overridden
197 by a setting specifically for this application.
198 */
199 static bool option(Fl_Option opt);
200
201 /*
202 Override an option while the application is running.
203 */
204 static void option(Fl_Option opt, bool val);
205
213 static void (*idle)();
214
215#ifndef FL_DOXYGEN
216 static Fl_Awake_Handler *awake_ring_;
217 static void **awake_data_;
218 static int awake_ring_size_;
219 static int awake_ring_head_;
220 static int awake_ring_tail_;
221 static const char* scheme_;
222 static Fl_Image* scheme_bg_;
223
224 static int e_original_keysym; // late addition
225 static int scrollbar_size_;
226#endif
227
228
229 static int add_awake_handler_(Fl_Awake_Handler, void*);
230 static int get_awake_handler_(Fl_Awake_Handler&, void*&);
231
232public:
233
234 // API version number
235 static double version();
236
237 // argument parsers:
238 static int arg(int argc, char **argv, int& i);
239 static int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0);
240 static void args(int argc, char **argv);
245 static const char* const help;
246
247 // things called by initialization:
248 static void display(const char*);
249 static int visual(int);
259 static int gl_visual(int, int *alist=0); // platform dependent
260 static void own_colormap();
261 static void get_system_colors();
262 static void foreground(uchar, uchar, uchar);
263 static void background(uchar, uchar, uchar);
264 static void background2(uchar, uchar, uchar);
265
266 // schemes:
267 static int scheme(const char*);
269 static const char* scheme() {return scheme_;}
275 static int reload_scheme(); // platform dependent
276
277 static void scheme_bg ( Fl_Image *i ) { scheme_bg_ = i; }
278 static int scrollbar_size();
279 static void scrollbar_size(int W);
280
281 // execution:
282 static int wait();
283 static double wait(double time);
284 static int check();
285 static int ready();
286 static int run();
287 static Fl_Widget* readqueue();
314 static void add_timeout(double t, Fl_Timeout_Handler,void* = 0); // platform dependent
335 static void repeat_timeout(double t, Fl_Timeout_Handler, void* = 0); // platform dependent
336 static int has_timeout(Fl_Timeout_Handler, void* = 0);
337 static void remove_timeout(Fl_Timeout_Handler, void* = 0);
338 static void add_check(Fl_Timeout_Handler, void* = 0);
339 static int has_check(Fl_Timeout_Handler, void* = 0);
340 static void remove_check(Fl_Timeout_Handler, void* = 0);
360 static void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0); // platform dependent
362 static void add_fd(int fd, Fl_FD_Handler cb, void* = 0); // platform dependent
364 static void remove_fd(int, int when); // platform dependent
366 static void remove_fd(int); // platform dependent
367
368 static void add_idle(Fl_Idle_Handler cb, void* data = 0);
369 static int has_idle(Fl_Idle_Handler cb, void* data = 0);
370 static void remove_idle(Fl_Idle_Handler cb, void* data = 0);
372 static int damage() {return damage_;}
373 static void redraw();
374 static void flush();
395 static void (*warning)(const char*, ...);
410 static void (*error)(const char*, ...);
427 static void (*fatal)(const char*, ...);
429
433 static Fl_Window* first_window();
434 static void first_window(Fl_Window*);
435 static Fl_Window* next_window(const Fl_Window*);
436
446 static Fl_Window* modal() {return modal_;}
452 static Fl_Window* grab() {return grab_;}
477 static void grab(Fl_Window*); // platform dependent
479
484 // event information:
490 static int event() {return e_number;}
495 static int event_x() {return e_x;}
500 static int event_y() {return e_y;}
507 static int event_x_root() {return e_x_root;}
514 static int event_y_root() {return e_y_root;}
519 static int event_dx() {return e_dx;}
524 static int event_dy() {return e_dy;}
533 static void get_mouse(int &,int &); // platform dependent
537 static void set_mouse(int x,int y); // platform dependent
545 static int event_clicks() {return e_clicks;}
553 static void event_clicks(int i) {e_clicks = i;}
561 static int event_is_click() {return e_is_click;}
568 static void event_is_click(int i) {e_is_click = i;}
575 static int event_button() {return e_keysym-FL_Button;}
599 static int event_state() {return e_state;}
601 static int event_state(int i) {return e_state&i;}
613 static int event_key() {return e_keysym;}
622 static int event_original_key(){return e_original_keysym;}
661 static int event_key(int key);
667 static int get_key(int key); // platform dependent
682 static const char* event_text() {return e_text;}
689 static int event_length() {return e_length;}
690
691 static int compose(int &del);
692 static void compose_reset();
693 static int event_inside(int,int,int,int);
694 static int event_inside(const Fl_Widget*);
695 static int test_shortcut(Fl_Shortcut);
696
697 // event destinations:
698 static int handle(int, Fl_Window*);
699 static int handle_(int, Fl_Window*);
702 static Fl_Widget* belowmouse() {return belowmouse_;}
703 static void belowmouse(Fl_Widget*);
706 static Fl_Widget* pushed() {return pushed_;}
707 static void pushed(Fl_Widget*);
709 static Fl_Widget* focus() {return focus_;}
710 static void focus(Fl_Widget*);
711 static void add_handler(Fl_Event_Handler h);
712 static void remove_handler(Fl_Event_Handler h);
713 static void event_dispatch(Fl_Event_Dispatch d);
714 static Fl_Event_Dispatch event_dispatch();
716
720 // cut/paste:
730 static void copy(const char* stuff, int len, int destination = 0); // platform dependent
748 static void paste(Fl_Widget &receiver, int source /*=0*/); // platform dependent
758 static int dnd(); // platform dependent
759
760 // These are for back-compatibility only:
763 static Fl_Widget* selection_owner() {return selection_owner_;}
764 static void selection_owner(Fl_Widget*);
765 static void selection(Fl_Widget &owner, const char*, int len);
766 static void paste(Fl_Widget &receiver);
771 // screen size:
773 static int x(); // platform dependent
775 static int y(); // platform dependent
777 static int w(); // platform dependent
779 static int h(); // platform dependent
780
781 // multi-head support:
782 static int screen_count();
788 static void screen_xywh(int &X, int &Y, int &W, int &H) {
789 screen_xywh(X, Y, W, H, e_x_root, e_y_root);
790 }
791 static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
792 static void screen_xywh(int &X, int &Y, int &W, int &H, int n);
793 static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
794 static void screen_dpi(float &h, float &v, int n=0);
795
797
802
803 // color map:
804 static void set_color(Fl_Color, uchar, uchar, uchar);
809 static void set_color(Fl_Color i, unsigned c); // platform dependent
810 static unsigned get_color(Fl_Color i);
811 static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue);
817 static void free_color(Fl_Color i, int overlay = 0); // platform dependent
818
819 // fonts:
820 static const char* get_font(Fl_Font);
833 static const char* get_font_name(Fl_Font, int* attributes = 0);
845 static int get_font_sizes(Fl_Font, int*& sizep);
846 static void set_font(Fl_Font, const char*);
847 static void set_font(Fl_Font, Fl_Font);
866 static Fl_Font set_fonts(const char* = 0); // platform dependent
867
874 // <Hack to re-order the 'Drawing functions' group>
876
877 // labeltypes:
878 static void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
880 static void set_labeltype(Fl_Labeltype, Fl_Labeltype from); // is it defined ?
881
882 // boxtypes:
885 static void set_boxtype(Fl_Boxtype, Fl_Boxtype from);
886 static int box_dx(Fl_Boxtype);
887 static int box_dy(Fl_Boxtype);
888 static int box_dw(Fl_Boxtype);
889 static int box_dh(Fl_Boxtype);
890 static int draw_box_active();
891
892 // back compatibility:
896 static void set_abort(Fl_Abort_Handler f) {fatal = f;}
897 static void (*atclose)(Fl_Window*,void*);
898 static void default_atclose(Fl_Window*,void*);
904
908 static int event_shift() {return e_state&FL_SHIFT;}
910 static int event_ctrl() {return e_state&FL_CTRL;}
912 static int event_command() {return e_state&FL_COMMAND;}
914 static int event_alt() {return e_state&FL_ALT;}
923 static int event_buttons() {return e_state&0x7f000000;}
928 static int event_button1() {return e_state&FL_BUTTON1;}
933 static int event_button2() {return e_state&FL_BUTTON2;}
938 static int event_button3() {return e_state&FL_BUTTON3;}
940
946 static void set_idle(Fl_Old_Idle_Handler cb) {idle = cb;}
948 static void grab(Fl_Window& win) {grab(&win);}
952 static void release() {grab(0);}
953
954 // Visible focus methods...
960 static void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); }
966 static int visible_focus() { return option(OPTION_VISIBLE_FOCUS); }
967
968 // Drag-n-drop text operation methods...
975 static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); }
982 static int dnd_text_ops() { return option(OPTION_DND_TEXT); }
986
987 // Multithreading support:
988 static int lock();
989 static void unlock();
990 static void awake(void* message = 0);
992 static int awake(Fl_Awake_Handler cb, void* message = 0);
999 static void* thread_message(); // platform dependent
1001
1031 // Widget deletion:
1032 static void delete_widget(Fl_Widget *w);
1033 static void do_widget_deletion();
1034 static void watch_widget_pointer(Fl_Widget *&w);
1035 static void release_widget_pointer(Fl_Widget *&w);
1036 static void clear_widget_pointer(Fl_Widget const *w);
1038
1042public:
1043
1044 static cairo_surface_t * cairo_create_surface ( Window xid, int W, int H );
1045
1046 // Cairo support API
1047 static cairo_t * cairo_make_current( cairo_t *cc );
1063 static cairo_t * cairo_cc() { return fl_cairo_context; }
1068// static void cairo_cc(cairo_t * c, bool own=false){ cairo_state_.cc(c, own); }
1069
1070private:
1071public:
1073
1074};
1075
1116class FL_EXPORT Fl_Widget_Tracker {
1117
1118 Fl_Widget* wp_;
1119
1120public:
1121
1124
1130 Fl_Widget *widget() {return wp_;}
1131
1141 int deleted() {return wp_ == 0;}
1142
1152 int exists() {return wp_ != 0;}
1153
1154};
1155
1160
1161/* 0 default, 1 off 2 on */
1162enum
1163{
1164 FL_ANTIALIAS_DEFAULT,
1165 FL_ANTIALIAS_OFF,
1166 FL_ANTIALIAS_ON
1167};
1168
1169void fl_set_antialias ( int v );
1170
1171#endif // !Fl_H
1172
1173//
1174// End of "$Id: Fl.H 8724 2011-05-23 18:01:29Z manolo $".
1175//
This file contains type definitions and general enumerations.
#define FL_BUTTON2
Mouse button 2 is pushed.
Definition Enumerations.H:437
#define FL_Button
A mouse button; use Fl_Button + n for mouse button n.
Definition Enumerations.H:341
#define FL_CTRL
One of the ctrl keys is down.
Definition Enumerations.H:428
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:707
unsigned Fl_Align
FLTK type for alignment control.
Definition Enumerations.H:658
#define FL_ALT
One of the alt keys is down.
Definition Enumerations.H:429
#define FL_COMMAND
An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X.
Definition Enumerations.H:449
unsigned int Fl_Color
an FLTK color value
Definition Enumerations.H:764
#define FL_BUTTON3
Mouse button 3 is pushed.
Definition Enumerations.H:438
#define FL_SHIFT
One of the shift keys is down.
Definition Enumerations.H:426
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition Enumerations.H:601
Fl_Boxtype
Definition Enumerations.H:472
#define FL_BUTTON1
Mouse button 1 is pushed.
Definition Enumerations.H:436
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition Fl_Image.H:51
int exists()
Returns 1, if the watched widget exists (has not been deleted).
Definition Fl.H:1152
int deleted()
Returns 1, if the watched widget has been deleted.
Definition Fl.H:1141
Fl_Widget * widget()
Returns a pointer to the watched widget.
Definition Fl.H:1130
Fl_Widget_Tracker(Fl_Widget *wi)
The constructor adds a widget to the watch list.
Definition Fl.cxx:2053
Fl_Widget is the base class for all widgets in FLTK.
Definition Fl_Widget.H:111
This widget produces an actual window.
Definition Fl_Window.H:58
static int args(int argc, char **argv, int &i, Fl_Args_Handler cb=0)
Parse command line switches using the cb argument handler.
Definition Fl_arg.cxx:290
static int arg(int argc, char **argv, int &i)
Parse a single switch from argv, starting at word i.
Definition Fl_arg.cxx:140
static void remove_fd(int, int when)
Removes a file descriptor handler.
static const char * scheme()
See void scheme(const char *name)
Definition Fl.H:269
static void own_colormap()
Makes FLTK use its own colormap.
Definition Fl_own_colormap.cxx:60
static int box_dx(Fl_Boxtype)
Returns the X offset for the given boxtype.
Definition fl_boxtype.cxx:334
static int gl_visual(int, int *alist=0)
This does the same thing as Fl::visual(int) but also requires OpenGL drawing to work.
Definition gl_start.cxx:112
static int has_idle(Fl_Idle_Handler cb, void *data=0)
Returns true if the specified idle callback is currently installed.
Definition Fl_add_idle.cxx:89
static void background(uchar, uchar, uchar)
Changes fl_color(FL_BACKGROUND_COLOR) to the given color, and changes the gray ramp from 32 to 56 to ...
Definition Fl_get_system_colors.cxx:56
static void remove_fd(int)
Removes a file descriptor handler.
static void remove_idle(Fl_Idle_Handler cb, void *data=0)
Removes the specified idle callback, if it is installed.
Definition Fl_add_idle.cxx:101
@ OPTION_ARROW_FOCUS
When switched on, moving the text cursor beyond the start or end of a text in a text widget will chan...
Definition Fl.H:161
@ OPTION_LAST
For internal use only.
Definition Fl.H:187
@ OPTION_DND_TEXT
If text drag-and-drop is enabled, the user can select and drag text from any text widget.
Definition Fl.H:180
@ OPTION_VISIBLE_FOCUS
If visible focus is switched on, FLTK will draw a dotted rectangle inside the widget that will receiv...
Definition Fl.H:176
@ OPTION_SHOW_TOOLTIPS
If tooltips are enabled, hovering the mouse over a widget with a tooltip text will open a little tool...
Definition Fl.H:184
static void damage(int d)
If true then flush() will do something.
Definition Fl.H:147
static void add_idle(Fl_Idle_Handler cb, void *data=0)
Adds a callback function that is called every time by Fl::wait() and also makes it act as though the ...
Definition Fl_add_idle.cxx:69
static void dnd_text_ops(int v)
Gets or sets whether drag and drop text operations are supported.
Definition Fl.H:975
static void(* idle)()
The currently executing idle callback function: DO NOT USE THIS DIRECTLY!
Definition Fl.H:213
static Fl_Box_Draw_F * get_boxtype(Fl_Boxtype)
Gets the current box drawing function for the specified box type.
Definition fl_boxtype.cxx:386
static const char *const help
Usage string displayed if Fl::args() detects an invalid argument.
Definition Fl.H:245
static void release()
Releases the current grabbed window, equals grab(0).
Definition Fl.H:952
static int visual(int)
Selects a visual so that your graphics are drawn correctly.
Definition Fl_visual.cxx:106
static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F *, uchar, uchar, uchar, uchar)
Sets the function to call to draw a specific boxtype.
Definition fl_boxtype.cxx:390
static void set_idle(Fl_Old_Idle_Handler cb)
Sets an idle callback.
Definition Fl.H:946
static void add_fd(int fd, int when, Fl_FD_Handler cb, void *=0)
Adds file descriptor fd to listen to.
static void display(const char *)
Sets the X display to use for all windows.
Definition Fl_display.cxx:41
static int get_awake_handler_(Fl_Awake_Handler &, void *&)
Gets the last stored awake handler for use in awake().
Definition Fl_lock.cxx:107
static void background2(uchar, uchar, uchar)
Changes the alternative background color.
Definition Fl_get_system_colors.cxx:87
static int box_dw(Fl_Boxtype)
Returns the width offset for the given boxtype.
Definition fl_boxtype.cxx:365
static int box_dy(Fl_Boxtype)
Returns the Y offset for the given boxtype.
Definition fl_boxtype.cxx:359
static int dnd_text_ops()
Gets or sets whether drag and drop text operations are supported.
Definition Fl.H:982
static void grab(Fl_Window &win)
See grab(Fl_Window*)
Definition Fl.H:948
static bool option(Fl_Option opt)
FLTK library options management.
Definition Fl.cxx:1980
static int damage()
If true then flush() will do something.
Definition Fl.H:372
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 int draw_box_active()
Determines if the current draw box is active or inactive.
Definition fl_boxtype.cxx:63
static double version()
Returns the compiled-in value of the FL_VERSION constant.
Definition Fl.cxx:139
static void visible_focus(int v)
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition Fl.H:960
static int visible_focus()
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition Fl.H:966
static void get_system_colors()
Read the user preference colors from the system and use them to call Fl::foreground(),...
Definition Fl_get_system_colors.cxx:231
static int box_dh(Fl_Boxtype)
Returns the height offset for the given boxtype.
Definition fl_boxtype.cxx:371
static void foreground(uchar, uchar, uchar)
Changes fl_color(FL_FOREGROUND_COLOR).
Definition Fl_get_system_colors.cxx:75
static int add_awake_handler_(Fl_Awake_Handler, void *)
Adds an awake handler for use in awake().
Definition Fl_lock.cxx:84
unsigned int Fl_Shortcut
24-bit Unicode character + 8-bit indicator for keyboard flags
Definition fl_types.h:55
unsigned char uchar
unsigned char
Definition fl_types.h:39
header for Unicode and UTF8 chracter handling
void(* Fl_Timeout_Handler)(void *data)
Signature of some timeout callback functions passed as parameters.
Definition Fl.H:79
int(* Fl_Event_Handler)(int event)
Signature of add_handler functions passed as parameters.
Definition Fl.H:94
void(* Fl_Old_Idle_Handler)()
Signature of set_idle callback functions passed as parameters.
Definition Fl.H:88
void(* Fl_Awake_Handler)(void *data)
Signature of some wakeup callback functions passed as parameters.
Definition Fl.H:82
int(* Fl_Event_Dispatch)(int event, Fl_Window *w)
Signature of event_dispatch functions passed as parameters.
Definition Fl.H:107
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:70
int(* Fl_Args_Handler)(int argc, char **argv, int &i)
Signature of args functions passed as parameters.
Definition Fl.H:103
void(* Fl_FD_Handler)(int fd, void *data)
Signature of add_fd functions passed as parameters.
Definition Fl.H:91
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:73
void(* Fl_Abort_Handler)(const char *format,...)
Signature of set_abort functions passed as parameters.
Definition Fl.H:97
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:76
void(* Fl_Atclose_Handler)(Fl_Window *window, void *data)
Signature of set_atclose functions passed as parameters.
Definition Fl.H:100
void(* Fl_Idle_Handler)(void *data)
Signature of add_idle callback functions passed as parameters.
Definition Fl.H:85
static void paste(Fl_Widget &receiver, int source)
Pastes the data from the selection buffer (source is 0) or the clipboard (source is 1) into receiver.
static Fl_Widget * selection_owner()
back-compatibility only: Gets the widget owning the current selection
Definition Fl.H:763
static int dnd()
Initiate a Drag And Drop operation.
Definition fl_dnd_win32.cxx:526
static void copy(const char *stuff, int len, int destination=0)
Copies the data pointed to by stuff to the selection buffer (destination is 0) or the clipboard (dest...
static void event_clicks(int i)
Manually sets the number returned by Fl::event_clicks().
Definition Fl.H:553
static void event_is_click(int i)
Clears the value returned by Fl::event_is_click().
Definition Fl.H:568
static int event_y()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition Fl.H:500
static int event_key()
Gets which key on the keyboard was last pushed.
Definition Fl.H:613
static int event_alt()
Returns non-zero if the Alt key is pressed.
Definition Fl.H:914
static int event_state(int i)
See int event_state()
Definition Fl.H:601
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition Fl.H:709
static int event_length()
Returns the length of the text in Fl::event_text().
Definition Fl.H:689
static int event_dy()
Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition Fl.H:524
static int event_x_root()
Returns the mouse position on the screen of the event.
Definition Fl.H:507
static Fl_Widget * pushed()
Gets the widget that is being pushed.
Definition Fl.H:706
static int event_button1()
Returns non-zero if mouse button 1 is currently held down.
Definition Fl.H:928
static int event_button3()
Returns non-zero if button 3 is currently held down.
Definition Fl.H:938
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:912
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:575
static int event_x()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition Fl.H:495
static int event_y_root()
Returns the mouse position on the screen of the event.
Definition Fl.H:514
static void set_mouse(int x, int y)
Set the pointer position in screen relative coordinates.
static int event_shift()
Returns non-zero if the Shift key is pressed.
Definition Fl.H:908
static int event()
Returns the last event that was processed.
Definition Fl.H:490
static int event_ctrl()
Returns non-zero if the Control key is pressed.
Definition Fl.H:910
static Fl_Widget * belowmouse()
Gets the widget that is below the mouse.
Definition Fl.H:702
static int event_button2()
Returns non-zero if button 2 is currently held down.
Definition Fl.H:933
static int event_dx()
Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition Fl.H:519
static int event_original_key()
Returns the keycode of the last key event, regardless of the NumLock state.
Definition Fl.H:622
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:561
static const char * event_text()
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events.
Definition Fl.H:682
static int event_buttons()
Returns the mouse buttons state bits; if non-zero, then at least one button is pressed now.
Definition Fl.H:923
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:599
static int event_clicks()
Returns non zero if we had a double click event.
Definition Fl.H:545
static int h()
Returns the height of the screen work area in pixels.
static int x()
Returns the origin of the current screen work area, where 0 indicates the left side of the screen.
static int w()
Returns the width of the screen work area in pixels.
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:788
static int y()
Returns the origin of the current screen work area, where 0 indicates the top edge of the screen.
static int screen_count()
Gets the number of available screens.
Definition screen_xywh.cxx:192
static Fl_Window * first_window()
Returns the first top-level window in the list of shown() windows.
Definition Fl.cxx:697
static Fl_Window * next_window(const Fl_Window *)
Returns the next top-level window in the list of shown() windows.
Definition Fl.cxx:707
static void(* atclose)(Fl_Window *, void *)
Back compatibility: default window callback handler.
Definition Fl.H:897
static Fl_Window * modal()
Returns the top-most modal() window currently shown.
Definition Fl.H:446
static void set_abort(Fl_Abort_Handler f)
For back compatibility, sets the void Fl::fatal handler callback.
Definition Fl.H:896
static Fl_Window * grab()
Returns the window that currently receives all events.
Definition Fl.H:452
static void default_atclose(Fl_Window *, void *)
Default callback for window widgets.
Definition Fl_Window.cxx:163
static void set_atclose(Fl_Atclose_Handler f)
For back compatibility, sets the Fl::atclose handler callback.
Definition Fl.H:902
static cairo_t * cairo_cc()
when FLTK_HAVE_CAIRO is defined and cairo_autolink_context() is true, any current window dc is linked...
Definition Fl.H:1063
static void(* error)(const char *,...)
FLTK calls Fl::error() to output a normal error message.
Definition Fl.H:410
static void(* fatal)(const char *,...)
FLTK calls Fl::fatal() to output a fatal error message.
Definition Fl.H:427
static void(* warning)(const char *,...)
FLTK calls Fl::warning() to output a warning message.
Definition Fl.H:395
This struct stores all information for a text or mixed graphics label.
Definition Fl_Widget.H:75