]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/msw/private.h
Getting various compilers to work with wxWin again
[wxWidgets.git] / include / wx / msw / private.h
index 39292f3c980a3aacc77e2e009ea36496b7bf1d4d..7e46709d654b86166f326791c23848a4f548bd52 100644 (file)
 
 #include <windows.h>
 
+// undefine conflicting symbols which were defined in windows.h
+#include "wx/msw/winundef.h"
+
 class WXDLLEXPORT wxFont;
 
+// ---------------------------------------------------------------------------
+// private constants
+// ---------------------------------------------------------------------------
+
+// Conversion
+static const double METRIC_CONVERSION_CONSTANT = 0.0393700787;
+
+// Scaling factors for various unit conversions
+static const double mm2inches = (METRIC_CONVERSION_CONSTANT);
+static const double inches2mm = (1/METRIC_CONVERSION_CONSTANT);
+
+static const double mm2twips = (METRIC_CONVERSION_CONSTANT*1440);
+static const double twips2mm = (1/(METRIC_CONVERSION_CONSTANT*1440));
+
+static const double mm2pt = (METRIC_CONVERSION_CONSTANT*72);
+static const double pt2mm = (1/(METRIC_CONVERSION_CONSTANT*72));
+
 // ---------------------------------------------------------------------------
 // standard icons from the resources
 // ---------------------------------------------------------------------------
@@ -34,7 +54,8 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
 // this defines a CASTWNDPROC macro which casts a pointer to the type of a
 // window proc
 // ---------------------------------------------------------------------------
-#ifdef __GNUWIN32__
+
+#if defined(__GNUWIN32__) && !defined(__MINGW32__)
 #  define CASTWNDPROC (long unsigned)
 #else
 #  ifdef __BORLANDC__
@@ -178,7 +199,9 @@ extern LONG APIENTRY _EXPORT
 #endif // USE_DBWIN32
 
 // ---------------------------------------------------------------------------
-// macros to make casting between WXFOO and FOO a bit easier
+// macros to make casting between WXFOO and FOO a bit easier: the GetFoo()
+// returns Foo cast to the Windows type for oruselves, while GetFoosFoo() takes
+// an argument which should be a pointer to wxFoo (is this really clear?)
 // ---------------------------------------------------------------------------
 
 #define GetHwnd()               ((HWND)GetHWND())
@@ -186,8 +209,11 @@ extern LONG APIENTRY _EXPORT
 
 #define GetHdc()                ((HDC)GetHDC())
 
+#define GetHicon()              ((HICON)GetHICON())
+#define GetIconHicon(icon)      ((HICON)(icon).GetHICON())
+
 #define GetHaccel()             ((HACCEL)GetHACCEL())
-#define GetTableHaccel(table)   ((HACCEL)((table)->GetHACCEL()))
+#define GetTableHaccel(table)   ((HACCEL)((table).GetHACCEL()))
 
 // ---------------------------------------------------------------------------
 // global data
@@ -226,8 +252,9 @@ WXDLLEXPORT extern wxString wxGetWindowText(WXHWND hWnd);
 // get the window class name
 WXDLLEXPORT extern wxString wxGetWindowClass(WXHWND hWnd);
 
-// get the window id
-WXDLLEXPORT extern wxWindowID wxGetWindowId(WXHWND hWnd);
+// get the window id (should be unsigned, hence this is not wxWindowID which
+// is, for mainly historical reasons, signed)
+WXDLLEXPORT extern WXWORD wxGetWindowId(WXHWND hWnd);
 
 // Does this window style specify any border?
 inline bool wxStyleHasBorder(long style)