FLTK 1.4.4

Loading...
Searching...
No Matches
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
21
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...
30 class Fl_Image;
31 class Fl_Window;
32
33// Label flags...
34FL_EXPORT extern char fl_draw_shortcut;
35
39
40// Colors:
50 inline void fl_color(Fl_Color c) {
51 fl_graphics_driver->color(c);
52} // select indexed color
53
54 inline void fl_color(int c) {
55 fl_color((Fl_Color)c);
56}
57
67 inline void fl_color(uchar r, uchar g, uchar b) {
68 fl_graphics_driver->color(r, g, b);
69}
70
74 inline Fl_Color fl_color() {
75 return fl_graphics_driver->color();
76}
77
78
82// clip:
88 inline void fl_push_clip(int x, int y, int w, int h) {
89 fl_graphics_driver->push_clip(x, y, w, h);
90}
91
99 inline void fl_clip(int x, int y, int w, int h) {
100 fl_graphics_driver->push_clip(x, y, w, h);
101}
102
105 inline void fl_push_no_clip() {
106 fl_graphics_driver->push_no_clip();
107}
108
115 inline void fl_pop_clip() {
116 fl_graphics_driver->pop_clip();
117}
118
132 inline 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
178 inline 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
183 inline void fl_restore_clip() {
184 fl_graphics_driver->restore_clip();
185}
186
196 inline void fl_clip_region(Fl_Region r) {
197 fl_graphics_driver->clip_region(r);
198}
199
206 inline Fl_Region fl_clip_region() {
207 return fl_graphics_driver->clip_region();
208}
209
210
211// points:
215 inline void fl_point(int x, int y) {
216 fl_graphics_driver->point(x, y);
217}
218
219// line type:
252 inline void fl_line_style(int style, int width = 0, char *dashes = 0) {
253 fl_graphics_driver->line_style(style, width, dashes);
254}
255
261 enum {
262 FL_SOLID = 0,
263 FL_DASH = 1,
264 FL_DOT = 2,
265 FL_DASHDOT = 3,
266 FL_DASHDOTDOT = 4,
267
268 FL_CAP_FLAT = 0x100,
269 FL_CAP_ROUND = 0x200,
270 FL_CAP_SQUARE = 0x300,
271
272 FL_JOIN_MITER = 0x1000,
273 FL_JOIN_ROUND = 0x2000,
274 FL_JOIN_BEVEL = 0x3000
275};
276
282 inline void fl_antialias(int state) {
283 fl_graphics_driver->antialias(state);
284}
285
287 inline int fl_antialias() {
288 return fl_graphics_driver->antialias();
289}
290
291// rectangles tweaked to exactly fill the pixel rectangle:
292
298 inline void fl_rect(int x, int y, int w, int h) {
299 fl_graphics_driver->rect(x, y, w, h);
300}
301
307 inline 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
316 inline void fl_rect(Fl_Rect r) {
317 fl_rect(r.x(), r.y(), r.w(), r.h());
318}
319
326 inline void fl_focus_rect(int x, int y, int w, int h) {
327 fl_graphics_driver->focus_rect(x, y, w, h);
328}
329
333 inline 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
339 inline void fl_rectf(int x, int y, int w, int h) {
340 fl_graphics_driver->rectf(x, y, w, h);
341}
342
347 inline 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
354 inline 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
360 inline void fl_rectf(Fl_Rect r) {
361 fl_graphics_driver->rectf(r.x(), r.y(), r.w(), r.h());
362}
363
367 inline void fl_rectf(Fl_Rect r, Fl_Color c) {
368 fl_color(c);
369 fl_rectf(r);
370}
371
379 inline 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
389 inline 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:
397 inline void fl_line(int x, int y, int x1, int y1) {
398 fl_graphics_driver->line(x, y, x1, y1);
399}
400
403 inline 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:
411 inline 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}
414
417 inline 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
425 inline 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}
428
431 inline 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:
439 inline void fl_xyline(int x, int y, int x1) {
440 fl_graphics_driver->xyline(x, y, x1);
441}
442
445 inline void fl_xyline(int x, int y, int x1, int y2) {
446 fl_graphics_driver->xyline(x, y, x1, y2);
447}
448
452 inline 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:
460 inline void fl_yxline(int x, int y, int y1) {
461 fl_graphics_driver->yxline(x, y, y1);
462}
463
466 inline void fl_yxline(int x, int y, int y1, int x2) {
467 fl_graphics_driver->yxline(x, y, y1, x2);
468}
469
473 inline 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):
503 inline 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}
506
521 inline 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}
524
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):
532 inline void fl_push_matrix() {
533 fl_graphics_driver->push_matrix();
534}
535
538 inline void fl_pop_matrix() {
539 fl_graphics_driver->pop_matrix();
540}
541
545 inline void fl_scale(double x, double y) {
546 fl_graphics_driver->mult_matrix(x, 0, 0, y, 0, 0);
547}
548
552 inline void fl_scale(double x) {
553 fl_graphics_driver->mult_matrix(x, 0, 0, x, 0, 0);
554}
555
559 inline void fl_translate(double x, double y) {
560 fl_graphics_driver->translate(x, y);
561}
562
566 inline void fl_rotate(double d) {
567 fl_graphics_driver->rotate(d);
568}
569
572 inline void fl_load_identity() {
573 fl_graphics_driver->load_identity();
574}
575
579 inline 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}
582
588 inline 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}
591
594 inline void fl_begin_points() {
595 fl_graphics_driver->begin_points();
596}
597
600 inline void fl_begin_line() {
601 fl_graphics_driver->begin_line();
602}
603
606 inline void fl_begin_loop() {
607 fl_graphics_driver->begin_loop();
608}
609
612 inline void fl_begin_polygon() {
613 fl_graphics_driver->begin_polygon();
614}
615
619 inline void fl_vertex(double x, double y) {
620 fl_graphics_driver->vertex(x, y);
621}
622
630 inline 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}
633
668 inline void fl_arc(double x, double y, double r, double start, double end) {
669 fl_graphics_driver->arc(x, y, r, start, end);
670}
671
683 inline void fl_circle(double x, double y, double r) {
684 fl_graphics_driver->circle(x, y, r);
685}
686
689 inline void fl_end_points() {
690 fl_graphics_driver->end_points();
691}
692
695 inline void fl_end_line() {
696 fl_graphics_driver->end_line();
697}
698
701 inline void fl_end_loop() {
702 fl_graphics_driver->end_loop();
703}
704
707 inline void fl_end_polygon() {
708 fl_graphics_driver->end_polygon();
709}
710
723 inline void fl_begin_complex_polygon() {
724 fl_graphics_driver->begin_complex_polygon();
725}
726
732 inline void fl_gap() {
733 fl_graphics_driver->gap();
734}
735
738 inline void fl_end_complex_polygon() {
739 fl_graphics_driver->end_complex_polygon();
740}
741// get and use transformed positions:
746 inline double fl_transform_x(double x, double y) {
747 return fl_graphics_driver->transform_x(x, y);
748}
749
753 inline double fl_transform_y(double x, double y) {
754 return fl_graphics_driver->transform_y(x, y);
755}
756
760 inline double fl_transform_dx(double x, double y) {
761 return fl_graphics_driver->transform_dx(x, y);
762}
763
767 inline double fl_transform_dy(double x, double y) {
768 return fl_graphics_driver->transform_dy(x, y);
769}
770
774 inline void fl_transformed_vertex(double xf, double yf) {
775 fl_graphics_driver->transformed_vertex(xf, yf);
776}
777
784 inline 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
795
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
811 inline Fl_Font fl_font() {
812 return fl_graphics_driver->font();
813}
814
818 inline Fl_Fontsize fl_size() {
819 return fl_graphics_driver->size();
820}
821
822// Information you can get about the current font:
827 inline int fl_height() {
828 return fl_graphics_driver->height();
829}
830FL_EXPORT int fl_height(int font, int size);
835 inline int fl_descent() {
836 return fl_graphics_driver->descent();
837}
838
841FL_EXPORT double fl_width(const char *txt);
842
846 inline double fl_width(const char *txt, int n) {
847 return fl_graphics_driver->width(txt, n);
848}
849
855 inline double fl_width(unsigned int c) {
856 return fl_graphics_driver->width(c);
857}
858
883FL_EXPORT void fl_text_extents(const char *, int &dx, int &dy, int &w, int &h);
884
891 inline 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);
926
929
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);
956 inline void fl_draw(const char *str, int n, int x, int y) {
957 fl_graphics_driver->draw(str, n, x, y);
958}
959
968 inline 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}
971
974 inline 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.
1032 void fl_draw_check(Fl_Rect bb, Fl_Color col);
1033
1034// Draw one or more "arrows" (triangles)
1035FL_EXPORT void fl_draw_arrow(Fl_Rect bb, Fl_Arrow_Type t, Fl_Orientation o, Fl_Color color);
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
1081 inline 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_general_(buf, X, Y, W, H, D, L);
1083}
1084
1089 inline 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_general_(buf, X, Y, W, H, D, L);
1091}
1092
1128 inline 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
1136 inline 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
1145 inline char fl_can_do_alpha_blending() {
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 *cdata, int x, int y, Fl_Color bg = FL_GRAY);
1169 inline 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);
1216
1217#endif
Enumerations.H
This file contains type definitions and general enumerations.
Fl_Font
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:1063
Fl_Arrow_Type
Fl_Arrow_Type
Arrow types define the type of arrow drawing function.
Definition Enumerations.H:1364
Fl_Align
unsigned Fl_Align
FLTK type for alignment control.
Definition Enumerations.H:986
Fl_Cursor
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition Enumerations.H:1283
Fl_Color
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition Enumerations.H:1120
Fl_Fontsize
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:1092
Fl_Boxtype
Fl_Boxtype
FLTK standard box types.
Definition Enumerations.H:644
Fl_Orientation
Fl_Orientation
Fl_Orientation describes the orientation of a GUI element.
Definition Enumerations.H:1393
fl_graphics_driver
Fl_Graphics_Driver * fl_graphics_driver
Points to the driver that currently receives all graphics requests.
Definition Fl_Graphics_Driver.cxx:23
Fl_Group::end
void end()
Exactly the same as current(this->parent()).
Definition Fl_Group.cxx:73
Fl_Image
Base class for image caching, scaling and drawing.
Definition Fl_Image.H:60
Fl_RGB_Image
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
Fl_Rect
Rectangle with standard FLTK coordinates (X, Y, W, H).
Definition Fl_Rect.H:30
Fl_Rect::y
int y() const
gets the y coordinate (top edge)
Definition Fl_Rect.H:73
Fl_Rect::w
int w() const
gets the width
Definition Fl_Rect.H:74
Fl_Rect::h
int h() const
gets the height
Definition Fl_Rect.H:75
Fl_Rect::x
int x() const
gets the x coordinate (left edge)
Definition Fl_Rect.H:72
Fl_Widget::align
Fl_Align align() const
Gets the label alignment.
Definition Fl_Widget.H:425
Fl_Widget::size
void size(int W, int H)
Changes the size of the widget.
Definition Fl_Widget.H:418
Fl_Window
This widget produces an actual window.
Definition Fl_Window.H:55
Fl_Window::label
const char * label() const
See void Fl_Window::label(const char*)
Definition Fl_Window.H:367
uchar
unsigned char uchar
unsigned char
Definition fl_types.h:30
fl_descent
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
fl_local_to_mac_roman
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_size
Fl_Fontsize fl_size()
Return the size set by the most recent call to fl_font().
Definition fl_draw.H:818
fl_text_extents
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
fl_width
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
fl_latin1_to_local
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
fl_local_to_latin1
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
fl_height
int fl_height()
Return the recommended minimum line spacing for the current font.
Definition fl_draw.H:827
fl_font
Fl_Font fl_font()
Return the face set by the most recent call to fl_font().
Definition fl_draw.H:811
fl_mac_roman_to_local
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
fl_color
Fl_Color fl_color()
Return the last fl_color() that was set.
Definition fl_draw.H:74
fl_draw_radio
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
fl_set_status
void fl_set_status(int X, int Y, int W, int H)
Related to text input methods under X11.
Definition fl_font.cxx:68
fl_push_no_clip
void fl_push_no_clip()
Push an empty clip region onto the stack so nothing will be clipped.
Definition fl_draw.H:105
fl_begin_complex_polygon
void fl_begin_complex_polygon()
Start drawing a complex filled polygon.
Definition fl_draw.H:723
fl_vertex
void fl_vertex(double x, double y)
Add a single vertex to the current path.
Definition fl_draw.H:619
fl_begin_offscreen
void fl_begin_offscreen(Fl_Offscreen b)
Send all subsequent drawing commands to this offscreen buffer.
Definition Fl_Image_Surface.cxx:331
fl_capture_window
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
fl_measure_pixmap
int fl_measure_pixmap(char *const *data, int &w, int &h)
Get the dimensions of a pixmap.
Definition fl_draw_pixmap.cxx:57
fl_clip
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
fl_expand_text
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
fl_point
void fl_point(int x, int y)
Draw a single pixel at the given coordinates.
Definition fl_draw.H:215
fl_create_offscreen
Fl_Offscreen fl_create_offscreen(int w, int h)
Creation of an offscreen graphics buffer.
Definition Fl_Image_Surface.cxx:306
fl_clip_region
Fl_Region fl_clip_region()
Return the current clipping region.
Definition fl_draw.H:206
fl_gap
void fl_gap()
Separate loops of the path.
Definition fl_draw.H:732
fl_rectf
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
fl_not_clipped
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
fl_translate
void fl_translate(double x, double y)
Concatenate translation transformation onto the current one.
Definition fl_draw.H:559
fl_overlay_clear
void fl_overlay_clear()
Erase a selection rectangle without drawing a new one.
Definition fl_overlay.cxx:82
fl_begin_points
void fl_begin_points()
Start drawing a list of points.
Definition fl_draw.H:594
fl_transform_dy
double fl_transform_dy(double x, double y)
Transform distance using current transformation matrix.
Definition fl_draw.H:767
fl_arc
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
fl_begin_loop
void fl_begin_loop()
Start drawing a closed sequence of lines.
Definition fl_draw.H:606
fl_rescale_offscreen
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
fl_transformed_vertex
void fl_transformed_vertex(double xf, double yf)
Add coordinate pair to the vertex list without further transformations.
Definition fl_draw.H:774
fl_scroll
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:42
fl_draw
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
fl_shortcut_label
const char * fl_shortcut_label(unsigned int shortcut)
Get a human-readable string from a shortcut value.
Definition fl_shortcut.cxx:131
fl_curve
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
fl_focus_rect
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
fl_rtl_draw
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
fl_read_image
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
fl_transform_dx
double fl_transform_dx(double x, double y)
Transform distance using current transformation matrix.
Definition fl_draw.H:760
fl_end_loop
void fl_end_loop()
End closed sequence of lines, and draw.
Definition fl_draw.H:701
fl_frame2
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
fl_scale
void fl_scale(double x, double y)
Concatenate scaling transformation onto the current one.
Definition fl_draw.H:545
fl_draw_pixmap
int fl_draw_pixmap(const char *const *cdata, 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
fl_rounded_rectf
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
fl_begin_polygon
void fl_begin_polygon()
Start drawing a convex filled polygon.
Definition fl_draw.H:612
fl_draw_circle
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
fl_rect
void fl_rect(int x, int y, int w, int h)
Draw a border inside the given bounding box.
Definition fl_draw.H:298
fl_cursor
void fl_cursor(Fl_Cursor)
Sets the cursor for the current window to the specified shape and colors.
Definition fl_cursor.cxx:41
fl_clip_box
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
fl_line_style
void fl_line_style(int style, int width=0, char *dashes=0)
Set how to draw lines (the "pen").
Definition fl_draw.H:252
fl_delete_offscreen
void fl_delete_offscreen(Fl_Offscreen bitmap)
Deletion of an offscreen graphics buffer.
Definition Fl_Image_Surface.cxx:316
fl_pop_clip
void fl_pop_clip()
Restore the previous clip region.
Definition fl_draw.H:115
fl_add_symbol
int fl_add_symbol(const char *name, void(*drawit)(Fl_Color), int scalable)
Adds a symbol to the system.
Definition fl_symbols.cxx:76
fl_loop
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
fl_yxline
void fl_yxline(int x, int y, int y1)
Draw a vertical line from (x,y) to (x,y1)
Definition fl_draw.H:460
fl_polygon
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
fl_copy_offscreen
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
fl_can_do_alpha_blending
char fl_can_do_alpha_blending()
Check whether platform supports true alpha blending for RGBA images.
Definition fl_draw.H:1145
fl_set_spot
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
fl_end_line
void fl_end_line()
End list of lines, and draw.
Definition fl_draw.H:695
fl_old_shortcut
unsigned int fl_old_shortcut(const char *s)
Emulation of XForms named shortcuts.
Definition fl_shortcut.cxx:275
fl_draw_check
void fl_draw_check(Fl_Rect bb, Fl_Color col)
Draw a check mark inside the given bounding box.
Definition fl_draw.cxx:620
fl_draw_box_focus
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:483
fl_pop_matrix
void fl_pop_matrix()
Restore the current transformation matrix from the stack.
Definition fl_draw.H:538
fl_rotate
void fl_rotate(double d)
Concatenate rotation transformation onto the current one.
Definition fl_draw.H:566
fl_pie
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
fl_mult_matrix
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
fl_restore_scale
void fl_restore_scale(float s)
Restores the GUI scaling factor in subsequent drawing operations.
Definition fl_draw.cxx:594
fl_transform_x
double fl_transform_x(double x, double y)
Transform coordinate using the current transformation matrix.
Definition fl_draw.H:746
fl_push_clip
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
fl_measure
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
fl_end_offscreen
void fl_end_offscreen(void)
Quit sending drawing commands to the current offscreen buffer.
Definition Fl_Image_Surface.cxx:342
fl_circle
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
fl_push_matrix
void fl_push_matrix()
Save the current transformation matrix on the stack.
Definition fl_draw.H:532
fl_reset_spot
void fl_reset_spot(void)
Resets marked text.
Definition fl_font.cxx:58
fl_end_complex_polygon
void fl_end_complex_polygon()
End complex filled polygon, and draw.
Definition fl_draw.H:738
fl_xyline
void fl_xyline(int x, int y, int x1)
Draw a horizontal line from (x,y) to (x1,y).
Definition fl_draw.H:439
fl_end_polygon
void fl_end_polygon()
End convex filled polygon, and draw.
Definition fl_draw.H:707
fl_rounded_rect
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
fl_draw_arrow
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:242
fl_chord
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
fl_override_scale
float fl_override_scale()
Removes any GUI scaling factor in subsequent drawing operations.
Definition fl_draw.cxx:588
fl_overlay_rect
void fl_overlay_rect(int x, int y, int w, int h)
Draw a transient dotted selection rectangle.
Definition fl_overlay.cxx:135
fl_begin_line
void fl_begin_line()
Start drawing a list of lines.
Definition fl_draw.H:600
fl_load_matrix
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
fl_frame
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
fl_antialias
int fl_antialias()
Return whether line drawings are currently antialiased.
Definition fl_draw.H:287
fl_line
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
fl_draw_symbol
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
fl_transform_y
double fl_transform_y(double x, double y)
Transform coordinate using the current transformation matrix.
Definition fl_draw.H:753
fl_end_points
void fl_end_points()
End list of points, and draw.
Definition fl_draw.H:689
fl_draw_box
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:471
fl_restore_clip
void fl_restore_clip()
Undo any clobbering of the clip region done by your program.
Definition fl_draw.H:183
fl_draw_image
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
fl_load_identity
void fl_load_identity()
Set the transformation matrix to identity.
Definition fl_draw.H:572
fl_draw_image_mono
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
@ FL_DASH
line style: 75% dashed line
Definition fl_draw.H:263
FL_CAP_FLAT
@ FL_CAP_FLAT
cap style: end is flat
Definition fl_draw.H:268
FL_JOIN_ROUND
@ FL_JOIN_ROUND
join style: line join is rounded
Definition fl_draw.H:273
FL_JOIN_BEVEL
@ FL_JOIN_BEVEL
join style: line join is tidied
Definition fl_draw.H:274
FL_JOIN_MITER
@ FL_JOIN_MITER
join style: line join extends to a point
Definition fl_draw.H:272
FL_CAP_SQUARE
@ FL_CAP_SQUARE
cap style: end wraps end point
Definition fl_draw.H:270
FL_DOT
@ FL_DOT
line style: 50% pixel dotted
Definition fl_draw.H:264
FL_DASHDOTDOT
@ FL_DASHDOTDOT
line style: dash / two dot pattern
Definition fl_draw.H:266
FL_SOLID
@ FL_SOLID
line style: solid line
Definition fl_draw.H:262
FL_DASHDOT
@ FL_DASHDOT
line style: dash / dot pattern
Definition fl_draw.H:265
FL_CAP_ROUND
@ FL_CAP_ROUND
cap style: end is round
Definition fl_draw.H:269
Fl_Offscreen
opaque Fl_Offscreen
Platform-specific value representing an offscreen drawing buffer.
Definition platform_types.h:46
Fl_Region
struct opaque * Fl_Region
Pointer to a platform-specific structure representing a collection of rectangles.
Definition platform_types.h:56