FLTK 1.4.0
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
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:
249inline void fl_line_style(int style, int width = 0, char *dashes = 0) {
250 fl_graphics_driver->line_style(style, width, dashes);
251}
252enum {
255 FL_DOT = 2,
258
259 FL_CAP_FLAT = 0x100,
260 FL_CAP_ROUND = 0x200,
262
263 FL_JOIN_MITER = 0x1000,
264 FL_JOIN_ROUND = 0x2000,
265 FL_JOIN_BEVEL = 0x3000
267
273inline void fl_antialias(int state) {
274 fl_graphics_driver->antialias(state);
275}
276
278inline int fl_antialias() {
279 return fl_graphics_driver->antialias();
280}
281
282// rectangles tweaked to exactly fill the pixel rectangle:
283
289inline void fl_rect(int x, int y, int w, int h) {
290 fl_graphics_driver->rect(x, y, w, h);
291}
292
298inline void fl_rounded_rect(int x, int y, int w, int h, int r) {
299 fl_graphics_driver->rounded_rect(x, y, w, h, r);
300}
301
307inline void fl_rect(Fl_Rect r) {
308 fl_rect(r.x(), r.y(), r.w(), r.h());
309}
310
317inline void fl_focus_rect(int x, int y, int w, int h) {
318 fl_graphics_driver->focus_rect(x, y, w, h);
319}
320
324inline void fl_rect(int x, int y, int w, int h, Fl_Color c) {
325 fl_color(c);
326 fl_rect(x, y, w, h);
327}
328
330inline void fl_rectf(int x, int y, int w, int h) {
331 fl_graphics_driver->rectf(x, y, w, h);
332}
333
338inline void fl_rounded_rectf(int x, int y, int w, int h, int r) {
339 fl_graphics_driver->rounded_rectf(x, y, w, h, r);
340}
341
345inline void fl_rectf(int x, int y, int w, int h, Fl_Color c) {
346 fl_color(c);
347 fl_rectf(x, y, w, h);
348}
349
351inline void fl_rectf(Fl_Rect r) {
352 fl_graphics_driver->rectf(r.x(), r.y(), r.w(), r.h());
353}
354
358inline void fl_rectf(Fl_Rect r, Fl_Color c) {
359 fl_color(c);
360 fl_rectf(r);
361}
362
370inline void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
371 fl_graphics_driver->colored_rectf(x, y, w, h, r, g, b);
372}
373
380inline void fl_rectf(Fl_Rect bb, uchar r, uchar g, uchar b) {
381 fl_graphics_driver->colored_rectf(bb.x(), bb.y(), bb.w(), bb.h(), r, g, b);
382}
383
384// line segments:
388inline void fl_line(int x, int y, int x1, int y1) {
389 fl_graphics_driver->line(x, y, x1, y1);
390}
394inline void fl_line(int x, int y, int x1, int y1, int x2, int y2) {
395 fl_graphics_driver->line(x, y, x1, y1, x2, y2);
396}
397
398// closed line segments:
402inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2) {
403 fl_graphics_driver->loop(x, y, x1, y1, x2, y2);
404}
408inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
409 fl_graphics_driver->loop(x, y, x1, y1, x2, y2, x3, y3);
410}
411
412// filled polygons
416inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {
417 fl_graphics_driver->polygon(x, y, x1, y1, x2, y2);
418}
422inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3) {
423 fl_graphics_driver->polygon(x, y, x1, y1, x2, y2, x3, y3);
424}
425
426// draw rectilinear lines, horizontal segment first:
430inline void fl_xyline(int x, int y, int x1) {
431 fl_graphics_driver->xyline(x, y, x1);
432}
436inline void fl_xyline(int x, int y, int x1, int y2) {
437 fl_graphics_driver->xyline(x, y, x1, y2);
438}
443inline void fl_xyline(int x, int y, int x1, int y2, int x3) {
444 fl_graphics_driver->xyline(x, y, x1, y2, x3);
445}
446
447// draw rectilinear lines, vertical segment first:
451inline void fl_yxline(int x, int y, int y1) {
452 fl_graphics_driver->yxline(x, y, y1);
453}
457inline void fl_yxline(int x, int y, int y1, int x2) {
458 fl_graphics_driver->yxline(x, y, y1, x2);
459}
464inline void fl_yxline(int x, int y, int y1, int x2, int y3) {
465 fl_graphics_driver->yxline(x, y, y1, x2, y3);
466}
467
468// circular lines and pie slices (code in fl_arci.C):
494inline void fl_arc(int x, int y, int w, int h, double a1, double a2) {
495 fl_graphics_driver->arc(x, y, w, h, a1, a2);
496}
512inline void fl_pie(int x, int y, int w, int h, double a1, double a2) {
513 fl_graphics_driver->pie(x, y, w, h, a1, a2);
514}
516FL_EXPORT void fl_chord(int x, int y, int w, int h, double a1, double a2); // nyi
517
518// scalable drawing code (code in fl_vertex.cxx and fl_arc.cxx):
523inline void fl_push_matrix() {
524 fl_graphics_driver->push_matrix();
525}
529inline void fl_pop_matrix() {
530 fl_graphics_driver->pop_matrix();
531}
536inline void fl_scale(double x, double y) {
537 fl_graphics_driver->mult_matrix(x, 0, 0, y, 0, 0);
538}
543inline void fl_scale(double x) {
544 fl_graphics_driver->mult_matrix(x, 0, 0, x, 0, 0);
545}
550inline void fl_translate(double x, double y) {
551 fl_graphics_driver->translate(x, y);
552}
557inline void fl_rotate(double d) {
558 fl_graphics_driver->rotate(d);
559}
563inline void fl_load_identity() {
564 fl_graphics_driver->load_identity();
565}
570inline void fl_load_matrix(double a, double b, double c, double d, double x, double y) {
571 fl_graphics_driver->load_matrix(a, b, c, d, x, y);
572}
579inline void fl_mult_matrix(double a, double b, double c, double d, double x, double y) {
580 fl_graphics_driver->mult_matrix(a, b, c, d, x, y);
581}
585inline void fl_begin_points() {
586 fl_graphics_driver->begin_points();
587}
591inline void fl_begin_line() {
592 fl_graphics_driver->begin_line();
593}
597inline void fl_begin_loop() {
598 fl_graphics_driver->begin_loop();
599}
603inline void fl_begin_polygon() {
604 fl_graphics_driver->begin_polygon();
605}
610inline void fl_vertex(double x, double y) {
611 fl_graphics_driver->vertex(x, y);
612}
621inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3) {
622 fl_graphics_driver->curve(X0, Y0, X1, Y1, X2, Y2, X3, Y3);
623}
653inline void fl_arc(double x, double y, double r, double start, double end) {
654 fl_graphics_driver->arc(x, y, r, start, end);
655}
668inline void fl_circle(double x, double y, double r) {
669 fl_graphics_driver->circle(x, y, r);
670}
674inline void fl_end_points() {
675 fl_graphics_driver->end_points();
676}
680inline void fl_end_line() {
681 fl_graphics_driver->end_line();
682}
686inline void fl_end_loop() {
687 fl_graphics_driver->end_loop();
688}
692inline void fl_end_polygon() {
693 fl_graphics_driver->end_polygon();
694}
709 fl_graphics_driver->begin_complex_polygon();
710}
717inline void fl_gap() {
718 fl_graphics_driver->gap();
719}
724 fl_graphics_driver->end_complex_polygon();
725}
726// get and use transformed positions:
731inline double fl_transform_x(double x, double y) {
732 return fl_graphics_driver->transform_x(x, y);
733}
738inline double fl_transform_y(double x, double y) {
739 return fl_graphics_driver->transform_y(x, y);
740}
745inline double fl_transform_dx(double x, double y) {
746 return fl_graphics_driver->transform_dx(x, y);
747}
752inline double fl_transform_dy(double x, double y) {
753 return fl_graphics_driver->transform_dy(x, y);
754}
759inline void fl_transformed_vertex(double xf, double yf) {
760 fl_graphics_driver->transformed_vertex(xf, yf);
761}
762
769inline void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) {
770 fl_graphics_driver->copy_offscreen(x, y, w, h, pixmap, srcx, srcy);
771}
772
773FL_EXPORT Fl_Offscreen fl_create_offscreen(int w, int h);
774FL_EXPORT void fl_begin_offscreen(Fl_Offscreen b);
775FL_EXPORT void fl_end_offscreen(void);
776FL_EXPORT void fl_delete_offscreen(Fl_Offscreen bitmap);
777FL_EXPORT void fl_rescale_offscreen(Fl_Offscreen &ctx);
778
783/* NOTE: doxygen comments here to avoid triplication in os-specific sources */
784
785// Fonts:
786/*
787 Set the current font, which is then used in various drawing routines.
788 Implemented and documented in src/fl_draw.cxx
789*/
790FL_EXPORT void fl_font(Fl_Font face, Fl_Fontsize fsize);
791
796inline Fl_Font fl_font() {
797 return fl_graphics_driver->font();
798}
804 return fl_graphics_driver->size();
805}
806
807// Information you can get about the current font:
812inline int fl_height() {
813 return fl_graphics_driver->height();
814}
815FL_EXPORT int fl_height(int font, int size);
820inline int fl_descent() {
821 return fl_graphics_driver->descent();
822}
826FL_EXPORT double fl_width(const char *txt);
827
831inline double fl_width(const char *txt, int n) {
832 return fl_graphics_driver->width(txt, n);
833}
840inline double fl_width(unsigned int c) {
841 return fl_graphics_driver->width(c);
842}
868FL_EXPORT void fl_text_extents(const char *, int &dx, int &dy, int &w, int &h);
869
876inline void fl_text_extents(const char *t, int n, int &dx, int &dy, int &w, int &h) {
877 fl_graphics_driver->text_extents(t, n, dx, dy, w, h);
878}
879
880// font encoding:
881// Note: doxygen comments here to avoid duplication for os-specific cases
888FL_EXPORT const char *fl_latin1_to_local(const char *t, int n = -1);
895FL_EXPORT const char *fl_local_to_latin1(const char *t, int n = -1);
902FL_EXPORT const char *fl_mac_roman_to_local(const char *t, int n = -1);
909FL_EXPORT const char *fl_local_to_mac_roman(const char *t, int n = -1);
915FL_EXPORT float fl_override_scale();
916
917FL_EXPORT void fl_restore_scale(float s);
918
929FL_EXPORT void fl_draw(const char *str, int x, int y);
937FL_EXPORT void fl_draw(int angle, const char *str, int x, int y);
941inline void fl_draw(const char *str, int n, int x, int y) {
942 fl_graphics_driver->draw(str, n, x, y);
943}
953inline void fl_draw(int angle, const char *str, int n, int x, int y) {
954 fl_graphics_driver->draw(angle, str, n, x, y);
955}
959inline void fl_rtl_draw(const char *str, int n, int x, int y) {
960 fl_graphics_driver->rtl_draw(str, n, x, y);
961}
962FL_EXPORT void fl_measure(const char *str, int &x, int &y, int draw_symbols = 1);
963FL_EXPORT void fl_draw(const char *str, int x, int y, int w, int h, Fl_Align align, Fl_Image *img = 0,
964 int draw_symbols = 1);
965FL_EXPORT void fl_draw(const char *str, int x, int y, int w, int h, Fl_Align align,
966 void (*callthis)(const char *, int, int, int), Fl_Image *img = 0, int draw_symbols = 1);
967
968// boxtypes:
969
970FL_EXPORT void fl_frame(const char *s, int x, int y, int w, int h);
971FL_EXPORT void fl_frame2(const char *s, int x, int y, int w, int h);
972FL_EXPORT void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color);
973
974// basic GUI objects (check marks, arrows, more to come ...):
975
976// Draw a check mark in the given color inside the bounding box bb.
977void fl_draw_check(Fl_Rect bb, Fl_Color col);
978
979// Draw one or more "arrows" (triangles)
981
982// Draw a potentially small, filled circle
983FL_EXPORT void fl_draw_circle(int x, int y, int d, Fl_Color color);
984
985// Draw the full "radio button" of a radio menu entry or radio button
986// This requires scheme specific handling (particularly gtk+ scheme)
987FL_EXPORT void fl_draw_radio(int x, int y, int d, Fl_Color color);
988
989// images:
990
1026inline void fl_draw_image(const uchar *buf, int X, int Y, int W, int H, int D = 3, int L = 0) {
1027 fl_graphics_driver->draw_image(buf, X, Y, W, H, D, L);
1028}
1029
1034inline void fl_draw_image_mono(const uchar *buf, int X, int Y, int W, int H, int D = 1, int L = 0) {
1035 fl_graphics_driver->draw_image_mono(buf, X, Y, W, H, D, L);
1036}
1037
1073inline void fl_draw_image(Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D = 3) {
1074 fl_graphics_driver->draw_image(cb, data, X, Y, W, H, D);
1075}
1076
1081inline void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D = 1) {
1082 fl_graphics_driver->draw_image_mono(cb, data, X, Y, W, H, D);
1083}
1084
1091 return Fl_Graphics_Driver::default_driver().can_do_alpha_blending();
1092}
1093
1094FL_EXPORT uchar *fl_read_image(uchar *p, int X, int Y, int W, int H, int alpha = 0);
1095FL_EXPORT Fl_RGB_Image *fl_capture_window(Fl_Window *win, int x, int y, int w, int h);
1096
1097// pixmaps:
1109FL_EXPORT int fl_draw_pixmap(const char *const *data, int x, int y, Fl_Color bg = FL_GRAY);
1114inline int fl_draw_pixmap(/*const*/ char *const *data, int x, int y, Fl_Color bg = FL_GRAY) {
1115 return fl_draw_pixmap((const char *const *)data, x, y, bg);
1116}
1117FL_EXPORT int fl_measure_pixmap(/*const*/ char *const *data, int &w, int &h);
1118FL_EXPORT int fl_measure_pixmap(const char *const *cdata, int &w, int &h);
1119
1120// other:
1121FL_EXPORT void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
1122 void (*draw_area)(void *, int, int, int, int), void *data);
1123FL_EXPORT const char *fl_shortcut_label(unsigned int shortcut);
1124FL_EXPORT const char *fl_shortcut_label(unsigned int shortcut, const char **eom);
1125FL_EXPORT unsigned int fl_old_shortcut(const char *s);
1126FL_EXPORT void fl_overlay_rect(int x, int y, int w, int h);
1127FL_EXPORT void fl_overlay_clear();
1128FL_EXPORT void fl_cursor(Fl_Cursor);
1129FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg, Fl_Color bg = FL_WHITE);
1130FL_EXPORT const char *fl_expand_text(const char *from, char *buf, int maxbuf, double maxw,
1131 int &n, double &width, int wrap, int draw_symbols = 0);
1132
1133// XIM:
1134FL_EXPORT void fl_set_status(int X, int Y, int W, int H);
1142FL_EXPORT void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win = 0);
1154FL_EXPORT void fl_reset_spot(void);
1155
1156
1157// XForms symbols:
1158FL_EXPORT int fl_draw_symbol(const char *label, int x, int y, int w, int h, Fl_Color);
1159FL_EXPORT int fl_add_symbol(const char *name, void (*drawit)(Fl_Color), int scalable);
1162#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:1044
Fl_Arrow_Type
Arrow types define the type of arrow drawing function.
Definition Enumerations.H:1342
unsigned Fl_Align
FLTK type for alignment control.
Definition Enumerations.H:967
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition Enumerations.H:1261
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition Enumerations.H:1101
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:1073
Fl_Boxtype
FLTK standard box types.
Definition Enumerations.H:626
Fl_Orientation
Fl_Orientation describes the orientation of a GUI element.
Definition Enumerations.H:1371
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:447
int y() const
Gets the widget position in its window.
Definition Fl_Widget.H:358
int h() const
Gets the widget height.
Definition Fl_Widget.H:368
Fl_Align align() const
Gets the label alignment.
Definition Fl_Widget.H:417
int w() const
Gets the widget width.
Definition Fl_Widget.H:363
void size(int W, int H)
Changes the size of the widget.
Definition Fl_Widget.H:410
int x() const
Gets the widget position in its window.
Definition Fl_Widget.H:353
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:351
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:820
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:803
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
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
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:812
Fl_Font fl_font()
Return the face set by the most recent call to fl_font().
Definition fl_draw.H:796
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()
Return the last fl_color() that was set.
Definition fl_draw.H:74
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:649
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:708
void fl_vertex(double x, double y)
Add a single vertex to the current path.
Definition fl_draw.H:610
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:56
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:129
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
Fl_Region fl_clip_region()
Return the current clipping region.
Definition fl_draw.H:206
void fl_gap()
Separate loops of the path.
Definition fl_draw.H:717
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:330
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:550
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:585
double fl_transform_dy(double x, double y)
Transform distance using current transformation matrix.
Definition fl_draw.H:752
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:494
void fl_begin_loop()
Start drawing a closed sequence of lines.
Definition fl_draw.H:597
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:759
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
const char * fl_shortcut_label(unsigned int shortcut)
Get a human-readable string from a shortcut value.
Definition fl_shortcut.cxx:130
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:621
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:317
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:959
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:745
void fl_end_loop()
End closed sequence of lines, and draw.
Definition fl_draw.H:686
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:536
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:338
void fl_begin_polygon()
Start drawing a convex filled polygon.
Definition fl_draw.H:603
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:614
void fl_rect(int x, int y, int w, int h)
Draw a border inside the given bounding box.
Definition fl_draw.H:289
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:249
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:402
void fl_yxline(int x, int y, int y1)
Draw a vertical line from (x,y) to (x,y1)
Definition fl_draw.H:451
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2)
Fill a 3-sided polygon.
Definition fl_draw.H:416
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:769
char fl_can_do_alpha_blending()
Check whether platform supports true alpha blending for RGBA images.
Definition fl_draw.H:1090
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:680
unsigned int fl_old_shortcut(const char *s)
Emulation of XForms named shortcuts.
Definition fl_shortcut.cxx:274
void fl_draw_check(Fl_Rect bb, Fl_Color col)
Draw a check mark inside the given bounding box.
Definition fl_draw.cxx:508
void fl_pop_matrix()
Restore the current transformation matrix from the stack.
Definition fl_draw.H:529
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:183
void fl_rotate(double d)
Concatenate rotation transformation onto the current one.
Definition fl_draw.H:557
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:512
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:579
void fl_restore_scale(float s)
Restores the GUI scaling factor and the clipping region in subsequent drawing operations.
Definition fl_draw.cxx:482
double fl_transform_x(double x, double y)
Transform coordinate using the current transformation matrix.
Definition fl_draw.H:731
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:375
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:668
void fl_push_matrix()
Save the current transformation matrix on the stack.
Definition fl_draw.H:523
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:723
void fl_xyline(int x, int y, int x1)
Draw a horizontal line from (x,y) to (x1,y).
Definition fl_draw.H:430
void fl_end_polygon()
End convex filled polygon, and draw.
Definition fl_draw.H:692
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:298
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:476
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:591
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:570
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
int fl_antialias()
Return whether line drawings are currently antialiased.
Definition fl_draw.H:278
void fl_line(int x, int y, int x1, int y1)
Draw a line from (x,y) to (x1,y1)
Definition fl_draw.H:388
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:738
void fl_end_points()
End list of points, and draw.
Definition fl_draw.H:674
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:451
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:1026
void fl_load_identity()
Set the transformation matrix to identity.
Definition fl_draw.H:563
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:1034
@ FL_DASH
line style: _ _ _ _ _ _
Definition fl_draw.H:254
@ FL_CAP_FLAT
cap style: end is flat
Definition fl_draw.H:259
@ FL_JOIN_ROUND
join style: line join is rounded
Definition fl_draw.H:264
@ FL_JOIN_BEVEL
join style: line join is tidied
Definition fl_draw.H:265
@ FL_JOIN_MITER
join style: line join extends to a point
Definition fl_draw.H:263
@ FL_CAP_SQUARE
cap style: end wraps end point
Definition fl_draw.H:261
@ FL_DOT
line style: . . . . . .
Definition fl_draw.H:255
@ FL_DASHDOTDOT
line style: _ . . _ . .
Definition fl_draw.H:257
@ FL_SOLID
line style: ___________
Definition fl_draw.H:253
@ FL_DASHDOT
line style: _ . _ . _ .
Definition fl_draw.H:256
@ FL_CAP_ROUND
cap style: end is round
Definition fl_draw.H:260
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