35 #ifdef FLTK_HAVE_CAIRO
36 # include <FL/Fl_Cairo.H>
42 # define Fl_Object Fl_Widget
132 static int e_is_click;
144 static int compose_state;
163 OPTION_ARROW_FOCUS = 0,
193 static unsigned char options_[OPTION_LAST];
194 static unsigned char options_read_;
201 static bool option(Fl_Option opt);
206 static void option(Fl_Option opt,
bool val);
215 static void (*idle)();
219 static void **awake_data_;
220 static int awake_ring_size_;
221 static int awake_ring_head_;
222 static int awake_ring_tail_;
223 static const char* scheme_;
226 static int e_original_keysym;
227 static int scrollbar_size_;
237 static double version();
240 static int arg(
int argc,
char **argv,
int& i);
241 static int args(
int argc,
char **argv,
int& i,
Fl_Args_Handler cb = 0);
242 static void args(
int argc,
char **argv);
250 static void display(
const char*);
251 static int visual(
int);
261 static int gl_visual(
int,
int *alist=0);
262 static void own_colormap();
263 static void get_system_colors();
269 static int scheme(
const char*);
271 static const char*
scheme() {
return scheme_;}
277 static int reload_scheme();
278 static int scrollbar_size();
279 static void scrollbar_size(
int W);
283 static double wait(
double time);
360 static void add_fd(
int fd,
int when,
Fl_FD_Handler cb,
void* = 0);
364 static void remove_fd(
int,
int when);
366 static void remove_fd(
int);
373 static void redraw();
395 static void (*warning)(
const char*, ...);
410 static void (*error)(
const char*, ...);
427 static void (*fatal)(
const char*, ...);
490 static int event() {
return e_number;}
533 static void get_mouse(
int &,
int &);
658 static int event_key(
int key);
664 static int get_key(
int key);
688 static int compose(
int &del);
689 static void compose_reset();
690 static int event_inside(
int,
int,
int,
int);
691 static int event_inside(
const Fl_Widget*);
727 static void copy(
const char* stuff,
int len,
int destination = 0);
745 static void paste(
Fl_Widget &receiver,
int source );
762 static void selection(
Fl_Widget &owner,
const char*,
int len);
779 static int screen_count();
786 screen_xywh(X, Y, W, H, e_x_root, e_y_root);
788 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H,
int mx,
int my);
789 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H,
int n);
790 static void screen_xywh(
int &X,
int &Y,
int &W,
int &H,
int mx,
int my,
int mw,
int mh);
791 static void screen_dpi(
float &h,
float &v,
int n=0);
806 static void set_color(
Fl_Color i,
unsigned c);
807 static unsigned get_color(
Fl_Color i);
814 static void free_color(
Fl_Color i,
int overlay = 0);
817 static const char* get_font(
Fl_Font);
830 static const char* get_font_name(
Fl_Font,
int* attributes = 0);
842 static int get_font_sizes(
Fl_Font,
int*& sizep);
843 static void set_font(
Fl_Font,
const char*);
863 static Fl_Font set_fonts(
const char* = 0);
887 static int draw_box_active();
895 static void default_atclose(
Fl_Window*,
void*);
986 static void unlock();
987 static void awake(
void* message = 0);
996 static void* thread_message();
1029 static void delete_widget(
Fl_Widget *w);
1030 static void do_widget_deletion();
1031 static void watch_widget_pointer(
Fl_Widget *&w);
1032 static void release_widget_pointer(
Fl_Widget *&w);
1033 static void clear_widget_pointer(
Fl_Widget const *w);
1036 #ifdef FLTK_HAVE_CAIRO
1042 static cairo_t * cairo_make_current(
Fl_Window* w);
1067 static cairo_t *
cairo_cc() {
return cairo_state_.cc(); }
1072 static void cairo_cc(cairo_t * c,
bool own=
false){ cairo_state_.cc(c, own); }
1075 static cairo_t * cairo_make_current(
void* gc);
1076 static cairo_t * cairo_make_current(
void* gc,
int W,
int H);
1081 #endif // FLTK_HAVE_CAIRO
static Fl_Window * modal()
Returns the top-most modal() window currently shown.
Definition: Fl.H:446
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:75
This widget produces an actual window.
Definition: Fl_Window.H:58
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:558
#define FL_BUTTON2
Mouse button 2 is pushed.
Definition: Enumerations.H:429
static const char * scheme()
See void scheme(const char *name)
Definition: Fl.H:271
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition: Fl.H:706
static const char * event_text()
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events...
Definition: Fl.H:679
static Fl_Widget * selection_owner()
back-compatibility only: Gets the widget owning the current selection
Definition: Fl.H:760
void(* Fl_FD_Handler)(int fd, void *data)
Signature of add_fd functions passed as parameters.
Definition: Fl.H:93
static int event_button1()
Returns non-zero if mouse button 1 is currently held down.
Definition: Fl.H:925
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:1057
The Fl is the FLTK global (static) class containing state information and global methods for the curr...
Definition: Fl.H:118
void(* Fl_Timeout_Handler)(void *data)
Signature of some timeout callback functions passed as parameters.
Definition: Fl.H:81
static void release()
Releases the current grabbed window, equals grab(0).
Definition: Fl.H:949
static int event_y_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:514
void(* Fl_Idle_Handler)(void *data)
Signature of add_idle callback functions passed as parameters.
Definition: Fl.H:87
If visible focus is switched on, FLTK will draw a dotted rectangle inside the widget that will receiv...
Definition: Fl.H:178
static Fl_Widget * belowmouse()
Gets the widget that is below the mouse.
Definition: Fl.H:699
static int event()
Returns the last event that was processed.
Definition: Fl.H:490
header for Unicode and UTF8 chracter handling
#define FL_BUTTON3
Mouse button 3 is pushed.
Definition: Enumerations.H:430
static int event_y()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:500
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition: Fl_Image.H:51
static int event_dx()
Returns the current horizontal mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:519
If tooltips are enabled, hovering the mouse over a widget with a tooltip text will open a little tool...
Definition: Fl.H:186
Fl_Boxtype
Definition: Enumerations.H:464
static int event_button()
Gets which particular mouse button caused the current event.
Definition: Fl.H:572
static bool cairo_autolink_context()
Gets the current autolink mode for cairo support.
Definition: Fl.H:1065
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:418
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:441
#define FL_Button
A mouse button; use Fl_Button + n for mouse button n.
Definition: Enumerations.H:333
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:72
void(* Fl_Atclose_Handler)(Fl_Window *window, void *data)
Signature of set_atclose functions passed as parameters.
Definition: Fl.H:102
If text drag-and-drop is enabled, the user can select and drag text from any text widget...
Definition: Fl.H:182
static void event_clicks(int i)
Manually sets the number returned by Fl::event_clicks().
Definition: Fl.H:550
static int event_clicks()
Returns non zero if we had a double click event.
Definition: Fl.H:542
static const char *const help
Usage string displayed if Fl::args() detects an invalid argument.
Definition: Fl.H:247
static int event_state(int i)
See int event_state()
Definition: Fl.H:598
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:596
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:73
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:420
static int event_original_key()
Returns the keycode of the last key event, regardless of the NumLock state.
Definition: Fl.H:619
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:785
static int event_button3()
Returns non-zero if button 3 is currently held down.
Definition: Fl.H:935
static int visible_focus()
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:963
static int event_dy()
Returns the current vertical mouse scrolling associated with the FL_MOUSEWHEEL event.
Definition: Fl.H:524
static void grab(Fl_Window &win)
See grab(Fl_Window*)
Definition: Fl.H:945
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:421
static int event_length()
Returns the length of the text in Fl::event_text().
Definition: Fl.H:686
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:909
static void event_is_click(int i)
Clears the value returned by Fl::event_is_click().
Definition: Fl.H:565
void(* Fl_Abort_Handler)(const char *format,...)
Signature of set_abort functions passed as parameters.
Definition: Fl.H:99
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:769
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition: Enumerations.H:606
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:712
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:78
static int event_x_root()
Returns the mouse position on the screen of the event.
Definition: Fl.H:507
#define FL_BUTTON1
Mouse button 1 is pushed.
Definition: Enumerations.H:428
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:663
static void dnd_text_ops(int v)
Gets or sets whether drag and drop text operations are supported.
Definition: Fl.H:972
static void cairo_cc(cairo_t *c, bool own=false)
Sets the current cairo context to c.
Definition: Fl.H:1072
static Fl_Window * grab()
Returns the window that currently receives all events.
Definition: Fl.H:452
static void damage(int d)
If true then flush() will do something.
Definition: Fl.H:149
void(* Fl_Old_Idle_Handler)()
Signature of set_idle callback functions passed as parameters.
Definition: Fl.H:90
static void visible_focus(int v)
Gets or sets the visible keyboard focus on buttons and other non-text widgets.
Definition: Fl.H:957
static int event_button2()
Returns non-zero if button 2 is currently held down.
Definition: Fl.H:930
void(* Fl_Awake_Handler)(void *data)
Signature of some wakeup callback functions passed as parameters.
Definition: Fl.H:84
int(* Fl_Event_Handler)(int event)
Signature of add_handler functions passed as parameters.
Definition: Fl.H:96
int(* Fl_Event_Dispatch)(int event, Fl_Window *w)
Signature of event_dispatch functions passed as parameters.
Definition: Fl.H:109
static Fl_Widget * pushed()
Gets the widget that is being pushed.
Definition: Fl.H:703
static void set_atclose(Fl_Atclose_Handler f)
For back compatibility, sets the Fl::atclose handler callback.
Definition: Fl.H:899
static cairo_t * cairo_cc()
Gets the current cairo context linked with a fltk window.
Definition: Fl.H:1067
Contains all the necessary info on the current cairo context.
Definition: Fl_Cairo.H:63
static int event_x()
Returns the mouse position of the event relative to the Fl_Window it was passed to.
Definition: Fl.H:495
Fl_Color color
text color
Definition: Fl_Widget.H:85
static int dnd_text_ops()
Gets or sets whether drag and drop text operations are supported.
Definition: Fl.H:979
static int event_shift()
Returns non-zero if the Shift key is pressed.
Definition: Fl.H:905
static int event_ctrl()
Returns non-zero if the Control key is pressed.
Definition: Fl.H:907
static int damage()
If true then flush() will do something.
Definition: Fl.H:372
static void set_idle(Fl_Old_Idle_Handler cb)
Sets an idle callback.
Definition: Fl.H:943
unsigned char uchar
unsigned char
Definition: fl_types.h:39
static int event_buttons()
Returns the mouse buttons state bits; if non-zero, then at least one button is pressed now...
Definition: Fl.H:920
unsigned int Fl_Shortcut
24-bit Unicode character + 8-bit indicator for keyboard flags
Definition: fl_types.h:55
static int event_key()
Gets which key on the keyboard was last pushed.
Definition: Fl.H:610
static void set_abort(Fl_Abort_Handler f)
For back compatibility, sets the void Fl::fatal handler callback.
Definition: Fl.H:893
static int event_alt()
Returns non-zero if the Alt key is pressed.
Definition: Fl.H:911
int(* Fl_Args_Handler)(int argc, char **argv, int &i)
Signature of args functions passed as parameters.
Definition: Fl.H:105