diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-13 18:18:33 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-13 18:18:33 +0000 |
| commit | 91aa5847ba00e27c3f7b94068960daff0c930110 (patch) | |
| tree | 64eb9bb525f154cb366a859238f525785fbfb3bb /src | |
| parent | 1f30c63d322778388a167f82df5d27a76e115ab5 (diff) | |
Bug fixes from Sebastien.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2309 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_BMP_Image.cxx | 20 | ||||
| -rw-r--r-- | src/Fl_File_Chooser2.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_File_Icon.cxx | 27 | ||||
| -rw-r--r-- | src/fl_file_dir.cxx | 8 |
4 files changed, 38 insertions, 23 deletions
diff --git a/src/Fl_BMP_Image.cxx b/src/Fl_BMP_Image.cxx index 16c392849..9df36f8c2 100644 --- a/src/Fl_BMP_Image.cxx +++ b/src/Fl_BMP_Image.cxx @@ -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); - w(read_long(fp)); - h(read_long(fp)); - read_word(fp); - depth = read_word(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 - 12; + count = info_size - 8; } else { // New BMP header... + w(read_long(fp)); + h(read_long(fp)); + read_word(fp); + depth = read_word(fp); 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 $". // diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 10e56c960..a94314fe5 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -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 $". // diff --git a/src/Fl_File_Icon.cxx b/src/Fl_File_Icon.cxx index 82e3d0626..274df2311 100644 --- a/src/Fl_File_Icon.cxx +++ b/src/Fl_File_Icon.cxx @@ -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,25 +190,36 @@ 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)) filetype = DIRECTORY; -#ifdef S_IFIFO +# ifdef S_IFIFO else if (S_ISFIFO(fileinfo.st_mode)) filetype = FIFO; -#endif // S_IFIFO -#if defined(S_ICHR) && defined(S_IBLK) +# endif // S_IFIFO +# if defined(S_ICHR) && defined(S_IBLK) else if (S_ISCHR(fileinfo.st_mode) || S_ISBLK(fileinfo.st_mode)) filetype = DEVICE; -#endif // S_ICHR && S_IBLK -#ifdef S_ILNK +# endif // S_ICHR && S_IBLK +# ifdef S_ILNK else if (S_ISLNK(fileinfo.st_mode)) filetype = LINK; -#endif // S_ILNK +# endif // S_ILNK 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 $". // diff --git a/src/fl_file_dir.cxx b/src/fl_file_dir.cxx index 97c60a9a1..4474f9ef2 100644 --- a/src/fl_file_dir.cxx +++ b/src/fl_file_dir.cxx @@ -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 $". // |
