summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorAaron M. Ucko <ucko@debian.org>2010-11-10 18:47:56 -0500
committerAaron M. Ucko <ucko@debian.org>2010-11-10 18:47:56 -0500
commitbca4cadccd3dc3f056235ecb8d264abd5a3123ab (patch)
tree313466d8f58fc0c173f25301f7917a756ea56b08 /FL
parent95f5ee2210b7b1999eba0156d24566225eedf700 (diff)
Imported Upstream version 1.3~r7794
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl.H50
-rw-r--r--FL/Fl_Color_Chooser.H22
-rw-r--r--FL/Fl_Input.H211
-rw-r--r--FL/Fl_Multiline_Input.H9
-rw-r--r--FL/Fl_Multiline_Output.H8
-rw-r--r--FL/Fl_Native_File_Chooser_MAC.H6
-rw-r--r--FL/Fl_Preferences.H8
-rw-r--r--FL/Fl_Table.H173
-rw-r--r--FL/Fl_Text_Buffer.H371
-rw-r--r--FL/Fl_Text_Display.H698
-rw-r--r--FL/Fl_Widget.H10
-rw-r--r--FL/README.Xcode2
-rw-r--r--FL/fl_draw.H100
-rw-r--r--FL/fl_show_colormap.H25
-rw-r--r--FL/forms.H6
15 files changed, 870 insertions, 829 deletions
diff --git a/FL/Fl.H b/FL/Fl.H
index ac588d9..b871443 100644
--- a/FL/Fl.H
+++ b/FL/Fl.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl.H 7720 2010-10-12 12:34:19Z manolo $"
+// "$Id: Fl.H 7789 2010-10-31 22:39:40Z matt $"
//
// Main header file for the Fast Light Tool Kit (FLTK).
//
@@ -106,13 +106,14 @@ typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i);
/** @} */ /* group callback_functions */
+
/**
The Fl is the FLTK global (static) containing
state information and global methods for the current application.
*/
class FL_EXPORT Fl {
Fl() {}; // no constructor!
-
+
public: // should be private!
#ifndef FL_DOXYGEN
static int e_number;
@@ -143,7 +144,34 @@ public: // should be private!
If true then flush() will do something.
*/
static void damage(int d) {damage_ = d;}
-
+
+public:
+ typedef enum {
+ /// If set, the arrow keys can change focus from a text widget to another
+ /// widget. If clear, only Tab and BackTab can.
+ OPTION_ARROW_FOCUS = 0,
+ /// If set, calls to fl_file_chooser will open the native file chooser.
+ /// If clear, the FLTK file chooser will open instead.
+ /// \todo Fl::OPTION_NATIVE_FILECHOOSER not yet supported
+ OPTION_NATIVE_FILECHOOSER,
+ // don't change this, leave it always as the last element
+ OPTION_LAST
+ } Fl_Option;
+
+private:
+ static unsigned char options_[OPTION_LAST];
+ static unsigned char options_read_;
+
+public:
+ /**
+ Return a global setting for all FLTK applications, possibly overridden
+ by a setting specifically for this application.
+
+ \param opt
+ \returns true or false
+ */
+ static bool option(Fl_Option opt);
+
/**
The currently executing idle callback function: DO NOT USE THIS DIRECTLY!
@@ -176,9 +204,9 @@ public:
static double version();
// argument parsers:
- static int arg(int, char**, int&);
- static int args(int, char**, int&, Fl_Args_Handler ah = 0);
- static void args(int, char**);
+ static int arg(int argc, char **argv, int& i);
+ static int args(int argc, char **argv, int& i, Fl_Args_Handler cb = 0);
+ static void args(int argc, char **argv);
/**
Usage string displayed if Fl::args() detects an invalid argument.
This may be changed to point to customized text at run-time.
@@ -718,15 +746,15 @@ public:
Sets an entry in the fl_color index table. You can set it to any
8-bit RGB color. The color is not allocated until fl_color(i) is used.
*/
- static void set_color(Fl_Color, unsigned); // platform dependent
- static Fl_Color get_color(Fl_Color);
- static void get_color(Fl_Color, uchar&, uchar&, uchar&);
+ static void set_color(Fl_Color i, unsigned c); // platform dependent
+ static unsigned get_color(Fl_Color i);
+ static void get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue);
/**
Frees the specified color from the colormap, if applicable.
If overlay is non-zero then the color is freed from the
overlay colormap.
*/
- static void free_color(Fl_Color, int overlay = 0); // platform dependent
+ static void free_color(Fl_Color i, int overlay = 0); // platform dependent
// fonts:
static const char* get_font(Fl_Font);
@@ -1085,5 +1113,5 @@ public:
#endif // !Fl_H
//
-// End of "$Id: Fl.H 7720 2010-10-12 12:34:19Z manolo $".
+// End of "$Id: Fl.H 7789 2010-10-31 22:39:40Z matt $".
//
diff --git a/FL/Fl_Color_Chooser.H b/FL/Fl_Color_Chooser.H
index 890c67c..7628553 100644
--- a/FL/Fl_Color_Chooser.H
+++ b/FL/Fl_Color_Chooser.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Color_Chooser.H 6614 2009-01-01 16:11:32Z matt $"
+// "$Id: Fl_Color_Chooser.H 7781 2010-10-30 20:16:43Z matt $"
//
// Color chooser header file for the Fast Light Tool Kit (FLTK).
//
@@ -127,9 +127,19 @@ class FL_EXPORT Fl_Color_Chooser : public Fl_Group {
static void rgb_cb(Fl_Widget*, void*);
static void mode_cb(Fl_Widget*, void*);
public:
- /** Returns which Fl_Color_Chooser variant is currently active */
+
+ /**
+ Returns which Fl_Color_Chooser variant is currently active
+ \return color modes are rgb(0), byte(1), hex(2), or hsv(3)
+ */
int mode() {return choice.value();}
-
+
+ /**
+ Set which Fl_Color_Chooser variant is currently active
+ \param[in] newMode color modes are rgb(0), byte(1), hex(2), or hsv(3)
+ */
+ void mode(int newMode);
+
/**
Returns the current hue.
0 <= hue < 6. Zero is red, one is yellow, two is green, etc.
@@ -179,11 +189,11 @@ public:
Fl_Color_Chooser(int X, int Y, int W, int H, const char *L = 0);
};
-FL_EXPORT int fl_color_chooser(const char* name, double& r, double& g, double& b);
-FL_EXPORT int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b);
+FL_EXPORT int fl_color_chooser(const char* name, double& r, double& g, double& b, int m=-1);
+FL_EXPORT int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b, int m=-1);
#endif
//
-// End of "$Id: Fl_Color_Chooser.H 6614 2009-01-01 16:11:32Z matt $".
+// End of "$Id: Fl_Color_Chooser.H 7781 2010-10-30 20:16:43Z matt $".
//
diff --git a/FL/Fl_Input.H b/FL/Fl_Input.H
index 01ae60d..717f897 100644
--- a/FL/Fl_Input.H
+++ b/FL/Fl_Input.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input.H 6699 2009-03-18 22:58:12Z engelsman $"
+// "$Id: Fl_Input.H 7789 2010-10-31 22:39:40Z matt $"
//
// Input header file for the Fast Light Tool Kit (FLTK).
//
@@ -37,10 +37,10 @@
This is the FLTK text input widget. It displays a single line
of text and lets the user edit it. Normally it is drawn with an
inset box and a white background. The text may contain any
- characters (even 0), and will correctly display anything, using
- ^X notation for unprintable control characters and \\nnn notation
- for unprintable characters with the high bit set. It assumes the
- font can draw any characters in the ISO-8859-1 character set.</P>
+ characters (even 0), and will correctly display any UTF text, using
+ ^X notation for unprintable control characters. It assumes the
+ font can draw any characters of the used scripts, which is true
+ for standard fonts under MSWindows and Mac OS X.</P>
<CENTER><TABLE border=1 WIDTH=90% summary="Fl_Input keyboard and mouse bindings.">
@@ -92,14 +92,14 @@
sequence. The next one or two keys typed define the character to
insert (see table that follows.)
- <p>For instance, to type "" type [compose][a]['] or [compose]['][a].
+ <p>For instance, to type "á" type [compose][a]['] or [compose]['][a].
<P>The character "nbsp" (non-breaking space) is typed by using
[compose][space].
<P>The single-character sequences may be followed by a space if
necessary to remove ambiguity. For instance, if you really want to
- type "~" rather than "" you must type [compose][a][space][~].
+ type "ª~" rather than "ã" you must type [compose][a][space][~].
<p>The same key may be used to "quote" control characters into the
text. If you need a ^Q character you can get one by typing
@@ -114,7 +114,10 @@
also be able to type "dead key" prefix characters. On X you will
actually be able to see what dead key you typed, and if you then move
the cursor without completing the sequence the accent will remain
- inserted.</TD></TR>
+ inserted.
+
+ <p>Under Mac OS X, character composition is done as for any Mac application
+ using Mac OS-defined keystroke series.</TD></TR>
</TABLE></CENTER>
<!-- NEW PAGE -->
@@ -130,116 +133,116 @@
</tr><tr>
<td align=center>sp</td><td align=center><small>nbsp</small></td>
- <td align=center>*</td><td align=center></td>
- <td align=center>` A</td><td align=center></td>
- <td align=center>D -</td><td align=center></td>
- <td align=center>` a</td><td align=center></td>
- <td align=center>d -</td><td align=center></td>
+ <td align=center>*</td><td align=center>°</td>
+ <td align=center>` A</td><td align=center>À</td>
+ <td align=center>D -</td><td align=center>Ð</td>
+ <td align=center>` a</td><td align=center>à</td>
+ <td align=center>d -</td><td align=center>ð</td>
</tr><tr>
- <td align=center>!</td><td align=center></td>
- <td align=center>+ -</td><td align=center></td>
- <td align=center>' A</td><td align=center></td>
- <td align=center>~ N</td><td align=center></td>
- <td align=center>' a</td><td align=center></td>
- <td align=center>~ n</td><td align=center></td>
+ <td align=center>!</td><td align=center>¡</td>
+ <td align=center>+ -</td><td align=center>±</td>
+ <td align=center>' A</td><td align=center>Á</td>
+ <td align=center>~ N</td><td align=center>Ñ</td>
+ <td align=center>' a</td><td align=center>á</td>
+ <td align=center>~ n</td><td align=center>ñ</td>
</tr><tr>
- <td align=center>%</td><td align=center></td>
- <td align=center>2</td><td align=center></td>
- <td align=center>A ^</td><td align=center></td>
- <td align=center>` O</td><td align=center></td>
- <td align=center>^ a</td><td align=center></td>
- <td align=center>` o</td><td align=center></td>
+ <td align=center>%</td><td align=center>¢</td>
+ <td align=center>2</td><td align=center>²</td>
+ <td align=center>A ^</td><td align=center>Â</td>
+ <td align=center>` O</td><td align=center>Ò</td>
+ <td align=center>^ a</td><td align=center>â</td>
+ <td align=center>` o</td><td align=center>ò</td>
</tr><tr>
- <td align=center>#</td><td align=center></td>
- <td align=center>3</td><td align=center></td>
- <td align=center>~ A</td><td align=center></td>
- <td align=center>' O</td><td align=center></td>
- <td align=center>~ a</td><td align=center></td>
- <td align=center>' o</td><td align=center></td>
+ <td align=center>#</td><td align=center>£</td>
+ <td align=center>3</td><td align=center>³</td>
+ <td align=center>~ A</td><td align=center>Ã</td>
+ <td align=center>' O</td><td align=center>Ó</td>
+ <td align=center>~ a</td><td align=center>ã</td>
+ <td align=center>' o</td><td align=center>ó</td>
</tr><tr>
- <td align=center>$</td><td align=center></td>
- <td align=center>'</td><td align=center></td>
- <td align=center>: A</td><td align=center></td>
- <td align=center>^ O</td><td align=center></td>
- <td align=center>: a</td><td align=center></td>
- <td align=center>^ o</td><td align=center></td>
+ <td align=center>$</td><td align=center>¤</td>
+ <td align=center>'</td><td align=center>´</td>
+ <td align=center>: A</td><td align=center>Ä</td>
+ <td align=center>^ O</td><td align=center>Ô</td>
+ <td align=center>: a</td><td align=center>ä</td>
+ <td align=center>^ o</td><td align=center>ô</td>
</tr><tr>
- <td align=center>y =</td><td align=center></td>
- <td align=center>u</td><td align=center></td>
- <td align=center>* A</td><td align=center></td>
- <td align=center>~ O</td><td align=center></td>
- <td align=center>* a</td><td align=center></td>
- <td align=center>~ o</td><td align=center></td>
+ <td align=center>y =</td><td align=center>¥</td>
+ <td align=center>u</td><td align=center>µ</td>
+ <td align=center>* A</td><td align=center>Å</td>
+ <td align=center>~ O</td><td align=center>Õ</td>
+ <td align=center>* a</td><td align=center>å</td>
+ <td align=center>~ o</td><td align=center>õ</td>
</tr><tr>
- <td align=center>|</td><td align=center></td>
- <td align=center>p</td><td align=center></td>
- <td align=center>A E</td><td align=center></td>
- <td align=center>: O</td><td align=center></td>
- <td align=center>a e</td><td align=center></td>
- <td align=center>: o</td><td align=center></td>
+ <td align=center>|</td><td align=center>¦</td>
+ <td align=center>p</td><td align=center>¶</td>
+ <td align=center>A E</td><td align=center>Æ</td>
+ <td align=center>: O</td><td align=center>Ö</td>
+ <td align=center>a e</td><td align=center>æ</td>
+ <td align=center>: o</td><td align=center>ö</td>
</tr><tr>
- <td align=center>&</td><td align=center></td>
- <td align=center>.</td><td align=center></td>
- <td align=center>, C</td><td align=center></td>
- <td align=center>x</td><td align=center></td>
- <td align=center>, c</td><td align=center></td>
- <td align=center>- :</td><td align=center></td>
+ <td align=center>&</td><td align=center>§</td>
+ <td align=center>.</td><td align=center>·</td>
+ <td align=center>, C</td><td align=center>Ç</td>
+ <td align=center>x</td><td align=center>×</td>
+ <td align=center>, c</td><td align=center>ç</td>
+ <td align=center>- :</td><td align=center>÷</td>
</tr><tr>
- <td align=center>:</td><td align=center></td>
- <td align=center>,</td><td align=center></td>
- <td align=center>E `</td><td align=center></td>
- <td align=center>O /</td><td align=center></td>
- <td align=center>` e</td><td align=center></td>
- <td align=center>o /</td><td align=center></td>
+ <td align=center>:</td><td align=center>¨</td>
+ <td align=center>,</td><td align=center>¸</td>
+ <td align=center>E `</td><td align=center>È</td>
+ <td align=center>O /</td><td align=center>Ø</td>
+ <td align=center>` e</td><td align=center>è</td>
+ <td align=center>o /</td><td align=center>ø</td>
</tr><tr>
- <td align=center>c</td><td align=center></td>
- <td align=center>1</td><td align=center></td>
- <td align=center>' E</td><td align=center></td>
- <td align=center>` U</td><td align=center></td>
- <td align=center>' e</td><td align=center></td>
- <td align=center>` u</td><td align=center></td>
+ <td align=center>c</td><td align=center>©</td>
+ <td align=center>1</td><td align=center>¹</td>
+ <td align=center>' E</td><td align=center>É</td>
+ <td align=center>` U</td><td align=center>Ù</td>
+ <td align=center>' e</td><td align=center>é</td>
+ <td align=center>` u</td><td align=center>ù</td>
</tr><tr>
- <td align=center>a</td><td align=center></td>
- <td align=center>o</td><td align=center></td>
- <td align=center>^ E</td><td align=center></td>
- <td align=center>' U</td><td align=center></td>
- <td align=center>^ e</td><td align=center></td>
- <td align=center>' u</td><td align=center></td>
+ <td align=center>a</td><td align=center>ª</td>
+ <td align=center>o</td><td align=center>º</td>
+ <td align=center>^ E</td><td align=center>Ê</td>
+ <td align=center>' U</td><td align=center>Ú</td>
+ <td align=center>^ e</td><td align=center>ê</td>
+ <td align=center>' u</td><td align=center>ú</td>
</tr><tr>
- <td align=center>&lt; &lt;</td><td align=center></td>
- <td align=center>&gt; &gt;</td><td align=center></td>
- <td align=center>: E</td><td align=center></td>
- <td align=center>^ U</td><td align=center></td>
- <td align=center>: e</td><td align=center></td>
- <td align=center>^ u</td><td align=center></td>
+ <td align=center>&lt; &lt;</td><td align=center>«</td>
+ <td align=center>&gt; &gt;</td><td align=center>»</td>
+ <td align=center>: E</td><td align=center>Ë</td>
+ <td align=center>^ U</td><td align=center>Û</td>
+ <td align=center>: e</td><td align=center>ë</td>
+ <td align=center>^ u</td><td align=center>û</td>
</tr><tr>
- <td align=center>~</td><td align=center></td>
- <td align=center>1 4</td><td align=center></td>
- <td align=center>` I</td><td align=center></td>
- <td align=center>: U</td><td align=center></td>
- <td align=center>` i</td><td align=center></td>
- <td align=center>: u</td><td align=center></td>
+ <td align=center>~</td><td align=center>¬</td>
+ <td align=center>1 4</td><td align=center>¼</td>
+ <td align=center>` I</td><td align=center>Ì</td>
+ <td align=center>: U</td><td align=center>Ü</td>
+ <td align=center>` i</td><td align=center>ì</td>
+ <td align=center>: u</td><td align=center>ü</td>
</tr><tr>
- <td align=center>-</td><td align=center></td>
- <td align=center>1 2</td><td align=center></td>
- <td align=center>' I</td><td align=center></td>
- <td align=center>' Y</td><td align=center></td>
- <td align=center>' i</td><td align=center></td>
- <td align=center>' y</td><td align=center></td>
+ <td align=center>-</td><td align=center>­</td>
+ <td align=center>1 2</td><td align=center>½</td>
+ <td align=center>' I</td><td align=center>Í</td>
+ <td align=center>' Y</td><td align=center>Ý</td>
+ <td align=center>' i</td><td align=center>í</td>
+ <td align=center>' y</td><td align=center>ý</td>
</tr><tr>
- <td align=center>r</td><td align=center></td>
- <td align=center>3 4</td><td align=center></td>
- <td align=center>^ I</td><td align=center></td>
- <td align=center>T H</td><td align=center></td>
- <td align=center>^ i</td><td align=center></td>
- <td align=center>t h</td><td align=center></td>
+ <td align=center>r</td><td align=center>®</td>
+ <td align=center>3 4</td><td align=center>¾</td>
+ <td align=center>^ I</td><td align=center>Î</td>
+ <td align=center>T H</td><td align=center>Þ</td>
+ <td align=center>^ i</td><td align=center>î</td>
+ <td align=center>t h</td><td align=center>þ</td>
</tr><tr>
- <td align=center>_</td><td align=center></td>
- <td align=center>?</td><td align=center></td>
- <td align=center>: I</td><td align=center></td>
- <td align=center>s s</td><td align=center></td>
- <td align=center>: i</td><td align=center></td>
- <td align=center>: y</td><td align=center></td>
+ <td align=center>_</td><td align=center>¯</td>
+ <td align=center>?</td><td align=center>¿</td>
+ <td align=center>: I</td><td align=center>Ï</td>
+ <td align=center>s s</td><td align=center>ß</td>
+ <td align=center>: i</td><td align=center>ï</td>
+ <td align=center>: y</td><td align=center>ÿ</td>
</tr>
</table></center>
*/
@@ -258,5 +261,5 @@ public:
#endif
//
-// End of "$Id: Fl_Input.H 6699 2009-03-18 22:58:12Z engelsman $".
+// End of "$Id: Fl_Input.H 7789 2010-10-31 22:39:40Z matt $".
//
diff --git a/FL/Fl_Multiline_Input.H b/FL/Fl_Multiline_Input.H
index 5f46624..783da32 100644
--- a/FL/Fl_Multiline_Input.H
+++ b/FL/Fl_Multiline_Input.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Multiline_Input.H 6889 2009-09-19 22:09:00Z greg.ercolano $"
+// "$Id: Fl_Multiline_Input.H 7789 2010-10-31 22:39:40Z matt $"
//
// Multiline input header file for the Fast Light Tool Kit (FLTK).
//
@@ -38,15 +38,14 @@
This input field displays '\n' characters as new lines rather than ^J,
and accepts the Return, Tab, and up and down arrow keys. This is for
editing multiline text.
- <P>
+
This is far from the nirvana of text editors, and is probably only
good for small bits of text, 10 lines at most. Note that this widget
does not support scrollbars or per-character color control.
- <P>
+
If you are presenting large amounts of text and need scrollbars
or full color control of characters, you probably want Fl_Text_Editor
instead.
- <P>
*/
class Fl_Multiline_Input : public Fl_Input {
public:
@@ -62,5 +61,5 @@ public:
#endif
//
-// End of "$Id: Fl_Multiline_Input.H 6889 2009-09-19 22:09:00Z greg.ercolano $".
+// End of "$Id: Fl_Multiline_Input.H 7789 2010-10-31 22:39:40Z matt $".
//
diff --git a/FL/Fl_Multiline_Output.H b/FL/Fl_Multiline_Output.H
index f0edf63..fbab1d9 100644
--- a/FL/Fl_Multiline_Output.H
+++ b/FL/Fl_Multiline_Output.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Multiline_Output.H 6889 2009-09-19 22:09:00Z greg.ercolano $"
+// "$Id: Fl_Multiline_Output.H 7789 2010-10-31 22:39:40Z matt $"
//
// Multi line output header file for the Fast Light Tool Kit (FLTK).
//
@@ -37,10 +37,10 @@
This widget is a subclass of Fl_Output that displays multiple
lines of text. It also displays tab characters as whitespace to the
next column.
- <P>
+
Note that this widget does not support scrollbars, or per-character
color control.
- <P>
+
If you are presenting large amounts of read-only text
and need scrollbars, or full color control of characters,
then use Fl_Text_Display. If you want to display HTML text,
@@ -60,5 +60,5 @@ public:
#endif
//
-// End of "$Id: Fl_Multiline_Output.H 6889 2009-09-19 22:09:00Z greg.ercolano $".
+// End of "$Id: Fl_Multiline_Output.H 7789 2010-10-31 22:39:40Z matt $".
//
diff --git a/FL/Fl_Native_File_Chooser_MAC.H b/FL/Fl_Native_File_Chooser_MAC.H
index 78ab4b7..ebef7f8 100644
--- a/FL/Fl_Native_File_Chooser_MAC.H
+++ b/FL/Fl_Native_File_Chooser_MAC.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Native_File_Chooser_MAC.H 7715 2010-10-11 18:10:32Z greg.ercolano $"
+// "$Id: Fl_Native_File_Chooser_MAC.H 7788 2010-10-31 20:47:50Z matt $"
//
// FLTK native OS file chooser widget
//
@@ -50,7 +50,7 @@ public:
NO_OPTIONS = 0x0000, // no options enabled
SAVEAS_CONFIRM = 0x0001, // Show native 'Save As' overwrite confirm dialog (if supported)
NEW_FOLDER = 0x0002, // Show 'New Folder' icon (if supported)
- PREVIEW = 0x0004, // enable preview mode
+ PREVIEW = 0x0004 // enable preview mode
};
private:
int _btype; // kind-of browser to show()
@@ -117,5 +117,5 @@ public:
#endif /*!FL_DOXYGEN*/
//
-// End of "$Id: Fl_Native_File_Chooser_MAC.H 7715 2010-10-11 18:10:32Z greg.ercolano $".
+// End of "$Id: Fl_Native_File_Chooser_MAC.H 7788 2010-10-31 20:47:50Z matt $".
//
diff --git a/FL/Fl_Preferences.H b/FL/Fl_Preferences.H
index 1c20181..508a74a 100644
--- a/FL/Fl_Preferences.H
+++ b/FL/Fl_Preferences.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Preferences.H 7672 2010-07-10 09:44:45Z matt $"
+// "$Id: Fl_Preferences.H 7788 2010-10-31 20:47:50Z matt $"
//
// Preferences .
//
@@ -99,7 +99,7 @@ public:
Fl_Preferences( Fl_Preferences *parent, int groupIndex );
Fl_Preferences(const Fl_Preferences&);
Fl_Preferences( ID id );
- ~Fl_Preferences();
+ virtual ~Fl_Preferences();
/** Return an ID that can later be reused to open more references to this dataset.
*/
@@ -156,8 +156,6 @@ public:
// char export( const char *filename, Type fileFormat );
// char import( const char *filename );
- // char copyTo(class Fl_Tree*); // deprecated, use Fl_Tree::load(Fl_Preferences&)
-
/**
'Name' provides a simple method to create numerical or more complex
procedural names for entries and groups on the fly.
@@ -283,5 +281,5 @@ protected:
#endif // !Fl_Preferences_H
//
-// End of "$Id: Fl_Preferences.H 7672 2010-07-10 09:44:45Z matt $".
+// End of "$Id: Fl_Preferences.H 7788 2010-10-31 20:47:50Z matt $".
//
diff --git a/FL/Fl_Table.H b/FL/Fl_Table.H
index 3be069d..8944045 100644
--- a/FL/Fl_Table.H
+++ b/FL/Fl_Table.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Table.H 7612 2010-05-19 07:22:37Z greg.ercolano $"
+// "$Id: Fl_Table.H 7753 2010-10-26 12:06:52Z greg.ercolano $"
//
// Fl_Table -- A table widget
//
@@ -61,12 +61,12 @@
This widget can be used in several ways:
- - As a custom widget; see test/testtablerow.cxx. Very optimal for even
+ - As a custom widget; see test/table.cxx. Very optimal for even
extremely large tables.
- - As a table made up of a single FLTK widget instanced all over the table;
- see test/singleinput.cxx. Very optimal for even extremely large tables;
+ - As a table made up of a single FLTK widget instanced all over the table,
+ simulating a numeric spreadsheet.
- As a regular container of FLTK widgets, one widget per cell.
- See test/widgettable.cxx. \em Not recommended for large tables.
+ See examples/table-as-container.cxx. \em Not recommended for large tables.
When acting as part of a custom widget, events on the cells and/or headings
generate callbacks when they are clicked by the user. You control when events
@@ -121,7 +121,8 @@
allowing FLTK license to apply while his widgets are part of the library.
If used on its own, this is the license that applies:
-
+
+ \verbatim
Fl_Table License
December 16, 2002
@@ -165,20 +166,24 @@
[program/widget] is based in part on the work of
the Fl_Table project http://seriss.com/people/erco/fltk/Fl_Table/
+ \endverbatim
*/
class Fl_Table : public Fl_Group {
public:
+ /**
+ The context bit flags for Fl_Table related callbacks (eg. draw_cell(), callback(), etc)
+ */
enum TableContext {
- CONTEXT_NONE = 0,
- CONTEXT_STARTPAGE = 0x01, // before a page is redrawn
- CONTEXT_ENDPAGE = 0x02, // after a page is redrawn
- CONTEXT_ROW_HEADER = 0x04, // in the row header
- CONTEXT_COL_HEADER = 0x08, // in the col header
- CONTEXT_CELL = 0x10, // in one of the cells
- CONTEXT_TABLE = 0x20, // in the table
- CONTEXT_RC_RESIZE = 0x40 // column or row being resized
+ CONTEXT_NONE = 0, ///< no known context
+ CONTEXT_STARTPAGE = 0x01, ///< before a page is redrawn
+ CONTEXT_ENDPAGE = 0x02, ///< after a page is redrawn
+ CONTEXT_ROW_HEADER = 0x04, ///< in the row header
+ CONTEXT_COL_HEADER = 0x08, ///< in the col header
+ CONTEXT_CELL = 0x10, ///< in one of the cells
+ CONTEXT_TABLE = 0x20, ///< in a dead zone of table
+ CONTEXT_RC_RESIZE = 0x40 ///< column or row being resized
};
private:
@@ -326,38 +331,47 @@ protected:
<table border=1>
<tr>
<td>\p Fl_Table::CONTEXT_STARTPAGE</td>
- <td> When table, or parts of the table, are about to be redrawn.
- Use to initialize static data, such as font selections.
- r/c will be zero, x/y/w/h will be the dimensions of the
- table's entire data area.
- (Useful for locking a database before accessing; see
- also visible_cells())</td>
+ <td>When table, or parts of the table, are about to be redrawn.<br>
+ Use to initialize static data, such as font selections.<p>
+ R/C will be zero,<br>
+ X/Y/W/H will be the dimensions of the table's entire data area.<br>
+ (Useful for locking a database before accessing; see
+ also visible_cells())</td>
</tr><tr>
<td>\p Fl_Table::CONTEXT_ENDPAGE</td>
- <td>When table has completed being redrawn.
- r/c will be zero, x/y/w/h dimensions of table's data area.
- (Useful for unlocking a database after accessing)</td>
+ <td>When table has completed being redrawn.<br>
+ R/C will be zero, X/Y/W/H dimensions of table's data area.<br>
+ (Useful for unlocking a database after accessing)</td>
</tr><tr>
<td>\p Fl_Table::CONTEXT_ROW_HEADER</td>
- <td>Whenever a row header cell needs to be drawn.</td>
+ <td>Whenever a row header cell needs to be drawn.<br>
+ R will be the row number of the header being redrawn,<br>
+ C will be zero,<br>
+ X/Y/W/H will be the fltk drawing area of the row header in the window </td>
</tr><tr>
<td>\p Fl_Table::CONTEXT_COL_HEADER</td>
- <td>Whenever a column header cell needs to be drawn.</td>
+ <td>Whenever a column header cell needs to be drawn.<br>
+ R will be zero, <br>
+ C will be the column number of the header being redrawn,<br>
+ X/Y/W/H will be the fltk drawing area of the column header in the window </td>
</tr><tr>
<td>\p Fl_Table::CONTEXT_CELL</td>
- <td>Whenever a data cell in the table needs to be drawn.</td>
+ <td>Whenever a data cell in the table needs to be drawn.<br>
+ R/C will be the row/column of the cell to be drawn,<br>
+ X/Y/W/H will be the fltk drawing area of the cell in the window </td>
</tr><tr>
<td>\p Fl_Table::CONTEXT_RC_RESIZE</td>
<td>Whenever table or row/column is resized or scrolled,
- either interactively or via col_width() or row_height().
-
- Useful for fltk containers that need to resize or move
- the child fltk widgets.</td>
+ either interactively or via col_width() or row_height().<br>
+ R/C/X/Y/W/H will all be zero.
+ <p>
+ Useful for fltk containers that need to resize or move
+ the child fltk widgets.</td>
</tr>
</table>
\p row and \p col will be set to the row and column number
- the user clicked on. In the case of row headers, \p col will be \a 0.
+ of the cell being drawn. In the case of row headers, \p col will be \a 0.
In the case of column headers, \p row will be \a 0.
<tt>x/y/w/h</tt> will be the position and dimensions of where the cell
@@ -373,53 +387,53 @@ protected:
// This is called whenever Fl_Table wants you to draw a cell
void MyTable::draw_cell(TableContext context, int R=0, int C=0, int X=0, int Y=0, int W=0, int H=0)
{
- static char s[40];
- sprintf(s, "%d/%d", R, C); // text for each cell
- switch ( context )
- {
- case CONTEXT_STARTPAGE: // Fl_Table telling us its starting to draw page
- fl_font(FL_HELVETICA, 16);
- return;
-
- case CONTEXT_ROW_HEADER: // Fl_Table telling us it's draw row/col headers
- case CONTEXT_COL_HEADER:
- fl_push_clip(X, Y, W, H);
- {
- fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, color());
- fl_color(FL_BLACK);
- fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER);
- }
- fl_pop_clip();
- return;
-
- case CONTEXT_CELL: // Fl_Table telling us to draw cells
- fl_push_clip(X, Y, W, H);
- {
- // BG COLOR
- fl_color( row_selected(R) ? selection_color() : FL_WHITE);
- fl_rectf(X, Y, W, H);
-
- // TEXT
- fl_color(FL_BLACK);
- fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER);
-
- // BORDER
- fl_color(FL_LIGHT2);
- fl_rect(X, Y, W, H);
- }
- fl_pop_clip();
- return;
-
- default:
- return;
- }
- //NOTREACHED
+ static char s[40];
+ sprintf(s, "%d/%d", R, C); // text for each cell
+ switch ( context )
+ {
+ case CONTEXT_STARTPAGE: // Fl_Table telling us its starting to draw page
+ fl_font(FL_HELVETICA, 16);
+ return;
+
+ case CONTEXT_ROW_HEADER: // Fl_Table telling us it's draw row/col headers
+ case CONTEXT_COL_HEADER:
+ fl_push_clip(X, Y, W, H);
+ {
+ fl_draw_box(FL_THIN_UP_BOX, X, Y, W, H, color());
+ fl_color(FL_BLACK);
+ fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER);
+ }
+ fl_pop_clip();
+ return;
+
+ case CONTEXT_CELL: // Fl_Table telling us to draw cells
+ fl_push_clip(X, Y, W, H);
+ {
+ // BG COLOR
+ fl_color( row_selected(R) ? selection_color() : FL_WHITE);
+ fl_rectf(X, Y, W, H);
+
+ // TEXT
+ fl_color(FL_BLACK);
+ fl_draw(s, X, Y, W, H, FL_ALIGN_CENTER);
+
+ // BORDER
+ fl_color(FL_LIGHT2);
+ fl_rect(X, Y, W, H);
+ }
+ fl_pop_clip();
+ return;
+
+ default:
+ return;
+ }
+ //NOTREACHED
}
\endcode
*/
virtual void draw_cell(TableContext context, int R=0, int C=0,
int X=0, int Y=0, int W=0, int H=0)
- { } // overridden by deriving class
+ { } // overridden by deriving class
long row_scroll_position(int row); // find scroll position of row (in pixels)
long col_scroll_position(int col); // find scroll position of col (in pixels)
@@ -811,8 +825,8 @@ public:
return(row_position());
}
int is_selected(int r, int c); // selected cell
- void get_selection(int& s_top, int& s_left, int& s_bottom, int& s_right);
- void set_selection(int s_top, int s_left, int s_bottom, int s_right);
+ void get_selection(int &row_top, int &col_left, int &row_bot, int &col_right);
+ void set_selection(int row_top, int col_left, int row_bot, int col_right);
int move_cursor(int R, int C);
/**
@@ -879,10 +893,9 @@ public:
Typically used in loops, eg:
\code
- for ( int i=0; i<children(); i++ )
- {
- Fl_Widget *w = child(i);
- [..]
+ for ( int i=0; i<children(); i++ ) {
+ Fl_Widget *w = child(i);
+ [..]
}
\endcode
*/
@@ -1063,5 +1076,5 @@ public:
#endif /*_FL_TABLE_H*/
//
-// End of "$Id: Fl_Table.H 7612 2010-05-19 07:22:37Z greg.ercolano $".
+// End of "$Id: Fl_Table.H 7753 2010-10-26 12:06:52Z greg.ercolano $".
//
diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H
index 84fae40..c9825d3 100644
--- a/FL/Fl_Text_Buffer.H
+++ b/FL/Fl_Text_Buffer.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Text_Buffer.H 7527 2010-04-18 14:33:33Z engelsman $"
+// "$Id: Fl_Text_Buffer.H 7794 2010-11-04 21:53:56Z matt $"
//
// Header file for Fl_Text_Buffer class.
//
@@ -39,7 +39,7 @@
?? "length" is the number of characters in a string
?? "size" is the number of bytes
?? "index" is the position in a string in number of characters
- ?? "offset" is the position in a strin in bytes (and must be kept on a charater boundary)
+ ?? "offset" is the position in a string in bytes (and must be kept on a charater boundary)
(there seems to be no standard in Uncode documents, howevere "length" is commonly
referencing the number of bytes. Maybe "bytes" and "glyphs" would be the most
obvious way to describe sizes?)
@@ -49,8 +49,16 @@
"column" was orginally defined as a character offset from the left margin. It was
identical to the byte offset. In UTF-8, we have neither a byte offset nor
- truly fixed width fonts. Column could be a pixel value multiplied with
+ truly fixed width fonts (*). Column could be a pixel value multiplied with
an average character width (which is a bearable approximation).
+
+ * in Unicode, there are no fixed width fonts! Even if the ASCII characters may
+ happen to be all the same width in pixels, chinese charcaters surely are not.
+ There are plenty of exceptions, like ligatures, that make special handling of
+ "fixed" character widths a nightmare. I decided to remove all references to
+ fixed fonts and see "columns" as a multiple of the average width of a
+ character in the main font.
+ - Matthias
*/
@@ -80,15 +88,6 @@ public:
void set(int start, int end);
/**
- \brief Set a regtangular selection range.
- \param start byte offset to first selected character
- \param end byte offset pointing after last selected character
- \param rectStart first selected column
- \param rectEnd last selected column +1
- */
- void set_rectangular(int start, int end, int rectStart, int rectEnd);
-
- /**
\brief Updates a selection afer text was modified.
Updates an individual selection for changes in the corresponding text
\param pos byte offset into text buffer at which the change occured
@@ -98,12 +97,6 @@ public:
void update(int pos, int nDeleted, int nInserted);
/**
- \brief Returns true if the selection is rectangular.
- \return flag
- */
- char rectangular() const { return mRectangular; }
-
- /**
\brief Return the byte offset to the first selected character.
\return byte offset
*/
@@ -116,35 +109,23 @@ public:
int end() const { return mEnd; }
/**
- \brief Return the first column of the rectangular selection.
- \return first column of rectangular selection
- */
- int rect_start() const { return mRectStart; }
-
- /**
- \brief Return the last column of the rectangular selection + 1.
- \return last column of rectangular selection +1
- */
- int rect_end() const { return mRectEnd; }
-
- /**
\brief Returns true if any text is selected.
\return a non-zero number if any text has been selected, or 0
if no text is selected.
*/
- char selected() const { return mSelected; }
+ bool selected() const { return mSelected; }
/**
\brief Modify the 'selected' flag.
\param b new flag
*/
- void selected(char b) { mSelected = b; }
+ void selected(bool b) { mSelected = b; }
/**
Return true if position \p pos with indentation \p dispIndex is in
the Fl_Text_Selection.
*/
- int includes(int pos, int lineStartPos, int dispIndex) const;
+ int includes(int pos) const;
/**
\brief Return the positions of this selection.
@@ -154,37 +135,30 @@ public:
*/
int position(int* start, int* end) const;
- /**
- \brief Return the positions of this rectangular selection.
- \param start return byte offset to first selected character
- \param end return byte offset pointing after last selected character
- \param isRect return if the selection is rectangular
- \param rectStart return first selected column
- \param rectEnd return last selected column +1
- \return true if selected
- */
- int position(int* start, int* end, int* isRect, int* rectStart, int* rectEnd) const;
-
protected:
- char mSelected; ///< this flag is set if any text is selected
- char mRectangular; ///< this flag is set if the selection is rectangular
int mStart; ///< byte offset to the first selected character
int mEnd; ///< byte offset to the character after the last selected character
- int mRectStart; ///< first selected column (see "column")
- int mRectEnd; ///< last selected column +1 (see "column")
+ bool mSelected; ///< this flag is set if any text is selected
};
+
typedef void (*Fl_Text_Modify_Cb)(int pos, int nInserted, int nDeleted,
int nRestyled, const char* deletedText,
void* cbArg);
+
typedef void (*Fl_Text_Predelete_Cb)(int pos, int nDeleted, void* cbArg);
/**
\brief This class manages unicode displayed in one or more Fl_Text_Display widgets.
+ All text in Fl_Text_Buffermust be encoded in UTF-8. All indices used in the
+ function calls must be aligned to the start of a UTF-8 sequence. All indices
+ and pointers returned will be aligned. All functions that return a single
+ character will return that in an unsiged int in UCS-4 encoding.
+
The Fl_Text_Buffer class is used by the Fl_Text_Display
and Fl_Text_Editor to manage complex text data and is based upon the
excellent NEdit text editor engine - see http://www.nedit.org/.
@@ -218,12 +192,13 @@ public:
\brief Get a copy of the entire contents of the text buffer.
Memory is allocated to contain the returned string, which the caller
must free.
- \return newly allocated text buffer - must be free'd
+ \return newly allocated text buffer - must be free'd, text is utf8
*/
char* text() const;
/**
- Replaces the entire contents of the text buffer
+ Replaces the entire contents of the text buffer.
+ \param text Text must be valid utf8.
\todo unicode check
*/
void text(const char* text);
@@ -236,38 +211,43 @@ public:
When you are done with the text, free it using the free() function.
\param start byte offset to first character
\param end byte offset after last character in range
- \return newly allocated text buffer - must be free'd
+ \return newly allocated text buffer - must be free'd, text is utf8
*/
char* text_range(int start, int end) const;
/**
Returns the character at the specified position pos in the buffer.
Positions start at 0
- \param pos byte offset into buffer
+ \param pos byte offset into buffer, pos must be at acharacter boundary
\return Unicode UCS-4 encoded character
*/
- unsigned int character(int pos) const;
+ unsigned int char_at(int pos) const;
+
+ /**
+ Returns the raw byte at the specified position pos in the buffer.
+ Positions start at 0
+ \param pos byte offset into buffer
+ \return unencoded raw byte
+ */
+ char byte_at(int pos) const;
/**
Convert a byte offset in buffer into a memory address.
+ \param pos byte offset into buffer
+ \return byte offset converted to a memory address
*/
const char *address(int pos) const
{ return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; }
/**
Convert a byte offset in buffer into a memory address.
+ \param pos byte offset into buffer
+ \return byte offset converted to a memory address
*/
char *address(int pos)
{ return (pos < mGapStart) ? mBuf+pos : mBuf+pos+mGapEnd-mGapStart; }
/**
- Returns the text from the given rectangle. When you are done
- with the text, free it using the free() function.
- \todo unicode check
- */
- char* text_in_rectangle(int start, int end, int rectStart, int rectEnd) const;
-
- /**
Inserts null-terminated string \p text at position \p pos.
\param pos insertion position as byte offset (must be utf-8 character aligned)
\param text utf-8 encoded and nul terminated text
@@ -276,6 +256,7 @@ public:
/**
Appends the text string to the end of the buffer.
+ \param t utf-8 encoded and nul terminated text
\todo unicode check
*/
void append(const char* t) { insert(length(), t); }
@@ -296,8 +277,11 @@ public:
void replace(int start, int end, const char *text);
/**
- Copies text from one buffer to this one; fromBuf may
- be the same as this.
+ Copies text from one buffer to this one.
+ \param fromBuf source text buffer may be the same as this
+ \param fromStart byte offset into buffer
+ \param fromEnd byte offset into buffer
+ \param toPos destination byte offset into buffer
\todo unicode check
*/
void copy(Fl_Text_Buffer* fromBuf, int fromStart, int fromEnd, int toPos);
@@ -357,54 +341,6 @@ public:
{ return outputfile(file, 0, length(), buflen); }
/**
- Insert \p s columnwise into buffer starting at displayed character
- position \p column on the line beginning at \p startPos. Opens a rectangular
- space the width and height of \p s, by moving all text to the right of
- \p column right. If \p charsInserted and \p charsDeleted are not NULL, the
- number of characters inserted and deleted in the operation (beginning
- at \p startPos) are returned in these arguments.
- \todo unicode check
- */
- void insert_column(int column, int startPos, const char* text,
- int* charsInserted, int* charsDeleted);
-
- /**
- Replaces a rectangular area in the buffer, given by \p start, \p end,
- \p rectStart, and \p rectEnd, with \p text. If \p text is vertically
- longer than the rectangle, add extra lines to make room for it.
- \todo unicode check
- */
- void replace_rectangular(int start, int end, int rectStart, int rectEnd,
- const char* text);
-
- /**
- Overlay \p text between displayed character positions \p rectStart and
- \p rectEnd on the line beginning at \p startPos. If \p charsInserted and
- \p charsDeleted are not NULL, the number of characters inserted and deleted
- in the operation (beginning at \p startPos) are returned in these arguments.
- \todo unicode check
- */
- void overlay_rectangular(int startPos, int rectStart, int rectEnd,
- const char* text, int* charsInserted,
- int* charsDeleted);
-
- /**
- Removes a rectangular swath of characters between character positions start
- and end and horizontal displayed-character offsets rectStart and rectEnd.
- \todo unicode check
- */
- void remove_rectangular(int start, int end, int rectStart, int rectEnd);
-
- /**
- Clears text in the specified area.
- It clears a rectangular "hole" out of the buffer between character positions
- start and end and horizontal displayed-character offsets rectStart and
- rectEnd.
- \todo unicode check
- */
- void clear_rectangular(int start, int end, int rectStart, int rectEnd);
-
- /**
Gets the tab width.
\todo unicode check
*/
@@ -435,25 +371,12 @@ public:
void unselect();
/**
- Achieves a rectangular selection on the primary text selection object
- \todo unicode check
- */
- void select_rectangular(int start, int end, int rectStart, int rectEnd);
-
- /**
Gets the selection position
\todo unicode check
*/
int selection_position(int* start, int* end);
/**
- Gets the selection position, and rectangular selection info
- \todo unicode check
- */
- int selection_position(int* start, int* end, int* isRect, int* rectStart,
- int* rectEnd);
-
- /**
Returns the currently selected text. When you are done with
the text, free it using the free() function.
\todo unicode check
@@ -491,26 +414,12 @@ public:
void secondary_unselect();
/**
- Achieves a rectangular selection on the secondary text selection object
- \todo unicode check
- */
- void secondary_select_rectangular(int start, int end, int rectStart,
- int rectEnd);
-
- /**
Returns the current selection in the secondary text selection object.
\todo unicode check
*/
int secondary_selection_position(int* start, int* end);
/**
- Returns the current selection in the secondary text selection object.
- \todo unicode check
- */
- int secondary_selection_position(int* start, int* end, int* isRect,
- int* rectStart, int* rectEnd);
-
- /**
Returns the text in the secondary selection. When you are
done with the text, free it using the free() function.
\todo unicode check
@@ -549,25 +458,12 @@ public:
void unhighlight();
/**
- Highlights a rectangular selection in the buffer
- \todo unicode check
- */
- void highlight_rectangular(int start, int end, int rectStart, int rectEnd);
-
- /**
Highlights the specified text between \p start and \p end within the buffer.
\todo unicode check
*/
int highlight_position(int* start, int* end);
/**
- Highlights the specified rectangle of text within the buffer.
- \todo unicode check
- */
- int highlight_position(int* start, int* end, int* isRect, int* rectStart,
- int* rectEnd);
-
- /**
Returns the highlighted text. When you are done with the
text, free it using the free() function.
\todo unicode check
@@ -625,12 +521,16 @@ public:
Returns the text from the entire line containing the specified
character position. When you are done with the text, free it
using the free() function.
+ \param pos byte index into buffer
+ \return copy of utf8 text, must be free'd
\todo unicode check
*/
char* line_text(int pos) const;
/**
Returns the position of the start of the line containing position \p pos.
+ \param pos byte index into buffer
+ \return byte offset to line start
\todo unicode check
*/
int line_start(int pos) const;
@@ -639,63 +539,29 @@ public:
Finds and returns the position of the end of the line containing position \p pos
(which is either a pointer to the newline character ending the line,
or a pointer to one character beyond the end of the buffer)
+ \param pos byte index into buffer
+ \return byte offset to line end
\todo unicode check
*/
int line_end(int pos) const;
/**
Returns the position corresponding to the start of the word
+ \param pos byte index into buffer
+ \return byte offset to word start
\todo unicode check
*/
int word_start(int pos) const;
/**
Returns the position corresponding to the end of the word.
+ \param pos byte index into buffer
+ \return byte offset to word end
\todo unicode check
*/
int word_end(int pos) const;
/**
- Expands the given character to a displayable format. Tabs and
- other control characters are given special treatment.
- Get a character from the text buffer expanded into its screen
- representation (which may be several characters for a tab or a
- control code). Returns the number of characters written to \p outStr.
- \p indent is the number of characters from the start of the line
- for figuring tabs. Output string is guranteed to be shorter or
- equal in length to FL_TEXT_MAX_EXP_CHAR_LEN
- \todo unicode check
- */
- int expand_character(int pos, int indent, char *outStr) const;
-
- /**
- Expand a single character \p c from the text buffer into it's displayable
- screen representation (which may be several characters for a tab or a
- control code). Returns the number of characters added to \p outStr.
- \p indent is the number of characters from the start of the line
- for figuring tabs of length \p tabDist. Output string is guaranteed
- to be shorter or equal in length to FL_TEXT_MAX_EXP_CHAR_LEN
- Tabs and other control characters are given special treatment.
- \param src address of utf-8 text
- \param indent
- \param[out] outStr write substitution here
- \param tabDist
- \return number of byte in substitution
- */
- static int expand_character(const char *src, int indent, char* outStr, int tabDist);
-
- /**
- Return the length in displayed characters of character \p c expanded
- for display (as discussed above in expand_character() ).
- \param src address of utf-8 text
- \param indent
- \param tabDist
- \return number of byte in substitution
- */
- static int character_width(const char *src, int indent, int tabDist);
- static int character_width(const char c, int indent, int tabDist);
-
- /**
Count the number of displayed characters between buffer position
\p lineStartPos and \p targetPos. (displayed characters are the characters
shown on the screen to represent characters in the buffer, where tabs and
@@ -745,9 +611,13 @@ public:
BufSearchForward is that it's optimized for single characters. The
overall performance of the text widget is dependent on its ability to
count lines quickly, hence searching for a single character: newline)
+ \param startPos byte offset to start position
+ \param searchChar UCS-4 character that we want to find
+ \param foundPos byte offset where the character was found
+ \return 1 if found, 0 if not
\todo unicode check
*/
- int findchar_forward(int startPos, char searchChar, int* foundPos) const;
+ int findchar_forward(int startPos, unsigned searchChar, int* foundPos) const;
/**
Search backwards in buffer \p buf for character \p searchChar, starting
@@ -756,15 +626,23 @@ public:
BufSearchBackward is that it's optimized for single characters. The
overall performance of the text widget is dependent on its ability to
count lines quickly, hence searching for a single character: newline)
+ \param startPos byte offset to start position
+ \param searchChar UCS-4 character that we want to find
+ \param foundPos byte offset where the character was found
+ \return 1 if found, 0 if not
\todo unicode check
*/
- int findchar_backward(int startPos, char searchChar, int* foundPos) const;
+ int findchar_backward(int startPos, unsigned searchChar, int* foundPos) const;
/**
Finds the next occurrence of the specified characters.
Search forwards in buffer for characters in \p searchChars, starting
with the character \p startPos, and returning the result in \p foundPos
returns 1 if found, 0 if not.
+ \param startPos byte offset to start position
+ \param searchChars utf8 string that we want to find
+ \param foundPos byte offset where the string was found
+ \return 1 if found, 0 if not
\todo unicode check
*/
int findchars_forward(int startPos, const char* searchChars, int* foundPos) const;
@@ -774,6 +652,10 @@ public:
Search backwards in buffer for characters in \p searchChars, starting
with the character BEFORE \p startPos, returning the result in \p foundPos
returns 1 if found, 0 if not.
+ \param startPos byte offset to start position
+ \param searchChars utf8 string that we want to find
+ \param foundPos byte offset where the string was found
+ \return 1 if found, 0 if not
\todo unicode check
*/
int findchars_backward(int startPos, const char* searchChars, int* foundPos) const;
@@ -782,6 +664,11 @@ public:
Search forwards in buffer for string \p searchString, starting with the
character \p startPos, and returning the result in \p foundPos
returns 1 if found, 0 if not.
+ \param startPos byte offset to start position
+ \param searchString utf8 string that we want to find
+ \param foundPos byte offset where the string was found
+ \param matchCase if set, match character case
+ \return 1 if found, 0 if not
\todo unicode check
*/
int search_forward(int startPos, const char* searchString, int* foundPos,
@@ -791,6 +678,11 @@ public:
Search backwards in buffer for string <i>searchCharssearchString</i>, starting with the
character BEFORE \p startPos, returning the result in \p foundPos
returns 1 if found, 0 if not.
+ \param startPos byte offset to start position
+ \param searchString utf8 string that we want to find
+ \param foundPos byte offset where the string was found
+ \param matchCase if set, match character case
+ \return 1 if found, 0 if not
\todo unicode check
*/
int search_backward(int startPos, const char* searchString, int* foundPos,
@@ -816,6 +708,32 @@ public:
*/
const Fl_Text_Selection* highlight_selection() const { return &mHighlight; }
+ /**
+ Returns the index of the previous character.
+ \param ix index to the current char
+ */
+ int prev_char(int ix) const;
+
+ /**
+ Returns a pointer to the previous character.
+ \param c pointer to the current char
+ */
+ char *prev_char(char *c) const;
+ const char *prev_char(const char *c) const;
+
+ /**
+ Returns the index of the next character.
+ \param ix index to the current char
+ */
+ int next_char(int ix) const;
+
+ /**
+ Returns a pointer to the next character.
+ \param c pointer to the current char
+ */
+ char *next_char(char *c) const;
+ const char *next_char(const char *c) const;
+
protected:
/**
@@ -839,6 +757,7 @@ protected:
expensive and the length will be required by any caller who will continue
on to call redisplay). \p pos must be contiguous with the existing text in
the buffer (i.e. not past the end).
+ \return the number of bytes inserted
\todo unicode check
*/
int insert_(int pos, const char* text);
@@ -852,43 +771,6 @@ protected:
void remove_(int start, int end);
/**
- Deletes a rectangle of text without calling the modify callbacks. Returns
- the number of characters replacing those between \p start and \p end. Note that
- in some pathological cases, deleting can actually increase the size of
- the buffer because of tab expansions. \p endPos returns the buffer position
- of the point in the last line where the text was removed (as a hint for
- routines which need to position the cursor after a delete operation)
- \todo unicode check
- */
- void remove_rectangular_(int start, int end, int rectStart, int rectEnd,
- int* replaceLen, int* endPos);
-
- /**
- Inserts a column of text without calling the modify callbacks. Note that
- in some pathological cases, inserting can actually decrease the size of
- the buffer because of spaces being coalesced into tabs. \p nDeleted and
- \p nInserted return the number of characters deleted and inserted beginning
- at the start of the line containing \p startPos. \p endPos returns buffer
- position of the lower left edge of the inserted column (as a hint for
- routines which need to set a cursor position).
- \todo unicode check
- */
- void insert_column_(int column, int startPos, const char* insText,
- int* nDeleted, int* nInserted, int* endPos);
-
- /**
- Overlay a rectangular area of text without calling the modify callbacks.
- \p nDeleted and \p nInserted return the number of characters deleted and
- inserted beginning at the start of the line containing \p startPos.
- \p endPos returns buffer position of the lower left edge of the inserted
- column (as a hint for routines which need to set a cursor position).
- \todo unicode check
- */
- void overlay_rectangular_(int startPos, int rectStart, int rectEnd,
- const char* insText, int* nDeleted,
- int* nInserted, int* endPos);
-
- /**
Calls the stored redisplay procedure(s) for this buffer to update the
screen for a change in a selection.
\todo unicode check
@@ -923,25 +805,6 @@ protected:
void replace_selection_(Fl_Text_Selection* sel, const char* text);
/**
- Finds the first and last character position in a line within a rectangular
- selection (for copying). Includes tabs which cross rectStart, but not
- control characters which do so. Leaves off tabs which cross rectEnd.
-
- Technically, the calling routine should convert tab characters which
- cross the right boundary of the selection to spaces which line up with
- the edge of the selection. Unfortunately, the additional memory
- management required in the parent routine to allow for the changes
- in string size is not worth all the extra work just for a couple of
- shifted characters, so if a tab protrudes, just lop it off and hope
- that there are other characters in the selection to establish the right
- margin for subsequent columnar pastes of this data.
- \todo unicode check
- */
- void rectangular_selection_boundaries(int lineStartPos, int rectStart,
- int rectEnd, int* selStart,
- int* selEnd) const;
-
- /**
Updates all of the selections in the buffer for changes in the buffer's text
\todo unicode check
*/
@@ -959,15 +822,13 @@ protected:
// The hardware tab distance used by all displays for this buffer,
// and used in computing offsets for rectangular selection operations.
int mTabDist; /**< equiv. number of characters in a tab */
- int mUseTabs; /**< True if buffer routines are allowed to use
- tabs for padding in rectangular operations */
int mNModifyProcs; /**< number of modify-redisplay procs attached */
- Fl_Text_Modify_Cb* /**< procedures to call when buffer is */
- mModifyProcs; /**< modified to redisplay contents */
+ Fl_Text_Modify_Cb *mModifyProcs;/**< procedures to call when buffer is
+ modified to redisplay contents */
void** mCbArgs; /**< caller arguments for modifyProcs above */
int mNPredeleteProcs; /**< number of pre-delete procs attached */
- Fl_Text_Predelete_Cb* /**< procedure to call before text is deleted */
- mPredeleteProcs; /**< from the buffer; at most one is supported. */
+ Fl_Text_Predelete_Cb *mPredeleteProcs; /**< procedure to call before text is deleted
+ from the buffer; at most one is supported. */
void **mPredeleteCbArgs; /**< caller argument for pre-delete proc above */
int mCursorPosHint; /**< hint for reasonable cursor position after
a buffer modification operation */
@@ -981,5 +842,5 @@ protected:
#endif
//
-// End of "$Id: Fl_Text_Buffer.H 7527 2010-04-18 14:33:33Z engelsman $".
+// End of "$Id: Fl_Text_Buffer.H 7794 2010-11-04 21:53:56Z matt $".
//
diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H
index 71bbd22..386209b 100644
--- a/FL/Fl_Text_Display.H
+++ b/FL/Fl_Text_Display.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Text_Display.H 7527 2010-04-18 14:33:33Z engelsman $"
+// "$Id: Fl_Text_Display.H 7794 2010-11-04 21:53:56Z matt $"
//
// Header file for Fl_Text_Display class.
//
@@ -28,7 +28,7 @@
//
/* \file
- Fl_Text_Display widget . */
+ Fl_Text_Display widget . */
#ifndef FL_TEXT_DISPLAY_H
#define FL_TEXT_DISPLAY_H
@@ -40,305 +40,409 @@
#include "Fl_Text_Buffer.H"
/**
- This is the FLTK text display widget. It allows the user to
- view multiple lines of text and supports highlighting and
- scrolling. The buffer that is displayed in the widget is managed
- by the Fl_Text_Buffer
- class.
-*/
-class FL_EXPORT Fl_Text_Display: public Fl_Group {
- public:
- /** text display cursor shapes enumeration */
- enum {
- NORMAL_CURSOR, CARET_CURSOR, DIM_CURSOR,
- BLOCK_CURSOR, HEAVY_CURSOR
- };
-
- enum {
- CURSOR_POS, CHARACTER_POS
- };
-
- /** drag types- they match Fl::event_clicks() so that single clicking to
- start a collection selects by character, double clicking selects by
- word and triple clicking selects by line.
- */
- enum {
- DRAG_CHAR = 0, DRAG_WORD = 1, DRAG_LINE = 2
- };
- friend void fl_text_drag_me(int pos, Fl_Text_Display* d);
-
- typedef void (*Unfinished_Style_Cb)(int, void *);
-
- /** style attributes - currently not implemented! */
- enum {
- ATTR_NONE = 0,
- ATTR_UNDERLINE = 1,
- ATTR_HIDDEN = 2
- };
- /** This structure associates the color,font,size of a string to draw
- with an attribute mask matching attr */
- struct Style_Table_Entry {
- Fl_Color color;
- Fl_Font font;
- int size;
- unsigned attr;
- };
-
- Fl_Text_Display(int X, int Y, int W, int H, const char *l = 0);
- ~Fl_Text_Display();
-
- virtual int handle(int e);
- void buffer(Fl_Text_Buffer* buf);
+ \brief Rich text display widget.
+
+ This is the FLTK text display widget. It allows the user to view multiple lines
+ of text and supports highlighting and scrolling. The buffer that is displayed
+ in the widget is managed by the Fl_Text_Buffer class. A single Text Buffer
+ can be displayed by multiple Text Displays.
+ */
+class FL_EXPORT Fl_Text_Display: public Fl_Group
+{
+public:
+
+ /**
+ text display cursor shapes enumeration
+ */
+ enum {
+ NORMAL_CURSOR, /**< I-beam */
+ CARET_CURSOR, /**< caret under the text */
+ DIM_CURSOR, /**< dim I-beam */
+ BLOCK_CURSOR, /**< unfille box under the current character */
+ HEAVY_CURSOR /**< thick I-beam */
+ };
+
/**
- Sets or gets the current text buffer associated with the text widget.
- Multiple text widgets can be associated with the same text buffer.
- */
- void buffer(Fl_Text_Buffer& buf) { buffer(&buf); }
- /**
- Gets the current text buffer associated with the text widget.
- Multiple text widgets can be associated with the same text buffer.
- */
- Fl_Text_Buffer* buffer() const { return mBuffer; }
- void redisplay_range(int start, int end);
- void scroll(int topLineNum, int horizOffset);
- void insert(const char* text);
- void overstrike(const char* text);
- void insert_position(int newPos);
- /** Gets the position of the text insertion cursor for text display */
- int insert_position() const { return mCursorPos; }
- int in_selection(int x, int y) const;
- void show_insert_position();
- int move_right();
- int move_left();
- int move_up();
- int move_down();
- int count_lines(int start, int end, bool start_pos_is_line_start) const;
- int line_start(int pos) const;
- int line_end(int pos, bool start_pos_is_line_start) const;
- int skip_lines(int startPos, int nLines, bool startPosIsLineStart);
- int rewind_lines(int startPos, int nLines);
- void next_word(void);
- void previous_word(void);
- void show_cursor(int b = 1);
- /** Hides the text cursor */
- void hide_cursor() { show_cursor(0); }
- void cursor_style(int style);
- /** Sets or gets the text cursor color. */
- Fl_Color cursor_color() const {return mCursor_color;}
- /** Sets or gets the text cursor color. */
- void cursor_color(Fl_Color n) {mCursor_color = n;}
- /** Sets or gets the width/height of the scrollbars. */
- int scrollbar_width() const { return scrollbar_width_; }
- /** Sets or gets the width/height of the scrollbars. */
- void scrollbar_width(int W) { scrollbar_width_ = W; }
- /** Gets the scrollbar alignment type */
- Fl_Align scrollbar_align() const { return scrollbar_align_; }
- /** Sets the scrollbar alignment type */
- void scrollbar_align(Fl_Align a) { scrollbar_align_ = a; }
- /** Moves the insert position to the beginning of the current word. */
- int word_start(int pos) const { return buffer()->word_start(pos); }
- /** Moves the insert position to the end of the current word. */
- int word_end(int pos) const { return buffer()->word_end(pos); }
-
-
- void highlight_data(Fl_Text_Buffer *styleBuffer,
- const Style_Table_Entry *styleTable,
- int nStyles, char unfinishedStyle,
- Unfinished_Style_Cb unfinishedHighlightCB,
- void *cbArg);
-
- int position_style(int lineStartPos, int lineLen, int lineIndex,
- int dispIndex) const;
- /** \todo FIXME : get set methods pointing on shortcut_
- have no effects as shortcut_ is unused in this class and derived! */
- int shortcut() const {return shortcut_;}
- /** \todo FIXME : get set methods pointing on shortcut_
- have no effects as shortcut_ is unused in this class and derived! */
- void shortcut(int s) {shortcut_ = s;}
-
- /** Gets the default font used when drawing text in the widget. */
- Fl_Font textfont() const {return textfont_;}
- /** Sets the default font used when drawing text in the widget. */
- void textfont(Fl_Font s) {textfont_ = s;}
- /** Gets the default size of text in the widget. */
- Fl_Fontsize textsize() const {return textsize_;}
- /** Sets the default size of text in the widget. */
- void textsize(Fl_Fontsize s) {textsize_ = s;}
- /** Gets the default color of text in the widget. */
- Fl_Color textcolor() const {return textcolor_;}
- /** Sets the default color of text in the widget. */
- void textcolor(Fl_Color n) {textcolor_ = n;}
-
- int wrapped_column(int row, int column) const;
- int wrapped_row(int row) const;
- void wrap_mode(int wrap, int wrap_margin);
-
- virtual void resize(int X, int Y, int W, int H);
-
- protected:
- // Most (all?) of this stuff should only be called from resize() or
- // draw().
- // Anything with "vline" indicates thats it deals with currently
- // visible lines.
-
- virtual void draw();
- void draw_text(int X, int Y, int W, int H);
- void draw_range(int start, int end);
- void draw_cursor(int, int);
-
- void draw_string(int style, int x, int y, int toX, const char *string,
- int nChars);
-
- void draw_vline(int visLineNum, int leftClip, int rightClip,
- int leftCharIndex, int rightCharIndex);
-
- void draw_line_numbers(bool clearAll);
-
- void clear_rect(int style, int x, int y, int width, int height);
- void display_insert();
-
- void offset_line_starts(int newTopLineNum);
-
- void calc_line_starts(int startLine, int endLine);
-
- void update_line_starts(int pos, int charsInserted, int charsDeleted,
- int linesInserted, int linesDeleted, int *scrolled);
-
- void calc_last_char();
-
- int position_to_line( int pos, int* lineNum ) const;
- int string_width(const char* string, int length, int style) const;
-
- static void scroll_timer_cb(void*);
-
- static void buffer_predelete_cb(int pos, int nDeleted, void* cbArg);
- static void buffer_modified_cb(int pos, int nInserted, int nDeleted,
- int nRestyled, const char* deletedText,
- void* cbArg);
-
- static void h_scrollbar_cb(Fl_Scrollbar* w, Fl_Text_Display* d);
- static void v_scrollbar_cb( Fl_Scrollbar* w, Fl_Text_Display* d);
- void update_v_scrollbar();
- void update_h_scrollbar();
- int measure_vline(int visLineNum) const;
- int longest_vline() const;
- int empty_vlines() const;
- int vline_length(int visLineNum) const;
- int xy_to_position(int x, int y, int PosType = CHARACTER_POS) const;
-
- void xy_to_rowcol(int x, int y, int* row, int* column,
- int PosType = CHARACTER_POS) const;
-
- int position_to_xy(int pos, int* x, int* y) const;
- void maintain_absolute_top_line_number(int state);
- int get_absolute_top_line_number() const;
- void absolute_top_line_number(int oldFirstChar);
- int maintaining_absolute_top_line_number() const;
- void reset_absolute_top_line_number();
- int position_to_linecol(int pos, int* lineNum, int* column) const;
- void scroll_(int topLineNum, int horizOffset);
-
- void extend_range_for_styles(int* start, int* end);
-
- void find_wrap_range(const char *deletedText, int pos, int nInserted,
- int nDeleted, int *modRangeStart, int *modRangeEnd,
- int *linesInserted, int *linesDeleted);
- void measure_deleted_lines(int pos, int nDeleted);
- void wrapped_line_counter(Fl_Text_Buffer *buf, int startPos, int maxPos,
- int maxLines, bool startPosIsLineStart,
- int styleBufOffset, int *retPos, int *retLines,
- int *retLineStart, int *retLineEnd,
- bool countLastLineMissingNewLine = true) const;
- void find_line_end(int pos, bool start_pos_is_line_start, int *lineEnd,
- int *nextLineStart) const;
- int measure_proportional_character(const char *s, int colNum, int pos) const;
- int wrap_uses_character(int lineEndPos) const;
- int range_touches_selection(const Fl_Text_Selection *sel, int rangeStart,
- int rangeEnd) const;
-#ifndef FL_DOXYGEN
- int damage_range1_start, damage_range1_end;
- int damage_range2_start, damage_range2_end;
- int mCursorPos;
- int mCursorOn;
- int mCursorOldY; /* Y pos. of cursor for blanking */
- int mCursorToHint; /* Tells the buffer modified callback
- where to move the cursor, to reduce
- the number of redraw calls */
- int mCursorStyle; /* One of enum cursorStyles above */
- int mCursorPreferredCol; /* Column for vert. cursor movement */
- int mNVisibleLines; /* # of visible (displayed) lines */
- int mNBufferLines; /* # of newlines in the buffer */
- Fl_Text_Buffer* mBuffer; /* Contains text to be displayed */
- Fl_Text_Buffer* mStyleBuffer; /* Optional parallel buffer containing
- color and font information */
- int mFirstChar, mLastChar; /* Buffer positions of first and last
- displayed character (lastChar points
- either to a newline or one character
- beyond the end of the buffer) */
- int mContinuousWrap; /* Wrap long lines when displaying */
- int mWrapMargin; /* Margin in # of char positions for
- wrapping in continuousWrap mode */
- int* mLineStarts;
- int mTopLineNum; /* Line number of top displayed line
- of file (first line of file is 1) */
- int mAbsTopLineNum; /* In continuous wrap mode, the line
- number of the top line if the text
- were not wrapped (note that this is
- only maintained as needed). */
- int mNeedAbsTopLineNum; /* Externally settable flag to continue
- maintaining absTopLineNum even if
- it isn't needed for line # display */
- int mHorizOffset; /* Horizontal scroll pos. in pixels */
- int mTopLineNumHint; /* Line number of top displayed line
- of file (first line of file is 1) */
- int mHorizOffsetHint; /* Horizontal scroll pos. in pixels */
- int mNStyles; /* Number of entries in styleTable */
- const Style_Table_Entry *mStyleTable; /* Table of fonts and colors for
- coloring/syntax-highlighting */
- char mUnfinishedStyle; /* Style buffer entry which triggers
- on-the-fly reparsing of region */
- Unfinished_Style_Cb mUnfinishedHighlightCB; /* Callback to parse "unfinished" */
- /* regions */
- void* mHighlightCBArg; /* Arg to unfinishedHighlightCB */
-
- int mMaxsize;
-
- int mFixedFontWidth; /* Font width if all current fonts are
- fixed and match in width, else -1 */
- int mSuppressResync; /* Suppress resynchronization of line
- starts during buffer updates */
- int mNLinesDeleted; /* Number of lines deleted during
- buffer modification (only used
- when resynchronization is suppressed) */
- int mModifyingTabDistance; /* Whether tab distance is being
- modified */
-
- Fl_Color mCursor_color;
-
- Fl_Scrollbar* mHScrollBar;
- Fl_Scrollbar* mVScrollBar;
- int scrollbar_width_;
- Fl_Align scrollbar_align_;
- int dragPos, dragType, dragging;
- int display_insert_position_hint;
- struct { int x, y, w, h; } text_area;
-
- int shortcut_;
-
- Fl_Font textfont_;
- Fl_Fontsize textsize_;
- Fl_Color textcolor_;
-
- // The following are not presently used from the original NEdit code,
- // but are being put here so that future versions of Fl_Text_Display
- // can implement line numbers without breaking binary compatibility.
- int mLineNumLeft, mLineNumWidth;
- /* Line number margin and width */
-#endif
+ the character position is the left edge of a character wheras
+ the cursor is thought to be between the centers of to consecutive
+ characters.
+ */
+ enum {
+ CURSOR_POS,
+ CHARACTER_POS
+ };
+
+ /**
+ drag types - they match Fl::event_clicks() so that single clicking to
+ start a collection selects by character, double clicking selects by
+ word and triple clicking selects by line.
+ */
+ enum {
+ DRAG_CHAR = 0,
+ DRAG_WORD = 1,
+ DRAG_LINE = 2
+ };
+
+ friend void fl_text_drag_me(int pos, Fl_Text_Display* d);
+
+ typedef void (*Unfinished_Style_Cb)(int, void *);
+
+ /**
+ This structure associates the color,font,size of a string to draw
+ with an attribute mask matching attr
+ */
+ struct Style_Table_Entry {
+ Fl_Color color;
+ Fl_Font font;
+ Fl_Fontsize size;
+ unsigned attr;
+ };
+
+ Fl_Text_Display(int X, int Y, int W, int H, const char *l = 0);
+ ~Fl_Text_Display();
+
+ virtual int handle(int e);
+
+ void buffer(Fl_Text_Buffer* buf);
+
+ /**
+ Sets the current text buffer associated with the text widget.
+ Multiple text widgets can be associated with the same text buffer.
+ \param buf new text buffer
+ */
+ void buffer(Fl_Text_Buffer& buf) { buffer(&buf); }
+
+ /**
+ Gets the current text buffer associated with the text widget.
+ Multiple text widgets can be associated with the same text buffer.
+ \return current text buffer
+ */
+ Fl_Text_Buffer* buffer() const { return mBuffer; }
+
+ void redisplay_range(int start, int end);
+ void scroll(int topLineNum, int horizOffset);
+ void insert(const char* text);
+ void overstrike(const char* text);
+ void insert_position(int newPos);
+
+ /**
+ Gets the position of the text insertion cursor for text display
+ \return insert position index into text buffer
+ */
+ int insert_position() const { return mCursorPos; }
+
+ int in_selection(int x, int y) const;
+ void show_insert_position();
+
+ int move_right();
+ int move_left();
+ int move_up();
+ int move_down();
+ int count_lines(int start, int end, bool start_pos_is_line_start) const;
+ int line_start(int pos) const;
+ int line_end(int pos, bool start_pos_is_line_start) const;
+ int skip_lines(int startPos, int nLines, bool startPosIsLineStart);
+ int rewind_lines(int startPos, int nLines);
+ void next_word(void);
+ void previous_word(void);
+
+ void show_cursor(int b = 1);
+
+ /**
+ Hides the text cursor
+ */
+ void hide_cursor() { show_cursor(0); }
+
+ void cursor_style(int style);
+
+ /**
+ Gets the text cursor color.
+ \return cursor color
+ */
+ Fl_Color cursor_color() const {return mCursor_color;}
+
+ /**
+ Sets the text cursor color.
+ \param n new cursor color
+ */
+ void cursor_color(Fl_Color n) {mCursor_color = n;}
+
+ /**
+ Gets the width/height of the scrollbars.
+ /return width of scrollbars
+ */
+ int scrollbar_width() const { return scrollbar_width_; }
+
+ /**
+ Sets the width/height of the scrollbars.
+ \param W width of scrollbars
+ */
+ void scrollbar_width(int W) { scrollbar_width_ = W; }
+
+ /**
+ Gets the scrollbar alignment type
+ \return scrollbar alignment
+ */
+ Fl_Align scrollbar_align() const { return scrollbar_align_; }
+
+ /**
+ Sets the scrollbar alignment type
+ \param a new scrollbar alignment
+ */
+ void scrollbar_align(Fl_Align a) { scrollbar_align_ = a; }
+
+ /**
+ Moves the insert position to the beginning of the current word.
+ \param pos start calculation at this index
+ \return beginning of the wors
+ */
+ int word_start(int pos) const { return buffer()->word_start(pos); }
+
+ /**
+ Moves the insert position to the end of the current word.
+ \param pos start calculation at this index
+ \return index of first character after the end of the word
+ */
+ int word_end(int pos) const { return buffer()->word_end(pos); }
+
+
+ void highlight_data(Fl_Text_Buffer *styleBuffer,
+ const Style_Table_Entry *styleTable,
+ int nStyles, char unfinishedStyle,
+ Unfinished_Style_Cb unfinishedHighlightCB,
+ void *cbArg);
+
+ int position_style(int lineStartPos, int lineLen, int lineIndex) const;
+
+ /**
+ \todo FIXME : get set methods pointing on shortcut_
+ have no effects as shortcut_ is unused in this class and derived!
+ \return the current shortcut key
+ */
+ int shortcut() const {return shortcut_;}
+
+ /**
+ \todo FIXME : get set methods pointing on shortcut_
+ have no effects as shortcut_ is unused in this class and derived!
+ \param s the new shortcut key
+ */
+ void shortcut(int s) {shortcut_ = s;}
+
+ /**
+ Gets the default font used when drawing text in the widget.
+ \return current text font face unless overriden by a style
+ */
+ Fl_Font textfont() const {return textfont_;}
+
+ /**
+ Sets the default font used when drawing text in the widget.
+ \param s default text font face
+ */
+ void textfont(Fl_Font s) {textfont_ = s;}
+
+ /**
+ Gets the default size of text in the widget.
+ \return current text height unless overriden by a style
+ */
+ Fl_Fontsize textsize() const {return textsize_;}
+
+ /**
+ Sets the default size of text in the widget.
+ \param s new text size
+ */
+ void textsize(Fl_Fontsize s) {textsize_ = s;}
+
+ /**
+ Gets the default color of text in the widget.
+ \return text color unless overriden by a style
+ */
+ Fl_Color textcolor() const {return textcolor_;}
+
+ /**
+ Sets the default color of text in the widget.
+ \param n new text color
+ */
+ void textcolor(Fl_Color n) {textcolor_ = n;}
+
+ int wrapped_column(int row, int column) const;
+ int wrapped_row(int row) const;
+ void wrap_mode(int wrap, int wrap_margin);
+
+ virtual void resize(int X, int Y, int W, int H);
+
+protected:
+ // Most (all?) of this stuff should only be called from resize() or
+ // draw().
+ // Anything with "vline" indicates thats it deals with currently
+ // visible lines.
+
+ virtual void draw();
+ void draw_text(int X, int Y, int W, int H);
+ void draw_range(int start, int end);
+ void draw_cursor(int, int);
+
+ void draw_string(int style, int x, int y, int toX, const char *string,
+ int nChars) const;
+
+ void draw_vline(int visLineNum, int leftClip, int rightClip,
+ int leftCharIndex, int rightCharIndex);
+
+ int find_x(const char *s, int len, int style, int x) const;
+
+ enum {
+ DRAW_LINE,
+ FIND_INDEX,
+ GET_WIDTH
+ };
+
+ int handle_vline(int mode,
+ int lineStart, int lineLen, int leftChar, int rightChar,
+ int topClip, int bottomClip,
+ int leftClip, int rightClip) const;
+
+ void draw_line_numbers(bool clearAll);
+
+ void clear_rect(int style, int x, int y, int width, int height) const;
+ void display_insert();
+
+ void offset_line_starts(int newTopLineNum);
+
+ void calc_line_starts(int startLine, int endLine);
+
+ void update_line_starts(int pos, int charsInserted, int charsDeleted,
+ int linesInserted, int linesDeleted, int *scrolled);
+
+ void calc_last_char();
+
+ int position_to_line( int pos, int* lineNum ) const;
+ int string_width(const char* string, int length, int style) const;
+
+ static void scroll_timer_cb(void*);
+
+ static void buffer_predelete_cb(int pos, int nDeleted, void* cbArg);
+ static void buffer_modified_cb(int pos, int nInserted, int nDeleted,
+ int nRestyled, const char* deletedText,
+ void* cbArg);
+
+ static void h_scrollbar_cb(Fl_Scrollbar* w, Fl_Text_Display* d);
+ static void v_scrollbar_cb( Fl_Scrollbar* w, Fl_Text_Display* d);
+ void update_v_scrollbar();
+ void update_h_scrollbar();
+ int measure_vline(int visLineNum) const;
+ int longest_vline() const;
+ int empty_vlines() const;
+ int vline_length(int visLineNum) const;
+ int xy_to_position(int x, int y, int PosType = CHARACTER_POS) const;
+
+ void xy_to_rowcol(int x, int y, int* row, int* column,
+ int PosType = CHARACTER_POS) const;
+
+ int position_to_xy(int pos, int* x, int* y) const;
+ void maintain_absolute_top_line_number(int state);
+ int get_absolute_top_line_number() const;
+ void absolute_top_line_number(int oldFirstChar);
+ int maintaining_absolute_top_line_number() const;
+ void reset_absolute_top_line_number();
+ int position_to_linecol(int pos, int* lineNum, int* column) const;
+ void scroll_(int topLineNum, int horizOffset);
+
+ void extend_range_for_styles(int* start, int* end);
+
+ void find_wrap_range(const char *deletedText, int pos, int nInserted,
+ int nDeleted, int *modRangeStart, int *modRangeEnd,
+ int *linesInserted, int *linesDeleted);
+ void measure_deleted_lines(int pos, int nDeleted);
+ void wrapped_line_counter(Fl_Text_Buffer *buf, int startPos, int maxPos,
+ int maxLines, bool startPosIsLineStart,
+ int styleBufOffset, int *retPos, int *retLines,
+ int *retLineStart, int *retLineEnd,
+ bool countLastLineMissingNewLine = true) const;
+ void find_line_end(int pos, bool start_pos_is_line_start, int *lineEnd,
+ int *nextLineStart) const;
+ int measure_proportional_character(const char *s, int colNum, int pos) const;
+ int wrap_uses_character(int lineEndPos) const;
+
+ int damage_range1_start, damage_range1_end;
+ int damage_range2_start, damage_range2_end;
+ int mCursorPos;
+ int mCursorOn;
+ int mCursorOldY; /* Y pos. of cursor for blanking */
+ int mCursorToHint; /* Tells the buffer modified callback
+ where to move the cursor, to reduce
+ the number of redraw calls */
+ int mCursorStyle; /* One of enum cursorStyles above */
+ int mCursorPreferredCol; /* Column for vert. cursor movement */
+ int mNVisibleLines; /* # of visible (displayed) lines */
+ int mNBufferLines; /* # of newlines in the buffer */
+ Fl_Text_Buffer* mBuffer; /* Contains text to be displayed */
+ Fl_Text_Buffer* mStyleBuffer; /* Optional parallel buffer containing
+ color and font information */
+ int mFirstChar, mLastChar; /* Buffer positions of first and last
+ displayed character (lastChar points
+ either to a newline or one character
+ beyond the end of the buffer) */
+ int mContinuousWrap; /* Wrap long lines when displaying */
+ int mWrapMargin; /* Margin in # of char positions for
+ wrapping in continuousWrap mode */
+ int* mLineStarts;
+ int mTopLineNum; /* Line number of top displayed line
+ of file (first line of file is 1) */
+ int mAbsTopLineNum; /* In continuous wrap mode, the line
+ number of the top line if the text
+ were not wrapped (note that this is
+ only maintained as needed). */
+ int mNeedAbsTopLineNum; /* Externally settable flag to continue
+ maintaining absTopLineNum even if
+ it isn't needed for line # display */
+ int mHorizOffset; /* Horizontal scroll pos. in pixels */
+ int mTopLineNumHint; /* Line number of top displayed line
+ of file (first line of file is 1) */
+ int mHorizOffsetHint; /* Horizontal scroll pos. in pixels */
+ int mNStyles; /* Number of entries in styleTable */
+ const Style_Table_Entry *mStyleTable; /* Table of fonts and colors for
+ coloring/syntax-highlighting */
+ char mUnfinishedStyle; /* Style buffer entry which triggers
+ on-the-fly reparsing of region */
+ Unfinished_Style_Cb mUnfinishedHighlightCB; /* Callback to parse "unfinished" */
+ /* regions */
+ void* mHighlightCBArg; /* Arg to unfinishedHighlightCB */
+
+ int mMaxsize;
+
+ int mSuppressResync; /* Suppress resynchronization of line
+ starts during buffer updates */
+ int mNLinesDeleted; /* Number of lines deleted during
+ buffer modification (only used
+ when resynchronization is suppressed) */
+ int mModifyingTabDistance; /* Whether tab distance is being
+ modified */
+
+ Fl_Color mCursor_color;
+
+ Fl_Scrollbar* mHScrollBar;
+ Fl_Scrollbar* mVScrollBar;
+ int scrollbar_width_;
+ Fl_Align scrollbar_align_;
+ int dragPos, dragType, dragging;
+ int display_insert_position_hint;
+ struct { int x, y, w, h; } text_area;
+
+ int shortcut_;
+
+ Fl_Font textfont_;
+ Fl_Fontsize textsize_;
+ Fl_Color textcolor_;
+
+ // The following are not presently used from the original NEdit code,
+ // but are being put here so that future versions of Fl_Text_Display
+ // can implement line numbers without breaking binary compatibility.
+
+ /* Line number margin and width */
+ int mLineNumLeft, mLineNumWidth;
};
#endif
//
-// End of "$Id: Fl_Text_Display.H 7527 2010-04-18 14:33:33Z engelsman $".
+// End of "$Id: Fl_Text_Display.H 7794 2010-11-04 21:53:56Z matt $".
//
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index b823577..16a8213 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Widget.H 7661 2010-07-01 15:01:49Z manolo $"
+// "$Id: Fl_Widget.H 7788 2010-10-31 20:47:50Z matt $"
//
// Widget header file for the Fast Light Tool Kit (FLTK).
//
@@ -752,7 +752,9 @@ public:
&& visible()) but is faster.
\retval 0 if the widget takes no events
*/
- unsigned int takesevents() const {return !(flags_&(INACTIVE|INVISIBLE|OUTPUT));}
+ unsigned int takesevents() const {
+ return !output() && active_r() && visible_r();
+ }
/**
Checks if the widget value changed since the last callback.
@@ -918,7 +920,7 @@ public:
/** Sets width ww and height hh accordingly with the label size.
Labels with images will return w() and h() of the image.
*/
- void measure_label(int& ww, int& hh) {label_.measure(ww, hh);}
+ void measure_label(int& ww, int& hh) const {label_.measure(ww, hh);}
/** Returns a pointer to the primary Fl_Window widget.
\retval NULL if no window is associated with this widget.
@@ -971,5 +973,5 @@ public:
#endif
//
-// End of "$Id: Fl_Widget.H 7661 2010-07-01 15:01:49Z manolo $".
+// End of "$Id: Fl_Widget.H 7788 2010-10-31 20:47:50Z matt $".
//
diff --git a/FL/README.Xcode b/FL/README.Xcode
new file mode 100644
index 0000000..2fa57ad
--- /dev/null
+++ b/FL/README.Xcode
@@ -0,0 +1,2 @@
+All FLTK header files are in the FL subdirectory of the fltk.framework.
+Image header files are located in "fltk.framework/Headers/FL/images/".
diff --git a/FL/fl_draw.H b/FL/fl_draw.H
index e515b1c..614eba0 100644
--- a/FL/fl_draw.H
+++ b/FL/fl_draw.H
@@ -1,5 +1,5 @@
//
-// "$Id: fl_draw.H 7659 2010-07-01 13:21:32Z manolo $"
+// "$Id: fl_draw.H 7788 2010-10-31 20:47:50Z matt $"
//
// Portable drawing function header file for the Fast Light Tool Kit (FLTK).
//
@@ -57,7 +57,7 @@ FL_EXPORT extern char fl_draw_shortcut;
the foreground is not set for the current window.
\param[in] c color
*/
-inline void fl_color(Fl_Color c) {fl_graphics_driver->color(c); }; // select indexed color
+inline void fl_color(Fl_Color c) {fl_graphics_driver->color(c); } // select indexed color
/** for back compatibility - use fl_color(Fl_Color c) instead */
inline void fl_color(int c) {fl_color((Fl_Color)c);}
/**
@@ -70,7 +70,7 @@ inline void fl_color(int c) {fl_color((Fl_Color)c);}
the foreground is not set for the current window.
\param[in] r,g,b color components
*/
-inline void fl_color(uchar r, uchar g, uchar b) {fl_graphics_driver->color(r,g,b); }; // select actual color
+inline void fl_color(uchar r, uchar g, uchar b) {fl_graphics_driver->color(r,g,b); } // select actual color
/** \brief The current color */
extern FL_EXPORT Fl_Color fl_color_;
/**
@@ -89,13 +89,13 @@ inline Fl_Color fl_color() {return fl_color_;}
new region onto the stack.
\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 */
#define fl_clip fl_push_clip
/**
Pushes an empty clip region onto the stack so nothing will be clipped.
*/
-inline void fl_push_no_clip() {fl_graphics_driver->push_no_clip(); };
+inline void fl_push_no_clip() {fl_graphics_driver->push_no_clip(); }
/**
Restores the previous clip region.
@@ -103,7 +103,7 @@ inline void fl_push_no_clip() {fl_graphics_driver->push_no_clip(); };
Unpredictable results may occur if the clip stack is not empty when
you return to FLTK.
*/
-inline void fl_pop_clip() {fl_graphics_driver->pop_clip(); };
+inline void fl_pop_clip() {fl_graphics_driver->pop_clip(); }
/**
Does the rectangle intersect the current clip region?
\param[in] x,y,w,h position and size of rectangle
@@ -114,7 +114,7 @@ inline void fl_pop_clip() {fl_graphics_driver->pop_clip(); };
Under X this returns 2 if the rectangle is partially clipped,
and 1 if it is entirely inside the clip region.
*/
-inline int fl_not_clipped(int x, int y, int w, int h) {return fl_graphics_driver->not_clipped(x,y,w,h); };
+inline int fl_not_clipped(int x, int y, int w, int h) {return fl_graphics_driver->not_clipped(x,y,w,h); }
/**
Intersects the rectangle with the current clip region and returns the
bounding box of the result.
@@ -130,7 +130,7 @@ 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.
*/
inline int fl_clip_box(int x , int y, int w, int h, int& X, int& Y, int& W, int& H)
- {return fl_graphics_driver->clip_box(x,y,w,h,X,Y,W,H); };
+ {return fl_graphics_driver->clip_box(x,y,w,h,X,Y,W,H); }
/** Undoes any clobbering of clip done by your program */
extern void fl_restore_clip();
/**
@@ -150,7 +150,7 @@ extern Fl_Region fl_clip_region();
/**
Draws a single pixel at the given coordinates
*/
-inline void fl_point(int x, int y) { fl_graphics_driver->point(x,y); };
+inline void fl_point(int x, int y) { fl_graphics_driver->point(x,y); }
// line type:
/**
@@ -180,7 +180,7 @@ inline void fl_point(int x, int y) { fl_graphics_driver->point(x,y); };
\note The \p dashes array does not work under Windows 95, 98 or Me,
since those operating systems do not support complex line styles.
*/
-inline void fl_line_style(int style, int width=0, char* dashes=0) {fl_graphics_driver->line_style(style,width,dashes); };
+inline void fl_line_style(int style, int width=0, char* dashes=0) {fl_graphics_driver->line_style(style,width,dashes); }
enum {
FL_SOLID = 0, ///< line style: <tt>___________</tt>
FL_DASH = 1, ///< line style: <tt>_ _ _ _ _ _</tt>
@@ -204,12 +204,12 @@ enum {
This function is meant for quick drawing of simple boxes. The behavior is
undefined for line widths that are not 1.
*/
-inline void fl_rect(int x, int y, int w, int h) { fl_graphics_driver->rect(x,y,w,h); };
+inline void fl_rect(int x, int y, int w, int h) { fl_graphics_driver->rect(x,y,w,h); }
/** Draws with passed color a 1-pixel border \e inside the given bounding box */
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 */
-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 */
inline void fl_rectf(int x, int y, int w, int h, Fl_Color c) {fl_color(c); fl_rectf(x,y,w,h);}
@@ -226,63 +226,63 @@ FL_EXPORT void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b);
/**
Draws a line from (x,y) to (x1,y1)
*/
-inline void fl_line(int x, int y, int x1, int y1) {fl_graphics_driver->line(x,y,x1,y1); };
+inline void fl_line(int x, int y, int x1, int y1) {fl_graphics_driver->line(x,y,x1,y1); }
/**
Draws a line from (x,y) to (x1,y1) and another from (x1,y1) to (x2,y2)
*/
-inline void fl_line(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_driver->line(x,y,x1,y1,x2,y2); };
+inline void fl_line(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_driver->line(x,y,x1,y1,x2,y2); }
// closed line segments:
/**
Outlines a 3-sided polygon with lines
*/
-inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_driver->loop(x,y,x1,y1,x2,y2); };
+inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_driver->loop(x,y,x1,y1,x2,y2); }
/**
Outlines a 4-sided polygon with lines
*/
inline void fl_loop(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
- {fl_graphics_driver->loop(x,y,x1,y1,x2,y2,x3,y3); };
+ {fl_graphics_driver->loop(x,y,x1,y1,x2,y2,x3,y3); }
// filled polygons
/**
Fills a 3-sided polygon. The polygon must be convex.
*/
-inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_driver->polygon(x,y,x1,y1,x2,y2); };
+inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2) {fl_graphics_driver->polygon(x,y,x1,y1,x2,y2); }
/**
Fills a 4-sided polygon. The polygon must be convex.
*/
inline void fl_polygon(int x, int y, int x1, int y1, int x2, int y2, int x3, int y3)
- { fl_graphics_driver->polygon(x,y,x1,y1,x2,y2,x3,y3); };
+ { fl_graphics_driver->polygon(x,y,x1,y1,x2,y2,x3,y3); }
// draw rectilinear lines, horizontal segment first:
/**
Draws a horizontal line from (x,y) to (x1,y)
*/
-inline void fl_xyline(int x, int y, int x1) {fl_graphics_driver->xyline(x,y,x1);};
+inline void fl_xyline(int x, int y, int x1) {fl_graphics_driver->xyline(x,y,x1);}
/**
Draws a horizontal line from (x,y) to (x1,y), then vertical from (x1,y) to (x1,y2)
*/
-inline void fl_xyline(int x, int y, int x1, int y2) {fl_graphics_driver->xyline(x,y,x1,y2);};
+inline void fl_xyline(int x, int y, int x1, int y2) {fl_graphics_driver->xyline(x,y,x1,y2);}
/**
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)
*/
-inline void fl_xyline(int x, int y, int x1, int y2, int x3) {fl_graphics_driver->xyline(x,y,x1,y2,x3);};
+inline void fl_xyline(int x, int y, int x1, int y2, int x3) {fl_graphics_driver->xyline(x,y,x1,y2,x3);}
// draw rectilinear lines, vertical segment first:
/**
Draws a vertical line from (x,y) to (x,y1)
*/
-inline void fl_yxline(int x, int y, int y1) {fl_graphics_driver->yxline(x,y,y1);};
+inline void fl_yxline(int x, int y, int y1) {fl_graphics_driver->yxline(x,y,y1);}
/**
Draws a vertical line from (x,y) to (x,y1), then a horizontal from (x,y1) to (x2,y1)
*/
-inline void fl_yxline(int x, int y, int y1, int x2) {fl_graphics_driver->yxline(x,y,y1,x2);};
+inline void fl_yxline(int x, int y, int y1, int x2) {fl_graphics_driver->yxline(x,y,y1,x2);}
/**
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)
*/
-inline void fl_yxline(int x, int y, int y1, int x2, int y3) {fl_graphics_driver->yxline(x,y,y1,x2,y3);};
+inline void fl_yxline(int x, int y, int y1, int x2, int y3) {fl_graphics_driver->yxline(x,y,y1,x2,y3);}
// circular lines and pie slices (code in fl_arci.C):
/**
@@ -307,7 +307,7 @@ inline void fl_yxline(int x, int y, int y1, int x2, int y3) {fl_graphics_driver-
counter-clockwise from 3 o'clock. \p a2 must be greater
than or equal to \p a1.
*/
-inline void fl_arc(int x, int y, int w, int h, double a1, double a2) {fl_graphics_driver->arc(x,y,w,h,a1,a2); };
+inline void fl_arc(int x, int y, int w, int h, double a1, double a2) {fl_graphics_driver->arc(x,y,w,h,a1,a2); }
/**
Draw filled ellipse sections using integer coordinates.
@@ -320,7 +320,7 @@ inline void fl_arc(int x, int y, int w, int h, double a1, double a2) {fl_graphic
counter-clockwise from 3 o'clock. \p a2 must be greater
than or equal to \p a1.
*/
-inline void fl_pie(int x, int y, int w, int h, double a1, double a2) {fl_graphics_driver->pie(x,y,w,h,a1,a2); };
+inline void fl_pie(int x, int y, int w, int h, double a1, double a2) {fl_graphics_driver->pie(x,y,w,h,a1,a2); }
/** fl_chord declaration is a place holder - the function does not yet exist */
FL_EXPORT void fl_chord(int x, int y, int w, int h, double a1, double a2); // nyi
@@ -335,24 +335,24 @@ FL_EXPORT void fl_mult_matrix(double a, double b, double c, double d, double x,d
/**
Starts drawing a list of points. Points are added to the list with fl_vertex()
*/
-inline void fl_begin_points() {fl_graphics_driver->begin_points(); };
+inline void fl_begin_points() {fl_graphics_driver->begin_points(); }
/**
Starts drawing a list of lines.
*/
-inline void fl_begin_line() {fl_graphics_driver->begin_line(); };
+inline void fl_begin_line() {fl_graphics_driver->begin_line(); }
/**
Starts drawing a closed sequence of lines.
*/
-inline void fl_begin_loop() {fl_graphics_driver->begin_loop(); };
+inline void fl_begin_loop() {fl_graphics_driver->begin_loop(); }
/**
Starts drawing a convex filled polygon.
*/
-inline void fl_begin_polygon() {fl_graphics_driver->begin_polygon(); };
+inline void fl_begin_polygon() {fl_graphics_driver->begin_polygon(); }
/**
Adds a single vertex to the current path.
\param[in] x,y coordinate
*/
-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.
The curve ends (and two of the points) are at X0,Y0 and X3,Y3.
@@ -362,7 +362,7 @@ inline void fl_vertex(double x, double y) {fl_graphics_driver->vertex(x,y); };
\param[in] X3,Y3 curve end point
*/
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
can get elliptical paths by using scale and rotate before calling fl_arc().
@@ -371,7 +371,7 @@ inline void fl_curve(double X0, double Y0, double X1, double Y1, double X2, doub
counter-clockwise from 3 o'clock. If \p end is less than \p start
then it draws the arc in a clockwise direction.
*/
-inline void fl_arc(double x, double y, double r, double start, double end) {fl_graphics_driver->arc(x,y,r,start,end); };
+inline void fl_arc(double x, double y, double r, double start, double end) {fl_graphics_driver->arc(x,y,r,start,end); }
/**
fl_circle() is equivalent to fl_arc(x,y,r,0,360), but may be faster.
@@ -379,23 +379,23 @@ inline void fl_arc(double x, double y, double r, double start, double end) {fl_g
a complex polygon you must use fl_arc()
\param[in] x,y,r center and radius of circle
*/
-inline void fl_circle(double x, double y, double r) {fl_graphics_driver->circle(x,y,r); };
+inline void fl_circle(double x, double y, double r) {fl_graphics_driver->circle(x,y,r); }
/**
Ends list of points, and draws.
*/
-inline void fl_end_points() {fl_graphics_driver->end_points(); };
+inline void fl_end_points() {fl_graphics_driver->end_points(); }
/**
Ends list of lines, and draws.
*/
-inline void fl_end_line() {fl_graphics_driver->end_line(); };
+inline void fl_end_line() {fl_graphics_driver->end_line(); }
/**
Ends closed sequence of lines, and draws.
*/
-inline void fl_end_loop() {fl_graphics_driver->end_loop(); };
+inline void fl_end_loop() {fl_graphics_driver->end_loop(); }
/**
Ends convex filled polygon, and draws.
*/
-inline void fl_end_polygon() {fl_graphics_driver->end_polygon(); };
+inline void fl_end_polygon() {fl_graphics_driver->end_polygon(); }
/**
Starts drawing a complex filled polygon.
@@ -410,18 +410,18 @@ inline void fl_end_polygon() {fl_graphics_driver->end_polygon(); };
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.
*/
-inline void fl_begin_complex_polygon() {fl_graphics_driver->begin_complex_polygon(); };
+inline void fl_begin_complex_polygon() {fl_graphics_driver->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.
*/
-inline void fl_gap() {fl_graphics_driver->gap(); };
+inline void fl_gap() {fl_graphics_driver->gap(); }
/**
Ends complex filled polygon, and draws.
*/
-inline void fl_end_complex_polygon() {fl_graphics_driver->end_complex_polygon(); };
+inline void fl_end_complex_polygon() {fl_graphics_driver->end_complex_polygon(); }
// get and use transformed positions:
FL_EXPORT double fl_transform_x(double x, double y);
FL_EXPORT double fl_transform_y(double x, double y);
@@ -431,7 +431,7 @@ FL_EXPORT double fl_transform_dy(double x, double y);
Adds coordinate pair to the vertex list without further transformations.
\param[in] xf,yf transformed coordinate
*/
-inline void fl_transformed_vertex(double xf, double yf) {fl_graphics_driver->transformed_vertex(xf,yf); };
+inline void fl_transformed_vertex(double xf, double yf) {fl_graphics_driver->transformed_vertex(xf,yf); }
/** @} */
/** \addtogroup fl_attributes
@@ -448,7 +448,7 @@ inline void fl_transformed_vertex(double xf, double yf) {fl_graphics_driver->tra
The size of the font is measured in pixels and not "points".
Lines should be spaced \p size pixels apart or more.
*/
-inline void fl_font(Fl_Font face, Fl_Fontsize size) { fl_graphics_driver->font(face,size); };
+inline void fl_font(Fl_Font face, Fl_Fontsize size) { fl_graphics_driver->font(face,size); }
extern FL_EXPORT Fl_Font fl_font_; ///< current font index
/**
@@ -554,16 +554,16 @@ FL_EXPORT void fl_draw(int angle, const char* str, int x, int y);
/**
Draws an array of \p n characters starting at the given location.
*/
-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,
rotating \p angle degrees counterclockwise.
*/
-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); }
/**
Draws an array of \p n characters right to left starting at given location.
*/
-inline void fl_rtl_draw(const char* str, int n, int x, int y) {fl_graphics_driver->rtl_draw(str,n,x,y); };
+inline void fl_rtl_draw(const char* str, int n, int x, int y) {fl_graphics_driver->rtl_draw(str,n,x,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,
@@ -615,14 +615,14 @@ FL_EXPORT void fl_draw_box(Fl_Boxtype, int x, int y, int w, int h, Fl_Color);
to 32 bits.
*/
inline void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0)
- { 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.
\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)
- { 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.
@@ -657,7 +657,7 @@ inline void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=
If \p D is 4 or more, you must fill in the unused bytes with zero.
*/
inline void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3)
- { 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.
@@ -730,5 +730,5 @@ FL_EXPORT int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scal
#endif
//
-// End of "$Id: fl_draw.H 7659 2010-07-01 13:21:32Z manolo $".
+// End of "$Id: fl_draw.H 7788 2010-10-31 20:47:50Z matt $".
//
diff --git a/FL/fl_show_colormap.H b/FL/fl_show_colormap.H
index f72fc51..9703b76 100644
--- a/FL/fl_show_colormap.H
+++ b/FL/fl_show_colormap.H
@@ -1,5 +1,5 @@
//
-// "$Id: fl_show_colormap.H 6614 2009-01-01 16:11:32Z matt $"
+// "$Id: fl_show_colormap.H 7785 2010-10-31 18:00:37Z greg.ercolano $"
//
// Colormap picker header file for the Fast Light Tool Kit (FLTK).
//
@@ -25,13 +25,34 @@
// http://www.fltk.org/str.php
//
+/** \file
+ The fl_show_colormap() function hides the implementation classes used
+ to provide the popup window and color selection mechanism.
+*/
+
#ifndef fl_show_colormap_H
#define fl_show_colormap_H
+/* doxygen comment here to avoid exposing ColorMenu in fl_show_colormap.cxx
+*/
+
+/** \addtogroup fl_attributes
+ @{ */
+
+/**
+ \brief Pops up a window to let the user pick an colormap entry.
+ \image html fl_show_colormap.gif
+ \image latex fl_show_colormap.eps "fl_show_colormap" width=8cm
+ \param[in] oldcol color to be highlighted when grid is shown.
+ \retval Fl_Color value of the chosen colormap entry.
+ \sa Fl_Color_Chooser
+*/
FL_EXPORT Fl_Color fl_show_colormap(Fl_Color oldcol);
+/** @} */
+
#endif
//
-// End of "$Id: fl_show_colormap.H 6614 2009-01-01 16:11:32Z matt $".
+// End of "$Id: fl_show_colormap.H 7785 2010-10-31 18:00:37Z greg.ercolano $".
//
diff --git a/FL/forms.H b/FL/forms.H
index 4e6120a..a5bf5d8 100644
--- a/FL/forms.H
+++ b/FL/forms.H
@@ -1,5 +1,5 @@
//
-// "$Id: forms.H 7117 2010-02-20 21:14:47Z matt $"
+// "$Id: forms.H 7767 2010-10-28 21:47:01Z matt $"
//
// Forms emulation header file for the Fast Light Tool Kit (FLTK).
//
@@ -652,7 +652,7 @@ inline int fl_show_question(const char* c, int = 0) {return fl_choice("%s",fl_no
FL_EXPORT void fl_show_message(const char *,const char *,const char *);
FL_EXPORT void fl_show_alert(const char *,const char *,const char *,int=0);
FL_EXPORT int fl_show_question(const char *,const char *,const char *);
-inline const char *fl_show_input(const char *l,const char*d=0) {return fl_input(l,d);}
+inline const char *fl_show_input(const char *l,const char*d=0) {return fl_input("%s",d,l);}
FL_EXPORT /*const*/ char *fl_show_simple_input(const char *label, const char *deflt = 0);
FL_EXPORT int fl_show_choice(
const char *m1,
@@ -841,5 +841,5 @@ inline void fl_draw() {Fl::flush();}
#endif /* define __FORMS_H__ */
//
-// End of "$Id: forms.H 7117 2010-02-20 21:14:47Z matt $".
+// End of "$Id: forms.H 7767 2010-10-28 21:47:01Z matt $".
//