FLTK
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-2020 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> // for the color names
26 #include <FL/Fl_Graphics_Driver.H> // for fl_graphics_driver + Fl_Region
27 
28 // Image class...
29 class Fl_Image;
30 class Fl_Window;
31 
32 // Label flags...
33 FL_EXPORT extern char fl_draw_shortcut;
34 
39 // Colors:
49 inline void fl_color(Fl_Color c) {fl_graphics_driver->color(c); } // select indexed color
51 inline void fl_color(int c) {fl_color((Fl_Color)c);}
62 inline void fl_color(uchar r, uchar g, uchar b) {fl_graphics_driver->color(r,g,b); } // select actual color
67 inline Fl_Color fl_color() {return fl_graphics_driver->color();}
73 // clip:
79 inline void fl_push_clip(int x, int y, int w, int h) {fl_graphics_driver->push_clip(x,y,w,h); }
88 #define fl_clip fl_push_clip
89 
92 inline void fl_push_no_clip() {fl_graphics_driver->push_no_clip(); }
100 inline void fl_pop_clip() {fl_graphics_driver->pop_clip(); }
101 
115 inline int fl_not_clipped(int x, int y, int w, int h) {
116  return fl_graphics_driver->not_clipped(x, y, w, h);
117 }
118 
161 inline int fl_clip_box(int x, int y, int w, int h, int& X, int& Y, int& W, int& H) {
162  return fl_graphics_driver->clip_box(x, y, w, h, X, Y, W, H);
163 }
164 
166 inline void fl_restore_clip() {
167  fl_graphics_driver->restore_clip();
168 }
169 
179 inline void fl_clip_region(Fl_Region r) { fl_graphics_driver->clip_region(r); }
180 
187 inline Fl_Region fl_clip_region() { return fl_graphics_driver->clip_region(); }
188 
189 
190 // points:
194 inline void fl_point(int x, int y) { fl_graphics_driver->point(x,y); }
195 
196 // line type:
224 inline void fl_line_style(int style, int width=0, char* dashes=0) {fl_graphics_driver->line_style(style,width,dashes); }
225 enum {
226  FL_SOLID = 0,
227  FL_DASH = 1,
228  FL_DOT = 2,
231 
232  FL_CAP_FLAT = 0x100,
233  FL_CAP_ROUND = 0x200,
234  FL_CAP_SQUARE = 0x300,
235 
236  FL_JOIN_MITER = 0x1000,
237  FL_JOIN_ROUND = 0x2000,
238  FL_JOIN_BEVEL = 0x3000
239 };
240 
241 // rectangles tweaked to exactly fill the pixel rectangle:
242 
248 inline void fl_rect(int x, int y, int w, int h) { fl_graphics_driver->rect(x,y,w,h); }
249 
253 inline void fl_focus_rect(int x, int y, int w, int h) { fl_graphics_driver->focus_rect(x, y, w, h); }
255 inline void fl_rect(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_rect(x,y,w,h);}
257 inline void fl_rectf(int x, int y, int w, int h) { fl_graphics_driver->rectf(x,y,w,h); }
259 inline void fl_rectf(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_rectf(x,y,w,h);}
260 
267 /* note: doxygen comment here to avoid triplication in os-speciic files */
268 FL_EXPORT void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b);
269 
270 // line segments:
274 inline void fl_line(int x, int y, int x1, int y1) {fl_graphics_driver->line(x,y,x1,y1); }
278 inline void fl_line(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_driver->line(x,y,x1,y1,x2,y2); }
279 
280 // closed line segments:
284 inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_driver->loop(x,y,x1,y1,x2,y2); }
288 inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
289  {fl_graphics_driver->loop(x,y,x1,y1,x2,y2,x3,y3); }
290 
291 // filled polygons
295 inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_driver->polygon(x,y,x1,y1,x2,y2); }
299 inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
300  { fl_graphics_driver->polygon(x,y,x1,y1,x2,y2,x3,y3); }
301 
302 // draw rectilinear lines, horizontal segment first:
306 inline void fl_xyline(int x, int y, int x1) {fl_graphics_driver->xyline(x,y,x1);}
310 inline void fl_xyline(int x, int y, int x1, int y2) {fl_graphics_driver->xyline(x,y,x1,y2);}
315 inline void fl_xyline(int x, int y, int x1, int y2, int x3) {fl_graphics_driver->xyline(x,y,x1,y2,x3);}
316 
317 // draw rectilinear lines, vertical segment first:
321 inline void fl_yxline(int x, int y, int y1) {fl_graphics_driver->yxline(x,y,y1);}
325 inline void fl_yxline(int x, int y, int y1, int x2) {fl_graphics_driver->yxline(x,y,y1,x2);}
330 inline void fl_yxline(int x, int y, int y1, int x2, int y3) {fl_graphics_driver->yxline(x,y,y1,x2,y3);}
331 
332 // circular lines and pie slices (code in fl_arci.C):
358 inline void fl_arc(int x, int y, int w, int h, double a1, double a2) {fl_graphics_driver->arc(x,y,w,h,a1,a2); }
374 inline void fl_pie(int x, int y, int w, int h, double a1, double a2) {fl_graphics_driver->pie(x,y,w,h,a1,a2); }
376 FL_EXPORT void fl_chord(int x, int y, int w, int h, double a1, double a2); // nyi
377 
378 // scalable drawing code (code in fl_vertex.C and fl_arc.C):
383 inline void fl_push_matrix() { fl_graphics_driver->push_matrix(); }
387 inline void fl_pop_matrix() { fl_graphics_driver->pop_matrix(); }
392 inline void fl_scale(double x, double y) {
393  fl_graphics_driver->mult_matrix(x,0,0,y,0,0);
394 }
399 inline void fl_scale(double x) {
400  fl_graphics_driver->mult_matrix(x,0,0,x,0,0);
401 }
406 inline void fl_translate(double x, double y) { fl_graphics_driver->translate(x, y); }
411 inline void fl_rotate(double d) { fl_graphics_driver->rotate(d); }
418 inline void fl_mult_matrix(double a, double b, double c, double d, double x,double y)
419  { fl_graphics_driver->mult_matrix(a, b, c, d, x, y); }
423 inline void fl_begin_points() {fl_graphics_driver->begin_points(); }
427 inline void fl_begin_line() {fl_graphics_driver->begin_line(); }
431 inline void fl_begin_loop() {fl_graphics_driver->begin_loop(); }
435 inline void fl_begin_polygon() {fl_graphics_driver->begin_polygon(); }
440 inline void fl_vertex(double x, double y) {fl_graphics_driver->vertex(x,y); }
449 inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3)
450  {fl_graphics_driver->curve(X0,Y0,X1,Y1,X2,Y2,X3,Y3); }
480 inline void fl_arc(double x, double y, double r, double start, double end) {fl_graphics_driver->arc(x,y,r,start,end); }
488 inline void fl_circle(double x, double y, double r) {fl_graphics_driver->circle(x,y,r); }
492 inline void fl_end_points() {fl_graphics_driver->end_points(); }
496 inline void fl_end_line() {fl_graphics_driver->end_line(); }
500 inline void fl_end_loop() {fl_graphics_driver->end_loop(); }
504 inline void fl_end_polygon() {fl_graphics_driver->end_polygon(); }
519 inline void fl_begin_complex_polygon() {fl_graphics_driver->begin_complex_polygon(); }
526 inline void fl_gap() {fl_graphics_driver->gap(); }
530 inline void fl_end_complex_polygon() {fl_graphics_driver->end_complex_polygon(); }
531 // get and use transformed positions:
536 inline double fl_transform_x(double x, double y) {return fl_graphics_driver->transform_x(x, y); }
541 inline double fl_transform_y(double x, double y) {return fl_graphics_driver->transform_y(x, y); }
546 inline double fl_transform_dx(double x, double y) {return fl_graphics_driver->transform_dx(x, y); }
551 inline double fl_transform_dy(double x, double y) {return fl_graphics_driver->transform_dy(x, y); }
556 inline void fl_transformed_vertex(double xf, double yf) {fl_graphics_driver->transformed_vertex(xf,yf); }
557 
564 inline void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy) {
565  fl_graphics_driver->copy_offscreen(x, y, w, h, pixmap, srcx, srcy);
566 }
567 
568 FL_EXPORT Fl_Offscreen fl_create_offscreen(int w, int h);
569 FL_EXPORT void fl_begin_offscreen(Fl_Offscreen b);
570 FL_EXPORT void fl_end_offscreen(void);
571 FL_EXPORT void fl_delete_offscreen(Fl_Offscreen bitmap);
572 FL_EXPORT void fl_rescale_offscreen(Fl_Offscreen &ctx);
573 
578 /* NOTE: doxygen comments here to avoid triplication in os-specific sources */
579 
580 // Fonts:
581 /*
582  Sets the current font, which is then used in various drawing routines.
583  Implemented and documented in src/fl_draw.cxx
584 */
585 FL_EXPORT void fl_font(Fl_Font face, Fl_Fontsize fsize);
586 
591 inline Fl_Font fl_font() {return fl_graphics_driver->font();}
596 inline Fl_Fontsize fl_size() {return fl_graphics_driver->size();}
597 
598 // information you can get about the current font:
603 inline int fl_height() {return fl_graphics_driver->height();}
604 FL_EXPORT int fl_height(int font, int size);
609 inline int fl_descent() {return fl_graphics_driver->descent();}
612 FL_EXPORT double fl_width(const char* txt);
615 inline double fl_width(const char* txt, int n) {return fl_graphics_driver->width(txt, n);}
620 inline double fl_width(unsigned int c) {return fl_graphics_driver->width(c);}
648 FL_EXPORT void fl_text_extents(const char*, int& dx, int& dy, int& w, int& h); // NO fltk symbol expansion will be performed
653 inline void fl_text_extents(const char *t, int n, int& dx, int& dy, int& w, int& h)
654  {fl_graphics_driver->text_extents(t, n, dx, dy, w, h);}
655 
656 // font encoding:
657 // Note: doxygen comments here to avoid duplication for os-sepecific cases
664 FL_EXPORT const char *fl_latin1_to_local(const char *t, int n=-1);
671 FL_EXPORT const char *fl_local_to_latin1(const char *t, int n=-1);
678 FL_EXPORT const char *fl_mac_roman_to_local(const char *t, int n=-1);
685 FL_EXPORT const char *fl_local_to_mac_roman(const char *t, int n=-1);
700 FL_EXPORT void fl_draw(const char* str, int x, int y);
708 FL_EXPORT void fl_draw(int angle, const char* str, int x, int y);
712 inline void fl_draw(const char* str, int n, int x, int y) {fl_graphics_driver->draw(str,n,x,y); }
722 inline void fl_draw(int angle, const char* str, int n, int x, int y) {fl_graphics_driver->draw(angle,str,n,x,y); }
726 inline void fl_rtl_draw(const char* str, int n, int x, int y) {fl_graphics_driver->rtl_draw(str,n,x,y); }
727 FL_EXPORT void fl_measure(const char* str, int& x, int& y,
728  int draw_symbols = 1);
729 FL_EXPORT void fl_draw(const char* str, int x, int y, int w, int h,
730  Fl_Align align,
731  Fl_Image* img=0, int draw_symbols = 1);
732 FL_EXPORT void fl_draw(const char* str, int x, int y, int w, int h,
733  Fl_Align align,
734  void (*callthis)(const char *,int,int,int),
735  Fl_Image* img=0, int draw_symbols = 1);
736 
737 // boxtypes:
738 FL_EXPORT void fl_frame(const char* s, int x, int y, int w, int h);
739 FL_EXPORT void fl_frame2(const char* s, int x, int y, int w, int h);
740 FL_EXPORT void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color);
741 
742 // images:
743 
779 inline void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0)
780  { fl_graphics_driver->draw_image(buf, X, Y, W, H, D, L); }
781 
786 inline void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0)
787  { fl_graphics_driver->draw_image_mono(buf, X, Y, W, H, D, L); }
788 
822 inline void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3)
823  { fl_graphics_driver->draw_image(cb, data, X, Y, W, H, D); }
824 
829 inline void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1)
830  { fl_graphics_driver->draw_image_mono(cb, data, X, Y, W, H, D); }
831 
837 inline char fl_can_do_alpha_blending() {return Fl_Graphics_Driver::default_driver().can_do_alpha_blending();}
838 
839 FL_EXPORT uchar *fl_read_image(uchar *p,int X,int Y,int W,int H,int alpha=0);
840 FL_EXPORT Fl_RGB_Image *fl_capture_window_part(Fl_Window *win, int x, int y, int w, int h);
841 
842 // pixmaps:
852 FL_EXPORT int fl_draw_pixmap(const char* const* data, int x,int y,Fl_Color bg=FL_GRAY);
857 inline int fl_draw_pixmap(/*const*/ char* const* data, int x, int y, Fl_Color bg=FL_GRAY)
858 {
859  return fl_draw_pixmap((const char*const*)data,x,y,bg);
860 }
861 FL_EXPORT int fl_measure_pixmap(/*const*/ char* const* data, int &w, int &h);
862 FL_EXPORT int fl_measure_pixmap(const char* const* cdata, int &w, int &h);
863 
864 // other:
865 FL_EXPORT void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
866  void (*draw_area)(void*, int,int,int,int), void* data);
867 FL_EXPORT const char* fl_shortcut_label(unsigned int shortcut);
868 FL_EXPORT const char* fl_shortcut_label(unsigned int shortcut, const char **eom);
869 FL_EXPORT unsigned int fl_old_shortcut(const char* s);
870 FL_EXPORT void fl_overlay_rect(int x,int y,int w,int h);
871 FL_EXPORT void fl_overlay_clear();
872 FL_EXPORT void fl_cursor(Fl_Cursor);
873 FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg, Fl_Color bg=FL_WHITE);
874 FL_EXPORT const char* fl_expand_text(const char* from, char* buf, int maxbuf,
875  double maxw, int& n, double &width,
876  int wrap, int draw_symbols = 0);
877 
878 // XIM:
880 FL_EXPORT void fl_set_status(int X, int Y, int W, int H);
882 FL_EXPORT void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win=0);
884 FL_EXPORT void fl_reset_spot(void);
885 
886 
887 
888 // XForms symbols:
889 FL_EXPORT int fl_draw_symbol(const char* label,int x,int y,int w,int h, Fl_Color);
890 FL_EXPORT int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scalable);
893 #endif
FL_EXPORT const char * fl_latin1_to_local(const char *t, int n=-1)
Converts text from Windows/X11 latin1 character set to local encoding.
Definition: fl_encoding_latin1.cxx:155
void fl_end_complex_polygon()
Ends complex filled polygon, and draws.
Definition: fl_draw.H:530
line style: ___________
Definition: fl_draw.H:226
FL_EXPORT void fl_reset_spot(void)
Definition: fl_font.cxx:57
FL_EXPORT 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:35
join style: line join extends to a point
Definition: fl_draw.H:236
void fl_loop(int x, int y, int x1, int y1, int x2, int y2)
Outlines a 3-sided polygon with lines.
Definition: fl_draw.H:284
double fl_transform_dx(double x, double y)
Transforms distance using current transformation matrix.
Definition: fl_draw.H:546
FL_EXPORT void fl_overlay_rect(int x, int y, int w, int h)
Draws a selection rectangle, erasing a previous one by XOR&#39;ing it first.
Definition: fl_overlay.cxx:124
This widget produces an actual window.
Definition: Fl_Window.H:53
int h() const
Gets the widget height.
Definition: Fl_Widget.H:286
Fl_Cursor
The following constants define the mouse cursors that are available in FLTK.
Definition: Enumerations.H:1156
cap style: end is flat
Definition: fl_draw.H:232
int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H)
Intersects a rectangle with the current clip region and returns the bounding box of the result...
Definition: fl_draw.H:161
void fl_point(int x, int y)
Draws a single pixel at the given coordinates.
Definition: fl_draw.H:194
int fl_descent()
Returns the recommended distance above the bottom of a fl_height() tall box to draw the text at so it...
Definition: fl_draw.H:609
void fl_clip_region(Fl_Region r)
Replaces the top of the clipping stack with a clipping region of any shape.
Definition: fl_draw.H:179
FL_EXPORT Fl_RGB_Image * fl_capture_window_part(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:99
void fl_push_matrix()
Saves the current transformation matrix on the stack.
Definition: fl_draw.H:383
void fl_transformed_vertex(double xf, double yf)
Adds coordinate pair to the vertex list without further transformations.
Definition: fl_draw.H:556
FL_EXPORT const char * fl_local_to_latin1(const char *t, int n=-1)
Converts text from local encoding to Windowx/X11 latin1 character set.
Definition: fl_encoding_latin1.cxx:160
void fl_gap()
Call fl_gap() to separate loops of the path.
Definition: fl_draw.H:526
FL_EXPORT void fl_set_status(int X, int Y, int W, int H)
int fl_not_clipped(int x, int y, int w, int h)
Does the rectangle intersect the current clip region?
Definition: fl_draw.H:115
FL_EXPORT unsigned int fl_old_shortcut(const char *s)
Emulation of XForms named shortcuts.
Definition: fl_shortcut.cxx:273
opaque Fl_Offscreen
an offscreen drawing buffer
Definition: platform_types.h:35
FL_EXPORT void fl_set_spot(int font, int size, int X, int Y, int W, int H, Fl_Window *win=0)
Definition: fl_font.cxx:52
void fl_rotate(double d)
Concatenates rotation transformation onto the current one.
Definition: fl_draw.H:411
int fl_height()
Returns the recommended minimum line spacing for the current font.
Definition: fl_draw.H:603
void fl_draw_image(const uchar *buf, int X, int Y, int W, int H, int D=3, int L=0)
Draws an 8-bit per color RGB or luminance image.
Definition: fl_draw.H:779
FL_EXPORT void fl_delete_offscreen(Fl_Offscreen bitmap)
Deletion of an offscreen graphics buffer.
Definition: Fl_Image_Surface.cxx:200
void fl_color(Fl_Color c)
Sets the color for all subsequent drawing operations.
Definition: fl_draw.H:49
FL_EXPORT void fl_overlay_clear()
Erase a selection rectangle without drawing a new one.
Definition: fl_overlay.cxx:117
void size(int W, int H)
Changes the size of the widget.
Definition: Fl_Widget.H:328
void fl_begin_polygon()
Starts drawing a convex filled polygon.
Definition: fl_draw.H:435
void fl_begin_complex_polygon()
Starts drawing a complex filled polygon.
Definition: fl_draw.H:519
void fl_pop_clip()
Restores the previous clip region.
Definition: fl_draw.H:100
FL_EXPORT 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:431
FL_EXPORT const char * fl_local_to_mac_roman(const char *t, int n=-1)
Converts text from local encoding to Mac Roman character set.
Definition: fl_encoding_mac_roman.cxx:130
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:253
const char * label() const
See void Fl_Window::label(const char*)
Definition: Fl_Window.H:328
void end()
Exactly the same as current(this->parent()).
Definition: Fl_Group.cxx:72
void fl_begin_line()
Starts drawing a list of lines.
Definition: fl_draw.H:427
Base class for image caching, scaling and drawing.
Definition: Fl_Image.H:62
FL_EXPORT void fl_text_extents(const char *, int &dx, int &dy, int &w, int &h)
Determines the minimum pixel dimensions of a nul-terminated string using the current fl_font()...
Definition: fl_font.cxx:39
FL_EXPORT void fl_begin_offscreen(Fl_Offscreen b)
Send all subsequent drawing commands to this offscreen buffer.
Definition: Fl_Image_Surface.cxx:215
line style: _ . _ . _ .
Definition: fl_draw.H:229
The Fl_RGB_Image class supports caching and drawing of full-color images with 1 to 4 channels of colo...
Definition: Fl_Image.H:287
FL_EXPORT 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
void fl_end_line()
Ends list of lines, and draws.
Definition: fl_draw.H:496
Fl_Boxtype
FLTK standard box types.
Definition: Enumerations.H:598
Fl_Fontsize fl_size()
Returns the size set by the most recent call to fl_font().
Definition: fl_draw.H:596
FL_EXPORT int fl_measure_pixmap(char *const *data, int &w, int &h)
Get the dimensions of a pixmap.
Definition: fl_draw_pixmap.cxx:60
FL_EXPORT 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_EXPORT 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:222
void fl_end_loop()
Ends closed sequence of lines, and draws.
Definition: fl_draw.H:500
FL_EXPORT 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_EXPORT void fl_rescale_offscreen(Fl_Offscreen &ctx)
Adapts an offscreen buffer to a changed value of the scale factor.
Definition: Fl_Image_Surface.cxx:237
This file contains type definitions and general enumerations.
opaque Fl_Region
a region made of several rectangles
Definition: platform_types.h:37
void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3)
Adds a series of points on a Bezier curve to the path.
Definition: fl_draw.H:449
FL_EXPORT Fl_Offscreen fl_create_offscreen(int w, int h)
Creation of an offscreen graphics buffer.
Definition: Fl_Image_Surface.cxx:190
double fl_transform_dy(double x, double y)
Transforms distance using current transformation matrix.
Definition: fl_draw.H:551
void fl_end_polygon()
Ends convex filled polygon, and draws.
Definition: fl_draw.H:504
cap style: end wraps end point
Definition: fl_draw.H:234
line style: _ _ _ _ _ _
Definition: fl_draw.H:227
int y() const
Gets the widget position in its window.
Definition: Fl_Widget.H:276
void fl_mult_matrix(double a, double b, double c, double d, double x, double y)
Concatenates another transformation onto the current one.
Definition: fl_draw.H:418
void fl_begin_points()
Starts drawing a list of points.
Definition: fl_draw.H:423
void fl_line_style(int style, int width=0, char *dashes=0)
Sets how to draw lines (the "pen").
Definition: fl_draw.H:224
FL_EXPORT 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:142
double fl_transform_x(double x, double y)
Transforms coordinate using the current transformation matrix.
Definition: fl_draw.H:536
FL_EXPORT 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:437
void fl_scale(double x, double y)
Concatenates scaling transformation onto the current one.
Definition: fl_draw.H:392
char fl_can_do_alpha_blending()
Checks whether platform supports true alpha blending for RGBA images.
Definition: fl_draw.H:837
FL_EXPORT 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:123
Fl_Align align() const
Gets the label alignment.
Definition: Fl_Widget.H:335
void fl_end_points()
Ends list of points, and draws.
Definition: fl_draw.H:492
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:1014
line style: _ . . _ . .
Definition: fl_draw.H:230
void fl_rectf(int x, int y, int w, int h)
Colors with current color a rectangle that exactly fills the given bounding box.
Definition: fl_draw.H:257
cap style: end is round
Definition: fl_draw.H:233
FL_EXPORT void fl_draw(const char *str, int x, int y)
Draws a nul-terminated UTF-8 string starting at the given x, y location.
Definition: fl_font.cxx:31
void fl_begin_loop()
Starts drawing a closed sequence of lines.
Definition: fl_draw.H:431
void fl_draw_image_mono(const uchar *buf, int X, int Y, int W, int H, int D=1, int L=0)
Draws a gray-scale (1 channel) image.
Definition: fl_draw.H:786
void fl_yxline(int x, int y, int y1)
Draws a vertical line from (x,y) to (x,y1)
Definition: fl_draw.H:321
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition: Enumerations.H:1042
void fl_push_no_clip()
Pushes an empty clip region onto the stack so nothing will be clipped.
Definition: fl_draw.H:92
double fl_transform_y(double x, double y)
Transforms coordinate using the current transformation matrix.
Definition: fl_draw.H:541
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:985
line style: . . . . . .
Definition: fl_draw.H:228
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:908
void fl_translate(double x, double y)
Concatenates translation transformation onto the current one.
Definition: fl_draw.H:406
FL_EXPORT const char * fl_shortcut_label(unsigned int shortcut)
Get a human-readable string from a shortcut value.
Definition: fl_shortcut.cxx:129
int x() const
Gets the widget position in its window.
Definition: Fl_Widget.H:271
void fl_vertex(double x, double y)
Adds a single vertex to the current path.
Definition: fl_draw.H:440
FL_EXPORT const char * fl_mac_roman_to_local(const char *t, int n=-1)
Converts text from Mac Roman character set to local encoding.
Definition: fl_encoding_mac_roman.cxx:134
FL_EXPORT 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:108
void fl_pop_matrix()
Restores the current transformation matrix from the stack.
Definition: fl_draw.H:387
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2)
Fills a 3-sided polygon.
Definition: fl_draw.H:295
void fl_xyline(int x, int y, int x1)
Draws a horizontal line from (x,y) to (x1,y)
Definition: fl_draw.H:306
join style: line join is tidied
Definition: fl_draw.H:238
void fl_restore_clip()
Undoes any clobbering of clip done by your program.
Definition: fl_draw.H:166
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:564
FL_EXPORT 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
void fl_rtl_draw(const char *str, int n, int x, int y)
Draws a UTF-8 string of length n bytes right to left starting at the given x, y location.
Definition: fl_draw.H:726
FL_EXPORT void fl_cursor(Fl_Cursor)
Sets the cursor for the current window to the specified shape and colors.
Definition: fl_cursor.cxx:41
void fl_line(int x, int y, int x1, int y1)
Draws a line from (x,y) to (x1,y1)
Definition: fl_draw.H:274
int w() const
Gets the widget width.
Definition: Fl_Widget.H:281
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:358
FL_EXPORT 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:368
join style: line join is rounded
Definition: fl_draw.H:237
unsigned char uchar
unsigned char
Definition: fl_types.h:28
void fl_rect(int x, int y, int w, int h)
Draws a 1-pixel border inside the given bounding box.
Definition: fl_draw.H:248
void fl_push_clip(int x, int y, int w, int h)
Intersects the current clip region with a rectangle and pushes this new region onto the stack...
Definition: fl_draw.H:79
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:374
FL_EXPORT double fl_width(const char *txt)
Returns the typographical width of a nul-terminated string using the current font face and size...
Definition: fl_font.cxx:26
FL_EXPORT void fl_end_offscreen(void)
Quit sending drawing commands to the current offscreen buffer.
Definition: Fl_Image_Surface.cxx:226
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:488