This change prepares the way for using wxGTK under Windows as this would
still define __WINDOWS__ but use __WXGTK__ instead of __WXMSW__.
Closes #14064.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70796
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
55 files changed:
@section page_cppconst_guisystem GUI system
@beginDefList
@section page_cppconst_guisystem GUI system
@beginDefList
-@itemdef{__WINDOWS__, any Windows, you may also use __WXMSW__}
-@itemdef{__WIN16__, Win16 API (not supported since wxWidgets 2.6)}
-@itemdef{__WIN32__, Win32 API}
-@itemdef{__WIN64__, Win64 (mostly same as Win32 but data type sizes are different)}
@itemdef{__WXBASE__, Only wxBase, no GUI features (same as @c wxUSE_GUI == 0)}
@itemdef{__WXCOCOA__, OS X using wxCocoa Port}
@itemdef{__WXDFB__, wxUniversal using DirectFB}
@itemdef{__WXBASE__, Only wxBase, no GUI features (same as @c wxUSE_GUI == 0)}
@itemdef{__WXCOCOA__, OS X using wxCocoa Port}
@itemdef{__WXDFB__, wxUniversal using DirectFB}
@itemdef{__WXMAC__, old define for Mac OS X}
@itemdef{__WXMOTIF__, Motif}
@itemdef{__WXMOTIF20__, Motif 2.0 or higher}
@itemdef{__WXMAC__, old define for Mac OS X}
@itemdef{__WXMOTIF__, Motif}
@itemdef{__WXMOTIF20__, Motif 2.0 or higher}
-@itemdef{__WXMSW__, Any Windows}
+@itemdef{__WXMSW__, GUI using <a href="http://en.wikipedia.org/wiki/Windows_User">Windows Controls</a>}
@itemdef{__WXOSX__, any OS X}
@itemdef{__WXOSX_IPHONE__, OS X iPhone}
@itemdef{__WXOSX_CARBON__, Mac OS X using Carbon}
@itemdef{__WXOSX__, any OS X}
@itemdef{__WXOSX_IPHONE__, OS X iPhone}
@itemdef{__WXOSX_CARBON__, Mac OS X using Carbon}
@itemdef{__UNIX__, any Unix}
@itemdef{__UNIX_LIKE__, Unix, BeOS or VMS}
@itemdef{__VMS__, VMS}
@itemdef{__UNIX__, any Unix}
@itemdef{__UNIX_LIKE__, Unix, BeOS or VMS}
@itemdef{__VMS__, VMS}
-@itemdef{__WINDOWS__, any Windows}
+@itemdef{__WINDOWS__, Any Windows platform, using any port (see also @c __WXMSW__)}
+@itemdef{__WIN16__, Win16 API (not supported since wxWidgets 2.6)}
+@itemdef{__WIN32__, Win32 API}
+@itemdef{__WIN64__, Win64 (mostly same as Win32 but data type sizes are different)}
@itemdef{__WINE__, Wine}
@itemdef{_WIN32_WCE, Windows CE version}
@endDefList
@itemdef{__WINE__, Wine}
@itemdef{_WIN32_WCE, Windows CE version}
@endDefList
class WXDLLIMPEXP_FWD_BASE wxDateTime;
class WXDLLIMPEXP_FWD_BASE wxTimeSpan;
class WXDLLIMPEXP_FWD_BASE wxDateSpan;
class WXDLLIMPEXP_FWD_BASE wxDateTime;
class WXDLLIMPEXP_FWD_BASE wxTimeSpan;
class WXDLLIMPEXP_FWD_BASE wxDateSpan;
struct _SYSTEMTIME;
#endif
struct _SYSTEMTIME;
#endif
wxDateTime_t minute = 0,
wxDateTime_t second = 0,
wxDateTime_t millisec = 0);
wxDateTime_t minute = 0,
wxDateTime_t second = 0,
wxDateTime_t millisec = 0);
wxDateTime(const struct _SYSTEMTIME& st)
{
SetFromMSWSysTime(st);
wxDateTime(const struct _SYSTEMTIME& st)
{
SetFromMSWSysTime(st);
// SYSTEMTIME format
// ------------------------------------------------------------------------
// SYSTEMTIME format
// ------------------------------------------------------------------------
// convert SYSTEMTIME to wxDateTime
wxDateTime& SetFromMSWSysTime(const struct _SYSTEMTIME& st);
// convert SYSTEMTIME to wxDateTime
wxDateTime& SetFromMSWSysTime(const struct _SYSTEMTIME& st);
// same as above but only take date part into account, time is always zero
wxDateTime& SetFromMSWSysDate(const struct _SYSTEMTIME& st);
void GetAsMSWSysDate(struct _SYSTEMTIME* st) const;
// same as above but only take date part into account, time is always zero
wxDateTime& SetFromMSWSysDate(const struct _SYSTEMTIME& st);
void GetAsMSWSysDate(struct _SYSTEMTIME* st) const;
// comparison (see also functions below for operator versions)
// ------------------------------------------------------------------------
// comparison (see also functions below for operator versions)
// ------------------------------------------------------------------------
#define wxDL_INIT_FUNC(pfx, name, dynlib) \
pfx ## name = (name ## _t)(dynlib).RawGetSymbol(#name)
#define wxDL_INIT_FUNC(pfx, name, dynlib) \
pfx ## name = (name ## _t)(dynlib).RawGetSymbol(#name)
// same as wxDL_INIT_FUNC() but appends 'A' or 'W' to the function name, see
// wxDynamicLibrary::GetSymbolAorW()
#define wxDL_INIT_FUNC_AW(pfx, name, dynlib) \
pfx ## name = (name ## _t)(dynlib).GetSymbolAorW(#name)
// same as wxDL_INIT_FUNC() but appends 'A' or 'W' to the function name, see
// wxDynamicLibrary::GetSymbolAorW()
#define wxDL_INIT_FUNC_AW(pfx, name, dynlib) \
pfx ## name = (name ## _t)(dynlib).GetSymbolAorW(#name)
// the following macros can be used to redirect a whole library to a class and
// check at run-time if the library is present and contains all required
// the following macros can be used to redirect a whole library to a class and
// check at run-time if the library is present and contains all required
// this function is useful for loading functions from the standard Windows
// DLLs: such functions have an 'A' (in ANSI build) or 'W' (in Unicode, or
// wide character build) suffix if they take string parameters
// this function is useful for loading functions from the standard Windows
// DLLs: such functions have an 'A' (in ANSI build) or 'W' (in Unicode, or
// wide character build) suffix if they take string parameters
{
return RawGetSymbolAorW(m_handle, name);
}
{
return RawGetSymbolAorW(m_handle, name);
}
// return all modules/shared libraries in the address space of this process
//
// return all modules/shared libraries in the address space of this process
//
static wxString GetPluginsDirectory();
static wxString GetPluginsDirectory();
// return the handle (HMODULE/HINSTANCE) of the DLL with the given name
// and/or containing the specified address: for XP and later systems only
// the address is used and the name is ignored but for the previous systems
// return the handle (HMODULE/HINSTANCE) of the DLL with the given name
// and/or containing the specified address: for XP and later systems only
// the address is used and the name is ignored but for the previous systems
// need to be freed using FreeLibrary() but it also means that it can
// become invalid if the DLL is unloaded
static WXHMODULE MSWGetModuleHandle(const char *name, void *addr);
// need to be freed using FreeLibrary() but it also means that it can
// become invalid if the DLL is unloaded
static WXHMODULE MSWGetModuleHandle(const char *name, void *addr);
protected:
// common part of GetSymbol() and HasSymbol()
protected:
// common part of GetSymbol() and HasSymbol()
wxDECLARE_NO_COPY_CLASS(wxDynamicLibrary);
};
wxDECLARE_NO_COPY_CLASS(wxDynamicLibrary);
};
// ----------------------------------------------------------------------------
// wxLoadedDLL is a MSW-only internal helper class allowing to dynamically bind
// ----------------------------------------------------------------------------
// wxLoadedDLL is a MSW-only internal helper class allowing to dynamically bind
// ----------------------------------------------------------------------------
// Interesting defines
// ----------------------------------------------------------------------------
// Interesting defines
#define wxCRT_RmDir _wrmdir
#define wxCRT_Stat _wstat
#define wxStructStat struct _stat
#define wxCRT_RmDir _wrmdir
#define wxCRT_Stat _wstat
#define wxStructStat struct _stat
-#elif (defined(__WXMSW__) || defined(__OS2__)) && \
+#elif (defined(__WINDOWS__) || defined(__OS2__)) && \
( \
defined(__VISUALC__) || \
defined(__MINGW64__) || \
( \
defined(__VISUALC__) || \
defined(__MINGW64__) || \
// this symbol is defined for the platforms where file systems use volumes in
// paths
// this symbol is defined for the platforms where file systems use volumes in
// paths
-#if defined(__WXMSW__) || defined(__DOS__) || defined(__OS2__)
+#if defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__)
#define wxHAS_FILESYSTEM_VOLUMES
#endif
#define wxHAS_FILESYSTEM_VOLUMES
#endif
#elif defined(wxHAS_KQUEUE)
#include "wx/unix/fswatcher_kqueue.h"
#define wxFileSystemWatcher wxKqueueFileSystemWatcher
#elif defined(wxHAS_KQUEUE)
#include "wx/unix/fswatcher_kqueue.h"
#define wxFileSystemWatcher wxKqueueFileSystemWatcher
-#elif defined(__WXMSW__)
+#elif defined(__WINDOWS__)
#include "wx/msw/fswatcher.h"
#define wxFileSystemWatcher wxMSWFileSystemWatcher
#else
#include "wx/msw/fswatcher.h"
#define wxFileSystemWatcher wxMSWFileSystemWatcher
#else
{
int Language; // wxLanguage id
wxString CanonicalName; // Canonical name, e.g. fr_FR
{
int Language; // wxLanguage id
wxString CanonicalName; // Canonical name, e.g. fr_FR
wxUint32 WinLang, // Win32 language identifiers
WinSublang;
wxUint32 WinLang, // Win32 language identifiers
WinSublang;
wxString Description; // human-readable name of the language
wxLayoutDirection LayoutDirection;
wxString Description; // human-readable name of the language
wxLayoutDirection LayoutDirection;
// return the LCID corresponding to this language
wxUint32 GetLCID() const;
// return the LCID corresponding to this language
wxUint32 GetLCID() const;
// return the locale name corresponding to this language usable with
// setlocale() on the current system
// return the locale name corresponding to this language usable with
// setlocale() on the current system
// for Unix systems GetLocaleName() is trivial so implement it inline here, for
// MSW it's implemented in intl.cpp
// for Unix systems GetLocaleName() is trivial so implement it inline here, for
// MSW it's implemented in intl.cpp
inline wxString wxLanguageInfo::GetLocaleName() const { return CanonicalName; }
inline wxString wxLanguageInfo::GetLocaleName() const { return CanonicalName; }
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
# include <iosfwd>
#endif
# include <iosfwd>
#endif
# include "wx/msw/winundef.h"
#endif
# include "wx/msw/winundef.h"
#endif
# include "wx/msw/winundef.h"
#endif
# include "wx/msw/winundef.h"
#endif
// 0, or if the platform is not Windows, use TCP/IP for IPC implementation
#if !defined(wxUSE_DDE_FOR_IPC)
// 0, or if the platform is not Windows, use TCP/IP for IPC implementation
#if !defined(wxUSE_DDE_FOR_IPC)
#define wxUSE_DDE_FOR_IPC 1
#else
#define wxUSE_DDE_FOR_IPC 0
#define wxUSE_DDE_FOR_IPC 1
#else
#define wxUSE_DDE_FOR_IPC 0
#define wxTraceResAlloc 0x0004 // trace GDI resource allocation
#define wxTraceRefCount 0x0008 // trace various ref counting operations
#define wxTraceResAlloc 0x0004 // trace GDI resource allocation
#define wxTraceRefCount 0x0008 // trace various ref counting operations
#define wxTraceOleCalls 0x0100 // OLE interface calls
#endif
#define wxTraceOleCalls 0x0100 // OLE interface calls
#endif
#define wxTRACE_ResAlloc wxT("resalloc") // trace GDI resource allocation
#define wxTRACE_RefCount wxT("refcount") // trace various ref counting operations
#define wxTRACE_ResAlloc wxT("resalloc") // trace GDI resource allocation
#define wxTRACE_RefCount wxT("refcount") // trace various ref counting operations
#define wxTRACE_OleCalls wxT("ole") // OLE interface calls
#endif
#define wxTRACE_OleCalls wxT("ole") // OLE interface calls
#endif
-#if defined(__WXMSW__) && !defined(__WXWINCE__)
+#if defined(__WINDOWS__) && !defined(__WXWINCE__)
#define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c )
#else
#define wxMulDivInt32( a , b , c ) (wxRound((a)*(((wxDouble)b)/((wxDouble)c))))
#define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c )
#else
#define wxMulDivInt32( a , b , c ) (wxRound((a)*(((wxDouble)b)/((wxDouble)c))))
// devik 2000-8-29: All new/delete ops are now inline because they can't
// be marked as dllexport/dllimport. It then leads to weird bugs when
// used on MSW as DLL
// devik 2000-8-29: All new/delete ops are now inline because they can't
// be marked as dllexport/dllimport. It then leads to weird bugs when
// used on MSW as DLL
-#if defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))
+#if defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))
inline void * operator new (size_t size, wxChar * fileName, int lineNum)
{
return wxDebugAlloc(size, fileName, lineNum, false, false);
inline void * operator new (size_t size, wxChar * fileName, int lineNum)
{
return wxDebugAlloc(size, fileName, lineNum, false, false);
void operator delete[] (void * buf);
#endif // wxUSE_ARRAY_MEMORY_OPERATORS
void operator delete[] (void * buf);
#endif // wxUSE_ARRAY_MEMORY_OPERATORS
-#endif // defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))
+#endif // defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))
// VC++ 6.0 and MWERKS
#if ( defined(__VISUALC__) && (__VISUALC__ >= 1200) ) || defined(__MWERKS__)
// VC++ 6.0 and MWERKS
#if ( defined(__VISUALC__) && (__VISUALC__ >= 1200) ) || defined(__MWERKS__)
// compiling in the code for handling them which is never going to be invoked
// under the other platforms, we define wxHAS_POWER_EVENTS symbol if this event
// is available, it should be used to guard all code using wxPowerEvent
// compiling in the code for handling them which is never going to be invoked
// under the other platforms, we define wxHAS_POWER_EVENTS symbol if this event
// is available, it should be used to guard all code using wxPowerEvent
#define wxHAS_POWER_EVENTS
#define wxHAS_POWER_EVENTS
#define wxFSWatchEntry wxFSWatchEntryKq
WX_DECLARE_STRING_HASH_MAP(wxSharedPtr<wxFSWatchEntry>,wxFSWatchEntries);
#include "wx/unix/private/fswatcher_kqueue.h"
#define wxFSWatchEntry wxFSWatchEntryKq
WX_DECLARE_STRING_HASH_MAP(wxSharedPtr<wxFSWatchEntry>,wxFSWatchEntries);
#include "wx/unix/private/fswatcher_kqueue.h"
-#elif defined(__WXMSW__)
+#elif defined(__WINDOWS__)
class wxFSWatchEntryMSW;
#define wxFSWatchEntry wxFSWatchEntryMSW
WX_DECLARE_STRING_HASH_MAP(wxSharedPtr<wxFSWatchEntry>,wxFSWatchEntries);
class wxFSWatchEntryMSW;
#define wxFSWatchEntry wxFSWatchEntryMSW
WX_DECLARE_STRING_HASH_MAP(wxSharedPtr<wxFSWatchEntry>,wxFSWatchEntries);
#ifndef _WX_PRIVATE_SOCKADDR_H_
#define _WX_PRIVATE_SOCKADDR_H_
#ifndef _WX_PRIVATE_SOCKADDR_H_
#define _WX_PRIVATE_SOCKADDR_H_
#include "wx/msw/wrapwin.h"
#if wxUSE_IPV6
#include "wx/msw/wrapwin.h"
#if wxUSE_IPV6
// include the header defining timeval: under Windows this struct is used only
// with sockets so we need to include winsock.h which we do via windows.h
// include the header defining timeval: under Windows this struct is used only
// with sockets so we need to include winsock.h which we do via windows.h
#include "wx/msw/wrapwin.h"
#else
#include <sys/time.h> // for timeval
#include "wx/msw/wrapwin.h"
#else
#include <sys/time.h> // for timeval
// define some symbols which winsock.h defines but traditional BSD headers
// don't
// define some symbols which winsock.h defines but traditional BSD headers
// don't
#define SOCKET int
#endif
#define SOCKET int
#endif
wxDECLARE_NO_COPY_CLASS(wxSocketImpl);
};
wxDECLARE_NO_COPY_CLASS(wxSocketImpl);
};
+#if defined(__WINDOWS__)
#include "wx/msw/private/sockmsw.h"
#else
#include "wx/unix/private/sockunix.h"
#include "wx/msw/private/sockmsw.h"
#else
#include "wx/unix/private/sockunix.h"
CHECK_PREC
m_szFlags[flagofs++] = char(ch);
break;
CHECK_PREC
m_szFlags[flagofs++] = char(ch);
break;
// under Windows we support the special '%I64' notation as longlong
// integer conversion specifier for MSVC compatibility
// (it behaves exactly as '%lli' or '%Li' or '%qi')
// under Windows we support the special '%I64' notation as longlong
// integer conversion specifier for MSVC compatibility
// (it behaves exactly as '%lli' or '%Li' or '%qi')
break;
}
// else: fall-through, 'I' is MSVC equivalent of C99 'z'
break;
}
// else: fall-through, 'I' is MSVC equivalent of C99 'z'
case wxT('z'):
case wxT('Z'):
case wxT('z'):
case wxT('Z'):
// wxSound class implementation
// ----------------------------------------------------------------------------
// wxSound class implementation
// ----------------------------------------------------------------------------
+#if defined(__WINDOWS__)
#include "wx/msw/sound.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/sound.h"
#include "wx/msw/sound.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/sound.h"
virtual void OnStackFrame(const wxStackFrame& frame) = 0;
};
virtual void OnStackFrame(const wxStackFrame& frame) = 0;
};
#include "wx/msw/stackwalk.h"
#elif defined(__UNIX__)
#include "wx/unix/stackwalk.h"
#include "wx/msw/stackwalk.h"
#elif defined(__UNIX__)
#include "wx/unix/stackwalk.h"
+ #if defined(__WINDOWS__)
#include "wx/msw/stdpaths.h"
#define wxHAS_NATIVE_STDPATHS
// We want CoreFoundation paths on both CarbonLib and Darwin (for all ports)
#include "wx/msw/stdpaths.h"
#define wxHAS_NATIVE_STDPATHS
// We want CoreFoundation paths on both CarbonLib and Darwin (for all ports)
// it would have to be re-tested and probably corrected
// CS: under OSX release builds the string destructor/cache cleanup sometimes
// crashes, disable until we find the true reason or a better workaround
// it would have to be re-tested and probably corrected
// CS: under OSX release builds the string destructor/cache cleanup sometimes
// crashes, disable until we find the true reason or a better workaround
-#if wxUSE_UNICODE_UTF8 && !defined(__WXMSW__) && !defined(__WXOSX__)
+#if wxUSE_UNICODE_UTF8 && !defined(__WINDOWS__) && !defined(__WXOSX__)
#define wxUSE_STRING_POS_CACHE 1
#else
#define wxUSE_STRING_POS_CACHE 0
#define wxUSE_STRING_POS_CACHE 1
#else
#define wxUSE_STRING_POS_CACHE 0
// in order to avoid any overhead under platforms where critical sections are
// just mutexes make all wxCriticalSection class functions inline
// in order to avoid any overhead under platforms where critical sections are
// just mutexes make all wxCriticalSection class functions inline
+#if !defined(__WINDOWS__)
#define wxCRITSECT_IS_MUTEX 1
#define wxCRITSECT_INLINE WXEXPORT inline
#define wxCRITSECT_IS_MUTEX 1
#define wxCRITSECT_INLINE WXEXPORT inline
private:
#if wxCRITSECT_IS_MUTEX
wxMutex m_mutex;
private:
#if wxCRITSECT_IS_MUTEX
wxMutex m_mutex;
-#elif defined(__WXMSW__)
+#elif defined(__WINDOWS__)
// we can't allocate any memory in the ctor, so use placement new -
// unfortunately, we have to hardcode the sizeof() here because we can't
// include windows.h from this public header and we also have to use the
// we can't allocate any memory in the ctor, so use placement new -
// unfortunately, we have to hardcode the sizeof() here because we can't
// include windows.h from this public header and we also have to use the
-#if defined(__WXMSW__) || defined(__OS2__) || defined(__EMX__) || defined(__WXOSX__)
+#if defined(__WINDOWS__) || defined(__OS2__) || defined(__EMX__) || defined(__WXOSX__)
// unlock GUI if there are threads waiting for and lock it back when
// there are no more of them - should be called periodically by the main
// thread
// unlock GUI if there are threads waiting for and lock it back when
// there are no more of them - should be called periodically by the main
// thread
// variables and their events/event semaphores have quite different semantics,
// so we reimplement the conditions from scratch using the mutexes and
// semaphores
// variables and their events/event semaphores have quite different semantics,
// so we reimplement the conditions from scratch using the mutexes and
// semaphores
-#if defined(__WXMSW__) || defined(__OS2__) || defined(__EMX__)
+#if defined(__WINDOWS__) || defined(__OS2__) || defined(__EMX__)
class wxConditionInternal
{
class wxConditionInternal
{
return wxCOND_NO_ERROR;
}
return wxCOND_NO_ERROR;
}
+#endif // __WINDOWS__ || __OS2__ || __EMX__
// ----------------------------------------------------------------------------
// wxCondition
// ----------------------------------------------------------------------------
// wxCondition
typedef void (*wxTlsDestructorFunction)(void*);
}
typedef void (*wxTlsDestructorFunction)(void*);
}
+ #if defined(__WINDOWS__)
#include "wx/msw/tls.h"
#elif defined(__OS2__)
#include "wx/os2/tls.h"
#include "wx/msw/tls.h"
#elif defined(__OS2__)
#include "wx/os2/tls.h"
int flags = 0,
const wxExecuteEnv *env = NULL);
int flags = 0,
const wxExecuteEnv *env = NULL);
-#if defined(__WXMSW__) && wxUSE_IPC
+#if defined(__WINDOWS__) && wxUSE_IPC
// ask a DDE server to execute the DDE request with given parameters
WXDLLIMPEXP_BASE bool wxExecuteDDE(const wxString& ddeServer,
const wxString& ddeTopic,
const wxString& ddeCommand);
// ask a DDE server to execute the DDE request with given parameters
WXDLLIMPEXP_BASE bool wxExecuteDDE(const wxString& ddeServer,
const wxString& ddeTopic,
const wxString& ddeCommand);
-#endif // __WXMSW__ && wxUSE_IPC
+#endif // __WINDOWS__ && wxUSE_IPC
// Windows resources access
// ----------------------------------------------------------------------------
// Windows resources access
// ----------------------------------------------------------------------------
-// MSW only: get user-defined resource from the .res file.
-#ifdef __WXMSW__
+// Windows only: get user-defined resource from the .res file.
+#ifdef __WINDOWS__
// default resource type for wxLoadUserResource()
extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxUserResourceStr;
// default resource type for wxLoadUserResource()
extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxUserResourceStr;
const wxString& resourceType = wxUserResourceStr,
int* pLen = NULL,
WXHINSTANCE module = 0);
const wxString& resourceType = wxUserResourceStr,
int* pLen = NULL,
WXHINSTANCE module = 0);
#endif
#ifndef WX_PRECOMP
#endif
#ifndef WX_PRECOMP
#include "wx/msw/wrapwin.h" // includes windows.h for MessageBox()
#endif
#include "wx/list.h"
#include "wx/msw/wrapwin.h" // includes windows.h for MessageBox()
#endif
#include "wx/list.h"
#include <typeinfo>
#endif
#include <typeinfo>
#endif
-#if !defined(__WXMSW__) || defined(__WXMICROWIN__)
+#if !defined(__WINDOWS__) || defined(__WXMICROWIN__)
#include <signal.h> // for SIGTRAP used by wxTrap()
#endif //Win/Unix
#include <signal.h> // for SIGTRAP used by wxTrap()
#endif //Win/Unix
#if wxDEBUG_LEVEL
#if wxUSE_STACKWALKER
#include "wx/stackwalk.h"
#if wxDEBUG_LEVEL
#if wxUSE_STACKWALKER
#include "wx/stackwalk.h"
#include "wx/msw/debughlp.h"
#endif
#endif // wxUSE_STACKWALKER
#include "wx/msw/debughlp.h"
#endif
#endif // wxUSE_STACKWALKER
+#if !defined(__WINDOWS__)
// on Unix stack frame generation may take some time, depending on the
// size of the executable mainly... warn the user that we are working
wxFprintf(stderr, "Collecting stack trace information, please wait...");
fflush(stderr);
// on Unix stack frame generation may take some time, depending on the
// size of the executable mainly... warn the user that we are working
wxFprintf(stderr, "Collecting stack trace information, please wait...");
fflush(stderr);
// break into the debugger
void wxTrap()
{
// break into the debugger
void wxTrap()
{
-#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
+#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
DebugBreak();
#elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
Debugger();
DebugBreak();
#elif defined(_MSL_USING_MW_C_HEADERS) && _MSL_USING_MW_C_HEADERS
Debugger();
static
bool DoShowAssertDialog(const wxString& msg)
{
static
bool DoShowAssertDialog(const wxString& msg)
{
- // under MSW we can show the dialog even in the console mode
-#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
+ // under Windows we can show the dialog even in the console mode
+#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
wxString msgDlg(msg);
// this message is intentionally not translated -- it is for developers
wxString msgDlg(msg);
// this message is intentionally not translated -- it is for developers
//case IDNO: nothing to do
}
//case IDNO: nothing to do
}
-#endif // __WXMSW__/!__WXMSW__
+#endif // __WINDOWS__/!__WINDOWS__
// continue with the asserts by default
return false;
// continue with the asserts by default
return false;
wxConfigBase *wxAppTraitsBase::CreateConfig()
{
return new
wxConfigBase *wxAppTraitsBase::CreateConfig()
{
return new
- #if defined(__WXMSW__) && wxUSE_CONFIG_NATIVE
+ #if defined(__WINDOWS__) && wxUSE_CONFIG_NATIVE
wxRegConfig(wxTheApp->GetAppName(), wxTheApp->GetVendorName());
#else // either we're under Unix or wish to use files even under Windows
wxFileConfig(wxTheApp->GetAppName());
wxRegConfig(wxTheApp->GetAppName(), wxTheApp->GetVendorName());
#else // either we're under Unix or wish to use files even under Windows
wxFileConfig(wxTheApp->GetAppName());
Bracket_None,
Bracket_Normal = ')',
Bracket_Curly = '}',
Bracket_None,
Bracket_Normal = ')',
Bracket_Curly = '}',
Bracket_Windows = '%', // yeah, Windows people are a bit strange ;-)
#endif
Bracket_Max
Bracket_Windows = '%', // yeah, Windows people are a bit strange ;-)
#endif
Bracket_Max
size_t m;
for ( size_t n = 0; n < str.length(); n++ ) {
switch ( str[n].GetValue() ) {
size_t m;
for ( size_t n = 0; n < str.length(); n++ ) {
switch ( str[n].GetValue() ) {
case wxT('$'):
{
Bracket bracket;
case wxT('$'):
{
Bracket bracket;
if ( str[n] == wxT('%') )
bracket = Bracket_Windows;
else
if ( str[n] == wxT('%') )
bracket = Bracket_Windows;
else
if ( n == str.length() - 1 ) {
bracket = Bracket_None;
}
if ( n == str.length() - 1 ) {
bracket = Bracket_None;
}
#endif
{
// variable doesn't exist => don't change anything
#endif
{
// variable doesn't exist => don't change anything
if ( bracket != Bracket_Windows )
#endif
if ( bracket != Bracket_None )
if ( bracket != Bracket_Windows )
#endif
if ( bracket != Bracket_None )
//
// under Unix, OTOH, this warning could be useful for the user to
// understand why isn't the variable expanded as intended
//
// under Unix, OTOH, this warning could be useful for the user to
// understand why isn't the variable expanded as intended
wxLogWarning(_("Environment variables expansion failed: missing '%c' at position %u in '%s'."),
(char)bracket, (unsigned int) (m + 1), str.c_str());
wxLogWarning(_("Environment variables expansion failed: missing '%c' at position %u in '%s'."),
(char)bracket, (unsigned int) (m + 1), str.c_str());
}
else {
// skip closing bracket unless the variables wasn't expanded
}
else {
// skip closing bracket unless the variables wasn't expanded
#if !defined(wxUSE_DATETIME) || wxUSE_DATETIME
#ifndef WX_PRECOMP
#if !defined(wxUSE_DATETIME) || wxUSE_DATETIME
#ifndef WX_PRECOMP
#include "wx/msw/wrapwin.h"
#endif
#include "wx/string.h"
#include "wx/msw/wrapwin.h"
#endif
#include "wx/string.h"
: (wxDateTime::WeekDay)(wd - 1);
}
: (wxDateTime::WeekDay)(wd - 1);
}
wxDateTime& wxDateTime::SetFromMSWSysTime(const SYSTEMTIME& st)
{
wxDateTime& wxDateTime::SetFromMSWSysTime(const SYSTEMTIME& st)
{
#if !defined(wxUSE_DATETIME) || wxUSE_DATETIME
#ifndef WX_PRECOMP
#if !defined(wxUSE_DATETIME) || wxUSE_DATETIME
#ifndef WX_PRECOMP
#include "wx/msw/wrapwin.h"
#endif
#include "wx/string.h"
#include "wx/msw/wrapwin.h"
#endif
#include "wx/string.h"
time_t time = GetTicks();
if ( (time != (time_t)-1) && !wxStrstr(format, wxT("%l"))
time_t time = GetTicks();
if ( (time != (time_t)-1) && !wxStrstr(format, wxT("%l"))
&& !wxStrstr(format, wxT("%z"))
#endif
)
&& !wxStrstr(format, wxT("%z"))
#endif
)
#include "wx/msw/msvcrt.h"
#endif
#include "wx/msw/msvcrt.h"
#endif
#endif
// for MSW/Unix it is defined in platform-specific file
#endif
// for MSW/Unix it is defined in platform-specific file
-#if !(defined(__WXMSW__) || defined(__UNIX__)) || defined(__EMX__)
+#if !(defined(__WINDOWS__) || defined(__UNIX__)) || defined(__EMX__)
wxDllType wxDynamicLibrary::GetProgramHandle()
{
wxDllType wxDynamicLibrary::GetProgramHandle()
{
-#endif // __WXMSW__ || __UNIX__
+#endif // __WINDOWS__ || __UNIX__
bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags)
bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags)
// for MSW and Unix this is implemented in the platform-specific file
//
// TODO: move the rest to os2/dlpm.cpp and mac/dlmac.cpp!
// for MSW and Unix this is implemented in the platform-specific file
//
// TODO: move the rest to os2/dlpm.cpp and mac/dlmac.cpp!
-#if (!defined(__WXMSW__) && !defined(__UNIX__)) || defined(__EMX__)
+#if (!defined(__WINDOWS__) && !defined(__UNIX__)) || defined(__EMX__)
/* static */
void wxDynamicLibrary::Unload(wxDllType handle)
/* static */
void wxDynamicLibrary::Unload(wxDllType handle)
-#endif // !(__WXMSW__ || __UNIX__)
+#endif // !(__WINDOWS__ || __UNIX__)
void *wxDynamicLibrary::DoGetSymbol(const wxString &name, bool *success) const
{
void *wxDynamicLibrary::DoGetSymbol(const wxString &name, bool *success) const
{
{
if (platform == wxPLATFORM_CURRENT)
{
{
if (platform == wxPLATFORM_CURRENT)
{
+#if defined(__WINDOWS__)
platform = wxPLATFORM_WINDOWS;
#elif defined(__WXGTK__) || defined(__WXMOTIF__)
platform = wxPLATFORM_UNIX;
platform = wxPLATFORM_WINDOWS;
#elif defined(__WXGTK__) || defined(__WXMOTIF__)
platform = wxPLATFORM_UNIX;
}
// wxEventLoopManual is unused in the other ports
}
// wxEventLoopManual is unused in the other ports
-#if defined(__WXMSW__) || defined(__WXDFB__) || ( ( defined(__UNIX__) && !defined(__WXOSX__) ) && wxUSE_BASE)
+#if defined(__WINDOWS__) || defined(__WXDFB__) || ( ( defined(__UNIX__) && !defined(__WXOSX__) ) && wxUSE_BASE)
// ============================================================================
// wxEventLoopManual implementation
// ============================================================================
// wxEventLoopManual implementation
-#endif // __WXMSW__ || __WXMAC__ || __WXDFB__
+#endif // __WINDOWS__ || __WXMAC__ || __WXDFB__
#if wxUSE_FILE
// standard
#if wxUSE_FILE
// standard
-#if defined(__WXMSW__) && !defined(__GNUWIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+#if defined(__WINDOWS__) && !defined(__GNUWIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
#define WIN32_LEAN_AND_MEAN
#define NOSERVICE
#define WIN32_LEAN_AND_MEAN
#define NOSERVICE
#define NOCRYPT
#define NOMCX
#define NOCRYPT
#define NOMCX
-#elif defined(__WXMSW__) && defined(__WXWINCE__)
+#elif defined(__WINDOWS__) && defined(__WXWINCE__)
#include "wx/msw/missing.h"
#elif (defined(__OS2__))
#include <io.h>
#include "wx/msw/missing.h"
#elif (defined(__OS2__))
#include <io.h>
#define O_BINARY (0)
#endif //__UNIX__
#define O_BINARY (0)
#endif //__UNIX__
#include "wx/msw/mslu.h"
#endif
#include "wx/msw/mslu.h"
#endif
+#if defined(__WINDOWS__)
#include "wx/msw/private.h"
#endif //windows.h
#if defined(__WXPM__)
#include "wx/msw/private.h"
#endif //windows.h
#if defined(__WXPM__)
static CharType *wxDoRealPath (CharType *path)
{
static const CharType SEP = wxFILE_SEP_PATH;
static CharType *wxDoRealPath (CharType *path)
{
static const CharType SEP = wxFILE_SEP_PATH;
wxUnix2DosFilename(path);
#endif
if (path[0] && path[1]) {
wxUnix2DosFilename(path);
#endif
if (path[0] && path[1]) {
path[0] = SEP;
path[1] = wxT('\0');
}
path[0] = SEP;
path[1] = wxT('\0');
}
-#if defined(__WXMSW__) || defined(__OS2__)
+#if defined(__WINDOWS__) || defined(__OS2__)
/* Check that path[2] is NULL! */
else if (path[1] == wxT(':') && !path[2])
{
/* Check that path[2] is NULL! */
else if (path[1] == wxT(':') && !path[2])
{
{
wxString buf = ::wxGetCwd();
wxChar ch = buf.Last();
{
wxString buf = ::wxGetCwd();
wxChar ch = buf.Last();
if (ch != wxT('\\') && ch != wxT('/'))
buf << wxT("\\");
#else
if (ch != wxT('\\') && ch != wxT('/'))
buf << wxT("\\");
#else
trimchars[3] = 0;
static const CharType SEP = wxFILE_SEP_PATH;
trimchars[3] = 0;
static const CharType SEP = wxFILE_SEP_PATH;
//wxUnix2DosFilename(path);
#endif
//wxUnix2DosFilename(path);
#endif
q = FALSE;
#else
q = nm[0] == wxT('\\') && nm[1] == wxT('~');
q = FALSE;
#else
q = nm[0] == wxT('\\') && nm[1] == wxT('~');
else
#else
while ((*d++ = *s) != 0) {
else
#else
while ((*d++ = *s) != 0) {
if (*s == wxT('\\')) {
if ((*(d - 1) = *++s)!=0) {
s++;
if (*s == wxT('\\')) {
if ((*(d - 1) = *++s)!=0) {
s++;
#endif
// No env variables on WinCE
#ifndef __WXWINCE__
#endif
// No env variables on WinCE
#ifndef __WXWINCE__
if (*s++ == wxT('$') && (*s == wxT('{') || *s == wxT(')')))
#else
if (*s++ == wxT('$'))
if (*s++ == wxT('$') && (*s == wxT('{') || *s == wxT(')')))
#else
if (*s++ == wxT('$'))
return NULL;
wxStrcpy (dest, filename);
return NULL;
wxStrcpy (dest, filename);
wxUnix2DosFilename(dest);
#endif
wxUnix2DosFilename(dest);
#endif
-#if defined(__WXMSW__) || defined(__OS2__)
+#if defined(__WINDOWS__) || defined(__OS2__)
// Try Drive specifier
if (wxIsalpha (buf[0]) && buf[1] == wxT(':'))
{
// Try Drive specifier
if (wxIsalpha (buf[0]) && buf[1] == wxT(':'))
{
-#if defined(__WXMSW__) || defined(__OS2__)
+#if defined(__WINDOWS__) || defined(__OS2__)
// Try Drive specifier
if (wxIsalpha (buf[0]) && buf[1] == wxT(':'))
{
// Try Drive specifier
if (wxIsalpha (buf[0]) && buf[1] == wxT(':'))
{
{
if (*s == wxT('\\'))
*s = wxT('/');
{
if (*s == wxT('\\'))
*s = wxT('/');
else
*s = wxTolower(*s); // Case INDEPENDENT
#endif
else
*s = wxTolower(*s); // Case INDEPENDENT
#endif
template<typename T>
static void
template<typename T>
static void
-#if defined(__WXMSW__) || defined(__OS2__)
+#if defined(__WINDOWS__) || defined(__OS2__)
wxDoUnix2DosFilename(T *s)
#else
wxDoUnix2DosFilename(T *WXUNUSED(s) )
#endif
{
// Yes, I really mean this to happen under DOS only! JACS
wxDoUnix2DosFilename(T *s)
#else
wxDoUnix2DosFilename(T *WXUNUSED(s) )
#endif
{
// Yes, I really mean this to happen under DOS only! JACS
-#if defined(__WXMSW__) || defined(__OS2__)
+#if defined(__WINDOWS__) || defined(__OS2__)
wxUnusedVar(overwrite);
return false;
wxUnusedVar(overwrite);
return false;
-#endif // __WXMSW__ && __WIN32__
+#endif // __WINDOWS__ && __WIN32__
// assume mkdir() has 2 args on non Windows-OS/2 platforms and on Windows too
// for the GNU compiler
// assume mkdir() has 2 args on non Windows-OS/2 platforms and on Windows too
// for the GNU compiler
-#elif (!(defined(__WXMSW__) || defined(__OS2__) || defined(__DOS__))) || \
+#elif (!(defined(__WINDOWS__) || defined(__OS2__) || defined(__DOS__))) || \
(defined(__GNUWIN32__) && !defined(__MINGW32__)) || \
defined(__WINE__) || defined(__WXMICROWIN__)
const wxChar *dirname = dir.c_str();
(defined(__GNUWIN32__) && !defined(__MINGW32__)) || \
defined(__WINE__) || defined(__WXMICROWIN__)
const wxChar *dirname = dir.c_str();
//
wxFileKind wxGetFileKind(int fd)
{
//
wxFileKind wxGetFileKind(int fd)
{
-#if defined __WXMSW__ && !defined __WXWINCE__ && defined wxGetOSFHandle
+#if defined __WINDOWS__ && !defined __WXWINCE__ && defined wxGetOSFHandle
switch (::GetFileType(wxGetOSFHandle(fd)) & ~FILE_TYPE_REMOTE)
{
case FILE_TYPE_CHAR:
switch (::GetFileType(wxGetOSFHandle(fd)) & ~FILE_TYPE_REMOTE)
{
case FILE_TYPE_CHAR:
#endif
#ifndef WX_PRECOMP
#endif
#ifndef WX_PRECOMP
#include "wx/msw/wrapwin.h" // For GetShort/LongPathName
#endif
#include "wx/dynarray.h"
#include "wx/msw/wrapwin.h" // For GetShort/LongPathName
#endif
#include "wx/dynarray.h"
#include "wx/msw/gccpriv.h"
#endif
#include "wx/msw/gccpriv.h"
#endif
#include "wx/msw/private.h"
#endif
#include "wx/msw/private.h"
#endif
bool wxFileName::Rmdir(const wxString& dir, int flags)
{
bool wxFileName::Rmdir(const wxString& dir, int flags)
{
if ( flags & wxPATH_RMDIR_RECURSIVE )
{
// SHFileOperation needs double null termination string
if ( flags & wxPATH_RMDIR_RECURSIVE )
{
// SHFileOperation needs double null termination string
return true;
}
else if ( flags & wxPATH_RMDIR_FULL )
return true;
}
else if ( flags & wxPATH_RMDIR_FULL )
if ( flags != 0 ) // wxPATH_RMDIR_FULL or wxPATH_RMDIR_RECURSIVE
if ( flags != 0 ) // wxPATH_RMDIR_FULL or wxPATH_RMDIR_RECURSIVE
{
wxString path(dir);
if ( path.Last() != wxFILE_SEP_PATH )
{
wxString path(dir);
if ( path.Last() != wxFILE_SEP_PATH )
cont = d.GetNext(&filename);
}
cont = d.GetNext(&filename);
}
if ( flags & wxPATH_RMDIR_RECURSIVE )
{
// delete all files too
if ( flags & wxPATH_RMDIR_RECURSIVE )
{
// delete all files too
cont = d.GetNext(&filename);
}
}
cont = d.GetNext(&filename);
}
}
{
wxString path(GetFullPath());
{
wxString path(GetFullPath());
-#if defined(__WXMSW__) && defined(__WIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+#if defined(__WINDOWS__) && defined(__WIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
DWORD sz = ::GetShortPathName(path.t_str(), NULL, 0);
if ( sz != 0 )
{
DWORD sz = ::GetShortPathName(path.t_str(), NULL, 0);
if ( sz != 0 )
{
{
if (format == wxPATH_NATIVE)
{
{
if (format == wxPATH_NATIVE)
{
-#if defined(__WXMSW__) || defined(__OS2__) || defined(__DOS__)
+#if defined(__WINDOWS__) || defined(__OS2__) || defined(__DOS__)
format = wxPATH_DOS;
#elif defined(__VMS)
format = wxPATH_VMS;
format = wxPATH_DOS;
#elif defined(__VMS)
format = wxPATH_VMS;
path = wxURI::Unescape(path);
path = wxURI::Unescape(path);
// file urls either start with a forward slash (local harddisk),
// otherwise they have a servername/sharename notation,
// which only exists on msw and corresponds to a unc
// file urls either start with a forward slash (local harddisk),
// otherwise they have a servername/sharename notation,
// which only exists on msw and corresponds to a unc
#include "wx/wxcrtvararg.h"
#endif //WX_PRECOMP
#include "wx/wxcrtvararg.h"
#endif //WX_PRECOMP
+#if defined(__WINDOWS__)
#include "wx/msw/private.h" // includes windows.h for LOGFONT
#include "wx/msw/winundef.h"
#endif
#include "wx/msw/private.h" // includes windows.h for LOGFONT
#include "wx/msw/winundef.h"
#endif
#include "wx/scopedptr.h"
#include "wx/except.h"
#include "wx/scopedptr.h"
#include "wx/except.h"
+#if defined(__WINDOWS__)
#include "wx/msw/private.h"
#include "wx/msw/msvcrt.h"
#include "wx/msw/private.h"
#include "wx/msw/msvcrt.h"
}
} gs_enableLeakChecks;
#endif // wxCrtSetDbgFlag
}
} gs_enableLeakChecks;
#endif // wxCrtSetDbgFlag
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
// private classes
wxLog::GetActiveTarget();
#endif // wxUSE_LOG
wxLog::GetActiveTarget();
#endif // wxUSE_LOG
// GUI applications obtain HINSTANCE in their WinMain() but we also need to
// initialize the global wxhInstance variable for the console programs as
// they may need it too, so set it here if it wasn't done yet
// GUI applications obtain HINSTANCE in their WinMain() but we also need to
// initialize the global wxhInstance variable for the console programs as
// they may need it too, so set it here if it wasn't done yet
{
wxSetInstance(::GetModuleHandle(NULL));
}
{
wxSetInstance(::GetModuleHandle(NULL));
}
// ----------------------------------------------------------------------------
// for MSW the real wxEntry is defined in msw/main.cpp
// ----------------------------------------------------------------------------
// for MSW the real wxEntry is defined in msw/main.cpp
#define wxEntryReal wxEntry
#define wxEntryReal wxEntry
int wxEntryReal(int& argc, wxChar **argv)
{
int wxEntryReal(int& argc, wxChar **argv)
{
// wxLanguageInfo
// ----------------------------------------------------------------------------
// wxLanguageInfo
// ----------------------------------------------------------------------------
// helper used by wxLanguageInfo::GetLocaleName() and elsewhere to determine
// whether the locale is Unicode-only (it is if this function returns empty
// helper used by wxLanguageInfo::GetLocaleName() and elsewhere to determine
// whether the locale is Unicode-only (it is if this function returns empty
// ----------------------------------------------------------------------------
// wxLocale
// ----------------------------------------------------------------------------
// wxLocale
// accessors for locale-dependent data
// ----------------------------------------------------------------------------
// accessors for locale-dependent data
// ----------------------------------------------------------------------------
-#if defined(__WXMSW__) || defined(__WXOSX__)
+#if defined(__WINDOWS__) || defined(__WXOSX__)
const char* formatchars =
"dghHmMsSy"
const char* formatchars =
"dghHmMsSy"
// between 1 and 2 digits for days
fmtWX += "%d";
break;
// between 1 and 2 digits for days
fmtWX += "%d";
break;
case 3: // ddd
fmtWX += "%a";
break;
case 3: // ddd
fmtWX += "%a";
break;
wxFAIL_MSG( "too many 'd's" );
}
break;
wxFAIL_MSG( "too many 'd's" );
}
break;
case 'D':
switch ( lastCount )
{
case 'D':
switch ( lastCount )
{
wxASSERT_MSG( lastCount <= 2, "too many 'g's" );
break;
wxASSERT_MSG( lastCount <= 2, "too many 'g's" );
break;
case 'a':
fmtWX += "%p";
break;
#endif
case 'a':
fmtWX += "%p";
break;
#endif
case 't':
switch ( lastCount )
{
case 't':
switch ( lastCount )
{
-#endif // __WXMSW__ || __WXOSX__
+#endif // __WINDOWS__ || __WXOSX__
+#if defined(__WINDOWS__)
-#else // !__WXMSW__ && !__WXOSX__, assume generic POSIX
+#else // !__WINDOWS__ && !__WXOSX__, assume generic POSIX
// don't time stamp debug messages under MSW as debug viewers usually
// already have an option to do it
// don't time stamp debug messages under MSW as debug viewers usually
// already have an option to do it
if ( level != wxLOG_Debug && level != wxLOG_Trace )
if ( level != wxLOG_Debug && level != wxLOG_Trace )
prefix = FormatTime(info.timestamp);
switch ( level )
prefix = FormatTime(info.timestamp);
switch ( level )
// don't prepend "debug/trace" prefix under MSW as it goes to the debug
// window anyhow and so can't be confused with something else
// don't prepend "debug/trace" prefix under MSW as it goes to the debug
// window anyhow and so can't be confused with something else
case wxLOG_Debug:
// this prefix (as well as the one below) is intentionally not
// translated as nobody translates debug messages anyhow
case wxLOG_Debug:
// this prefix (as well as the one below) is intentionally not
// translated as nobody translates debug messages anyhow
case wxLOG_Trace:
prefix += "Trace: ";
break;
case wxLOG_Trace:
prefix += "Trace: ";
break;
// get error code from syste
unsigned long wxSysErrorCode()
{
// get error code from syste
unsigned long wxSysErrorCode()
{
-#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
+#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
return ::GetLastError();
#else //Unix
return errno;
return ::GetLastError();
#else //Unix
return errno;
if ( nErrCode == 0 )
nErrCode = wxSysErrorCode();
if ( nErrCode == 0 )
nErrCode = wxSysErrorCode();
-#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
+#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
static wxChar s_szBuf[1024];
// get error message from system
static wxChar s_szBuf[1024];
// get error message from system
#if wxUSE_UNICODE
static wchar_t s_wzBuf[1024];
wxConvCurrent->MB2WC(s_wzBuf, strerror((int)nErrCode),
#if wxUSE_UNICODE
static wchar_t s_wzBuf[1024];
wxConvCurrent->MB2WC(s_wzBuf, strerror((int)nErrCode),
#else
return strerror((int)nErrCode);
#endif
#else
return strerror((int)nErrCode);
#endif
-#endif // __WXMSW__/!__WXMSW__
+#endif // __WINDOWS__/!__WINDOWS__
#include "wx/memory.h"
#ifndef WX_PRECOMP
#include "wx/memory.h"
#ifndef WX_PRECOMP
#include "wx/msw/wrapwin.h"
#endif
#include "wx/utils.h"
#include "wx/msw/wrapwin.h"
#endif
#include "wx/utils.h"
#endif // USE_THREADSAFE_MEMORY_ALLOCATION
#endif // USE_THREADSAFE_MEMORY_ALLOCATION
-#if !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)))
+#if !(defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)))
#if wxUSE_GLOBAL_MEMORY_OPERATORS
void * operator new (size_t size, wxChar * fileName, int lineNum)
{
#if wxUSE_GLOBAL_MEMORY_OPERATORS
void * operator new (size_t size, wxChar * fileName, int lineNum)
{
}
#endif // wxUSE_ARRAY_MEMORY_OPERATORS
#endif // wxUSE_GLOBAL_MEMORY_OPERATORS
}
#endif // wxUSE_ARRAY_MEMORY_OPERATORS
#endif // wxUSE_GLOBAL_MEMORY_OPERATORS
-#endif // !(defined(__WXMSW__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)))
+#endif // !(defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE)))
// TODO: store whether this is a vector or not.
void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool WXUNUSED(isVect) )
// TODO: store whether this is a vector or not.
void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool WXUNUSED(isVect) )
wvsprintf(buffer,fmt,ap) ;
#else
vsprintf(buffer,fmt,ap) ;
wvsprintf(buffer,fmt,ap) ;
#else
vsprintf(buffer,fmt,ap) ;
wxDebugContext::GetStream().flush();
}
else
wxDebugContext::GetStream().flush();
}
else
#ifdef __WIN32__
OutputDebugString((LPCTSTR)buffer) ;
#else
#ifdef __WIN32__
OutputDebugString((LPCTSTR)buffer) ;
#else
wxWvsprintf(buffer,fmt,ap) ;
#else
vsprintf(buffer,fmt,ap) ;
wxWvsprintf(buffer,fmt,ap) ;
#else
vsprintf(buffer,fmt,ap) ;
wxDebugContext::GetStream().flush();
}
else
wxDebugContext::GetStream().flush();
}
else
#ifdef __WIN32__
OutputDebugString((LPCTSTR)buffer) ;
#else
#ifdef __WIN32__
OutputDebugString((LPCTSTR)buffer) ;
#else
#include <ctype.h>
// implementation classes:
#include <ctype.h>
// implementation classes:
+#if defined(__WINDOWS__)
#include "wx/msw/mimetype.h"
#elif ( defined(__WXMAC__) )
#include "wx/osx/mimetype.h"
#include "wx/msw/mimetype.h"
#elif ( defined(__WXMAC__) )
#include "wx/osx/mimetype.h"
if ( iconLoc )
{
iconLoc->SetFileName(m_info->GetIconFile());
if ( iconLoc )
{
iconLoc->SetFileName(m_info->GetIconFile());
iconLoc->SetIndex(m_info->GetIconIndex());
iconLoc->SetIndex(m_info->GetIconIndex());
if ( commands )
commands->Clear();
if ( commands )
commands->Clear();
-#if defined (__WXMSW__) || defined(__UNIX__)
+#if defined (__WINDOWS__) || defined(__UNIX__)
return m_impl->GetAllCommands(verbs, commands, params);
return m_impl->GetAllCommands(verbs, commands, params);
-#else // !__WXMSW__ || Unix
+#else // !__WINDOWS__ || __UNIX__
// we don't know how to retrieve all commands, so just try the 2 we know
// about
size_t count = 0;
// we don't know how to retrieve all commands, so just try the 2 we know
// about
size_t count = 0;
-#endif // __WXMSW__/| __UNIX__
+#endif // __WINDOWS__/| __UNIX__
}
bool wxFileType::Unassociate()
{
}
bool wxFileType::Unassociate()
{
+#if defined(__WINDOWS__)
return m_impl->Unassociate();
#elif defined(__UNIX__)
return m_impl->Unassociate(this);
return m_impl->Unassociate();
#elif defined(__UNIX__)
return m_impl->Unassociate(this);
const wxString& verb,
bool overwriteprompt)
{
const wxString& verb,
bool overwriteprompt)
{
-#if defined (__WXMSW__) || defined(__UNIX__)
+#if defined (__WINDOWS__) || defined(__UNIX__)
return m_impl->SetCommand(cmd, verb, overwriteprompt);
#else
wxUnusedVar(cmd);
return m_impl->SetCommand(cmd, verb, overwriteprompt);
#else
wxUnusedVar(cmd);
bool wxFileType::SetDefaultIcon(const wxString& cmd, int index)
{
wxString sTmp = cmd;
bool wxFileType::SetDefaultIcon(const wxString& cmd, int index)
{
wxString sTmp = cmd;
// VZ: should we do this?
// chris elliott : only makes sense in MS windows
if ( sTmp.empty() )
// VZ: should we do this?
// chris elliott : only makes sense in MS windows
if ( sTmp.empty() )
#endif
wxCHECK_MSG( !sTmp.empty(), false, wxT("need the icon file") );
#endif
wxCHECK_MSG( !sTmp.empty(), false, wxT("need the icon file") );
-#if defined (__WXMSW__) || defined(__UNIX__)
+#if defined (__WINDOWS__) || defined(__UNIX__)
return m_impl->SetDefaultIcon (cmd, index);
#else
wxUnusedVar(index);
return m_impl->SetDefaultIcon (cmd, index);
#else
wxUnusedVar(index);
-#if defined(__WXMSW__) || defined(__UNIX__)
+#if defined(__WINDOWS__) || defined(__UNIX__)
return m_impl->Associate(ftInfo);
#else // other platforms
wxUnusedVar(ftInfo);
return m_impl->Associate(ftInfo);
#else // other platforms
wxUnusedVar(ftInfo);
#endif
// provide stubs for the systems not implementing these functions
#endif
// provide stubs for the systems not implementing these functions
+#if !defined(__WINDOWS__)
wxPowerType wxGetPowerType()
{
wxPowerType wxGetPowerType()
{
// TODO: use POSIX getaddrinfo() (also available in Winsock 2) for simplicity
// and to use the same code for IPv4 and IPv6 support
// TODO: use POSIX getaddrinfo() (also available in Winsock 2) for simplicity
// and to use the same code for IPv4 and IPv6 support
#define HAVE_INET_ADDR
#ifndef HAVE_GETHOSTBYNAME
#define HAVE_INET_ADDR
#ifndef HAVE_GETHOSTBYNAME
#pragma warning(default:4706)
#endif
#endif
#pragma warning(default:4706)
#endif
#endif
// we assume that we have gethostbyaddr_r() if and only if we have
// gethostbyname_r() and that it uses the similar conventions to it (see
// we assume that we have gethostbyaddr_r() if and only if we have
// gethostbyname_r() and that it uses the similar conventions to it (see
#if wxUSE_STOPWATCH
#ifndef WX_PRECOMP
#if wxUSE_STOPWATCH
#ifndef WX_PRECOMP
#include "wx/msw/wrapwin.h"
#endif
#include "wx/log.h"
#include "wx/msw/wrapwin.h"
#endif
#include "wx/log.h"
bool init;
} gs_perfCounter;
bool init;
} gs_perfCounter;
const int MILLISECONDS_PER_SECOND = 1000;
const int MICROSECONDS_PER_MILLISECOND = 1000;
const int MILLISECONDS_PER_SECOND = 1000;
const int MICROSECONDS_PER_MILLISECOND = 1000;
void wxStopWatch::DoStart()
{
void wxStopWatch::DoStart()
{
if ( !gs_perfCounter.init )
{
wxCRIT_SECT_LOCKER(lock, gs_perfCounter.cs);
if ( !gs_perfCounter.init )
{
wxCRIT_SECT_LOCKER(lock, gs_perfCounter.cs);
gs_perfCounter.init = true;
}
gs_perfCounter.init = true;
}
m_t0 = GetCurrentClockValue();
}
wxLongLong wxStopWatch::GetClockFreq() const
{
m_t0 = GetCurrentClockValue();
}
wxLongLong wxStopWatch::GetClockFreq() const
{
// Under MSW we use the high resolution performance counter timer which has
// its own frequency (usually related to the CPU clock speed).
if ( gs_perfCounter.CanBeUsed() )
return gs_perfCounter.freq.QuadPart;
// Under MSW we use the high resolution performance counter timer which has
// its own frequency (usually related to the CPU clock speed).
if ( gs_perfCounter.CanBeUsed() )
return gs_perfCounter.freq.QuadPart;
#ifdef HAVE_GETTIMEOFDAY
// With gettimeofday() we can have nominally microsecond precision and
#ifdef HAVE_GETTIMEOFDAY
// With gettimeofday() we can have nominally microsecond precision and
wxLongLong wxStopWatch::GetCurrentClockValue() const
{
wxLongLong wxStopWatch::GetCurrentClockValue() const
{
if ( gs_perfCounter.CanBeUsed() )
{
LARGE_INTEGER counter;
::QueryPerformanceCounter(&counter);
return counter.QuadPart;
}
if ( gs_perfCounter.CanBeUsed() )
{
LARGE_INTEGER counter;
::QueryPerformanceCounter(&counter);
return counter.QuadPart;
}
#ifdef HAVE_GETTIMEOFDAY
return wxGetUTCTimeUSec();
#ifdef HAVE_GETTIMEOFDAY
return wxGetUTCTimeUSec();
#include "wx/vector.h"
#include "wx/xlocale.h"
#include "wx/vector.h"
#include "wx/xlocale.h"
#include "wx/msw/wrapwin.h"
#include "wx/msw/wrapwin.h"
#if wxUSE_STD_IOSTREAM
#include <sstream>
#if wxUSE_STD_IOSTREAM
#include <sstream>
#include "wx/time.h"
#ifndef WX_PRECOMP
#include "wx/time.h"
#ifndef WX_PRECOMP
#include "wx/msw/wrapwin.h"
#endif
#include "wx/intl.h"
#include "wx/msw/wrapwin.h"
#endif
#include "wx/intl.h"
-#if defined(__MWERKS__) && defined(__WXMSW__)
+#if defined(__MWERKS__) && defined(__WINDOWS__)
# undef HAVE_FTIME
# undef HAVE_GETTIMEOFDAY
#endif
# undef HAVE_FTIME
# undef HAVE_GETTIMEOFDAY
#endif
wxLongLong wxGetUTCTimeUSec()
{
wxLongLong wxGetUTCTimeUSec()
{
+#if defined(__WINDOWS__)
FILETIME ft;
::GetSystemTimeAsFileTime(&ft);
FILETIME ft;
::GetSystemTimeAsFileTime(&ft);
// If possible, use a function which avoids conversions from
// broken-up time structures to milliseconds
// If possible, use a function which avoids conversions from
// broken-up time structures to milliseconds
+#if defined(__WINDOWS__)
FILETIME ft;
::GetSystemTimeAsFileTime(&ft);
FILETIME ft;
::GetSystemTimeAsFileTime(&ft);
#include "wx/stdpaths.h"
#include "wx/hashset.h"
#include "wx/stdpaths.h"
#include "wx/hashset.h"
#include "wx/msw/wrapwin.h"
#endif
#include "wx/msw/wrapwin.h"
#endif
m_mode = mode;
if (m_mode == wxEOL_NATIVE)
{
m_mode = mode;
if (m_mode == wxEOL_NATIVE)
{
-#if defined(__WXMSW__) || defined(__WXPM__)
+#if defined(__WINDOWS__) || defined(__WXPM__)
m_mode = wxEOL_DOS;
#else
m_mode = wxEOL_UNIX;
m_mode = wxEOL_DOS;
#else
m_mode = wxEOL_UNIX;
m_mode = mode;
if (m_mode == wxEOL_NATIVE)
{
m_mode = mode;
if (m_mode == wxEOL_NATIVE)
{
-#if defined(__WXMSW__) || defined(__WXPM__)
+#if defined(__WINDOWS__) || defined(__WXPM__)
m_mode = wxEOL_DOS;
#else
m_mode = wxEOL_UNIX;
m_mode = wxEOL_DOS;
#else
m_mode = wxEOL_UNIX;
#include <sys/stat.h>
#endif
#include <sys/stat.h>
#endif
+#if defined(__WINDOWS__)
#include "wx/msw/private.h"
#include "wx/filesys.h"
#endif
#include "wx/msw/private.h"
#include "wx/filesys.h"
#endif
bool wxPlatform::Is(int platform)
{
bool wxPlatform::Is(int platform)
{
if (platform == wxOS_WINDOWS)
return true;
#endif
if (platform == wxOS_WINDOWS)
return true;
#endif
// standard headers anyhow so we can just rely on already having the
// correct declaration. And if this turns out to be wrong, we can always
// add a configure test checking whether it is declared later.
// standard headers anyhow so we can just rely on already having the
// correct declaration. And if this turns out to be wrong, we can always
// add a configure test checking whether it is declared later.
char **env = environ;
#endif
char **env = environ;
#endif
// Launch default browser
// ----------------------------------------------------------------------------
// Launch default browser
// ----------------------------------------------------------------------------
+#if defined(__WINDOWS__)
// implemented in a port-specific utils source file:
bool wxDoLaunchDefaultBrowser(const wxString& url, const wxString& scheme, int flags);
// implemented in a port-specific utils source file:
bool wxDoLaunchDefaultBrowser(const wxString& url, const wxString& scheme, int flags);
// (e.g. "C:\\test.txt" when parsed by wxURI reports a scheme == "C")
bool hasValidScheme = uri.HasScheme() && uri.GetScheme().length() > 1;
// (e.g. "C:\\test.txt" when parsed by wxURI reports a scheme == "C")
bool hasValidScheme = uri.HasScheme() && uri.GetScheme().length() > 1;
+#if defined(__WINDOWS__)
// NOTE: when testing wxMSW's wxLaunchDefaultBrowser all possible forms
// of the URL/flags should be tested; e.g.:
// NOTE: when testing wxMSW's wxLaunchDefaultBrowser all possible forms
// of the URL/flags should be tested; e.g.:
// apparently not the case for all MSW makefiles and so, unless we use
// configure (which defines __WX_SETUP_H__) or it is explicitly overridden by
// the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here
// apparently not the case for all MSW makefiles and so, unless we use
// configure (which defines __WX_SETUP_H__) or it is explicitly overridden by
// the user (who can define wxUSE_ZLIB_H_IN_PATH), we hardcode the path here
-#if defined(__WXMSW__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH)
+#if defined(__WINDOWS__) && !defined(__WX_SETUP_H__) && !defined(wxUSE_ZLIB_H_IN_PATH)
#include "../zlib/zlib.h"
#else
#include "zlib.h"
#include "../zlib/zlib.h"
#else
#include "zlib.h"
#include "wx/iconloc.h"
#include "wx/confbase.h"
#include "wx/iconloc.h"
#include "wx/confbase.h"
#include "wx/msw/registry.h"
#include "wx/msw/private.h"
#endif // OS
#include "wx/msw/registry.h"
#include "wx/msw/private.h"
#endif // OS