diff options
Diffstat (limited to 'FL')
-rw-r--r-- | FL/Enumerations.H | 38 | ||||
-rw-r--r-- | FL/Fl.H | 29 | ||||
-rw-r--r-- | FL/Fl_Browser_.H | 5 | ||||
-rw-r--r-- | FL/Fl_Check_Browser.H | 8 | ||||
-rw-r--r-- | FL/Fl_File_Chooser.H | 85 | ||||
-rw-r--r-- | FL/Fl_Gl_Window.H | 13 | ||||
-rw-r--r-- | FL/Fl_Help_Dialog.H | 27 | ||||
-rw-r--r-- | FL/Fl_Help_View.H | 31 | ||||
-rw-r--r-- | FL/Fl_Input.H | 5 | ||||
-rw-r--r-- | FL/Fl_Input_Choice.H | 6 | ||||
-rw-r--r-- | FL/Fl_Preferences.H | 6 | ||||
-rw-r--r-- | FL/Fl_RGB_Image.H | 35 | ||||
-rw-r--r-- | FL/Fl_Scroll.H | 6 | ||||
-rw-r--r-- | FL/Fl_Spinner.H | 67 | ||||
-rw-r--r-- | FL/Fl_Tabs.H | 5 | ||||
-rw-r--r-- | FL/Makefile.in | 15 | ||||
-rw-r--r-- | FL/filename.H | 22 | ||||
-rw-r--r-- | FL/fl_draw.H | 11 | ||||
-rw-r--r-- | FL/glu.h | 60 | ||||
-rw-r--r-- | FL/glut.H | 165 | ||||
-rw-r--r-- | FL/mac.H | 13 | ||||
-rw-r--r-- | FL/names.h | 85 | ||||
-rw-r--r-- | FL/win32.H | 5 | ||||
-rw-r--r-- | FL/x.H | 5 |
24 files changed, 553 insertions, 194 deletions
diff --git a/FL/Enumerations.H b/FL/Enumerations.H index 4c3337c..90b3354 100644 --- a/FL/Enumerations.H +++ b/FL/Enumerations.H @@ -1,5 +1,5 @@ // -// "$Id: Enumerations.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: Enumerations.H 5834 2007-05-16 08:30:48Z matt $" // // Enumerations for the Fast Light Tool Kit (FLTK). // @@ -47,7 +47,7 @@ #define FL_MAJOR_VERSION 1 #define FL_MINOR_VERSION 1 -#define FL_PATCH_VERSION 7 +#define FL_PATCH_VERSION 8 #define FL_VERSION ((double)FL_MAJOR_VERSION + \ (double)FL_MINOR_VERSION * 0.01 + \ (double)FL_PATCH_VERSION * 0.0001) @@ -177,6 +177,11 @@ enum Fl_Boxtype { // boxtypes (if you change these you must fix fl_boxtype.C): _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_GTK_UP_BOX, _FL_GTK_DOWN_BOX, + _FL_GTK_UP_FRAME, _FL_GTK_DOWN_FRAME, + _FL_GTK_THIN_UP_BOX, _FL_GTK_THIN_DOWN_BOX, + _FL_GTK_THIN_UP_FRAME, _FL_GTK_THIN_DOWN_FRAME, + _FL_GTK_ROUND_UP_BOX, _FL_GTK_ROUND_DOWN_BOX, FL_FREE_BOXTYPE }; extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUND_UP_BOX(); @@ -211,9 +216,28 @@ extern FL_EXPORT Fl_Boxtype fl_define_FL_PLASTIC_UP_BOX(); #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) +extern FL_EXPORT Fl_Boxtype fl_define_FL_GTK_UP_BOX(); +#define FL_GTK_UP_BOX fl_define_FL_GTK_UP_BOX() +#define FL_GTK_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+1) +#define FL_GTK_UP_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+2) +#define FL_GTK_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+3) +#define FL_GTK_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+4) +#define FL_GTK_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+5) +#define FL_GTK_THIN_UP_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+6) +#define FL_GTK_THIN_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+7) +#define FL_GTK_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+8) +#define FL_GTK_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+9) + // 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);} +inline Fl_Boxtype fl_box(Fl_Boxtype b) { + return (Fl_Boxtype)((b<FL_UP_BOX||b%4>1)?b:(b-2)); +} +inline Fl_Boxtype fl_down(Fl_Boxtype b) { + return (Fl_Boxtype)((b<FL_UP_BOX)?b:(b|1)); +} +inline Fl_Boxtype fl_frame(Fl_Boxtype b) { + return (Fl_Boxtype)((b%4<2)?b:(b+2)); +} // back-compatability box types: #define FL_FRAME FL_ENGRAVED_FRAME @@ -401,6 +425,10 @@ enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut) FL_FAKE_SINGLE = 512 // Fake single buffered windows using double-buffer }; +// image alpha blending + +#define FL_IMAGE_WITH_ALPHA 0x40000000 + // damage masks enum Fl_Damage { @@ -424,5 +452,5 @@ enum Fl_Damage { #endif // -// End of "$Id: Enumerations.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: Enumerations.H 5834 2007-05-16 08:30:48Z matt $". // @@ -1,9 +1,9 @@ // -// "$Id: Fl.H 4223 2005-03-31 16:01:24Z mike $" +// "$Id: Fl.H 5749 2007-03-20 10:41:14Z matt $" // // Main header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2005 by Bill Spitzak and others. +// Copyright 1998-2006 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public @@ -46,6 +46,7 @@ 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*); +typedef void (*Fl_Awake_Handler)(void*); class FL_EXPORT Fl { Fl() {}; // no constructor! @@ -78,10 +79,20 @@ public: // should be private! static void damage(int d) {damage_ = d;} static void (*idle)(); + static Fl_Awake_Handler *awake_ring_; + static void **awake_data_; + static int awake_ring_size_; + static int awake_ring_head_; + static int awake_ring_tail_; + + static int add_awake_handler_(Fl_Awake_Handler, void*); + static int get_awake_handler_(Fl_Awake_Handler&, void*&); static const char* scheme_; static Fl_Image* scheme_bg_; + static int e_original_keysym; // late addition + public: // API version number @@ -107,6 +118,8 @@ public: static int scheme(const char*); static const char* scheme() {return scheme_;} static int reload_scheme(); + static int scrollbar_size(); + static void scrollbar_size(int W); // execution: static int wait(); @@ -159,6 +172,7 @@ public: 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_original_key(){return e_original_keysym;} static int event_key(int); static int get_key(int); static const char* event_text() {return e_text;} @@ -191,13 +205,8 @@ public: 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(); @@ -266,15 +275,19 @@ public: static void lock(); static void unlock(); static void awake(void* message = 0); + static int awake(Fl_Awake_Handler cb, void* message = 0); static void* thread_message(); // Widget deletion: static void delete_widget(Fl_Widget *w); static void do_widget_deletion(); + static void watch_widget_pointer(Fl_Widget *&w); + static void release_widget_pointer(Fl_Widget *&w); + static void clear_widget_pointer(Fl_Widget const *w); }; #endif // !Fl_H // -// End of "$Id: Fl.H 4223 2005-03-31 16:01:24Z mike $". +// End of "$Id: Fl.H 5749 2007-03-20 10:41:14Z matt $". // diff --git a/FL/Fl_Browser_.H b/FL/Fl_Browser_.H index c66d414..3469be4 100644 --- a/FL/Fl_Browser_.H +++ b/FL/Fl_Browser_.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Browser_.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: Fl_Browser_.H 4879 2006-03-28 23:27:20Z matt $" // // Common browser header file for the Fast Light Tool Kit (FLTK). // @@ -88,6 +88,7 @@ protected: 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 swapping(void *a,void *b); // exchange pointers a and 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 @@ -149,5 +150,5 @@ public: #endif // -// End of "$Id: Fl_Browser_.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: Fl_Browser_.H 4879 2006-03-28 23:27:20Z matt $". // diff --git a/FL/Fl_Check_Browser.H b/FL/Fl_Check_Browser.H index f474a03..3725667 100644 --- a/FL/Fl_Check_Browser.H +++ b/FL/Fl_Check_Browser.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Check_Browser.H 4461 2005-08-05 13:31:02Z dejan $" +// "$Id: Fl_Check_Browser.H 5006 2006-04-20 03:53:41Z matt $" // // Fl_Check_Browser header file for the Fast Light Tool Kit (FLTK). // @@ -88,11 +88,15 @@ class FL_EXPORT Fl_Check_Browser : public Fl_Browser_ { void check_none(); int value() const; // currently selected item char *text(int item) const; // returns pointer to internal buffer + + protected: + + int handle(int); }; #endif // Fl_Check_Browser_H // -// End of "$Id: Fl_Check_Browser.H 4461 2005-08-05 13:31:02Z dejan $". +// End of "$Id: Fl_Check_Browser.H 5006 2006-04-20 03:53:41Z matt $". // diff --git a/FL/Fl_File_Chooser.H b/FL/Fl_File_Chooser.H index 4382698..727c73d 100644 --- a/FL/Fl_File_Chooser.H +++ b/FL/Fl_File_Chooser.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_File_Chooser.H 4473 2005-08-08 00:50:02Z mike $" +// "$Id: Fl_File_Chooser.H 5644 2007-01-28 19:41:56Z mike $" // // Fl_File_Chooser dialog for the Fast Light Tool Kit (FLTK). // @@ -25,7 +25,7 @@ // http://www.fltk.org/str.php // -// generated by Fast Light User Interface Designer (fluid) version 1.0107 +// generated by Fast Light User Interface Designer (fluid) version 1.0108 #ifndef Fl_File_Chooser_H #define Fl_File_Chooser_H @@ -49,24 +49,24 @@ class FL_EXPORT Fl_File_Chooser { public: - enum { SINGLE = 0, MULTI = 1, CREATE = 2, DIRECTORY = 4 }; + 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(); + 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: @@ -128,10 +128,10 @@ public: 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); + int count(); + void directory(const char *d); char * directory(); - void filter(const char *p); + void filter(const char *p); const char * filter(); int filter_value(); void filter_value(int f); @@ -142,9 +142,10 @@ public: 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 preview(int e); + int preview() const { return previewButton->value(); }; + void rescan(); + void rescan_keep_filename(); void show(); int shown(); void textcolor(Fl_Color c); @@ -157,23 +158,23 @@ public: int type(); void * user_data() const; void user_data(void *d); - const char *value(int f = 1); - void value(const char *filename); + 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; + 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); @@ -182,5 +183,5 @@ 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 $". +// End of "$Id: Fl_File_Chooser.H 5644 2007-01-28 19:41:56Z mike $". // diff --git a/FL/Fl_Gl_Window.H b/FL/Fl_Gl_Window.H index d19e33d..ba5380c 100644 --- a/FL/Fl_Gl_Window.H +++ b/FL/Fl_Gl_Window.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Gl_Window.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: Fl_Gl_Window.H 5322 2006-08-17 09:49:43Z matt $" // // OpenGL header file for the Fast Light Tool Kit (FLTK). // @@ -41,7 +41,7 @@ class FL_EXPORT Fl_Gl_Window : public Fl_Window { const int *alist; Fl_Gl_Choice *g; GLContext context_; - char valid_; + char valid_f_; char damage1_; // damage() of back buffer virtual void draw_overlay(); void init(); @@ -61,10 +61,13 @@ public: void hide(); void resize(int,int,int,int); - char valid() const {return valid_;} - void valid(char v) {valid_ = v;} + char valid() const {return valid_f_ & 1;} + void valid(char v) {if (v) valid_f_ |= 1; else valid_f_ &= 0xfe;} void invalidate(); + char context_valid() const {return valid_f_ & 2;} + void context_valid(char v) {if (v) valid_f_ |= 2; else valid_f_ &= 0xfd;} + 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);} @@ -92,5 +95,5 @@ public: #endif // -// End of "$Id: Fl_Gl_Window.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: Fl_Gl_Window.H 5322 2006-08-17 09:49:43Z matt $". // diff --git a/FL/Fl_Help_Dialog.H b/FL/Fl_Help_Dialog.H index 198e250..bf86af7 100644 --- a/FL/Fl_Help_Dialog.H +++ b/FL/Fl_Help_Dialog.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Help_Dialog.H 4582 2005-09-25 16:54:40Z matt $" +// "$Id: Fl_Help_Dialog.H 5643 2007-01-28 19:36:51Z mike $" // // Fl_Help_Dialog dialog for the Fast Light Tool Kit (FLTK). // @@ -25,32 +25,28 @@ // http://www.fltk.org/str.php // -// generated by Fast Light User Interface Designer (fluid) version 1.0107 +// generated by Fast Light User Interface Designer (fluid) version 1.0108 #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> +#include <FL/Fl_Box.H> +#include <FL/Fl_Help_View.H> class FL_EXPORT Fl_Help_Dialog { - int index_; - int max_; - int line_[100]; - char file_[100][256]; - int find_pos_; + 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*); @@ -66,6 +62,9 @@ private: Fl_Input *find_; void cb_find__i(Fl_Input*, void*); static void cb_find_(Fl_Input*, void*); + Fl_Help_View *view_; + void cb_view__i(Fl_Help_View*, void*); + static void cb_view_(Fl_Help_View*, void*); public: ~Fl_Help_Dialog(); int h(); @@ -89,5 +88,5 @@ public: #endif // -// End of "$Id: Fl_Help_Dialog.H 4582 2005-09-25 16:54:40Z matt $". +// End of "$Id: Fl_Help_Dialog.H 5643 2007-01-28 19:36:51Z mike $". // diff --git a/FL/Fl_Help_View.H b/FL/Fl_Help_View.H index a0f4fd6..1a9f002 100644 --- a/FL/Fl_Help_View.H +++ b/FL/Fl_Help_View.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Help_View.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: Fl_Help_View.H 5207 2006-06-18 15:53:26Z matt $" // // Help Viewer widget definitions. // @@ -133,6 +133,21 @@ class FL_EXPORT Fl_Help_View : public Fl_Group //// Help viewer widget Fl_Scrollbar scrollbar_, // Vertical scrollbar for document hscrollbar_; // Horizontal scrollbar + static int selection_first; + static int selection_last; + static int selection_push_first; + static int selection_push_last; + static int selection_drag_first; + static int selection_drag_last; + static int selected; + static int draw_mode; + static int mouse_x; + static int mouse_y; + static int current_pos; + static Fl_Help_View *current_view; + static Fl_Color hv_selection_color; + static Fl_Color hv_selection_text_color; + 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); @@ -158,7 +173,15 @@ class FL_EXPORT Fl_Help_View : public Fl_Group //// Help viewer widget fl_font(f = fonts_[nfonts_][0], s = fonts_[nfonts_][1]); } - public: + void hv_draw(const char *t, int x, int y); + char begin_selection(); + char extend_selection(); + void end_selection(int c=0); + void clear_global_selection(); + Fl_Help_Link *find_link(int, int); + void follow_link(Fl_Help_Link*); + +public: Fl_Help_View(int xx, int yy, int ww, int hh, const char *l = 0); ~Fl_Help_View(); @@ -186,10 +209,12 @@ class FL_EXPORT Fl_Help_View : public Fl_Group //// Help viewer widget int leftline() const { return (leftline_); } void value(const char *v); const char *value() const { return (value_); } + void clear_selection(); + void select_all(); }; #endif // !Fl_Help_View_H // -// End of "$Id: Fl_Help_View.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: Fl_Help_View.H 5207 2006-06-18 15:53:26Z matt $". // diff --git a/FL/Fl_Input.H b/FL/Fl_Input.H index 7debfdd..03823fe 100644 --- a/FL/Fl_Input.H +++ b/FL/Fl_Input.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: Fl_Input.H 5300 2006-08-14 07:06:45Z matt $" // // Input header file for the Fast Light Tool Kit (FLTK). // @@ -34,7 +34,6 @@ 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); @@ -44,5 +43,5 @@ public: #endif // -// End of "$Id: Fl_Input.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: Fl_Input.H 5300 2006-08-14 07:06:45Z matt $". // diff --git a/FL/Fl_Input_Choice.H b/FL/Fl_Input_Choice.H index d4acb44..45971bc 100644 --- a/FL/Fl_Input_Choice.H +++ b/FL/Fl_Input_Choice.H @@ -34,6 +34,7 @@ #define Fl_Input_Choice_H #include <FL/Fl.H> +#include <FL/Fl_Group.H> #include <FL/Fl_Input.H> #include <FL/Fl_Menu_Button.H> #include <FL/fl_draw.H> @@ -58,6 +59,8 @@ class Fl_Input_Choice : public Fl_Group { static void menu_cb(Fl_Widget*, void *data) { Fl_Input_Choice *o=(Fl_Input_Choice *)data; + const Fl_Menu_Item *item = o->menubutton()->mvalue(); + if ( item && item->flags & (FL_SUBMENU|FL_SUBMENU_POINTER) ) return; // ignore submenus o->inp_->value(o->menu_->text()); o->do_callback(); } @@ -95,6 +98,9 @@ public: void add(const char *s) { menu_->add(s); } + int changed() const { + return inp_->changed(); + } void clear() { menu_->clear(); } diff --git a/FL/Fl_Preferences.H b/FL/Fl_Preferences.H index b583d2e..392ac05 100644 --- a/FL/Fl_Preferences.H +++ b/FL/Fl_Preferences.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Preferences.H 4458 2005-07-26 07:59:01Z matt $" +// "$Id: Fl_Preferences.H 5330 2006-08-18 07:29:09Z matt $" // // Preferences definitions for the Fast Light Tool Kit (FLTK). // @@ -65,7 +65,9 @@ public: char set( const char *entry, int value ); char set( const char *entry, float value ); + char set( const char *entry, float value, int precision ); char set( const char *entry, double value ); + char set( const char *entry, double value, int precision ); char set( const char *entry, const char *value ); char set( const char *entry, const void *value, int size ); @@ -165,5 +167,5 @@ private: #endif // !Fl_Preferences_H // -// End of "$Id: Fl_Preferences.H 4458 2005-07-26 07:59:01Z matt $". +// End of "$Id: Fl_Preferences.H 5330 2006-08-18 07:29:09Z matt $". // diff --git a/FL/Fl_RGB_Image.H b/FL/Fl_RGB_Image.H new file mode 100644 index 0000000..e8b1be6 --- /dev/null +++ b/FL/Fl_RGB_Image.H @@ -0,0 +1,35 @@ +// +// "$Id:$" +// +// RGB Image header file for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2007 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_RGB_Image_H +# define Fl_RGB_Image_H +# include "Fl_Image.H" +#endif // !Fl_RGB_Image_H + +// +// End of "$Id:$". +// diff --git a/FL/Fl_Scroll.H b/FL/Fl_Scroll.H index 0bc3a5b..67c650f 100644 --- a/FL/Fl_Scroll.H +++ b/FL/Fl_Scroll.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Scroll.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: Fl_Scroll.H 5618 2007-01-18 19:23:24Z matt $" // // Scroll header file for the Fast Light Tool Kit (FLTK). // @@ -40,10 +40,10 @@ class FL_EXPORT Fl_Scroll : public Fl_Group { 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 bbox(int&,int&,int&,int&); void draw(); public: @@ -75,5 +75,5 @@ public: #endif // -// End of "$Id: Fl_Scroll.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: Fl_Scroll.H 5618 2007-01-18 19:23:24Z matt $". // diff --git a/FL/Fl_Spinner.H b/FL/Fl_Spinner.H index 35a9bad..9f76ad7 100644 --- a/FL/Fl_Spinner.H +++ b/FL/Fl_Spinner.H @@ -3,7 +3,7 @@ // // Spinner widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2005 by Bill Spitzak and others. +// Copyright 1998-2006 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public @@ -32,6 +32,7 @@ // Include necessary headers... // +# include <FL/Enumerations.H> # include <FL/Fl_Group.H> # include <FL/Fl_Input.H> # include <FL/Fl_Repeat_Button.H> @@ -56,6 +57,7 @@ class Fl_Spinner : public Fl_Group up_button_, // Up button down_button_; // Down button + static void sb_cb(Fl_Widget *w, Fl_Spinner *sb) { double v; // New value @@ -93,7 +95,20 @@ class Fl_Spinner : public Fl_Group void update() { char s[255]; // Value string - sprintf(s, format_, value_); + if (format_[0]=='%'&&format_[1]=='.'&&format_[2]=='*') { // precision argument + // this code block is a simplified version of + // Fl_Valuator::format() and works well (but looks ugly) + int c = 0; + char temp[64], *sp = temp; + sprintf(temp, "%.12f", step_); + while (*sp) sp++; + sp--; + while (sp>temp && *sp=='0') sp--; + while (sp>temp && (*sp>='0' && *sp<='9')) { sp--; c++; } + sprintf(s, format_, c, value_); + } else { + sprintf(s, format_, value_); + } input_.value(s); } @@ -102,22 +117,22 @@ class Fl_Spinner : public Fl_Group 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<"), + up_button_(X + W - H / 2 - 2, Y, H / 2 + 2, H / 2, "@-42<"), down_button_(X + W - H / 2 - 2, Y + H - H / 2, - H / 2 + 2, H / 2, "@-22>") { + H / 2 + 2, H / 2, "@-42>") { end(); value_ = 1.0; minimum_ = 1.0; maximum_ = 100.0; step_ = 1.0; - format_ = "%.0f"; + format_ = "%g"; align(FL_ALIGN_LEFT); input_.value("1"); input_.type(FL_INT_INPUT); - input_.when(FL_WHEN_CHANGED); + input_.when(FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE); input_.callback((Fl_Callback *)sb_cb, this); up_button_.callback((Fl_Callback *)sb_cb, this); @@ -127,9 +142,33 @@ class Fl_Spinner : public Fl_Group const char *format() { return (format_); } void format(const char *f) { format_ = f; update(); } + + int handle(int event) { + switch (event) { + case FL_KEYDOWN : + case FL_SHORTCUT : + if (Fl::event_key() == FL_Up) { + up_button_.do_callback(); + return 1; + } else if (Fl::event_key() == FL_Down) { + down_button_.do_callback(); + return 1; + } else return 0; + + case FL_FOCUS : + if (input_.take_focus()) return 1; + else return 0; + } + + return Fl_Group::handle(event); + } + + // Speling mistaks retained for source compatibility... double maxinum() const { return (maximum_); } + double maximum() const { return (maximum_); } void maximum(double m) { maximum_ = m; } double mininum() const { return (minimum_); } + double minimum() 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) { @@ -141,7 +180,12 @@ class Fl_Spinner : public Fl_Group H / 2 + 2, H / 2); } double step() const { return (step_); } - void step(double s) { step_ = s; } + void step(double s) { + step_ = s; + if (step_ != (int)step_) input_.type(FL_FLOAT_INPUT); + else input_.type(FL_INT_INPUT); + update(); + } Fl_Color textcolor() const { return (input_.textcolor()); } @@ -160,6 +204,15 @@ class Fl_Spinner : public Fl_Group void textsize(uchar s) { input_.textsize(s); } + uchar type() const { return (input_.type()); } + void type(uchar v) { + if (v==FL_FLOAT_INPUT) { + format("%.*f"); + } else { + format("%.0f"); + } + input_.type(v); + } double value() const { return (value_); } void value(double v) { value_ = v; update(); } }; diff --git a/FL/Fl_Tabs.H b/FL/Fl_Tabs.H index 3145f20..c46bb2e 100644 --- a/FL/Fl_Tabs.H +++ b/FL/Fl_Tabs.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tabs.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: Fl_Tabs.H 5326 2006-08-17 13:43:07Z matt $" // // Tab header file for the Fast Light Tool Kit (FLTK). // @@ -37,6 +37,7 @@ class FL_EXPORT Fl_Tabs : public Fl_Group { int tab_height(); void draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int sel=0); protected: + void redraw_tabs(); void draw(); public: @@ -52,5 +53,5 @@ public: #endif // -// End of "$Id: Fl_Tabs.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: Fl_Tabs.H 5326 2006-08-17 13:43:07Z matt $". // diff --git a/FL/Makefile.in b/FL/Makefile.in index 9fb8fde..adf52c7 100644 --- a/FL/Makefile.in +++ b/FL/Makefile.in @@ -1,9 +1,9 @@ # -# "$Id: Makefile.in 4288 2005-04-16 00:13:17Z mike $" +# "$Id: Makefile.in 5745 2007-03-15 13:27:41Z mike $" # # Header makefile for the Fast Light Tool Kit (FLTK). # -# Copyright 1998-2005 by Bill Spitzak and others. +# Copyright 1998-2007 by Bill Spitzak and others. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -35,12 +35,11 @@ depend: install: echo "Installing include files in $(DESTDIR)$(includedir)..." - -$(MKDIR) -p $(DESTDIR)$(includedir) $(RMDIR) $(DESTDIR)$(includedir)/FL - $(MKDIR) $(DESTDIR)$(includedir)/FL - $(CHMOD) 755 $(DESTDIR)$(includedir)/FL - $(CP) ../FL/*.[hHr] $(DESTDIR)$(includedir)/FL - $(CHMOD) 644 $(DESTDIR)$(includedir)/FL/*.[hHr] + $(INSTALL_DIR) $(DESTDIR)$(includedir)/FL + for file in *.[hrH]; do \ + $(INSTALL_DATA) $$file $(DESTDIR)$(includedir)/FL; \ + done @HLINKS@ cd $(DESTDIR)$(includedir)/FL;\ @HLINKS@ for file in *.H; do\ @HLINKS@ $(RM) "`basename $$file H`h";\ @@ -60,5 +59,5 @@ uninstall: # -# End of "$Id: Makefile.in 4288 2005-04-16 00:13:17Z mike $". +# End of "$Id: Makefile.in 5745 2007-03-15 13:27:41Z mike $". # diff --git a/FL/filename.H b/FL/filename.H index df7dd87..daf5e32 100644 --- a/FL/filename.H +++ b/FL/filename.H @@ -1,5 +1,5 @@ /* - * "$Id: filename.H 4548 2005-08-29 20:16:36Z matt $" + * "$Id: filename.H 5635 2007-01-23 15:02:00Z mike $" * * Filename header file for the Fast Light Tool Kit (FLTK). * @@ -111,6 +111,24 @@ typedef int (Fl_File_Sort_F)(struct dirent **, struct dirent **); FL_EXPORT int fl_filename_list(const char *d, struct dirent ***l, Fl_File_Sort_F *s = fl_numericsort); + +/* + * Generic function to open a Uniform Resource Identifier (URI) using a + * system-defined program (added in FLTK 1.1.8) + */ + +FL_EXPORT int fl_open_uri(const char *uri, char *msg = (char *)0, + int msglen = 0); + +/* + * _fl_filename_isdir_quick() is a private function that checks for a + * trailing slash and assumes that the passed name is a directory if + * it finds one. This function is used by Fl_File_Browser and + * Fl_File_Chooser to avoid extra stat() calls, but is not supported + * outside of FLTK... + */ +int _fl_filename_isdir_quick(const char *name); + # endif /* __cplusplus */ /* @@ -134,5 +152,5 @@ FL_EXPORT int fl_filename_list(const char *d, struct dirent ***l, #endif /* FL_FILENAME_H */ /* - * End of "$Id: filename.H 4548 2005-08-29 20:16:36Z matt $". + * End of "$Id: filename.H 5635 2007-01-23 15:02:00Z mike $". */ diff --git a/FL/fl_draw.H b/FL/fl_draw.H index ba5d710..c752795 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -1,5 +1,5 @@ // -// "$Id: fl_draw.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: fl_draw.H 5430 2006-09-15 15:35:16Z matt $" // // Portable drawing function header file for the Fast Light Tool Kit (FLTK). // @@ -160,6 +160,12 @@ FL_EXPORT void fl_draw(const char*, int,int,int,int, Fl_Align, void (*callthis)(const char *, int n, int x, int y), Fl_Image* img=0, int draw_symbols = 1); +// font encoding: +FL_EXPORT const char *fl_latin1_to_local(const char *, int n=-1); +FL_EXPORT const char *fl_local_to_latin1(const char *, int n=-1); +FL_EXPORT const char *fl_mac_roman_to_local(const char *, int n=-1); +FL_EXPORT const char *fl_local_to_mac_roman(const char *, int n=-1); + // boxtypes: FL_EXPORT void fl_frame(const char* s, int x, int y, int w, int h); FL_EXPORT void fl_frame2(const char* s, int x, int y, int w, int h); @@ -172,6 +178,7 @@ typedef void (*Fl_Draw_Image_Cb)(void*,int,int,int,uchar*); FL_EXPORT void fl_draw_image(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta=3); FL_EXPORT void fl_draw_image_mono(Fl_Draw_Image_Cb, void*, int,int,int,int, int delta=1); FL_EXPORT void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b); +FL_EXPORT char fl_can_do_alpha_blending(); FL_EXPORT uchar *fl_read_image(uchar *p, int x,int y, int w, int h, int alpha=0); @@ -196,5 +203,5 @@ FL_EXPORT int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scal #endif // -// End of "$Id: fl_draw.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: fl_draw.H 5430 2006-09-15 15:35:16Z matt $". // diff --git a/FL/glu.h b/FL/glu.h new file mode 100644 index 0000000..b6409ae --- /dev/null +++ b/FL/glu.h @@ -0,0 +1,60 @@ +// +// "$Id:$" +// +// GLu header file for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2006 by Bill Spitzak and others. +// +// You must include this instead of GL/gl.h to get the Microsoft +// APIENTRY stuff included (from <windows.h>) prior to the OpenGL +// header files. +// +// This file also provides "missing" OpenGL functions, and +// gl_start() and gl_finish() to allow OpenGL to be used in any window +// +// 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_glu_H +# define FL_glu_H + +# include "Enumerations.H" // for color names +# ifdef WIN32 +# include <windows.h> +# endif +# ifndef APIENTRY +# if defined(__CYGWIN__) +# define APIENTRY __attribute__ ((__stdcall__)) +# else +# define APIENTRY +# endif +# endif + +# ifdef __APPLE__ +# include <OpenGL/glu.h> +# else +# include <GL/glu.h> +# endif + +#endif // !FL_glu_H + +// +// End of "$Id: $". +// @@ -1,9 +1,9 @@ // -// "$Id: glut.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: glut.H 5715 2007-02-25 00:05:06Z matt $" // // GLUT emulation header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2005 by Bill Spitzak and others. +// Copyright 1998-2007 by Bill Spitzak and others. // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public @@ -43,15 +43,14 @@ // Commented out lines indicate parts of GLUT that are not emulated. -#ifndef __glut_h__ -# define __glut_h__ +#ifndef Fl_glut_H +# define Fl_glut_H # include "gl.h" -//# include <GL/glu.h> //////////////////////////////////////////////////////////////// // GLUT is emulated using this window class and these static variables -// (plus several more static variables hidden in glut.C): +// (plus several more static variables hidden in glut_compatability.cxx): # include "Fl.H" # include "Fl_Gl_Window.H" @@ -118,6 +117,7 @@ FL_EXPORT void glutInitWindowSize(int w, int h); FL_EXPORT void glutMainLoop(); FL_EXPORT int glutCreateWindow(char *title); +FL_EXPORT int glutCreateWindow(const char *title); FL_EXPORT int glutCreateSubWindow(int win, int x, int y, int width, int height); @@ -125,6 +125,8 @@ FL_EXPORT void glutDestroyWindow(int win); inline void glutPostRedisplay() {glut_window->redraw();} +FL_EXPORT void glutPostWindowRedisplay(int win); + FL_EXPORT void glutSwapBuffers(); inline int glutGetWindow() {return glut_window->number;} @@ -141,7 +143,7 @@ inline void glutReshapeWindow(int w, int h) {glut_window->size(w,h);} inline void glutPopWindow() {glut_window->show();} -//inline void glutPushWindow(); +inline void glutPushWindow() { /* do nothing */ } inline void glutIconifyWindow() {glut_window->iconize();} @@ -177,7 +179,7 @@ inline void glutSetCursor(Fl_Cursor cursor) {glut_window->cursor(cursor);} # define GLUT_CURSOR_NONE FL_CURSOR_NONE # define GLUT_CURSOR_FULL_CROSSHAIR FL_CURSOR_CROSS -//inline void glutWarpPointer(int x, int y); +inline void glutWarpPointer(int, int) { /* do nothing */ } inline void glutEstablishOverlay() {glut_window->make_overlay_current();} @@ -205,7 +207,7 @@ FL_EXPORT void glutAddMenuEntry(char *label, int value); FL_EXPORT void glutAddSubMenu(char *label, int submenu); -FL_EXPORT void glutChangeToMenuEntry(int item, char *label, int value); +FL_EXPORT void glutChangeToMenuEntry(int item, char *labela, int value); FL_EXPORT void glutChangeToSubMenu(int item, char *label, int submenu); @@ -312,7 +314,7 @@ inline void glutOverlayDisplayFunc(void (*f)()) { // Warning: values are changed from GLUT! // Also relies on the GL_ symbols having values greater than 100 -int glutGet(GLenum type); +FL_EXPORT int glutGet(GLenum type); enum { GLUT_RETURN_ZERO = 0, GLUT_WINDOW_X, @@ -320,12 +322,8 @@ enum { GLUT_WINDOW_WIDTH, GLUT_WINDOW_HEIGHT, GLUT_WINDOW_PARENT, -//GLUT_WINDOW_NUM_CHILDREN, -//GLUT_WINDOW_CURSOR, GLUT_SCREEN_WIDTH, GLUT_SCREEN_HEIGHT, -//GLUT_SCREEN_WIDTH_MM, -//GLUT_SCREEN_HEIGHT_MM, GLUT_MENU_NUM_ITEMS, GLUT_DISPLAY_MODE_POSSIBLE, GLUT_INIT_WINDOW_X, @@ -333,8 +331,13 @@ enum { GLUT_INIT_WINDOW_WIDTH, GLUT_INIT_WINDOW_HEIGHT, GLUT_INIT_DISPLAY_MODE, + GLUT_WINDOW_BUFFER_SIZE, + GLUT_VERSION +//GLUT_WINDOW_NUM_CHILDREN, +//GLUT_WINDOW_CURSOR, +//GLUT_SCREEN_WIDTH_MM, +//GLUT_SCREEN_HEIGHT_MM, //GLUT_ELAPSED_TIME, - GLUT_WINDOW_BUFFER_SIZE }; # define GLUT_WINDOW_STENCIL_SIZE GL_STENCIL_BITS @@ -357,17 +360,17 @@ enum { # endif # define GLUT_WINDOW_STEREO GL_STEREO -//int glutDeviceGet(GLenum type); -//#define GLUT_HAS_KEYBOARD 600 -//#define GLUT_HAS_MOUSE 601 -//#define GLUT_HAS_SPACEBALL 602 -//#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 -//#define GLUT_HAS_TABLET 604 -//#define GLUT_NUM_MOUSE_BUTTONS 605 -//#define GLUT_NUM_SPACEBALL_BUTTONS 606 -//#define GLUT_NUM_BUTTON_BOX_BUTTONS 607 -//#define GLUT_NUM_DIALS 608 -//#define GLUT_NUM_TABLET_BUTTONS 609 +# define GLUT_HAS_KEYBOARD 600 +# define GLUT_HAS_MOUSE 601 +# define GLUT_HAS_SPACEBALL 602 +# define GLUT_HAS_DIAL_AND_BUTTON_BOX 603 +# define GLUT_HAS_TABLET 604 +# define GLUT_NUM_MOUSE_BUTTONS 605 +# define GLUT_NUM_SPACEBALL_BUTTONS 606 +# define GLUT_NUM_BUTTON_BOX_BUTTONS 607 +# define GLUT_NUM_DIALS 608 +# define GLUT_NUM_TABLET_BUTTONS 609 +FL_EXPORT int glutDeviceGet(GLenum type); // WARNING: these values are different than GLUT uses: # define GLUT_ACTIVE_SHIFT FL_SHIFT @@ -375,7 +378,7 @@ enum { # define GLUT_ACTIVE_ALT FL_ALT inline int glutGetModifiers() {return Fl::event_state() & (GLUT_ACTIVE_SHIFT | GLUT_ACTIVE_CTRL | GLUT_ACTIVE_ALT);} -int glutLayerGet(GLenum); +FL_EXPORT int glutLayerGet(GLenum); # define GLUT_OVERLAY_POSSIBLE 800 //#define GLUT_LAYER_IN_USE 801 //#define GLUT_HAS_OVERLAY 802 @@ -383,6 +386,12 @@ int glutLayerGet(GLenum); # define GLUT_NORMAL_DAMAGED 804 # define GLUT_OVERLAY_DAMAGED 805 +extern "C" { +typedef void (*GLUTproc)(); +} + +FL_EXPORT GLUTproc glutGetProcAddress(const char *procName); + //inline int glutVideoResizeGet(GLenum param); //#define GLUT_VIDEO_RESIZE_POSSIBLE 900 //#define GLUT_VIDEO_RESIZE_IN_USE 901 @@ -403,11 +412,8 @@ int glutLayerGet(GLenum); //inline void glutVideoPan(int x, int y, int width, int height); -//////////////////////////////////////////////////////////////// -// Emulated GLUT drawing functions: - // Font argument must be a void* for compatability, so... -extern FL_EXPORT struct Glut_Bitmap_Font {uchar font; int size;} +extern FL_EXPORT struct Fl_Glut_Bitmap_Font {uchar font; int size;} glutBitmap9By15, glutBitmap8By13, glutBitmapTimesRoman10, glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12, glutBitmapHelvetica18; @@ -420,57 +426,68 @@ extern FL_EXPORT struct Glut_Bitmap_Font {uchar font; int size;} # define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18) FL_EXPORT void glutBitmapCharacter(void *font, int character); +FL_EXPORT int glutBitmapHeight(void *font); +FL_EXPORT int glutBitmapLength(void *font, const unsigned char *string); +FL_EXPORT void glutBitmapString(void *font, const unsigned char *string); FL_EXPORT int glutBitmapWidth(void *font, int character); -//////////////////////////////////////////////////////////////// -// GLUT drawing functions. These are NOT emulated but you can -// link in the glut library to get them. This assumes the object -// files in GLUT remain as they currently are so that there are -// not symbol conflicts with the above. - -extern "C" { +FL_EXPORT int glutExtensionSupported(char *name); -extern int APIENTRY glutExtensionSupported(char *name); +/* GLUT stroked font sub-API */ +struct Fl_Glut_StrokeVertex { + GLfloat X, Y; +}; -/* Stroke font constants (use these in GLUT program). */ -# ifdef WIN32 -# define GLUT_STROKE_ROMAN ((void*)0) -# define GLUT_STROKE_MONO_ROMAN ((void*)1) -# else -extern void *glutStrokeRoman; -# define GLUT_STROKE_ROMAN (&glutStrokeRoman) -extern void *glutStrokeMonoRoman; -# define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) -# endif +struct Fl_Glut_StrokeStrip { + int Number; + const Fl_Glut_StrokeVertex* Vertices; +}; -/* GLUT font sub-API */ -extern void APIENTRY glutStrokeCharacter(void *font, int character); -extern int APIENTRY glutStrokeWidth(void *font, int character); +struct Fl_Glut_StrokeChar { + GLfloat Right; + int Number; + const Fl_Glut_StrokeStrip* Strips; +}; -/* GLUT pre-built models sub-API */ -extern void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); -extern void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); -extern void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); -extern void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); -extern void APIENTRY glutWireCube(GLdouble size); -extern void APIENTRY glutSolidCube(GLdouble size); -extern void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); -extern void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); -extern void APIENTRY glutWireDodecahedron(); -extern void APIENTRY glutSolidDodecahedron(); -extern void APIENTRY glutWireTeapot(GLdouble size); -extern void APIENTRY glutSolidTeapot(GLdouble size); -extern void APIENTRY glutWireOctahedron(); -extern void APIENTRY glutSolidOctahedron(); -extern void APIENTRY glutWireTetrahedron(); -extern void APIENTRY glutSolidTetrahedron(); -extern void APIENTRY glutWireIcosahedron(); -extern void APIENTRY glutSolidIcosahedron(); +struct Fl_Glut_StrokeFont { + char* Name; // The source font name + int Quantity; // Number of chars in font + GLfloat Height; // Height of the characters + const Fl_Glut_StrokeChar** Characters;// The characters mapping +}; +extern FL_EXPORT Fl_Glut_StrokeFont glutStrokeRoman; +extern FL_EXPORT Fl_Glut_StrokeFont glutStrokeMonoRoman; +# define GLUT_STROKE_ROMAN (&glutStrokeRoman) +# define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) -} +FL_EXPORT void glutStrokeCharacter(void *font, int character); +FL_EXPORT GLfloat glutStrokeHeight(void *font); +FL_EXPORT int glutStrokeLength(void *font, const unsigned char *string); +FL_EXPORT void glutStrokeString(void *font, const unsigned char *string); +FL_EXPORT int glutStrokeWidth(void *font, int character); -#endif /* !__glut_h__ */ +/* GLUT pre-built models sub-API */ +FL_EXPORT void glutWireSphere(GLdouble radius, GLint slices, GLint stacks); +FL_EXPORT void glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); +FL_EXPORT void glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +FL_EXPORT void glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); +FL_EXPORT void glutWireCube(GLdouble size); +FL_EXPORT void glutSolidCube(GLdouble size); +FL_EXPORT void glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +FL_EXPORT void glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); +FL_EXPORT void glutWireDodecahedron(); +FL_EXPORT void glutSolidDodecahedron(); +FL_EXPORT void glutWireTeapot(GLdouble size); +FL_EXPORT void glutSolidTeapot(GLdouble size); +FL_EXPORT void glutWireOctahedron(); +FL_EXPORT void glutSolidOctahedron(); +FL_EXPORT void glutWireTetrahedron(); +FL_EXPORT void glutSolidTetrahedron(); +FL_EXPORT void glutWireIcosahedron(); +FL_EXPORT void glutSolidIcosahedron(); + +#endif // !Fl_glut_H // -// End of "$Id: glut.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: glut.H 5715 2007-02-25 00:05:06Z matt $". // @@ -1,5 +1,5 @@ // -// "$Id: mac.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: mac.H 5379 2006-08-29 11:03:05Z matt $" // // Mac header file for the Fast Light Tool Kit (FLTK). // @@ -54,10 +54,6 @@ inline void XDestroyRegion(Fl_Region r) { DisposeRgn(r); } -# define XDestroyWindow(a,b) DisposeWindow(b) -# define XMapWindow(a,b) ShowWindow(b) -# define XUnmapWindow(a,b) HideWindow(b) - # include "Fl_Window.H" // This object contains all mac-specific stuff about a window: @@ -90,6 +86,11 @@ public: static void q_end_image(); }; +extern void MacDestroyWindow(Fl_Window*,WindowPtr); +extern void MacMapWindow(Fl_Window*,WindowPtr); +extern void MacUnmapWindow(Fl_Window*,WindowPtr); +extern int MacUnlinkWindow(Fl_X*,Fl_X*start=0L); + inline Window fl_xid(const Fl_Window*w) { return Fl_X::i(w)->xid; @@ -130,6 +131,6 @@ extern void fl_open_callback(void (*cb)(const char *)); extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b); // -// End of "$Id: mac.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: mac.H 5379 2006-08-29 11:03:05Z matt $". // diff --git a/FL/names.h b/FL/names.h new file mode 100644 index 0000000..e2c934b --- /dev/null +++ b/FL/names.h @@ -0,0 +1,85 @@ +// +// "$Id:$" +// +// Event names header file for the Fast Light Tool Kit (FLTK). +// +// Copyright 1998-2007 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 +// + +// Thnaks to Greg Ercolano for this addition. + +#ifndef FL_NAMES_H +#define FL_NAMES_H + +char *fl_eventnames[] = +{ + "FL_NO_EVENT", + "FL_PUSH", + "FL_RELEASE", + "FL_ENTER", + "FL_LEAVE", + "FL_DRAG", + "FL_FOCUS", + "FL_UNFOCUS", + "FL_KEYDOWN", + "FL_KEYUP", + "FL_CLOSE", + "FL_MOVE", + "FL_SHORTCUT", + "FL_DEACTIVATE", + "FL_ACTIVATE", + "FL_HIDE", + "FL_SHOW", + "FL_PASTE", + "FL_SELECTIONCLEAR", + "FL_MOUSEWHEEL", + "FL_DND_ENTER", + "FL_DND_DRAG", + "FL_DND_LEAVE", + "FL_DND_RELEASE", +}; + +char *fl_fontnames[] = +{ + "FL_HELVETICA", + "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", +}; + +#endif /* FL_NAMES_H */ + +// +// End of "$Id:$". +//
\ No newline at end of file @@ -1,5 +1,5 @@ // -// "$Id: win32.H 4569 2005-09-15 07:41:17Z matt $" +// "$Id: win32.H 5436 2006-09-16 16:02:00Z matt $" // // WIN32 header file for the Fast Light Tool Kit (FLTK). // @@ -132,6 +132,7 @@ extern FL_EXPORT HDC fl_makeDC(HBITMAP); fl_pop_clip(); RestoreDC(fl_gc, _savedc); DeleteDC(fl_gc); fl_window=_sw; fl_gc = _sgc FL_EXPORT void fl_copy_offscreen(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy); +FL_EXPORT void fl_copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy); #define fl_delete_offscreen(bitmap) DeleteObject(bitmap); // Bitmap masks @@ -147,5 +148,5 @@ inline void fl_open_callback(void (*)(const char *)) {} extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b); // -// End of "$Id: win32.H 4569 2005-09-15 07:41:17Z matt $". +// End of "$Id: win32.H 5436 2006-09-16 16:02:00Z matt $". // @@ -1,5 +1,5 @@ // -// "$Id: x.H 4288 2005-04-16 00:13:17Z mike $" +// "$Id: x.H 5262 2006-07-18 11:23:20Z matt $" // // X11 header file for the Fast Light Tool Kit (FLTK). // @@ -69,6 +69,7 @@ extern FL_EXPORT Colormap fl_colormap; extern FL_EXPORT GC fl_gc; extern FL_EXPORT Window fl_window; extern FL_EXPORT XFontStruct* fl_xfont; +extern FL_EXPORT void *fl_xftfont; FL_EXPORT ulong fl_xpixel(Fl_Color i); FL_EXPORT ulong fl_xpixel(uchar r, uchar g, uchar b); FL_EXPORT void fl_clip_region(Fl_Region); @@ -143,5 +144,5 @@ extern FL_EXPORT int fl_parse_color(const char* p, uchar& r, uchar& g, uchar& b) #endif // -// End of "$Id: x.H 4288 2005-04-16 00:13:17Z mike $". +// End of "$Id: x.H 5262 2006-07-18 11:23:20Z matt $". // |