// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifndef __DEFSH__
-#define __DEFSH__
+#ifndef _WX_DEFS_H_
+#define _WX_DEFS_H_
#ifdef __GNUG__
#pragma interface "defs.h"
#endif
#if defined(__WXMOTIF__)
# define __X__
-#elif defined(__WXMSW__) || defined(__WINDOWS_386__) || defined(__NT__) || defined(__MSDOS__)
-# ifndef __WXMSW__
-# define __WXMSW__
-# endif
#endif
// wxWindows checks for WIN32, not __WIN32__
-#if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__))
+#if ((defined(WIN32) || defined(__NT__)) && !defined(__WIN32__) && !defined(__WXSTUBS__))
#define __WIN32__
#endif
// Make sure the environment is set correctly
#if defined(__WXMSW__) && defined(__X__)
# error "Target can't be both X and Windows"
-#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__MAC__) && !defined(__X__)
-#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__MAC__]"
+#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
+ !defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__)
+#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXSTUBS__]"
#endif
-#if defined(__WXMOTIF__) || defined(__WXGTK__)
+#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXSTUBS__)
// Bool is now obsolete, use bool instead
// typedef int Bool;
/** @name Very common macros */
// ----------------------------------------------------------------------------
//@{
-/// delete pointer if it is not NULL
-#define DELETEP(p) if ( (p) != NULL ) delete (p)
-/// delete array pointer if it is not NULL
-#define DELETEA(p) if ( (p) != NULL ) delete [] (p)
+/// delete pointer if it is not NULL and NULL it afterwards
+// (checking that it's !NULL before passing it to delete is just a
+// a question of style, because delete will do it itself anyhow, but it might
+// be considered as an error by some overzealous debugging implementations of
+// the library, so we do it ourselves)
+#define wxDELETE(p) if ( (p) != NULL ) { delete (p); p = NULL; }
+
+// delete an array and NULL it (see comments above)
+#define wxDELETEA(p) if ( (p) != NULL ) { delete [] (p); p = NULL; }
/// size of statically declared array
#define WXSIZEOF(array) (sizeof(array)/sizeof(array[0]))
#endif
#ifndef __UNIX__ // Windows
- #ifndef __WXMSW__
- #define __WXMSW__
- #endif
-
#if defined(_MSC_VER)
#define __VISUALC__
#elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__)
#elif defined(__WXMSW__)
#define FILE_PATH_SEPARATOR ('\\')
#else
- #error "don't know path separator for this platform"
+ #define FILE_PATH_SEPARATOR ('/')
#endif
// ----------------------------------------------------------------------------
* Styles for wxListBox
*/
-// In wxListBox style flag
-#define wxSB_MASK 0x0008
-#define wxNEEDED_SB 0x0000
-#define wxALWAYS_SB 0x0008
-
-// New naming convention
-#define wxLB_NEEDED_SB wxNEEDED_SB
-#define wxLB_ALWAYS_SB wxALWAYS_SB
#define wxLB_SORT 0x0010
-// These duplicate the styles in the Multiple argument
-#define wxLB_SINGLE 0x0000
+#define wxLB_SINGLE 0x0020
#define wxLB_MULTIPLE 0x0040
#define wxLB_EXTENDED 0x0080
// wxLB_OWNERDRAW is Windows-only
#define wxLB_OWNERDRAW 0x0100
+#define wxLB_NEEDED_SB 0x0200
+#define wxLB_ALWAYS_SB 0x0400
#define wxLB_HSCROLL wxHSCROLL
/*
#define wxTE_READONLY 0x0010
#define wxTE_MULTILINE 0x0020
-// TODO For backward compatibility, need wxOLD_READONLY
-#define wxREADONLY wxTE_READONLY
-#define wxEDITABLE 0
-
-// #define wxTE_RICHTEXT 0x0020
+// MSW-only
+#define wxTE_RICHTEXT 0x0020
/*
* wxComboBox style flags
*/
#define wxCB_SIMPLE 0x0004
-#define wxCB_DROPDOWN 0x0000
#define wxCB_SORT 0x0008
-#define wxCB_READONLY wxREADONLY
+#define wxCB_READONLY 0x0010
+#define wxCB_DROPDOWN 0x0020
/*
* wxRadioBox/wxRadioButton style flags
// OS mnemonics -- Identify the running OS (useful for Windows)
// [Not all platforms are currently available or supported]
enum {
- wxCURSES,
+ wxUNKNOWN_PLATFORM,
+ wxCURSES, // Text-only CURSES
wxXVIEW_X, // Sun's XView OpenLOOK toolkit
wxMOTIF_X, // OSF Motif 1.x.x
- wxCOSE_X, // OSF Common Desktop Environment
+ wxCOSE_X, // OSF Common Desktop Environment
wxNEXTSTEP, // NeXTStep
wxMACINTOSH, // Apple System 7
- wxGEOS, // GEOS
- wxOS2_PM, // OS/2 Workplace
+ wxGTK, // GTK
+ wxQT, // Qt
+ wxGEOS, // GEOS
+ wxOS2_PM, // OS/2 Workplace
wxWINDOWS, // Windows or WfW
wxPENWINDOWS, // Windows for Pen Computing
wxWINDOWS_NT, // Windows NT
- wxWIN32S, // Windows 32S API
- wxWIN95, // Windows 95
- wxWIN386 // Watcom 32-bit supervisor modus
+ wxWIN32S, // Windows 32S API
+ wxWIN95, // Windows 95
+ wxWIN386 // Watcom 32-bit supervisor modus
};
// Printing
typedef void * WXDRAWITEMSTRUCT;
typedef void * WXMEASUREITEMSTRUCT;
typedef void * WXLPCREATESTRUCT;
+#ifdef __GNUWIN32__
typedef int (*WXFARPROC)();
+#else
+typedef int (__stdcall *WXFARPROC)();
+#endif
#endif
#endif
- // __WXDEFSH__
+ // _WX_DEFS_H_