@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{__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{__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
class WXDLLIMPEXP_FWD_BASE wxDateTime;
class WXDLLIMPEXP_FWD_BASE wxTimeSpan;
class WXDLLIMPEXP_FWD_BASE wxDateSpan;
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
struct _SYSTEMTIME;
#endif
wxDateTime_t minute = 0,
wxDateTime_t second = 0,
wxDateTime_t millisec = 0);
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
wxDateTime(const struct _SYSTEMTIME& st)
{
SetFromMSWSysTime(st);
// SYSTEMTIME format
// ------------------------------------------------------------------------
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// 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;
-#endif // __WXMSW__
+#endif // __WINDOWS__
// comparison (see also functions below for operator versions)
// ------------------------------------------------------------------------
#define wxDL_INIT_FUNC(pfx, name, dynlib) \
pfx ## name = (name ## _t)(dynlib).RawGetSymbol(#name)
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// 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)
-#endif // __WXMSW__
+#endif // __WINDOWS__
// 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
#endif
}
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// 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);
}
-#endif // __WXMSW__
+#endif // __WINDOWS__
// return all modules/shared libraries in the address space of this process
//
static wxString GetPluginsDirectory();
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// 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);
-#endif // __WXMSW__
+#endif // __WINDOWS__
protected:
// common part of GetSymbol() and HasSymbol()
wxDECLARE_NO_COPY_CLASS(wxDynamicLibrary);
};
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// ----------------------------------------------------------------------------
// wxLoadedDLL is a MSW-only internal helper class allowing to dynamically bind
}
};
-#endif // __WXMSW__
+#endif // __WINDOWS__
// ----------------------------------------------------------------------------
// Interesting defines
#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__) || \
// 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
#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
{
int Language; // wxLanguage id
wxString CanonicalName; // Canonical name, e.g. fr_FR
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
wxUint32 WinLang, // Win32 language identifiers
WinSublang;
-#endif // __WXMSW__
+#endif // __WINDOWS__
wxString Description; // human-readable name of the language
wxLayoutDirection LayoutDirection;
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// return the LCID corresponding to this language
wxUint32 GetLCID() const;
-#endif // __WXMSW__
+#endif // __WINDOWS__
// 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
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
inline wxString wxLanguageInfo::GetLocaleName() const { return CanonicalName; }
-#endif // !__WXMSW__
+#endif // !__WINDOWS__
// ----------------------------------------------------------------------------
# include <iosfwd>
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
# include "wx/msw/winundef.h"
#endif
#include "wx/afterstd.h"
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
# 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)
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#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
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#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
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#define wxTRACE_OleCalls wxT("ole") // OLE interface calls
#endif
#endif /* __cplusplus */
-#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))))
// 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);
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__)
// 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
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#define wxHAS_POWER_EVENTS
#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);
#ifndef _WX_PRIVATE_SOCKADDR_H_
#define _WX_PRIVATE_SOCKADDR_H_
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#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
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#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
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
#define SOCKET int
#endif
wxDECLARE_NO_COPY_CLASS(wxSocketImpl);
};
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
#include "wx/msw/private/sockmsw.h"
#else
#include "wx/unix/private/sockunix.h"
CHECK_PREC
m_szFlags[flagofs++] = char(ch);
break;
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// 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'
-#endif // __WXMSW__
+#endif // __WINDOWS__
case wxT('z'):
case wxT('Z'):
// wxSound class implementation
// ----------------------------------------------------------------------------
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
#include "wx/msw/sound.h"
#elif defined(__WXCOCOA__)
#include "wx/cocoa/sound.h"
virtual void OnStackFrame(const wxStackFrame& frame) = 0;
};
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#include "wx/msw/stackwalk.h"
#elif defined(__UNIX__)
#include "wx/unix/stackwalk.h"
};
#if wxUSE_STDPATHS
- #if defined(__WXMSW__)
+ #if defined(__WINDOWS__)
#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
-#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
// in order to avoid any overhead under platforms where critical sections are
// just mutexes make all wxCriticalSection class functions inline
-#if !defined(__WXMSW__)
+#if !defined(__WINDOWS__)
#define wxCRITSECT_IS_MUTEX 1
#define wxCRITSECT_INLINE WXEXPORT inline
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
#if wxUSE_THREADS
-#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
// 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
{
return wxCOND_NO_ERROR;
}
-#endif // MSW or OS2
+#endif // __WINDOWS__ || __OS2__ || __EMX__
// ----------------------------------------------------------------------------
// wxCondition
typedef void (*wxTlsDestructorFunction)(void*);
}
- #if defined(__WXMSW__)
+ #if defined(__WINDOWS__)
#include "wx/msw/tls.h"
#elif defined(__OS2__)
#include "wx/os2/tls.h"
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);
-#endif // __WXMSW__ && wxUSE_IPC
+#endif // __WINDOWS__ && wxUSE_IPC
enum wxSignal
{
// 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;
const wxString& resourceType = wxUserResourceStr,
int* pLen = NULL,
WXHINSTANCE module = 0);
-#endif // MSW
+#endif // __WINDOWS__
#endif
// _WX_UTILSH__
#endif
#ifndef WX_PRECOMP
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#include "wx/msw/wrapwin.h" // includes windows.h for MessageBox()
#endif
#include "wx/list.h"
#include <typeinfo>
#endif
-#if !defined(__WXMSW__) || defined(__WXMICROWIN__)
+#if !defined(__WINDOWS__) || defined(__WXMICROWIN__)
#include <signal.h> // for SIGTRAP used by wxTrap()
#endif //Win/Unix
#if wxDEBUG_LEVEL
#if wxUSE_STACKWALKER
#include "wx/stackwalk.h"
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#include "wx/msw/debughlp.h"
#endif
#endif // wxUSE_STACKWALKER
{
#if wxDEBUG_LEVEL
-#if !defined(__WXMSW__)
+#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);
-#endif // !__WXMSW__
+#endif // !__WINDOWS__
wxString stackTrace;
// 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();
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
//case IDNO: nothing to do
}
-#else // !__WXMSW__
+#else // !__WINDOWS__
wxUnusedVar(msg);
-#endif // __WXMSW__/!__WXMSW__
+#endif // __WINDOWS__/!__WINDOWS__
// continue with the asserts by default
return false;
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());
Bracket_None,
Bracket_Normal = ')',
Bracket_Curly = '}',
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
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() ) {
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
case wxT('%'):
-#endif //WINDOWS
+#endif // __WINDOWS__
case wxT('$'):
{
Bracket bracket;
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
if ( str[n] == wxT('%') )
bracket = Bracket_Windows;
else
- #endif //WINDOWS
+ #endif // __WINDOWS__
if ( n == str.length() - 1 ) {
bracket = Bracket_None;
}
#endif
{
// variable doesn't exist => don't change anything
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
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
- #ifndef __WXMSW__
+ #ifndef __WINDOWS__
wxLogWarning(_("Environment variables expansion failed: missing '%c' at position %u in '%s'."),
(char)bracket, (unsigned int) (m + 1), str.c_str());
- #endif // __WXMSW__
+ #endif // __WINDOWS__
}
else {
// skip closing bracket unless the variables wasn't expanded
#if !defined(wxUSE_DATETIME) || wxUSE_DATETIME
#ifndef WX_PRECOMP
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#include "wx/msw/wrapwin.h"
#endif
#include "wx/string.h"
: (wxDateTime::WeekDay)(wd - 1);
}
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
wxDateTime& wxDateTime::SetFromMSWSysTime(const SYSTEMTIME& st)
{
st->wMilliseconds = 0;
}
-#endif // __WXMSW__
+#endif // __WINDOWS__
#endif // wxUSE_DATETIME
#if !defined(wxUSE_DATETIME) || wxUSE_DATETIME
#ifndef WX_PRECOMP
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#include "wx/msw/wrapwin.h"
#endif
#include "wx/string.h"
time_t time = GetTicks();
if ( (time != (time_t)-1) && !wxStrstr(format, wxT("%l"))
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
&& !wxStrstr(format, wxT("%z"))
#endif
)
#pragma hdrstop
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#include "wx/msw/msvcrt.h"
#endif
#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()
{
return 0;
}
-#endif // __WXMSW__ || __UNIX__
+#endif // __WINDOWS__ || __UNIX__
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!
-#if (!defined(__WXMSW__) && !defined(__UNIX__)) || defined(__EMX__)
+#if (!defined(__WINDOWS__) && !defined(__UNIX__)) || defined(__EMX__)
/* static */
void wxDynamicLibrary::Unload(wxDllType handle)
#endif
}
-#endif // !(__WXMSW__ || __UNIX__)
+#endif // !(__WINDOWS__ || __UNIX__)
void *wxDynamicLibrary::DoGetSymbol(const wxString &name, bool *success) const
{
{
if (platform == wxPLATFORM_CURRENT)
{
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
platform = wxPLATFORM_WINDOWS;
#elif defined(__WXGTK__) || defined(__WXMOTIF__)
platform = wxPLATFORM_UNIX;
}
// 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
WakeUp();
}
-#endif // __WXMSW__ || __WXMAC__ || __WXDFB__
+#endif // __WINDOWS__ || __WXMAC__ || __WXDFB__
#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 NOCRYPT
#define NOMCX
-#elif defined(__WXMSW__) && defined(__WXWINCE__)
+#elif defined(__WINDOWS__) && defined(__WXWINCE__)
#include "wx/msw/missing.h"
#elif (defined(__OS2__))
#include <io.h>
#define O_BINARY (0)
#endif //__UNIX__
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#include "wx/msw/mslu.h"
#endif
#include "wx/stdpaths.h"
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
#include "wx/msw/private.h"
#endif //windows.h
#if defined(__WXPM__)
static CharType *wxDoRealPath (CharType *path)
{
static const CharType SEP = wxFILE_SEP_PATH;
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
wxUnix2DosFilename(path);
#endif
if (path[0] && path[1]) {
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])
{
{
wxString buf = ::wxGetCwd();
wxChar ch = buf.Last();
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
if (ch != wxT('\\') && ch != wxT('/'))
buf << wxT("\\");
#else
trimchars[3] = 0;
static const CharType SEP = wxFILE_SEP_PATH;
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
//wxUnix2DosFilename(path);
#endif
s = nm;
d = lnm;
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
q = FALSE;
#else
q = nm[0] == wxT('\\') && nm[1] == wxT('~');
else
#else
while ((*d++ = *s) != 0) {
-# ifndef __WXMSW__
+# ifndef __WINDOWS__
if (*s == wxT('\\')) {
if ((*(d - 1) = *++s)!=0) {
s++;
#endif
// No env variables on WinCE
#ifndef __WXWINCE__
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
if (*s++ == wxT('$') && (*s == wxT('{') || *s == wxT(')')))
#else
if (*s++ == wxT('$'))
return NULL;
wxStrcpy (dest, filename);
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
wxUnix2DosFilename(dest);
#endif
i --;
}
-#if defined(__WXMSW__) || defined(__OS2__)
+#if defined(__WINDOWS__) || defined(__OS2__)
// Try Drive specifier
if (wxIsalpha (buf[0]) && buf[1] == wxT(':'))
{
i --;
}
-#if defined(__WXMSW__) || defined(__OS2__)
+#if defined(__WINDOWS__) || defined(__OS2__)
// Try Drive specifier
if (wxIsalpha (buf[0]) && buf[1] == wxT(':'))
{
{
if (*s == wxT('\\'))
*s = wxT('/');
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
else
*s = wxTolower(*s); // Case INDEPENDENT
#endif
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
-#if defined(__WXMSW__) || defined(__OS2__)
+#if defined(__WINDOWS__) || defined(__OS2__)
if (s)
while (*s)
{
wxUnusedVar(overwrite);
return false;
-#endif // __WXMSW__ && __WIN32__
+#endif // __WINDOWS__ && __WIN32__
return true;
}
// 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();
//
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:
#endif
#ifndef WX_PRECOMP
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#include "wx/msw/wrapwin.h" // For GetShort/LongPathName
#endif
#include "wx/dynarray.h"
#include "wx/msw/gccpriv.h"
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#include "wx/msw/private.h"
#endif
bool wxFileName::Rmdir(const wxString& dir, int flags)
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
if ( flags & wxPATH_RMDIR_RECURSIVE )
{
// SHFileOperation needs double null termination string
return true;
}
else if ( flags & wxPATH_RMDIR_FULL )
-#else // !__WXMSW__
+#else // !__WINDOWS__
if ( flags != 0 ) // wxPATH_RMDIR_FULL or wxPATH_RMDIR_RECURSIVE
-#endif // !__WXMSW__
+#endif // !__WINDOWS__
{
wxString path(dir);
if ( path.Last() != wxFILE_SEP_PATH )
cont = d.GetNext(&filename);
}
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
if ( flags & wxPATH_RMDIR_RECURSIVE )
{
// delete all files too
cont = d.GetNext(&filename);
}
}
-#endif // !__WXMSW__
+#endif // !__WINDOWS__
}
return ::wxRmdir(dir);
{
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 )
{
{
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;
path = wxURI::Unescape(path);
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// 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
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
#include "wx/msw/private.h" // includes windows.h for LOGFONT
#include "wx/msw/winundef.h"
#endif
#include "wx/scopedptr.h"
#include "wx/except.h"
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
#include "wx/msw/private.h"
#include "wx/msw/msvcrt.h"
}
} gs_enableLeakChecks;
#endif // wxCrtSetDbgFlag
-#endif // __WXMSW__
+#endif // __WINDOWS__
// ----------------------------------------------------------------------------
// private classes
wxLog::GetActiveTarget();
#endif // wxUSE_LOG
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// 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));
}
-#endif // __WXMSW__
+#endif // __WINDOWS__
return true;
}
// ----------------------------------------------------------------------------
// for MSW the real wxEntry is defined in msw/main.cpp
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
#define wxEntryReal wxEntry
-#endif // !__WXMSW__
+#endif // !__WINDOWS__
int wxEntryReal(int& argc, wxChar **argv)
{
// wxLanguageInfo
// ----------------------------------------------------------------------------
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// helper used by wxLanguageInfo::GetLocaleName() and elsewhere to determine
// whether the locale is Unicode-only (it is if this function returns empty
return locale;
}
-#endif // __WXMSW__
+#endif // __WINDOWS__
// ----------------------------------------------------------------------------
// wxLocale
// accessors for locale-dependent data
// ----------------------------------------------------------------------------
-#if defined(__WXMSW__) || defined(__WXOSX__)
+#if defined(__WINDOWS__) || defined(__WXOSX__)
namespace
{
const char* formatchars =
"dghHmMsSy"
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
"t"
#else
"EawD"
// between 1 and 2 digits for days
fmtWX += "%d";
break;
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
case 3: // ddd
fmtWX += "%a";
break;
wxFAIL_MSG( "too many 'd's" );
}
break;
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
case 'D':
switch ( lastCount )
{
wxASSERT_MSG( lastCount <= 2, "too many 'g's" );
break;
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
case 'a':
fmtWX += "%p";
break;
#endif
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
case 't':
switch ( lastCount )
{
} // anonymous namespace
-#endif // __WXMSW__ || __WXOSX__
+#endif // __WINDOWS__ || __WXOSX__
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
namespace
{
return str.AsString();
}
-#else // !__WXMSW__ && !__WXOSX__, assume generic POSIX
+#else // !__WINDOWS__ && !__WXOSX__, assume generic POSIX
namespace
{
// don't time stamp debug messages under MSW as debug viewers usually
// already have an option to do it
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
if ( level != wxLOG_Debug && level != wxLOG_Trace )
-#endif // __WXMSW__
+#endif // __WINDOWS__
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
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
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;
-#endif // !__WXMSW__
+#endif // !__WINDOWS__
}
return prefix + msg;
// get error code from syste
unsigned long wxSysErrorCode()
{
-#if defined(__WXMSW__) && !defined(__WXMICROWIN__)
+#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
return ::GetLastError();
#else //Unix
return errno;
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
}
return s_szBuf;
-#else // !__WXMSW__
+#else // !__WINDOWS__
#if wxUSE_UNICODE
static wchar_t s_wzBuf[1024];
wxConvCurrent->MB2WC(s_wzBuf, strerror((int)nErrCode),
#else
return strerror((int)nErrCode);
#endif
-#endif // __WXMSW__/!__WXMSW__
+#endif // __WINDOWS__/!__WINDOWS__
}
#endif // wxUSE_LOG
#include "wx/memory.h"
#ifndef WX_PRECOMP
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#include "wx/msw/wrapwin.h"
#endif
#include "wx/utils.h"
#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)
{
}
#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) )
va_start(ap, fmt);
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
wvsprintf(buffer,fmt,ap) ;
#else
vsprintf(buffer,fmt,ap) ;
wxDebugContext::GetStream().flush();
}
else
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#ifdef __WIN32__
OutputDebugString((LPCTSTR)buffer) ;
#else
va_start(ap, fmt);
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
wxWvsprintf(buffer,fmt,ap) ;
#else
vsprintf(buffer,fmt,ap) ;
wxDebugContext::GetStream().flush();
}
else
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#ifdef __WIN32__
OutputDebugString((LPCTSTR)buffer) ;
#else
#include <ctype.h>
// implementation classes:
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
#include "wx/msw/mimetype.h"
#elif ( defined(__WXMAC__) )
#include "wx/osx/mimetype.h"
if ( iconLoc )
{
iconLoc->SetFileName(m_info->GetIconFile());
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
iconLoc->SetIndex(m_info->GetIconIndex());
-#endif // __WXMSW__
+#endif // __WINDOWS__
}
return true;
if ( commands )
commands->Clear();
-#if defined (__WXMSW__) || defined(__UNIX__)
+#if defined (__WINDOWS__) || defined(__UNIX__)
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;
}
return count;
-#endif // __WXMSW__/| __UNIX__
+#endif // __WINDOWS__/| __UNIX__
}
bool wxFileType::Unassociate()
{
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
return m_impl->Unassociate();
#elif defined(__UNIX__)
return m_impl->Unassociate(this);
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);
bool wxFileType::SetDefaultIcon(const wxString& cmd, int index)
{
wxString sTmp = cmd;
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// 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") );
-#if defined (__WXMSW__) || defined(__UNIX__)
+#if defined (__WINDOWS__) || defined(__UNIX__)
return m_impl->SetDefaultIcon (cmd, index);
#else
wxUnusedVar(index);
{
EnsureImpl();
-#if defined(__WXMSW__) || defined(__UNIX__)
+#if defined(__WINDOWS__) || defined(__UNIX__)
return m_impl->Associate(ftInfo);
#else // other platforms
wxUnusedVar(ftInfo);
#endif
// provide stubs for the systems not implementing these functions
-#if !defined(__WXMSW__)
+#if !defined(__WINDOWS__)
wxPowerType wxGetPowerType()
{
// TODO: use POSIX getaddrinfo() (also available in Winsock 2) for simplicity
// and to use the same code for IPv4 and IPv6 support
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#define HAVE_INET_ADDR
#ifndef HAVE_GETHOSTBYNAME
#pragma warning(default:4706)
#endif
#endif
-#endif // __WXMSW__
+#endif // __WINDOWS__
// 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
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#include "wx/msw/wrapwin.h"
#endif
#include "wx/log.h"
namespace
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
struct PerfCounter
{
bool init;
} gs_perfCounter;
-#endif // __WXMSW__
+#endif // __WINDOWS__
const int MILLISECONDS_PER_SECOND = 1000;
const int MICROSECONDS_PER_MILLISECOND = 1000;
void wxStopWatch::DoStart()
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
if ( !gs_perfCounter.init )
{
wxCRIT_SECT_LOCKER(lock, gs_perfCounter.cs);
gs_perfCounter.init = true;
}
-#endif // __WXMSW__
+#endif // __WINDOWS__
m_t0 = GetCurrentClockValue();
}
wxLongLong wxStopWatch::GetClockFreq() const
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
// 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;
-#endif // __WXMSW__
+#endif // __WINDOWS__
#ifdef HAVE_GETTIMEOFDAY
// With gettimeofday() we can have nominally microsecond precision and
wxLongLong wxStopWatch::GetCurrentClockValue() const
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
if ( gs_perfCounter.CanBeUsed() )
{
LARGE_INTEGER counter;
::QueryPerformanceCounter(&counter);
return counter.QuadPart;
}
-#endif // __WXMSW__
+#endif // __WINDOWS__
#ifdef HAVE_GETTIMEOFDAY
return wxGetUTCTimeUSec();
#include "wx/vector.h"
#include "wx/xlocale.h"
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#include "wx/msw/wrapwin.h"
-#endif // __WXMSW__
+#endif // __WINDOWS__
#if wxUSE_STD_IOSTREAM
#include <sstream>
#include "wx/time.h"
#ifndef WX_PRECOMP
- #ifdef __WXMSW__
+ #ifdef __WINDOWS__
#include "wx/msw/wrapwin.h"
#endif
#include "wx/intl.h"
# endif
#endif
-#if defined(__MWERKS__) && defined(__WXMSW__)
+#if defined(__MWERKS__) && defined(__WINDOWS__)
# undef HAVE_FTIME
# undef HAVE_GETTIMEOFDAY
#endif
wxLongLong wxGetUTCTimeUSec()
{
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
FILETIME ft;
::GetSystemTimeAsFileTime(&ft);
// If possible, use a function which avoids conversions from
// broken-up time structures to milliseconds
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
FILETIME ft;
::GetSystemTimeAsFileTime(&ft);
#include "wx/stdpaths.h"
#include "wx/hashset.h"
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#include "wx/msw/wrapwin.h"
#endif
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 = 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;
#include <sys/stat.h>
#endif
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
#include "wx/msw/private.h"
#include "wx/filesys.h"
#endif
bool wxPlatform::Is(int platform)
{
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
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.
-#ifndef __WXMSW__
+#ifndef __WINDOWS__
extern char **environ;
-#endif // !__WXMSW__
+#endif // !__WINDOWS__
char **env = environ;
#endif
// Launch default browser
// ----------------------------------------------------------------------------
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
// 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;
-#if defined(__WXMSW__)
+#if defined(__WINDOWS__)
// 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
-#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 "wx/iconloc.h"
#include "wx/confbase.h"
-#ifdef __WXMSW__
+#ifdef __WINDOWS__
#include "wx/msw/registry.h"
#include "wx/msw/private.h"
#endif // OS