FLTK 1.4.4

Loading...
Searching...
No Matches
fl_draw.H File Reference

utility header to pull drawing functions together More...

`#include <FL/Enumerations.H>`
`#include <FL/Fl_Graphics_Driver.H>`
`#include <FL/Fl_Rect.H>`

Go to the source code of this file.

## Enumerations
enum | { FL_SOLID = 0 , FL_DASH = 1 , FL_DOT = 2 , FL_DASHDOT = 3 , FL_DASHDOTDOT = 4 , FL_CAP_FLAT = 0x100 , FL_CAP_ROUND = 0x200 , FL_CAP_SQUARE = 0x300 , FL_JOIN_MITER = 0x1000 , FL_JOIN_ROUND = 0x2000 , FL_JOIN_BEVEL = 0x3000 }
| More...

## Functions
int | fl_add_symbol (const char *name, void(*drawit)(Fl_Color), int scalable)
| Adds a symbol to the system.
int | fl_antialias ()
| Return whether line drawings are currently antialiased.
void | fl_antialias (int state)
| Turn antialiased line drawings ON or OFF, if supported by platform.
void | fl_arc (double x, double y, double r, double start, double end)
| Add a series of points to the current path on the arc of a circle.
void | fl_arc (int x, int y, int w, int h, double a1, double a2)
| Draw ellipse sections using integer coordinates.
void | fl_begin_complex_polygon ()
| Start drawing a complex filled polygon.
void | fl_begin_line ()
| Start drawing a list of lines.
void | fl_begin_loop ()
| Start drawing a closed sequence of lines.
void | fl_begin_offscreen (Fl_Offscreen ctx)
| Send all subsequent drawing commands to this offscreen buffer.
void | fl_begin_points ()
| Start drawing a list of points.
void | fl_begin_polygon ()
| Start drawing a convex filled polygon.
char | fl_can_do_alpha_blending ()
| Check whether platform supports true alpha blending for RGBA images.
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.
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
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.
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 (deprecated).
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.
Fl_Region | fl_clip_region ()
| Return the current clipping region.
void | fl_clip_region (Fl_Region r)
| Replace the top of the clipping stack with a clipping region of any shape.
Fl_Color | fl_color ()
| Return the last fl_color() that was set.
void | fl_color (Fl_Color c)
| Set the color for all subsequent drawing operations.
void | fl_color (int c)
| for back compatibility - use fl_color(Fl_Color c) instead
void | fl_color (uchar r, uchar g, uchar b)
| Set the color for all subsequent drawing operations.
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.
Fl_Offscreen | fl_create_offscreen (int w, int h)
| Creation of an offscreen graphics buffer.
void | fl_cursor (Fl_Cursor)
| Sets the cursor for the current window to the specified shape and colors.
void | fl_cursor (Fl_Cursor, Fl_Color fg, Fl_Color bg=FL_WHITE)
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.
void | fl_delete_offscreen (Fl_Offscreen ctx)
| Deletion of an offscreen graphics buffer.
int | fl_descent ()
| Return the recommended distance above the bottom of a fl_height() tall box to draw the text at so it looks centered vertically in that box.
void | fl_draw (const char *str, int n, int x, int y)
| Draws starting at the given `x`, `y` location a UTF-8 string of length `n` bytes.
void | fl_draw (const char *str, int x, int y)
| Draw a nul-terminated UTF-8 string starting at the given `x`, `y` location.
void | fl_draw (const char *str, int x, int y, int w, int h, Fl_Align align, Fl_Image *img=0, int draw_symbols=1, int spacing=0)
| Fancy string drawing function which is used to draw all the labels.
void | fl_draw (const char *str, int x, int y, int w, int h, Fl_Align align, void(*callthis)(const char *, int, int, int), Fl_Image *img=0, int draw_symbols=1, int spacing=0)
| The same as fl_draw(const char*,int,int,int,int,Fl_Align,Fl_Image*,int) with the addition of the `callthis` parameter, which is a pointer to a text drawing function such as fl_draw(const char*, int, int, int) to do the real work.
void | fl_draw (int angle, const char *str, int n, int x, int y)
| Draw at the given `x`, `y` location a UTF-8 string of length `n` bytes rotating `angle` degrees counter-clockwise.
void | fl_draw (int angle, const char *str, int x, int y)
| Draw a nul-terminated UTF-8 string starting at the given `x`, `y` location and rotating `angle` degrees counter-clockwise.
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.
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.
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.
void | fl_draw_check (Fl_Rect bb, Fl_Color col)
| Draw a check mark inside the given bounding box.
void | fl_draw_circle (int x, int y, int d, Fl_Color color)
| Draw a potentially small, filled circle using a given color.
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.
void | fl_draw_image (Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=3)
| Draw an image using a callback function to generate image data.
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.
void | fl_draw_image_mono (Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=1)
| Draw a gray-scale image using a callback function to generate image data.
int | fl_draw_pixmap (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.
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.
void | fl_draw_radio (int x, int y, int d, Fl_Color color)
| Draw a round check mark (circle) of a radio button.
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.
void | fl_end_complex_polygon ()
| End complex filled polygon, and draw.
void | fl_end_line ()
| End list of lines, and draw.
void | fl_end_loop ()
| End closed sequence of lines, and draw.
void | fl_end_offscreen ()
| Quit sending drawing commands to the current offscreen buffer.
void | fl_end_points ()
| End list of points, and draw.
void | fl_end_polygon ()
| End convex filled polygon, and draw.
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.
void | fl_focus_rect (int x, int y, int w, int h)
| Draw a dotted rectangle, used to indicate keyboard focus on a widget.
Fl_Font | fl_font ()
| Return the `face` set by the most recent call to fl_font().
void | fl_font (Fl_Font face, Fl_Fontsize fsize)
| Sets the current font, which is then used in various drawing routines.
void | fl_frame (const char *s, int x, int y, int w, int h)
| Draws a series of line segments around the given box.
void | fl_frame2 (const char *s, int x, int y, int w, int h)
| Draws a series of line segments around the given box.
void | fl_gap ()
| Separate loops of the path.
int | fl_height ()
| Return the recommended minimum line spacing for the current font.
int | fl_height (int font, int size)
| This function returns the actual height of the specified `font` and `size`.
const char * | fl_latin1_to_local (const char *t, int n=-1)
| Convert text from Windows/X11 latin1 character set to local encoding.
void | fl_line (int x, int y, int x1, int y1)
| Draw a line from (x,y) to (x1,y1)
void | fl_line (int x, int y, int x1, int y1, int x2, int y2)
| Draw a line from (x,y) to (x1,y1) and another from (x1,y1) to (x2,y2)
void | fl_line_style (int style, int width=0, char *dashes=0)
| Set how to draw lines (the "pen").
void | fl_load_identity ()
| Set the transformation matrix to identity.
void | fl_load_matrix (double a, double b, double c, double d, double x, double y)
| Set the current transformation matrix.
const char * | fl_local_to_latin1 (const char *t, int n=-1)
| Convert text from local encoding to Windows/X11 latin1 character set.
const char * | fl_local_to_mac_roman (const char *t, int n=-1)
| Convert text from local encoding to Mac Roman character set.
void | fl_loop (int x, int y, int x1, int y1, int x2, int y2)
| Outline a 3-sided polygon with lines.
void | fl_loop (int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
| Outline a 4-sided polygon with lines.
const char * | fl_mac_roman_to_local (const char *t, int n=-1)
| Convert text from Mac Roman character set to local encoding.
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` parameter.
int | fl_measure_pixmap (char *const *data, int &w, int &h)
| Get the dimensions of a pixmap.
int | fl_measure_pixmap (const char *const *cdata, int &w, int &h)
| Get the dimensions of a pixmap.
void | fl_mult_matrix (double a, double b, double c, double d, double x, double y)
| Concatenate another transformation onto the current one.
int | fl_not_clipped (int x, int y, int w, int h)
| Does the rectangle intersect the current clip region?
unsigned int | fl_old_shortcut (const char *s)
| Emulation of XForms named shortcuts.
void | fl_overlay_clear ()
| Erase a selection rectangle without drawing a new one.
void | fl_overlay_rect (int x, int y, int w, int h)
| Draw a transient dotted selection rectangle.
float | fl_override_scale ()
| Removes any GUI scaling factor in subsequent drawing operations.
void | fl_pie (int x, int y, int w, int h, double a1, double a2)
| Draw filled ellipse sections using integer coordinates.
void | fl_point (int x, int y)
| Draw a single pixel at the given coordinates.
void | fl_polygon (int x, int y, int x1, int y1, int x2, int y2)
| Fill a 3-sided polygon.
void | fl_polygon (int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
| Fill a 4-sided polygon.
void | fl_pop_clip ()
| Restore the previous clip region.
void | fl_pop_matrix ()
| Restore the current transformation matrix from the stack.
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.
void | fl_push_matrix ()
| Save the current transformation matrix on the stack.
void | fl_push_no_clip ()
| Push an empty clip region onto the stack so nothing will be clipped.
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.
void | fl_rect (Fl_Rect r)
| Draw a border inside the given bounding box.
void | fl_rect (int x, int y, int w, int h)
| Draw a border inside the given bounding box.
void | fl_rect (int x, int y, int w, int h, Fl_Color c)
| Draw with passed color a border inside the given bounding box.
void | fl_rectf (Fl_Rect bb, uchar r, uchar g, uchar b)
| Color a rectangle with "exactly" the passed r,g,b color.
void | fl_rectf (Fl_Rect r)
| Color with current color a rectangle that exactly fills the given bounding box.
void | fl_rectf (Fl_Rect r, Fl_Color c)
| Color with passed color a rectangle that exactly fills the given bounding box.
void | fl_rectf (int x, int y, int w, int h)
| Color with current color a rectangle that exactly fills the given bounding box.
void | fl_rectf (int x, int y, int w, int h, Fl_Color c)
| Color with passed color a rectangle that exactly fills the given bounding box.
void | fl_rectf (int x, int y, int w, int h, uchar r, uchar g, uchar b)
| Color a rectangle with "exactly" the passed r,g,b color.
void | fl_rescale_offscreen (Fl_Offscreen &ctx)
| Adapts an offscreen buffer to a changed value of the scale factor.
void | fl_reset_spot (void)
| Resets marked text.
void | fl_restore_clip ()
| Undo any clobbering of the clip region done by your program.
void | fl_restore_scale (float s)
| Restores the GUI scaling factor in subsequent drawing operations.
void | fl_rotate (double d)
| Concatenate rotation transformation onto the current one.
void | fl_rounded_rect (int x, int y, int w, int h, int r)
| Draw a rounded border inside the given bounding box.
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.
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.
void | fl_scale (double x)
| Concatenate scaling transformation onto the current one.
void | fl_scale (double x, double y)
| Concatenate scaling transformation onto the current one.
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.
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.
void | fl_set_status (int X, int Y, int W, int H)
| Related to text input methods under X11.
const char * | fl_shortcut_label (unsigned int shortcut)
| Get a human-readable string from a shortcut value.
const char * | fl_shortcut_label (unsigned int shortcut, const char **eom)
| Get a human-readable string from a shortcut value.
Fl_Fontsize | fl_size ()
| Return the `size` set by the most recent call to fl_font().
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().
void | fl_text_extents (const char *t, int n, int &dx, int &dy, int &w, int &h)
| Determine the minimum pixel dimensions of a sequence of `n` characters (bytes) using the current fl_font().
double | fl_transform_dx (double x, double y)
| Transform distance using current transformation matrix.
double | fl_transform_dy (double x, double y)
| Transform distance using current transformation matrix.
double | fl_transform_x (double x, double y)
| Transform coordinate using the current transformation matrix.
double | fl_transform_y (double x, double y)
| Transform coordinate using the current transformation matrix.
void | fl_transformed_vertex (double xf, double yf)
| Add coordinate pair to the vertex list without further transformations.
void | fl_translate (double x, double y)
| Concatenate translation transformation onto the current one.
void | fl_vertex (double x, double y)
| Add a single vertex to the current path.
double | fl_width (const char *txt)
| Return the typographical width of a nul-terminated string using the current font face and size.
double | fl_width (const char *txt, int n)
| Return the typographical width of a sequence of `n` characters using the current font face and size.
double | fl_width (unsigned int c)
| Return the typographical width of a single character using the current font face and size.
void | fl_xyline (int x, int y, int x1)
| Draw a horizontal line from (x,y) to (x1,y).
void | fl_xyline (int x, int y, int x1, int y2)
| Draw a horizontal line from (x,y) to (x1,y), then vertical from (x1,y) to (x1,y2).
void | fl_xyline (int x, int y, int x1, int y2, int x3)
| Draw a horizontal line from (x,y) to (x1,y), then a vertical from (x1,y) to (x1,y2) and then another horizontal from (x1,y2) to (x3,y2).
void | fl_yxline (int x, int y, int y1)
| Draw a vertical line from (x,y) to (x,y1)
void | fl_yxline (int x, int y, int y1, int x2)
| Draw a vertical line from (x,y) to (x,y1), then a horizontal from (x,y1) to (x2,y1).
void | fl_yxline (int x, int y, int y1, int x2, int y3)
| Draw a vertical line from (x,y) to (x,y1), then a horizontal from (x,y1) to (x2,y1), then another vertical from (x2,y1) to (x2,y3).

## Variables
char | fl_draw_shortcut

## Detailed Description

utility header to pull drawing functions together