diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2018-02-09 14:39:42 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2018-02-09 14:39:42 +0000 |
| commit | 52ae3582a2c7bb437df33c0a30bfd5a01d6c5282 (patch) | |
| tree | 4f532a97ab0a6a1c2f96454290bc8803ee022f1f | |
| parent | 30dad6a4aa2b94fe91783160c86abc75f9dc9e23 (diff) | |
Replace "WIN32" with "_WIN32" or "Windows".
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32".
Replace "WIN32" in text and documentation with "Windows".
Replace "MSWindows" with "Windows".
To do: README.Windows.txt (and maybe other documentation as well)
needs updates.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
107 files changed, 415 insertions, 433 deletions
diff --git a/CMake/setup.cmake b/CMake/setup.cmake index fd70d44d8..bed59722e 100644 --- a/CMake/setup.cmake +++ b/CMake/setup.cmake @@ -73,20 +73,6 @@ set(FLTK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc CACHE PATH # platform dependent information ####################################################################### -# I think this code is useless, so I disabled it by commenting it out. -# Let's wait and see if it does any harm (user complaints). -# The real fix is below: add_definitions(-DWIN32). -# AlbrechtS, Dec 28, 2017. -# fix no WIN32 defined issue -# if(NOT WIN32) -# if(_WIN32) -# set(WIN32 _WIN32) -# elseif(__WIN32__) -# set(WIN32 __WIN32__) -# endif(_WIN32) -# endif(NOT WIN32) -# End of code commented out on Dec 28, 2017 - # set where config files go if(WIN32 AND NOT CYGWIN) set(FLTK_CONFIG_PATH CMake) @@ -124,13 +110,13 @@ if(APPLE) endif(APPLE) if(WIN32) - add_definitions(-DWIN32) + # we do no longer define WIN32 or _WIN32 (since FLTK 1.4.0) + # ... but if we did, we'd define _WIN32 (since FLTK 1.4.0) + # add_definitions(-D_WIN32) if(MSVC) add_definitions(-DWIN32_LEAN_AND_MEAN) add_definitions(-D_CRT_SECURE_NO_WARNINGS) -######## from ide/VisualC2010/config.h set(BORDER_WIDTH 2) -######## endif(MSVC) if(CMAKE_C_COMPILER_ID STREQUAL GNU) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-subsystem,windows") @@ -146,27 +146,27 @@ public: // run time information about compile time configuration /** @{ */ static bool cfg_gfx_xlib; ///< X11 Xlib rendering available, usually on Linux systems static bool cfg_gfx_quartz; ///< Quartz rendering available, usually on OS X systems - static bool cfg_gfx_gdi; ///< GDI rendering available, usually on MSWindows systems + static bool cfg_gfx_gdi; ///< GDI rendering available, usually on Windows systems static bool cfg_gfx_opengl; ///< OpenGL rendering available, available on many platforms static bool cfg_gfx_cairo; ///< Cairo rendering available, available on many platforms - static bool cfg_gfx_directx;///< DirectX rendering available, usually on MSWindows systems + static bool cfg_gfx_directx;///< DirectX rendering available, usually on Windows systems /** @} */ /** \defgroup cfg_prn runtime printer driver configuration */ /** @{ */ static bool cfg_prn_ps; ///< PostScript rendering available, usually on Linux systems static bool cfg_prn_quartz; ///< Quartz rendering available, usually on OS X systems - static bool cfg_prn_gdi; ///< GDI rendering available, usually on MSWindows systems + static bool cfg_prn_gdi; ///< GDI rendering available, usually on Windows systems /** @} */ /** \defgroup cfg_win runtime window and event manager configuration */ /** @{ */ static bool cfg_win_x11; ///< X11 window management available, usually on Linux systems static bool cfg_win_cocoa; ///< Cocoa window management available, usually on OS X systems - static bool cfg_win_win32; ///< WIN32 window management available, on low level MSWindows + static bool cfg_win_win32; ///< Windows window management available, on low level Windows /** @} */ /** \defgroup cfg_sys runtime system configuration */ /** @{ */ static bool cfg_sys_posix; ///< Posix system available, usually on Linux and OS X systems, but also Cygwin - static bool cfg_sys_win32; ///< WIN32 system available, on MSWindows + static bool cfg_sys_win32; ///< Windows system available, on Windows /** @} */ public: // should be private! @@ -195,7 +195,7 @@ public: // should be private! static Fl_Widget* selection_owner_; static Fl_Window* modal_; static Fl_Window* grab_; - static int compose_state; // used for dead keys (WIN32) or marked text (MacOS) + static int compose_state; // used for dead keys (Windows) or marked text (MacOS) static void call_screen_init(); // recompute screen number and dimensions static void reset_marked_text(); // resets marked text static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point @@ -507,7 +507,7 @@ int main() { Under UNIX <I>any</I> file descriptor can be monitored (files, devices, pipes, sockets, etc.). Due to limitations in Microsoft Windows, - WIN32 applications can only monitor sockets. + Windows applications can only monitor sockets. */ static void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0); // platform dependent /** See void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0) */ @@ -609,7 +609,7 @@ int main() { focus is (including in other programs). The window <I>does not have to be shown()</I> , this lets the handle() method of a "dummy" window override all event handling and allows you to - map and unmap a complex set of windows (under both X and WIN32 + map and unmap a complex set of windows (under both X and Windows <I>some</I> window must be mapped because the system interface needs a window id). @@ -813,7 +813,7 @@ int main() { On X Fl::get_key(FL_Button+n) does not work. - On WIN32 Fl::get_key(FL_KP_Enter) and Fl::event_key(FL_KP_Enter) do not work. + On Windows Fl::get_key(FL_KP_Enter) and Fl::event_key(FL_KP_Enter) do not work. */ static int event_key(int key); /** @@ -939,7 +939,7 @@ int main() { \par Platform details for image data: \li Unix/Linux platform: Clipboard images in PNG or BMP formats are recognized. Requires linking with the fltk_images library. - \li MSWindows platform: Both bitmap and vectorial (Enhanced metafile) data from clipboard + \li Windows platform: Both bitmap and vectorial (Enhanced metafile) data from clipboard can be pasted as image data. \li Mac OS X platform: Both bitmap (TIFF) and vectorial (PDF) data from clipboard can be pasted as image data. @@ -1090,7 +1090,7 @@ int main() { "-*" will select all fonts with any encoding as long as they have normal X font names with dashes in them. Passing "*" will list every font that exists (on X this may produce some strange output). Other - values may be useful but are system dependent. With WIN32 NULL + values may be useful but are system dependent. With Windows NULL selects fonts with ISO8859-1 encoding and non-NULL selects all fonts. diff --git a/FL/Fl_Copy_Surface.H b/FL/Fl_Copy_Surface.H index 7c2c60b04..0d7a4f17c 100644 --- a/FL/Fl_Copy_Surface.H +++ b/FL/Fl_Copy_Surface.H @@ -39,7 +39,7 @@ Fl_Display_Device::display_device()->set_current(); // direct graphics requests back to the display \endcode Platform details: - \li MSWindows: Transparent RGB images copy without transparency. + \li Windows: Transparent RGB images copy without transparency. The graphical data are copied to the clipboard as an 'enhanced metafile'. \li Mac OS: The graphical data are copied to the clipboard (a.k.a. pasteboard) in two 'flavors': 1) in vectorial form as PDF data; 2) in bitmap form as a TIFF image. diff --git a/FL/Fl_Export.H b/FL/Fl_Export.H index c239910eb..1b51c2584 100644 --- a/FL/Fl_Export.H +++ b/FL/Fl_Export.H @@ -1,9 +1,9 @@ /* * "$Id$" * - * WIN32 DLL export . + * Windows DLL export . * - * Copyright 1998-2010 by Bill Spitzak and others. + * Copyright 1998-2018 by Bill Spitzak and others. * * This library is free software. Distribution and use rights are outlined in * the file "COPYING" which should have been included with this file. If this @@ -20,7 +20,7 @@ # define Fl_Export_H /* - * The following is only used when building DLLs under WIN32... + * The following is only used when building DLLs under Windows... */ # if defined(FL_DLL) diff --git a/FL/Fl_Gl_Window.H b/FL/Fl_Gl_Window.H index 135a343fa..0c483e59e 100644 --- a/FL/Fl_Gl_Window.H +++ b/FL/Fl_Gl_Window.H @@ -166,7 +166,7 @@ public: mode() must not be called within draw() since it changes the current context. - \note On the <b>MSWindows and Unix/Linux platforms</b>, FLTK produces + \note On the <b>Windows and Unix/Linux platforms</b>, FLTK produces contexts for the highest OpenGL version supported by the hardware. Such contexts are also compatible with lower OpenGL versions. On the <b>Apple OS X platform</b>, it is necessary to decide whether the source code targets @@ -186,7 +186,7 @@ public: the <tt>glXChooseVisual()</tt> function (e.g., <tt>GLX_DOUBLEBUFFER</tt>, defined by including <GL/glx.h>). \note What attributes are adequate here is subject to change. The preferred, stable public API is Fl_Gl_Window::mode(int a). - <p><b>MSWindows platform</b>: this member function is of no use. + <p><b>Windows platform</b>: this member function is of no use. <p><b>Mac OS X platform</b>: attributes belong to the <tt>CGLPixelFormatAttribute</tt> enumeration (defined by including <tt><OpenGL/OpenGL.h></tt>, e.g., <tt>kCGLPFADoubleBuffer</tt>) and may be followed by adequate attribute values. diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H index 27778da2f..7445eeae3 100644 --- a/FL/Fl_Graphics_Driver.H +++ b/FL/Fl_Graphics_Driver.H @@ -1,7 +1,7 @@ // // "$Id$" // -// Definition of classes Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device +// Definition of classes Fl_Graphics_Driver, Fl_Surface_Device, Fl_Display_Device // for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2018 by Bill Spitzak and others. @@ -444,7 +444,7 @@ struct Fl_Fontdesc { - scale and unscale the clipping region. This class is presently used on the X11 platform to support HiDPI displays. - In the future, it may also be used on the WIN32 platform. + In the future, it may also be used on the Windows platform. */ class FL_EXPORT Fl_Scalable_Graphics_Driver : public Fl_Graphics_Driver { public: diff --git a/FL/Fl_Input.H b/FL/Fl_Input.H index 4c5ff17d4..dc04ae020 100644 --- a/FL/Fl_Input.H +++ b/FL/Fl_Input.H @@ -31,7 +31,7 @@ characters, and will correctly display any UTF text, using ^X notation for unprintable control characters. It assumes the font can draw any characters of the used scripts, which is true - for standard fonts under MSWindows and Mac OS X. + for standard fonts under Windows and Mac OS X. Characters can be input using the keyboard or the character palette/map. Character composition is done using dead keys and/or a compose key as defined by the operating system. diff --git a/FL/Fl_Native_File_Chooser.H b/FL/Fl_Native_File_Chooser.H index 4a9221573..ec88a925f 100644 --- a/FL/Fl_Native_File_Chooser.H +++ b/FL/Fl_Native_File_Chooser.H @@ -21,21 +21,21 @@ Fl_Native_File_Chooser widget. */ /* Implementation note: - + class Fl_Native_File_Chooser <== public API used by applications - + class Fl_Native_File_Chooser_Driver <== virtual API that a platform may implement this API has a do-nothing default implementation - + class Fl_Native_File_Chooser_FLTK_Driver <== this API implementation is the default FLTK file chooser class Fl_GTK_Native_File_Chooser_Driver <== this API implementation runs a GTK file chooser it is determined at run-time if the GTK dynamic libraries are available - + class Fl_Quartz_Native_File_Chooser_Driver <== this API implementation runs a Mac OS X file chooser - class Fl_WinAPI_Native_File_Chooser_Driver <== this API implementation runs a MSWindows file chooser - - + class Fl_WinAPI_Native_File_Chooser_Driver <== this API implementation runs a Windows file chooser + + Each platform must implement the constructor of the Fl_Native_File_Chooser class. This particular implementation: @@ -97,8 +97,8 @@ class Fl_Native_File_Chooser_Driver; The Fl_Native_File_Chooser widget transmits UTF-8 encoded filenames to its user. It is recommended to open files that may have non-ASCII names with the fl_fopen() or - fl_open() utility functions that handle these names in a cross-platform way - (whereas the standard fopen()/open() functions fail on the MSWindows platform + fl_open() utility functions that handle these names in a cross-platform way + (whereas the standard fopen()/open() functions fail on the Windows platform to open files with a non-ASCII name). <B>Platform Specific Caveats</B> diff --git a/FL/Fl_Preferences.H b/FL/Fl_Preferences.H index 70b6d705a..db0708967 100644 --- a/FL/Fl_Preferences.H +++ b/FL/Fl_Preferences.H @@ -1,7 +1,7 @@ // // "$Id$" // -// Preferences . +// Preferences implementation for the Fast Light Tool Kit (FLTK). // // Copyright 2002-2010 by Matthias Melcher. // @@ -30,7 +30,7 @@ settings between application starts. It is similar to the - Registry on WIN32 and Preferences on MacOS, and provides a + Registry on Windows and Preferences on MacOS, and provides a simple configuration mechanism for UNIX. Fl_Preferences uses a hierarchy to store data. It diff --git a/FL/Fl_Printer.H b/FL/Fl_Printer.H index 32cbe0d88..148897f2e 100644 --- a/FL/Fl_Printer.H +++ b/FL/Fl_Printer.H @@ -78,7 +78,7 @@ before creation of the Fl_Printer object. Use Fl_PostScript_File_Device::file_chooser_title to customize the title of the file chooser dialog that opens when using the "Print To File" option of the print dialog. - <li>MSWindows platform: Transparent Fl_RGB_Image 's don't print with exact transparency on most printers + <li>Windows platform: Transparent Fl_RGB_Image 's don't print with exact transparency on most printers (a workaround is to use print_window_part() ). Fl_RGB_Image 's don't rotate() well. <li>Mac OS X platform: all graphics requests print as on display and accept rotation and scaling. diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H index 9d9492606..3ad0d4081 100644 --- a/FL/Fl_Window.H +++ b/FL/Fl_Window.H @@ -348,7 +348,7 @@ public: void icon(const Fl_RGB_Image*); void icons(const Fl_RGB_Image*[], int); -#if defined(WIN32) && !defined(FL_DOXYGEN) +#if defined(_WIN32) && !defined(FL_DOXYGEN) typedef struct HICON__* HICON; // These 2 member functions break the driver model but are kept for back compatibility. // They are implemented in Fl_win32.cxx diff --git a/FL/filename.H b/FL/filename.H index 949bacc11..a82d1ec6a 100644 --- a/FL/filename.H +++ b/FL/filename.H @@ -3,7 +3,7 @@ * * Filename header file for the Fast Light Tool Kit (FLTK). * - * Copyright 1998-2010 by Bill Spitzak and others. + * Copyright 1998-2018 by Bill Spitzak and others. * * This library is free software. Distribution and use rights are outlined in * the file "COPYING" which should have been included with this file. If this @@ -56,7 +56,7 @@ FL_EXPORT int fl_filename_isdir(const char *name); # if defined(__cplusplus) && !defined(FL_DOXYGEN) /* - * Under WIN32, we include filename.H from numericsort.c; this should probably change... + * Under Windows, we include filename.H from numericsort.c; this should probably change... */ inline char *fl_filename_setext(char *to, const char *ext) { return fl_filename_setext(to, FL_PATH_MAX, ext); } diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 56500f661..46a60fb14 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -3,7 +3,7 @@ // // Portable drawing function header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2017 by Bill Spitzak and others. +// Copyright 1998-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -286,7 +286,7 @@ inline void fl_yxline(int x, int y, int y1, int x2, int y3) {fl_graphics_driver- Draw ellipse sections using integer coordinates. These functions match the rather limited circle drawing code provided by X - and WIN32. The advantage over using fl_arc with floating point coordinates + and Windows. The advantage over using fl_arc with floating point coordinates is that they are faster because they often use the hardware, and they draw much nicer small circles, since the small sizes are often hard-coded bitmaps. diff --git a/FL/fl_utf8.h b/FL/fl_utf8.h index f855f977f..5f759418a 100644 --- a/FL/fl_utf8.h +++ b/FL/fl_utf8.h @@ -3,7 +3,7 @@ * * Author: Jean-Marc Lienher ( http://oksid.ch ) * Copyright 2000-2010 by O'ksi'D. - * Copyright 2016-2017 by Bill Spitzak and others. + * Copyright 2016-2018 by Bill Spitzak and others. * * This library is free software. Distribution and use rights are outlined in * the file "COPYING" which should have been included with this file. If this @@ -121,14 +121,14 @@ FL_EXPORT char* fl_utf2mbcs(const char *src); FL_EXPORT unsigned fl_utf8from_mb(char *dst, unsigned dstlen, const char *src, unsigned srclen); /*****************************************************************************/ -#ifdef WIN32 -/* these two WIN32-only functions are kept for API compatibility */ +#ifdef _WIN32 +/* these two Windows-only functions are kept for API compatibility */ /* OD: Attempt to convert the UTF-8 string to the current locale */ FL_EXPORT char *fl_utf8_to_locale(const char *s, int len, unsigned int codepage); /* OD: Attempt to convert a string in the current locale to UTF-8 */ FL_EXPORT char *fl_locale_to_utf8(const char *s, int len, unsigned int codepage); -#endif /* WIN32 */ +#endif /* _WIN32 */ /***************************************************************************** * The following functions are intended to provide portable, UTF-8 aware @@ -44,7 +44,7 @@ # define FL_gl_H # include "Enumerations.H" // for color names -# ifdef WIN32 +# ifdef _WIN32 # include <windows.h> # endif # ifndef APIENTRY @@ -27,7 +27,7 @@ # define FL_glu_H # include "Enumerations.H" // for color names -# ifdef WIN32 +# ifdef _WIN32 # include <windows.h> # endif # ifndef APIENTRY @@ -42,12 +42,12 @@ # define M_SQRT1_2 0.70710678118654752440 # endif // !M_SQRT2 -# if (defined(WIN32) || defined(CRAY)) && !defined(__MINGW32__) && !defined(__MWERKS__) +# if (defined(_WIN32) || defined(CRAY)) && !defined(__MINGW32__) && !defined(__MWERKS__) inline double rint(double v) {return floor(v+.5);} inline double copysign(double a, double b) {return b<0 ? -a : a;} -# endif // (WIN32 || CRAY) && !__MINGW32__ && !__MWERKS__ +# endif // (_WIN32 || CRAY) && !__MINGW32__ && !__MWERKS__ #endif // !fl_math_h diff --git a/FL/platform.H b/FL/platform.H index 7b54856db..7bb8807ad 100644 --- a/FL/platform.H +++ b/FL/platform.H @@ -35,7 +35,7 @@ # include <FL/fl_types.h> // for uchar class Fl_Window; -# ifdef WIN32 +# ifdef _WIN32 # include "win32.H" # elif defined(__APPLE__) # include "mac.H" diff --git a/FL/platform_types.h b/FL/platform_types.h index ce2e6718f..6eec3cd79 100644 --- a/FL/platform_types.h +++ b/FL/platform_types.h @@ -70,7 +70,7 @@ typedef int FL_SOCKET; # define FL_COMMAND FL_META # define FL_CONTROL FL_CTRL -#elif defined(WIN32) +#elif defined(_WIN32) typedef struct HBITMAP__ *HBITMAP; typedef HBITMAP Fl_Offscreen; typedef HBITMAP Fl_Bitmask; @@ -116,8 +116,8 @@ typedef struct __GLXcontextRec *GLContext; #ifndef __APPLE__ -# define FL_COMMAND FL_CTRL /**< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X */ -# define FL_CONTROL FL_META /**< An alias for FL_META on WIN32 and X11, or FL_CTRL on MacOS X */ +# define FL_COMMAND FL_CTRL /**< An alias for FL_CTRL on Windows and X11, or FL_META on MacOS X */ +# define FL_CONTROL FL_META /**< An alias for FL_META on Windows and X11, or FL_CTRL on MacOS X */ #endif #endif /* FL_PLATFORM_TYPES_H */ diff --git a/FL/win32.H b/FL/win32.H index 0d8253d40..0b77e1674 100644 --- a/FL/win32.H +++ b/FL/win32.H @@ -1,7 +1,7 @@ // // "$Id$" // -// WIN32 header file for the Fast Light Tool Kit (FLTK). +// Windows system header file for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. // @@ -17,7 +17,7 @@ // // Do not directly include this file, instead use <FL/platform.H>. It will -// include this file if WIN32 is defined. This is to encourage +// include this file if _WIN32 is defined. This is to encourage // portability of even the system-specific code... #ifndef FL_DOXYGEN @@ -54,7 +54,7 @@ BUILDING AND INSTALLING FLTK UNDER UNIX AND Mac OS X You can run configure yourself to get the exact setup you need. Type "./configure <options>". Options include: - --enable-cygwin - Enable the Cygwin libraries (WIN32) + --enable-cygwin - Enable the Cygwin libraries (Windows) --enable-debug - Enable debugging code & symbols --disable-gl - Disable OpenGL support --enable-shared - Enable generation of shared libraries diff --git a/README.Unix.txt b/README.Unix.txt index 0cb15f61d..9450a57d3 100644 --- a/README.Unix.txt +++ b/README.Unix.txt @@ -376,7 +376,7 @@ recommend that you add it to the command search path. =========================================== Code::Blocks is a free and popular C++ IDE in the Linux world. It also runs on -OS X and MSWindows. Configured correctly, it can also cross-compile between +OS X and Windows. Configured correctly, it can also cross-compile between these platforms. This chapter focuses on creating a new FLTK project for Linux, assuming that FLTK 1.3 was previously built and installed in its default location from the command line. diff --git a/README.MSWindows.txt b/README.Windows.txt index 9e67c09bd..04faa338f 100644 --- a/README.MSWindows.txt +++ b/README.Windows.txt @@ -429,9 +429,7 @@ file to it. The FLTK "hello" source code is a good base. Now open the Project Properties dialog and add "Comctl32.lib" and all the FLTK libraries that you want to use (at least "fltk.lib") to Additional Dependencies -(Configuration Properties > Linker > Additional Dependencies). In the same -dialog, add "WIN32" to the C++ Preprocessor Definitions (Configuration -Properties > C/C++ > Preprocessor > Preprocessor Definitions). +(Configuration Properties > Linker > Additional Dependencies). Compile and run your test program with F5. @@ -529,9 +527,7 @@ file to it. The FLTK "hello" source code is a good base. Now open the Project Properties dialog and add "Comctl32.lib" and all the FLTK libraries that you want to use (at least "fltk.lib") to Additional Dependencies -(Configuration Properties > Linker > Additional Dependencies). In the same -dialog, add "WIN32" to the C++ Preprocessor Definitions (Configuration -Properties > C/C++ > Preprocessor > Preprocessor Definitions). +(Configuration Properties > Linker > Additional Dependencies). Compile and run your test program with F5. diff --git a/cairo/Fl_Cairo.cxx b/cairo/Fl_Cairo.cxx index 803c4628c..7ddc87fa2 100644 --- a/cairo/Fl_Cairo.cxx +++ b/cairo/Fl_Cairo.cxx @@ -28,7 +28,7 @@ #if defined(USE_X11) // X11 # include <cairo-xlib.h> -#elif defined(WIN32) +#elif defined(_WIN32) # include <cairo-win32.h> #elif defined(__APPLE_QUARTZ__) // PORTME: Cairo Support # include <cairo-quartz.h> @@ -95,14 +95,14 @@ cairo_t * Fl::cairo_make_current(Fl_Window* wi) { /* Creates transparently a cairo_surface_t object. - gc is an HDC context in WIN32, a CGContext* in Quartz, and + gc is an HDC context in Windows, a CGContext* in Quartz, and a display on X11 (not used on this platform) */ static cairo_surface_t * cairo_create_surface(void * gc, int W, int H) { # if defined(USE_X11) return cairo_xlib_surface_create(fl_display, fl_window, fl_visual->visual, W, H); -# elif defined(WIN32) +# elif defined(_WIN32) return cairo_win32_surface_create((HDC) gc); # elif defined(__APPLE_QUARTZ__) return cairo_quartz_surface_create_for_cg_context((CGContext*) gc, W, H); @@ -131,8 +131,8 @@ cairo_t * Fl::cairo_make_current(void *gc) { W = CGBitmapContextGetWidth(fl_gc); H = CGBitmapContextGetHeight(fl_gc); } -#elif defined(WIN32) - // we don't need any W,H for WIN32 +#elif defined(_WIN32) + // we don't need any W,H for Windows #else # error Cairo is not supported on this platform. #endif diff --git a/configure.ac b/configure.ac index 5cfa35b08..478a4e403 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ dnl "$Id$" dnl dnl Configuration script for the Fast Light Tool Kit (FLTK). dnl -dnl Copyright 1998-2016 by Bill Spitzak and others. +dnl Copyright 1998-2018 by Bill Spitzak and others. dnl dnl This library is free software. Distribution and use rights are outlined in dnl the file "COPYING" which should have been included with this file. If this @@ -860,8 +860,11 @@ case $host_os_gui in # checks don't work because the shell puts out \r\n instead of # \n. Here we just force U32 to be defined to "unsigned"... AC_DEFINE(U32,unsigned) - CFLAGS="-mwindows -DWIN32 -DUSE_OPENGL32 $CFLAGS" - CXXFLAGS="-mwindows -DWIN32 -DUSE_OPENGL32 $CXXFLAGS" + # We do no longer define WIN32 or _WIN32 (since FLTK 1.4.0) + # CFLAGS="-mwindows -D_WIN32 -DUSE_OPENGL32 $CFLAGS" + # CXXFLAGS="-mwindows -D_WIN32 -DUSE_OPENGL32 $CXXFLAGS" + CFLAGS="-mwindows -DUSE_OPENGL32 $CFLAGS" + CXXFLAGS="-mwindows -DUSE_OPENGL32 $CXXFLAGS" LDFLAGS="-mwindows $LDFLAGS" DSOFLAGS="-mwindows $DSOFLAGS" LIBS="$LIBS -lole32 -luuid -lcomctl32" @@ -1511,7 +1514,7 @@ case $host_os in mingw*) # Determine the path where MSys has /usr installed msyspath=`mount | grep '\/usr ' | cut -d ' ' -f -1 | sed -e 's/\\\/\// g'` - # Then substitute that in the WIN32 path instead of /usr + # Then substitute that in the Windows path instead of /usr AC_DEFINE_UNQUOTED(FLTK_DOCDIR, "$msyspath/local/share/doc/fltk") ;; *) diff --git a/documentation/src/basics.dox b/documentation/src/basics.dox index 0a539a956..97cdb53ea 100644 --- a/documentation/src/basics.dox +++ b/documentation/src/basics.dox @@ -333,9 +333,12 @@ find the FLTK header files. This can be done by selecting "Preprocessor" settings under the "C/C++" tab. You will also need to add the FLTK (<tt>FLTK.LIB</tt> or <tt>FLTKD.LIB</tt>) and the Windows Common Controls (<tt>COMCTL32.LIB</tt>) libraries to the "Link" settings. -You must also define <tt>WIN32</tt>. -More information can be found in <tt>README.MSWindows.txt</tt>. +You must also define <tt>_WIN32</tt> if the compiler doesn't do this. +Currently all known Windows compilers define _WIN32 - unless you use Cygwin. +You must not define _WIN32 if you use Cygwin. + +More information can be found in <tt>README.Windows.txt</tt>. You can build your Microsoft Windows applications as Console or Desktop applications. If you want to use the standard C \p main() diff --git a/documentation/src/editor.dox b/documentation/src/editor.dox index 903827348..24e13ceb0 100644 --- a/documentation/src/editor.dox +++ b/documentation/src/editor.dox @@ -543,7 +543,7 @@ void set_title(Fl_Window* w) { else { char *slash; slash = strrchr(filename, '/'); -#ifdef WIN32 +#ifdef _WIN32 if (slash == NULL) slash = strrchr(filename, '\\'); #endif if (slash != NULL) strcpy(title, slash + 1); diff --git a/documentation/src/enumerations.dox b/documentation/src/enumerations.dox index 75915650d..8f040448c 100644 --- a/documentation/src/enumerations.dox +++ b/documentation/src/enumerations.dox @@ -154,7 +154,7 @@ value: - FL_ALT - One of the alt keys is down. - FL_NUM_LOCK - The num lock is on. - FL_META - One of the meta/Windows keys is down. - - FL_COMMAND - An alias for FL_CTRL on WIN32 and X11, + - FL_COMMAND - An alias for FL_CTRL on Windows and X11, or FL_META on MacOS X. - FL_SCROLL_LOCK - The scroll lock is on. - FL_BUTTON1 - Mouse button 1 is pushed. @@ -289,7 +289,7 @@ cursors. - FL_CURSOR_CROSS - crosshair - FL_CURSOR_WAIT - watch or hourglass - FL_CURSOR_INSERT - I-beam - - FL_CURSOR_HAND - hand (uparrow on MSWindows) + - FL_CURSOR_HAND - hand (uparrow on Windows) - FL_CURSOR_HELP - question mark - FL_CURSOR_MOVE - 4-pointed arrow - FL_CURSOR_NS - up/down arrow diff --git a/documentation/src/fluid.dox b/documentation/src/fluid.dox index cc24a5d17..d58201d69 100644 --- a/documentation/src/fluid.dox +++ b/documentation/src/fluid.dox @@ -109,9 +109,9 @@ immediately, losing any changes. \section fluid_fluid_under_windows Running FLUID Under Microsoft Windows -To run FLUID under WIN32, double-click on the \e FLUID.exe +To run FLUID under Windows, double-click on the \e FLUID.exe file. You can also run FLUID from the Command Prompt window. -FLUID always runs in the background under WIN32. +FLUID always runs in the background under Windows. \section fluid_compiling_fl_files Compiling .fl files @@ -1407,7 +1407,7 @@ and the KDE icon editor. \par FLUID reads Windows BMP image files which are often used in -WIN32 applications for icons. FLUID converts BMP files into +Windows applications for icons. FLUID converts BMP files into (modified) XPM format and uses a Fl_BMP_Image image to label the widget. Transparency is handled the same as for XPM files. All image data is uncompressed when written to the source file, so diff --git a/documentation/src/intro.dox b/documentation/src/intro.dox index dc5d62fe6..cfb7d1c10 100644 --- a/documentation/src/intro.dox +++ b/documentation/src/intro.dox @@ -94,10 +94,10 @@ Here are some of the core features unique to FLTK: \li The FLUID program (which includes every widget) is 538k. -\li Written directly atop core libraries (Xlib, WIN32 or Cocoa) for +\li Written directly atop core libraries (Xlib, Windows or Cocoa) for maximum speed, and carefully optimized for code size and performance. -\li Precise low-level compatibility between the X11, WIN32 and MacOS +\li Precise low-level compatibility between the X11, Windows and MacOS versions - only about 10% of the code is different. \li Interactive user interface builder program. Output is human-readable @@ -105,12 +105,12 @@ Here are some of the core features unique to FLTK: \li Support for overlay hardware, with emulation if none is available. -\li Very small & fast portable 2-D drawing library to hide Xlib, WIN32, +\li Very small & fast portable 2-D drawing library to hide Xlib, Windows, or QuickDraw. \li OpenGL/Mesa drawing area widget. -\li Support for OpenGL overlay hardware on both X11 and WIN32, with +\li Support for OpenGL overlay hardware on both X11 and Windows, with emulation if none is available. \li Text widgets with cut & paste, undo, and support @@ -191,7 +191,7 @@ You can run configure yourself to get the exact setup you need. Type "./configure <options>", where options are: \par --enable-cygwin -Enable the Cygwin libraries under WIN32 +Enable the Cygwin libraries under Windows \par --enable-debug Enable debugging code & symbols @@ -247,7 +247,7 @@ files to "includedir", and the library files to "libdir". NOTE: This documentation section is currently under review. More up-to-date information for this release may be available -in the file "README.MSWindows.txt" and you should read +in the file "README.Windows.txt" and you should read that file to determine if there are changes that may be applicable to your build environment. diff --git a/documentation/src/opengl.dox b/documentation/src/opengl.dox index 6863701b4..08ab000ee 100644 --- a/documentation/src/opengl.dox +++ b/documentation/src/opengl.dox @@ -23,7 +23,7 @@ functions around your OpenGL code. You must include FLTK's \p <FL/gl.h> header file. It will include the file \p <GL/gl.h> (on macOS: \p <OpenGL/gl.h>), define some extra drawing functions provided by FLTK, and include the -\p <windows.h> header file needed by WIN32 applications. +\p <windows.h> header file needed by Windows applications. Some simple coding rules (see \ref osissues_retina) allow to write cross-platform code that will draw high resolution @@ -206,7 +206,7 @@ context with an orthographic projection so that 0,0 is the lower-left corner of the window and each pixel is one unit. The current clipping is reproduced with OpenGL \p glScissor() commands. These functions also synchronize the OpenGL graphics stream -with the drawing done by other X, WIN32, or FLTK functions. +with the drawing done by other X, Windows, or FLTK functions. \code gl_start(); @@ -397,7 +397,7 @@ void OptimizerWindow::draw() { // This is the first time we've been asked to draw; create the // Optimizer context for the scene... -#ifdef WIN32 +#ifdef _WIN32 context_ = new csContext((HDC)fl_getHDC()); context_->ref(); context_->makeCurrent((HDC)fl_getHDC()); @@ -405,7 +405,7 @@ void OptimizerWindow::draw() { context_ = new csContext(fl_display, fl_visual); context_->ref(); context_->makeCurrent(fl_display, fl_window); -#endif // WIN32 +#endif // _WIN32 ... perform other context setup as desired ... @@ -417,11 +417,11 @@ void OptimizerWindow::draw() { camera_->draw(draw_action_); } } else { -#ifdef WIN32 +#ifdef _WIN32 context_->makeCurrent((HDC)fl_getHDC()); #else context_->makeCurrent(fl_display, fl_window); -#endif // WIN32 +#endif // _WIN32 } if (!valid()) { @@ -456,7 +456,7 @@ showing how to use OpenGL 3.0 (or higher versions) with FLTK in a cross-platform It contains also OpenGL3-glut-test.cxx which shows how to use FLTK's GLUT compatibility and OpenGL 3. -<b>On the MSWindows and Unix/Linux platforms</b>, FLTK creates contexts +<b>On the Windows and Unix/Linux platforms</b>, FLTK creates contexts implementing the highest OpenGL version supported by the hardware, which are also compatible with lower OpenGL versions. Thus, FLTK allows source code targeting any version of OpenGL. Access to functions from OpenGL @@ -467,10 +467,10 @@ FLTK creates by default contexts implementing OpenGL versions 1 or 2. To access OpenGL 3.0 (or higher versions), use the <tt>FL_OPENGL3</tt> flag (see below). Mac OS 10.7 or above is required; GLEW is possible but not necessary. -\par GLEW installation (Unix/Linux and MSWindows platforms) +\par GLEW installation (Unix/Linux and Windows platforms) GLEW is available as a package for most Linux distributions and in source form at http://glew.sourceforge.net/. -For the MSWindows platform, a Visual Studio static library (glew32.lib) can +For the Windows platform, a Visual Studio static library (glew32.lib) can be downloaded from the same web site; a MinGW-style static library (libglew32.a) can be built from source with the make command. @@ -481,7 +481,7 @@ and before \#include <FL/glut.h> if you use GLUT): #if defined(__APPLE__) # include <OpenGL/gl3.h> // defines OpenGL 3.0+ functions #else -# if defined(WIN32) +# if defined(_WIN32) # define GLEW_STATIC 1 # endif # include <GL/glew.h> diff --git a/documentation/src/osissues.dox b/documentation/src/osissues.dox index 82472c274..f2383445e 100644 --- a/documentation/src/osissues.dox +++ b/documentation/src/osissues.dox @@ -198,7 +198,7 @@ Set which X display to use. This actually does <tt>putenv("DISPLAY=...")</tt> so that child programs will display on the same screen if called with \c exec(). This must be done before the display is opened. This call is -provided under MacOS and WIN32 but it has no effect. +provided under MacOS and Windows but it has no effect. extern Display *fl_display @@ -474,9 +474,9 @@ the class "fltk" is used (e.g. <tt>fltk.background</tt>). If no match is found, a global search is done (e.g. <tt>*background</tt>). -\section osissues_win32 The Windows (WIN32) Interface +\section osissues_win32 The Windows Interface -The Windows interface provides access to the WIN32 GDI +The Windows interface provides access to the Windows GDI state information and data structures. \subsection non_ascii_filenames Using filenames with non-ASCII characters @@ -494,15 +494,15 @@ requests with the same code on both Windows and UNIX systems. Other processes can send this message via \c PostThreadMessage() in order to request, rather than force your application to terminate. -\subsection osissues_win32_messages Handling Other WIN32 Messages +\subsection osissues_win32_messages Handling Other Windows API Messages By default a single WNDCLASSEX called "FLTK" is -created. All Fl_Window 's are of this class unless you +created. All Fl_Window's are of this class unless you use Fl_Window::xclass(). The window class is created the first time Fl_Window::show() is called. You can probably combine FLTK with other libraries that make -their own WIN32 window classes. The easiest way is to call +their own window classes. The easiest way is to call Fl::wait(), as it will call \c DispatchMessage() for all messages to the other windows. If necessary you can let the other library take over as long as it calls @@ -517,7 +517,7 @@ extern MSG fl_msg This variable contains the most recent message read by \c GetMessage(), which is called by Fl::wait(). This may not be the -most recent message sent to an FLTK window, because silly WIN32 +most recent message sent to an FLTK window, because silly Windows calls the handle procedures directly for some events (sigh). void Fl::add_handler(int (*f)(int)) @@ -545,7 +545,7 @@ window handle, or \c NULL if not found. This function uses a cache so it is slightly faster than iterating through the windows yourself. -\subsection osissues_win32_gdi Drawing Things Using the WIN32 GDI +\subsection osissues_win32_gdi Drawing Things Using the Windows GDI When the virtual function Fl_Widget::draw() is called, FLTK stores all the extra arguments you need to @@ -614,13 +614,13 @@ bitmap data. \subsection osissues_msdos_console How to Not Get a MSDOS Console Window -WIN32 has a really stupid mode switch stored in the +Windows has a really stupid mode switch stored in the executables that controls whether or not to make a console window. To always get a console window you simply create a console application (the "/SUBSYSTEM:CONSOLE" option for the -linker). For a GUI-only application create a WIN32 application +linker). For a GUI-only application create a Windows application (the "/SUBSYSTEM:WINDOWS" option for the linker). FLTK includes a \c WinMain() function that calls the @@ -630,16 +630,16 @@ This function creates a console window when you use the debug version of the library. </I> -WIN32 applications without a console cannot write to +Windows applications without a console cannot write to \c stdout or \c stderr, even if they are run from a console window. Any output is silently thrown away. -Additionally, WIN32 applications are run in the background by +Additionally, Windows applications are run in the background by the console, although you can use "start /wait program" to run them in the foreground. -\subsection osissues_win32_problems Known WIN32 Bugs and Problems +\subsection osissues_win32_problems Known Windows Bugs and Problems -The following is a list of known bugs and problems in the WIN32 +The following is a list of known bugs and problems in the Windows version of FLTK: \li If a program is deactivated, <tt>Fl::wait()</tt> @@ -650,7 +650,7 @@ version of FLTK: windows or otherwise holding the mouse down. We were forced to remove most of the efficiency FLTK uses for redrawing in order to get windows to update while being - moved. This is a design error in WIN32 and probably + moved. This is a design error in Windows and probably impossible to get around. \li <tt>Fl_Gl_Window::can_do_overlay()</tt> returns true diff --git a/documentation/src/preface.dox b/documentation/src/preface.dox index d387a5f55..48229e9d8 100644 --- a/documentation/src/preface.dox +++ b/documentation/src/preface.dox @@ -65,8 +65,9 @@ The X Window System interface library. \par MS Windows, <tt>WIN32</tt> The Microsoft Windows Application Programmer's Interface for Windows 2000, -Windows XP, Windows Vista, and Windows 7. FLTK uses the preprocessor definition -<tt>WIN32</tt> for the 32 bit and 64 bit MS Windows API. +Windows XP, Windows Vista, Windows 7 and later Windows versions. +FLTK uses the preprocessor definition <tt>_WIN32</tt> for the 32 bit +and 64 bit MS Windows API. \par OS X, <tt>__APPLE__</tt> The Apple desktop operating sytem OS X 10.0 and later. MacOS 8 and 9 support diff --git a/examples/OpenGL3-glut-test.cxx b/examples/OpenGL3-glut-test.cxx index 77d738311..9ec8c4989 100644 --- a/examples/OpenGL3-glut-test.cxx +++ b/examples/OpenGL3-glut-test.cxx @@ -21,7 +21,7 @@ # define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED 1 # include <OpenGL/gl3.h> // defines OpenGL 3.0+ functions #else -# if defined(WIN32) +# if defined(_WIN32) # define GLEW_STATIC 1 # endif # include <GL/glew.h> diff --git a/examples/OpenGL3test.cxx b/examples/OpenGL3test.cxx index 1f8c2b8d9..ca880d22f 100644 --- a/examples/OpenGL3test.cxx +++ b/examples/OpenGL3test.cxx @@ -27,7 +27,7 @@ #if defined(__APPLE__) # include <OpenGL/gl3.h> // defines OpenGL 3.0+ functions #else -# if defined(WIN32) +# if defined(_WIN32) # define GLEW_STATIC 1 # endif # include <GL/glew.h> diff --git a/examples/clipboard.cxx b/examples/clipboard.cxx index 156c520d2..d95f883bd 100644 --- a/examples/clipboard.cxx +++ b/examples/clipboard.cxx @@ -26,9 +26,9 @@ #include <FL/Fl_Button.H> #include <FL/Fl.H> #include <FL/fl_draw.H> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> -#endif // WIN32 +#endif // _WIN32 /* Displays and follows the content of the clipboard with either image or text data */ @@ -79,7 +79,7 @@ public: if (!im) return 1; char title[300]; sprintf(title, "%dx%d",im->w(), im->h()); // display the image original size -#ifdef WIN32 +#ifdef _WIN32 OpenClipboard(NULL); // display extra technical info about clipboard content char *p=title + strlen(title); int format = EnumClipboardFormats(0); @@ -133,7 +133,7 @@ void clip_callback(int source, void *data) { // called after clipboard was chang int main(int argc, char **argv) { -#if !(defined(__APPLE__) || defined(WIN32)) +#if !(defined(__APPLE__) || defined(_WIN32)) fl_register_images(); // required to allow pasting of images #endif Fl_Window* win = new Fl_Window(500, 550, "clipboard viewer"); diff --git a/examples/howto-add_fd-and-popen.cxx b/examples/howto-add_fd-and-popen.cxx index 0131f4018..285a377f3 100644 --- a/examples/howto-add_fd-and-popen.cxx +++ b/examples/howto-add_fd-and-popen.cxx @@ -27,7 +27,7 @@ #include <FL/Fl_Window.H> #include <FL/Fl_Multi_Browser.H> -#ifdef WIN32 +#ifdef _WIN32 # define PING_CMD "ping -n 10 localhost" // 'slow command' under windows # ifdef _MSC_VER # define popen _popen diff --git a/examples/progress-simple.cxx b/examples/progress-simple.cxx index 9f72c4ca6..5221ddcb8 100644 --- a/examples/progress-simple.cxx +++ b/examples/progress-simple.cxx @@ -23,14 +23,14 @@ #include <FL/Fl_Button.H> #include <FL/Fl_Progress.H> -#ifdef WIN32 +#ifdef _WIN32 // WINDOWS #include <windows.h> #define usleep(v) Sleep(v/1000) -#else /*WIN32*/ +#else /* _WIN32 */ // UNIX #include <unistd.h> // usleep -#endif /*WIN32*/ +#endif /* _WIN32 */ // Button callback void butt_cb(Fl_Widget *butt, void *data) { diff --git a/examples/table-sort.cxx b/examples/table-sort.cxx index 2cbee1f51..dba178e8f 100644 --- a/examples/table-sort.cxx +++ b/examples/table-sort.cxx @@ -37,18 +37,18 @@ #define MARGIN 20 -#ifdef WIN32 +#ifdef _WIN32 // WINDOWS # define DIRCMD "dir" static const char *G_header[] = { "Date", "Time", "Size", "Filename", "", "", "", "", "", 0 }; # ifdef _MSC_VER # define popen _popen # endif -#else /*WIN32*/ +#else /* _WIN32 */ // UNIX # define DIRCMD "ls -l" static const char *G_header[] = { "Perms", "#L", "Own", "Group", "Size", "Date", "", "", "Filename", 0 }; -#endif /*WIN32*/ +#endif /* _WIN32 */ // Font face/sizes for header and rows #define HEADER_FONTFACE FL_HELVETICA_BOLD diff --git a/fluid/Fl_Function_Type.cxx b/fluid/Fl_Function_Type.cxx index dadd44f6c..97d6485d2 100644 --- a/fluid/Fl_Function_Type.cxx +++ b/fluid/Fl_Function_Type.cxx @@ -28,7 +28,7 @@ #include <stdlib.h> #include <string.h> -#ifdef WIN32 +#ifdef _WIN32 #include "ExternalCodeEditor_WIN32.h" #else #include "ExternalCodeEditor_UNIX.h" diff --git a/fluid/Fl_Type.h b/fluid/Fl_Type.h index 859f98bd1..6d7bd5eac 100644 --- a/fluid/Fl_Type.h +++ b/fluid/Fl_Type.h @@ -32,7 +32,7 @@ #include <FL/fl_draw.H> #include <stdarg.h> -#ifdef WIN32 +#ifdef _WIN32 #include "ExternalCodeEditor_WIN32.h" #else #include "ExternalCodeEditor_UNIX.h" diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 8bc13ac92..e13a171b3 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -48,7 +48,7 @@ #include "function_panel.h" #include "template_panel.h" -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) # include <direct.h> # include <windows.h> # include <io.h> @@ -235,10 +235,10 @@ void save_cb(Fl_Widget *, void *v) { const char *basename; if ((basename = strrchr(c, '/')) != NULL) basename ++; -#if defined(WIN32) +#if defined(_WIN32) if ((basename = strrchr(c, '\\')) != NULL) basename ++; -#endif // WIN32 +#endif // _WIN32 else basename = c; @@ -1000,7 +1000,7 @@ void print_menu_cb(Fl_Widget *, void *) { fl_draw(date, w - (int)fl_width(date), fl_height()); // Get the base filename... const char *basename = strrchr(filename, -#ifdef WIN32 +#ifdef _WIN32 '\\' #else '/' @@ -1287,11 +1287,11 @@ void update_history(const char *flname) { fl_filename_absolute(absolute, sizeof(absolute), flname); for (i = 0; i < max_files; i ++) -#if defined(WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(__APPLE__) if (!strcasecmp(absolute, absolute_history[i])) break; #else if (!strcmp(absolute, absolute_history[i])) break; -#endif // WIN32 || __APPLE__ +#endif // _WIN32 || __APPLE__ if (i == 0) return; @@ -1342,7 +1342,7 @@ public: FILE * desc() const { return _fpt;} // non null if file is open char * get_line(char * line, size_t s) const {return _fpt ? fgets(line, s, _fpt) : NULL;} -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) protected: HANDLE pin[2], pout[2], perr[2]; char ptmode; @@ -1365,7 +1365,7 @@ protected: FILE * _fpt; }; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) bool Fl_Process::createPipe(HANDLE * h, BOOL bInheritHnd) { SECURITY_ATTRIBUTES sa; sa.nLength = sizeof(sa); @@ -1376,7 +1376,7 @@ bool Fl_Process::createPipe(HANDLE * h, BOOL bInheritHnd) { #endif // portable open process: FILE * Fl_Process::popen(const char *cmd, const char *mode) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) // PRECONDITIONS if (!mode || !*mode || (*mode!='r' && *mode!='w') ) return NULL; if (_fpt) close(); // close first before reuse @@ -1417,7 +1417,7 @@ FILE * Fl_Process::popen(const char *cmd, const char *mode) { } int Fl_Process::close() { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) if (_fpt) { fclose(_fpt); clean_close(perr[0]); @@ -1434,7 +1434,7 @@ int Fl_Process::close() { #endif } -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) void Fl_Process::clean_close(HANDLE& h) { if (h!= INVALID_HANDLE_VALUE) CloseHandle(h); h = INVALID_HANDLE_VALUE; @@ -1674,9 +1674,9 @@ void set_modflag(int mf) { if (main_window) { if (!filename) basename = "Untitled.fl"; else if ((basename = strrchr(filename, '/')) != NULL) basename ++; -#if defined(WIN32) +#if defined(_WIN32) else if ((basename = strrchr(filename, '\\')) != NULL) basename ++; -#endif // WIN32 +#endif // _WIN32 else basename = filename; if (modflag) { @@ -1727,7 +1727,7 @@ static int arg(int argc, char** argv, int& i) { return 0; } -#if ! (defined(WIN32) && !defined (__CYGWIN__)) +#if ! (defined(_WIN32) && !defined (__CYGWIN__)) int quit_flag = 0; #include <signal.h> @@ -1833,7 +1833,7 @@ int main(int argc,char **argv) { } set_modflag(0); undo_clear(); -#ifndef WIN32 +#ifndef _WIN32 signal(SIGINT,sigint); #endif @@ -1842,13 +1842,13 @@ int main(int argc,char **argv) { grid_cb(horizontal_input, 0); // Makes sure that windows get snap params... -#ifdef WIN32 +#ifdef _WIN32 Fl::run(); #else while (!quit_flag) Fl::wait(); if (quit_flag) exit_cb(0,0); -#endif // WIN32 +#endif // _WIN32 undo_clear(); diff --git a/fluid/template_panel.cxx b/fluid/template_panel.cxx index 5762980ac..9975b16b6 100644 --- a/fluid/template_panel.cxx +++ b/fluid/template_panel.cxx @@ -27,11 +27,11 @@ #include <FL/fl_ask.H> #include <FL/Fl_Shared_Image.H> #include <FL/Fl_Preferences.H> -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) #include <io.h> #else #include <unistd.h> -#endif // WIN32 && !__CYGWIN__ +#endif // _WIN32 && !__CYGWIN__ extern Fl_Preferences fluid_prefs; Fl_Double_Window *template_panel=(Fl_Double_Window *)0; diff --git a/fluid/template_panel.fl b/fluid/template_panel.fl index fd6a1d5e1..7c9239dc6 100644 --- a/fluid/template_panel.fl +++ b/fluid/template_panel.fl @@ -46,7 +46,7 @@ decl {\#include <FL/Fl_Shared_Image.H>} {private local decl {\#include <FL/Fl_Preferences.H>} {private local } -declblock {\#if defined(WIN32) && !defined(__CYGWIN__)} {after {\#endif // WIN32 && !__CYGWIN__} +declblock {\#if defined(_WIN32) && !defined(__CYGWIN__)} {after {\#endif // _WIN32 && !__CYGWIN__} } { decl {\#include <io.h>} {private local } diff --git a/fluid/undo.cxx b/fluid/undo.cxx index 62770fec4..fc23e60a1 100644 --- a/fluid/undo.cxx +++ b/fluid/undo.cxx @@ -23,13 +23,13 @@ #include <FL/filename.H> #include "../src/flstring.h" -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) # include <io.h> # include <windows.h> # define getpid (int)GetCurrentProcessId #else # include <unistd.h> -#endif // WIN32 && !__CYGWIN__ +#endif // _WIN32 && !__CYGWIN__ extern Fl_Preferences fluid_prefs; // FLUID preferences diff --git a/jpeg/jconfig.h b/jpeg/jconfig.h index 900301492..2e31f719d 100644 --- a/jpeg/jconfig.h +++ b/jpeg/jconfig.h @@ -59,14 +59,6 @@ typedef unsigned char boolean; /* #undef NEED_SIGNAL_CATCHER */ /* #undef DONT_USE_B_MODE */ -#if 0 /* FLTK 1.3.3 (disabled in FLTK 1.3.4) */ - -#if defined(WIN32) || defined(__EMX__) -# define USE_SETMODE -#endif /* WIN32 || __EMX__ */ - -#endif /* FLTK 1.3.3 (disabled in FLTK 1.3.4) */ - /* Define this if you want percent-done progress reports from cjpeg/djpeg. */ /* #undef PROGRESS_REPORT */ diff --git a/src/Fl.cxx b/src/Fl.cxx index d5d6fb8b7..efbf90986 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -101,12 +101,12 @@ bool Fl::cfg_win_win32 = 1; bool Fl::cfg_win_win32 = 0; #endif -#ifdef FL_SYS_POSIX +#ifdef FL_CFG_SYS_POSIX bool Fl::cfg_sys_posix = 1; #else bool Fl::cfg_sys_posix = 0; #endif -#ifdef FL_SYS_WIN32 +#ifdef FL_CFG_SYS_WIN32 bool Fl::cfg_sys_win32 = 1; #else bool Fl::cfg_sys_win32 = 0; diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx index 94cbbfe63..eed1d670b 100644 --- a/src/Fl_File_Chooser2.cxx +++ b/src/Fl_File_Chooser2.cxx @@ -23,85 +23,85 @@ /** \class Fl_File_Chooser The Fl_File_Chooser widget displays a standard file selection dialog that supports various selection modes. - + \image html Fl_File_Chooser.jpg \image latex Fl_File_Chooser.jpg "Fl_File_Chooser" width=12cm - - The Fl_File_Chooser widget transmits UTF-8 encoded filenames to its user. It is - recommended to open files that may have non-ASCII names with the fl_fopen() or - fl_open() utility functions that handle these names in a cross-platform way - (whereas the standard fopen()/open() functions fail on the MSWindows platform - to open files with a non-ASCII name). - + + The Fl_File_Chooser widget transmits UTF-8 encoded filenames to its user. It is + recommended to open files that may have non-ASCII names with the fl_fopen() or + fl_open() utility functions that handle these names in a cross-platform way + (whereas the standard fopen()/open() functions fail on the Windows platform + to open files with a non-ASCII name). + The Fl_File_Chooser class also exports several static values that may be used to localize or customize the appearance of all file chooser dialogs: <CENTER><TABLE BORDER="1"> <TR> - <TH>Member</TH> - <TH>Default value</TH> + <TH>Member</TH> + <TH>Default value</TH> </TR> <TR> - <TD>add_favorites_label</TD> - <TD>"Add to Favorites"</TD> + <TD>add_favorites_label</TD> + <TD>"Add to Favorites"</TD> </TR> <TR> - <TD>all_files_label</TD> - <TD>"All Files (*)"</TD> + <TD>all_files_label</TD> + <TD>"All Files (*)"</TD> </TR> <TR> - <TD>custom_filter_label</TD> - <TD>"Custom Filter"</TD> + <TD>custom_filter_label</TD> + <TD>"Custom Filter"</TD> </TR> <TR> - <TD>existing_file_label</TD> - <TD>"Please choose an existing file!"</TD> + <TD>existing_file_label</TD> + <TD>"Please choose an existing file!"</TD> </TR> <TR> - <TD>favorites_label</TD> - <TD>"Favorites"</TD> + <TD>favorites_label</TD> + <TD>"Favorites"</TD> </TR> <TR> - <TD>filename_label</TD> - <TD>"Filename:"</TD> + <TD>filename_label</TD> + <TD>"Filename:"</TD> </TR> <TR> - <TD>filesystems_label</TD> - <TD>"My Computer" (WIN32)<BR> - "File Systems" (all others)</TD> + <TD>filesystems_label</TD> + <TD>"My Computer" (Windows)<BR> + "File Systems" (all others)</TD> </TR> - <TR> + <TR> <TD>hidden_label</TD> <TD>"Show hidden files:"</TD> - </TR> - <TR> - <TD>manage_favorites_label</TD> - <TD>"Manage Favorites"</TD> </TR> <TR> - <TD>new_directory_label</TD> - <TD>"New Directory?"</TD> + <TD>manage_favorites_label</TD> + <TD>"Manage Favorites"</TD> </TR> <TR> - <TD>new_directory_tooltip</TD> - <TD>"Create a new directory."</TD> + <TD>new_directory_label</TD> + <TD>"New Directory?"</TD> </TR> <TR> - <TD>preview_label</TD> - <TD>"Preview"</TD> + <TD>new_directory_tooltip</TD> + <TD>"Create a new directory."</TD> </TR> <TR> - <TD>save_label</TD> - <TD>"Save"</TD> + <TD>preview_label</TD> + <TD>"Preview"</TD> </TR> <TR> - <TD>show_label</TD> - <TD>"Show:"</TD> + <TD>save_label</TD> + <TD>"Save"</TD> </TR> - <TR> - <TD>sort</TD> - <TD>fl_numericsort</TD> + <TR> + <TD>show_label</TD> + <TD>"Show:"</TD> + </TR> + <TR> + <TD>sort</TD> + <TD>fl_numericsort</TD> </TR> </TABLE></CENTER> diff --git a/src/Fl_Gl_Overlay.cxx b/src/Fl_Gl_Overlay.cxx index 0c98ca707..161a51bb6 100644 --- a/src/Fl_Gl_Overlay.cxx +++ b/src/Fl_Gl_Overlay.cxx @@ -62,7 +62,7 @@ void Fl_Gl_Window::make_overlay_current() { pGlWindowDriver->make_overlay_current(); } -/** Hides the window if it is not this window, does nothing in WIN32. */ +/** Hides the window if it is not this window, does nothing in Windows. */ void Fl_Gl_Window::hide_overlay() { pGlWindowDriver->hide_overlay(); } @@ -211,7 +211,7 @@ void Fl_X11_Gl_Window_Driver::make_overlay(void *¤t) { #include "drivers/WinAPI/Fl_WinAPI_Window_Driver.H" //////////////////////////////////////////////////////////////// -// WIN32 version: +// Windows version: void Fl_WinAPI_Gl_Window_Driver::hide_overlay(void *& overlay) { #if HAVE_GL_OVERLAY diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index 05d609f14..d27bb3eaa 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -1,7 +1,7 @@ // // "$Id$" // -// implementation of Fl_Graphics_Driver class for the Fast Light Tool Kit (FLTK). +// Fl_Graphics_Driver class for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2018 by Bill Spitzak and others. // @@ -89,7 +89,7 @@ void Fl_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Offscreen fl_begin_offscreen(pixmap); // does nothing if pixmap was not created by fl_create_offscreen() float s = 1; if (current == Fl_Surface_Device::surface()) {// pixmap was not created by fl_create_offscreen() - // happens, e.g., when drawing images under WIN32 + // happens, e.g., when drawing images under Windows surface = new Fl_Image_Surface(px_width, px_height, 0, pixmap); Fl_Surface_Device::push_current(surface); } diff --git a/src/Fl_JPEG_Image.cxx b/src/Fl_JPEG_Image.cxx index 8c8b762d1..384acd2a4 100644 --- a/src/Fl_JPEG_Image.cxx +++ b/src/Fl_JPEG_Image.cxx @@ -39,9 +39,9 @@ // updated header file for the INT32 data type; the following define // from Shane Hill seems to be a usable workaround... -#if defined(WIN32) && defined(__CYGWIN__) +#if defined(__CYGWIN__) # define XMD_H -#endif // WIN32 && __CYGWIN__ +#endif // __CYGWIN__ extern "C" diff --git a/src/Fl_Table.cxx b/src/Fl_Table.cxx index 8ebc9044f..aea25a0b3 100644 --- a/src/Fl_Table.cxx +++ b/src/Fl_Table.cxx @@ -26,11 +26,11 @@ #include <string.h> // memcpy #include <stdio.h> // fprintf -#ifdef WIN32 +#ifdef _WIN32 #include <malloc.h> // WINDOWS: malloc/realloc -#else /*WIN32*/ +#else /* _WIN32 */ #include <stdlib.h> // UNIX: malloc/realloc -#endif /*WIN32*/ +#endif /* _WIN32 */ // An STL-ish vector without templates (private to Fl_Table) diff --git a/src/Fl_Text_Editor.cxx b/src/Fl_Text_Editor.cxx index f3167e232..ab2f30c51 100644 --- a/src/Fl_Text_Editor.cxx +++ b/src/Fl_Text_Editor.cxx @@ -1,7 +1,8 @@ // // "$Id$" // -// Copyright 2001-2010 by Bill Spitzak and others. +// Copyright 2001-2018 by Bill Spitzak and others. +// // Original code Copyright Mark Edel. Permission to distribute under // the LGPL for the FLTK library granted by Mark Edel. // @@ -696,8 +697,8 @@ int Fl_Text_Editor::handle(int event) { return 1; case FL_ENTER: -// MRS: WIN32 only? Need to test! -// case FL_MOVE: +// MRS: Windows only? Need to test! +// case FL_MOVE: show_cursor(mCursorOn); return 1; diff --git a/src/Fl_Window.cxx b/src/Fl_Window.cxx index 7a2ae7270..dedbf525d 100644 --- a/src/Fl_Window.cxx +++ b/src/Fl_Window.cxx @@ -19,7 +19,7 @@ // The Fl_Window is a window in the fltk library. // This is the system-independent portions. The huge amount of // crap you need to do to communicate with X is in Fl_x.cxx, the -// equivalent (but totally different) crap for MSWindows is in Fl_win32.cxx +// equivalent (but totally different) crap for Windows is in Fl_win32.cxx #include <config.h> #include <FL/Fl.H> @@ -597,10 +597,10 @@ int Fl_Window::handle(int ev) <LI>\p dw and \p dh are size increments. The window will be constrained to widths of minw + N * dw, where N is any non-negative integer. If these are less or equal to 1 they are ignored (this is ignored - on WIN32).</LI> + on Windows).</LI> <LI>\p aspect is a flag that indicates that the window should preserve its aspect ratio. This only works if both the maximum and minimum have - the same aspect ratio (ignored on WIN32 and by many X window managers). + the same aspect ratio (ignored on Windows and by many X window managers). </LI> </UL> diff --git a/src/Fl_Window_Driver.cxx b/src/Fl_Window_Driver.cxx index 7a391e13f..f9cc27912 100644 --- a/src/Fl_Window_Driver.cxx +++ b/src/Fl_Window_Driver.cxx @@ -131,7 +131,7 @@ void Fl_Window_Driver::destroy_double_buffer() { Platform details: \li On the unix/linux platform, the SHAPE extension of the X server is required. This function does control the shape of Fl_Gl_Window instances. - \li On the MSWindows platform, this function does nothing with class Fl_Gl_Window. + \li On the Windows platform, this function does nothing with class Fl_Gl_Window. \li On the Mac platform, OS version 10.4 or above is required. An 8-bit shape-mask is used when \p img is an Fl_RGB_Image: with depths 2 or 4, the image alpha channel becomes the shape mask such that areas with alpha = 0 diff --git a/src/Fl_arg.cxx b/src/Fl_arg.cxx index ad2a47938..2712b72ae 100644 --- a/src/Fl_arg.cxx +++ b/src/Fl_arg.cxx @@ -3,7 +3,7 @@ // // Optional argument initialization code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -16,7 +16,7 @@ // http://www.fltk.org/str.php // -// OPTIONAL initialization code for a program using fltk. +// OPTIONAL initialization code for a program using FLTK. // You do not need to call this! Feel free to make up your own switches. #include <FL/Fl.H> @@ -69,7 +69,7 @@ extern const char *fl_bg2; \li -display host:n.n <br> Sets the X display to use; this option is silently - ignored under WIN32 and MacOS. + ignored under Windows and MacOS. \li -dnd and -nodnd <br> @@ -292,7 +292,7 @@ void Fl_Window::show(int argc, char **argv) { // if (mh > gh) gh = mh; Fl_Widget *r = resizable(); if (!r) resizable(this); - // for WIN32 we assume window is not mapped yet: + // for Windows we assume window is not mapped yet: if (fl & (Fl_System_Driver::fl_XValue | Fl_System_Driver::fl_YValue)) x(-1), resize(gx,gy,gw,gh); else diff --git a/src/Fl_get_key_win32.cxx b/src/Fl_get_key_win32.cxx index 66b27c7ae..fb6a49238 100644 --- a/src/Fl_get_key_win32.cxx +++ b/src/Fl_get_key_win32.cxx @@ -1,7 +1,7 @@ // // "$Id$" // -// WIN32 keyboard state routines for the Fast Light Tool Kit (FLTK). +// Windows keyboard state routines for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. // @@ -17,15 +17,15 @@ // // Return the current state of a key. Keys are named by fltk symbols, -// which are actually X keysyms. So this has to translate to MSWindows +// which are actually X keysyms. So this has to translate to Windows // VK_x symbols. #include "drivers/WinAPI//Fl_WinAPI_System_Driver.H" #include <FL/platform.H> -// convert an Fltk (X) keysym to a MSWindows VK symbol: +// Convert an FLTK (X) keysym to a Windows VK symbol: // See also the inverse converter in Fl_win32.cxx -// This table is in numeric order by Fltk symbol order for binary search: +// This table is in numeric order by FLTK symbol order for binary search: static const struct {unsigned short vk, fltk;} vktab[] = { {VK_SPACE, ' '}, diff --git a/src/Fl_grab.cxx b/src/Fl_grab.cxx index 5a33e4b7c..f7fc8c904 100644 --- a/src/Fl_grab.cxx +++ b/src/Fl_grab.cxx @@ -3,7 +3,7 @@ // // Grab/release code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2016 by Bill Spitzak and others. +// Copyright 1998-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -25,7 +25,7 @@ // have to be displayed (and in the case of Fl_Menu.cxx it isn't). // The system is also told to "grab" events and send them to this app. // This also modifies how Fl_Window::show() works, on X it turns on -// override_redirect, it does similar things on WIN32. +// override_redirect, it does similar things on Windows. void Fl::grab(Fl_Window *win) { diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 0a8e399b9..24b0548fb 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,7 +1,7 @@ // // "$Id$" // -// WIN32-specific code for the Fast Light Tool Kit (FLTK). +// Windows-specific code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. // @@ -16,11 +16,11 @@ // http://www.fltk.org/str.php // -// This file contains win32-specific code for fltk which is always linked -// in. Search other files for "WIN32" or filenames ending in _win32.cxx +// This file contains Windows-specific code for FLTK which is always linked +// in. Search other files for "_WIN32" or filenames ending in _win32.cxx // for other system-specific code. -#if defined(WIN32) && !defined(FL_DOXYGEN) +#if defined(_WIN32) && !defined(FL_DOXYGEN) /* We require Windows 2000 features (e.g. VK definitions) */ # if !defined(WINVER) || (WINVER < 0x0500) @@ -271,7 +271,7 @@ static Fl_Window *track_mouse_win = 0; // current TrackMouseEvent() window // devices, or pipes... // // Microsoft provides the Berkeley select() call and an asynchronous -// select function that sends a WIN32 message when the select condition +// select function that sends a Windows message when the select condition // exists. However, we don't try to use the asynchronous WSAAsyncSelect() // any more for good reasons (see above). // @@ -399,7 +399,7 @@ double Fl_WinAPI_Screen_Driver::wait(double time_to_wait) { } if (nfds) { - // For WIN32 we need to poll for socket input FIRST, since + // For Windows we need to poll for socket input FIRST, since // the event queue is not something we can select() on... timeval t; t.tv_sec = 0; @@ -560,7 +560,7 @@ class Fl_Win32_At_Exit { public: Fl_Win32_At_Exit() {} ~Fl_Win32_At_Exit() { - fl_free_fonts(); // do some WIN32 cleanup + fl_free_fonts(); // do some Windows cleanup fl_cleanup_pens(); OleUninitialize(); fl_brush_action(1); @@ -1043,7 +1043,7 @@ static int mouse_event(Fl_Window *window, int what, int button, case 3: // move: default: // avoid compiler warning - // MSWindows produces extra events even if mouse does not move, ignore em: + // Windows produces extra events even if the mouse does not move, ignore em: if (Fl::e_x_root == pmx && Fl::e_y_root == pmy) return 1; pmx = Fl::e_x_root; @@ -1054,7 +1054,7 @@ static int mouse_event(Fl_Window *window, int what, int button, } } -// convert a MSWindows VK_x to an Fltk (X) Keysym: +// Convert a Windows VK_x to an FLTK (X) Keysym: // See also the inverse converter in Fl_get_key_win32.cxx // This table is in numeric order by VK: static const struct { @@ -1216,7 +1216,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar redraw_whole_window = true; } - // We need to merge WIN32's damage into FLTK's damage. + // We need to merge Windows' damage into FLTK's damage. R = CreateRectRgn(0, 0, 0, 0); int r = GetUpdateRgn(hWnd, R, 0); if (r == NULLREGION && !redraw_whole_window) { @@ -1228,7 +1228,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar R2 = Fl_GDI_Graphics_Driver::scale_region(i->region, scale, NULL); if (R2) { - // Also tell WIN32 that we are drawing someplace else as well... + // Also tell Windows that we are drawing someplace else as well... CombineRgn(R2, R2, R, RGN_OR); DeleteObject(R); } else { @@ -1245,7 +1245,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar window->clear_damage((uchar)(window->damage() | FL_DAMAGE_EXPOSE)); // These next two statements should not be here, so that all update - // is deferred until Fl::flush() is called during idle. However WIN32 + // is deferred until Fl::flush() is called during idle. However Windows // apparently is very unhappy if we don't obey it and draw right now. // Very annoying! fl_GetDC(hWnd); // Make sure we have a DC for this window... @@ -1403,7 +1403,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar if (GetKeyState(VK_NUMLOCK)) state |= FL_NUM_LOCK; if ((GetKeyState(VK_LWIN) | GetKeyState(VK_RWIN)) & ~1) { - // WIN32 bug? GetKeyState returns garbage if the user hit the + // Windows bug? GetKeyState returns garbage if the user hit the // meta key to pop up start menu. Sigh. if ((GetAsyncKeyState(VK_LWIN) | GetAsyncKeyState(VK_RWIN)) & ~1) state |= FL_META; @@ -1677,7 +1677,7 @@ static int fake_X_wm_style(const Fl_Window *w, int &X, int &Y, int &bt, int &bx, if (!style) { HWND hwnd = fl_xid(w); - // request the style flags of this window, as WIN32 sees them + // request the style flags of this window, as Windows sees them style = GetWindowLong(hwnd, GWL_STYLE); styleEx = GetWindowLong(hwnd, GWL_EXSTYLE); } @@ -2529,7 +2529,7 @@ fl_uintptr_t Fl_WinAPI_Window_Driver::current_cursor() { // faster by using X's background pixel erasing. We can make it // actually *be* faster by drawing the frame only, this is done by // setting fl_boxcheat, which is seen by code in fl_drawbox.cxx: -// For WIN32 it looks like all windows share a background color, so +// For Windows it looks like all windows share a background color, so // I use FL_GRAY for this and only do this cheat for windows that are // that color. // Actually it is totally disabled. @@ -2810,7 +2810,7 @@ void preparePrintFront(void) { } #endif // USE_PRINT_BUTTON -#endif // defined(WIN32) and !defined(FL_DOXYGEN) +#endif // defined(_WIN32) and !defined(FL_DOXYGEN) // // End of "$Id$". diff --git a/src/Makefile b/src/Makefile index 9364320a7..bb9560463 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,7 +3,7 @@ # # Library Makefile for the Fast Light Tool Kit (FLTK). # -# Copyright 1998-2017 by Bill Spitzak and others. +# Copyright 1998-2018 by Bill Spitzak and others. # # This library is free software. Distribution and use rights are outlined in # the file "COPYING" which should have been included with this file. If this @@ -612,7 +612,7 @@ depend: $(CPPFILES) $(MMFILES) $(FLCPPFILES) $(GLCPPFILES) $(IMGCPPFILES) $(CFIL include makedepend # These dependencies aren't part of the makedepend file since -# they are part of the WIN32 and MacOS code base... +# they are part of the Windows and MacOS code base... # Please add only non-Linux/Unix files or such that are optional # (like "*xft*") here: Fl_get_key_mac.o: Fl_get_key_mac.cxx diff --git a/src/config_lib.h b/src/config_lib.h index 0fd18a322..bef665b71 100644 --- a/src/config_lib.h +++ b/src/config_lib.h @@ -3,7 +3,7 @@ * * Configuration file for the Fast Light Tool Kit (FLTK). * - * Copyright 1998-2016 by Bill Spitzak and others. + * Copyright 1998-2018 by Bill Spitzak and others. */ #ifndef FL_CONFIG_LIB_H @@ -20,7 +20,7 @@ # ifdef HAVE_GL # define FL_CFG_GFX_OPENGL # endif -#elif defined(WIN32) +#elif defined(_WIN32) # define FL_CFG_GFX_GDI # ifdef HAVE_GL # define FL_CFG_GFX_OPENGL @@ -42,7 +42,7 @@ #ifdef __APPLE__ /* default configurations */ # define FL_CFG_PRN_QUARTZ -#elif defined(WIN32) +#elif defined(_WIN32) # define FL_CFG_PRN_WIN32 #elif defined(FL_PORTING) # pragma message "FL_PORTING: please choose a printer driver" @@ -58,7 +58,7 @@ #ifdef __APPLE__ /* default configurations */ # define FL_CFG_WIN_COCOA -#elif defined(WIN32) +#elif defined(_WIN32) # define FL_CFG_WIN_WIN32 #elif defined(FL_PORTING) # pragma message "FL_PORTING: please choose a window management library" @@ -74,7 +74,7 @@ #ifdef __APPLE__ /* default configurations */ # define FL_CFG_SYS_POSIX -#elif defined(WIN32) +#elif defined(_WIN32) # define FL_CFG_SYS_WIN32 #elif defined(FL_PORTING) # pragma message "FL_PORTING: please choose a system library" diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H index ef64799c9..f9631198e 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H @@ -4,7 +4,7 @@ // Definition of Apple Cocoa window driver // for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2016 by Bill Spitzak and others. +// Copyright 2010-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -52,7 +52,7 @@ class FLWindow; - window types and styles, depth, etc. - decorations - ? where do we handle the interface between OpenGL/DirectX and Cocoa/WIN32/Glx? + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ struct Fl_Window_Driver::shape_data_type { Fl_Image* shape_; ///< shape image diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx index ddcf5b812..1662f6847 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx @@ -205,7 +205,7 @@ char *Fl_Darwin_System_Driver::preference_rootnode(Fl_Preferences *prefs, Fl_Pre { static char filename[ FL_PATH_MAX ]; // TODO: verify that this is the Apple sanctioned way of finding these folders - // (On MSWindows, this frequently leads to issues with internationalized systems) + // (On Windows, this frequently leads to issues with internationalized systems) // Carbon: err = FindFolder( kLocalDomain, kPreferencesFolderType, 1, &spec.vRefNum, &spec.parID ); switch (root) { case Fl_Preferences::SYSTEM: diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H index 8de2a9a1d..1ab61722b 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -19,7 +19,7 @@ /** \file Fl_GDI_Graphics_Driver.H - \brief Definition of MSWindows GDI graphics driver. + \brief Definition of Windows GDI graphics driver. */ #ifndef FL_GDI_GRAPHICS_DRIVER_H @@ -30,10 +30,10 @@ /** - \brief The MSWindows-specific graphics class. - * - This class is implemented only on the MSWindows platform. - */ + \brief The Windows-specific graphics driver class. + + This class is implemented only on the Windows platform. +*/ class FL_EXPORT Fl_GDI_Graphics_Driver : public Fl_Scalable_Graphics_Driver { private: BOOL alpha_blend_(int x, int y, int w, int h, HDC src_gc, int srcx, int srcy, int srcw, int srch); @@ -151,10 +151,11 @@ protected: /** - The graphics driver used when printing on MSWindows. - * - This class is implemented only on the MSWindows platform. It 's extremely similar to Fl_GDI_Graphics_Driver. - */ + The graphics driver used when printing on Windows. + + This class is implemented only on the Windows platform. + It is extremely similar to Fl_GDI_Graphics_Driver. +*/ class FL_EXPORT Fl_GDI_Printer_Graphics_Driver : public Fl_GDI_Graphics_Driver { private: typedef BOOL (WINAPI* transparent_f_type) (HDC,int,int,int,int,HDC,int,int,int,int,UINT); diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx index 4a49db6d5..e4088b0c0 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx @@ -25,7 +25,7 @@ /* * By linking this module, the following static method will instantiate the - * MSWindows GDI Graphics driver as the main display driver. + * Windows GDI Graphics driver as the main display driver. */ Fl_Graphics_Driver *Fl_Graphics_Driver::newMainGraphicsDriver() { @@ -53,7 +53,7 @@ void Fl_GDI_Graphics_Driver::global_gc() } /* - * This function checks if the version of MSWindows that we + * This function checks if the version of Windows that we * curently run on supports alpha blending for bitmap transfers * and finds the required function if so. */ diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx index c9d74e59e..7127682cc 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_font.cxx @@ -1,7 +1,7 @@ // // "$Id$" // -// WIN32 font utilities for the Fast Light Tool Kit (FLTK). +// Windows font utilities for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. // @@ -16,23 +16,21 @@ // http://www.fltk.org/str.php // -#ifdef WIN32 -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif /* We require Windows 2000 features such as GetGlyphIndices */ -# if !defined(WINVER) || (WINVER < 0x0500) -# ifdef WINVER -# undef WINVER -# endif -# define WINVER 0x0500 +#if !defined(WINVER) || (WINVER < 0x0500) +# ifdef WINVER +# undef WINVER # endif -# if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500) -# ifdef _WIN32_WINNT -# undef _WIN32_WINNT -# endif -# define _WIN32_WINNT 0x0500 +# define WINVER 0x0500 +#endif +#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500) +# ifdef _WIN32_WINNT +# undef _WIN32_WINNT # endif +# define _WIN32_WINNT 0x0500 #endif // Select fonts from the FLTK font table. diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index 63dded34d..31d308464 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -1,7 +1,7 @@ // // "$Id$" // -// WIN32 image drawing code for the Fast Light Tool Kit (FLTK). +// Windows image drawing code for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. // @@ -414,7 +414,7 @@ void Fl_GDI_Graphics_Driver::draw_unscaled(Fl_Bitmap *bm, float s, int XP, int Y int save = SaveDC(tempdc); SelectObject(tempdc, (HGDIOBJ)*Fl_Graphics_Driver::id(bm)); SelectObject(gc_, fl_brush()); - // secret bitblt code found in old MSWindows reference manual: + // secret bitblt code found in old Windows reference manual: BitBlt(gc_, X, Y, W, H, tempdc, cx, cy, 0xE20746L); RestoreDC(tempdc, save); DeleteDC(tempdc); diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx index d347cc6a8..0dbb674f0 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx @@ -19,7 +19,7 @@ /** \file Fl_GDI_Graphics_Driver_rect.cxx - \brief MSWindows GDI specific line and polygon drawing with integer coordinates. + \brief Windows GDI specific line and polygon drawing with integer coordinates. */ #include <config.h> diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx index b8ee81d65..caace8b39 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_vertex.cxx @@ -20,7 +20,7 @@ \file Fl_GDI_Graphics_Driver_vertex.cxx \brief Portable drawing code for drawing arbitrary shapes with - simple 2D transformations, implemented for MSWindows GDI. + simple 2D transformations, implemented for Windows GDI. */ #include "Fl_GDI_Graphics_Driver.H" diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx index 193f766cb..f6586aa85 100644 --- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx +++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_color.cxx @@ -3,7 +3,7 @@ // // Color functions for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2016 by Bill Spitzak and others. +// Copyright 1998-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -21,8 +21,8 @@ \brief Color handling */ -#include <config.h> #include "../../config_lib.h" +// #include <config.h> #include "Fl_OpenGL_Graphics_Driver.H" #include <FL/gl.h> #include <FL/Fl_Gl_Window.H> @@ -37,7 +37,7 @@ void Fl_OpenGL_Graphics_Driver::color(Fl_Color i) { // FIXME: do we need the code below? /* #if HAVE_GL_OVERLAY -#if defined(WIN32) +#if defined(_WIN32) if (fl_overlay && fl_overlay_depth) { if (fl_overlay_depth < 8) { // only black & white produce the expected colors. This could diff --git a/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx index 2c318d0b4..7492074a7 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx @@ -1,9 +1,9 @@ // // "$Id$" // -// Support for WIN32 printing for the Fast Light Tool Kit (FLTK). +// Printing support for Windows for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2016 by Bill Spitzak and others. +// Copyright 2010-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -16,7 +16,7 @@ // http://www.fltk.org/str.php // -#ifdef WIN32 +#ifdef _WIN32 #include "../GDI/Fl_GDI_Graphics_Driver.H" #include <FL/Fl_Printer.H> @@ -27,7 +27,7 @@ extern HWND fl_window; -/** Support for printing on the MSWindows platform */ +/** Support for printing on the Windows platform */ class Fl_WinAPI_Printer_Driver : public Fl_Paged_Device { friend class Fl_Paged_Device; private: @@ -318,7 +318,7 @@ void Fl_WinAPI_Printer_Driver::origin(int *x, int *y) Fl_Paged_Device::origin(x, y); } -#endif // WIN32 +#endif // _WIN32 // // End of "$Id$". diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H index b5d238ba9..d6dfaf889 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.H @@ -1,7 +1,7 @@ // // "$Id$" // -// Definition of MSWindows Win32/64 Screen interface +// Definition of Windows screen interface // for the Fast Light Tool Kit (FLTK). // // Copyright 2010-2018 by Bill Spitzak and others. @@ -19,7 +19,7 @@ /** \file Fl_WinAPI_Screen_Driver.H - \brief Definition of MSWindows Win32/64 Screen interface. + \brief Definition of Windows screen interface. */ #ifndef FL_WINAPI_SCREEN_DRIVER_H diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index f44fa7a3c..4521038f0 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -1,7 +1,7 @@ // // "$Id$" // -// Definition of MSWindows Win32/64 Screen interface +// Windows screen interface for the Fast Light Tool Kit (FLTK). // // Copyright 1998-2018 by Bill Spitzak and others. // @@ -275,7 +275,7 @@ void Fl_WinAPI_Screen_Driver::flush() extern void fl_fix_focus(); // in Fl.cxx // We have to keep track of whether we have captured the mouse, since -// MSWindows shows little respect for this... Grep for fl_capture to +// Windows shows little respect for this... Grep for fl_capture to // see where and how this is used. extern HWND fl_capture; diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H index 0f376a00a..0fe23cfda 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H @@ -1,10 +1,9 @@ // // "$Id$" // -// Definition of MSWindows system driver -// for the Fast Light Tool Kit (FLTK). +// Definition of Windows system driver for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2017 by Bill Spitzak and others. +// Copyright 2010-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -19,7 +18,7 @@ /** \file Fl_WinAPI_System_Driver.H - \brief Definition of MSWindows system driver. + \brief Definition of Windows system driver. */ #ifndef FL_WINAPI_SYSTEM_DRIVER_H diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx index 26a41bd61..f2b56e0e0 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx @@ -3,7 +3,7 @@ // // Definition of Apple Darwin system driver. // -// Copyright 1998-2017 by Bill Spitzak and others. +// Copyright 1998-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -155,7 +155,7 @@ Fl_System_Driver *Fl_System_Driver::newSystemDriver() } void Fl_WinAPI_System_Driver::warning(const char *format, va_list args) { - // Show nothing for warnings under WIN32... + // Show nothing for warnings under Windows... } void Fl_WinAPI_System_Driver::error(const char *format, va_list args) { @@ -308,7 +308,7 @@ int Fl_WinAPI_System_Driver::rename(const char *fnam, const char *newnam) { return _wrename(wbuf, wbuf1); } -// Two WIN32-specific functions fl_utf8_to_locale() and fl_locale_to_utf8() +// Two Windows-specific functions fl_utf8_to_locale() and fl_locale_to_utf8() // from file fl_utf8.cxx are put here for API compatibility static char *buf = NULL; @@ -721,7 +721,7 @@ int Fl_WinAPI_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows endmntent(m); # else // - // Normal WIN32 code uses drive bits... + // Normal Windows code uses drive bits... // DWORD drives; // Drive available bits drives = GetLogicalDrives(); @@ -729,7 +729,7 @@ int Fl_WinAPI_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows if (drives & 1) { sprintf(filename, "%c:/", i); - if (i < 'C') // see also: GetDriveType and GetVolumeInformation in WIN32 + if (i < 'C') // see also: GetDriveType and GetVolumeInformation in Windows browser->add(filename, icon); else browser->add(filename, icon); diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H index 576d42736..7e67f2355 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H +++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H @@ -4,7 +4,7 @@ // Definition of Apple Cocoa window driver // for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2016 by Bill Spitzak and others. +// Copyright 2010-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -19,7 +19,7 @@ /** \file Fl_WinAPI_Window_Driver.H - \brief Definition of MSWindows window driver. + \brief Definition of Windows window driver. */ #ifndef FL_WINAPI_WINDOW_DRIVER_H @@ -40,7 +40,7 @@ - window types and styles, depth, etc. - decorations - ? where do we handle the interface between OpenGL/DirectX and Cocoa/WIN32/Glx? + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ diff --git a/src/drivers/X11/Fl_X11_Window_Driver.H b/src/drivers/X11/Fl_X11_Window_Driver.H index ad1c29c3d..c84949e3b 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.H +++ b/src/drivers/X11/Fl_X11_Window_Driver.H @@ -42,7 +42,7 @@ class Fl_Bitmap; - window types and styles, depth, etc. - decorations - ? where do we handle the interface between OpenGL/DirectX and Cocoa/WIN32/Glx? + ? where do we handle the interface between OpenGL/DirectX and Cocoa/Windows/Glx? */ diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx index 34ae4bd38..da88cc00e 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_line_style.cxx @@ -32,7 +32,7 @@ void Fl_Xlib_Graphics_Driver::line_style_unscaled(int style, float width, char* dashes) { int ndashes = dashes ? strlen(dashes) : 0; - // emulate the WIN32 dash patterns on X + // emulate the Windows dash patterns on X char buf[7]; if (!ndashes && (style&0xff)) { int w = width ? width : 1; diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx index 954b36b60..10d6f4875 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx @@ -142,7 +142,7 @@ int Fl_Xlib_Graphics_Driver::clip_x (int x) { } // Missing X call: (is this the fastest way to init a 1-rectangle region?) -// MSWindows equivalent exists, implemented inline in win32.H +// Windows equivalent exists, implemented inline in win32.H Fl_Region Fl_Xlib_Graphics_Driver::XRectangleRegion(int x, int y, int w, int h) { XRectangle R; clip_to_short(x, y, w, h, line_width_); diff --git a/src/filename_list.cxx b/src/filename_list.cxx index cd1f1d4df..262b79974 100644 --- a/src/filename_list.cxx +++ b/src/filename_list.cxx @@ -3,7 +3,7 @@ // // Filename list routines for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -36,33 +36,35 @@ int fl_casealphasort(struct dirent **a, struct dirent **b) { /** - Portable and const-correct wrapper for the scandir() function. - For each file in that directory a "dirent" structure is created. - The only portable thing about a dirent is that dirent.d_name is the nul-terminated file name. - An pointers array to these dirent's is created and a pointer to the array is returned in *list. - The number of entries is given as a return value. - If there is an error reading the directory a number less than zero is returned, - and errno has the reason; errno does not work under WIN32. + Portable and const-correct wrapper for the scandir() function. - \b Include: - \code - #include <FL/filename.H> - \endcode + For each file in that directory a "dirent" structure is created. + The only portable thing about a dirent is that dirent.d_name is the + nul-terminated file name. A pointers array to these dirent's is created + and a pointer to the array is returned in *list. + The number of entries is given as a return value. + If there is an error reading the directory a number less than zero is + returned, and errno has the reason; errno does not work under Windows. - \param[in] d the name of the directory to list. It does not matter if it has a trailing slash. - \param[out] list table containing the resulting directory listing - \param[in] sort sorting functor: - - fl_alphasort: The files are sorted in ascending alphabetical order; - upper and lowercase letters are compared according to their ASCII ordering uppercase before lowercase. - - fl_casealphasort: The files are sorted in ascending alphabetical order; - upper and lowercase letters are compared equally case is not significant. - - fl_casenumericsort: The files are sorted in ascending "alphanumeric" order, where an attempt is made - to put unpadded numbers in consecutive order; upper and lowercase letters - are compared equally case is not significant. - - fl_numericsort: The files are sorted in ascending "alphanumeric" order, where an attempt is made - to put unpadded numbers in consecutive order; upper and lowercase letters are compared - according to their ASCII ordering - uppercase before lowercase. - \return the number of entries if no error, a negative value otherwise. + \b Include: + \code + #include <FL/filename.H> + \endcode + + \param[in] d the name of the directory to list. It does not matter if it has a trailing slash. + \param[out] list table containing the resulting directory listing + \param[in] sort sorting functor: + - fl_alphasort: The files are sorted in ascending alphabetical order; + upper and lowercase letters are compared according to their ASCII ordering uppercase before lowercase. + - fl_casealphasort: The files are sorted in ascending alphabetical order; + upper and lowercase letters are compared equally case is not significant. + - fl_casenumericsort: The files are sorted in ascending "alphanumeric" order, where an attempt is made + to put unpadded numbers in consecutive order; upper and lowercase letters + are compared equally case is not significant. + - fl_numericsort: The files are sorted in ascending "alphanumeric" order, where an attempt is made + to put unpadded numbers in consecutive order; upper and lowercase letters are compared + according to their ASCII ordering - uppercase before lowercase. + \return the number of entries if no error, a negative value otherwise. */ int fl_filename_list(const char *d, dirent ***list, Fl_File_Sort_F *sort) { return Fl::system_driver()->filename_list(d, list, sort); diff --git a/src/fl_call_main.c b/src/fl_call_main.c index 2f8e6b0d5..6fa541a55 100644 --- a/src/fl_call_main.c +++ b/src/fl_call_main.c @@ -1,7 +1,7 @@ /* * "$Id$" * - * Copyright 1998-2016 by Bill Spitzak and others. + * Copyright 1998-2018 by Bill Spitzak and others. * * fl_call_main() calls main() for you Windows people. Needs to be done in C * because Borland C++ won't let you call main() from C++. @@ -21,7 +21,7 @@ * This WinMain() function can be overridden by an application and * is provided for compatibility with programs written for other * operating systems that conform to the ANSI standard entry point - * "main()". This will allow you to build a WIN32 Application + * "main()". This will allow you to build a Windows Application * without any special settings. * * Because of problems with the Microsoft Visual C++ header files @@ -37,13 +37,13 @@ * Microsoft(r) Windows(r) that allows for it. */ -#if defined(WIN32) || defined(__APPLE__) /* PORTME: Fl_System_Driver - platform main() */ +#if defined(_WIN32) || defined(__APPLE__) /* PORTME: Fl_System_Driver - platform main() */ #elif defined(FL_PORTING) # pragma message "FL_PORTING: implement 'main()' here if your platform provides another app entry point" #else #endif -#if defined(WIN32) && !defined(FL_DLL) && !defined (__GNUC__) +#if defined(_WIN32) && !defined(FL_DLL) && !defined (__GNUC__) # include <windows.h> # include <stdio.h> @@ -85,7 +85,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, * * While we can detect if the program was run from the command-line - * look at the CMDLINE environment variable, it will be "WIN" for - * programs started from the GUI - the shell seems to run all WIN32 + * programs started from the GUI - the shell seems to run all Windows * applications in the background anyways... */ @@ -132,7 +132,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, #else /* STR# 2973: solves "empty translation unit" error (Sun, HP-UX..) */ typedef int dummy; -#endif /* WIN32 && !FL_DLL && !__GNUC__ */ +#endif /* _WIN32 && !FL_DLL && !__GNUC__ */ /* * End of "$Id$". diff --git a/src/fl_dnd_win32.cxx b/src/fl_dnd_win32.cxx index 0c625c1d0..f6d68676e 100644 --- a/src/fl_dnd_win32.cxx +++ b/src/fl_dnd_win32.cxx @@ -16,8 +16,8 @@ // http://www.fltk.org/str.php // -// This file contains win32-specific code for fltk which is always linked -// in. Search other files for "WIN32" or filenames ending in _win32.cxx +// This file contains Windows-specific code for FLTK which is always linked +// in. Search other files for "_WIN32" or filenames ending in _win32.cxx // for other system-specific code. #include <FL/Fl.H> diff --git a/src/fl_encoding_latin1.cxx b/src/fl_encoding_latin1.cxx index c7995aac7..10b899f92 100644 --- a/src/fl_encoding_latin1.cxx +++ b/src/fl_encoding_latin1.cxx @@ -1,7 +1,7 @@ // // "$Id$" // -// Convert MSWindows-1252 (Latin-1) encoded text to the local encoding. +// Convert Windows-1252 (Latin-1) encoded text to the local encoding. // // Copyright 1998-2016 by Bill Spitzak and others. // @@ -44,7 +44,7 @@ // lookup tables below will convert all common character codes and replace // unknown characters with an upsidedown question mark. -// This table converts MSWindows-1252/Latin 1 into MacRoman encoding +// This table converts Windows-1252/Latin 1 into MacRoman encoding static uchar latin2roman[128] = { 0xdb, 0xc0, 0xe2, 0xc4, 0xe3, 0xc9, 0xa0, 0xe0, 0xf6, 0xe4, 0xc0, 0xdc, 0xce, 0xc0, 0xc0, 0xc0, 0xc0, 0xd4, 0xd5, 0xd2, 0xd3, 0xa5, 0xd0, 0xd1, 0xf7, 0xaa, 0xc0, 0xdd, 0xcf, 0xc0, 0xc0, 0xd9, @@ -56,7 +56,7 @@ static uchar latin2roman[128] = { 0xc0, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xc0, 0xc0, 0xd8 }; -// This table converts MacRoman into MSWindows-1252/Latin 1 +// This table converts MacRoman into Windows-1252/Latin 1 static uchar roman2latin[128] = { 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1, 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8, 0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3, 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc, diff --git a/src/fl_encoding_mac_roman.cxx b/src/fl_encoding_mac_roman.cxx index d0217ba34..2036fb4dd 100644 --- a/src/fl_encoding_mac_roman.cxx +++ b/src/fl_encoding_mac_roman.cxx @@ -29,7 +29,7 @@ // On Mac OS X, nothing need to be converted. We simply return the // original pointer. // -// MSWindows and X11 render text in ISO or Latin-1 for western settings. The +// Windows and X11 render text in ISO or Latin-1 for western settings. The // lookup tables below will convert all common character codes and replace // unknown characters with an upsidedown question mark. @@ -49,7 +49,7 @@ const char *Fl_Darwin_System_Driver::local_to_mac_roman(const char *t, int) #endif -// This table converts MSWindows-1252/Latin 1 into MacRoman encoding +// This table converts Windows-1252/Latin 1 into MacRoman encoding static uchar latin2roman[128] = { 0xdb, 0xc0, 0xe2, 0xc4, 0xe3, 0xc9, 0xa0, 0xe0, 0xf6, 0xe4, 0xc0, 0xdc, 0xce, 0xc0, 0xc0, 0xc0, 0xc0, 0xd4, 0xd5, 0xd2, 0xd3, 0xa5, 0xd0, 0xd1, 0xf7, 0xaa, 0xc0, 0xdd, 0xcf, 0xc0, 0xc0, 0xd9, @@ -61,7 +61,7 @@ static uchar latin2roman[128] = { 0xc0, 0x96, 0x98, 0x97, 0x99, 0x9b, 0x9a, 0xd6, 0xbf, 0x9d, 0x9c, 0x9e, 0x9f, 0xc0, 0xc0, 0xd8 }; -// This table converts MacRoman into MSWindows-1252/Latin 1 +// This table converts MacRoman into Windows-1252/Latin 1 static uchar roman2latin[128] = { 0xc4, 0xc5, 0xc7, 0xc9, 0xd1, 0xd6, 0xdc, 0xe1, 0xe0, 0xe2, 0xe4, 0xe3, 0xe5, 0xe7, 0xe9, 0xe8, 0xea, 0xeb, 0xed, 0xec, 0xee, 0xef, 0xf1, 0xf3, 0xf2, 0xf4, 0xf6, 0xf5, 0xfa, 0xf9, 0xfb, 0xfc, diff --git a/src/fl_overlay.cxx b/src/fl_overlay.cxx index 8e095a962..a26af33ec 100644 --- a/src/fl_overlay.cxx +++ b/src/fl_overlay.cxx @@ -53,7 +53,7 @@ static void draw_current_rect() { XSetForeground(fl_display, gc, 0xffffffff); XDrawRectangle(fl_display, fl_window, gc, px, py, pw, ph); XSetFunction(fl_display, gc, GXcopy); -# elif defined(WIN32) +# elif defined(_WIN32) int old = SetROP2(fl_graphics_driver->gc(), R2_NOT); fl_rect(px, py, pw, ph); SetROP2(fl_graphics_driver->gc(), old); diff --git a/src/flstring.h b/src/flstring.h index 0d865738a..da242b3d4 100644 --- a/src/flstring.h +++ b/src/flstring.h @@ -3,7 +3,7 @@ * * Common string header file for the Fast Light Tool Kit (FLTK). * - * Copyright 1998-2017 by Bill Spitzak and others. + * Copyright 1998-2018 by Bill Spitzak and others. * * This library is free software. Distribution and use rights are outlined in * the file "COPYING" which should have been included with this file. If this @@ -49,10 +49,10 @@ # define strdup _strdup # endif /* _MSC_VER */ -# if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) +# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) # define strcasecmp(s,t) _stricmp((s), (t)) # define strncasecmp(s,t,n) _strnicmp((s), (t), (n)) -# endif /* WIN32 && ... */ +# endif /* _WIN32 && ... */ # ifdef __cplusplus extern "C" { diff --git a/src/forms_fselect.cxx b/src/forms_fselect.cxx index 2b89b3cd6..6b9f0d713 100644 --- a/src/forms_fselect.cxx +++ b/src/forms_fselect.cxx @@ -32,7 +32,7 @@ char* fl_show_file_selector(const char *message,const char *dir, if (fname && fname[0]) strlcpy(fl_filename,fname,sizeof(fl_filename)); char *p = fl_directory+strlen(fl_directory); if (p > fl_directory && *(p-1)!='/' -#ifdef WIN32 +#ifdef _WIN32 && *(p-1)!='\\' && *(p-1)!=':' #endif ) *p++ = '/'; diff --git a/src/forms_timer.cxx b/src/forms_timer.cxx index dbaacce5d..c8782c7c3 100644 --- a/src/forms_timer.cxx +++ b/src/forms_timer.cxx @@ -24,7 +24,7 @@ #include <FL/Fl_Timer.H> #include <FL/fl_draw.H> #include <FL/forms.H> -#ifdef WIN32 +#ifdef _WIN32 # ifdef __MWERKS__ # include <time.h> # else @@ -40,7 +40,7 @@ #define FL_TIMER_BLINKRATE 0.2 void fl_gettime(long* sec, long* usec) { -#ifdef WIN32 +#ifdef _WIN32 # ifdef __MWERKS__ time_t localTime = time(NULL); struct tm *now = localtime(&localTime); diff --git a/src/scandir_win32.c b/src/scandir_win32.c index c72581c23..cd14a92d7 100644 --- a/src/scandir_win32.c +++ b/src/scandir_win32.c @@ -1,9 +1,9 @@ /* * "$Id$" * - * WIN32 scandir function for the Fast Light Tool Kit (FLTK). + * Windows scandir function for the Fast Light Tool Kit (FLTK). * - * Copyright 1998-2010 by Bill Spitzak and others. + * Copyright 1998-2018 by Bill Spitzak and others. * * This library is free software. Distribution and use rights are outlined in * the file "COPYING" which should have been included with this file. If this @@ -17,7 +17,7 @@ */ #ifndef __CYGWIN__ -/* Emulation of posix scandir() call */ +/* Emulation of POSIX scandir() call */ #include <FL/platform_types.h> #include <FL/fl_utf8.h> #include "flstring.h" diff --git a/src/screen_xywh.cxx b/src/screen_xywh.cxx index 6c214b322..607f6df52 100644 --- a/src/screen_xywh.cxx +++ b/src/screen_xywh.cxx @@ -104,7 +104,7 @@ void Fl::screen_work_area(int &X, int &Y, int &W, int &H, int n) /** Gets the screen bounding rect for the given screen. - Under MSWindows, Mac OS X, and the Gnome desktop, screen #0 contains the menubar/taskbar + Under Windows, Mac OS X, and the Gnome desktop, screen #0 contains the menubar/taskbar \param[out] X,Y,W,H the corresponding screen bounding box \param[in] n the screen number (0 to Fl::screen_count() - 1) \see void screen_xywh(int &x, int &y, int &w, int &h, int mx, int my) diff --git a/src/xutf8/lcUniConv/cp936ext.h b/src/xutf8/lcUniConv/cp936ext.h index 64bd0fc97..e1a524d44 100644 --- a/src/xutf8/lcUniConv/cp936ext.h +++ b/src/xutf8/lcUniConv/cp936ext.h @@ -3,7 +3,7 @@ * * Character encoding support for the Fast Light Tool Kit (FLTK). * - * Copyright 1998-2016 by Bill Spitzak and others. + * Copyright 1998-2018 by Bill Spitzak and others. * * This library is free software. Distribution and use rights are outlined in * the file "COPYING" which should have been included with this file. If this @@ -16,7 +16,7 @@ * http://www.fltk.org/str.php */ -#if defined(WIN32) || defined(__APPLE__) /* PORTME: is this really needed? It's huge! */ +#if defined(_WIN32) || defined(__APPLE__) /* PORTME: is this really needed? It's huge! */ /* not needed */ @@ -6251,7 +6251,7 @@ cp936ext_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) #endif /* CP936 */ -#endif /* __APPLE__ WIN32 */ /* PORTME: Unicode stuff */ +#endif /* _WIN32 || __APPLE__ */ /* PORTME: Unicode stuff */ /* * End of "$Id$". diff --git a/test/blocks.cxx b/test/blocks.cxx index 691c54130..029133e5b 100644 --- a/test/blocks.cxx +++ b/test/blocks.cxx @@ -34,16 +34,16 @@ // Audio headers... #include <config.h> -#if defined(WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(__APPLE__) #elif defined(FL_PORTING) # pragma message "FL_PORTING: FLTK does not provide cross platform sound support" #else #endif -#ifndef WIN32 +#ifndef _WIN32 # include <unistd.h> # include <sys/time.h> // gettimeofday() -#endif // !WIN32 +#endif // !_WIN32 #ifdef HAVE_ALSA_ASOUNDLIB_H # define ALSA_PCM_NEW_HW_PARAMS_API @@ -52,9 +52,9 @@ #ifdef __APPLE__ # include <CoreAudio/AudioHardware.h> #endif // __APPLE__ -#ifdef WIN32 +#ifdef _WIN32 # include <mmsystem.h> -#endif // WIN32 +#endif // _WIN32 #define BLOCK_COLS 20 #define BLOCK_ROWS 10 @@ -175,7 +175,7 @@ class BlockSound { AudioBufferList *data_out, const AudioTimeStamp *time_out, void *client_data); -#elif defined(WIN32) +#elif defined(_WIN32) HWAVEOUT device; HGLOBAL header_handle; LPWAVEHDR header_ptr; @@ -243,7 +243,7 @@ BlockSound::BlockSound() { sample_size = (int)format.mSampleRate; -#elif defined(WIN32) +#elif defined(_WIN32) WAVEFORMATEX format; memset(&format, 0, sizeof(format)); @@ -340,7 +340,7 @@ BlockSound::~BlockSound() { # endif } -#elif defined(WIN32) +#elif defined(_WIN32) if (sample_size) { waveOutClose(device); @@ -405,20 +405,20 @@ void BlockSound::play_explosion(float duration) { if (duration <= 0.0) return; -#if defined(__APPLE__) || defined(WIN32) || defined(HAVE_ALSA_ASOUNDLIB_H) +#if defined(__APPLE__) || defined(_WIN32) || defined(HAVE_ALSA_ASOUNDLIB_H) if (duration > 1.0) duration = 1.0; int samples = (int)(duration * sample_size); short *sample_ptr = sample_data + 2 * (sample_size - samples); -#endif // __APPLE__ || WIN32 || HAVE_ALSA_ASOUNDLIB_H +#endif // __APPLE__ || _WIN32 || HAVE_ALSA_ASOUNDLIB_H #ifdef __APPLE__ // Point to the next note... data = sample_ptr; remaining = samples * 2; -#elif defined(WIN32) +#elif defined(_WIN32) if (sample_size) { memcpy(data_ptr, sample_ptr, samples * 4); @@ -899,19 +899,19 @@ void BlockWindow::timeout_cb(BlockWindow *bw) { static int ntime = 0; static int level = 0; -#if !defined(WIN32) +#if !defined(_WIN32) { struct timeval atime; gettimeofday(&atime, NULL); curtime = atime.tv_sec % 60 + 0.000001 * atime.tv_usec; } -#else // (WIN32) +#else // (_WIN32) { SYSTEMTIME atime; GetLocalTime(&atime); curtime = atime.wSecond + 0.001 * atime.wMilliseconds; } -#endif // (WIN32) +#endif // (_WIN32) // platform independent part of timer debugging code if (bw->interval_ > 0) { // game is active diff --git a/test/color_chooser.cxx b/test/color_chooser.cxx index 887962961..cc60a363b 100644 --- a/test/color_chooser.cxx +++ b/test/color_chooser.cxx @@ -28,7 +28,7 @@ #include <stdlib.h> #include <stdio.h> -#if !defined(WIN32) && !defined(__APPLE__) && !defined(FL_PORTING) +#if !defined(_WIN32) && !defined(__APPLE__) && !defined(FL_PORTING) #include "list_visuals.cxx" #endif @@ -114,7 +114,7 @@ int main(int argc, char ** argv) { " - : default visual\n" " r : call Fl::visual(FL_RGB)\n" " c : call Fl::own_colormap()\n",argv[0]); -#if !defined(WIN32) && !defined(__APPLE__) && !defined(FL_PORTING) +#if !defined(_WIN32) && !defined(__APPLE__) && !defined(FL_PORTING) printf(" # : use this visual with an empty colormap:\n"); list_visuals(); #endif @@ -127,7 +127,7 @@ int main(int argc, char ** argv) { } else if (argv[i][0] == 'c') { Fl::own_colormap(); } else if (argv[i][0] != '-') { -#if !defined(WIN32) && !defined(__APPLE__) && !defined(FL_PORTING) +#if !defined(_WIN32) && !defined(__APPLE__) && !defined(FL_PORTING) int visid = atoi(argv[i]); fl_open_display(); XVisualInfo templt; int num; @@ -138,7 +138,7 @@ int main(int argc, char ** argv) { fl_visual->visual, AllocNone); fl_xpixel(FL_BLACK); // make sure black is allocated #else - Fl::fatal("Visual id's not supported on MSWindows or MacOS."); + Fl::fatal("Visual id's not supported on Windows or MacOS."); #endif } } diff --git a/test/demo.cxx b/test/demo.cxx index 44646af92..e6497aa73 100644 --- a/test/demo.cxx +++ b/test/demo.cxx @@ -62,7 +62,7 @@ // #if ( defined _MSC_VER || defined __MWERKS__ ) && defined _DEBUG -#if defined(WIN32) && defined(__MWERKS__) && defined(_DEBUG) +#if defined(_WIN32) && defined(__MWERKS__) && defined(_DEBUG) # define DEBUG_EXE_WITH_D 1 #else # define DEBUG_EXE_WITH_D 0 @@ -241,7 +241,7 @@ void dobut(Fl_Widget *, long arg) { push_menu(menus[men].icommand[bn]); } else { -#ifdef WIN32 +#ifdef _WIN32 STARTUPINFO suInfo; // Process startup information PROCESS_INFORMATION prInfo; // Process information @@ -260,7 +260,7 @@ void dobut(Fl_Widget *, long arg) { char* copy_of_icommand = new char[icommand_length+1]; strcpy(copy_of_icommand,menus[men].icommand[bn]); - // On WIN32 the .exe suffix needs to be appended to the command + // On Windows the .exe suffix needs to be appended to the command // whilst leaving any additional parameters unchanged - this // is required to handle the correct conversion of cases such as : // `../fluid/fluid valuators.fl' to '../fluid/fluid.exe valuators.fl'. @@ -346,7 +346,7 @@ void dobut(Fl_Widget *, long arg) { system(command); free(cmd); -#else // NON WIN32 systems. +#else // Non Windows systems. int icommand_length = strlen(menus[men].icommand[bn]); char* command = new char[icommand_length+5]; // 5 for extra './' and ' &\0' @@ -356,7 +356,7 @@ void dobut(Fl_Widget *, long arg) { delete[] command; -#endif // WIN32 +#endif // _WIN32 } } diff --git a/test/editor.cxx b/test/editor.cxx index 868d14c30..0978d36bd 100644 --- a/test/editor.cxx +++ b/test/editor.cxx @@ -676,7 +676,7 @@ void set_title(Fl_Window* w) { else { char *slash; slash = strrchr(filename, '/'); -#ifdef WIN32 +#ifdef _WIN32 if (slash == NULL) slash = strrchr(filename, '\\'); #endif if (slash != NULL) strcpy(title, slash + 1); diff --git a/test/fractals.cxx b/test/fractals.cxx index 1b20e25f9..435ede1b6 100644 --- a/test/fractals.cxx +++ b/test/fractals.cxx @@ -67,7 +67,7 @@ int main(int, char**) { #include "fracviewer.h" -#if defined(WIN32) +#if defined(_WIN32) # define drand48() (((float) rand())/((float) RAND_MAX)) # define srand48(x) (srand((x))) #elif defined __APPLE__ diff --git a/test/fracviewer.cxx b/test/fracviewer.cxx index 605731d21..e1467619b 100644 --- a/test/fracviewer.cxx +++ b/test/fracviewer.cxx @@ -23,9 +23,9 @@ # include <math.h> # include <sys/types.h> # include <time.h> -# if !defined(WIN32) +# if !defined(_WIN32) # include <sys/time.h> -# endif // !WIN32 +# endif // !_WIN32 # include "fracviewer.h" diff --git a/test/fullscreen.cxx b/test/fullscreen.cxx index 27fa4ed30..b16e1e992 100644 --- a/test/fullscreen.cxx +++ b/test/fullscreen.cxx @@ -171,7 +171,7 @@ void fullscreen_cb(Fl_Widget *o, void *p) { int d = ((Fl_Button *)o)->value(); if (d) { w->fullscreen(); -#ifndef WIN32 // update our border state in case border was turned off +#ifndef _WIN32 // update our border state in case border was turned off border_button->value(w->border()); #endif } else { diff --git a/test/image.cxx b/test/image.cxx index ff2f9ab1b..05369d639 100644 --- a/test/image.cxx +++ b/test/image.cxx @@ -73,7 +73,7 @@ void button_cb(Fl_Widget *,void *) { } #include <FL/platform.H> -#if !defined(WIN32) && !defined(__APPLE__) +#if !defined(_WIN32) && !defined(__APPLE__) #include "list_visuals.cxx" #endif diff --git a/test/list_visuals.cxx b/test/list_visuals.cxx index dca7de222..a4516afcf 100644 --- a/test/list_visuals.cxx +++ b/test/list_visuals.cxx @@ -24,7 +24,7 @@ // http://www.fltk.org/str.php // -#if defined(WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(__APPLE__) #include <FL/Fl.H> #include <FL/fl_message.H> diff --git a/test/native-filechooser.cxx b/test/native-filechooser.cxx index 834ac3d44..6730ab65e 100644 --- a/test/native-filechooser.cxx +++ b/test/native-filechooser.cxx @@ -88,7 +88,7 @@ int main(int argc, char **argv) { //// no icons will be shown. However, this means you do not need to link in the //// fltk_images library, potentially reducing the size of your executable. //// Loading the system icons is not required by the OSX or Windows native file choosers. -#if !defined(WIN32) && !defined(__APPLE__) +#if !defined(_WIN32) && !defined(__APPLE__) Fl_File_Icon::load_system_icons(); #endif diff --git a/test/sudoku.cxx b/test/sudoku.cxx index 218e81b35..14255daab 100644 --- a/test/sudoku.cxx +++ b/test/sudoku.cxx @@ -33,20 +33,20 @@ #include <time.h> #include <FL/math.h> -#ifdef WIN32 +#ifdef _WIN32 # include "sudokurc.h" #elif !defined(__APPLE__) # include "pixmaps/sudoku.xbm" -#endif // WIN32 +#endif // _WIN32 // Audio headers... #include <config.h> -#ifndef WIN32 +#ifndef _WIN32 # include <unistd.h> -#endif // !WIN32 +#endif // !_WIN32 -#if defined(WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(__APPLE__) #elif defined(FL_PORTING) # pragma message "FL_PORTING: FLTK does not provide cross platform sound support" #else @@ -59,9 +59,9 @@ #ifdef __APPLE__ # include <CoreAudio/AudioHardware.h> #endif // __APPLE__ -#ifdef WIN32 +#ifdef _WIN32 # include <mmsystem.h> -#endif // WIN32 +#endif // _WIN32 // @@ -113,7 +113,7 @@ class SudokuSound { AudioBufferList *data_out, const AudioTimeStamp *time_out, void *client_data); -#elif defined(WIN32) +#elif defined(_WIN32) HWAVEOUT device; HGLOBAL header_handle; LPWAVEHDR header_ptr; @@ -259,7 +259,7 @@ SudokuSound::SudokuSound() { sample_size = (int)format.mSampleRate / 20; -#elif defined(WIN32) +#elif defined(_WIN32) WAVEFORMATEX format; memset(&format, 0, sizeof(format)); @@ -364,7 +364,7 @@ SudokuSound::~SudokuSound() { # endif } -#elif defined(WIN32) +#elif defined(_WIN32) if (sample_size) { waveOutClose(device); @@ -438,7 +438,7 @@ void SudokuSound::play(char note) { // Wait for the sound to complete... usleep(NOTE_DURATION*1000); -#elif defined(WIN32) +#elif defined(_WIN32) if (sample_size) { memcpy(data_ptr, sample_data[note - 'A'], sample_size * 4); @@ -711,14 +711,14 @@ Sudoku::Sudoku() } // Set icon for window (MacOS uses app bundle for icon...) -#ifdef WIN32 +#ifdef _WIN32 icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON))); #elif !defined(__APPLE__) fl_open_display(); icon((char *)XCreateBitmapFromData(fl_display, DefaultRootWindow(fl_display), (char *)sudoku_bits, sudoku_width, sudoku_height)); -#endif // WIN32 +#endif // _WIN32 // Catch window close events... callback(close_cb); diff --git a/test/table.cxx b/test/table.cxx index 2890895f8..5c4ab3e69 100644 --- a/test/table.cxx +++ b/test/table.cxx @@ -4,9 +4,9 @@ #include <stdio.h> #include <string.h> -#ifdef WIN32 +#ifdef _WIN32 #include <stdlib.h> // atoi -#endif /*WIN32*/ +#endif /* _WIN32 */ #include <FL/Fl.H> #include <FL/Fl_Window.H> diff --git a/test/threads.cxx b/test/threads.cxx index 522aa0a9f..2fe40eb54 100644 --- a/test/threads.cxx +++ b/test/threads.cxx @@ -3,7 +3,7 @@ // // Threading example program for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2016 by Bill Spitzak and others. +// Copyright 1998-2018 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -18,7 +18,7 @@ #include <config.h> -#if defined(HAVE_PTHREAD) || defined(WIN32) +#if defined(HAVE_PTHREAD) || defined(_WIN32) # include <FL/Fl.H> # include <FL/Fl_Double_Window.H> # include <FL/Fl_Browser.H> @@ -156,7 +156,7 @@ int main(int argc, char **argv) int main() { fl_alert("Sorry, threading not supported on this platform!"); } -#endif // HAVE_PTHREAD || WIN32 +#endif // HAVE_PTHREAD || _WIN32 // diff --git a/test/threads.h b/test/threads.h index d81f1e6a6..d90d6e422 100644 --- a/test/threads.h +++ b/test/threads.h @@ -48,7 +48,7 @@ static int fl_create_thread(Fl_Thread& t, Fl_Thread_Func* f, void* p) { return pthread_create((pthread_t*)&t, 0, f, p); } -# elif defined(WIN32) && !defined(__WATCOMC__) // Use Windows threading... +# elif defined(_WIN32) && !defined(__WATCOMC__) // Use Windows threading... # include <windows.h> # include <process.h> diff --git a/test/tiled_image.cxx b/test/tiled_image.cxx index 7d702c28f..f858583df 100644 --- a/test/tiled_image.cxx +++ b/test/tiled_image.cxx @@ -35,7 +35,7 @@ void button_cb(Fl_Widget *,void *) { } #include <FL/platform.H> -#if !defined(WIN32) && !defined(__APPLE__) +#if !defined(_WIN32) && !defined(__APPLE__) #include "list_visuals.cxx" #endif @@ -51,7 +51,7 @@ int arg(int argc, char **argv, int &i) { } int main(int argc, char **argv) { -#if !defined(WIN32) && !defined(__APPLE__) +#if !defined(_WIN32) && !defined(__APPLE__) int i = 1; Fl::args(argc,argv,i,arg); diff --git a/test/utf8.cxx b/test/utf8.cxx index b2c40fcb9..5dd9f57df 100644 --- a/test/utf8.cxx +++ b/test/utf8.cxx @@ -419,7 +419,7 @@ int make_font_chooser(void) // Load the systems available fonts - ask for everything // font_count = Fl::set_fonts("*"); -#ifdef WIN32 +#ifdef _WIN32 font_count = Fl::set_fonts("*"); #elif defined(__APPLE__) font_count = Fl::set_fonts("*"); @@ -580,7 +580,7 @@ int main(int argc, char** argv) /* setup the extra font */ Fl::set_font(extra_font, -#ifdef WIN32 +#ifdef _WIN32 " Arial Unicode MS" #elif defined(__APPLE__) "Monaco" |
