FLTK 1.4.0
fl_draw.H
Go to the documentation of this file.
1//
2// Portable drawing function header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2023 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
22#ifndef fl_draw_H
23#define fl_draw_H
24
25#include <FL/Enumerations.H> // color names
26#include <FL/Fl_Graphics_Driver.H> // fl_graphics_driver + Fl_Region
27#include <FL/Fl_Rect.H>
28
29// Image class...
30class Fl_Image;
31class Fl_Window;
32
33// Label flags...
34FL_EXPORT extern char fl_draw_shortcut;
35
40// Colors:
50inline void fl_color(Fl_Color c) {
51 fl_graphics_driver->color(c);
52} // select indexed color
54inline void fl_color(int c) {
56}
67inline void fl_color(uchar r, uchar g, uchar b) {
68 fl_graphics_driver->color(r, g, b);
69}
75 return fl_graphics_driver->color();
76}
82// clip:
88inline void fl_push_clip(int x, int y, int w, int h) {
89 fl_graphics_driver->push_clip(x, y, w, h);
90}
99inline void fl_clip(int x, int y, int w, int h) {
100 fl_graphics_driver->push_clip(x, y, w, h);
101}
105inline void fl_push_no_clip() {
106 fl_graphics_driver->push_no_clip();
107}
115inline void fl_pop_clip() {
116 fl_graphics_driver->pop_clip();
117}
118
132inline int fl_not_clipped(int x, int y, int w, int h) {
133 return fl_graphics_driver->not_clipped(x, y, w, h);
134}
135
178inline int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) {
179 return fl_graphics_driver->clip_box(x, y, w, h, X, Y, W, H);
180}
181
183inline void fl_restore_clip() {
184 fl_graphics_driver->restore_clip();
185}
186
196inline void fl_clip_region(Fl_Region r) {
197 fl_graphics_driver->clip_region(r);
198}
199
207 return fl_graphics_driver->clip_region();
208}
209
210
211// points:
215inline void fl_point(int x, int y) {
216 fl_graphics_driver->point(x, y);
217}
218
219// line type:
252inline void fl_line_style(int style, int width = 0, char *dashes = 0) {
253 fl_graphics_driver->line_style(style, width, dashes);
254}
255
261enum {
264 FL_DOT = 2,
267
268 FL_CAP_FLAT = 0x100,
269 FL_CAP_ROUND = 0x200,
271
272 FL_JOIN_MITER = 0x1000,
273 FL_JOIN_ROUND = 0x2000,
274 FL_JOIN_BEVEL = 0x3000
276
282inline void fl_antialias(int state) {
283 fl_graphics_driver->antialias(state);
284}
285
287inline int fl_antialias() {
288 return fl_graphics_driver->antialias();
289}
290
291// rectangles tweaked to exactly fill the pixel rectangle:
292
298inline void fl_rect(int x, int y, int w, int h) {
299 fl_graphics_driver->rect(x, y, w, h);
300}
301
307inline void fl_rounded_rect(int x, int y, int w, int h, int r) {
308 fl_graphics_driver->rounded_rect(x, y, w, h, r);
309}
310
316inline void fl_rect(Fl_Rect r) {
317 fl_rect(r.x(), r.y(), r.w(), r.h());
318}
319
326inline void fl_focus_rect(int x, int y, int w, int h) {
327 fl_graphics_driver->focus_rect(x, y, w, h);
328}
329
333inline void fl_rect(int x, int y, int w, int h, Fl_Color c) {
334 fl_color(c);
335 fl_rect(x, y, w, h);
336}
337
339inline void fl_rectf(int x, int y, int w, int h) {
340 fl_graphics_driver->rectf(x, y, w, h);
341}
342
347inline void fl_rounded_rectf(int x, int y, int w, int h, int r) {
348 fl_graphics_driver->rounded_rectf(x, y, w, h, r);
349}
350
354inline void fl_rectf(int x, int y, int w, int h, Fl_Color c) {
355 fl_color(c);
356 fl_rectf(x, y, w, h);
357}
358
360inline void fl_rectf(Fl_Rect r) {
361 fl_graphics_driver->rectf(r.x(), r.y(), r.w(), r.h());
362}
363
367inline void fl_rectf(Fl_Rect r, Fl_Color c) {
368 fl_color(c);
369 fl_rectf(r);
370}
371
379inline void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
380 fl_graphics_driver->colored_rectf(x, y, w, h, r, g, b);
381}
382
389inline void fl_rectf(Fl_Rect bb, uchar r, uchar g, uchar b) {
390 fl_graphics_driver->colored_rectf(bb.x(), bb.y(), bb.w(), bb.h(), r, g, b);
391}
392
393// line segments:
397inline void fl_line(int x, int y, int x1, int y1) {
398 fl_graphics_driver->line(x, y, x1, y1);
399}
403inline void fl_line(int x, int y, int x1, int y1, int x2, int y2) {
404 fl_graphics_driver->line(x, y, x1, y1, x2, y2);
405}
406
407// closed line segments:
411inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2) {
412 fl_graphics_driver->loop(x, y, x1, y1, x2, y2);
413}
417inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
418 fl_graphics_driver->loop(x, y, x1, y1, x2, y2, x3, y3);
419}
420
421// filled polygons
425inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {
426 fl_graphics_driver->polygon(x, y, x1, y1, x2, y2);
427}
431inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
432 fl_graphics_driver->polygon(x, y, x1, y1, x2, y2, x3, y3);
433}
434
435// draw rectilinear lines, horizontal segment first:
439inline void fl_xyline(int x, int y, int x1) {
440 fl_graphics_driver->xyline(x, y, x1);
441}
445inline void fl_xyline(int x, int y, int x1, int y2) {
446 fl_graphics_driver->xyline(x, y, x1, y2);
447}
452inline void fl_xyline(int x, int y, int x1, int y2, int x3) {
453 fl_graphics_driver->xyline(x, y, x1, y2, x3);
454}
455
456// draw rectilinear lines, vertical segment first:
460inline void fl_yxline(int x, int y, int y1) {
461 fl_graphics_driver->yxline(x, y, y1);
462}
466inline void fl_yxline(int x, int y, int y1, int x2) {
467 fl_graphics_driver->yxline(x, y, y1, x2);
468}
473inline void fl_yxline(int x, int y, int y1, int x2, int y3) {
474 fl_graphics_driver->yxline(x, y, y1, x2, y3);
475}
476
477// circular lines and pie slices (code in fl_arci.C):
503inline void fl_arc(int x, int y, int w, int h, double a1, double a2) {
504 fl_graphics_driver->arc(x, y, w, h, a1, a2);
505}
521inline void fl_pie(int x, int y, int w, int h, double a1, double a2) {
522 fl_graphics_driver->pie(x, y, w, h, a1, a2);
523}
525FL_EXPORT void fl_chord(int x, int y, int w, int h, double a1, double a2); // nyi
526
527// scalable drawing code (code in fl_vertex.cxx and fl_arc.cxx):
532inline void fl_push_matrix() {
533 fl_graphics_driver->push_matrix();
534}
538inline void fl_pop_matrix() {
539 fl_graphics_driver->pop_matrix();
540}
545inline void fl_scale(double x, double y) {
546 fl_graphics_driver->mult_matrix(x, 0, 0, y, 0, 0);
547}
552inline void fl_scale(double x) {
553 fl_graphics_driver->mult_matrix(x, 0, 0, x, 0, 0);
554}
559inline void fl_translate(double x, double y) {
560 fl_graphics_driver->translate(x, y);
561}
566inline void fl_rotate(double d) {
567 fl_graphics_driver->rotate(d);
568}
572inline void fl_load_identity() {
573 fl_graphics_driver->load_identity();
574}
579inline void fl_load_matrix(double a, double b, double c, double d, double x, double y) {
580 fl_graphics_driver->load_matrix(a, b, c, d, x, y);
581}
588inline void fl_mult_matrix(double a, double b, double c, double d, double x, double y) {
589 fl_graphics_driver->mult_matrix(a, b, c, d, x, y);
590}
594inline void fl_begin_points() {
595 fl_graphics_driver->begin_points();
596}
600inline void fl_begin_line() {
601 fl_graphics_driver->begin_line();
602}
606inline void fl_begin_loop() {
607 fl_graphics_driver->begin_loop();
608}
612inline void fl_begin_polygon() {
613 fl_graphics_driver->begin_polygon();
614}
619inline void fl_vertex(double x, double y) {
620 fl_graphics_driver->vertex(x, y);
621}
630inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3) {
631 fl_graphics_driver->curve(X0, Y0, X1, Y1, X2, Y2, X3, Y3);
632}
668inline void fl_arc(double x, double y, double r, double start, double end) {
669 fl_graphics_driver->arc(x, y, r, start, end);
670}
683inline void fl_circle(double x, double y, double r) {
684 fl_graphics_driver->circle(x, y, r);
685}
689inline void fl_end_points() {
690 fl_graphics_driver->end_points();
691}
695inline void fl_end_line() {
696 fl_graphics_driver->end_line();
697}
701inline void fl_end_loop() {
702 fl_graphics_driver->end_loop();
703}
707inline void fl_end_polygon() {
708 fl_graphics_driver->end_polygon();
709}
724 fl_graphics_driver->begin_complex_polygon();
725}
732inline void fl_gap() {
733 fl_graphics_driver->gap();
734}
739 fl_graphics_driver->end_complex_polygon();
740}
741// get and use transformed positions:
746inline double fl_transform_x(double x, double y) {
747 return fl_graphics_driver->transform_x(x, y);
748}
753inline double fl_transform_y(double x, double y) {
754 return fl_graphics_driver->transform_y(x, y);
755}
760inline double fl_transform_dx(double x, double y) {
761 return fl_graphics_driver->transform_dx(x, y);
762}
767inline double fl_transform_dy(double x, double y) {
768 return fl_graphics_driver->transform_dy(x, y);
769}
774inline void fl_transformed_vertex(double xf, double yf) {
775 fl_graphics_driver->transformed_vertex(xf, yf);
776}
777
784inline void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) {
785 fl_graphics_driver->copy_offscreen(x, y, w, h, pixmap, srcx, srcy);
786}
787
788FL_EXPORT Fl_Offscreen fl_create_offscreen(int w, int h);
789FL_EXPORT void fl_begin_offscreen(Fl_Offscreen b);
790FL_EXPORT void fl_end_offscreen(void);
791FL_EXPORT void fl_delete_offscreen(Fl_Offscreen bitmap);
792FL_EXPORT void fl_rescale_offscreen(Fl_Offscreen &ctx);
793
798/* NOTE: doxygen comments here to avoid triplication in os-specific sources */
799
800// Fonts:
801/*
802 Set the current font, which is then used in various drawing routines.
803 Implemented and documented in src/fl_draw.cxx
804*/
805FL_EXPORT void fl_font(Fl_Font face, Fl_Fontsize fsize);
806
811inline Fl_Font fl_font() {
812 return fl_graphics_driver->font();
813}
819 return fl_graphics_driver->size();
820}
821
822// Information you can get about the current font:
827inline int fl_height() {
828 return fl_graphics_driver->height();
829}
830FL_EXPORT int fl_height(int font, int size);
835inline int fl_descent() {
836 return fl_graphics_driver->descent();
837}
841FL_EXPORT double fl_width(const char *txt);
842
846inline double fl_width(const char *txt, int n) {
847 return fl_graphics_driver->width(txt, n);
848}
855inline double fl_width(unsigned int c) {
856 return fl_graphics_driver->width(c);
857}
883FL_EXPORT void fl_text_extents(const char *, int &dx, int &dy, int &w, int &h);
884
891inline void fl_text_extents(const char *t, int n, int &dx, int &dy, int &w, int &h) {
892 fl_graphics_driver->text_extents(t, n, dx, dy, w, h);
893}
894
895// font encoding:
896// Note: doxygen comments here to avoid duplication for os-specific cases
903FL_EXPORT const char *fl_latin1_to_local(const char *t, int n = -1);
910FL_EXPORT const char *fl_local_to_latin1(const char *t, int n = -1);
917FL_EXPORT const char *fl_mac_roman_to_local(const char *t, int n = -1);
924FL_EXPORT const char *fl_local_to_mac_roman(const char *t, int n = -1);
930FL_EXPORT float fl_override_scale();
931
932FL_EXPORT void fl_restore_scale(float s);
933
944FL_EXPORT void fl_draw(const char *str, int x, int y);
952FL_EXPORT void fl_draw(int angle, const char *str, int x, int y);
956inline void fl_draw(const char *str, int n, int x, int y) {
957 fl_graphics_driver->draw(str, n, x, y);
958}
968inline void fl_draw(int angle, const char *str, int n, int x, int y) {
969 fl_graphics_driver->draw(angle, str, n, x, y);
970}
974inline void fl_rtl_draw(const char *str, int n, int x, int y) {
975 fl_graphics_driver->rtl_draw(str, n, x, y);
976}
977FL_EXPORT void fl_measure(const char *str, int &x, int &y, int draw_symbols = 1);
1000FL_EXPORT void fl_draw(const char *str, int x, int y, int w, int h,
1001 Fl_Align align, Fl_Image *img = 0,
1002 int draw_symbols = 1, int spacing = 0);
1018FL_EXPORT void fl_draw(const char *str, int x, int y, int w, int h, Fl_Align align,
1019 void (*callthis)(const char *, int, int, int),
1020 Fl_Image *img = 0, int draw_symbols = 1, int spacing = 0);
1021
1022// boxtypes:
1023
1024FL_EXPORT void fl_frame(const char *s, int x, int y, int w, int h);
1025FL_EXPORT void fl_frame2(const char *s, int x, int y, int w, int h);
1026FL_EXPORT void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color);
1027FL_EXPORT void fl_draw_box_focus(Fl_Boxtype, int x, int y, int w, int h, Fl_Color, Fl_Color);
1028
1029// basic GUI objects (check marks, arrows, more to come ...):
1030
1031// Draw a check mark in the given color inside the bounding box bb.
1032void fl_draw_check(Fl_Rect bb, Fl_Color col);
1033
1034// Draw one or more "arrows" (triangles)
1036
1037// Draw a potentially small, filled circle
1038FL_EXPORT void fl_draw_circle(int x, int y, int d, Fl_Color color);
1039
1040// Draw the full "radio button" of a radio menu entry or radio button
1041// This requires scheme specific handling (particularly gtk+ scheme)
1042FL_EXPORT void fl_draw_radio(int x, int y, int d, Fl_Color color);
1043
1044// images:
1045
1081inline void fl_draw_image(const uchar *buf, int X, int Y, int W, int H, int D = 3, int L = 0) {
1082 fl_graphics_driver->draw_image(buf, X, Y, W, H, D, L);
1083}
1084
1089inline void fl_draw_image_mono(const uchar *buf, int X, int Y, int W, int H, int D = 1, int L = 0) {
1090 fl_graphics_driver->draw_image_mono(buf, X, Y, W, H, D, L);
1091}
1092
1128inline void fl_draw_image(Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D = 3) {
1129 fl_graphics_driver->draw_image(cb, data, X, Y, W, H, D);
1130}
1131
1136inline void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D = 1) {
1137 fl_graphics_driver->draw_image_mono(cb, data, X, Y, W, H, D);
1138}
1139
1146 return Fl_Graphics_Driver::default_driver().can_do_alpha_blending();
1147}
1148
1149FL_EXPORT uchar *fl_read_image(uchar *p, int X, int Y, int W, int H, int alpha = 0);
1150FL_EXPORT Fl_RGB_Image *fl_capture_window(Fl_Window *win, int x, int y, int w, int h);
1151
1152// pixmaps:
1164FL_EXPORT int fl_draw_pixmap(const char *const *data, int x, int y, Fl_Color bg = FL_GRAY);
1169inline int fl_draw_pixmap(/*const*/ char *const *data, int x, int y, Fl_Color bg = FL_GRAY) {
1170 return fl_draw_pixmap((const char *const *)data, x, y, bg);
1171}
1172FL_EXPORT int fl_measure_pixmap(/*const*/ char *const *data, int &w, int &h);
1173FL_EXPORT int fl_measure_pixmap(const char *const *cdata, int &w, int &h);
1174
1175// other:
1176FL_EXPORT void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
1177 void (*draw_area)(void *, int, int, int, int), void *data);
1178FL_EXPORT const char *fl_shortcut_label(unsigned int shortcut);
1179FL_EXPORT const char *fl_shortcut_label(unsigned int shortcut, const char **eom);
1180FL_EXPORT unsigned int fl_old_shortcut(const char *s);
1181FL_EXPORT void fl_overlay_rect(int x, int y, int w, int h);
1182FL_EXPORT void fl_overlay_clear();
1183FL_EXPORT void fl_cursor(Fl_Cursor);
1184FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg, Fl_Color bg = FL_WHITE);
1185FL_EXPORT const char *fl_expand_text(const char *from, char *buf, int maxbuf, double maxw,
1186 int &n, double &width, int wrap, int draw_symbols = 0);
1187
1188// XIM:
1189FL_EXPORT void fl_set_status(int X, int Y, int W, int H);
1197FL_EXPORT void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win = 0);
1209FL_EXPORT void fl_reset_spot(void);
1210
1211
1212// XForms symbols:
1213FL_EXPORT int fl_draw_symbol(const char *label, int x, int y, int w, int h, Fl_Color);
1214FL_EXPORT int fl_add_symbol(const char *name, void (*drawit)(Fl_Color), int scalable);
1217#endif
This file contains type definitions and general enumerations.
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:1054
Fl_Arrow_Type
Arrow types define the type of arrow drawing function.
Definition: Enumerations.H:1355
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:977
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition: Enumerations.H:1274
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition: Enumerations.H:1111
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:1083
Fl_Boxtype
FLTK standard box types.
Definition: Enumerations.H:635
Fl_Orientation
Fl_Orientation describes the orientation of a GUI element.
Definition: Enumerations.H:1384
Fl_Graphics_Driver * fl_graphics_driver
Points to the driver that currently receives all graphics requests.
Definition: Fl_Graphics_Driver.cxx:23
void end()
Exactly the same as current(this->parent()).
Definition: Fl_Group.cxx:73
Base class for image caching, scaling and drawing.
Definition: Fl_Image.H:60
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:339
Rectangle with standard FLTK coordinates (X, Y, W, H).
Definition: Fl_Rect.H:30
int y() const
gets the y coordinate (top edge)
Definition: Fl_Rect.H:73
int w() const
gets the width
Definition: Fl_Rect.H:74
int h() const
gets the height
Definition: Fl_Rect.H:75
int x() const
gets the x coordinate (left edge)
Definition: Fl_Rect.H:72
Fl_Color color() const
Gets the background color of the widget.
Definition: Fl_Widget.H:453
int y() const
Gets the widget position in its window.
Definition: Fl_Widget.H:364
int h() const
Gets the widget height.
Definition: Fl_Widget.H:374
Fl_Align align() const
Gets the label alignment.
Definition: Fl_Widget.H:423
int w() const
Gets the widget width.
Definition: Fl_Widget.H:369
void size(int W, int H)
Changes the size of the widget.
Definition: Fl_Widget.H:416
int x() const
Gets the widget position in its window.
Definition: Fl_Widget.H:359
This widget produces an actual window.
Definition: Fl_Window.H:55
const char * label() const
See void Fl_Window::label(const char*)
Definition: Fl_Window.H:357
unsigned char uchar
unsigned char
Definition: fl_types.h:30
int fl_descent()
Return the recommended distance above the bottom of a fl_height() tall box to draw the text at so it ...
Definition: fl_draw.H:835
const char * fl_local_to_mac_roman(const char *t, int n=-1)
Convert text from local encoding to Mac Roman character set.
Definition: fl_encoding_mac_roman.cxx:111
Fl_Fontsize fl_size()
Return the size set by the most recent call to fl_font().
Definition: fl_draw.H:818
void fl_text_extents(const char *, int &dx, int &dy, int &w, int &h)
Determine the minimum pixel dimensions of a nul-terminated string using the current fl_font().
Definition: fl_font.cxx:40
double fl_width(const char *txt)
Return the typographical width of a nul-terminated string using the current font face and size.
Definition: fl_font.cxx:27
void fl_font(Fl_Font face, Fl_Fontsize fsize)
Sets the current font, which is then used in various drawing routines.
Definition: fl_draw.cxx:550
const char * fl_latin1_to_local(const char *t, int n=-1)
Convert text from Windows/X11 latin1 character set to local encoding.
Definition: fl_encoding_latin1.cxx:64
void fl_color(Fl_Color c)
Set the color for all subsequent drawing operations.
Definition: fl_draw.H:50
const char * fl_local_to_latin1(const char *t, int n=-1)
Convert text from local encoding to Windows/X11 latin1 character set.
Definition: fl_encoding_latin1.cxx:69
int fl_height()
Return the recommended minimum line spacing for the current font.
Definition: fl_draw.H:827
const char * fl_mac_roman_to_local(const char *t, int n=-1)
Convert text from Mac Roman character set to local encoding.
Definition: fl_encoding_mac_roman.cxx:115
void fl_draw_radio(int x, int y, int d, Fl_Color color)
Draw a round check mark (circle) of a radio button.
Definition: fl_draw.cxx:761
void fl_set_status(int X, int Y, int W, int H)
Related to text input methods under X11.
Definition: fl_font.cxx:68
void fl_push_no_clip()
Push an empty clip region onto the stack so nothing will be clipped.
Definition: fl_draw.H:105
void fl_begin_complex_polygon()
Start drawing a complex filled polygon.
Definition: fl_draw.H:723
void fl_vertex(double x, double y)
Add a single vertex to the current path.
Definition: fl_draw.H:619
void fl_begin_offscreen(Fl_Offscreen b)
Send all subsequent drawing commands to this offscreen buffer.
Definition: Fl_Image_Surface.cxx:331
Fl_RGB_Image * fl_capture_window(Fl_Window *win, int x, int y, int w, int h)
Captures the content of a rectangular zone of a mapped window.
Definition: fl_read_image.cxx:104
int fl_measure_pixmap(char *const *data, int &w, int &h)
Get the dimensions of a pixmap.
Definition: fl_draw_pixmap.cxx:57
void fl_clip(int x, int y, int w, int h)
Intersect the current clip region with a rectangle and push this new region onto the stack (deprecate...
Definition: fl_draw.H:99
const char * fl_expand_text(const char *from, char *buf, int maxbuf, double maxw, int &n, double &width, int wrap, int draw_symbols=0)
Copy from to buf, replacing control characters with ^X.
Definition: fl_draw.cxx:187
void fl_point(int x, int y)
Draw a single pixel at the given coordinates.
Definition: fl_draw.H:215
Fl_Offscreen fl_create_offscreen(int w, int h)
Creation of an offscreen graphics buffer.
Definition: Fl_Image_Surface.cxx:306
void fl_gap()
Separate loops of the path.
Definition: fl_draw.H:732
void fl_rectf(int x, int y, int w, int h)
Color with current color a rectangle that exactly fills the given bounding box.
Definition: fl_draw.H:339
int fl_not_clipped(int x, int y, int w, int h)
Does the rectangle intersect the current clip region?
Definition: fl_draw.H:132
void fl_translate(double x, double y)
Concatenate translation transformation onto the current one.
Definition: fl_draw.H:559
void fl_overlay_clear()
Erase a selection rectangle without drawing a new one.
Definition: fl_overlay.cxx:82
void fl_begin_points()
Start drawing a list of points.
Definition: fl_draw.H:594
double fl_transform_dy(double x, double y)
Transform distance using current transformation matrix.
Definition: fl_draw.H:767
void fl_arc(int x, int y, int w, int h, double a1, double a2)
Draw ellipse sections using integer coordinates.
Definition: fl_draw.H:503
void fl_begin_loop()
Start drawing a closed sequence of lines.
Definition: fl_draw.H:606
void fl_rescale_offscreen(Fl_Offscreen &ctx)
Adapts an offscreen buffer to a changed value of the scale factor.
Definition: Fl_Image_Surface.cxx:353
void fl_transformed_vertex(double xf, double yf)
Add coordinate pair to the vertex list without further transformations.
Definition: fl_draw.H:774
void fl_scroll(int X, int Y, int W, int H, int dx, int dy, void(*draw_area)(void *, int, int, int, int), void *data)
Scroll a rectangle and draw the newly exposed portions.
Definition: fl_scroll_area.cxx:36
void fl_draw(const char *str, int x, int y)
Draw a nul-terminated UTF-8 string starting at the given x, y location.
Definition: fl_font.cxx:32
void fl_antialias(int state)
Turn antialiased line drawings ON or OFF, if supported by platform.
Definition: fl_draw.H:282
const char * fl_shortcut_label(unsigned int shortcut)
Get a human-readable string from a shortcut value.
Definition: fl_shortcut.cxx:131
void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3)
Add a series of points on a Bézier curve to the path.
Definition: fl_draw.H:630
void fl_focus_rect(int x, int y, int w, int h)
Draw a dotted rectangle, used to indicate keyboard focus on a widget.
Definition: fl_draw.H:326
void fl_rtl_draw(const char *str, int n, int x, int y)
Draw a UTF-8 string of length n bytes right to left starting at the given x, y location.
Definition: fl_draw.H:974
uchar * fl_read_image(uchar *p, int X, int Y, int W, int H, int alpha=0)
Reads an RGB(A) image from the current window or off-screen buffer.
Definition: fl_read_image.cxx:40
double fl_transform_dx(double x, double y)
Transform distance using current transformation matrix.
Definition: fl_draw.H:760
void fl_end_loop()
End closed sequence of lines, and draw.
Definition: fl_draw.H:701
void fl_frame2(const char *s, int x, int y, int w, int h)
Draws a series of line segments around the given box.
Definition: fl_boxtype.cxx:144
void fl_scale(double x, double y)
Concatenate scaling transformation onto the current one.
Definition: fl_draw.H:545
void fl_rounded_rectf(int x, int y, int w, int h, int r)
Color with current color a rounded rectangle that exactly fills the given bounding box.
Definition: fl_draw.H:347
void fl_begin_polygon()
Start drawing a convex filled polygon.
Definition: fl_draw.H:612
void fl_draw_circle(int x, int y, int d, Fl_Color color)
Draw a potentially small, filled circle using a given color.
Definition: fl_draw.cxx:726
void fl_rect(int x, int y, int w, int h)
Draw a border inside the given bounding box.
Definition: fl_draw.H:298
void fl_cursor(Fl_Cursor)
Sets the cursor for the current window to the specified shape and colors.
Definition: fl_cursor.cxx:41
int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H)
Intersect a rectangle with the current clip region and return the bounding box of the result.
Definition: fl_draw.H:178
void fl_line_style(int style, int width=0, char *dashes=0)
Set how to draw lines (the "pen").
Definition: fl_draw.H:252
void fl_delete_offscreen(Fl_Offscreen bitmap)
Deletion of an offscreen graphics buffer.
Definition: Fl_Image_Surface.cxx:316
void fl_pop_clip()
Restore the previous clip region.
Definition: fl_draw.H:115
int fl_add_symbol(const char *name, void(*drawit)(Fl_Color), int scalable)
Adds a symbol to the system.
Definition: fl_symbols.cxx:76
void fl_loop(int x, int y, int x1, int y1, int x2, int y2)
Outline a 3-sided polygon with lines.
Definition: fl_draw.H:411
void fl_yxline(int x, int y, int y1)
Draw a vertical line from (x,y) to (x,y1)
Definition: fl_draw.H:460
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2)
Fill a 3-sided polygon.
Definition: fl_draw.H:425
void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy)
Copy a rectangular area of the given offscreen buffer into the current drawing destination.
Definition: fl_draw.H:784
char fl_can_do_alpha_blending()
Check whether platform supports true alpha blending for RGBA images.
Definition: fl_draw.H:1145
void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win=0)
Inform text input methods about the current text insertion cursor.
Definition: fl_font.cxx:53
void fl_end_line()
End list of lines, and draw.
Definition: fl_draw.H:695
unsigned int fl_old_shortcut(const char *s)
Emulation of XForms named shortcuts.
Definition: fl_shortcut.cxx:275
void fl_draw_check(Fl_Rect bb, Fl_Color col)
Draw a check mark inside the given bounding box.
Definition: fl_draw.cxx:620
void fl_draw_box_focus(Fl_Boxtype, int x, int y, int w, int h, Fl_Color, Fl_Color)
Draws the focus rectangle inside a box using given type, position, size and color.
Definition: fl_boxtype.cxx:480
void fl_pop_matrix()
Restore the current transformation matrix from the stack.
Definition: fl_draw.H:538
int fl_draw_pixmap(const char *const *data, int x, int y, Fl_Color bg=FL_GRAY)
Draw XPM image data, with the top-left corner at the given position.
Definition: fl_draw_pixmap.cxx:184
void fl_clip_region(Fl_Region r)
Replace the top of the clipping stack with a clipping region of any shape.
Definition: fl_draw.H:196
void fl_rotate(double d)
Concatenate rotation transformation onto the current one.
Definition: fl_draw.H:566
void fl_pie(int x, int y, int w, int h, double a1, double a2)
Draw filled ellipse sections using integer coordinates.
Definition: fl_draw.H:521
void fl_mult_matrix(double a, double b, double c, double d, double x, double y)
Concatenate another transformation onto the current one.
Definition: fl_draw.H:588
void fl_restore_scale(float s)
Restores the GUI scaling factor and the clipping region in subsequent drawing operations.
Definition: fl_draw.cxx:594
double fl_transform_x(double x, double y)
Transform coordinate using the current transformation matrix.
Definition: fl_draw.H:746
void fl_push_clip(int x, int y, int w, int h)
Intersect the current clip region with a rectangle and push this new region onto the stack.
Definition: fl_draw.H:88
void fl_measure(const char *str, int &x, int &y, int draw_symbols=1)
Measure how wide and tall the string will be when printed by the fl_draw() function with align parame...
Definition: fl_draw.cxx:487
void fl_end_offscreen(void)
Quit sending drawing commands to the current offscreen buffer.
Definition: Fl_Image_Surface.cxx:342
void fl_circle(double x, double y, double r)
fl_circle(x,y,r) is equivalent to fl_arc(x,y,r,0,360), but may be faster.
Definition: fl_draw.H:683
void fl_push_matrix()
Save the current transformation matrix on the stack.
Definition: fl_draw.H:532
void fl_reset_spot(void)
Resets marked text.
Definition: fl_font.cxx:58
void fl_end_complex_polygon()
End complex filled polygon, and draw.
Definition: fl_draw.H:738
void fl_xyline(int x, int y, int x1)
Draw a horizontal line from (x,y) to (x1,y).
Definition: fl_draw.H:439
void fl_end_polygon()
End convex filled polygon, and draw.
Definition: fl_draw.H:707
void fl_rounded_rect(int x, int y, int w, int h, int r)
Draw a rounded border inside the given bounding box.
Definition: fl_draw.H:307
void fl_draw_arrow(Fl_Rect bb, Fl_Arrow_Type t, Fl_Orientation o, Fl_Color color)
Draw an "arrow like" GUI element for the selected scheme.
Definition: fl_draw_arrow.cxx:227
void fl_chord(int x, int y, int w, int h, double a1, double a2)
fl_chord declaration is a place holder - the function does not yet exist
float fl_override_scale()
Removes any GUI scaling factor in subsequent drawing operations.
Definition: fl_draw.cxx:588
void fl_overlay_rect(int x, int y, int w, int h)
Draw a transient dotted selection rectangle.
Definition: fl_overlay.cxx:135
void fl_begin_line()
Start drawing a list of lines.
Definition: fl_draw.H:600
void fl_load_matrix(double a, double b, double c, double d, double x, double y)
Set the current transformation matrix.
Definition: fl_draw.H:579
void fl_frame(const char *s, int x, int y, int w, int h)
Draws a series of line segments around the given box.
Definition: fl_boxtype.cxx:110
void fl_line(int x, int y, int x1, int y1)
Draw a line from (x,y) to (x1,y1)
Definition: fl_draw.H:397
int fl_draw_symbol(const char *label, int x, int y, int w, int h, Fl_Color)
Draw the named symbol in the given rectangle using the given color.
Definition: fl_symbols.cxx:101
double fl_transform_y(double x, double y)
Transform coordinate using the current transformation matrix.
Definition: fl_draw.H:753
void fl_end_points()
End list of points, and draw.
Definition: fl_draw.H:689
void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color)
Draws a box using given type, position, size and color.
Definition: fl_boxtype.cxx:468
void fl_restore_clip()
Undo any clobbering of the clip region done by your program.
Definition: fl_draw.H:183
void fl_draw_image(const uchar *buf, int X, int Y, int W, int H, int D=3, int L=0)
Draw an 8-bit per color RGB or luminance image.
Definition: fl_draw.H:1081
void fl_load_identity()
Set the transformation matrix to identity.
Definition: fl_draw.H:572
void fl_draw_image_mono(const uchar *buf, int X, int Y, int W, int H, int D=1, int L=0)
Draw a gray-scale (1 channel) image.
Definition: fl_draw.H:1089
@ FL_DASH
line style: 75% dashed line
Definition: fl_draw.H:263
@ FL_CAP_FLAT
cap style: end is flat
Definition: fl_draw.H:268
@ FL_JOIN_ROUND
join style: line join is rounded
Definition: fl_draw.H:273
@ FL_JOIN_BEVEL
join style: line join is tidied
Definition: fl_draw.H:274
@ FL_JOIN_MITER
join style: line join extends to a point
Definition: fl_draw.H:272
@ FL_CAP_SQUARE
cap style: end wraps end point
Definition: fl_draw.H:270
@ FL_DOT
line style: 50% pixel dotted
Definition: fl_draw.H:264
@ FL_DASHDOTDOT
line style: dash / two dot pattern
Definition: fl_draw.H:266
@ FL_SOLID
line style: solid line
Definition: fl_draw.H:262
@ FL_DASHDOT
line style: dash / dot pattern
Definition: fl_draw.H:265
@ FL_CAP_ROUND
cap style: end is round
Definition: fl_draw.H:269
opaque Fl_Offscreen
Platform-specific value representing an offscreen drawing buffer.
Definition: platform_types.h:46
struct opaque * Fl_Region
Pointer to a platform-specific structure representing a collection of rectangles.
Definition: platform_types.h:56