FLTK 1.3.4
fl_draw.H File Reference

utility header to pull drawing functions together More...

#include <FL/x.H>
#include <FL/Enumerations.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Device.H>

Go to the source code of this file.

Macros

#define fl_clip   fl_push_clip
 Intersects the current clip region with a rectangle and pushes this new region onto the stack (deprecated). More...
 

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
}
 

Functions

FL_EXPORT int fl_add_symbol (const char *name, void(*drawit)(Fl_Color), int scalable)
 Adds a symbol to the system. More...
 
void fl_arc (int x, int y, int w, int h, double a1, double a2)
 Draw ellipse sections using integer coordinates. More...
 
void fl_arc (double x, double y, double r, double start, double end)
 Adds a series of points to the current path on the arc of a circle. More...
 
void fl_begin_complex_polygon ()
 Starts drawing a complex filled polygon. More...
 
void fl_begin_line ()
 Starts drawing a list of lines.
 
void fl_begin_loop ()
 Starts drawing a closed sequence of lines.
 
void fl_begin_points ()
 Starts drawing a list of points. More...
 
void fl_begin_polygon ()
 Starts drawing a convex filled polygon.
 
FL_EXPORT char fl_can_do_alpha_blending ()
 Checks whether platform supports true alpha blending for RGBA images. More...
 
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
 
void fl_circle (double x, double y, double r)
 fl_circle() is equivalent to fl_arc(x,y,r,0,360), but may be faster. More...
 
int fl_clip_box (int x, int y, int w, int h, int &X, int &Y, int &W, int &H)
 Intersects the rectangle with the current clip region and returns the bounding box of the result. More...
 
void fl_clip_region (Fl_Region r)
 Replaces the top of the clipping stack with a clipping region of any shape. More...
 
Fl_Region fl_clip_region ()
 Returns the current clipping region.
 
void fl_color (Fl_Color c)
 Sets the color for all subsequent drawing operations. More...
 
void fl_color (int c)
 for back compatibility - use fl_color(Fl_Color c) instead
 
void fl_color (uchar r, uchar g, uchar b)
 Sets the color for all subsequent drawing operations. More...
 
Fl_Color fl_color ()
 Returns the last fl_color() that was set. More...
 
FL_EXPORT void fl_cursor (Fl_Cursor)
 Sets the cursor for the current window to the specified shape and colors. More...
 
FL_EXPORT 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)
 Adds a series of points on a Bezier curve to the path. More...
 
int fl_descent ()
 Returns 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.
 
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. More...
 
FL_EXPORT void fl_draw (int angle, const char *str, int x, int y)
 Draws a nul-terminated UTF-8 string starting at the given x, y location and rotating angle degrees counter-clockwise. More...
 
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 (int angle, const char *str, int n, int x, int y)
 Draws at the given x, y location a UTF-8 string of length n bytes rotating angle degrees counter-clockwise. More...
 
FL_EXPORT 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)
 Fancy string drawing function which is used to draw all the labels. More...
 
FL_EXPORT 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)
 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.
 
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. More...
 
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. More...
 
void fl_draw_image (Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=3)
 Draws an image using a callback function to generate image data. More...
 
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. More...
 
void fl_draw_image_mono (Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=1)
 Draws a gray-scale image using a callback function to generate image data. More...
 
FL_EXPORT int fl_draw_pixmap (char *const *data, int x, int y, Fl_Color=FL_GRAY)
 Draw XPM image data, with the top-left corner at the given position. More...
 
FL_EXPORT int fl_draw_pixmap (const char *const *cdata, int x, int y, Fl_Color=FL_GRAY)
 Draw XPM image data, with the top-left corner at the given position. More...
 
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. More...
 
void fl_end_complex_polygon ()
 Ends complex filled polygon, and draws.
 
void fl_end_line ()
 Ends list of lines, and draws.
 
void fl_end_loop ()
 Ends closed sequence of lines, and draws.
 
void fl_end_points ()
 Ends list of points, and draws.
 
void fl_end_polygon ()
 Ends convex filled polygon, and draws.
 
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. More...
 
void fl_font (Fl_Font face, Fl_Fontsize fsize)
 Sets the current font, which is then used in various drawing routines. More...
 
Fl_Font fl_font ()
 Returns the face set by the most recent call to fl_font(). More...
 
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. More...
 
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. More...
 
void fl_gap ()
 Call fl_gap() to separate loops of the path. More...
 
int fl_height ()
 Returns the recommended minimum line spacing for the current font. More...
 
FL_EXPORT int fl_height (int font, int size)
 This function returns the actual height of the specified font and size. More...
 
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. More...
 
void fl_line (int x, int y, int x1, int y1)
 Draws a line from (x,y) to (x1,y1)
 
void fl_line (int x, int y, int x1, int y1, int x2, int y2)
 Draws 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)
 Sets how to draw lines (the "pen"). More...
 
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. More...
 
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. More...
 
void fl_loop (int x, int y, int x1, int y1, int x2, int y2)
 Outlines 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)
 Outlines a 4-sided polygon with lines.
 
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. More...
 
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 parameter. More...
 
FL_EXPORT int fl_measure_pixmap (char *const *data, int &w, int &h)
 Get the dimensions of a pixmap. More...
 
FL_EXPORT int fl_measure_pixmap (const char *const *cdata, int &w, int &h)
 Get the dimensions of a pixmap. More...
 
void fl_mult_matrix (double a, double b, double c, double d, double x, double y)
 Concatenates another transformation onto the current one. More...
 
int fl_not_clipped (int x, int y, int w, int h)
 Does the rectangle intersect the current clip region? More...
 
FL_EXPORT unsigned int fl_old_shortcut (const char *s)
 Emulation of XForms named shortcuts. More...
 
FL_EXPORT void fl_overlay_clear ()
 Erase a selection rectangle without drawing a new one.
 
FL_EXPORT void fl_overlay_rect (int x, int y, int w, int h)
 Draws a selection rectangle, erasing a previous one by XOR'ing it first.
 
void fl_pie (int x, int y, int w, int h, double a1, double a2)
 Draw filled ellipse sections using integer coordinates. More...
 
void fl_point (int x, int y)
 Draws a single pixel at the given coordinates.
 
void fl_polygon (int x, int y, int x1, int y1, int x2, int y2)
 Fills a 3-sided polygon. More...
 
void fl_polygon (int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
 Fills a 4-sided polygon. More...
 
void fl_pop_clip ()
 Restores the previous clip region. More...
 
void fl_pop_matrix ()
 Restores the current transformation matrix from the stack.
 
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. More...
 
void fl_push_matrix ()
 Saves the current transformation matrix on the stack. More...
 
void fl_push_no_clip ()
 Pushes an empty clip region onto the stack so nothing will be clipped.
 
FL_EXPORT ucharfl_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. More...
 
void fl_rect (int x, int y, int w, int h)
 Draws a 1-pixel border inside the given bounding box. More...
 
void fl_rect (int x, int y, int w, int h, Fl_Color c)
 Draws with passed color a 1-pixel border inside the given bounding box.
 
void fl_rectf (int x, int y, int w, int h)
 Colors 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)
 Colors with passed color a rectangle that exactly fills the given bounding box.
 
FL_EXPORT void fl_rectf (int x, int y, int w, int h, uchar r, uchar g, uchar b)
 Colors a rectangle with "exactly" the passed r,g,b color. More...
 
FL_EXPORT void fl_reset_spot (void)
 
void fl_restore_clip ()
 Undoes any clobbering of clip done by your program.
 
void fl_rotate (double d)
 Concatenates rotation transformation onto the current one. More...
 
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.
 
void fl_scale (double x, double y)
 Concatenates scaling transformation onto the current one. More...
 
void fl_scale (double x)
 Concatenates scaling transformation onto the current one. More...
 
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. More...
 
FL_EXPORT void fl_set_spot (int font, int size, int X, int Y, int W, int H, Fl_Window *win=0)
 
FL_EXPORT void fl_set_status (int X, int Y, int W, int H)
 
FL_EXPORT const char * fl_shortcut_label (unsigned int shortcut)
 Get a human-readable string from a shortcut value. More...
 
FL_EXPORT const char * fl_shortcut_label (unsigned int shortcut, const char **eom)
 Get a human-readable string from a shortcut value. More...
 
Fl_Fontsize fl_size ()
 Returns the size set by the most recent call to fl_font(). More...
 
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. More...
 
void fl_text_extents (const char *t, int n, int &dx, int &dy, int &w, int &h)
 Determines the minimum pixel dimensions of a sequence of n characters. More...
 
double fl_transform_dx (double x, double y)
 Transforms distance using current transformation matrix. More...
 
double fl_transform_dy (double x, double y)
 Transforms distance using current transformation matrix. More...
 
double fl_transform_x (double x, double y)
 Transforms coordinate using the current transformation matrix. More...
 
double fl_transform_y (double x, double y)
 Transforms coordinate using the current transformation matrix. More...
 
void fl_transformed_vertex (double xf, double yf)
 Adds coordinate pair to the vertex list without further transformations. More...
 
void fl_translate (double x, double y)
 Concatenates translation transformation onto the current one. More...
 
void fl_vertex (double x, double y)
 Adds a single vertex to the current path. More...
 
FL_EXPORT double fl_width (const char *txt)
 Returns the typographical width of a nul-terminated string using the current font face and size. More...
 
double fl_width (const char *txt, int n)
 Returns the typographical width of a sequence of n characters using the current font face and size. More...
 
double fl_width (unsigned int c)
 Returns the typographical width of a single character using the current font face and size. More...
 
void fl_xyline (int x, int y, int x1)
 Draws a horizontal line from (x,y) to (x1,y)
 
void fl_xyline (int x, int y, int x1, int y2)
 Draws 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)
 Draws 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)
 Draws a vertical line from (x,y) to (x,y1)
 
void fl_yxline (int x, int y, int y1, int x2)
 Draws 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)
 Draws 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

FL_EXPORT char fl_draw_shortcut
 

Detailed Description

utility header to pull drawing functions together