From b983b285cc4f0627a1f72c9d6c510047af0ad116 Mon Sep 17 00:00:00 2001
From: Michael R Sweet In addition, the system may provide clipping when updating windows,
this clip region may be more complex than a simple rectangle. For colormapped displays, a color cell will be allocated out of
fl_colormap the first time you use a color. If the colormap fills
up then a least-squares algorithm is used to find the closest color. 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. fl_chord() is not yet implemented.
void fl_clip(int x, int y, int w, int h)
- Intersect the current clip region with a rectangle and push this new
+void fl_push_clip(int x, int y, int w, int h)
+Intersect the current clip region with a rectangle and push this new
region onto the stack.
+void fl_push_no_clip()
+Pushes an empty clip region on the stack so nothing will be clipped.
void fl_pop_clip()
- Restore the previous clip region. You must call fl_pop_clip()
- once for every time you call fl_clip(). If you return to
+Restore the previous clip region. You must call fl_pop_clip()
+once for every time you call fl_clip(). If you return to
FLTK with the clip stack not empty unpredictable results occur.
int fl_not_clipped(int x, int y, int w, int h)
Returns true if any of the rectangle intersects the current clip
@@ -57,9 +59,9 @@ Under X this returns 2 if the rectangle is partially clipped, and 1 if
it is entirely inside the clip region.
int fl_clip_box(int x, int y, int w, int h, int &X, int &Y, int &W,
int &H)
- Intersect the rectangle x,y,w,h with the current clip region
+Intersect the rectangle x,y,w,h with the current clip region
and returns the bounding box of the result in X,Y,W,H.
- Returns non-zero if the resulting rectangle is different than the
+Returns non-zero if the resulting rectangle is different than 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.
@@ -70,8 +72,8 @@ is completely outside the region.
is not the X or WIN32 pixel, it is an index into an internal
table! The table provides several general colors, a 24-entry gray
ramp, and a 5x8x5 color cube. All of these are named with
-poorly-documented symbols in
-<FL/Enumerations.H>.
+symbols in
+<FL/Enumerations.H>.
Fast Shapes
+Fast Shapes
These are used to draw almost all the FLTK widgets. They draw on
exact pixel boundaries and are as fast as possible, and their behavior
will be duplicated exactly on any platform FLTK is ported to. It is
@@ -121,10 +123,9 @@ drawn first, then a vertical, then a horizontal.
Draw 1-pixel wide 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_chord(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)
High-speed ellipse sections. These functions match the rather limited
-circle drawing code provided by X and MSWindows. The advantage over
+circle drawing code provided by X and WIN32. The advantage over
using fl_arc 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.
@@ -138,12 +139,11 @@ different number of arguments than the fl_arc()
Complex Shapes
+Complex Shapes
These functions let you draw arbitrary shapes with 2-D linear
transformations. The functionality matches that found in Adobe®
-PostScriptTM. The exact pixels filled in is less defined
-than for the above calls, so that FLTK can take advantage of drawing
+PostScriptTM. The exact pixels that are filled is less defined
+than for the previous calls so that FLTK can take advantage of drawing
hardware. The transformed vertices are rounded to integers before
drawing the line segments. This severely limits the accuracy of these
functions for complex graphics. Use OpenGL when greater accuracy
@@ -234,8 +234,8 @@ box to draw the text at so it looks centered vertically in that box.
float fl_width(const char*)
- Return the width of a nul-terminated string, a sequence of n
- characters, or a single character.
+ Return the pixel width of a nul-terminated string, a sequence of n
+ characters, or a single character in the current font.
float fl_width(const char*, int n)
float fl_width(uchar)const char *fl_shortcut_label(ulong)
Unparse a shortcut value as used by
Fl_Button or
@@ -318,10 +318,6 @@ thus redrawing is much faster.
It is undefined whether the location or drawing of the image is
affected by the current transformation, so you should only call these
when it is the identity.
-void fl_draw_bitmap(const uchar *, int X, int Y, int W, int H, int
-LD = 0)
- This function is planned but not yet implemented (it may be impossible
-under X without allocating a pixmap).
void fl_draw_image(const uchar *, int X, int Y, int W, int H, int D
= 3, int LD = 0)
void fl_draw_image_mono(const uchar *, int X, int Y, int W, int H,
@@ -383,8 +379,8 @@ first one may be greater than zero.
If D is 4 or more, you must fill in the unused bytes with zero.
To use an XPM, do:
@@ -395,7 +391,7 @@ zero if there was any error decoding the XPM data. fl_draw_pixmap(foo, X, Y); - In the current version the XPM data is converted to 8-bit full color + In the current version the XPM data is converted to 24-bit RGB color and passed through fl_draw_image(). This is obviously not the most efficient way to do it, and has the same visual limitations as listed above for fl_draw_image(). Transparent colors are @@ -448,7 +444,7 @@ make an Fl_Widget use a pixmap as a label, or to just draw the pixmap directly. Under X it will create an offscreen pixmap the first time it is drawn, and copy this each subsequent time it is drawn . -The current implementation converts the pixmap to 8 bit color data +
The current implementation converts the pixmap to 24-bit RGB data and uses fl_draw_image() to draw it. Thus you will get dithered colors on an 8 bit screen.