ZynAddSubFX/FLTK: updated to SVN revision 8805

Updated FLTK to SVN revision 8805 of branch-1.3.
(cherry picked from commit c2c315e11f)
This commit is contained in:
Tobias Doerffel
2011-06-16 00:04:24 +02:00
parent 56d7e2e6ec
commit b99d63eaf0
346 changed files with 22057 additions and 10836 deletions

View File

@@ -1,9 +1,9 @@
//
// "$Id: Enumerations.H 7476 2010-04-09 22:18:05Z matt $"
// "$Id: Enumerations.H 8710 2011-05-21 21:55:59Z manolo $"
//
// Enumerations for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -26,7 +26,7 @@
//
/** \file
* This file contains type definitions and general enumerations.
This file contains type definitions and general enumerations.
*/
#ifndef Fl_Enumerations_H
@@ -45,39 +45,35 @@
/*@{*/
/**
* The major release version of this FLTK library.
The major release version of this FLTK library.
\sa FL_VERSION
*/
#define FL_MAJOR_VERSION 1
/**
* The minor release version for this library.
*
* FLTK remains mostly source-code compatible between minor version changes.
The minor release version for this library.
FLTK remains mostly source-code compatible between minor version changes.
*/
#define FL_MINOR_VERSION 3
/**
* The patch version for this library.
*
* FLTK remains binary compatible between patches.
The patch version for this library.
FLTK remains binary compatible between patches.
*/
#define FL_PATCH_VERSION 0
/**
* The FLTK version number as a \em double.
*
* This is changed slightly from the beta versions
* because the old "const double" definition would not allow for conditional
* compilation...
*
* FL_VERSION is a double that describes the major and minor version numbers.
* Version 1.1 is actually stored as 1.01 to allow for more than 9 minor
* releases.
*
* The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants
* give the integral values for the major, minor, and patch releases
* respectively.
The FLTK version number as a \em double.
FL_VERSION is a double that describes the major and minor version numbers.
Version 1.1 is actually stored as 1.01 to allow for more than 9 minor
releases.
The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants
give the integral values for the major, minor, and patch releases
respectively.
*/
#define FL_VERSION ((double)FL_MAJOR_VERSION + \
(double)FL_MINOR_VERSION * 0.01 + \
@@ -86,203 +82,205 @@
/*@}*/ // group: Version Numbers
/**
* Every time a user moves the mouse pointer, clicks a button,
* or presses a key, an event is generated and sent to your
* application. Events can also come from other programs like the
* window manager.
*
* Events are identified by the integer argument passed to the
* Fl_Widget::handle() virtual method. Other information about the
* most recent event is stored in static locations and acquired by
* calling the Fl::event_*() methods. This static information remains
* valid until the next event is read from the window system, so it
* is ok to look at it outside of the handle() method.
*
* \sa Fl::event_text(), Fl::event_key(), class Fl::
Every time a user moves the mouse pointer, clicks a button,
or presses a key, an event is generated and sent to your
application. Events can also come from other programs like the
window manager.
Events are identified by the integer argument passed to the
Fl_Widget::handle() virtual method. Other information about the
most recent event is stored in static locations and acquired by
calling the Fl::event_*() methods. This static information remains
valid until the next event is read from the window system, so it
is ok to look at it outside of the handle() method.
\sa Fl::event_text(), Fl::event_key(), class Fl::
*/
enum Fl_Event { // events
/** No event. */
FL_NO_EVENT = 0,
/** A mouse button has gone down with the mouse pointing at this
* widget. You can find out what button by calling Fl::event_button().
* You find out the mouse position by calling Fl::event_x() and
* Fl::event_y().
*
* A widget indicates that it "wants" the mouse click by returning non-zero
* from its Fl_Widget::handle() method. It will then become the
* Fl::pushed() widget and will get FL_DRAG and the matching FL_RELEASE events.
* If Fl_Widget::handle() returns zero then FLTK will try sending the FL_PUSH
* to another widget.
widget. You can find out what button by calling Fl::event_button().
You find out the mouse position by calling Fl::event_x() and
Fl::event_y().
A widget indicates that it "wants" the mouse click by returning non-zero
from its Fl_Widget::handle() method. It will then become the
Fl::pushed() widget and will get FL_DRAG and the matching FL_RELEASE events.
If Fl_Widget::handle() returns zero then FLTK will try sending the FL_PUSH
to another widget.
*/
FL_PUSH = 1,
/** A mouse button has been released. You can find out what button by
* calling Fl::event_button().
*
* In order to receive the FL_RELEASE event, the widget must return
* non-zero when handling FL_PUSH.
calling Fl::event_button().
In order to receive the FL_RELEASE event, the widget must return
non-zero when handling FL_PUSH.
*/
FL_RELEASE = 2,
/** The mouse has been moved to point at this widget. This can
* be used for highlighting feedback. If a widget wants to
* highlight or otherwise track the mouse, it indicates this by
* returning non-zero from its handle() method. It then
* becomes the Fl::belowmouse() widget and will receive
* FL_MOVE and FL_LEAVE events.
be used for highlighting feedback. If a widget wants to
highlight or otherwise track the mouse, it indicates this by
returning non-zero from its handle() method. It then
becomes the Fl::belowmouse() widget and will receive
FL_MOVE and FL_LEAVE events.
*/
FL_ENTER = 3,
/** The mouse has moved out of the widget.
* In order to receive the FL_LEAVE event, the widget must
* return non-zero when handling FL_ENTER.
In order to receive the FL_LEAVE event, the widget must
return non-zero when handling FL_ENTER.
*/
FL_LEAVE = 4,
/** The mouse has moved with a button held down. The current button state
* is in Fl::event_state(). The mouse position is in Fl::event_x() and
* Fl::event_y().
*
* In order to receive FL_DRAG events, the widget must return non-zero
* when handling FL_PUSH.
is in Fl::event_state(). The mouse position is in Fl::event_x() and
Fl::event_y().
In order to receive FL_DRAG events, the widget must return non-zero
when handling FL_PUSH.
*/
FL_DRAG = 5,
/** This indicates an <I>attempt</I> to give a widget the keyboard focus.
*
* If a widget wants the focus, it should change itself to display the
* fact that it has the focus, and return non-zero from its handle() method.
* It then becomes the Fl::focus() widget and gets FL_KEYDOWN, FL_KEYUP,
* and FL_UNFOCUS events.
*
* The focus will change either because the window manager changed which
* window gets the focus, or because the user tried to navigate using tab,
* arrows, or other keys. You can check Fl::event_key() to figure out why
* it moved. For navigation it will be the key pressed and interaction
* with the window manager it will be zero.
If a widget wants the focus, it should change itself to display the
fact that it has the focus, and return non-zero from its handle() method.
It then becomes the Fl::focus() widget and gets FL_KEYDOWN, FL_KEYUP,
and FL_UNFOCUS events.
The focus will change either because the window manager changed which
window gets the focus, or because the user tried to navigate using tab,
arrows, or other keys. You can check Fl::event_key() to figure out why
it moved. For navigation it will be the key pressed and for interaction
with the window manager it will be zero.
*/
FL_FOCUS = 6,
/** This event is sent to the previous Fl::focus() widget when another
* widget gets the focus or the window loses focus.
widget gets the focus or the window loses focus.
*/
FL_UNFOCUS = 7,
/** A key was pressed or released. The key can be found in Fl::event_key().
* The text that the key should insert can be found with Fl::event_text()
* and its length is in Fl::event_length(). If you use the key handle()
* should return 1. If you return zero then FLTK assumes you ignored the
* key and will then attempt to send it to a parent widget. If none of
* them want it, it will change the event into a FL_SHORTCUT event.
*
* To receive FL_KEYBOARD events you must also respond to the FL_FOCUS
* and FL_UNFOCUS events.
*
* If you are writing a text-editing widget you may also want to call
* the Fl::compose() function to translate individual keystrokes into
* foreign characters.
*
* FL_KEYUP events are sent to the widget that currently has focus. This
* is not necessarily the same widget that received the corresponding
* FL_KEYDOWN event because focus may have changed between events.
/** A key was pressed (FL_KEYDOWN) or released (FL_KEYUP).
Fl_KEYBOARD is a synonym for FL_KEYDOWN.
The key can be found in Fl::event_key().
The text that the key should insert can be found with Fl::event_text()
and its length is in Fl::event_length(). If you use the key handle()
should return 1. If you return zero then FLTK assumes you ignored the
key and will then attempt to send it to a parent widget. If none of
them want it, it will change the event into a FL_SHORTCUT event.
To receive FL_KEYBOARD events you must also respond to the FL_FOCUS
and FL_UNFOCUS events.
If you are writing a text-editing widget you may also want to call
the Fl::compose() function to translate individual keystrokes into
non-ASCII characters.
FL_KEYUP events are sent to the widget that currently has focus. This
is not necessarily the same widget that received the corresponding
FL_KEYDOWN event because focus may have changed between events.
*/
FL_KEYDOWN = 8,
/** Equvalent to FL_KEYDOWN.
* \see FL_KEYDOWN
/** Equivalent to FL_KEYDOWN.
\see FL_KEYDOWN
*/
FL_KEYBOARD = 8,
/** Key release event.
* \see FL_KEYDOWN
\see FL_KEYDOWN
*/
FL_KEYUP = 9,
/** The user clicked the close button of a window.
* This event is used internally only to trigger the callback of
* Fl_Window derived classed. The default callback closes the
* window calling Fl_Window::hide().
This event is used internally only to trigger the callback of
Fl_Window derived classed. The default callback closes the
window calling Fl_Window::hide().
*/
FL_CLOSE = 10,
/** The mouse has moved without any mouse buttons held down.
* This event is sent to the Fl::belowmouse() widget.
*
* In order to receive FL_MOVE events, the widget must return
* non-zero when handling FL_ENTER.
This event is sent to the Fl::belowmouse() widget.
In order to receive FL_MOVE events, the widget must return
non-zero when handling FL_ENTER.
*/
FL_MOVE = 11,
/** If the Fl::focus() widget is zero or ignores an FL_KEYBOARD
* event then FLTK tries sending this event to every widget it
* can, until one of them returns non-zero. FL_SHORTCUT is first
* sent to the Fl::belowmouse() widget, then its parents and siblings,
* and eventually to every widget in the window, trying to find an
* object that returns non-zero. FLTK tries really hard to not to ignore
* any keystrokes!
*
* You can also make "global" shortcuts by using Fl::add_handler(). A
* global shortcut will work no matter what windows are displayed or
* which one has the focus.
event then FLTK tries sending this event to every widget it
can, until one of them returns non-zero. FL_SHORTCUT is first
sent to the Fl::belowmouse() widget, then its parents and siblings,
and eventually to every widget in the window, trying to find an
object that returns non-zero. FLTK tries really hard to not to ignore
any keystrokes!
You can also make "global" shortcuts by using Fl::add_handler(). A
global shortcut will work no matter what windows are displayed or
which one has the focus.
*/
FL_SHORTCUT = 12,
/** This widget is no longer active, due to Fl_Widget::deactivate()
* being called on it or one of its parents. Fl_Widget::active() may
* still be true after this, the widget is only active if Fl_Widget::active()
* is true on it and all its parents (use Fl_Widget::active_r() to check this).
being called on it or one of its parents. Fl_Widget::active() may
still be true after this, the widget is only active if Fl_Widget::active()
is true on it and all its parents (use Fl_Widget::active_r() to check this).
*/
FL_DEACTIVATE = 13,
/** This widget is now active, due to Fl_Widget::activate() being
* called on it or one of its parents.
called on it or one of its parents.
*/
FL_ACTIVATE = 14,
/** This widget is no longer visible, due to Fl_Widget::hide() being
* called on it or one of its parents, or due to a parent window being
* minimized. Fl_Widget::visible() may still be true after this, but the
* widget is visible only if visible() is true for it and all its
* parents (use Fl_Widget::visible_r() to check this).
called on it or one of its parents, or due to a parent window being
minimized. Fl_Widget::visible() may still be true after this, but the
widget is visible only if visible() is true for it and all its
parents (use Fl_Widget::visible_r() to check this).
*/
FL_HIDE = 15,
/** This widget is visible again, due to Fl_Widget::show() being called on
* it or one of its parents, or due to a parent window being restored.
* Child Fl_Windows respond to this by actually creating the window if not
* done already, so if you subclass a window, be sure to pass FL_SHOW
* to the base class Fl_Widget::handle() method!
it or one of its parents, or due to a parent window being restored.
Child Fl_Windows respond to this by actually creating the window if not
done already, so if you subclass a window, be sure to pass FL_SHOW
to the base class Fl_Widget::handle() method!
*/
FL_SHOW = 16,
/** You should get this event some time after you call Fl::paste().
* The contents of Fl::event_text() is the text to insert and the number
* of characters is in Fl::event_length().
The contents of Fl::event_text() is the text to insert and the number
of characters is in Fl::event_length().
*/
FL_PASTE = 17,
/** The Fl::selection_owner() will get this event before the selection is
* moved to another widget. This indicates that some other widget or program
* has claimed the selection. Motif programs used this to clear the selection
* indication. Most modern programs ignore this.
moved to another widget. This indicates that some other widget or program
has claimed the selection. Motif programs used this to clear the selection
indication. Most modern programs ignore this.
*/
FL_SELECTIONCLEAR = 18,
/** The user has moved the mouse wheel. The Fl::event_dx() and Fl::event_dy()
* methods can be used to find the amount to scroll horizontally and vertically.
methods can be used to find the amount to scroll horizontally and vertically.
*/
FL_MOUSEWHEEL = 19,
/** The mouse has been moved to point at this widget. A widget that is
* interested in receiving drag'n'drop data must return 1 to receive
* FL_DND_DRAG, FL_DND_LEAVE and FL_DND_RELEASE events.
interested in receiving drag'n'drop data must return 1 to receive
FL_DND_DRAG, FL_DND_LEAVE and FL_DND_RELEASE events.
*/
FL_DND_ENTER = 20,
/** The mouse has been moved inside a widget while dragging data. A
* widget that is interested in receiving drag'n'drop data should
* indicate the possible drop position.
widget that is interested in receiving drag'n'drop data should
indicate the possible drop position.
*/
FL_DND_DRAG = 21,
@@ -291,8 +289,8 @@ enum Fl_Event { // events
FL_DND_LEAVE = 22,
/** The user has released the mouse button dropping data into the widget.
* If the widget returns 1, it will receive the data in the immediately
* following FL_PASTE event.
If the widget returns 1, it will receive the data in the immediately
following FL_PASTE event.
*/
FL_DND_RELEASE = 23
};
@@ -300,9 +298,9 @@ enum Fl_Event { // events
/** \name When Conditions */
/*@{*/
/** These constants determine when a callback is performed.
*
* \sa Fl_Widget::when();
* \todo doxygen comments for values are incomplete and maybe wrong or unclear
\sa Fl_Widget::when();
\todo doxygen comments for values are incomplete and maybe wrong or unclear
*/
enum Fl_When { // Fl_Widget::when():
FL_WHEN_NEVER = 0, ///< Never call the callback
@@ -368,6 +366,27 @@ enum Fl_When { // Fl_Widget::when():
#define FL_Alt_R 0xffea ///< The right alt key.
#define FL_Delete 0xffff ///< The delete key.
// These use the Private Use Area (PUA) of the Basic Multilingual Plane
// of Unicode. Guaranteed not to conflict with a proper Unicode character.
// These primarily map to the XFree86 keysym range
#define FL_Volume_Down 0xEF11 /* Volume control down */
#define FL_Volume_Mute 0xEF12 /* Mute sound from the system */
#define FL_Volume_Up 0xEF13 /* Volume control up */
#define FL_Media_Play 0xEF14 /* Start playing of audio */
#define FL_Media_Stop 0xEF15 /* Stop playing audio */
#define FL_Media_Prev 0xEF16 /* Previous track */
#define FL_Media_Next 0xEF17 /* Next track */
#define FL_Home_Page 0xEF18 /* Display user's home page */
#define FL_Mail 0xEF19 /* Invoke user's mail program */
#define FL_Search 0xEF1B /* Search */
#define FL_Back 0xEF26 /* Like back on a browser */
#define FL_Forward 0xEF27 /* Like forward on a browser */
#define FL_Stop 0xEF28 /* Stop current operation */
#define FL_Refresh 0xEF29 /* Refresh the page */
#define FL_Sleep 0xEF2F /* Put system to sleep */
#define FL_Favorites 0xEF30 /* Show favorite locations */
/*@}*/ // group: Mouse and Keyboard Events
/** \name Mouse Buttons
@@ -412,15 +431,15 @@ enum Fl_When { // Fl_Widget::when():
#define FL_BUTTONS 0x7f000000 ///< Any mouse button is pushed
#define FL_BUTTON(n) (0x00800000<<(n)) ///< Mouse button n (n > 0) is pushed
#define FL_KEY_MASK 0x0000ffff ///< All keys are 16 bit for now
// FIXME: Unicode needs 24 bits!
#define FL_KEY_MASK 0x0000ffff ///< All keys are 16 bit for now
// FIXME: Unicode needs 24 bits!
#ifdef __APPLE__
# define FL_COMMAND FL_META ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
# define FL_CONTROL FL_CTRL ///< An alias for FL_META on WIN32 and X11, or FL_META on MacOS X
# define FL_COMMAND FL_META ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
# define FL_CONTROL FL_CTRL ///< An alias for FL_META on WIN32 and X11, or FL_CTRL on MacOS X
#else
# define FL_COMMAND FL_CTRL ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
# define FL_CONTROL FL_META ///< An alias for FL_META on WIN32 and X11, or FL_META on MacOS X
# define FL_CONTROL FL_META ///< An alias for FL_META on WIN32 and X11, or FL_CTRL on MacOS X
#endif // __APPLE__
/*@}*/ // group: Event States
@@ -435,8 +454,8 @@ enum Fl_When { // Fl_Widget::when():
leaving the interior unchanged. The blue color in Figure 1
is the area that is not drawn by the frame types.
\image html boxtypes.gif "Figure 1: FLTK standard box types"
\image latex boxtypes.eps "FLTK standard box types" width=10cm
\image html boxtypes.png "Figure 1: FLTK standard box types"
\image latex boxtypes.png "FLTK standard box types" width=10cm
\todo Description of boxtypes is incomplete.
See below for the defined enum Fl_Boxtype.
\see src/Fl_get_system_colors.cxx
@@ -542,24 +561,24 @@ extern FL_EXPORT Fl_Boxtype fl_define_FL_GTK_UP_BOX();
/**
Get the filled version of a frame.
If no filled version of a given frame exists, the behavior of this function
is undefined and some random box or frame is returned,
*/
is undefined and some random box or frame is returned.
*/
inline Fl_Boxtype fl_box(Fl_Boxtype b) {
return (Fl_Boxtype)((b<FL_UP_BOX||b%4>1)?b:(b-2));
}
/**
Get the "pressed" or "down" version of a box.
If no "down" version of a given box exists, the behavior of this function
is undefined and some random box or frame is returned,
*/
is undefined and some random box or frame is returned.
*/
inline Fl_Boxtype fl_down(Fl_Boxtype b) {
return (Fl_Boxtype)((b<FL_UP_BOX)?b:(b|1));
}
/**
Get the unfilled, frame only version of a box.
If no frame version of a given box exists, the behavior of this function
is undefined and some random box or frame is returned,
*/
is undefined and some random box or frame is returned.
*/
inline Fl_Boxtype fl_frame(Fl_Boxtype b) {
return (Fl_Boxtype)((b%4<2)?b:(b+2));
}
@@ -589,7 +608,7 @@ enum Fl_Labeltype { // labeltypes:
FL_NO_LABEL, ///< does nothing
_FL_SHADOW_LABEL, ///< draws a drop shadow under the text
_FL_ENGRAVED_LABEL, ///< draws edges as though the text is engraved
_FL_EMBOSSED_LABEL, ///< draws edges as thought the text is raised
_FL_EMBOSSED_LABEL, ///< draws edges as though the text is raised
_FL_MULTI_LABEL, ///< ?
_FL_ICON_LABEL, ///< draws the icon associated with the text
_FL_IMAGE_LABEL, ///< ?
@@ -598,7 +617,7 @@ enum Fl_Labeltype { // labeltypes:
};
/**
Sets the current label type end return its corresponding Fl_Labeltype value.
Sets the current label type and return its corresponding Fl_Labeltype value.
@{
*/
#define FL_SYMBOL_LABEL FL_NORMAL_LABEL
@@ -610,48 +629,48 @@ extern Fl_Labeltype FL_EXPORT fl_define_FL_EMBOSSED_LABEL();
#define FL_EMBOSSED_LABEL fl_define_FL_EMBOSSED_LABEL()
/** @} */
/** \name Alignment Flags */
/*@{*/
/** Flags to control the label alignment.
* This controls how the label is displayed next to or inside the widget.
* The default value is FL_ALIGN_CENTER for most widgets, which centers the label
* inside the widget.
*
* Flags can be or'd to achieve a combination of alignments.
*
* Outside alignments:
* \code
* TOP_LEFT TOP TOP_RIGHT
* LEFT_TOP+---------------------------------+RIGHT_TOP
* | |
* LEFT| |RIGHT
* | |
* LEFT_BOTTOM+---------------------------------+RIGHT_BOTTOM
* BOTTOM_RIGHT BOTTOM BOTTOM_LEFT
*
* Inside alignments:
* \code
* +---------------------------------+
* |TOP_LEFT TOP TOP_RIGHT|
* | |
* |LEFT RIGHT|
* | |
* |BOTTOM_RIGHT BOTTOM BOTTOM_LEFT|
* +---------------------------------+
* \endcode
* \see #FL_ALIGN_CENTER, etc.
/** \name Alignment Flags
Flags to control the label alignment.
This controls how the label is displayed next to or inside the widget.
The default value is FL_ALIGN_CENTER for most widgets, which centers the label
inside the widget.
Flags can be or'd to achieve a combination of alignments.
\code
Outside alignments:
TOP_LEFT TOP TOP_RIGHT
LEFT_TOP+---------------------------------+RIGHT_TOP
| |
LEFT| |RIGHT
| |
LEFT_BOTTOM+---------------------------------+RIGHT_BOTTOM
BOTTOM_RIGHT BOTTOM BOTTOM_LEFT
Inside alignments:
+---------------------------------+
|TOP_LEFT TOP TOP_RIGHT|
| |
|LEFT RIGHT|
| |
|BOTTOM_RIGHT BOTTOM BOTTOM_LEFT|
+---------------------------------+
\endcode
\see #FL_ALIGN_CENTER, etc.
*/
/*@{*/
/** FLTK type for alignment control */
typedef unsigned Fl_Align;
/** Align the label horizontally in the middle. */
const Fl_Align FL_ALIGN_CENTER = (Fl_Align)0;
/** Align the label at the top of the widget. Inside labels appear below the top,
* outside labels are drawn on top of the widget. */
outside labels are drawn on top of the widget. */
const Fl_Align FL_ALIGN_TOP = (Fl_Align)1;
/** Align the label at the bottom of the widget. */
const Fl_Align FL_ALIGN_BOTTOM = (Fl_Align)2;
/** Align the label at the left of the widget. Inside labels appear left-justified
* starting at the left side of the widget, outside labels are right-justified and
* drawn to the left of the widget. */
starting at the left side of the widget, outside labels are right-justified and
drawn to the left of the widget. */
const Fl_Align FL_ALIGN_LEFT = (Fl_Align)4;
/** Align the label to the right of the widget. */
const Fl_Align FL_ALIGN_RIGHT = (Fl_Align)8;
@@ -669,7 +688,7 @@ const Fl_Align FL_ALIGN_WRAP = (Fl_Align)128;
const Fl_Align FL_ALIGN_IMAGE_NEXT_TO_TEXT = (Fl_Align)0x0100;
/** If the label contains an image, draw the text to the left of the image. */
const Fl_Align FL_ALIGN_TEXT_NEXT_TO_IMAGE = (Fl_Align)0x0120;
/** If the label contains an image, draw the image or deimage in the backgroup. */
/** If the label contains an image, draw the image or deimage in the background. */
const Fl_Align FL_ALIGN_IMAGE_BACKDROP = (Fl_Align)0x0200;
const Fl_Align FL_ALIGN_TOP_LEFT = FL_ALIGN_TOP | FL_ALIGN_LEFT;
const Fl_Align FL_ALIGN_TOP_RIGHT = FL_ALIGN_TOP | FL_ALIGN_RIGHT;
@@ -679,23 +698,19 @@ const Fl_Align FL_ALIGN_LEFT_TOP = 0x0007; // magic value
const Fl_Align FL_ALIGN_RIGHT_TOP = 0x000b; // magic value
const Fl_Align FL_ALIGN_LEFT_BOTTOM = 0x000d; // magic value
const Fl_Align FL_ALIGN_RIGHT_BOTTOM = 0x000e; // magic value
const Fl_Align FL_ALIGN_NOWRAP = (Fl_Align)0; // for back compatability
const Fl_Align FL_ALIGN_NOWRAP = (Fl_Align)0; // for back compatibility
const Fl_Align FL_ALIGN_POSITION_MASK = 0x000f; // left, right, top, bottom
const Fl_Align FL_ALIGN_IMAGE_MASK = 0x0320; // l/r, t/b, backdrop
/*@}*/
/** \name Font Numbers */
/*@{*/
/** A font number is an index into the internal font table.
/** \name Font Numbers
The following constants define the standard FLTK fonts:
*/
/*@{*/
/** A font number is an index into the internal font table. */
typedef int Fl_Font;
// standard fonts
const Fl_Font FL_HELVETICA = 0; ///< Helvetica (or Arial) normal (0)
const Fl_Font FL_HELVETICA_BOLD = 1; ///< Helvetica (or Arial) bold
const Fl_Font FL_HELVETICA_ITALIC = 2; ///< Helvetica (or Arial) oblique
@@ -721,22 +736,21 @@ const Fl_Font FL_BOLD_ITALIC = 3; ///< add this to helvetica, courier
/*@}*/
/** Size of a font in pixels.
* This is the approximate height of a font in pixels.
This is the approximate height of a font in pixels.
*/
typedef int Fl_Fontsize;
extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size
/** \name Colors */
/*@{*/
/** The Fl_Color type holds an FLTK color value.
/** \name Colors
The Fl_Color type holds an FLTK color value.
Colors are either 8-bit indexes into a virtual colormap
or 24-bit RGB color values.
Color indices occupy the lower 8 bits of the value, while
RGB colors occupy the upper 24 bits, for a byte organization of RGBI.
<pre>
Fl_Color => 0xrrggbbii
| | | |
@@ -745,12 +759,13 @@ extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size
| +------- green component (8 bit)
+--------- red component (8 bit)
</pre>
A color can have either an index or an rgb value. Colors with rgb set
and an index >0 are reserved for special use.
*/
*/
/*@{*/
/** an FLTK color value */
typedef unsigned int Fl_Color;
// Standard colors. These are used as default colors in widgets and altered as necessary
@@ -762,14 +777,14 @@ const Fl_Color FL_SELECTION_COLOR = 15; ///< the default selection/highlight c
// boxtypes generally limit themselves to these colors so
// the whole ramp is not allocated:
const Fl_Color FL_GRAY0 = 32; // 'A'
const Fl_Color FL_DARK3 = 39; // 'H'
const Fl_Color FL_DARK2 = 45; // 'N'
const Fl_Color FL_DARK1 = 47; // 'P'
const Fl_Color FL_GRAY0 = 32; // 'A'
const Fl_Color FL_DARK3 = 39; // 'H'
const Fl_Color FL_DARK2 = 45; // 'N'
const Fl_Color FL_DARK1 = 47; // 'P'
const Fl_Color FL_BACKGROUND_COLOR = 49; // 'R' default background color
const Fl_Color FL_LIGHT1 = 50; // 'S'
const Fl_Color FL_LIGHT2 = 52; // 'U'
const Fl_Color FL_LIGHT3 = 54; // 'W'
const Fl_Color FL_LIGHT1 = 50; // 'S'
const Fl_Color FL_LIGHT2 = 52; // 'U'
const Fl_Color FL_LIGHT3 = 54; // 'W'
// FLTK provides a 5x8x5 color cube that is used with colormap visuals
@@ -807,74 +822,99 @@ FL_EXPORT Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg);
FL_EXPORT Fl_Color fl_color_average(Fl_Color c1, Fl_Color c2, float weight);
/** Returns a lighter version of the specified color. */
inline Fl_Color fl_lighter(Fl_Color c) { return fl_color_average(c, FL_WHITE, .67f); }
/** Returns a darker version of the specified color. */
inline Fl_Color fl_darker(Fl_Color c) { return fl_color_average(c, FL_BLACK, .67f); }
/** return 24-bit color value closest to \p r, \p g, \p b. */
/** Returns the 24-bit color value closest to \p r, \p g, \p b. */
inline Fl_Color fl_rgb_color(uchar r, uchar g, uchar b) {
if (!r && !g && !b) return FL_BLACK;
else return (Fl_Color)(((((r << 8) | g) << 8) | b) << 8);
}
/** return 24-bit color value closest to \p grayscale */
/** Returns the 24-bit color value closest to \p g (grayscale). */
inline Fl_Color fl_rgb_color(uchar g) {
if (!g) return FL_BLACK;
else return (Fl_Color)(((((g << 8) | g) << 8) | g) << 8);
}
/** Returns a gray color value from black (i == 0) to white (i == FL_NUM_GRAY - 1).
FL_NUM_GRAY is defined to be 24 in the current FLTK release.
To get the closest FLTK gray value to an 8-bit grayscale color 'I' use:
\code
fl_gray_ramp(I * (FL_NUM_GRAY - 1) / 255)
\endcode
*/
inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);}
/** Returns a color out of the color cube.
\p r must be in the range 0 to FL_NUM_RED (5) minus 1,
\p g must be in the range 0 to FL_NUM_GREEN (8) minus 1,
\p b must be in the range 0 to FL_NUM_BLUE (5) minus 1.
To get the closest color to a 8-bit set of R,G,B values use:
\code
fl_color_cube(R * (FL_NUM_RED - 1) / 255,
G * (FL_NUM_GREEN - 1) / 255,
B * (FL_NUM_BLUE - 1) / 255);
\endcode
*/
inline Fl_Color fl_color_cube(int r, int g, int b) {
return (Fl_Color)((b*FL_NUM_RED + r) * FL_NUM_GREEN + g + FL_COLOR_CUBE);}
//*@}*/ // group: Colors
/*@}*/ // group: Colors
/** \name Cursors
/** \name Cursors */
/*@{*/
/** The following constants define the mouse cursors that are available in FLTK.
The following constants define the mouse cursors that are available in FLTK.
The double-headed arrows are bitmaps provided by FLTK on X, the others
are provided by system-defined cursors.
\todo enum Fl_Cursor needs some more comments for values
(and maybe an image), see Fl/Enumerations.H
\todo enum Fl_Cursor needs maybe an image.
*/
enum Fl_Cursor { // standard cursors
FL_CURSOR_DEFAULT = 0,
FL_CURSOR_ARROW = 35,
FL_CURSOR_CROSS = 66,
FL_CURSOR_WAIT = 76,
FL_CURSOR_INSERT = 77,
FL_CURSOR_HAND = 31,
FL_CURSOR_HELP = 47,
FL_CURSOR_MOVE = 27,
enum Fl_Cursor {
FL_CURSOR_DEFAULT = 0, /**< the default cursor, usually an arrow. */
FL_CURSOR_ARROW = 35, /**< an arrow pointer. */
FL_CURSOR_CROSS = 66, /**< crosshair. */
FL_CURSOR_WAIT = 76, /**< watch or hourglass. */
FL_CURSOR_INSERT = 77, /**< I-beam. */
FL_CURSOR_HAND = 31, /**< hand (uparrow on MSWindows). */
FL_CURSOR_HELP = 47, /**< question mark. */
FL_CURSOR_MOVE = 27, /**< 4-pointed arrow. */
// fltk provides bitmaps for these:
FL_CURSOR_NS = 78,
FL_CURSOR_WE = 79,
FL_CURSOR_NWSE = 80,
FL_CURSOR_NESW = 81,
FL_CURSOR_NONE = 255,
// for back compatability (non MSWindows ones):
FL_CURSOR_N = 70,
FL_CURSOR_NE = 69,
FL_CURSOR_E = 49,
FL_CURSOR_SE = 8,
FL_CURSOR_S = 9,
FL_CURSOR_SW = 7,
FL_CURSOR_W = 36,
FL_CURSOR_NW = 68
//FL_CURSOR_NS = 22,
//FL_CURSOR_WE = 55,
FL_CURSOR_NS = 78, /**< up/down arrow. */
FL_CURSOR_WE = 79, /**< left/right arrow. */
FL_CURSOR_NWSE = 80, /**< diagonal arrow. */
FL_CURSOR_NESW = 81, /**< diagonal arrow. */
FL_CURSOR_NONE =255, /**< invisible. */
// for back compatibility (non MSWindows ones):
FL_CURSOR_N = 70, /**< for back compatibility. */
FL_CURSOR_NE = 69, /**< for back compatibility. */
FL_CURSOR_E = 49, /**< for back compatibility. */
FL_CURSOR_SE = 8, /**< for back compatibility. */
FL_CURSOR_S = 9, /**< for back compatibility. */
FL_CURSOR_SW = 7, /**< for back compatibility. */
FL_CURSOR_W = 36, /**< for back compatibility. */
FL_CURSOR_NW = 68 /**< for back compatibility. */
};
/*@}*/ // group: Cursors
/** FD "when" conditions */
enum { // values for "when" passed to Fl::add_fd()
FL_READ = 1,
FL_WRITE = 4,
FL_EXCEPT = 8
FL_READ = 1, /**< Call the callback when there is data to be read. */
FL_WRITE = 4, /**< Call the callback when data can be written without blocking. */
FL_EXCEPT = 8 /**< Call the callback if an exception occurs on the file. */
};
enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut)
/** visual types and Fl_Gl_Window::mode() (values match Glut) */
enum Fl_Mode {
FL_RGB = 0,
FL_INDEX = 1,
FL_SINGLE = 0,
@@ -893,16 +933,15 @@ enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut)
#define FL_IMAGE_WITH_ALPHA 0x40000000
// damage masks
/** Damage masks */
enum Fl_Damage {
FL_DAMAGE_CHILD = 0x01,
FL_DAMAGE_EXPOSE = 0x02,
FL_DAMAGE_SCROLL = 0x04,
FL_DAMAGE_OVERLAY = 0x08,
FL_DAMAGE_USER1 = 0x10,
FL_DAMAGE_USER2 = 0x20,
FL_DAMAGE_ALL = 0x80
FL_DAMAGE_CHILD = 0x01, /**< A child needs to be redrawn. */
FL_DAMAGE_EXPOSE = 0x02, /**< The window was exposed. */
FL_DAMAGE_SCROLL = 0x04, /**< The Fl_Scroll widget was scrolled. */
FL_DAMAGE_OVERLAY = 0x08, /**< The overlay planes need to be redrawn. */
FL_DAMAGE_USER1 = 0x10, /**< First user-defined damage bit. */
FL_DAMAGE_USER2 = 0x20, /**< Second user-defined damage bit. */
FL_DAMAGE_ALL = 0x80 /**< Everything needs to be redrawn. */
};
// FLTK 1.0.x compatibility definitions...
@@ -916,5 +955,5 @@ enum Fl_Damage {
#endif
//
// End of "$Id: Enumerations.H 7476 2010-04-09 22:18:05Z matt $".
// End of "$Id: Enumerations.H 8710 2011-05-21 21:55:59Z manolo $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl.H 7334 2010-03-25 14:37:46Z AlbrechtS $"
// "$Id: Fl.H 8724 2011-05-23 18:01:29Z manolo $"
//
// Main header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -25,14 +25,14 @@
// http://www.fltk.org/str.php
//
/* \file
/** \file
Fl static class.
*/
#ifndef Fl_H
# define Fl_H
#ifdef HAVE_CAIRO
#ifdef FLTK_HAVE_CAIRO
# include <FL/Fl_Cairo.H>
#endif
@@ -54,7 +54,7 @@ struct Fl_Label;
/** \defgroup callback_functions Callback function typedefs
\brief Typedefs for callback or handler functions passed as function parameters.
\brief Typedefs defined in <FL/Fl.H> for callback or handler functions passed as function parameters.
FLTK uses callback functions as parameters for some function calls, e.g. to
set up global event handlers (Fl::add_handler()), to add a timeout handler
@@ -68,51 +68,56 @@ struct Fl_Label;
Fl::remove_timeout() and others
@{ */
/** signature of some label drawing functions passed as parameters */
/** Signature of some label drawing functions passed as parameters */
typedef void (Fl_Label_Draw_F)(const Fl_Label *label, int x, int y, int w, int h, Fl_Align align);
/** signature of some label measurement functions passed as parameters */
/** Signature of some label measurement functions passed as parameters */
typedef void (Fl_Label_Measure_F)(const Fl_Label *label, int &width, int &height);
/** signature of some box drawing functions passed as parameters */
/** Signature of some box drawing functions passed as parameters */
typedef void (Fl_Box_Draw_F)(int x, int y, int w, int h, Fl_Color color);
/** signature of some timeout callback functions passed as parameters */
/** Signature of some timeout callback functions passed as parameters */
typedef void (*Fl_Timeout_Handler)(void *data);
/** signature of some wakeup callback functions passed as parameters */
/** Signature of some wakeup callback functions passed as parameters */
typedef void (*Fl_Awake_Handler)(void *data);
/** signature of add_idle callback functions passed as parameters */
/** Signature of add_idle callback functions passed as parameters */
typedef void (*Fl_Idle_Handler)(void *data);
/** signature of set_idle callback functions passed as parameters */
/** Signature of set_idle callback functions passed as parameters */
typedef void (*Fl_Old_Idle_Handler)();
/** signature of add_fd functions passed as parameters */
/** Signature of add_fd functions passed as parameters */
typedef void (*Fl_FD_Handler)(int fd, void *data);
/** signature of add_handler functions passed as parameters */
/** Signature of add_handler functions passed as parameters */
typedef int (*Fl_Event_Handler)(int event);
/** signature of set_abort functions passed as parameters */
/** Signature of set_abort functions passed as parameters */
typedef void (*Fl_Abort_Handler)(const char *format,...);
/** signature of set_atclose functions passed as parameters */
/** Signature of set_atclose functions passed as parameters */
typedef void (*Fl_Atclose_Handler)(Fl_Window *window, void *data);
/** signature of args functions passed as parameters */
/** Signature of args functions passed as parameters */
typedef int (*Fl_Args_Handler)(int argc, char **argv, int &i);
/** Signature of event_dispatch functions passed as parameters.
\see Fl::event_dispatch(Fl_Event_Dispatch) */
typedef int (*Fl_Event_Dispatch)(int event, Fl_Window *w);
/** @} */ /* group callback_functions */
/**
The Fl is the FLTK global (static) containing
The Fl is the FLTK global (static) class 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;
@@ -128,6 +133,7 @@ public: // should be private!
static int e_keysym;
static char* e_text;
static int e_length;
static Fl_Event_Dispatch e_dispatch;
static Fl_Widget* belowmouse_;
static Fl_Widget* pushed_;
static Fl_Widget* focus_;
@@ -136,14 +142,69 @@ public: // should be private!
static Fl_Window* modal_;
static Fl_Window* grab_;
static int compose_state;
static int visible_focus_;
static int dnd_text_ops_;
#endif
/**
If true then flush() will do something.
*/
static void damage(int d) {damage_ = d;}
public:
/** Enumerator for global FLTK options.
These options can be set system wide, per user, or for the running
application only.
\see Fl::option(Fl_Option, bool)
\see Fl::option(Fl_Option)
*/
typedef enum {
/// When switched on, moving the text cursor beyond the start or end of
/// a text in a text widget will change focus to the next text widget.
/// When switched off, the cursor will stop at the end of the text.
/// Pressing Tab or Ctrl-Tab will advance the keyboard focus.
OPTION_ARROW_FOCUS = 0,
// When switched on, FLTK will use the file chooser dialog that comes
// with your operating system whenever possible. When switched off, FLTK
// will present its own file chooser.
// \todo implement me
// OPTION_NATIVE_FILECHOOSER,
// When Filechooser Preview is enabled, the FLTK or native file chooser
// will show a preview of a selected file (if possible) before the user
// decides to choose the file.
// \todo implement me
//OPTION_FILECHOOSER_PREVIEW,
/// If visible focus is switched on, FLTK will draw a dotted rectangle
/// inside the widget that will receive the next keystroke. If switched
/// off, no such indicator will be drawn and keyboard navigation
/// is disabled.
OPTION_VISIBLE_FOCUS,
/// If text drag-and-drop is enabled, the user can select and drag text
/// from any text widget. If disabled, no dragging is possible, however
/// dropping text from other applications still works.
OPTION_DND_TEXT,
/// If tooltips are enabled, hovering the mouse over a widget with a
/// tooltip text will open a little tooltip window until the mouse leaves
/// the widget. If disabled, no tooltip is shown.
OPTION_SHOW_TOOLTIPS,
// don't change this, leave it always as the last element
/// For internal use only.
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.
*/
static bool option(Fl_Option opt);
/*
Override an option while the application is running.
*/
static void option(Fl_Option opt, bool val);
/**
The currently executing idle callback function: DO NOT USE THIS DIRECTLY!
@@ -176,9 +237,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.
@@ -329,6 +390,7 @@ public:
be messed up, but the user can probably keep working - all X protocol
errors call this, for example. The default implementation returns after
displaying the message.
\note \#include <FL/Fl.H>
*/
static void (*warning)(const char*, ...);
/**
@@ -343,6 +405,7 @@ public:
Fl::error() means there is a recoverable error such as the inability to read
an image file. The default implementation returns after displaying the message.
\note \#include <FL/Fl.H>
*/
static void (*error)(const char*, ...);
/**
@@ -359,12 +422,13 @@ public:
version may be able to use longjmp or an exception to continue, as long as
it does not call FLTK again. The default implementation exits with status 1
after displaying the message.
\note \#include <FL/Fl.H>
*/
static void (*fatal)(const char*, ...);
/** @} */
/** \defgroup fl_windows Windows handling functions
Windows and standard dialogs handling
\brief Windows and standard dialogs handling declared in <FL/Fl.H>
@{ */
static Fl_Window* first_window();
static void first_window(Fl_Window*);
@@ -380,37 +444,41 @@ public:
called (grab() overrides this).
*/
static Fl_Window* modal() {return modal_;}
/**
This is used when pop-up menu systems are active.
Send all events to the passed window no matter where the pointer or
focus is (including in other programs). The window <I>does not have
to be shown()</I> , this lets the handle() method of a
"dummy" window override all event handling and allows you to
map and unmap a complex set of windows (under both X and WIN32
<I>some</I> window must be mapped because the system interface needs a
window id).
If grab() is on it will also affect show() of windows by doing
system-specific operations (on X it turns on override-redirect).
These are designed to make menus popup reliably
and faster on the system.
To turn off grabbing do Fl::grab(0).
<I>Be careful that your program does not enter an infinite loop
while grab() is on. On X this will lock up your screen!</I>
To avoid this potential lockup, all newer operating systems seem to
limit mouse pointer grabbing to the time during which a mouse button
is held down. Some OS's may not support grabbing at all.
/** Returns the window that currently receives all events.
\return The window that currently receives all events,
or NULL if event grabbing is currently OFF.
*/
static Fl_Window* grab() {return grab_;}
/** Selects the window to grab. See Fl_Window* Fl::grab() */
/** Selects the window to grab.
This is used when pop-up menu systems are active.
Send all events to the passed window no matter where the pointer or
focus is (including in other programs). The window <I>does not have
to be shown()</I> , this lets the handle() method of a
"dummy" window override all event handling and allows you to
map and unmap a complex set of windows (under both X and WIN32
<I>some</I> window must be mapped because the system interface needs a
window id).
If grab() is on it will also affect show() of windows by doing
system-specific operations (on X it turns on override-redirect).
These are designed to make menus popup reliably
and faster on the system.
To turn off grabbing do Fl::grab(0).
<I>Be careful that your program does not enter an infinite loop
while grab() is on. On X this will lock up your screen!</I>
To avoid this potential lockup, all newer operating systems seem to
limit mouse pointer grabbing to the time during which a mouse button
is held down. Some OS's may not support grabbing at all.
*/
static void grab(Fl_Window*); // platform dependent
/** @} */
/** \defgroup fl_events Events handling functions
Fl class events handling API
Fl class events handling API declared in <FL/Fl.H>
@{
*/
// event information:
@@ -481,18 +549,18 @@ public:
*/
static void event_clicks(int i) {e_clicks = i;}
/**
The first form returns non-zero if the mouse has not moved far enough
and not enough time has passed since the last FL_PUSH or
FL_KEYBOARD event for it to be considered a "drag" rather than a
"click". You can test this on FL_DRAG, FL_RELEASE,
and FL_MOVE events. The second form clears the value returned
by Fl::event_is_click(). Useful to prevent the <I>next</I>
click from being counted as a double-click or to make a popup menu
pick an item with a single click. Don't pass non-zero to this.
Returns non-zero if the mouse has not moved far enough
and not enough time has passed since the last FL_PUSH or
FL_KEYBOARD event for it to be considered a "drag" rather than a
"click". You can test this on FL_DRAG, FL_RELEASE,
and FL_MOVE events.
*/
static int event_is_click() {return e_is_click;}
/**
Only i=0 works! See int event_is_click().
Clears the value returned by Fl::event_is_click().
Useful to prevent the <I>next</I>
click from being counted as a double-click or to make a popup menu
pick an item with a single click. Don't pass non-zero to this.
*/
static void event_is_click(int i) {e_is_click = i;}
/**
@@ -618,19 +686,14 @@ public:
static int event_length() {return e_length;}
static int compose(int &del);
/**
If the user moves the cursor, be sure to call Fl::compose_reset().
The next call to Fl::compose() will start out in an initial state. In
particular it will not set "del" to non-zero. This call is very fast
so it is ok to call it many times and in many places.
*/
static void compose_reset() {compose_state = 0;}
static void compose_reset();
static int event_inside(int,int,int,int);
static int event_inside(const Fl_Widget*);
static int test_shortcut(Fl_Shortcut);
// event destinations:
static int handle(int, Fl_Window*);
static int handle_(int, Fl_Window*);
/** Gets the widget that is below the mouse.
\see belowmouse(Fl_Widget*) */
static Fl_Widget* belowmouse() {return belowmouse_;}
@@ -644,31 +707,50 @@ public:
static void focus(Fl_Widget*);
static void add_handler(Fl_Event_Handler h);
static void remove_handler(Fl_Event_Handler h);
static void event_dispatch(Fl_Event_Dispatch d);
static Fl_Event_Dispatch event_dispatch();
/** @} */
/** \defgroup fl_clipboard Selection & Clipboard functions
fl global copy/cut/paste functions
FLTK global copy/cut/paste functions declared in <FL/Fl.H>
@{ */
// cut/paste:
/**
Copies the data pointed to by \p stuff to the selection (0) or
primary (1) clipboard. The selection clipboard is used for
middle-mouse pastes and for drag-and-drop selections. The primary
clipboard is used for traditional copy/cut/paste operations.
Copies the data pointed to by \p stuff to the selection buffer
(\p destination is 0) or
the clipboard (\p destination is 1); \p len is the number of relevant
bytes in \p stuff.
The selection buffer is used for
middle-mouse pastes and for drag-and-drop selections. The
clipboard is used for traditional copy/cut/paste operations.
*/
static void copy(const char* stuff, int len, int clipboard = 0); // platform dependent
static void copy(const char* stuff, int len, int destination = 0); // platform dependent
/**
Pastes the data from the selection (0) or primary (1) clipboard into receiver.
The selection clipboard is used for middle-mouse pastes and for
drag-and-drop selections. The primary clipboard is used for
traditional copy/cut/paste operations.
Pastes the data from the selection buffer (\p source is 0) or the clipboard
(\p source is 1) into \p receiver.
Set things up so the receiver widget will be called with an FL_PASTE event some
time in the future with the data from the specified \p source in Fl::event_text()
and the number of characters in Fl::event_length().
The receiver
should be prepared to be called \e directly by this, or for
it to happen \e later, or possibly <i>not at all</i>. This
allows the window system to take as long as necessary to retrieve
the paste buffer (or even to screw up completely) without complex
and error-prone synchronization code in FLTK.
The selection buffer is used for middle-mouse pastes and for
drag-and-drop selections. The clipboard is used for traditional
copy/cut/paste operations.
*/
static void paste(Fl_Widget &receiver, int clipboard /*=0*/); // platform dependent
static void paste(Fl_Widget &receiver, int source /*=0*/); // platform dependent
/**
Initiate a Drag And Drop operation. The clipboard should be
Initiate a Drag And Drop operation. The selection buffer should be
filled with relevant data before calling this method. FLTK will
then initiate the system wide drag and drop handling. Dropped data
will be marked as <i>text</i>.
Create a selection first using:
Fl::copy(const char *stuff, int len, 0)
*/
static int dnd(); // platform dependent
@@ -681,16 +763,16 @@ public:
static void paste(Fl_Widget &receiver);
/** @} */
/** \defgroup fl_screen Screen functions
fl global screen functions
fl global screen functions declared in <FL/Fl.H>
@{ */
// screen size:
/** Returns the origin of the current screen, where 0 indicates the left side of the screen. */
/** Returns the origin of the current screen work area, where 0 indicates the left side of the screen. */
static int x(); // platform dependent
/** Returns the origin of the current screen, where 0 indicates the top edge of the screen. */
/** Returns the origin of the current screen work area, where 0 indicates the top edge of the screen. */
static int y(); // platform dependent
/** Returns the width of the screen in pixels. */
/** Returns the width of the screen work area in pixels. */
static int w(); // platform dependent
/** Returns the height of the screen in pixels. */
/** Returns the height of the screen work area in pixels. */
static int h(); // platform dependent
// multi-head support:
@@ -704,12 +786,15 @@ public:
screen_xywh(X, Y, W, H, e_x_root, e_y_root);
}
static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my);
static void screen_xywh(int &X, int &Y, int &W, int &H, int n);
static void screen_xywh(int &X, int &Y, int &W, int &H, int n);
static void screen_xywh(int &X, int &Y, int &W, int &H, int mx, int my, int mw, int mh);
static void screen_dpi(float &h, float &v, int n=0);
/** @} */
/** \defgroup fl_attributes Color & Font functions
fl global color, font functions
fl global color, font functions.
These functions are declared in <FL/Fl.H> or <FL/fl_draw.H>.
@{ */
// color map:
@@ -718,15 +803,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);
@@ -779,7 +864,9 @@ public:
/** @} */
/** \defgroup fl_drawings Drawing functions
fl global graphics and gui drawing functions
FLTK global graphics and GUI drawing functions.
These functions are declared in <FL/fl_draw.H>,
and in <FL/x.H> for offscreen buffer-related ones.
@{ */
// <Hack to re-order the 'Drawing functions' group>
/** @} */
@@ -854,11 +941,11 @@ public:
\deprecated This method is obsolete - use the add_idle() method instead.
*/
static void set_idle(Fl_Old_Idle_Handler cb) {idle = cb;}
/** See Fl_Window* grab() */
static void grab(Fl_Window&win) {grab(&win);}
/** See grab(Fl_Window*) */
static void grab(Fl_Window& win) {grab(&win);}
/** Releases the current grabbed window, equals grab(0).
\deprecated Use Fl::grab(0) instead.
\see Fl_Window* grab() */
\see grab(Fl_Window*) */
static void release() {grab(0);}
// Visible focus methods...
@@ -867,13 +954,13 @@ public:
non-text widgets. The default mode is to enable keyboard focus
for all widgets.
*/
static void visible_focus(int v) { visible_focus_ = v; }
static void visible_focus(int v) { option(OPTION_VISIBLE_FOCUS, (v!=0)); }
/**
Gets or sets the visible keyboard focus on buttons and other
non-text widgets. The default mode is to enable keyboard focus
for all widgets.
*/
static int visible_focus() { return visible_focus_; }
static int visible_focus() { return option(OPTION_VISIBLE_FOCUS); }
// Drag-n-drop text operation methods...
/**
@@ -882,20 +969,20 @@ public:
be dragged from text fields or dragged within a text field as a
cut/paste shortcut.
*/
static void dnd_text_ops(int v) { dnd_text_ops_ = v; }
static void dnd_text_ops(int v) { option(OPTION_DND_TEXT, (v!=0)); }
/**
Gets or sets whether drag and drop text operations are
supported. This specifically affects whether selected text can
be dragged from text fields or dragged within a text field as a
cut/paste shortcut.
*/
static int dnd_text_ops() { return dnd_text_ops_; }
static int dnd_text_ops() { return option(OPTION_DND_TEXT); }
/** \defgroup fl_multithread Multithreading support functions
fl multithreading support functions
fl multithreading support functions declared in <FL/Fl.H>
@{ */
// Multithreading support:
static void lock();
static int lock();
static void unlock();
static void awake(void* message = 0);
/** See void awake(void* message=0). */
@@ -904,14 +991,14 @@ public:
The thread_message() method returns the last message
that was sent from a child by the awake() method.
See also: multithreading
See also: \ref advanced_multithreading
*/
static void* thread_message(); // platform dependent
/** @} */
/** \defgroup fl_del_widget Safe widget deletion support functions
These functions support deletion of widgets inside callbacks.
These functions, declared in <FL/Fl.H>, support deletion of widgets inside callbacks.
Fl::delete_widget() should be called when deleting widgets
or complete widget trees (Fl_Group, Fl_Window, ...) inside
@@ -946,14 +1033,14 @@ public:
static void clear_widget_pointer(Fl_Widget const *w);
/** @} */
#ifdef HAVE_CAIRO
#ifdef FLTK_HAVE_CAIRO
/** \defgroup group_cairo Cairo support functions and classes
@{
*/
public:
// Cairo support API
static cairo_t * cairo_make_current(Fl_Window* w);
/** when HAVE_CAIRO is defined and cairo_autolink_context() is true,
/** when FLTK_HAVE_CAIRO is defined and cairo_autolink_context() is true,
any current window dc is linked to a current context.
This is not the default, because it may not be necessary
to add cairo support to all fltk supported windows.
@@ -991,7 +1078,7 @@ private:
public:
/** @} */
#endif // HAVE_CAIRO
#endif // FLTK_HAVE_CAIRO
};
@@ -1076,12 +1163,12 @@ public:
};
/** \defgroup fl_unicode Unicode and UTF-8 functions
fl global Unicode and UTF-8 handling functions
fl global Unicode and UTF-8 handling functions declared in <FL/fl_utf8.h>
@{ */
/** @} */
#endif // !Fl_H
//
// End of "$Id: Fl.H 7334 2010-03-25 14:37:46Z AlbrechtS $".
// End of "$Id: Fl.H 8724 2011-05-23 18:01:29Z manolo $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Adjuster.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Adjuster.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Adjuster widget header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -40,8 +40,8 @@
/**
The Fl_Adjuster widget was stolen from Prisms, and has proven
to be very useful for values that need a large dynamic range.
\image html adjuster1.gif
\image latex adjuster1.eps "Fl_Adjuster" width=4cm
\image html adjuster1.png
\image latex adjuster1.png "Fl_Adjuster" width=4cm
<P>When you press a button and drag to the right the value increases.
When you drag to the left it decreases. The largest button adjusts by
100 * step(), the next by 10 * step() and that
@@ -78,5 +78,5 @@ public:
#endif
//
// End of "$Id: Fl_Adjuster.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Adjuster.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Bitmap.H 7617 2010-05-27 17:20:18Z manolo $"
// "$Id: Fl_Bitmap.H 7903 2010-11-28 21:06:39Z matt $"
//
// Bitmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -81,5 +81,5 @@ public:
#endif
//
// End of "$Id: Fl_Bitmap.H 7617 2010-05-27 17:20:18Z manolo $".
// End of "$Id: Fl_Bitmap.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Box.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Box.H 7903 2010-11-28 21:06:39Z matt $"
//
// Box header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -65,5 +65,5 @@ public:
#endif
//
// End of "$Id: Fl_Box.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Box.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Browser.H 6850 2009-09-07 02:25:51Z greg.ercolano $"
// "$Id: Fl_Browser.H 8623 2011-04-24 17:09:41Z AlbrechtS $"
//
// Browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -28,7 +28,7 @@
/* \file
Fl_Browser widget . */
// Forms-compatable browser. Probably useful for other
// Forms-compatible browser. Probably useful for other
// lists of textual data. Notice that the line numbers
// start from 1, and 0 means "no line".
@@ -320,5 +320,5 @@ public:
#endif
//
// End of "$Id: Fl_Browser.H 6850 2009-09-07 02:25:51Z greg.ercolano $".
// End of "$Id: Fl_Browser.H 8623 2011-04-24 17:09:41Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Browser_.H 6902 2009-09-27 11:06:56Z matt $"
// "$Id: Fl_Browser_.H 8275 2011-01-13 22:07:31Z manolo $"
//
// Common browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -138,20 +138,20 @@ protected:
\param[in] item The item whose label text is returned.
\returns The item's text label. (Can be NULL if blank)
*/
virtual const char *item_text(void *item) const { return 0L; }
virtual const char *item_text(void *item) const { (void)item; return 0L; }
/**
This optional method should be provided by the subclass
to efficiently swap browser items \p a and \p b, such as for sorting.
\param[in] a,b The two items to be swapped.
*/
virtual void item_swap(void *a,void *b) { }
virtual void item_swap(void *a,void *b) { (void)a; (void)b; }
/**
This method must be provided by the subclass
to return the item for the specified \p index.
\param[in] index The \p index of the item to be returned
\returns The item at the specified \p index.
*/
virtual void *item_at(int index) const { return 0L; }
virtual void *item_at(int index) const { (void)index; return 0L; }
// you don't have to provide these but it may help speed it up:
virtual int full_width() const ; // current width of all items
virtual int full_height() const ; // current height of all items
@@ -374,5 +374,5 @@ public:
#endif
//
// End of "$Id: Fl_Browser_.H 6902 2009-09-27 11:06:56Z matt $".
// End of "$Id: Fl_Browser_.H 8275 2011-01-13 22:07:31Z manolo $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Button.H 7499 2010-04-14 08:07:53Z manolo $"
// "$Id: Fl_Button.H 7903 2010-11-28 21:06:39Z matt $"
//
// Button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -46,6 +46,8 @@
extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
class Fl_Widget_Tracker;
/**
\class Fl_Button
\brief Buttons generate callbacks when they are clicked by the user.
@@ -88,6 +90,10 @@ class FL_EXPORT Fl_Button : public Fl_Widget {
protected:
static Fl_Widget_Tracker *key_release_tracker;
static void key_release_timeout(void*);
void simulate_key_action();
virtual void draw();
public:
@@ -170,5 +176,5 @@ public:
#endif
//
// End of "$Id: Fl_Button.H 7499 2010-04-14 08:07:53Z manolo $".
// End of "$Id: Fl_Button.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Chart.H 6902 2009-09-27 11:06:56Z matt $"
// "$Id: Fl_Chart.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Forms chart header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -61,8 +61,8 @@ struct FL_CHART_ENTRY {
\brief Fl_Chart displays simple charts.
It is provided for Forms compatibility.
\image html charts.gif
\image latex charts.eps "Fl_Chart" width=10cm
\image html charts.png
\image latex charts.png "Fl_Chart" width=10cm
\todo Refactor Fl_Chart::type() information.
The type of an Fl_Chart object can be set using type(uchar t) to:
@@ -156,5 +156,5 @@ public:
#endif
//
// End of "$Id: Fl_Chart.H 6902 2009-09-27 11:06:56Z matt $".
// End of "$Id: Fl_Chart.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Check_Browser.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Check_Browser.H 7903 2010-11-28 21:06:39Z matt $"
//
// Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -117,6 +117,6 @@ class FL_EXPORT Fl_Check_Browser : public Fl_Browser_ {
#endif // Fl_Check_Browser_H
//
// End of "$Id: Fl_Check_Browser.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Check_Browser.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Check_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Check_Button.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Check button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -37,8 +37,8 @@
\class Fl_Check_Button
\brief A button with an "checkmark" to show its status.
\image html Fl_Check_Button.gif
\image latex Fl_Check_Button.eps "Fl_Check_Button" width=4cm
\image html Fl_Check_Button.png
\image latex Fl_Check_Button.png "Fl_Check_Button" width=4cm
Buttons generate callbacks when they are clicked by the user. You control
exactly when and how by changing the values for type() and when().
@@ -56,5 +56,5 @@ public:
#endif
//
// End of "$Id: Fl_Check_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Check_Button.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Choice.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Choice.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Choice header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -64,8 +64,8 @@
you pick the item with the mouse. The '\&' character in item names are
only looked at when the menu is popped up, however.
\image html choice.gif
\image latex choice.eps "Fl_Choice" width=4cm
\image html choice.png
\image latex choice.png "Fl_Choice" width=4cm
\todo Refactor the doxygen comments for Fl_Choice changed() documentation.
\li <tt>int Fl_Widget::changed() const</tt>
@@ -104,5 +104,5 @@ public:
#endif
//
// End of "$Id: Fl_Choice.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Choice.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Clock.H 6812 2009-07-01 07:27:25Z AlbrechtS $"
// "$Id: Fl_Clock.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Clock header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -53,12 +53,12 @@
\htmlonly <BR> <table align=CENTER border=1 cellpadding=5 >
<caption align=bottom>type() FL_SQUARE_CLOCK and FL_ROUND_CLOCK </caption> <TR><TD> \endhtmlonly
\image html clock.gif
\image html clock.png
\htmlonly </TD> <TD> \endhtmlonly
\image html round_clock.gif
\image html round_clock.png
\htmlonly </TD> </TR> </table> \endhtmlonly
\image latex clock.eps "FL_SQUARE_CLOCK type" width=4cm
\image latex round_clock.eps "FL_ROUND_CLOCK type" width=4cm
\image latex clock.png "FL_SQUARE_CLOCK type" width=4cm
\image latex round_clock.png "FL_ROUND_CLOCK type" width=4cm
*/
class FL_EXPORT Fl_Clock_Output : public Fl_Widget {
int hour_, minute_, second_;
@@ -112,12 +112,12 @@ public:
You can choose the rounded or square type of the clock with type(), see below.
\htmlonly <BR> <table align=CENTER border=1 cellpadding=5 >
<caption align=bottom>type() FL_SQUARE_CLOCK and FL_ROUND_CLOCK </caption> <TR><TD> \endhtmlonly
\image html clock.gif
\image html clock.png
\htmlonly </TD> <TD> \endhtmlonly
\image html round_clock.gif
\image html round_clock.png
\htmlonly </TD> </TR> </table> \endhtmlonly
\image latex clock.eps "FL_SQUARE_CLOCK type" width=4cm
\image latex round_clock.eps "FL_ROUND_CLOCK type" width=4cm
\image latex clock.png "FL_SQUARE_CLOCK type" width=4cm
\image latex round_clock.png "FL_ROUND_CLOCK type" width=4cm
*/
class FL_EXPORT Fl_Clock : public Fl_Clock_Output {
public:
@@ -133,5 +133,5 @@ public:
#endif
//
// End of "$Id: Fl_Clock.H 6812 2009-07-01 07:27:25Z AlbrechtS $".
// End of "$Id: Fl_Clock.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Color_Chooser.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Color_Chooser.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Color chooser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -84,7 +84,7 @@ public:
\brief The Fl_Color_Chooser widget provides a standard RGB color chooser.
\image html fl_color_chooser.jpg
\image latex fl_color_chooser.eps "fl_color_chooser()" width=5cm
\image latex fl_color_chooser.jpg "fl_color_chooser()" width=5cm
You can place any number of the widgets into a panel of your own design.
The diagram shows the widget as part of a color chooser dialog created by
@@ -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 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Counter.H 6939 2009-11-17 14:45:36Z matt $"
// "$Id: Fl_Counter.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Counter header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -45,8 +45,8 @@
Controls a single floating point value with button (or keyboard) arrows.
Double arrows buttons achieve larger steps than simple arrows.
\see Fl_Spinner for value input with vertical step arrows.
<P align=center>\image html counter.gif</P>
\image latex counter.eps "Fl_Counter" width=4cm
<P align=center>\image html counter.png</P>
\image latex counter.png "Fl_Counter" width=4cm
\todo Refactor the doxygen comments for Fl_Counter type() documentation.
@@ -120,5 +120,5 @@ public:
#endif
//
// End of "$Id: Fl_Counter.H 6939 2009-11-17 14:45:36Z matt $".
// End of "$Id: Fl_Counter.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,10 +1,10 @@
//
// "$Id: Fl_Device.H 7666 2010-07-04 17:19:38Z AlbrechtS $"
// "$Id: Fl_Device.H 8529 2011-03-23 12:49:30Z AlbrechtS $"
//
// Definition of classes Fl_Device, Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device
// for the Fast Light Tool Kit (FLTK).
//
// Copyright 2010 by Bill Spitzak and others.
// Copyright 2010-2011 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
@@ -26,7 +26,8 @@
// http://www.fltk.org/str.php
//
/** \file Fl_Device.H
\brief declaration of classes Fl_Device, Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device.
\brief declaration of classes Fl_Device, Fl_Graphics_Driver, Fl_Surface_Device,
Fl_Display_Device, Fl_Device_Plugin.
*/
#ifndef Fl_Device_H
@@ -38,22 +39,11 @@
#include <FL/Fl_Bitmap.H>
#include <FL/Fl_Pixmap.H>
#include <FL/Fl_RGB_Image.H>
#ifdef WIN32
#include <commdlg.h>
#elif defined(__APPLE__)
#else
#include <stdio.h>
#endif
class Fl_Graphics_Driver;
class Fl_Display_Device;
class Fl_Surface_Device;
class Fl_Font_Descriptor;
/** \brief Points to the driver that currently receives all graphics requests */
FL_EXPORT extern Fl_Graphics_Driver *fl_graphics_driver;
/** \brief Points to the surface that currently receives all graphics requests */
FL_EXPORT extern Fl_Surface_Device *fl_surface;
/** \brief Points to the platform's display */
FL_EXPORT extern Fl_Display_Device *fl_display_device;
/**
signature of image generation callback function.
@@ -65,47 +55,86 @@ FL_EXPORT extern Fl_Display_Device *fl_display_device;
*/
typedef void (*Fl_Draw_Image_Cb)(void* data,int x,int y,int w,uchar* buf);
// typedef what the x,y fields in a point are:
#ifdef WIN32
typedef int COORD_T;
# define XPOINT XPoint
#elif defined(__APPLE__)
typedef float COORD_T;
typedef struct { float x; float y; } QPoint;
# define XPOINT QPoint
extern float fl_quartz_line_width_;
#else
typedef short COORD_T;
# define XPOINT XPoint
#endif
/**
\brief All graphical output devices and all graphics systems.
*/
class Fl_Device {
protected:
/** \brief The device type */
const char *type_;
/** \brief A string that identifies each subclass of Fl_Device.
*
Function type() applied to a device of this class returns this string.
*/
static const char *device_type;
class FL_EXPORT Fl_Device {
public:
/** A string that identifies each subclass of Fl_Device.
Function class_name() applied to a device of this class returns this string.
*/
static const char *class_id;
/**
@brief An RTTI emulation of device classes.
*
The type of an instance of an Fl_Device subclass can be checked with code such as:
Returns the name of the class of this object.
The class of an instance of an Fl_Device subclass can be checked with code such as:
\code
if ( instance->type() == Fl_Printer::device_type ) { ... }
if ( instance->class_name() == Fl_Printer::class_id ) { ... }
\endcode
*/
inline const char *type() {return type_;};
virtual const char *class_name() {return class_id;};
/**
Virtual destructor.
The destructor of Fl_Device must be virtual to make the destructors of
derived classes being called correctly on destruction.
*/
virtual ~Fl_Device() {};
};
#define FL_REGION_STACK_SIZE 10
#define FL_MATRIX_STACK_SIZE 32
/**
\brief A virtual class subclassed for each graphics driver FLTK uses.
*
The protected virtual methods of this class are those that a graphics driver should implement to
The virtual methods of this class are those that a graphics driver should implement to
support all of FLTK drawing functions.
<br> The preferred FLTK API for drawing operations is the function collection of the
\ref fl_drawings and \ref fl_attributes modules.
<br> Alternatively, methods of the Fl_Graphics_Driver class can be called
using the global variable Fl_Graphics_Driver * \ref fl_graphics_driver that points at all time to
the single driver (an instance of an Fl_Graphics_Driver subclass) that's currently receiving graphics
requests. For example:
\code fl_graphics_driver->rect(x, y, w, h); \endcode
<br>Each protected method of the Fl_Graphics_Driver class has the same effect as the
function of the \ref fl_drawings and \ref fl_attributes modules which bears the same name
prefixed with fl_ and has the same parameter list.
<br> The public API for drawing operations is functionally presented in \ref drawing and as function lists
in the \ref fl_drawings and \ref fl_attributes modules.
*/
class Fl_Graphics_Driver : public Fl_Device {
class FL_EXPORT Fl_Graphics_Driver : public Fl_Device {
public:
/** A 2D coordinate transformation matrix
*/
struct matrix {double a, b, c, d, x, y;};
private:
static const matrix m0;
Fl_Font font_; // current font
Fl_Fontsize size_; // current font size
Fl_Color color_; // current color
enum {LINE, LOOP, POLYGON, POINT_};
int sptr;
static const int matrix_stack_size = FL_MATRIX_STACK_SIZE;
matrix stack[FL_MATRIX_STACK_SIZE];
matrix m;
int n, p_size, gap_;
XPOINT *p;
int what;
int fl_clip_state_number;
int rstackptr;
static const int region_stack_max = FL_REGION_STACK_SIZE - 1;
Fl_Region rstack[FL_REGION_STACK_SIZE];
#ifdef WIN32
int numcount;
int counts[20];
#endif
Fl_Font_Descriptor *font_descriptor_;
void transformed_vertex0(COORD_T x, COORD_T y);
void fixloop();
protected:
/* ** \brief red color for background and/or mixing if device does not support masking or alpha *
uchar bg_r_;
@@ -116,7 +145,6 @@ protected:
friend class Fl_Pixmap;
friend class Fl_Bitmap;
friend class Fl_RGB_Image;
friend class Fl_PostScript_Graphics_Driver;
friend void fl_rect(int x, int y, int w, int h);
friend void fl_rectf(int x, int y, int w, int h);
friend void fl_line_style(int style, int width, char* dashes);
@@ -165,13 +193,31 @@ protected:
friend void fl_begin_complex_polygon();
friend void fl_gap();
friend void fl_end_complex_polygon();
friend void fl_push_matrix();
friend void fl_pop_matrix();
friend void fl_mult_matrix(double a, double b, double c, double d, double x, double y);
friend void fl_scale(double x, double y);
friend void fl_scale(double x);
friend void fl_translate(double x, double y);
friend void fl_rotate(double d);
friend double fl_transform_x(double x, double y);
friend double fl_transform_y(double x, double y);
friend double fl_transform_dx(double x, double y);
friend double fl_transform_dy(double x, double y);
friend Fl_Region fl_clip_region();
friend void fl_clip_region(Fl_Region r);
friend void fl_restore_clip();
friend void fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L);
friend void fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L);
friend void fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
friend FL_EXPORT void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D);
friend FL_EXPORT void gl_start();
matrix *fl_matrix; /**< Points to the current coordinate transformation matrix */
/** \brief The constructor. */
Fl_Graphics_Driver() {};
Fl_Graphics_Driver();
/** \brief see fl_rect(int x, int y, int w, int h). */
virtual void rect(int x, int y, int w, int h);
/** \brief see fl_rectf(int x, int y, int w, int h). */
@@ -195,17 +241,18 @@ protected:
/** \brief see fl_line(int x, int y, int x1, int y1, int x2, int y2). */
virtual void line(int x, int y, int x1, int y1, int x2, int y2);
/** \brief see fl_draw(const char *str, int n, int x, int y). */
virtual void draw(const char *str, int n, int x, int y);
virtual void draw(const char *str, int n, int x, int y) = 0;
#ifdef __APPLE__
virtual void draw(const char *str, int n, float x, float y) = 0;
#endif
/** \brief see fl_draw(int angle, const char *str, int n, int x, int y). */
virtual void draw(int angle, const char *str, int n, int x, int y);
virtual void draw(int angle, const char *str, int n, int x, int y) = 0;
/** \brief see fl_rtl_draw(const char *str, int n, int x, int y). */
virtual void rtl_draw(const char *str, int n, int x, int y);
/** \brief see fl_font(Fl_Font face, Fl_Fontsize size). */
virtual void font(Fl_Font face, Fl_Fontsize size);
virtual void rtl_draw(const char *str, int n, int x, int y) = 0;
/** \brief see fl_color(Fl_Color c). */
virtual void color(Fl_Color c);
virtual void color(Fl_Color c) {color_ = c;}
/** \brief see fl_color(uchar r, uchar g, uchar b). */
virtual void color(uchar r, uchar g, uchar b);
virtual void color(uchar r, uchar g, uchar b) = 0;
/** \brief see fl_point(int x, int y). */
virtual void point(int x, int y);
/** \brief see fl_loop(int x0, int y0, int x1, int y1, int x2, int y2). */
@@ -262,37 +309,90 @@ protected:
virtual void push_no_clip();
/** \brief see fl_pop_clip(). */
virtual void pop_clip();
/** \brief see fl_push_matrix(). */
void push_matrix();
/** \brief see fl_pop_matrix(). */
void pop_matrix();
/** \brief see fl_mult_matrix(double a, double b, double c, double d, double x, double y). */
void mult_matrix(double a, double b, double c, double d, double x, double y);
/** \brief see fl_scale(double x, double y). */
inline void scale(double x, double y) { mult_matrix(x,0,0,y,0,0); }
/** \brief see fl_scale(double x). */
inline void scale(double x) { mult_matrix(x,0,0,x,0,0); }
/** \brief see fl_translate(double x, double y). */
inline void translate(double x,double y) { mult_matrix(1,0,0,1,x,y); }
/** \brief see fl_rotate(double d). */
void rotate(double d);
/** \brief see fl_transform_x(double x, double y). */
double transform_x(double x, double y);
/** \brief see fl_transform_y(double x, double y). */
double transform_y(double x, double y);
/** \brief see fl_transform_dx(double x, double y). */
double transform_dx(double x, double y);
/** \brief see fl_transform_dy(double x, double y). */
double transform_dy(double x, double y);
/** \brief see fl_clip_region(). */
Fl_Region clip_region();
/** \brief see fl_clip_region(Fl_Region r). */
void clip_region(Fl_Region r);
/** \brief see fl_restore_clip(). */
void restore_clip();
// Images
/** \brief see fl_draw_image(const uchar* buf, int X,int Y,int W,int H, int D, int L). */
virtual void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
virtual void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0) = 0;
/** \brief see fl_draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D, int L). */
virtual void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
virtual void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0) = 0;
/** \brief see fl_draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D). */
virtual void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
virtual void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3) = 0;
/** \brief see fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D). */
virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
virtual void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1) = 0;
// Image classes
/** \brief Draws an Fl_RGB_Image object to the device.
*
Specifies a bounding box for the image, with the origin (upper left-hand corner) of
the image offset by the cx and cy arguments.
*/
virtual void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy) {};
virtual void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy) = 0;
/** \brief Draws an Fl_Pixmap object to the device.
*
Specifies a bounding box for the image, with the origin (upper left-hand corner) of
the image offset by the cx and cy arguments.
*/
virtual void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy) {};
virtual void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy) = 0;
/** \brief Draws an Fl_Bitmap object to the device.
*
Specifies a bounding box for the image, with the origin (upper left-hand corner) of
the image offset by the cx and cy arguments.
*/
virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) {};
virtual void draw(Fl_Bitmap *bm, int XP, int YP, int WP, int HP, int cx, int cy) = 0;
public:
static const char *device_type;
static const char *class_id;
virtual const char *class_name() {return class_id;};
/** \brief see fl_font(Fl_Font face, Fl_Fontsize size). */
virtual void font(Fl_Font face, Fl_Fontsize size) {font_ = face; size_ = size;}
/** \brief see fl_font(void). */
Fl_Font font() {return font_; }
/** \brief see fl_size(). */
Fl_Fontsize size() {return size_; }
/** \brief see fl_width(const char *str, int n). */
virtual double width(const char *str, int n) = 0;
/** \brief see fl_width(unsigned int n). */
virtual inline double width(unsigned int c) { char ch = (char)c; return width(&ch, 1); }
/** \brief see fl_text_extents(const char*, int n, int& dx, int& dy, int& w, int& h). */
virtual void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
/** \brief see fl_height(). */
virtual int height() = 0;
/** \brief see fl_descent(). */
virtual int descent() = 0;
/** \brief see fl_color(void). */
Fl_Color color() {return color_;}
/** Returns a pointer to the current Fl_Font_Descriptor for the graphics driver */
inline Fl_Font_Descriptor *font_descriptor() { return font_descriptor_;}
/** Sets the current Fl_Font_Descriptor for the graphics driver */
inline void font_descriptor(Fl_Font_Descriptor *d) { font_descriptor_ = d;}
/** \brief The destructor */
virtual ~Fl_Graphics_Driver() {};
};
@@ -303,13 +403,31 @@ public:
*
This class is implemented only on the Mac OS X platform.
*/
class Fl_Quartz_Graphics_Driver : public Fl_Graphics_Driver {
class FL_EXPORT Fl_Quartz_Graphics_Driver : public Fl_Graphics_Driver {
public:
Fl_Quartz_Graphics_Driver() { type_ = device_type; };
static const char *device_type;
static const char *class_id;
const char *class_name() {return class_id;};
void color(Fl_Color c);
void color(uchar r, uchar g, uchar b);
void draw(const char* str, int n, int x, int y);
#ifdef __APPLE__
void draw(const char *str, int n, float x, float y);
#endif
void draw(int angle, const char *str, int n, int x, int y);
void rtl_draw(const char* str, int n, int x, int y);
void font(Fl_Font face, Fl_Fontsize size);
void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
double width(const char *str, int n);
double width(unsigned int c);
void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
int height();
int descent();
};
#endif
#if defined(WIN32) || defined(FL_DOXYGEN)
@@ -318,13 +436,28 @@ public:
*
This class is implemented only on the MSWindows platform.
*/
class Fl_GDI_Graphics_Driver : public Fl_Graphics_Driver {
class FL_EXPORT Fl_GDI_Graphics_Driver : public Fl_Graphics_Driver {
public:
Fl_GDI_Graphics_Driver() { type_ = device_type; };
static const char *device_type;
static const char *class_id;
const char *class_name() {return class_id;};
void color(Fl_Color c);
void color(uchar r, uchar g, uchar b);
void draw(const char* str, int n, int x, int y);
void draw(int angle, const char *str, int n, int x, int y);
void rtl_draw(const char* str, int n, int x, int y);
void font(Fl_Font face, Fl_Fontsize size);
void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
double width(const char *str, int n);
double width(unsigned int c);
void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
int height();
int descent();
};
#endif
#if !(defined(__APPLE__) || defined(WIN32))
@@ -335,32 +468,49 @@ public:
*/
class Fl_Xlib_Graphics_Driver : public Fl_Graphics_Driver {
public:
Fl_Xlib_Graphics_Driver() { type_ = device_type; };
static const char *device_type;
static const char *class_id;
const char *class_name() {return class_id;};
void color(Fl_Color c);
void color(uchar r, uchar g, uchar b);
void draw(const char* str, int n, int x, int y);
void draw(int angle, const char *str, int n, int x, int y);
void rtl_draw(const char* str, int n, int x, int y);
void font(Fl_Font face, Fl_Fontsize size);
void draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_Bitmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_RGB_Image *img, int XP, int YP, int WP, int HP, int cx, int cy);
void draw_image(const uchar* buf, int X,int Y,int W,int H, int D=3, int L=0);
void draw_image(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=3);
void draw_image_mono(const uchar* buf, int X,int Y,int W,int H, int D=1, int L=0);
void draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int W,int H, int D=1);
double width(const char *str, int n);
double width(unsigned int c);
void text_extents(const char*, int n, int& dx, int& dy, int& w, int& h);
int height();
int descent();
};
#endif
/**
\brief A surface that's susceptible to receive graphical output.
*/
class Fl_Surface_Device : public Fl_Device {
class FL_EXPORT Fl_Surface_Device : public Fl_Device {
/** \brief The graphics driver in use by this surface. */
Fl_Graphics_Driver *_driver;
static Fl_Surface_Device *_surface; // the surface that currently receives graphics output
protected:
/** \brief Constructor that sets the graphics driver to use for the created surface. */
Fl_Surface_Device(Fl_Graphics_Driver *graphics_driver) {_driver = graphics_driver; };
public:
static const char *device_type;
static const char *class_id;
const char *class_name() {return class_id;};
virtual void set_current(void);
/** \brief Sets the graphics driver of this drawing surface. */
inline void driver(Fl_Graphics_Driver *graphics_driver) {_driver = graphics_driver;};
/** \brief Returns the graphics driver of this drawing surface. */
inline Fl_Graphics_Driver *driver() {return _driver; };
/** \brief the surface that currently receives graphics output */
static Fl_Surface_Device *surface() {return fl_surface; };
static inline Fl_Surface_Device *surface() {return _surface; };
/** \brief The destructor. */
virtual ~Fl_Surface_Device() {}
};
@@ -368,19 +518,41 @@ public:
/**
\brief A display to which the computer can draw.
*/
class Fl_Display_Device : public Fl_Surface_Device {
class FL_EXPORT Fl_Display_Device : public Fl_Surface_Device {
static Fl_Display_Device *_display; // the platform display device
public:
static const char *device_type;
static const char *class_id;
const char *class_name() {return class_id;};
/** \brief A constructor that sets the graphics driver used by the display */
Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device( graphics_driver) { type_ = device_type; };
/**
@brief Returns the platform's display device.
Fl_Display_Device(Fl_Graphics_Driver *graphics_driver);
/** Returns the platform display device. */
static inline Fl_Display_Device *display_device() {return _display;};
};
/**
This plugin socket allows the integration of new device drivers for special
window or screen types. It is currently used to provide an automated printing
service for OpenGL windows, if linked with fltk_gl.
*/
class FL_EXPORT Fl_Device_Plugin : public Fl_Plugin {
public:
/** \brief The constructor */
Fl_Device_Plugin(const char *name)
: Fl_Plugin(klass(), name) { }
/** \brief Returns the class name */
virtual const char *klass() { return "fltk:device"; }
/** \brief Returns the plugin name */
virtual const char *name() = 0;
/** \brief Prints a widget
\param w the widget
\param x,y offsets where to print relatively to coordinates origin
\param height height of the current drawing area
*/
static Fl_Display_Device *display_device() { return fl_display_device; };
virtual int print(Fl_Widget* w, int x, int y, int height) = 0;
};
#endif // Fl_Device_H
//
// End of "$Id: Fl_Device.H 7666 2010-07-04 17:19:38Z AlbrechtS $".
// End of "$Id: Fl_Device.H 8529 2011-03-23 12:49:30Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Dial.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Dial.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Dial header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -43,8 +43,8 @@
/**
The Fl_Dial widget provides a circular dial to control a
single floating point value.
<P ALIGN=CENTER>\image html dial.gif
\image latex dial.eps "Fl_Dial" width=4cm
<P ALIGN=CENTER>\image html dial.png
\image latex dial.png "Fl_Dial" width=4cm
Use type() to set the type of the dial to:
<UL>
<LI>FL_NORMAL_DIAL - Draws a normal dial with a knob. </LI>
@@ -93,5 +93,5 @@ public:
#endif
//
// End of "$Id: Fl_Dial.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Dial.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Double_Window.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Double_Window.H 7903 2010-11-28 21:06:39Z matt $"
//
// Double-buffered window header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -77,5 +77,5 @@ public:
#endif
//
// End of "$Id: Fl_Double_Window.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Double_Window.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
/*
* "$Id: Fl_Export.H 6614 2009-01-01 16:11:32Z matt $"
* "$Id: Fl_Export.H 7903 2010-11-28 21:06:39Z matt $"
*
* WIN32 DLL export .
*
* Copyright 1998-2009 by Bill Spitzak and others.
* Copyright 1998-2010 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
@@ -32,7 +32,7 @@
* The following is only used when building DLLs under WIN32...
*/
# if defined(FL_DLL) && (defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) || __GNUC__ >= 3)
# if defined(FL_DLL)
# ifdef FL_LIBRARY
# define FL_EXPORT __declspec(dllexport)
# else
@@ -45,5 +45,5 @@
#endif /* !Fl_Export_H */
/*
* End of "$Id: Fl_Export.H 6614 2009-01-01 16:11:32Z matt $".
* End of "$Id: Fl_Export.H 7903 2010-11-28 21:06:39Z matt $".
*/

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_File_Browser.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_File_Browser.H 8306 2011-01-24 17:04:22Z matt $"
//
// FileBrowser definitions.
//
// Copyright 1999-2009 by Michael Sweet.
// Copyright 1999-2010 by Michael Sweet.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -45,8 +45,8 @@
//
/** The Fl_File_Browser widget displays a list of filenames, optionally with file-specific icons. */
class FL_EXPORT Fl_File_Browser : public Fl_Browser
{
class FL_EXPORT Fl_File_Browser : public Fl_Browser {
int filetype_;
const char *directory_;
uchar iconsize_;
@@ -116,5 +116,5 @@ public:
#endif // !_Fl_File_Browser_H_
//
// End of "$Id: Fl_File_Browser.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_File_Browser.H 8306 2011-01-24 17:04:22Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_File_Chooser.H 7007 2010-01-14 23:08:06Z greg.ercolano $"
// "$Id: Fl_File_Chooser.H 8786 2011-06-07 11:41:36Z manolo $"
//
// Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -54,8 +54,8 @@ private:
static Fl_Preferences prefs_;
void (*callback_)(Fl_File_Chooser*, void *);
void *data_;
char directory_[1024];
char pattern_[1024];
char directory_[FL_PATH_MAX];
char pattern_[FL_PATH_MAX];
char preview_text_[2048];
int type_;
void favoritesButtonCB();
@@ -95,6 +95,11 @@ public:
private:
void cb_previewButton_i(Fl_Check_Button*, void*);
static void cb_previewButton(Fl_Check_Button*, void*);
public:
Fl_Check_Button *showHiddenButton;
private:
void cb_showHiddenButton_i(Fl_Check_Button*, void*);
static void cb_showHiddenButton(Fl_Check_Button*, void*);
Fl_File_Input *fileName;
void cb_fileName_i(Fl_File_Input*, void*);
static void cb_fileName(Fl_File_Input*, void*);
@@ -144,9 +149,13 @@ public:
const char * ok_label();
void preview(int e);
int preview() const { return previewButton->value(); };
private:
void showHidden(int e);
void remove_hidden_files();
public:
void rescan();
void rescan_keep_filename();
void show();
void show();
int shown();
void textcolor(Fl_Color c);
Fl_Color textcolor();
@@ -213,6 +222,10 @@ public:
[standard text may be customized at run-time]
*/
static const char *show_label;
/**
[standard text may be customized at run-time]
*/
static const char *hidden_label;
/**
the sort function that is used when loading
the contents of a directory.
@@ -222,7 +235,6 @@ private:
Fl_Widget* ext_group;
public:
Fl_Widget* add_extra(Fl_Widget* gr);
Fl_File_Browser *browser(void) {return fileList; };
};
FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);
FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);
@@ -231,5 +243,5 @@ FL_EXPORT void fl_file_chooser_ok_label(const char*l);
#endif
//
// End of "$Id: Fl_File_Chooser.H 7007 2010-01-14 23:08:06Z greg.ercolano $".
// End of "$Id: Fl_File_Chooser.H 8786 2011-06-07 11:41:36Z manolo $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_File_Icon.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_File_Icon.H 8306 2011-01-24 17:04:22Z matt $"
//
// Fl_File_Icon definitions.
//
// Copyright 1999-2009 by Michael Sweet.
// Copyright 1999-2010 by Michael Sweet.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -53,8 +53,8 @@
The Fl_File_Icon class manages icon images that can be used
as labels in other widgets and as icons in the FileBrowser widget.
*/
class FL_EXPORT Fl_File_Icon //// Icon data
{
class FL_EXPORT Fl_File_Icon { //// Icon data
static Fl_File_Icon *first_; // Pointer to first icon/filetype
Fl_File_Icon *next_; // Pointer to next icon/filetype
const char *pattern_; // Pattern string
@@ -164,5 +164,5 @@ class FL_EXPORT Fl_File_Icon //// Icon data
#endif // !_Fl_Fl_File_Icon_H_
//
// End of "$Id: Fl_File_Icon.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_File_Icon.H 8306 2011-01-24 17:04:22Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_File_Input.H 6716 2009-03-24 01:40:44Z fabien $"
// "$Id: Fl_File_Input.H 8712 2011-05-22 09:45:40Z AlbrechtS $"
//
// File_Input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 by Bill Spitzak and others.
// Original version Copyright 1998 by Curtis Edwards.
//
// This library is free software; you can redistribute it and/or
@@ -42,17 +42,19 @@
navigate upward in the directory tree.
You may want to handle FL_WHEN_CHANGED events for tracking text changes
and also FL_WHEN_RELEASE for button release when changing to parent dir.
FL_WHEN_RELEASE callback won't be called if the directory clicked
is the same that the current one.
<P align=CENTER> \image html Fl_File_Input.gif </P>
\image latex Fl_File_Input.eps "Fl_File_Input" width=6cm
FL_WHEN_RELEASE callback won't be called if the directory clicked
is the same as the current one.
<P align=CENTER> \image html Fl_File_Input.png </P>
\image latex Fl_File_Input.png "Fl_File_Input" width=6cm
\note As all Fl_Input derived objects, Fl_File_Input may call its callback
when loosing focus (see FL_UNFOCUS) to update its state like its cursor shape.
when losing focus (see FL_UNFOCUS) to update its state like its cursor shape.
One resulting side effect is that you should call clear_changed() early in your callback
to avoid reentrant calls if you plan to show another window or dialog box in the callback.
*/
class FL_EXPORT Fl_File_Input : public Fl_Input
{
class FL_EXPORT Fl_File_Input : public Fl_Input {
Fl_Color errorcolor_;
char ok_entry_;
uchar down_box_;
@@ -100,5 +102,5 @@ public:
//
// End of "$Id: Fl_File_Input.H 6716 2009-03-24 01:40:44Z fabien $".
// End of "$Id: Fl_File_Input.H 8712 2011-05-22 09:45:40Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Fill_Dial.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Fill_Dial.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Filled dial header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -34,7 +34,7 @@
#include "Fl_Dial.H"
/** Draws a dial with a filled arc */
class Fl_Fill_Dial : public Fl_Dial {
class FL_EXPORT Fl_Fill_Dial : public Fl_Dial {
public:
/** Creates a filled dial, also setting its type to FL_FILL_DIAL. */
Fl_Fill_Dial(int x,int y,int w,int h, const char *l = 0)
@@ -44,5 +44,5 @@ public:
#endif
//
// End of "$Id: Fl_Fill_Dial.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Fill_Dial.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Fill_Slider.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Fill_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Filled slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -33,7 +33,7 @@
#include "Fl_Slider.H"
/** Widget that draws a filled horizontal slider, useful as a progress or value meter*/
class Fl_Fill_Slider : public Fl_Slider {
class FL_EXPORT Fl_Fill_Slider : public Fl_Slider {
public:
/** Creates the slider from its position,size and optional title. */
Fl_Fill_Slider(int x,int y,int w,int h,const char *l=0)
@@ -43,5 +43,5 @@ public:
#endif
//
// End of "$Id: Fl_Fill_Slider.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Fill_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Float_Input.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Float_Input.H 8726 2011-05-23 18:32:47Z AlbrechtS $"
//
// Floating point input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -39,19 +39,24 @@
that only allows the user to type floating point numbers (sign,
digits, decimal point, more digits, 'E' or 'e', sign, digits).
*/
class Fl_Float_Input : public Fl_Input {
class FL_EXPORT Fl_Float_Input : public Fl_Input {
public:
/**
Creates a new Fl_Float_Input widget using the given position,
Creates a new Fl_Float_Input widget using the given position,
size, and label string. The default boxtype is FL_DOWN_BOX.
<P> Inherited destructor destroys the widget and any value associated with it
Inherited destructor destroys the widget and any value associated with it.
*/
#if defined(FL_DLL) // implementation in src/Fl_Input.cxx
Fl_Float_Input(int X,int Y,int W,int H,const char *l = 0);
#else
Fl_Float_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(X,Y,W,H,l) {type(FL_FLOAT_INPUT);}
#endif
};
#endif
//
// End of "$Id: Fl_Float_Input.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Float_Input.H 8726 2011-05-23 18:32:47Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_FormsBitmap.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_FormsBitmap.H 7903 2010-11-28 21:06:39Z matt $"
//
// Forms bitmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -52,5 +52,5 @@ public:
#endif
//
// End of "$Id: Fl_FormsBitmap.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_FormsBitmap.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_FormsPixmap.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_FormsPixmap.H 7903 2010-11-28 21:06:39Z matt $"
//
// Forms pixmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -59,5 +59,5 @@ public:
#endif
//
// End of "$Id: Fl_FormsPixmap.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_FormsPixmap.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Free.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Free.H 7903 2010-11-28 21:06:39Z matt $"
//
// Forms free header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -85,5 +85,5 @@ public:
#endif
//
// End of "$Id: Fl_Free.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Free.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Group.H 7280 2010-03-16 22:51:31Z matt $"
// "$Id: Fl_Group.H 8157 2011-01-01 14:01:53Z AlbrechtS $"
//
// Group header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -106,6 +106,7 @@ public:
widget if \p before is not in the group.
*/
void insert(Fl_Widget& o, Fl_Widget* before) {insert(o,find(before));}
void remove(int index);
void remove(Fl_Widget&);
/**
Removes the widget \p o from the group.
@@ -127,13 +128,13 @@ public:
In these examples the gray area is the resizable:
\image html resizebox1.gif
\image html resizebox1.png
\image html resizebox2.gif
\image html resizebox2.png
\image latex resizebox1.eps "before resize" width=4cm
\image latex resizebox1.png "before resize" width=4cm
\image latex resizebox2.eps "after resize" width=4cm
\image latex resizebox2.png "after resize" width=4cm
The resizable may be set to the group itself, in which case all the
contents are resized. This is the default value for Fl_Group,
@@ -176,12 +177,7 @@ public:
*/
unsigned int clip_children() { return (flags() & CLIP_CHILDREN) != 0; }
/** Returns an Fl_Group pointer if this widget is an Fl_Group.
\retval NULL if this widget is not derived from Fl_Group.
\note This method is provided to avoid dynamic_cast.
\todo More documentation ...
*/
// Note: Doxygen docs in Fl_Widget.H to avoid redundancy.
virtual Fl_Group* as_group() { return this; }
// back compatibility functions:
@@ -230,5 +226,5 @@ public:
#endif
//
// End of "$Id: Fl_Group.H 7280 2010-03-16 22:51:31Z matt $".
// End of "$Id: Fl_Group.H 8157 2011-01-01 14:01:53Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Help_Dialog.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Help_Dialog.H 8063 2010-12-19 21:20:10Z matt $"
//
// Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -43,8 +43,8 @@
class FL_EXPORT Fl_Help_Dialog {
int index_;
int max_;
int line_[100];
char file_[100][256];
int line_[100]; // FIXME: we must remove those static numbers
char file_[100][FL_PATH_MAX]; // FIXME: we must remove those static numbers
int find_pos_;
public:
Fl_Help_Dialog();
@@ -91,5 +91,5 @@ public:
#endif
//
// End of "$Id: Fl_Help_Dialog.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Help_Dialog.H 8063 2010-12-19 21:20:10Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Help_View.H 7139 2010-02-23 15:55:22Z greg.ercolano $"
// "$Id: Fl_Help_View.H 8306 2011-01-24 17:04:22Z matt $"
//
// Help Viewer widget definitions.
//
// Copyright 1997-2009 by Easy Software Products.
// Copyright 1997-2010 by Easy Software Products.
// Image support by Matthias Melcher, Copyright 2000-2009.
//
// This library is free software; you can redistribute it and/or
@@ -42,6 +42,7 @@
# include "Fl_Scrollbar.H"
# include "fl_draw.H"
# include "Fl_Shared_Image.H"
# include "filename.H"
//
@@ -56,8 +57,7 @@ typedef const char *(Fl_Help_Func)(Fl_Widget *, const char *);
// Fl_Help_Block structure...
//
struct Fl_Help_Block
{
struct Fl_Help_Block {
const char *start, // Start of text
*end; // End of text
uchar border; // Draw border?
@@ -73,8 +73,7 @@ struct Fl_Help_Block
// Fl_Help_Link structure...
//
/** Definition of a link for the html viewer. */
struct Fl_Help_Link
{
struct Fl_Help_Link {
char filename[192], ///< Reference filename
name[32]; ///< Link target (blank if none)
int x, ///< X offset of link text
@@ -88,7 +87,7 @@ struct Fl_Help_Link
*/
/** Fl_Help_View font stack element definition. */
struct Fl_Help_Font_Style {
struct FL_EXPORT Fl_Help_Font_Style {
Fl_Font f; ///< Font
Fl_Fontsize s; ///< Font Size
Fl_Color c; ///< Font Color
@@ -101,7 +100,7 @@ struct Fl_Help_Font_Style {
/** Fl_Help_View font stack definition. */
const size_t MAX_FL_HELP_FS_ELTS = 100;
struct Fl_Help_Font_Stack {
struct FL_EXPORT Fl_Help_Font_Stack {
/** font stack construction, initialize attributes. */
Fl_Help_Font_Stack() {
nfonts_ = 0;
@@ -137,8 +136,7 @@ protected:
/** Fl_Help_Target structure */
struct Fl_Help_Target
{
struct Fl_Help_Target {
char name[32]; ///< Target name
int y; ///< Y offset of target
};
@@ -208,8 +206,8 @@ struct Fl_Help_Target
- yen Yuml yuml
*/
class FL_EXPORT Fl_Help_View : public Fl_Group // Help viewer widget
{
class FL_EXPORT Fl_Help_View : public Fl_Group { // Help viewer widget
enum { RIGHT = -1, CENTER, LEFT }; ///< Alignments
char title_[1024]; ///< Title string
@@ -220,7 +218,7 @@ class FL_EXPORT Fl_Help_View : public Fl_Group // Help viewer widget
Fl_Font textfont_; ///< Default font for text
Fl_Fontsize textsize_; ///< Default font size
const char *value_; ///< HTML text value
Fl_Help_Font_Stack fstack_; ///< font stack management
Fl_Help_Font_Stack fstack_; ///< font stack management
int nblocks_, ///< Number of blocks/paragraphs
ablocks_; ///< Allocated blocks
Fl_Help_Block *blocks_; ///< Blocks
@@ -235,8 +233,8 @@ class FL_EXPORT Fl_Help_View : public Fl_Group // Help viewer widget
atargets_; ///< Allocated targets
Fl_Help_Target *targets_; ///< Targets
char directory_[1024]; ///< Directory for current file
char filename_[1024]; ///< Current filename
char directory_[FL_PATH_MAX];///< Directory for current file
char filename_[FL_PATH_MAX]; ///< Current filename
int topline_, ///< Top line in document
leftline_, ///< Lefthand position
size_, ///< Total document length
@@ -394,5 +392,5 @@ public:
#endif // !Fl_Help_View_H
//
// End of "$Id: Fl_Help_View.H 7139 2010-02-23 15:55:22Z greg.ercolano $".
// End of "$Id: Fl_Help_View.H 8306 2011-01-24 17:04:22Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Hold_Browser.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Hold_Browser.H 8736 2011-05-24 20:00:56Z AlbrechtS $"
//
// Hold browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -42,7 +42,7 @@
user releases the mouse, but you can change this with when().
<P>See Fl_Browser for methods to add and remove lines from the browser.
*/
class Fl_Hold_Browser : public Fl_Browser {
class FL_EXPORT Fl_Hold_Browser : public Fl_Browser {
public:
/**
Creates a new Fl_Hold_Browser widget using the given
@@ -50,12 +50,16 @@ public:
The constructor specializes Fl_Browser() by setting the type to FL_HOLD_BROWSER.
The destructor destroys the widget and frees all memory that has been allocated.
*/
Fl_Hold_Browser(int X,int Y,int W,int H,const char *l=0)
: Fl_Browser(X,Y,W,H,l) {type(FL_HOLD_BROWSER);}
#if defined(FL_DLL) // implementation in src/Fl_Browser.cxx
Fl_Hold_Browser(int X,int Y,int W,int H,const char *L=0);
#else
Fl_Hold_Browser(int X,int Y,int W,int H,const char *L=0)
: Fl_Browser(X,Y,W,H,L) {type(FL_HOLD_BROWSER);}
#endif
};
#endif
//
// End of "$Id: Fl_Hold_Browser.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Hold_Browser.H 8736 2011-05-24 20:00:56Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Hor_Fill_Slider.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Hor_Fill_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Horizontal fill slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -33,7 +33,7 @@
#include "Fl_Slider.H"
class Fl_Hor_Fill_Slider : public Fl_Slider {
class FL_EXPORT Fl_Hor_Fill_Slider : public Fl_Slider {
public:
Fl_Hor_Fill_Slider(int x,int y,int w,int h,const char *l=0)
: Fl_Slider(x,y,w,h,l) {type(FL_HOR_FILL_SLIDER);}
@@ -42,5 +42,5 @@ public:
#endif
//
// End of "$Id: Fl_Hor_Fill_Slider.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Hor_Fill_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Hor_Nice_Slider.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Hor_Nice_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Horizontal "nice" slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -33,7 +33,7 @@
#include "Fl_Slider.H"
class Fl_Hor_Nice_Slider : public Fl_Slider {
class FL_EXPORT Fl_Hor_Nice_Slider : public Fl_Slider {
public:
Fl_Hor_Nice_Slider(int x,int y,int w,int h,const char *l=0)
: Fl_Slider(x,y,w,h,l) {type(FL_HOR_NICE_SLIDER); box(FL_FLAT_BOX);}
@@ -42,5 +42,5 @@ public:
#endif
//
// End of "$Id: Fl_Hor_Nice_Slider.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Hor_Nice_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Hor_Slider.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Hor_Slider.H 8726 2011-05-23 18:32:47Z AlbrechtS $"
//
// Horizontal slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -33,14 +33,28 @@
#include "Fl_Slider.H"
class Fl_Hor_Slider : public Fl_Slider {
/** Horizontal Slider class.
\see class Fl_Slider.
*/
class FL_EXPORT Fl_Hor_Slider : public Fl_Slider {
public:
Fl_Hor_Slider(int X,int Y,int W,int H,const char *l=0)
: Fl_Slider(X,Y,W,H,l) {type(FL_HOR_SLIDER);}
/**
Creates a new Fl_Hor_Slider widget using the given position,
size, and label string.
*/
#if defined(FL_DLL) // implementation in src/Fl_Slider.cxx
Fl_Hor_Slider(int X,int Y,int W,int H,const char *l=0);
#else
Fl_Hor_Slider(int X,int Y,int W,int H,const char *l=0)
: Fl_Slider(X,Y,W,H,l) { type(FL_HOR_SLIDER); }
#endif
};
#endif
//
// End of "$Id: Fl_Hor_Slider.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Hor_Slider.H 8726 2011-05-23 18:32:47Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Hor_Value_Slider.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Hor_Value_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Horizontal value slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -33,7 +33,7 @@
#include "Fl_Value_Slider.H"
class Fl_Hor_Value_Slider : public Fl_Value_Slider {
class FL_EXPORT Fl_Hor_Value_Slider : public Fl_Value_Slider {
public:
Fl_Hor_Value_Slider(int X,int Y,int W,int H,const char *l=0)
: Fl_Value_Slider(X,Y,W,H,l) {type(FL_HOR_SLIDER);}
@@ -42,5 +42,5 @@ public:
#endif
//
// End of "$Id: Fl_Hor_Value_Slider.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Hor_Value_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Image.H 7617 2010-05-27 17:20:18Z manolo $"
// "$Id: Fl_Image.H 8338 2011-01-30 09:24:40Z manolo $"
//
// Image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -59,33 +59,24 @@ class FL_EXPORT Fl_Image {
protected:
/**
The first form of the w() method returns the current
image width in pixels.</P>
<P>The second form is a protected method that sets the current
image width.
Sets the current image width in pixels.
*/
void w(int W) {w_ = W;}
/**
The first form of the h() method returns the current
image height in pixels.</P>
<P>The second form is a protected method that sets the current
image height.
Sets the current image height in pixels.
*/
void h(int H) {h_ = H;}
/**
The first form of the d() method returns the current
image depth. The return value will be 0 for bitmaps, 1 for
pixmaps, and 1 to 4 for color images.</P>
<P>The second form is a protected method that sets the current
image depth.
Sets the current image depth.
*/
void d(int D) {d_ = D;}
/** See int ld() */
/**
Sets the current line data size in bytes.
*/
void ld(int LD) {ld_ = LD;}
/** See const char * const *data() */
/**
Sets the current array pointer and count of pointers in the array.
*/
void data(const char * const *p, int c) {data_ = p; count_ = c;}
void draw_empty(int X, int Y);
@@ -94,26 +85,23 @@ class FL_EXPORT Fl_Image {
public:
/** See void Fl_Image::w(int) */
/**
Returns the current image width in pixels.
*/
int w() const {return w_;}
/** See void Fl_Image::h(int) */
/** Returns the current image height in pixels.
*/
int h() const {return h_;}
/**
The first form of the d() method returns the current
image depth. The return value will be 0 for bitmaps, 1 for
Returns the current image depth.
The return value will be 0 for bitmaps, 1 for
pixmaps, and 1 to 4 for color images.</P>
<P>The second form is a protected method that sets the current
image depth.
*/
int d() const {return d_;}
/**
The first form of the ld() method returns the current
line data size in bytes. Line data is extra data that is included
after each line of color image data and is normally not present.</P>
<P>The second form is a protected method that sets the current
line data size in bytes.
Returns the current line data size in bytes.
Line data is extra data that is included
after each line of color image data and is normally not present.
*/
int ld() const {return ld_;}
/**
@@ -124,12 +112,8 @@ class FL_EXPORT Fl_Image {
*/
int count() const {return count_;}
/**
The first form of the data() method returns a
pointer to the current image data array. Use the
count() method to find the size of the data array.</P>
<P>The second form is a protected method that sets the current
array pointer and count of pointers in the array.
Returns a pointer to the current image data array.
Use the count() method to find the size of the data array.
*/
const char * const *data() const {return data_;}
@@ -162,15 +146,16 @@ class FL_EXPORT Fl_Image {
virtual void label(Fl_Widget*w);
virtual void label(Fl_Menu_Item*m);
/**
The draw() methods draw the image. This form specifies
Draws the image with a bounding box.
This form specifies
a bounding box for the image, with the origin
(upper-lefthand corner) of the image offset by the cx
and cy arguments.
*/
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0); // platform dependent
/**
The draw() methods draw the image. This form
specifies the upper-lefthand corner of the image
Draws the image.
This form specifies the upper-lefthand corner of the image.
*/
void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);} // platform dependent
virtual void uncache();
@@ -226,5 +211,5 @@ public:
#endif // !Fl_Image_H
//
// End of "$Id: Fl_Image.H 7617 2010-05-27 17:20:18Z manolo $".
// End of "$Id: Fl_Image.H 8338 2011-01-30 09:24:40Z manolo $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Input.H 6699 2009-03-18 22:58:12Z engelsman $"
// "$Id: Fl_Input.H 8111 2010-12-23 08:13:18Z manolo $"
//
// Input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -37,217 +37,232 @@
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>
<CENTER><TABLE border=1 WIDTH=90% summary="Fl_Input keyboard and mouse bindings.">
<TR><TD WIDTH=200><B>Mouse button 1</B></TD><TD>Moves the cursor to
this point. Drag selects characters. Double click selects words.
Triple click selects all text. Shift+click extends the selection.
When you select text it is automatically copied to the clipboard.
</TD></TR>
<TR><TD><B>Mouse button 2</B></TD><TD>Insert the clipboard at
the point clicked. You can also select a region and replace it with the
clipboard by selecting the region with mouse button 2.
</TD></TR>
<TR><TD><B>Mouse button 3</B></TD><TD>Currently acts like button 1.</TD></TR>
<TR><TD><B>Backspace</B></TD><TD>Deletes one character to the left, or
deletes the selected region.</TD></TR>
<TR><TD><B>Enter</B></TD><TD>May cause the callback, see when().</TD></TR>
<TR><TD><B>^A or Home</B></TD><TD>Go to start of line.</TD></TR>
<TR><TD><B>^B or Left</B></TD><TD>Move left</TD></TR>
<TR><TD><B>^C</B></TD><TD>Copy the selection to the clipboard</TD></TR>
<TR><TD><B>^D or Delete</B></TD><TD>Deletes one character to the right
or deletes the selected region.</TD></TR>
<TR><TD><B>^E or End</B></TD><TD>Go to the end of line.</TD></TR>
<TR><TD><B>^F or Right</B></TD><TD>Move right</TD></TR>
<TR><TD><B>^K</B></TD><TD>Delete to the end of line (next \\n character)
or deletes a single \\n character. These deletions are all concatenated
into the clipboard.</TD></TR>
<TR><TD><B>^N or Down</B></TD><TD>Move down (for Fl_Multiline_Input
only, otherwise it moves to the next input field).</TD></TR>
<TR><TD><B>^P or Up</B></TD><TD>Move up (for Fl_Multiline_Input only,
otherwise it moves to the previous input field).</TD></TR>
<TR><TD><B>^U</B></TD><TD>Delete everything.</TD></TR>
<TR><TD><B>^V or ^Y</B></TD><TD>Paste the clipboard</TD></TR>
<TR><TD><B>^X or ^W</B></TD><TD>Copy the region to the clipboard and
delete it.</TD></TR>
<TR><TD><B>^Z or ^_</B></TD><TD>Undo. This is a single-level undo
mechanism, but all adjacent deletions and insertions are concatenated
into a single "undo". Often this will undo a lot more than you
expected.</TD></TR>
<TR><TD><B>Shift+move</B></TD><TD>Move the cursor but also extend the
selection.</TD></TR>
<TR><TD><B>RightCtrl or
<BR>Compose</B></TD><TD>
\anchor Fl_Input_Compose_Character
Start a compose-character
sequence. The next one or two keys typed define the character to
insert (see table that follows.)
<p>For instance, to type "<22>" 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 "<22>~" rather than "<22>" 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
[compose][Control+Q].
<p>X may have a key on the keyboard
defined as XK_Multi_key. If so this key may be used as well
as the right-hand control key. You can set this up with the program
xmodmap.
<p>If your keyboard is set to support a foreign language you should
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>
</TABLE></CENTER>
<!-- NEW PAGE -->
<center><table border=1 summary="Character Composition Table">
<caption align="top">Character Composition Table</caption>
<tr>
<th>Keys</th><th>Char</th>
<th>Keys</th><th>Char</th>
<th>Keys</th><th>Char</th>
<th>Keys</th><th>Char</th>
<th>Keys</th><th>Char</th>
<th>Keys</th><th>Char</th>
</tr><tr>
<td align=center>sp</td><td align=center><small>nbsp</small></td>
<td align=center>*</td><td align=center><3E></td>
<td align=center>` A</td><td align=center><3E></td>
<td align=center>D -</td><td align=center><3E></td>
<td align=center>` a</td><td align=center><3E></td>
<td align=center>d -</td><td align=center><3E></td>
</tr><tr>
<td align=center>!</td><td align=center><3E></td>
<td align=center>+ -</td><td align=center><3E></td>
<td align=center>' A</td><td align=center><3E></td>
<td align=center>~ N</td><td align=center><3E></td>
<td align=center>' a</td><td align=center><3E></td>
<td align=center>~ n</td><td align=center><3E></td>
</tr><tr>
<td align=center>%</td><td align=center><3E></td>
<td align=center>2</td><td align=center><3E></td>
<td align=center>A ^</td><td align=center><3E></td>
<td align=center>` O</td><td align=center><3E></td>
<td align=center>^ a</td><td align=center><3E></td>
<td align=center>` o</td><td align=center><3E></td>
</tr><tr>
<td align=center>#</td><td align=center><3E></td>
<td align=center>3</td><td align=center><3E></td>
<td align=center>~ A</td><td align=center><3E></td>
<td align=center>' O</td><td align=center><3E></td>
<td align=center>~ a</td><td align=center><3E></td>
<td align=center>' o</td><td align=center><3E></td>
</tr><tr>
<td align=center>$</td><td align=center><3E></td>
<td align=center>'</td><td align=center><3E></td>
<td align=center>: A</td><td align=center><3E></td>
<td align=center>^ O</td><td align=center><3E></td>
<td align=center>: a</td><td align=center><3E></td>
<td align=center>^ o</td><td align=center><3E></td>
</tr><tr>
<td align=center>y =</td><td align=center><3E></td>
<td align=center>u</td><td align=center><3E></td>
<td align=center>* A</td><td align=center><3E></td>
<td align=center>~ O</td><td align=center><3E></td>
<td align=center>* a</td><td align=center><3E></td>
<td align=center>~ o</td><td align=center><3E></td>
</tr><tr>
<td align=center>|</td><td align=center><3E></td>
<td align=center>p</td><td align=center><3E></td>
<td align=center>A E</td><td align=center><3E></td>
<td align=center>: O</td><td align=center><3E></td>
<td align=center>a e</td><td align=center><3E></td>
<td align=center>: o</td><td align=center><3E></td>
</tr><tr>
<td align=center>&</td><td align=center><3E></td>
<td align=center>.</td><td align=center><3E></td>
<td align=center>, C</td><td align=center><3E></td>
<td align=center>x</td><td align=center><3E></td>
<td align=center>, c</td><td align=center><3E></td>
<td align=center>- :</td><td align=center><3E></td>
</tr><tr>
<td align=center>:</td><td align=center><3E></td>
<td align=center>,</td><td align=center><3E></td>
<td align=center>E `</td><td align=center><3E></td>
<td align=center>O /</td><td align=center><3E></td>
<td align=center>` e</td><td align=center><3E></td>
<td align=center>o /</td><td align=center><3E></td>
</tr><tr>
<td align=center>c</td><td align=center><3E></td>
<td align=center>1</td><td align=center><3E></td>
<td align=center>' E</td><td align=center><3E></td>
<td align=center>` U</td><td align=center><3E></td>
<td align=center>' e</td><td align=center><3E></td>
<td align=center>` u</td><td align=center><3E></td>
</tr><tr>
<td align=center>a</td><td align=center><3E></td>
<td align=center>o</td><td align=center><3E></td>
<td align=center>^ E</td><td align=center><3E></td>
<td align=center>' U</td><td align=center><3E></td>
<td align=center>^ e</td><td align=center><3E></td>
<td align=center>' u</td><td align=center><3E></td>
</tr><tr>
<td align=center>&lt; &lt;</td><td align=center><3E></td>
<td align=center>&gt; &gt;</td><td align=center><3E></td>
<td align=center>: E</td><td align=center><3E></td>
<td align=center>^ U</td><td align=center><3E></td>
<td align=center>: e</td><td align=center><3E></td>
<td align=center>^ u</td><td align=center><3E></td>
</tr><tr>
<td align=center>~</td><td align=center><3E></td>
<td align=center>1 4</td><td align=center><3E></td>
<td align=center>` I</td><td align=center><3E></td>
<td align=center>: U</td><td align=center><3E></td>
<td align=center>` i</td><td align=center><3E></td>
<td align=center>: u</td><td align=center><3E></td>
</tr><tr>
<td align=center>-</td><td align=center><3E></td>
<td align=center>1 2</td><td align=center><3E></td>
<td align=center>' I</td><td align=center><3E></td>
<td align=center>' Y</td><td align=center><3E></td>
<td align=center>' i</td><td align=center><3E></td>
<td align=center>' y</td><td align=center><3E></td>
</tr><tr>
<td align=center>r</td><td align=center><3E></td>
<td align=center>3 4</td><td align=center><3E></td>
<td align=center>^ I</td><td align=center><3E></td>
<td align=center>T H</td><td align=center><3E></td>
<td align=center>^ i</td><td align=center><3E></td>
<td align=center>t h</td><td align=center><3E></td>
</tr><tr>
<td align=center>_</td><td align=center><3E></td>
<td align=center>?</td><td align=center><3E></td>
<td align=center>: I</td><td align=center><3E></td>
<td align=center>s s</td><td align=center><3E></td>
<td align=center>: i</td><td align=center><3E></td>
<td align=center>: y</td><td align=center><3E></td>
</tr>
</table></center>
*/
characters, 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.
Characters can be input using the keyboard or the character palette/map.
Character composition is done using dead keys and/or a compose
key as defined by the operating system.
<P>
<TABLE WIDTH=90% BORDER=1 SUMMARY="Fl_Input keyboard and mouse bindings.">
<CAPTION ALIGN=TOP>Fl_Input keyboard and mouse bindings.</CAPTION>
<TR><TD NOWRAP="NOWRAP" WIDTH="1%">
<B>Mouse button 1</B>
</TD><TD>
Moves the cursor to this point.
Drag selects characters.
Double click selects words.
Triple click selects all line.
Shift+click extends the selection.
When you select text it is automatically copied to the selection buffer.
</TD></TR><TR><TD NOWRAP="NOWRAP">
<B>Mouse button 2</B>
</TD><TD>
Insert the selection buffer at the point clicked.
You can also select a region and replace it with the selection buffer
by selecting the region with mouse button 2.
</TD></TR><TR><TD NOWRAP="NOWRAP">
<B>Mouse button 3</B>
</TD><TD>
Currently acts like button 1.
</TD></TR><TR><TD NOWRAP="NOWRAP">
<B>Backspace</B>
</TD><TD>
Deletes one character to the left, or deletes the selected region.
</TD></TR><TR><TD NOWRAP="NOWRAP">
<B>Delete</B>
</TD><TD>
Deletes one character to the right, or deletes the selected region.
Combine with Shift for equivalent of ^X (copy+cut).
</TD></TR><TR><TD NOWRAP="NOWRAP">
<B>Enter</b>
</TD><TD>
May cause the callback, see when().
</TD></TR></TABLE>
<P>
<TABLE WIDTH="90%" BORDER="1" SUMMARY="Fl_Input platform specific keyboard bindings.">
<CAPTION ALIGN=TOP>Fl_Input platform specific keyboard bindings.</CAPTION>
<TR>
<TD NOWRAP="NOWRAP" WIDTH="1%"><B> Windows/Linux </B></TD>
<TD NOWRAP="NOWRAP" WIDTH="1%"><B> Mac </B></TD>
<TD NOWRAP="NOWRAP" ><B> Function </B></TD>
</TR><TR>
<TD NOWRAP="NOWRAP"><B> ^A </B></TD>
<TD NOWRAP="NOWRAP"><B> Command-A </B></TD>
<TD>
<B>Selects all text in the widget.</B>
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> ^C </B></TD>
<TD NOWRAP="NOWRAP"><B> Command-C </B></TD>
<TD>
<B>Copy the current selection to the clipboard.</B>
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> ^I </B></TD>
<TD NOWRAP="NOWRAP"><B> ^I </B></TD>
<TD>
<B>Insert a tab.</B>
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> ^J </B></TD>
<TD NOWRAP="NOWRAP"><B> ^J </B></TD>
<TD>
<B>Insert a Line Feed.</B> <BR>
(Similar to literal 'Enter' character)
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> ^L </B></TD>
<TD NOWRAP="NOWRAP"><B> ^L </B></TD>
<TD>
<B>Insert a Form Feed.</B>
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> ^M </B></TD>
<TD NOWRAP="NOWRAP"><B> ^M </B></TD>
<TD>
<B>Insert a Carriage Return.</B>
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> ^V,<BR>Shift-Insert </B></TD>
<TD NOWRAP="NOWRAP"><B> Command-V </B></TD>
<TD>
<B>Paste the clipboard.</B> <BR>
(Macs keyboards don't have "Insert" keys,
but if they did, Shift-Insert would work)
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> ^X,<BR>Shift-Delete </B></TD>
<TD NOWRAP="NOWRAP"><B> Command-X,<BR>Shift-Delete </B></TD>
<TD>
<B>Cut.</B> <BR>
Copy the selection to the clipboard and delete it.
(If there's no selection, Shift-Delete acts like Delete)
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> ^Z </B></TD>
<TD NOWRAP="NOWRAP"><B> Command-Z </B></TD>
<TD>
<B>Undo.</B> <BR>
This is a single-level undo mechanism, but all adjacent
deletions and insertions are concatenated into a single "undo".
Often this will undo a lot more than you expected.
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> Shift-^Z </B></TD>
<TD NOWRAP="NOWRAP"><B> Shift-Command-Z </B></TD>
<TD>
<B>Redo.</B> <BR>
Currently same behavior as ^Z.
Reserved for future multilevel undo/redo.
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> Arrow Keys </B></TD>
<TD NOWRAP="NOWRAP"><B> Arrow Keys </B></TD>
<TD>
<B>Standard cursor movement.</B> <BR>
Can be combined with Shift to extend selection.
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> Home </B></TD>
<TD NOWRAP="NOWRAP"><B> Command-Up,<BR>Command-Left </B></TD>
<TD>
<B>Move to start of line.</B> <BR>
Can be combined with Shift to extend selection.
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> End </B></TD>
<TD NOWRAP="NOWRAP"><B> Command-Down,<BR>Command-Right </B></TD>
<TD>
<B>Move to end of line.</B> <BR>
Can be combined with Shift to extend selection.
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B>Ctrl-Home</B></TD>
<TD NOWRAP="NOWRAP"><B>Command-Up,<BR>Command-PgUp,<BR>Ctrl-Left</B></TD>
<TD>
<B>Move to top of document/field.</B> <BR>
In single line input, moves to start of line.
In multiline input, moves to start of top line.
Can be combined with Shift to extend selection.
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> Ctrl-End </B></TD>
<TD NOWRAP="NOWRAP"><B> Command-End,<BR>Command-PgDn,<BR>Ctrl-Right</B></TD>
<TD>
<B>Move to bottom of document/field.</B> <BR>
In single line input, moves to end of line.
In multiline input, moves to end of last line.
Can be combined with Shift to extend selection.
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> Ctrl-Left </B></TD>
<TD NOWRAP="NOWRAP"><B> Alt-Left </B></TD>
<TD>
<B>Word left.</B> <BR>
Can be combined with Shift to extend selection.
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> Ctrl-Right </B></TD>
<TD NOWRAP="NOWRAP"><B> Alt-Right </B></TD>
<TD>
<B>Word right.</B> <BR>
Can be combined with Shift to extend selection.
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> Ctrl-Backspace </B></TD>
<TD NOWRAP="NOWRAP"><B> Alt-Backspace </B></TD>
<TD>
<B>Delete word left.</B>
</TD></TR><TR>
<TD NOWRAP="NOWRAP"><B> Ctrl-Delete </B></TD>
<TD NOWRAP="NOWRAP"><B> Alt-Delete </B></TD>
<TD>
<B>Delete word right.</B>
</TD></TR></TABLE>
*/
class FL_EXPORT Fl_Input : public Fl_Input_ {
int handle_key();
int shift_position(int p);
int shift_up_down_position(int p);
void handle_mouse(int keepmark=0);
// Private keyboard functions
int kf_lines_up(int repeat_num);
int kf_lines_down(int repeat_num);
int kf_page_up();
int kf_page_down();
int kf_insert_toggle();
int kf_delete_word_right();
int kf_delete_word_left();
int kf_delete_sol();
int kf_delete_eol();
int kf_delete_char_right();
int kf_delete_char_left();
int kf_move_sol();
int kf_move_eol();
int kf_clear_eol();
int kf_move_char_left();
int kf_move_char_right();
int kf_move_word_left();
int kf_move_word_right();
int kf_move_up_and_sol();
int kf_move_down_and_eol();
int kf_top();
int kf_bottom();
int kf_select_all();
int kf_undo();
int kf_redo();
int kf_copy();
int kf_paste();
int kf_copy_cut();
protected:
void draw();
public:
@@ -258,5 +273,5 @@ public:
#endif
//
// End of "$Id: Fl_Input.H 6699 2009-03-18 22:58:12Z engelsman $".
// End of "$Id: Fl_Input.H 8111 2010-12-23 08:13:18Z manolo $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Input_.H 7672 2010-07-10 09:44:45Z matt $"
// "$Id: Fl_Input_.H 8068 2010-12-20 07:48:59Z greg.ercolano $"
//
// Input base class header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -58,10 +58,10 @@
one of those people who likes to change how the editing keys
work. It may also be useful for adding scrollbars
to the input field.
This can act like any of the subclasses of Fl_Input, by
setting type() to one of the following values:
\code
#define FL_NORMAL_INPUT 0
#define FL_FLOAT_INPUT 1
@@ -78,26 +78,26 @@
\endcode
All variables that represent an index into a text buffer are byte-oriented,
not character oriented. Since utf8 characters can be up to six bytes long,
not character oriented. Since UTF-8 characters can be up to six bytes long,
simply incrementing such an index will not reliably advance to the next character
in the text buffer.
in the text buffer.
Indices and pointers into the text buffer should always point at a 7 bit ASCII
character or the beginning of a utf8 character sequence. Behavior for false
utf8 sequences and pointers into the middle of a seqeunce are undefined.
Indices and pointers into the text buffer should always point at a 7 bit ASCII
character or the beginning of a UTF-8 character sequence. Behavior for false
UTF-8 sequences and pointers into the middle of a sequence are undefined.
\see Fl_Text_Display, Fl_Text_Editor for more powerful text handling widgets
\internal
When porting this widget from ASCII to UTF8, previously legal pointers into
When porting this widget from ASCII to UTF-8, previously legal pointers into
the text of this widget can become illegal by pointing into the middle of
a UTF8 seuence. This is not a big problem for Fl_Input_ because all code
a UTF-8 sequence. This is not a big problem for Fl_Input_ because all code
in this module is quite tolerant. It could be problematic though when deriving
from this class because no feedback for illegal pointers is given. Additionaly,
a careless "copy" call can put partial UTF8 sequnces into the clipboard.
from this class because no feedback for illegal pointers is given. Additionally,
a careless "copy" call can put partial UTF-8 sequences into the clipboard.
None of these issues should be desasterous. Nevertheless, we should
discuss how FLTK should handle false UTF8 suequences and pointers.
None of these issues should be disastrous. Nevertheless, we should
discuss how FLTK should handle false UTF-8 sequences and pointers.
*/
class FL_EXPORT Fl_Input_ : public Fl_Widget {
@@ -113,17 +113,22 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget {
/** \internal \todo Please document me! */
int bufsize;
/** \internal Positin of the cursor in the document */
/** \internal Position of the cursor in the document. */
int position_;
/** \internal Position of the other end of the selected text. If \p position_ equals
\p mark_, no text is selected */
int mark_;
/** \internal Behavior of Tab key in multiline input widget.
If enabled (default) Tab causes focus nav, otherwise Tab is inserted
as a character. */
int tab_nav_;
/** \internal Offset to text origin within widget bounds */
int xscroll_, yscroll_;
/** \internal Minimal update pointer. Display requirs redraw from here to the end
/** \internal Minimal update pointer. Display requires redraw from here to the end
of the buffer. */
int mu_p;
@@ -148,7 +153,7 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget {
/** \internal color of the text cursor */
Fl_Color cursor_color_;
/** \internal Horizontal cursor position in pixels while movin up or down. */
/** \internal Horizontal cursor position in pixels while moving up or down. */
static double up_down_pos;
/** \internal Flag to remember last cursor move. */
@@ -192,7 +197,7 @@ protected:
/* Move the cursor to the column given by up_down_pos. */
int up_down_position(int, int keepmark=0);
/* Handle mouse clicks and mose moves. */
/* Handle mouse clicks and mouse moves. */
void handle_mouse(int, int, int, int, int keepmark=0);
/* Handle all kinds of text field related events. */
@@ -294,7 +299,7 @@ public:
int position(int p) {return position(p, p);}
/** Sets the current selection mark.
mark(n) is the same as <tt>position(position(),n)</tt>.
mark(n) is the same as <tt>position(position(),n)</tt>.
\param m new index of the mark
\return 0 if the mark did not change
\see position(), position(int, int) */
@@ -364,13 +369,13 @@ public:
/* Copy the yank buffer to the clipboard. */
int copy_cuts();
/** Return the shortcut key associtaed with this widget.
/** Return the shortcut key associated with this widget.
\return shortcut keystroke
\see Fl_Button::shortcut() */
int shortcut() const {return shortcut_;}
/**
Sets the shortcut key associtaed with this widget.
Sets the shortcut key associated with this widget.
Pressing the shortcut key gives text editing focus to this widget.
\param [in] s new shortcut keystroke
\see Fl_Button::shortcut()
@@ -446,10 +451,47 @@ public:
void wrap(int b) { if (b) type((uchar)(type() | FL_INPUT_WRAP));
else type((uchar)(type() & ~FL_INPUT_WRAP)); }
/**
Sets whether the Tab key does focus navigation,
or inserts tab characters into Fl_Multiline_Input.
By default this flag is enabled to provide the 'normal' behavior
most users expect; Tab navigates focus to the next widget.
To inserting an actual Tab character, users can use Ctrl-I
or copy/paste.
Disabling this flag gives the old FLTK behavior where Tab
inserts a tab character into the text field, in which case
only the mouse can be used to navigate to the next field.
History: This flag was provided for backwards support of FLTK's old 1.1.x
behavior where Tab inserts a tab character instead of navigating
focus to the next widget. This behavior was unique to Fl_Multiline_Input.
With the advent of Fl_Text_Editor, this old behavior has been deprecated.
\param [in] val If \p val is 1, Tab advances focus (default).<BR>
If \p val is 0, Tab inserts a tab character (old FLTK behavior).
*/
void tab_nav(int val) {
tab_nav_ = val;
}
/**
Gets whether the Tab key causes focus navigation in multiline input fields or not.
If enabled (default), hitting Tab causes focus navigation to the next widget.
If disabled, hitting Tab inserts a tab character into the text field.
\returns 1 if Tab advances focus (default), 0 if Tab inserts tab characters.
\see tab_nav(int)
*/
int tab_nav() const {
return tab_nav_;
}
};
#endif
//
// End of "$Id: Fl_Input_.H 7672 2010-07-10 09:44:45Z matt $".
// End of "$Id: Fl_Input_.H 8068 2010-12-20 07:48:59Z greg.ercolano $".
//

View File

@@ -1,5 +1,5 @@
//
// "$Id: Fl_Input_Choice.H 7115 2010-02-20 17:40:07Z AlbrechtS $"
// "$Id: Fl_Input_Choice.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// An input/chooser widget.
// ______________ ____
@@ -7,7 +7,7 @@
// | input area || \/ |
// |______________||____|
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 by Bill Spitzak and others.
// Copyright 2004 by Greg Ercolano.
//
// This library is free software; you can redistribute it and/or
@@ -56,7 +56,7 @@
widgets directly, using the menubutton()
and input() accessor methods.
*/
class Fl_Input_Choice : public Fl_Group {
class FL_EXPORT Fl_Input_Choice : public Fl_Group {
// Private class to handle slightly 'special' behavior of menu button
class InputMenuButton : public Fl_Menu_Button {
void draw() {
@@ -218,5 +218,5 @@ public:
#endif // !Fl_Input_Choice_H
//
// End of "$Id: Fl_Input_Choice.H 7115 2010-02-20 17:40:07Z AlbrechtS $".
// End of "$Id: Fl_Input_Choice.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Int_Input.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Int_Input.H 8726 2011-05-23 18:32:47Z AlbrechtS $"
//
// Integer input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -34,22 +34,28 @@
#include "Fl_Input.H"
/**
The Fl_Int_Input class is a subclass of Fl_Input
that only allows the user to type decimal digits (or hex numbers of the form 0xaef).
The Fl_Int_Input class is a subclass of Fl_Input that only allows
the user to type decimal digits (or hex numbers of the form 0xaef).
*/
class Fl_Int_Input : public Fl_Input {
class FL_EXPORT Fl_Int_Input : public Fl_Input {
public:
/**
Creates a new Fl_Int_Input widget using the given position,
size, and label string. The default boxtype is FL_DOWN_BOX.
<P>Inherited destructor Destroys the widget and any value associated with it.
Inherited destructor destroys the widget and any value associated with it.
*/
#if defined(FL_DLL) // implementation in src/Fl_Input.cxx
Fl_Int_Input(int X,int Y,int W,int H,const char *l = 0);
#else
Fl_Int_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(X,Y,W,H,l) {type(FL_INT_INPUT);}
#endif
};
#endif
//
// End of "$Id: Fl_Int_Input.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Int_Input.H 8726 2011-05-23 18:32:47Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Light_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Light_Button.H 8178 2011-01-04 14:09:37Z manolo $"
//
// Lighted button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -34,15 +34,15 @@
#include "Fl_Button.H"
/**
<P>This subclass displays the "on" state by turning on a light,
This subclass displays the "on" state by turning on a light,
rather than drawing pushed in. The shape of the "light"
is initially set to FL_DOWN_BOX. The color of the light when
on is controlled with selection_color(), which defaults to FL_YELLOW.
Buttons generate callbacks when they are clicked by the user. You
control exactly when and how by changing the values for type() and when().
<P ALIGN=CENTER>\image html Fl_Light_Button.gif</P>
\image latex Fl_Light_Button.eps "Fl_Light_Button" width=4cm
<P ALIGN=CENTER>\image html Fl_Light_Button.png</P>
\image latex Fl_Light_Button.png "Fl_Light_Button" width=4cm
*/
class FL_EXPORT Fl_Light_Button : public Fl_Button {
protected:
@@ -55,5 +55,5 @@ public:
#endif
//
// End of "$Id: Fl_Light_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Light_Button.H 8178 2011-01-04 14:09:37Z manolo $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Line_Dial.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Line_Dial.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Line dial header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -33,7 +33,7 @@
#include "Fl_Dial.H"
class Fl_Line_Dial : public Fl_Dial {
class FL_EXPORT Fl_Line_Dial : public Fl_Dial {
public:
Fl_Line_Dial(int x,int y,int w,int h, const char *l = 0)
: Fl_Dial(x,y,w,h,l) {type(FL_LINE_DIAL);}
@@ -42,5 +42,5 @@ public:
#endif
//
// End of "$Id: Fl_Line_Dial.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Line_Dial.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Menu.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Menu.H 7903 2010-11-28 21:06:39Z matt $"
//
// Old menu header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -29,5 +29,5 @@
#include "Fl_Menu_Item.H"
//
// End of "$Id: Fl_Menu.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Menu.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Menu_.H 7517 2010-04-16 17:55:45Z greg.ercolano $"
// "$Id: Fl_Menu_.H 7903 2010-11-28 21:06:39Z matt $"
//
// Menu base class header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -70,6 +70,17 @@ public:
int find_index(const Fl_Menu_Item *item) const;
int find_index(Fl_Callback *cb) const;
/**
Returns the menu item with the entered shortcut (key value).
This searches the complete menu() for a shortcut that matches the
entered key value. It must be called for a FL_KEYBOARD or FL_SHORTCUT
event.
If a match is found, the menu's callback will be called.
\return matched Fl_Menu_Item or NULL.
*/
const Fl_Menu_Item* test_shortcut() {return picked(menu()->test_shortcut());}
void global();
@@ -116,9 +127,9 @@ public:
the new value is different than the old one.
*/
int value(int i) {return value(menu_+i);}
/** Returns the title of the last item chosen, or of item i. */
/** Returns the title of the last item chosen. */
const char *text() const {return value_ ? value_->text : 0;}
/** Returns the title of the last item chosen, or of item i. */
/** Returns the title of item i. */
const char *text(int i) const {return menu_[i].text;}
/** Gets the current font of menu item labels. */
@@ -153,5 +164,5 @@ public:
#endif
//
// End of "$Id: Fl_Menu_.H 7517 2010-04-16 17:55:45Z greg.ercolano $".
// End of "$Id: Fl_Menu_.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Menu_Bar.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Menu_Bar.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Menu bar header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -44,8 +44,8 @@
top level menu defines the items in the menubar, while the submenus
define the pull-down menus. Sub-sub menus and lower pop up to the right
of the submenus. </P>
<P ALIGN=CENTER>\image html menubar.gif</P>
\image latex menubar.eps " menubar" width=12cm
<P ALIGN=CENTER>\image html menubar.png</P>
\image latex menubar.png " menubar" width=12cm
<P>If there is an item in the top menu that is not a title of a
submenu, then it acts like a "button" in the menubar. Clicking on it
will pick it. </P>
@@ -85,5 +85,5 @@ public:
#endif
//
// End of "$Id: Fl_Menu_Bar.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Menu_Bar.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Menu_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Menu_Button.H 8016 2010-12-12 11:19:12Z manolo $"
//
// Menu button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -37,12 +37,14 @@
This is a button that when pushed pops up a menu (or hierarchy of
menus) defined by an array of
Fl_Menu_Item objects.
<P ALIGN=CENTER>\image html menu_button.gif</P>
\image latex menu_button.eps " menu_button" width=5cm
<P ALIGN=CENTER>\image html menu_button.png</P>
\image latex menu_button.png " menu_button" width=5cm
<P>Normally any mouse button will pop up a menu and it is lined up
below the button as shown in the picture. However an Fl_Menu_Button
may also control a pop-up menu. This is done by setting the type()
, see below. </P>
may also control a pop-up menu. This is done by setting the type().
If type() is zero a normal menu button is produced.
If it is nonzero then this is a pop-up menu. The bits in type() indicate
what mouse buttons pop up the menu (see Fl_Menu_Button::popup_buttons). </P>
<P>The menu will also pop up in response to shortcuts indicated by
putting a '&' character in the label(). </P>
<P>Typing the shortcut() of any of the menu items will cause
@@ -58,8 +60,20 @@ class FL_EXPORT Fl_Menu_Button : public Fl_Menu_ {
protected:
void draw();
public:
// values for type:
enum {POPUP1 = 1, POPUP2, POPUP12, POPUP3, POPUP13, POPUP23, POPUP123};
/**
\brief indicate what mouse buttons pop up the menu.
Values for type() used to indicate what mouse buttons pop up the menu.
Fl_Menu_Button::POPUP3 is usually what you want.
*/
enum popup_buttons {POPUP1 = 1, /**< pops up with the mouse 1st button. */
POPUP2, /**< pops up with the mouse 2nd button. */
POPUP12, /**< pops up with the mouse 1st or 2nd buttons. */
POPUP3, /**< pops up with the mouse 3rd button. */
POPUP13, /**< pops up with the mouse 1st or 3rd buttons. */
POPUP23, /**< pops up with the mouse 2nd or 3rd buttons. */
POPUP123 /**< pops up with any mouse button. */
};
int handle(int);
const Fl_Menu_Item* popup();
Fl_Menu_Button(int,int,int,int,const char * =0);
@@ -68,5 +82,5 @@ public:
#endif
//
// End of "$Id: Fl_Menu_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Menu_Button.H 8016 2010-12-12 11:19:12Z manolo $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Menu_Item.H 7517 2010-04-16 17:55:45Z greg.ercolano $"
// "$Id: Fl_Menu_Item.H 7983 2010-12-09 00:04:06Z AlbrechtS $"
//
// Menu item header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -56,11 +56,11 @@ class Fl_Menu_;
is used by the Fl_Menu_ class.
\code
struct Fl_Menu_Item {
const char* text; // label()
const char* text; // label()
ulong shortcut_;
Fl_Callback* callback_;
Fl_Callback* callback_;
void* user_data_;
int flags;
int flags;
uchar labeltype_;
uchar labelfont_;
uchar labelsize_;
@@ -102,8 +102,8 @@ class Fl_Menu_;
\endcode
produces:
\image html menu.gif
\image latex menu.eps "menu" width=10cm
\image html menu.png
\image latex menu.png "menu" width=10cm
A submenu title is identified by the bit FL_SUBMENU in the
flags field, and ends with a label() that is NULL.
@@ -119,12 +119,12 @@ struct FL_EXPORT Fl_Menu_Item {
const char *text; ///< menu item text, returned by label()
int shortcut_; ///< menu item shortcut
Fl_Callback *callback_; ///< menu item callback
void *user_data_; ///< menu item user_data for 3rd party apps
void *user_data_; ///< menu item user_data for the menu's callback
int flags; ///< menu item flags like FL_MENU_TOGGLE, FL_MENU_RADIO
uchar labeltype_; ///< how the menu item text looks like
Fl_Font labelfont_; ///< which font for this menu item text
Fl_Fontsize labelsize_; ///< size of menu item text
Fl_Color labelcolor_; ///< menu item text color
Fl_Color labelcolor_; ///< menu item text color
// advance N items, skipping submenus:
const Fl_Menu_Item *next(int=1) const;
@@ -148,7 +148,7 @@ struct FL_EXPORT Fl_Menu_Item {
Returns the title of the item.
A NULL here indicates the end of the menu (or of a submenu).
A '&' in the item will print an underscore under the next letter,
and if the menu is popped up that letter will be a "shortcut" to pick
and if the menu is popped up that letter will be a "shortcut" to pick
that item. To get a real '&' put two in a row.
*/
const char* label() const {return text;}
@@ -160,6 +160,7 @@ struct FL_EXPORT Fl_Menu_Item {
void label(Fl_Labeltype a,const char* b) {labeltype_ = a; text = b;}
/**
Returns the menu item's labeltype.
A labeltype identifies a routine that draws the label of the
widget. This can be used for special effects such as emboss, or to use
the label() pointer as another form of data such as a bitmap.
@@ -168,6 +169,7 @@ struct FL_EXPORT Fl_Menu_Item {
Fl_Labeltype labeltype() const {return (Fl_Labeltype)labeltype_;}
/**
Sets the menu item's labeltype.
A labeltype identifies a routine that draws the label of the
widget. This can be used for special effects such as emboss, or to use
the label() pointer as another form of data such as a bitmap.
@@ -176,77 +178,100 @@ struct FL_EXPORT Fl_Menu_Item {
void labeltype(Fl_Labeltype a) {labeltype_ = a;}
/**
Gets the menu item's label color.
This color is passed to the labeltype routine, and is typically the
color of the label text. This defaults to FL_BLACK. If this
color is not black fltk will <I>not</I> use overlay bitplanes to draw
color is not black fltk will \b not use overlay bitplanes to draw
the menu - this is so that images put in the menu draw correctly.
*/
Fl_Color labelcolor() const {return labelcolor_;}
/** See Fl_Color Fl_Menu_Item::labelcolor() const */
/**
Sets the menu item's label color.
\see Fl_Color Fl_Menu_Item::labelcolor() const
*/
void labelcolor(Fl_Color a) {labelcolor_ = a;}
/**
Fonts are identified by small 8-bit indexes into a table. See the
Gets the menu item's label font.
Fonts are identified by small 8-bit indexes into a table. See the
enumeration list for predefined fonts. The default value is a
Helvetica font. The function Fl::set_font() can define new fonts.
*/
Fl_Font labelfont() const {return labelfont_;}
/**
Fonts are identified by small 8-bit indexes into a table. See the
Sets the menu item's label font.
Fonts are identified by small 8-bit indexes into a table. See the
enumeration list for predefined fonts. The default value is a
Helvetica font. The function Fl::set_font() can define new fonts.
*/
void labelfont(Fl_Font a) {labelfont_ = a;}
/** Gets the label font pixel size/height.*/
/** Gets the label font pixel size/height. */
Fl_Fontsize labelsize() const {return labelsize_;}
/** Sets the label font pixel size/height.*/
void labelsize(Fl_Fontsize a) {labelsize_ = a;}
/**
Each item has space for a callback function and an argument for that
function. Due to back compatibility, the Fl_Menu_Item itself
is not passed to the callback, instead you have to get it by calling
((Fl_Menu_*)w)->mvalue() where w is the widget argument.
Returns the callback function that is set for the menu item.
Each item has space for a callback function and an argument for that
function. Due to back compatibility, the Fl_Menu_Item itself
is not passed to the callback, instead you have to get it by calling
((Fl_Menu_*)w)->mvalue() where w is the widget argument.
*/
Fl_Callback_p callback() const {return callback_;}
/** See Fl_Callback_p Fl_MenuItem::callback() const */
/**
Sets the menu item's callback function and userdata() argument.
\see Fl_Callback_p Fl_MenuItem::callback() const
*/
void callback(Fl_Callback* c, void* p) {callback_=c; user_data_=p;}
/** See Fl_Callback_p Fl_MenuItem::callback() const */
/**
Sets the menu item's callback function.
This method does not set the userdata() argument.
\see Fl_Callback_p Fl_MenuItem::callback() const
*/
void callback(Fl_Callback* c) {callback_=c;}
/** See Fl_Callback_p Fl_MenuItem::callback() const */
/**
Sets the menu item's callback function.
This method does not set the userdata() argument.
\see Fl_Callback_p Fl_MenuItem::callback() const
*/
void callback(Fl_Callback0*c) {callback_=(Fl_Callback*)c;}
/** See Fl_Callback_p Fl_MenuItem::callback() const */
/**
Sets the menu item's callback function and userdata() argument.
This method does not set the userdata() argument.
The argument \p is cast to void* and stored as the userdata()
for the menu item's callback function.
\see Fl_Callback_p Fl_MenuItem::callback() const
*/
void callback(Fl_Callback1*c, long p=0) {callback_=(Fl_Callback*)c; user_data_=(void*)p;}
/**
Get or set the user_data argument that is sent to the
callback function.
Gets the user_data() argument that is sent to the callback function.
*/
void* user_data() const {return user_data_;}
/**
Get or set the user_data argument that is sent to the
callback function.
Sets the user_data() argument that is sent to the callback function.
*/
void user_data(void* v) {user_data_ = v;}
/**
Gets the user_data() argument that is sent to the callback function.
For convenience you can also define the callback as taking a long
argument. This is implemented by casting this to a Fl_Callback
and casting the long to a void* and may not be
portable to some machines.
argument. This method casts the stored userdata() argument to long
and returns it as a \e long value.
*/
intptr_t argument() const {return (intptr_t)user_data_;}
long argument() const {return (long)(fl_intptr_t)user_data_;}
/**
Sets the user_data() argument that is sent to the callback function.
For convenience you can also define the callback as taking a long
argument. This is implemented by casting this to a Fl_Callback
and casting the long to a void* and may not be
portable to some machines.
argument. This method casts the given argument \p v to void*
and stores it in the menu item's userdata() member.
This may not be portable to some machines.
*/
void argument(long v) {user_data_ = (void*)v;}
@@ -278,15 +303,15 @@ struct FL_EXPORT Fl_Menu_Item {
*/
int submenu() const {return flags&(FL_SUBMENU|FL_SUBMENU_POINTER);}
/**
Returns true if a checkbox will be drawn next to this item. This is
true if FL_MENU_TOGGLE or FL_MENU_RADIO is set in the flags.
Returns true if a checkbox will be drawn next to this item.
This is true if FL_MENU_TOGGLE or FL_MENU_RADIO is set in the flags.
*/
int checkbox() const {return flags&FL_MENU_TOGGLE;}
/**
Returns true if this item is a radio item. When a radio button is
selected all "adjacent" radio buttons are turned off. A set of radio
items is delimited by an item that has radio() false, or by an
item with FL_MENU_DIVIDER turned on.
Returns true if this item is a radio item.
When a radio button is selected all "adjacent" radio buttons are
turned off. A set of radio items is delimited by an item that has
radio() false, or by an item with FL_MENU_DIVIDER turned on.
*/
int radio() const {return flags&FL_MENU_RADIO;}
/** Returns the current value of the check or radio item. */
@@ -349,29 +374,28 @@ struct FL_EXPORT Fl_Menu_Item {
const Fl_Menu_Item* title = 0,
int menubar=0) const;
const Fl_Menu_Item* test_shortcut() const;
const Fl_Menu_Item* find_shortcut(int *ip=0) const;
const Fl_Menu_Item* find_shortcut(int *ip=0, const bool require_alt = false) const;
/**
Calls the Fl_Menu_Item item's callback, and provides the
Fl_Widget argument (and optionally overrides the user_data()
argument). You must first check that callback() is non-zero
before calling this.
Calls the Fl_Menu_Item item's callback, and provides the Fl_Widget argument.
The callback is called with the stored user_data() as its second argument.
You must first check that callback() is non-zero before calling this.
*/
void do_callback(Fl_Widget* o) const {callback_(o, user_data_);}
/**
Calls the Fl_Menu_Item item's callback, and provides the
Fl_Widget argument (and optionally overrides the user_data()
argument). You must first check that callback() is non-zero
before calling this.
Calls the Fl_Menu_Item item's callback, and provides the Fl_Widget argument.
This call overrides the callback's second argument with the given value \p arg.
You must first check that callback() is non-zero before calling this.
*/
void do_callback(Fl_Widget* o,void* arg) const {callback_(o, arg);}
/**
Calls the Fl_Menu_Item item's callback, and provides the
Fl_Widget argument (and optionally overrides the user_data()
argument). You must first check that callback() is non-zero
before calling this.
Calls the Fl_Menu_Item item's callback, and provides the Fl_Widget argument.
This call overrides the callback's second argument with the
given value \p arg. long \p arg is cast to void* when calling
the callback.
You must first check that callback() is non-zero before calling this.
*/
void do_callback(Fl_Widget* o,long arg) const {callback_(o, (void*)arg);}
@@ -415,5 +439,5 @@ enum { // back-compatibility enum:
#endif
//
// End of "$Id: Fl_Menu_Item.H 7517 2010-04-16 17:55:45Z greg.ercolano $".
// End of "$Id: Fl_Menu_Item.H 7983 2010-12-09 00:04:06Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Menu_Window.H 6909 2009-09-28 14:41:43Z matt $"
// "$Id: Fl_Menu_Window.H 7903 2010-11-28 21:06:39Z matt $"
//
// Menu window header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -64,5 +64,5 @@ public:
#endif
//
// End of "$Id: Fl_Menu_Window.H 6909 2009-09-28 14:41:43Z matt $".
// End of "$Id: Fl_Menu_Window.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Multi_Browser.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Multi_Browser.H 8736 2011-05-24 20:00:56Z AlbrechtS $"
//
// Multi browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -43,7 +43,7 @@
mouse, but you can change this with when().
<P>See Fl_Browser for methods to add and remove lines from the browser.
*/
class Fl_Multi_Browser : public Fl_Browser {
class FL_EXPORT Fl_Multi_Browser : public Fl_Browser {
public:
/**
Creates a new Fl_Multi_Browser widget using the given
@@ -51,12 +51,16 @@ public:
The constructor specializes Fl_Browser() by setting the type to FL_MULTI_BROWSER.
The destructor destroys the widget and frees all memory that has been allocated.
*/
#if defined(FL_DLL) // implementation in src/Fl_Browser.cxx
Fl_Multi_Browser(int X,int Y,int W,int H,const char *L=0);
#else
Fl_Multi_Browser(int X,int Y,int W,int H,const char *L=0)
: Fl_Browser(X,Y,W,H,L) {type(FL_MULTI_BROWSER);}
#endif
};
#endif
//
// End of "$Id: Fl_Multi_Browser.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Multi_Browser.H 8736 2011-05-24 20:00:56Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Multi_Label.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Multi_Label.H 7903 2010-11-28 21:06:39Z matt $"
//
// Multi-label header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -43,5 +43,5 @@ struct FL_EXPORT Fl_Multi_Label {
#endif
//
// End of "$Id: Fl_Multi_Label.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Multi_Label.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Multiline_Input.H 6889 2009-09-19 22:09:00Z greg.ercolano $"
// "$Id: Fl_Multiline_Input.H 8726 2011-05-23 18:32:47Z AlbrechtS $"
//
// Multiline input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -38,29 +38,38 @@
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>
In FLTK 1.3.x, the default behavior of the 'Tab' key was changed
to support consistent focus navigation. To get the older FLTK 1.1.x
behavior, set Fl_Input_::tab_nav() to 0. Newer programs should consider using
Fl_Text_Editor.
*/
class Fl_Multiline_Input : public Fl_Input {
class FL_EXPORT Fl_Multiline_Input : public Fl_Input {
public:
/**
Creates a new Fl_Multiline_Input widget using the given
position, size, and label string. The default boxtype is FL_DOWN_BOX.
<P>Inherited destructor destroys the widget and any value associated with it.
Inherited destructor destroys the widget and any value associated with it.
*/
#if defined(FL_DLL) // implementation in src/Fl_Input.cxx
Fl_Multiline_Input(int X,int Y,int W,int H,const char *l = 0);
#else
Fl_Multiline_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(X,Y,W,H,l) {type(FL_MULTILINE_INPUT);}
#endif
};
#endif
//
// End of "$Id: Fl_Multiline_Input.H 6889 2009-09-19 22:09:00Z greg.ercolano $".
// End of "$Id: Fl_Multiline_Input.H 8726 2011-05-23 18:32:47Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Multiline_Output.H 6889 2009-09-19 22:09:00Z greg.ercolano $"
// "$Id: Fl_Multiline_Output.H 8726 2011-05-23 18:32:47Z AlbrechtS $"
//
// Multi line output header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -37,28 +37,34 @@
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,
use Fl_Help_View.
*/
class Fl_Multiline_Output : public Fl_Output {
class FL_EXPORT Fl_Multiline_Output : public Fl_Output {
public:
/**
Creates a new Fl_Multiline_Output widget using the given
position, size, and label string. The default boxtype is FL_DOWN_BOX
<P> Inherited destructor destroys the widget and any value associated with it.
Creates a new Fl_Multiline_Output widget using the given position,
size, and label string. The default boxtype is FL_DOWN_BOX.
Inherited destructor destroys the widget and any value associated with it.
*/
#if defined(FL_DLL) // implementation in src/Fl_Input.cxx
Fl_Multiline_Output(int X,int Y,int W,int H,const char *l = 0);
#else
Fl_Multiline_Output(int X,int Y,int W,int H,const char *l = 0)
: Fl_Output(X,Y,W,H,l) {type(FL_MULTILINE_OUTPUT);}
#endif
};
#endif
//
// End of "$Id: Fl_Multiline_Output.H 6889 2009-09-19 22:09:00Z greg.ercolano $".
// End of "$Id: Fl_Multiline_Output.H 8726 2011-05-23 18:32:47Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Native_File_Chooser.H 7003 2010-01-14 20:47:59Z greg.ercolano $"
// "$Id: Fl_Native_File_Chooser.H 8380 2011-02-06 10:07:28Z manolo $"
//
// FLTK native OS file chooser widget
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 by Bill Spitzak and others.
// Copyright 2004 Greg Ercolano.
//
// This library is free software; you can redistribute it and/or
@@ -26,26 +26,280 @@
// http://www.fltk.org/str.php
//
/** \file
Fl_Native_File_Chooser widget. */
/**
\class Fl_Native_File_Chooser
This class lets an FLTK application easily and consistently access
the operating system's native file chooser. Some operating systems
have very complex and specific file choosers that many users want
access to specifically, instead of FLTK's default file chooser(s).
In cases where there is no native file browser, FLTK's own file browser
is used instead.
To use this widget correctly, use the following include in your code:
\code
#include <FL/Fl_Native_File_Chooser.H>
\endcode
Do not include the other Fl_Native_File_Choser_XXX.H files in your code;
those are platform specific files that will be included automatically
depending on your build platform.
The following example shows how to pick a single file:
\code
// Create and post the local native file chooser
#include <FL/Fl_Native_File_Chooser.H>
[..]
Fl_Native_File_Chooser fnfc;
fnfc.title("Pick a file");
fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
fnfc.filter("Text\t*.txt\n"
"C Files\t*.{cxx,h,c}");
fnfc.directory("/var/tmp"); // default directory to use
// Show native chooser
switch ( fnfc.show() ) {
case -1: printf("ERROR: %s\n", fnfc.errmsg()); break; // ERROR
case 1: printf("CANCEL\n"); break; // CANCEL
default: printf("PICKED: %s\n", fnfc.filename()); break; // FILE CHOSEN
}
\endcode
<B>Platform Specific Caveats</B>
- Under X windows, it's best if you call Fl_File_Icon::load_system_icons()
at the start of main(), to enable the nicer looking file browser widgets.
Use the static public attributes of class Fl_File_Chooser to localize
the browser.
- Some operating systems support certain OS specific options; see
Fl_Native_File_Chooser::options() for a list.
\image html Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms."
\image latex Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms" width=14cm
*/
#ifndef FL_NATIVE_FILE_CHOOSER_H
#define FL_NATIVE_FILE_CHOOSER_H
/* \file
Fl_Native_File_Chooser widget. */
// Use Windows' chooser
#ifdef WIN32
#include <FL/Fl_Native_File_Chooser_WIN32.H>
// #define _WIN32_WINNT 0x0501 // needed for OPENFILENAME's 'FlagsEx'
#include <stdio.h>
#include <stdlib.h> // malloc
#include <windows.h>
#include <commdlg.h> // OPENFILENAME, GetOpenFileName()
#include <shlobj.h> // BROWSEINFO, SHBrowseForFolder()
#endif
// Use Apple's chooser
#ifdef __APPLE__
#include <FL/Fl_Native_File_Chooser_MAC.H>
#include <FL/filename.H>
#define MAXFILTERS 80
#endif
// All else falls back to FLTK's own chooser
#if ! defined(__APPLE__) && !defined(WIN32)
#include <FL/Fl_Native_File_Chooser_FLTK.H>
#include <FL/Fl_File_Chooser.H>
#include <unistd.h> // _POSIX_NAME_MAX
#endif
/**
This class lets an FLTK application easily and consistently access
the operating system's native file chooser. Some operating systems
have very complex and specific file choosers that many users want
access to specifically, instead of FLTK's default file chooser(s).
In cases where there is no native file browser, FLTK's own file browser
is used instead.
To use this widget, use the following include in your code:
\code
#include <FL/Fl_Native_File_Chooser.H>
\endcode
The following example shows how to pick a single file:
\code
// Create and post the local native file chooser
#include <FL/Fl_Native_File_Chooser.H>
[..]
Fl_Native_File_Chooser fnfc;
fnfc.title("Pick a file");
fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
fnfc.filter("Text\t*.txt\n"
"C Files\t*.{cxx,h,c}");
fnfc.directory("/var/tmp"); // default directory to use
// Show native chooser
switch ( fnfc.show() ) {
case -1: printf("ERROR: %s\n", fnfc.errmsg()); break; // ERROR
case 1: printf("CANCEL\n"); break; // CANCEL
default: printf("PICKED: %s\n", fnfc.filename()); break; // FILE CHOSEN
}
\endcode
<B>Platform Specific Caveats</B>
- Under X windows, it's best if you call Fl_File_Icon::load_system_icons()
at the start of main(), to enable the nicer looking file browser widgets.
Use the static public attributes of class Fl_File_Chooser to localize
the browser.
- Some operating systems support certain OS specific options; see
Fl_Native_File_Chooser::options() for a list.
\image html Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms."
\image latex Fl_Native_File_Chooser.png "The Fl_Native_File_Chooser on different platforms" width=14cm
*/
class FL_EXPORT Fl_Native_File_Chooser {
public:
enum Type {
BROWSE_FILE = 0, ///< browse files (lets user choose one file)
BROWSE_DIRECTORY, ///< browse directories (lets user choose one directory)
BROWSE_MULTI_FILE, ///< browse files (lets user choose multiple files)
BROWSE_MULTI_DIRECTORY, ///< browse directories (lets user choose multiple directories)
BROWSE_SAVE_FILE, ///< browse to save a file
BROWSE_SAVE_DIRECTORY ///< browse to save a directory
};
enum Option {
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
};
/** Localizable message */
static const char *file_exists_message;
public:
Fl_Native_File_Chooser(int val=BROWSE_FILE);
~Fl_Native_File_Chooser();
// Public methods
void type(int);
int type() const;
void options(int);
int options() const;
int count() const;
const char *filename() const;
const char *filename(int i) const;
void directory(const char *val);
const char *directory() const;
void title(const char *);
const char* title() const;
const char *filter() const;
void filter(const char *);
int filters() const;
void filter_value(int i);
int filter_value() const;
void preset_file(const char*);
const char* preset_file() const;
const char *errmsg() const;
int show();
#ifdef WIN32
private:
int _btype; // kind-of browser to show()
int _options; // general options
OPENFILENAMEW _ofn; // GetOpenFileName() & GetSaveFileName() struct
BROWSEINFO _binf; // SHBrowseForFolder() struct
char **_pathnames; // array of pathnames
int _tpathnames; // total pathnames
char *_directory; // default pathname to use
char *_title; // title for window
char *_filter; // user-side search filter
char *_parsedfilt; // filter parsed for Windows dialog
int _nfilters; // number of filters parse_filter counted
char *_preset_file; // the file to preselect
char *_errmsg; // error message
// Private methods
void errmsg(const char *msg);
void clear_pathnames();
void set_single_pathname(const char *s);
void add_pathname(const char *s);
void FreePIDL(ITEMIDLIST *pidl);
void ClearOFN();
void ClearBINF();
void Win2Unix(char *s);
void Unix2Win(char *s);
int showfile();
static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data);
int showdir();
void parse_filter(const char *);
void clear_filters();
void add_filter(const char *, const char *);
#endif
#ifdef __APPLE__
private:
int _btype; // kind-of browser to show()
int _options; // general options
void *_panel;
char **_pathnames; // array of pathnames
int _tpathnames; // total pathnames
char *_directory; // default pathname to use
char *_title; // title for window
char *_preset_file; // the 'save as' filename
char *_filter; // user-side search filter, eg:
// C Files\t*.[ch]\nText Files\t*.txt"
char *_filt_names; // filter names (tab delimited)
// eg. "C Files\tText Files"
char *_filt_patt[MAXFILTERS];
// array of filter patterns, eg:
// _filt_patt[0]="*.{cxx,h}"
// _filt_patt[1]="*.txt"
int _filt_total; // parse_filter() # of filters loaded
int _filt_value; // index of the selected filter
char *_errmsg; // error message
// Private methods
void errmsg(const char *msg);
void clear_pathnames();
void set_single_pathname(const char *s);
int get_saveas_basename(void);
void clear_filters();
void add_filter(const char *, const char *);
void parse_filter(const char *from);
int post();
#endif
#if ! defined(__APPLE__) && !defined(WIN32)
private:
int _btype; // kind-of browser to show()
int _options; // general options
int _nfilters;
char *_filter; // user supplied filter
char *_parsedfilt; // parsed filter
int _filtvalue; // selected filter
char *_preset_file;
char *_prevvalue; // Returned filename
char *_directory;
char *_errmsg; // error message
Fl_File_Chooser *_file_chooser;
// Private methods
void errmsg(const char *msg);
int type_fl_file(int);
void parse_filter();
void keeplocation();
int exist_dialog();
#endif
};
#endif /*FL_NATIVE_FILE_CHOOSER_H*/
//
// End of "$Id: Fl_Native_File_Chooser.H 7003 2010-01-14 20:47:59Z greg.ercolano $".
// End of "$Id: Fl_Native_File_Chooser.H 8380 2011-02-06 10:07:28Z manolo $".
//

View File

@@ -1,142 +0,0 @@
//
// "$Id: Fl_Native_File_Chooser_FLTK.H 7007 2010-01-14 23:08:06Z greg.ercolano $"
//
// FLTK native OS file chooser widget
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 2005 by Nathan Vander Wilt.
//
// 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 on the following page:
//
// http://www.fltk.org/str.php
//
/* \file
Fl_Native_File_Chooser widget. */
#include <FL/Fl_File_Chooser.H>
#include <unistd.h> // _POSIX_NAME_MAX
/**
This class lets an FLTK application easily and consistently access
the operating system's native file chooser. Some operating systems
have very complex and specific file choosers that many users want
access to specifically, instead of FLTK's default file chooser(s).
<P>
In cases where there is no native file browser, FLTK's own file browser
is used instead.
<P>
\code
// Create and post the local native file chooser
#include <FL/Fl_Native_File_Chooser.H>
[..]
Fl_Native_File_Chooser fnfc;
fnfc.title("Pick a file");
fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
fnfc.filter("Text\t*.txt\n"
"C Files\t*.{cxx,h,c}");
fnfc.directory("/var/tmp");
// Show native chooser
switch ( fnfc.show() ) {
case -1: printf("ERROR: %s\n", fnfc.errmsg()); break; // ERROR
case 1: printf("CANCEL\n"); break; // CANCEL
default: printf("PICKED: %s\n", fnfc.filename()); break; // FILE CHOSEN
}
\endcode
<P>
<B>Platform Specific Caveats</B>
<P>
- Under X windows, it's best if you call Fl_File_Icon::load_system_icons()
at the start of main(), to enable the nicer looking file browser widgets.
- Some operating systems support certain OS specific options; see
Fl_Native_File_Chooser::options() for a list.
*/
class Fl_Native_File_Chooser {
public:
enum Type {
BROWSE_FILE = 0, ///< browse files (lets user choose one file)
BROWSE_DIRECTORY, ///< browse directories (lets user choose one directory)
BROWSE_MULTI_FILE, ///< browse files (lets user choose multiple files)
BROWSE_MULTI_DIRECTORY, ///< browse directories (lets user choose multiple directories)
BROWSE_SAVE_FILE, ///< browse to save a file
BROWSE_SAVE_DIRECTORY ///< browse to save a directory
};
enum Option {
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
};
private:
int _btype; // kind-of browser to show()
int _options; // general options
int _nfilters;
char *_filter; // user supplied filter
char *_parsedfilt; // parsed filter
int _filtvalue; // selected filter
char *_preset_file;
char *_prevvalue; // Returned filename
char *_directory;
char *_errmsg; // error message
char *_old_dir;
Fl_File_Chooser *_file_chooser;
// added by MG
Fl_File_Browser *my_fileList;
Fl_Check_Button *show_hidden;
int prev_filtervalue;
static void show_hidden_cb(Fl_Check_Button *o, void *data);
static void remove_hidden_files(Fl_File_Browser *my_fileList);
// Private methods
void errmsg(const char *msg);
int type_fl_file(int);
void parse_filter();
void keeplocation();
int exist_dialog();
public:
Fl_Native_File_Chooser(int val=BROWSE_FILE);
~Fl_Native_File_Chooser();
// Public methods
void type(int);
int type() const;
void options(int);
int options() const;
int count() const;
const char *filename() const;
const char *filename(int i) const;
void directory(const char *val);
const char *directory() const;
void title(const char *);
const char* title() const;
const char *filter() const;
void filter(const char *);
int filters() const;
void filter_value(int i);
int filter_value() const;
void preset_file(const char*);
const char* preset_file() const;
const char *errmsg() const;
int show();
};
//
// End of "$Id: Fl_Native_File_Chooser_FLTK.H 7007 2010-01-14 23:08:06Z greg.ercolano $".
//

View File

@@ -1,122 +0,0 @@
//
// "$Id: Fl_Native_File_Chooser_MAC.H 7354 2010-03-29 11:07:29Z matt $"
//
// FLTK native OS file chooser widget
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 2004 Greg Ercolano.
//
// 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 on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef FL_DOXYGEN // PREVENT DOXYGEN'S USE OF THIS FILE
// OSX-SPECIFIC NATIVE BROWSER
#include <Carbon/Carbon.h>
#include <config.h>
#undef check // necessary for use of Fl::check()
#include <FL/filename.H>
#define MAXFILTERS 80
class Fl_Native_File_Chooser {
public:
enum Type {
BROWSE_FILE = 0,
BROWSE_DIRECTORY,
BROWSE_MULTI_FILE,
BROWSE_MULTI_DIRECTORY,
BROWSE_SAVE_FILE,
BROWSE_SAVE_DIRECTORY
};
enum Option {
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
};
private:
int _btype; // kind-of browser to show()
int _options; // general options
void *_panel;
char **_pathnames; // array of pathnames
int _tpathnames; // total pathnames
char *_directory; // default pathname to use
char *_title; // title for window
char *_preset_file; // the 'save as' filename
char *_filter; // user-side search filter, eg:
// C Files\t*.[ch]\nText Files\t*.txt"
char *_filt_names; // filter names (tab delimited)
// eg. "C Files\tText Files"
char *_filt_patt[MAXFILTERS];
// array of filter patterns, eg:
// _filt_patt[0]="*.{cxx,h}"
// _filt_patt[1]="*.txt"
int _filt_total; // parse_filter() # of filters loaded
int _filt_value; // index of the selected filter
char *_errmsg; // error message
// Private methods
void errmsg(const char *msg);
void clear_pathnames();
void set_single_pathname(const char *s);
int get_saveas_basename(void);
void clear_filters();
void add_filter(const char *, const char *);
void parse_filter(const char *from);
int post();
public:
Fl_Native_File_Chooser(int val = BROWSE_FILE);
~Fl_Native_File_Chooser();
// Public methods
void type(int);
int type() const;
void options(int);
int options() const;
int count() const;
const char *filename() const;
const char *filename(int i) const;
void directory(const char *);
const char *directory() const;
void title(const char *);
const char *title() const;
const char *filter() const;
void filter(const char *);
void filter_value(int i) { _filt_value = i; }
int filter_value() { return(_filt_value); }
int filters() { return(_filt_total); }
void preset_file(const char *);
const char *preset_file();
const char *errmsg() const;
int show();
};
#endif /*!FL_DOXYGEN*/
//
// End of "$Id: Fl_Native_File_Chooser_MAC.H 7354 2010-03-29 11:07:29Z matt $".
//

View File

@@ -1,120 +0,0 @@
//
// "$Id: Fl_Native_File_Chooser_WIN32.H 7003 2010-01-14 20:47:59Z greg.ercolano $"
//
// FLTK native OS file chooser widget
//
// Copyright 1998-2005 by Bill Spitzak and others.
// Copyright 2004 by Greg Ercolano.
// April 2005 - API changes, improved filter processing by Nathan Vander Wilt
//
// 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:
//
// http://www.fltk.org/str.php
//
#ifndef FL_DOXYGEN // PREVENT DOXYGEN'S USE OF THIS FILE
// #define _WIN32_WINNT 0x0501 // needed for OPENFILENAME's 'FlagsEx'
#include <stdio.h>
#include <stdlib.h> // malloc
#include <windows.h>
#include <commdlg.h> // OPENFILENAME, GetOpenFileName()
#include <shlobj.h> // BROWSEINFO, SHBrowseForFolder()
class Fl_Native_File_Chooser {
public:
enum Type {
BROWSE_FILE = 0,
BROWSE_DIRECTORY,
BROWSE_MULTI_FILE,
BROWSE_MULTI_DIRECTORY,
BROWSE_SAVE_FILE,
BROWSE_SAVE_DIRECTORY
};
enum Option {
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
};
private:
int _btype; // kind-of browser to show()
int _options; // general options
OPENFILENAMEW _ofn; // GetOpenFileName() & GetSaveFileName() struct
BROWSEINFO _binf; // SHBrowseForFolder() struct
char **_pathnames; // array of pathnames
int _tpathnames; // total pathnames
char *_directory; // default pathname to use
char *_title; // title for window
char *_filter; // user-side search filter
char *_parsedfilt; // filter parsed for Windows dialog
int _nfilters; // number of filters parse_filter counted
char *_preset_file; // the file to preselect
char *_errmsg; // error message
// Private methods
void errmsg(const char *msg);
void clear_pathnames();
void set_single_pathname(const char *s);
void add_pathname(const char *s);
void FreePIDL(ITEMIDLIST *pidl);
void ClearOFN();
void ClearBINF();
void Win2Unix(char *s);
void Unix2Win(char *s);
int showfile();
static int CALLBACK Dir_CB(HWND win, UINT msg, LPARAM param, LPARAM data);
int showdir();
void parse_filter(const char *);
void clear_filters();
void add_filter(const char *, const char *);
public:
Fl_Native_File_Chooser(int val = BROWSE_FILE);
~Fl_Native_File_Chooser();
// Public methods
void type(int val);
int type() const;
void options(int);
int options() const;
int count() const;
const char *filename() const;
const char *filename(int i) const;
void directory(const char *val);
const char *directory() const;
void title(const char *val);
const char *title() const;
const char *filter() const;
void filter(const char *val);
int filters() const { return _nfilters; }
void filter_value(int i);
int filter_value() const;
void preset_file(const char *);
const char *preset_file() const;
const char *errmsg() const;
int show();
};
#endif /*!FL_DOXYGEN*/
//
// End of "$Id: Fl_Native_File_Chooser_WIN32.H 7003 2010-01-14 20:47:59Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Nice_Slider.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Nice_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// "Nice" slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -33,7 +33,7 @@
#include "Fl_Slider.H"
class Fl_Nice_Slider : public Fl_Slider {
class FL_EXPORT Fl_Nice_Slider : public Fl_Slider {
public:
Fl_Nice_Slider(int x,int y,int w,int h,const char *l=0)
: Fl_Slider(x,y,w,h,l) {type(FL_VERT_NICE_SLIDER); box(FL_FLAT_BOX);}
@@ -42,5 +42,5 @@ public:
#endif
//
// End of "$Id: Fl_Nice_Slider.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Nice_Slider.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Object.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Object.H 7903 2010-11-28 21:06:39Z matt $"
//
// Old Fl_Object header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -32,5 +32,5 @@
#include "Fl_Widget.H"
//
// End of "$Id: Fl_Object.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Object.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Output.H 6898 2009-09-23 20:43:27Z matt $"
// "$Id: Fl_Output.H 8726 2011-05-23 18:32:47Z AlbrechtS $"
//
// Output header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -33,36 +33,45 @@
#include "Fl_Input.H"
/**
This widget displays a piece of text. When you set the value()
, Fl_Output does a strcpy() to it's own storage,
This widget displays a piece of text.
When you set the value() , Fl_Output does a strcpy() to its own storage,
which is useful for program-generated values. The user may select
portions of the text using the mouse and paste the contents into other
fields or programs.
<P align=CENTER>\image html text.gif</P>
\image latex text.eps "Fl_Output" width=8cm
<P>There is a single subclass,
Fl_Multiline_Output, which allows you to display multiple lines of
text. Fl_Multiline_Output does not provide scroll bars. If a more
complete text editing widget is needed, use Fl_Text_Display instead.</P>
<P>The text may contain any characters except \\0, and will correctly
<P align=CENTER>\image html text.png</P>
\image latex text.png "Fl_Output" width=8cm
There is a single subclass, Fl_Multiline_Output, which allows you to
display multiple lines of text. Fl_Multiline_Output does not provide
scroll bars. If a more complete text editing widget is needed, use
Fl_Text_Display instead.
The text may contain any characters except \\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-Latin1 character
set.
assumes the font can draw any characters in the ISO-Latin1 character set.
*/
class Fl_Output : public Fl_Input {
class FL_EXPORT Fl_Output : public Fl_Input {
public:
/**
Creates a new Fl_Output widget using the given position,
size, and label string. The default boxtype is FL_DOWN_BOX.
<P>Inherited destrucor destroys the widget and any value associated with it.
Inherited destructor destroys the widget and any value associated with it.
*/
#if defined(FL_DLL) // implementation in src/Fl_Input.cxx
Fl_Output(int X,int Y,int W,int H, const char *l = 0);
#else
Fl_Output(int X,int Y,int W,int H, const char *l = 0)
: Fl_Input(X, Y, W, H, l) {type(FL_NORMAL_OUTPUT);}
#endif
};
#endif
//
// End of "$Id: Fl_Output.H 6898 2009-09-23 20:43:27Z matt $".
// End of "$Id: Fl_Output.H 8726 2011-05-23 18:32:47Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Overlay_Window.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Overlay_Window.H 7903 2010-11-28 21:06:39Z matt $"
//
// Overlay window header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -75,5 +75,5 @@ public:
#endif
//
// End of "$Id: Fl_Overlay_Window.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Overlay_Window.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Pack.H 6664 2009-02-18 09:27:54Z AlbrechtS $"
// "$Id: Fl_Pack.H 7903 2010-11-28 21:06:39Z matt $"
//
// Pack header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -80,5 +80,5 @@ public:
#endif
//
// End of "$Id: Fl_Pack.H 6664 2009-02-18 09:27:54Z AlbrechtS $".
// End of "$Id: Fl_Pack.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,5 +1,5 @@
//
// "$Id: Fl_Paged_Device.H 7622 2010-05-27 17:50:51Z manolo $"
// "$Id: Fl_Paged_Device.H 8699 2011-05-20 16:39:06Z manolo $"
//
// Printing support for the Fast Light Tool Kit (FLTK).
//
@@ -33,6 +33,10 @@
#define Fl_Paged_Device_H
#include <FL/Fl_Device.H>
#include <FL/Fl_Window.H>
/** \brief Number of elements in enum Page_Format */
#define NO_PAGE_FORMATS 30 /* MSVC6 compilation fix */
/**
\brief Represents page-structured drawing surfaces.
@@ -40,46 +44,103 @@
This class has no public constructor: don't instantiate it; use Fl_Printer
or Fl_PostScript_File_Device instead.
*/
class Fl_Paged_Device : public Fl_Surface_Device {
private:
#ifdef __APPLE__
struct chain_elt {
Fl_Image *image;
const uchar *data;
struct chain_elt *next;
class FL_EXPORT Fl_Paged_Device : public Fl_Surface_Device {
public:
/**
\brief Possible page formats.
All paper formats with pre-defined width and height.
*/
enum Page_Format {
A0 = 0, /**< A0 format */
A1,
A2,
A3,
A4, /**< A4 format */
A5,
A6,
A7,
A8,
A9,
B0,
B1,
B2,
B3,
B4,
B5,
B6,
B7,
B8,
B9,
B10,
C5E,
DLE,
EXECUTIVE,
FOLIO,
LEDGER,
LEGAL,
LETTER, /**< Letter format */
TABLOID,
ENVELOPE,
MEDIA = 0x1000
};
void add_image(Fl_Image *image, const uchar *data); // adds an image to the page image list
#endif
/**
\brief Possible page layouts.
*/
enum Page_Layout {
PORTRAIT = 0, /**< Portrait orientation */
LANDSCAPE = 0x100, /**< Landscape orientation */
REVERSED = 0x200, /**< Reversed orientation */
ORIENTATION = 0x300 /**< orientation */
};
/** \brief width, height and name of a page format
*/
typedef struct {
/** \brief width in points */
int width;
/** \brief height in points */
int height;
/** \brief format name */
const char *name;
} page_format;
/** \brief width, height and name of all elements of the enum \ref Page_Format.
*/
static const page_format page_formats[NO_PAGE_FORMATS];
private:
void traverse(Fl_Widget *widget); // finds subwindows of widget and prints them
protected:
/** \brief horizontal offset to the origin of graphics coordinates */
int x_offset;
/** \brief vertical offset to the origin of graphics coordinates */
int y_offset;
/** \brief chained list of Fl_Image's used in this page */
struct chain_elt *image_list_;
#ifdef __APPLE__
/** \brief deletes the page image list */
void delete_image_list();
#endif
/** \brief The constructor */
Fl_Paged_Device() : Fl_Surface_Device(NULL) {type_ = device_type;};
Fl_Paged_Device() : Fl_Surface_Device(NULL) {};
/** \brief The destructor */
virtual ~Fl_Paged_Device() {};
public:
static const char *device_type;
static const char *class_id;
const char *class_name() {return class_id;};
virtual int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
virtual int start_page(void);
virtual int printable_rect(int *w, int *h);
virtual void margins(int *left, int *top, int *right, int *bottom);
virtual void origin(int x, int y);
void origin(int *x, int *y);
virtual void scale(float scale_x, float scale_y);
virtual void origin(int *x, int *y);
virtual void scale(float scale_x, float scale_y = 0.);
virtual void rotate(float angle);
virtual void translate(int x, int y);
virtual void untranslate(void);
void print_widget(Fl_Widget* widget, int delta_x = 0, int delta_y = 0);
void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x = 0, int delta_y = 0);
virtual void print_widget(Fl_Widget* widget, int delta_x = 0, int delta_y = 0);
/** Prints a window with its title bar and frame if any.
\p x_offset and \p y_offset are optional coordinates of where to position the window top left.
Equivalent to print_widget() if \p win is a subwindow or has no border.
Use Fl_Window::decorated_w() and Fl_Window::decorated_h() to get the size of the
printed window.
*/
void print_window(Fl_Window *win, int x_offset = 0, int y_offset = 0);
virtual void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x = 0, int delta_y = 0);
virtual int end_page (void);
virtual void end_job (void);
};
@@ -87,6 +148,6 @@ public:
#endif // Fl_Paged_Device_H
//
// End of "$Id: Fl_Paged_Device.H 7622 2010-05-27 17:50:51Z manolo $"
// End of "$Id: Fl_Paged_Device.H 8699 2011-05-20 16:39:06Z manolo $"
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Pixmap.H 7617 2010-05-27 17:20:18Z manolo $"
// "$Id: Fl_Pixmap.H 7903 2010-11-28 21:06:39Z matt $"
//
// Pixmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -95,5 +95,5 @@ class FL_EXPORT Fl_Pixmap : public Fl_Image {
#endif
//
// End of "$Id: Fl_Pixmap.H 7617 2010-05-27 17:20:18Z manolo $".
// End of "$Id: Fl_Pixmap.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -55,7 +55,7 @@
My_Plugin blur_plugin();
\endcode
Plugins can be put into modules and either linked befor distribution, or loaded
Plugins can be put into modules and either linked before distribution, or loaded
from dynamically linkable files. An Fl_Plugin_Manager is used to list and
access all currently loaded plugins.
\code
@@ -67,8 +67,7 @@
}
\endcode
*/
class FL_EXPORT Fl_Plugin
{
class FL_EXPORT Fl_Plugin {
Fl_Preferences::ID id;
public:
Fl_Plugin(const char *klass, const char *name);
@@ -80,8 +79,7 @@ public:
\brief Fl_Plugin_Manager manages link-time and run-time plugin binaries.
\see Fl_Plugin
*/
class FL_EXPORT Fl_Plugin_Manager : public Fl_Preferences
{
class FL_EXPORT Fl_Plugin_Manager : public Fl_Preferences {
public:
Fl_Plugin_Manager(const char *klass);
~Fl_Plugin_Manager();

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Positioner.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Positioner.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Positioner header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -40,8 +40,8 @@
It would be useful if this could be put atop another widget so that the
crosshairs are on top, but this is not implemented. The color of the
crosshairs is selection_color().
<P ALIGN=CENTER>\image html positioner.gif </P>
\image latex positioner.eps " Fl_Positioner" width=4cm
<P ALIGN=CENTER>\image html positioner.png </P>
\image latex positioner.png " Fl_Positioner" width=4cm
*/
class FL_EXPORT Fl_Positioner : public Fl_Widget {
@@ -99,5 +99,5 @@ public:
#endif
//
// End of "$Id: Fl_Positioner.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Positioner.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_PostScript.H 7622 2010-05-27 17:50:51Z manolo $"
// "$Id: Fl_PostScript.H 8699 2011-05-20 16:39:06Z manolo $"
//
// Support for graphics output to PostScript file for the Fast Light Tool Kit (FLTK).
//
// Copyright 2010 by Bill Spitzak and others.
// Copyright 2010-2011 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
@@ -35,70 +35,40 @@
#include <FL/Fl_Paged_Device.H>
#include <FL/fl_draw.H>
#define NO_PAGE_FORMATS 30 /* MSVC6 compilation fix */
/**
\brief PostScript graphical backend.
*
PostScript text output is presently implemented only for the latin character set.
FLTK's standard fonts are output using PostScript's standard fonts: Helvetica, Courier,
Times (and their bold, oblique, italic variants), Symbol, ZapfDingbats.
PostScript text uses vectorial fonts for the latin alphabet (exactly: all unicode
characters between U+0020 and U+017F, that is, ASCII, Latin-1 Supplement and Latin Extended-A charts)
plus a few other characters:
<table>
<tr> <th>Char</th><th>Codepoint</th><th>Name</th> <th>Char</th><th>Codepoint</th><th>Name</th> <th>Char</th><th>Codepoint</th><th>Name</th></tr>
<tr><td>ƒ</td><td>U+0192</td><td>florin</td><td></td><td>U+201A</td><td>quotesinglbase</td><td>™</td><td>U+2122</td><td>trademark</td></tr>
<tr><td>ˆ</td><td>U+02C6</td><td>circumflex</td><td>“</td><td>U+201C</td><td>quotedblleft</td><td>∂</td><td>U+2202</td><td>partialdiff</td></tr>
<tr><td>ˇ</td><td>U+02C7</td><td>caron</td><td>”</td><td>U+201D</td><td>quotedblright</td><td>Δ</td><td>U+2206</td><td>Delta</td></tr>
<tr><td>˘</td><td>U+02D8</td><td>breve</td><td>„</td><td>U+201E</td><td>quotedblbase</td><td>∑</td><td>U+2211</td><td>summation</td></tr>
<tr><td>˙</td><td>U+02D9</td><td>dotaccent</td><td>†</td><td>U+2020</td><td>dagger</td><td>√</td><td>U+221A</td><td>radical</td></tr>
<tr><td>˚</td><td>U+02DA</td><td>ring</td><td>‡</td><td>U+2021</td><td>daggerdbl</td><td>∞</td><td>U+221E</td><td>infinity</td></tr>
<tr><td>˛</td><td>U+02DB</td><td>ogonek</td><td>•</td><td>U+2022</td><td>bullet</td><td>≠</td><td>U+2260</td><td>notequal</td></tr>
<tr><td>˜</td><td>U+02DC</td><td>tilde</td><td>…</td><td>U+2026</td><td>ellipsis</td><td>≤</td><td>U+2264</td><td>lessequal</td></tr>
<tr><td>˝</td><td>U+02DD</td><td>hungarumlaut</td><td>‰</td><td>U+2030</td><td>perthousand</td><td>≥</td><td>U+2265</td><td>greaterequal</td></tr>
<tr><td></td><td>U+2013</td><td>endash</td><td></td><td>U+2039</td><td>guilsinglleft</td><td>◊</td><td>U+25CA</td><td>lozenge</td></tr>
<tr><td>—</td><td>U+2014</td><td>emdash</td><td></td><td>U+203A</td><td>guilsinglright</td><td>fi</td><td>U+FB01</td><td>fi</td></tr>
<tr><td></td><td>U+2018</td><td>quoteleft</td><td>/</td><td>U+2044</td><td>fraction</td><td>fl</td><td>U+FB02</td><td>fl</td></tr>
<tr><td></td><td>U+2019</td><td>quoteright</td><td>€</td><td>U+20AC</td><td>Euro</td><td></td><td>U+F8FF</td><td>apple (Mac OS only)</td></tr>
</table>
<br> All other unicode characters are output as a bitmap.
<br> FLTK standard fonts are output using PostScript standard fonts: Helvetica, Courier,
Times (and their bold, oblique, italic variants).
*/
class Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver {
class FL_EXPORT Fl_PostScript_Graphics_Driver : public Fl_Graphics_Driver {
public:
static const char *device_type;
/**
\brief Possible page formats.
*/
enum Page_Format {
A0 = 0,
A1,
A2,
A3,
A4,
A5,
A6,
A7,
A8,
A9,
B0,
B1,
B2,
B3,
B4,
B5,
B6,
B7,
B8,
B9,
B10,
C5E,
DLE,
EXECUTIVE,
FOLIO,
LEDGER,
LEGAL,
LETTER,
TABLOID,
ENVELOPE,
MEDIA = 0x1000
};
/**
\brief Possible page layouts.
*/
enum Page_Layout {PORTRAIT = 0, LANDSCAPE = 0x100, REVERSED = 0x200, ORIENTATION = 0x300};
static const char *class_id;
const char *class_name() {return class_id;};
Fl_PostScript_Graphics_Driver();
#ifndef FL_DOXYGEN
public:
enum SHAPE{NONE=0, LINE, LOOP, POLYGON, POINTS};
typedef struct page_format {
int width;
int height;
const char *name;
} page_format;
class Clip {
public:
int x, y, w, h;
@@ -107,9 +77,6 @@ class Clip {
Clip * clip_;
int lang_level_;
int font_;
int size_;
Fl_Color color_;
int gap_;
int pages_;
@@ -144,29 +111,35 @@ class Clip {
FILE *output;
double pw_, ph_;
static const page_format page_formats[NO_PAGE_FORMATS];
uchar bg_r, bg_g, bg_b;
int start_postscript (int pagecount, enum Page_Format format, enum Page_Layout layout);
int start_postscript (int pagecount, enum Fl_Paged_Device::Page_Format format, enum Fl_Paged_Device::Page_Layout layout);
/* int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
*/
void draw(const char* s, int n, int x, int y) {transformed_draw(s,n,x,y); };
void draw(int angle, const char *str, int n, int x, int y);
void transformed_draw(const char* s, int n, double x, double y); //precise text placing
void transformed_draw(const char* s, double x, double y);
int alpha_mask(const uchar * data, int w, int h, int D, int LD=0);
void draw_scaled_image(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D=3, int LD=0);
void draw_scaled_image_mono(const uchar *data, double x, double y, double w, double h, int iw, int ih, int D=3, int LD=0);
void draw_scaled_image(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D);
void draw_scaled_image_mono(Fl_Draw_Image_Cb call, void *data, double x, double y, double w, double h, int iw, int ih, int D);
enum Page_Format page_format_;
enum Fl_Paged_Device::Page_Format page_format_;
char *ps_filename_;
void page_policy(int p);
int page_policy(){return page_policy_;};
void close_command( int (*cmd)(FILE *)){close_cmd_=cmd;};
FILE * file() {return output;};
//void orientation (int o);
//Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int pages = 0); // ps (also multi-page) constructor
//Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int x, int y, int w, int h); //eps constructor
void interpolate(int i){interpolate_=i;};
int interpolate(){return interpolate_;}
void page(double pw, double ph, int media = 0);
void page(int format);
#endif // FL_DOXYGEN
// implementation of drawing methods
void color(Fl_Color c);
//void bg_color(Fl_Color bg);
void color(uchar r, uchar g, uchar b);
Fl_Color color(){return color_;};
void push_clip(int x, int y, int w, int h);
int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H);
@@ -214,66 +187,53 @@ class Clip {
void gap(){gap_=1;};
void end_complex_polygon(){end_polygon();};
void transformed_vertex(double x, double y);
void font(int face, int size);
int font(){return font_;};
int size(){return size_;};
double width(unsigned c);
double width(const char* s, int n);
int descent();
int height();
void draw_image(const uchar* d, int x,int y,int w,int h, int delta=3, int ldelta=0){draw_scaled_image(d,x,y,w,h,w,h,delta,ldelta);};
void draw_image_mono(const uchar* d, int x,int y,int w,int h, int delta=1, int ld=0){draw_scaled_image_mono(d,x,y,w,h,w,h,delta,ld);};
void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3){draw_scaled_image(call,data, x, y, w, h, w, h, delta);};
void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1){draw_scaled_image_mono(call, data, x, y, w, h, w, h, delta);};
void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy);
public:
void page_policy(int p);
int page_policy(){return page_policy_;};
void close_command( int (*cmd)(FILE *)){close_cmd_=cmd;};
FILE * file() {return output;};
//void orientation (int o);
//Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int pages = 0); // ps (also multi-page) constructor
//Fl_PostScript_Graphics_Driver(FILE *o, int lang_level, int x, int y, int w, int h); //eps constructor
void interpolate(int i){interpolate_=i;};
int interpolate(){return interpolate_;}
void page(double pw, double ph, int media = 0);
void page(int format);
void place(double x, double y, double tx, double ty, double scale = 1);
#endif // FL_DOXYGEN
Fl_PostScript_Graphics_Driver();
void draw_image(const uchar* d, int x,int y,int w,int h, int delta=3, int ldelta=0);
void draw_image_mono(const uchar* d, int x,int y,int w,int h, int delta=1, int ld=0);
void draw_image(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=3);
void draw_image_mono(Fl_Draw_Image_Cb call, void* data, int x,int y, int w, int h, int delta=1);
void draw(const char* s, int n, int x, int y) {transformed_draw(s,n,x,y); };
#ifdef __APPLE__
void draw(const char* s, int n, float x, float y) {transformed_draw(s,n,x,y); };
#endif
void draw(int angle, const char *str, int n, int x, int y);
void rtl_draw(const char* s, int n, int x, int y);
void font(int face, int size);
double width(const char *, int);
void text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h);
int height();
int descent();
void draw(Fl_Pixmap * pxm,int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy);
void draw(Fl_RGB_Image * rgb,int XP, int YP, int WP, int HP, int cx, int cy);
~Fl_PostScript_Graphics_Driver();
};
/**
\brief To send graphical output to a PostScript file.
*/
class Fl_PostScript_File_Device : public Fl_Paged_Device {
class FL_EXPORT Fl_PostScript_File_Device : public Fl_Paged_Device {
#ifdef __APPLE__
CGContextRef gc;
Fl_CGContextRef gc;
#endif
protected:
Fl_PostScript_Graphics_Driver *driver();
public:
static const char *device_type;
static const char *class_id;
const char *class_name() {return class_id;};
Fl_PostScript_File_Device();
~Fl_PostScript_File_Device();
int start_job(int pagecount, enum Fl_PostScript_Graphics_Driver::Page_Format format = Fl_PostScript_Graphics_Driver::A4,
enum Fl_PostScript_Graphics_Driver::Page_Layout layout = Fl_PostScript_Graphics_Driver::PORTRAIT);
int start_job(FILE *ps_output, int pagecount, enum Fl_PostScript_Graphics_Driver::Page_Format format = Fl_PostScript_Graphics_Driver::A4,
enum Fl_PostScript_Graphics_Driver::Page_Layout layout = Fl_PostScript_Graphics_Driver::PORTRAIT);
int start_job(int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4,
enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
int start_job(FILE *ps_output, int pagecount, enum Fl_Paged_Device::Page_Format format = Fl_Paged_Device::A4,
enum Fl_Paged_Device::Page_Layout layout = Fl_Paged_Device::PORTRAIT);
int start_page (void);
int printable_rect(int *w, int *h);
void margins(int *left, int *top, int *right, int *bottom);
void origin(int *x, int *y);
void origin(int x, int y);
void scale (float scale_x, float scale_y);
void scale (float scale_x, float scale_y = 0.);
void rotate(float angle);
void translate(int x, int y);
void untranslate(void);
@@ -289,5 +249,5 @@ public:
#endif // Fl_PostScript_H
//
// End of "$Id: Fl_PostScript.H 7622 2010-05-27 17:50:51Z manolo $"
// End of "$Id: Fl_PostScript.H 8699 2011-05-20 16:39:06Z manolo $"
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Preferences.H 7672 2010-07-10 09:44:45Z matt $"
// "$Id: Fl_Preferences.H 7949 2010-12-05 00:38:16Z greg.ercolano $"
//
// Preferences .
//
// Copyright 2002-2009 by Matthias Melcher.
// Copyright 2002-2010 by Matthias Melcher.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -32,8 +32,7 @@
# define Fl_Preferences_H
# include <stdio.h>
# include "Fl_Export.H"
# include "Fl_Export.H"
/**
\brief Fl_Preferences provides methods to store user
@@ -67,11 +66,9 @@
current chracter set or code page which renders them incompatible
for text entries using international characters.
*/
class FL_EXPORT Fl_Preferences
{
public:
class FL_EXPORT Fl_Preferences {
public:
/**
Define the scope of the preferences.
*/
@@ -99,7 +96,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 +153,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.
@@ -173,8 +168,7 @@ public:
char *data_;
public:
public:
Name( unsigned int n );
Name( const char *format, ... );
@@ -187,13 +181,11 @@ public:
};
/** \internal An entry associates a preference name to its corresponding value */
struct Entry
{
struct Entry {
char *name, *value;
};
private:
private:
Fl_Preferences() : node(0), rootNode(0) { }
Fl_Preferences &operator=(const Fl_Preferences&);
@@ -203,12 +195,12 @@ private:
class RootNode;
class FL_EXPORT Node // a node contains a list to all its entries
{ // and all means to manage the tree structure
class FL_EXPORT Node { // a node contains a list to all its entries
// and all means to manage the tree structure
Node *child_, *next_;
union { // these two are mutually exclusive
Node *parent_; // top_ bit clear
RootNode *root_; // top_ bit set
union { // these two are mutually exclusive
Node *parent_; // top_ bit clear
RootNode *root_; // top_ bit set
};
char *path_;
Entry *entry_;
@@ -257,8 +249,7 @@ private:
};
friend class Node;
class FL_EXPORT RootNode // the root node manages file paths and basic reading and writing
{
class FL_EXPORT RootNode { // the root node manages file paths and basic reading and writing
Fl_Preferences *prefs_;
char *filename_;
char *vendor_, *application_;
@@ -274,14 +265,12 @@ private:
friend class RootNode;
protected:
Node *node;
RootNode *rootNode;
};
#endif // !Fl_Preferences_H
//
// End of "$Id: Fl_Preferences.H 7672 2010-07-10 09:44:45Z matt $".
// End of "$Id: Fl_Preferences.H 7949 2010-12-05 00:38:16Z greg.ercolano $".
//

View File

@@ -1,5 +1,5 @@
//
// "$Id: Fl_Printer.H 7662 2010-07-01 15:35:28Z manolo $"
// "$Id: Fl_Printer.H 8699 2011-05-20 16:39:06Z manolo $"
//
// Printing support for the Fast Light Tool Kit (FLTK).
//
@@ -25,12 +25,13 @@
// http://www.fltk.org/str.php
//
/** \file Fl_Printer.H
\brief declaration of classes Fl_System_Printer, Fl_PostScript_Printer, Fl_Printer, Fl_Device_Plugin.
\brief declaration of classes Fl_Printer, Fl_System_Printer and Fl_PostScript_Printer.
*/
#ifndef Fl_Printer_H
#define Fl_Printer_H
#include <FL/x.H>
#include <FL/Fl_Paged_Device.H>
#include <FL/fl_draw.H>
#include <FL/Fl_Pixmap.H>
@@ -39,27 +40,31 @@
#include <stdio.h>
#if !(defined(__APPLE__) || defined(WIN32))
#include <FL/Fl_PostScript.H>
#elif defined(WIN32)
#include <commdlg.h>
#endif
#if defined(__APPLE__) || defined(WIN32) || defined(FL_DOXYGEN)
/**
\brief Print support under MSWindows and Mac OS X.
*
Print support under MSWindows and Mac OS.
Class Fl_System_Printer is implemented only on the MSWindows and Mac OS platforms.
It has no public constructor.
Use Fl_Printer instead that is cross-platform and has the same API.
Fl_Printer is typedef'ed to Fl_System_Printer under MSWindows and Mac OS X.
*/
class Fl_System_Printer : public Fl_Paged_Device {
friend class Fl_Printer;
private:
/** \brief the printer's graphics context, if there's one, NULL otherwise */
void *gc;
void set_current();
void set_current(void);
#ifdef __APPLE__
float scale_x;
float scale_y;
float angle; // rotation angle in radians
PMPrintSession printSession;
PMPageFormat pageFormat;
PMPrintSettings printSettings;
Fl_PMPrintSession printSession;
Fl_PMPageFormat pageFormat;
Fl_PMPrintSettings printSettings;
#elif defined(WIN32)
int abortPrint;
PRINTDLG pd;
@@ -69,117 +74,69 @@ private:
int top_margin;
void absolute_printable_rect(int *x, int *y, int *w, int *h);
#endif
public:
static const char *device_type;
/**
@brief The constructor.
*/
protected:
/** \brief The constructor */
Fl_System_Printer(void);
public:
static const char *class_id;
const char *class_name() {return class_id;};
int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
int start_page (void);
int printable_rect(int *w, int *h);
void margins(int *left, int *top, int *right, int *bottom);
void origin(int *x, int *y);
void origin(int x, int y);
void scale (float scale_x, float scale_y);
void scale (float scale_x, float scale_y = 0.);
void rotate(float angle);
void translate(int x, int y);
void untranslate(void);
int end_page (void);
void end_job (void);
/**
@brief The destructor.
*/
/** \brief The destructor */
~Fl_System_Printer(void);
#ifndef FL_DOXYGEN
public:
static const char *dialog_title;
static const char *dialog_printer;
static const char *dialog_range;
static const char *dialog_copies;
static const char *dialog_all;
static const char *dialog_pages;
static const char *dialog_from;
static const char *dialog_to;
static const char *dialog_properties;
static const char *dialog_copyNo;
static const char *dialog_print_button;
static const char *dialog_cancel_button;
static const char *dialog_print_to_file;
static const char *property_title;
static const char *property_pagesize;
static const char *property_mode;
static const char *property_use;
static const char *property_save;
static const char *property_cancel;
#endif // FL_DOXYGEN
}; // class Fl_System_Printer
/** \brief OS-independant class name */
typedef Fl_System_Printer Fl_Printer;
#endif
#if !(defined(__APPLE__) || defined(WIN32))
#if !(defined(__APPLE__) || defined(WIN32) )
/**
\brief Print support under Unix/Linux.
*
Print support under Unix/Linux.
Class Fl_PostScript_Printer is implemented only on the Unix/Linux platform.
It has no public constructor.
Use Fl_Printer instead that is cross-platform and has the same API.
Fl_Printer is typedef'ed to Fl_PostScript_Printer under Unix/Linux.
*/
class Fl_PostScript_Printer : public Fl_PostScript_File_Device {
private:
void set_current();
friend class Fl_Printer;
protected:
/** The constructor */
Fl_PostScript_Printer(void) {};
public:
static const char *device_type;
static const char *class_id;
const char *class_name() {return class_id;};
int start_job(int pages, int *firstpage = NULL, int *lastpage = NULL);
#ifndef FL_DOXYGEN
static const char *dialog_title;
static const char *dialog_printer;
static const char *dialog_range;
static const char *dialog_copies;
static const char *dialog_all;
static const char *dialog_pages;
static const char *dialog_from;
static const char *dialog_to;
static const char *dialog_properties;
static const char *dialog_copyNo;
static const char *dialog_print_button;
static const char *dialog_cancel_button;
static const char *dialog_print_to_file;
static const char *property_title;
static const char *property_pagesize;
static const char *property_mode;
static const char *property_use;
static const char *property_save;
static const char *property_cancel;
#endif // FL_DOXYGEN
};
/** \brief OS-independant class name */
typedef Fl_PostScript_Printer Fl_Printer;
#endif
/**
* @brief OS-independent print support.
* \brief OS-independent print support.
*
Fl_Printer allows to use all FLTK drawing, color, text, and clip functions, and to have them operate
on printed page(s). There are two main, non exclusive, ways to use it.
<ul><li>Print any widget (standard, custom, Fl_Window, Fl_Gl_Window) as it appears
on screen, with optional translation, scaling and rotation. This is done by calling print_widget()
or print_window_part().
<li>Use a series of FLTK graphics commands (e.g., font, text, lines, colors, clip) to
<li>Use a series of FLTK graphics commands (e.g., font, text, lines, colors, clip, image) to
compose a page appropriately shaped for printing.
</ul>
In both cases, begin by start_job(), start_page(), printable_rect() and origin() calls
and finish by end_page() and end_job() calls.
<p><b>Platform specifics</b>
<br>Fl_Printer is typedef'ed to Fl_PostScript_Printer under Unix/Linux
and to Fl_System_Printer otherwise. Both classes have the same API.
<ul>
<li>Unix/Linux platforms:
Class Fl_RGB_Image prints but loses its transparency if it has one.
PostScript text output is presently restricted to the Latin alphabet.
See class Fl_PostScript_Graphics_Driver for a description of how UTF-8 strings appear in print.
Use the static public attributes of this class to set the print dialog to other languages
than English. For example, the "Printer:" dialog item Fl_Printer::dialog_printer can be set to French with:
\code
@@ -194,25 +151,29 @@ typedef Fl_PostScript_Printer Fl_Printer;
<li>Mac OS X platform: all graphics requests print as on display.
</ul>
*/
#ifdef FL_DOXYGEN
// this class is NOT compiled. It's here for Doxygen documentation purpose only
class Fl_Printer : public Fl_System_Printer, Fl_PostScript_Printer {
class FL_EXPORT Fl_Printer : public Fl_Paged_Device {
public:
static const char *device_type;
/** @brief The constructor */
static const char *class_id;
const char *class_name() {return class_id;};
/** \brief The constructor */
Fl_Printer(void);
int start_job(int pagecount, int *frompage = NULL, int *topage = NULL);
int start_page(void);
int printable_rect(int *w, int *h);
void margins(int *left, int *top, int *right, int *bottom);
void origin(int *x, int *y);
void origin(int x, int y);
void scale(float scale_x, float scale_y);
void scale(float scale_x, float scale_y = 0.);
void rotate(float angle);
void translate(int x, int y);
void untranslate(void);
int end_page (void);
void end_job (void);
/** @brief The destructor */
void print_widget(Fl_Widget* widget, int delta_x=0, int delta_y=0);
void print_window_part(Fl_Window *win, int x, int y, int w, int h, int delta_x=0, int delta_y=0);
void set_current(void);
Fl_Graphics_Driver* driver(void);
/** \brief The destructor */
~Fl_Printer(void);
/** \name These attributes are effective under the Xlib platform only.
@@ -238,33 +199,16 @@ public:
static const char *property_save;
static const char *property_cancel;
/** \} */
};
private:
#if defined(WIN32) || defined(__APPLE__)
Fl_System_Printer *printer;
#else
Fl_PostScript_Printer *printer;
#endif
/**
This plugin socket allows the integration of new device drivers for special
window or screen types. It is currently used to provide an automated printing
service for OpenGL windows, if linked with fltk_gl.
*/
class Fl_Device_Plugin : public Fl_Plugin {
public:
/** \brief The constructor */
Fl_Device_Plugin(const char *name)
: Fl_Plugin(klass(), name) { }
/** \brief Returns the class name */
virtual const char *klass() { return "fltk:device"; }
/** \brief Returns the plugin name */
virtual const char *name() = 0;
/** \brief Prints a widget
\param w the widget
\param x,y offsets where to print relatively to coordinates origin
\param height height of the current drawing area
*/
virtual int print(Fl_Widget* w, int x, int y, int height) { return 0; }
};
#endif // Fl_Printer_H
//
// End of "$Id: Fl_Printer.H 7662 2010-07-01 15:35:28Z manolo $"
// End of "$Id: Fl_Printer.H 8699 2011-05-20 16:39:06Z manolo $"
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Progress.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Progress.H 8306 2011-01-24 17:04:22Z matt $"
//
// Progress bar widget definitions.
//
// Copyright 2000-2009 by Michael Sweet.
// Copyright 2000-2010 by Michael Sweet.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -44,8 +44,8 @@
/**
Displays a progress bar for the user.
*/
class FL_EXPORT Fl_Progress : public Fl_Widget
{
class FL_EXPORT Fl_Progress : public Fl_Widget {
float value_,
minimum_,
maximum_;
@@ -77,5 +77,5 @@ class FL_EXPORT Fl_Progress : public Fl_Widget
#endif // !_Fl_Progress_H_
//
// End of "$Id: Fl_Progress.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Progress.H 8306 2011-01-24 17:04:22Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_RGB_Image.H 6942 2009-11-18 12:22:51Z AlbrechtS $"
// "$Id: Fl_RGB_Image.H 7903 2010-11-28 21:06:39Z matt $"
//
// RGB Image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -31,5 +31,5 @@
#endif // !Fl_RGB_Image_H
//
// End of "$Id: Fl_RGB_Image.H 6942 2009-11-18 12:22:51Z AlbrechtS $".
// End of "$Id: Fl_RGB_Image.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Radio_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Radio_Button.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Radio button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -33,7 +33,7 @@
#include "Fl_Button.H"
class Fl_Radio_Button : public Fl_Button {
class FL_EXPORT Fl_Radio_Button : public Fl_Button {
public:
Fl_Radio_Button(int x,int y,int w,int h,const char *l=0)
: Fl_Button(x,y,w,h,l) {type(FL_RADIO_BUTTON);}
@@ -42,5 +42,5 @@ public:
#endif
//
// End of "$Id: Fl_Radio_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Radio_Button.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Radio_Light_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Radio_Light_Button.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Radio light button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -33,7 +33,7 @@
#include "Fl_Light_Button.H"
class Fl_Radio_Light_Button : public Fl_Light_Button {
class FL_EXPORT Fl_Radio_Light_Button : public Fl_Light_Button {
public:
Fl_Radio_Light_Button(int X,int Y,int W,int H,const char *l=0)
: Fl_Light_Button(X,Y,W,H,l) {type(FL_RADIO_BUTTON);}
@@ -42,5 +42,5 @@ public:
#endif
//
// End of "$Id: Fl_Radio_Light_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Radio_Light_Button.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Radio_Round_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Radio_Round_Button.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Radio round button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -33,7 +33,7 @@
#include "Fl_Round_Button.H"
class Fl_Radio_Round_Button : public Fl_Round_Button {
class FL_EXPORT Fl_Radio_Round_Button : public Fl_Round_Button {
public:
Fl_Radio_Round_Button(int x,int y,int w,int h,const char *l=0)
: Fl_Round_Button(x,y,w,h,l) {type(FL_RADIO_BUTTON);}
@@ -42,5 +42,5 @@ public:
#endif
//
// End of "$Id: Fl_Radio_Round_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Radio_Round_Button.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Repeat_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Repeat_Button.H 7903 2010-11-28 21:06:39Z matt $"
//
// Repeat button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -59,5 +59,5 @@ public:
#endif
//
// End of "$Id: Fl_Repeat_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Repeat_Button.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Return_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Return_Button.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Return button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -36,8 +36,8 @@
The Fl_Return_Button is a subclass of Fl_Button that
generates a callback when it is pressed or when the user presses the
Enter key. A carriage-return symbol is drawn next to the button label.
<P ALIGN=CENTER>\image html Fl_Return_Button.gif
\image latex Fl_Return_Button.eps "Fl_Return_Button" width=4cm
<P ALIGN=CENTER>\image html Fl_Return_Button.png
\image latex Fl_Return_Button.png "Fl_Return_Button" width=4cm
*/
class FL_EXPORT Fl_Return_Button : public Fl_Button {
protected:
@@ -56,5 +56,5 @@ public:
#endif
//
// End of "$Id: Fl_Return_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Return_Button.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Roller.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Roller.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Roller header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -38,8 +38,8 @@
/**
The Fl_Roller widget is a "dolly" control commonly used to
move 3D objects.
<P ALIGN=CENTER>\image html Fl_Roller.gif
\image latex Fl_Roller.eps "Fl_Roller" width=4cm
<P ALIGN=CENTER>\image html Fl_Roller.png
\image latex Fl_Roller.png "Fl_Roller" width=4cm
*/
class FL_EXPORT Fl_Roller : public Fl_Valuator {
protected:
@@ -52,5 +52,5 @@ public:
#endif
//
// End of "$Id: Fl_Roller.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Roller.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Round_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Round_Button.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Round button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -37,8 +37,8 @@
Buttons generate callbacks when they are clicked by the user. You
control exactly when and how by changing the values for type()
and when().
<P ALIGN=CENTER>\image html Fl_Round_Button.gif</P>
\image latex Fl_Round_Button.eps " Fl_Round_Button" width=4cm
<P ALIGN=CENTER>\image html Fl_Round_Button.png</P>
\image latex Fl_Round_Button.png " Fl_Round_Button" width=4cm
<P>The Fl_Round_Button subclass display the "on" state by
turning on a light, rather than drawing pushed in. The shape of the
"light" is initially set to FL_ROUND_DOWN_BOX. The color of the light
@@ -53,5 +53,5 @@ public:
#endif
//
// End of "$Id: Fl_Round_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Round_Button.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Round_Clock.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Round_Clock.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Round clock header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -34,7 +34,7 @@
#include "Fl_Clock.H"
/** A clock widget of type FL_ROUND_CLOCK. Has no box. */
class Fl_Round_Clock : public Fl_Clock {
class FL_EXPORT Fl_Round_Clock : public Fl_Clock {
public:
/** Creates the clock widget, setting his type and box. */
Fl_Round_Clock(int x,int y,int w,int h, const char *l = 0)
@@ -44,5 +44,5 @@ public:
#endif
//
// End of "$Id: Fl_Round_Clock.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Round_Clock.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Scroll.H 6951 2009-12-06 22:21:55Z matt $"
// "$Id: Fl_Scroll.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Scroll header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -39,8 +39,8 @@
larger than your window. If the child widgets are larger than the size
of this object then scrollbars will appear so that you can scroll over
to them:
\image html Fl_Scroll.gif
\image latex Fl_Scroll.eps "Fl_Scroll" width=4cm
\image html Fl_Scroll.png
\image latex Fl_Scroll.png "Fl_Scroll" width=4cm
If all of the child widgets are packed together into a solid
rectangle then you want to set box() to FL_NO_BOX or
@@ -195,5 +195,5 @@ public:
#endif
//
// End of "$Id: Fl_Scroll.H 6951 2009-12-06 22:21:55Z matt $".
// End of "$Id: Fl_Scroll.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Scrollbar.H 6683 2009-03-14 11:46:43Z engelsman $"
// "$Id: Fl_Scrollbar.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Scroll bar header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -46,8 +46,8 @@
have to use casts to get at the floating-point versions of value()
from Fl_Slider.
\image html scrollbar.gif
\image latex scrollbar.eps "Fl_Scrollbar" width=4cm
\image html scrollbar.png
\image latex scrollbar.png "Fl_Scrollbar" width=4cm
*/
class FL_EXPORT Fl_Scrollbar : public Fl_Slider {
@@ -116,5 +116,5 @@ public:
#endif
//
// End of "$Id: Fl_Scrollbar.H 6683 2009-03-14 11:46:43Z engelsman $".
// End of "$Id: Fl_Scrollbar.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Secret_Input.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Secret_Input.H 8726 2011-05-23 18:32:47Z AlbrechtS $"
//
// Secret input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2011 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
@@ -34,23 +34,31 @@
#include "Fl_Input.H"
/**
The Fl_Secret_Input class is a subclass of Fl_Input
that displays its input as a string of asterisks. This subclass is
usually used to receive passwords and other "secret" information.
The Fl_Secret_Input class is a subclass of Fl_Input that displays its
input as a string of placeholders. Depending on the platform this
placeholder is either the asterisk ('*') or the Unicode bullet
character (U+2022).
This subclass is usually used to receive passwords and other "secret" information.
*/
class Fl_Secret_Input : public Fl_Input {
class FL_EXPORT Fl_Secret_Input : public Fl_Input {
public:
/**
Creates a new Fl_Secret_Input widget using the given
position, size, and label string. The default boxtype is FL_DOWN_BOX.
<P>Inherited destructor destroys the widget and any value associated with it.
Inherited destructor destroys the widget and any value associated with it.
*/
#if defined(FL_DLL) // implementation in src/Fl_Input.cxx
Fl_Secret_Input(int X,int Y,int W,int H,const char *l = 0);
#else
Fl_Secret_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(X,Y,W,H,l) {type(FL_SECRET_INPUT);}
#endif
};
#endif
//
// End of "$Id: Fl_Secret_Input.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Secret_Input.H 8726 2011-05-23 18:32:47Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Select_Browser.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Select_Browser.H 8736 2011-05-24 20:00:56Z AlbrechtS $"
//
// Select browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -36,25 +36,29 @@
/**
The class is a subclass of Fl_Browser
which lets the user select a single item, or no items by clicking on
the empty space. As long as the mouse button is held down on an
the empty space. As long as the mouse button is held down on an
unselected item it is highlighted. Normally the callback is done when the
user presses the mouse, but you can change this with when().
<P>See Fl_Browser for methods to add and remove lines from the browser.
*/
class Fl_Select_Browser : public Fl_Browser {
class FL_EXPORT Fl_Select_Browser : public Fl_Browser {
public:
/**
/**
Creates a new Fl_Select_Browser widget using the given
position, size, and label string. The default boxtype is FL_DOWN_BOX.
The constructor specializes Fl_Browser() by setting the type to FL_SELECT_BROWSER.
The destructor destroys the widget and frees all memory that has been allocated.
*/
Fl_Select_Browser(int X,int Y,int W,int H,const char *l=0)
: Fl_Browser(X,Y,W,H,l) {type(FL_SELECT_BROWSER);}
#if defined(FL_DLL) // implementation in src/Fl_Browser.cxx
Fl_Select_Browser(int X,int Y,int W,int H,const char *L=0);
#else
Fl_Select_Browser(int X,int Y,int W,int H,const char *L=0)
: Fl_Browser(X,Y,W,H,L) {type(FL_SELECT_BROWSER);}
#endif
};
#endif
//
// End of "$Id: Fl_Select_Browser.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Select_Browser.H 8736 2011-05-24 20:00:56Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Shared_Image.H 7505 2010-04-14 20:47:34Z manolo $"
// "$Id: Fl_Shared_Image.H 8306 2011-01-24 17:04:22Z matt $"
//
// Shared image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -47,7 +47,11 @@ typedef Fl_Image *(*Fl_Shared_Handler)(const char *name, uchar *header,
function to support standard image formats such as BMP, GIF, JPEG, and PNG.
*/
class FL_EXPORT Fl_Shared_Image : public Fl_Image {
protected:
friend class Fl_JPEG_Image;
friend class Fl_PNG_Image;
protected:
static Fl_Shared_Image **images_; // Shared images
static int num_images_; // Number of shared images
@@ -106,5 +110,5 @@ FL_EXPORT extern void fl_register_images();
#endif // !Fl_Shared_Image_H
//
// End of "$Id: Fl_Shared_Image.H 7505 2010-04-14 20:47:34Z manolo $"
// End of "$Id: Fl_Shared_Image.H 8306 2011-01-24 17:04:22Z matt $"
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Simple_Counter.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Simple_Counter.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Simple counter header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -34,10 +34,10 @@
#include "Fl_Counter.H"
/**
This widget creates a counter with only 2 arrow buttons
<P align=center>\image html counter.gif</P>
\image latex counter.eps "Fl_Simple_Counter" width=4cm
<P align=center>\image html counter.png</P>
\image latex counter.png "Fl_Simple_Counter" width=4cm
*/
class Fl_Simple_Counter : public Fl_Counter {
class FL_EXPORT Fl_Simple_Counter : public Fl_Counter {
public:
Fl_Simple_Counter(int x,int y,int w,int h, const char *l = 0)
: Fl_Counter(x,y,w,h,l) {type(FL_SIMPLE_COUNTER);}
@@ -46,5 +46,5 @@ public:
#endif
//
// End of "$Id: Fl_Simple_Counter.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Simple_Counter.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Single_Window.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Single_Window.H 7903 2010-11-28 21:06:39Z matt $"
//
// Single-buffered window header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -63,5 +63,5 @@ public:
#endif
//
// End of "$Id: Fl_Single_Window.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Single_Window.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Slider.H 6683 2009-03-14 11:46:43Z engelsman $"
// "$Id: Fl_Slider.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -64,8 +64,8 @@
\li FL_HOR_NICE_SLIDER - Draws a horizontal slider with a
nice looking control knob.
\image html slider.gif
\image latex slider.eps "Fl_Slider" width=4cm
\image html slider.png
\image latex slider.png "Fl_Slider" width=4cm
*/
class FL_EXPORT Fl_Slider : public Fl_Valuator {
@@ -116,5 +116,5 @@ public:
#endif
//
// End of "$Id: Fl_Slider.H 6683 2009-03-14 11:46:43Z engelsman $".
// End of "$Id: Fl_Slider.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Spinner.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Spinner.H 8339 2011-01-30 12:50:19Z ianmacarthur $"
//
// Spinner widget for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -48,8 +48,8 @@
widget and repeat buttons. The user can either type into the
input area or use the buttons to change the value.
*/
class Fl_Spinner : public Fl_Group
{
class FL_EXPORT Fl_Spinner : public Fl_Group {
double value_; // Current value
double minimum_; // Minimum value
double maximum_; // Maximum value
@@ -233,14 +233,16 @@ class Fl_Spinner : public Fl_Group
void textsize(Fl_Fontsize s) {
input_.textsize(s);
}
/** Sets or Gets the numeric representation in the input field.
Valid values are FL_INT_INPUT and FL_FLOAT_INPUT.
The first form also changes the format() template.
Setting a new spinner type via a superclass pointer will not work.
\note type is not a virtual function.
/** Gets the numeric representation in the input field.
\see Fl_Spinner::type(uchar)
*/
uchar type() const { return (input_.type()); }
/** See uchar Fl_Spinner::type() const */
/** Sets the numeric representation in the input field.
Valid values are FL_INT_INPUT and FL_FLOAT_INPUT.
Also changes the format() template.
Setting a new spinner type via a superclass pointer will not work.
\note type is not a virtual function.
*/
void type(uchar v) {
if (v==FL_FLOAT_INPUT) {
format("%.*f");
@@ -262,5 +264,5 @@ class Fl_Spinner : public Fl_Group
#endif // !Fl_Spinner_H
//
// End of "$Id: Fl_Spinner.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Spinner.H 8339 2011-01-30 12:50:19Z ianmacarthur $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Sys_Menu_Bar.H 7518 2010-04-16 19:27:28Z manolo $"
// "$Id: Fl_Sys_Menu_Bar.H 7903 2010-11-28 21:06:39Z matt $"
//
// MacOS system menu bar header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -76,5 +76,5 @@ typedef Fl_Menu_Bar Fl_Sys_Menu_Bar;
#endif // Fl_Sys_Menu_Bar_H
//
// End of "$Id: Fl_Sys_Menu_Bar.H 7518 2010-04-16 19:27:28Z manolo $".
// End of "$Id: Fl_Sys_Menu_Bar.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,5 +1,5 @@
//
// "$Id: Fl_Table.H 7612 2010-05-19 07:22:37Z greg.ercolano $"
// "$Id: Fl_Table.H 8301 2011-01-22 22:40:11Z AlbrechtS $"
//
// Fl_Table -- A table widget
//
@@ -61,12 +61,19 @@
This widget can be used in several ways:
- As a custom widget; see test/testtablerow.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 custom widget; see examples/table-simple.cxx and 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,
simulating a numeric spreadsheet. See examples/table-spreadsheet.cxx and
examples/table-spreadsheet-with-keyboard-nav.cxx. Optimal for large tables.
- 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.
\image html table-simple.png
\image latex table-simple.png "table-simple example" width=6cm
\image html table-as-container.png
\image latex table-as-container.png "table-as-container example" width=6cm
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
@@ -74,11 +81,12 @@
When acting as a container for FLTK widgets, the FLTK widgets maintain
themselves. Although the draw_cell() method must be overridden, its contents
can be very simple. See the draw_cell() code in test/widgettable.cxx.
can be very simple. See the draw_cell() code in examples/table-simple.cxx.
The following variables are available to classes deriving from Fl_Table:
\image html table-dimensions.gif
\image html table-dimensions.png
\image latex table-dimensions.png "Fl_Table Dimensions" width=6cm
<table border=0>
<tr><td>x()/y()/w()/h()</td>
@@ -117,11 +125,12 @@
LICENSE
Greg added the following license to the original distribution of Fl_Table. He
kindly gave his permission to integrate Fl_Table and Fl_Table_row into FLTK,
kindly gave his permission to integrate Fl_Table and Fl_Table_Row into FLTK,
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 +174,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 {
class FL_EXPORT 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:
@@ -207,7 +220,7 @@ private:
int _selecting;
// An STL-ish vector without templates
class IntVector {
class FL_EXPORT IntVector {
int *arr;
unsigned int _size;
void init() {
@@ -326,38 +339,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
@@ -371,55 +393,53 @@ protected:
\code
// 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
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
}
\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)
@@ -472,9 +492,7 @@ public:
*/
virtual void clear() { rows(0); cols(0); }
// topline()
// middleline()
// bottomline()
// \todo: add topline(), middleline(), bottomline()
/**
Sets the kind of box drawn around the data table,
@@ -811,8 +829,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 +897,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
*/
@@ -943,7 +960,7 @@ public:
Fl_Widget::do_callback();
}
#if DOXYGEN
#if FL_DOXYGEN
/**
The Fl_Widget::when() function is used to set a group of flags, determining
when the widget callback is called:
@@ -975,7 +992,7 @@ public:
void when(Fl_When flags);
#endif
#if DOXYGEN
#if FL_DOXYGEN
/**
Callbacks will be called depending on the setting of Fl_Widget::when().
@@ -1025,34 +1042,31 @@ public:
</table>
\code
class MyTable
{
[..]
class MyTable : public Fl_Table {
[..]
private:
// Handle events that happen on the table
void event_callback2()
{
int R = callback_row(), // row where event occurred
C = callback_col(); // column where event occurred
TableContext context = callback_context(); // which part of table
fprintf(stderr, "callback: Row=%d Col=%d Context=%d Event=%d\n",
R, C, (int)context, (int)Fl::event());
}
// Actual static callback
static void event_callback(Fl_Widget*, void* data)
{
MyTable *o = (MyTable*)data;
o-&gt;event_callback2();
}
// Handle events that happen on the table
void event_callback2() {
int R = callback_row(), // row where event occurred
C = callback_col(); // column where event occurred
TableContext context = callback_context(); // which part of table
fprintf(stderr, "callback: Row=%d Col=%d Context=%d Event=%d\n",
R, C, (int)context, (int)Fl::event());
}
// Actual static callback
static void event_callback(Fl_Widget*, void* data) {
MyTable *o = (MyTable*)data;
o-&gt;event_callback2();
}
public:
MyTable() // Constructor
{
[..]
table.callback(&event_callback, (void*)this); // setup callback
table.when(FL_WHEN_CHANGED|FL_WHEN_RELEASE); // when to call it
}
// Constructor
MyTable() {
[..]
table.callback(&event_callback, (void*)this); // setup callback
table.when(FL_WHEN_CHANGED|FL_WHEN_RELEASE); // when to call it
}
};
\endcode
*/
@@ -1063,5 +1077,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 8301 2011-01-22 22:40:11Z AlbrechtS $".
//

View File

@@ -1,5 +1,5 @@
//
// "$Id: Fl_Table_Row.H 6942 2009-11-18 12:22:51Z AlbrechtS $"
// "$Id: Fl_Table_Row.H 8301 2011-01-22 22:40:11Z AlbrechtS $"
//
#ifndef _FL_TABLE_ROW_H
@@ -37,12 +37,10 @@
/**
A table with row selection capabilities.
This class implements a simple table of rows and columns that specializes in
the selection of rows. This widget is similar in behavior to a "mail subject
browser", similar to that found in mozilla, netscape and outlook mail browsers.
Most methods of importance will be found in the Fl_Table widget, such as
Fl_Table::rows() and Fl_Table::cols().
This class implements a simple table with the ability to select
rows. This widget is similar to an Fl_Browser with columns. Most
methods of importance will be found in the Fl_Table widget, such
as Fl_Table::rows() and Fl_Table::cols().
To be useful it must be subclassed and at minimum the draw_cell()
method must be overridden to provide the content of the cells. This widget
@@ -53,7 +51,7 @@
clicked by the user. You control when events are generated based on
the values you supply for Fl_Table::when().
*/
class Fl_Table_Row : public Fl_Table {
class FL_EXPORT Fl_Table_Row : public Fl_Table {
public:
enum TableRowSelectMode {
SELECT_NONE, // no selection allowed
@@ -62,7 +60,7 @@ public:
};
private:
// An STL-ish vector without templates
class CharVector {
class FL_EXPORT CharVector {
char *arr;
int _size;
void init() {
@@ -209,5 +207,5 @@ public:
#endif /*_FL_TABLE_ROW_H*/
//
// End of "$Id: Fl_Table_Row.H 6942 2009-11-18 12:22:51Z AlbrechtS $".
// End of "$Id: Fl_Table_Row.H 8301 2011-01-22 22:40:11Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Tabs.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Tabs.H 8101 2010-12-22 13:06:03Z AlbrechtS $"
//
// Tab header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -38,8 +38,8 @@
interface that allows you to put lots and lots of buttons and
switches in a panel, as popularized by many toolkits.
\image html tabs.gif
\image latex tabs.eps "Fl_Tabs" width=8cm
\image html tabs.png
\image latex tabs.png "Fl_Tabs" width=8cm
Clicking the tab makes a child visible() by calling
show() on it, and all other children are made invisible
@@ -62,7 +62,11 @@
class FL_EXPORT Fl_Tabs : public Fl_Group {
Fl_Widget *value_;
Fl_Widget *push_;
int tab_positions(int*, int*);
int *tab_pos; // array of x-offsets of tabs per child + 1
int *tab_width; // array of widths of tabs per child + 1
int tab_count; // array size
int tab_positions(); // allocate and calculate tab positions
void clear_tab_positions();
int tab_height();
void draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int sel=0);
protected:
@@ -77,10 +81,12 @@ public:
int push(Fl_Widget *);
Fl_Tabs(int,int,int,int,const char * = 0);
Fl_Widget *which(int event_x, int event_y);
~Fl_Tabs();
void client_area(int &rx, int &ry, int &rw, int &rh, int tabh=0);
};
#endif
//
// End of "$Id: Fl_Tabs.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Tabs.H 8101 2010-12-22 13:06:03Z AlbrechtS $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Text_Buffer.H 7527 2010-04-18 14:33:33Z engelsman $"
// "$Id: Fl_Text_Buffer.H 8148 2010-12-31 22:38:03Z matt $"
//
// Header file for Fl_Text_Buffer class.
//
// Copyright 2001-2009 by Bill Spitzak and others.
// Copyright 2001-2010 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
// the LGPL for the FLTK library granted by Mark Edel.
//
@@ -33,24 +33,34 @@
#ifndef FL_TEXT_BUFFER_H
#define FL_TEXT_BUFFER_H
#undef ASSERT_UTF8
#ifdef ASSERT_UTF8
# include <assert.h>
# define IS_UTF8_ALIGNED(a) if (a && *a) assert(fl_utf8len(*(a))>0);
# define IS_UTF8_ALIGNED2(a, b) if (b>=0 && b<a->length()) assert(fl_utf8len(a->byte_at(b))>0);
#else
# define IS_UTF8_ALIGNED(a)
# define IS_UTF8_ALIGNED2(a, b)
#endif
/*
Suggested UTF-8 terminology for this file:
?? "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)
(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?)
"character size" is the size of a UTF-8 character in bytes
"character width" is the width of a Unicode character in pixels
"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
"character width" is the width of a Unicode character in pixels
"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
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
*/
@@ -79,15 +89,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
@@ -97,12 +98,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
@@ -115,36 +110,24 @@ 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,41 +137,33 @@ 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/.
\todo unicode check
*/
class FL_EXPORT Fl_Text_Buffer {
public:
@@ -218,13 +193,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
\todo unicode check
Replaces the entire contents of the text buffer.
\param text Text must be valid utf8.
*/
void text(const char* text);
@@ -236,37 +211,42 @@ 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)
@@ -276,7 +256,7 @@ public:
/**
Appends the text string to the end of the buffer.
\todo unicode check
\param t utf-8 encoded and nul terminated text
*/
void append(const char* t) { insert(length(), t); }
@@ -296,16 +276,17 @@ 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.
\todo unicode check
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
*/
void copy(Fl_Text_Buffer* fromBuf, int fromStart, int fromEnd, int toPos);
/**
Undo text modification according to the undo variables or insert text
from the undo buffer
\todo unicode check
*/
int undo(int *cp=0);
@@ -319,23 +300,22 @@ public:
non-zero on error (strerror() contains reason). 1 indicates open
for read failed (no data loaded). 2 indicates error occurred
while reading data (data was partially loaded).
\todo unicode check
File can be UTF-8 or CP1252-encoded.
If the input file is not UTF-8-encoded, the Fl_Text_Buffer widget will contain
UTF-8-transcoded data. By default, the message Fl_Text_Buffer::file_encoding_warning_message
will warn the user about this.
\see input_file_was_transcoded and transcoding_warning_action.
*/
int insertfile(const char *file, int pos, int buflen = 128*1024);
/**
Appends the named file to the end of the buffer. Returns 0 on
success, non-zero on error (strerror() contains reason). 1 indicates
open for read failed (no data loaded). 2 indicates error occurred
while reading data (data was partially loaded).
\todo unicode check
Appends the named file to the end of the buffer. See also insertfile().
*/
int appendfile(const char *file, int buflen = 128*1024)
{ return insertfile(file, length(), buflen); }
/**
Loads a text file into the buffer
\todo unicode check
Loads a text file into the buffer. See also insertfile().
*/
int loadfile(const char *file, int buflen = 128*1024)
{ select(0, length()); remove_selection(); return appendfile(file, buflen); }
@@ -345,81 +325,28 @@ public:
on error (strerror() contains reason). 1 indicates open for write failed
(no data saved). 2 indicates error occurred while writing data
(data was partially saved).
\todo unicode check
*/
int outputfile(const char *file, int start, int end, int buflen = 128*1024);
/**
Saves a text file from the current buffer
\todo unicode check
*/
int savefile(const char *file, int buflen = 128*1024)
{ 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
*/
int tab_distance() const { return mTabDist; }
/**
Set the hardware tab distance (width) used by all displays for this buffer,
and used in computing offsets for rectangular selection operations.
\todo unicode check
*/
void tab_distance(int tabDist);
/**
Selects a range of characters in the buffer.
\todo unicode check
*/
void select(int start, int end);
@@ -430,51 +357,32 @@ public:
/**
Cancels any previous selection on the primary text selection object
\todo unicode check
*/
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
*/
char* selection_text();
/**
Removes the text in the primary selection.
\todo unicode check
*/
void remove_selection();
/**
Replaces the text in the primary selection.
\todo unicode check
*/
void replace_selection(const char* text);
/**
Selects a range of characters in the secondary selection.
\todo unicode check
*/
void secondary_select(int start, int end);
@@ -486,53 +394,33 @@ public:
/**
Clears any selection in the secondary text selection object.
\todo unicode check
*/
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
*/
char* secondary_selection_text();
/**
Removes the text from the buffer corresponding to the secondary text selection object.
\todo unicode check
*/
void remove_secondary_selection();
/**
Replaces the text from the buffer corresponding to the secondary
text selection object with the new string \p text.
\todo unicode check
*/
void replace_secondary_selection(const char* text);
/**
Highlights the specified text within the buffer.
\todo unicode check
*/
void highlight(int start, int end);
@@ -544,33 +432,17 @@ public:
/**
Unhighlights text in the buffer.
\todo unicode check
*/
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
*/
char* highlight_text();
@@ -583,13 +455,11 @@ public:
int nRestyled, const char* deletedText,
void* cbArg);
\endcode
\todo unicode check
*/
void add_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, void* cbArg);
/**
Removes a modify callback.
\todo unicode check
*/
void remove_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, void* cbArg);
@@ -597,27 +467,23 @@ public:
Calls all modify callbacks that have been registered using
the add_modify_callback()
method.
\todo unicode check
*/
void call_modify_callbacks() { call_modify_callbacks(0, 0, 0, 0, 0); }
/**
Adds a callback routine to be called before text is deleted from the buffer.
\todo unicode check
*/
void add_predelete_callback(Fl_Text_Predelete_Cb bufPredelCB, void* cbArg);
/**
Removes a callback routine \p bufPreDeleteCB associated with argument \p cbArg
to be called before text is deleted from the buffer.
\todo unicode check
*/
void remove_predelete_callback(Fl_Text_Predelete_Cb predelCB, void* cbArg);
/**
Calls the stored pre-delete callback procedure(s) for this buffer to update
the changed area(s) on the screen and any other listeners.
\todo unicode check
*/
void call_predelete_callbacks() { call_predelete_callbacks(0, 0); }
@@ -625,13 +491,15 @@ 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.
\todo unicode check
\param pos byte index into buffer
\return copy of utf8 text, must be free'd
*/
char* line_text(int pos) const;
/**
Returns the position of the start of the line containing position \p pos.
\todo unicode check
\param pos byte index into buffer
\return byte offset to line start
*/
int line_start(int pos) const;
@@ -639,68 +507,30 @@ 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)
\todo unicode check
\param pos byte index into buffer
\return byte offset to line end
*/
int line_end(int pos) const;
/**
Returns the position corresponding to the start of the word
\todo unicode check
\param pos byte index into buffer
\return byte offset to word start
*/
int word_start(int pos) const;
/**
Returns the position corresponding to the end of the word.
\todo unicode check
\param pos byte index into buffer
\return byte offset to word end
*/
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
control characters are expanded)
\todo unicode check
*/
int count_displayed_characters(int lineStartPos, int targetPos) const;
@@ -711,21 +541,18 @@ public:
\param lineStartPos byte offset into buffer
\param nChars number of bytes that are sent to the display
\return byte offset in input after all output bytes are sent
\todo unicode check
*/
int skip_displayed_characters(int lineStartPos, int nChars);
/**
Counts the number of newlines between \p startPos and \p endPos in buffer.
The character at position \p endPos is not counted.
\todo unicode check
*/
int count_lines(int startPos, int endPos) const;
/**
Finds the first character of the line \p nLines forward from \p startPos
in the buffer and returns its position
\todo unicode check
*/
int skip_lines(int startPos, int nLines);
@@ -733,7 +560,6 @@ public:
Finds and returns the position of the first character of the line \p nLines backwards
from \p startPos (not counting the character pointed to by \p startpos if
that is a newline) in the buffer. \p nLines == 0 means find the beginning of the line
\todo unicode check
*/
int rewind_lines(int startPos, int nLines);
@@ -745,9 +571,12 @@ 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)
\todo unicode check
\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
*/
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,33 +585,22 @@ 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)
\todo unicode check
\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
*/
int findchar_backward(int startPos, char 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.
\todo unicode check
*/
int findchars_forward(int startPos, const char* searchChars, int* foundPos) const;
/**
Finds the previous occurrence of the specified characters.
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.
\todo unicode check
*/
int findchars_backward(int startPos, const char* searchChars, int* foundPos) const;
int findchar_backward(int startPos, unsigned int searchChar, int* foundPos) const;
/**
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.
\todo unicode check
\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
*/
int search_forward(int startPos, const char* searchString, int* foundPos,
int matchCase = 0) const;
@@ -791,7 +609,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.
\todo unicode check
\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
*/
int search_backward(int startPos, const char* searchString, int* foundPos,
int matchCase = 0) const;
@@ -816,12 +638,51 @@ 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;
int prev_char_clipped(int ix) const;
/**
Returns the index of the next character.
\param ix index to the current char
*/
int next_char(int ix) const;
int next_char_clipped(int ix) const;
/**
Align an index into the buffer to the current or previous utf8 boundary.
*/
int utf8_align(int) const;
/**
\brief true iff the loaded file has been transcoded to UTF-8
*/
int input_file_was_transcoded;
/** This message may be displayed using the fl_alert() function when a file
which was not UTF-8 encoded is input.
*/
static const char* file_encoding_warning_message;
/**
\brief Pointer to a function called after reading a non UTF-8 encoded file.
This function is called after reading a file if the file content
was transcoded to UTF-8. Its default implementation calls fl_alert()
with the text of \ref file_encoding_warning_message. No warning message is
displayed if this pointer is set to NULL. Use \ref input_file_was_transcoded
to be informed if file input required transcoding to UTF-8.
*/
void (*transcoding_warning_action)(Fl_Text_Buffer*);
protected:
/**
Calls the stored modify callback procedure(s) for this buffer to update the
changed area(s) on the screen and any other listeners.
\todo unicode check
*/
void call_modify_callbacks(int pos, int nDeleted, int nInserted,
int nRestyled, const char* deletedText) const;
@@ -829,7 +690,6 @@ protected:
/**
Calls the stored pre-delete callback procedure(s) for this buffer to update
the changed area(s) on the screen and any other listeners.
\todo unicode check
*/
void call_predelete_callbacks(int pos, int nDeleted) const;
@@ -839,7 +699,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).
\todo unicode check
\return the number of bytes inserted
*/
int insert_(int pos, const char* text);
@@ -847,64 +707,24 @@ protected:
Internal (non-redisplaying) version of BufRemove. Removes the contents
of the buffer between start and end (and moves the gap to the site of
the delete).
\todo unicode check
*/
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
*/
void redisplay_selection(Fl_Text_Selection* oldSelection,
Fl_Text_Selection* newSelection) const;
/**
\todo unicode check
Move the gap to start at a new position.
*/
void move_gap(int pos);
/**
Reallocates the text storage in the buffer to have a gap starting at \p newGapStart
and a gap size of \p newGapLen, preserving the buffer's current contents.
\todo unicode check
*/
void reallocate_with_gap(int newGapStart, int newGapLen);
@@ -912,38 +732,16 @@ protected:
/**
Removes the text from the buffer corresponding to \p sel.
\todo unicode check
*/
void remove_selection_(Fl_Text_Selection* sel);
/**
Replaces the \p text in selection \p sel.
\todo unicode check
*/
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
*/
void update_selections(int pos, int nDeleted, int nInserted);
@@ -959,15 +757,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 +777,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 8148 2010-12-31 22:38:03Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Text_Display.H 7527 2010-04-18 14:33:33Z engelsman $"
// "$Id: Fl_Text_Display.H 8306 2011-01-24 17:04:22Z matt $"
//
// Header file for Fl_Text_Display class.
//
// Copyright 2001-2009 by Bill Spitzak and others.
// Copyright 2001-2010 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
// the LGPL for the FLTK library granted by Mark Edel.
//
@@ -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,441 @@
#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.
*/
\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, 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);
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); }
the character position is the left edge of a character, whereas
the cursor is thought to be between the centers of two 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_NONE = -2,
DRAG_START_DND = -1,
DRAG_CHAR = 0,
DRAG_WORD = 1,
DRAG_LINE = 2
};
/**
wrap types - used in wrap_mode()
*/
enum {
WRAP_NONE, /**< don't wrap text at all */
WRAP_AT_COLUMN, /**< wrap text at the given text column */
WRAP_AT_PIXEL, /**< wrap text at a pixel position */
WRAP_AT_BOUNDS /**< wrap text so that it fits into the widget width */
};
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, andsize 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 position_to_xy(int pos, int* x, int* y) const;
void highlight_data(Fl_Text_Buffer *styleBuffer,
const Style_Table_Entry *styleTable,
int nStyles, char unfinishedStyle,
Unfinished_Style_Cb unfinishedHighlightCB,
void *cbArg);
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 startPos, bool startPosIsLineStart) 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 words
*/
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 overridden 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; mColumnScale = 0;}
/**
Gets the default size of text in the widget.
\return current text height unless overridden 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; mColumnScale = 0;}
/**
Gets the default color of text in the widget.
\return text color unless overridden 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);
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
/**
Convert an x pixel position into a column number.
\param x number of pixels from the left margin
\return an approximate column number based on the main font
*/
double x_to_col(double x) const;
/**
Convert a column number into an x pixel position.
\param col an approximate column number based on the main font
\return number of pixels from the left margin to the left of an
average sized character
*/
double col_to_x(double col) const;
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,
FIND_INDEX_FROM_ZERO,
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;
double 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;
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;
int 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;
double 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 mCursorPreferredXPos; /* Pixel position 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 mWrapMarginPix; /* Margin in # of pixels 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 */
mutable double mColumnScale; /* Width in pixels of an average character. This
value is calculated as needed (lazy eval); it
needs to be mutable so that it can be calculated
within a method marked as "const" */
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 8306 2011-01-24 17:04:22Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Text_Editor.H 6893 2009-09-20 19:24:24Z greg.ercolano $"
// "$Id: Fl_Text_Editor.H 7903 2010-11-28 21:06:39Z matt $"
//
// Header file for Fl_Text_Editor class.
//
// Copyright 2001-2009 by Bill Spitzak and others.
// Copyright 2001-2010 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
// the LGPL for the FLTK library granted by Mark Edel.
//
@@ -136,6 +136,6 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display {
#endif
//
// End of "$Id: Fl_Text_Editor.H 6893 2009-09-20 19:24:24Z greg.ercolano $".
// End of "$Id: Fl_Text_Editor.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Tile.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Tile.H 7981 2010-12-08 23:53:04Z greg.ercolano $"
//
// Tile header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -37,8 +37,8 @@
The Fl_Tile class lets you resize the children by dragging
the border between them:
<P ALIGN=CENTER>\image html Fl_Tile.gif </P>
\image latex Fl_Tile.eps "Fl_Tile" width=4cm
<P ALIGN=CENTER>\image html Fl_Tile.png </P>
\image latex Fl_Tile.png "Fl_Tile" width=4cm
<P>For the tiling to work correctly, the children of an
Fl_Tile must cover the entire area of the widget, but not
@@ -98,5 +98,5 @@ public:
#endif
//
// End of "$Id: Fl_Tile.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Tile.H 7981 2010-12-08 23:53:04Z greg.ercolano $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Tiled_Image.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Tiled_Image.H 7903 2010-11-28 21:06:39Z matt $"
//
// Tiled image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -66,5 +66,5 @@ class FL_EXPORT Fl_Tiled_Image : public Fl_Image {
#endif // !Fl_Tiled_Image_H
//
// End of "$Id: Fl_Tiled_Image.H 6614 2009-01-01 16:11:32Z matt $"
// End of "$Id: Fl_Tiled_Image.H 7903 2010-11-28 21:06:39Z matt $"
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Timer.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Timer.H 7903 2010-11-28 21:06:39Z matt $"
//
// Timer header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -82,6 +82,6 @@ public:
#endif
//
// End of "$Id: Fl_Timer.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Timer.H 7903 2010-11-28 21:06:39Z matt $".
//

View File

@@ -1,9 +1,9 @@
//
// "$Id: Fl_Toggle_Button.H 6614 2009-01-01 16:11:32Z matt $"
// "$Id: Fl_Toggle_Button.H 8022 2010-12-12 23:21:03Z AlbrechtS $"
//
// Toggle button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2009 by Bill Spitzak and others.
// Copyright 1998-2010 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
@@ -42,7 +42,7 @@
control exactly when and how by changing the values for type()
and when().
*/
class Fl_Toggle_Button : public Fl_Button {
class FL_EXPORT Fl_Toggle_Button : public Fl_Button {
public:
/**
Creates a new Fl_Toggle_Button widget using the given
@@ -56,5 +56,5 @@ public:
#endif
//
// End of "$Id: Fl_Toggle_Button.H 6614 2009-01-01 16:11:32Z matt $".
// End of "$Id: Fl_Toggle_Button.H 8022 2010-12-12 23:21:03Z AlbrechtS $".
//

Some files were not shown because too many files have changed in this diff Show More