Browse Source

Add Cygwin drive code.

Fix typos.

Update dependencies.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2081 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
pull/168/head
Michael R Sweet 23 years ago
parent
commit
b530634804
  1. 2
      CHANGES
  2. 48
      src/Fl_File_Browser.cxx
  3. 7
      src/Fl_arg.cxx
  4. 4
      src/makedepend

2
CHANGES

@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.0 CHANGES IN FLTK 1.1.0
- Fl_File_Browser::load() didn't properly show drives
when compiled in Cygwin mode.
- Now pass correctly pass keyboard and mouse events to - Now pass correctly pass keyboard and mouse events to
widget under tooltip as needed... widget under tooltip as needed...
- Added new Fl::dnd_text_ops() methods to enable/disable - Added new Fl::dnd_text_ops() methods to enable/disable

48
src/Fl_File_Browser.cxx

@ -1,5 +1,5 @@
// //
// "$Id: Fl_File_Browser.cxx,v 1.1.2.8 2002/03/29 14:16:03 easysw Exp $" // "$Id: Fl_File_Browser.cxx,v 1.1.2.9 2002/04/14 12:51:55 easysw Exp $"
// //
// Fl_File_Browser routines. // Fl_File_Browser routines.
// //
@ -44,10 +44,12 @@
#include <stdlib.h> #include <stdlib.h>
#include "flstring.h" #include "flstring.h"
#if defined(WIN32) && ! defined(__CYGWIN__) #ifdef __CYGWIN__
# include <mntent.h>
#elif defined(WIN32)
# include <windows.h> # include <windows.h>
# include <direct.h> # include <direct.h>
#endif /* WIN32 */ #endif /* __CYGWIN__ */
#if defined(__EMX__) #if defined(__EMX__)
# define INCL_DOS # define INCL_DOS
@ -409,9 +411,26 @@ Fl_File_Browser::load(const char *directory)// I - Directory to load
if ((icon = Fl_File_Icon::find("any", Fl_File_Icon::DEVICE)) == NULL) if ((icon = Fl_File_Icon::find("any", Fl_File_Icon::DEVICE)) == NULL)
icon = Fl_File_Icon::find("any", Fl_File_Icon::DIRECTORY); icon = Fl_File_Icon::find("any", Fl_File_Icon::DIRECTORY);
#if defined(WIN32) && ! defined (__CYGWIN__) #ifdef WIN32
DWORD drives; // Drive available bits # ifdef __CYGWIN__
//
// Cygwin provides an implementation of setmntent() to get the list
// of available drives...
//
FILE *m = setmntent("/-not-used-", "r");
struct mntent *p;
while ((p = getmntent (m)) != NULL) {
add(p->mnt_dir, icon);
num_files ++;
}
endmntent(m);
# else
//
// Normal WIN32 code uses drive bits...
//
DWORD drives; // Drive available bits
drives = GetLogicalDrives(); drives = GetLogicalDrives();
for (i = 'A'; i <= 'Z'; i ++, drives >>= 1) for (i = 'A'; i <= 'Z'; i ++, drives >>= 1)
@ -426,7 +445,11 @@ Fl_File_Browser::load(const char *directory)// I - Directory to load
num_files ++; num_files ++;
} }
# endif // __CYGWIN__
#elif defined(__EMX__) #elif defined(__EMX__)
//
// OS/2 code uses drive bits...
//
ULONG curdrive; // Current drive ULONG curdrive; // Current drive
ULONG drives; // Drive available bits ULONG drives; // Drive available bits
int start = 3; // 'C' (MRS - dunno if this is correct!) int start = 3; // 'C' (MRS - dunno if this is correct!)
@ -443,22 +466,23 @@ Fl_File_Browser::load(const char *directory)// I - Directory to load
num_files ++; num_files ++;
} }
#else #else
//
// UNIX code uses /etc/fstab or similar...
//
FILE *mtab; // /etc/mtab or /etc/mnttab file FILE *mtab; // /etc/mtab or /etc/mnttab file
char line[1024]; // Input line char line[1024]; // Input line
// //
// Open the file that contains a list of mounted filesystems... // Open the file that contains a list of mounted filesystems...
// //
# if defined(hpux) || defined(__sun)
mtab = fopen("/etc/mnttab", "r"); // Fairly standard mtab = fopen("/etc/mnttab", "r"); // Fairly standard
# elif defined(__sgi) || defined(linux) if (mtab == NULL)
mtab = fopen("/etc/mtab", "r"); // More standard mtab = fopen("/etc/mtab", "r"); // More standard
# else if (mtab == NULL)
mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list
if (mtab == NULL) if (mtab == NULL)
mtab = fopen("/etc/vfstab", "r"); mtab = fopen("/etc/vfstab", "r"); // Alternate full list file
# endif
if (mtab != NULL) if (mtab != NULL)
{ {
@ -559,5 +583,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string
// //
// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.8 2002/03/29 14:16:03 easysw Exp $". // End of "$Id: Fl_File_Browser.cxx,v 1.1.2.9 2002/04/14 12:51:55 easysw Exp $".
// //

7
src/Fl_arg.cxx

@ -1,5 +1,5 @@
// //
// "$Id: Fl_arg.cxx,v 1.5.2.8.2.10 2002/04/14 02:43:48 easysw Exp $" // "$Id: Fl_arg.cxx,v 1.5.2.8.2.11 2002/04/14 12:51:56 easysw Exp $"
// //
// Optional argument initialization code for the Fast Light Tool Kit (FLTK). // Optional argument initialization code for the Fast Light Tool Kit (FLTK).
// //
@ -29,6 +29,7 @@
#include <FL/Fl.H> #include <FL/Fl.H>
#include <FL/x.H> #include <FL/x.H>
#include <FL/Fl_Window.H> #include <FL/Fl_Window.H>
#include <FL/Fl_Tooltip.H>
#include <FL/filename.H> #include <FL/filename.H>
#include <FL/fl_draw.H> #include <FL/fl_draw.H>
#include <ctype.h> #include <ctype.h>
@ -263,7 +264,7 @@ static const char * const helpmsg =
" -nok[bd]\n" " -nok[bd]\n"
" -not[ooltips]\n" " -not[ooltips]\n"
" -s[cheme] scheme\n" " -s[cheme] scheme\n"
" -ti[tle] windowtitle\n"; " -ti[tle] windowtitle\n"
" -to[oltips]"; " -to[oltips]";
const char * const Fl::help = helpmsg+13; const char * const Fl::help = helpmsg+13;
@ -411,5 +412,5 @@ int XParseGeometry(const char* string, int* x, int* y,
#endif // ifdef WIN32 #endif // ifdef WIN32
// //
// End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.10 2002/04/14 02:43:48 easysw Exp $". // End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.11 2002/04/14 12:51:56 easysw Exp $".
// //

4
src/makedepend

@ -268,8 +268,8 @@ Fl_abort.o: ../config.h
Fl_add_idle.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H Fl_add_idle.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_arg.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/x.H Fl_arg.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/x.H
Fl_arg.o: ../FL/Fl_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H Fl_arg.o: ../FL/Fl_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
Fl_arg.o: ../FL/Fl_Widget.H ../FL/filename.H ../FL/fl_draw.H flstring.h Fl_arg.o: ../FL/Fl_Widget.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
Fl_arg.o: ../config.h Fl_arg.o: ../FL/filename.H ../FL/fl_draw.H flstring.h ../config.h
Fl_compose.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H Fl_compose.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_display.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H flstring.h Fl_display.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H flstring.h
Fl_display.o: ../config.h Fl_display.o: ../config.h

Loading…
Cancel
Save