Bug fixes from Sebastien.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2309 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2002-06-13 18:18:33 +00:00
parent 1f30c63d32
commit 91aa5847ba
6 changed files with 53 additions and 25 deletions

View File

@ -1,5 +1,14 @@
CHANGES IN FLTK 1.1.0
- The pixmap_browser demo didn't check for a NULL image
pointer.
- Fl_File_Icon::find() now uses fl_filename_isdir()
under WIN32 to check for directories.
- Fl_File_Chooser's preview code called refcount()
on the deleted image's object.
- Fixed another problem with the Fl_BMP_Image loader.
- The fl_file_chooser() callback was being called with a
NULL filename.
- Documented that fl_push_clip() is preferred over
fl_clip(), with a corresponding source change.
- Minor changes to the MacOS X event handling code.

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_BMP_Image.cxx,v 1.1.2.5 2002/06/10 17:21:49 easysw Exp $"
// "$Id: Fl_BMP_Image.cxx,v 1.1.2.6 2002/06/13 18:18:33 easysw Exp $"
//
// Fl_BMP_Image routines.
//
@ -94,19 +94,23 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
// Then the bitmap information...
info_size = read_dword(fp);
if (info_size < 40) {
// Old Windows/OS2 BMP header...
w(read_word(fp));
h(read_word(fp));
read_word(fp);
depth = read_word(fp);
compression = BI_RGB;
colors_used = 0;
count = info_size - 8;
} else {
// New BMP header...
w(read_long(fp));
h(read_long(fp));
read_word(fp);
depth = read_word(fp);
if (info_size < 40) {
// Old Windows/OS2 BMP header...
compression = BI_RGB;
colors_used = 0;
count = info_size - 12;
} else {
// New BMP header...
compression = read_dword(fp);
read_dword(fp);
read_long(fp);
@ -129,7 +133,7 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read
for (count = 0; count < colors_used; count ++) {
// Read BGR color...
fread(colormap, colors_used, 3, fp);
fread(colormap[count], colors_used, 3, fp);
// Skip pad byte for new BMP files...
if (info_size > 12) getc(fp);
@ -371,5 +375,5 @@ read_long(FILE *fp) { // I - File to read from
//
// End of "$Id: Fl_BMP_Image.cxx,v 1.1.2.5 2002/06/10 17:21:49 easysw Exp $".
// End of "$Id: Fl_BMP_Image.cxx,v 1.1.2.6 2002/06/13 18:18:33 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.15 2002/06/07 15:06:32 easysw Exp $"
// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.16 2002/06/13 18:18:33 easysw Exp $"
//
// More Fl_File_Chooser routines.
//
@ -864,7 +864,7 @@ Fl_File_Chooser::update_preview()
oldimage = (Fl_Shared_Image *)previewBox->image();
if (oldimage) while (oldimage->refcount()) oldimage->release();
if (oldimage) oldimage->release();
previewBox->image(0);
@ -1103,5 +1103,5 @@ unquote_pathname(char *dst, // O - Destination string
//
// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.15 2002/06/07 15:06:32 easysw Exp $".
// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.16 2002/06/13 18:18:33 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_File_Icon.cxx,v 1.1.2.12 2002/05/25 13:38:24 easysw Exp $"
// "$Id: Fl_File_Icon.cxx,v 1.1.2.13 2002/06/13 18:18:33 easysw Exp $"
//
// Fl_File_Icon routines.
//
@ -190,6 +190,13 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */
// Get file information if needed...
if (filetype == ANY)
{
#ifdef WIN32
if (fl_filename_isdir(filename))
filetype = DIRECTORY;
else
filetype = PLAIN;
#else
if (!stat(filename, &fileinfo))
{
if (S_ISDIR(fileinfo.st_mode))
@ -209,6 +216,10 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */
else
filetype = PLAIN;
}
else
filetype = PLAIN;
#endif // WIN32
}
// Look at the base name in the filename
name = fl_filename_name(filename);
@ -464,5 +475,5 @@ Fl_File_Icon::labeltype(const Fl_Label *o, // I - Label data
//
// End of "$Id: Fl_File_Icon.cxx,v 1.1.2.12 2002/05/25 13:38:24 easysw Exp $".
// End of "$Id: Fl_File_Icon.cxx,v 1.1.2.13 2002/06/13 18:18:33 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: fl_file_dir.cxx,v 1.1.2.12 2002/05/16 12:47:43 easysw Exp $"
// "$Id: fl_file_dir.cxx,v 1.1.2.13 2002/06/13 18:18:33 easysw Exp $"
//
// File chooser widget for the Fast Light Tool Kit (FLTK).
//
@ -33,8 +33,8 @@ static void (*current_callback)(const char*) = 0;
static void callback(Fl_File_Chooser *, void*) {
if (current_callback)
(*current_callback)(fc->value(0));
if (current_callback && fc->value())
(*current_callback)(fc->value());
}
@ -142,5 +142,5 @@ fl_dir_chooser(const char *message, // I - Message for titlebar
//
// End of "$Id: fl_file_dir.cxx,v 1.1.2.12 2002/05/16 12:47:43 easysw Exp $".
// End of "$Id: fl_file_dir.cxx,v 1.1.2.13 2002/06/13 18:18:33 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: pixmap_browser.cxx,v 1.5.2.4.2.5 2002/01/06 17:51:12 easysw Exp $"
// "$Id: pixmap_browser.cxx,v 1.5.2.4.2.6 2002/06/13 18:18:33 easysw Exp $"
//
// A shared image test program for the Fast Light Tool Kit (FLTK).
//
@ -44,6 +44,10 @@ void load_file(const char *n) {
if (img) img->release();
img = Fl_Shared_Image::get(n);
if (!img) {
fl_alert("Image file format not recognized!");
return;
}
if (img->w() > b->w() || img->h() > b->h()) {
Fl_Image *temp;
if (img->w() > img->h()) temp = img->copy(b->w(), b->h() * img->h() / img->w());
@ -94,5 +98,5 @@ int main(int argc, char **argv) {
}
//
// End of "$Id: pixmap_browser.cxx,v 1.5.2.4.2.5 2002/01/06 17:51:12 easysw Exp $".
// End of "$Id: pixmap_browser.cxx,v 1.5.2.4.2.6 2002/06/13 18:18:33 easysw Exp $".
//