]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/defs.h
Add wxImage::CanRead, wasn't in 1.59 ?
[wxWidgets.git] / include / wx / defs.h
index 4d44264966fe9449cd999d859eee237f0d856ee3..456b71b9510667ed13adea1102c17a3570d3ec3d 100644 (file)
         #endif
     #endif // Sun
 
         #endif
     #endif // Sun
 
-    #if defined(__hpux) && !defined(__HPUX__)
-        #define __HPUX__
-    #endif // HP-UX
-
 #elif defined(applec) || defined(THINK_C) || ( defined( __MWERKS__ ) && !defined(__INTEL__) )
         // MacOS
 #elif defined(__OS2__)
 #elif defined(applec) || defined(THINK_C) || ( defined( __MWERKS__ ) && !defined(__INTEL__) )
         // MacOS
 #elif defined(__OS2__)
 #   pragma suppress 571             // Virtual function hiding
 #endif // __SALFORDC__
 
 #   pragma suppress 571             // Virtual function hiding
 #endif // __SALFORDC__
 
-#ifdef __VISUALC__
-#ifndef WIN32
-// VC1.5 does not have LPTSTR type
-#define LPTSTR LPSTR
-#define LPCTSTR LPCSTR
-#endif
-#endif
+#if defined(__VISUALC__) && !defined(WIN32)
+    // VC1.5 does not have LPTSTR type
+    #define LPTSTR LPSTR
+    #define LPCTSTR LPCSTR
+#endif // VC++ 1.5
 
 // Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files,
 // so define it ourselves
 
 // Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files,
 // so define it ourselves
 // Make sure the environment is set correctly
 #if defined(__WXMSW__) && defined(__X__)
     #error "Target can't be both X and Windows"
 // Make sure the environment is set correctly
 #if defined(__WXMSW__) && defined(__X__)
     #error "Target can't be both X and Windows"
-#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXPM__) && \
-      !defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__)
+#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
+      !defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \
+      !defined(__WXQT__) && !defined(__WXSTUBS__) && wxUSE_GUI
     #error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXPM__|__WXSTUBS__]"
 #endif
 
     #error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXPM__|__WXSTUBS__]"
 #endif
 
 #undef PACKAGE
 #undef VERSION
 
 #undef PACKAGE
 #undef VERSION
 
+// this has to be done after including setup.h which might
+// define __HPUX__ 1 itself
+#if defined(__hpux) && !defined(__HPUX__)
+    #define __HPUX__
+#endif // HP-UX
+
 // if we're on a Unixsystem but didn't use configure (so that setup.h didn't
 // define __UNIX__), do define __UNIX__ now
 #if !defined(__UNIX__) && defined(__UNIX_LIKE__)
 // if we're on a Unixsystem but didn't use configure (so that setup.h didn't
 // define __UNIX__), do define __UNIX__ now
 #if !defined(__UNIX__) && defined(__UNIX_LIKE__)
 
 #include "wx/version.h"
 
 
 #include "wx/version.h"
 
+// ----------------------------------------------------------------------------
+// compatibility defines
+// ----------------------------------------------------------------------------
+
+// possibility to build non GUI apps is new, so don't burden ourselves with
+// compatibility code
+#if !wxUSE_GUI
+    #undef WXWIN_COMPATIBILITY_2
+    #define WXWIN_COMPATIBILITY_2 0
+#endif // !GUI
+
 // ============================================================================
 // non portable C++ features
 // ============================================================================
 // ============================================================================
 // non portable C++ features
 // ============================================================================
 // check for native bool type and TRUE/FALSE constants
 // ----------------------------------------------------------------------------
 
 // check for native bool type and TRUE/FALSE constants
 // ----------------------------------------------------------------------------
 
-#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXPM__) || defined(__WXSTUBS__)
-    // Bool is now obsolete, use bool instead
-    // typedef int Bool;
+// define boolean constants if not done yet
+#ifndef TRUE
+    #define TRUE  1
+#endif
 
 
-    #ifndef TRUE
-        #define TRUE  1
-        #define FALSE 0
-        #define Bool_DEFINED
-    #endif
-#elif defined(__WXMSW__)
-    #ifndef TRUE
-        #define TRUE  1
-        #define FALSE 0
-    #endif
-#endif // TRUE/FALSE
+#ifndef FALSE
+    #define FALSE 0
+#endif
 
 // Add more tests here for Windows compilers that already define bool
 // (under Unix, configure tests for this)
 
 // Add more tests here for Windows compilers that already define bool
 // (under Unix, configure tests for this)
@@ -304,7 +309,7 @@ typedef int wxWindowID;
 // wxCALLBACK should be used for the functions which are called back by
 // Windows (such as compare function for wxListCtrl)
 #if defined(__WXMSW__)
 // wxCALLBACK should be used for the functions which are called back by
 // Windows (such as compare function for wxListCtrl)
 #if defined(__WXMSW__)
-    #if defined(__MINGW32__)
+    #if defined(__MINGW32__) || defined(__GNUWIN32__)
         #define wxCALLBACK __attribute__((stdcall))
     #else
         // both VC++ and Borland understand this
         #define wxCALLBACK __attribute__((stdcall))
     #else
         // both VC++ and Borland understand this
@@ -870,11 +875,11 @@ enum wxStretch
 /*
  * wxGauge flags
  */
 /*
  * wxGauge flags
  */
-#define wxGA_PROGRESSBAR     0x0004
 #define wxGA_HORIZONTAL      wxHORIZONTAL
 #define wxGA_VERTICAL        wxVERTICAL
 #define wxGA_HORIZONTAL      wxHORIZONTAL
 #define wxGA_VERTICAL        wxVERTICAL
+#define wxGA_PROGRESSBAR     0x0010
 // Windows only
 // Windows only
-#define wxGA_SMOOTH          0x0010
+#define wxGA_SMOOTH          0x0020
 
 /*
  * wxSlider flags
 
 /*
  * wxSlider flags
@@ -1512,6 +1517,8 @@ typedef long            WXLPARAM;
 #  define WXLPARAM      MPARAM
 #  define RECT          RECTL
 #  define LOGFONT       FATTRS
 #  define WXLPARAM      MPARAM
 #  define RECT          RECTL
 #  define LOGFONT       FATTRS
+#  define LOWORD        SHORT1FROMMP
+#  define HIWORD        SHORT2FROMMP
 #endif
 typedef unsigned long   WXCOLORREF;
 typedef void *          WXRGNDATA;
 #endif
 typedef unsigned long   WXCOLORREF;
 typedef void *          WXRGNDATA;