Ajouts de musique et irrKlang.

This commit is contained in:
Marc-Eric Martel
2021-10-19 10:27:59 -04:00
parent 167548dfc2
commit df3441dad6
778 changed files with 73920 additions and 13 deletions

View File

@@ -0,0 +1,428 @@
//
// "$Id: Enumerations.H 4288 2005-04-16 00:13:17Z mike $"
//
// Enumerations for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Enumerations_H
#define Fl_Enumerations_H
# include "Fl_Export.H"
//
// The FLTK version number; this is changed slightly from the beta versions
// because the old "const double" definition would not allow for conditional
// compilation...
//
// FL_VERSION is a double that describes the major and minor version numbers.
// Version 1.1 is actually stored as 1.01 to allow for more than 9 minor
// releases.
//
// The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants
// give the integral values for the major, minor, and patch releases
// respectively.
//
#define FL_MAJOR_VERSION 1
#define FL_MINOR_VERSION 1
#define FL_PATCH_VERSION 7
#define FL_VERSION ((double)FL_MAJOR_VERSION + \
(double)FL_MINOR_VERSION * 0.01 + \
(double)FL_PATCH_VERSION * 0.0001)
typedef unsigned char uchar;
typedef unsigned long ulong;
enum Fl_Event { // events
FL_NO_EVENT = 0,
FL_PUSH = 1,
FL_RELEASE = 2,
FL_ENTER = 3,
FL_LEAVE = 4,
FL_DRAG = 5,
FL_FOCUS = 6,
FL_UNFOCUS = 7,
FL_KEYDOWN = 8,
FL_KEYUP = 9,
FL_CLOSE = 10,
FL_MOVE = 11,
FL_SHORTCUT = 12,
FL_DEACTIVATE = 13,
FL_ACTIVATE = 14,
FL_HIDE = 15,
FL_SHOW = 16,
FL_PASTE = 17,
FL_SELECTIONCLEAR = 18,
FL_MOUSEWHEEL = 19,
FL_DND_ENTER = 20,
FL_DND_DRAG = 21,
FL_DND_LEAVE = 22,
FL_DND_RELEASE = 23
};
#define FL_KEYBOARD FL_KEYDOWN
enum Fl_When { // Fl_Widget::when():
FL_WHEN_NEVER = 0,
FL_WHEN_CHANGED = 1,
FL_WHEN_RELEASE = 4,
FL_WHEN_RELEASE_ALWAYS= 6,
FL_WHEN_ENTER_KEY = 8,
FL_WHEN_ENTER_KEY_ALWAYS=10,
FL_WHEN_ENTER_KEY_CHANGED=11,
FL_WHEN_NOT_CHANGED = 2 // modifier bit to disable changed() test
};
// Fl::event_key() and Fl::get_key(n) (use ascii letters for all other keys):
#define FL_Button 0xfee8 // use Fl_Button+FL_*_MOUSE
#define FL_BackSpace 0xff08
#define FL_Tab 0xff09
#define FL_Enter 0xff0d
#define FL_Pause 0xff13
#define FL_Scroll_Lock 0xff14
#define FL_Escape 0xff1b
#define FL_Home 0xff50
#define FL_Left 0xff51
#define FL_Up 0xff52
#define FL_Right 0xff53
#define FL_Down 0xff54
#define FL_Page_Up 0xff55
#define FL_Page_Down 0xff56
#define FL_End 0xff57
#define FL_Print 0xff61
#define FL_Insert 0xff63
#define FL_Menu 0xff67 // the "menu/apps" key on XFree86
#define FL_Help 0xff68 // the 'help' key on Mac keyboards
#define FL_Num_Lock 0xff7f
#define FL_KP 0xff80 // use FL_KP+'x' for 'x' on numeric keypad
#define FL_KP_Enter 0xff8d // same as Fl_KP+'\r'
#define FL_KP_Last 0xffbd // use to range-check keypad
#define FL_F 0xffbd // use FL_F+n for function key n
#define FL_F_Last 0xffe0 // use to range-check function keys
#define FL_Shift_L 0xffe1
#define FL_Shift_R 0xffe2
#define FL_Control_L 0xffe3
#define FL_Control_R 0xffe4
#define FL_Caps_Lock 0xffe5
#define FL_Meta_L 0xffe7 // the left MSWindows key on XFree86
#define FL_Meta_R 0xffe8 // the right MSWindows key on XFree86
#define FL_Alt_L 0xffe9
#define FL_Alt_R 0xffea
#define FL_Delete 0xffff
// Fl::event_button():
#define FL_LEFT_MOUSE 1
#define FL_MIDDLE_MOUSE 2
#define FL_RIGHT_MOUSE 3
// Fl::event_state():
#define FL_SHIFT 0x00010000
#define FL_CAPS_LOCK 0x00020000
#define FL_CTRL 0x00040000
#define FL_ALT 0x00080000
#define FL_NUM_LOCK 0x00100000 // most X servers do this?
#define FL_META 0x00400000 // correct for XFree86
#define FL_SCROLL_LOCK 0x00800000 // correct for XFree86
#define FL_BUTTON1 0x01000000
#define FL_BUTTON2 0x02000000
#define FL_BUTTON3 0x04000000
#define FL_BUTTONS 0x7f000000 // All possible buttons
#define FL_BUTTON(n) (0x00800000<<(n))
#ifdef __APPLE__
# define FL_COMMAND FL_META
#else
# define FL_COMMAND FL_CTRL
#endif // __APPLE__
enum Fl_Boxtype { // boxtypes (if you change these you must fix fl_boxtype.C):
FL_NO_BOX = 0, FL_FLAT_BOX,
FL_UP_BOX, FL_DOWN_BOX,
FL_UP_FRAME, FL_DOWN_FRAME,
FL_THIN_UP_BOX, FL_THIN_DOWN_BOX,
FL_THIN_UP_FRAME, FL_THIN_DOWN_FRAME,
FL_ENGRAVED_BOX, FL_EMBOSSED_BOX,
FL_ENGRAVED_FRAME, FL_EMBOSSED_FRAME,
FL_BORDER_BOX, _FL_SHADOW_BOX,
FL_BORDER_FRAME, _FL_SHADOW_FRAME,
_FL_ROUNDED_BOX, _FL_RSHADOW_BOX,
_FL_ROUNDED_FRAME, _FL_RFLAT_BOX,
_FL_ROUND_UP_BOX, _FL_ROUND_DOWN_BOX,
_FL_DIAMOND_UP_BOX, _FL_DIAMOND_DOWN_BOX,
_FL_OVAL_BOX, _FL_OSHADOW_BOX,
_FL_OVAL_FRAME, _FL_OFLAT_BOX,
_FL_PLASTIC_UP_BOX, _FL_PLASTIC_DOWN_BOX,
_FL_PLASTIC_UP_FRAME, _FL_PLASTIC_DOWN_FRAME,
_FL_PLASTIC_THIN_UP_BOX, _FL_PLASTIC_THIN_DOWN_BOX,
_FL_PLASTIC_ROUND_UP_BOX, _FL_PLASTIC_ROUND_DOWN_BOX,
FL_FREE_BOXTYPE
};
extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUND_UP_BOX();
#define FL_ROUND_UP_BOX fl_define_FL_ROUND_UP_BOX()
#define FL_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_ROUND_UP_BOX()+1)
extern FL_EXPORT Fl_Boxtype fl_define_FL_SHADOW_BOX();
#define FL_SHADOW_BOX fl_define_FL_SHADOW_BOX()
#define FL_SHADOW_FRAME (Fl_Boxtype)(fl_define_FL_SHADOW_BOX()+2)
extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUNDED_BOX();
#define FL_ROUNDED_BOX fl_define_FL_ROUNDED_BOX()
#define FL_ROUNDED_FRAME (Fl_Boxtype)(fl_define_FL_ROUNDED_BOX()+2)
extern FL_EXPORT Fl_Boxtype fl_define_FL_RFLAT_BOX();
#define FL_RFLAT_BOX fl_define_FL_RFLAT_BOX()
extern FL_EXPORT Fl_Boxtype fl_define_FL_RSHADOW_BOX();
#define FL_RSHADOW_BOX fl_define_FL_RSHADOW_BOX()
extern FL_EXPORT Fl_Boxtype fl_define_FL_DIAMOND_BOX();
#define FL_DIAMOND_UP_BOX fl_define_FL_DIAMOND_BOX()
#define FL_DIAMOND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_DIAMOND_BOX()+1)
extern FL_EXPORT Fl_Boxtype fl_define_FL_OVAL_BOX();
#define FL_OVAL_BOX fl_define_FL_OVAL_BOX()
#define FL_OSHADOW_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+1)
#define FL_OVAL_FRAME (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+2)
#define FL_OFLAT_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+3)
extern FL_EXPORT Fl_Boxtype fl_define_FL_PLASTIC_UP_BOX();
#define FL_PLASTIC_UP_BOX fl_define_FL_PLASTIC_UP_BOX()
#define FL_PLASTIC_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+1)
#define FL_PLASTIC_UP_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+2)
#define FL_PLASTIC_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+3)
#define FL_PLASTIC_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+4)
#define FL_PLASTIC_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+5)
#define FL_PLASTIC_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+6)
#define FL_PLASTIC_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+7)
// conversions of box types to other boxtypes:
inline Fl_Boxtype fl_down(Fl_Boxtype b) {return (Fl_Boxtype)(b|1);}
inline Fl_Boxtype fl_frame(Fl_Boxtype b) {return (Fl_Boxtype)(b|2);}
// back-compatability box types:
#define FL_FRAME FL_ENGRAVED_FRAME
#define FL_FRAME_BOX FL_ENGRAVED_BOX
#define FL_CIRCLE_BOX FL_ROUND_DOWN_BOX
#define FL_DIAMOND_BOX FL_DIAMOND_DOWN_BOX
enum Fl_Labeltype { // labeltypes:
FL_NORMAL_LABEL = 0,
FL_NO_LABEL,
_FL_SHADOW_LABEL,
_FL_ENGRAVED_LABEL,
_FL_EMBOSSED_LABEL,
_FL_MULTI_LABEL,
_FL_ICON_LABEL,
_FL_IMAGE_LABEL,
FL_FREE_LABELTYPE
};
#define FL_SYMBOL_LABEL FL_NORMAL_LABEL
extern Fl_Labeltype FL_EXPORT fl_define_FL_SHADOW_LABEL();
#define FL_SHADOW_LABEL fl_define_FL_SHADOW_LABEL()
extern Fl_Labeltype FL_EXPORT fl_define_FL_ENGRAVED_LABEL();
#define FL_ENGRAVED_LABEL fl_define_FL_ENGRAVED_LABEL()
extern Fl_Labeltype FL_EXPORT fl_define_FL_EMBOSSED_LABEL();
#define FL_EMBOSSED_LABEL fl_define_FL_EMBOSSED_LABEL()
enum Fl_Align { // align() values
FL_ALIGN_CENTER = 0,
FL_ALIGN_TOP = 1,
FL_ALIGN_BOTTOM = 2,
FL_ALIGN_LEFT = 4,
FL_ALIGN_RIGHT = 8,
FL_ALIGN_INSIDE = 16,
FL_ALIGN_TEXT_OVER_IMAGE = 32,
FL_ALIGN_IMAGE_OVER_TEXT = 0,
FL_ALIGN_CLIP = 64,
FL_ALIGN_WRAP = 128,
FL_ALIGN_TOP_LEFT = FL_ALIGN_TOP | FL_ALIGN_LEFT,
FL_ALIGN_TOP_RIGHT = FL_ALIGN_TOP | FL_ALIGN_RIGHT,
FL_ALIGN_BOTTOM_LEFT = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT,
FL_ALIGN_BOTTOM_RIGHT = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT,
FL_ALIGN_LEFT_TOP = FL_ALIGN_TOP_LEFT,
FL_ALIGN_RIGHT_TOP = FL_ALIGN_TOP_RIGHT,
FL_ALIGN_LEFT_BOTTOM = FL_ALIGN_BOTTOM_LEFT,
FL_ALIGN_RIGHT_BOTTOM = FL_ALIGN_BOTTOM_RIGHT,
FL_ALIGN_NOWRAP = 0 // for back compatability
};
enum Fl_Font { // standard fonts
FL_HELVETICA = 0,
FL_HELVETICA_BOLD,
FL_HELVETICA_ITALIC,
FL_HELVETICA_BOLD_ITALIC,
FL_COURIER,
FL_COURIER_BOLD,
FL_COURIER_ITALIC,
FL_COURIER_BOLD_ITALIC,
FL_TIMES,
FL_TIMES_BOLD,
FL_TIMES_ITALIC,
FL_TIMES_BOLD_ITALIC,
FL_SYMBOL,
FL_SCREEN,
FL_SCREEN_BOLD,
FL_ZAPF_DINGBATS,
FL_FREE_FONT = 16, // first one to allocate
FL_BOLD = 1, // add this to helvetica, courier, or times
FL_ITALIC = 2 // add this to helvetica, courier, or times
};
extern FL_EXPORT int FL_NORMAL_SIZE;
enum Fl_Color { // standard colors
// These are used as default colors in widgets and altered as necessary
FL_FOREGROUND_COLOR = 0,
FL_BACKGROUND2_COLOR = 7,
FL_INACTIVE_COLOR = 8,
FL_SELECTION_COLOR = 15,
// 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'
// 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,
FL_DARK_GREEN = 60,
FL_DARK_YELLOW = 76,
FL_DARK_BLUE = 136,
FL_DARK_MAGENTA = 152,
FL_DARK_CYAN = 140,
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
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); }
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);
}
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);}
enum Fl_Cursor { // standard cursors
FL_CURSOR_DEFAULT = 0,
FL_CURSOR_ARROW = 35,
FL_CURSOR_CROSS = 66,
FL_CURSOR_WAIT = 76,
FL_CURSOR_INSERT = 77,
FL_CURSOR_HAND = 31,
FL_CURSOR_HELP = 47,
FL_CURSOR_MOVE = 27,
// fltk provides bitmaps for these:
FL_CURSOR_NS = 78,
FL_CURSOR_WE = 79,
FL_CURSOR_NWSE = 80,
FL_CURSOR_NESW = 81,
FL_CURSOR_NONE = 255,
// for back compatability (non MSWindows ones):
FL_CURSOR_N = 70,
FL_CURSOR_NE = 69,
FL_CURSOR_E = 49,
FL_CURSOR_SE = 8,
FL_CURSOR_S = 9,
FL_CURSOR_SW = 7,
FL_CURSOR_W = 36,
FL_CURSOR_NW = 68
//FL_CURSOR_NS = 22,
//FL_CURSOR_WE = 55,
};
enum { // values for "when" passed to Fl::add_fd()
FL_READ = 1,
FL_WRITE = 4,
FL_EXCEPT = 8
};
enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut)
FL_RGB = 0,
FL_INDEX = 1,
FL_SINGLE = 0,
FL_DOUBLE = 2,
FL_ACCUM = 4,
FL_ALPHA = 8,
FL_DEPTH = 16,
FL_STENCIL = 32,
FL_RGB8 = 64,
FL_MULTISAMPLE= 128,
FL_STEREO = 256,
FL_FAKE_SINGLE = 512 // Fake single buffered windows using double-buffer
};
// damage masks
enum Fl_Damage {
FL_DAMAGE_CHILD = 0x01,
FL_DAMAGE_EXPOSE = 0x02,
FL_DAMAGE_SCROLL = 0x04,
FL_DAMAGE_OVERLAY = 0x08,
FL_DAMAGE_USER1 = 0x10,
FL_DAMAGE_USER2 = 0x20,
FL_DAMAGE_ALL = 0x80
};
// FLTK 1.0.x compatibility definitions...
# ifdef FLTK_1_0_COMPAT
# define contrast fl_contrast
# define down fl_down
# define frame fl_frame
# define inactive fl_inactive
# endif // FLTK_1_0_COMPAT
#endif
//
// End of "$Id: Enumerations.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,280 @@
//
// "$Id: Fl.H 4223 2005-03-31 16:01:24Z mike $"
//
// Main header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_H
# define Fl_H
# include "Enumerations.H"
# ifndef Fl_Object
# define Fl_Object Fl_Widget
# endif
# ifdef check
# undef check
# endif
class Fl_Widget;
class Fl_Window;
class Fl_Image;
struct Fl_Label;
typedef void (Fl_Label_Draw_F)(const Fl_Label*, int,int,int,int, Fl_Align);
typedef void (Fl_Label_Measure_F)(const Fl_Label*, int&, int&);
typedef void (Fl_Box_Draw_F)(int,int,int,int, Fl_Color);
typedef void (*Fl_Timeout_Handler)(void*);
class FL_EXPORT Fl {
Fl() {}; // no constructor!
public: // should be private!
static int e_number;
static int e_x;
static int e_y;
static int e_x_root;
static int e_y_root;
static int e_dx;
static int e_dy;
static int e_state;
static int e_clicks;
static int e_is_click;
static int e_keysym;
static char* e_text;
static int e_length;
static Fl_Widget* belowmouse_;
static Fl_Widget* pushed_;
static Fl_Widget* focus_;
static int damage_;
static Fl_Widget* selection_owner_;
static Fl_Window* modal_;
static Fl_Window* grab_;
static int compose_state;
static int visible_focus_;
static int dnd_text_ops_;
static void damage(int d) {damage_ = d;}
static void (*idle)();
static const char* scheme_;
static Fl_Image* scheme_bg_;
public:
// API version number
static double version();
// argument parsers:
static int arg(int, char**, int&);
static int args(int, char**, int&, int (*)(int,char**,int&) = 0);
static const char* const help;
static void args(int, char**);
// things called by initialization:
static void display(const char*);
static int visual(int);
static int gl_visual(int, int *alist=0);
static void own_colormap();
static void get_system_colors();
static void foreground(uchar, uchar, uchar);
static void background(uchar, uchar, uchar);
static void background2(uchar, uchar, uchar);
// schemes:
static int scheme(const char*);
static const char* scheme() {return scheme_;}
static int reload_scheme();
// execution:
static int wait();
static double wait(double time);
static int check();
static int ready();
static int run();
static Fl_Widget* readqueue();
static void add_timeout(double t, Fl_Timeout_Handler,void* = 0);
static void repeat_timeout(double t, Fl_Timeout_Handler,void* = 0);
static int has_timeout(Fl_Timeout_Handler, void* = 0);
static void remove_timeout(Fl_Timeout_Handler, void* = 0);
static void add_check(Fl_Timeout_Handler, void* = 0);
static int has_check(Fl_Timeout_Handler, void* = 0);
static void remove_check(Fl_Timeout_Handler, void* = 0);
static void add_fd(int fd, int when, void (*cb)(int,void*),void* =0);
static void add_fd(int fd, void (*cb)(int, void*), void* = 0);
static void remove_fd(int, int when);
static void remove_fd(int);
static void add_idle(void (*cb)(void*), void* = 0);
static int has_idle(void (*cb)(void*), void* = 0);
static void remove_idle(void (*cb)(void*), void* = 0);
static int damage() {return damage_;}
static void redraw();
static void flush();
static void (*warning)(const char*, ...);
static void (*error)(const char*, ...);
static void (*fatal)(const char*, ...);
static Fl_Window* first_window();
static void first_window(Fl_Window*);
static Fl_Window* next_window(const Fl_Window*);
static Fl_Window* modal() {return modal_;}
static Fl_Window* grab() {return grab_;}
static void grab(Fl_Window*);
// event information:
static int event() {return e_number;}
static int event_x() {return e_x;}
static int event_y() {return e_y;}
static int event_x_root() {return e_x_root;}
static int event_y_root() {return e_y_root;}
static int event_dx() {return e_dx;}
static int event_dy() {return e_dy;}
static void get_mouse(int &,int &);
static int event_clicks() {return e_clicks;}
static void event_clicks(int i) {e_clicks = i;}
static int event_is_click() {return e_is_click;}
static void event_is_click(int i) {e_is_click = i;} // only 0 works!
static int event_button() {return e_keysym-FL_Button;}
static int event_state() {return e_state;}
static int event_state(int i) {return e_state&i;}
static int event_key() {return e_keysym;}
static int event_key(int);
static int get_key(int);
static const char* event_text() {return e_text;}
static int event_length() {return e_length;}
static int compose(int &del);
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);
// event destinations:
static int handle(int, Fl_Window*);
static Fl_Widget* belowmouse() {return belowmouse_;}
static void belowmouse(Fl_Widget*);
static Fl_Widget* pushed() {return pushed_;}
static void pushed(Fl_Widget*);
static Fl_Widget* focus() {return focus_;}
static void focus(Fl_Widget*);
static void add_handler(int (*h)(int));
static void remove_handler(int (*h)(int));
// cut/paste:
static void copy(const char* stuff, int len, int clipboard = 0);
static void paste(Fl_Widget &receiver, int clipboard /*=0*/);
static int dnd();
// These are for back-compatability only:
static Fl_Widget* selection_owner() {return selection_owner_;}
static void selection_owner(Fl_Widget*);
static void selection(Fl_Widget &owner, const char*, int len);
static void paste(Fl_Widget &receiver);
// screen size:
#if defined(WIN32) || defined(__APPLE__)
static int x();
static int y();
#else
static int x() {return 0;}
static int y() {return 0;}
#endif /* WIN32 || __APPLE__ */
static int w();
static int h();
// multi-head support:
static int screen_count();
static void screen_xywh(int &x, int &y, int &w, int &h) {
screen_xywh(x, y, w, h, e_x_root, e_y_root);
}
static void screen_xywh(int &x, int &y, int &w, int &h, int mx, int my);
static void screen_xywh(int &x, int &y, int &w, int &h, int n);
// color map:
static void set_color(Fl_Color, uchar, uchar, uchar);
static void set_color(Fl_Color, unsigned);
static unsigned get_color(Fl_Color);
static void get_color(Fl_Color, uchar&, uchar&, uchar&);
static void free_color(Fl_Color, int overlay = 0);
// fonts:
static const char* get_font(Fl_Font);
static const char* get_font_name(Fl_Font, int* attributes = 0);
static int get_font_sizes(Fl_Font, int*& sizep);
static void set_font(Fl_Font, const char*);
static void set_font(Fl_Font, Fl_Font);
static Fl_Font set_fonts(const char* = 0);
// labeltypes:
static void set_labeltype(Fl_Labeltype,Fl_Label_Draw_F*,Fl_Label_Measure_F*);
static void set_labeltype(Fl_Labeltype, Fl_Labeltype from);
// boxtypes:
static Fl_Box_Draw_F *get_boxtype(Fl_Boxtype);
static void set_boxtype(Fl_Boxtype, Fl_Box_Draw_F*,uchar,uchar,uchar,uchar);
static void set_boxtype(Fl_Boxtype, Fl_Boxtype from);
static int box_dx(Fl_Boxtype);
static int box_dy(Fl_Boxtype);
static int box_dw(Fl_Boxtype);
static int box_dh(Fl_Boxtype);
static int draw_box_active();
// back compatability:
static void set_abort(void (*f)(const char*,...)) {fatal = f;}
static void (*atclose)(Fl_Window*,void*);
static void default_atclose(Fl_Window*,void*);
static void set_atclose(void (*f)(Fl_Window*,void*)) {atclose = f;}
static int event_shift() {return e_state&FL_SHIFT;}
static int event_ctrl() {return e_state&FL_CTRL;}
static int event_alt() {return e_state&FL_ALT;}
static int event_buttons() {return e_state&0x7f000000;}
static int event_button1() {return e_state&FL_BUTTON1;}
static int event_button2() {return e_state&FL_BUTTON2;}
static int event_button3() {return e_state&FL_BUTTON3;}
static void set_idle(void (*cb)()) {idle = cb;}
static void grab(Fl_Window&win) {grab(&win);}
static void release() {grab(0);}
// Visible focus methods...
static void visible_focus(int v) { visible_focus_ = v; }
static int visible_focus() { return visible_focus_; }
// Drag-n-drop text operation methods...
static void dnd_text_ops(int v) { dnd_text_ops_ = v; }
static int dnd_text_ops() { return dnd_text_ops_; }
// Multithreading support:
static void lock();
static void unlock();
static void awake(void* message = 0);
static void* thread_message();
// Widget deletion:
static void delete_widget(Fl_Widget *w);
static void do_widget_deletion();
};
#endif // !Fl_H
//
// End of "$Id: Fl.H 4223 2005-03-31 16:01:24Z mike $".
//

View File

@@ -0,0 +1,55 @@
//
// "$Id: Fl_Adjuster.H 4288 2005-04-16 00:13:17Z mike $"
//
// Adjuster widget header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// 3-button "slider", made for Nuke
#ifndef Fl_Adjuster_H
#define Fl_Adjuster_H
#ifndef Fl_Valuator_H
#include "Fl_Valuator.H"
#endif
class FL_EXPORT Fl_Adjuster : public Fl_Valuator {
int drag;
int ix;
int soft_;
protected:
void draw();
int handle(int);
void value_damage();
public:
Fl_Adjuster(int X,int Y,int W,int H,const char *l=0);
void soft(int s) {soft_ = s;}
int soft() const {return soft_;}
};
#endif
//
// End of "$Id: Fl_Adjuster.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_BMP_Image.H 4288 2005-04-16 00:13:17Z mike $"
//
// BMP image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_BMP_Image_H
#define Fl_BMP_Image_H
# include "Fl_Image.H"
class FL_EXPORT Fl_BMP_Image : public Fl_RGB_Image {
public:
Fl_BMP_Image(const char* filename);
};
#endif
//
// End of "$Id: Fl_BMP_Image.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,64 @@
//
// "$Id: Fl_Bitmap.H 4288 2005-04-16 00:13:17Z mike $"
//
// Bitmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Bitmap_H
#define Fl_Bitmap_H
# include "Fl_Image.H"
class Fl_Widget;
struct Fl_Menu_Item;
class FL_EXPORT Fl_Bitmap : public Fl_Image {
public:
const uchar *array;
int alloc_array; // Non-zero if data was allocated
#if defined(__APPLE__) || defined(WIN32)
void *id; // for internal use
#else
unsigned id; // for internal use
#endif // __APPLE__ || WIN32
Fl_Bitmap(const uchar *bits, int W, int H) :
Fl_Image(W,H,0), array(bits), alloc_array(0), id(0) {data((const char **)&array, 1);}
Fl_Bitmap(const char *bits, int W, int H) :
Fl_Image(W,H,0), array((const uchar *)bits), alloc_array(0), id(0) {data((const char **)&array, 1);}
virtual ~Fl_Bitmap();
virtual Fl_Image *copy(int W, int H);
Fl_Image *copy() { return copy(w(), h()); }
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
virtual void label(Fl_Widget*w);
virtual void label(Fl_Menu_Item*m);
virtual void uncache();
};
#endif
//
// End of "$Id: Fl_Bitmap.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,51 @@
//
// "$Id: Fl_Box.H 4288 2005-04-16 00:13:17Z mike $"
//
// Box header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Box_H
#define Fl_Box_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
class FL_EXPORT Fl_Box : public Fl_Widget {
protected:
void draw();
public:
Fl_Box(int X, int Y, int W, int H, const char *l=0)
: Fl_Widget(X,Y,W,H,l) {}
Fl_Box(Fl_Boxtype b, int X, int Y, int W, int H, const char *l)
: Fl_Widget(X,Y,W,H,l) {box(b);}
virtual int handle(int);
};
#endif
//
// End of "$Id: Fl_Box.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,132 @@
//
// "$Id: Fl_Browser.H 4288 2005-04-16 00:13:17Z mike $"
//
// Browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// Forms-compatable browser. Probably useful for other
// lists of textual data. Notice that the line numbers
// start from 1, and 0 means "no line".
#ifndef Fl_Browser_H
#define Fl_Browser_H
#include "Fl_Browser_.H"
struct FL_BLINE;
class FL_EXPORT Fl_Browser : public Fl_Browser_ {
FL_BLINE *first; // the array of lines
FL_BLINE *last;
FL_BLINE *cache;
int cacheline; // line number of cache
int lines; // Number of lines
int full_height_;
const int* column_widths_;
char format_char_; // alternative to @-sign
char column_char_; // alternative to tab
protected:
// required routines for Fl_Browser_ subclass:
void* item_first() const ;
void* item_next(void*) const ;
void* item_prev(void*) const ;
int item_selected(void*) const ;
void item_select(void*, int);
int item_height(void*) const ;
int item_width(void*) const ;
void item_draw(void*, int, int, int, int) const ;
int full_height() const ;
int incr_height() const ;
FL_BLINE* find_line(int) const ;
FL_BLINE* _remove(int) ;
void insert(int, FL_BLINE*);
int lineno(void*) const ;
void swap(FL_BLINE *a, FL_BLINE *b);
public:
void remove(int);
void add(const char*, void* = 0);
void insert(int, const char*, void* = 0);
void move(int to, int from);
int load(const char* filename);
void swap(int a, int b);
void clear();
int size() const {return lines;}
void size(int W, int H) { Fl_Widget::size(W, H); }
int topline() const ;
enum Fl_Line_Position { TOP, BOTTOM, MIDDLE };
void lineposition(int, Fl_Line_Position);
void topline(int l) { lineposition(l, TOP); }
void bottomline(int l) { lineposition(l, BOTTOM); }
void middleline(int l) { lineposition(l, MIDDLE); }
int select(int, int=1);
int selected(int) const ;
void show(int n);
void show() {Fl_Widget::show();}
void hide(int n);
void hide() {Fl_Widget::hide();}
int visible(int n) const ;
int value() const ;
void value(int v) {select(v);}
const char* text(int) const ;
void text(int, const char*);
void* data(int) const ;
void data(int, void* v);
Fl_Browser(int, int, int, int, const char* = 0);
~Fl_Browser() { clear(); }
char format_char() const {return format_char_;}
void format_char(char c) {format_char_ = c;}
char column_char() const {return column_char_;}
void column_char(char c) {column_char_ = c;}
const int* column_widths() const {return column_widths_;}
void column_widths(const int* l) {column_widths_ = l;}
int displayed(int n) const {return Fl_Browser_::displayed(find_line(n));}
void make_visible(int n) {
if (n < 1) Fl_Browser_::display(find_line(1));
else if (n > lines) Fl_Browser_::display(find_line(lines));
else Fl_Browser_::display(find_line(n));
}
// for back compatability only:
void replace(int a, const char* b) {text(a, b);}
void display(int, int=1);
};
#endif
//
// End of "$Id: Fl_Browser.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,153 @@
//
// "$Id: Fl_Browser_.H 4288 2005-04-16 00:13:17Z mike $"
//
// Common browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// This is the base class for browsers. To be useful it must
// be subclassed and several virtual functions defined. The
// Forms-compatable browser and the file chooser's browser are
// subclassed off of this.
// Yes, I know this should be a template...
#ifndef Fl_Browser__H
#define Fl_Browser__H
#ifndef Fl_Group_H
#include "Fl_Group.H"
#endif
#include "Fl_Scrollbar.H"
#define FL_NORMAL_BROWSER 0
#define FL_SELECT_BROWSER 1
#define FL_HOLD_BROWSER 2
#define FL_MULTI_BROWSER 3
class FL_EXPORT Fl_Browser_ : public Fl_Group {
int position_; // where user wants it scrolled to
int real_position_; // the current vertical scrolling position
int hposition_; // where user wants it panned to
int real_hposition_; // the current horizontal scrolling position
int offset_; // how far down top_ item the real_position is
int max_width; // widest object seen so far
uchar has_scrollbar_; // which scrollbars are enabled
uchar textfont_, textsize_;
unsigned 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
void* max_width_item; // which item has max_width_
static int scrollbar_width_;
void update_top();
protected:
// All of the following must be supplied by the subclass:
virtual void *item_first() const = 0;
virtual void *item_next(void *) const = 0;
virtual void *item_prev(void *) const = 0;
virtual int item_height(void *) const = 0;
virtual int item_width(void *) const = 0;
virtual int item_quick_height(void *) const ;
virtual void item_draw(void *,int,int,int,int) const = 0;
// you don't have to provide these but it may help speed it up:
virtual int full_width() const ; // current width of all items
virtual int full_height() const ; // current height of all items
virtual int incr_height() const ; // average height of an item
// These only need to be done by subclass if you want a multi-browser:
virtual void item_select(void *,int=1);
virtual int item_selected(void *) const ;
// things the subclass may want to call:
void *top() const {return top_;}
void *selection() const {return selection_;}
void new_list(); // completely clobber all data, as though list replaced
void deleting(void *a); // get rid of any pointers to a
void replacing(void *a,void *b); // change a pointers to b
void inserting(void *a,void *b); // insert b near a
int displayed(void *) const ; // true if this line is visible
void redraw_line(void *); // minimal update, no change in size
void redraw_lines() {damage(FL_DAMAGE_SCROLL);} // redraw all of them
void bbox(int&,int&,int&,int&) const;
int leftedge() const; // x position after scrollbar & border
void *find_item(int my); // item under mouse
void draw(int,int,int,int);
int handle(int,int,int,int,int);
void draw();
Fl_Browser_(int,int,int,int,const char * = 0);
public:
Fl_Scrollbar scrollbar; // Vertical scrollbar
Fl_Scrollbar hscrollbar; // Horizontal scrollbar
int handle(int);
void resize(int,int,int,int);
int select(void *,int=1,int docallbacks=0);
int select_only(void *,int docallbacks=0);
int deselect(int docallbacks=0);
int position() const {return position_;}
int hposition() const {return hposition_;}
void position(int); // scroll to here
void hposition(int); // pan to here
void display(void*); // scroll so this item is shown
uchar has_scrollbar() const {return has_scrollbar_;}
void has_scrollbar(uchar i) {has_scrollbar_ = i;}
enum { // values for has_scrollbar()
HORIZONTAL = 1,
VERTICAL = 2,
BOTH = 3,
ALWAYS_ON = 4,
HORIZONTAL_ALWAYS = 5,
VERTICAL_ALWAYS = 6,
BOTH_ALWAYS = 7
};
Fl_Font textfont() const {return (Fl_Font)textfont_;}
void textfont(uchar s) {textfont_ = s;}
uchar textsize() const {return textsize_;}
void textsize(uchar s) {textsize_ = s;}
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
void textcolor(unsigned n) {textcolor_ = n;}
static void scrollbar_width(int b) {scrollbar_width_ = b;}
static int scrollbar_width() {return scrollbar_width_;}
// for back compatability:
void scrollbar_right() {scrollbar.align(FL_ALIGN_RIGHT);}
void scrollbar_left() {scrollbar.align(FL_ALIGN_LEFT);}
};
#endif
//
// End of "$Id: Fl_Browser_.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,78 @@
//
// "$Id: Fl_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Button_H
#define Fl_Button_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
// values for type()
#define FL_NORMAL_BUTTON 0
#define FL_TOGGLE_BUTTON 1
#define FL_RADIO_BUTTON (FL_RESERVED_TYPE+2)
#define FL_HIDDEN_BUTTON 3 // for Forms compatability
extern FL_EXPORT int fl_old_shortcut(const char*);
class FL_EXPORT Fl_Button : public Fl_Widget {
int shortcut_;
char value_;
char oldval;
uchar down_box_;
protected:
virtual void draw();
public:
virtual int handle(int);
Fl_Button(int,int,int,int,const char * = 0);
int value(int);
char value() const {return value_;}
int set() {return value(1);}
int clear() {return value(0);}
void setonly(); // this should only be called on FL_RADIO_BUTTONs
int shortcut() const {return shortcut_;}
void shortcut(int s) {shortcut_ = s;}
Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
void down_box(Fl_Boxtype b) {down_box_ = b;}
// back compatability:
void shortcut(const char *s) {shortcut(fl_old_shortcut(s));}
Fl_Color down_color() const {return selection_color();}
void down_color(unsigned c) {selection_color(c);}
};
#endif
//
// End of "$Id: Fl_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,93 @@
//
// "$Id: Fl_Chart.H 4288 2005-04-16 00:13:17Z mike $"
//
// Forms chart header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Chart_H
#define Fl_Chart_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
// values for type()
#define FL_BAR_CHART 0
#define FL_HORBAR_CHART 1
#define FL_LINE_CHART 2
#define FL_FILL_CHART 3
#define FL_SPIKE_CHART 4
#define FL_PIE_CHART 5
#define FL_SPECIALPIE_CHART 6
#define FL_FILLED_CHART FL_FILL_CHART // compatibility
#define FL_CHART_MAX 128
#define FL_CHART_LABEL_MAX 18
struct FL_CHART_ENTRY {
float val;
unsigned col;
char str[FL_CHART_LABEL_MAX+1];
};
class FL_EXPORT Fl_Chart : public Fl_Widget {
int numb;
int maxnumb;
int sizenumb;
FL_CHART_ENTRY *entries;
double min,max;
uchar autosize_;
uchar textfont_,textsize_;
unsigned textcolor_;
protected:
void draw();
public:
Fl_Chart(int,int,int,int,const char * = 0);
~Fl_Chart();
void clear();
void add(double, const char * =0, unsigned=0);
void insert(int, double, const char * =0, unsigned=0);
void replace(int, double, const char * =0, unsigned=0);
void bounds(double *a,double *b) const {*a = min; *b = max;}
void bounds(double a,double b);
int size() const {return numb;}
void size(int W, int H) { Fl_Widget::size(W, H); }
int maxsize() const {return maxnumb;}
void maxsize(int);
Fl_Font textfont() const {return (Fl_Font)textfont_;}
void textfont(uchar s) {textfont_ = s;}
uchar textsize() const {return textsize_;}
void textsize(uchar s) {textsize_ = s;}
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
void textcolor(unsigned n) {textcolor_ = n;}
uchar autosize() const {return autosize_;}
void autosize(uchar n) {autosize_ = n;}
};
#endif
//
// End of "$Id: Fl_Chart.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,98 @@
//
// "$Id: Fl_Check_Browser.H 4461 2005-08-05 13:31:02Z dejan $"
//
// Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Check_Browser_H
#define Fl_Check_Browser_H
#include "Fl.H"
#include "Fl_Browser_.H"
class FL_EXPORT Fl_Check_Browser : public Fl_Browser_ {
/* required routines for Fl_Browser_ subclass: */
void *item_first() const;
void *item_next(void *) const;
void *item_prev(void *) const;
int item_height(void *) const;
int item_width(void *) const;
void item_draw(void *, int, int, int, int) const;
void item_select(void *, int);
int item_selected(void *) const;
/* private data */
public: // IRIX 5.3 C++ compiler doesn't support private structures...
struct cb_item {
cb_item *next;
cb_item *prev;
char checked;
char selected;
char *text;
};
private:
cb_item *first;
cb_item *last;
cb_item *cache;
int cached_item;
int nitems_;
int nchecked_;
cb_item *find_item(int) const;
int lineno(cb_item *) const;
public:
Fl_Check_Browser(int x, int y, int w, int h, const char *l = 0);
~Fl_Check_Browser() { clear(); }
int add(char *s); // add an (unchecked) item
int add(char *s, int b); // add an item and set checked
// both return the new nitems()
// inline const char * methods to avoid breaking binary compatibility...
int add(const char *s) { return add((char *)s); }
int add(const char *s, int b) { return add((char *)s, b); }
void clear(); // delete all items
int nitems() const { return nitems_; }
int nchecked() const { return nchecked_; }
int checked(int item) const;
void checked(int item, int b);
void set_checked(int item) { checked(item, 1); }
void check_all();
void check_none();
int value() const; // currently selected item
char *text(int item) const; // returns pointer to internal buffer
};
#endif // Fl_Check_Browser_H
//
// End of "$Id: Fl_Check_Browser.H 4461 2005-08-05 13:31:02Z dejan $".
//

View File

@@ -0,0 +1,42 @@
//
// "$Id: Fl_Check_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Check button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Check_Button_H
#define Fl_Check_Button_H
#include "Fl_Light_Button.H"
class FL_EXPORT Fl_Check_Button : public Fl_Light_Button {
public:
Fl_Check_Button(int x,int y,int w,int h,const char *l = 0);
};
#endif
//
// End of "$Id: Fl_Check_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,48 @@
//
// "$Id: Fl_Choice.H 4288 2005-04-16 00:13:17Z mike $"
//
// Choice header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Choice_H
#define Fl_Choice_H
#include "Fl_Menu_.H"
class FL_EXPORT Fl_Choice : public Fl_Menu_ {
protected:
void draw();
public:
int handle(int);
Fl_Choice(int,int,int,int,const char * = 0);
int value(const Fl_Menu_Item*);
int value(int i);
int value() const {return Fl_Menu_::value();}
};
#endif
//
// End of "$Id: Fl_Choice.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,75 @@
//
// "$Id: Fl_Clock.H 4288 2005-04-16 00:13:17Z mike $"
//
// Clock header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Clock_H
#define Fl_Clock_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
// values for type:
#define FL_SQUARE_CLOCK 0
#define FL_ROUND_CLOCK 1
#define FL_ANALOG_CLOCK FL_SQUARE_CLOCK
#define FL_DIGITAL_CLOCK FL_SQUARE_CLOCK // nyi
// a Fl_Clock_Output can be used to display a program-supplied time:
class FL_EXPORT Fl_Clock_Output : public Fl_Widget {
int hour_, minute_, second_;
ulong value_;
void drawhands(Fl_Color,Fl_Color); // part of draw
protected:
void draw(int, int, int, int);
void draw();
public:
Fl_Clock_Output(int x,int y,int w,int h, const char *l = 0);
void value(ulong v); // set to this Unix time
void value(int,int,int); // set hour, minute, second
ulong value() const {return value_;}
int hour() const {return hour_;}
int minute() const {return minute_;}
int second() const {return second_;}
};
// a Fl_Clock displays the current time always by using a timeout:
class FL_EXPORT Fl_Clock : public Fl_Clock_Output {
public:
int handle(int);
void update();
Fl_Clock(int x,int y,int w,int h, const char *l = 0);
Fl_Clock(uchar t,int x,int y,int w,int h, const char *l);
~Fl_Clock();
};
#endif
//
// End of "$Id: Fl_Clock.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,104 @@
//
// "$Id: Fl_Color_Chooser.H 4288 2005-04-16 00:13:17Z mike $"
//
// Color chooser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// The color chooser object and the color chooser popup. The popup
// is just a window containing a single color chooser and some boxes
// to indicate the current and cancelled color.
#ifndef Fl_Color_Chooser_H
#define Fl_Color_Chooser_H
#include <FL/Fl_Group.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Return_Button.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Value_Input.H>
class FL_EXPORT Flcc_HueBox : public Fl_Widget {
int px, py;
protected:
void draw();
int handle_key(int);
public:
int handle(int);
Flcc_HueBox(int X, int Y, int W, int H) : Fl_Widget(X,Y,W,H) {
px = py = 0;}
};
class FL_EXPORT Flcc_ValueBox : public Fl_Widget {
int py;
protected:
void draw();
int handle_key(int);
public:
int handle(int);
Flcc_ValueBox(int X, int Y, int W, int H) : Fl_Widget(X,Y,W,H) {
py = 0;}
};
class FL_EXPORT Flcc_Value_Input : public Fl_Value_Input {
public:
int format(char*);
Flcc_Value_Input(int X, int Y, int W, int H) : Fl_Value_Input(X,Y,W,H) {}
};
class FL_EXPORT Fl_Color_Chooser : public Fl_Group {
Flcc_HueBox huebox;
Flcc_ValueBox valuebox;
Fl_Choice choice;
Flcc_Value_Input rvalue;
Flcc_Value_Input gvalue;
Flcc_Value_Input bvalue;
Fl_Box resize_box;
double hue_, saturation_, value_;
double r_, g_, b_;
void set_valuators();
static void rgb_cb(Fl_Widget*, void*);
static void mode_cb(Fl_Widget*, void*);
public:
int mode() {return choice.value();}
double hue() const {return hue_;}
double saturation() const {return saturation_;}
double value() const {return value_;}
double r() const {return r_;}
double g() const {return g_;}
double b() const {return b_;}
int hsv(double,double,double);
int rgb(double,double,double);
static void hsv2rgb(double, double, double,double&,double&,double&);
static void rgb2hsv(double, double, double,double&,double&,double&);
Fl_Color_Chooser(int,int,int,int,const char* = 0);
};
FL_EXPORT int fl_color_chooser(const char* name, double& r, double& g, double& b);
FL_EXPORT int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b);
#endif
//
// End of "$Id: Fl_Color_Chooser.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,76 @@
//
// "$Id: Fl_Counter.H 4288 2005-04-16 00:13:17Z mike $"
//
// Counter header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// A numerical value with up/down step buttons. From Forms.
#ifndef Fl_Counter_H
#define Fl_Counter_H
#ifndef Fl_Valuator_H
#include "Fl_Valuator.H"
#endif
// values for type():
#define FL_NORMAL_COUNTER 0
#define FL_SIMPLE_COUNTER 1
class FL_EXPORT Fl_Counter : public Fl_Valuator {
uchar textfont_, textsize_;
unsigned textcolor_;
double lstep_;
uchar mouseobj;
static void repeat_callback(void *);
int calc_mouseobj();
void increment_cb();
protected:
void draw();
public:
int handle(int);
Fl_Counter(int,int,int,int,const char * = 0);
~Fl_Counter();
void lstep(double a) {lstep_ = a;}
void step(double a,double b) {Fl_Valuator::step(a); lstep_ = b;}
void step(double a) {Fl_Valuator::step(a);}
Fl_Font textfont() const {return (Fl_Font)textfont_;}
void textfont(uchar s) {textfont_ = s;}
uchar textsize() const {return textsize_;}
void textsize(uchar s) {textsize_ = s;}
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
void textcolor(unsigned s) {textcolor_ = s;}
};
#endif
//
// End of "$Id: Fl_Counter.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,67 @@
//
// "$Id: Fl_Dial.H 4288 2005-04-16 00:13:17Z mike $"
//
// Dial header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Dial_H
#define Fl_Dial_H
#ifndef Fl_Valuator_H
#include "Fl_Valuator.H"
#endif
// values for type():
#define FL_NORMAL_DIAL 0
#define FL_LINE_DIAL 1
#define FL_FILL_DIAL 2
class FL_EXPORT Fl_Dial : public Fl_Valuator {
short a1,a2;
protected:
// these allow subclasses to put the dial in a smaller area:
void draw(int, int, int, int);
int handle(int, int, int, int, int);
void draw();
public:
int handle(int);
Fl_Dial(int x,int y,int w,int h, const char *l = 0);
short angle1() const {return a1;}
void angle1(short a) {a1 = a;}
short angle2() const {return a2;}
void angle2(short a) {a2 = a;}
void angles(short a, short b) {a1 = a; a2 = b;}
};
#endif
//
// End of "$Id: Fl_Dial.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,54 @@
//
// "$Id: Fl_Double_Window.H 4288 2005-04-16 00:13:17Z mike $"
//
// Double-buffered window header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Double_Window_H
#define Fl_Double_Window_H
#include "Fl_Window.H"
class FL_EXPORT Fl_Double_Window : public Fl_Window {
protected:
void flush(int eraseoverlay);
char force_doublebuffering_; // force db, even if the OS already buffers windows (overlays need that on MacOS and Windows2000)
public:
void show();
void show(int a, char **b) {Fl_Window::show(a,b);}
void flush();
void resize(int,int,int,int);
void hide();
~Fl_Double_Window();
Fl_Double_Window(int W, int H, const char *l = 0)
: Fl_Window(W,H,l), force_doublebuffering_(0) { type(FL_DOUBLE_WINDOW); }
Fl_Double_Window(int X, int Y, int W, int H, const char *l = 0)
: Fl_Window(X,Y,W,H,l), force_doublebuffering_(0) { type(FL_DOUBLE_WINDOW); }
};
#endif
//
// End of "$Id: Fl_Double_Window.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,49 @@
/*
* "$Id: Fl_Export.H 4288 2005-04-16 00:13:17Z mike $"
*
* WIN32 DLL export definitions for the Fast Light Tool Kit (FLTK).
*
* Copyright 1998-2005 by Bill Spitzak and others.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Please report all bugs and problems on the following page:
*
* http://www.fltk.org/str.php
*/
#ifndef Fl_Export_H
# define Fl_Export_H
/*
* The following is only used when building DLLs under WIN32...
*/
# if defined(FL_DLL) && (defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) || __GNUC__ >= 3)
# ifdef FL_LIBRARY
# define FL_EXPORT __declspec(dllexport)
# else
# define FL_EXPORT __declspec(dllimport)
# endif /* FL_LIBRARY */
# else
# define FL_EXPORT
# endif /* FL_DLL */
#endif /* !Fl_Export_H */
/*
* End of "$Id: Fl_Export.H 4288 2005-04-16 00:13:17Z mike $".
*/

View File

@@ -0,0 +1,81 @@
//
// "$Id: Fl_File_Browser.H 4288 2005-04-16 00:13:17Z mike $"
//
// FileBrowser definitions.
//
// Copyright 1999-2005 by Michael Sweet.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
//
// Include necessary header files...
//
#ifndef _Fl_File_Browser_H_
# define _Fl_File_Browser_H_
# include "Fl_Browser.H"
# include "Fl_File_Icon.H"
# include "filename.H"
//
// Fl_File_Browser class...
//
class FL_EXPORT Fl_File_Browser : public Fl_Browser
{
int filetype_;
const char *directory_;
uchar iconsize_;
const char *pattern_;
int full_height() const;
int item_height(void *) const;
int item_width(void *) const;
void item_draw(void *, int, int, int, int) const;
int incr_height() const { return (item_height(0)); }
public:
enum { FILES, DIRECTORIES };
Fl_File_Browser(int, int, int, int, const char * = 0);
uchar iconsize() const { return (iconsize_); };
void iconsize(uchar s) { iconsize_ = s; redraw(); };
void filter(const char *pattern);
const char *filter() const { return (pattern_); };
int load(const char *directory, Fl_File_Sort_F *sort = fl_numericsort);
uchar textsize() const { return (Fl_Browser::textsize()); };
void textsize(uchar s) { Fl_Browser::textsize(s); iconsize_ = (uchar)(3 * s / 2); };
int filetype() const { return (filetype_); };
void filetype(int t) { filetype_ = t; };
};
#endif // !_Fl_File_Browser_H_
//
// End of "$Id: Fl_File_Browser.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,186 @@
//
// "$Id: Fl_File_Chooser.H 4473 2005-08-08 00:50:02Z mike $"
//
// Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// generated by Fast Light User Interface Designer (fluid) version 1.0107
#ifndef Fl_File_Chooser_H
#define Fl_File_Chooser_H
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <FL/Fl_Group.H>
#include <FL/Fl_Choice.H>
#include <FL/Fl_Menu_Button.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Preferences.H>
#include <FL/Fl_Tile.H>
#include <FL/Fl_File_Browser.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Check_Button.H>
#include <FL/Fl_File_Input.H>
#include <FL/Fl_Return_Button.H>
#include <FL/fl_ask.H>
class FL_EXPORT Fl_File_Chooser {
public:
enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 };
private:
static Fl_Preferences prefs_;
void (*callback_)(Fl_File_Chooser*, void *);
void *data_;
char directory_[1024];
char pattern_[1024];
char preview_text_[2048];
int type_;
void favoritesButtonCB();
void favoritesCB(Fl_Widget *w);
void fileListCB();
void fileNameCB();
void newdir();
static void previewCB(Fl_File_Chooser *fc);
void showChoiceCB();
void update_favorites();
void update_preview();
public:
Fl_File_Chooser(const char *d, const char *p, int t, const char *title);
private:
Fl_Double_Window *window;
void cb_window_i(Fl_Double_Window*, void*);
static void cb_window(Fl_Double_Window*, void*);
Fl_Choice *showChoice;
void cb_showChoice_i(Fl_Choice*, void*);
static void cb_showChoice(Fl_Choice*, void*);
Fl_Menu_Button *favoritesButton;
void cb_favoritesButton_i(Fl_Menu_Button*, void*);
static void cb_favoritesButton(Fl_Menu_Button*, void*);
public:
Fl_Button *newButton;
private:
void cb_newButton_i(Fl_Button*, void*);
static void cb_newButton(Fl_Button*, void*);
void cb__i(Fl_Tile*, void*);
static void cb_(Fl_Tile*, void*);
Fl_File_Browser *fileList;
void cb_fileList_i(Fl_File_Browser*, void*);
static void cb_fileList(Fl_File_Browser*, void*);
Fl_Box *previewBox;
public:
Fl_Check_Button *previewButton;
private:
void cb_previewButton_i(Fl_Check_Button*, void*);
static void cb_previewButton(Fl_Check_Button*, void*);
Fl_File_Input *fileName;
void cb_fileName_i(Fl_File_Input*, void*);
static void cb_fileName(Fl_File_Input*, void*);
Fl_Return_Button *okButton;
void cb_okButton_i(Fl_Return_Button*, void*);
static void cb_okButton(Fl_Return_Button*, void*);
Fl_Button *cancelButton;
void cb_cancelButton_i(Fl_Button*, void*);
static void cb_cancelButton(Fl_Button*, void*);
Fl_Double_Window *favWindow;
Fl_File_Browser *favList;
void cb_favList_i(Fl_File_Browser*, void*);
static void cb_favList(Fl_File_Browser*, void*);
Fl_Button *favUpButton;
void cb_favUpButton_i(Fl_Button*, void*);
static void cb_favUpButton(Fl_Button*, void*);
Fl_Button *favDeleteButton;
void cb_favDeleteButton_i(Fl_Button*, void*);
static void cb_favDeleteButton(Fl_Button*, void*);
Fl_Button *favDownButton;
void cb_favDownButton_i(Fl_Button*, void*);
static void cb_favDownButton(Fl_Button*, void*);
Fl_Button *favCancelButton;
void cb_favCancelButton_i(Fl_Button*, void*);
static void cb_favCancelButton(Fl_Button*, void*);
Fl_Return_Button *favOkButton;
void cb_favOkButton_i(Fl_Return_Button*, void*);
static void cb_favOkButton(Fl_Return_Button*, void*);
public:
~Fl_File_Chooser();
void callback(void (*cb)(Fl_File_Chooser *, void *), void *d = 0);
void color(Fl_Color c);
Fl_Color color();
int count();
void directory(const char *d);
char * directory();
void filter(const char *p);
const char * filter();
int filter_value();
void filter_value(int f);
void hide();
void iconsize(uchar s);
uchar iconsize();
void label(const char *l);
const char * label();
void ok_label(const char *l);
const char * ok_label();
void preview(int e);
int preview() const { return previewButton->value(); };
void rescan();
void show();
int shown();
void textcolor(Fl_Color c);
Fl_Color textcolor();
void textfont(uchar f);
uchar textfont();
void textsize(uchar s);
uchar textsize();
void type(int t);
int type();
void * user_data() const;
void user_data(void *d);
const char *value(int f = 1);
void value(const char *filename);
int visible();
static const char *add_favorites_label;
static const char *all_files_label;
static const char *custom_filter_label;
static const char *existing_file_label;
static const char *favorites_label;
static const char *filename_label;
static const char *filesystems_label;
static const char *manage_favorites_label;
static const char *new_directory_label;
static const char *new_directory_tooltip;
static const char *preview_label;
static const char *save_label;
static const char *show_label;
static Fl_File_Sort_F *sort;
};
FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname,int relative=0);
FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname,int relative=0);
FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));
FL_EXPORT void fl_file_chooser_ok_label(const char*l);
#endif
//
// End of "$Id: Fl_File_Chooser.H 4473 2005-08-08 00:50:02Z mike $".
//

View File

@@ -0,0 +1,115 @@
//
// "$Id: Fl_File_Icon.H 4288 2005-04-16 00:13:17Z mike $"
//
// Fl_File_Icon definitions.
//
// Copyright 1999-2005 by Michael Sweet.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
//
// Include necessary header files...
//
#ifndef _Fl_Fl_File_Icon_H_
# define _Fl_Fl_File_Icon_H_
# include "Fl.H"
//
// Special color value for the icon color.
//
# define FL_ICON_COLOR (Fl_Color)0xffffffff
//
// Fl_File_Icon class...
//
class FL_EXPORT Fl_File_Icon //// Icon data
{
static Fl_File_Icon *first_; // Pointer to first icon/filetype
Fl_File_Icon *next_; // Pointer to next icon/filetype
const char *pattern_; // Pattern string
int type_; // Match only if directory or file?
int num_data_; // Number of data elements
int alloc_data_; // Number of allocated elements
short *data_; // Icon data
public:
enum // File types
{
ANY, // Any kind of file
PLAIN, // Only plain files
FIFO, // Only named pipes
DEVICE, // Only character and block devices
LINK, // Only symbolic links
DIRECTORY // Only directories
};
enum // Data opcodes
{
END, // End of primitive/icon
COLOR, // Followed by color value (2 shorts)
LINE, // Start of line
CLOSEDLINE, // Start of closed line
POLYGON, // Start of polygon
OUTLINEPOLYGON, // Followed by outline color (2 shorts)
VERTEX // Followed by scaled X,Y
};
Fl_File_Icon(const char *p, int t, int nd = 0, short *d = 0);
~Fl_File_Icon();
short *add(short d);
short *add_color(Fl_Color c)
{ short *d = add((short)COLOR); add((short)(c >> 16)); add((short)c); return (d); }
short *add_vertex(int x, int y)
{ short *d = add((short)VERTEX); add((short)x); add((short)y); return (d); }
short *add_vertex(float x, float y)
{ short *d = add((short)VERTEX); add((short)(x * 10000.0));
add((short)(y * 10000.0)); return (d); }
void clear() { num_data_ = 0; }
void draw(int x, int y, int w, int h, Fl_Color ic, int active = 1);
void label(Fl_Widget *w);
static void labeltype(const Fl_Label *o, int x, int y, int w, int h, Fl_Align a);
void load(const char *f);
int load_fti(const char *fti);
int load_image(const char *i);
Fl_File_Icon *next() { return (next_); }
const char *pattern() { return (pattern_); }
int size() { return (num_data_); }
int type() { return (type_); }
short *value() { return (data_); }
static Fl_File_Icon *find(const char *filename, int filetype = ANY);
static Fl_File_Icon *first() { return (first_); }
static void load_system_icons(void);
};
#endif // !_Fl_Fl_File_Icon_H_
//
// End of "$Id: Fl_File_Icon.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,68 @@
//
// "$Id: Fl_File_Input.H 4288 2005-04-16 00:13:17Z mike $"
//
// File_Input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
// Original version Copyright 1998 by Curtis Edwards.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_File_Input_H
# define Fl_File_Input_H
# include <FL/Fl_Input.H>
class FL_EXPORT Fl_File_Input : public Fl_Input
{
Fl_Color errorcolor_;
char ok_entry_;
uchar down_box_;
short buttons_[200];
short pressed_;
void draw_buttons();
int handle_button(int event);
void update_buttons();
public:
Fl_File_Input(int,int,int,int,const char *t=0);
virtual int handle(int);
virtual void draw();
Fl_Boxtype down_box() const { return (Fl_Boxtype)down_box_; }
void down_box(Fl_Boxtype b) { down_box_ = b; }
Fl_Color errorcolor() const { return errorcolor_; }
void errorcolor(Fl_Color c) { errorcolor_ = c; }
int value(const char*);
int value(const char*, int);
const char *value() { return Fl_Input_::value(); }
};
#endif // !Fl_File_Input_H
//
// End of "$Id: Fl_File_Input.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Fill_Dial.H 4288 2005-04-16 00:13:17Z mike $"
//
// Filled dial header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Fill_Dial_H
#define Fl_Fill_Dial_H
#include "Fl_Dial.H"
class Fl_Fill_Dial : public Fl_Dial {
public:
Fl_Fill_Dial(int x,int y,int w,int h, const char *l = 0)
: Fl_Dial(x,y,w,h,l) {type(FL_FILL_DIAL);}
};
#endif
//
// End of "$Id: Fl_Fill_Dial.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Fill_Slider.H 4288 2005-04-16 00:13:17Z mike $"
//
// Filled slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Fill_Slider_H
#define Fl_Fill_Slider_H
#include "Fl_Slider.H"
class Fl_Fill_Slider : public Fl_Slider {
public:
Fl_Fill_Slider(int x,int y,int w,int h,const char *l=0)
: Fl_Slider(x,y,w,h,l) {type(FL_VERT_FILL_SLIDER);}
};
#endif
//
// End of "$Id: Fl_Fill_Slider.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Float_Input.H 4288 2005-04-16 00:13:17Z mike $"
//
// Floating point input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Float_Input_H
#define Fl_Float_Input_H
#include "Fl_Input.H"
class Fl_Float_Input : public Fl_Input {
public:
Fl_Float_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(X,Y,W,H,l) {type(FL_FLOAT_INPUT);}
};
#endif
//
// End of "$Id: Fl_Float_Input.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,48 @@
//
// "$Id: Fl_FormsBitmap.H 4288 2005-04-16 00:13:17Z mike $"
//
// Forms bitmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_FormsBitmap_H
#define Fl_FormsBitmap_H
#include "Fl_Bitmap.H"
class FL_EXPORT Fl_FormsBitmap : public Fl_Widget {
Fl_Bitmap *b;
protected:
void draw();
public:
Fl_FormsBitmap(Fl_Boxtype, int, int, int, int, const char * = 0);
void set(int W, int H, const uchar *bits);
void bitmap(Fl_Bitmap *B) {b = B;}
Fl_Bitmap *bitmap() const {return b;}
};
#endif
//
// End of "$Id: Fl_FormsBitmap.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,48 @@
//
// "$Id: Fl_FormsPixmap.H 4288 2005-04-16 00:13:17Z mike $"
//
// Forms pixmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_FormsPixmap_H
#define Fl_FormsPixmap_H
#include "Fl_Pixmap.H"
class FL_EXPORT Fl_FormsPixmap : public Fl_Widget {
Fl_Pixmap *b;
protected:
void draw();
public:
Fl_FormsPixmap(Fl_Boxtype, int, int, int, int, const char * = 0);
void set(/*const*/char * const * bits);
void Pixmap(Fl_Pixmap *B) {b = B;}
Fl_Pixmap *Pixmap() const {return b;}
};
#endif
//
// End of "$Id: Fl_FormsPixmap.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,66 @@
//
// "$Id: Fl_Free.H 4288 2005-04-16 00:13:17Z mike $"
//
// Forms free header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Free_H
#define Fl_Free_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
#define FL_NORMAL_FREE 1
#define FL_SLEEPING_FREE 2
#define FL_INPUT_FREE 3
#define FL_CONTINUOUS_FREE 4
#define FL_ALL_FREE 5
typedef int (*FL_HANDLEPTR)(Fl_Widget *, int , float, float, char);
class FL_EXPORT Fl_Free : public Fl_Widget {
FL_HANDLEPTR hfunc;
static void step(void *);
protected:
void draw();
public:
int handle(int);
Fl_Free(uchar t,int x,int y,int w,int h,const char *l,FL_HANDLEPTR hdl);
~Fl_Free();
};
// old event names for compatability:
#define FL_MOUSE FL_DRAG
#define FL_DRAW 100 // NOT USED
#define FL_STEP 101
#define FL_FREEMEM 102 // NOT USED
#define FL_FREEZE 103 // NOT USED
#define FL_THAW 104 // NOT USED
#endif
//
// End of "$Id: Fl_Free.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_GIF_Image.H 4288 2005-04-16 00:13:17Z mike $"
//
// GIF image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_GIF_Image_H
#define Fl_GIF_Image_H
# include "Fl_Pixmap.H"
class FL_EXPORT Fl_GIF_Image : public Fl_Pixmap {
public:
Fl_GIF_Image(const char* filename);
};
#endif
//
// End of "$Id: Fl_GIF_Image.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,96 @@
//
// "$Id: Fl_Gl_Window.H 4288 2005-04-16 00:13:17Z mike $"
//
// OpenGL header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Gl_Window_H
#define Fl_Gl_Window_H
#include "Fl_Window.H"
#ifndef GLContext
typedef void* GLContext; // actually a GLXContext or HGLDC
#endif
class Fl_Gl_Choice; // structure to hold result of glXChooseVisual
class FL_EXPORT Fl_Gl_Window : public Fl_Window {
int mode_;
const int *alist;
Fl_Gl_Choice *g;
GLContext context_;
char valid_;
char damage1_; // damage() of back buffer
virtual void draw_overlay();
void init();
void *overlay;
void make_overlay();
friend class _Fl_Gl_Overlay;
static int can_do(int, const int *);
int mode(int, const int *);
public:
void show();
void show(int a, char **b) {Fl_Window::show(a,b);}
void flush();
void hide();
void resize(int,int,int,int);
char valid() const {return valid_;}
void valid(char v) {valid_ = v;}
void invalidate();
static int can_do(int m) {return can_do(m,0);}
static int can_do(const int *m) {return can_do(0, m);}
int can_do() {return can_do(mode_,alist);}
Fl_Mode mode() const {return (Fl_Mode)mode_;}
int mode(int a) {return mode(a,0);}
int mode(const int *a) {return mode(0, a);}
void* context() const {return context_;}
void context(void*, int destroy_flag = 0);
void make_current();
void swap_buffers();
void ortho();
int can_do_overlay();
void redraw_overlay();
void hide_overlay();
void make_overlay_current();
~Fl_Gl_Window();
Fl_Gl_Window(int W, int H, const char *l=0) : Fl_Window(W,H,l) {init();}
Fl_Gl_Window(int X, int Y, int W, int H, const char *l=0)
: Fl_Window(X,Y,W,H,l) {init();}
};
#endif
//
// End of "$Id: Fl_Gl_Window.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,107 @@
//
// "$Id: Fl_Group.H 4421 2005-07-15 09:34:53Z matt $"
//
// Group header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Group_H
#define Fl_Group_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
class FL_EXPORT Fl_Group : public Fl_Widget {
Fl_Widget** array_;
Fl_Widget* savedfocus_;
Fl_Widget* resizable_;
int children_;
short *sizes_; // remembered initial sizes of children
int navigation(int);
static Fl_Group *current_;
// unimplemented copy ctor and assignment operator
Fl_Group(const Fl_Group&);
Fl_Group& operator=(const Fl_Group&);
protected:
void draw();
void draw_child(Fl_Widget&) const;
void draw_children();
void draw_outside_label(const Fl_Widget&) const ;
void update_child(Fl_Widget&) const;
short* sizes();
public:
int handle(int);
void begin();
void end();
static Fl_Group *current();
static void current(Fl_Group *g);
int children() const {return children_;}
Fl_Widget* child(int n) const {return array()[n];}
int find(const Fl_Widget*) const;
int find(const Fl_Widget& o) const {return find(&o);}
Fl_Widget* const* array() const;
void resize(int,int,int,int);
Fl_Group(int,int,int,int, const char * = 0);
virtual ~Fl_Group();
void add(Fl_Widget&);
void add(Fl_Widget* o) {add(*o);}
void insert(Fl_Widget&, int i);
void insert(Fl_Widget& o, Fl_Widget* before) {insert(o,find(before));}
void remove(Fl_Widget&);
void remove(Fl_Widget* o) {remove(*o);}
void clear();
void resizable(Fl_Widget& o) {resizable_ = &o;}
void resizable(Fl_Widget* o) {resizable_ = o;}
Fl_Widget* resizable() const {return resizable_;}
void add_resizable(Fl_Widget& o) {resizable_ = &o; add(o);}
void init_sizes();
// back compatability function:
void focus(Fl_Widget* o) {o->take_focus();}
Fl_Widget* & _ddfdesign_kludge() {return resizable_;}
void forms_end();
};
// dummy class used to end child groups in constructors for complex
// subclasses of Fl_Group:
class FL_EXPORT Fl_End {
public:
Fl_End() {Fl_Group::current()->end();}
};
#endif
//
// End of "$Id: Fl_Group.H 4421 2005-07-15 09:34:53Z matt $".
//

View File

@@ -0,0 +1,93 @@
//
// "$Id: Fl_Help_Dialog.H 4582 2005-09-25 16:54:40Z matt $"
//
// Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// generated by Fast Light User Interface Designer (fluid) version 1.0107
#ifndef Fl_Help_Dialog_H
#define Fl_Help_Dialog_H
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Help_View.H>
#include <FL/Fl_Group.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Input.H>
class FL_EXPORT Fl_Help_Dialog {
int index_;
int max_;
int line_[100];
char file_[100][256];
int find_pos_;
public:
Fl_Help_Dialog();
private:
Fl_Double_Window *window_;
Fl_Help_View *view_;
void cb_view__i(Fl_Help_View*, void*);
static void cb_view_(Fl_Help_View*, void*);
void cb_Close_i(Fl_Button*, void*);
static void cb_Close(Fl_Button*, void*);
Fl_Button *back_;
void cb_back__i(Fl_Button*, void*);
static void cb_back_(Fl_Button*, void*);
Fl_Button *forward_;
void cb_forward__i(Fl_Button*, void*);
static void cb_forward_(Fl_Button*, void*);
Fl_Button *smaller_;
void cb_smaller__i(Fl_Button*, void*);
static void cb_smaller_(Fl_Button*, void*);
Fl_Button *larger_;
void cb_larger__i(Fl_Button*, void*);
static void cb_larger_(Fl_Button*, void*);
Fl_Input *find_;
void cb_find__i(Fl_Input*, void*);
static void cb_find_(Fl_Input*, void*);
public:
~Fl_Help_Dialog();
int h();
void hide();
void load(const char *f);
void position(int xx, int yy);
void resize(int xx, int yy, int ww, int hh);
void show();
void show(int argc, char **argv);
void textsize(uchar s);
uchar textsize();
void topline(const char *n);
void topline(int n);
void value(const char *f);
const char * value() const;
int visible();
int w();
int x();
int y();
};
#endif
//
// End of "$Id: Fl_Help_Dialog.H 4582 2005-09-25 16:54:40Z matt $".
//

View File

@@ -0,0 +1,195 @@
//
// "$Id: Fl_Help_View.H 4288 2005-04-16 00:13:17Z mike $"
//
// Help Viewer widget definitions.
//
// Copyright 1997-2005 by Easy Software Products.
// Image support donated by Matthias Melcher, Copyright 2000.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Help_View_H
# define Fl_Help_View_H
//
// Include necessary header files...
//
# include <stdio.h>
# include "Fl.H"
# include "Fl_Group.H"
# include "Fl_Scrollbar.H"
# include "fl_draw.H"
# include "Fl_Shared_Image.H"
//
// Fl_Help_Func type - link callback function for files...
//
typedef const char *(Fl_Help_Func)(Fl_Widget *, const char *);
//
// Fl_Help_Block structure...
//
struct Fl_Help_Block
{
const char *start, // Start of text
*end; // End of text
uchar border; // Draw border?
Fl_Color bgcolor; // Background color
int x, // Indentation/starting X coordinate
y, // Starting Y coordinate
w, // Width
h; // Height
int line[32]; // Left starting position for each line
};
//
// Fl_Help_Link structure...
//
struct Fl_Help_Link
{
char filename[192], // Reference filename
name[32]; // Link target (blank if none)
int x, // X offset of link text
y, // Y offset of link text
w, // Width of link text
h; // Height of link text
};
//
// Fl_Help_Target structure...
//
struct Fl_Help_Target
{
char name[32]; // Target name
int y; // Y offset of target
};
//
// Fl_Help_View class...
//
class FL_EXPORT Fl_Help_View : public Fl_Group //// Help viewer widget
{
enum { RIGHT = -1, CENTER, LEFT }; // Alignments
char title_[1024]; // Title string
Fl_Color defcolor_, // Default text color
bgcolor_, // Background color
textcolor_, // Text color
linkcolor_; // Link color
uchar textfont_, // Default font for text
textsize_; // Default font size
const char *value_; // HTML text value
int nblocks_, // Number of blocks/paragraphs
ablocks_; // Allocated blocks
Fl_Help_Block *blocks_; // Blocks
int nfonts_; // Number of fonts in stack
uchar fonts_[100][2]; // Font stack
Fl_Help_Func *link_; // Link transform function
int nlinks_, // Number of links
alinks_; // Allocated links
Fl_Help_Link *links_; // Links
int ntargets_, // Number of targets
atargets_; // Allocated targets
Fl_Help_Target *targets_; // Targets
char directory_[1024]; // Directory for current file
char filename_[1024]; // Current filename
int topline_, // Top line in document
leftline_, // Lefthand position
size_, // Total document length
hsize_; // Maximum document width
Fl_Scrollbar scrollbar_, // Vertical scrollbar for document
hscrollbar_; // Horizontal scrollbar
Fl_Help_Block *add_block(const char *s, int xx, int yy, int ww, int hh, uchar border = 0);
void add_link(const char *n, int xx, int yy, int ww, int hh);
void add_target(const char *n, int yy);
static int compare_targets(const Fl_Help_Target *t0, const Fl_Help_Target *t1);
int do_align(Fl_Help_Block *block, int line, int xx, int a, int &l);
void draw();
void format();
void format_table(int *table_width, int *columns, const char *table);
int get_align(const char *p, int a);
const char *get_attr(const char *p, const char *n, char *buf, int bufsize);
Fl_Color get_color(const char *n, Fl_Color c);
Fl_Shared_Image *get_image(const char *name, int W, int H);
int get_length(const char *l);
int handle(int);
void initfont(uchar &f, uchar &s) { nfonts_ = 0;
fl_font(f = fonts_[0][0] = textfont_,
s = fonts_[0][1] = textsize_); }
void pushfont(uchar f, uchar s) { if (nfonts_ < 99) nfonts_ ++;
fl_font(fonts_[nfonts_][0] = f,
fonts_[nfonts_][1] = s); }
void popfont(uchar &f, uchar &s) { if (nfonts_ > 0) nfonts_ --;
fl_font(f = fonts_[nfonts_][0],
s = fonts_[nfonts_][1]); }
public:
Fl_Help_View(int xx, int yy, int ww, int hh, const char *l = 0);
~Fl_Help_View();
const char *directory() const { if (directory_[0]) return (directory_);
else return ((const char *)0); }
const char *filename() const { if (filename_[0]) return (filename_);
else return ((const char *)0); }
int find(const char *s, int p = 0);
void link(Fl_Help_Func *fn) { link_ = fn; }
int load(const char *f);
void resize(int,int,int,int);
int size() const { return (size_); }
void size(int W, int H) { Fl_Widget::size(W, H); }
void textcolor(Fl_Color c) { if (textcolor_ == defcolor_) textcolor_ = c; defcolor_ = c; }
Fl_Color textcolor() const { return (defcolor_); }
void textfont(uchar f) { textfont_ = f; format(); }
uchar textfont() const { return (textfont_); }
void textsize(uchar s) { textsize_ = s; format(); }
uchar textsize() const { return (textsize_); }
const char *title() { return (title_); }
void topline(const char *n);
void topline(int);
int topline() const { return (topline_); }
void leftline(int);
int leftline() const { return (leftline_); }
void value(const char *v);
const char *value() const { return (value_); }
};
#endif // !Fl_Help_View_H
//
// End of "$Id: Fl_Help_View.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Hold_Browser.H 4288 2005-04-16 00:13:17Z mike $"
//
// Hold browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Hold_Browser_H
#define Fl_Hold_Browser_H
#include "Fl_Browser.H"
class Fl_Hold_Browser : public Fl_Browser {
public:
Fl_Hold_Browser(int X,int Y,int W,int H,const char *l=0)
: Fl_Browser(X,Y,W,H,l) {type(FL_HOLD_BROWSER);}
};
#endif
//
// End of "$Id: Fl_Hold_Browser.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,42 @@
//
// "$Id: Fl_Hor_Fill_Slider.H 4288 2005-04-16 00:13:17Z mike $"
//
// Horizontal fill slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Hor_Fill_Slider_H
#define Fl_Hor_Fill_Slider_H
#include "Fl_Slider.H"
class Fl_Hor_Fill_Slider : public Fl_Slider {
public:
Fl_Hor_Fill_Slider(int x,int y,int w,int h,const char *l=0)
: Fl_Slider(x,y,w,h,l) {type(FL_HOR_FILL_SLIDER);}
};
#endif
//
// End of "$Id: Fl_Hor_Fill_Slider.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Hor_Nice_Slider.H 4288 2005-04-16 00:13:17Z mike $"
//
// Horizontal "nice" slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Hor_Nice_Slider_H
#define Fl_Hor_Nice_Slider_H
#include "Fl_Slider.H"
class Fl_Hor_Nice_Slider : public Fl_Slider {
public:
Fl_Hor_Nice_Slider(int x,int y,int w,int h,const char *l=0)
: Fl_Slider(x,y,w,h,l) {type(FL_HOR_NICE_SLIDER); box(FL_FLAT_BOX);}
};
#endif
//
// End of "$Id: Fl_Hor_Nice_Slider.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Hor_Slider.H 4288 2005-04-16 00:13:17Z mike $"
//
// Horizontal slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Hor_Slider_H
#define Fl_Hor_Slider_H
#include "Fl_Slider.H"
class Fl_Hor_Slider : public Fl_Slider {
public:
Fl_Hor_Slider(int X,int Y,int W,int H,const char *l=0)
: Fl_Slider(X,Y,W,H,l) {type(FL_HOR_SLIDER);}
};
#endif
//
// End of "$Id: Fl_Hor_Slider.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Hor_Value_Slider.H 4288 2005-04-16 00:13:17Z mike $"
//
// Horizontal value slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Hor_Value_Slider_H
#define Fl_Hor_Value_Slider_H
#include "Fl_Value_Slider.H"
class Fl_Hor_Value_Slider : public Fl_Value_Slider {
public:
Fl_Hor_Value_Slider(int X,int Y,int W,int H,const char *l=0)
: Fl_Value_Slider(X,Y,W,H,l) {type(FL_HOR_SLIDER);}
};
#endif
//
// End of "$Id: Fl_Hor_Value_Slider.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,112 @@
//
// "$Id: Fl_Image.H 4288 2005-04-16 00:13:17Z mike $"
//
// Image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Image_H
# define Fl_Image_H
# include "Enumerations.H"
class Fl_Widget;
struct Fl_Menu_Item;
struct Fl_Label;
class FL_EXPORT Fl_Image {
int w_, h_, d_, ld_, count_;
const char * const *data_;
// Forbid use of copy contructor and assign operator
Fl_Image & operator=(const Fl_Image &);
Fl_Image(const Fl_Image &);
protected:
void w(int W) {w_ = W;}
void h(int H) {h_ = H;}
void d(int D) {d_ = D;}
void ld(int LD) {ld_ = LD;}
void data(const char * const *p, int c) {data_ = p; count_ = c;}
void draw_empty(int X, int Y);
static void labeltype(const Fl_Label *lo, int lx, int ly, int lw, int lh, Fl_Align la);
static void measure(const Fl_Label *lo, int &lw, int &lh);
public:
int w() const {return w_;}
int h() const {return h_;}
int d() const {return d_;}
int ld() const {return ld_;}
int count() const {return count_;}
const char * const *data() const {return data_;}
Fl_Image(int W, int H, int D) {w_ = W; h_ = H; d_ = D; ld_ = 0; count_ = 0; data_ = 0;}
virtual ~Fl_Image();
virtual Fl_Image *copy(int W, int H);
Fl_Image *copy() { return copy(w(), h()); }
virtual void color_average(Fl_Color c, float i);
void inactive() { color_average(FL_GRAY, .33f); }
virtual void desaturate();
virtual void label(Fl_Widget*w);
virtual void label(Fl_Menu_Item*m);
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
virtual void uncache();
};
class FL_EXPORT Fl_RGB_Image : public Fl_Image {
public:
const uchar *array;
int alloc_array; // Non-zero if array was allocated
#if defined(__APPLE__) || defined(WIN32)
void *id; // for internal use
void *mask; // for internal use (mask bitmap)
#else
unsigned id; // for internal use
unsigned mask; // for internal use (mask bitmap)
#endif // __APPLE__ || WIN32
Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0) :
Fl_Image(W,H,D), array(bits), alloc_array(0), id(0), mask(0) {data((const char **)&array, 1); ld(LD);}
virtual ~Fl_RGB_Image();
virtual Fl_Image *copy(int W, int H);
Fl_Image *copy() { return copy(w(), h()); }
virtual void color_average(Fl_Color c, float i);
virtual void desaturate();
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
virtual void label(Fl_Widget*w);
virtual void label(Fl_Menu_Item*m);
virtual void uncache();
};
#endif // !Fl_Image_H
//
// End of "$Id: Fl_Image.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,48 @@
//
// "$Id: Fl_Input.H 4288 2005-04-16 00:13:17Z mike $"
//
// Input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Input_H
#define Fl_Input_H
#include "Fl_Input_.H"
class FL_EXPORT Fl_Input : public Fl_Input_ {
int handle_key();
int shift_position(int p);
int shift_up_down_position(int p);
void handle_mouse(int keepmark=0);
public:
void draw();
int handle(int);
Fl_Input(int,int,int,int,const char * = 0);
};
#endif
//
// End of "$Id: Fl_Input.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,145 @@
//
// "$Id: Fl_Input_.H 4288 2005-04-16 00:13:17Z mike $"
//
// Input base class header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Input__H
#define Fl_Input__H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
#define FL_NORMAL_INPUT 0
#define FL_FLOAT_INPUT 1
#define FL_INT_INPUT 2
#define FL_HIDDEN_INPUT 3
#define FL_MULTILINE_INPUT 4
#define FL_SECRET_INPUT 5
#define FL_INPUT_TYPE 7
#define FL_INPUT_READONLY 8
#define FL_NORMAL_OUTPUT (FL_NORMAL_INPUT | FL_INPUT_READONLY)
#define FL_MULTILINE_OUTPUT (FL_MULTILINE_INPUT | FL_INPUT_READONLY)
#define FL_INPUT_WRAP 16
#define FL_MULTILINE_INPUT_WRAP (FL_MULTILINE_INPUT | FL_INPUT_WRAP)
#define FL_MULTILINE_OUTPUT_WRAP (FL_MULTILINE_INPUT | FL_INPUT_READONLY | FL_INPUT_WRAP)
class FL_EXPORT Fl_Input_ : public Fl_Widget {
const char* value_;
char* buffer;
int size_;
int bufsize;
int position_;
int mark_;
int xscroll_, yscroll_;
int mu_p;
int maximum_size_;
uchar erase_cursor_only;
uchar textfont_;
uchar textsize_;
unsigned textcolor_;
unsigned cursor_color_;
const char* expand(const char*, char*) const;
double expandpos(const char*, const char*, const char*, int*) const;
void minimal_update(int, int);
void minimal_update(int p);
void put_in_buffer(int newsize);
void setfont() const;
protected:
int word_start(int i) const;
int word_end(int i) const;
int line_start(int i) const;
int line_end(int i) const;
void drawtext(int, int, int, int);
int up_down_position(int, int keepmark=0);
void handle_mouse(int, int, int, int, int keepmark=0);
int handletext(int e, int, int, int, int);
void maybe_do_callback();
int xscroll() const {return xscroll_;}
int yscroll() const {return yscroll_;}
public:
void resize(int, int, int, int);
Fl_Input_(int, int, int, int, const char* = 0);
~Fl_Input_();
int value(const char*);
int value(const char*, int);
int static_value(const char*);
int static_value(const char*, int);
const char* value() const {return value_;}
char index(int i) const {return value_[i];}
int size() const {return size_;}
void size(int W, int H) { Fl_Widget::size(W, H); }
int maximum_size() const {return maximum_size_;}
void maximum_size(int m) {maximum_size_ = m;}
int position() const {return position_;}
int mark() const {return mark_;}
int position(int p, int m);
int position(int p) {return position(p, p);}
int mark(int m) {return position(position(), m);}
int replace(int, int, const char*, int=0);
int cut() {return replace(position(), mark(), 0);}
int cut(int n) {return replace(position(), position()+n, 0);}
int cut(int a, int b) {return replace(a, b, 0);}
int insert(const char* t, int l=0){return replace(position_, mark_, t, l);}
int copy(int clipboard);
int undo();
int copy_cuts();
Fl_Font textfont() const {return (Fl_Font)textfont_;}
void textfont(uchar s) {textfont_ = s;}
uchar textsize() const {return textsize_;}
void textsize(uchar s) {textsize_ = s;}
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
void textcolor(unsigned n) {textcolor_ = n;}
Fl_Color cursor_color() const {return (Fl_Color)cursor_color_;}
void cursor_color(unsigned n) {cursor_color_ = n;}
int input_type() const {return type() & FL_INPUT_TYPE; }
void input_type(int t) { type((uchar)(t | readonly())); }
int readonly() const { return type() & FL_INPUT_READONLY; }
void readonly(int b) { if (b) type((uchar)(type() | FL_INPUT_READONLY));
else type((uchar)(type() & ~FL_INPUT_READONLY)); }
int wrap() const { return type() & FL_INPUT_WRAP; }
void wrap(int b) { if (b) type((uchar)(type() | FL_INPUT_WRAP));
else type((uchar)(type() & ~FL_INPUT_WRAP)); }
};
#endif
//
// End of "$Id: Fl_Input_.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,154 @@
//
// "$Id$"
//
// An input/chooser widget.
// ______________ ____
// | || __ |
// | input area || \/ |
// |______________||____|
//
// Copyright 1998-2005 by Bill Spitzak and others.
// Copyright 2004 by Greg Ercolano.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Input_Choice_H
#define Fl_Input_Choice_H
#include <FL/Fl.H>
#include <FL/Fl_Input.H>
#include <FL/Fl_Menu_Button.H>
#include <FL/fl_draw.H>
class Fl_Input_Choice : public Fl_Group {
// Private class to handle slightly 'special' behavior of menu button
class InputMenuButton : public Fl_Menu_Button {
void draw() {
draw_box(FL_UP_BOX, color());
fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor()));
int xc = x()+w()/2, yc=y()+h()/2;
fl_polygon(xc-5,yc-3,xc+5,yc-3,xc,yc+3);
if (Fl::focus() == this) draw_focus();
}
public:
InputMenuButton(int x,int y,int w,int h,const char*l=0) :
Fl_Menu_Button(x,y,w,h,l) { box(FL_UP_BOX); }
};
Fl_Input *inp_;
InputMenuButton *menu_;
static void menu_cb(Fl_Widget*, void *data) {
Fl_Input_Choice *o=(Fl_Input_Choice *)data;
o->inp_->value(o->menu_->text());
o->do_callback();
}
static void inp_cb(Fl_Widget*, void *data) {
Fl_Input_Choice *o=(Fl_Input_Choice *)data;
o->do_callback();
}
// Custom resize behavior -- input stretches, menu button doesn't
inline int inp_x() { return(x() + Fl::box_dx(box())); }
inline int inp_y() { return(y() + Fl::box_dy(box())); }
inline int inp_w() { return(w() - Fl::box_dw(box()) - 20); }
inline int inp_h() { return(h() - Fl::box_dh(box())); }
inline int menu_x() { return(x() + w() - 20 - Fl::box_dx(box())); }
inline int menu_y() { return(y() + Fl::box_dy(box())); }
inline int menu_w() { return(20); }
inline int menu_h() { return(h() - Fl::box_dh(box())); }
public:
Fl_Input_Choice (int x,int y,int w,int h,const char*l=0) : Fl_Group(x,y,w,h,l) {
Fl_Group::box(FL_DOWN_BOX);
align(FL_ALIGN_LEFT); // default like Fl_Input
inp_ = new Fl_Input(inp_x(), inp_y(),
inp_w(), inp_h());
inp_->callback(inp_cb, (void*)this);
inp_->box(FL_FLAT_BOX); // cosmetic
menu_ = new InputMenuButton(menu_x(), menu_y(),
menu_w(), menu_h());
menu_->callback(menu_cb, (void*)this);
menu_->box(FL_FLAT_BOX); // cosmetic
end();
}
void add(const char *s) {
menu_->add(s);
}
void clear() {
menu_->clear();
}
Fl_Boxtype down_box() const {
return (menu_->down_box());
}
void down_box(Fl_Boxtype b) {
menu_->down_box(b);
}
const Fl_Menu_Item *menu() {
return (menu_->menu());
}
void menu(const Fl_Menu_Item *m) {
menu_->menu(m);
}
void resize(int X, int Y, int W, int H) {
Fl_Group::resize(X,Y,W,H);
inp_->resize(inp_x(), inp_y(), inp_w(), inp_h());
menu_->resize(menu_x(), menu_y(), menu_w(), menu_h());
}
Fl_Color textcolor() const {
return (inp_->textcolor());
}
void textcolor(Fl_Color c) {
inp_->textcolor(c);
}
uchar textfont() const {
return (inp_->textfont());
}
void textfont(uchar f) {
inp_->textfont(f);
}
uchar textsize() const {
return (inp_->textsize());
}
void textsize(uchar s) {
inp_->textsize(s);
}
const char* value() const {
return (inp_->value());
}
void value(const char *val) {
inp_->value(val);
}
void value(int val) {
menu_->value(val);
inp_->value(menu_->text(val));
}
Fl_Menu_Button *menubutton() { return menu_; }
Fl_Input *input() { return inp_; }
};
#endif // !Fl_Input_Choice_H
//
// End of "$Id$".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Int_Input.H 4288 2005-04-16 00:13:17Z mike $"
//
// Integer input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Int_Input_H
#define Fl_Int_Input_H
#include "Fl_Input.H"
class Fl_Int_Input : public Fl_Input {
public:
Fl_Int_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(X,Y,W,H,l) {type(FL_INT_INPUT);}
};
#endif
//
// End of "$Id: Fl_Int_Input.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_JPEG_Image.H 4288 2005-04-16 00:13:17Z mike $"
//
// JPEG image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_JPEG_Image_H
#define Fl_JPEG_Image_H
# include "Fl_Image.H"
class FL_EXPORT Fl_JPEG_Image : public Fl_RGB_Image {
public:
Fl_JPEG_Image(const char* filename);
};
#endif
//
// End of "$Id: Fl_JPEG_Image.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,45 @@
//
// "$Id: Fl_Light_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Lighted button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Light_Button_H
#define Fl_Light_Button_H
#include "Fl_Button.H"
class FL_EXPORT Fl_Light_Button : public Fl_Button {
protected:
virtual void draw();
public:
virtual int handle(int);
Fl_Light_Button(int x,int y,int w,int h,const char *l = 0);
};
#endif
//
// End of "$Id: Fl_Light_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Line_Dial.H 4288 2005-04-16 00:13:17Z mike $"
//
// Line dial header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Line_Dial_H
#define Fl_Line_Dial_H
#include "Fl_Dial.H"
class Fl_Line_Dial : public Fl_Dial {
public:
Fl_Line_Dial(int x,int y,int w,int h, const char *l = 0)
: Fl_Dial(x,y,w,h,l) {type(FL_LINE_DIAL);}
};
#endif
//
// End of "$Id: Fl_Line_Dial.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,33 @@
//
// "$Id: Fl_Menu.H 4288 2005-04-16 00:13:17Z mike $"
//
// Old menu header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// this include file is for back compatability only
#include "Fl_Menu_Item.H"
//
// End of "$Id: Fl_Menu.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,102 @@
//
// "$Id: Fl_Menu_.H 4288 2005-04-16 00:13:17Z mike $"
//
// Menu base class header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Menu__H
#define Fl_Menu__H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
#include "Fl_Menu_Item.H"
class FL_EXPORT Fl_Menu_ : public Fl_Widget {
Fl_Menu_Item *menu_;
const Fl_Menu_Item *value_;
protected:
uchar alloc;
uchar down_box_;
uchar textfont_;
uchar textsize_;
unsigned textcolor_;
public:
Fl_Menu_(int,int,int,int,const char * =0);
~Fl_Menu_();
int item_pathname(char *name, int namelen, const Fl_Menu_Item *finditem=0) const;
const Fl_Menu_Item* picked(const Fl_Menu_Item*);
const Fl_Menu_Item* find_item(const char *name);
const Fl_Menu_Item* test_shortcut() {return picked(menu()->test_shortcut());}
void global();
const Fl_Menu_Item *menu() const {return menu_;}
void menu(const Fl_Menu_Item *m);
void copy(const Fl_Menu_Item *m, void* user_data = 0);
int add(const char*, int shortcut, Fl_Callback*, void* = 0, int = 0);
int add(const char* a, const char* b, Fl_Callback* c,
void* d = 0, int e = 0) {return add(a,fl_old_shortcut(b),c,d,e);}
int size() const ;
void size(int W, int H) { Fl_Widget::size(W, H); }
void clear();
int add(const char *);
void replace(int,const char *);
void remove(int);
void shortcut(int i, int s) {menu_[i].shortcut(s);}
void mode(int i,int fl) {menu_[i].flags = fl;}
int mode(int i) const {return menu_[i].flags;}
const Fl_Menu_Item *mvalue() const {return value_;}
int value() const {return value_ ? (int)(value_-menu_) : -1;}
int value(const Fl_Menu_Item*);
int value(int i) {return value(menu_+i);}
const char *text() const {return value_ ? value_->text : 0;}
const char *text(int i) const {return menu_[i].text;}
Fl_Font textfont() const {return (Fl_Font)textfont_;}
void textfont(uchar c) {textfont_=c;}
uchar textsize() const {return textsize_;}
void textsize(uchar c) {textsize_=c;}
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
void textcolor(unsigned c) {textcolor_=c;}
Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;}
void down_box(Fl_Boxtype b) {down_box_ = b;}
// back compatability:
Fl_Color down_color() const {return selection_color();}
void down_color(unsigned c) {selection_color(c);}
};
#endif
//
// End of "$Id: Fl_Menu_.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,46 @@
//
// "$Id: Fl_Menu_Bar.H 4288 2005-04-16 00:13:17Z mike $"
//
// Menu bar header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Menu_Bar_H
#define Fl_Menu_Bar_H
#include "Fl_Menu_.H"
class FL_EXPORT Fl_Menu_Bar : public Fl_Menu_ {
protected:
void draw();
public:
int handle(int);
Fl_Menu_Bar(int X, int Y, int W, int H,const char *l=0)
: Fl_Menu_(X,Y,W,H,l) {}
};
#endif
//
// End of "$Id: Fl_Menu_Bar.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,48 @@
//
// "$Id: Fl_Menu_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Menu button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Menu_Button_H
#define Fl_Menu_Button_H
#include "Fl_Menu_.H"
class FL_EXPORT Fl_Menu_Button : public Fl_Menu_ {
protected:
void draw();
public:
// values for type:
enum {POPUP1 = 1, POPUP2, POPUP12, POPUP3, POPUP13, POPUP23, POPUP123};
int handle(int);
const Fl_Menu_Item* popup();
Fl_Menu_Button(int,int,int,int,const char * =0);
};
#endif
//
// End of "$Id: Fl_Menu_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,167 @@
//
// "$Id: Fl_Menu_Item.H 4288 2005-04-16 00:13:17Z mike $"
//
// Menu item header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Menu_Item_H
#define Fl_Menu_Item_H
# include "Fl_Widget.H"
# include "Fl_Image.H"
# if defined(__APPLE__) && defined(check)
# undef check
# 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
};
extern FL_EXPORT int fl_old_shortcut(const char*);
class Fl_Menu_;
struct FL_EXPORT Fl_Menu_Item {
const char *text; // label()
int shortcut_;
Fl_Callback *callback_;
void *user_data_;
int flags;
uchar labeltype_;
uchar labelfont_;
uchar labelsize_;
unsigned labelcolor_;
// advance N items, skipping submenus:
const Fl_Menu_Item *next(int=1) const;
Fl_Menu_Item *next(int i=1) {
return (Fl_Menu_Item*)(((const Fl_Menu_Item*)this)->next(i));}
const Fl_Menu_Item *first() const { return next(0); }
Fl_Menu_Item *first() { return next(0); }
// methods on menu items:
const char* label() const {return text;}
void label(const char* a) {text=a;}
void label(Fl_Labeltype a,const char* b) {labeltype_ = a; text = b;}
Fl_Labeltype labeltype() const {return (Fl_Labeltype)labeltype_;}
void labeltype(Fl_Labeltype a) {labeltype_ = a;}
Fl_Color labelcolor() const {return (Fl_Color)labelcolor_;}
void labelcolor(unsigned a) {labelcolor_ = a;}
Fl_Font labelfont() const {return (Fl_Font)labelfont_;}
void labelfont(uchar a) {labelfont_ = a;}
uchar labelsize() const {return labelsize_;}
void labelsize(uchar a) {labelsize_ = a;}
Fl_Callback_p callback() const {return callback_;}
void callback(Fl_Callback* c, void* p) {callback_=c; user_data_=p;}
void callback(Fl_Callback* c) {callback_=c;}
void callback(Fl_Callback0*c) {callback_=(Fl_Callback*)c;}
void callback(Fl_Callback1*c, long p=0) {callback_=(Fl_Callback*)c; user_data_=(void*)p;}
void* user_data() const {return user_data_;}
void user_data(void* v) {user_data_ = v;}
long argument() const {return (long)user_data_;}
void argument(long v) {user_data_ = (void*)v;}
int shortcut() const {return shortcut_;}
void shortcut(int s) {shortcut_ = s;}
int submenu() const {return flags&(FL_SUBMENU|FL_SUBMENU_POINTER);}
int checkbox() const {return flags&FL_MENU_TOGGLE;}
int radio() const {return flags&FL_MENU_RADIO;}
int value() const {return flags&FL_MENU_VALUE;}
void set() {flags |= FL_MENU_VALUE;}
void clear() {flags &= ~FL_MENU_VALUE;}
void setonly();
int visible() const {return !(flags&FL_MENU_INVISIBLE);}
void show() {flags &= ~FL_MENU_INVISIBLE;}
void hide() {flags |= FL_MENU_INVISIBLE;}
int active() const {return !(flags&FL_MENU_INACTIVE);}
void activate() {flags &= ~FL_MENU_INACTIVE;}
void deactivate() {flags |= FL_MENU_INACTIVE;}
int activevisible() const {return !(flags&0x11);}
// compatibility for FLUID so it can set the image of a menu item...
void image(Fl_Image* a) {a->label(this);}
void image(Fl_Image& a) {a.label(this);}
// used by menubar:
int measure(int* h, const Fl_Menu_*) const;
void draw(int x, int y, int w, int h, const Fl_Menu_*, int t=0) const;
// popup menus without using an Fl_Menu_ widget:
const Fl_Menu_Item* popup(
int X, int Y,
const char *title = 0,
const Fl_Menu_Item* picked=0,
const Fl_Menu_* = 0) const;
const Fl_Menu_Item* pulldown(
int X, int Y, int W, int H,
const Fl_Menu_Item* picked = 0,
const Fl_Menu_* = 0,
const Fl_Menu_Item* title = 0,
int menubar=0) const;
const Fl_Menu_Item* test_shortcut() const;
const Fl_Menu_Item* find_shortcut(int *ip=0) const;
void do_callback(Fl_Widget* o) const {callback_(o, user_data_);}
void do_callback(Fl_Widget* o,void* arg) const {callback_(o, arg);}
void do_callback(Fl_Widget* o,long arg) const {callback_(o, (void*)arg);}
// back-compatability, do not use:
int checked() const {return flags&FL_MENU_VALUE;}
void check() {flags |= FL_MENU_VALUE;}
void uncheck() {flags &= ~FL_MENU_VALUE;}
int add(const char*, int shortcut, Fl_Callback*, void* =0, int = 0);
int add(const char*a, const char* b, Fl_Callback* c,
void* d = 0, int e = 0) {
return add(a,fl_old_shortcut(b),c,d,e);}
int size() const ;
};
typedef Fl_Menu_Item Fl_Menu; // back compatability
enum { // back-compatability enum:
FL_PUP_NONE = 0,
FL_PUP_GREY = FL_MENU_INACTIVE,
FL_PUP_GRAY = FL_MENU_INACTIVE,
FL_MENU_BOX = FL_MENU_TOGGLE,
FL_PUP_BOX = FL_MENU_TOGGLE,
FL_MENU_CHECK = FL_MENU_VALUE,
FL_PUP_CHECK = FL_MENU_VALUE,
FL_PUP_RADIO = FL_MENU_RADIO,
FL_PUP_INVISIBLE = FL_MENU_INVISIBLE,
FL_PUP_SUBMENU = FL_SUBMENU_POINTER
};
#endif
//
// End of "$Id: Fl_Menu_Item.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,54 @@
//
// "$Id: Fl_Menu_Window.H 4288 2005-04-16 00:13:17Z mike $"
//
// Menu window header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Menu_Window_H
#define Fl_Menu_Window_H
#include "Fl_Single_Window.H"
class FL_EXPORT Fl_Menu_Window : public Fl_Single_Window {
enum {NO_OVERLAY = 128};
public:
void show();
void erase();
void flush();
void hide();
int overlay() {return !(flags()&NO_OVERLAY);}
void set_overlay() {clear_flag(NO_OVERLAY);}
void clear_overlay() {set_flag(NO_OVERLAY);}
~Fl_Menu_Window();
Fl_Menu_Window(int W, int H, const char *l = 0)
: Fl_Single_Window(W,H,l) { image(0); }
Fl_Menu_Window(int X, int Y, int W, int H, const char *l = 0)
: Fl_Single_Window(X,Y,W,H,l) { image(0); }
};
#endif
//
// End of "$Id: Fl_Menu_Window.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Multi_Browser.H 4288 2005-04-16 00:13:17Z mike $"
//
// Multi browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Multi_Browser_H
#define Fl_Multi_Browser_H
#include "Fl_Browser.H"
class Fl_Multi_Browser : public Fl_Browser {
public:
Fl_Multi_Browser(int X,int Y,int W,int H,const char *L=0)
: Fl_Browser(X,Y,W,H,L) {type(FL_MULTI_BROWSER);}
};
#endif
//
// End of "$Id: Fl_Multi_Browser.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,47 @@
//
// "$Id: Fl_Multi_Label.H 4288 2005-04-16 00:13:17Z mike $"
//
// Multi-label header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Multi_Label_H
#define Fl_Multi_Label_H
class Fl_Widget;
struct Fl_Menu_Item;
struct FL_EXPORT Fl_Multi_Label {
const char* labela;
const char* labelb;
uchar typea;
uchar typeb;
void label(Fl_Widget*);
void label(Fl_Menu_Item*);
};
#endif
//
// End of "$Id: Fl_Multi_Label.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Multiline_Input.H 4288 2005-04-16 00:13:17Z mike $"
//
// Multiline input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Multiline_Input_H
#define Fl_Multiline_Input_H
#include "Fl_Input.H"
class Fl_Multiline_Input : public Fl_Input {
public:
Fl_Multiline_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(X,Y,W,H,l) {type(FL_MULTILINE_INPUT);}
};
#endif
//
// End of "$Id: Fl_Multiline_Input.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Multiline_Output.H 4288 2005-04-16 00:13:17Z mike $"
//
// Multi line output header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Multiline_Output_H
#define Fl_Multiline_Output_H
#include "Fl_Output.H"
class Fl_Multiline_Output : public Fl_Output {
public:
Fl_Multiline_Output(int X,int Y,int W,int H,const char *l = 0)
: Fl_Output(X,Y,W,H,l) {type(FL_MULTILINE_OUTPUT);}
};
#endif
//
// End of "$Id: Fl_Multiline_Output.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,42 @@
//
// "$Id: Fl_Nice_Slider.H 4288 2005-04-16 00:13:17Z mike $"
//
// "Nice" slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Nice_Slider_H
#define Fl_Nice_Slider_H
#include "Fl_Slider.H"
class Fl_Nice_Slider : public Fl_Slider {
public:
Fl_Nice_Slider(int x,int y,int w,int h,const char *l=0)
: Fl_Slider(x,y,w,h,l) {type(FL_VERT_NICE_SLIDER); box(FL_FLAT_BOX);}
};
#endif
//
// End of "$Id: Fl_Nice_Slider.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,36 @@
//
// "$Id: Fl_Object.H 4288 2005-04-16 00:13:17Z mike $"
//
// Old Fl_Object header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// This file is provided for back compatability only. Please use Fl_Widget
#ifndef Fl_Object
#define Fl_Object Fl_Widget
#endif
#include "Fl_Widget.H"
//
// End of "$Id: Fl_Object.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Output.H 4288 2005-04-16 00:13:17Z mike $"
//
// Output header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Output_H
#define Fl_Output_H
#include "Fl_Input.H"
class Fl_Output : public Fl_Input {
public:
Fl_Output(int X,int Y,int W,int H, const char *l = 0)
: Fl_Input(X, Y, W, H, l) {type(FL_NORMAL_OUTPUT);}
};
#endif
//
// End of "$Id: Fl_Output.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,56 @@
//
// "$Id: Fl_Overlay_Window.H 4288 2005-04-16 00:13:17Z mike $"
//
// Overlay window header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Overlay_Window_H
#define Fl_Overlay_Window_H
#include "Fl_Double_Window.H"
class FL_EXPORT Fl_Overlay_Window : public Fl_Double_Window {
friend class _Fl_Overlay;
virtual void draw_overlay() = 0;
Fl_Window *overlay_;
public:
void show();
void flush();
void hide();
void resize(int,int,int,int);
~Fl_Overlay_Window();
int can_do_overlay();
void redraw_overlay();
Fl_Overlay_Window(int W, int H, const char *l=0)
: Fl_Double_Window(W,H,l) {overlay_ = 0; force_doublebuffering_=1; image(0); }
Fl_Overlay_Window(int X, int Y, int W, int H, const char *l=0)
: Fl_Double_Window(X,Y,W,H,l) {overlay_ = 0; force_doublebuffering_=1; image(0); }
void show(int a, char **b) {Fl_Double_Window::show(a,b);}
};
#endif
//
// End of "$Id: Fl_Overlay_Window.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_PNG_Image.H 4288 2005-04-16 00:13:17Z mike $"
//
// PNG image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_PNG_Image_H
#define Fl_PNG_Image_H
# include "Fl_Image.H"
class FL_EXPORT Fl_PNG_Image : public Fl_RGB_Image {
public:
Fl_PNG_Image(const char* filename);
};
#endif
//
// End of "$Id: Fl_PNG_Image.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_PNM_Image.H 4288 2005-04-16 00:13:17Z mike $"
//
// PNM image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_PNM_Image_H
#define Fl_PNM_Image_H
# include "Fl_Image.H"
class FL_EXPORT Fl_PNM_Image : public Fl_RGB_Image {
public:
Fl_PNM_Image(const char* filename);
};
#endif
//
// End of "$Id: Fl_PNM_Image.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,51 @@
//
// "$Id: Fl_Pack.H 4288 2005-04-16 00:13:17Z mike $"
//
// Pack header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Pack_H
#define Fl_Pack_H
#include <FL/Fl_Group.H>
class FL_EXPORT Fl_Pack : public Fl_Group {
int spacing_;
public:
enum { // values for type(int)
VERTICAL = 0,
HORIZONTAL = 1
};
void draw();
Fl_Pack(int x,int y,int w ,int h,const char *l = 0);
int spacing() const {return spacing_;}
void spacing(int i) {spacing_ = i;}
uchar horizontal() const {return type();}
};
#endif
//
// End of "$Id: Fl_Pack.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,80 @@
//
// "$Id: Fl_Pixmap.H 4288 2005-04-16 00:13:17Z mike $"
//
// Pixmap header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Pixmap_H
#define Fl_Pixmap_H
# include "Fl_Image.H"
class Fl_Widget;
struct Fl_Menu_Item;
// Older C++ compilers don't support the explicit keyword... :(
# if defined(__sgi) && !defined(_COMPILER_VERSION)
# define explicit
# endif // __sgi && !_COMPILER_VERSION
class FL_EXPORT Fl_Pixmap : public Fl_Image {
void copy_data();
void delete_data();
void set_data(const char * const *p);
protected:
void measure();
public:
int alloc_data; // Non-zero if data was allocated
#if defined(__APPLE__) || defined(WIN32)
void *id; // for internal use
void *mask; // for internal use (mask bitmap)
#else
unsigned id; // for internal use
unsigned mask; // for internal use (mask bitmap)
#endif // __APPLE__ || WIN32
explicit Fl_Pixmap(char * const * D) : Fl_Image(-1,0,1), alloc_data(0), id(0), mask(0) {set_data((const char*const*)D); measure();}
explicit Fl_Pixmap(uchar* const * D) : Fl_Image(-1,0,1), alloc_data(0), id(0), mask(0) {set_data((const char*const*)D); measure();}
explicit Fl_Pixmap(const char * const * D) : Fl_Image(-1,0,1), alloc_data(0), id(0), mask(0) {set_data((const char*const*)D); measure();}
explicit Fl_Pixmap(const uchar* const * D) : Fl_Image(-1,0,1), alloc_data(0), id(0), mask(0) {set_data((const char*const*)D); measure();}
virtual ~Fl_Pixmap();
virtual Fl_Image *copy(int W, int H);
Fl_Image *copy() { return copy(w(), h()); }
virtual void color_average(Fl_Color c, float i);
virtual void desaturate();
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
virtual void label(Fl_Widget*w);
virtual void label(Fl_Menu_Item*m);
virtual void uncache();
};
#endif
//
// End of "$Id: Fl_Pixmap.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,77 @@
//
// "$Id: Fl_Positioner.H 4288 2005-04-16 00:13:17Z mike $"
//
// Positioner header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Positioner_H
#define Fl_Positioner_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
class FL_EXPORT Fl_Positioner : public Fl_Widget {
double xmin, ymin;
double xmax, ymax;
double xvalue_, yvalue_;
double xstep_, ystep_;
protected:
// these allow subclasses to put the dial in a smaller area:
void draw(int, int, int, int);
int handle(int, int, int, int, int);
void draw();
public:
int handle(int);
Fl_Positioner(int x,int y,int w,int h, const char *l=0);
double xvalue() const {return xvalue_;}
double yvalue() const {return yvalue_;}
int xvalue(double);
int yvalue(double);
int value(double,double);
void xbounds(double, double);
double xminimum() const {return xmin;}
void xminimum(double a) {xbounds(a,xmax);}
double xmaximum() const {return xmax;}
void xmaximum(double a) {xbounds(xmin,a);}
void ybounds(double, double);
double yminimum() const {return ymin;}
void yminimum(double a) {ybounds(a,ymax);}
double ymaximum() const {return ymax;}
void ymaximum(double a) {ybounds(ymin,a);}
void xstep(double a) {xstep_ = a;}
void ystep(double a) {ystep_ = a;}
};
#endif
//
// End of "$Id: Fl_Positioner.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,169 @@
//
// "$Id: Fl_Preferences.H 4458 2005-07-26 07:59:01Z matt $"
//
// Preferences definitions for the Fast Light Tool Kit (FLTK).
//
// Copyright 2002-2005 by Matthias Melcher.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Preferences_H
# define Fl_Preferences_H
# ifdef WIN32
# include <windows.h>
# endif // WIN32
# include <stdio.h>
# include "Fl_Export.H"
/**
* Preferences are a data tree containing a root, branches and leafs
*/
class FL_EXPORT Fl_Preferences
{
public:
enum Root { SYSTEM=0, USER };
// enum Type { win32, macos, fltk };
Fl_Preferences( Root root, const char *vendor, const char *application );
Fl_Preferences( const char *path, const char *vendor, const char *application );
Fl_Preferences( Fl_Preferences&, const char *group );
Fl_Preferences( Fl_Preferences*, const char *group );
~Fl_Preferences();
int groups();
const char *group( int );
char groupExists( const char *group );
char deleteGroup( const char *group );
int entries();
const char *entry( int );
char entryExists( const char *entry );
char deleteEntry( const char *entry );
char set( const char *entry, int value );
char set( const char *entry, float value );
char set( const char *entry, double value );
char set( const char *entry, const char *value );
char set( const char *entry, const void *value, int size );
char get( const char *entry, int &value, int defaultValue );
char get( const char *entry, float &value, float defaultValue );
char get( const char *entry, double &value, double defaultValue );
char get( const char *entry, char *&value, const char *defaultValue );
char get( const char *entry, char *value, const char *defaultValue, int maxSize );
char get( const char *entry, void *&value, const void *defaultValue, int defaultSize );
char get( const char *entry, void *value, const void *defaultValue, int defaultSize, int maxSize );
int size( const char *entry );
char getUserdataPath( char *path, int pathlen );
void flush();
// char export( const char *filename, Type fileFormat );
// char import( const char *filename );
class FL_EXPORT Name {
char *data_;
public:
Name( unsigned int n );
Name( const char *format, ... );
operator const char *() { return data_; }
~Name();
};
struct Entry
{
char *name, *value;
};
private:
// make the following functions unavailable
Fl_Preferences();
Fl_Preferences(const Fl_Preferences&);
Fl_Preferences &operator=(const Fl_Preferences&);
static char nameBuffer[128];
class FL_EXPORT Node // a node contains a list to all its entries
{ // and all means to manage the tree structure
Node *child_, *next_, *parent_;
char *path_;
char dirty_;
public:
Node( const char *path );
~Node();
// node methods
int write( FILE *f );
Node *find( const char *path );
Node *search( const char *path, int offset=0 );
Node *addChild( const char *path );
void setParent( Node *parent );
Node *parent() { return parent_; }
char remove();
char dirty();
// entry methods
int nChildren();
const char *child( int ix );
void set( const char *name, const char *value );
void set( const char *line );
void add( const char *line );
const char *get( const char *name );
int getEntry( const char *name );
char deleteEntry( const char *name );
// public values
Entry *entry;
int nEntry, NEntry;
static int lastEntrySet;
};
friend class Node;
class FL_EXPORT RootNode // the root node manages file paths and basic reading and writing
{
Fl_Preferences *prefs_;
char *filename_;
char *vendor_, *application_;
public:
RootNode( Fl_Preferences *, Root root, const char *vendor, const char *application );
RootNode( Fl_Preferences *, const char *path, const char *vendor, const char *application );
~RootNode();
int read();
int write();
char getPath( char *path, int pathlen );
};
friend class RootNode;
Node *node;
RootNode *rootNode;
};
#endif // !Fl_Preferences_H
//
// End of "$Id: Fl_Preferences.H 4458 2005-07-26 07:59:01Z matt $".
//

View File

@@ -0,0 +1,70 @@
//
// "$Id: Fl_Progress.H 4288 2005-04-16 00:13:17Z mike $"
//
// Progress bar widget definitions.
//
// Copyright 2000-2005 by Michael Sweet.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef _Fl_Progress_H_
# define _Fl_Progress_H_
//
// Include necessary headers.
//
#include "Fl_Widget.H"
//
// Progress class...
//
class FL_EXPORT Fl_Progress : public Fl_Widget
{
float value_,
minimum_,
maximum_;
protected:
virtual void draw();
public:
Fl_Progress(int x, int y, int w, int h, const char *l = 0);
void maximum(float v) { maximum_ = v; redraw(); }
float maximum() const { return (maximum_); }
void minimum(float v) { minimum_ = v; redraw(); }
float minimum() const { return (minimum_); }
void value(float v) { value_ = v; redraw(); }
float value() const { return (value_); }
};
#endif // !_Fl_Progress_H_
//
// End of "$Id: Fl_Progress.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Radio_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Radio button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Radio_Button_H
#define Fl_Radio_Button_H
#include "Fl_Button.H"
class Fl_Radio_Button : public Fl_Button {
public:
Fl_Radio_Button(int x,int y,int w,int h,const char *l=0)
: Fl_Button(x,y,w,h,l) {type(FL_RADIO_BUTTON);}
};
#endif
//
// End of "$Id: Fl_Radio_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,42 @@
//
// "$Id: Fl_Radio_Light_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Radio light button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Radio_Light_Button_H
#define Fl_Radio_Light_Button_H
#include "Fl_Light_Button.H"
class Fl_Radio_Light_Button : public Fl_Light_Button {
public:
Fl_Radio_Light_Button(int X,int Y,int W,int H,const char *l=0)
: Fl_Light_Button(X,Y,W,H,l) {type(FL_RADIO_BUTTON);}
};
#endif
//
// End of "$Id: Fl_Radio_Light_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Radio_Round_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Radio round button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Radio_Round_Button_H
#define Fl_Radio_Round_Button_H
#include "Fl_Round_Button.H"
class Fl_Radio_Round_Button : public Fl_Round_Button {
public:
Fl_Radio_Round_Button(int x,int y,int w,int h,const char *l=0)
: Fl_Round_Button(x,y,w,h,l) {type(FL_RADIO_BUTTON);}
};
#endif
//
// End of "$Id: Fl_Radio_Round_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,49 @@
//
// "$Id: Fl_Repeat_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Repeat button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Repeat_Button_H
#define Fl_Repeat_Button_H
#include "Fl.H"
#include "Fl_Button.H"
class FL_EXPORT Fl_Repeat_Button : public Fl_Button {
static void repeat_callback(void *);
public:
int handle(int);
Fl_Repeat_Button(int X,int Y,int W,int H,const char *l=0)
: Fl_Button(X,Y,W,H,l) {}
void deactivate() {
Fl::remove_timeout(repeat_callback,this);
Fl_Button::deactivate();
}
};
#endif
//
// End of "$Id: Fl_Repeat_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,45 @@
//
// "$Id: Fl_Return_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Return button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Return_Button_H
#define Fl_Return_Button_H
#include "Fl_Button.H"
class FL_EXPORT Fl_Return_Button : public Fl_Button {
protected:
void draw();
public:
int handle(int);
Fl_Return_Button(int X, int Y, int W, int H,const char *l=0)
: Fl_Button(X,Y,W,H,l) {}
};
#endif
//
// End of "$Id: Fl_Return_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,47 @@
//
// "$Id: Fl_Roller.H 4288 2005-04-16 00:13:17Z mike $"
//
// Roller header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Roller_H
#define Fl_Roller_H
#ifndef Fl_Valuator_H
#include "Fl_Valuator.H"
#endif
class FL_EXPORT Fl_Roller : public Fl_Valuator {
protected:
void draw();
public:
int handle(int);
Fl_Roller(int X,int Y,int W,int H,const char* L=0);
};
#endif
//
// End of "$Id: Fl_Roller.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,42 @@
//
// "$Id: Fl_Round_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Round button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Round_Button_H
#define Fl_Round_Button_H
#include "Fl_Light_Button.H"
class FL_EXPORT Fl_Round_Button : public Fl_Light_Button {
public:
Fl_Round_Button(int x,int y,int w,int h,const char *l = 0);
};
#endif
//
// End of "$Id: Fl_Round_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Round_Clock.H 4288 2005-04-16 00:13:17Z mike $"
//
// Round clock header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Round_Clock_H
#define Fl_Round_Clock_H
#include "Fl_Clock.H"
class Fl_Round_Clock : public Fl_Clock {
public:
Fl_Round_Clock(int x,int y,int w,int h, const char *l = 0)
: Fl_Clock(x,y,w,h,l) {type(FL_ROUND_CLOCK); box(FL_NO_BOX);}
};
#endif
//
// End of "$Id: Fl_Round_Clock.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,79 @@
//
// "$Id: Fl_Scroll.H 4288 2005-04-16 00:13:17Z mike $"
//
// Scroll header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Scroll_H
#define Fl_Scroll_H
#include "Fl_Group.H"
#include "Fl_Scrollbar.H"
class FL_EXPORT Fl_Scroll : public Fl_Group {
int xposition_, yposition_;
int width_, height_;
int oldx, oldy;
static void hscrollbar_cb(Fl_Widget*, void*);
static void scrollbar_cb(Fl_Widget*, void*);
void fix_scrollbar_order();
static void draw_clip(void*,int,int,int,int);
void bbox(int&,int&,int&,int&);
protected:
void draw();
public:
Fl_Scrollbar scrollbar;
Fl_Scrollbar hscrollbar;
void resize(int,int,int,int);
int handle(int);
Fl_Scroll(int X,int Y,int W,int H,const char*l=0);
enum { // values for type()
HORIZONTAL = 1,
VERTICAL = 2,
BOTH = 3,
ALWAYS_ON = 4,
HORIZONTAL_ALWAYS = 5,
VERTICAL_ALWAYS = 6,
BOTH_ALWAYS = 7
};
int xposition() const {return xposition_;}
int yposition() const {return yposition_;}
void position(int, int);
void clear();
};
#endif
//
// End of "$Id: Fl_Scroll.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,60 @@
//
// "$Id: Fl_Scrollbar.H 4288 2005-04-16 00:13:17Z mike $"
//
// Scroll bar header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Scrollbar_H
#define Fl_Scrollbar_H
#include "Fl_Slider.H"
class FL_EXPORT Fl_Scrollbar : public Fl_Slider {
int linesize_;
int pushed_;
static void timeout_cb(void*);
void increment_cb();
protected:
void draw();
public:
Fl_Scrollbar(int x,int y,int w,int h, const char *l = 0);
int handle(int);
int value() {return int(Fl_Slider::value());}
int value(int p, int s, int top, int total) {
return scrollvalue(p, s, top, total);
}
int linesize() const {return linesize_;}
void linesize(int i) {linesize_ = i;}
};
#endif
//
// End of "$Id: Fl_Scrollbar.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Secret_Input.H 4288 2005-04-16 00:13:17Z mike $"
//
// Secret input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Secret_Input_H
#define Fl_Secret_Input_H
#include "Fl_Input.H"
class Fl_Secret_Input : public Fl_Input {
public:
Fl_Secret_Input(int X,int Y,int W,int H,const char *l = 0)
: Fl_Input(X,Y,W,H,l) {type(FL_SECRET_INPUT);}
};
#endif
//
// End of "$Id: Fl_Secret_Input.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Select_Browser.H 4288 2005-04-16 00:13:17Z mike $"
//
// Select browser header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Select_Browser_H
#define Fl_Select_Browser_H
#include "Fl_Browser.H"
class Fl_Select_Browser : public Fl_Browser {
public:
Fl_Select_Browser(int X,int Y,int W,int H,const char *l=0)
: Fl_Browser(X,Y,W,H,l) {type(FL_SELECT_BROWSER);}
};
#endif
//
// End of "$Id: Fl_Select_Browser.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,99 @@
//
// "$Id: Fl_Shared_Image.H 4288 2005-04-16 00:13:17Z mike $"
//
// Shared image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Shared_Image_H
# define Fl_Shared_Image_H
# include "Fl_Image.H"
// Test function for adding new formats
typedef Fl_Image *(*Fl_Shared_Handler)(const char *name, uchar *header,
int headerlen);
// Shared images class.
class FL_EXPORT Fl_Shared_Image : public Fl_Image {
protected:
static Fl_Shared_Image **images_; // Shared images
static int num_images_; // Number of shared images
static int alloc_images_; // Allocated shared images
static Fl_Shared_Handler *handlers_; // Additional format handlers
static int num_handlers_; // Number of format handlers
static int alloc_handlers_; // Allocated format handlers
const char *name_; // Name of image file
int original_; // Original image?
int refcount_; // Number of times this image has been used
Fl_Image *image_; // The image that is shared
int alloc_image_; // Was the image allocated?
static int compare(Fl_Shared_Image **i0, Fl_Shared_Image **i1);
// Use get() and release() to load/delete images in memory...
Fl_Shared_Image();
Fl_Shared_Image(const char *n, Fl_Image *img = 0);
virtual ~Fl_Shared_Image();
void add();
void update();
public:
const char *name() { return name_; }
int refcount() { return refcount_; }
void release();
void reload();
virtual Fl_Image *copy(int W, int H);
Fl_Image *copy() { return copy(w(), h()); }
virtual void color_average(Fl_Color c, float i);
virtual void desaturate();
virtual void draw(int X, int Y, int W, int H, int cx, int cy);
void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); }
virtual void uncache();
static Fl_Shared_Image *find(const char *n, int W = 0, int H = 0);
static Fl_Shared_Image *get(const char *n, int W = 0, int H = 0);
static Fl_Shared_Image **images();
static int num_images();
static void add_handler(Fl_Shared_Handler f);
static void remove_handler(Fl_Shared_Handler f);
};
//
// The following function is provided in the fltk_images library and
// registers all of the "extra" image file formats that are not part
// of the core FLTK library...
//
FL_EXPORT extern void fl_register_images();
#endif // !Fl_Shared_Image_H
//
// End of "$Id: Fl_Shared_Image.H 4288 2005-04-16 00:13:17Z mike $"
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Simple_Counter.H 4288 2005-04-16 00:13:17Z mike $"
//
// Simple counter header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Simple_Counter_H
#define Fl_Simple_Counter_H
#include "Fl_Counter.H"
class Fl_Simple_Counter : public Fl_Counter {
public:
Fl_Simple_Counter(int x,int y,int w,int h, const char *l = 0)
: Fl_Counter(x,y,w,h,l) {type(FL_SIMPLE_COUNTER);}
};
#endif
//
// End of "$Id: Fl_Simple_Counter.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,49 @@
//
// "$Id: Fl_Single_Window.H 4288 2005-04-16 00:13:17Z mike $"
//
// Single-buffered window header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Single_Window_H
#define Fl_Single_Window_H
#include "Fl_Window.H"
class FL_EXPORT Fl_Single_Window : public Fl_Window {
public:
void show();
void show(int a, char **b) {Fl_Window::show(a,b);}
void flush();
Fl_Single_Window(int W, int H, const char *l=0)
: Fl_Window(W,H,l) {}
Fl_Single_Window(int X, int Y, int W, int H, const char *l=0)
: Fl_Window(X,Y,W,H,l) {}
int make_current();
};
#endif
//
// End of "$Id: Fl_Single_Window.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,75 @@
//
// "$Id: Fl_Slider.H 4288 2005-04-16 00:13:17Z mike $"
//
// Slider header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Slider_H
#define Fl_Slider_H
#ifndef Fl_Valuator_H
#include "Fl_Valuator.H"
#endif
// values for type(), lowest bit indicate horizontal:
#define FL_VERT_SLIDER 0
#define FL_HOR_SLIDER 1
#define FL_VERT_FILL_SLIDER 2
#define FL_HOR_FILL_SLIDER 3
#define FL_VERT_NICE_SLIDER 4
#define FL_HOR_NICE_SLIDER 5
class FL_EXPORT Fl_Slider : public Fl_Valuator {
float slider_size_;
uchar slider_;
void _Fl_Slider();
void draw_bg(int, int, int, int);
protected:
// these allow subclasses to put the slider in a smaller area:
void draw(int, int, int, int);
int handle(int, int, int, int, int);
public:
void draw();
int handle(int);
Fl_Slider(int x,int y,int w,int h, const char *l = 0);
Fl_Slider(uchar t,int x,int y,int w,int h, const char *l);
int scrollvalue(int windowtop,int windowsize,int first,int totalsize);
void bounds(double a, double b);
float slider_size() const {return slider_size_;}
void slider_size(double v);
Fl_Boxtype slider() const {return (Fl_Boxtype)slider_;}
void slider(Fl_Boxtype c) {slider_ = c;}
};
#endif
//
// End of "$Id: Fl_Slider.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,171 @@
//
// "$Id$"
//
// Spinner widget for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Spinner_H
# define Fl_Spinner_H
//
// Include necessary headers...
//
# include <FL/Fl_Group.H>
# include <FL/Fl_Input.H>
# include <FL/Fl_Repeat_Button.H>
# include <stdio.h>
# include <stdlib.h>
//
// Fl_Spinner widget class...
//
class Fl_Spinner : public Fl_Group
{
double value_; // Current value
double minimum_; // Minimum value
double maximum_; // Maximum value
double step_; // Amount to add/subtract for up/down
const char *format_; // Format string
Fl_Input input_; // Input field for the value
Fl_Repeat_Button
up_button_, // Up button
down_button_; // Down button
static void sb_cb(Fl_Widget *w, Fl_Spinner *sb) {
double v; // New value
if (w == &(sb->input_)) {
// Something changed in the input field...
v = atof(sb->input_.value());
if (v < sb->minimum_) {
sb->value_ = sb->minimum_;
sb->update();
} else if (v > sb->maximum_) {
sb->value_ = sb->maximum_;
sb->update();
} else sb->value_ = v;
} else if (w == &(sb->up_button_)) {
// Up button pressed...
v = sb->value_ + sb->step_;
if (v > sb->maximum_) sb->value_ = sb->minimum_;
else sb->value_ = v;
sb->update();
} else if (w == &(sb->down_button_)) {
// Down button pressed...
v = sb->value_ - sb->step_;
if (v < sb->minimum_) sb->value_ = sb->maximum_;
else sb->value_ = v;
sb->update();
}
sb->do_callback();
}
void update() {
char s[255]; // Value string
sprintf(s, format_, value_);
input_.value(s);
}
public:
Fl_Spinner(int X, int Y, int W, int H, const char *L = 0)
: Fl_Group(X, Y, W, H, L),
input_(X, Y, W - H / 2 - 2, H),
up_button_(X + W - H / 2 - 2, Y, H / 2 + 2, H / 2, "@-22<"),
down_button_(X + W - H / 2 - 2, Y + H - H / 2,
H / 2 + 2, H / 2, "@-22>") {
end();
value_ = 1.0;
minimum_ = 1.0;
maximum_ = 100.0;
step_ = 1.0;
format_ = "%.0f";
align(FL_ALIGN_LEFT);
input_.value("1");
input_.type(FL_INT_INPUT);
input_.when(FL_WHEN_CHANGED);
input_.callback((Fl_Callback *)sb_cb, this);
up_button_.callback((Fl_Callback *)sb_cb, this);
down_button_.callback((Fl_Callback *)sb_cb, this);
}
const char *format() { return (format_); }
void format(const char *f) { format_ = f; update(); }
double maxinum() const { return (maximum_); }
void maximum(double m) { maximum_ = m; }
double mininum() const { return (minimum_); }
void minimum(double m) { minimum_ = m; }
void range(double a, double b) { minimum_ = a; maximum_ = b; }
void resize(int X, int Y, int W, int H) {
Fl_Group::resize(X,Y,W,H);
input_.resize(X, Y, W - H / 2 - 2, H);
up_button_.resize(X + W - H / 2 - 2, Y, H / 2 + 2, H / 2);
down_button_.resize(X + W - H / 2 - 2, Y + H - H / 2,
H / 2 + 2, H / 2);
}
double step() const { return (step_); }
void step(double s) { step_ = s; }
Fl_Color textcolor() const {
return (input_.textcolor());
}
void textcolor(Fl_Color c) {
input_.textcolor(c);
}
uchar textfont() const {
return (input_.textfont());
}
void textfont(uchar f) {
input_.textfont(f);
}
uchar textsize() const {
return (input_.textsize());
}
void textsize(uchar s) {
input_.textsize(s);
}
double value() const { return (value_); }
void value(double v) { value_ = v; update(); }
};
#endif // !Fl_Spinner_H
//
// End of "$Id$".
//

View File

@@ -0,0 +1,56 @@
//
// "$Id: Fl_Sys_Menu_Bar.H 4546 2005-08-29 20:05:38Z matt $"
//
// MacOS system menu bar header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Sys_Menu_Bar_H
#define Fl_Sys_Menu_Bar_H
#include "Fl_Menu_Bar.H"
#ifdef __APPLE__
class FL_EXPORT Fl_Sys_Menu_Bar : public Fl_Menu_Bar {
protected:
void draw();
public:
Fl_Sys_Menu_Bar(int x,int y,int w,int h,const char *l=0)
: Fl_Menu_Bar(x,y,w,h,l) {
deactivate(); // don't let the old area take events
}
void menu(const Fl_Menu_Item *m);
};
#else
typedef Fl_Menu_Bar Fl_Sys_Menu_Bar;
#endif
#endif
//
// End of "$Id: Fl_Sys_Menu_Bar.H 4546 2005-08-29 20:05:38Z matt $".
//

View File

@@ -0,0 +1,56 @@
//
// "$Id: Fl_Tabs.H 4288 2005-04-16 00:13:17Z mike $"
//
// Tab header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Tabs_H
#define Fl_Tabs_H
#include "Fl_Group.H"
class FL_EXPORT Fl_Tabs : public Fl_Group {
Fl_Widget *value_;
Fl_Widget *push_;
int tab_positions(int*, int*);
int tab_height();
void draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int sel=0);
protected:
void draw();
public:
int handle(int);
Fl_Widget *value();
int value(Fl_Widget *);
Fl_Widget *push() const {return push_;}
int push(Fl_Widget *);
Fl_Tabs(int,int,int,int,const char * = 0);
Fl_Widget *which(int event_x, int event_y);
};
#endif
//
// End of "$Id: Fl_Tabs.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,259 @@
//
// "$Id: Fl_Text_Buffer.H 4288 2005-04-16 00:13:17Z mike $"
//
// Header file for Fl_Text_Buffer class.
//
// Copyright 2001-2005 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
// the LGPL for the FLTK library granted by Mark Edel.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef FL_TEXT_BUFFER_H
#define FL_TEXT_BUFFER_H
/* Maximum length in characters of a tab or control character expansion
of a single buffer character */
#define FL_TEXT_MAX_EXP_CHAR_LEN 20
#include "Fl_Export.H"
class FL_EXPORT Fl_Text_Selection {
friend class Fl_Text_Buffer;
public:
void set(int start, int end);
void set_rectangular(int start, int end, int rectStart, int rectEnd);
void update(int pos, int nDeleted, int nInserted);
char rectangular() { return mRectangular; }
int start() { return mStart; }
int end() { return mEnd; }
int rect_start() { return mRectStart; }
int rect_end() { return mRectEnd; }
char selected() { return mSelected; }
void selected(char b) { mSelected = b; }
int includes(int pos, int lineStartPos, int dispIndex);
int position(int* start, int* end);
int position(int* start, int* end, int* isRect, int* rectStart, int* rectEnd);
protected:
char mSelected;
char mRectangular;
int mStart;
int mEnd;
int mRectStart;
int mRectEnd;
};
typedef void (*Fl_Text_Modify_Cb)(int pos, int nInserted, int nDeleted,
int nRestyled, const char* deletedText,
void* cbArg);
typedef void (*Fl_Text_Predelete_Cb)(int pos, int nDeleted, void* cbArg);
class FL_EXPORT Fl_Text_Buffer {
public:
Fl_Text_Buffer(int requestedSize = 0);
~Fl_Text_Buffer();
int length() { return mLength; }
char* text();
void text(const char* text);
char* text_range(int start, int end);
char character(int pos);
char* text_in_rectangle(int start, int end, int rectStart, int rectEnd);
void insert(int pos, const char* text);
void append(const char* t) { insert(length(), t); }
void remove(int start, int end);
void replace(int start, int end, const char *text);
void copy(Fl_Text_Buffer* fromBuf, int fromStart, int fromEnd, int toPos);
int undo(int *cp=0);
void canUndo(char flag=1);
int insertfile(const char *file, int pos, int buflen = 128*1024);
int appendfile(const char *file, int buflen = 128*1024)
{ return insertfile(file, length(), buflen); }
int loadfile(const char *file, int buflen = 128*1024)
{ select(0, length()); remove_selection(); return appendfile(file, buflen); }
int outputfile(const char *file, int start, int end, int buflen = 128*1024);
int savefile(const char *file, int buflen = 128*1024)
{ return outputfile(file, 0, length(), buflen); }
void insert_column(int column, int startPos, const char* text,
int* charsInserted, int* charsDeleted);
void replace_rectangular(int start, int end, int rectStart, int rectEnd,
const char* text);
void overlay_rectangular(int startPos, int rectStart, int rectEnd,
const char* text, int* charsInserted,
int* charsDeleted);
void remove_rectangular(int start, int end, int rectStart, int rectEnd);
void clear_rectangular(int start, int end, int rectStart, int rectEnd);
int tab_distance() { return mTabDist; }
void tab_distance(int tabDist);
void select(int start, int end);
int selected() { return mPrimary.selected(); }
void unselect();
void select_rectangular(int start, int end, int rectStart, int rectEnd);
int selection_position(int* start, int* end);
int selection_position(int* start, int* end, int* isRect, int* rectStart,
int* rectEnd);
char* selection_text();
void remove_selection();
void replace_selection(const char* text);
void secondary_select(int start, int end);
void secondary_unselect();
void secondary_select_rectangular(int start, int end, int rectStart,
int rectEnd);
int secondary_selection_position(int* start, int* end, int* isRect,
int* rectStart, int* rectEnd);
char* secondary_selection_text();
void remove_secondary_selection();
void replace_secondary_selection(const char* text);
void highlight(int start, int end);
void unhighlight();
void highlight_rectangular(int start, int end, int rectStart, int rectEnd);
int highlight_position(int* start, int* end, int* isRect, int* rectStart,
int* rectEnd);
char* highlight_text();
void add_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, void* cbArg);
void remove_modify_callback(Fl_Text_Modify_Cb bufModifiedCB, void* cbArg);
void call_modify_callbacks() { call_modify_callbacks(0, 0, 0, 0, 0); }
void add_predelete_callback(Fl_Text_Predelete_Cb bufPredelCB, void* cbArg);
void remove_predelete_callback(Fl_Text_Predelete_Cb predelCB, void* cbArg);
void call_predelete_callbacks() { call_predelete_callbacks(0, 0); }
char* line_text(int pos);
int line_start(int pos);
int line_end(int pos);
int word_start(int pos);
int word_end(int pos);
int expand_character(int pos, int indent, char *outStr);
static int expand_character(char c, int indent, char* outStr, int tabDist,
char nullSubsChar);
static int character_width(char c, int indent, int tabDist, char nullSubsChar);
int count_displayed_characters(int lineStartPos, int targetPos);
int skip_displayed_characters(int lineStartPos, int nChars);
int count_lines(int startPos, int endPos);
int skip_lines(int startPos, int nLines);
int rewind_lines(int startPos, int nLines);
int findchar_forward(int startPos, char searchChar, int* foundPos);
int findchar_backward(int startPos, char searchChar, int* foundPos);
int findchars_forward(int startPos, const char* searchChars, int* foundPos);
int findchars_backward(int startPos, const char* searchChars, int* foundPos);
int search_forward(int startPos, const char* searchString, int* foundPos,
int matchCase = 0);
int search_backward(int startPos, const char* searchString, int* foundPos,
int matchCase = 0);
int substitute_null_characters(char* string, int length);
void unsubstitute_null_characters(char* string);
char null_substitution_character() { return mNullSubsChar; }
Fl_Text_Selection* primary_selection() { return &mPrimary; }
Fl_Text_Selection* secondary_selection() { return &mSecondary; }
Fl_Text_Selection* highlight_selection() { return &mHighlight; }
protected:
void call_modify_callbacks(int pos, int nDeleted, int nInserted,
int nRestyled, const char* deletedText);
void call_predelete_callbacks(int pos, int nDeleted);
int insert_(int pos, const char* text);
void remove_(int start, int end);
void remove_rectangular_(int start, int end, int rectStart, int rectEnd,
int* replaceLen, int* endPos);
void insert_column_(int column, int startPos, const char* insText,
int* nDeleted, int* nInserted, int* endPos);
void overlay_rectangular_(int startPos, int rectStart, int rectEnd,
const char* insText, int* nDeleted,
int* nInserted, int* endPos);
void redisplay_selection(Fl_Text_Selection* oldSelection,
Fl_Text_Selection* newSelection);
void move_gap(int pos);
void reallocate_with_gap(int newGapStart, int newGapLen);
char* selection_text_(Fl_Text_Selection* sel);
void remove_selection_(Fl_Text_Selection* sel);
void replace_selection_(Fl_Text_Selection* sel, const char* text);
void rectangular_selection_boundaries(int lineStartPos, int rectStart,
int rectEnd, int* selStart,
int* selEnd);
void update_selections(int pos, int nDeleted, int nInserted);
Fl_Text_Selection mPrimary; /* highlighted areas */
Fl_Text_Selection mSecondary;
Fl_Text_Selection mHighlight;
int mLength; /* length of the text in the buffer (the length
of the buffer itself must be calculated:
gapEnd - gapStart + length) */
char* mBuf; /* allocated memory where the text is stored */
int mGapStart; /* points to the first character of the gap */
int mGapEnd; /* points to the first char after the gap */
// The hardware tab distance used by all displays for this buffer,
// and used in computing offsets for rectangular selection operations.
int mTabDist; /* equiv. number of characters in a tab */
int mUseTabs; /* True if buffer routines are allowed to use
tabs for padding in rectangular operations */
int mNModifyProcs; /* number of modify-redisplay procs attached */
Fl_Text_Modify_Cb* /* procedures to call when buffer is */
mNodifyProcs; /* modified to redisplay contents */
void** mCbArgs; /* caller arguments for modifyProcs above */
int mNPredeleteProcs; /* number of pre-delete procs attached */
Fl_Text_Predelete_Cb* /* procedure to call before text is deleted */
mPredeleteProcs; /* from the buffer; at most one is supported. */
void **mPredeleteCbArgs; /* caller argument for pre-delete proc above */
int mCursorPosHint; /* hint for reasonable cursor position after
a buffer modification operation */
char mNullSubsChar; /* NEdit is based on C null-terminated strings,
so ascii-nul characters must be substituted
with something else. This is the else, but
of course, things get quite messy when you
use it */
char mCanUndo; /* if this buffer is used for attributes, it must
not do any undo calls */
};
#endif
//
// End of "$Id: Fl_Text_Buffer.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,298 @@
//
// "$Id: Fl_Text_Display.H 4502 2005-08-10 23:11:51Z matt $"
//
// Header file for Fl_Text_Display class.
//
// Copyright 2001-2005 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
// the LGPL for the FLTK library granted by Mark Edel.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef FL_TEXT_DISPLAY_H
#define FL_TEXT_DISPLAY_H
#include "fl_draw.H"
#include "Fl_Group.H"
#include "Fl_Widget.H"
#include "Fl_Scrollbar.H"
#include "Fl_Text_Buffer.H"
class FL_EXPORT Fl_Text_Display: public Fl_Group {
public:
enum {
NORMAL_CURSOR, CARET_CURSOR, DIM_CURSOR,
BLOCK_CURSOR, HEAVY_CURSOR
};
enum {
CURSOR_POS, CHARACTER_POS
};
// drag types- they match Fl::event_clicks() so that single clicking to
// start a collection selects by character, double clicking selects by
// word and triple clicking selects by line.
enum {
DRAG_CHAR = 0, DRAG_WORD = 1, DRAG_LINE = 2
};
friend void fl_text_drag_me(int pos, Fl_Text_Display* d);
typedef void (*Unfinished_Style_Cb)(int, void *);
// style attributes - currently not implemented!
enum {
ATTR_NONE = 0,
ATTR_UNDERLINE = 1,
ATTR_HIDDEN = 2
};
struct Style_Table_Entry {
Fl_Color color;
Fl_Font font;
int size;
unsigned attr;
};
Fl_Text_Display(int X, int Y, int W, int H, const char *l = 0);
~Fl_Text_Display();
virtual int handle(int e);
void buffer(Fl_Text_Buffer* buf);
void buffer(Fl_Text_Buffer& buf) { buffer(&buf); }
Fl_Text_Buffer* buffer() { return mBuffer; }
void redisplay_range(int start, int end);
void scroll(int topLineNum, int horizOffset);
void insert(const char* text);
void overstrike(const char* text);
void insert_position(int newPos);
int insert_position() { return mCursorPos; }
int in_selection(int x, int y);
void show_insert_position();
int move_right();
int move_left();
int move_up();
int move_down();
int count_lines(int start, int end, bool start_pos_is_line_start);
int line_start(int pos);
int line_end(int pos, bool start_pos_is_line_start);
int skip_lines(int startPos, int nLines, bool startPosIsLineStart);
int rewind_lines(int startPos, int nLines);
void next_word(void);
void previous_word(void);
void show_cursor(int b = 1);
void hide_cursor() { show_cursor(0); }
void cursor_style(int style);
Fl_Color cursor_color() const {return mCursor_color;}
void cursor_color(Fl_Color n) {mCursor_color = n;}
int scrollbar_width() { return scrollbar_width_; }
Fl_Align scrollbar_align() { return scrollbar_align_; }
void scrollbar_width(int W) { scrollbar_width_ = W; }
void scrollbar_align(Fl_Align a) { scrollbar_align_ = a; }
int word_start(int pos) { return buffer()->word_start(pos); }
int word_end(int pos) { return buffer()->word_end(pos); }
void highlight_data(Fl_Text_Buffer *styleBuffer,
const Style_Table_Entry *styleTable,
int nStyles, char unfinishedStyle,
Unfinished_Style_Cb unfinishedHighlightCB,
void *cbArg);
int position_style(int lineStartPos, int lineLen, int lineIndex,
int dispIndex);
Fl_Font textfont() const {return (Fl_Font)textfont_;}
void textfont(uchar s) {textfont_ = s;}
uchar textsize() const {return textsize_;}
void textsize(uchar s) {textsize_ = s;}
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
void textcolor(unsigned n) {textcolor_ = n;}
int wrapped_column(int row, int column);
int wrapped_row(int row);
void wrap_mode(int wrap, int wrap_margin);
virtual void resize(int X, int Y, int W, int H);
protected:
// Most (all?) of this stuff should only be called from resize() or
// draw().
// Anything with "vline" indicates thats it deals with currently
// visible lines.
virtual void draw();
void draw_text(int X, int Y, int W, int H);
void draw_range(int start, int end);
void draw_cursor(int, int);
void draw_string(int style, int x, int y, int toX, const char *string,
int nChars);
void draw_vline(int visLineNum, int leftClip, int rightClip,
int leftCharIndex, int rightCharIndex);
void draw_line_numbers(bool clearAll);
void clear_rect(int style, int x, int y, int width, int height);
void display_insert();
void offset_line_starts(int newTopLineNum);
void calc_line_starts(int startLine, int endLine);
void update_line_starts(int pos, int charsInserted, int charsDeleted,
int linesInserted, int linesDeleted, int *scrolled);
void calc_last_char();
int position_to_line( int pos, int* lineNum );
int string_width(const char* string, int length, int style);
static void scroll_timer_cb(void*);
static void buffer_predelete_cb(int pos, int nDeleted, void* cbArg);
static void buffer_modified_cb(int pos, int nInserted, int nDeleted,
int nRestyled, const char* deletedText,
void* cbArg);
static void h_scrollbar_cb(Fl_Scrollbar* w, Fl_Text_Display* d);
static void v_scrollbar_cb( Fl_Scrollbar* w, Fl_Text_Display* d);
void update_v_scrollbar();
void update_h_scrollbar();
int measure_vline(int visLineNum);
int longest_vline();
int empty_vlines();
int vline_length(int visLineNum);
int xy_to_position(int x, int y, int PosType = CHARACTER_POS);
void xy_to_rowcol(int x, int y, int* row, int* column,
int PosType = CHARACTER_POS);
int position_to_xy(int pos, int* x, int* y);
void maintain_absolute_top_line_number(int state);
int get_absolute_top_line_number();
void absolute_top_line_number(int oldFirstChar);
int maintaining_absolute_top_line_number();
void reset_absolute_top_line_number();
int position_to_linecol(int pos, int* lineNum, int* column);
void scroll_(int topLineNum, int horizOffset);
void extend_range_for_styles(int* start, int* end);
void find_wrap_range(const char *deletedText, int pos, int nInserted,
int nDeleted, int *modRangeStart, int *modRangeEnd,
int *linesInserted, int *linesDeleted);
void measure_deleted_lines(int pos, int nDeleted);
void wrapped_line_counter(Fl_Text_Buffer *buf, int startPos, int maxPos,
int maxLines, bool startPosIsLineStart,
int styleBufOffset, int *retPos, int *retLines,
int *retLineStart, int *retLineEnd,
bool countLastLineMissingNewLine = true);
void find_line_end(int pos, bool start_pos_is_line_start, int *lineEnd,
int *nextLineStart);
int measure_proportional_character(char c, int colNum, int pos);
int wrap_uses_character(int lineEndPos);
int range_touches_selection(Fl_Text_Selection *sel, int rangeStart,
int rangeEnd);
int damage_range1_start, damage_range1_end;
int damage_range2_start, damage_range2_end;
int mCursorPos;
int mCursorOn;
int mCursorOldY; /* Y pos. of cursor for blanking */
int mCursorToHint; /* Tells the buffer modified callback
where to move the cursor, to reduce
the number of redraw calls */
int mCursorStyle; /* One of enum cursorStyles above */
int mCursorPreferredCol; /* Column for vert. cursor movement */
int mNVisibleLines; /* # of visible (displayed) lines */
int mNBufferLines; /* # of newlines in the buffer */
Fl_Text_Buffer* mBuffer; /* Contains text to be displayed */
Fl_Text_Buffer* mStyleBuffer; /* Optional parallel buffer containing
color and font information */
int mFirstChar, mLastChar; /* Buffer positions of first and last
displayed character (lastChar points
either to a newline or one character
beyond the end of the buffer) */
int mContinuousWrap; /* Wrap long lines when displaying */
int mWrapMargin; /* Margin in # of char positions for
wrapping in continuousWrap mode */
int* mLineStarts;
int mTopLineNum; /* Line number of top displayed line
of file (first line of file is 1) */
int mAbsTopLineNum; /* In continuous wrap mode, the line
number of the top line if the text
were not wrapped (note that this is
only maintained as needed). */
int mNeedAbsTopLineNum; /* Externally settable flag to continue
maintaining absTopLineNum even if
it isn't needed for line # display */
int mHorizOffset; /* Horizontal scroll pos. in pixels */
int mTopLineNumHint; /* Line number of top displayed line
of file (first line of file is 1) */
int mHorizOffsetHint; /* Horizontal scroll pos. in pixels */
int mNStyles; /* Number of entries in styleTable */
const Style_Table_Entry *mStyleTable; /* Table of fonts and colors for
coloring/syntax-highlighting */
char mUnfinishedStyle; /* Style buffer entry which triggers
on-the-fly reparsing of region */
Unfinished_Style_Cb mUnfinishedHighlightCB; /* Callback to parse "unfinished" */
/* regions */
void* mHighlightCBArg; /* Arg to unfinishedHighlightCB */
int mMaxsize;
int mFixedFontWidth; /* Font width if all current fonts are
fixed and match in width, else -1 */
int mSuppressResync; /* Suppress resynchronization of line
starts during buffer updates */
int mNLinesDeleted; /* Number of lines deleted during
buffer modification (only used
when resynchronization is suppressed) */
int mModifyingTabDistance; /* Whether tab distance is being
modified */
Fl_Color mCursor_color;
Fl_Scrollbar* mHScrollBar;
Fl_Scrollbar* mVScrollBar;
int scrollbar_width_;
Fl_Align scrollbar_align_;
int dragPos, dragType, dragging;
int display_insert_position_hint;
struct { int x, y, w, h; } text_area;
uchar textfont_;
uchar textsize_;
unsigned textcolor_;
// The following are not presently used from the original NEdit code,
// but are being put here so that future versions of Fl_Text_Display
// can implement line numbers without breaking binary compatibility.
int mLineNumLeft, mLineNumWidth;
/* Line number margin and width */
};
#endif
//
// End of "$Id: Fl_Text_Display.H 4502 2005-08-10 23:11:51Z matt $".
//

View File

@@ -0,0 +1,110 @@
//
// "$Id: Fl_Text_Editor.H 4288 2005-04-16 00:13:17Z mike $"
//
// Header file for Fl_Text_Editor class.
//
// Copyright 2001-2005 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
// the LGPL for the FLTK library granted by Mark Edel.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef FL_TEXT_EDITOR_H
#define FL_TEXT_EDITOR_H
#include "Fl_Text_Display.H"
// key will match in any state
#define FL_TEXT_EDITOR_ANY_STATE (-1L)
class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display {
public:
typedef int (*Key_Func)(int key, Fl_Text_Editor* editor);
struct Key_Binding {
int key;
int state;
Key_Func function;
Key_Binding* next;
};
Fl_Text_Editor(int X, int Y, int W, int H, const char* l = 0);
~Fl_Text_Editor() { remove_all_key_bindings(); }
virtual int handle(int e);
void insert_mode(int b) { insert_mode_ = b; }
int insert_mode() { return insert_mode_; }
void add_key_binding(int key, int state, Key_Func f, Key_Binding** list);
void add_key_binding(int key, int state, Key_Func f)
{ add_key_binding(key, state, f, &key_bindings); }
void remove_key_binding(int key, int state, Key_Binding** list);
void remove_key_binding(int key, int state)
{ remove_key_binding(key, state, &key_bindings); }
void remove_all_key_bindings(Key_Binding** list);
void remove_all_key_bindings() { remove_all_key_bindings(&key_bindings); }
void add_default_key_bindings(Key_Binding** list);
Key_Func bound_key_function(int key, int state, Key_Binding* list);
Key_Func bound_key_function(int key, int state)
{ return bound_key_function(key, state, key_bindings); }
void default_key_function(Key_Func f) { default_key_function_ = f; }
// functions for the built in default bindings
static int kf_default(int c, Fl_Text_Editor* e);
static int kf_ignore(int c, Fl_Text_Editor* e);
static int kf_backspace(int c, Fl_Text_Editor* e);
static int kf_enter(int c, Fl_Text_Editor* e);
static int kf_move(int c, Fl_Text_Editor* e);
static int kf_shift_move(int c, Fl_Text_Editor* e);
static int kf_ctrl_move(int c, Fl_Text_Editor* e);
static int kf_c_s_move(int c, Fl_Text_Editor* e);
static int kf_home(int, Fl_Text_Editor* e);
static int kf_end(int c, Fl_Text_Editor* e);
static int kf_left(int c, Fl_Text_Editor* e);
static int kf_up(int c, Fl_Text_Editor* e);
static int kf_right(int c, Fl_Text_Editor* e);
static int kf_down(int c, Fl_Text_Editor* e);
static int kf_page_up(int c, Fl_Text_Editor* e);
static int kf_page_down(int c, Fl_Text_Editor* e);
static int kf_insert(int c, Fl_Text_Editor* e);
static int kf_delete(int c, Fl_Text_Editor* e);
static int kf_copy(int c, Fl_Text_Editor* e);
static int kf_cut(int c, Fl_Text_Editor* e);
static int kf_paste(int c, Fl_Text_Editor* e);
static int kf_select_all(int c, Fl_Text_Editor* e);
static int kf_undo(int c, Fl_Text_Editor* e);
protected:
int handle_key();
void maybe_do_callback();
int insert_mode_;
Key_Binding* key_bindings;
static Key_Binding* global_key_bindings;
Key_Func default_key_function_;
};
#endif
//
// End of "$Id: Fl_Text_Editor.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,45 @@
//
// "$Id: Fl_Tile.H 4288 2005-04-16 00:13:17Z mike $"
//
// Tile header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Tile_H
#define Fl_Tile_H
#include "Fl_Group.H"
class FL_EXPORT Fl_Tile : public Fl_Group {
public:
int handle(int);
Fl_Tile(int X,int Y,int W,int H,const char*l=0) : Fl_Group(X,Y,W,H,l) {}
void resize(int, int, int, int);
void position(int, int, int, int);
};
#endif
//
// End of "$Id: Fl_Tile.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,59 @@
//
// "$Id: Fl_Tiled_Image.H 4288 2005-04-16 00:13:17Z mike $"
//
// Tiled image header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Tiled_Image_H
# define Fl_Tiled_Image_H
# include "Fl_Image.H"
// Tiled image class.
class FL_EXPORT Fl_Tiled_Image : public Fl_Image {
protected:
Fl_Image *image_; // The image that is shared
int alloc_image_; // Did we allocate this image?
public:
Fl_Tiled_Image(Fl_Image *i, int W = 0, int H = 0);
virtual ~Fl_Tiled_Image();
virtual Fl_Image *copy(int W, int H);
Fl_Image *copy() { return copy(w(), h()); }
virtual void color_average(Fl_Color c, float i);
virtual void desaturate();
virtual void draw(int X, int Y, int W, int H, int cx, int cy);
void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); }
Fl_Image *image() { return image_; }
};
#endif // !Fl_Tiled_Image_H
//
// End of "$Id: Fl_Tiled_Image.H 4288 2005-04-16 00:13:17Z mike $"
//

View File

@@ -0,0 +1,65 @@
//
// "$Id: Fl_Timer.H 4288 2005-04-16 00:13:17Z mike $"
//
// Timer header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Timer_H
#define Fl_Timer_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
// values for type():
#define FL_NORMAL_TIMER 0
#define FL_VALUE_TIMER 1
#define FL_HIDDEN_TIMER 2
class FL_EXPORT Fl_Timer : public Fl_Widget {
static void stepcb(void *);
void step();
char on, direction_;
double delay, total;
long lastsec,lastusec;
protected:
void draw();
public:
int handle(int);
Fl_Timer(uchar t,int x,int y,int w,int h, const char *l);
~Fl_Timer();
void value(double);
double value() const {return delay>0.0?delay:0.0;}
char direction() const {return direction_;}
void direction(char d) {direction_ = d;}
char suspended() const {return !on;}
void suspended(char d);
};
#endif
//
// End of "$Id: Fl_Timer.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,43 @@
//
// "$Id: Fl_Toggle_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Toggle button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Toggle_Button_H
#define Fl_Toggle_Button_H
#include "Fl_Button.H"
class Fl_Toggle_Button : public Fl_Button {
public:
Fl_Toggle_Button(int X,int Y,int W,int H,const char *l=0)
: Fl_Button(X,Y,W,H,l) {type(FL_TOGGLE_BUTTON);}
};
#endif
//
// End of "$Id: Fl_Toggle_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,37 @@
//
// "$Id: Fl_Toggle_Light_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Toggle light button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// provided for back-compatability only
#ifndef Fl_Toggle_Light_Button
#include "Fl_Light_Button.H"
#define Fl_Toggle_Light_Button Fl_Light_Button
#endif
//
// End of "$Id: Fl_Toggle_Light_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,37 @@
//
// "$Id: Fl_Toggle_Round_Button.H 4288 2005-04-16 00:13:17Z mike $"
//
// Toggle round button header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
// provided for back-compatability only
#ifndef Fl_Toggle_Round_Button
#include "Fl_Round_Button.H"
#define Fl_Toggle_Round_Button Fl_Round_Button
#endif
//
// End of "$Id: Fl_Toggle_Round_Button.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,77 @@
//
// "$Id: Fl_Tooltip.H 4288 2005-04-16 00:13:17Z mike $"
//
// Tooltip header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Tooltip_H
#define Fl_Tooltip_H
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
class FL_EXPORT Fl_Tooltip {
public:
static float delay() { return delay_; }
static void delay(float f) { delay_ = f; }
static float hoverdelay() { return hoverdelay_; }
static void hoverdelay(float f) { hoverdelay_ = f; }
static int enabled() { return enabled_; }
static void enable(int b = 1) { enabled_ = b;}
static void disable() { enabled_ = 0; }
static void (*enter)(Fl_Widget* w);
static void enter_area(Fl_Widget* w, int X, int Y, int W, int H, const char* tip);
static void (*exit)(Fl_Widget *w);
static Fl_Widget* current() {return widget_;}
static void current(Fl_Widget*);
static int font() { return font_; }
static int size() { return size_; }
static void font(int i) { font_ = i; }
static void size(int s) { size_ = s; }
static void color(unsigned c) { color_ = c; }
static Fl_Color color() { return (Fl_Color)color_; }
static void textcolor(unsigned c) { textcolor_ = c; }
static Fl_Color textcolor() { return (Fl_Color)textcolor_; }
// These should not be public, but Fl_Widget::tooltip() needs them...
static void enter_(Fl_Widget* w);
static void exit_(Fl_Widget *w);
private:
static float delay_;
static float hoverdelay_;
static int enabled_;
static unsigned color_;
static unsigned textcolor_;
static int font_;
static int size_;
static Fl_Widget* widget_;
};
#endif
//
// End of "$Id: Fl_Tooltip.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,86 @@
//
// "$Id: Fl_Valuator.H 4288 2005-04-16 00:13:17Z mike $"
//
// Valuator header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Valuator_H
#define Fl_Valuator_H
#ifndef Fl_Widget_H
#include "Fl_Widget.H"
#endif
// shared type() values for classes that work in both directions:
#define FL_VERTICAL 0
#define FL_HORIZONTAL 1
class FL_EXPORT Fl_Valuator : public Fl_Widget {
double value_;
double previous_value_;
double min, max; // truncates to this range *after* rounding
double A; int B; // rounds to multiples of A/B, or no rounding if A is zero
protected:
int horizontal() const {return type()&1;}
Fl_Valuator(int X, int Y, int W, int H, const char* L);
double previous_value() const {return previous_value_;}
void handle_push() {previous_value_ = value_;}
double softclamp(double);
void handle_drag(double newvalue);
void handle_release(); // use drag() value
virtual void value_damage(); // cause damage() due to value() changing
void set_value(double v) {value_ = v;}
public:
void bounds(double a, double b) {min=a; max=b;}
double minimum() const {return min;}
void minimum(double a) {min = a;}
double maximum() const {return max;}
void maximum(double a) {max = a;}
void range(double a, double b) {min = a; max = b;}
void step(int a) {A = a; B = 1;}
void step(double a, int b) {A = a; B = b;}
void step(double s);
double step() const {return A/B;}
void precision(int);
double value() const {return value_;}
int value(double);
virtual int format(char*);
double round(double); // round to nearest multiple of step
double clamp(double); // keep in range
double increment(double, int); // add n*step to value
};
#endif
//
// End of "$Id: Fl_Valuator.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,65 @@
//
// "$Id: Fl_Value_Input.H 4288 2005-04-16 00:13:17Z mike $"
//
// Value input header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Value_Input_H
#define Fl_Value_Input_H
#include "Fl_Valuator.H"
#include "Fl_Input.H"
class FL_EXPORT Fl_Value_Input : public Fl_Valuator {
public:
Fl_Input input;
private:
char soft_;
static void input_cb(Fl_Widget*,void*);
virtual void value_damage(); // cause damage() due to value() changing
public:
int handle(int);
void draw();
void resize(int,int,int,int);
Fl_Value_Input(int x,int y,int w,int h,const char *l=0);
void soft(char s) {soft_ = s;}
char soft() const {return soft_;}
Fl_Font textfont() const {return input.textfont();}
void textfont(uchar s) {input.textfont(s);}
uchar textsize() const {return input.textsize();}
void textsize(uchar s) {input.textsize(s);}
Fl_Color textcolor() const {return input.textcolor();}
void textcolor(unsigned n) {input.textcolor(n);}
Fl_Color cursor_color() const {return input.cursor_color();}
void cursor_color(unsigned n) {input.cursor_color(n);}
};
#endif
//
// End of "$Id: Fl_Value_Input.H 4288 2005-04-16 00:13:17Z mike $".
//

View File

@@ -0,0 +1,58 @@
//
// "$Id: Fl_Value_Output.H 4288 2005-04-16 00:13:17Z mike $"
//
// Value output header file for the Fast Light Tool Kit (FLTK).
//
// Copyright 1998-2005 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
// You should have received a copy of the GNU Library General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
//
#ifndef Fl_Value_Output_H
#define Fl_Value_Output_H
#ifndef Fl_Valuator_H
#include "Fl_Valuator.H"
#endif
class FL_EXPORT Fl_Value_Output : public Fl_Valuator {
uchar textfont_, textsize_, soft_;
unsigned textcolor_;
public:
int handle(int);
void draw();
Fl_Value_Output(int x,int y,int w,int h,const char *l=0);
void soft(uchar s) {soft_ = s;}
uchar soft() const {return soft_;}
Fl_Font textfont() const {return (Fl_Font)textfont_;}
void textfont(uchar s) {textfont_ = s;}
uchar textsize() const {return textsize_;}
void textsize(uchar s) {textsize_ = s;}
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
void textcolor(unsigned s) {textcolor_ = s;}
};
#endif
//
// End of "$Id: Fl_Value_Output.H 4288 2005-04-16 00:13:17Z mike $".
//

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