mirror of
https://github.com/fltk/fltk.git
synced 2026-05-21 06:21:26 +08:00
Fixed typos and amended doxygen docs.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6565 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+26
-20
@@ -1,20 +1,25 @@
|
||||
/* This is the utf.c file from fltk2 adapted for use in my fltk1.1 port */
|
||||
|
||||
/* Copyright 2006 by Bill Spitzak and others.
|
||||
/* Copyright 2006-2008 by Bill Spitzak and others.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* Please report all bugs and problems to "fltk-bugs@fltk.org".
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
* USA.
|
||||
*
|
||||
* Please report all bugs and problems on the following page:
|
||||
*
|
||||
* http://www.fltk.org/str.php
|
||||
*/
|
||||
|
||||
// Modified to obey rfc3629, which limits unicode to 0-0x10ffff
|
||||
@@ -30,8 +35,8 @@
|
||||
@{ */
|
||||
|
||||
/**
|
||||
Convert a Unicode character into a utf-8 sequnece.
|
||||
\param[in] uc Unicode characte
|
||||
Converts a Unicode character into a utf-8 sequence.
|
||||
\param[in] uc Unicode character
|
||||
\param[out] text utf-8 sequence will be written here; if this pointer is
|
||||
\c NULL, only the length of the utf-8 sequence is calculated
|
||||
\return length of the sequence in bytes
|
||||
@@ -46,8 +51,8 @@
|
||||
@{ */
|
||||
|
||||
/**
|
||||
Calculate the size of a utf-8 sequnce for a Unnicode character.
|
||||
\param[in] uc Unicode characte
|
||||
Calculate the size of a utf-8 sequence for a Unicode character.
|
||||
\param[in] uc Unicode character
|
||||
\return length of the sequence in bytes
|
||||
*/
|
||||
//FL_EXPORT int fl_utf8_size(Fl_Unichar uc);
|
||||
@@ -497,7 +502,7 @@ unsigned fl_utf8toa(const char* src, unsigned srclen,
|
||||
possibly being "surrogate pairs" in the UTF-16 encoding used.
|
||||
On Unix wchar_t is 32 bits and each location is a character.
|
||||
|
||||
On Unix if a src word is greater than 0x10ffff then this is an
|
||||
On Unix if a \a src word is greater than 0x10ffff then this is an
|
||||
illegal character according to RFC 3629. These are converted as
|
||||
though they are 0xFFFD (REPLACEMENT CHARACTER). Characters in the
|
||||
range 0xd800 to 0xdfff, or ending with 0xfffe or 0xffff are also
|
||||
@@ -662,7 +667,7 @@ int fl_utf8locale(void) {
|
||||
|
||||
/*! Convert the UTF-8 used by FLTK to the locale-specific encoding
|
||||
used for filenames (and sometimes used for data in files).
|
||||
Unfortunatley due to stupid design you will have to do this as
|
||||
Unfortunately due to stupid design you will have to do this as
|
||||
needed for filenames. This is a bug on both Unix and Windows.
|
||||
|
||||
Up to \a dstlen bytes are written to \a dst, including a null
|
||||
@@ -675,7 +680,8 @@ int fl_utf8locale(void) {
|
||||
|
||||
If fl_utf8locale() returns true then this does not change the data.
|
||||
It is copied and truncated as necessary to
|
||||
the destination buffer and \a srclen is always returned. */
|
||||
the destination buffer and \a srclen is always returned.
|
||||
*/
|
||||
unsigned fl_utf8to_mb(const char* src, unsigned srclen,
|
||||
char* dst, unsigned dstlen)
|
||||
{
|
||||
@@ -800,7 +806,7 @@ unsigned fl_utf8from_mb(char* dst, unsigned dstlen,
|
||||
return srclen;
|
||||
}
|
||||
|
||||
/*! Examines the first \a srclen bytes in \a src and return a verdict
|
||||
/*! Examines the first \a srclen bytes in \a src and returns a verdict
|
||||
on whether it is UTF-8 or not.
|
||||
- Returns 0 if there is any illegal UTF-8 sequences, using the
|
||||
same rules as fl_utf8decode(). Note that some UCS values considered
|
||||
|
||||
+32
-28
@@ -34,7 +34,7 @@
|
||||
// Portable drawing code for drawing arbitrary shapes with
|
||||
// simple 2D transformations. See also fl_arc.cxx
|
||||
|
||||
// matt: the Quartz implementation purposly doesn't use the Quartz matrix
|
||||
// matt: the Quartz implementation purposely doesn't use the Quartz matrix
|
||||
// operations for reasons of compatibility and maintainability
|
||||
|
||||
#include <config.h>
|
||||
@@ -52,7 +52,7 @@ static matrix stack[32];
|
||||
static int sptr = 0;
|
||||
|
||||
/**
|
||||
Save the current transformation matrix on the stack.
|
||||
Saves the current transformation matrix on the stack.
|
||||
The maximum depth of the stack is 4.
|
||||
*/
|
||||
void fl_push_matrix() {
|
||||
@@ -63,7 +63,7 @@ void fl_push_matrix() {
|
||||
}
|
||||
|
||||
/**
|
||||
Restore the current transformation matrix from the stack.
|
||||
Restores the current transformation matrix from the stack.
|
||||
*/
|
||||
void fl_pop_matrix() {
|
||||
if (sptr==0)
|
||||
@@ -73,7 +73,8 @@ void fl_pop_matrix() {
|
||||
}
|
||||
|
||||
/**
|
||||
Concatenate another transformation onto the current one.
|
||||
Concatenates another transformation onto the current one.
|
||||
|
||||
\param[in] a,b,c,d,x,y transformation matrix elements such that
|
||||
<tt> X' = aX + cY + x </tt> and <tt> Y' = bX +dY + y </tt>
|
||||
*/
|
||||
@@ -89,25 +90,25 @@ void fl_mult_matrix(double a, double b, double c, double d, double x, double y)
|
||||
}
|
||||
|
||||
/**
|
||||
Concatenate scaling transformation onto the current one.
|
||||
Concatenates scaling transformation onto the current one.
|
||||
\param[in] x,y scale factors in x-direction and y-direction
|
||||
*/
|
||||
void fl_scale(double x,double y) {fl_mult_matrix(x,0,0,y,0,0);}
|
||||
|
||||
/**
|
||||
Concatenate scaling transformation onto the current one.
|
||||
Concatenates scaling transformation onto the current one.
|
||||
\param[in] x scale factor in both x-direction and y-direction
|
||||
*/
|
||||
void fl_scale(double x) {fl_mult_matrix(x,0,0,x,0,0);}
|
||||
|
||||
/**
|
||||
Concatenate translation transformation onto the current one.
|
||||
Concatenates translation transformation onto the current one.
|
||||
\param[in] x,y translation factor in x-direction and y-direction
|
||||
*/
|
||||
void fl_translate(double x,double y) {fl_mult_matrix(1,0,0,1,x,y);}
|
||||
|
||||
/**
|
||||
Concatenate rotation transformation onto the current one.
|
||||
Concatenates rotation transformation onto the current one.
|
||||
\param[in] d - rotation angle, counter-clockwise in degrees (not radians)
|
||||
*/
|
||||
void fl_rotate(double d) {
|
||||
@@ -144,45 +145,45 @@ static int what;
|
||||
enum {LINE, LOOP, POLYGON, POINT_};
|
||||
|
||||
/**
|
||||
Start drawing a list of points. Points are added to the list with fl_vertex()
|
||||
Starts drawing a list of points. Points are added to the list with fl_vertex()
|
||||
*/
|
||||
void fl_begin_points() {n = 0; what = POINT_;}
|
||||
|
||||
/**
|
||||
Start drawing a list of lines.
|
||||
Starts drawing a list of lines.
|
||||
*/
|
||||
void fl_begin_line() {n = 0; what = LINE;}
|
||||
|
||||
/**
|
||||
Start drawing a closed sequence of lines.
|
||||
Starts drawing a closed sequence of lines.
|
||||
*/
|
||||
void fl_begin_loop() {n = 0; what = LOOP;}
|
||||
|
||||
/**
|
||||
Start drawing a convex filled polygon.
|
||||
Starts drawing a convex filled polygon.
|
||||
*/
|
||||
void fl_begin_polygon() {n = 0; what = POLYGON;}
|
||||
|
||||
/**
|
||||
Transform coordinate using current transformation matrix.
|
||||
Transforms coordinate using the current transformation matrix.
|
||||
\param[in] x,y coordinate
|
||||
*/
|
||||
double fl_transform_x(double x, double y) {return x*m.a + y*m.c + m.x;}
|
||||
|
||||
/**
|
||||
Transform coordinate using current transformation matrix.
|
||||
Transform coordinate using the current transformation matrix.
|
||||
\param[in] x,y coordinate
|
||||
*/
|
||||
double fl_transform_y(double x, double y) {return x*m.b + y*m.d + m.y;}
|
||||
|
||||
/**
|
||||
Transform distance using current transformation matrix.
|
||||
Transforms distance using current transformation matrix.
|
||||
\param[in] x,y coordinate
|
||||
*/
|
||||
double fl_transform_dx(double x, double y) {return x*m.a + y*m.c;}
|
||||
|
||||
/**
|
||||
Transform distance using current transformation matrix.
|
||||
Transforms distance using current transformation matrix.
|
||||
\param[in] x,y coordinate
|
||||
*/
|
||||
double fl_transform_dy(double x, double y) {return x*m.b + y*m.d;}
|
||||
@@ -200,7 +201,7 @@ static void fl_transformed_vertex(COORD_T x, COORD_T y) {
|
||||
}
|
||||
|
||||
/**
|
||||
Add coordinate pair to the vertex list without further transformations.
|
||||
Adds coordinate pair to the vertex list without further transformations.
|
||||
\param[in] xf,yf transformed coordinate
|
||||
*/
|
||||
void fl_transformed_vertex(double xf, double yf) {
|
||||
@@ -212,7 +213,7 @@ void fl_transformed_vertex(double xf, double yf) {
|
||||
}
|
||||
|
||||
/**
|
||||
Add a single vertex to the current path.
|
||||
Adds a single vertex to the current path.
|
||||
\param[in] x,y coordinate
|
||||
*/
|
||||
void fl_vertex(double x,double y) {
|
||||
@@ -220,7 +221,7 @@ void fl_vertex(double x,double y) {
|
||||
}
|
||||
|
||||
/**
|
||||
End list of points, and draw
|
||||
Ends list of points, and draws.
|
||||
*/
|
||||
void fl_end_points() {
|
||||
#if defined(USE_X11)
|
||||
@@ -241,7 +242,7 @@ void fl_end_points() {
|
||||
}
|
||||
|
||||
/**
|
||||
End list of lines, and draw
|
||||
Ends list of lines, and draws.
|
||||
*/
|
||||
void fl_end_line() {
|
||||
if (n < 2) {
|
||||
@@ -268,7 +269,7 @@ static void fixloop() { // remove equal points from closed path
|
||||
}
|
||||
|
||||
/**
|
||||
End closed sequence of lines, and draw
|
||||
Ends closed sequence of lines, and draws.
|
||||
*/
|
||||
void fl_end_loop() {
|
||||
fixloop();
|
||||
@@ -277,7 +278,7 @@ void fl_end_loop() {
|
||||
}
|
||||
|
||||
/**
|
||||
End convex filled polygon, and draw
|
||||
Ends convex filled polygon, and draws.
|
||||
*/
|
||||
void fl_end_polygon() {
|
||||
fixloop();
|
||||
@@ -311,11 +312,12 @@ static int numcount;
|
||||
#endif
|
||||
|
||||
/**
|
||||
Start 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
|
||||
seperate loops of the path.
|
||||
Starts drawing a complex filled polygon.
|
||||
|
||||
To outline the polygone, use fl_begin_loop() and reaplace each fl_gap()
|
||||
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
|
||||
@@ -333,6 +335,7 @@ void fl_begin_complex_polygon() {
|
||||
|
||||
/**
|
||||
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.
|
||||
*/
|
||||
@@ -350,7 +353,7 @@ void fl_gap() {
|
||||
}
|
||||
|
||||
/**
|
||||
End complex filled polygon, and draw
|
||||
Ends complex filled polygon, and draws.
|
||||
*/
|
||||
void fl_end_complex_polygon() {
|
||||
fl_gap();
|
||||
@@ -382,7 +385,8 @@ void fl_end_complex_polygon() {
|
||||
// See fl_arc.c for portable version.
|
||||
|
||||
/**
|
||||
fl_circle() is equivalent to fl_arc(x,y,r,0,360) but may be faster.
|
||||
fl_circle() is equivalent to fl_arc(x,y,r,0,360), but may be faster.
|
||||
|
||||
It must be the \e only thing in the path: if you want a circle as part of
|
||||
a complex polygon you must use fl_arc()
|
||||
\param[in] x,y,r center and radius of circle
|
||||
|
||||
Reference in New Issue
Block a user