fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Drawing functions

FLTK global graphics and GUI drawing functions. These functions are declared in <FL/fl_draw.H>, and in <FL/x.H> for offscreen buffer-related ones. More...

Macros

#define fl_clip   fl_push_clip
 

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

void fl_push_clip (int x, int y, int w, int h)
 
void fl_push_no_clip ()
 
void fl_pop_clip ()
 
int fl_not_clipped (int x, int y, int w, int h)
 
int fl_clip_box (int x, int y, int w, int h, int &X, int &Y, int &W, int &H)
 
void fl_restore_clip ()
 
void fl_clip_region (Fl_Region r)
 
Fl_Region fl_clip_region ()
 
void fl_point (int x, int y)
 
void fl_line_style (int style, int width=0, char *dashes=0)
 
void fl_rect (int x, int y, int w, int h)
 
void fl_rect (int x, int y, int w, int h, Fl_Color c)
 
void fl_rectf (int x, int y, int w, int h)
 
void fl_rectf (int x, int y, int w, int h, Fl_Color c)
 
FL_EXPORT void fl_rectf (int x, int y, int w, int h, uchar r, uchar g, uchar b)
 
void fl_line (int x, int y, int x1, int y1)
 
void fl_line (int x, int y, int x1, int y1, int x2, int y2)
 
void fl_loop (int x, int y, int x1, int y1, int x2, int y2)
 
void fl_loop (int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
 
void fl_polygon (int x, int y, int x1, int y1, int x2, int y2)
 
void fl_polygon (int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
 
void fl_xyline (int x, int y, int x1)
 
void fl_xyline (int x, int y, int x1, int y2)
 
void fl_xyline (int x, int y, int x1, int y2, int x3)
 
void fl_yxline (int x, int y, int y1)
 
void fl_yxline (int x, int y, int y1, int x2)
 
void fl_yxline (int x, int y, int y1, int x2, int y3)
 
void fl_arc (int x, int y, int w, int h, double a1, double a2)
 
void fl_pie (int x, int y, int w, int h, double a1, double a2)
 
FL_EXPORT void fl_chord (int x, int y, int w, int h, double a1, double a2)
 
void fl_push_matrix ()
 
void fl_pop_matrix ()
 
void fl_scale (double x, double y)
 
void fl_scale (double x)
 
void fl_translate (double x, double y)
 
void fl_rotate (double d)
 
void fl_mult_matrix (double a, double b, double c, double d, double x, double y)
 
void fl_begin_points ()
 
void fl_begin_line ()
 
void fl_begin_loop ()
 
void fl_begin_polygon ()
 
void fl_vertex (double x, double y)
 
void fl_curve (double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3)
 
void fl_arc (double x, double y, double r, double start, double end)
 
void fl_circle (double x, double y, double r)
 
void fl_end_points ()
 
void fl_end_line ()
 
void fl_end_loop ()
 
void fl_end_polygon ()
 
void fl_begin_complex_polygon ()
 
void fl_gap ()
 
void fl_end_complex_polygon ()
 
double fl_transform_x (double x, double y)
 
double fl_transform_y (double x, double y)
 
double fl_transform_dx (double x, double y)
 
double fl_transform_dy (double x, double y)
 
void fl_transformed_vertex (double xf, double yf)
 
FL_EXPORT void fl_draw (const char *str, int x, int y)
 
FL_EXPORT void fl_draw (int angle, const char *str, int x, int y)
 
void fl_draw (const char *str, int n, int x, int y)
 
void fl_draw (int angle, const char *str, int n, int x, int y)
 
void fl_rtl_draw (const char *str, int n, int x, int y)
 
FL_EXPORT void fl_measure (const char *str, int &x, int &y, int draw_symbols=1)
 
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)
 
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)
 
FL_EXPORT void fl_frame (const char *s, int x, int y, int w, int h)
 
FL_EXPORT void fl_frame2 (const char *s, int x, int y, int w, int h)
 
FL_EXPORT void fl_draw_box (Fl_Boxtype, int x, int y, int w, int h, Fl_Color)
 
void fl_draw_image (const uchar *buf, int X, int Y, int W, int H, int D=3, int L=0)
 
void fl_draw_image_mono (const uchar *buf, int X, int Y, int W, int H, int D=1, int L=0)
 
void fl_draw_image (Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=3)
 
void fl_draw_image_mono (Fl_Draw_Image_Cb cb, void *data, int X, int Y, int W, int H, int D=1)
 
FL_EXPORT char fl_can_do_alpha_blending ()
 
FL_EXPORT ucharfl_read_image (uchar *p, int X, int Y, int W, int H, int alpha=0)
 
FL_EXPORT int fl_draw_pixmap (char *const *data, int x, int y, Fl_Color=FL_GRAY)
 
FL_EXPORT int fl_draw_pixmap (const char *const *cdata, int x, int y, Fl_Color=FL_GRAY)
 
FL_EXPORT int fl_measure_pixmap (char *const *data, int &w, int &h)
 
FL_EXPORT int fl_measure_pixmap (const char *const *cdata, int &w, int &h)
 
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)
 
const FL_EXPORT char * fl_shortcut_label (unsigned int shortcut)
 
const FL_EXPORT char * fl_shortcut_label (unsigned int shortcut, const char **eom)
 
FL_EXPORT unsigned int fl_old_shortcut (const char *s)
 
FL_EXPORT void fl_overlay_rect (int x, int y, int w, int h)
 
FL_EXPORT void fl_overlay_clear ()
 
FL_EXPORT void fl_cursor (Fl_Cursor)
 
FL_EXPORT void fl_cursor (Fl_Cursor, Fl_Color fg, Fl_Color bg=FL_WHITE)
 
const FL_EXPORT char * fl_expand_text (const char *from, char *buf, int maxbuf, double maxw, int &n, double &width, int wrap, int draw_symbols=0)
 
FL_EXPORT void fl_set_status (int X, int Y, int W, int H)
 
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_reset_spot (void)
 
FL_EXPORT int fl_draw_symbol (const char *label, int x, int y, int w, int h, Fl_Color)
 
FL_EXPORT int fl_add_symbol (const char *name, void(*drawit)(Fl_Color), int scalable)
 
void fl_copy_offscreen (int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy)
 

Detailed Description

FLTK global graphics and GUI drawing functions. These functions are declared in <FL/fl_draw.H>, and in <FL/x.H> for offscreen buffer-related ones.

Macro Definition Documentation

◆ fl_clip

#define fl_clip   fl_push_clip

Intersects the current clip region with a rectangle and pushes this new region onto the stack (deprecated).

Parameters
[in]x,y,w,hposition and size
Deprecated:
fl_clip(int, int, int, int) is deprecated and will be removed from future releases. Please use fl_push_clip(int x, int y, int w, int h) instead.

Definition at line 91 of file fl_draw.H.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
FL_SOLID 

line style: ___________

FL_DASH 

line style: _ _ _ _ _ _

FL_DOT 

line style: . . . . . .

FL_DASHDOT 

line style: _ . _ . _ .

FL_DASHDOTDOT 

line style: _ . . _ . .

FL_CAP_FLAT 

cap style: end is flat

FL_CAP_ROUND 

cap style: end is round

FL_CAP_SQUARE 

cap style: end wraps end point

FL_JOIN_MITER 

join style: line join extends to a point

FL_JOIN_ROUND 

join style: line join is rounded

FL_JOIN_BEVEL 

join style: line join is tidied

Definition at line 178 of file fl_draw.H.

Function Documentation

◆ fl_add_symbol()

FL_EXPORT int fl_add_symbol ( const char *  name,
void(*)(Fl_Color drawit,
int  scalable 
)

Adds a symbol to the system.

Parameters
[in]namename of symbol (without the "@")
[in]drawitfunction to draw symbol
[in]scalableset to 1 if drawit uses scalable vector drawing
Returns
1 on success, 0 on failure

Definition at line 78 of file fl_symbols.cxx.

References SYMBOL::drawit, find(), fl_init_symbols(), MAXSYMBOL, SYMBOL::name, name, SYMBOL::notempty, SYMBOL::scalable, symbnumb, and symbols.

Referenced by fl_init_symbols().

◆ fl_arc() [1/2]

void fl_arc ( double  x,
double  y,
double  r,
double  start,
double  end 
)
inline

Adds a series of points to the current path on the arc of a circle. You can get elliptical paths by using scale and rotate before calling fl_arc().

Parameters
[in]x,y,rcenter and radius of circular arc
[in]start,endangles of start and end of arc measured in degrees counter-clockwise from 3 o'clock. If end is less than start then it draws the arc in a clockwise direction.

Examples:

// Draw an arc of points
fl_arc(100.0, 100.0, 50.0, 0.0, 180.0);
// Draw arc with a line
fl_arc(200.0, 100.0, 50.0, 0.0, 180.0);
// Draw filled arc
fl_arc(300.0, 100.0, 50.0, 0.0, 180.0);

Definition at line 416 of file fl_draw.H.

References Fl_Graphics_Driver::arc(), fl_graphics_driver, start(), x, and y.

◆ fl_arc() [2/2]

void fl_arc ( int  x,
int  y,
int  w,
int  h,
double  a1,
double  a2 
)
inline

Draw ellipse sections using integer coordinates.

These functions match the rather limited circle drawing code provided by X and WIN32. The advantage over using fl_arc with floating point coordinates is that they are faster because they often use the hardware, and they draw much nicer small circles, since the small sizes are often hard-coded bitmaps.

If a complete circle is drawn it will fit inside the passed bounding box. The two angles are measured in degrees counter-clockwise from 3 o'clock and are the starting and ending angle of the arc, a2 must be greater or equal to a1.

fl_arc() draws a series of lines to approximate the arc. Notice that the integer version of fl_arc() has a different number of arguments than the double version fl_arc(double x, double y, double r, double start, double end)

Parameters
[in]x,y,w,hbounding box of complete circle
[in]a1,a2start and end angles of arc measured in degrees counter-clockwise from 3 o'clock. a2 must be greater than or equal to a1.

Definition at line 304 of file fl_draw.H.

References Fl_Graphics_Driver::arc(), fl_graphics_driver, Fl_Image::h(), Fl_Image::w(), x, and y.

Referenced by Fl_Light_Button::draw(), Fl_Dial::draw(), Fl_Menu_Item::draw(), draw_piechart(), fl_arc_i(), fl_oval_frame(), and frame_round().

◆ fl_begin_complex_polygon()

void fl_begin_complex_polygon ( )
inline

Starts drawing a complex filled polygon.

The polygon may be concave, may have holes in it, or may be several disconnected pieces. Call fl_gap() to separate loops of the path.

To outline the polygon, use fl_begin_loop() and replace each fl_gap() with fl_end_loop();fl_begin_loop() pairs.

Note
For portability, you should only draw polygons that appear the same whether "even/odd" or "non-zero" winding rules are used to fill them. Holes should be drawn in the opposite direction to the outside loop.

Definition at line 455 of file fl_draw.H.

References Fl_Graphics_Driver::begin_complex_polygon(), and fl_graphics_driver.

Referenced by Fl_File_Icon::draw().

◆ fl_begin_line()

void fl_begin_line ( )
inline

Starts drawing a list of lines.

Definition at line 366 of file fl_draw.H.

References Fl_Graphics_Driver::begin_line(), and fl_graphics_driver.

Referenced by Fl_File_Icon::draw().

◆ fl_begin_loop()

void fl_begin_loop ( )
inline

Starts drawing a closed sequence of lines.

Definition at line 370 of file fl_draw.H.

References Fl_Graphics_Driver::begin_loop(), and fl_graphics_driver.

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_File_Icon::draw(), draw_piechart(), drawhand(), gtk_down_frame(), gtk_up_frame(), and rbox().

◆ fl_begin_points()

void fl_begin_points ( )
inline

Starts drawing a list of points. Points are added to the list with fl_vertex()

Definition at line 362 of file fl_draw.H.

References Fl_Graphics_Driver::begin_points(), and fl_graphics_driver.

◆ fl_begin_polygon()

void fl_begin_polygon ( )
inline

Starts drawing a convex filled polygon.

Definition at line 374 of file fl_draw.H.

References Fl_Graphics_Driver::begin_polygon(), and fl_graphics_driver.

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), draw_piechart(), drawhand(), rbox(), and rect().

◆ fl_can_do_alpha_blending()

FL_EXPORT char fl_can_do_alpha_blending ( )

Checks whether platform supports true alpha blending for RGBA images.

Returns
1 if true alpha blending supported by platform
0 not supported so FLTK will use screen door transparency

Referenced by Fl_Xlib_Graphics_Driver::draw(), and innards().

◆ fl_chord()

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_circle()

void fl_circle ( double  x,
double  y,
double  r 
)
inline

fl_circle() is equivalent to fl_arc(x,y,r,0,360), but may be faster.

It must be the only thing in the path: if you want a circle as part of a complex polygon you must use fl_arc()

Parameters
[in]x,y,rcenter and radius of circle

Definition at line 424 of file fl_draw.H.

References Fl_Graphics_Driver::circle(), fl_graphics_driver, x, and y.

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), draw_circle(), and draw_search().

◆ fl_clip_box()

int fl_clip_box ( int  x,
int  y,
int  w,
int  h,
int &  X,
int &  Y,
int &  W,
int &  H 
)
inline

Intersects the rectangle with the current clip region and returns the bounding box of the result.

Returns non-zero if the resulting rectangle is different to the original. This can be used to limit the necessary drawing to a rectangle. W and H are set to zero if the rectangle is completely outside the region.

Parameters
[in]x,y,w,hposition and size of rectangle
[out]X,Y,W,Hposition and size of resulting bounding box.
Returns
Non-zero if the resulting rectangle is different to the original.

Definition at line 126 of file fl_draw.H.

References Fl_Graphics_Driver::clip_box(), fl_graphics_driver, H, Fl_Image::h(), Fl_Image::w(), x, y, and Y.

Referenced by Fl_Text_Display::draw(), Fl_Double_Window::flush(), innards(), Fl_Bitmap::start(), and start().

◆ fl_clip_region() [1/2]

Fl_Region fl_clip_region ( )
inline

Returns the current clipping region.

Definition at line 140 of file fl_draw.H.

References Fl_Graphics_Driver::clip_region(), and fl_graphics_driver.

◆ fl_clip_region() [2/2]

void fl_clip_region ( Fl_Region  r)
inline

Replaces the top of the clipping stack with a clipping region of any shape.

Fl_Region is an operating system specific type.

Parameters
[in]rclipping region

Definition at line 136 of file fl_draw.H.

References Fl_Graphics_Driver::clip_region(), and fl_graphics_driver.

Referenced by fl_drawUCS4(), Fl_Menu_Window::flush(), Fl_Double_Window::flush(), Fl_Window::flush(), and Fl_Window::make_current().

◆ 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.

Parameters
x,yposition where to draw the copied rectangle
w,hsize of the copied rectangle
pixmapoffscreen buffer containing the rectangle to copy
srcx,srcyorigin in offscreen buffer of rectangle to copy

Definition at line 98 of file Fl_Double_Window.cxx.

References Fl_Graphics_Driver::class_name(), Fl_Graphics_Driver::copy_offscreen(), Fl_Display_Device::display_device(), Fl_Surface_Device::driver(), fl_graphics_driver, pixmap, x, and y.

Referenced by Fl_Double_Window::flush().

◆ fl_cursor() [1/2]

FL_EXPORT void fl_cursor ( Fl_Cursor  c)

Sets the cursor for the current window to the specified shape and colors. The cursors are defined in the <FL/Enumerations.H> header file.

Definition at line 42 of file fl_cursor.cxx.

References Fl_Window::cursor(), and Fl::first_window().

Referenced by Fl_Table::change_cursor(), fl_cursor(), Fl_Help_View::handle(), and Fl_File_Chooser::show().

◆ fl_cursor() [2/2]

FL_EXPORT void fl_cursor ( Fl_Cursor  ,
Fl_Color  fg,
Fl_Color  bg = FL_WHITE 
)

Definition at line 47 of file fl_cursor.cxx.

References fl_cursor().

◆ fl_curve()

void fl_curve ( double  X0,
double  Y0,
double  X1,
double  Y1,
double  X2,
double  Y2,
double  X3,
double  Y3 
)
inline

Adds a series of points on a Bezier curve to the path. The curve ends (and two of the points) are at X0,Y0 and X3,Y3.

Parameters
[in]X0,Y0curve start point
[in]X1,Y1curve control point
[in]X2,Y2curve control point
[in]X3,Y3curve end point

Definition at line 388 of file fl_draw.H.

References Fl_Graphics_Driver::curve(), and fl_graphics_driver.

◆ fl_draw() [1/6]

void fl_draw ( const char *  str,
int  n,
int  x,
int  y 
)
inline

Draws starting at the given x, y location a UTF-8 string of length n bytes.

Definition at line 618 of file fl_draw.H.

References Fl_Graphics_Driver::draw(), fl_graphics_driver, x, and y.

◆ fl_draw() [2/6]

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.

Text is aligned to the left and to the baseline of the font. To align to the bottom, subtract fl_descent() from y. To align to the top, subtract fl_descent() and add fl_height(). This version of fl_draw provides direct access to the text drawing function of the underlying OS. It does not apply any special handling to control characters.

Definition at line 70 of file fl_font.cxx.

References x, and y.

Referenced by Shortcut_Button::draw(), Fl_Value_Slider::draw(), Fl_Value_Output::draw(), Fl_Timer::draw(), Fl_TooltipBox::draw(), Fl_Counter::draw(), Fl_Tree_Item::draw(), draw_barchart(), draw_height(), draw_horbarchart(), Fl_Text_Display::draw_line_numbers(), draw_linechart(), draw_piechart(), Fl_Text_Display::draw_string(), draw_width(), Fluid_Table::DrawData(), menuwindow::drawentry(), Fluid_Table::DrawHeader(), fl_draw(), fl_normal_label(), Fl_Help_View::hv_draw(), innards(), Fl_Check_Browser::item_draw(), Fl_File_Browser::item_draw(), Fl_Browser::item_draw(), Widget_Browser::item_draw(), and print_menu_cb().

◆ fl_draw() [3/6]

FL_EXPORT void fl_draw ( const char *  str,
int  x,
int  y,
int  w,
int  h,
Fl_Align  align,
Fl_Image img,
int  draw_symbols 
)

Fancy string drawing function which is used to draw all the labels.

The string is formatted and aligned inside the passed box. Handles '\t' and '\n', expands all other control characters to '^X', and aligns inside or against the edges of the box. See Fl_Widget::align() for values of align. The value FL_ALIGN_INSIDE is ignored, as this function always prints inside the box. If img is provided and is not NULL, the image is drawn above or below the text as specified by the align value. The draw_symbols argument specifies whether or not to look for symbol names starting with the '@' character'

Definition at line 336 of file fl_draw.cxx.

References FL_ALIGN_CLIP, FL_ALIGN_INSIDE, fl_draw(), fl_not_clipped(), fl_pop_clip(), fl_push_clip(), x, and y.

◆ fl_draw() [4/6]

FL_EXPORT void fl_draw ( const char *  str,
int  x,
int  y,
int  w,
int  h,
Fl_Align  align,
void(*)(const char *, int, int, int)  callthis,
Fl_Image img,
int  draw_symbols 
)

◆ fl_draw() [5/6]

void fl_draw ( int  angle,
const char *  str,
int  n,
int  x,
int  y 
)
inline

Draws at the given x, y location a UTF-8 string of length n bytes rotating angle degrees counter-clockwise.

Note
When using X11 (Unix, Linux, Cygwin et al.) this needs Xft to work. Under plain X11 (w/o Xft) rotated text is not supported by FLTK. A warning will be issued to stderr at runtime (only once) if you use this method with an angle other than 0.

Definition at line 628 of file fl_draw.H.

References Fl_Graphics_Driver::draw(), fl_graphics_driver, x, and y.

◆ fl_draw() [6/6]

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. This version of fl_draw provides direct access to the text drawing function of the underlying OS and is supported by Xft, Win32 and MacOS fltk subsets.

Definition at line 74 of file fl_font.cxx.

References fl_draw(), x, and y.

◆ fl_draw_box()

FL_EXPORT void fl_draw_box ( Fl_Boxtype  t,
int  x,
int  y,
int  w,
int  h,
Fl_Color  c 
)

Draws a box using given type, position, size and color.

Parameters
[in]tbox type
[in]x,y,w,hposition and size
[in]ccolor

Definition at line 436 of file fl_boxtype.cxx.

References f, fl_box_table, x, and y.

Referenced by ColorMenu::draw(), menuwindow::draw(), Fl_Tree_Item::draw(), Fl_Menu_Item::draw(), ColorMenu::drawbox(), Fluid_Table::DrawHeader(), fl_drw_box(), and fl_drw_frame().

◆ fl_draw_image() [1/2]

void fl_draw_image ( const uchar buf,
int  X,
int  Y,
int  W,
int  H,
int  D = 3,
int  L = 0 
)
inline

Draws an 8-bit per color RGB or luminance image.

Parameters
[in]bufpoints at the "r" data of the top-left pixel. Color data must be in r,g,b order. Luminance data is only one gray byte.
[in]X,Yposition where to put top-left corner of image
[in]W,Hsize of the image
[in]Ddelta to add to the pointer between pixels. It may be any value greater than or equal to 1, or it can be negative to flip the image horizontally
[in]Ldelta to add to the pointer between lines (if 0 is passed it uses W * D), and may be larger than W * D to crop data, or negative to flip the image vertically

It is highly recommended that you put the following code before the first show() of any window in your program to get rid of the dithering if possible:

Gray scale (1-channel) images may be drawn. This is done if abs(D) is less than 3, or by calling fl_draw_image_mono(). Only one 8-bit sample is used for each pixel, and on screens with different numbers of bits for red, green, and blue only gray colors are used. Setting D greater than 1 will let you display one channel of a color image.

Note:
The X version does not support all possible visuals. If FLTK cannot draw the image in the current visual it will abort. FLTK supports any visual of 8 bits or less, and all common TrueColor visuals up to 32 bits.

Definition at line 685 of file fl_draw.H.

References buf, Fl_Graphics_Driver::draw_image(), fl_graphics_driver, H, and Y.

Referenced by alpha_blend(), Flcc_HueBox::draw(), Flcc_ValueBox::draw(), Fl_Paged_Device::draw_decorated_window(), erase_current_rect(), fl_draw_pixmap(), Fl_Gl_Device_Plugin::print(), and Fl_Paged_Device::print_window_part().

◆ fl_draw_image() [2/2]

void fl_draw_image ( Fl_Draw_Image_Cb  cb,
void *  data,
int  X,
int  Y,
int  W,
int  H,
int  D = 3 
)
inline

Draws an image using a callback function to generate image data.

You can generate the image as it is being drawn, or do arbitrary decompression of stored data, provided it can be decompressed to individual scan lines easily.

Parameters
[in]cbcallback function to generate scan line data
[in]datauser data passed to callback function
[in]X,Yscreen position of top left pixel
[in]W,Himage width and height
[in]Ddata size in bytes (must be greater than 0)
See also
fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L)

The callback function cb is called with the void* data user data pointer to allow access to a structure of information about the image, and the x, y, and w of the scan line desired from the image. 0,0 is the upper-left corner of the image, not x, y. A pointer to a buffer to put the data into is passed. You must copy w pixels from scanline y, starting at pixel x, to this buffer.

Due to cropping, less than the whole image may be requested. So x may be greater than zero, the first y may be greater than zero, and w may be less than W. The buffer is long enough to store the entire W * D pixels, this is for convenience with some decompression schemes where you must decompress the entire line at once: decompress it into the buffer, and then if x is not zero, copy the data over so the x'th pixel is at the start of the buffer.

You can assume the y's will be consecutive, except the first one may be greater than zero.

If D is 4 or more, you must fill in the unused bytes with zero.

Definition at line 728 of file fl_draw.H.

References cb(), Fl_Image::data(), Fl_Graphics_Driver::draw_image(), fl_graphics_driver, H, and Y.

◆ fl_draw_image_mono() [1/2]

void fl_draw_image_mono ( const uchar buf,
int  X,
int  Y,
int  W,
int  H,
int  D = 1,
int  L = 0 
)
inline

Draws a gray-scale (1 channel) image.

See also
fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L)

Definition at line 692 of file fl_draw.H.

References buf, Fl_Graphics_Driver::draw_image_mono(), fl_graphics_driver, H, and Y.

◆ fl_draw_image_mono() [2/2]

void fl_draw_image_mono ( Fl_Draw_Image_Cb  cb,
void *  data,
int  X,
int  Y,
int  W,
int  H,
int  D = 1 
)
inline

Draws a gray-scale image using a callback function to generate image data.

See also
fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D)

Definition at line 735 of file fl_draw.H.

References cb(), Fl_Image::data(), Fl_Graphics_Driver::draw_image_mono(), fl_graphics_driver, H, and Y.

◆ fl_draw_pixmap() [1/2]

FL_EXPORT int fl_draw_pixmap ( char *const data,
int  x,
int  y,
Fl_Color  bg 
)

Draw XPM image data, with the top-left corner at the given position. The image is dithered on 8-bit displays so you won't lose color space for programs displaying both images and pixmaps.

Parameters
[in]datapointer to XPM image data
[in]x,yposition of top-left corner
[in]bgbackground color
Returns
0 if there was any error decoding the XPM data.

Definition at line 78 of file fl_draw_pixmap.cxx.

References x, and y.

Referenced by Fl_PostScript_Graphics_Driver::draw(), and Fl_Pixmap::prepare().

◆ fl_draw_pixmap() [2/2]

FL_EXPORT int fl_draw_pixmap ( const char *const cdata,
int  x,
int  y,
Fl_Color  bg 
)

◆ fl_draw_symbol()

FL_EXPORT int fl_draw_symbol ( const char *  label,
int  x,
int  y,
int  w,
int  h,
Fl_Color  col 
)

Draw the named symbol in the given rectangle using the given color

Parameters
[in]labelname of symbol
[in]x,yposition of symbol
[in]w,hsize of symbol
[in]colcolor of symbox
Returns
1 on success, 0 on failure

Definition at line 103 of file fl_symbols.cxx.

References SYMBOL::drawit, find(), fl_init_symbols(), fl_pop_matrix(), fl_push_matrix(), fl_return_arrow(), fl_rotate(), fl_scale(), fl_translate(), p, symbols, x, and y.

Referenced by Fl_Counter::draw(), and fl_draw().

◆ fl_end_complex_polygon()

void fl_end_complex_polygon ( )
inline

Ends complex filled polygon, and draws.

Definition at line 466 of file fl_draw.H.

References Fl_Graphics_Driver::end_complex_polygon(), and fl_graphics_driver.

Referenced by Fl_File_Icon::draw().

◆ fl_end_line()

void fl_end_line ( )
inline

Ends list of lines, and draws.

Definition at line 432 of file fl_draw.H.

References Fl_Graphics_Driver::end_line(), and fl_graphics_driver.

Referenced by Fl_File_Icon::draw().

◆ fl_end_loop()

void fl_end_loop ( )
inline

Ends closed sequence of lines, and draws.

Definition at line 436 of file fl_draw.H.

References Fl_Graphics_Driver::end_loop(), and fl_graphics_driver.

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_File_Icon::draw(), draw_piechart(), drawhand(), gtk_down_frame(), gtk_up_frame(), and rbox().

◆ fl_end_points()

void fl_end_points ( )
inline

Ends list of points, and draws.

Definition at line 428 of file fl_draw.H.

References Fl_Graphics_Driver::end_points(), and fl_graphics_driver.

◆ fl_end_polygon()

void fl_end_polygon ( )
inline

Ends convex filled polygon, and draws.

Definition at line 440 of file fl_draw.H.

References Fl_Graphics_Driver::end_polygon(), and fl_graphics_driver.

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_File_Icon::draw(), draw_piechart(), drawhand(), rbox(), and rect().

◆ fl_expand_text()

const FL_EXPORT char* fl_expand_text ( const char *  from,
char *  buf,
int  maxbuf,
double  maxw,
int &  n,
double &  width,
int  wrap,
int  draw_symbols 
)

Copy from to buf, replacing control characters with ^X.

Stop at a newline or if maxbuf characters written to buffer. Also word-wrap if width exceeds maxw. Returns a pointer to the start of the next line of characters. Sets n to the number of characters put into the buffer. Sets width to the width of the string in the current font.

Definition at line 135 of file fl_draw.cxx.

References buf, and expand_text_().

◆ fl_frame()

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. The string s must contain groups of 4 letters which specify one of 24 standard grayscale values, where 'A' is black and 'X' is white. The order of each set of 4 characters is: top, left, bottom, right. The result of calling fl_frame() with a string that is not a multiple of 4 characters in length is undefined. The only difference between this function and fl_frame2() is the order of the line segments.

Parameters
[in]ssets of 4 grayscale values in top, left, bottom, right order
[in]x,y,w,hposition and size

Definition at line 107 of file fl_boxtype.cxx.

References fl_color(), fl_gray_ramp(), fl_xyline(), fl_yxline(), x, and y.

Referenced by fl_down_frame(), fl_embossed_frame(), fl_engraved_frame(), and fl_up_frame().

◆ fl_frame2()

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. The string s must contain groups of 4 letters which specify one of 24 standard grayscale values, where 'A' is black and 'X' is white. The order of each set of 4 characters is: bottom, right, top, left. The result of calling fl_frame2() with a string that is not a multiple of 4 characters in length is undefined. The only difference between this function and fl_frame() is the order of the line segments.

Parameters
[in]ssets of 4 grayscale values in bottom, right, top, left order
[in]x,y,w,hposition and size

Definition at line 141 of file fl_boxtype.cxx.

References fl_color(), fl_gray_ramp(), fl_xyline(), fl_yxline(), x, and y.

Referenced by fl_down_frame(), fl_thin_down_frame(), fl_thin_up_frame(), and fl_up_frame().

◆ fl_gap()

void fl_gap ( )
inline

Call fl_gap() to separate loops of the path.

It is unnecessary but harmless to call fl_gap() before the first vertex, after the last vertex, or several times in a row.

Definition at line 462 of file fl_draw.H.

References fl_graphics_driver, and Fl_Graphics_Driver::gap().

◆ fl_line() [1/2]

◆ fl_line() [2/2]

void fl_line ( int  x,
int  y,
int  x1,
int  y1,
int  x2,
int  y2 
)
inline

Draws a line from (x,y) to (x1,y1) and another from (x1,y1) to (x2,y2)

Definition at line 227 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::line(), x, and y.

◆ fl_line_style()

void fl_line_style ( int  style,
int  width = 0,
char *  dashes = 0 
)
inline

Sets how to draw lines (the "pen"). If you change this it is your responsibility to set it back to the default using fl_line_style(0).

Parameters
[in]styleA bitmask which is a bitwise-OR of a line style, a cap style, and a join style. If you don't specify a dash type you will get a solid line. If you don't specify a cap or join type you will get a system-defined default of whatever value is fastest.
[in]widthThe thickness of the lines in pixels. Zero results in the system defined default, which on both X and Windows is somewhat different and nicer than 1.
[in]dashesA pointer to an array of dash lengths, measured in pixels. The first location is how long to draw a solid portion, the next is how long to draw the gap, then the solid, etc. It is terminated with a zero-length entry. A NULL pointer or a zero-length array results in a solid line. Odd array sizes are not supported and result in undefined behavior.
Note
Because of how line styles are implemented on Win32 systems, you must set the line style after setting the drawing color. If you set the color after the line style you will lose the line style settings.
The dashes array does not work under Windows 95, 98 or Me, since those operating systems do not support complex line styles.

Definition at line 177 of file fl_draw.H.

References fl_graphics_driver, and Fl_Graphics_Driver::line_style().

Referenced by draw_current_rect(), Fl_Widget::draw_focus(), draw_item_focus(), Fl_Window_Type::draw_overlay(), and draw_search().

◆ fl_loop() [1/2]

void fl_loop ( int  x,
int  y,
int  x1,
int  y1,
int  x2,
int  y2 
)
inline

Outlines a 3-sided polygon with lines

Definition at line 233 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::loop(), x, and y.

Referenced by fl_diamond_down_box(), fl_diamond_up_box(), Fl_Check_Browser::item_draw(), and Widget_Browser::item_draw().

◆ fl_loop() [2/2]

void fl_loop ( int  x,
int  y,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
)
inline

Outlines a 4-sided polygon with lines

Definition at line 237 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::loop(), x, and y.

◆ fl_measure()

FL_EXPORT void fl_measure ( const char *  str,
int &  w,
int &  h,
int  draw_symbols 
)

Measure how wide and tall the string will be when printed by the fl_draw() function with align parameter. If the incoming w is non-zero it will wrap to that width.

The current font is used to do the width/height calculations, so unless its value is known at the time fl_measure() is called, it is advised to first set the current font with fl_font(). With event-driven GUI programming you can never be sure which widget was exposed and redrawn last, nor which font it used. If you have not called fl_font() explicitly in your own code, the width and height may be set to unexpected values, even zero!

Note: In the general use case, it's a common error to forget to set w to 0 before calling fl_measure() when wrap behavior isn't needed.

Parameters
[in]strnul-terminated string
[out]w,hwidth and height of string in current font
[in]draw_symbolsnon-zero to enable @symbol handling [default=1]
// Example: Common use case for fl_measure()
const char *s = "This is a test";
int wi=0, hi=0; // initialize to zero before calling fl_measure()
fl_font(FL_HELVETICA, 14); // set current font face/size to be used for measuring
fl_measure(s, wi, hi); // returns pixel width/height of string in current font

Definition at line 380 of file fl_draw.cxx.

References buflen, expand_text_(), fl_height(), linebuf, NULL, and p.

Referenced by Fl_Tree_Item::draw(), fl_normal_measure(), Fl_TooltipBox::layout(), and resizeform().

◆ fl_measure_pixmap() [1/2]

FL_EXPORT int fl_measure_pixmap ( char *const data,
int &  w,
int &  h 
)

Get the dimensions of a pixmap. An XPM image contains the dimensions in its data. This function returns the width and height.

Parameters
[in]datapointer to XPM image data.
[out]w,hwidth and height of image
Returns
non-zero if the dimensions were parsed OK
0 if there were any problems

Definition at line 52 of file fl_draw_pixmap.cxx.

Referenced by Fl_PostScript_Graphics_Driver::draw(), fl_convert_pixmap(), fl_draw_pixmap(), and Fl_Pixmap::measure().

◆ fl_measure_pixmap() [2/2]

FL_EXPORT int fl_measure_pixmap ( const char *const cdata,
int &  w,
int &  h 
)

Get the dimensions of a pixmap.

See also
fl_measure_pixmap(char* const* data, int &w, int &h)

Definition at line 60 of file fl_draw_pixmap.cxx.

References chars_per_pixel, and ncolors.

◆ fl_mult_matrix()

void fl_mult_matrix ( double  a,
double  b,
double  c,
double  d,
double  x,
double  y 
)
inline

Concatenates another transformation onto the current one.

Parameters
[in]a,b,c,d,x,ytransformation matrix elements such that X' = aX + cY + x and Y' = bX +dY + y

Definition at line 357 of file fl_draw.H.

References b, Fl_Image::d(), fl_graphics_driver, Fl_Graphics_Driver::mult_matrix(), x, and y.

◆ fl_not_clipped()

int fl_not_clipped ( int  x,
int  y,
int  w,
int  h 
)
inline

Does the rectangle intersect the current clip region?

Parameters
[in]x,y,w,hposition and size of rectangle
Returns
non-zero if any of the rectangle intersects the current clip region. If this returns 0 you don't have to draw the object.
Note
Under X this returns 2 if the rectangle is partially clipped, and 1 if it is entirely inside the clip region.

Definition at line 114 of file fl_draw.H.

References fl_graphics_driver, Fl_Image::h(), Fl_Graphics_Driver::not_clipped(), Fl_Image::w(), x, and y.

Referenced by Fl_Tiled_Image::draw(), Fl_Group::draw_child(), fl_draw(), and Fl_Group::update_child().

◆ fl_old_shortcut()

FL_EXPORT unsigned int fl_old_shortcut ( const char *  s)

Emulation of XForms named shortcuts.

Converts ascii shortcut specifications (eg. "^c") into the FLTK integer equivalent (eg. FL_CTRL+'c')

These ascii characters are used to specify the various keyboard modifier keys:

 # - Alt
 + - Shift
 ^ - Control
 ! - Meta
 @ - Command (Ctrl on linux/win, Meta on OSX)

These special characters can be combined to form chords of modifier keys. (See 'Remarks' below)

After the optional modifier key prefixes listed above, one can either specify a single keyboard character to use as the shortcut, or a numeric sequence in hex, decimal or octal.

Examples:

 "c"      -- Uses 'c' as the shortcut
 "#^c"    -- Same as FL_ALT|FL_CTRL|'c'
 "#^!c"   -- Same as FL_ALT|FL_CTRL|FL_META|'c'
 "@c"     -- Same as FL_COMMAND|'c' (see FL_COMMAND for platform specific behavior)
 "0x63"   -- Same as "c" (hex 63=='c')
 "99"     -- Same as "c" (dec 99=='c')
 "0143"   -- Same as "c" (octal 0143=='c')
 "^0x63"  -- Same as (FL_CTRL|'c'), or (FL_CTRL|0x63)
 "^99"    -- Same as (FL_CTRL|'c'), or (FL_CTRL|99)
 "^0143"  -- Same as (FL_CTRL|'c'), or (FL_CTRL|0143)
Remarks
Due to XForms legacy, there are some odd things to consider when using the modifier characters.
(1) You can use the special modifier keys for chords only if the modifiers are provided in this order: #, +, ^, !, @. Other ordering can yield undefined results.
So for instance, Ctrl-Alt-c must be specified as "#^c" (and not "^#c"), due to the above ordering rule.
(2) If you want to make a shortcut that uses one of the special modifier characters (as the character being modified), then to avoid confusion, specify the numeric equivalent, e.g.
 If you want..                    Then use..
 -----------------------------    ------------------------------
 '#' as the shortcut..            "0x23"  (instead of just "#").
 '+' as the shortcut..            "0x2b"  (instead of just "+").
 '^' as the shortcut..            "0x5e"  (instead of just "^").
 Alt-+ as the shortcut..          "#0x2b" (instead of "#+").
 Alt-^ as the shortcut..          "#0x5e" (instead of "#^").
 ..etc..
As a general rule that's easy to remember, unless the shortcut key to be modified is a single alpha-numeric character [A-Z,a-z,0-9), it's probably best to use the numeric equivalents.
Todo:
Fix these silly legacy issues in a future release to support more predictable behavior for the modifier keys.

Definition at line 396 of file fl_shortcut.cxx.

◆ fl_overlay_clear()

FL_EXPORT void fl_overlay_clear ( )

Erase a selection rectangle without drawing a new one

Definition at line 100 of file fl_overlay.cxx.

References erase_current_rect(), and pw.

◆ fl_overlay_rect()

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.

Definition at line 107 of file fl_overlay.cxx.

References draw_current_rect(), erase_current_rect(), ph, pw, px, py, x, and y.

◆ fl_pie()

void fl_pie ( int  x,
int  y,
int  w,
int  h,
double  a1,
double  a2 
)
inline

Draw filled ellipse sections using integer coordinates.

Like fl_arc(), but fl_pie() draws a filled-in pie slice. This slice may extend outside the line drawn by fl_arc(); to avoid this use w - 1 and h - 1.

Parameters
[in]x,y,w,hbounding box of complete circle
[in]a1,a2start and end angles of arc measured in degrees counter-clockwise from 3 o'clock. a2 must be greater than or equal to a1.

Definition at line 317 of file fl_draw.H.

References fl_graphics_driver, Fl_Image::h(), Fl_Graphics_Driver::pie(), Fl_Image::w(), x, and y.

Referenced by Fl_Light_Button::draw(), Fl_Dial::draw(), draw(), Fl_Menu_Item::draw(), fl_oval_flat_box(), and shade_round().

◆ fl_point()

void fl_point ( int  x,
int  y 
)
inline

Draws a single pixel at the given coordinates

Definition at line 147 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::point(), x, and y.

Referenced by Fl_Widget::draw_focus(), Fl_Tree_Item::draw_horizontal_connector(), draw_item_focus(), Fl_Tree_Item::draw_vertical_connector(), and shade_rect().

◆ fl_polygon() [1/2]

void fl_polygon ( int  x,
int  y,
int  x1,
int  y1,
int  x2,
int  y2 
)
inline

◆ fl_polygon() [2/2]

void fl_polygon ( int  x,
int  y,
int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3 
)
inline

Fills a 4-sided polygon. The polygon must be convex.

Definition at line 248 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::polygon(), x, and y.

◆ fl_pop_clip()

◆ fl_pop_matrix()

void fl_pop_matrix ( )
inline

Restores the current transformation matrix from the stack.

Definition at line 330 of file fl_draw.H.

References fl_graphics_driver, and Fl_Graphics_Driver::pop_matrix().

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_File_Icon::draw(), drawhand(), and fl_draw_symbol().

◆ fl_push_clip()

◆ fl_push_matrix()

void fl_push_matrix ( )
inline

Saves the current transformation matrix on the stack. The maximum depth of the stack is 32.

Definition at line 326 of file fl_draw.H.

References fl_graphics_driver, and Fl_Graphics_Driver::push_matrix().

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_File_Icon::draw(), drawhand(), and fl_draw_symbol().

◆ fl_push_no_clip()

void fl_push_no_clip ( )
inline

Pushes an empty clip region onto the stack so nothing will be clipped.

Definition at line 95 of file fl_draw.H.

References fl_graphics_driver, and Fl_Graphics_Driver::push_no_clip().

Referenced by Fl_Image_Surface::set_current(), and Fl_Copy_Surface::set_current().

◆ fl_read_image()

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.

Parameters
[in]ppixel buffer, or NULL to allocate one
[in]X,Yposition of top-left of image to read
[in]W,Hwidth and height of image to read
[in]alphaalpha value for image (0 for none)
Returns
pointer to pixel buffer, or NULL if allocation failed.

The p argument points to a buffer that can hold the image and must be at least W*H*3 bytes when reading RGB images, or W*H*4 bytes when reading RGBA images. If NULL, fl_read_image() will create an array of the proper size which can be freed using delete[].

The alpha parameter controls whether an alpha channel is created and the value that is placed in the alpha channel. If 0, no alpha channel is generated.

Definition at line 152 of file fl_read_image.cxx.

References Fl_RGB_Image::alloc_array, Fl_RGB_Image::array, Fl_Window::current(), fl_find(), fl_gc, fl_window, NULL, p, read_win_rectangle(), traverse_to_gl_subwindows(), x, y, and Y.

Referenced by alpha_blend(), Fl_Graphics_Driver::copy_offscreen(), draw_current_rect(), Fl_Paged_Device::draw_decorated_window(), Fl_Image_Surface::image(), Fl::paste(), Fl_Paged_Device::print_window_part(), Overlay_Window::read_image(), Fl_PostScript_Graphics_Driver::transformed_draw_extra(), and Fl_Copy_Surface::~Fl_Copy_Surface().

◆ fl_rect() [1/2]

void fl_rect ( int  x,
int  y,
int  w,
int  h 
)
inline

Draws a 1-pixel border inside the given bounding box. This function is meant for quick drawing of simple boxes. The behavior is undefined for line widths that are not 1.

Definition at line 201 of file fl_draw.H.

References fl_graphics_driver, Fl_Image::h(), Fl_Graphics_Driver::rect(), Fl_Image::w(), x, and y.

Referenced by Fl_Help_View::draw(), draw_current_rect(), Fl_Image::draw_empty(), Fl_Widget::draw_focus(), draw_item_focus(), Fl_Window_Type::draw_overlay(), Fluid_Table::DrawData(), erase_current_rect(), fl_rect(), fl_rectbound(), and fl_shadow_frame().

◆ fl_rect() [2/2]

void fl_rect ( int  x,
int  y,
int  w,
int  h,
Fl_Color  c 
)
inline

Draws with passed color a 1-pixel border inside the given bounding box

Definition at line 204 of file fl_draw.H.

References fl_color(), fl_rect(), Fl_Image::h(), Fl_Image::w(), x, and y.

◆ fl_rectf() [1/3]

◆ fl_rectf() [2/3]

void fl_rectf ( int  x,
int  y,
int  w,
int  h,
Fl_Color  c 
)
inline

Colors with passed color a rectangle that exactly fills the given bounding box

Definition at line 208 of file fl_draw.H.

References fl_color(), fl_rectf(), Fl_Image::h(), Fl_Image::w(), x, and y.

◆ fl_rectf() [3/3]

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. On screens with less than 24 bits of color this is done by drawing a solid-colored block using fl_draw_image() so that the correct color shade is produced.

Definition at line 602 of file fl_draw_image.cxx.

References b, fl_color(), fl_palette, fl_visual, innards(), x, and y.

◆ fl_reset_spot()

FL_EXPORT void fl_reset_spot ( void  )
Todo:
provide user documentation for fl_reset_spot function

Definition at line 271 of file Fl_win32.cxx.

References spot.

Referenced by Fl_Input_::handletext().

◆ fl_restore_clip()

void fl_restore_clip ( )
inline

Undoes any clobbering of clip done by your program

Definition at line 129 of file fl_draw.H.

References fl_graphics_driver, and Fl_Graphics_Driver::restore_clip().

Referenced by Fl_Double_Window::flush().

◆ fl_rotate()

void fl_rotate ( double  d)
inline

Concatenates rotation transformation onto the current one.

Parameters
[in]d- rotation angle, counter-clockwise in degrees (not radians)

Definition at line 350 of file fl_draw.H.

References Fl_Image::d(), fl_graphics_driver, and Fl_Graphics_Driver::rotate().

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), draw_0arrowbar(), draw_0arrowbox(), draw_0bararrow(), draw_arrow01(), draw_arrow02(), draw_arrow03(), draw_refresh(), draw_reload(), drawhand(), and fl_draw_symbol().

◆ fl_rtl_draw()

void fl_rtl_draw ( const char *  str,
int  n,
int  x,
int  y 
)
inline

Draws a UTF-8 string of length n bytes right to left starting at the given x, y location.

Definition at line 632 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::rtl_draw(), x, and y.

◆ fl_scale() [1/2]

void fl_scale ( double  x)
inline

Concatenates scaling transformation onto the current one.

Parameters
[in]xscale factor in both x-direction and y-direction

Definition at line 340 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::scale(), and x.

◆ fl_scale() [2/2]

void fl_scale ( double  x,
double  y 
)
inline

Concatenates scaling transformation onto the current one.

Parameters
[in]x,yscale factors in x-direction and y-direction

Definition at line 335 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::scale(), x, and y.

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_File_Icon::draw(), draw_redo(), draw_undo(), and fl_draw_symbol().

◆ fl_scroll()

FL_EXPORT void fl_scroll ( int  X,
int  Y,
int  W,
int  H,
int  dx,
int  dy,
void(*)(void *, int, int, int, int)  draw_area,
void *  data 
)

Scroll a rectangle and draw the newly exposed portions.

Parameters
[in]X,Yposition of top-left of rectangle
[in]W,Hsize of rectangle
[in]dx,dypixel offsets for shifting rectangle
[in]draw_areacallback function to draw rectangular areas
[in]datapointer to user data for callback The contents of the rectangular area is first shifted by dx and dy pixels. The draw_area callback is then called for every newly exposed rectangular area.

Definition at line 40 of file fl_scroll_area.cxx.

References Fl_Window::current(), dx, dy, fl_display, fl_gc, fl_window, H, offset, rect(), and Y.

Referenced by Fl_Scroll::draw().

◆ fl_set_spot()

FL_EXPORT void fl_set_spot ( int  font,
int  size,
int  X,
int  Y,
int  W,
int  H,
Fl_Window win = 0 
)

◆ fl_set_status()

FL_EXPORT void fl_set_status ( int  X,
int  Y,
int  W,
int  H 
)
Todo:
provide user documentation for fl_set_status function

Definition at line 297 of file Fl_win32.cxx.

References fl_xim_ic, NULL, status_area, x, and y.

◆ fl_shortcut_label() [1/2]

const FL_EXPORT char* fl_shortcut_label ( unsigned int  shortcut)

Get a human-readable string from a shortcut value.

Unparse a shortcut value as used by Fl_Button or Fl_Menu_Item into a human-readable string like "Alt+N". This only works if the shortcut is a character key or a numbered function key. If the shortcut is zero then an empty string is returned. The return value points at a static buffer that is overwritten with each call.

Since
FLTK 1.3.4 modifier key names can be localized, but key names can not yet be localized. This may be added to a future FLTK version.

Modifier key names (human-readable shortcut names) can be defined with the following global const char * pointer variables:

  • fl_local_ctrl => name of FL_CTRL
  • fl_local_alt => name of FL_ALT
  • fl_local_shift => name of FL_SHIFT
  • fl_local_meta => name of FL_META
fl_local_ctrl = "Strg"; // German for "Ctrl"
fl_local_shift = "Umschalt"; // German for "Shift"

The shortcut name will be constructed by adding all modifier names in the order defined above plus the name of the key. A '+' character is added to each modifier name unless it has a trailing '\' or a trailing '+'.

Example:

Ctrl+Alt+Shift+Meta+F12

The default values for modifier key names are as given above for all platforms except Mac OS X. Mac OS X uses graphical characters that represent the typical OS X modifier names in menus, e.g. cloverleaf, saucepan, etc. You may, however, redefine Mac OS X modifier names as well.

Parameters
[in]shortcutthe integer value containing the ascii character or extended keystroke plus modifiers
Returns
a pointer to a static buffer containing human readable text for the shortcut

Definition at line 199 of file fl_shortcut.cxx.

Referenced by Shortcut_Button::draw(), menuwindow::drawentry(), and menuwindow::menuwindow().

◆ fl_shortcut_label() [2/2]

const FL_EXPORT char* fl_shortcut_label ( unsigned int  shortcut,
const char **  eom 
)

Get a human-readable string from a shortcut value.

Parameters
[in]shortcutthe integer value containing the ascii character or extended keystroke plus modifiers
[in]eomif this pointer is set, it will receive a pointer to the end of the modifier text
Returns
a pointer to a static buffer containing human readable text for the shortcut
See also
fl_shortcut_label(unsigned int shortcut)

Definition at line 247 of file fl_shortcut.cxx.

References add_modifier_key(), b, buf, FL_ALT, FL_CTRL, FL_Enter, FL_F, FL_F_Last, FL_KEY_MASK, FL_KP, FL_KP_Last, fl_local_alt, fl_local_ctrl, fl_local_meta, fl_local_shift, FL_META, FL_SHIFT, fl_tolower(), fl_toupper(), fl_utf8encode(), key, name, symbol::name, p, and table.

◆ fl_transform_dx()

double fl_transform_dx ( double  x,
double  y 
)
inline

Transforms distance using current transformation matrix.

Parameters
[in]x,ycoordinate

Definition at line 482 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::transform_dx(), x, and y.

◆ fl_transform_dy()

double fl_transform_dy ( double  x,
double  y 
)
inline

Transforms distance using current transformation matrix.

Parameters
[in]x,ycoordinate

Definition at line 487 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::transform_dy(), x, and y.

◆ fl_transform_x()

double fl_transform_x ( double  x,
double  y 
)
inline

Transforms coordinate using the current transformation matrix.

Parameters
[in]x,ycoordinate

Definition at line 472 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::transform_x(), x, and y.

◆ fl_transform_y()

double fl_transform_y ( double  x,
double  y 
)
inline

Transforms coordinate using the current transformation matrix.

Parameters
[in]x,ycoordinate

Definition at line 477 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::transform_y(), x, and y.

◆ fl_transformed_vertex()

void fl_transformed_vertex ( double  xf,
double  yf 
)
inline

Adds coordinate pair to the vertex list without further transformations.

Parameters
[in]xf,yftransformed coordinate

Definition at line 492 of file fl_draw.H.

References fl_graphics_driver, and Fl_Graphics_Driver::transformed_vertex().

◆ fl_translate()

void fl_translate ( double  x,
double  y 
)
inline

Concatenates translation transformation onto the current one.

Parameters
[in]x,ytranslation factor in x-direction and y-direction

Definition at line 345 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::translate(), x, and y.

Referenced by Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_File_Icon::draw(), draw_undo(), and fl_draw_symbol().

◆ fl_vertex()

void fl_vertex ( double  x,
double  y 
)
inline

Adds a single vertex to the current path.

Parameters
[in]x,ycoordinate

Definition at line 379 of file fl_draw.H.

References fl_graphics_driver, Fl_Graphics_Driver::vertex(), x, and y.

Referenced by Fl_Dial::draw(), Fl_File_Icon::draw(), draw_piechart(), drawhand(), fl_vertex_r(), gtk_down_frame(), gtk_up_frame(), and rect().

◆ fl_xyline() [1/3]

◆ fl_xyline() [2/3]

void fl_xyline ( int  x,
int  y,
int  x1,
int  y2 
)
inline

Draws a horizontal line from (x,y) to (x1,y), then vertical from (x1,y) to (x1,y2)

Definition at line 259 of file fl_draw.H.

References fl_graphics_driver, x, Fl_Graphics_Driver::xyline(), and y.

◆ fl_xyline() [3/3]

void fl_xyline ( int  x,
int  y,
int  x1,
int  y2,
int  x3 
)
inline

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)

Definition at line 264 of file fl_draw.H.

References fl_graphics_driver, x, Fl_Graphics_Driver::xyline(), and y.

◆ fl_yxline() [1/3]

◆ fl_yxline() [2/3]

void fl_yxline ( int  x,
int  y,
int  y1,
int  x2 
)
inline

Draws a vertical line from (x,y) to (x,y1), then a horizontal from (x,y1) to (x2,y1)

Definition at line 274 of file fl_draw.H.

References fl_graphics_driver, x, y, and Fl_Graphics_Driver::yxline().

◆ fl_yxline() [3/3]

void fl_yxline ( int  x,
int  y,
int  y1,
int  x2,
int  y3 
)
inline

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)

Definition at line 279 of file fl_draw.H.

References fl_graphics_driver, x, y, and Fl_Graphics_Driver::yxline().

fl_font
void fl_font(Fl_Font face, Fl_Fontsize fsize)
Definition: fl_draw.H:509
fl_begin_polygon
void fl_begin_polygon()
Definition: fl_draw.H:374
Fl::visual
static int visual(int)
Definition: Fl_visual.cxx:118
FL_RGB
Definition: Enumerations.H:1085
fl_local_shift
const char * fl_local_shift
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:98
fl_local_ctrl
const char * fl_local_ctrl
string pointer used in shortcuts, you can change it to another language
Definition: Fl.cxx:96
FL_HELVETICA
const Fl_Font FL_HELVETICA
Helvetica (or Arial) normal (0)
Definition: Enumerations.H:879
fl_measure
FL_EXPORT void fl_measure(const char *str, int &x, int &y, int draw_symbols=1)
Definition: fl_draw.cxx:380
fl_arc
void fl_arc(int x, int y, int w, int h, double a1, double a2)
Definition: fl_draw.H:304
fl_end_line
void fl_end_line()
Definition: fl_draw.H:432
fl_end_polygon
void fl_end_polygon()
Definition: fl_draw.H:440
fl_begin_line
void fl_begin_line()
Definition: fl_draw.H:366
fl_end_points
void fl_end_points()
Definition: fl_draw.H:428
fl_begin_points
void fl_begin_points()
Definition: fl_draw.H:362