X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a23fd0e1d1329a4a258b4defb3e0b0001b700c6e..25889d3c43f537fea00a2b7d6df7bd7e63e113f8:/include/wx/msw/private.h diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 39292f3c98..7e46709d65 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -16,8 +16,28 @@ #include +// 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)