29#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(WIN32)
33#include <FL/Fl_Export.H>
36# include <FL/Fl_Cairo.H>
42# define Fl_Object Fl_Widget
56#if defined(WIN32) && !defined(__CYGWIN__)
58# define FL_SOCKET unsigned __int64
146 static int use_high_res_GL_;
159 static int e_is_click;
163 static void *e_clipboard_data;
164 static const char *e_clipboard_type;
173 static int compose_state;
174 static void call_screen_init();
176 static void reset_marked_text();
177 static void insertion_point_location(
int x,
int y,
int height);
238 static unsigned char options_[OPTION_LAST];
239 static unsigned char options_read_;
246 static bool option(Fl_Option opt);
251 static void option(Fl_Option opt,
bool val);
264 static void **awake_data_;
265 static int awake_ring_size_;
266 static int awake_ring_head_;
267 static int awake_ring_tail_;
268 static const char* scheme_;
271 static int e_original_keysym;
272 static int scrollbar_size_;
315 static int arg(
int argc,
char **argv,
int& i);
316 static int args(
int argc,
char **argv,
int& i,
Fl_Args_Handler cb = 0);
317 static void args(
int argc,
char **argv);
325 static void display(
const char*);
344 static int scheme(
const char *name);
346 static const char*
scheme() {
return scheme_;}
376 return (scheme_ && name && !strcmp(name,scheme_));
383 static int reload_scheme();
384 static int scrollbar_size();
385 static void scrollbar_size(
int W);
389 static double wait(
double time);
483 static void redraw();
520 static void (*
error)(
const char*, ...);
537 static void (*
fatal)(
const char*, ...);
600 static int event() {
return e_number;}
778 static int event_key(
int key);
784 static int get_key(
int key);
818 static int compose(
int &del);
819 static void compose_reset();
820 static int event_inside(
int,
int,
int,
int);
821 static int event_inside(
const Fl_Widget*);
876#if FLTK_ABI_VERSION >= 10303 || defined(FL_DOXYGEN)
879 static void copy(
const char* stuff,
int len,
int destination,
const char *type);
880 static void copy(
const char* stuff,
int len,
int destination = 0);
883#if !(defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN))
884 static void copy_image(
const unsigned char* data,
int W,
int H,
int destination = 0);
924#if FLTK_ABI_VERSION >= 10303 || defined(FL_DOXYGEN)
927 static void paste(
Fl_Widget &receiver,
int source,
const char *type);
984 static void selection(
Fl_Widget &owner,
const char*,
int len);
1012 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H,
int mx,
int my);
1013 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H,
int n);
1014 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H,
int mx,
int my,
int mw,
int mh);
1015 static int screen_num(
int x,
int y);
1016 static int screen_num(
int x,
int y,
int w,
int h);
1017 static void screen_dpi(
float &h,
float &v,
int n=0);
1018 static void screen_work_area(
int &X,
int &Y,
int &W,
int &H,
int mx,
int my);
1019 static void screen_work_area(
int &X,
int &Y,
int &W,
int &H,
int n);
1044 static void set_color(
Fl_Color i,
unsigned c);
1045 static unsigned get_color(
Fl_Color i);
1052 static void free_color(
Fl_Color i,
int overlay = 0);
1055 static const char* get_font(
Fl_Font);
1068 static const char* get_font_name(
Fl_Font,
int* attributes = 0);
1080 static int get_font_sizes(
Fl_Font,
int*& sizep);
1081 static void set_font(
Fl_Font,
const char*);
1101 static Fl_Font set_fonts(
const char* = 0);
1227 static void unlock();
1228 static void awake(
void* message = 0);
1237 static void* thread_message();
1270 static void delete_widget(
Fl_Widget *w);
1271 static void do_widget_deletion();
1272 static void watch_widget_pointer(
Fl_Widget *&w);
1273 static void release_widget_pointer(
Fl_Widget *&w);
1274 static void clear_widget_pointer(
Fl_Widget const *w);
1289#ifdef FLTK_HAVE_CAIRO
1295 static cairo_t * cairo_make_current(
Fl_Window* w);
1320 static cairo_t *
cairo_cc() {
return cairo_state_.cc(); }
1325 static void cairo_cc(cairo_t * c,
bool own=
false){ cairo_state_.cc(c, own); }
1328 static cairo_t * cairo_make_current(
void* gc);
1329 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.
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
#define FL_ABI_VERSION
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
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition Enumerations.H:761
Fl_Boxtype
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 widget produces an actual window.
Definition Fl_Window.H:57
static int is_scheme(const char *name)
Returns whether the current scheme is the given name.
Definition Fl.H:375
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:346
static void own_colormap()
Makes FLTK use its own colormap.
Definition Fl_own_colormap.cxx:51
static int box_dx(Fl_Boxtype)
Returns the X offset for the given boxtype.
Definition fl_boxtype.cxx:360
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:105
static void use_high_res_GL(int val)
sets whether GL windows should be drawn at high resolution on Apple computers with retina displays
Definition Fl.H:1281
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:80
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:47
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:92
@ 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:231
@ 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:204
@ OPTION_LAST
For internal use only.
Definition Fl.H:234
@ 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:223
@ OPTION_VISIBLE_FOCUS
If visible focus is switched on (default), FLTK will draw a dotted rectangle inside the widget that w...
Definition Fl.H:219
@ 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:227
static void damage(int d)
If true then flush() will do something.
Definition Fl.H:185
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:60
static void dnd_text_ops(int v)
Gets or sets whether drag and drop text operations are supported.
Definition Fl.H:1213
static void(* idle)()
The currently executing idle callback function: DO NOT USE THIS DIRECTLY!
Definition Fl.H:260
static Fl_Box_Draw_F * get_boxtype(Fl_Boxtype)
Gets the current box drawing function for the specified box type.
Definition fl_boxtype.cxx:412
static const char *const help
Usage string displayed if Fl::args() detects an invalid argument.
Definition Fl.H:322
static void release()
Releases the current grabbed window, equals grab(0).
Definition Fl.H:1190
static int visual(int)
Selects a visual so that your graphics are drawn correctly.
Definition Fl_visual.cxx:118
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:416
static int api_version()
Returns the compiled-in value of the FL_API_VERSION constant.
Definition Fl.cxx:176
static void set_idle(Fl_Old_Idle_Handler cb)
Sets an idle callback.
Definition Fl.H:1184
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:32
static int get_awake_handler_(Fl_Awake_Handler &, void *&)
Gets the last stored awake handler for use in awake().
Definition Fl_lock.cxx:106
static int use_high_res_GL()
returns whether GL windows should be drawn at high resolution on Apple computers with retina displays...
Definition Fl.H:1287
static void background2(uchar, uchar, uchar)
Changes the alternative background color.
Definition Fl_get_system_colors.cxx:78
static int box_dw(Fl_Boxtype)
Returns the width offset for the given boxtype.
Definition fl_boxtype.cxx:391
static int scheme(const char *name)
Sets the current widget scheme.
Definition Fl_get_system_colors.cxx:292
static int box_dy(Fl_Boxtype)
Returns the Y offset for the given boxtype.
Definition fl_boxtype.cxx:385
static int abi_version()
Returns the compiled-in value of the FL_ABI_VERSION constant.
Definition Fl.cxx:184
static Fl_Color box_color(Fl_Color)
Gets the drawing color to be used for the background of a box.
Definition fl_boxtype.cxx:69
static int dnd_text_ops()
Gets or sets whether drag and drop text operations are supported.
Definition Fl.H:1220
static void grab(Fl_Window &win)
See grab(Fl_Window*)
Definition Fl.H:1186
static bool option(Fl_Option opt)
FLTK library options management.
Definition Fl.cxx:2186
static int damage()
If true then flush() will do something.
Definition Fl.H:482
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 currently drawn box is active or inactive.
Definition fl_boxtype.cxx:58
static double version()
Returns the compiled-in value of the FL_VERSION constant.
Definition Fl.cxx:168
static void visible_focus(int v)
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition Fl.H:1198
static void set_box_color(Fl_Color)
Sets the drawing color for the box that is currently drawn.
Definition fl_boxtype.cxx:93
static int visible_focus()
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition Fl.H:1204
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:228
static int abi_check(const int val=FL_ABI_VERSION)
Returns whether the runtime library ABI version is correct.
Definition Fl.H:310
static int box_dh(Fl_Boxtype)
Returns the height offset for the given boxtype.
Definition fl_boxtype.cxx:397
static void foreground(uchar, uchar, uchar)
Changes fl_color(FL_FOREGROUND_COLOR).
Definition Fl_get_system_colors.cxx:66
static int add_awake_handler_(Fl_Awake_Handler, void *)
Adds an awake handler for use in awake().
Definition Fl_lock.cxx:74
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:117
void(* Fl_Timeout_Handler)(void *data)
Signature of some timeout callback functions passed as parameters.
Definition Fl.H:99
int(* Fl_Event_Handler)(int event)
Signature of add_handler functions passed as parameters.
Definition Fl.H:114
void(* Fl_Old_Idle_Handler)()
Signature of set_idle callback functions passed as parameters.
Definition Fl.H:108
void(* Fl_Awake_Handler)(void *data)
Signature of some wakeup callback functions passed as parameters.
Definition Fl.H:102
void(* Fl_FD_Handler)(FL_SOCKET fd, void *data)
Signature of add_fd functions passed as parameters.
Definition Fl.H:111
int(* Fl_Event_Dispatch)(int event, Fl_Window *w)
Signature of event_dispatch functions passed as parameters.
Definition Fl.H:130
void Fl_Label_Draw_F(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align)
Signature of some label drawing functions passed as parameters.
Definition Fl.H:90
int(* Fl_Args_Handler)(int argc, char **argv, int &i)
Signature of args functions passed as parameters.
Definition Fl.H:126
void Fl_Label_Measure_F(const Fl_Label *label, int &width, int &height)
Signature of some label measurement functions passed as parameters.
Definition Fl.H:93
void(* Fl_Abort_Handler)(const char *format,...)
Signature of set_abort functions passed as parameters.
Definition Fl.H:120
void Fl_Box_Draw_F(int x, int y, int w, int h, Fl_Color color)
Signature of some box drawing functions passed as parameters.
Definition Fl.H:96
void(* Fl_Atclose_Handler)(Fl_Window *window, void *data)
Signature of set_atclose functions passed as parameters.
Definition Fl.H:123
void(* Fl_Idle_Handler)(void *data)
Signature of add_idle callback functions passed as parameters.
Definition Fl.H:105
void(* Fl_Clipboard_Notify_Handler)(int source, void *data)
Signature of add_clipboard_notify functions passed as parameters.
Definition Fl.H:133
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:966
static Fl_Widget * selection_owner()
back-compatibility only: Gets the widget owning the current selection
Definition Fl.H:982
static int dnd()
Initiate a Drag And Drop operation.
Definition fl_dnd_win32.cxx:535
static char const *const clipboard_plain_text
Denotes plain textual data.
Definition Fl.H:963
static void add_clipboard_notify(Fl_Clipboard_Notify_Handler h, void *data=0)
FLTK will call the registered callback whenever there is a change to the selection buffer or the clip...
Definition Fl.cxx:504
static int clipboard_contains(const char *type)
Returns non 0 if the clipboard contains data matching type.
static void remove_clipboard_notify(Fl_Clipboard_Notify_Handler h)
Stop calling the specified callback when there are changes to the selection buffer or the clipboard.
Definition Fl.cxx:520
static void event_clicks(int i)
Manually sets the number returned by Fl::event_clicks().
Definition Fl.H:660
static int handle(int, Fl_Window *)
Handle events from the window system.
Definition Fl.cxx:1295
static void event_is_click(int i)
Clears the value returned by Fl::event_is_click().
Definition Fl.H:675
static int event_y()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition Fl.H:610
static int event_key()
Gets which key on the keyboard was last pushed.
Definition Fl.H:730
static int event_alt()
Returns non-zero if the Alt key is pressed.
Definition Fl.H:1152
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition Fl.H:847
static int event_length()
Returns the length of the text in Fl::event_text().
Definition Fl.H:806
static int event_state(int mask)
Returns non-zero if any of the passed event state bits are turned on.
Definition Fl.H:718
static int event_dy()
Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition Fl.H:634
static int event_x_root()
Returns the mouse position on the screen of the event.
Definition Fl.H:617
static Fl_Widget * pushed()
Gets the widget that is being pushed.
Definition Fl.H:844
static const char * event_clipboard_type()
Returns the type of the pasted data during an FL_PASTE event.
Definition Fl.H:815
static int event_button1()
Returns non-zero if mouse button 1 is currently held down.
Definition Fl.H:1166
static int event_button3()
Returns non-zero if button 3 is currently held down.
Definition Fl.H:1176
static int event_command()
Returns non-zero if the FL_COMMAND key is pressed, either FL_CTRL or on OSX FL_META.
Definition Fl.H:1150
static void 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:685
static int event_x()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition Fl.H:605
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:624
static int handle_(int, Fl_Window *)
Handle events from the window system.
Definition Fl.cxx:1318
static void * event_clipboard()
During an FL_PASTE event of non-textual data, returns a pointer to the pasted data.
Definition Fl.H:811
static int event_shift()
Returns non-zero if the Shift key is pressed.
Definition Fl.H:1146
static int event()
Returns the last event that was processed.
Definition Fl.H:600
static int event_ctrl()
Returns non-zero if the Control key is pressed.
Definition Fl.H:1148
static Fl_Widget * belowmouse()
Gets the widget that is below the mouse.
Definition Fl.H:840
static int event_button2()
Returns non-zero if button 2 is currently held down.
Definition Fl.H:1171
static int event_dx()
Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition Fl.H:629
static int event_original_key()
Returns the keycode of the last key event, regardless of the NumLock state.
Definition Fl.H:739
static int event_is_click()
Returns non-zero if the mouse has not moved far enough and not enough time has passed since the last ...
Definition Fl.H:668
static const char * event_text()
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events.
Definition Fl.H:799
static int event_buttons()
Returns the mouse buttons state bits; if non-zero, then at least one button is pressed now.
Definition Fl.H:1161
static int event_state()
Returns the keyboard and mouse button states of the last event.
Definition Fl.H:711
static int event_clicks()
Returns non zero if we had a double click event.
Definition Fl.H:652
static int h()
Returns the height in pixels of the main screen work area.
static void screen_work_area(int &X, int &Y, int &W, int &H, int mx, int my)
Gets the bounding box of the work area of a screen that contains the specified screen position mx,...
Definition screen_xywh.cxx:290
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:1007
static int y()
Returns the topmost y coordinate of the main screen work area.
static int screen_count()
Gets the number of available screens.
Definition screen_xywh.cxx:267
static void screen_work_area(int &X, int &Y, int &W, int &H)
Gets the bounding box of the work area of the screen that contains the mouse pointer.
Definition Fl.H:1025
static Fl_Window * first_window()
Returns the first top-level window in the list of shown() windows.
Definition Fl.cxx:755
static Fl_Window * next_window(const Fl_Window *)
Returns the next top-level window in the list of shown() windows.
Definition Fl.cxx:765
static void(* atclose)(Fl_Window *, void *)
Back compatibility: default window callback handler.
Definition Fl.H:1135
static Fl_Window * modal()
Returns the top-most modal() window currently shown.
Definition Fl.H:556
static void set_abort(Fl_Abort_Handler f)
For back compatibility, sets the void Fl::fatal handler callback.
Definition Fl.H:1134
static Fl_Window * grab()
Returns the window that currently receives all events.
Definition Fl.H:562
static void default_atclose(Fl_Window *, void *)
Default callback for window widgets.
Definition Fl_Window.cxx:183
static void set_atclose(Fl_Atclose_Handler f)
For back compatibility, sets the Fl::atclose handler callback.
Definition Fl.H:1140
static cairo_t * cairo_cc()
Gets the current cairo context linked with a fltk window.
Definition Fl.H:1320
static void cairo_cc(cairo_t *c, bool own=false)
Sets the current cairo context to c.
Definition Fl.H:1325
static bool cairo_autolink_context()
Gets the current autolink mode for cairo support.
Definition Fl.H:1318
static void cairo_autolink_context(bool alink)
when FLTK_HAVE_CAIRO is defined and cairo_autolink_context() is true, any current window dc is linked...
Definition Fl.H:1310
static void(* error)(const char *,...)
FLTK calls Fl::error() to output a normal error message.
Definition Fl.H:520
static void(* fatal)(const char *,...)
FLTK calls Fl::fatal() to output a fatal error message.
Definition Fl.H:537
static void(* warning)(const char *,...)
FLTK calls Fl::warning() to output a warning message.
Definition Fl.H:505
This struct stores all information for a text or mixed graphics label.
Definition Fl_Widget.H:65