Documentation fixes and a few indent corrections.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8621 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
5c6913fed9
commit
06e17886ed
97
FL/fl_draw.H
97
FL/fl_draw.H
@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Portable drawing function header file for the Fast Light Tool Kit (FLTK).
|
// Portable drawing function header file for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2010 by Bill Spitzak and others.
|
// Copyright 1998-2011 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Library General Public
|
// modify it under the terms of the GNU Library General Public
|
||||||
@ -62,7 +62,7 @@ inline void fl_color(Fl_Color c) {fl_graphics_driver->color(c); } // select inde
|
|||||||
/** for back compatibility - use fl_color(Fl_Color c) instead */
|
/** for back compatibility - use fl_color(Fl_Color c) instead */
|
||||||
inline void fl_color(int c) {fl_color((Fl_Color)c);}
|
inline void fl_color(int c) {fl_color((Fl_Color)c);}
|
||||||
/**
|
/**
|
||||||
Set the color for all subsequent drawing operations.
|
Sets the color for all subsequent drawing operations.
|
||||||
The closest possible match to the RGB color is used.
|
The closest possible match to the RGB color is used.
|
||||||
The RGB color is used directly on TrueColor displays.
|
The RGB color is used directly on TrueColor displays.
|
||||||
For colormap visuals the nearest index in the gray
|
For colormap visuals the nearest index in the gray
|
||||||
@ -89,7 +89,14 @@ inline Fl_Color fl_color() {return fl_graphics_driver->color();}
|
|||||||
\param[in] x,y,w,h position and size
|
\param[in] x,y,w,h position and size
|
||||||
*/
|
*/
|
||||||
inline void fl_push_clip(int x, int y, int w, int h) {fl_graphics_driver->push_clip(x,y,w,h); }
|
inline void fl_push_clip(int x, int y, int w, int h) {fl_graphics_driver->push_clip(x,y,w,h); }
|
||||||
/** The fl_clip() name is deprecated and will be removed from future releases */
|
/**
|
||||||
|
Intersects the current clip region with a rectangle and pushes this
|
||||||
|
new region onto the stack (deprecated).
|
||||||
|
\param[in] x,y,w,h position 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.
|
||||||
|
*/
|
||||||
#define fl_clip fl_push_clip
|
#define fl_clip fl_push_clip
|
||||||
/**
|
/**
|
||||||
Pushes an empty clip region onto the stack so nothing will be clipped.
|
Pushes an empty clip region onto the stack so nothing will be clipped.
|
||||||
@ -120,12 +127,9 @@ inline int fl_not_clipped(int x, int y, int w, int h) {return fl_graphics_driver
|
|||||||
|
|
||||||
Returns non-zero if the resulting rectangle is different to the original.
|
Returns non-zero if the resulting rectangle is different to the original.
|
||||||
This can be used to limit the necessary drawing to a rectangle.
|
This can be used to limit the necessary drawing to a rectangle.
|
||||||
\p W and \p H are set to zero if the rectangle is completely outside
|
\p W and \p H are set to zero if the rectangle is completely outside the region.
|
||||||
the region.
|
|
||||||
\param[in] x,y,w,h position and size of rectangle
|
\param[in] x,y,w,h position and size of rectangle
|
||||||
\param[out] X,Y,W,H position and size of resulting bounding box.
|
\param[out] X,Y,W,H position and size of resulting bounding box.
|
||||||
\p W and \p H are set to zero if the rectangle is
|
|
||||||
completely outside the region.
|
|
||||||
\returns Non-zero if the resulting rectangle is different to the original.
|
\returns Non-zero if the resulting rectangle is different to the original.
|
||||||
*/
|
*/
|
||||||
inline int fl_clip_box(int x , int y, int w, int h, int& X, int& Y, int& W, int& H)
|
inline int fl_clip_box(int x , int y, int w, int h, int& X, int& Y, int& W, int& H)
|
||||||
@ -140,10 +144,10 @@ inline void fl_restore_clip() { fl_graphics_driver->restore_clip(); };
|
|||||||
*/
|
*/
|
||||||
inline void fl_clip_region(Fl_Region r) { fl_graphics_driver->clip_region(r); };
|
inline void fl_clip_region(Fl_Region r) { fl_graphics_driver->clip_region(r); };
|
||||||
/**
|
/**
|
||||||
returns the current clipping region.
|
Returns the current clipping region.
|
||||||
*/
|
*/
|
||||||
inline Fl_Region fl_clip_region() { return fl_graphics_driver->clip_region(); };
|
inline Fl_Region fl_clip_region() { return fl_graphics_driver->clip_region(); };
|
||||||
|
|
||||||
|
|
||||||
// points:
|
// points:
|
||||||
/**
|
/**
|
||||||
@ -209,11 +213,11 @@ inline void fl_rect(int x, int y, int w, int h) { fl_graphics_driver->rect(x,y,w
|
|||||||
inline void fl_rect(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_rect(x,y,w,h);}
|
inline void fl_rect(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_rect(x,y,w,h);}
|
||||||
/** Colors with current color a rectangle that exactly fills the given bounding box */
|
/** Colors with current color a rectangle that exactly fills the given bounding box */
|
||||||
inline void fl_rectf(int x, int y, int w, int h) { fl_graphics_driver->rectf(x,y,w,h); }
|
inline void fl_rectf(int x, int y, int w, int h) { fl_graphics_driver->rectf(x,y,w,h); }
|
||||||
/** Colors with passsed color a rectangle that exactly fills the given bounding box */
|
/** Colors with passed color a rectangle that exactly fills the given bounding box */
|
||||||
inline void fl_rectf(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_rectf(x,y,w,h);}
|
inline void fl_rectf(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_rectf(x,y,w,h);}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Color a rectangle with "exactly" the passed <tt>r,g,b</tt> color.
|
Colors a rectangle with "exactly" the passed <tt>r,g,b</tt> color.
|
||||||
On screens with less than 24 bits of color this is done by drawing a
|
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
|
solid-colored block using fl_draw_image() so that the correct color
|
||||||
shade is produced.
|
shade is produced.
|
||||||
@ -293,7 +297,7 @@ inline void fl_yxline(int x, int y, int y1, int x2, int y3) {fl_graphics_driver-
|
|||||||
much nicer small circles, since the small sizes are often hard-coded bitmaps.
|
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.
|
If a complete circle is drawn it will fit inside the passed bounding box.
|
||||||
The two angles are measured in degrees counterclockwise from 3 o'clock and
|
The two angles are measured in degrees counter-clockwise from 3 o'clock and
|
||||||
are the starting and ending angle of the arc, \p a2 must be greater or equal
|
are the starting and ending angle of the arc, \p a2 must be greater or equal
|
||||||
to \p a1.
|
to \p a1.
|
||||||
|
|
||||||
@ -326,7 +330,7 @@ FL_EXPORT void fl_chord(int x, int y, int w, int h, double a1, double a2); // ny
|
|||||||
// scalable drawing code (code in fl_vertex.C and fl_arc.C):
|
// scalable drawing code (code in fl_vertex.C and fl_arc.C):
|
||||||
/**
|
/**
|
||||||
Saves the current transformation matrix on the stack.
|
Saves the current transformation matrix on the stack.
|
||||||
The maximum depth of the stack is 4.
|
The maximum depth of the stack is 32.
|
||||||
*/
|
*/
|
||||||
inline void fl_push_matrix() { fl_graphics_driver->push_matrix(); };
|
inline void fl_push_matrix() { fl_graphics_driver->push_matrix(); };
|
||||||
/**
|
/**
|
||||||
@ -383,7 +387,7 @@ inline void fl_begin_polygon() {fl_graphics_driver->begin_polygon(); }
|
|||||||
*/
|
*/
|
||||||
inline void fl_vertex(double x, double y) {fl_graphics_driver->vertex(x,y); }
|
inline void fl_vertex(double x, double y) {fl_graphics_driver->vertex(x,y); }
|
||||||
/**
|
/**
|
||||||
Add a series of points on a Bezier curve to the path.
|
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.
|
The curve ends (and two of the points) are at X0,Y0 and X3,Y3.
|
||||||
\param[in] X0,Y0 curve start point
|
\param[in] X0,Y0 curve start point
|
||||||
\param[in] X1,Y1 curve control point
|
\param[in] X1,Y1 curve control point
|
||||||
@ -393,8 +397,8 @@ inline void fl_vertex(double x, double y) {fl_graphics_driver->vertex(x,y); }
|
|||||||
inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3)
|
inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, double Y2, double X3, double Y3)
|
||||||
{fl_graphics_driver->curve(X0,Y0,X1,Y1,X2,Y2,X3,Y3); }
|
{fl_graphics_driver->curve(X0,Y0,X1,Y1,X2,Y2,X3,Y3); }
|
||||||
/**
|
/**
|
||||||
Add a series of points to the current path on the arc of a circle; you
|
Adds a series of points to the current path on the arc of a circle.
|
||||||
can get elliptical paths by using scale and rotate before calling fl_arc().
|
You can get elliptical paths by using scale and rotate before calling fl_arc().
|
||||||
\param[in] x,y,r center and radius of circular arc
|
\param[in] x,y,r center and radius of circular arc
|
||||||
\param[in] start,end angles of start and end of arc measured in degrees
|
\param[in] start,end angles of start and end of arc measured in degrees
|
||||||
counter-clockwise from 3 o'clock. If \p end is less than \p start
|
counter-clockwise from 3 o'clock. If \p end is less than \p start
|
||||||
@ -458,7 +462,7 @@ inline void fl_end_complex_polygon() {fl_graphics_driver->end_complex_polygon();
|
|||||||
*/
|
*/
|
||||||
inline double fl_transform_x(double x, double y) {return fl_graphics_driver->transform_x(x, y); };
|
inline double fl_transform_x(double x, double y) {return fl_graphics_driver->transform_x(x, y); };
|
||||||
/**
|
/**
|
||||||
Transform coordinate using the current transformation matrix.
|
Transforms coordinate using the current transformation matrix.
|
||||||
\param[in] x,y coordinate
|
\param[in] x,y coordinate
|
||||||
*/
|
*/
|
||||||
inline double fl_transform_y(double x, double y) {return fl_graphics_driver->transform_y(x, y); };
|
inline double fl_transform_y(double x, double y) {return fl_graphics_driver->transform_y(x, y); };
|
||||||
@ -518,24 +522,24 @@ FL_EXPORT int fl_height(int font, int size);
|
|||||||
draw the text at so it looks centered vertically in that box.
|
draw the text at so it looks centered vertically in that box.
|
||||||
*/
|
*/
|
||||||
inline int fl_descent() {return fl_graphics_driver->descent();}
|
inline int fl_descent() {return fl_graphics_driver->descent();}
|
||||||
/** Return the typographical width of a nul-terminated string */
|
/** Returns the typographical width of a nul-terminated string */
|
||||||
FL_EXPORT double fl_width(const char* txt);
|
FL_EXPORT double fl_width(const char* txt);
|
||||||
/** Return the typographical width of a sequence of \p n characters */
|
/** Returns the typographical width of a sequence of \p n characters */
|
||||||
inline double fl_width(const char* txt, int n) {return fl_graphics_driver->width(txt, n);}
|
inline double fl_width(const char* txt, int n) {return fl_graphics_driver->width(txt, n);}
|
||||||
/** Return the typographical width of a single character :
|
/** Returns the typographical width of a single character.
|
||||||
\note if a valid fl_gc is NOT found then it uses the first window gc,
|
\note if a valid fl_gc is NOT found then it uses the first window gc,
|
||||||
or the screen gc if no fltk window is available when called. */
|
or the screen gc if no fltk window is available when called. */
|
||||||
inline double fl_width(unsigned int c) {return fl_graphics_driver->width(c);}
|
inline double fl_width(unsigned int c) {return fl_graphics_driver->width(c);}
|
||||||
/** Determine the minimum pixel dimensions of a nul-terminated string.
|
/** Determines the minimum pixel dimensions of a nul-terminated string.
|
||||||
|
|
||||||
Usage: given a string "txt" drawn using fl_draw(txt, x, y) you would determine
|
Usage: given a string "txt" drawn using fl_draw(txt, x, y) you would determine
|
||||||
its pixel extents on the display using fl_text_extents(txt, dx, dy, wo, ho)
|
its pixel extents on the display using fl_text_extents(txt, dx, dy, wo, ho)
|
||||||
such that a bounding box that exactly fits around the text could be drawn with
|
such that a bounding box that exactly fits around the text could be drawn with
|
||||||
fl_rect(x+dx, y+dy, wo, ho). Note the dx, dy values hold the offset of the first
|
fl_rect(x+dx, y+dy, wo, ho). Note the dx, dy values hold the offset of the first
|
||||||
"colored in" pixel of the string, from the draw origin.
|
"colored in" pixel of the string, from the draw origin.
|
||||||
*/
|
*/
|
||||||
FL_EXPORT void fl_text_extents(const char*, int& dx, int& dy, int& w, int& h); // NO fltk symbol expansion will be performed
|
FL_EXPORT void fl_text_extents(const char*, int& dx, int& dy, int& w, int& h); // NO fltk symbol expansion will be performed
|
||||||
/** Determine the minimum pixel dimensions of a sequence of \p n characters.
|
/** Determines the minimum pixel dimensions of a sequence of \p n characters.
|
||||||
\see fl_text_extents(const char*, int& dx, int& dy, int& w, int& h)
|
\see fl_text_extents(const char*, int& dx, int& dy, int& w, int& h)
|
||||||
*/
|
*/
|
||||||
inline void fl_text_extents(const char *t, int n, int& dx, int& dy, int& w, int& h)
|
inline void fl_text_extents(const char *t, int n, int& dx, int& dy, int& w, int& h)
|
||||||
@ -544,28 +548,28 @@ inline void fl_text_extents(const char *t, int n, int& dx, int& dy, int& w, int&
|
|||||||
// font encoding:
|
// font encoding:
|
||||||
// Note: doxygen comments here to avoid duplication for os-sepecific cases
|
// Note: doxygen comments here to avoid duplication for os-sepecific cases
|
||||||
/**
|
/**
|
||||||
convert text from Windows/X11 latin1 charcter set to local encoding.
|
Converts text from Windows/X11 latin1 character set to local encoding.
|
||||||
\param[in] t character string (latin1 encoding)
|
\param[in] t character string (latin1 encoding)
|
||||||
\param[in] n optional number of characters to convert (default is all)
|
\param[in] n optional number of characters to convert (default is all)
|
||||||
\returns pointer to internal buffer containing converted characters
|
\returns pointer to internal buffer containing converted characters
|
||||||
*/
|
*/
|
||||||
FL_EXPORT const char *fl_latin1_to_local(const char *t, int n=-1);
|
FL_EXPORT const char *fl_latin1_to_local(const char *t, int n=-1);
|
||||||
/**
|
/**
|
||||||
convert text from local encoding to Windowx/X11 latin1 character set.
|
Converts text from local encoding to Windowx/X11 latin1 character set.
|
||||||
\param[in] t character string (local encoding)
|
\param[in] t character string (local encoding)
|
||||||
\param[in] n optional number of characters to convert (default is all)
|
\param[in] n optional number of characters to convert (default is all)
|
||||||
\returns pointer to internal buffer containing converted characters
|
\returns pointer to internal buffer containing converted characters
|
||||||
*/
|
*/
|
||||||
FL_EXPORT const char *fl_local_to_latin1(const char *t, int n=-1);
|
FL_EXPORT const char *fl_local_to_latin1(const char *t, int n=-1);
|
||||||
/**
|
/**
|
||||||
convert text from Mac Roman charcter set to local encoding.
|
Converts text from Mac Roman character set to local encoding.
|
||||||
\param[in] t character string (Mac Roman encoding)
|
\param[in] t character string (Mac Roman encoding)
|
||||||
\param[in] n optional number of characters to convert (default is all)
|
\param[in] n optional number of characters to convert (default is all)
|
||||||
\returns pointer to internal buffer containing converted characters
|
\returns pointer to internal buffer containing converted characters
|
||||||
*/
|
*/
|
||||||
FL_EXPORT const char *fl_mac_roman_to_local(const char *t, int n=-1);
|
FL_EXPORT const char *fl_mac_roman_to_local(const char *t, int n=-1);
|
||||||
/**
|
/**
|
||||||
convert text from local encoding to Mac Roman character set.
|
Converts text from local encoding to Mac Roman character set.
|
||||||
\param[in] t character string (local encoding)
|
\param[in] t character string (local encoding)
|
||||||
\param[in] n optional number of characters to convert (default is all)
|
\param[in] n optional number of characters to convert (default is all)
|
||||||
\returns pointer to internal buffer containing converted characters
|
\returns pointer to internal buffer containing converted characters
|
||||||
@ -588,7 +592,7 @@ FL_EXPORT const char *fl_local_to_mac_roman(const char *t, int n=-1);
|
|||||||
FL_EXPORT void fl_draw(const char* str, int x, int y);
|
FL_EXPORT void fl_draw(const char* str, int x, int y);
|
||||||
/**
|
/**
|
||||||
Draws a nul-terminated string starting at the given location and
|
Draws a nul-terminated string starting at the given location and
|
||||||
rotating \p angle degrees counterclockwise.
|
rotating \p angle degrees counter-clockwise.
|
||||||
This version of fl_draw provides direct access to the text drawing
|
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
|
function of the underlying OS and is supported by Xft, Win32 and MacOS
|
||||||
fltk subsets.
|
fltk subsets.
|
||||||
@ -600,7 +604,7 @@ FL_EXPORT void fl_draw(int angle, const char* str, int x, int y);
|
|||||||
inline void fl_draw(const char* str, int n, int x, int y) {fl_graphics_driver->draw(str,n,x,y); }
|
inline void fl_draw(const char* str, int n, int x, int y) {fl_graphics_driver->draw(str,n,x,y); }
|
||||||
/**
|
/**
|
||||||
Draws an array of \p n characters starting at the given location,
|
Draws an array of \p n characters starting at the given location,
|
||||||
rotating \p angle degrees counterclockwise.
|
rotating \p angle degrees counter-clockwise.
|
||||||
*/
|
*/
|
||||||
inline void fl_draw(int angle,const char* str, int n, int x, int y) {fl_graphics_driver->draw(angle,str,n,x,y); }
|
inline void fl_draw(int angle,const char* str, int n, int x, int y) {fl_graphics_driver->draw(angle,str,n,x,y); }
|
||||||
/**
|
/**
|
||||||
@ -625,13 +629,14 @@ FL_EXPORT void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color);
|
|||||||
// images:
|
// images:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw an 8-bit per color RGB or luminance image.
|
Draws an 8-bit per color RGB or luminance image.
|
||||||
\param[in] buf points at the "r" data of the top-left pixel.
|
\param[in] buf points at the "r" data of the top-left pixel.
|
||||||
Color data must be in <tt>r,g,b</tt> order.
|
Color data must be in <tt>r,g,b</tt> order.
|
||||||
|
Luminance data is only one <tt>gray</tt> byte.
|
||||||
\param[in] X,Y position where to put top-left corner of image
|
\param[in] X,Y position where to put top-left corner of image
|
||||||
\param[in] W,H size of the image
|
\param[in] W,H size of the image
|
||||||
\param[in] D delta to add to the pointer between pixels. it may be
|
\param[in] D delta to add to the pointer between pixels. It may be
|
||||||
any value greater than or equal to 3, or it can be
|
any value greater than or equal to 1, or it can be
|
||||||
negative to flip the image horizontally
|
negative to flip the image horizontally
|
||||||
\param[in] L delta to add to the pointer between lines (if 0 is
|
\param[in] L delta to add to the pointer between lines (if 0 is
|
||||||
passed it uses \p W * \p D), and may be larger than
|
passed it uses \p W * \p D), and may be larger than
|
||||||
@ -644,6 +649,7 @@ FL_EXPORT void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color);
|
|||||||
\code
|
\code
|
||||||
Fl::visual(FL_RGB);
|
Fl::visual(FL_RGB);
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
Gray scale (1-channel) images may be drawn. This is done if
|
Gray scale (1-channel) images may be drawn. This is done if
|
||||||
<tt>abs(D)</tt> is less than 3, or by calling fl_draw_image_mono().
|
<tt>abs(D)</tt> 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
|
Only one 8-bit sample is used for each pixel, and on screens with
|
||||||
@ -661,28 +667,29 @@ inline void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, in
|
|||||||
{ fl_graphics_driver->draw_image(buf, X, Y, W, H, D, L); }
|
{ fl_graphics_driver->draw_image(buf, X, Y, W, H, D, L); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw a gray-scale (1 channel) image.
|
Draws a gray-scale (1 channel) image.
|
||||||
\see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L)
|
\see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L)
|
||||||
*/
|
*/
|
||||||
inline void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0)
|
inline void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0)
|
||||||
{ fl_graphics_driver->draw_image_mono(buf, X, Y, W, H, D, L); }
|
{ fl_graphics_driver->draw_image_mono(buf, X, Y, W, H, D, L); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw image using callback function to generate image data.
|
Draws an image using a callback function to generate image data.
|
||||||
|
|
||||||
You can generate the image as it is being drawn, or do arbitrary
|
You can generate the image as it is being drawn, or do arbitrary
|
||||||
decompression of stored data, provided it can be decompressed to
|
decompression of stored data, provided it can be decompressed to
|
||||||
individual scan lines easily.
|
individual scan lines easily.
|
||||||
\param[in] cb callback function to generate scan line data
|
\param[in] cb callback function to generate scan line data
|
||||||
\param[in] data user data passed to callback function
|
\param[in] data user data passed to callback function
|
||||||
\param[in] X,Y
|
\param[in] X,Y screen position of top left pixel
|
||||||
\param[in] W,H
|
\param[in] W,H image width and height
|
||||||
\param[in] D
|
\param[in] D data size in bytes (must be greater than 0)
|
||||||
\see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L)
|
\see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L)
|
||||||
|
|
||||||
The callback function \p cb is called with the <tt>void*</tt> \p data
|
The callback function \p cb is called with the <tt>void*</tt> \p data
|
||||||
user data pointer to allow access to a structure of information about
|
user data pointer to allow access to a structure of information about
|
||||||
the image, and the \p x, \p y, and \p w of the scan line desired from
|
the image, and the \p x, \p y, and \p w of the scan line desired from
|
||||||
the image. 0,0 is the upper-left corner of the image, not \p X, \p Y.
|
the image. 0,0 is the upper-left corner of the image, not \p x, \p y.
|
||||||
A pointer to a buffer to put the data into is passed. You must copy
|
A pointer to a buffer to put the data into is passed. You must copy
|
||||||
\p w pixels from scanline \p y, starting at pixel \p x, to this buffer.
|
\p w pixels from scanline \p y, starting at pixel \p x, to this buffer.
|
||||||
|
|
||||||
@ -703,7 +710,7 @@ inline void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int
|
|||||||
{ fl_graphics_driver->draw_image(cb, data, X, Y, W, H, D); }
|
{ fl_graphics_driver->draw_image(cb, data, X, Y, W, H, D); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Draw gray-scale image using callback function to generate image data.
|
Draws a gray-scale image using a callback function to generate image data.
|
||||||
\see fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D)
|
\see fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D)
|
||||||
*/
|
*/
|
||||||
FL_EXPORT 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 void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
|
||||||
@ -717,11 +724,11 @@ FL_EXPORT void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,i
|
|||||||
FL_EXPORT char fl_can_do_alpha_blending();
|
FL_EXPORT char fl_can_do_alpha_blending();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Read an RGB(A) image from the current window or off-screen buffer.
|
Reads an RGB(A) image from the current window or off-screen buffer.
|
||||||
\param[in] p pixel buffer, or NULL to allocate one
|
\param[in] p pixel buffer, or NULL to allocate one
|
||||||
\param[in] X,Y position of top-left of image to read
|
\param[in] X,Y position of top-left of image to read
|
||||||
\param[in] W,H width and height of image to read
|
\param[in] W,H width and height of image to read
|
||||||
\param[in] alpha alpha value for image (0 fr none)
|
\param[in] alpha alpha value for image (0 for none)
|
||||||
\returns pointer to pixel buffer, or NULL if allocation failed.
|
\returns pointer to pixel buffer, or NULL if allocation failed.
|
||||||
|
|
||||||
The \p p argument points to a buffer that can hold the image and must
|
The \p p argument points to a buffer that can hold the image and must
|
||||||
|
|||||||
@ -40,12 +40,12 @@
|
|||||||
@{ */
|
@{ */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Pops up a window to let the user pick an colormap entry.
|
\brief Pops up a window to let the user pick a colormap entry.
|
||||||
\image html fl_show_colormap.png
|
\image html fl_show_colormap.png
|
||||||
\image latex fl_show_colormap.png "fl_show_colormap" height=10cm
|
\image latex fl_show_colormap.png "fl_show_colormap" height=10cm
|
||||||
\param[in] oldcol color to be highlighted when grid is shown.
|
\param[in] oldcol color to be highlighted when grid is shown.
|
||||||
\retval Fl_Color value of the chosen colormap entry.
|
\retval Fl_Color value of the chosen colormap entry.
|
||||||
\sa Fl_Color_Chooser
|
\see Fl_Color_Chooser
|
||||||
*/
|
*/
|
||||||
FL_EXPORT Fl_Color fl_show_colormap(Fl_Color oldcol);
|
FL_EXPORT Fl_Color fl_show_colormap(Fl_Color oldcol);
|
||||||
|
|
||||||
|
|||||||
@ -420,7 +420,7 @@ small sizes are often hard-coded bitmaps.
|
|||||||
|
|
||||||
\par
|
\par
|
||||||
If a complete circle is drawn it will fit inside the passed bounding
|
If a complete circle is drawn it will fit inside the passed bounding
|
||||||
box. The two angles are measured in degrees counterclockwise from
|
box. The two angles are measured in degrees counter-clockwise from
|
||||||
3'oclock and are the starting and ending angle of the arc, \p a2
|
3'oclock and are the starting and ending angle of the arc, \p a2
|
||||||
must be greater or equal to \p a1.
|
must be greater or equal to \p a1.
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// implementation of Fl_Paged_Device class for the Fast Light Tool Kit (FLTK).
|
// implementation of Fl_Paged_Device class for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 2010 by Bill Spitzak and others.
|
// Copyright 2010-2011 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Library General Public
|
// modify it under the terms of the GNU Library General Public
|
||||||
@ -74,7 +74,7 @@ void Fl_Paged_Device::print_widget(Fl_Widget* widget, int delta_x, int delta_y)
|
|||||||
int width, height;
|
int width, height;
|
||||||
this->printable_rect(&width, &height);
|
this->printable_rect(&width, &height);
|
||||||
drawn_by_plugin = pi->print(widget, 0, 0, height);
|
drawn_by_plugin = pi->print(widget, 0, 0, height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!drawn_by_plugin) {
|
if (!drawn_by_plugin) {
|
||||||
widget->draw();
|
widget->draw();
|
||||||
@ -118,7 +118,7 @@ void Fl_Paged_Device::origin(int *x, int *y)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Prints a rectangular part of an on-screen window.
|
@brief Prints a rectangular part of an on-screen window.
|
||||||
*
|
|
||||||
@param win The window from where to capture.
|
@param win The window from where to capture.
|
||||||
@param x The rectangle left
|
@param x The rectangle left
|
||||||
@param y The rectangle top
|
@param y The rectangle top
|
||||||
@ -150,7 +150,7 @@ void Fl_Paged_Device::print_window_part(Fl_Window *win, int x, int y, int w, int
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Starts a print job.
|
@brief Starts a print job.
|
||||||
*
|
|
||||||
@param[in] pagecount the total number of pages of the job
|
@param[in] pagecount the total number of pages of the job
|
||||||
@param[out] frompage if non-null, *frompage is set to the first page the user wants printed
|
@param[out] frompage if non-null, *frompage is set to the first page the user wants printed
|
||||||
@param[out] topage if non-null, *topage is set to the last page the user wants printed
|
@param[out] topage if non-null, *topage is set to the last page the user wants printed
|
||||||
@ -160,7 +160,7 @@ int Fl_Paged_Device::start_job(int pagecount, int *frompage, int *topage) {retur
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Starts a new printed page
|
@brief Starts a new printed page
|
||||||
*
|
|
||||||
The page coordinates are initially in points, i.e., 1/72 inch,
|
The page coordinates are initially in points, i.e., 1/72 inch,
|
||||||
and with origin at the top left of the printable page area.
|
and with origin at the top left of the printable page area.
|
||||||
@return 0 if OK, non-zero if any error
|
@return 0 if OK, non-zero if any error
|
||||||
@ -169,7 +169,7 @@ int Fl_Paged_Device::start_page (void) {return 1;}
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Computes the width and height of the printable area of the page.
|
@brief Computes the width and height of the printable area of the page.
|
||||||
*
|
|
||||||
Values are in the same unit as that used by FLTK drawing functions,
|
Values are in the same unit as that used by FLTK drawing functions,
|
||||||
are unchanged by calls to origin(), but are changed by scale() calls.
|
are unchanged by calls to origin(), but are changed by scale() calls.
|
||||||
Values account for the user-selected paper type and print orientation.
|
Values account for the user-selected paper type and print orientation.
|
||||||
@ -180,7 +180,7 @@ int Fl_Paged_Device::printable_rect(int *w, int *h) {return 1;}
|
|||||||
/**
|
/**
|
||||||
@brief Computes the dimensions of margins that lie between the printable page area and
|
@brief Computes the dimensions of margins that lie between the printable page area and
|
||||||
the full page.
|
the full page.
|
||||||
*
|
|
||||||
Values are in the same unit as that used by FLTK drawing functions. They are changed
|
Values are in the same unit as that used by FLTK drawing functions. They are changed
|
||||||
by scale() calls.
|
by scale() calls.
|
||||||
@param[out] left If non-null, *left is set to the left margin size.
|
@param[out] left If non-null, *left is set to the left margin size.
|
||||||
@ -192,7 +192,7 @@ void Fl_Paged_Device::margins(int *left, int *top, int *right, int *bottom) {}
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Sets the position in page coordinates of the origin of graphics functions.
|
@brief Sets the position in page coordinates of the origin of graphics functions.
|
||||||
*
|
|
||||||
Arguments should be expressed relatively to the result of a previous printable_rect() call.
|
Arguments should be expressed relatively to the result of a previous printable_rect() call.
|
||||||
That is, <tt>printable_rect(&w, &h); origin(w/2, 0);</tt> sets the graphics origin at the
|
That is, <tt>printable_rect(&w, &h); origin(w/2, 0);</tt> sets the graphics origin at the
|
||||||
top center of the page printable area.
|
top center of the page printable area.
|
||||||
@ -205,7 +205,7 @@ void Fl_Paged_Device::origin(int x, int y) {}
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Changes the scaling of page coordinates.
|
@brief Changes the scaling of page coordinates.
|
||||||
*
|
|
||||||
This function also resets the origin of graphics functions at top left of printable page area.
|
This function also resets the origin of graphics functions at top left of printable page area.
|
||||||
After a scale() call, do a printable_rect() call to get the new dimensions of the printable page area.
|
After a scale() call, do a printable_rect() call to get the new dimensions of the printable page area.
|
||||||
Successive scale() calls don't combine their effects.
|
Successive scale() calls don't combine their effects.
|
||||||
@ -218,16 +218,16 @@ void Fl_Paged_Device::scale (float scale_x, float scale_y) {}
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Rotates the graphics operations relatively to paper.
|
@brief Rotates the graphics operations relatively to paper.
|
||||||
*
|
|
||||||
The rotation is centered on the current graphics origin.
|
The rotation is centered on the current graphics origin.
|
||||||
Successive rotate() calls don't combine their effects.
|
Successive rotate() calls don't combine their effects.
|
||||||
@param angle Rotation angle in counterclockwise degrees.
|
@param angle Rotation angle in counter-clockwise degrees.
|
||||||
*/
|
*/
|
||||||
void Fl_Paged_Device::rotate(float angle) {}
|
void Fl_Paged_Device::rotate(float angle) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief To be called at the end of each page.
|
@brief To be called at the end of each page.
|
||||||
*
|
|
||||||
@return 0 if OK, non-zero if any error.
|
@return 0 if OK, non-zero if any error.
|
||||||
*/
|
*/
|
||||||
int Fl_Paged_Device::end_page (void) {return 1;}
|
int Fl_Paged_Device::end_page (void) {return 1;}
|
||||||
@ -239,7 +239,7 @@ void Fl_Paged_Device::end_job (void) {}
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Translates the current graphics origin accounting for the current rotation.
|
@brief Translates the current graphics origin accounting for the current rotation.
|
||||||
*
|
|
||||||
This function is only useful after a rotate() call.
|
This function is only useful after a rotate() call.
|
||||||
Each translate() call must be matched by an untranslate() call.
|
Each translate() call must be matched by an untranslate() call.
|
||||||
Successive translate() calls add up their effects.
|
Successive translate() calls add up their effects.
|
||||||
@ -295,4 +295,3 @@ const Fl_Paged_Device::page_format Fl_Paged_Device::page_formats[NO_PAGE_FORMATS
|
|||||||
//
|
//
|
||||||
// End of "$Id$".
|
// End of "$Id$".
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Shortcut support routines for the Fast Light Tool Kit (FLTK).
|
// Shortcut support routines for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2010 by Bill Spitzak and others.
|
// Copyright 1998-2011 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Library General Public
|
// modify it under the terms of the GNU Library General Public
|
||||||
@ -34,7 +34,7 @@
|
|||||||
// To make it easier to match some things it is more complex:
|
// To make it easier to match some things it is more complex:
|
||||||
//
|
//
|
||||||
// Only FL_META, FL_ALT, FL_SHIFT, and FL_CTRL must be "off". A
|
// Only FL_META, FL_ALT, FL_SHIFT, and FL_CTRL must be "off". A
|
||||||
// zero in the other shift flags indicates "dont care".
|
// zero in the other shift flags indicates "don't care".
|
||||||
//
|
//
|
||||||
// It also checks against the first character of Fl::event_text(),
|
// It also checks against the first character of Fl::event_text(),
|
||||||
// and zero for FL_SHIFT means "don't care".
|
// and zero for FL_SHIFT means "don't care".
|
||||||
@ -52,13 +52,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Test the current event, which must be an FL_KEYBOARD or
|
Tests the current event, which must be an FL_KEYBOARD or
|
||||||
FL_SHORTCUT, against a shortcut value (described in
|
FL_SHORTCUT, against a shortcut value (described in Fl_Button).
|
||||||
Fl_Button).
|
|
||||||
|
Not to be confused with Fl_Widget::test_shortcut().
|
||||||
Not to be confused with Fl_Widget::test_shortcut().
|
|
||||||
|
\return non-zero if there is a match.
|
||||||
\return non-zero if there is a match.
|
|
||||||
*/
|
*/
|
||||||
int Fl::test_shortcut(unsigned int shortcut) {
|
int Fl::test_shortcut(unsigned int shortcut) {
|
||||||
if (!shortcut) return 0;
|
if (!shortcut) return 0;
|
||||||
@ -129,7 +128,7 @@ static Keyname table[] = {
|
|||||||
};
|
};
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
static Keyname table[] = {
|
static Keyname table[] = {
|
||||||
// v - this column contains utf8 characters
|
// v - this column contains UTF-8 characters
|
||||||
{' ', "Space"},
|
{' ', "Space"},
|
||||||
{FL_BackSpace,"\xe2\x8c\xab"}, // erase to the left
|
{FL_BackSpace,"\xe2\x8c\xab"}, // erase to the left
|
||||||
{FL_Tab, "\xe2\x87\xa5"}, // rightwards arrow to bar
|
{FL_Tab, "\xe2\x87\xa5"}, // rightwards arrow to bar
|
||||||
@ -144,7 +143,7 @@ static Keyname table[] = {
|
|||||||
{FL_Right, "\xe2\x86\x92"}, // rightwards arrow
|
{FL_Right, "\xe2\x86\x92"}, // rightwards arrow
|
||||||
{FL_Down, "\xe2\x86\x93"}, // downwards arrow
|
{FL_Down, "\xe2\x86\x93"}, // downwards arrow
|
||||||
{FL_Page_Up, "\xe2\x87\x9e"}, // upwards arrow with double stroke
|
{FL_Page_Up, "\xe2\x87\x9e"}, // upwards arrow with double stroke
|
||||||
{FL_Page_Down,"\xe2\x87\x9f"}, // downward arrow with double stroke
|
{FL_Page_Down,"\xe2\x87\x9f"}, // downwards arrow with double stroke
|
||||||
{FL_End, "\xe2\x86\x98"}, // south east arrow
|
{FL_End, "\xe2\x86\x98"}, // south east arrow
|
||||||
{FL_Print, "Print"},
|
{FL_Print, "Print"},
|
||||||
{FL_Insert, "Insert"},
|
{FL_Insert, "Insert"},
|
||||||
@ -173,7 +172,7 @@ static Keyname table[] = {
|
|||||||
zero then an empty string is returned. The return value points at
|
zero then an empty string is returned. The return value points at
|
||||||
a static buffer that is overwritten with each call.
|
a static buffer that is overwritten with each call.
|
||||||
|
|
||||||
\param [in] shortcut the integer value containing the ascii charcter or extended keystroke plus modifiers
|
\param [in] shortcut the integer value containing the ascii character or extended keystroke plus modifiers
|
||||||
\return a pointer to a static buffer containing human readable text for the shortcut
|
\return a pointer to a static buffer containing human readable text for the shortcut
|
||||||
*/
|
*/
|
||||||
const char* fl_shortcut_label(unsigned int shortcut) {
|
const char* fl_shortcut_label(unsigned int shortcut) {
|
||||||
@ -183,7 +182,7 @@ const char* fl_shortcut_label(unsigned int shortcut) {
|
|||||||
/**
|
/**
|
||||||
Get a human-readable string from a shortcut value.
|
Get a human-readable string from a shortcut value.
|
||||||
|
|
||||||
\param [in] shortcut the integer value containing the ascii charcter or extended keystroke plus modifiers
|
\param [in] shortcut the integer value containing the ascii character or extended keystroke plus modifiers
|
||||||
\param [in] eom if this pointer is set, it will receive a pointer to the end of the modifier text
|
\param [in] eom if this pointer is set, it will receive a pointer to the end of the modifier text
|
||||||
\return a pointer to a static buffer containing human readable text for the shortcut
|
\return a pointer to a static buffer containing human readable text for the shortcut
|
||||||
\see fl_shortcut_label(unsigned int shortcut)
|
\see fl_shortcut_label(unsigned int shortcut)
|
||||||
@ -298,7 +297,7 @@ unsigned int fl_old_shortcut(const char* s) {
|
|||||||
|
|
||||||
The given text \p t (usually a widget's label or a menu text) is
|
The given text \p t (usually a widget's label or a menu text) is
|
||||||
searched for a '&x' shortcut label, and if found, the Unicode
|
searched for a '&x' shortcut label, and if found, the Unicode
|
||||||
value of the '&x' shortcut is returned.
|
value (code point) of the '&x' shortcut is returned.
|
||||||
|
|
||||||
\param t text or label to search for '&x' shortcut.
|
\param t text or label to search for '&x' shortcut.
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
//
|
//
|
||||||
// Portable drawing routines for the Fast Light Tool Kit (FLTK).
|
// Portable drawing routines for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
// Copyright 1998-2010 by Bill Spitzak and others.
|
// Copyright 1998-2011 by Bill Spitzak and others.
|
||||||
//
|
//
|
||||||
// This library is free software; you can redistribute it and/or
|
// This library is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Library General Public
|
// modify it under the terms of the GNU Library General Public
|
||||||
@ -270,8 +270,8 @@ void Fl_Graphics_Driver::circle(double x, double y,double r) {
|
|||||||
} else
|
} else
|
||||||
Arc(fl_gc, llx, lly, llx+w, lly+h, 0,0, 0,0);
|
Arc(fl_gc, llx, lly, llx+w, lly+h, 0,0, 0,0);
|
||||||
#elif defined(__APPLE_QUARTZ__)
|
#elif defined(__APPLE_QUARTZ__)
|
||||||
// Quartz warning : circle won't scale to current matrix!
|
// Quartz warning: circle won't scale to current matrix!
|
||||||
//last argument must be 0 (counterclockwise) or it draws nothing under __LP64__ !!!!
|
// Last argument must be 0 (counter-clockwise) or it draws nothing under __LP64__ !!!!
|
||||||
CGContextSetShouldAntialias(fl_gc, true);
|
CGContextSetShouldAntialias(fl_gc, true);
|
||||||
CGContextAddArc(fl_gc, xt, yt, (w+h)*0.25f, 0, 2.0f*M_PI, 0);
|
CGContextAddArc(fl_gc, xt, yt, (w+h)*0.25f, 0, 2.0f*M_PI, 0);
|
||||||
(what == POLYGON ? CGContextFillPath : CGContextStrokePath)(fl_gc);
|
(what == POLYGON ? CGContextFillPath : CGContextStrokePath)(fl_gc);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user