mirror of
https://github.com/LMMS/lmms.git
synced 2026-03-19 14:38:22 -04:00
ZynAddSubFX/FLTK: updated to SVN revision 6921
Updated FLTK to SVN revision 6921 of branch-1.3:
- Managing all Widget flags in a single location now (STR #2161)
- Fixed all color related call to Fl_Color type (STR #2208)
- File chooser preview now recognizes utf8 encoded
text files (STR #2218)
- Empty functions in Fluid no longer create an
implementation (STR #2259)
- Fixed Fluid dependency on X11 (STR #2261)
- Updated the bundled libpng to v1.2.40 (released Sep. 10, 2009)
- Fixed Fl_Choice contrast with light-on-dark settings (STR #2219)
- Fixed X server "lock", if a modal dialog window is opened
while a menu is active (STR #1986)
- Updated mirror sites in documentation (STR #2220)
- Setting a default font for Xft (STR #2216)
- Temporarily limited builds to 32-bit on OX S to stay
compatible to Snow Leopard
- Fixed Windows compile bug with "#define USE_COLORMAP 0"
(STR #2241)
(cherry picked from commit c734023be2)
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
CHANGES IN FLTK 1.3.0
|
||||
|
||||
- Managing all Widget flags in a single location now (STR #2161)
|
||||
- Fixed all color related call to Fl_Color type (STR #2208)
|
||||
- File chooser preview now recognizes utf8 encoded
|
||||
text files (STR #2218)
|
||||
- Empty functions in Fluid no longer create an
|
||||
implementation (STR #2259)
|
||||
- Fixed Fluid dependency on X11 (STR #2261)
|
||||
- Updated the bundled libpng to v1.2.40 (released Sep. 10, 2009)
|
||||
- Fixed Fl_Choice contrast with light-on-dark settings (STR #2219)
|
||||
- Fixed X server "lock", if a modal dialog window is opened
|
||||
while a menu is active (STR #1986)
|
||||
- Updated mirror sites in documentation (STR #2220)
|
||||
- Setting a default font for Xft (STR #2216)
|
||||
- Temporarily limited builds to 32-bit on OX S to stay
|
||||
compatible to Snow Leopard
|
||||
- Fixed Windows compile bug with "#define USE_COLORMAP 0"
|
||||
(STR #2241)
|
||||
- Fixed glibc 2.10 compiler problems (Fedora 11 and others)
|
||||
with scandir() and strchr() (STR #2222)
|
||||
- Corrected const methods of Fl_Text_{Buffer|Display|Selection}
|
||||
@@ -27,7 +44,6 @@ CHANGES IN FLTK 1.3.0
|
||||
- Added drop box to utf8 test that will show the utf8 encoding
|
||||
for the first dropped character
|
||||
- Restructured the unittest application
|
||||
- Updated the bundled libpng to v1.2.35 (released 18 Feb. 2009)
|
||||
- Fl_Preferences.H now doesn't include windows.h any more
|
||||
(Windows only, STR #2173).
|
||||
- Fl_Window::draw() now doesn't reset its x/y-coordinates to 0
|
||||
|
||||
@@ -29,7 +29,7 @@ int main()
|
||||
{
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
jpeg_create_decompress(&cinfo);
|
||||
jpeg_read_header(&cinfo, true);
|
||||
jpeg_read_header(&cinfo, TRUE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ IF(UNIX)
|
||||
ENDIF(UNIX)
|
||||
|
||||
|
||||
# OS X with X11 is not currently supported!
|
||||
SET(FLTK_X11 1)
|
||||
SET(FLTK_APPLE 0)
|
||||
IF(APPLE)
|
||||
@@ -92,7 +93,7 @@ ENDIF(CYGWIN)
|
||||
|
||||
IF(MINGW)
|
||||
ADD_DEFINITIONS(-DWIN32)
|
||||
SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid wsock32 gdi32 comdlg32)
|
||||
SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 gdi32 comdlg32)
|
||||
ENDIF(MINGW)
|
||||
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Enumerations.H 6735 2009-04-01 22:11:57Z engelsman $"
|
||||
// "$Id: Enumerations.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Enumerations for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -330,6 +330,8 @@ enum Fl_When { // Fl_Widget::when():
|
||||
|
||||
/*@{*/
|
||||
|
||||
// FIXME: These codes collide with valid Unicode keys
|
||||
|
||||
#define FL_Button 0xfee8 ///< A mouse button; use Fl_Button + n for mouse button n.
|
||||
#define FL_BackSpace 0xff08 ///< The backspace key.
|
||||
#define FL_Tab 0xff09 ///< The tab key.
|
||||
@@ -391,6 +393,9 @@ enum Fl_When { // Fl_Widget::when():
|
||||
|
||||
/*@{*/ // group: Event States
|
||||
|
||||
// FIXME: it would be nice to have the modifiers in the upper 8 bit so that
|
||||
// a unicode ke (24bit) can be sent as an unsigned with the modifiers.
|
||||
|
||||
#define FL_SHIFT 0x00010000 ///< One of the shift keys is down
|
||||
#define FL_CAPS_LOCK 0x00020000 ///< The caps lock is on
|
||||
#define FL_CTRL 0x00040000 ///< One of the ctrl keys is down
|
||||
@@ -407,10 +412,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!
|
||||
|
||||
#ifdef __APPLE__
|
||||
# define FL_COMMAND FL_META ///< An alias for FL_CTRL 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_META 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
|
||||
#endif // __APPLE__
|
||||
|
||||
/*@}*/ // group: Event States
|
||||
@@ -689,7 +699,7 @@ extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size
|
||||
|
||||
/** \name Colors */
|
||||
/*@{*/
|
||||
/** The Fl_Color enumeration type holds a FLTK color value.
|
||||
/** 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.
|
||||
@@ -697,75 +707,94 @@ extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size
|
||||
Color indices occupy the lower 8 bits of the value, while
|
||||
RGB colors occupy the upper 24 bits, for a byte organization of RGBI.
|
||||
|
||||
\todo enum Fl_Color needs some more comments for values,
|
||||
see Fl/Enumerations.H
|
||||
<pre>
|
||||
Fl_Color => 0xrrggbbii
|
||||
| | | |
|
||||
| | | +--- index between 0 and 255
|
||||
| | +----- blue color component (8 bit)
|
||||
| +------- 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.
|
||||
|
||||
*/
|
||||
|
||||
enum Fl_Color { // standard colors
|
||||
// These are used as default colors in widgets and altered as necessary
|
||||
FL_FOREGROUND_COLOR = 0, ///< the default foreground color (0) used for labels and text
|
||||
FL_BACKGROUND2_COLOR = 7, ///< the default background color for text, list, and valuator widgets
|
||||
FL_INACTIVE_COLOR = 8, ///< the inactive foreground color
|
||||
FL_SELECTION_COLOR = 15, ///< the default selection/highlight color
|
||||
typedef unsigned int Fl_Color;
|
||||
|
||||
// Standard colors. These are used as default colors in widgets and altered as necessary
|
||||
const Fl_Color FL_FOREGROUND_COLOR = 0; ///< the default foreground color (0) used for labels and text
|
||||
const Fl_Color FL_BACKGROUND2_COLOR = 7; ///< the default background color for text, list, and valuator widgets
|
||||
const Fl_Color FL_INACTIVE_COLOR = 8; ///< the inactive foreground color
|
||||
const Fl_Color FL_SELECTION_COLOR = 15; ///< the default selection/highlight color
|
||||
|
||||
// boxtypes generally limit themselves to these colors so
|
||||
// the whole ramp is not allocated:
|
||||
|
||||
FL_GRAY0 = 32, // 'A'
|
||||
FL_DARK3 = 39, // 'H'
|
||||
FL_DARK2 = 45, // 'N'
|
||||
FL_DARK1 = 47, // 'P'
|
||||
FL_BACKGROUND_COLOR = 49, // 'R' default background color
|
||||
FL_LIGHT1 = 50, // 'S'
|
||||
FL_LIGHT2 = 52, // 'U'
|
||||
FL_LIGHT3 = 54, // 'W'
|
||||
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'
|
||||
|
||||
// FLTK provides a 5x8x5 color cube that is used with colormap visuals
|
||||
|
||||
FL_BLACK = 56,
|
||||
FL_RED = 88,
|
||||
FL_GREEN = 63,
|
||||
FL_YELLOW = 95,
|
||||
FL_BLUE = 216,
|
||||
FL_MAGENTA = 248,
|
||||
FL_CYAN = 223,
|
||||
FL_DARK_RED = 72,
|
||||
const Fl_Color FL_BLACK = 56;
|
||||
const Fl_Color FL_RED = 88;
|
||||
const Fl_Color FL_GREEN = 63;
|
||||
const Fl_Color FL_YELLOW = 95;
|
||||
const Fl_Color FL_BLUE = 216;
|
||||
const Fl_Color FL_MAGENTA = 248;
|
||||
const Fl_Color FL_CYAN = 223;
|
||||
const Fl_Color FL_DARK_RED = 72;
|
||||
|
||||
FL_DARK_GREEN = 60,
|
||||
FL_DARK_YELLOW = 76,
|
||||
FL_DARK_BLUE = 136,
|
||||
FL_DARK_MAGENTA = 152,
|
||||
FL_DARK_CYAN = 140,
|
||||
const Fl_Color FL_DARK_GREEN = 60;
|
||||
const Fl_Color FL_DARK_YELLOW = 76;
|
||||
const Fl_Color FL_DARK_BLUE = 136;
|
||||
const Fl_Color FL_DARK_MAGENTA = 152;
|
||||
const Fl_Color FL_DARK_CYAN = 140;
|
||||
|
||||
FL_WHITE = 255
|
||||
};
|
||||
const Fl_Color FL_WHITE = 255;
|
||||
|
||||
#define FL_FREE_COLOR (Fl_Color)16
|
||||
#define FL_NUM_FREE_COLOR 16
|
||||
#define FL_GRAY_RAMP (Fl_Color)32
|
||||
#define FL_NUM_GRAY 24
|
||||
#define FL_GRAY FL_BACKGROUND_COLOR
|
||||
#define FL_COLOR_CUBE (Fl_Color)56
|
||||
#define FL_NUM_RED 5
|
||||
#define FL_NUM_GREEN 8
|
||||
#define FL_NUM_BLUE 5
|
||||
|
||||
#define FL_FREE_COLOR (Fl_Color)16
|
||||
#define FL_NUM_FREE_COLOR 16
|
||||
#define FL_GRAY_RAMP (Fl_Color)32
|
||||
#define FL_NUM_GRAY 24
|
||||
#define FL_GRAY FL_BACKGROUND_COLOR
|
||||
#define FL_COLOR_CUBE (Fl_Color)56
|
||||
#define FL_NUM_RED 5
|
||||
#define FL_NUM_GREEN 8
|
||||
#define FL_NUM_BLUE 5
|
||||
|
||||
FL_EXPORT Fl_Color fl_inactive(Fl_Color c);
|
||||
|
||||
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);
|
||||
|
||||
inline Fl_Color fl_lighter(Fl_Color c) { return fl_color_average(c, FL_WHITE, .67f); }
|
||||
|
||||
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. */
|
||||
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 */
|
||||
inline Fl_Color fl_rgb_color(uchar g) {
|
||||
if (!g) return FL_BLACK;
|
||||
else return (Fl_Color)(((((g << 8) | g) << 8) | g) << 8);
|
||||
}
|
||||
|
||||
inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);}
|
||||
|
||||
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);}
|
||||
|
||||
@@ -857,5 +886,5 @@ enum Fl_Damage {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Enumerations.H 6735 2009-04-01 22:11:57Z engelsman $".
|
||||
// End of "$Id: Enumerations.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl.H 6771 2009-04-19 12:47:36Z matt $"
|
||||
// "$Id: Fl.H 6903 2009-09-27 11:09:03Z matt $"
|
||||
//
|
||||
// Main header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -489,18 +489,25 @@ public:
|
||||
static int event_state() {return e_state;}
|
||||
/** See int event_state() */
|
||||
static int event_state(int i) {return e_state&i;}
|
||||
/** Gets which key on the keyboard was last pushed.
|
||||
\retval 0 if the last event was not a key press or release.
|
||||
\see int event_key(int) */
|
||||
/**
|
||||
Gets which key on the keyboard was last pushed.
|
||||
|
||||
The returned integer 'key code' is not necessarily a text
|
||||
equivalent for the keystroke. For instance: if someone presses '5' on the
|
||||
numeric keypad with numlock on, Fl::event_key() may return the 'key code'
|
||||
for this key, and NOT the character '5'. To always get the '5', use Fl::event_text() instead.
|
||||
|
||||
\returns an integer 'key code', or 0 if the last event was not a key press or release.
|
||||
\see int event_key(int), event_text(), compose(int&).
|
||||
*/
|
||||
static int event_key() {return e_keysym;}
|
||||
/**
|
||||
Returns the keycode of the last key event, regardless of the NumLock state.
|
||||
|
||||
|
||||
If NumLock is deactivated, FLTK translates events from the
|
||||
numeric keypad into the corresponding arrow key events.
|
||||
event_key() returns the translated key code, whereas
|
||||
event_original_key() returns the keycode before
|
||||
NumLock translation.
|
||||
event_original_key() returns the keycode before NumLock translation.
|
||||
*/
|
||||
static int event_original_key(){return e_original_keysym;}
|
||||
/**
|
||||
@@ -548,7 +555,20 @@ public:
|
||||
slower than Fl::event_key(int). \see event_key(int)
|
||||
*/
|
||||
static int get_key(int key); // platform dependent
|
||||
/** Returns the text associated with the current FL_PASTE or FL_DND_RELEASE event. */
|
||||
/**
|
||||
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events.
|
||||
This can be used in response to FL_KEYUP, FL_KEYDOWN, FL_PASTE, FL_DND_RELEASE.
|
||||
|
||||
When responding to FL_KEYUP/FL_KEYDOWN, use this function instead of Fl::event_key()
|
||||
to get the text equivalent of keystrokes suitable for inserting into strings
|
||||
and text widgets.
|
||||
|
||||
The returned string is guaranteed to be be NULL terminated.
|
||||
However, see Fl::event_length() for the actual length of the string,
|
||||
in case the string itself contains NULLs that are part of the text data.
|
||||
|
||||
\returns A NULL terminated text string equivalent of the last keystroke.
|
||||
*/
|
||||
static const char* event_text() {return e_text;}
|
||||
/**
|
||||
Returns the length of the text in Fl::event_text(). There
|
||||
@@ -568,7 +588,7 @@ public:
|
||||
static void compose_reset() {compose_state = 0;}
|
||||
static int event_inside(int,int,int,int);
|
||||
static int event_inside(const Fl_Widget*);
|
||||
static int test_shortcut(int);
|
||||
static int test_shortcut(Fl_Shortcut);
|
||||
|
||||
// event destinations:
|
||||
static int handle(int, Fl_Window*);
|
||||
@@ -660,7 +680,7 @@ public:
|
||||
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 unsigned get_color(Fl_Color);
|
||||
static Fl_Color get_color(Fl_Color);
|
||||
static void get_color(Fl_Color, uchar&, uchar&, uchar&);
|
||||
/**
|
||||
Frees the specified color from the colormap, if applicable.
|
||||
@@ -1022,5 +1042,5 @@ public:
|
||||
#endif // !Fl_H
|
||||
|
||||
//
|
||||
// End of "$Id: Fl.H 6771 2009-04-19 12:47:36Z matt $".
|
||||
// End of "$Id: Fl.H 6903 2009-09-27 11:09:03Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Browser.H 6726 2009-03-27 16:52:31Z greg.ercolano $"
|
||||
// "$Id: Fl_Browser.H 6850 2009-09-07 02:25:51Z greg.ercolano $"
|
||||
//
|
||||
// Browser header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -36,6 +36,7 @@
|
||||
#define Fl_Browser_H
|
||||
|
||||
#include "Fl_Browser_.H"
|
||||
#include "Fl_Image.H"
|
||||
|
||||
struct FL_BLINE;
|
||||
|
||||
@@ -306,6 +307,11 @@ public:
|
||||
else Fl_Browser_::display(find_line(line));
|
||||
}
|
||||
|
||||
// icon support
|
||||
void icon(int line, Fl_Image* icon);
|
||||
Fl_Image* icon(int line) const;
|
||||
void remove_icon(int line);
|
||||
|
||||
/** For back compatibility only. */
|
||||
void replace(int a, const char* b) { text(a, b); }
|
||||
void display(int line, int val=1);
|
||||
@@ -314,5 +320,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Browser.H 6726 2009-03-27 16:52:31Z greg.ercolano $".
|
||||
// End of "$Id: Fl_Browser.H 6850 2009-09-07 02:25:51Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Browser_.H 6737 2009-04-02 06:44:34Z greg.ercolano $"
|
||||
// "$Id: Fl_Browser_.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Common browser header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -74,7 +74,7 @@ class FL_EXPORT Fl_Browser_ : public Fl_Group {
|
||||
uchar has_scrollbar_; // which scrollbars are enabled
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
void* top_; // which item scrolling position is in
|
||||
void* selection_; // which is selected (except for FL_MULTI_BROWSER)
|
||||
void *redraw1,*redraw2; // minimal update pointers
|
||||
@@ -297,11 +297,11 @@ public:
|
||||
/**
|
||||
Gets the default text color for the lines in the browser.
|
||||
*/
|
||||
Fl_Color textcolor() const { return (Fl_Color)textcolor_; }
|
||||
Fl_Color textcolor() const { return textcolor_; }
|
||||
/**
|
||||
Sets the default text color for the lines in the browser to color \p col.
|
||||
*/
|
||||
void textcolor(unsigned col) { textcolor_ = col; }
|
||||
void textcolor(Fl_Color col) { textcolor_ = col; }
|
||||
|
||||
/**
|
||||
Gets the current size of the scrollbars' troughs, in pixels.
|
||||
@@ -374,5 +374,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Browser_.H 6737 2009-04-02 06:44:34Z greg.ercolano $".
|
||||
// End of "$Id: Fl_Browser_.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Button.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Button.H 6878 2009-09-17 22:12:24Z matt $"
|
||||
//
|
||||
// Button header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -45,7 +45,7 @@
|
||||
#define FL_HIDDEN_BUTTON 3 ///< for Forms compatibility
|
||||
|
||||
#ifndef FL_DOXYGEN
|
||||
extern FL_EXPORT int fl_old_shortcut(const char*);
|
||||
extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -172,5 +172,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Button.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Button.H 6878 2009-09-17 22:12:24Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Chart.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Chart.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Forms chart header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -87,7 +87,7 @@ class FL_EXPORT Fl_Chart : public Fl_Widget {
|
||||
uchar autosize_;
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
protected:
|
||||
void draw();
|
||||
public:
|
||||
@@ -136,9 +136,9 @@ public:
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s;}
|
||||
|
||||
/** Gets the chart's text color */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** gets the chart's text color to \p n. */
|
||||
void textcolor(unsigned n) {textcolor_ = n;}
|
||||
void textcolor(Fl_Color n) {textcolor_ = n;}
|
||||
|
||||
/**
|
||||
Get whether the chart will automatically adjust the bounds of the chart.
|
||||
@@ -156,5 +156,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Chart.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Chart.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Clock.H 6754 2009-04-12 11:32:22Z AlbrechtS $"
|
||||
// "$Id: Fl_Clock.H 6812 2009-07-01 07:27:25Z AlbrechtS $"
|
||||
//
|
||||
// Clock header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -133,5 +133,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Clock.H 6754 2009-04-12 11:32:22Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Clock.H 6812 2009-07-01 07:27:25Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Counter.H 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: Fl_Counter.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Counter header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -58,7 +58,7 @@ class FL_EXPORT Fl_Counter : public Fl_Valuator {
|
||||
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
double lstep_;
|
||||
uchar mouseobj;
|
||||
static void repeat_callback(void *);
|
||||
@@ -111,14 +111,14 @@ public:
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s;}
|
||||
|
||||
/** Gets the font color */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Sets the font color to \p s */
|
||||
void textcolor(unsigned s) {textcolor_ = s;}
|
||||
void textcolor(Fl_Color s) {textcolor_ = s;}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Counter.H 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: Fl_Counter.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Group.H 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: Fl_Group.H 6907 2009-09-28 14:34:52Z matt $"
|
||||
//
|
||||
// Group header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -58,8 +58,6 @@ class FL_EXPORT Fl_Group : public Fl_Widget {
|
||||
Fl_Group& operator=(const Fl_Group&);
|
||||
|
||||
protected:
|
||||
enum { CLIP_CHILDREN = 2048 };
|
||||
|
||||
void draw();
|
||||
void draw_child(Fl_Widget& widget) const;
|
||||
void draw_children();
|
||||
@@ -176,7 +174,7 @@ public:
|
||||
|
||||
\see void Fl_Group::clip_children(int c)
|
||||
*/
|
||||
int clip_children() { return (flags() & CLIP_CHILDREN) != 0; }
|
||||
unsigned int clip_children() { return (flags() & CLIP_CHILDREN) != 0; }
|
||||
|
||||
// back compatibility functions:
|
||||
|
||||
@@ -224,5 +222,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Group.H 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: Fl_Group.H 6907 2009-09-28 14:34:52Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Input_.H 6777 2009-04-23 15:32:19Z matt $"
|
||||
// "$Id: Fl_Input_.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Input base class header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -120,7 +120,7 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget {
|
||||
\p mark_, no text is selected */
|
||||
int mark_;
|
||||
|
||||
/** \internal Offset to text origin within wdget bounds */
|
||||
/** \internal Offset to text origin within widget bounds */
|
||||
int xscroll_, yscroll_;
|
||||
|
||||
/** \internal Minimal update pointer. Display requirs redraw from here to the end
|
||||
@@ -143,10 +143,10 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget {
|
||||
Fl_Fontsize textsize_;
|
||||
|
||||
/** \internal color of the entire text */
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
|
||||
/** \internal color of the text cursor */
|
||||
unsigned cursor_color_;
|
||||
Fl_Color cursor_color_;
|
||||
|
||||
/** \internal Horizontal cursor position in pixels while movin up or down. */
|
||||
static double up_down_pos;
|
||||
@@ -206,6 +206,7 @@ protected:
|
||||
|
||||
/** \internal Vertical offset of text to top edge of widget. */
|
||||
int yscroll() const {return yscroll_;}
|
||||
void yscroll(int y) { yscroll_ = y; damage(FL_DAMAGE_EXPOSE);}
|
||||
|
||||
/* Return the number of lines displayed on a single page. */
|
||||
int linesPerPage();
|
||||
@@ -396,23 +397,23 @@ public:
|
||||
|
||||
/** Gets the color of the text in the input field.
|
||||
\return the text color
|
||||
\see textcolor(unsigned) */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
\see textcolor(Fl_Color) */
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
|
||||
/** Sets the color of the text in the input field.
|
||||
The text color defaults to \c FL_FOREGROUND_COLOR.
|
||||
\param [in] n new text color
|
||||
\see textcolor() */
|
||||
void textcolor(unsigned n) {textcolor_ = n;}
|
||||
void textcolor(Fl_Color n) {textcolor_ = n;}
|
||||
|
||||
/** Gets the color of the cursor.
|
||||
\return the current cursor color */
|
||||
Fl_Color cursor_color() const {return (Fl_Color)cursor_color_;}
|
||||
Fl_Color cursor_color() const {return cursor_color_;}
|
||||
|
||||
/** Sets the color of the cursor.
|
||||
The default color for the cursor is \c FL_BLACK.
|
||||
\param [in] n the new cursor color */
|
||||
void cursor_color(unsigned n) {cursor_color_ = n;}
|
||||
void cursor_color(Fl_Color n) {cursor_color_ = n;}
|
||||
|
||||
/** Gets the input field type.
|
||||
\return the current input type */
|
||||
@@ -450,5 +451,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Input_.H 6777 2009-04-23 15:32:19Z matt $".
|
||||
// End of "$Id: Fl_Input_.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Menu_.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Menu base class header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -56,7 +56,7 @@ protected:
|
||||
uchar down_box_;
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
|
||||
public:
|
||||
Fl_Menu_(int,int,int,int,const char * =0);
|
||||
@@ -119,9 +119,9 @@ public:
|
||||
/** Sets the font size of menu item labels. */
|
||||
void textsize(Fl_Fontsize c) {textsize_=c;}
|
||||
/** Get the current color of menu item labels. */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Sets the current color of menu item labels. */
|
||||
void textcolor(unsigned c) {textcolor_=c;}
|
||||
void textcolor(Fl_Color c) {textcolor_=c;}
|
||||
|
||||
/**
|
||||
This box type is used to surround the currently-selected items in the
|
||||
@@ -142,5 +142,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Menu_.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_Item.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Menu_Item.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Menu item header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -36,18 +36,18 @@
|
||||
# endif
|
||||
|
||||
enum { // values for flags:
|
||||
FL_MENU_INACTIVE = 1,
|
||||
FL_MENU_TOGGLE= 2,
|
||||
FL_MENU_VALUE = 4,
|
||||
FL_MENU_RADIO = 8,
|
||||
FL_MENU_INVISIBLE = 0x10,
|
||||
FL_SUBMENU_POINTER = 0x20,
|
||||
FL_SUBMENU = 0x40,
|
||||
FL_MENU_DIVIDER = 0x80,
|
||||
FL_MENU_HORIZONTAL = 0x100
|
||||
FL_MENU_INACTIVE = 1, ///< Deactivate menu item (gray out)
|
||||
FL_MENU_TOGGLE= 2, ///< Item is a checkbox toggle (shows checkbox for on/off state)
|
||||
FL_MENU_VALUE = 4, ///< The on/off state for checkbox/radio buttons (if set, state is 'on')
|
||||
FL_MENU_RADIO = 8, ///< Item is a radio button (one checkbox of many can be on)
|
||||
FL_MENU_INVISIBLE = 0x10, ///< Item will not show up (shortcut will work)
|
||||
FL_SUBMENU_POINTER = 0x20, ///< Indicates user_data() is a pointer to another menu array
|
||||
FL_SUBMENU = 0x40, ///< This item is a submenu to other items
|
||||
FL_MENU_DIVIDER = 0x80, ///< Creates divider line below this item. Also ends a group of radio buttons.
|
||||
FL_MENU_HORIZONTAL = 0x100 ///< ??? -- reserved
|
||||
};
|
||||
|
||||
extern FL_EXPORT int fl_old_shortcut(const char*);
|
||||
extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
|
||||
|
||||
class Fl_Menu_;
|
||||
|
||||
@@ -68,15 +68,15 @@ class Fl_Menu_;
|
||||
};
|
||||
|
||||
enum { // values for flags:
|
||||
FL_MENU_INACTIVE = 1,
|
||||
FL_MENU_TOGGLE = 2,
|
||||
FL_MENU_VALUE = 4,
|
||||
FL_MENU_RADIO = 8,
|
||||
FL_MENU_INVISIBLE = 0x10,
|
||||
FL_SUBMENU_POINTER = 0x20,
|
||||
FL_SUBMENU = 0x40,
|
||||
FL_MENU_DIVIDER = 0x80,
|
||||
FL_MENU_HORIZONTAL = 0x100
|
||||
FL_MENU_INACTIVE = 1, // Deactivate menu item (gray out)
|
||||
FL_MENU_TOGGLE = 2, // Item is a checkbox toggle (shows checkbox for on/off state)
|
||||
FL_MENU_VALUE = 4, // The on/off state for checkbox/radio buttons (if set, state is 'on')
|
||||
FL_MENU_RADIO = 8, // Item is a radio button (one checkbox of many can be on)
|
||||
FL_MENU_INVISIBLE = 0x10, // Item will not show up (shortcut will work)
|
||||
FL_SUBMENU_POINTER = 0x20, // Indicates user_data() is a pointer to another menu array
|
||||
FL_SUBMENU = 0x40, // This item is a submenu to other items
|
||||
FL_MENU_DIVIDER = 0x80, // Creates divider line below this item. Also ends a group of radio buttons.
|
||||
FL_MENU_HORIZONTAL = 0x100 // ??? -- reserved
|
||||
};
|
||||
\endcode
|
||||
Typically menu items are statically defined; for example:
|
||||
@@ -124,7 +124,7 @@ struct FL_EXPORT Fl_Menu_Item {
|
||||
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
|
||||
unsigned 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;
|
||||
@@ -181,10 +181,10 @@ struct FL_EXPORT Fl_Menu_Item {
|
||||
color is not black fltk will <I>not</I> use overlay bitplanes to draw
|
||||
the menu - this is so that images put in the menu draw correctly.
|
||||
*/
|
||||
Fl_Color labelcolor() const {return (Fl_Color)labelcolor_;}
|
||||
Fl_Color labelcolor() const {return labelcolor_;}
|
||||
|
||||
/** See Fl_Color Fl_Menu_Item::labelcolor() const */
|
||||
void labelcolor(unsigned a) {labelcolor_ = a;}
|
||||
void labelcolor(Fl_Color a) {labelcolor_ = a;}
|
||||
/**
|
||||
Fonts are identified by small 8-bit indexes into a table. See the
|
||||
enumeration list for predefined fonts. The default value is a
|
||||
@@ -414,5 +414,5 @@ enum { // back-compatibility enum:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_Item.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Menu_Item.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_Window.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Menu_Window.H 6909 2009-09-28 14:41:43Z matt $"
|
||||
//
|
||||
// Menu window header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -40,14 +40,13 @@
|
||||
redraw.
|
||||
*/
|
||||
class FL_EXPORT Fl_Menu_Window : public Fl_Single_Window {
|
||||
enum {NO_OVERLAY = 128};
|
||||
public:
|
||||
void show();
|
||||
void erase();
|
||||
void flush();
|
||||
void hide();
|
||||
/** Tells if hardware overlay mode is set */
|
||||
int overlay() {return !(flags()&NO_OVERLAY);}
|
||||
unsigned int overlay() {return !(flags()&NO_OVERLAY);}
|
||||
/** Tells FLTK to use hardware overlay planes if they are available. */
|
||||
void set_overlay() {clear_flag(NO_OVERLAY);}
|
||||
/** Tells FLTK to use normal drawing planes instead of overlay planes.
|
||||
@@ -65,5 +64,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_Window.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Menu_Window.H 6909 2009-09-28 14:41:43Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Multiline_Input.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Multiline_Input.H 6889 2009-09-19 22:09:00Z greg.ercolano $"
|
||||
//
|
||||
// Multiline input header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -38,11 +38,15 @@
|
||||
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. I think FLTK can be
|
||||
used to write a powerful text editor, but it is not going to be a
|
||||
built-in feature. Powerful text editors in a toolkit are a big source
|
||||
of bloat.
|
||||
<P>
|
||||
This is far from the nirvana of text editors, and is probably only
|
||||
good for small bits of text, 10 lines at most. Note that this widget
|
||||
does not support scrollbars or per-character color control.
|
||||
<P>
|
||||
If you are presenting large amounts of text and need scrollbars
|
||||
or full color control of characters, you probably want Fl_Text_Editor
|
||||
instead.
|
||||
<P>
|
||||
*/
|
||||
class Fl_Multiline_Input : public Fl_Input {
|
||||
public:
|
||||
@@ -58,5 +62,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Multiline_Input.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Multiline_Input.H 6889 2009-09-19 22:09:00Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Multiline_Output.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Multiline_Output.H 6889 2009-09-19 22:09:00Z greg.ercolano $"
|
||||
//
|
||||
// Multi line output header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -37,6 +37,14 @@
|
||||
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 {
|
||||
public:
|
||||
@@ -52,5 +60,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Multiline_Output.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Multiline_Output.H 6889 2009-09-19 22:09:00Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Output.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Output.H 6898 2009-09-23 20:43:27Z matt $"
|
||||
//
|
||||
// Output header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -42,7 +42,8 @@
|
||||
\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. </P>
|
||||
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
|
||||
display anything, using ^X notation for unprintable control characters
|
||||
and \\nnn notation for unprintable characters with the high bit set. It
|
||||
@@ -63,5 +64,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Output.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Output.H 6898 2009-09-23 20:43:27Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Scroll.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Scroll.H 6828 2009-07-12 00:15:06Z greg.ercolano $"
|
||||
//
|
||||
// Scroll header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -193,5 +193,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Scroll.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Scroll.H 6828 2009-07-12 00:15:06Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Buffer.H 6618 2009-01-01 21:54:10Z matt $"
|
||||
// "$Id: Fl_Text_Buffer.H 6822 2009-07-04 00:24:26Z fabien $"
|
||||
//
|
||||
// Header file for Fl_Text_Buffer class.
|
||||
//
|
||||
@@ -322,5 +322,5 @@ class FL_EXPORT Fl_Text_Buffer {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Buffer.H 6618 2009-01-01 21:54:10Z matt $".
|
||||
// End of "$Id: Fl_Text_Buffer.H 6822 2009-07-04 00:24:26Z fabien $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Display.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Text_Display.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Header file for Fl_Text_Display class.
|
||||
//
|
||||
@@ -165,9 +165,9 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group {
|
||||
/** 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 (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Sets the default color of text in the widget. */
|
||||
void textcolor(unsigned n) {textcolor_ = n;}
|
||||
void textcolor(Fl_Color n) {textcolor_ = n;}
|
||||
|
||||
int wrapped_column(int row, int column) const;
|
||||
int wrapped_row(int row) const;
|
||||
@@ -327,7 +327,7 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group {
|
||||
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
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
|
||||
@@ -340,5 +340,5 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Display.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Text_Display.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Editor.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Text_Editor.H 6893 2009-09-20 19:24:24Z greg.ercolano $"
|
||||
//
|
||||
// Header file for Fl_Text_Editor class.
|
||||
//
|
||||
@@ -103,6 +103,8 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display {
|
||||
static int kf_shift_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_ctrl_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_c_s_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_meta_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_m_s_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_home(int, Fl_Text_Editor* e);
|
||||
static int kf_end(int c, Fl_Text_Editor* e);
|
||||
static int kf_left(int c, Fl_Text_Editor* e);
|
||||
@@ -134,6 +136,6 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Editor.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Text_Editor.H 6893 2009-09-20 19:24:24Z greg.ercolano $".
|
||||
//
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Tooltip.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Tooltip.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Tooltip header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -76,13 +76,13 @@ public:
|
||||
/** Sets the size of the tooltip text. */
|
||||
static void size(Fl_Fontsize s) { size_ = s; }
|
||||
/** Gets the background color for tooltips. The default background color is a pale yellow. */
|
||||
static Fl_Color color() { return (Fl_Color)color_; }
|
||||
static Fl_Color color() { return color_; }
|
||||
/** Sets the background color for tooltips. The default background color is a pale yellow. */
|
||||
static void color(unsigned c) { color_ = c; }
|
||||
static void color(Fl_Color c) { color_ = c; }
|
||||
/** Gets the color of the text in the tooltip. The default is black. */
|
||||
static Fl_Color textcolor() { return (Fl_Color)textcolor_; }
|
||||
static Fl_Color textcolor() { return textcolor_; }
|
||||
/** Sets the color of the text in the tooltip. The default is black. */
|
||||
static void textcolor(unsigned c) { textcolor_ = c; }
|
||||
static void textcolor(Fl_Color c) { textcolor_ = c; }
|
||||
|
||||
// These should not be public, but Fl_Widget::tooltip() needs them...
|
||||
// fabien: made it private with only a friend function access
|
||||
@@ -95,8 +95,8 @@ private:
|
||||
static float delay_; //!< delay before a tooltip is shown
|
||||
static float hoverdelay_; //!< delay between tooltips
|
||||
static int enabled_;
|
||||
static unsigned color_;
|
||||
static unsigned textcolor_;
|
||||
static Fl_Color color_;
|
||||
static Fl_Color textcolor_;
|
||||
static Fl_Font font_;
|
||||
static Fl_Fontsize size_;
|
||||
static Fl_Widget* widget_; //!< Keeps track of the current target widget
|
||||
@@ -105,5 +105,5 @@ private:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Tooltip.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Tooltip.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Value_Input.H 6664 2009-02-18 09:27:54Z AlbrechtS $"
|
||||
// "$Id: Fl_Value_Input.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Value input header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -120,16 +120,16 @@ public:
|
||||
/** Gets the color of the text in the value box. */
|
||||
Fl_Color textcolor() const {return input.textcolor();}
|
||||
/** Sets the color of the text in the value box.*/
|
||||
void textcolor(unsigned n) {input.textcolor(n);}
|
||||
void textcolor(Fl_Color n) {input.textcolor(n);}
|
||||
/** Gets the color of the text cursor. The text cursor is black by default. */
|
||||
Fl_Color cursor_color() const {return input.cursor_color();}
|
||||
/** Sets the color of the text cursor. The text cursor is black by default. */
|
||||
void cursor_color(unsigned n) {input.cursor_color(n);}
|
||||
void cursor_color(Fl_Color n) {input.cursor_color(n);}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Value_Input.H 6664 2009-02-18 09:27:54Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Value_Input.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Value_Output.H 6664 2009-02-18 09:27:54Z AlbrechtS $"
|
||||
// "$Id: Fl_Value_Output.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Value output header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -51,7 +51,7 @@ class FL_EXPORT Fl_Value_Output : public Fl_Valuator {
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
uchar soft_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
|
||||
protected:
|
||||
void draw();
|
||||
@@ -83,13 +83,13 @@ public:
|
||||
Fl_Fontsize textsize() const {return textsize_;}
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s;}
|
||||
/** Sets the color of the text in the value box. */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Gets the color of the text in the value box. */
|
||||
void textcolor(unsigned s) {textcolor_ = s;}
|
||||
void textcolor(Fl_Color s) {textcolor_ = s;}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Value_Output.H 6664 2009-02-18 09:27:54Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Value_Output.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Value_Slider.H 6664 2009-02-18 09:27:54Z AlbrechtS $"
|
||||
// "$Id: Fl_Value_Slider.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Value slider header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -42,7 +42,7 @@
|
||||
class FL_EXPORT Fl_Value_Slider : public Fl_Slider {
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
protected:
|
||||
void draw();
|
||||
public:
|
||||
@@ -57,13 +57,13 @@ public:
|
||||
/** Sets the size of the text in the value box. */
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s;}
|
||||
/** Gets the color of the text in the value box. */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Sets the color of the text in the value box. */
|
||||
void textcolor(unsigned s) {textcolor_ = s;}
|
||||
void textcolor(Fl_Color s) {textcolor_ = s;}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Value_Slider.H 6664 2009-02-18 09:27:54Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Value_Slider.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Widget.H 6753 2009-04-12 09:40:59Z AlbrechtS $"
|
||||
// "$Id: Fl_Widget.H 6912 2009-10-02 19:08:55Z matt $"
|
||||
//
|
||||
// Widget header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -69,7 +69,7 @@ struct FL_EXPORT Fl_Label {
|
||||
/** size of label font */
|
||||
Fl_Fontsize size;
|
||||
/** text color */
|
||||
unsigned color;
|
||||
Fl_Color color;
|
||||
/** Draws the label aligned to the given box */
|
||||
void draw(int,int,int,int, Fl_Align) const ;
|
||||
void measure(int &w, int &h) const ;
|
||||
@@ -96,9 +96,9 @@ class FL_EXPORT Fl_Widget {
|
||||
void* user_data_;
|
||||
int x_,y_,w_,h_;
|
||||
Fl_Label label_;
|
||||
int flags_;
|
||||
unsigned color_;
|
||||
unsigned color2_;
|
||||
unsigned int flags_;
|
||||
Fl_Color color_;
|
||||
Fl_Color color2_;
|
||||
uchar type_;
|
||||
uchar damage_;
|
||||
uchar box_;
|
||||
@@ -135,23 +135,37 @@ protected:
|
||||
/** Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead. */
|
||||
void h(int v) {h_ = v;}
|
||||
/** Gets the widget flags mask */
|
||||
int flags() const {return flags_;}
|
||||
unsigned int flags() const {return flags_;}
|
||||
/** Sets a flag in the flags mask */
|
||||
void set_flag(int c) {flags_ |= c;}
|
||||
void set_flag(unsigned int c) {flags_ |= c;}
|
||||
/** Clears a flag in the flags mask */
|
||||
void clear_flag(int c) {flags_ &= ~c;}
|
||||
void clear_flag(unsigned int c) {flags_ &= ~c;}
|
||||
/** flags possible values enumeration.
|
||||
See activate(), output(), visible(), changed(), set_visible_focus()
|
||||
*/
|
||||
enum {
|
||||
INACTIVE=1, ///< the widget can't receive focus, and is disabled but potentially visible
|
||||
INVISIBLE=2, ///< the widget is not drawn but can receive events
|
||||
OUTPUT=4, ///< for output only
|
||||
SHORTCUT_LABEL=64, ///< the label contains a shortcut we need to draw
|
||||
CHANGED=128, ///< the widget value changed
|
||||
VISIBLE_FOCUS=512, ///< accepts keyboard focus navigation if the widget can have the focus
|
||||
COPIED_LABEL=1024 ///< the widget label is internally copied, its destruction is handled by the widget
|
||||
};
|
||||
INACTIVE = 1<<0, ///< the widget can't receive focus, and is disabled but potentially visible
|
||||
INVISIBLE = 1<<1, ///< the widget is not drawn but can receive events
|
||||
OUTPUT = 1<<2, ///< for output only
|
||||
NOBORDER = 1<<3, ///< don't draw a decoration (Fl_Window)
|
||||
FORCE_POSITION = 1<<4, ///< don't let the window manager position the window (Fl_Window)
|
||||
NON_MODAL = 1<<5, ///< thisis a hovering toolbar window (Fl_Window)
|
||||
SHORTCUT_LABEL = 1<<6, ///< the label contains a shortcut we need to draw
|
||||
CHANGED = 1<<7, ///< the widget value changed
|
||||
OVERRIDE = 1<<8, ///< position window on top (Fl_Window)
|
||||
VISIBLE_FOCUS = 1<<9, ///< accepts keyboard focus navigation if the widget can have the focus
|
||||
COPIED_LABEL = 1<<10, ///< the widget label is internally copied, its destruction is handled by the widget
|
||||
CLIP_CHILDREN = 1<<11, ///< all drawing within this widget will be clipped (Fl_Group)
|
||||
MENU_WINDOW = 1<<12, ///< a temporary popup window, dismissed by clicking outside (Fl_Window)
|
||||
TOOLTIP_WINDOW = 1<<13, ///< a temporary popup, transparent to events, and dismissed easily (Fl_Window)
|
||||
MODAL = 1<<14, ///< a window blocking input to all other winows (Fl_Window)
|
||||
NO_OVERLAY = 1<<15, ///< window not using a hardware overlay plane (Fl_Menu_Window)
|
||||
GROUP_RELATIVE = 1<<16, ///< position this idget relative to the parent group, not to the window
|
||||
// (space for more flags)
|
||||
USERFLAG3 = 1<<29, ///< reserved for 3rd party extensions
|
||||
USERFLAG2 = 1<<30, ///< reserved for 3rd party extensions
|
||||
USERFLAG1 = 1<<31 ///< reserved for 3rd party extensions
|
||||
};
|
||||
void draw_box() const;
|
||||
void draw_box(Fl_Boxtype t, Fl_Color c) const;
|
||||
void draw_box(Fl_Boxtype t, int x,int y,int w,int h, Fl_Color c) const;
|
||||
@@ -343,9 +357,9 @@ public:
|
||||
|
||||
/** Gets the background color of the widget.
|
||||
\return current background color
|
||||
\see color(unsigned), color(unsigned, unsigned)
|
||||
\see color(Fl_Color), color(Fl_Color, Fl_Color)
|
||||
*/
|
||||
Fl_Color color() const {return (Fl_Color)color_;}
|
||||
Fl_Color color() const {return color_;}
|
||||
|
||||
/** Sets the background color of the widget.
|
||||
The color is passed to the box routine. The color is either an index into
|
||||
@@ -355,25 +369,25 @@ public:
|
||||
The default for most widgets is FL_BACKGROUND_COLOR. Use Fl::set_color()
|
||||
to redefine colors in the color map.
|
||||
\param[in] bg background color
|
||||
\see color(), color(unsigned, unsigned), selection_color(unsigned)
|
||||
\see color(), color(Fl_Color, Fl_Color), selection_color(Fl_Color)
|
||||
*/
|
||||
void color(unsigned bg) {color_ = bg;}
|
||||
void color(Fl_Color bg) {color_ = bg;}
|
||||
|
||||
/** Gets the selection color.
|
||||
\return the current selection color
|
||||
\see selection_color(unsigned), color(unsigned, unsigned)
|
||||
\see selection_color(Fl_Color), color(Fl_Color, Fl_Color)
|
||||
*/
|
||||
Fl_Color selection_color() const {return (Fl_Color)color2_;}
|
||||
Fl_Color selection_color() const {return color2_;}
|
||||
|
||||
/** Sets the selection color.
|
||||
The selection color is defined for Forms compatibility and is usually
|
||||
used to color the widget when it is selected, although some widgets
|
||||
use this color for other purposes. You can set both colors at once
|
||||
with color(unsigned bg, unsigned sel).
|
||||
with color(Fl_Color bg, Fl_Color sel).
|
||||
\param[in] a the new selection color
|
||||
\see selection_color(), color(unsigned, unsigned)
|
||||
\see selection_color(), color(Fl_Color, Fl_Color)
|
||||
*/
|
||||
void selection_color(unsigned a) {color2_ = a;}
|
||||
void selection_color(Fl_Color a) {color2_ = a;}
|
||||
|
||||
/** Sets the background and selection color of the widget.
|
||||
|
||||
@@ -382,7 +396,7 @@ public:
|
||||
\param[in] sel selection color
|
||||
\see color(unsigned), selection_color(unsigned)
|
||||
*/
|
||||
void color(unsigned bg, unsigned sel) {color_=bg; color2_=sel;}
|
||||
void color(Fl_Color bg, Fl_Color sel) {color_=bg; color2_=sel;}
|
||||
|
||||
/** Gets the current label text.
|
||||
\return a pointer to the current label text
|
||||
@@ -439,13 +453,13 @@ public:
|
||||
The default color is FL_FOREGROUND_COLOR.
|
||||
\return the current label color
|
||||
*/
|
||||
Fl_Color labelcolor() const {return (Fl_Color)label_.color;}
|
||||
Fl_Color labelcolor() const {return label_.color;}
|
||||
|
||||
/** Sets the label color.
|
||||
The default color is FL_FOREGROUND_COLOR.
|
||||
\param[in] c the new label color
|
||||
*/
|
||||
void labelcolor(unsigned c) {label_.color=c;}
|
||||
void labelcolor(Fl_Color c) {label_.color=c;}
|
||||
|
||||
/** Gets the font to use.
|
||||
Fonts are identified by indexes into a table. The default value
|
||||
@@ -633,7 +647,7 @@ public:
|
||||
\retval 0 if the widget is not drawn and hence invisible.
|
||||
\see show(), hide(), visible_r()
|
||||
*/
|
||||
int visible() const {return !(flags_&INVISIBLE);}
|
||||
unsigned int visible() const {return !(flags_&INVISIBLE);}
|
||||
|
||||
/** Returns whether a widget and all its parents are visible.
|
||||
\retval 0 if the widget or any of its parents are invisible.
|
||||
@@ -678,7 +692,7 @@ public:
|
||||
\retval 0 if the widget is inactive
|
||||
\see active_r(), activate(), deactivate()
|
||||
*/
|
||||
int active() const {return !(flags_&INACTIVE);}
|
||||
unsigned int active() const {return !(flags_&INACTIVE);}
|
||||
|
||||
/** Returns whether the widget and all of its parents are active.
|
||||
\retval 0 if this or any of the parent widgets are inactive
|
||||
@@ -717,7 +731,7 @@ public:
|
||||
\retval 0 if the widget is used for input and output
|
||||
\see set_output(), clear_output()
|
||||
*/
|
||||
int output() const {return (flags_&OUTPUT);}
|
||||
unsigned int output() const {return (flags_&OUTPUT);}
|
||||
|
||||
/** Sets a widget to output only.
|
||||
\see output(), clear_output()
|
||||
@@ -734,7 +748,7 @@ public:
|
||||
&& visible()) but is faster.
|
||||
\retval 0 if the widget takes no events
|
||||
*/
|
||||
int takesevents() const {return !(flags_&(INACTIVE|INVISIBLE|OUTPUT));}
|
||||
unsigned int takesevents() const {return !(flags_&(INACTIVE|INVISIBLE|OUTPUT));}
|
||||
|
||||
/**
|
||||
Checks if the widget value changed since the last callback.
|
||||
@@ -751,7 +765,7 @@ public:
|
||||
\retval 0 if the value did not change
|
||||
\see set_changed(), clear_changed()
|
||||
*/
|
||||
int changed() const {return flags_&CHANGED;}
|
||||
unsigned int changed() const {return flags_&CHANGED;}
|
||||
|
||||
/** Marks the value of the widget as changed.
|
||||
\see changed(), clear_changed()
|
||||
@@ -796,7 +810,7 @@ public:
|
||||
\retval 0 if this widget has no visible focus.
|
||||
\see visible_focus(int), set_visible_focus(), clear_visible_focus()
|
||||
*/
|
||||
int visible_focus() { return flags_ & VISIBLE_FOCUS; }
|
||||
unsigned int visible_focus() { return flags_ & VISIBLE_FOCUS; }
|
||||
|
||||
/** Sets the default callback for all widgets.
|
||||
Sets the default callback, which puts a pointer to the widget on the queue
|
||||
@@ -828,7 +842,7 @@ public:
|
||||
/** Internal use only. */
|
||||
int test_shortcut();
|
||||
/** Internal use only. */
|
||||
static char label_shortcut(const char *t);
|
||||
static Fl_Shortcut label_shortcut(const char *t);
|
||||
/** Internal use only. */
|
||||
static int test_shortcut(const char*);
|
||||
|
||||
@@ -866,9 +880,16 @@ public:
|
||||
*/
|
||||
uchar damage() const {return damage_;}
|
||||
|
||||
/** Clears the damage flags.
|
||||
/** Clears or sets the damage flags.
|
||||
Damage flags are cleared when parts of the widget drawing is repaired.
|
||||
\param[in] c bitmask of flags to clear
|
||||
|
||||
The optional argument \p c specifies the bits that <b>are set</b>
|
||||
after the call (default: 0) and \b not the bits that are cleared!
|
||||
|
||||
\note Therefore it is possible to set damage bits with this method, but
|
||||
this should be avoided. Use damage(uchar) instead.
|
||||
|
||||
\param[in] c new bitmask of damage flags (default: 0)
|
||||
\see damage(uchar), damage()
|
||||
*/
|
||||
void clear_damage(uchar c = 0) {damage_ = c;}
|
||||
@@ -923,5 +944,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Widget.H 6753 2009-04-12 09:40:59Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Widget.H 6912 2009-10-02 19:08:55Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Window.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Window.H 6907 2009-09-28 14:34:52Z matt $"
|
||||
//
|
||||
// Window header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -69,16 +69,6 @@ class FL_EXPORT Fl_Window : public Fl_Group {
|
||||
Fl_Cursor cursor_default;
|
||||
Fl_Color cursor_fg, cursor_bg;
|
||||
void size_range_();
|
||||
// values for flags():
|
||||
enum {
|
||||
FL_MODAL = 64,
|
||||
FL_NOBORDER = 8,
|
||||
FL_FORCE_POSITION = 16,
|
||||
FL_NON_MODAL = 32,
|
||||
FL_OVERRIDE = 256,
|
||||
FL_MENU_WINDOW = 4096,
|
||||
FL_TOOLTIP_WINDOW = 8192
|
||||
};
|
||||
void _Fl_Window(); // constructor innards
|
||||
|
||||
// unimplemented copy ctor and assignment operator
|
||||
@@ -167,13 +157,13 @@ public:
|
||||
Fast inline function to turn the border
|
||||
off. It only works before show() is called.
|
||||
*/
|
||||
void clear_border() {set_flag(FL_NOBORDER);}
|
||||
void clear_border() {set_flag(NOBORDER);}
|
||||
/** See int Fl_Window::border(int) */
|
||||
int border() const {return !(flags() & FL_NOBORDER);}
|
||||
/** Activate the flags FL_NOBORDER|FL_OVERRIDE */
|
||||
void set_override() {set_flag(FL_NOBORDER|FL_OVERRIDE);}
|
||||
unsigned int border() const {return !(flags() & NOBORDER);}
|
||||
/** Activate the flags NOBORDER|FL_OVERRIDE */
|
||||
void set_override() {set_flag(NOBORDER|OVERRIDE);}
|
||||
/** Returns non zero if FL_OVERRIDE flag is set, 0 otherwise. */
|
||||
int override() const { return flags()&FL_OVERRIDE; }
|
||||
unsigned int override() const { return flags()&OVERRIDE; }
|
||||
/**
|
||||
A "modal" window, when shown(), will prevent any events from
|
||||
being delivered to other windows in the same program, and will also
|
||||
@@ -183,18 +173,18 @@ public:
|
||||
which window (if any) is modal by calling
|
||||
Fl::modal().
|
||||
*/
|
||||
void set_modal() {set_flag(FL_MODAL);}
|
||||
void set_modal() {set_flag(MODAL);}
|
||||
/** Returns true if this window is modal. */
|
||||
int modal() const {return flags() & FL_MODAL;}
|
||||
unsigned int modal() const {return flags() & MODAL;}
|
||||
/**
|
||||
A "non-modal" window (terminology borrowed from Microsoft Windows)
|
||||
acts like a modal() one in that it remains on top, but it has
|
||||
no effect on event delivery. There are <I>three</I> states for a
|
||||
window: modal, non-modal, and normal.
|
||||
*/
|
||||
void set_non_modal() {set_flag(FL_NON_MODAL);}
|
||||
void set_non_modal() {set_flag(NON_MODAL);}
|
||||
/** Returns true if this window is modal or non-modal. */
|
||||
int non_modal() const {return flags() & (FL_NON_MODAL|FL_MODAL);}
|
||||
unsigned int non_modal() const {return flags() & (NON_MODAL|MODAL);}
|
||||
|
||||
/**
|
||||
Marks the window as a menu window.
|
||||
@@ -209,10 +199,10 @@ public:
|
||||
This must be called before the window is shown and cannot be changed
|
||||
later.
|
||||
*/
|
||||
void set_menu_window() {set_flag(FL_MENU_WINDOW);}
|
||||
void set_menu_window() {set_flag(MENU_WINDOW);}
|
||||
|
||||
/** Returns true if this window is a menu window. */
|
||||
int menu_window() const {return flags() & FL_MENU_WINDOW;}
|
||||
unsigned int menu_window() const {return flags() & MENU_WINDOW;}
|
||||
|
||||
/**
|
||||
Marks the window as a tooltip window.
|
||||
@@ -230,10 +220,10 @@ public:
|
||||
\note Since Fl_Tooltip_Window is derived from Fl_Menu_Window, this
|
||||
also \b clears the menu_window() state.
|
||||
*/
|
||||
void set_tooltip_window() { set_flag(FL_TOOLTIP_WINDOW);
|
||||
clear_flag(FL_MENU_WINDOW); }
|
||||
void set_tooltip_window() { set_flag(TOOLTIP_WINDOW);
|
||||
clear_flag(MENU_WINDOW); }
|
||||
/** Returns true if this window is a tooltip window. */
|
||||
int tooltip_window() const {return flags() & FL_TOOLTIP_WINDOW;}
|
||||
unsigned int tooltip_window() const {return flags() & TOOLTIP_WINDOW;}
|
||||
|
||||
/**
|
||||
Position the window so that the mouse is pointing at the
|
||||
@@ -252,7 +242,7 @@ public:
|
||||
so that the next time show() is called the window manager is
|
||||
free to position the window.
|
||||
*/
|
||||
void free_position() {clear_flag(FL_FORCE_POSITION);}
|
||||
void free_position() {clear_flag(FORCE_POSITION);}
|
||||
/**
|
||||
Set the allowable range the user can resize this window to. This only
|
||||
works for top-level windows.
|
||||
@@ -410,5 +400,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Window.H 6907 2009-09-28 14:34:52Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_draw.H 6779 2009-04-24 09:28:30Z yuri $"
|
||||
// "$Id: fl_draw.H 6878 2009-09-17 22:12:24Z matt $"
|
||||
//
|
||||
// Portable drawing function header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -203,14 +203,7 @@ inline Fl_Fontsize fl_size() {return fl_size_;}
|
||||
You can also use the value of \p size passed to fl_font()
|
||||
*/
|
||||
FL_EXPORT int fl_height(); // using "size" should work ok
|
||||
/**
|
||||
Dummy passthru function called only in Fl_Text_Display that simply returns
|
||||
the font height as given by the \p size parameter in the same call!
|
||||
|
||||
\todo Is fl_height(int, int size) required for Fl_Text_Dispay?
|
||||
Why not use \p size parameter directly?
|
||||
*/
|
||||
inline int fl_height(int, int size) {return size;}
|
||||
FL_EXPORT int fl_height(int font, int size);
|
||||
/**
|
||||
Returns the recommended distance above the bottom of a fl_height() tall box to
|
||||
draw the text at so it looks centered vertically in that box.
|
||||
@@ -448,8 +441,8 @@ FL_EXPORT int fl_measure_pixmap(const char* const* cdata, int &w, int &h);
|
||||
// other:
|
||||
FL_EXPORT void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
|
||||
void (*draw_area)(void*, int,int,int,int), void* data);
|
||||
FL_EXPORT const char* fl_shortcut_label(int shortcut);
|
||||
FL_EXPORT const char* fl_shortcut_label(int shortcuti, const char **eom);
|
||||
FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut);
|
||||
FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom);
|
||||
FL_EXPORT void fl_overlay_rect(int x,int y,int w,int h);
|
||||
FL_EXPORT void fl_overlay_clear();
|
||||
FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg=FL_BLACK, Fl_Color bg=FL_WHITE);
|
||||
@@ -475,5 +468,5 @@ FL_EXPORT int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scal
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: fl_draw.H 6779 2009-04-24 09:28:30Z yuri $".
|
||||
// End of "$Id: fl_draw.H 6878 2009-09-17 22:12:24Z matt $".
|
||||
//
|
||||
|
||||
@@ -52,6 +52,9 @@ typedef char *Fl_String;
|
||||
typedef const char *Fl_CString;
|
||||
|
||||
/** 24-bit Unicode character + 8-bit indicator for keyboard flags */
|
||||
typedef unsigned int Fl_Shortcut;
|
||||
|
||||
/** 24-bit Unicode character - upper 8-bits are unused */
|
||||
typedef unsigned int Fl_Char;
|
||||
|
||||
/*@}*/ /* group: Miscellaneous */
|
||||
|
||||
686
plugins/zynaddsubfx/fltk/README.123
Normal file
686
plugins/zynaddsubfx/fltk/README.123
Normal file
@@ -0,0 +1,686 @@
|
||||
|
||||
R E A D M E . 1 2 3
|
||||
=====================
|
||||
|
||||
This file listst the differences between FLTK 1 and FLTK 2 with annotations
|
||||
for a possible implementation of FLTK 3. The all new and improved FLTK 3
|
||||
needs to be compatible with 1 and 2. It must have a moder API, plenty of
|
||||
widgets, lots of options, customization at run-time, but still be easily
|
||||
portable, fast, and of course light.
|
||||
|
||||
FLTK 1 has become a nice starting point for the first steps in GUI
|
||||
programming. It runs on al major platform (and on many minor ones
|
||||
as well), is small, compact, and easy to use. FLTK 2 was the
|
||||
attempt to continue the success of FLTK 1 with a much cleaber API
|
||||
and many important details improved. Unfortunately many users never
|
||||
made the jump to FLTK 2 and so it not only ended in a crawling slow
|
||||
branch, it also became instable and at last unmaintainable.
|
||||
|
||||
FLTK 3 sets out to surprise FLTK 1 users and satisfy FLTK 2 junkies.
|
||||
It will basically be the improved FLTK 2 API combined with the quite
|
||||
stable innards of FLTK 1. As an extra bonus, FLTK 3 will be compatible
|
||||
to 1 and 2. Just prepend your code with the "coding_style" instruction
|
||||
and FLTK 3 will do the rest. It is even possible to intermix F1 and
|
||||
F2 coding styles at any place.
|
||||
|
||||
Nice challange, eh? So let's get going:
|
||||
|
||||
|
||||
The Big Differences
|
||||
---------------------
|
||||
|
||||
FLTK 2 is based on FLTK 1 in many ways, and while the FLTK 1 API was based
|
||||
on the Forms Library, FLTK 2 is Bill's take on how FLTK 1 should have been.
|
||||
This chapter outlines the biggest differences between version.
|
||||
|
||||
(1) Coordinate System: FLTK 1 child coordinates are always relative to the
|
||||
window, not as most would expect to the parent. FLTK 2 does the logical
|
||||
thing and uses group-relative origins. This is somewhat difficult to port
|
||||
if we want to stay downward compatible. Fl_Widget will need an additional
|
||||
flag indicating absolute or relative coordinates.
|
||||
|
||||
(2) Pulldown Menus: The developers of the Forms Library did not implement
|
||||
the idea of hierarchies all the way through. Pulldown menus, which are
|
||||
hierarchical by nature, were instead implemented as a list with lots of
|
||||
tricks and cludges to make them usable. FLTK 2 went half way by using the
|
||||
existing Windget/Group relation to create menus, however, menu items are
|
||||
still specialized widgets. For FLTK 3, I would like to allow any widget
|
||||
inside a pulldown menu.
|
||||
|
||||
(3) Browsers and Tree Views: Browsers in FLTK1 are implemented even worse
|
||||
than Pulldown Menus. FLTK 2 solved the issues in a similar way, and here
|
||||
again, I prefer the FLTK 2 way very mch, but also would like to extend
|
||||
functionality to allow arbitrary widgets as list items. A Tree-like
|
||||
widget comes free with the FLTK 2 concept. FLTK 1 has no such thing and
|
||||
even Fluid had to hack the library badly to generate a tree view.
|
||||
|
||||
(4) Namespaces: this is a minr issue that I include for completeness. FLTK 2
|
||||
introduces the ftk namespace, renaming all widgets. FLTK 3 will use the
|
||||
FLTK 2 naming scheme and map FLTK 1 class names using typedefs. This is, as
|
||||
most things in programming are, a compromise. The "coding_style" function
|
||||
must be used to switch between FLTK 1 and FLTK 2 code. No worries though,
|
||||
it's easy and straight forward.
|
||||
|
||||
(5) Layout: FLTK 1 uses a top-down approach for widget layout in which the
|
||||
parent widget decides about the childs size "resize(x, y, w, h)". In FLTK 2
|
||||
any widget can call "layout()" which will query children for their preffered
|
||||
size and propagate the information up. This is a great concept that FLTK 3
|
||||
should adapt, plus it is compatible.
|
||||
|
||||
(6) Ractangle: FLTK 2's base class is fltk::Rectangle. This is nice and
|
||||
easy to implement. The API is pretty much the same in both versions.
|
||||
|
||||
(7) Styles: FLTK 2 uses a minimal number of styles to define the basic
|
||||
(and often repeated) parameters of every widget. API's are similar though,
|
||||
so this is luckily another pretty straight-forward upgrade.
|
||||
|
||||
|
||||
Comparison Chart by Class
|
||||
---------------------------
|
||||
|
||||
This chart contains a list of all classes in FLTK 1 and 2, how they
|
||||
correspond, and how they could be implemented in FLTK 3.
|
||||
|
||||
1: class Fl
|
||||
2: namespace fltk
|
||||
*: this is a pretty straight-forward mapping of functions. The actual work
|
||||
lies in finding and listing all global functions and adapting those.
|
||||
|
||||
1: class Fl_Adjuster
|
||||
2: class Adjuster
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class AlignGroup
|
||||
*: undocumented in FLTK 2. Minimal code. Can be transfered easily.
|
||||
|
||||
1:
|
||||
2: class AnsiWidget
|
||||
*: There is no equvalet in FLTK 1, but the widget may be easily ported.
|
||||
|
||||
1:
|
||||
2: class AssociationFunctor
|
||||
*: Associations are a new and rarly used concept in FLTK 2. We need to
|
||||
decide if these should be moved into FLTK 3
|
||||
|
||||
1:
|
||||
2: class AssociationType
|
||||
*: Associations are a new and rarly used concept in FLTK 2. We need to
|
||||
decide if these should be moved into FLTK 3
|
||||
|
||||
1:
|
||||
2: class BarGroup
|
||||
*: undocumented in FLTK 2. Minimal code. Can be transfered easily.
|
||||
|
||||
1: class Fl_BMP_Image
|
||||
2: class bmpImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Bitmap
|
||||
2:
|
||||
|
||||
1: class Fl_Box
|
||||
2: class Widget
|
||||
*: This actually maps pretty much exactly to fltk::Widget. FLTK 2 provides
|
||||
a bunch of other box-like classes which have some predefined properties,
|
||||
however this is the best match for FLTK 1. fltk::InvisibleBox can be used
|
||||
as well.
|
||||
|
||||
1: class Fl_Browser
|
||||
2: class Browser
|
||||
|
||||
1: class Fl_Browser_
|
||||
2:
|
||||
|
||||
1: class Fl_Button
|
||||
2: class Button
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Cairo_State
|
||||
2:
|
||||
|
||||
1: class Fl_Cairo_Window
|
||||
2:
|
||||
|
||||
1: class Fl_Chart
|
||||
2:
|
||||
|
||||
1: class Fl_Check_Browser
|
||||
2:
|
||||
|
||||
1: class Fl_Check_Button
|
||||
2: class CheckButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Choice
|
||||
2: class Choice
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Clock
|
||||
2: class Clock
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Clock_Output
|
||||
2: class ClockOutput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Color_Chooser
|
||||
2: class ColorChooser
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class ComboBrowser
|
||||
|
||||
1:
|
||||
2: class ComboWindow
|
||||
|
||||
1:
|
||||
2: class CycleButton
|
||||
|
||||
1: class Fl_Counter
|
||||
2:
|
||||
|
||||
1: class Fl_Dial
|
||||
2: class Dial
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class Divider
|
||||
|
||||
1: class Fl_Double_Window
|
||||
2: class DoubleBufferWindow
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_End
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class EngravedLabel
|
||||
|
||||
1: class Fl_File_Browser
|
||||
2: class FileBrowser
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_File_Chooser
|
||||
2: class FileChooser
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_File_Icon
|
||||
2: class FileIcon
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_File_Input
|
||||
2: class FileInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Fill_Dial
|
||||
2: class FillDial
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Fill_Slider
|
||||
2: class FillSlider
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class FlatBox
|
||||
|
||||
1: class Fl_Float_Input
|
||||
2: class FloatInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_FormsBitmap
|
||||
2:
|
||||
|
||||
1: class Fl_FormsPixmap
|
||||
2:
|
||||
|
||||
1: class Fl_FormsText
|
||||
2: class Fl_FormsText
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class FrameBox
|
||||
|
||||
1: class Fl_Free
|
||||
2:
|
||||
|
||||
1: class Fl_GIF_Image
|
||||
2: class gifImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Gl_Choice
|
||||
2: class GlChoice
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Gl_Window
|
||||
2: class GlWindow
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class GlOverlay
|
||||
|
||||
1: class Fl_Glut_Window
|
||||
2: class GlutWindow
|
||||
|
||||
1: class Fl_Group
|
||||
2: class Group
|
||||
*: should map easily, must manage coordinate systems
|
||||
|
||||
1:
|
||||
2: class GSave
|
||||
|
||||
1:
|
||||
2: class Guard
|
||||
|
||||
1: class Fl_Help_Dialog
|
||||
2: class HelpDialog
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Help_View
|
||||
2: class HelpView
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class HighlightBox
|
||||
|
||||
1:
|
||||
2: class HighlightButton
|
||||
|
||||
1: class Fl_Hold_Browser
|
||||
2:
|
||||
|
||||
1: class Fl_Hor_Fill_Slider
|
||||
2:
|
||||
|
||||
1: class Fl_Hor_Nice_Slider
|
||||
2:
|
||||
|
||||
1: class Fl_Hor_Slider
|
||||
2:
|
||||
|
||||
1: class Fl_Hor_Value_Slider
|
||||
2:
|
||||
|
||||
1: class Fl_Image
|
||||
2: class Image
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Input
|
||||
2: class Input
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Input_
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class InputBrowser
|
||||
|
||||
1: class Fl_Input_Choice
|
||||
2: class ComboBox
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Int_Input
|
||||
2: class IntInput
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class InvisibleBox
|
||||
|
||||
1:
|
||||
2: class Item
|
||||
|
||||
1:
|
||||
2: class ItemGroup
|
||||
|
||||
1: class Fl_JPEG_Image
|
||||
2: class jpegImage
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class LabelType
|
||||
|
||||
1: class Fl_Light_Button
|
||||
2: class LightButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Line_Dial
|
||||
2: class LineDial
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class List
|
||||
|
||||
1: class Fl_Menu_
|
||||
2: class Menu
|
||||
|
||||
1: class Fl_Menu_Bar
|
||||
2: class MenuBar
|
||||
|
||||
1: class Fl_Menu_Button
|
||||
2: class PopupMenu
|
||||
|
||||
1:
|
||||
2: class MenuSection
|
||||
|
||||
1: class Fl_Menu_Window
|
||||
2: class MenuWindow
|
||||
|
||||
1:
|
||||
2: class Monitor
|
||||
|
||||
1: class Fl_Multi_Browser
|
||||
2: class MultiBrowser
|
||||
|
||||
1:
|
||||
2: class MultiImage
|
||||
|
||||
1: class Fl_Multiline_Input
|
||||
2: class MultiLineInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Multiline_Output
|
||||
2: class MultiLineOutput
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class Mutex
|
||||
|
||||
1: class Fl_Nice_Slider
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class NumericInput
|
||||
|
||||
1: class Fl_Output
|
||||
2: class Output
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Overlay_Window
|
||||
2:
|
||||
|
||||
1: class Fl_PNG_Image
|
||||
2: class pngImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_PNM_Image
|
||||
2: class pnmImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Pack
|
||||
2: class PackedGroup
|
||||
*: should map easily, FLTK 2 has soem additional functionaity
|
||||
|
||||
1: class Fl_Pixmap
|
||||
2:
|
||||
|
||||
1: class Fl_Positioner
|
||||
2:
|
||||
|
||||
1: class Fl_Preferences
|
||||
2: class Preferences
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Progress
|
||||
2: class ProgressBar
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_RGB_Image
|
||||
2: class rgbImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Radio_Button
|
||||
2: class RadioButton
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class RadioItem
|
||||
|
||||
1: class Fl_Radio_Light_Button
|
||||
2: class RadioLightButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Radio_Round_Button
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class Rectangle
|
||||
|
||||
1:
|
||||
2: class RecursiveMutex
|
||||
|
||||
1: class Fl_Repeat_Button
|
||||
2: class RepeatButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Return_Button
|
||||
2: class ReturnButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Roller
|
||||
2: class ThumbWheel
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Round_Button
|
||||
2:
|
||||
|
||||
1: class Fl_Round_Clock
|
||||
2:
|
||||
|
||||
1: class Fl_Scroll
|
||||
2: class ScrollGroup
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Scrollbar
|
||||
2: class Scrollbar
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Secret_Input
|
||||
2: class SecretInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Select_Browser
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class ShapedWindow
|
||||
|
||||
1: class Fl_Shared_Image
|
||||
2: class SharedImage
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class ShortcutFunctor
|
||||
|
||||
1: class Fl_Simple_Counter
|
||||
2:
|
||||
|
||||
1: class Fl_Single_Window
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class SignalMutex
|
||||
|
||||
1: class Fl_Slider
|
||||
2: class Slider
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Spinner
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class StatusBarGroup
|
||||
|
||||
1:
|
||||
2: class StringArray
|
||||
|
||||
1:
|
||||
2: class StringHierarchy
|
||||
|
||||
1:
|
||||
2: class StringList
|
||||
|
||||
1:
|
||||
2: class Style
|
||||
|
||||
1:
|
||||
2: class StyleSet
|
||||
|
||||
1:
|
||||
2: class Symbol
|
||||
|
||||
1: class Fl_Sys_Menu_Bar
|
||||
2: class SystemMenuBar
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Tabs
|
||||
2: class TabGroup
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class TabGroupPager
|
||||
|
||||
1: class Fl_Text_Buffer
|
||||
2: class TextBuffer
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Text_Display
|
||||
2: class TextDisplay
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Text_Editor
|
||||
2: class TextEditor
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Text_Selection
|
||||
2: class TextSelection
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Tile
|
||||
2: class TiledGroup
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Tiled_Image
|
||||
2: class TiledImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Timer
|
||||
2:
|
||||
|
||||
1: class Fl_Toggle_Button
|
||||
2: class ToggleButton
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class ToggleItem
|
||||
|
||||
1: class Fl_Tooltip
|
||||
2: class Tooltip
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class WordwrapInput
|
||||
|
||||
1:
|
||||
2: class WordwrapOutput
|
||||
|
||||
1: class Fl_Valuator
|
||||
2: class Valuator
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Value_Input
|
||||
2: class ValueInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Value_Output
|
||||
2: class ValueOutput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Value_Slider
|
||||
2: class ValueSlider
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Widget
|
||||
2: class Widget
|
||||
*: should map easily for the most part
|
||||
|
||||
1: class Fl_Widget_Tracker
|
||||
2:
|
||||
|
||||
1: class Fl_Window
|
||||
2: class Window
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Wizard
|
||||
2: class WizardGroup
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_X
|
||||
2: class CreatedWindow
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_XBM_Image
|
||||
2: class xbmImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_XPM_Image
|
||||
2: class xpmImage
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class xpmFileImage
|
||||
|
||||
1:
|
||||
2: struct Cursor
|
||||
|
||||
1:
|
||||
2: struct Font
|
||||
|
||||
1: struct Fl_Glut_Bitmap_Font
|
||||
2:
|
||||
|
||||
1: struct Fl_Glut_StrokeChar
|
||||
2:
|
||||
|
||||
1: struct Fl_Glut_StrokeFont
|
||||
2:
|
||||
|
||||
1: struct Fl_Glut_StrokeStrip
|
||||
2:
|
||||
|
||||
1: struct Fl_Glut_StrokeVertex
|
||||
2:
|
||||
|
||||
1: struct Fl_Help_Block
|
||||
2: struct HelpBlock
|
||||
*: should map easily
|
||||
|
||||
1: struct Fl_Help_Font_Stack
|
||||
2:
|
||||
|
||||
1: struct Fl_Help_Font_Style
|
||||
2:
|
||||
|
||||
1: struct Fl_Help_Link
|
||||
2: struct HelpLink
|
||||
*: should map easily
|
||||
|
||||
1: struct Fl_Help_Target
|
||||
2: struct HelpTarget
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: struct ImageType
|
||||
|
||||
1: struct Fl_Label
|
||||
2:
|
||||
|
||||
1: struct Fl_Menu_Item
|
||||
2:
|
||||
|
||||
1: struct Fl_Multi_Label
|
||||
2:
|
||||
|
||||
1:
|
||||
2: struct NamedStyle
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ SET(CPPFILES
|
||||
Fl_Menu.cxx
|
||||
Fl_Menu_.cxx
|
||||
Fl_Menu_Bar.cxx
|
||||
Fl_Sys_Menu_Bar.cxx
|
||||
Fl_Sys_Menu_Bar.cxx
|
||||
Fl_Menu_Button.cxx
|
||||
Fl_Menu_Window.cxx
|
||||
Fl_Menu_add.cxx
|
||||
@@ -130,6 +130,8 @@ SET(CPPFILES
|
||||
fl_vertex.cxx
|
||||
screen_xywh.cxx
|
||||
fl_utf8.cxx
|
||||
fl_encoding_latin1.cxx
|
||||
fl_encoding_mac_roman.cxx
|
||||
)
|
||||
SET(FLCPPFILES
|
||||
forms_compatability.cxx
|
||||
@@ -165,18 +167,18 @@ SET(IMGCPPFILES
|
||||
|
||||
SET(CFILES
|
||||
fl_call_main.c
|
||||
fl_utf.c
|
||||
flstring.c
|
||||
scandir.c
|
||||
numericsort.c
|
||||
vsnprintf.c
|
||||
xutf8/case.c
|
||||
xutf8/is_right2left.c
|
||||
xutf8/is_spacing.c
|
||||
xutf8/keysym2Ucs.c
|
||||
xutf8/case.c
|
||||
xutf8/utf8Input.c
|
||||
xutf8/utf8Utils.c
|
||||
xutf8/utf8Wrap.c
|
||||
xutf8/keysym2Ucs.c
|
||||
fl_utf.c
|
||||
)
|
||||
|
||||
ADD_LIBRARY(fltk ${CPPFILES} ${CFILES})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl.cxx 6787 2009-05-14 20:16:09Z engelsman $"
|
||||
// "$Id: Fl.cxx 6836 2009-07-25 12:56:16Z AlbrechtS $"
|
||||
//
|
||||
// Main event handling code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -1699,5 +1699,5 @@ Fl_Widget_Tracker::~Fl_Widget_Tracker() {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl.cxx 6787 2009-05-14 20:16:09Z engelsman $".
|
||||
// End of "$Id: Fl.cxx 6836 2009-07-25 12:56:16Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Browser.cxx 6726 2009-03-27 16:52:31Z greg.ercolano $"
|
||||
// "$Id: Fl_Browser.cxx 6895 2009-09-21 06:35:08Z greg.ercolano $"
|
||||
//
|
||||
// Browser widget for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -44,10 +44,16 @@
|
||||
#define SELECTED 1
|
||||
#define NOTDISPLAYED 2
|
||||
|
||||
// WARNING:
|
||||
// Fl_File_Chooser.cxx also has a definition of this structure (FL_BLINE).
|
||||
// Changes to FL_BLINE *must* be reflected in Fl_File_Chooser.cxx as well.
|
||||
// This hack in Fl_File_Chooser should be solved.
|
||||
//
|
||||
struct FL_BLINE { // data is in a linked list of these
|
||||
FL_BLINE* prev;
|
||||
FL_BLINE* next;
|
||||
void* data;
|
||||
Fl_Image* icon;
|
||||
short length; // sizeof(txt)-1, may be longer than string
|
||||
char flags; // selected, displayed
|
||||
char txt[1]; // start of allocated array
|
||||
@@ -138,7 +144,8 @@ const char *Fl_Browser::item_text(void *item) const {
|
||||
item_next(), etc. to access the internal linked list more efficiently.
|
||||
|
||||
\param[in] line The line number of the item to return. (1 based)
|
||||
\returns The returned item.
|
||||
\retval item that was found.
|
||||
\retval NULL if line is out of range.
|
||||
\see item_at(), find_line(), lineno()
|
||||
*/
|
||||
FL_BLINE* Fl_Browser::find_line(int line) const {
|
||||
@@ -287,6 +294,7 @@ void Fl_Browser::insert(int line, const char* newtext, void* d) {
|
||||
t->flags = 0;
|
||||
strcpy(t->txt, newtext);
|
||||
t->data = d;
|
||||
t->icon = 0;
|
||||
insert(line, t);
|
||||
}
|
||||
|
||||
@@ -321,6 +329,7 @@ void Fl_Browser::text(int line, const char* newtext) {
|
||||
replacing(t, n);
|
||||
cache = n;
|
||||
n->data = t->data;
|
||||
n->icon = t->icon;
|
||||
n->length = (short)l;
|
||||
n->flags = t->flags;
|
||||
n->prev = t->prev;
|
||||
@@ -364,8 +373,7 @@ int Fl_Browser::item_height(void *item) const {
|
||||
fl_font(textfont(), textsize());
|
||||
int hh = fl_height();
|
||||
if (hh > hmax) hmax = hh;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
const int* i = column_widths();
|
||||
// do each column separately as they may all set different fonts:
|
||||
for (char* str = l->txt; str && *str; str++) {
|
||||
@@ -400,6 +408,9 @@ int Fl_Browser::item_height(void *item) const {
|
||||
}
|
||||
}
|
||||
|
||||
if (l->icon && (l->icon->h()+2)>hmax) {
|
||||
hmax = l->icon->h() + 2; // leave 2px above/below
|
||||
}
|
||||
return hmax; // previous version returned hmax+2!
|
||||
}
|
||||
|
||||
@@ -412,7 +423,8 @@ int Fl_Browser::item_height(void *item) const {
|
||||
incr_height(), full_height()
|
||||
*/
|
||||
int Fl_Browser::item_width(void *item) const {
|
||||
char* str = ((FL_BLINE*)item)->txt;
|
||||
FL_BLINE* l=(FL_BLINE*)item;
|
||||
char* str = l->txt;
|
||||
const int* i = column_widths();
|
||||
int ww = 0;
|
||||
|
||||
@@ -457,6 +469,8 @@ int Fl_Browser::item_width(void *item) const {
|
||||
if (*str == format_char_ && str[1])
|
||||
str ++;
|
||||
|
||||
if (ww==0 && l->icon) ww = l->icon->w();
|
||||
|
||||
fl_font(font, tsize);
|
||||
return ww + int(fl_width(str)) + 6;
|
||||
}
|
||||
@@ -492,9 +506,11 @@ int Fl_Browser::incr_height() const {
|
||||
\param[in] X,Y,W,H position and size.
|
||||
*/
|
||||
void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
char* str = ((FL_BLINE*)item)->txt;
|
||||
FL_BLINE* l = (FL_BLINE*)item;
|
||||
char* str = l->txt;
|
||||
const int* i = column_widths();
|
||||
|
||||
bool first = true; // for icon
|
||||
while (W > 6) { // do each tab-separated field
|
||||
int w1 = W; // width for this field
|
||||
char* e = 0; // pointer to end of field or null if none
|
||||
@@ -502,6 +518,15 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
e = strchr(str, column_char());
|
||||
if (e) {*e = 0; w1 = *i++;}
|
||||
}
|
||||
// Icon drawing code
|
||||
if (first) {
|
||||
first = false;
|
||||
if (l->icon) {
|
||||
l->icon->draw(X+2,Y+1); // leave 2px left, 1px above
|
||||
int iconw = l->icon->w()+2;
|
||||
X += iconw; W -= iconw; w1 -= iconw;
|
||||
}
|
||||
}
|
||||
int tsize = textsize();
|
||||
Fl_Font font = textfont();
|
||||
Fl_Color lcol = textcolor();
|
||||
@@ -521,7 +546,7 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
case 'c': talign = FL_ALIGN_CENTER; break;
|
||||
case 'r': talign = FL_ALIGN_RIGHT; break;
|
||||
case 'B':
|
||||
if (!(((FL_BLINE*)item)->flags & SELECTED)) {
|
||||
if (!(l->flags & SELECTED)) {
|
||||
fl_color((Fl_Color)strtol(str, &str, 10));
|
||||
fl_rectf(X, Y, w1, H);
|
||||
} else strtol(str, &str, 10);
|
||||
@@ -557,7 +582,7 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
}
|
||||
BREAK:
|
||||
fl_font(font, tsize);
|
||||
if (((FL_BLINE*)item)->flags & SELECTED)
|
||||
if (l->flags & SELECTED)
|
||||
lcol = fl_contrast(lcol, selection_color());
|
||||
if (!active_r()) lcol = fl_inactive(lcol);
|
||||
fl_color(lcol);
|
||||
@@ -592,8 +617,7 @@ Fl_Browser::Fl_Browser(int X, int Y, int W, int H, const char *L)
|
||||
Updates the browser so that \p line is shown at position \p pos.
|
||||
\param[in] line line number. (1 based)
|
||||
\param[in] pos position.
|
||||
\see topline(), middleline(), bottomline(), \n
|
||||
+: Command not found.
|
||||
\see topline(), middleline(), bottomline()
|
||||
*/
|
||||
void Fl_Browser::lineposition(int line, Fl_Line_Position pos) {
|
||||
if (line<1) line = 1;
|
||||
@@ -835,6 +859,58 @@ void Fl_Browser::swap(int a, int b) {
|
||||
swap(ai,bi);
|
||||
}
|
||||
|
||||
/**
|
||||
Set the image icon for \p line to the value \p icon.
|
||||
Caller is responsible for keeping the icon allocated.
|
||||
The \p line is automatically redrawn.
|
||||
\param[in] line The line to be modified. If out of range, nothing is done.
|
||||
\param[in] icon The image icon to be assigned to the \p line.
|
||||
If NULL, any previous icon is removed.
|
||||
*/
|
||||
void Fl_Browser::icon(int line, Fl_Image* icon) {
|
||||
|
||||
if (line<1 || line > lines) return;
|
||||
|
||||
FL_BLINE* bl = find_line(line);
|
||||
|
||||
int old_h = bl->icon ? bl->icon->h()+2 : 0; // init with *old* icon height
|
||||
bl->icon = 0; // remove icon, if any
|
||||
int th = item_height(bl); // height of text only
|
||||
int new_h = icon ? icon->h()+2 : 0; // init with *new* icon height
|
||||
if (th > old_h) old_h = th;
|
||||
if (th > new_h) new_h = th;
|
||||
int dh = new_h - old_h;
|
||||
full_height_ += dh; // do this *always*
|
||||
|
||||
bl->icon = icon; // set new icon
|
||||
if (dh>0) {
|
||||
redraw(); // icon larger than item? must redraw widget
|
||||
} else {
|
||||
redraw_line(bl); // icon same or smaller? can redraw just this line
|
||||
}
|
||||
replacing(bl,bl); // recalc Fl_Browser_::max_width et al
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the icon currently defined for \p line.
|
||||
If no icon is defined, NULL is returned.
|
||||
\param[in] line The line whose icon is returned.
|
||||
\returns The icon defined, or NULL if none.
|
||||
*/
|
||||
Fl_Image* Fl_Browser::icon(int line) const {
|
||||
FL_BLINE* l = find_line(line);
|
||||
return(l ? l->icon : NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
Removes the icon for \p line.
|
||||
It's ok to remove an icon if none has been defined.
|
||||
\param[in] line The line whose icon is to be removed.
|
||||
*/
|
||||
void Fl_Browser::remove_icon(int line) {
|
||||
icon(line,0);
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Browser.cxx 6726 2009-03-27 16:52:31Z greg.ercolano $".
|
||||
// End of "$Id: Fl_Browser.cxx 6895 2009-09-21 06:35:08Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Choice.cxx 6616 2009-01-01 21:28:26Z matt $"
|
||||
// "$Id: Fl_Choice.cxx 6873 2009-09-16 07:06:41Z AlbrechtS $"
|
||||
//
|
||||
// Choice widget for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -209,5 +209,5 @@ int Fl_Choice::handle(int e) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Choice.cxx 6616 2009-01-01 21:28:26Z matt $".
|
||||
// End of "$Id: Fl_Choice.cxx 6873 2009-09-16 07:06:41Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -128,7 +128,7 @@ HDC fl_makeDC(HBITMAP bitmap) {
|
||||
SetTextAlign(new_gc, TA_BASELINE|TA_LEFT);
|
||||
SetBkMode(new_gc, TRANSPARENT);
|
||||
#if USE_COLORMAP
|
||||
if (fl_palette) SelectPalette(new_gc, fl_palette, false);
|
||||
if (fl_palette) SelectPalette(new_gc, fl_palette, FALSE);
|
||||
#endif
|
||||
SelectObject(new_gc, bitmap);
|
||||
return new_gc;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_File_Browser.cxx 6616 2009-01-01 21:28:26Z matt $"
|
||||
// "$Id: Fl_File_Browser.cxx 6853 2009-09-09 05:16:41Z greg.ercolano $"
|
||||
//
|
||||
// Fl_File_Browser routines.
|
||||
//
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <FL/Fl_File_Browser.H>
|
||||
#include <FL/fl_draw.H>
|
||||
#include <FL/filename.H>
|
||||
#include <FL/Fl_Image.H> // icon
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "flstring.h"
|
||||
@@ -80,11 +81,17 @@
|
||||
#define SELECTED 1
|
||||
#define NOTDISPLAYED 2
|
||||
|
||||
// TODO -- Warning: The definition of FL_BLINE here is a hack.
|
||||
// Fl_File_Browser should not do this. PLEASE FIX.
|
||||
// FL_BLINE should be private to Fl_Browser, and not re-defined here.
|
||||
// For now, make sure this struct is precisely consistent with Fl_Browser.cxx.
|
||||
//
|
||||
struct FL_BLINE // data is in a linked list of these
|
||||
{
|
||||
FL_BLINE *prev; // Previous item in list
|
||||
FL_BLINE *next; // Next item in list
|
||||
void *data; // Pointer to data (function)
|
||||
Fl_Image *icon; // Pointer to optional icon
|
||||
short length; // sizeof(txt)-1, may be longer than string
|
||||
char flags; // selected, displayed
|
||||
char txt[1]; // start of allocated array
|
||||
@@ -635,5 +642,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_File_Browser.cxx 6616 2009-01-01 21:28:26Z matt $".
|
||||
// End of "$Id: Fl_File_Browser.cxx 6853 2009-09-09 05:16:41Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_File_Chooser2.cxx 6678 2009-03-13 23:36:09Z AlbrechtS $"
|
||||
// "$Id: Fl_File_Chooser2.cxx 6899 2009-09-23 21:32:23Z matt $"
|
||||
//
|
||||
// More Fl_File_Chooser routines.
|
||||
//
|
||||
@@ -858,7 +858,7 @@ Fl_File_Chooser::fileNameCB()
|
||||
}
|
||||
} else {
|
||||
// File doesn't exist, so beep at and alert the user...
|
||||
fl_alert("%s", existing_file_label);
|
||||
fl_alert(existing_file_label);
|
||||
}
|
||||
}
|
||||
else if (Fl::event_key() != FL_Delete &&
|
||||
@@ -1046,7 +1046,7 @@ Fl_File_Chooser::newdir()
|
||||
|
||||
|
||||
// Get a directory name from the user
|
||||
if ((dir = fl_input("%s", new_directory_label, (char *)NULL)) == NULL)
|
||||
if ((dir = fl_input(new_directory_label, NULL)) == NULL)
|
||||
return;
|
||||
|
||||
// Make it relative to the current directory as needed...
|
||||
@@ -1213,7 +1213,7 @@ Fl_File_Chooser::showChoiceCB()
|
||||
item = showChoice->text(showChoice->value());
|
||||
|
||||
if (strcmp(item, custom_filter_label) == 0) {
|
||||
if ((item = fl_input("%s",custom_filter_label, pattern_)) != NULL) {
|
||||
if ((item = fl_input(custom_filter_label, pattern_)) != NULL) {
|
||||
strlcpy(pattern_, item, sizeof(pattern_));
|
||||
|
||||
quote_pathname(temp, item, sizeof(temp));
|
||||
@@ -1332,10 +1332,37 @@ Fl_File_Chooser::update_preview()
|
||||
window->cursor(FL_CURSOR_DEFAULT);
|
||||
Fl::check();
|
||||
|
||||
// Scan the buffer for printable chars...
|
||||
for (ptr = preview_text_;
|
||||
// Scan the buffer for printable UTF8 chars...
|
||||
for (ptr = preview_text_; *ptr; ptr++) {
|
||||
uchar c = uchar(*ptr);
|
||||
if ( (c&0x80)==0 ) {
|
||||
if (!isprint(c&255) && !isspace(c&255)) break;
|
||||
} else if ( (c&0xe0)==0xc0 ) {
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
} else if ( (c&0xf0)==0xe0 ) {
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
} else if ( (c&0xf8)==0xf0 ) {
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
// *ptr && (isprint(*ptr & 255) || isspace(*ptr & 255));
|
||||
// ptr ++);
|
||||
|
||||
// Scan the buffer for printable characters in 8 bit
|
||||
if (*ptr || ptr == preview_text_) {
|
||||
for (ptr = preview_text_;
|
||||
*ptr && (isprint(*ptr & 255) || isspace(*ptr & 255));
|
||||
ptr ++);
|
||||
}
|
||||
|
||||
if (*ptr || ptr == preview_text_) {
|
||||
// Non-printable file, just show a big ?...
|
||||
@@ -1589,5 +1616,5 @@ unquote_pathname(char *dst, // O - Destination string
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_File_Chooser2.cxx 6678 2009-03-13 23:36:09Z AlbrechtS $".
|
||||
// End of "$Id: Fl_File_Chooser2.cxx 6899 2009-09-23 21:32:23Z matt $".
|
||||
//
|
||||
|
||||
@@ -144,7 +144,7 @@ void Fl_File_Input::update_buttons() {
|
||||
\param[in] str new string value
|
||||
\param[in] len lengh of value
|
||||
*/
|
||||
int // O - true on success
|
||||
int // O - TRUE on success
|
||||
Fl_File_Input::value(const char *str, // I - New string value
|
||||
int len) { // I - Length of value
|
||||
damage(FL_DAMAGE_BAR);
|
||||
@@ -157,7 +157,7 @@ Fl_File_Input::value(const char *str, // I - New string value
|
||||
Returns non 0 on success.
|
||||
\param[in] str new string value
|
||||
*/
|
||||
int // O - true on success
|
||||
int // O - TRUE on success
|
||||
Fl_File_Input::value(const char *str) { // I - New string value
|
||||
damage(FL_DAMAGE_BAR);
|
||||
return Fl_Input::value(str);
|
||||
@@ -187,7 +187,7 @@ void Fl_File_Input::draw() {
|
||||
Return non zero if event is handled.
|
||||
\param[in] event
|
||||
*/
|
||||
int // O - true if we handled event
|
||||
int // O - TRUE if we handled event
|
||||
Fl_File_Input::handle(int event) // I - Event
|
||||
{
|
||||
// printf("handle(event = %d)\n", event);
|
||||
@@ -230,7 +230,7 @@ Fl_File_Input::handle(int event) // I - Event
|
||||
Return non zero if event is handled.
|
||||
\param[in] event
|
||||
*/
|
||||
int // O - true if we handled event
|
||||
int // O - TRUE if we handled event
|
||||
Fl_File_Input::handle_button(int event) // I - Event
|
||||
{
|
||||
int i, // Looping var
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Image.cxx 6773 2009-04-21 09:25:22Z AlbrechtS $"
|
||||
// "$Id: Fl_Image.cxx 6804 2009-06-29 07:44:25Z AlbrechtS $"
|
||||
//
|
||||
// Image drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -551,5 +551,5 @@ void Fl_RGB_Image::label(Fl_Menu_Item* m) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Image.cxx 6773 2009-04-21 09:25:22Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Image.cxx 6804 2009-06-29 07:44:25Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Input.cxx 6765 2009-04-15 08:35:28Z matt $"
|
||||
// "$Id: Fl_Input.cxx 6888 2009-09-19 21:16:21Z matt $"
|
||||
//
|
||||
// Input widget for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -621,6 +621,18 @@ int Fl_Input::handle(int event) {
|
||||
take_focus();
|
||||
return 1;
|
||||
|
||||
/* TODO: this will scroll the area, but stop if the cursor would become invisible.
|
||||
That clipping happens in drawtext(). Do we change the clipping or should
|
||||
we move the cursor (ouch)?
|
||||
case FL_MOUSEWHEEL:
|
||||
if (Fl::e_dy > 0) {
|
||||
yscroll( yscroll() - Fl::e_dy*15 );
|
||||
} else if (Fl::e_dy < 0) {
|
||||
yscroll( yscroll() - Fl::e_dy*15 );
|
||||
}
|
||||
return 1;
|
||||
*/
|
||||
|
||||
}
|
||||
Fl_Boxtype b = box();
|
||||
return Fl_Input_::handletext(event,
|
||||
@@ -637,5 +649,5 @@ Fl_Input::Fl_Input(int X, int Y, int W, int H, const char *l)
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Input.cxx 6765 2009-04-15 08:35:28Z matt $".
|
||||
// End of "$Id: Fl_Input.cxx 6888 2009-09-19 21:16:21Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Input_.cxx 6777 2009-04-23 15:32:19Z matt $"
|
||||
// "$Id: Fl_Input_.cxx 6887 2009-09-19 20:57:48Z matt $"
|
||||
//
|
||||
// Common input widget routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -134,7 +134,7 @@ double Fl_Input_::expandpos(
|
||||
if (c < ' ' || c == 127) {
|
||||
if (c == '\t' && input_type()==FL_MULTILINE_INPUT) {
|
||||
n += 8-(chr%8);
|
||||
chr += 8-(chr%8);
|
||||
chr += 7-(chr%8);
|
||||
} else n += 2;
|
||||
} else {
|
||||
n++;
|
||||
@@ -239,6 +239,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
|
||||
// count how many lines and put the last one into the buffer:
|
||||
// And figure out where the cursor is:
|
||||
int height = fl_height();
|
||||
int threshold = height/2;
|
||||
int lines;
|
||||
int curx, cury;
|
||||
for (p=value(), curx=cury=lines=0; ;) {
|
||||
@@ -248,15 +249,15 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
|
||||
if (Fl::focus()==this && !was_up_down) up_down_pos = curx;
|
||||
cury = lines*height;
|
||||
int newscroll = xscroll_;
|
||||
if (curx > newscroll+W-20) {
|
||||
if (curx > newscroll+W-threshold) {
|
||||
// figure out scrolling so there is space after the cursor:
|
||||
newscroll = curx+20-W;
|
||||
newscroll = curx+threshold-W;
|
||||
// figure out the furthest left we ever want to scroll:
|
||||
int ex = int(expandpos(p, e, buf, 0))+2-W;
|
||||
// use minimum of both amounts:
|
||||
if (ex < newscroll) newscroll = ex;
|
||||
} else if (curx < newscroll+20) {
|
||||
newscroll = curx-20;
|
||||
} else if (curx < newscroll+threshold) {
|
||||
newscroll = curx-threshold;
|
||||
}
|
||||
if (newscroll < 0) newscroll = 0;
|
||||
if (newscroll != xscroll_) {
|
||||
@@ -1253,5 +1254,5 @@ Fl_Char Fl_Input_::index(int i) const
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Input_.cxx 6777 2009-04-23 15:32:19Z matt $".
|
||||
// End of "$Id: Fl_Input_.cxx 6887 2009-09-19 20:57:48Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu.cxx 6757 2009-04-12 20:00:45Z matt $"
|
||||
// "$Id: Fl_Menu.cxx 6841 2009-08-03 06:26:32Z AlbrechtS $"
|
||||
//
|
||||
// Menu code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -1014,5 +1014,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu.cxx 6757 2009-04-12 20:00:45Z matt $".
|
||||
// End of "$Id: Fl_Menu.cxx 6841 2009-08-03 06:26:32Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_.cxx 6660 2009-02-15 18:58:03Z AlbrechtS $"
|
||||
// "$Id: Fl_Menu_.cxx 6904 2009-09-27 11:39:02Z matt $"
|
||||
//
|
||||
// Common menu code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -172,11 +172,11 @@ void Fl_Menu_Item::setonly() {
|
||||
}
|
||||
}
|
||||
|
||||
Fl_Menu_::Fl_Menu_(int X,int Y,int W,int H,const char* l)
|
||||
/**
|
||||
Creates a new Fl_Menu_ widget using the given position, size,
|
||||
and label string. menu() is initialized to null.
|
||||
*/
|
||||
Creates a new Fl_Menu_ widget using the given position, size,
|
||||
and label string. menu() is initialized to null.
|
||||
*/
|
||||
Fl_Menu_::Fl_Menu_(int X,int Y,int W,int H,const char* l)
|
||||
: Fl_Widget(X,Y,W,H,l) {
|
||||
set_flag(SHORTCUT_LABEL);
|
||||
box(FL_UP_BOX);
|
||||
@@ -262,5 +262,5 @@ void Fl_Menu_::clear() {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_.cxx 6660 2009-02-15 18:58:03Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Menu_.cxx 6904 2009-09-27 11:39:02Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_add.cxx 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: Fl_Menu_add.cxx 6878 2009-09-17 22:12:24Z matt $"
|
||||
//
|
||||
// Menu utilities for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -177,56 +177,95 @@ int Fl_Menu_Item::add(
|
||||
}
|
||||
|
||||
/**
|
||||
Adds a new menu item, with a title string, shortcut int (or string),
|
||||
callback, argument to the callback, and flags.
|
||||
Adds a new menu item.
|
||||
|
||||
\param[in] label The text label for the menu item.
|
||||
\param[in] shortcut Optional keyboard shortcut that can be an int or string; (FL_CTRL+'a') or "^a". Default 0 if none.
|
||||
\param[in] callback Optional callback invoked when user clicks the item. Default 0 if none.
|
||||
\param[in] userdata Optional user data passed as an argument to the callback. Default 0 if none.
|
||||
\param[in] flags Optional flags that control the type of menu item; see below. Default is 0 for none.
|
||||
\returns The index into the menu() array, where the entry was added.
|
||||
|
||||
\par Description
|
||||
If the menu array was directly set with menu(x), then copy() is done
|
||||
to make a private array.
|
||||
|
||||
The characters "&", "/", "\", and "_" are treated as
|
||||
special characters in the label string. The "&" character
|
||||
specifies that the following character is an accelerator and
|
||||
will be underlined. The "\" character is used to escape the next
|
||||
character in the string. Labels starting with the "_" character
|
||||
cause a divider to be placed after that menu item.
|
||||
|
||||
A label of the form "foo/bar/baz" will create submenus called
|
||||
"foo" and "bar" with an entry called "baz". The "/" character is
|
||||
ignored if it appears as the first character of the label string, e.g.
|
||||
"/foo/bar/baz".
|
||||
|
||||
\par
|
||||
A menu item's callback must not add() items to its parent menu during the callback.
|
||||
|
||||
<B>Detailed Description of Parameters</B>
|
||||
\par label
|
||||
The menu item's label. This option is required.
|
||||
\par
|
||||
The characters "&", "/", "\", and "_" are treated as special characters in the label string.
|
||||
The "&" character specifies that the following character is an accelerator and will be underlined.
|
||||
The "\" character is used to escape the next character in the string.
|
||||
Labels starting with the "_" character cause a divider to be placed after that menu item.
|
||||
\par
|
||||
A label of the form "File/Quit" will create the submenu "File"
|
||||
with a menu item called "Quit". The "/" character is ignored if it appears
|
||||
as the first character of the label string, e.g. "/File/Quit".
|
||||
\par
|
||||
The label string is copied to new memory and can be freed.
|
||||
The other arguments (including the shortcut) are copied into the
|
||||
menu item unchanged.
|
||||
|
||||
\par
|
||||
If an item exists already with that name then it is replaced with
|
||||
this new one. Otherwise this new one is added to the end of the
|
||||
correct menu or submenu. The return value is the offset into the array
|
||||
that the new entry was placed at.
|
||||
|
||||
\par shortcut
|
||||
The keyboard shortcut for this menu item.
|
||||
\par
|
||||
This parameter is optional, and defaults to 0 to indicate no shortcut.
|
||||
\par
|
||||
Shortcut can be 0L, or either a modifier/key combination (for example
|
||||
FL_CTRL+'A') or a string describing the shortcut in one of two ways:
|
||||
|
||||
\code
|
||||
\verbatim
|
||||
[#+^]<ascii_value> e.g. "97", "^97", "+97", "#97"
|
||||
[#+^]<ascii_char> e.g. "a", "^a", "+a", "#a"
|
||||
\endcode
|
||||
\endverbatim
|
||||
..where \<ascii_value\> is a decimal value representing an
|
||||
ascii character (eg. 97 is the ascii for 'a'), and the optional
|
||||
prefixes enhance the value that follows. Multiple prefixes must
|
||||
appear in the above order.
|
||||
\code
|
||||
\verbatim
|
||||
# - Alt
|
||||
+ - Shift
|
||||
^ - Control
|
||||
\endcode
|
||||
\endverbatim
|
||||
Text shortcuts are converted to integer shortcut by calling
|
||||
int fl_old_shortcut(const char*).
|
||||
|
||||
The return value is the index into the array that the entry was put.
|
||||
|
||||
No items must be added to a menu during a callback to the same menu.
|
||||
Fl_Shortcut fl_old_shortcut(const char*).
|
||||
|
||||
\par callback
|
||||
The callback to invoke when this menu item is selected.
|
||||
\par
|
||||
This parameter is optional, and defaults to 0 for no callback.
|
||||
|
||||
\par userdata
|
||||
The callback's 'user data' that is passed to the callback.
|
||||
\par
|
||||
This parameter is optional, and defaults to 0.
|
||||
|
||||
\par flags
|
||||
These are bit flags to define what kind of menu item this is.
|
||||
\par
|
||||
This parameter is optional, and defaults to 0 to define a 'regular' menu item.
|
||||
\par
|
||||
These flags can be 'OR'ed together:
|
||||
\code
|
||||
FL_MENU_INACTIVE // Deactivate menu item (gray out)
|
||||
FL_MENU_TOGGLE // Item is a checkbox toggle (shows checkbox for on/off state)
|
||||
FL_MENU_VALUE // The on/off state for checkbox/radio buttons (if set, state is 'on')
|
||||
FL_MENU_RADIO // Item is a radio button (one checkbox of many can be on)
|
||||
FL_MENU_INVISIBLE // Item will not show up (shortcut will work)
|
||||
FL_SUBMENU_POINTER // Indicates user_data() is a pointer to another menu array
|
||||
FL_SUBMENU // This item is a submenu to other items
|
||||
FL_MENU_DIVIDER // Creates divider line below this item. Also ends a group of radio buttons.
|
||||
\endcode
|
||||
|
||||
*/
|
||||
int Fl_Menu_::add(const char *t, int s, Fl_Callback *c,void *v,int f) {
|
||||
int Fl_Menu_::add(const char *label,int shortcut,Fl_Callback *callback,void *userdata,int flags) {
|
||||
// make this widget own the local array:
|
||||
if (this != fl_menu_array_owner) {
|
||||
if (fl_menu_array_owner) {
|
||||
@@ -260,7 +299,7 @@ int Fl_Menu_::add(const char *t, int s, Fl_Callback *c,void *v,int f) {
|
||||
}
|
||||
fl_menu_array_owner = this;
|
||||
}
|
||||
int r = menu_->add(t,s,c,v,f);
|
||||
int r = menu_->add(label,shortcut,callback,userdata,flags);
|
||||
// if it rellocated array we must fix the pointer:
|
||||
int value_offset = value_-menu_;
|
||||
menu_ = local_array; // in case it reallocated it
|
||||
@@ -335,5 +374,5 @@ void Fl_Menu_::remove(int i) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_add.cxx 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: Fl_Menu_add.cxx 6878 2009-09-17 22:12:24Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Progress.cxx 6616 2009-01-01 21:28:26Z matt $"
|
||||
// "$Id: Fl_Progress.cxx 6794 2009-06-27 09:29:36Z AlbrechtS $"
|
||||
//
|
||||
// Progress bar widget routines.
|
||||
//
|
||||
@@ -119,5 +119,5 @@ Fl_Progress::Fl_Progress(int X, int Y, int W, int H, const char* L)
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Progress.cxx 6616 2009-01-01 21:28:26Z matt $".
|
||||
// End of "$Id: Fl_Progress.cxx 6794 2009-06-27 09:29:36Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Scroll.cxx 6654 2009-02-08 18:47:37Z AlbrechtS $"
|
||||
// "$Id: Fl_Scroll.cxx 6828 2009-07-12 00:15:06Z greg.ercolano $"
|
||||
//
|
||||
// Scroll widget for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -413,5 +413,5 @@ int Fl_Scroll::handle(int event) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Scroll.cxx 6654 2009-02-08 18:47:37Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Scroll.cxx 6828 2009-07-12 00:15:06Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Buffer.cxx 6765 2009-04-15 08:35:28Z matt $"
|
||||
// "$Id: Fl_Text_Buffer.cxx 6825 2009-07-04 05:18:29Z fabien $"
|
||||
//
|
||||
// Copyright 2001-2009 by Bill Spitzak and others.
|
||||
// Original code Copyright Mark Edel. Permission to distribute under
|
||||
@@ -2502,5 +2502,5 @@ Fl_Text_Buffer::outputfile(const char *file, int start, int end, int buflen) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Buffer.cxx 6765 2009-04-15 08:35:28Z matt $".
|
||||
// End of "$Id: Fl_Text_Buffer.cxx 6825 2009-07-04 05:18:29Z fabien $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Display.cxx 6765 2009-04-15 08:35:28Z matt $"
|
||||
// "$Id: Fl_Text_Display.cxx 6909 2009-09-28 14:41:43Z matt $"
|
||||
//
|
||||
// Copyright 2001-2009 by Bill Spitzak and others.
|
||||
// Original code Copyright Mark Edel. Permission to distribute under
|
||||
@@ -387,8 +387,8 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
|
||||
mMaxsize = max(mMaxsize, fl_height(mStyleTable[i].font, mStyleTable[i].size));
|
||||
|
||||
// did we have scrollbars initially?
|
||||
int hscrollbarvisible = mHScrollBar->visible();
|
||||
int vscrollbarvisible = mVScrollBar->visible();
|
||||
unsigned int hscrollbarvisible = mHScrollBar->visible();
|
||||
unsigned int vscrollbarvisible = mVScrollBar->visible();
|
||||
|
||||
// try without scrollbars first
|
||||
mVScrollBar->clear_visible();
|
||||
@@ -3439,5 +3439,5 @@ int Fl_Text_Display::handle(int event) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Display.cxx 6765 2009-04-15 08:35:28Z matt $".
|
||||
// End of "$Id: Fl_Text_Display.cxx 6909 2009-09-28 14:41:43Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Editor.cxx 6765 2009-04-15 08:35:28Z matt $"
|
||||
// "$Id: Fl_Text_Editor.cxx 6894 2009-09-20 21:55:21Z greg.ercolano $"
|
||||
//
|
||||
// Copyright 2001-2009 by Bill Spitzak and others.
|
||||
// Original code Copyright Mark Edel. Permission to distribute under
|
||||
@@ -156,6 +156,14 @@ static struct {
|
||||
{ 'c', FL_COMMAND, Fl_Text_Editor::kf_copy },
|
||||
{ 'v', FL_COMMAND, Fl_Text_Editor::kf_paste },
|
||||
{ 'a', FL_COMMAND, Fl_Text_Editor::kf_select_all },
|
||||
{ FL_Left, FL_COMMAND, Fl_Text_Editor::kf_meta_move },
|
||||
{ FL_Right, FL_COMMAND, Fl_Text_Editor::kf_meta_move },
|
||||
{ FL_Up, FL_COMMAND, Fl_Text_Editor::kf_meta_move },
|
||||
{ FL_Down, FL_COMMAND, Fl_Text_Editor::kf_meta_move },
|
||||
{ FL_Left, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
|
||||
{ FL_Right, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
|
||||
{ FL_Up, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
|
||||
{ FL_Down, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
|
||||
#endif // __APPLE__
|
||||
|
||||
{ 0, 0, 0 }
|
||||
@@ -352,6 +360,40 @@ int Fl_Text_Editor::kf_ctrl_move(int c, Fl_Text_Editor* e) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Moves the current text cursor in the direction indicated by meta key */
|
||||
int Fl_Text_Editor::kf_meta_move(int c, Fl_Text_Editor* e) {
|
||||
if (!e->buffer()->selected())
|
||||
e->dragPos = e->insert_position();
|
||||
if (c != FL_Up && c != FL_Down) {
|
||||
e->buffer()->unselect();
|
||||
e->show_insert_position();
|
||||
}
|
||||
switch (c) {
|
||||
case FL_Up: // top of buffer
|
||||
e->insert_position(0);
|
||||
e->scroll(0, 0);
|
||||
break;
|
||||
case FL_Down: // end of buffer
|
||||
e->insert_position(e->buffer()->length());
|
||||
e->scroll(e->count_lines(0, e->buffer()->length(), 1), 0);
|
||||
break;
|
||||
case FL_Left: // beginning of line
|
||||
kf_move(FL_Home, e);
|
||||
break;
|
||||
case FL_Right: // end of line
|
||||
kf_move(FL_End, e);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Extends the current selection in the direction indicated by meta key c. */
|
||||
int Fl_Text_Editor::kf_m_s_move(int c, Fl_Text_Editor* e) {
|
||||
kf_meta_move(c, e);
|
||||
fl_text_drag_me(e->insert_position(), e);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Extends the current selection in the direction indicated by control key c. */
|
||||
int Fl_Text_Editor::kf_c_s_move(int c, Fl_Text_Editor* e) {
|
||||
kf_ctrl_move(c, e);
|
||||
@@ -572,5 +614,5 @@ int Fl_Text_Editor::handle(int event) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Editor.cxx 6765 2009-04-15 08:35:28Z matt $".
|
||||
// End of "$Id: Fl_Text_Editor.cxx 6894 2009-09-20 21:55:21Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Tooltip.cxx 6712 2009-03-22 19:21:34Z AlbrechtS $"
|
||||
// "$Id: Fl_Tooltip.cxx 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Tooltip source file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -34,10 +34,10 @@
|
||||
float Fl_Tooltip::delay_ = 1.0f;
|
||||
float Fl_Tooltip::hoverdelay_ = 0.2f;
|
||||
int Fl_Tooltip::enabled_ = 1;
|
||||
unsigned Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
|
||||
Fl_Color Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
|
||||
FL_NUM_GREEN - 1,
|
||||
FL_NUM_BLUE - 2);
|
||||
unsigned Fl_Tooltip::textcolor_ = FL_BLACK;
|
||||
Fl_Color Fl_Tooltip::textcolor_ = FL_BLACK;
|
||||
Fl_Font Fl_Tooltip::font_ = FL_HELVETICA;
|
||||
Fl_Fontsize Fl_Tooltip::size_ = FL_NORMAL_SIZE;
|
||||
|
||||
@@ -278,5 +278,5 @@ void Fl_Widget::tooltip(const char *tt) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Tooltip.cxx 6712 2009-03-22 19:21:34Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Tooltip.cxx 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Window.cxx 6669 2009-02-25 08:44:54Z AlbrechtS $"
|
||||
// "$Id: Fl_Window.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// Window widget class for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -66,7 +66,7 @@ Fl_Window::Fl_Window(int X,int Y,int W, int H, const char *l)
|
||||
cursor_bg = FL_WHITE;
|
||||
|
||||
_Fl_Window();
|
||||
set_flag(FL_FORCE_POSITION);
|
||||
set_flag(FORCE_POSITION);
|
||||
}
|
||||
|
||||
Fl_Window::Fl_Window(int W, int H, const char *l)
|
||||
@@ -151,8 +151,7 @@ void Fl_Window::copy_label(const char *a) {
|
||||
|
||||
|
||||
void Fl_Window::iconlabel(const char *iname) {
|
||||
// FIXME: 'flags' is 32 bit large!
|
||||
uchar saveflags = flags();
|
||||
unsigned saveflags = flags();
|
||||
label(label(), iname);
|
||||
set_flag(saveflags);
|
||||
}
|
||||
@@ -179,5 +178,5 @@ Fl_Window *Fl_Window::current() {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window.cxx 6669 2009-02-25 08:44:54Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Window.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Window_fullscreen.cxx 6660 2009-02-15 18:58:03Z AlbrechtS $"
|
||||
// "$Id: Fl_Window_fullscreen.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// Fullscreen window support for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -43,10 +43,10 @@
|
||||
void Fl_Window::border(int b) {
|
||||
if (b) {
|
||||
if (border()) return;
|
||||
clear_flag(FL_NOBORDER);
|
||||
clear_flag(NOBORDER);
|
||||
} else {
|
||||
if (!border()) return;
|
||||
set_flag(FL_NOBORDER);
|
||||
set_flag(NOBORDER);
|
||||
}
|
||||
#if defined(USE_X11)
|
||||
if (shown()) Fl_X::i(this)->sendxjunk();
|
||||
@@ -91,5 +91,5 @@ void Fl_Window::fullscreen_off(int X,int Y,int W,int H) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window_fullscreen.cxx 6660 2009-02-15 18:58:03Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Window_fullscreen.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_arg.cxx 6712 2009-03-22 19:21:34Z AlbrechtS $"
|
||||
// "$Id: Fl_arg.cxx 6813 2009-07-01 07:32:14Z AlbrechtS $"
|
||||
//
|
||||
// Optional argument initialization code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -538,5 +538,5 @@ int XParseGeometry(const char* string, int* x, int* y,
|
||||
#endif // ifdef WIN32
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_arg.cxx 6712 2009-03-22 19:21:34Z AlbrechtS $".
|
||||
// End of "$Id: Fl_arg.cxx 6813 2009-07-01 07:32:14Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_mac.cxx 6758 2009-04-13 07:32:01Z matt $"
|
||||
// "$Id: Fl_mac.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// MacOS specific code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -1496,10 +1496,10 @@ void fl_open_display() {
|
||||
beenHereDoneThat = 1;
|
||||
|
||||
FlushEvents(everyEvent,0);
|
||||
|
||||
|
||||
MoreMasters(); // \todo Carbon suggests MoreMasterPointers()
|
||||
AEInstallEventHandler( kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP((AEEventHandlerProcPtr)QuitAppleEventHandler), 0, false );
|
||||
|
||||
|
||||
// create the Mac Handle for the default cursor (a pointer to a pointer)
|
||||
GetQDGlobalsArrow(&default_cursor);
|
||||
default_cursor_ptr = &default_cursor;
|
||||
@@ -1508,12 +1508,12 @@ void fl_open_display() {
|
||||
ClearMenuBar();
|
||||
AppendResMenu( GetMenuHandle( 1 ), 'DRVR' );
|
||||
DrawMenuBar();
|
||||
|
||||
|
||||
// bring the application into foreground without a 'CARB' resource
|
||||
Boolean same_psn;
|
||||
ProcessSerialNumber cur_psn, front_psn;
|
||||
if( !GetCurrentProcess( &cur_psn ) && !GetFrontProcess( &front_psn ) &&
|
||||
!SameProcess( &front_psn, &cur_psn, &same_psn ) && !same_psn )
|
||||
!SameProcess( &front_psn, &cur_psn, &same_psn ) && !same_psn )
|
||||
{
|
||||
// only transform the application type for unbundled apps
|
||||
CFBundleRef bundle = CFBundleGetMainBundle();
|
||||
@@ -1522,35 +1522,16 @@ void fl_open_display() {
|
||||
FSRef execFs;
|
||||
CFURLRef execUrl = CFBundleCopyExecutableURL( bundle );
|
||||
CFURLGetFSRef( execUrl, &execFs );
|
||||
|
||||
|
||||
FSRef bundleFs;
|
||||
GetProcessBundleLocation( &cur_psn, &bundleFs );
|
||||
|
||||
|
||||
if( !FSCompareFSRefs( &execFs, &bundleFs ) )
|
||||
bundle = NULL;
|
||||
|
||||
|
||||
CFRelease(execUrl);
|
||||
}
|
||||
|
||||
// imm: keycode handler stub setting - use Gestalt to determine the running system version,
|
||||
// then set the keycode_function pointer accordingly
|
||||
SInt32 MacVersion;
|
||||
if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr)
|
||||
{
|
||||
// SInt32 maj, min, fix;
|
||||
// Gestalt(gestaltSystemVersionMajor, &maj); // e.g. 10
|
||||
// Gestalt(gestaltSystemVersionMinor, &min); // e.g. 4
|
||||
// Gestalt(gestaltSystemVersionBugFix, &fix); // e.g. 11
|
||||
if(MacVersion >= 0x1050) { // 10.5.0 or later
|
||||
keycode_function = keycodeToUnicode;
|
||||
}
|
||||
else {
|
||||
keycode_function = keycode_wrap_old; // pre-10.5 mechanism
|
||||
}
|
||||
}
|
||||
// else our default handler will be used (keycode_wrap_old)
|
||||
|
||||
|
||||
|
||||
if( !bundle )
|
||||
{
|
||||
// Earlier versions of this code tried to use weak linking, however it
|
||||
@@ -1558,19 +1539,30 @@ void fl_open_display() {
|
||||
// both TransformProcessType and CPSEnableForegroundOperation, the following
|
||||
// conditional code compiled on 10.2 will still work on newer releases...
|
||||
OSErr err;
|
||||
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
|
||||
if (TransformProcessType != NULL) {
|
||||
err = TransformProcessType(&cur_psn, kProcessTransformToForegroundApplication);
|
||||
} else
|
||||
err = TransformProcessType(&cur_psn, kProcessTransformToForegroundApplication);
|
||||
} else
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
|
||||
err = CPSEnableForegroundOperation(&cur_psn, 0x03, 0x3C, 0x2C, 0x1103);
|
||||
|
||||
err = CPSEnableForegroundOperation(&cur_psn, 0x03, 0x3C, 0x2C, 0x1103);
|
||||
|
||||
if (err == noErr) {
|
||||
SetFrontProcess( &cur_psn );
|
||||
SetFrontProcess( &cur_psn );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// imm: keycode handler stub setting - use Gestalt to determine the running system version,
|
||||
// then set the keycode_function pointer accordingly
|
||||
keycode_function = keycode_wrap_old; // default to pre-10.5 mechanism
|
||||
SInt32 MacVersion;
|
||||
if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr)
|
||||
{
|
||||
if(MacVersion >= 0x1050) { // 10.5.0 or later
|
||||
keycode_function = keycodeToUnicode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2185,7 +2177,7 @@ void Fl_X::make(Fl_Window* w)
|
||||
wp += 2*bx;
|
||||
hp += 2*by+bt;
|
||||
}
|
||||
if (!(w->flags() & Fl_Window::FL_FORCE_POSITION)) {
|
||||
if (!(w->flags() & Fl_Widget::FORCE_POSITION)) {
|
||||
// use the Carbon functions below for default window positioning
|
||||
w->x(xyPos+Fl::x());
|
||||
w->y(xyPos+Fl::y());
|
||||
@@ -2232,7 +2224,7 @@ void Fl_X::make(Fl_Window* w)
|
||||
SetWindowClass(x->xid, kFloatingWindowClass);
|
||||
SetWindowActivationScope(x->xid, kWindowActivationScopeAll);
|
||||
}
|
||||
if (!(w->flags() & Fl_Window::FL_FORCE_POSITION))
|
||||
if (!(w->flags() & Fl_Widget::FORCE_POSITION))
|
||||
{
|
||||
WindowRef pw = Fl_X::first ? Fl_X::first->xid : 0 ;
|
||||
if (w->modal()) {
|
||||
@@ -2412,7 +2404,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
int is_a_resize = (W != w() || H != h());
|
||||
// printf("Fl_Winodw::resize(X=%d, Y=%d, W=%d, H=%d), is_a_resize=%d, resize_from_system=%p, this=%p\n",
|
||||
// X, Y, W, H, is_a_resize, resize_from_system, this);
|
||||
if (X != x() || Y != y()) set_flag(FL_FORCE_POSITION);
|
||||
if (X != x() || Y != y()) set_flag(FORCE_POSITION);
|
||||
else if (!is_a_resize) return;
|
||||
if ( (resize_from_system!=this) && (!parent()) && shown()) {
|
||||
if (is_a_resize) {
|
||||
@@ -2881,5 +2873,5 @@ void MacUnmapWindow(Fl_Window *w, WindowPtr p) {
|
||||
#endif // FL_DOXYGEN
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_mac.cxx 6758 2009-04-13 07:32:01Z matt $".
|
||||
// End of "$Id: Fl_mac.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_win32.cxx 6668 2009-02-21 10:18:47Z AlbrechtS $"
|
||||
// "$Id: Fl_win32.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// WIN32-specific code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -398,7 +398,7 @@ int fl_wait(double time_to_wait) {
|
||||
|
||||
time_to_wait = (time_to_wait > 10000 ? 10000 : time_to_wait);
|
||||
int t_msec = (int) (time_to_wait * 1000.0 + 0.5);
|
||||
MsgWaitForMultipleObjects(0, NULL, false, t_msec, QS_ALLINPUT);
|
||||
MsgWaitForMultipleObjects(0, NULL, FALSE, t_msec, QS_ALLINPUT);
|
||||
|
||||
fl_lock_function();
|
||||
|
||||
@@ -1127,7 +1127,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||
#if USE_COLORMAP
|
||||
case WM_QUERYNEWPALETTE :
|
||||
fl_GetDC(hWnd);
|
||||
if (fl_select_palette()) InvalidateRect(hWnd, NULL, false);
|
||||
if (fl_select_palette()) InvalidateRect(hWnd, NULL, FALSE);
|
||||
break;
|
||||
|
||||
case WM_PALETTECHANGED:
|
||||
@@ -1215,7 +1215,7 @@ int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by)
|
||||
r.right = w->x()+w->w();
|
||||
r.bottom = w->y()+w->h();
|
||||
// get the decoration rectangle for the desired client rectangle
|
||||
BOOL ok = AdjustWindowRectEx(&r, style, false, exstyle);
|
||||
BOOL ok = AdjustWindowRectEx(&r, style, FALSE, exstyle);
|
||||
if (ok) {
|
||||
X = r.left;
|
||||
Y = r.top;
|
||||
@@ -1292,7 +1292,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
int resize_from_program = (this != resize_bug_fix);
|
||||
if (!resize_from_program) resize_bug_fix = 0;
|
||||
if (X != x() || Y != y()) {
|
||||
set_flag(FL_FORCE_POSITION);
|
||||
set_flag(FORCE_POSITION);
|
||||
} else {
|
||||
if (!is_a_resize) return;
|
||||
flags |= SWP_NOMOVE;
|
||||
@@ -1474,7 +1474,7 @@ Fl_X* Fl_X::make(Fl_Window* w) {
|
||||
wp += 2*bx;
|
||||
hp += 2*by+bt;
|
||||
}
|
||||
if (!(w->flags() & Fl_Window::FL_FORCE_POSITION)) {
|
||||
if (!(w->flags() & Fl_Widget::FORCE_POSITION)) {
|
||||
xp = yp = CW_USEDEFAULT;
|
||||
} else {
|
||||
if (!Fl::grab()) {
|
||||
@@ -1557,7 +1557,7 @@ Fl_X* Fl_X::make(Fl_Window* w) {
|
||||
CoCreateInstance(CLSID_CActiveIMM, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_IActiveIMMApp, (void**) &fl_aimm);
|
||||
if (fl_aimm) {
|
||||
fl_aimm->Activate(true);
|
||||
fl_aimm->Activate(TRUE);
|
||||
}
|
||||
}
|
||||
#endif // !__GNUC__ || __GNUC__ >= 3
|
||||
@@ -1916,5 +1916,5 @@ void fl_cleanup_dc_list(void) { // clean up the list
|
||||
#endif // FL_DOXYGEN
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_win32.cxx 6668 2009-02-21 10:18:47Z AlbrechtS $".
|
||||
// End of "$Id: Fl_win32.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_x.cxx 6767 2009-04-16 22:23:36Z AlbrechtS $"
|
||||
// "$Id: Fl_x.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// X specific code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -1352,7 +1352,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
int is_a_resize = (W != w() || H != h());
|
||||
int resize_from_program = (this != resize_bug_fix);
|
||||
if (!resize_from_program) resize_bug_fix = 0;
|
||||
if (is_a_move && resize_from_program) set_flag(FL_FORCE_POSITION);
|
||||
if (is_a_move && resize_from_program) set_flag(FORCE_POSITION);
|
||||
else if (!is_a_resize && !is_a_move) return;
|
||||
if (is_a_resize) {
|
||||
Fl_Group::resize(X,Y,W,H);
|
||||
@@ -1430,7 +1430,7 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap)
|
||||
if (!win->parent() && !Fl::grab()) {
|
||||
// center windows in case window manager does not do anything:
|
||||
#ifdef FL_CENTER_WINDOWS
|
||||
if (!(win->flags() & Fl_Window::FL_FORCE_POSITION)) {
|
||||
if (!(win->flags() & Fl_Widget::FORCE_POSITION)) {
|
||||
win->x(X = scr_x+(scr_w-W)/2);
|
||||
win->y(Y = scr_y+(scr_h-H)/2);
|
||||
}
|
||||
@@ -1636,7 +1636,7 @@ void Fl_X::sendxjunk() {
|
||||
prop[1] = 1|2|16; // MWM_FUNC_ALL | MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE
|
||||
}
|
||||
|
||||
if (w->flags() & Fl_Window::FL_FORCE_POSITION) {
|
||||
if (w->flags() & Fl_Widget::FORCE_POSITION) {
|
||||
hints->flags |= USPosition;
|
||||
hints->x = w->x();
|
||||
hints->y = w->y();
|
||||
@@ -1741,5 +1741,5 @@ void Fl_Window::make_current() {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_x.cxx 6767 2009-04-16 22:23:36Z AlbrechtS $".
|
||||
// End of "$Id: Fl_x.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_ask.cxx 6763 2009-04-13 22:47:21Z AlbrechtS $"
|
||||
// "$Id: fl_ask.cxx 6869 2009-09-13 21:57:46Z AlbrechtS $"
|
||||
//
|
||||
// Standard dialog functions for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -215,8 +215,7 @@ static int innards(const char* fmt, va_list ap,
|
||||
message_form->show();
|
||||
// deactivate Fl::grab(), because it is incompatible with Fl::readqueue()
|
||||
Fl_Window* g = Fl::grab();
|
||||
if (g) // do an alternative grab to avoid floating menus, if possible
|
||||
Fl::grab(message_form);
|
||||
if (g) Fl::grab(0);
|
||||
int r = 0;
|
||||
for (;;) {
|
||||
Fl_Widget *o = Fl::readqueue();
|
||||
@@ -461,5 +460,5 @@ const char *fl_password(const char *fmt, const char *defstr, ...) {
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// End of "$Id: fl_ask.cxx 6763 2009-04-13 22:47:21Z AlbrechtS $".
|
||||
// End of "$Id: fl_ask.cxx 6869 2009-09-13 21:57:46Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_boxtype.cxx 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: fl_boxtype.cxx 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Box drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -406,7 +406,7 @@ void Fl_Widget::draw_box() const {
|
||||
// if (t == FL_FLAT_BOX) return;
|
||||
// t += 2; // convert box to frame
|
||||
// }
|
||||
draw_box((Fl_Boxtype)t, x_, y_, w_, h_, (Fl_Color)color_);
|
||||
draw_box((Fl_Boxtype)t, x_, y_, w_, h_, color_);
|
||||
}
|
||||
/** Draws a box of type t, of color c at the widget's position and size. */
|
||||
void Fl_Widget::draw_box(Fl_Boxtype t, Fl_Color c) const {
|
||||
@@ -420,5 +420,5 @@ void Fl_Widget::draw_box(Fl_Boxtype t, int X, int Y, int W, int H, Fl_Color c) c
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_boxtype.cxx 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: fl_boxtype.cxx 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_color.cxx 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: fl_color.cxx 6813 2009-07-01 07:32:14Z AlbrechtS $"
|
||||
//
|
||||
// Color functions for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -484,5 +484,5 @@ Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg) {
|
||||
@}
|
||||
*/
|
||||
//
|
||||
// End of "$Id: fl_color.cxx 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: fl_color.cxx 6813 2009-07-01 07:32:14Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -241,7 +241,7 @@ fl_select_palette(void)
|
||||
fl_palette = CreatePalette(pPal);
|
||||
}
|
||||
if (fl_palette) {
|
||||
SelectPalette(fl_gc, fl_palette, false);
|
||||
SelectPalette(fl_gc, fl_palette, FALSE);
|
||||
RealizePalette(fl_gc);
|
||||
}
|
||||
return fl_palette;
|
||||
|
||||
@@ -434,14 +434,14 @@ public:
|
||||
// df->pFiles = sizeof(DROPFILES);
|
||||
// df->pt.x = 0;
|
||||
// df->pt.y = 0;
|
||||
// df->fNC = false;
|
||||
// df->fNC = FALSE;
|
||||
// for (int i = 0; i < fl_selection_length[0]; i++) {
|
||||
// if (fl_selection_buffer[0][i] == '\n') {
|
||||
// fl_selection_buffer[0][i] = '\0';
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// df->fWide = true;
|
||||
// df->fWide = TRUE;
|
||||
// l = fl_utf2unicode((unsigned char*)fl_selection_buffer[0],
|
||||
// fl_selection_length[0], (xchar*)(((char*)pMem)
|
||||
// + sizeof(DROPFILES)));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_draw.cxx 6735 2009-04-01 22:11:57Z engelsman $"
|
||||
// "$Id: fl_draw.cxx 6845 2009-08-28 20:14:41Z greg.ercolano $"
|
||||
//
|
||||
// Label drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -422,6 +422,31 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) {
|
||||
h = lines*h;
|
||||
}
|
||||
|
||||
/**
|
||||
This function returns the actual height of the specified \p font
|
||||
and \p size. Normally the font height should always be 'size',
|
||||
but with the advent of XFT, there are (currently) complexities
|
||||
that seem to only be solved by asking the font what its actual
|
||||
font height is. (See STR#2115)
|
||||
|
||||
This function was originally undocumented in 1.1.x, and was used
|
||||
only by Fl_Text_Display. We're now documenting it in 1.3.x so that
|
||||
apps that need precise height info can get it with this function.
|
||||
|
||||
\returns the height of the font in pixels.
|
||||
|
||||
\todo In the future, when the XFT issues are resolved, this function
|
||||
should simply return the 'size' value.
|
||||
*/
|
||||
int fl_height(int font, int size) {
|
||||
if ( font == fl_font() && size == fl_size() ) return(fl_height());
|
||||
int tf = fl_font(), ts = fl_size(); // save
|
||||
fl_font(font,size);
|
||||
int height = fl_height();
|
||||
fl_font(tf,ts); // restore
|
||||
return(height);
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_draw.cxx 6735 2009-04-01 22:11:57Z engelsman $".
|
||||
// End of "$Id: fl_draw.cxx 6845 2009-08-28 20:14:41Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_draw_image_win32.cxx 6616 2009-01-01 21:28:26Z matt $"
|
||||
// "$Id: fl_draw_image_win32.cxx 6844 2009-08-24 19:55:29Z AlbrechtS $"
|
||||
//
|
||||
// WIN32 image drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -115,8 +115,10 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
|
||||
int delta, int linedelta, int depth,
|
||||
Fl_Draw_Image_Cb cb, void* userdata)
|
||||
{
|
||||
char indexed = 0;
|
||||
|
||||
#if USE_COLORMAP
|
||||
char indexed = (fl_palette != 0);
|
||||
indexed = (fl_palette != 0);
|
||||
#endif
|
||||
|
||||
if (depth==0) depth = 3;
|
||||
@@ -319,5 +321,5 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_draw_image_win32.cxx 6616 2009-01-01 21:28:26Z matt $".
|
||||
// End of "$Id: fl_draw_image_win32.cxx 6844 2009-08-24 19:55:29Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -44,8 +44,8 @@ Fl_Font_Descriptor::Fl_Font_Descriptor(const char* name, Fl_Fontsize size) {
|
||||
fl_angle_*10, // base-line orientation angle
|
||||
weight,
|
||||
italic,
|
||||
false, // underline attribute flag
|
||||
false, // strikeout attribute flag
|
||||
FALSE, // underline attribute flag
|
||||
FALSE, // strikeout attribute flag
|
||||
DEFAULT_CHARSET, // character set identifier
|
||||
OUT_DEFAULT_PRECIS, // output precision
|
||||
CLIP_DEFAULT_PRECIS,// clipping precision
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_font_xft.cxx 6779 2009-04-24 09:28:30Z yuri $"
|
||||
// "$Id: fl_font_xft.cxx 6862 2009-09-13 10:15:42Z matt $"
|
||||
//
|
||||
// Xft font code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -635,5 +635,5 @@ void fl_rtl_draw(const char* c, int n, int x, int y) {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: fl_font_xft.cxx 6779 2009-04-24 09:28:30Z yuri $"
|
||||
// End of "$Id: fl_font_xft.cxx 6862 2009-09-13 10:15:42Z matt $"
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_open_uri.cxx 6641 2009-01-20 11:10:29Z fabien $"
|
||||
// "$Id: fl_open_uri.cxx 6901 2009-09-26 13:56:04Z matt $"
|
||||
//
|
||||
// fl_open_uri() code for FLTK.
|
||||
//
|
||||
@@ -117,9 +117,9 @@ fl_open_uri(const char *uri, char *msg, int msglen) {
|
||||
#elif defined(__APPLE__)
|
||||
char *argv[3]; // Command-line arguments
|
||||
|
||||
argv[0] = "open";
|
||||
argv[1] = (char *)uri;
|
||||
argv[2] = 0;
|
||||
argv[0] = (char*)"open";
|
||||
argv[1] = (char*)uri;
|
||||
argv[2] = (char*)0;
|
||||
|
||||
if (msg) snprintf(msg, msglen, "open %s", uri);
|
||||
|
||||
@@ -364,5 +364,5 @@ int main(int argc, char **argv) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: fl_open_uri.cxx 6641 2009-01-20 11:10:29Z fabien $".
|
||||
// End of "$Id: fl_open_uri.cxx 6901 2009-09-26 13:56:04Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_shortcut.cxx 6760 2009-04-13 11:32:58Z matt $"
|
||||
// "$Id: fl_shortcut.cxx 6878 2009-09-17 22:12:24Z matt $"
|
||||
//
|
||||
// Shortcut support routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -39,7 +39,7 @@
|
||||
// It also checks against the first character of Fl::event_text(),
|
||||
// and zero for FL_SHIFT means "don't care".
|
||||
// This allows punctuation shortcuts like "#" to work (rather than
|
||||
// calling it "shift+3")
|
||||
// calling it "shift+3" on a US keyboard)
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Widget.H>
|
||||
@@ -58,19 +58,12 @@
|
||||
be confused with
|
||||
Fl_Widget::test_shortcut().
|
||||
*/
|
||||
int Fl::test_shortcut(int shortcut) {
|
||||
int Fl::test_shortcut(Fl_Shortcut shortcut) {
|
||||
if (!shortcut) return 0;
|
||||
|
||||
int v = shortcut & 0xffff;
|
||||
#ifdef __APPLE__
|
||||
if (v > 32 && v < 0x7f || v >= 0x80 && v <= 0xff) {
|
||||
#else
|
||||
// most X11 use MSWindows Latin-1 if set to Western encoding, so 0x80 to 0xa0 are defined
|
||||
if (v > 32 && v < 0x7f || v >= 0x80 && v <= 0xff) {
|
||||
#endif
|
||||
if (isupper(v)) {
|
||||
shortcut |= FL_SHIFT;
|
||||
}
|
||||
Fl_Char v = shortcut & FL_KEY_MASK;
|
||||
if (fl_tolower(v)!=v) {
|
||||
shortcut |= FL_SHIFT;
|
||||
}
|
||||
|
||||
int shift = Fl::event_state();
|
||||
@@ -81,17 +74,18 @@ int Fl::test_shortcut(int shortcut) {
|
||||
// these three must always be correct:
|
||||
if (mismatch&(FL_META|FL_ALT|FL_CTRL)) return 0;
|
||||
|
||||
int key = shortcut & 0xffff;
|
||||
Fl_Char key = shortcut & FL_KEY_MASK;
|
||||
|
||||
// if shift is also correct, check for exactly equal keysyms:
|
||||
if (!(mismatch&(FL_SHIFT)) && key == Fl::event_key()) return 1;
|
||||
|
||||
// try matching ascii, ignore shift:
|
||||
if (key == event_text()[0]) return 1;
|
||||
// try matching utf8, ignore shift:
|
||||
Fl_Char firstChar = fl_utf8decode(Fl::event_text(), Fl::event_text()+Fl::event_length(), 0);
|
||||
if (key==firstChar) return 1;
|
||||
|
||||
// kludge so that Ctrl+'_' works (as opposed to Ctrl+'^_'):
|
||||
if ((shift&FL_CTRL) && key >= 0x3f && key <= 0x5F
|
||||
&& event_text()[0]==(key^0x40)) return 1;
|
||||
&& firstChar==(key^0x40)) return 1; // firstChar should be within a-z
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -180,7 +174,7 @@ static Keyname table[] = {
|
||||
\param [in] shortcut the integer value containing the ascii charcter or extended keystroke plus modifiers
|
||||
\return a pointer to a static buffer containing human readable text for the shortcut
|
||||
*/
|
||||
const char* fl_shortcut_label(int shortcut) {
|
||||
const char* fl_shortcut_label(Fl_Shortcut shortcut) {
|
||||
return fl_shortcut_label(shortcut, 0L);
|
||||
}
|
||||
|
||||
@@ -190,23 +184,17 @@ const char* fl_shortcut_label(int shortcut) {
|
||||
\param [in] shortcut the integer value containing the ascii charcter or extended keystroke plus modifiers
|
||||
\param [in] eom if this pointer is set, it will receive a pointer to the end of the modifier text
|
||||
\return a pointer to a static buffer containing human readable text for the shortcut
|
||||
\see fl_shortcut_label(int shortcut)
|
||||
\see fl_shortcut_label(Fl_Shortcut shortcut)
|
||||
*/
|
||||
const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom) {
|
||||
static char buf[20];
|
||||
char *p = buf;
|
||||
if (eom) *eom = p;
|
||||
if (!shortcut) {*p = 0; return buf;}
|
||||
// fix upper case shortcuts
|
||||
int v = shortcut & 0xffff;
|
||||
#ifdef __APPLE__
|
||||
if (v > 32 && v < 0x7f || v >= 0x80 && v <= 0xff) {
|
||||
#else
|
||||
if (v > 32 && v < 0x7f || v >= 0xa0 && v <= 0xff) {
|
||||
#endif
|
||||
if (isupper(v)) {
|
||||
shortcut |= FL_SHIFT;
|
||||
}
|
||||
Fl_Char v = shortcut & FL_KEY_MASK;
|
||||
if (fl_tolower(v)!=v) {
|
||||
shortcut |= FL_SHIFT;
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
// this column contains utf8 characters - v
|
||||
@@ -221,7 +209,7 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
if (shortcut & FL_CTRL) {strcpy(p,"Ctrl+"); p += 5;}
|
||||
#endif // __APPLE__
|
||||
if (eom) *eom = p;
|
||||
int key = shortcut & 0xFFFF;
|
||||
Fl_Char key = shortcut & FL_KEY_MASK;
|
||||
#if defined(WIN32) || defined(__APPLE__) // if not X
|
||||
if (key >= FL_F && key <= FL_F_Last) {
|
||||
*p++ = 'F';
|
||||
@@ -234,7 +222,7 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
while (a < b) {
|
||||
int c = (a+b)/2;
|
||||
if (table[c].key == key) {
|
||||
if (p > buf) {
|
||||
if (p > buf) {
|
||||
strcpy(p,table[c].name);
|
||||
return buf;
|
||||
} else {
|
||||
@@ -252,7 +240,7 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
*p++ = uchar(key & 127);
|
||||
} else {
|
||||
// if none found, use the keystroke as a match:
|
||||
*p++ = uchar(toupper(key & 255));
|
||||
p += fl_utf8encode(fl_toupper(key), p);
|
||||
}
|
||||
}
|
||||
*p = 0;
|
||||
@@ -262,7 +250,11 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
if (key == FL_Enter || key == '\r') q="Enter"; // don't use Xlib's "Return":
|
||||
else if (key > 32 && key < 0x100) q = 0;
|
||||
else q = XKeysymToString(key);
|
||||
if (!q) {*p++ = uchar(toupper(key & 255)); *p = 0; return buf;}
|
||||
if (!q) {
|
||||
p += fl_utf8encode(fl_toupper(key), p);
|
||||
*p = 0;
|
||||
return buf;
|
||||
}
|
||||
if (p > buf) {
|
||||
strcpy(p,q);
|
||||
return buf;
|
||||
@@ -278,9 +270,9 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
/**
|
||||
Emulation of XForms named shortcuts.
|
||||
*/
|
||||
int fl_old_shortcut(const char* s) {
|
||||
Fl_Shortcut fl_old_shortcut(const char* s) {
|
||||
if (!s || !*s) return 0;
|
||||
int n = 0;
|
||||
Fl_Shortcut n = 0;
|
||||
if (*s == '#') {n |= FL_ALT; s++;}
|
||||
if (*s == '+') {n |= FL_SHIFT; s++;}
|
||||
if (*s == '^') {n |= FL_CTRL; s++;}
|
||||
@@ -290,14 +282,14 @@ int fl_old_shortcut(const char* s) {
|
||||
|
||||
// Tests for &x shortcuts in button labels:
|
||||
|
||||
char Fl_Widget::label_shortcut(const char *t) {
|
||||
Fl_Shortcut Fl_Widget::label_shortcut(const char *t) {
|
||||
if (!t) return 0;
|
||||
for (;;) {
|
||||
if (*t==0) return 0;
|
||||
if (*t=='&') {
|
||||
char s = t[1];
|
||||
Fl_Shortcut s = fl_utf8decode(t+1, 0, 0);
|
||||
if (s==0) return 0;
|
||||
else if (s=='&') t++;
|
||||
else if (s==(Fl_Char)'&') t++;
|
||||
else return s;
|
||||
}
|
||||
t++;
|
||||
@@ -309,8 +301,9 @@ int Fl_Widget::test_shortcut(const char *t) {
|
||||
// on MSWindows, users expect shortcuts to work only when the Alt modifier is pressed
|
||||
if (Fl::event_state(FL_ALT)==0) return 0;
|
||||
#endif
|
||||
char c = Fl::event_text()[0];
|
||||
if (!c || !t) return 0;
|
||||
if (!t) return 0;
|
||||
Fl_Shortcut c = fl_utf8decode(Fl::event_text(), Fl::event_text()+Fl::event_length(), 0);
|
||||
if (!c) return 0;
|
||||
if (c == label_shortcut(t))
|
||||
return 1;
|
||||
return 0;
|
||||
@@ -322,5 +315,5 @@ int Fl_Widget::test_shortcut() {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_shortcut.cxx 6760 2009-04-13 11:32:58Z matt $".
|
||||
// End of "$Id: fl_shortcut.cxx 6878 2009-09-17 22:12:24Z matt $".
|
||||
//
|
||||
|
||||
@@ -138,11 +138,11 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
{
|
||||
unsigned char c = *(unsigned char*)p;
|
||||
if (c < 0x80) {
|
||||
*len = 1;
|
||||
if (len) *len = 1;
|
||||
return c;
|
||||
#if ERRORS_TO_CP1252
|
||||
} else if (c < 0xa0) {
|
||||
*len = 1;
|
||||
if (len) *len = 1;
|
||||
return cp1252[c-0x80];
|
||||
#endif
|
||||
} else if (c < 0xc2) {
|
||||
@@ -150,7 +150,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
}
|
||||
if (p+1 >= end || (p[1]&0xc0) != 0x80) goto FAIL;
|
||||
if (c < 0xe0) {
|
||||
*len = 2;
|
||||
if (len) *len = 2;
|
||||
return
|
||||
((p[0] & 0x1f) << 6) +
|
||||
((p[1] & 0x3f));
|
||||
@@ -171,7 +171,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
} else if (c < 0xf0) {
|
||||
UTF8_3:
|
||||
if (p+2 >= end || (p[2]&0xc0) != 0x80) goto FAIL;
|
||||
*len = 3;
|
||||
if (len) *len = 3;
|
||||
return
|
||||
((p[0] & 0x0f) << 12) +
|
||||
((p[1] & 0x3f) << 6) +
|
||||
@@ -182,7 +182,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
} else if (c < 0xf4) {
|
||||
UTF8_4:
|
||||
if (p+3 >= end || (p[2]&0xc0) != 0x80 || (p[3]&0xc0) != 0x80) goto FAIL;
|
||||
*len = 4;
|
||||
if (len) *len = 4;
|
||||
#if STRICT_RFC3629
|
||||
/* RFC 3629 says all codes ending in fffe or ffff are illegal: */
|
||||
if ((p[1]&0xf)==0xf &&
|
||||
@@ -199,7 +199,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
goto UTF8_4;
|
||||
} else {
|
||||
FAIL:
|
||||
*len = 1;
|
||||
if (len) *len = 1;
|
||||
#if ERRORS_TO_ISO8859_1
|
||||
return c;
|
||||
#else
|
||||
|
||||
@@ -58,7 +58,7 @@ static fl_gmi_func fl_gmi = NULL; // used to get a proc pointer for GetMonitorIn
|
||||
static RECT screens[16];
|
||||
|
||||
static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM) {
|
||||
if (num_screens >= 16) return true;
|
||||
if (num_screens >= 16) return TRUE;
|
||||
|
||||
MONITORINFO mi;
|
||||
mi.cbSize = sizeof(mi);
|
||||
@@ -69,7 +69,7 @@ static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM) {
|
||||
screens[num_screens] = mi.rcWork;
|
||||
num_screens ++;
|
||||
}
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void screen_init() {
|
||||
|
||||
Reference in New Issue
Block a user