Multiple fixes from Sebastien.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1833 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2001-12-11 16:03:13 +00:00
parent 6905f61c2c
commit fdcdc8fd46
22 changed files with 182 additions and 130 deletions

15
CHANGES
View File

@ -1,6 +1,20 @@
CHANGES IN FLTK 1.1.0b7
- More documentation updates...
- Mac OS X support works 95%
- Fl_Button::handle() was calling take_focus() for both
FL_PUSH and FL_DRAG.
- File and memory fixes for Fl_GIF_Image, Fl_PNG_Image,
Fl_PNM_Image, Fl_Shared_Image, Fl_Tiled_Image, and
Fl_XBM_Image.
- filename_match() didn't handle backslashes properly
under WIN32, and didn't use a case-insensitive
comparison under MacOS X.
- The Fl class was missing access methods for the
FL_MOUSEWHEEL event values - Fl::event_dx() and
Fl::event_dy().
- The default help string didn't include the -nokbd
option.
- "make uninstall" didn't uninstall the static OpenGL
widget library.
- Mac cursor shapes added...
@ -22,7 +36,6 @@ CHANGES IN FLTK 1.1.0b7
loaded.
- Some Win32 drivers would draw into wrong buffers
after OpenGL mode change
- Mac OS X support works 95%
- The file chooser would cause a segfault if you
clicked in an empty area of the file list.
- Fl_File_Icon::labeltype() would cause a segfault

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl.H,v 1.8.2.11.2.7 2001/12/06 22:16:49 easysw Exp $"
// "$Id: Fl.H,v 1.8.2.11.2.8 2001/12/11 16:03:11 easysw Exp $"
//
// Main header file for the Fast Light Tool Kit (FLTK).
//
@ -128,6 +128,8 @@ public:
static FL_EXPORT int event_y() {return e_y;}
static FL_EXPORT int event_x_root() {return e_x_root;}
static FL_EXPORT int event_y_root() {return e_y_root;}
static FL_EXPORT int event_dx() {return e_dx;}
static FL_EXPORT int event_dy() {return e_dy;}
static FL_EXPORT void get_mouse(int &,int &);
static FL_EXPORT int event_clicks() {return e_clicks;}
static FL_EXPORT void event_clicks(int i) {e_clicks = i;}
@ -231,5 +233,5 @@ public:
#endif // !Fl_H
//
// End of "$Id: Fl.H,v 1.8.2.11.2.7 2001/12/06 22:16:49 easysw Exp $".
// End of "$Id: Fl.H,v 1.8.2.11.2.8 2001/12/11 16:03:11 easysw Exp $".
//

27
README
View File

@ -5,10 +5,10 @@ WHAT IS FLTK?
The Fast Light Tool Kit ("FLTK", pronounced "fulltick") is a
LGPL'd C++ graphical user interface toolkit for X (UNIX(r)),
OpenGL(r), and Microsoft(r) Windows(r) NT 4.0, 95, or 98. It
was originally developed by Mr. Bill Spitzak and is
currently maintained by a small group of developers across
the world with a central repository in the US.
OpenGL(r), MacOS(r) X, and Microsoft(r) Windows(r). It was
originally developed by Mr. Bill Spitzak and is currently
maintained by a small group of developers across the world
with a central repository in the US.
LICENSING
@ -29,7 +29,7 @@ ON-LINE DOCUMENTATION
http://www.fltk.org/documentation.php
BUILDING AND INSTALLING FLTK UNDER UNIX
BUILDING AND INSTALLING FLTK UNDER UNIX AND MacOS X
In most cases you can just type "make". This will run
configure with the default (no) options and then compile
@ -78,14 +78,20 @@ BUILDING AND INSTALLING FLTK UNDER UNIX
BUILDING FLTK UNDER MICROSOFT WINDOWS
There are two ways to build FLTK under Microsoft Windows.
The first is to use the 5.0 project files under the
The first is to use the VC++ 6.0 project files under the
"visualc" directory. Just open (or double-click on) the
"fltk.dsw" file to get the whole shebang.
The second method is to use a GNU-based development tool
with the files in the "makefiles" directory. To build using
one of these tools simply copy the appropriate makeinclude
and config files to the main directory and do a make:
with the files in the "makefiles" directory. To build
with the CygWin tools, use the supplied configure script
as specified in the UNIX section above:
sh configure ...options...
To build using other tools simply copy the appropriate
makeinclude and config files to the main directory and do a
make:
copy makefiles\Makefile.<env> Makefile
make
@ -162,7 +168,8 @@ TRADEMARKS
Microsoft and Windows are registered trademarks of Microsoft
Corportation. UNIX is a registered trademark of the X/Open
Group, Inc. OpenGL is a registered trademark of Silicon
Graphics, Inc.
Graphics, Inc. MacOS is a registered trademark of Apple
Computers, Inc.
COPYRIGHT

View File

@ -22,8 +22,15 @@
<H3>Description</H3>
<P>The <TT>Fl_Tiled_Image</TT> class supports tiling of images over a
specified area.</P>
<P>The <TT>Fl_Tiled_Image</TT> class supports tiling of images
over a specified area. The source (tile) image is <B>not</B>
copied unless you call the <A
HREF="Fl_Image.html#Fl_Image.color_average"><TT>color_average()</TT></A>,
<A
HREF="Fl_Image.html#Fl_Image.desaturate"><TT>desaturate()</TT></A>,
or <A
HREF="Fl_Image.html#Fl_Image.inactive"><TT>inactive()</TT></A>
methods.</P>
<H3>Methods</H3>

View File

@ -5,11 +5,11 @@
<P>The Fast Light Tool Kit (&quot;FLTK&quot;, pronounced
&quot;fulltick&quot;) is a LGPL'd C++ graphical user interface
toolkit for X (UNIX&reg;), OpenGL&reg;, and Microsoft&reg;
Windows&reg;. Work is also underway to support FLTK under MacOS
X. It was originally developed by Mr. Bill Spitzak and is
currently maintained by a small group of developers across the
world with a central repository in the US.</P>
toolkit for X (UNIX&reg;), OpenGL&reg;, MacOS&reg; X, and
Microsoft&reg; Windows&reg;. It was originally developed by Mr.
Bill Spitzak and is currently maintained by a small group of
developers across the world with a central repository in the
US.</P>
<H2>History of FLTK</H2>
@ -151,7 +151,7 @@ the toolkit, which was already in use by several people, Bill
came up with &quot;FLTK&quot;, including a bogus excuse that it
stands for &quot;The Fast Light Toolkit&quot;.</P>
<H2>Building and Installing FLTK Under UNIX</H2>
<H2>Building and Installing FLTK Under UNIX and MacOS X</H2>
<P>In most cases you can just type &quot;make&quot;. This will
run configure with the default of no options and then compile
@ -294,15 +294,6 @@ copy makefiles\Makefile.os2x Makefile
make
</PRE></UL>
<H2>Building FLTK Under MacOS X</H2>
<P>The current version of FLTK requires the XFree86 X server for
Darwin. Follow the instructions for building FLTK under
UNIX.</P>
<P>Future versions of FLTK will provide a Carbon-based window
interface, so XFree86 will no longer be required.</P>
<H2>Internet Resources</H2>
<P>FLTK is available on the 'net in a bunch of locations:</P>

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Button.cxx,v 1.4.2.6.2.5 2001/11/03 19:24:22 easysw Exp $"
// "$Id: Fl_Button.cxx,v 1.4.2.6.2.6 2001/12/11 16:03:11 easysw Exp $"
//
// Button widget for the Fast Light Tool Kit (FLTK).
//
@ -65,8 +65,8 @@ int Fl_Button::handle(int event) {
// if ((value_?selection_color():color())==FL_GRAY) redraw();
return 1;
case FL_PUSH:
case FL_DRAG:
if (Fl::visible_focus()) take_focus();
case FL_DRAG:
if (Fl::event_inside(this)) {
if (type() == FL_RADIO_BUTTON) newval = 1;
else newval = !oldval;
@ -138,5 +138,5 @@ Fl_Button::Fl_Button(int x,int y,int w,int h, const char *l)
}
//
// End of "$Id: Fl_Button.cxx,v 1.4.2.6.2.5 2001/11/03 19:24:22 easysw Exp $".
// End of "$Id: Fl_Button.cxx,v 1.4.2.6.2.6 2001/12/11 16:03:11 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Chart.cxx,v 1.5.2.6.2.2 2001/11/22 15:35:01 easysw Exp $"
// "$Id: Fl_Chart.cxx,v 1.5.2.6.2.3 2001/12/11 16:03:12 easysw Exp $"
//
// Forms-compatible chart widget for the Fast Light Tool Kit (FLTK).
//
@ -312,7 +312,7 @@ void Fl_Chart::add(double val, const char *str, unsigned col) {
entries[numb].val = float(val);
entries[numb].col = col;
if (str) {
strncpy(entries[numb].str,str,FL_CHART_LABEL_MAX+1);
strncpy(entries[numb].str,str,FL_CHART_LABEL_MAX);
entries[numb].str[FL_CHART_LABEL_MAX] = 0;
} else {
entries[numb].str[0] = 0;
@ -336,7 +336,7 @@ void Fl_Chart::insert(int index, double val, const char *str, unsigned col) {
entries[index-1].val = float(val);
entries[index-1].col = col;
if (str) {
strncpy(entries[index-1].str,str,FL_CHART_LABEL_MAX+1);
strncpy(entries[index-1].str,str,FL_CHART_LABEL_MAX);
entries[index-1].str[FL_CHART_LABEL_MAX] = 0;
} else {
entries[index-1].str[0] = 0;
@ -349,7 +349,7 @@ void Fl_Chart::replace(int index,double val, const char *str, unsigned col) {
entries[index-1].val = float(val);
entries[index-1].col = col;
if (str) {
strncpy(entries[index-1].str,str,FL_CHART_LABEL_MAX+1);
strncpy(entries[index-1].str,str,FL_CHART_LABEL_MAX);
entries[index-1].str[FL_CHART_LABEL_MAX] = 0;
} else {
entries[index-1].str[0] = 0;
@ -378,5 +378,5 @@ void Fl_Chart::maxsize(int m) {
}
//
// End of "$Id: Fl_Chart.cxx,v 1.5.2.6.2.2 2001/11/22 15:35:01 easysw Exp $".
// End of "$Id: Fl_Chart.cxx,v 1.5.2.6.2.3 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -53,10 +53,10 @@ void Fl_File_Chooser::cb_upButton(Fl_Button* o, void* v) {
}
#include <FL/Fl_Bitmap.H>
static unsigned char bits_up[] =
static unsigned char idata_up[] =
"\0\0x\0\204\0\2\1""1\376y\200\375\200""1\200""1\200""1\200""1\200""1\200\1\
\200\1\200\377\377\0\0";
static Fl_Bitmap bitmap_up(bits_up, 16, 16);
static Fl_Bitmap image_up(idata_up, 16, 16);
inline void Fl_File_Chooser::cb_newButton_i(Fl_Button*, void*) {
newdir();
@ -65,10 +65,10 @@ void Fl_File_Chooser::cb_newButton(Fl_Button* o, void* v) {
((Fl_File_Chooser*)(o->parent()->user_data()))->cb_newButton_i(o,v);
}
static unsigned char bits_new[] =
static unsigned char idata_new[] =
"\0\0x\0\204\0\2\1\1\376\1\200""1\200""1\200\375\200\375\200""1\200""1\200\1\
\200\1\200\377\377\0\0";
static Fl_Bitmap bitmap_new(bits_new, 16, 16);
static Fl_Bitmap image_new(idata_new, 16, 16);
inline void Fl_File_Chooser::cb_dirMenu_i(Fl_Choice*, void*) {
char pathname[1024];
@ -96,9 +96,9 @@ void Fl_File_Chooser::cb_(Fl_Button* o, void* v) {
((Fl_File_Chooser*)(o->parent()->user_data()))->cb__i(o,v);
}
static unsigned char bits_allfiles[] =
static unsigned char idata_allfiles[] =
"\374?\4 \4 \4 \204!\244%\304#\364/\364/\304#\244%\204!\4 \4 \4 \374?";
static Fl_Bitmap bitmap_allfiles(bits_allfiles, 16, 16);
static Fl_Bitmap image_allfiles(idata_allfiles, 16, 16);
Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char *title) {
Fl_Window* w;
@ -127,13 +127,13 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
}
{ Fl_Button* o = upButton = new Fl_Button(280, 10, 25, 25);
o->tooltip("Show the parent directory.");
o->image(bitmap_up);
o->image(image_up);
o->labelsize(8);
o->callback((Fl_Callback*)cb_upButton);
}
{ Fl_Button* o = newButton = new Fl_Button(310, 10, 25, 25);
o->tooltip("Create a new directory.");
o->image(bitmap_new);
o->image(image_new);
o->labelsize(8);
o->callback((Fl_Callback*)cb_newButton);
}
@ -144,7 +144,7 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
}
{ Fl_Button* o = new Fl_Button(340, 10, 25, 25);
o->tooltip("Change the filename filter.");
o->image(bitmap_allfiles);
o->image(image_allfiles);
o->labelsize(28);
o->labelcolor(4);
o->callback((Fl_Callback*)cb_);
@ -154,7 +154,7 @@ Fl_File_Chooser::Fl_File_Chooser(const char *d, const char *p, int t, const char
o->set_modal();
o->end();
}
window->size_range(345, 270, 345);
window->size_range(375, 315, 375);
fileList->filter(p);
type(t);
value(d);

View File

@ -84,12 +84,13 @@ if ((f = fl_input("New Filter?",
code0 {\#include <FL/fl_ask.H>}
}
}
code {window->size_range(345, 270, 345);
code {window->size_range(375, 315, 375);
fileList->filter(p);
type(t);
value(d);
callback_ = 0;
data_ = 0;} {}
data_ = 0;} {selected
}
}
decl {void (*callback_)(Fl_File_Chooser*, void *);} {}
decl {void *data_;} {}
@ -215,5 +216,5 @@ decl {FL_EXPORT char *fl_dir_chooser(const char *message,const char *fname);} {p
decl {FL_EXPORT char *fl_file_chooser(const char *message,const char *pat,const char *fname);} {public
}
decl {FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));} {selected public
decl {FL_EXPORT void fl_file_chooser_callback(void (*cb)(const char*));} {public
}

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_GIF_Image.cxx,v 1.1.2.5 2001/11/24 18:07:57 easysw Exp $"
// "$Id: Fl_GIF_Image.cxx,v 1.1.2.6 2001/12/11 16:03:12 easysw Exp $"
//
// Fl_GIF_Image routines.
//
@ -87,9 +87,15 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
}
{char b[6];
if (fread(b,1,6,GifFile)<6) return; /* quit on eof */
if (fread(b,1,6,GifFile)<6) {
fclose(GifFile);
return; /* quit on eof */
}
if (b[0]!='G' || b[1]!='I' || b[2] != 'F') {
Fl::error("%s is not a GIF file.\n", infname); return;}
Fl::error("%s is not a GIF file.\n", infname);
fclose(GifFile);
return;
}
if (b[3]!='8' || b[4]>'9' || b[5]!= 'a')
Fl::warning("%s is version %c%c%c.",infname,b[3],b[4],b[5]);
}
@ -128,7 +134,11 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
for (;;) {
int i = NEXTBYTE;
if (i<0) {Fl::error("%s: unexpected EOF",infname); return;}
if (i<0) {
Fl::error("%s: unexpected EOF",infname);
fclose(GifFile);
return;
}
int blocklen;
// if (i == 0x3B) return 0; eof code
@ -185,6 +195,7 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
uchar *Image = new uchar[Width*Height];
if (!Image) {
Fl::fatal("Insufficient memory for %s.", infname);
fclose(GifFile);
return;
}
@ -361,9 +372,11 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
alloc_data = 1;
delete[] Image;
fclose(GifFile);
}
//
// End of "$Id: Fl_GIF_Image.cxx,v 1.1.2.5 2001/11/24 18:07:57 easysw Exp $".
// End of "$Id: Fl_GIF_Image.cxx,v 1.1.2.6 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.3 2001/12/06 00:17:47 matthiaswm Exp $"
// "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.4 2001/12/11 16:03:12 easysw Exp $"
//
// OpenGL window code for the Fast Light Tool Kit (FLTK).
//
@ -339,11 +339,14 @@ Fl_Gl_Window::~Fl_Gl_Window() {
void Fl_Gl_Window::init() {
end(); // we probably don't want any children
box(FL_NO_BOX);
mode_ = FL_RGB | FL_DEPTH | FL_DOUBLE;
alist = 0;
mode_ = FL_RGB | FL_DEPTH | FL_DOUBLE;
alist = 0;
context_ = 0;
g = 0;
overlay = 0;
g = 0;
overlay = 0;
valid_ = 0;
damage1_ = 0;
}
void Fl_Gl_Window::draw_overlay() {}
@ -351,5 +354,5 @@ void Fl_Gl_Window::draw_overlay() {}
#endif
//
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.3 2001/12/06 00:17:47 matthiaswm Exp $".
// End of "$Id: Fl_Gl_Window.cxx,v 1.12.2.22.2.4 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Help_View.cxx,v 1.1.2.17 2001/11/30 16:10:08 easysw Exp $"
// "$Id: Fl_Help_View.cxx,v 1.1.2.18 2001/12/11 16:03:12 easysw Exp $"
//
// Fl_Help_View widget routines.
//
@ -162,13 +162,13 @@ Fl_Help_View::add_link(const char *n, // I - Name of link
temp->w = xx + ww;
temp->h = yy + hh;
strncpy(temp->filename, n, sizeof(temp->filename));
strncpy(temp->filename, n, sizeof(temp->filename) - 1);
temp->filename[sizeof(temp->filename) - 1] = '\0';
if ((target = strrchr(temp->filename, '#')) != NULL)
{
*target++ = '\0';
strncpy(temp->name, target, sizeof(temp->name));
strncpy(temp->name, target, sizeof(temp->name) - 1);
temp->name[sizeof(temp->name) - 1] = '\0';
}
else
@ -202,7 +202,7 @@ Fl_Help_View::add_target(const char *n, // I - Name of target
temp = targets_ + ntargets_;
temp->y = yy;
strncpy(temp->name, n, sizeof(temp->name));
strncpy(temp->name, n, sizeof(temp->name) - 1);
temp->name[sizeof(temp->name) - 1] = '\0';
ntargets_ ++;
@ -2042,6 +2042,9 @@ Fl_Help_View::handle(int event) // I - Event to handle
yy = Fl::event_y() - y() + topline_;
break;
case FL_LEAVE :
fl_cursor(FL_CURSOR_DEFAULT);
default :
return (Fl_Group::handle(event));
}
@ -2549,5 +2552,5 @@ hscrollbar_callback(Fl_Widget *s, void *)
//
// End of "$Id: Fl_Help_View.cxx,v 1.1.2.17 2001/11/30 16:10:08 easysw Exp $".
// End of "$Id: Fl_Help_View.cxx,v 1.1.2.18 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_PNG_Image.cxx,v 1.1.2.2 2001/11/23 12:06:36 easysw Exp $"
// "$Id: Fl_PNG_Image.cxx,v 1.1.2.3 2001/12/11 16:03:12 easysw Exp $"
//
// Fl_PNG_Image routines.
//
@ -25,6 +25,7 @@
//
// Contents:
//
// Fl_PNG_Image::Fl_PNG_Image() - Load a PNG image file.
//
//
@ -115,7 +116,7 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
png_read_rows(pp, rows, NULL, h());
// Free memory and return...
delete rows;
delete[] rows;
png_read_end(pp, info);
# ifdef HAVE_PNG_READ_DESTROY
@ -130,5 +131,5 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
//
// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.2 2001/11/23 12:06:36 easysw Exp $".
// End of "$Id: Fl_PNG_Image.cxx,v 1.1.2.3 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_PNM_Image.cxx,v 1.1.2.2 2001/11/28 18:09:08 easysw Exp $"
// "$Id: Fl_PNM_Image.cxx,v 1.1.2.3 2001/12/11 16:03:12 easysw Exp $"
//
// Fl_PNM_Image routines.
//
@ -24,6 +24,7 @@
//
// Contents:
//
// Fl_PNM_Image::Fl_PNM_Image() - Load a PNM image...
//
//
@ -73,6 +74,12 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
//
lineptr = fgets(line, sizeof(line), fp);
if (!lineptr) {
Fl::error("Early end-of-file in PNM file \"%s\"!", name);
fclose(fp);
return;
}
lineptr ++;
format = atoi(lineptr);
@ -159,5 +166,5 @@ Fl_PNM_Image::Fl_PNM_Image(const char *name) // I - File to read
//
// End of "$Id: Fl_PNM_Image.cxx,v 1.1.2.2 2001/11/28 18:09:08 easysw Exp $".
// End of "$Id: Fl_PNM_Image.cxx,v 1.1.2.3 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Shared_Image.cxx,v 1.23.2.3 2001/11/29 00:24:43 easysw Exp $"
// "$Id: Fl_Shared_Image.cxx,v 1.23.2.4 2001/12/11 16:03:12 easysw Exp $"
//
// Shared image code for the Fast Light Tool Kit (FLTK).
//
@ -118,7 +118,7 @@ Fl_Shared_Image::add() {
temp = new Fl_Shared_Image *[alloc_images_ + 32];
if (alloc_images_) {
memcpy(images_, temp, sizeof(Fl_Shared_Image *));
memcpy(temp, images_, alloc_images_ * sizeof(Fl_Shared_Image *));
delete[] images_;
}
@ -376,5 +376,5 @@ Fl_Shared_Image::get(const char *n, int W, int H) {
//
// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.3 2001/11/29 00:24:43 easysw Exp $".
// End of "$Id: Fl_Shared_Image.cxx,v 1.23.2.4 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Tiled_Image.cxx,v 1.1.2.2 2001/12/06 18:12:35 easysw Exp $"
// "$Id: Fl_Tiled_Image.cxx,v 1.1.2.3 2001/12/11 16:03:12 easysw Exp $"
//
// Tiled image code for the Fast Light Tool Kit (FLTK).
//
@ -74,12 +74,15 @@ Fl_Tiled_Image::copy(int W, // I - New width
void
Fl_Tiled_Image::color_average(Fl_Color c, // I - Color to blend with
float i) { // I - Blend fraction
Fl_Image *temp = image_->copy();
if (alloc_image_) image_->color_average(c, i);
else {
Fl_Image *temp = image_->copy();
temp->color_average(c, i);
temp->color_average(c, i);
image_ = temp;
alloc_image_ = 1;
image_ = temp;
alloc_image_ = 1;
}
}
@ -89,12 +92,15 @@ Fl_Tiled_Image::color_average(Fl_Color c, // I - Color to blend with
void
Fl_Tiled_Image::desaturate() {
Fl_Image *temp = image_->copy();
if (alloc_image_) image_->desaturate();
else {
Fl_Image *temp = image_->copy();
temp->desaturate();
temp->desaturate();
image_ = temp;
alloc_image_ = 1;
image_ = temp;
alloc_image_ = 1;
}
}
@ -133,5 +139,5 @@ Fl_Tiled_Image::draw(int X, // I - Starting X position
//
// End of "$Id: Fl_Tiled_Image.cxx,v 1.1.2.2 2001/12/06 18:12:35 easysw Exp $".
// End of "$Id: Fl_Tiled_Image.cxx,v 1.1.2.3 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_XBM_Image.cxx,v 1.1.2.1 2001/11/24 18:07:57 easysw Exp $"
// "$Id: Fl_XBM_Image.cxx,v 1.1.2.2 2001/12/11 16:03:12 easysw Exp $"
//
// Fl_XBM_Image routines.
//
@ -24,6 +24,7 @@
//
// Contents:
//
// Fl_XBM_Image::Fl_XBM_Image() - Load an XBM file.
//
//
@ -37,6 +38,10 @@
#include <stdlib.h>
#include <string.h>
//
// 'Fl_XBM_Image::Fl_XBM_Image()' - Load an XBM file.
//
Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
FILE *f;
uchar *data;
@ -49,7 +54,10 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
int i;
for (i = 0; i<2; i++) {
for (;;) {
if (!fgets(buffer,1024,f)) return;
if (!fgets(buffer,1024,f)) {
fclose(f);
return;
}
int r = sscanf(buffer,"#define %s %d",junk,&wh[i]);
if (r >= 2) break;
}
@ -57,7 +65,10 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
// skip to data array:
for (;;) {
if (!fgets(buffer,1024,f)) return;
if (!fgets(buffer,1024,f)) {
fclose(f);
return;
}
if (!strncmp(buffer,"static ",7)) break;
}
@ -70,7 +81,10 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
// read the data:
for (i = 0, data = (uchar *)array; i < n;) {
if (!fgets(buffer,1024,f)) return;
if (!fgets(buffer,1024,f)) {
fclose(f);
return;
}
const char *a = buffer;
while (*a && i<n) {
int t;
@ -84,5 +98,5 @@ Fl_XBM_Image::Fl_XBM_Image(const char *name) : Fl_Bitmap((const char *)0,0,0) {
//
// End of "$Id: Fl_XBM_Image.cxx,v 1.1.2.1 2001/11/24 18:07:57 easysw Exp $".
// End of "$Id: Fl_XBM_Image.cxx,v 1.1.2.2 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_arg.cxx,v 1.5.2.8.2.3 2001/11/27 17:44:06 easysw Exp $"
// "$Id: Fl_arg.cxx,v 1.5.2.8.2.4 2001/12/11 16:03:12 easysw Exp $"
//
// Optional argument initialization code for the Fast Light Tool Kit (FLTK).
//
@ -211,7 +211,8 @@ static const char * const helpmsg =
" -i[conic]\n"
" -fg color\n"
" -bg color\n"
" -bg2 color";
" -bg2 color\n"
" -nokbd";
const char * const Fl::help = helpmsg+13;
@ -358,5 +359,5 @@ int XParseGeometry(const char* string, int* x, int* y,
#endif // ifdef WIN32
//
// End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.3 2001/11/27 17:44:06 easysw Exp $".
// End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.4 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: filename_absolute.cxx,v 1.5.2.4.2.2 2001/11/26 19:41:57 easysw Exp $"
// "$Id: filename_absolute.cxx,v 1.5.2.4.2.3 2001/12/11 16:03:12 easysw Exp $"
//
// Filename expansion routines for the Fast Light Tool Kit (FLTK).
//
@ -110,13 +110,12 @@ int filename_absolute(char *to, int tolen, const char *from) {
*/
int // O - 0 if no change, 1 if changed
filename_relative(char *to, // O - Relative filename
int tolen, // I - Size of "to" buffer
const char *from) { // I - Absolute filename
filename_relative(char *to, // O - Relative filename
int tolen, // I - Size of "to" buffer
const char *from) { // I - Absolute filename
const char *newslash; // Directory separator
char *slash; // Directory separator
const char *slash; // Directory separator
char cwd[1024]; // Current directory
char *temp = new char[tolen];// Temporary pathname
if (from[0] == '\0' || !isdirsep(*from)) {
@ -131,16 +130,13 @@ filename_relative(char *to, // O - Relative filename
return 0;
}
strncpy(temp, from, tolen - 1);
temp[tolen - 1] = '\0';
for (slash = temp, newslash = cwd;
for (slash = from, newslash = cwd;
*slash != '\0' && *newslash != '\0';
slash ++, newslash ++)
if (isdirsep(*slash) && isdirsep(*newslash)) continue;
else if (*slash != *newslash) break;
while (!isdirsep(*slash) && slash > temp) slash --;
while (!isdirsep(*slash) && slash > from) slash --;
if (isdirsep(*slash)) slash ++;
@ -158,10 +154,8 @@ filename_relative(char *to, // O - Relative filename
to[0] = '\0';
to[tolen - 1] = '\0';
while (*newslash != '\0')
{
if (*newslash == '/' || *newslash == '\\')
strncat(to, "../", tolen - 1);
while (*newslash != '\0') {
if (isdirsep(*newslash)) strncat(to, "../", tolen - 1);
newslash ++;
}
@ -173,5 +167,5 @@ filename_relative(char *to, // O - Relative filename
//
// End of "$Id: filename_absolute.cxx,v 1.5.2.4.2.2 2001/11/26 19:41:57 easysw Exp $".
// End of "$Id: filename_absolute.cxx,v 1.5.2.4.2.3 2001/12/11 16:03:12 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: filename_expand.cxx,v 1.4.2.4.2.1 2001/11/26 00:15:06 easysw Exp $"
// "$Id: filename_expand.cxx,v 1.4.2.4.2.2 2001/12/11 16:03:13 easysw Exp $"
//
// Filename expansion routines for the Fast Light Tool Kit (FLTK).
//
@ -46,7 +46,7 @@ static inline int isdirsep(char c) {return c=='/' || c=='\\';}
int filename_expand(char *to,int tolen, const char *from) {
char *temp = new char[tolen];
strncpy(temp,from, tolen);
strncpy(temp,from, tolen - 1);
temp[tolen - 1] = '\0';
char *start = temp;
char *end = temp+strlen(temp);
@ -106,5 +106,5 @@ int filename_expand(char *to,int tolen, const char *from) {
//
// End of "$Id: filename_expand.cxx,v 1.4.2.4.2.1 2001/11/26 00:15:06 easysw Exp $".
// End of "$Id: filename_expand.cxx,v 1.4.2.4.2.2 2001/12/11 16:03:13 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: filename_match.cxx,v 1.5.2.4 2001/01/22 15:13:40 easysw Exp $"
// "$Id: filename_match.cxx,v 1.5.2.4.2.1 2001/12/11 16:03:13 easysw Exp $"
//
// Pattern matching routines for the Fast Light Tool Kit (FLTK).
//
@ -89,25 +89,20 @@ int filename_match(const char *s, const char *p) {
case 0: // end of pattern
return !*s;
#if defined(WIN32) && !defined(__CYGWIN__)
case '\\': // quote next character
if (*p) p++;
if (*s++ != *(p-1)) return 0;
break;
default:
#if defined(WIN32) || defined(__CYGWIN__) || defined(__APPLE__)
if (tolower(*s) != tolower(*(p-1))) return 0;
s++;
#else
case '\\': // quote next character
if (*p) p++;
default :
if (*s++ != *(p-1)) return 0;
break;
#endif
break;
}
}
}
//
// End of "$Id: filename_match.cxx,v 1.5.2.4 2001/01/22 15:13:40 easysw Exp $".
// End of "$Id: filename_match.cxx,v 1.5.2.4.2.1 2001/12/11 16:03:13 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: fl_font.cxx,v 1.9.2.5.2.1 2001/11/27 17:44:08 easysw Exp $"
// "$Id: fl_font.cxx,v 1.9.2.5.2.2 2001/12/11 16:03:13 easysw Exp $"
//
// Font selection code for the Fast Light Tool Kit (FLTK).
//
@ -38,6 +38,7 @@
# include "Fl_Font.H"
# include <ctype.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@ -172,14 +173,7 @@ static Fl_FontSize* find(int fnum, int size) {
// whoa! A scalable font! Use unless exact match found:
int l = c-thisname;
memcpy(namebuffer,thisname,l);
#if 1 // this works if you don't want stdio
if (size>=100) namebuffer[l++] = size/100+'0';
if (size>=10) namebuffer[l++] = (size/10)%10+'0';
namebuffer[l++] = (size%10)+'0';
#else
//for some reason, sprintf fails to return the right value under Solaris.
l += sprintf(namebuffer+l,"%d",size);
#endif
while (*c == '0') c++;
strcpy(namebuffer+l,c);
name = namebuffer;
@ -295,5 +289,5 @@ void fl_draw(const char* str, int x, int y) {
#endif
//
// End of "$Id: fl_font.cxx,v 1.9.2.5.2.1 2001/11/27 17:44:08 easysw Exp $".
// End of "$Id: fl_font.cxx,v 1.9.2.5.2.2 2001/12/11 16:03:13 easysw Exp $".
//