From cda7f614627d3bcf303ab1ad92d5d7fe53f3e3af Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 23 Aug 2006 20:38:30 +0000 Subject: [PATCH] Adding more links to the global function reference list git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5351 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- CHANGES | 1 + documentation/common.html | 21 +++++ documentation/drawing.html | 87 +++++++++--------- documentation/functions.html | 173 +++++++++++++++++++++++++++-------- documentation/osissues.html | 2 +- 5 files changed, 204 insertions(+), 80 deletions(-) diff --git a/CHANGES b/CHANGES index 178f6e0e3..5ae995135 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ CHANGES IN FLTK 1.1.8 + - Improving the global function index (STR #1319) - Avoiding problems with some platforms that don't implement hypot() (STR #1366) - Fixed floating point value formatting diff --git a/documentation/common.html b/documentation/common.html index ef171b2d2..9c2084de6 100644 --- a/documentation/common.html +++ b/documentation/common.html @@ -507,6 +507,27 @@ method to select your label type.

The Fl::set_labeltype method can also be used to overload an existing label type such as FL_NORMAL_LABEL.

+

Making your own symbols

+ +

It is also possible to define your own drawings and add +them to the symbol list, so they can be rendered as part of +any label.

+ +

To create a new symbol, you implement a drawing function +void drawit(Fl_Color c) which typically uses the +complex drawing functions +to generate a vector shape inside a two-by-two units sized box +around the origin. This function is then linked into the symbols +table using fl_add_symbol:

+ + + +

name is the name of the symbol without the "@"; scalable +must be set to 1 if the symbol is generated using scalable vector drawing +functions.

+

Callbacks

Callbacks are functions that are called when the value of a diff --git a/documentation/drawing.html b/documentation/drawing.html index d7d36def6..9e3b6e0b0 100644 --- a/documentation/drawing.html +++ b/documentation/drawing.html @@ -300,11 +300,12 @@ href="#complex">transformation matrix, so you should only call these while the matrix is set to the identity matrix (the default). -

void fl_point(int x, int y)

+

void fl_point(int x, int y)

Draw a single pixel at the given coordinates. -

void fl_rectf(int x, int y, int w, int h)

+

void fl_rectf(int x, int y, int w, int h) +
void fl_rectf(int x, int y, int w, int h)

Color a rectangle that exactly fills the given bounding box. @@ -316,43 +317,44 @@ color this is done by drawing a solid-colored block using fl_draw_image() so that the correct color shade is produced. -

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

+

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)

Draw a 1-pixel border inside this bounding box. -

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_line(int x, int y, int x1, int y1) +
void fl_line(int x, int y, int x1, int y1, int x2, int y2)

Draw one or two lines between the given points. -

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)
void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, -int y3)

+int y3)

Outline a 3 or 4-sided polygon with lines. -

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)
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int -x3, int y3)

+x3, int y3)

Fill a 3 or 4-sided polygon. The polygon must be convex. -

void fl_xyline(int x, int y, int x1) +

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_xyline(int x, int y, int x1, int y2, int x3)

Draw horizontal and vertical lines. A horizontal line is drawn first, then a vertical, then a horizontal. -

void fl_yxline(int x, int y, int y1) +

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_yxline(int x, int y, int y1, int x2, int y3)

Draw vertical and horizontal lines. A vertical line is drawn first, then a horizontal, then a vertical. -

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)

+

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)

Draw ellipse sections using integer coordinates. These functions match the rather limited circle drawing code provided @@ -389,40 +391,40 @@ severely limits the accuracy of these functions for complex graphics, so use OpenGL when greater accuracy and/or performance is required. -

void fl_push_matrix() -
void fl_pop_matrix()

+

void fl_push_matrix() +
void fl_pop_matrix()

Save and restore the current transformation. The maximum depth of the stack is 4. -

void fl_scale(float x, float y) +

void fl_scale(float x, float y)
void fl_scale(float x)
void fl_translate(float x, float y)
void fl_rotate(float d)
void fl_mult_matrix(float a, float b, float c, float d, float -x, float y)

+x, float y)

Concatenate another transformation onto the current one. The rotation angle is in degrees (not radians) and is counter-clockwise. -

void fl_begin_line() -
void fl_end_line()

+

void fl_begin_line() +
void fl_end_line()

Start and end drawing lines. -

void fl_begin_loop() -
void fl_end_loop()

+

void fl_begin_loop() +
void fl_end_loop()

Start and end drawing a closed sequence of lines. -

void fl_begin_polygon() -
void fl_end_polygon()

+

void fl_begin_polygon() +
void fl_end_polygon()

Start and end drawing a convex filled polygon. -

void fl_begin_complex_polygon() +

void fl_begin_complex_polygon()
void fl_gap() -
void fl_end_complex_polygon()

+
void fl_end_complex_polygon()

Start and end drawing a complex filled polygon. This polygon may be concave, may have holes in it, or may be several @@ -451,11 +453,11 @@ fl_begin_complex_polygon() and fl_begin_loop() and replace each fl_gap() with fl_end_loop();fl_begin_loop().

-

void fl_vertex(float x, float y)

+

void fl_vertex(float x, float y)

Add a single vertex to the current path. -

void fl_curve(float x, float y, float x1, float y1, float x2, float -y2, float x3, float y3)

+

void fl_curve(float x, float y, float x1, float y1, float x2, float +y2, float x3, float y3)

Add a series of points on a Bezier curve to the path. The curve ends (and two of the points) are at x,y and x3,y3. @@ -471,7 +473,7 @@ in degrees counter-clockwise from 3 o'clock. If end is less than start then it draws the arc in a clockwise direction. -

void fl_circle(float x, float y, float r)

+

void fl_circle(float x, float y, float r)

fl_circle() is equivalent to fl_arc(...,0,360) but may be faster. It must be the only thing in the path: if you @@ -494,8 +496,8 @@ want a circle as part of a complex polygon you must use fl_arc(). It is undefined whether this location or the characters are modified by the current transformation. -

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

+

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

Draw a nul-terminated string or an array of n characters starting at the given location. Text is aligned to the left and to @@ -527,32 +529,33 @@ to look for symbol names starting with the "@" character.

The text length is limited to 1024 caracters per line. -

void fl_measure(const char *, int &w, int &h, int draw_symbols = 1)

+

void fl_measure(const char *, int &w, +int &h, int draw_symbols = 1)

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

int fl_height()

+

int fl_height()

Recommended minimum line spacing for the current font. You can also just use the value of size passed to fl_font(). -

int fl_descent()

+

int fl_descent()

Recommended distance above the bottom of a fl_height() tall box to draw the text at so it looks centered vertically in that box. -

float fl_width(const char*) +

float fl_width(const char*)
float fl_width(const char*, int n) -
float fl_width(uchar)

+
float fl_width(uchar)i

Return the pixel width of a nul-terminated string, a sequence of n characters, or a single character in the current font. -

const char *fl_shortcut_label(ulong)

+

const char *fl_shortcut_label(ulong)

Unparse a shortcut value as used by Fl_Button @@ -598,7 +601,7 @@ the display. fl_font(a,b). This can be used to save/restore the font. -

Character Encoding

+

Character Encoding

FLTK 1 supports western character sets using the eight bit encoding of the user-selected global code page. For MS Windows and X11, the code @@ -748,7 +751,7 @@ the first one may be greater than zero.

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

-

int fl_draw_pixmap(char **data, int X, int Y, Fl_Color = FL_GRAY)

+

int fl_draw_pixmap(char **data, int X, int Y, Fl_Color = FL_GRAY)i

Draws 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 @@ -767,7 +770,7 @@ fl_draw_pixmap(foo, X, Y); Fl_Color argument. To draw with true transparency you must use the Fl_Pixmap class. -

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

+

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

An XPM image contains the dimensions in its data. This function finds and returns the width and height. The return diff --git a/documentation/functions.html b/documentation/functions.html index 26a19b74c..635c424f8 100644 --- a/documentation/functions.html +++ b/documentation/functions.html @@ -11,39 +11,138 @@ A.

@@ -726,22 +825,22 @@ are provided with FLTK: