diff --git a/plugins/zynaddsubfx/fltk/CHANGES b/plugins/zynaddsubfx/fltk/CHANGES index 9d9ba3427..17802f4dc 100644 --- a/plugins/zynaddsubfx/fltk/CHANGES +++ b/plugins/zynaddsubfx/fltk/CHANGES @@ -1,5 +1,6 @@ CHANGES IN FLTK 1.3.0 + - Added template to generate new projects with Xcode. - Managing all Widget flags in a single location now (STR #2161) - Fixed all color related call to Fl_Color type (STR #2208) - File chooser preview now recognizes utf8 encoded diff --git a/plugins/zynaddsubfx/fltk/FL/Fl_Counter.H b/plugins/zynaddsubfx/fltk/FL/Fl_Counter.H index 24930779a..ff5a89568 100644 --- a/plugins/zynaddsubfx/fltk/FL/Fl_Counter.H +++ b/plugins/zynaddsubfx/fltk/FL/Fl_Counter.H @@ -98,7 +98,7 @@ public: /** Returns the increment for normal step buttons. */ - double step() {return Fl_Valuator::step();} + double step() const {return Fl_Valuator::step();} /** Gets the text font */ Fl_Font textfont() const {return textfont_;} diff --git a/plugins/zynaddsubfx/fltk/FL/Fl_Scroll.H b/plugins/zynaddsubfx/fltk/FL/Fl_Scroll.H index a8bbdb480..4e53ad4d2 100644 --- a/plugins/zynaddsubfx/fltk/FL/Fl_Scroll.H +++ b/plugins/zynaddsubfx/fltk/FL/Fl_Scroll.H @@ -36,22 +36,24 @@ /** This container widget lets you maneuver around a set of widgets much - larger than your window. If the child widgets are larger than the size + larger than your window. If the child widgets are larger than the size of this object then scrollbars will appear so that you can scroll over to them: -

\image html Fl_Scroll.gif

+ \image html Fl_Scroll.gif \image latex Fl_Scroll.eps "Fl_Scroll" width=4cm -

If all of the child widgets are packed together into a solid + + If all of the child widgets are packed together into a solid rectangle then you want to set box() to FL_NO_BOX or one of the _FRAME types. This will result in the best output. - However, if the child widgets are a sparse arrangment you must set - box() to a real _BOX type. This can result in some + However, if the child widgets are a sparse arrangement you must + set box() to a real _BOX type. This can result in some blinking during redrawing, but that can be solved by using a - Fl_Double_Window.

+ Fl_Double_Window. By default you can scroll in both directions, and the scrollbars disappear if the data will fit in the area of the scroll. -

Use Fl_Scroll::type() to change this as follows : + + Use Fl_Scroll::type() to change this as follows :

-

Use scrollbar.align(int) ( see void Fl_Widget::align(Fl_Align) ) : - to change what side the scrollbars are drawn on.
If the - FL_ALIGN_LEFT bit is on, the vertical scrollbar is on the left. + Use scrollbar.align(int) ( see void Fl_Widget::align(Fl_Align) ) : + to change what side the scrollbars are drawn on. + + If the FL_ALIGN_LEFT bit is on, the vertical scrollbar is on the left. If the FL_ALIGN_TOP bit is on, the horizontal scrollbar is on the top. Note that only the alignment flags in scrollbar are considered. The flags in hscrollbar however are ignored. -

This widget can also be used to pan around a single child widget - "canvas". This child widget should be of your own class, with a - draw() method that draws the contents. The scrolling is done by + This widget can also be used to pan around a single child widget + "canvas". This child widget should be of your own class, with a + draw() method that draws the contents. The scrolling is done by changing the x() and y() of the widget, so this child - must use the x() and y() to position it's drawing. + must use the x() and y() to position its drawing. To speed up drawing it should test fl_push_clip(). -

Another very useful child is a single - Fl_Pack, which is itself a group that packs it's children - together and changes size to surround them. Filling the Fl_Pack - with Fl_Tabs groups (and then putting + Another very useful child is a single Fl_Pack, which is itself a group + that packs its children together and changes size to surround them. + Filling the Fl_Pack with Fl_Tabs groups (and then putting normal widgets inside those) gives you a very powerful scrolling list - of individually-openable panels.

+ of individually-openable panels. -

Fluid lets you create these, but you can only lay out objects that - fit inside the Fl_Scroll without scrolling. Be sure to leave - space for the scrollbars, as Fluid won't show these either.

-

You cannot use Fl_Window as a child of this since the + Fluid lets you create these, but you can only lay out objects that + fit inside the Fl_Scroll without scrolling. Be sure to leave + space for the scrollbars, as Fluid won't show these either. + + You cannot use Fl_Window as a child of this since the clipping is not conveyed to it when drawn, and it will draw over the scrollbars and neighboring objects. */ class FL_EXPORT Fl_Scroll : public Fl_Group { int xposition_, yposition_; - int width_, height_; int oldx, oldy; int scrollbar_size_; static void hscrollbar_cb(Fl_Widget*, void*); diff --git a/plugins/zynaddsubfx/fltk/FL/Xutf8.h b/plugins/zynaddsubfx/fltk/FL/Xutf8.h index f8815287b..47f44a78d 100644 --- a/plugins/zynaddsubfx/fltk/FL/Xutf8.h +++ b/plugins/zynaddsubfx/fltk/FL/Xutf8.h @@ -1,4 +1,4 @@ -/* "$Id: $" +/* "$Id$" * * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2003 by O'ksi'D. @@ -172,5 +172,5 @@ XUtf8Toupper( #endif /* - * End of "$Id: $". + * End of "$Id$". */ diff --git a/plugins/zynaddsubfx/fltk/FL/fl_types.h b/plugins/zynaddsubfx/fltk/FL/fl_types.h index d87cd7387..99f164ba4 100644 --- a/plugins/zynaddsubfx/fltk/FL/fl_types.h +++ b/plugins/zynaddsubfx/fltk/FL/fl_types.h @@ -1,5 +1,5 @@ /* - * "$Id: fl_types.h 6299 2008-09-18 19:09:34Z fabien $" + * "$Id$" * * Simple "C"-style types for the Fast Light Tool Kit (FLTK). * @@ -62,5 +62,5 @@ typedef unsigned int Fl_Char; #endif /* - * End of "$Id: fl_types.h 6299 2008-09-18 19:09:34Z fabien $". + * End of "$Id$". */ diff --git a/plugins/zynaddsubfx/fltk/FL/fl_utf8.h b/plugins/zynaddsubfx/fltk/FL/fl_utf8.h index e7bc9010a..cd7be66fe 100644 --- a/plugins/zynaddsubfx/fltk/FL/fl_utf8.h +++ b/plugins/zynaddsubfx/fltk/FL/fl_utf8.h @@ -1,4 +1,4 @@ -/* "$Id: $" +/* "$Id$" * * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2009 by O'ksi'D. @@ -246,5 +246,5 @@ FL_EXPORT char fl_make_path( const char *path ); #endif /* _HAVE_FL_UTF8_HDR_ */ /* - * End of "$Id: $". + * End of "$Id$". */ diff --git a/plugins/zynaddsubfx/fltk/src/Fl_Input.cxx b/plugins/zynaddsubfx/fltk/src/Fl_Input.cxx index 7be68aafa..3f79122af 100644 --- a/plugins/zynaddsubfx/fltk/src/Fl_Input.cxx +++ b/plugins/zynaddsubfx/fltk/src/Fl_Input.cxx @@ -82,18 +82,18 @@ static const char *legal_fp_chars = ".eE+-"; #endif int Fl_Input::handle_key() { - + char ascii = Fl::event_text()[0]; - + int repeat_num=1; - + int del; if (Fl::compose(del)) { - + // Insert characters into numeric fields after checking for legality: if (input_type() == FL_FLOAT_INPUT || input_type() == FL_INT_INPUT) { Fl::compose_reset(); // ignore any foreign letters... - + // initialize the list of legal characters inside a floating point number #ifdef HAVE_LOCALECONV if (!legal_fp_chars) { @@ -108,7 +108,7 @@ int Fl_Input::handle_key() { // the following line is not a true memory leak because the array is only // allocated once if required, and automatically freed when the program quits char *chars = (char*)malloc(len+1); - legal_fp_chars = chars; + legal_fp_chars = chars; strcpy(chars, standard_fp_chars); if (lc) { if (lc->decimal_point) strcat(chars, lc->decimal_point); @@ -118,361 +118,364 @@ int Fl_Input::handle_key() { } } #endif // HAVE_LOCALECONV - + + // find the insert position + int ip = position()= '0' && ascii <= '9') || - (position()==1 && index(0)=='0' && (ascii=='x' || ascii == 'X')) || - (position()>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X') - && (ascii>='A'&& ascii<='F' || ascii>='a'&& ascii<='f')) || - input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii)) { - if (readonly()) fl_beep(); - else replace(position(), mark(), &ascii, 1); + if (!ip && (ascii == '+' || ascii == '-') + || (ascii >= '0' && ascii <= '9') + || (ip==1 && index(0)=='0' && (ascii=='x' || ascii == 'X')) + || (ip>1 && index(0)=='0' && (index(1)=='x'||index(1)=='X') + && (ascii>='A'&& ascii<='F' || ascii>='a'&& ascii<='f')) + || input_type()==FL_FLOAT_INPUT && ascii && strchr(legal_fp_chars, ascii)) + { + if (readonly()) fl_beep(); + else replace(position(), mark(), &ascii, 1); } return 1; } - + if (del || Fl::event_length()) { if (readonly()) fl_beep(); else replace(position(), del ? position()-del : mark(), - Fl::event_text(), Fl::event_length()); + Fl::event_text(), Fl::event_length()); } return 1; } - + unsigned int mods = Fl::event_state() & (FL_META|FL_CTRL|FL_ALT); switch (Fl::event_key()) { - case FL_Insert: - if (Fl::event_state() & FL_CTRL) ascii = ctrl('C'); - else if (Fl::event_state() & FL_SHIFT) ascii = ctrl('V'); - break; - case FL_Delete: + case FL_Insert: + if (Fl::event_state() & FL_CTRL) ascii = ctrl('C'); + else if (Fl::event_state() & FL_SHIFT) ascii = ctrl('V'); + break; + case FL_Delete: #ifdef __APPLE__ - if (mods==0 || mods==FL_CTRL) { // delete next char - ascii = ctrl('D'); - } else if (mods==FL_ALT) { // delete next word - if (mark() != position()) return cut(); - cut(position(), word_end(position())); - return 1; - } else if (mods==FL_META) { // delete to the end of the line - if (mark() != position()) return cut(); - cut(position(), line_end(position())); - return 1; - } else return 1; + if (mods==0 || mods==FL_CTRL) { // delete next char + ascii = ctrl('D'); + } else if (mods==FL_ALT) { // delete next word + if (mark() != position()) return cut(); + cut(position(), word_end(position())); + return 1; + } else if (mods==FL_META) { // delete to the end of the line + if (mark() != position()) return cut(); + cut(position(), line_end(position())); + return 1; + } else return 1; #else - if (mods==0) { - ascii = ctrl('D'); - } else if (mods==FL_SHIFT) { - ascii = ctrl('X'); - } else return 1; + if (mods==0) { + ascii = ctrl('D'); + } else if (mods==FL_SHIFT) { + ascii = ctrl('X'); + } else return 1; #endif - break; - case FL_Left: + break; + case FL_Left: #ifdef __APPLE__ - if (mods==0) { // char left - ascii = ctrl('B'); - } else if (mods==FL_ALT) { // word left - shift_position(word_start(position())); - return 1; - } else if (mods==FL_CTRL || mods==FL_META) { // start of line - shift_position(line_start(position())); - return 1; - } else return 1; + if (mods==0) { // char left + ascii = ctrl('B'); + } else if (mods==FL_ALT) { // word left + shift_position(word_start(position())); + return 1; + } else if (mods==FL_CTRL || mods==FL_META) { // start of line + shift_position(line_start(position())); + return 1; + } else return 1; #else - if (mods==0) { // char left - ascii = ctrl('B'); - } else if (mods==FL_CTRL) { // word left - shift_position(word_start(position())); - return 1; - } else return 1; + if (mods==0) { // char left + ascii = ctrl('B'); + } else if (mods==FL_CTRL) { // word left + shift_position(word_start(position())); + return 1; + } else return 1; #endif - break; - case FL_Right: + break; + case FL_Right: #ifdef __APPLE__ - if (mods==0) { // char right - ascii = ctrl('F'); - } else if (mods==FL_ALT) { // word right - shift_position(word_end(position())); - return 1; - } else if (mods==FL_CTRL || mods==FL_META) { // end of line - shift_position(line_end(position())); - return 1; - } else return 1; + if (mods==0) { // char right + ascii = ctrl('F'); + } else if (mods==FL_ALT) { // word right + shift_position(word_end(position())); + return 1; + } else if (mods==FL_CTRL || mods==FL_META) { // end of line + shift_position(line_end(position())); + return 1; + } else return 1; #else - if (mods==0) { // char right - ascii = ctrl('F'); - } else if (mods==FL_CTRL) { // word right - shift_position(word_end(position())); - return 1; - } else return 1; + if (mods==0) { // char right + ascii = ctrl('F'); + } else if (mods==FL_CTRL) { // word right + shift_position(word_end(position())); + return 1; + } else return 1; #endif // __APPLE__ - break; - case FL_Page_Up: + break; + case FL_Page_Up: #ifdef __APPLE__ - if (mods==0) { // scroll text one page - // OS X scrolls the view, but does not move the cursor - // Fl_Input has no scroll control, so instead we move the cursor by one page + if (mods==0) { // scroll text one page + // OS X scrolls the view, but does not move the cursor + // Fl_Input has no scroll control, so instead we move the cursor by one page + repeat_num = linesPerPage(); + ascii = ctrl('P'); + } else if (mods==FL_ALT) { // move cursor one page + repeat_num = linesPerPage(); + ascii = ctrl('P'); + } else return 1; + break; +#else repeat_num = linesPerPage(); - ascii = ctrl('P'); - } else if (mods==FL_ALT) { // move cursor one page + // fall through +#endif + case FL_Up: +#ifdef __APPLE__ + if (mods==0) { // line up + ascii = ctrl('P'); + } else if (mods==FL_CTRL) { // scroll text down one page + // OS X scrolls the view, but does not move the cursor + // Fl_Input has no scroll control, so instead we move the cursor by one page + repeat_num = linesPerPage(); + ascii = ctrl('P'); + } else if (mods==FL_ALT) { // line start and up + if (line_start(position())==position() && position()>0) + return shift_position(line_start(position()-1)) + NORMAL_INPUT_MOVE; + else + return shift_position(line_start(position())) + NORMAL_INPUT_MOVE; + } else if (mods==FL_META) { // start of document + shift_position(0); + return 1; + } else return 1; +#else + if (mods==0) { // line up + ascii = ctrl('P'); + } else if (mods==FL_CTRL) { // scroll text down one line + // Fl_Input has no scroll control, so instead we move the cursor by one page + ascii = ctrl('P'); + } else return 1; +#endif + break; + case FL_Page_Down: +#ifdef __APPLE__ + if (mods==0) { // scroll text one page + // OS X scrolls the view, but does not move the cursor + // Fl_Input has no scroll control, so instead we move the cursor by one page + repeat_num = linesPerPage(); + ascii = ctrl('N'); + } else if (mods==FL_ALT) { // move cursor one page + repeat_num = linesPerPage(); + ascii = ctrl('N'); + } else return 1; + break; +#else repeat_num = linesPerPage(); - ascii = ctrl('P'); - } else return 1; - break; -#else - repeat_num = linesPerPage(); - // fall through + // fall through #endif - case FL_Up: + case FL_Down: #ifdef __APPLE__ - if (mods==0) { // line up - ascii = ctrl('P'); - } else if (mods==FL_CTRL) { // scroll text down one page - // OS X scrolls the view, but does not move the cursor - // Fl_Input has no scroll control, so instead we move the cursor by one page - repeat_num = linesPerPage(); - ascii = ctrl('P'); - } else if (mods==FL_ALT) { // line start and up - if (line_start(position())==position() && position()>0) - return shift_position(line_start(position()-1)) + NORMAL_INPUT_MOVE; - else - return shift_position(line_start(position())) + NORMAL_INPUT_MOVE; - } else if (mods==FL_META) { // start of document - shift_position(0); - return 1; - } else return 1; + if (mods==0) { // line down + ascii = ctrl('N'); + } else if (mods==FL_CTRL) { + // OS X scrolls the view, but does not move the cursor + // Fl_Input has no scroll control, so instead we move the cursor by one page + repeat_num = linesPerPage(); + ascii = ctrl('N'); + } else if (mods==FL_ALT) { // line end and down + if (line_end(position())==position() && position()=size()) return 0; + i = line_end(position()); + if (i == position() && i < size()) i++; + cut(position(), i); + return copy_cuts(); + case ctrl('N'): // go down one line + i = position(); + if (line_end(i) >= size()) return NORMAL_INPUT_MOVE; + while (repeat_num--) { + i = line_end(i); + if (i >= size()) break; + i++; + } + shift_up_down_position(i); return 1; - } - if (mark() != position()) cut(); - else cut(-1); - return 1; - case ctrl('K'): // cut to the end of the line - if (readonly()) { - fl_beep(); + case ctrl('P'): // go up one line + i = position(); + if (!line_start(i)) return NORMAL_INPUT_MOVE; + while(repeat_num--) { + i = line_start(i); + if (!i) break; + i--; + } + shift_up_down_position(line_start(i)); return 1; - } - if (position()>=size()) return 0; - i = line_end(position()); - if (i == position() && i < size()) i++; - cut(position(), i); - return copy_cuts(); - case ctrl('N'): // go down one line - i = position(); - if (line_end(i) >= size()) return NORMAL_INPUT_MOVE; - while (repeat_num--) { - i = line_end(i); - if (i >= size()) break; - i++; - } - shift_up_down_position(i); - return 1; - case ctrl('P'): // go up one line - i = position(); - if (!line_start(i)) return NORMAL_INPUT_MOVE; - while(repeat_num--) { - i = line_start(i); - if (!i) break; - i--; - } - shift_up_down_position(line_start(i)); - return 1; - case ctrl('U'): // clear the whole document? - if (readonly()) { - fl_beep(); + case ctrl('U'): // clear the whole document? + if (readonly()) { + fl_beep(); + return 1; + } + return cut(0, size()); + case ctrl('V'): // paste text + case ctrl('Y'): + if (readonly()) { + fl_beep(); + return 1; + } + Fl::paste(*this, 1); return 1; - } - return cut(0, size()); - case ctrl('V'): // paste text - case ctrl('Y'): - if (readonly()) { - fl_beep(); - return 1; - } - Fl::paste(*this, 1); - return 1; - case ctrl('X'): // cut the selected text - case ctrl('W'): - if (readonly()) { - fl_beep(); - return 1; - } - copy(1); - return cut(); - case ctrl('Z'): // undo - case ctrl('_'): - if (readonly()) { - fl_beep(); - return 1; - } - return undo(); - case ctrl('I'): // insert literal - case ctrl('J'): - case ctrl('L'): - case ctrl('M'): - if (readonly()) { - fl_beep(); - return 1; - } - // insert a few selected control characters literally: - if (input_type() != FL_FLOAT_INPUT && input_type() != FL_INT_INPUT) - return replace(position(), mark(), &ascii, 1); + case ctrl('X'): // cut the selected text + case ctrl('W'): + if (readonly()) { + fl_beep(); + return 1; + } + copy(1); + return cut(); + case ctrl('Z'): // undo + case ctrl('_'): + if (readonly()) { + fl_beep(); + return 1; + } + return undo(); + case ctrl('I'): // insert literal + case ctrl('J'): + case ctrl('L'): + case ctrl('M'): + if (readonly()) { + fl_beep(); + return 1; + } + // insert a few selected control characters literally: + if (input_type() != FL_FLOAT_INPUT && input_type() != FL_INT_INPUT) + return replace(position(), mark(), &ascii, 1); } - + return 0; } diff --git a/plugins/zynaddsubfx/fltk/src/aimm.h b/plugins/zynaddsubfx/fltk/src/aimm.h index 2acd5d96f..1ee9e6ce9 100644 --- a/plugins/zynaddsubfx/fltk/src/aimm.h +++ b/plugins/zynaddsubfx/fltk/src/aimm.h @@ -1,3 +1,6 @@ +// +// "$Id$" +// // Standard dialog header file for the UTF-8 Fast Light Tool Kit (FLTK-UTF8). // // Copyright 2009 by Bill Spitzak and others. @@ -423,6 +426,6 @@ extern "C" __declspec(dllimport) long __stdcall CoCreateInstance(const GUID & rc #endif -/* - * End of "$Id$". - */ +// +// End of "$Id$". +// diff --git a/plugins/zynaddsubfx/fltk/src/fl_utf.c b/plugins/zynaddsubfx/fltk/src/fl_utf.c index cc2059ce5..3acf925ed 100644 --- a/plugins/zynaddsubfx/fltk/src/fl_utf.c +++ b/plugins/zynaddsubfx/fltk/src/fl_utf.c @@ -1,5 +1,8 @@ -/* This is the utf.c file from fltk2 adapted for use in my fltk1.1 port */ - +/* + * "$Id$" + * + * This is the utf.c file from fltk2 adapted for use in my fltk1.1 port + */ /* Copyright 2006-2009 by Bill Spitzak and others. * * This library is free software; you can redistribute it and/or @@ -855,3 +858,7 @@ int fl_utf8test(const char* src, unsigned srclen) { } /** @} */ + +/* + * End of "$Id$". + */ diff --git a/plugins/zynaddsubfx/fltk/src/fl_utf8.cxx b/plugins/zynaddsubfx/fltk/src/fl_utf8.cxx index 7634ca93b..f90d847af 100644 --- a/plugins/zynaddsubfx/fltk/src/fl_utf8.cxx +++ b/plugins/zynaddsubfx/fltk/src/fl_utf8.cxx @@ -1,4 +1,5 @@ -// "$Id: $" +// +// "$Id$" // // Unicode to UTF-8 conversion functions. // @@ -822,6 +823,5 @@ void fl_make_path_for_file( const char *path ) /** @} */ // -// End of "$Id: $". +// End of "$Id$". // -