From 3cb5ebe0e811f3db008085d985b7761725589a74 Mon Sep 17 00:00:00 2001
From: No Author
Date: Wed, 1 Aug 2001 21:24:49 +0000
Subject: This commit was manufactured by cvs2svn to create branch
'branch-1.1'.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1513 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
---
FL/Fl_Export.H | 37 +
FL/Fl_FileBrowser.H | 80 ++
FL/Fl_FileChooser.H | 80 ++
FL/Fl_FileIcon.H | 107 ++
FL/Fl_Shared_Image.H | 203 ++++
FL/Fl_Text_Buffer.H | 241 +++++
FL/Fl_Text_Display.H | 217 ++++
FL/Fl_Text_Editor.H | 105 ++
FL/Fl_Tooltip.H | 72 ++
documentation/Fl_Image.html | 142 +++
src/Fl_FileBrowser.cxx | 446 +++++++++
src/Fl_FileChooser.cxx | 248 +++++
src/Fl_FileChooser.fl | 208 ++++
src/Fl_FileChooser2.cxx | 669 +++++++++++++
src/Fl_FileIcon.cxx | 329 +++++++
src/Fl_Text_Buffer.cxx | 2287 +++++++++++++++++++++++++++++++++++++++++++
src/Fl_Text_Display.cxx | 1947 ++++++++++++++++++++++++++++++++++++
src/Fl_Text_Editor.cxx | 446 +++++++++
src/Fl_Tooltip.cxx | 157 +++
src/Fl_lock.cxx | 145 +++
src/allfiles.xbm | 6 +
src/fl_dnd.cxx | 34 +
src/fl_dnd_x.cxx | 170 ++++
src/new.xbm | 6 +
src/up.xbm | 6 +
test/tabs.cxx | 85 ++
test/threads.cxx | 65 ++
27 files changed, 8538 insertions(+)
create mode 100644 FL/Fl_Export.H
create mode 100644 FL/Fl_FileBrowser.H
create mode 100644 FL/Fl_FileChooser.H
create mode 100644 FL/Fl_FileIcon.H
create mode 100644 FL/Fl_Shared_Image.H
create mode 100644 FL/Fl_Text_Buffer.H
create mode 100644 FL/Fl_Text_Display.H
create mode 100644 FL/Fl_Text_Editor.H
create mode 100644 FL/Fl_Tooltip.H
create mode 100644 documentation/Fl_Image.html
create mode 100644 src/Fl_FileBrowser.cxx
create mode 100644 src/Fl_FileChooser.cxx
create mode 100644 src/Fl_FileChooser.fl
create mode 100644 src/Fl_FileChooser2.cxx
create mode 100644 src/Fl_FileIcon.cxx
create mode 100644 src/Fl_Text_Buffer.cxx
create mode 100644 src/Fl_Text_Display.cxx
create mode 100644 src/Fl_Text_Editor.cxx
create mode 100644 src/Fl_Tooltip.cxx
create mode 100644 src/Fl_lock.cxx
create mode 100644 src/allfiles.xbm
create mode 100644 src/fl_dnd.cxx
create mode 100644 src/fl_dnd_x.cxx
create mode 100644 src/new.xbm
create mode 100644 src/up.xbm
create mode 100644 test/tabs.cxx
create mode 100644 test/threads.cxx
diff --git a/FL/Fl_Export.H b/FL/Fl_Export.H
new file mode 100644
index 000000000..c4f6b2e95
--- /dev/null
+++ b/FL/Fl_Export.H
@@ -0,0 +1,37 @@
+/*
+ The following is only used when building DLLs under WIN32
+*/
+
+#if defined(WIN32) && defined(FL_SHARED)
+# ifdef FL_LIBRARY
+# define FL_API __declspec(dllexport)
+# else
+# define FL_API __declspec(dllimport)
+# endif
+# ifdef FL_IMAGES_LIBRARY
+# define FL_IMAGES_API __declspec(dllexport)
+# else
+# define FL_IMAGES_API __declspec(dllimport)
+# endif
+# ifdef FL_GLUT_LIBRARY
+# define FL_GLUT_API __declspec(dllexport)
+# else
+# define FL_GLUT_API __declspec(dllimport)
+# endif
+# ifdef FL_FORMS_LIBRARY
+# define FL_FORMS_API __declspec(dllexport)
+# else
+# define FL_FORMS_API __declspec(dllimport)
+# endif
+# ifdef FL_GL_LIBRARY
+# define FL_GL_API __declspec(dllexport)
+# else
+# define FL_GL_API __declspec(dllimport)
+# endif
+#else
+# define FL_API
+# define FL_IMAGES_API
+# define FL_GLUT_API
+# define FL_FORMS_API
+# define FL_GL_API
+#endif
diff --git a/FL/Fl_FileBrowser.H b/FL/Fl_FileBrowser.H
new file mode 100644
index 000000000..4b3f2bd11
--- /dev/null
+++ b/FL/Fl_FileBrowser.H
@@ -0,0 +1,80 @@
+//
+// "$Id: Fl_FileBrowser.H,v 1.4 2000/01/16 07:44:20 robertk Exp $"
+//
+// Fl_FileBrowser definitions for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1997-1999 by Easy Software Products.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to "fltk-bugs@easysw.com".
+//
+
+//
+// Include necessary header files...
+//
+
+#ifndef _FL_FILEBROWSER_H_
+# define _FL_FILEBROWSER_H_
+
+# include
+# include
+
+
+//
+// Fl_FileBrowser class...
+//
+
+class FL_API Fl_FileBrowser : public Fl_Browser
+{
+ const char *directory_;
+ uchar iconsize_;
+ const char *pattern_;
+
+ int item_height(void *) const;
+ int item_width(void *) const;
+ void item_draw(void *, int, int, int, int) const;
+ int incr_height() const { return (item_height(0)); }
+
+public:
+ Fl_FileBrowser(int, int, int, int, const char * = 0);
+
+ uchar iconsize() const { return (iconsize_); };
+ void iconsize(uchar s) { iconsize_ = s; redraw(); };
+
+ void directory(const char *directory) { load(directory); }
+ const char *directory(void) const { return (directory_); }
+
+ void filter(const char *pattern);
+ const char *filter() const { return (pattern_); };
+
+ int load(const char *directory);
+
+#ifdef FLTK_2
+ unsigned textsize() const { return (Fl_Browser::text_size()); };
+ void textsize(unsigned s) { Fl_Browser::text_size(s); };
+#else
+ uchar textsize() const { return (Fl_Browser::textsize()); };
+ void textsize(uchar s) { Fl_Browser::textsize(s); };
+#endif
+
+};
+
+#endif // !_FL_FILEBROWSER_H_
+
+//
+// End of "$Id: Fl_FileBrowser.H,v 1.4 2000/01/16 07:44:20 robertk Exp $".
+//
diff --git a/FL/Fl_FileChooser.H b/FL/Fl_FileChooser.H
new file mode 100644
index 000000000..81790510b
--- /dev/null
+++ b/FL/Fl_FileChooser.H
@@ -0,0 +1,80 @@
+// generated by Fast Light User Interface Designer (fluid) version 2.0000
+
+#ifndef Fl_FileChooser_h
+#define Fl_FileChooser_h
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "filename.H"
+#include
+#include
+#include
+
+class FL_API Fl_FileChooser {
+public:
+ enum { SINGLE, MULTI, CREATE };
+ Fl_FileChooser(const char *d, const char *p, int t, const char *title);
+ Fl_Window *window;
+private:
+ inline void cb_window_i(Fl_Window*, void*);
+ static void cb_window(Fl_Window*, void*);
+ Fl_Choice *dirMenu;
+ inline void cb_dirMenu_i(Fl_Choice*, void*);
+ static void cb_dirMenu(Fl_Choice*, void*);
+ Fl_Button *upButton;
+ inline void cb_upButton_i(Fl_Button*, void*);
+ static void cb_upButton(Fl_Button*, void*);
+ Fl_Button *newButton;
+ inline void cb_newButton_i(Fl_Button*, void*);
+ static void cb_newButton(Fl_Button*, void*);
+ inline void cb__i(Fl_Button*, void*);
+ static void cb_(Fl_Button*, void*);
+ Fl_FileBrowser *fileList;
+ inline void cb_fileList_i(Fl_FileBrowser*, void*);
+ static void cb_fileList(Fl_FileBrowser*, void*);
+ Fl_FileInput *fileName;
+ inline void cb_fileName_i(Fl_FileInput*, void*);
+ static void cb_fileName(Fl_FileInput*, void*);
+ Fl_Return_Button *okButton;
+ inline void cb_okButton_i(Fl_Return_Button*, void*);
+ static void cb_okButton(Fl_Return_Button*, void*);
+ inline void cb_Cancel_i(Fl_Button*, void*);
+ static void cb_Cancel(Fl_Button*, void*);
+ char directory_[1024];
+ int type_;
+ void fileListCB();
+ void fileNameCB();
+ void newdir();
+ void up();
+public:
+ void color(Fl_Color c);
+ Fl_Color color();
+ int count();
+ void directory(const char *d);
+ char * directory();
+ void exec();
+ void filter(const char *p);
+ const char * filter();
+ void hide();
+ void iconsize(uchar s);
+ uchar iconsize();
+ void label(const char *l);
+ const char * label();
+ void rescan();
+ void textcolor(Fl_Color c);
+ Fl_Color textcolor();
+ void textfont(Fl_Font f);
+ Fl_Font textfont();
+ void textsize(uchar s);
+ uchar textsize();
+ void type(int t);
+ int type();
+ const char *value(int f = 1);
+ void value(const char *filename);
+ int visible();
+};
+#endif
diff --git a/FL/Fl_FileIcon.H b/FL/Fl_FileIcon.H
new file mode 100644
index 000000000..6df0f7d54
--- /dev/null
+++ b/FL/Fl_FileIcon.H
@@ -0,0 +1,107 @@
+//
+// "$Id: Fl_FileIcon.H,v 1.1 2000/01/08 22:14:13 vincent Exp $"
+//
+// Fl_FileIcon definitions for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1997-1999 by Easy Software Products.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to "fltk-bugs@easysw.com".
+//
+
+//
+// Include necessary header files...
+//
+
+#ifndef _FL_FILEICON_H_
+# define _FL_FILEICON_H_
+
+# include
+
+
+//
+// Fl_FileIcon class...
+//
+
+class FL_API Fl_FileIcon //// Icon data
+{
+ static Fl_FileIcon *first_; // Pointer to first icon/filetype
+ Fl_FileIcon *next_; // Pointer to next icon/filetype
+ const char *pattern_; // Pattern string
+ int type_; // Match only if directory or file?
+ int num_data_; // Number of data elements
+ int alloc_data_; // Number of allocated elements
+ short *data_; // Icon data
+
+ public:
+
+ enum // File types
+ {
+ ANY, // Any kind of file
+ PLAIN, // Only plain files
+ FIFO, // Only named pipes
+ DEVICE, // Only character and block devices
+ LINK, // Only symbolic links
+ DIR // Only directories
+ };
+
+ enum // Data opcodes
+ {
+ END, // End of primitive/icon
+ COLOR, // Followed by color index
+ LINE, // Start of line
+ CLOSEDLINE, // Start of closed line
+ POLYGON, // Start of polygon
+ OUTLINEPOLYGON, // Followed by outline color
+ VERTEX // Followed by scaled X,Y
+ };
+
+ Fl_FileIcon(const char *p, int t, int nd = 0, short *d = 0);
+ ~Fl_FileIcon();
+
+ short *add(short d);
+ short *add_color(short c)
+ { short *d = add(COLOR); add(c); return (d); }
+ short *add_vertex(int x, int y)
+ { short *d = add(VERTEX); add(x); add(y); return (d); }
+ short *add_vertex(float x, float y)
+ { short *d = add(VERTEX); add((int)(x * 10000.0));
+ add((int)(y * 10000.0)); return (d); }
+ void clear() { num_data_ = 0; }
+ void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1);
+ void label(Fl_Widget *w);
+// static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a);
+ void load(const char *f);
+ void load_fti(const char *fti);
+ void load_xpm(const char *xpm);
+ const char *pattern() { return (pattern_); }
+ int size() { return (num_data_); }
+ int type() { return (type_); }
+ short *value() { return (data_); }
+
+ static Fl_FileIcon *find(const char *filename, int filetype = ANY);
+ static Fl_FileIcon *first() { return (first_); }
+ static void load_system_icons(void);
+};
+
+//#define _FL_ICON_LABEL FL_FREE_LABELTYPE
+
+#endif // !_FL_FILEICON_H_
+
+//
+// End of "$Id: Fl_FileIcon.H,v 1.1 2000/01/08 22:14:13 vincent Exp $".
+//
diff --git a/FL/Fl_Shared_Image.H b/FL/Fl_Shared_Image.H
new file mode 100644
index 000000000..11c5ce794
--- /dev/null
+++ b/FL/Fl_Shared_Image.H
@@ -0,0 +1,203 @@
+//
+// "$Id: Fl_Shared_Image.H,v 1.22 2001/07/16 19:38:17 robertk Exp $"
+//
+// Image file header file for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-1999 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to "fltk-bugs@easysw.com".
+//
+
+#ifndef Fl_Shared_Image_H
+#define Fl_Shared_Image_H
+
+#include
+#include
+
+struct FL_IMAGES_API Fl_Image_Type;
+
+// Shared images class.
+class FL_IMAGES_API Fl_Shared_Image : public Fl_Image {
+protected:
+ static const char* fl_shared_image_root;
+
+ static int image_used;
+ static size_t mem_usage_limit;
+
+ static size_t mem_used;
+ static int forbid_delete;
+
+ Fl_Shared_Image* l1; // Left leaf in the binary tree
+ Fl_Shared_Image* l2; // Right leaf in the binary tree
+ const char* name; // Used to indentify the image, and as filename
+ const uchar* datas; // If non zero, pointers on inlined compressed datas
+ unsigned int used; // Last time used, for cache handling purpose
+ int refcount; // Number of time this image has been get
+
+ Fl_Shared_Image() { }; // Constructor is private on purpose,
+ // use the get function rather
+ ~Fl_Shared_Image();
+
+ void find_less_used();
+ static void check_mem_usage();
+
+ const char* get_filename();// Return the filename obtained from the concatenation
+ // of the image root directory and this image name
+ // WARNING : the returned pointer will be
+ // available only until next call to get_filename
+
+ static const char* get_filename(const char*);
+
+ virtual void read() = 0;// decompress the image and create its pixmap
+
+ static void insert(Fl_Shared_Image*& p, Fl_Shared_Image* image);
+ static Fl_Shared_Image* find(Fl_Shared_Image* image, const char* name);
+ void remove_from_tree(Fl_Shared_Image*& p, Fl_Shared_Image* image);
+
+
+public:
+ static Fl_Shared_Image *first_image;
+
+ // Return an Fl_Shared_Image, using the create function if an image with
+ // the given name doesn't already exist. Use datas, or read from the
+ // file with filename name if datas==0.
+ static Fl_Shared_Image* get(Fl_Shared_Image* (*create)(),
+ const char* name, const uchar* datas=0);
+
+ // Reload the image, useful if it has changed on disk, or if the datas
+ // in memory have changed (you can also give a new pointer on datas)
+ void reload(const uchar* datas=0);
+ static void reload(const char* name, const uchar* datas=0);
+
+ // Remove an image from the database and delete it if its refcount has
+ // fallen to zero
+ // Each remove decrement the refcount, each get increment it
+ // Return 1 if it has been really deleted.
+ int remove();
+ static int remove(const char* name);
+
+ // Clear the cache for this image and all of its children in the binary tree
+ void clear_cache();
+
+ // Try to guess the filetype
+ // Beware that calling this force you to link in all image types !
+ static Fl_Image_Type* guess(const char* name, const uchar* datas=0);
+
+ // Set the position where images are looked for on disk
+ static void set_root_directory(const char* d);
+
+ // Set the size of the cache (0 = unlimited is the default)
+ static void set_cache_size(size_t l);
+
+ virtual void draw(int X, int Y, int W, int H, int cx, int cy);
+};
+
+
+
+// Description of a file format
+struct FL_IMAGES_API Fl_Image_Type {
+ // Name of the filetype as it appear in the source code (uppercase)
+ const char* name;
+ // Function to test the filetype
+ int (*test)(const uchar* datas, size_t size=0);
+ // Function to get/create an image of this type
+ Fl_Shared_Image* (*get)(const char* name, const uchar* datas=0);
+};
+extern FL_IMAGES_API Fl_Image_Type fl_image_filetypes[];
+
+/* Specific image format functions. Add you own file format here. */
+
+// PNG image class
+class FL_IMAGES_API Fl_PNG_Image : public Fl_Shared_Image {
+ void read(); // Uncompress PNG datas
+ Fl_PNG_Image() { }
+ static Fl_Shared_Image* create() { return new Fl_PNG_Image; } // Instantiate
+public:
+// Check the given buffer if it is in PNG format
+ static int test(const uchar* datas, size_t size=0);
+ void measure(int& W, int& H); // Return width and heigth
+ static Fl_Shared_Image* get(const char* name, const uchar* datas = 0) {
+ return Fl_Shared_Image::get(create, name, datas);
+ }
+};
+
+class FL_IMAGES_API Fl_GIF_Image : public Fl_Shared_Image {
+ void read();
+ Fl_GIF_Image() { }
+ static Fl_Shared_Image* create() { return new Fl_GIF_Image; }
+public:
+ static int test(const uchar* datas, size_t size=0);
+ void measure(int& W, int& H);
+ static Fl_Shared_Image* get(const char* name, const uchar* datas = 0) {
+ return Fl_Shared_Image::get(create, name, datas);
+ }
+};
+
+class FL_IMAGES_API Fl_XPM_Image : public Fl_Shared_Image {
+ void read();
+ Fl_XPM_Image() { }
+ static Fl_Shared_Image* create() { return new Fl_XPM_Image; }
+public:
+ static int test(const uchar* datas, size_t size=0);
+ void measure(int& W, int& H);
+ static Fl_Shared_Image* get(const char* name, const uchar* datas = 0) {
+ return Fl_Shared_Image::get(create, name, datas);
+ }
+};
+
+class FL_IMAGES_API Fl_BMP_Image : public Fl_Shared_Image {
+ void read();
+ Fl_BMP_Image() { }
+ static Fl_Shared_Image* create() { return new Fl_BMP_Image; }
+public:
+ static int test(const uchar* datas, size_t size=0);
+ void measure(int& W, int& H);
+ static Fl_Shared_Image* get(const char* name, const uchar* datas = 0) {
+ return Fl_Shared_Image::get(create, name, datas);
+ }
+};
+
+class FL_IMAGES_API Fl_JPEG_Image : public Fl_Shared_Image {
+ void read();
+ Fl_JPEG_Image() { }
+ static Fl_Shared_Image* create() { return new Fl_JPEG_Image; }
+public:
+ static int test(const uchar* datas, size_t size=0);
+ void measure(int& W, int& H);
+ static Fl_Shared_Image* get(const char* name, const uchar* datas = 0) {
+ return Fl_Shared_Image::get(create, name, datas);
+ }
+};
+
+//class FL_API Fl_Bitmap;
+class Fl_Bitmap;
+extern FL_IMAGES_API Fl_Bitmap nosuch_bitmap;
+
+class FL_IMAGES_API Fl_UNKNOWN_Image {
+public:
+ static int test(const uchar*, size_t =0) { return 1; };
+ static Fl_Shared_Image* get(const char*, const uchar* = 0) {
+ return (Fl_Shared_Image*) &nosuch_bitmap;
+ };
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Shared_Image.H,v 1.22 2001/07/16 19:38:17 robertk Exp $"
+//
diff --git a/FL/Fl_Text_Buffer.H b/FL/Fl_Text_Buffer.H
new file mode 100644
index 000000000..2528c2fa8
--- /dev/null
+++ b/FL/Fl_Text_Buffer.H
@@ -0,0 +1,241 @@
+//
+// "$Id: Fl_Text_Buffer.H,v 1.3 2001/02/21 06:15:44 clip Exp $"
+//
+// Header file for Fl_Text_Buffer class.
+//
+// Copyright Mark Edel. Permission to distribute under the LGPL for
+// the FLTK library granted by Mark Edel.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to "fltk-bugs@fltk.org".
+//
+
+#ifndef FL_TEXT_BUFFER_H
+#define FL_TEXT_BUFFER_H
+
+/* Maximum length in characters of a tab or control character expansion
+ of a single buffer character */
+#define FL_TEXT_MAX_EXP_CHAR_LEN 20
+
+#include
+
+class FL_API Fl_Text_Selection {
+ friend class Fl_Text_Buffer;
+
+ public:
+ void set(int start, int end);
+ void set_rectangular(int start, int end, int rectStart, int rectEnd);
+ void update(int pos, int nDeleted, int nInserted);
+ char rectangular() { return mRectangular; }
+ int start() { return mStart; }
+ int end() { return mEnd; }
+ int rect_start() { return mRectStart; }
+ int rect_end() { return mRectEnd; }
+ char selected() { return mSelected; }
+ void selected(char b) { mSelected = b; }
+ int includes(int pos, int lineStartPos, int dispIndex);
+ int position(int* start, int* end);
+ int position(int* start, int* end, int* isRect, int* rectStart, int* rectEnd);
+
+
+ protected:
+ char mSelected;
+ char mRectangular;
+ int mStart;
+ int mEnd;
+ int mRectStart;
+ int mRectEnd;
+};
+
+typedef void (*Fl_Text_Modify_Cb)(int pos, int nInserted, int nDeleted,
+ int nRestyled, const char* deletedText,
+ void* cbArg);
+
+class FL_API Fl_Text_Buffer {
+ public:
+ Fl_Text_Buffer(int requestedSize = 0);
+ ~Fl_Text_Buffer();
+
+ int length() { return mLength; }
+ const char* text();
+ void text(const char* text);
+ const char* text_range(int start, int end);
+ char character(int pos);
+ const char* text_in_rectangle(int start, int end, int rectStart, int rectEnd);
+ void insert(int pos, const char* text);
+ void append(const char* text) { insert(length(), text); }
+ void remove(int start, int end);
+ void replace(int start, int end, const char *text);
+ void copy(Fl_Text_Buffer* fromBuf, int fromStart, int fromEnd, int toPos);
+ int insertfile(const char *file, int pos, int buflen = 128*1024);
+ int appendfile(const char *file, int buflen = 128*1024)
+ { return insertfile(file, length(), buflen); }
+ int loadfile(const char *file, int buflen = 128*1024)
+ { select(0, length()); remove_selection(); return appendfile(file, buflen); }
+ int outputfile(const char *file, int start, int end, int buflen = 128*1024);
+ int savefile(const char *file, int buflen = 128*1024)
+ { return outputfile(file, 0, length(), buflen); }
+
+ void insert_column(int column, int startPos, const char* text,
+ int* charsInserted, int* charsDeleted);
+
+ void replace_rectangular(int start, int end, int rectStart, int rectEnd,
+ const char* text);
+
+ void overlay_rectangular(int startPos, int rectStart, int rectEnd,
+ const char* text, int* charsInserted,
+ int* charsDeleted);
+
+ void remove_rectangular(int start, int end, int rectStart, int rectEnd);
+ void clear_rectangular(int start, int end, int rectStart, int rectEnd);
+ int tab_distance() { return mTabDist; }
+ void tab_distance(int tabDist);
+ void select(int start, int end);
+ int selected() { return mPrimary.selected(); }
+ void unselect();
+ void select_rectangular(int start, int end, int rectStart, int rectEnd);
+ int selection_position(int* start, int* end);
+
+ int selection_position(int* start, int* end, int* isRect, int* rectStart,
+ int* rectEnd);
+
+ const char* selection_text();
+ void remove_selection();
+ void replace_selection(const char* text);
+ void secondary_select(int start, int end);
+ void secondary_unselect();
+
+ void secondary_select_rectangular(int start, int end, int rectStart,
+ int rectEnd);
+
+ int secondary_selection_position(int* start, int* end, int* isRect,
+ int* rectStart, int* rectEnd);
+
+ const char* secondary_selection_text();
+ void remove_secondary_selection();
+ void replace_secondary_selection(const char* text);
+ void highlight(int start, int end);
+ void unhighlight();
+ void highlight_rectangular(int start, int end, int rectStart, int rectEnd);
+
+ int highlight_position(int* start, int* end, int* isRect, int* rectStart,
+ int* rectEnd);
+
+ const char* highlight_text();
+ void add_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, void* cbArg);
+ void remove_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, void* cbArg);
+
+ void call_modify_callbacks() { call_modify_callbacks(0, 0, 0, 0, 0); }
+
+ const char* line_text(int pos);
+ int line_start(int pos);
+ int line_end(int pos);
+ int word_start(int pos);
+ int word_end(int pos);
+ int expand_character(int pos, int indent, char *outStr);
+
+ static int expand_character(char c, int indent, char* outStr, int tabDist,
+ char nullSubsChar);
+
+ static int character_width(char c, int indent, int tabDist, char nullSubsChar);
+ int count_displayed_characters(int lineStartPos, int targetPos);
+ int skip_displayed_characters(int lineStartPos, int nChars);
+ int count_lines(int startPos, int endPos);
+ int skip_lines(int startPos, int nLines);
+ int rewind_lines(int startPos, int nLines);
+ int findchar_forward(int startPos, char searchChar, int* foundPos);
+ int findchar_backward(int startPos, char searchChar, int* foundPos);
+ int findchars_forward(int startPos, const char* searchChars, int* foundPos);
+ int findchars_backward(int startPos, const char* searchChars, int* foundPos);
+
+ int search_forward(int startPos, const char* searchString, int* foundPos,
+ int matchCase = 0);
+
+ int search_backward(int startPos, const char* searchString, int* foundPos,
+ int matchCase = 0);
+
+ int substitute_null_characters(char* string, int length);
+ void unsubstitute_null_characters(char* string);
+ char null_substitution_character() { return mNullSubsChar; }
+ Fl_Text_Selection* primary_selection() { return &mPrimary; }
+ Fl_Text_Selection* secondary_selection() { return &mSecondary; }
+ Fl_Text_Selection* highlight_selection() { return &mHighlight; }
+
+ protected:
+ void call_modify_callbacks(int pos, int nDeleted, int nInserted,
+ int nRestyled, const char* deletedText);
+
+ int insert_(int pos, const char* text);
+ void remove_(int start, int end);
+
+ void remove_rectangular_(int start, int end, int rectStart, int rectEnd,
+ int* replaceLen, int* endPos);
+
+ void insert_column_(int column, int startPos, const char* insText,
+ int* nDeleted, int* nInserted, int* endPos);
+
+ void overlay_rectangular_(int startPos, int rectStart, int rectEnd,
+ const char* insText, int* nDeleted,
+ int* nInserted, int* endPos);
+
+ void redisplay_selection(Fl_Text_Selection* oldSelection,
+ Fl_Text_Selection* newSelection);
+
+ void move_gap(int pos);
+ void reallocate_with_gap(int newGapStart, int newGapLen);
+ const char* selection_text_(Fl_Text_Selection* sel);
+ void remove_selection_(Fl_Text_Selection* sel);
+ void replace_selection_(Fl_Text_Selection* sel, const char* text);
+
+ void rectangular_selection_boundaries(int lineStartPos, int rectStart,
+ int rectEnd, int* selStart,
+ int* selEnd);
+
+ void update_selections(int pos, int nDeleted, int nInserted);
+
+ Fl_Text_Selection mPrimary; /* highlighted areas */
+ Fl_Text_Selection mSecondary;
+ Fl_Text_Selection mHighlight;
+ int mLength; /* length of the text in the buffer (the length
+ of the buffer itself must be calculated:
+ gapEnd - gapStart + length) */
+ char* mBuf; /* allocated memory where the text is stored */
+ int mGapStart; /* points to the first character of the gap */
+ int mGapEnd; /* points to the first char after the gap */
+ // 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 */
+ mNodifyProcs; /* modified to redisplay contents */
+ void** mCbArgs; /* caller arguments for modifyProcs above */
+ int mCursorPosHint; /* hint for reasonable cursor position after
+ a buffer modification operation */
+ char mNullSubsChar; /* NEdit is based on C null-terminated strings,
+ so ascii-nul characters must be substituted
+ with something else. This is the else, but
+ of course, things get quite messy when you
+ use it */
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Text_Buffer.H,v 1.3 2001/02/21 06:15:44 clip Exp $".
+//
diff --git a/FL/Fl_Text_Display.H b/FL/Fl_Text_Display.H
new file mode 100644
index 000000000..af9d3df0b
--- /dev/null
+++ b/FL/Fl_Text_Display.H
@@ -0,0 +1,217 @@
+//
+// "$Id: Fl_Text_Display.H,v 1.4 2000/08/20 04:31:36 spitzak Exp $"
+//
+// Header file for Fl_Text_Display class.
+//
+// Copyright Mark Edel. Permission to distribute under the LGPL for
+// the FLTK library granted by Mark Edel.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to "fltk-bugs@fltk.org".
+//
+
+#ifndef FL_TEXT_DISPLAY_H
+#define FL_TEXT_DISPLAY_H
+
+#include
+#include
+#include
+#include
+#include
+
+class FL_API Fl_Text_Display: public Fl_Group {
+ public:
+ 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)();
+
+ struct FL_API Style_Table_Entry {
+ Fl_Color color;
+ Fl_Font font;
+ int size;
+ };
+
+ 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);
+ void buffer(Fl_Text_Buffer& buf) { buffer(&buf); }
+ Fl_Text_Buffer* buffer() { 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);
+ int insert_position() { return mCursorPos; }
+ int in_selection(int x, int y);
+ void show_insert_position();
+ int move_right();
+ int move_left();
+ int move_up();
+ int move_down();
+ void next_word(void);
+ void previous_word(void);
+ void show_cursor(int b = 1);
+ void hide_cursor() { show_cursor(0); }
+ void cursor_style(int style);
+ int scrollbar_width() { return scrollbar_width_; }
+ Fl_Flags scrollbar_align() { return scrollbar_align_; }
+ void scrollbar_width(int w) { scrollbar_width_ = w; }
+ void scrollbar_align(Fl_Flags a) { scrollbar_align_ = a; }
+ int word_start(int pos) { return buffer()->word_start(pos); }
+ int word_end(int pos) { return buffer()->word_end(pos); }
+
+ void highlight_data(Fl_Text_Buffer *styleBuffer,
+ 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);
+
+ protected:
+ // Most (all?) of this stuff should only be called from layout() or
+ // draw().
+ // Anything with "vline" indicates thats it deals with currently
+ // visible lines.
+ virtual void layout();
+
+ 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 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 );
+ int string_width(const char* string, int length, int style);
+
+ 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);
+ int longest_vline();
+ int empty_vlines();
+ int vline_length(int visLineNum);
+ int xy_to_position(int x, int y, int PosType = CHARACTER_POS);
+
+ void xy_to_rowcol(int x, int y, int* row, int* column,
+ int PosType = CHARACTER_POS);
+
+ int position_to_xy(int pos, int* x, int* y);
+ int position_to_linecol(int pos, int* lineNum, int* column);
+ void scroll_(int topLineNum, int horizOffset);
+
+ void extend_range_for_styles(int* start, int* end);
+
+
+ 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* mLineStarts;
+ int mTopLineNum; /* Line number of top displayed line
+ of file (first line of file is 1) */
+ 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 mVisibility; /* Window visibility (see XVisibility
+ event) */
+ int mNStyles; /* Number of entries in styleTable */
+ 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 */
+
+ Fl_Color mCursor_color;
+
+ Fl_Scrollbar* mHScrollBar;
+ Fl_Scrollbar* mVScrollBar;
+ int scrollbar_width_;
+ Fl_Flags scrollbar_align_;
+ int dragPos, dragType, dragging;
+ int display_insert_position_hint;
+ struct { int x, y, w, h; } text_area;
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Text_Display.H,v 1.4 2000/08/20 04:31:36 spitzak Exp $".
+//
diff --git a/FL/Fl_Text_Editor.H b/FL/Fl_Text_Editor.H
new file mode 100644
index 000000000..980a7fb84
--- /dev/null
+++ b/FL/Fl_Text_Editor.H
@@ -0,0 +1,105 @@
+//
+// "$Id: Fl_Text_Editor.H,v 1.1 2000/08/04 10:21:59 clip Exp $"
+//
+// Header file for Fl_Text_Editor class.
+//
+// Copyright Mark Edel. Permission to distribute under the LGPL for
+// the FLTK library granted by Mark Edel.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to "fltk-bugs@fltk.org".
+//
+
+
+#ifndef FL_TEXT_EDITOR_H
+#define FL_TEXT_EDITOR_H
+
+#include
+
+// key will match in any state
+#define FL_TEXT_EDITOR_ANY_STATE (-1L)
+
+class FL_API Fl_Text_Editor : public Fl_Text_Display {
+ public:
+ typedef int (*Key_Func)(int key, Fl_Text_Editor* editor);
+
+ struct FL_API Key_Binding {
+ int key;
+ int state;
+ Key_Func function;
+ Key_Binding* next;
+ };
+
+ Fl_Text_Editor(int X, int Y, int W, int H, const char* l = 0);
+ ~Fl_Text_Editor() { remove_all_key_bindings(); }
+ virtual int handle(int e);
+ void insert_mode(int b) { insert_mode_ = b; }
+ int insert_mode() { return insert_mode_; }
+
+ void add_key_binding(int key, int state, Key_Func f, Key_Binding** list);
+ void add_key_binding(int key, int state, Key_Func f)
+ { add_key_binding(key, state, f, &key_bindings); }
+ void remove_key_binding(int key, int state, Key_Binding** list);
+ void remove_key_binding(int key, int state)
+ { remove_key_binding(key, state, &key_bindings); }
+ void remove_all_key_bindings(Key_Binding** list);
+ void remove_all_key_bindings() { remove_all_key_bindings(&key_bindings); }
+ void add_default_key_bindings(Key_Binding** list);
+ Key_Func bound_key_function(int key, int state, Key_Binding* list);
+ Key_Func bound_key_function(int key, int state)
+ { return bound_key_function(key, state, key_bindings); }
+ void default_key_function(Key_Func f) { default_key_function_ = f; }
+
+ // functions for the built in default bindings
+ static int kf_default(int c, Fl_Text_Editor* e);
+ static int kf_ignore(int c, Fl_Text_Editor* e);
+ static int kf_backspace(int c, Fl_Text_Editor* e);
+ static int kf_enter(int c, Fl_Text_Editor* e);
+ static int kf_move(int c, Fl_Text_Editor* e);
+ static int kf_shift_move(int c, Fl_Text_Editor* e);
+ static int kf_ctrl_move(int c, Fl_Text_Editor* e);
+ static int kf_c_s_move(int c, Fl_Text_Editor* e);
+ static int kf_home(int, Fl_Text_Editor* e);
+ static int kf_end(int c, Fl_Text_Editor* e);
+ static int kf_left(int c, Fl_Text_Editor* e);
+ static int kf_up(int c, Fl_Text_Editor* e);
+ static int kf_right(int c, Fl_Text_Editor* e);
+ static int kf_down(int c, Fl_Text_Editor* e);
+ static int kf_page_up(int c, Fl_Text_Editor* e);
+ static int kf_page_down(int c, Fl_Text_Editor* e);
+ static int kf_insert(int c, Fl_Text_Editor* e);
+ static int kf_delete(int c, Fl_Text_Editor* e);
+ static int kf_copy(int c, Fl_Text_Editor* e);
+ static int kf_cut(int c, Fl_Text_Editor* e);
+ static int kf_paste(int c, Fl_Text_Editor* e);
+ static int kf_select_all(int c, Fl_Text_Editor* e);
+
+ protected:
+ int handle_key();
+
+ int insert_mode_;
+ Key_Binding* key_bindings;
+ static Key_Binding* global_key_bindings;
+ Key_Func default_key_function_;
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Text_Editor.H,v 1.1 2000/08/04 10:21:59 clip Exp $".
+//
+
diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H
new file mode 100644
index 000000000..054c16786
--- /dev/null
+++ b/FL/Fl_Tooltip.H
@@ -0,0 +1,72 @@
+//
+// "$Id: Fl_Tooltip.H,v 1.16 2001/02/25 01:41:19 clip Exp $"
+//
+// Tooltip definitions for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-1999 by Bill Spitzak and others.
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+//
+// Please report all bugs and problems to "fltk-bugs@easysw.com".
+//
+
+#ifndef _FL_TOOLTIP_H_
+#define _FL_TOOLTIP_H_
+
+#include
+#include
+
+class FL_API Fl_Tooltip {
+public:
+ static float delay() { return delay_; }
+ static void delay(float f) { delay_ = f; }
+ static int enabled() { return enabled_; }
+ static void enable(int b = 1) { enabled_ = b; }
+ static void disable() { enable(0); }
+
+ // This is called when the pointer enters a widget,
+ // Also enter(0) gets rid of any displayed or pending tooltip:
+ static void (*enter)(Fl_Widget* w);
+
+ // A widget may also pop up tooltips for internal parts by calling this:
+ static void (*enter_area)(Fl_Widget* w, int X, int Y, int W, int H, const char* tip);
+
+ // This is called when a widget is destroyed or hidden:
+ static void (*exit)(Fl_Widget *w);
+
+ static Fl_Style* style() { return default_style; }
+ static Fl_Font font() { return style()->label_font; }
+ static void font(Fl_Font i) { style()->label_font = i; }
+ static unsigned size() { return style()->label_size; }
+ static void size(unsigned s) { style()->label_size = s; }
+ static void color(Fl_Color c) { style()->color = c; }
+ static Fl_Color color() { return style()->color; }
+ static void textcolor(Fl_Color c) {style()->label_color = c; }
+ static Fl_Color textcolor() { return style()->label_color; }
+ static void boxtype(Fl_Boxtype b) {style()->box = b; }
+ static Fl_Boxtype boxtype() { return style()->box; }
+
+private:
+ static Fl_Named_Style* default_style;
+ static float delay_;
+ static int enabled_;
+};
+
+#endif
+
+//
+// End of "$Id: Fl_Tooltip.H,v 1.16 2001/02/25 01:41:19 clip Exp $".
+//
diff --git a/documentation/Fl_Image.html b/documentation/Fl_Image.html
new file mode 100644
index 000000000..1287a6113
--- /dev/null
+++ b/documentation/Fl_Image.html
@@ -0,0 +1,142 @@
+Fl_Image
+
+class Fl_Image
+
+This class holds an image, normally used to label a widget. The
+subclasses define how the data is interpreted, and usually store
+server-side cached versions of the image. All the current types
+define pixel arrays, but other types of images, such as vector
+graphics, can be defined.
+
+Methods
+
+ulong id, mask;
+void _draw(int X, int Y, int W, int H, int cx, int cy);
+
+Subclasses may use these protected members of the base class to
+draw a cached pixel array. They must first set id and
+mask to the color and transparency offscreen windows, using
+system-specific code. Then they can call _draw() to draw
+them.
+
+int w,h
+
+These members hold the width and height of the image. They are not
+correct until measure() is called. These are public instance
+variables for back comptability, but you should never set them.
+
+virtual void Fl_Image::measure(int W, int H);
+
+Measure how big the image will be if it is drawn inside a W,H
+rectangle and put the result into w,h. For most image types this does
+nothing and w,h are set by the constructor. This may be used to
+initialize the scaling for variable-sized images.
+
+virtual void Fl_Image::draw(int x,int y,int w,int h, int cx,int
+cy);
+
+Draw the image so the point cx,cy of the image is at
+x,y. The image may be scaled or clipped to fit in the w,h
+rectangle, but this is not necessary (although obeying the current
+fl_clip value is!).
+
+void Fl_Image::draw(int x,int y,int w,int h, Fl_Flags align);
+
+This non-virtual function uses measure() and the
+align flags to figure out cx,cy and call the normal draw
+function. This allows you to center or align any edge of the image
+with a bounding box.
+
+virtual Fl_Image::~Fl_Image();
+
+The destructor throws away any server-cached information, but in most
+cases does not destroy the local data passed to a constructor.
+
+
+ This object encapsulates the width, height, and bits of an X bitmap
+(XBM), and allows you to make an Fl_Widget use a bitmap as a
+label, or to just draw the bitmap directly.
+
+Fl_Bitmap(const char *bits, int W, int H)
+
Fl_Bitmap(const uchar *bits, int W, int H)
+Construct using an X bitmap. The bits pointer is simply copied to the
+object, so it must point at persistent storage. The two constructors
+are provided because various X implementations disagree about the type
+of bitmap data. To use an XBM file use:
+
+#include "foo.xbm"
+...
+Fl_Bitmap bitmap = new Fl_Bitmap(foo_bits, foo_width, foo_height);
+
+
+~Fl_Bitmap()
+ The destructor will destroy any X pixmap created. It does not do
+anything to the bits data.
+void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)
+1 bits are drawn with the current color, 0 bits
+are unchanged.
+The image is clipped to the destination rectangle: the area
+ox,oy,w,h is copied to x,y,w,h.
+void draw(int x, int y)
+Draws the bitmap with the upper-left corner at x,y. This is
+the same as doing draw(x,y,this->w,this->h,0,0).
+
+
+
+This object encapsulates the data from an XPM image, and allows you to
+make an Fl_Widget use a pixmap as a label, or to just draw
+the pixmap directly.
+
+Fl_Pixmap(char *const* data)
+ Construct using XPM data. The data pointer is simply copied to the
+object, so it must point at persistent storage. To use an XPM file do:
+
+#include <fltk/Fl_Pixmap.h>
+#include "foo.xpm"
+...
+Fl_Pixmap pixmap = new Fl_Pixmap(foo);
+
+
+~Fl_Pixmap()
+ The destructor will destroy any X pixmap created. It does not do
+anything to the data.
+
+void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)
+The image is clipped to the destination rectangle: the area
+ox,oy,w,h is copied to x,y,w,h. The current
+implementation converts the pixmap to 24-bit RGB data and uses fl_draw_image() to draw it. Thus you
+will get dithered colors on an 8 bit screen.
+
+void draw(int x, int y)
+ Draws the image with the upper-left corner at x,y. This is
+the same as doing draw(x,y,this->w,this->h,0,0).
+
+
+
+This object encapsulates a full-color RGB image, and allows you to
+make an Fl_Widget use an image as a label, or to just draw the
+image directly.
+
+Fl_RGB_Image(const uchar *data, int W, int H, int D = 3, int LD = 0)
+ Construct using a pointer to RGB data. W and H are
+the size of the image in pixels. D is the delta between pixels
+(it may be more than 3 to skip alpha or other data, or negative to flip
+the image left/right). LD is the delta between lines (it may
+be more than D * W to crop images, or negative to flip the
+image vertically). The data pointer is simply copied to the object, so
+it must point at persistent storage.
+~Fl_RGB_Image()
+ The destructor will destroy any X pixmap created. It does not do
+anything to the data.
+void draw(int x, int y, int w, int h, int ox = 0, int oy = 0)
+The image is clipped to the destination rectangle: the area
+ox,oy,w,h is copied to x,y,w,h.
+void draw(int x, int y)
+ Draws the image with the upper-left corner at x,y. This is
+the same as doing draw(x,y,this->w,this->h,0,0).
+
+