Changes to WXDLLEXPORT keyword position for VC++ 6.0; changed

wxTrace to wxDebugLog in memory.cpp and also app.cpp (please check this works
on wxGTK!)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-11-22 22:32:53 +00:00
parent c2cde53a09
commit 184b5d99a5
36 changed files with 408 additions and 334 deletions

View File

@@ -2,6 +2,19 @@
wxWindows 2.0 for Windows Change Log wxWindows 2.0 for Windows Change Log
------------------------------------ ------------------------------------
Alpha 17, November 22nd 1998
----------------------------
- More documentation updates, especially for
wxLayoutWindow classes and debugging facilities.
- Changed wxDebugContext to use wxDebugLog instead
of wxTrace.
- Now supports VC++ 6.0, and hopefully BC++ 5.0.
However, DLL support may be broken for BC++ since
VC++ 6 required changing of WXDLLEXPORT keyword
position.
- Numerous miscellaneous changes.
Alpha 16, September 8th 1998 Alpha 16, September 8th 1998
---------------------------- ----------------------------

View File

@@ -150,7 +150,7 @@ typedef int wxWindowID;
# ifdef WXMAKINGDLL # ifdef WXMAKINGDLL
# define WXDLLEXPORT __declspec( dllexport ) # define WXDLLEXPORT __declspec( dllexport )
# define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type # define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type
# define WXDLLEXPORT_CTORFN __declspec( dllexport ) # define WXDLLEXPORT_CTORFN // __declspec( dllexport )
# elif defined(WXUSINGDLL) # elif defined(WXUSINGDLL)
# define WXDLLEXPORT __declspec( dllimport ) # define WXDLLEXPORT __declspec( dllimport )
# define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type # define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type

View File

@@ -40,101 +40,101 @@ typedef enum {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// functions // functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool WXDLLEXPORT wxFileExists(const wxString& filename); WXDLLEXPORT bool wxFileExists(const wxString& filename);
#define FileExists wxFileExists #define FileExists wxFileExists
// does the path exist? (may have or not '/' or '\\' at the end) // does the path exist? (may have or not '/' or '\\' at the end)
bool WXDLLEXPORT wxPathExists(const char *pszPathName); WXDLLEXPORT bool wxPathExists(const char *pszPathName);
#define wxDirExists wxPathExists #define wxDirExists wxPathExists
#define DirExists wxDirExists #define DirExists wxDirExists
bool WXDLLEXPORT wxIsAbsolutePath(const wxString& filename); WXDLLEXPORT bool wxIsAbsolutePath(const wxString& filename);
#define IsAbsolutePath wxIsAbsolutePath #define IsAbsolutePath wxIsAbsolutePath
// Get filename // Get filename
char* WXDLLEXPORT wxFileNameFromPath(char *path); WXDLLEXPORT char* wxFileNameFromPath(char *path);
wxString WXDLLEXPORT wxFileNameFromPath(const wxString& path); WXDLLEXPORT wxString wxFileNameFromPath(const wxString& path);
#define FileNameFromPath wxFileNameFromPath #define FileNameFromPath wxFileNameFromPath
// Get directory // Get directory
char* WXDLLEXPORT wxPathOnly(char *path); WXDLLEXPORT char* wxPathOnly(char *path);
wxString WXDLLEXPORT wxPathOnly(const wxString& path); WXDLLEXPORT wxString wxPathOnly(const wxString& path);
#define PathOnly wxPathOnly #define PathOnly wxPathOnly
// wxString version // wxString version
wxString WXDLLEXPORT wxRealPath(const wxString& path); WXDLLEXPORT wxString wxRealPath(const wxString& path);
void WXDLLEXPORT wxDos2UnixFilename(char *s); WXDLLEXPORT void wxDos2UnixFilename(char *s);
#define Dos2UnixFilename wxDos2UnixFilename #define Dos2UnixFilename wxDos2UnixFilename
void WXDLLEXPORT wxUnix2DosFilename(char *s); WXDLLEXPORT void wxUnix2DosFilename(char *s);
#define Unix2DosFilename wxUnix2DosFilename #define Unix2DosFilename wxUnix2DosFilename
// Strip the extension, in situ // Strip the extension, in situ
void WXDLLEXPORT wxStripExtension(char *buffer); WXDLLEXPORT void wxStripExtension(char *buffer);
void WXDLLEXPORT wxStripExtension(wxString& buffer); WXDLLEXPORT void wxStripExtension(wxString& buffer);
// Get a temporary filename, opening and closing the file. // Get a temporary filename, opening and closing the file.
char* WXDLLEXPORT wxGetTempFileName(const wxString& prefix, char *buf = (char *) NULL); WXDLLEXPORT char* wxGetTempFileName(const wxString& prefix, char *buf = (char *) NULL);
// Expand file name (~/ and ${OPENWINHOME}/ stuff) // Expand file name (~/ and ${OPENWINHOME}/ stuff)
char* WXDLLEXPORT wxExpandPath(char *dest, const char *path); WXDLLEXPORT char* wxExpandPath(char *dest, const char *path);
// Contract w.r.t environment (</usr/openwin/lib, OPENWHOME> -> ${OPENWINHOME}/lib) // Contract w.r.t environment (</usr/openwin/lib, OPENWHOME> -> ${OPENWINHOME}/lib)
// and make (if under the home tree) relative to home // and make (if under the home tree) relative to home
// [caller must copy-- volatile] // [caller must copy-- volatile]
char* WXDLLEXPORT wxContractPath (const wxString& filename, WXDLLEXPORT char* wxContractPath (const wxString& filename,
const wxString& envname = "", const wxString& user = ""); const wxString& envname = "", const wxString& user = "");
// Destructive removal of /./ and /../ stuff // Destructive removal of /./ and /../ stuff
char* WXDLLEXPORT wxRealPath(char *path); WXDLLEXPORT char* wxRealPath(char *path);
// Allocate a copy of the full absolute path // Allocate a copy of the full absolute path
char* WXDLLEXPORT wxCopyAbsolutePath(const wxString& path); WXDLLEXPORT char* wxCopyAbsolutePath(const wxString& path);
// Get first file name matching given wild card. // Get first file name matching given wild card.
// Flags are reserved for future use. // Flags are reserved for future use.
#define wxFILE 1 #define wxFILE 1
#define wxDIR 2 #define wxDIR 2
char* WXDLLEXPORT wxFindFirstFile(const char *spec, int flags = wxFILE); WXDLLEXPORT char* wxFindFirstFile(const char *spec, int flags = wxFILE);
char* WXDLLEXPORT wxFindNextFile(void); WXDLLEXPORT char* wxFindNextFile(void);
// Does the pattern contain wildcards? // Does the pattern contain wildcards?
bool WXDLLEXPORT wxIsWild(const wxString& pattern); WXDLLEXPORT bool wxIsWild(const wxString& pattern);
// Does the pattern match the text (usually a filename)? // Does the pattern match the text (usually a filename)?
// If dot_special is TRUE, doesn't match * against . (eliminating // If dot_special is TRUE, doesn't match * against . (eliminating
// `hidden' dot files) // `hidden' dot files)
bool WXDLLEXPORT wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = TRUE); WXDLLEXPORT bool wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = TRUE);
// Concatenate two files to form third // Concatenate two files to form third
bool WXDLLEXPORT wxConcatFiles(const wxString& file1, const wxString& file2, const wxString& file3); WXDLLEXPORT bool wxConcatFiles(const wxString& file1, const wxString& file2, const wxString& file3);
// Copy file1 to file2 // Copy file1 to file2
bool WXDLLEXPORT wxCopyFile(const wxString& file1, const wxString& file2); WXDLLEXPORT bool wxCopyFile(const wxString& file1, const wxString& file2);
// Remove file // Remove file
bool WXDLLEXPORT wxRemoveFile(const wxString& file); WXDLLEXPORT bool wxRemoveFile(const wxString& file);
// Rename file // Rename file
bool WXDLLEXPORT wxRenameFile(const wxString& file1, const wxString& file2); WXDLLEXPORT bool wxRenameFile(const wxString& file1, const wxString& file2);
// Get current working directory. // Get current working directory.
// If buf is NULL, allocates space using new, else // If buf is NULL, allocates space using new, else
// copies into buf. // copies into buf.
// IMPORTANT NOTE getcwd is know not to work under some releases // IMPORTANT NOTE getcwd is know not to work under some releases
// of Win32s 1.3, according to MS release notes! // of Win32s 1.3, according to MS release notes!
char* WXDLLEXPORT wxGetWorkingDirectory(char *buf = (char *) NULL, int sz = 1000); WXDLLEXPORT char* wxGetWorkingDirectory(char *buf = (char *) NULL, int sz = 1000);
// Set working directory // Set working directory
bool WXDLLEXPORT wxSetWorkingDirectory(const wxString& d); WXDLLEXPORT bool wxSetWorkingDirectory(const wxString& d);
// Make directory // Make directory
bool WXDLLEXPORT wxMkdir(const wxString& dir); WXDLLEXPORT bool wxMkdir(const wxString& dir);
// Remove directory. Flags reserved for future use. // Remove directory. Flags reserved for future use.
bool WXDLLEXPORT wxRmdir(const wxString& dir, int flags = 0); WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0);
// separators in file names // separators in file names
#define FILE_SEP_EXT '.' #define FILE_SEP_EXT '.'
@@ -169,17 +169,17 @@ inline bool wxIsPathSeparator(char c)
{ return c == FILE_SEP_PATH_DOS || c == FILE_SEP_PATH_UNIX; } { return c == FILE_SEP_PATH_DOS || c == FILE_SEP_PATH_UNIX; }
// does the string ends with path separator? // does the string ends with path separator?
bool WXDLLEXPORT wxEndsWithPathSeparator(const char *pszFileName); WXDLLEXPORT bool wxEndsWithPathSeparator(const char *pszFileName);
// split the full path into path (including drive for DOS), name and extension // split the full path into path (including drive for DOS), name and extension
// (understands both '/' and '\\') // (understands both '/' and '\\')
void WXDLLEXPORT wxSplitPath(const char *pszFileName, WXDLLEXPORT void wxSplitPath(const char *pszFileName,
wxString *pstrPath, wxString *pstrPath,
wxString *pstrName, wxString *pstrName,
wxString *pstrExt); wxString *pstrExt);
// find a file in a list of directories, returns false if not found // find a file in a list of directories, returns false if not found
bool WXDLLEXPORT wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile); WXDLLEXPORT bool wxFindFileInPath(wxString *pStr, const char *pszPath, const char *pszFile);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// classes // classes

View File

@@ -56,43 +56,43 @@ protected:
char* m_clientData; char* m_clientData;
}; };
wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption, WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL, int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, bool centre = TRUE, int x = -1, int y = -1, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT); int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
wxString WXDLLEXPORT wxGetSingleChoice(const wxString& message, const wxString& caption, WXDLLEXPORT wxString wxGetSingleChoice(const wxString& message, const wxString& caption,
int n, char *choices[], wxWindow *parent = (wxWindow *) NULL, int n, char *choices[], wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, bool centre = TRUE, int x = -1, int y = -1, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT); int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
// Same as above but gets position in list of strings, instead of string, // Same as above but gets position in list of strings, instead of string,
// or -1 if no selection // or -1 if no selection
int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL, int n, const wxString *choices, wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, bool centre = TRUE, int x = -1, int y = -1, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT); int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
int WXDLLEXPORT wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, WXDLLEXPORT int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption,
int n, char *choices[], wxWindow *parent = (wxWindow *) NULL, int n, char *choices[], wxWindow *parent = (wxWindow *) NULL,
int x = -1, int y = -1, bool centre = TRUE, int x = -1, int y = -1, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT); int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
// Return client data instead // Return client data instead
char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption, WXDLLEXPORT char* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
int n, const wxString *choices, char **client_data, int n, const wxString *choices, char **client_data,
wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1, wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
bool centre = TRUE, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT); int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
char* WXDLLEXPORT wxGetSingleChoiceData(const wxString& message, const wxString& caption, WXDLLEXPORT char* wxGetSingleChoiceData(const wxString& message, const wxString& caption,
int n, char *choices[], char **client_data, int n, char *choices[], char **client_data,
wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1, wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1,
bool centre = TRUE, bool centre = TRUE,
int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT); int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT);
/* /*
int WXDLLEXPORT wxGetMultipleChoice(const wxString& message, const wxString& caption, WXDLLEXPORT int wxGetMultipleChoice(const wxString& message, const wxString& caption,
int n, const wxString *choices, int n, const wxString *choices,
int nsel, int * selection, int nsel, int * selection,
wxWindow *parent = NULL, int x = -1 , int y = -1, bool centre = TRUE, wxWindow *parent = NULL, int x = -1 , int y = -1, bool centre = TRUE,

View File

@@ -115,10 +115,10 @@ private:
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// global functions // global functions
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxLocale* WXDLLEXPORT wxGetLocale(); WXDLLEXPORT wxLocale* wxGetLocale();
// get the translation of the string in the current locale // get the translation of the string in the current locale
inline WXDLLEXPORT const char *wxGetTranslation(const char *sz) inline const char *wxGetTranslation(const char *sz)
{ {
wxLocale *pLoc = wxGetLocale(); wxLocale *pLoc = wxGetLocale();
return pLoc == (wxLocale *) NULL ? sz : pLoc->GetString(sz); return pLoc == (wxLocale *) NULL ? sz : pLoc->GetString(sz);

View File

@@ -379,9 +379,9 @@ WXDLLEXPORT_DATA(extern bool) g_bVerbose;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// return the last system error code // return the last system error code
unsigned long WXDLLEXPORT wxSysErrorCode(); WXDLLEXPORT unsigned long wxSysErrorCode();
// return the error message for given (or last if 0) error code // return the error message for given (or last if 0) error code
const char* WXDLLEXPORT wxSysErrorMsg(unsigned long nErrCode = 0); WXDLLEXPORT const char* wxSysErrorMsg(unsigned long nErrCode = 0);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// debug only logging functions: use them with API name and error code // debug only logging functions: use them with API name and error code

View File

@@ -56,16 +56,17 @@ void wxDebugFree(void * buf, bool isVect = FALSE);
void * operator new (size_t size, char * fileName, int lineNum); void * operator new (size_t size, char * fileName, int lineNum);
void operator delete (void * buf); void operator delete (void * buf);
// VC++ 6.0
#if _MSC_VER >= 1200
void operator delete(void *buf, char*, int);
#endif
#if !( defined (_MSC_VER) && (_MSC_VER <= 1020) ) #if !( defined (_MSC_VER) && (_MSC_VER <= 1020) )
void * operator new[] (size_t size, char * fileName, int lineNum); void * operator new[] (size_t size, char * fileName, int lineNum);
void operator delete[] (void * buf); void operator delete[] (void * buf);
#endif #endif
// VC++ 6.0
#if _MSC_VER >= 1200
void operator delete(void *buf, char*, int);
void operator delete[](void *buf, char*, int);
#endif
#endif #endif
#endif #endif

View File

@@ -23,16 +23,16 @@
#include "wx/list.h" #include "wx/list.h"
bool WXDLLEXPORT wxOpenClipboard(void); WXDLLEXPORT bool wxOpenClipboard(void);
bool WXDLLEXPORT wxClipboardOpen(void); WXDLLEXPORT bool wxClipboardOpen(void);
bool WXDLLEXPORT wxCloseClipboard(void); WXDLLEXPORT bool wxCloseClipboard(void);
bool WXDLLEXPORT wxEmptyClipboard(void); WXDLLEXPORT bool wxEmptyClipboard(void);
bool WXDLLEXPORT wxIsClipboardFormatAvailable(int dataFormat); WXDLLEXPORT bool wxIsClipboardFormatAvailable(int dataFormat);
bool WXDLLEXPORT wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0); WXDLLEXPORT bool wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0);
wxObject* WXDLLEXPORT wxGetClipboardData(int dataFormat, long *len = NULL); WXDLLEXPORT wxObject* wxGetClipboardData(int dataFormat, long *len = NULL);
int WXDLLEXPORT wxEnumClipboardFormats(int dataFormat); WXDLLEXPORT int wxEnumClipboardFormats(int dataFormat);
int WXDLLEXPORT wxRegisterClipboardFormat(char *formatName); WXDLLEXPORT int wxRegisterClipboardFormat(char *formatName);
bool WXDLLEXPORT wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount); WXDLLEXPORT bool wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount);
/* The following is Matthew Flatt's implementation of the MSW /* The following is Matthew Flatt's implementation of the MSW
* side of generic clipboard functionality. * side of generic clipboard functionality.
@@ -101,7 +101,7 @@ class WXDLLEXPORT wxClipboard : public wxObject
}; };
/* Initialize wxTheClipboard. Can be called repeatedly */ /* Initialize wxTheClipboard. Can be called repeatedly */
void WXDLLEXPORT wxInitClipboard(void); WXDLLEXPORT void wxInitClipboard(void);
/* The clipboard */ /* The clipboard */
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard; WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;

View File

@@ -68,22 +68,22 @@ public:
#define wxFILE_MUST_EXIST 0x0010 #define wxFILE_MUST_EXIST 0x0010
// File selector - backward compatibility // File selector - backward compatibility
char* WXDLLEXPORT wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, WXDLLEXPORT char* wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
const char *default_filename = NULL, const char *default_extension = NULL, const char *default_filename = NULL, const char *default_extension = NULL,
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
wxWindow *parent = NULL, int x = -1, int y = -1); wxWindow *parent = NULL, int x = -1, int y = -1);
// An extended version of wxFileSelector // An extended version of wxFileSelector
char* WXDLLEXPORT wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL, WXDLLEXPORT char* wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
const char *default_filename = NULL, int *indexDefaultExtension = NULL, const char *default_filename = NULL, int *indexDefaultExtension = NULL,
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
wxWindow *parent = NULL, int x = -1, int y = -1); wxWindow *parent = NULL, int x = -1, int y = -1);
// Generic file load dialog // Generic file load dialog
char* WXDLLEXPORT wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); WXDLLEXPORT char* wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
// Generic file save dialog // Generic file save dialog
char* WXDLLEXPORT wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL); WXDLLEXPORT char* wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
#endif #endif
// _WX_FILEDLG_H_ // _WX_FILEDLG_H_

View File

@@ -25,7 +25,13 @@ WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr;
// define the array of list box items // define the array of list box items
#include <wx/dynarray.h> #include <wx/dynarray.h>
#undef WXDLLEXPORTLOCAL
#define WXDLLEXPORTLOCAL WXDLLEXPORT
WX_DEFINE_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray); WX_DEFINE_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray);
#undef WXDLLEXPORTLOCAL
#define WXDLLEXPORTLOCAL
#endif #endif
// forward decl for GetSelections() // forward decl for GetSelections()

View File

@@ -32,8 +32,15 @@ class WXDLLEXPORT wxWindow;
// array of notebook pages // array of notebook pages
typedef wxWindow WXDLLEXPORT wxNotebookPage; // so far, any window can be a page typedef wxWindow WXDLLEXPORT wxNotebookPage; // so far, any window can be a page
#undef WXDLLEXPORTLOCAL
#define WXDLLEXPORTLOCAL WXDLLEXPORT
WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages); WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages);
#undef WXDLLEXPORTLOCAL
#define WXDLLEXPORTLOCAL
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// notebook events // notebook events
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@@ -20,10 +20,10 @@
class WXDLLEXPORT wxFont ; class WXDLLEXPORT wxFont ;
void WXDLLEXPORT wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font); WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font);
void WXDLLEXPORT wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos); WXDLLEXPORT void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos);
wxWindow* WXDLLEXPORT wxFindWinFromHandle(WXHWND hWnd); WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd);
void WXDLLEXPORT wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos); WXDLLEXPORT void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos);
WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_ICON; WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_ICON;
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDIPARENTFRAME_ICON; WXDLLEXPORT_DATA(extern HICON) wxSTD_MDIPARENTFRAME_ICON;
@@ -33,9 +33,9 @@ WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDIPARENTFRAME_ICON;
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON; WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON;
WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT; WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
extern HINSTANCE WXDLLEXPORT wxGetInstance(); WXDLLEXPORT HINSTANCE wxGetInstance();
void WXDLLEXPORT wxFillLogFont(LOGFONT *logFont, wxFont *font); WXDLLEXPORT void wxFillLogFont(LOGFONT *logFont, wxFont *font);
wxFont WXDLLEXPORT wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNew = TRUE); WXDLLEXPORT wxFont wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNew = TRUE);
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
# define CASTWNDPROC (long unsigned) # define CASTWNDPROC (long unsigned)
@@ -68,9 +68,9 @@ typedef signed short int SHORT ;
#endif #endif
#if wxUSE_PENWIN #if wxUSE_PENWIN
void WXDLLEXPORT wxRegisterPenWin(void); WXDLLEXPORT void wxRegisterPenWin(void);
void WXDLLEXPORT wxCleanUpPenWin(void); WXDLLEXPORT void wxCleanUpPenWin(void);
void WXDLLEXPORT wxEnablePenAppHooks (bool hook); WXDLLEXPORT void wxEnablePenAppHooks (bool hook);
#endif #endif
#if wxUSE_ITSY_BITSY #if wxUSE_ITSY_BITSY
@@ -136,7 +136,7 @@ extern LONG APIENTRY _EXPORT
wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
// Find maximum size of window/rectangle // Find maximum size of window/rectangle
extern void WXDLLEXPORT wxFindMaxSize(WXHWND hwnd, RECT *rect); WXDLLEXPORT extern void wxFindMaxSize(WXHWND hwnd, RECT *rect);
// List of scrollbar controls // List of scrollbar controls
WXDLLEXPORT_DATA(extern wxList) wxScrollBarList; WXDLLEXPORT_DATA(extern wxList) wxScrollBarList;
@@ -145,14 +145,14 @@ WXDLLEXPORT_DATA(extern FARPROC) wxGenericControlSubClassProc;
WXDLLEXPORT_DATA(extern char*) wxBuffer; WXDLLEXPORT_DATA(extern char*) wxBuffer;
WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance; WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance;
wxWindow* WXDLLEXPORT wxFindControlFromHandle(WXHWND hWnd); WXDLLEXPORT wxWindow* wxFindControlFromHandle(WXHWND hWnd);
void WXDLLEXPORT wxAddControlHandle(WXHWND hWnd, wxWindow *item); WXDLLEXPORT void wxAddControlHandle(WXHWND hWnd, wxWindow *item);
// Safely get the window text (i.e. without using fixed size buffer) // Safely get the window text (i.e. without using fixed size buffer)
extern wxString WXDLLEXPORT wxGetWindowText(WXHWND hWnd); WXDLLEXPORT extern wxString wxGetWindowText(WXHWND hWnd);
// Does this window style specify any border? // Does this window style specify any border?
inline bool WXDLLEXPORT wxStyleHasBorder(long style) inline bool wxStyleHasBorder(long style)
{ {
return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER | return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER |
wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0; wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;

View File

@@ -30,7 +30,7 @@
#define wxUSE_AUTOTRANS 1 #define wxUSE_AUTOTRANS 1
// Define wxTString // Define wxTString
#define wxUSE_POSTSCRIPT 1 #define wxUSE_POSTSCRIPT 0
// 0 for no PostScript device context // 0 for no PostScript device context
#define wxUSE_AFM_FOR_POSTSCRIPT 0 #define wxUSE_AFM_FOR_POSTSCRIPT 0
// 1 to use font metric files in GetTextExtent // 1 to use font metric files in GetTextExtent

View File

@@ -728,15 +728,15 @@ inline int wxWindow::GetReturnCode(void) { return m_returnCode; }
inline bool wxWindow::IsBeingDeleted(void) { return m_isBeingDeleted; } inline bool wxWindow::IsBeingDeleted(void) { return m_isBeingDeleted; }
// Window specific (so far) // Window specific (so far)
wxWindow* WXDLLEXPORT wxGetActiveWindow(void); WXDLLEXPORT wxWindow* wxGetActiveWindow(void);
WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows; WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;
int WXDLLEXPORT wxCharCodeMSWToWX(int keySym); WXDLLEXPORT int wxCharCodeMSWToWX(int keySym);
int WXDLLEXPORT wxCharCodeWXToMSW(int id, bool *IsVirtual); WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
// Allocates control ids // Allocates control ids
int WXDLLEXPORT NewControlId(void); WXDLLEXPORT int NewControlId(void);
#endif #endif
// _WX_WINDOW_H_ // _WX_WINDOW_H_

View File

@@ -96,10 +96,10 @@ public:
static wxHashTable* sm_classTable; static wxHashTable* sm_classTable;
}; };
wxObject* WXDLLEXPORT wxCreateDynamicObject(const char *name); WXDLLEXPORT wxObject* wxCreateDynamicObject(const char *name);
#ifdef wxUSE_SERIAL #ifdef wxUSE_SERIAL
wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream ); WXDLLEXPORT wxObject* wxCreateStoredObject( wxInputStream& stream );
#endif #endif
#define DECLARE_DYNAMIC_CLASS(name) \ #define DECLARE_DYNAMIC_CLASS(name) \

View File

@@ -186,26 +186,26 @@ enum {
};// ps_action = PS_PREVIEW; };// ps_action = PS_PREVIEW;
// PostScript printer settings // PostScript printer settings
void WXDLLEXPORT wxSetPrinterCommand(const char *cmd); WXDLLEXPORT void wxSetPrinterCommand(const char *cmd);
void WXDLLEXPORT wxSetPrintPreviewCommand(const char *cmd); WXDLLEXPORT void wxSetPrintPreviewCommand(const char *cmd);
void WXDLLEXPORT wxSetPrinterOptions(const char *flags); WXDLLEXPORT void wxSetPrinterOptions(const char *flags);
void WXDLLEXPORT wxSetPrinterOrientation(int orientation); WXDLLEXPORT void wxSetPrinterOrientation(int orientation);
void WXDLLEXPORT wxSetPrinterScaling(double x, double y); WXDLLEXPORT void wxSetPrinterScaling(double x, double y);
void WXDLLEXPORT wxSetPrinterTranslation(long x, long y); WXDLLEXPORT void wxSetPrinterTranslation(long x, long y);
void WXDLLEXPORT wxSetPrinterMode(int mode); WXDLLEXPORT void wxSetPrinterMode(int mode);
void WXDLLEXPORT wxSetPrinterFile(const char *f); WXDLLEXPORT void wxSetPrinterFile(const char *f);
void WXDLLEXPORT wxSetAFMPath(const char *f); WXDLLEXPORT void wxSetAFMPath(const char *f);
// Get current values // Get current values
char* WXDLLEXPORT wxGetPrinterCommand(void); WXDLLEXPORT char* wxGetPrinterCommand(void);
char* WXDLLEXPORT wxGetPrintPreviewCommand(void); WXDLLEXPORT char* wxGetPrintPreviewCommand(void);
char* WXDLLEXPORT wxGetPrinterOptions(void); WXDLLEXPORT char* wxGetPrinterOptions(void);
int WXDLLEXPORT wxGetPrinterOrientation(void); WXDLLEXPORT int wxGetPrinterOrientation(void);
void WXDLLEXPORT wxGetPrinterScaling(double* x, double* y); WXDLLEXPORT void wxGetPrinterScaling(double* x, double* y);
void WXDLLEXPORT wxGetPrinterTranslation(long *x, long *y); WXDLLEXPORT void wxGetPrinterTranslation(long *x, long *y);
int WXDLLEXPORT wxGetPrinterMode(void); WXDLLEXPORT int wxGetPrinterMode(void);
char* WXDLLEXPORT wxGetPrinterFile(void); WXDLLEXPORT char* wxGetPrinterFile(void);
char* WXDLLEXPORT wxGetAFMPath(void); WXDLLEXPORT char* wxGetAFMPath(void);
/* /*
* PostScript print setup information * PostScript print setup information
@@ -264,8 +264,8 @@ class WXDLLEXPORT wxPrintSetupData: public wxObject
void operator=(wxPrintSetupData& data); void operator=(wxPrintSetupData& data);
}; };
extern wxPrintSetupData* WXDLLEXPORT wxThePrintSetupData; WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData;
extern void WXDLLEXPORT wxInitializePrintSetupData(bool init = TRUE); WXDLLEXPORT extern void wxInitializePrintSetupData(bool init = TRUE);
/* /*
* Again, this only really needed for non-Windows platforms * Again, this only really needed for non-Windows platforms

View File

@@ -155,35 +155,35 @@ class WXDLLEXPORT wxResourceTable: public wxHashTable
virtual void ClearTable(); virtual void ClearTable();
}; };
extern void WXDLLEXPORT wxInitializeResourceSystem(); WXDLLEXPORT extern void wxInitializeResourceSystem();
extern void WXDLLEXPORT wxCleanUpResourceSystem(); WXDLLEXPORT extern void wxCleanUpResourceSystem();
WXDLLEXPORT_DATA(extern wxResourceTable*) wxDefaultResourceTable; WXDLLEXPORT_DATA(extern wxResourceTable*) wxDefaultResourceTable;
extern long WXDLLEXPORT wxParseWindowStyle(const wxString& style); WXDLLEXPORT extern long wxParseWindowStyle(const wxString& style);
class WXDLLEXPORT wxMenuBar; class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxMenu;
class WXDLLEXPORT wxBitmap; class WXDLLEXPORT wxBitmap;
class WXDLLEXPORT wxIcon; class WXDLLEXPORT wxIcon;
extern wxBitmap WXDLLEXPORT wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
extern wxIcon WXDLLEXPORT wxResourceCreateIcon(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
extern wxMenuBar* WXDLLEXPORT wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL, wxMenuBar *menuBar = (wxMenuBar *) NULL); WXDLLEXPORT extern wxMenuBar* wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL, wxMenuBar *menuBar = (wxMenuBar *) NULL);
extern wxMenu* WXDLLEXPORT wxResourceCreateMenu(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern wxMenu* wxResourceCreateMenu(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
extern bool WXDLLEXPORT wxResourceParseData(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern bool wxResourceParseData(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL);
extern bool WXDLLEXPORT wxResourceParseFile(const wxString& filename, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern bool wxResourceParseFile(const wxString& filename, wxResourceTable *table = (wxResourceTable *) NULL);
extern bool WXDLLEXPORT wxResourceParseString(char* s, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern bool wxResourceParseString(char* s, wxResourceTable *table = (wxResourceTable *) NULL);
extern void WXDLLEXPORT wxResourceClear(wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern void wxResourceClear(wxResourceTable *table = (wxResourceTable *) NULL);
// Register XBM/XPM data // Register XBM/XPM data
extern bool WXDLLEXPORT wxResourceRegisterBitmapData(const wxString& name, char bits[], int width, int height, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern bool wxResourceRegisterBitmapData(const wxString& name, char bits[], int width, int height, wxResourceTable *table = (wxResourceTable *) NULL);
extern bool WXDLLEXPORT wxResourceRegisterBitmapData(const wxString& name, char **data, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern bool wxResourceRegisterBitmapData(const wxString& name, char **data, wxResourceTable *table = (wxResourceTable *) NULL);
#define wxResourceRegisterIconData wxResourceRegisterBitmapData #define wxResourceRegisterIconData wxResourceRegisterBitmapData
/* /*
* Resource identifer code: #define storage * Resource identifer code: #define storage
*/ */
extern bool WXDLLEXPORT wxResourceAddIdentifier(const wxString& name, int value, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern bool wxResourceAddIdentifier(const wxString& name, int value, wxResourceTable *table = (wxResourceTable *) NULL);
extern int WXDLLEXPORT wxResourceGetIdentifier(const wxString& name, wxResourceTable *table = (wxResourceTable *) NULL); WXDLLEXPORT extern int wxResourceGetIdentifier(const wxString& name, wxResourceTable *table = (wxResourceTable *) NULL);
#endif #endif
#endif #endif

View File

@@ -28,7 +28,7 @@ class WXDLLEXPORT wxOutputStream;
typedef wxInputStream& (*__wxInputManip)(wxInputStream&); typedef wxInputStream& (*__wxInputManip)(wxInputStream&);
typedef wxOutputStream& (*__wxOutputManip)(wxOutputStream&); typedef wxOutputStream& (*__wxOutputManip)(wxOutputStream&);
wxOutputStream& WXDLLEXPORT wxEndL(wxOutputStream& o_stream); WXDLLEXPORT wxOutputStream& wxEndL(wxOutputStream& o_stream);
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Stream buffer // Stream buffer

View File

@@ -937,7 +937,7 @@ wxString WXDLLEXPORT operator+(const char *psz, const wxString& string);
# endif # endif
#endif #endif
istream& WXDLLEXPORT operator>>(istream& is, wxString& str); WXDLLEXPORT istream& operator>>(istream& is, wxString& str);
#endif //std::string compatibility #endif //std::string compatibility

View File

@@ -55,21 +55,21 @@ class WXDLLEXPORT wxFrame;
#define wxToLower(C) (((C) >= 'A' && (C) <= 'Z')? (C) - 'A' + 'a': (C)) #define wxToLower(C) (((C) >= 'A' && (C) <= 'Z')? (C) - 'A' + 'a': (C))
// Return a string with the current date/time // Return a string with the current date/time
wxString WXDLLEXPORT wxNow(void); WXDLLEXPORT wxString wxNow(void);
// Make a copy of this string using 'new' // Make a copy of this string using 'new'
char* WXDLLEXPORT copystring(const char *s); WXDLLEXPORT char* copystring(const char *s);
// Generate a unique ID // Generate a unique ID
long WXDLLEXPORT wxNewId(void); WXDLLEXPORT long wxNewId(void);
#define NewId wxNewId #define NewId wxNewId
// Ensure subsequent IDs don't clash with this one // Ensure subsequent IDs don't clash with this one
void WXDLLEXPORT wxRegisterId(long id); WXDLLEXPORT void wxRegisterId(long id);
#define RegisterId wxRegisterId #define RegisterId wxRegisterId
// Return the current ID // Return the current ID
long WXDLLEXPORT wxGetCurrentId(void); WXDLLEXPORT long wxGetCurrentId(void);
// Useful buffer // Useful buffer
WXDLLEXPORT_DATA(extern char*) wxBuffer; WXDLLEXPORT_DATA(extern char*) wxBuffer;
@@ -78,50 +78,50 @@ WXDLLEXPORT_DATA(extern const char*) wxFloatToStringStr;
WXDLLEXPORT_DATA(extern const char*) wxDoubleToStringStr; WXDLLEXPORT_DATA(extern const char*) wxDoubleToStringStr;
// Various conversions // Various conversions
void WXDLLEXPORT StringToFloat(char *s, float *number); WXDLLEXPORT void StringToFloat(char *s, float *number);
char* WXDLLEXPORT FloatToString(float number, const char *fmt = wxFloatToStringStr); WXDLLEXPORT char* FloatToString(float number, const char *fmt = wxFloatToStringStr);
void WXDLLEXPORT StringToDouble(char *s, double *number); WXDLLEXPORT void StringToDouble(char *s, double *number);
char* WXDLLEXPORT DoubleToString(double number, const char *fmt = wxDoubleToStringStr); WXDLLEXPORT char* DoubleToString(double number, const char *fmt = wxDoubleToStringStr);
void WXDLLEXPORT StringToInt(char *s, int *number); WXDLLEXPORT void StringToInt(char *s, int *number);
void WXDLLEXPORT StringToLong(char *s, long *number); WXDLLEXPORT void StringToLong(char *s, long *number);
char* WXDLLEXPORT IntToString(int number); WXDLLEXPORT char* IntToString(int number);
char* WXDLLEXPORT LongToString(long number); WXDLLEXPORT char* LongToString(long number);
// Matches string one within string two regardless of case // Matches string one within string two regardless of case
bool WXDLLEXPORT StringMatch(char *one, char *two, bool subString = TRUE, bool exact = FALSE); WXDLLEXPORT bool StringMatch(char *one, char *two, bool subString = TRUE, bool exact = FALSE);
// A shorter way of using strcmp // A shorter way of using strcmp
#define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0)) #define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0))
// Convert 2-digit hex number to decimal // Convert 2-digit hex number to decimal
int WXDLLEXPORT wxHexToDec(const wxString& buf); WXDLLEXPORT int wxHexToDec(const wxString& buf);
// Convert decimal integer to 2-character hex string // Convert decimal integer to 2-character hex string
void WXDLLEXPORT wxDecToHex(int dec, char *buf); WXDLLEXPORT void wxDecToHex(int dec, char *buf);
wxString WXDLLEXPORT wxDecToHex(int dec); WXDLLEXPORT wxString wxDecToHex(int dec);
// Execute another program. Returns 0 if there was an error, a PID otherwise. // Execute another program. Returns 0 if there was an error, a PID otherwise.
long WXDLLEXPORT wxExecute(char **argv, bool sync = FALSE, WXDLLEXPORT long wxExecute(char **argv, bool sync = FALSE,
wxProcess *process = (wxProcess *) NULL); wxProcess *process = (wxProcess *) NULL);
long WXDLLEXPORT wxExecute(const wxString& command, bool sync = FALSE, WXDLLEXPORT long wxExecute(const wxString& command, bool sync = FALSE,
wxProcess *process = (wxProcess *) NULL); wxProcess *process = (wxProcess *) NULL);
#define wxSIGTERM 1 #define wxSIGTERM 1
int WXDLLEXPORT wxKill(long pid, int sig=wxSIGTERM); WXDLLEXPORT int wxKill(long pid, int sig=wxSIGTERM);
// Execute a command in an interactive shell window // Execute a command in an interactive shell window
// If no command then just the shell // If no command then just the shell
bool WXDLLEXPORT wxShell(const wxString& command = ""); WXDLLEXPORT bool wxShell(const wxString& command = "");
// Sleep for nSecs seconds under UNIX, do nothing under Windows // Sleep for nSecs seconds under UNIX, do nothing under Windows
void WXDLLEXPORT wxSleep(int nSecs); WXDLLEXPORT void wxSleep(int nSecs);
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
long WXDLLEXPORT wxGetFreeMemory(void); WXDLLEXPORT long wxGetFreeMemory(void);
// Consume all events until no more left // Consume all events until no more left
void WXDLLEXPORT wxFlushEvents(void); WXDLLEXPORT void wxFlushEvents(void);
/* /*
* Network and username functions. * Network and username functions.
@@ -129,33 +129,33 @@ void WXDLLEXPORT wxFlushEvents(void);
*/ */
// Get eMail address // Get eMail address
bool WXDLLEXPORT wxGetEmailAddress(char *buf, int maxSize); WXDLLEXPORT bool wxGetEmailAddress(char *buf, int maxSize);
// Get hostname. // Get hostname.
bool WXDLLEXPORT wxGetHostName(char *buf, int maxSize); WXDLLEXPORT bool wxGetHostName(char *buf, int maxSize);
// Get user ID e.g. jacs // Get user ID e.g. jacs
bool WXDLLEXPORT wxGetUserId(char *buf, int maxSize); WXDLLEXPORT bool wxGetUserId(char *buf, int maxSize);
// Get user name e.g. Julian Smart // Get user name e.g. Julian Smart
bool WXDLLEXPORT wxGetUserName(char *buf, int maxSize); WXDLLEXPORT bool wxGetUserName(char *buf, int maxSize);
/* /*
* Strip out any menu codes * Strip out any menu codes
*/ */
char* WXDLLEXPORT wxStripMenuCodes(char *in, char *out = (char *) NULL); WXDLLEXPORT char* wxStripMenuCodes(char *in, char *out = (char *) NULL);
wxString WXDLLEXPORT wxStripMenuCodes(const wxString& str); WXDLLEXPORT wxString wxStripMenuCodes(const wxString& str);
// Find the window/widget with the given title or label. // Find the window/widget with the given title or label.
// Pass a parent to begin the search from, or NULL to look through // Pass a parent to begin the search from, or NULL to look through
// all windows. // all windows.
wxWindow* WXDLLEXPORT wxFindWindowByLabel(const wxString& title, wxWindow *parent = (wxWindow *) NULL); WXDLLEXPORT wxWindow* wxFindWindowByLabel(const wxString& title, wxWindow *parent = (wxWindow *) NULL);
// Find window by name, and if that fails, by label. // Find window by name, and if that fails, by label.
wxWindow* WXDLLEXPORT wxFindWindowByName(const wxString& name, wxWindow *parent = (wxWindow *) NULL); WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent = (wxWindow *) NULL);
// Returns menu item id or -1 if none. // Returns menu item id or -1 if none.
int WXDLLEXPORT wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString); WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString);
// A debugging stream buffer. // A debugging stream buffer.
// Under Windows, this writes to the Windows debug output. // Under Windows, this writes to the Windows debug output.
@@ -208,70 +208,70 @@ class WXDLLEXPORT wxDebugStreamBuf: public streambuf
#define wxMin(a,b) (((a) < (b)) ? (a) : (b)) #define wxMin(a,b) (((a) < (b)) ? (a) : (b))
// Yield to other apps/messages // Yield to other apps/messages
bool WXDLLEXPORT wxYield(void); WXDLLEXPORT bool wxYield(void);
// Format a message on the standard error (UNIX) or the debugging // Format a message on the standard error (UNIX) or the debugging
// stream (Windows) // stream (Windows)
void WXDLLEXPORT wxDebugMsg(const char *fmt ...) ; WXDLLEXPORT void wxDebugMsg(const char *fmt ...) ;
// Sound the bell // Sound the bell
void WXDLLEXPORT wxBell(void) ; WXDLLEXPORT void wxBell(void) ;
// Get OS version // Get OS version
int WXDLLEXPORT wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ; WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ;
// Set the cursor to the busy cursor for all windows // Set the cursor to the busy cursor for all windows
class WXDLLEXPORT wxCursor; class WXDLLEXPORT wxCursor;
WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR; WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR;
void WXDLLEXPORT wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR); WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
// Restore cursor to normal // Restore cursor to normal
void WXDLLEXPORT wxEndBusyCursor(void); WXDLLEXPORT void wxEndBusyCursor(void);
// TRUE if we're between the above two calls // TRUE if we're between the above two calls
bool WXDLLEXPORT wxIsBusy(void); WXDLLEXPORT bool wxIsBusy(void);
/* Error message functions used by wxWindows */ /* Error message functions used by wxWindows */
// Non-fatal error (continues) // Non-fatal error (continues)
WXDLLEXPORT_DATA(extern const char*) wxInternalErrorStr; WXDLLEXPORT_DATA(extern const char*) wxInternalErrorStr;
void WXDLLEXPORT wxError(const wxString& msg, const wxString& title = wxInternalErrorStr); WXDLLEXPORT void wxError(const wxString& msg, const wxString& title = wxInternalErrorStr);
// Fatal error (exits) // Fatal error (exits)
WXDLLEXPORT_DATA(extern const char*) wxFatalErrorStr; WXDLLEXPORT_DATA(extern const char*) wxFatalErrorStr;
void WXDLLEXPORT wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr); WXDLLEXPORT void wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
// Reading and writing resources (eg WIN.INI, .Xdefaults) // Reading and writing resources (eg WIN.INI, .Xdefaults)
#if wxUSE_RESOURCES #if wxUSE_RESOURCES
bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = ""); WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = "");
bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = ""); WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = "");
bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = ""); WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = "");
bool WXDLLEXPORT wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = ""); WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = "");
bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file = ""); WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file = "");
bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = ""); WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = "");
bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = ""); WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = "");
bool WXDLLEXPORT wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = ""); WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = "");
#endif // wxUSE_RESOURCES #endif // wxUSE_RESOURCES
// Get current Home dir and copy to dest (returns pstr->c_str()) // Get current Home dir and copy to dest (returns pstr->c_str())
const char* WXDLLEXPORT wxGetHomeDir(wxString *pstr); WXDLLEXPORT const char* wxGetHomeDir(wxString *pstr);
// Get the user's home dir (caller must copy--- volatile) // Get the user's home dir (caller must copy--- volatile)
// returns NULL is no HOME dir is known // returns NULL is no HOME dir is known
char* WXDLLEXPORT wxGetUserHome(const wxString& user = ""); WXDLLEXPORT char* wxGetUserHome(const wxString& user = "");
// Check whether this window wants to process messages, e.g. Stop button // Check whether this window wants to process messages, e.g. Stop button
// in long calculations. // in long calculations.
bool WXDLLEXPORT wxCheckForInterrupt(wxWindow *wnd); WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd);
void WXDLLEXPORT wxGetMousePosition( int* x, int* y ); void WXDLLEXPORT wxGetMousePosition( int* x, int* y );
// MSW only: get user-defined resource from the .res file. // MSW only: get user-defined resource from the .res file.
// Returns NULL or newly-allocated memory, so use delete[] to clean up. // Returns NULL or newly-allocated memory, so use delete[] to clean up.
#ifdef __WXMSW__ #ifdef __WXMSW__
extern const char* WXDLLEXPORT wxUserResourceStr; WXDLLEXPORT extern const char* wxUserResourceStr;
char* WXDLLEXPORT wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = wxUserResourceStr); WXDLLEXPORT char* wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = wxUserResourceStr);
#endif #endif
// X only // X only

View File

@@ -18,7 +18,7 @@
#define wxRELEASE_NUMBER 0 #define wxRELEASE_NUMBER 0
#define wxVERSION_STRING "wxWindows 2.0" #define wxVERSION_STRING "wxWindows 2.0"
#define wxVERSION_NUMBER (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER #define wxVERSION_NUMBER (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER
#define wxBETA_NUMBER 13 #define wxBETA_NUMBER 17
#define wxVERSION_FLOAT float(wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0)) #define wxVERSION_FLOAT float(wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0))
#endif #endif

View File

@@ -15,6 +15,7 @@
#include "wx/setup.h" // Which features to include - user editable #include "wx/setup.h" // Which features to include - user editable
#include "wx/defs.h" #include "wx/defs.h"
#include "wx/string.h" #include "wx/string.h"
#include "wx/log.h"
#include "wx/window.h" #include "wx/window.h"
#include "wx/panel.h" #include "wx/panel.h"
#include "wx/frame.h" #include "wx/frame.h"
@@ -23,7 +24,6 @@
#include "wx/dcmemory.h" #include "wx/dcmemory.h"
#include "wx/dcprint.h" #include "wx/dcprint.h"
#include "wx/dcscreen.h" #include "wx/dcscreen.h"
#include "wx/postscrp.h"
#include "wx/button.h" #include "wx/button.h"
#include "wx/bmpbuttn.h" #include "wx/bmpbuttn.h"
#include "wx/checkbox.h" #include "wx/checkbox.h"

View File

@@ -59,9 +59,9 @@ typedef bool (*wxExprErrorHandler) (int errorType, char *msg);
WXDLLEXPORT_DATA(extern wxExprErrorHandler) currentwxExprErrorHandler; WXDLLEXPORT_DATA(extern wxExprErrorHandler) currentwxExprErrorHandler;
WXDLLEXPORT_DATA(extern "C" FILE*) yyin; extern "C" WXDLLEXPORT_DATA(FILE*) yyin;
extern "C" int WXDLLEXPORT yyparse(void); extern "C" WXDLLEXPORT int yyparse(void);
typedef enum { typedef enum {
wxExprNull, wxExprNull,
@@ -263,7 +263,7 @@ class WXDLLEXPORT wxExprDatabase: public wxList
// Function call-style interface - some more convenience wrappers/unwrappers // Function call-style interface - some more convenience wrappers/unwrappers
// Make a call // Make a call
wxExpr* WXDLLEXPORT wxExprMakeCall(const wxString& functor ...); WXDLLEXPORT wxExpr* wxExprMakeCall(const wxString& functor ...);
#define wxExprMakeInteger(x) (new wxExpr((long)x)) #define wxExprMakeInteger(x) (new wxExpr((long)x))
#define wxExprMakeReal(x) (new wxExpr((double)x)) #define wxExprMakeReal(x) (new wxExpr((double)x))
@@ -272,13 +272,13 @@ wxExpr* WXDLLEXPORT wxExprMakeCall(const wxString& functor ...);
#define wxExprMake(x) (new wxExpr(x)) #define wxExprMake(x) (new wxExpr(x))
// Checks functor // Checks functor
bool WXDLLEXPORT wxExprIsFunctor(wxExpr *expr, const wxString& functor); WXDLLEXPORT bool wxExprIsFunctor(wxExpr *expr, const wxString& functor);
// Temporary variable for communicating between wxexpr.cpp and YACC/LEX // Temporary variable for communicating between wxexpr.cpp and YACC/LEX
WXDLLEXPORT_DATA(extern wxExprDatabase*) thewxExprDatabase; WXDLLEXPORT_DATA(extern wxExprDatabase*) thewxExprDatabase;
// YACC/LEX can leave memory lying around... // YACC/LEX can leave memory lying around...
extern "C" int WXDLLEXPORT wxExprCleanUp(); extern "C" WXDLLEXPORT int wxExprCleanUp();
#endif #endif

View File

@@ -13,7 +13,7 @@
# Set WXDIR for your system # Set WXDIR for your system
WXDIR = $(WXWIN) WXDIR = $(WXWIN)
WXUSINGDLL=0 WXUSINGDLL=1
!include $(WXDIR)\src\ntwxwin.mak !include $(WXDIR)\src\ntwxwin.mak

View File

@@ -14,7 +14,7 @@
# Set WXDIR for your system # Set WXDIR for your system
WXDIR = $(WXWIN) WXDIR = $(WXWIN)
WXUSINGDLL=0 WXUSINGDLL=1
!include $(WXDIR)\src\ntwxwin.mak !include $(WXDIR)\src\ntwxwin.mak

View File

@@ -285,6 +285,9 @@ wxString wxLog::TimeStamp() const
{ {
wxString str; wxString str;
/* Let's disable TimeStamp and see if anyone complains.
* If not, we'll remove it, since it's probably unlikely
* to ever be used. -- JACS 22/11/98
if ( !IsEmpty(m_szTimeFormat) ) { if ( !IsEmpty(m_szTimeFormat) ) {
char szBuf[128]; char szBuf[128];
time_t timeNow; time_t timeNow;
@@ -296,6 +299,7 @@ wxString wxLog::TimeStamp() const
strftime(szBuf, WXSIZEOF(szBuf), m_szTimeFormat, ptmNow); strftime(szBuf, WXSIZEOF(szBuf), m_szTimeFormat, ptmNow);
str = szBuf; str = szBuf;
} }
*/
return str; return str;
} }
@@ -496,7 +500,7 @@ void wxLogGui::DoLog(wxLogLevel level, const char *szString)
{ {
wxString strTime = TimeStamp(); wxString strTime = TimeStamp();
#if defined(__WIN32__) && !defined(__WXSTUBS__) #if (defined(__WIN32__) || defined(__WIN16__)) && !defined(__WXSTUBS__)
// don't prepend debug/trace here: it goes to the debug window // don't prepend debug/trace here: it goes to the debug window
// anyhow, but do put a timestamp // anyhow, but do put a timestamp
OutputDebugString(strTime + szString + "\n\r"); OutputDebugString(strTime + szString + "\n\r");

View File

@@ -35,6 +35,7 @@
#include "wx/app.h" #include "wx/app.h"
#endif #endif
#include <wx/log.h>
#include <stdlib.h> #include <stdlib.h>
#if wxUSE_IOSTREAMH #if wxUSE_IOSTREAMH
@@ -112,7 +113,7 @@
*/ */
void wxMemStruct::ErrorMsg (const char * mesg) void wxMemStruct::ErrorMsg (const char * mesg)
{ {
wxTrace("wxWindows memory checking error: %s\n", mesg); wxLogDebug("wxWindows memory checking error: %s", mesg);
PrintNode (); PrintNode ();
// << m_fileName << ' ' << m_lineNum << endl; // << m_fileName << ' ' << m_lineNum << endl;
@@ -123,7 +124,7 @@ void wxMemStruct::ErrorMsg (const char * mesg)
*/ */
void wxMemStruct::ErrorMsg () void wxMemStruct::ErrorMsg ()
{ {
wxTrace("wxWindows over/underwrite memory error: \n"); wxLogDebug("wxWindows over/underwrite memory error:");
PrintNode (); PrintNode ();
// cerr << m_fileName << ' ' << m_lineNum << endl; // cerr << m_fileName << ' ' << m_lineNum << endl;
@@ -328,35 +329,37 @@ void wxMemStruct::PrintNode ()
{ {
wxObject *obj = (wxObject *)m_actualData; wxObject *obj = (wxObject *)m_actualData;
wxClassInfo *info = obj->GetClassInfo(); wxClassInfo *info = obj->GetClassInfo();
/*
if (info && info->GetClassName())
wxTrace("%s", info->GetClassName());
else
wxTrace("Object");
if (m_fileName)
wxTrace(" (%s %d)", m_fileName, (int)m_lineNum);
wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize());
*/
// Let's put this in standard form so IDEs can load the file at the appropriate // Let's put this in standard form so IDEs can load the file at the appropriate
// line // line
wxString msg("");
if (m_fileName) if (m_fileName)
wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum);
if (info && info->GetClassName()) if (info && info->GetClassName())
wxTrace("%s", info->GetClassName()); msg += info->GetClassName();
else else
wxTrace("object"); msg += "object";
wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); wxString msg2;
msg2.Printf(" at $%lX, size %d", (long)GetActualData(), (int)RequestSize());
msg += msg2;
wxLogDebug(msg);
} }
else else
{ {
wxString msg("");
if (m_fileName) if (m_fileName)
wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum);
wxTrace("non-object data"); msg += ("non-object data");
wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); wxString msg2;
msg2.Printf(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize());
msg += msg2;
wxLogDebug(msg);
} }
} }
@@ -368,19 +371,39 @@ void wxMemStruct::Dump ()
{ {
wxObject *obj = (wxObject *)m_actualData; wxObject *obj = (wxObject *)m_actualData;
wxString msg("");
if (m_fileName) if (m_fileName)
wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum);
/* TODO: We no longer have a stream (using wxLogDebug) so we can't dump it.
* Instead, do what wxObject::Dump does.
* What should we do long-term, eliminate Dumping? Or specify
* that MyClass::Dump should use wxLogDebug? Ugh.
obj->Dump(wxDebugContext::GetStream()); obj->Dump(wxDebugContext::GetStream());
wxTrace(" at $%lX, size %d", (long)GetActualData(), (int)RequestSize()); */
wxTrace("\n");
if (obj->GetClassInfo() && obj->GetClassInfo()->GetClassName())
msg += obj->GetClassInfo()->GetClassName();
else
msg += "unknown object class";
wxString msg2("");
msg2.Printf(" at $%lX, size %d", (long)GetActualData(), (int)RequestSize());
msg += msg2;
wxLogDebug(msg);
} }
else else
{ {
wxString msg("");
if (m_fileName) if (m_fileName)
wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum);
wxTrace("non-object data");
wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); wxString msg2("");
msg2.Printf("non-object data at $%lX, size %d", (long)GetActualData(), (int)RequestSize() );
msg += msg2;
wxLogDebug(msg);
} }
} }
@@ -398,7 +421,7 @@ int wxMemStruct::ValidateNode ()
else { else {
// Can't use the error routines as we have no recognisable object. // Can't use the error routines as we have no recognisable object.
#ifndef __WXGTK__ #ifndef __WXGTK__
wxTrace("Can't verify memory struct - all bets are off!\n"); wxLogDebug("Can't verify memory struct - all bets are off!");
#endif #endif
} }
return 0; return 0;
@@ -470,15 +493,6 @@ wxDebugContext::~wxDebugContext(void)
void wxDebugContext::SetStream(ostream *str, streambuf *buf) void wxDebugContext::SetStream(ostream *str, streambuf *buf)
{ {
/*
if (str)
{
char buff[128];
sprintf(buff, "SetStream (1): str is %ld", (long) str);
MessageBox(NULL, buff, "Memory", MB_OK);
}
*/
if (m_debugStream) if (m_debugStream)
{ {
m_debugStream->flush(); m_debugStream->flush();
@@ -511,11 +525,6 @@ bool wxDebugContext::SetFile(const wxString& file)
} }
else else
{ {
/*
char buf[40];
sprintf(buf, "SetFile: str is %ld", (long) str);
MessageBox(NULL, buf, "Memory", MB_OK);
*/
SetStream(str); SetStream(str);
return TRUE; return TRUE;
} }
@@ -622,7 +631,8 @@ void wxDebugContext::TraverseList (PmSFV func, wxMemStruct *from)
for (wxMemStruct * st = from; st != 0; st = st->m_next) for (wxMemStruct * st = from; st != 0; st = st->m_next)
{ {
void* data = st->GetActualData(); void* data = st->GetActualData();
if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf)) // if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
if (data != (void*) wxLog::GetActiveTarget())
{ {
(st->*func) (); (st->*func) ();
} }
@@ -636,8 +646,8 @@ void wxDebugContext::TraverseList (PmSFV func, wxMemStruct *from)
bool wxDebugContext::PrintList (void) bool wxDebugContext::PrintList (void)
{ {
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
if (!HasStream()) // if (!HasStream())
return FALSE; // return FALSE;
TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL)); TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL));
@@ -650,8 +660,8 @@ bool wxDebugContext::PrintList (void)
bool wxDebugContext::Dump(void) bool wxDebugContext::Dump(void)
{ {
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
if (!HasStream()) // if (!HasStream())
return FALSE; // return FALSE;
if (TRUE) if (TRUE)
{ {
@@ -661,16 +671,17 @@ bool wxDebugContext::Dump(void)
{ {
appNameStr = wxTheApp->GetAppName(); appNameStr = wxTheApp->GetAppName();
appName = (char*) (const char*) appNameStr; appName = (char*) (const char*) appNameStr;
wxTrace("----- Memory dump of %s at %s -----\n", appName, WXSTRINGCAST wxNow() ); wxLogDebug("----- Memory dump of %s at %s -----", appName, WXSTRINGCAST wxNow() );
} }
else else
{ {
wxTrace( "----- Memory dump -----\n" ); wxLogDebug( "----- Memory dump -----" );
} }
} }
TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL)); TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL));
wxTrace( "\n\n" ); wxLogDebug( "" );
wxLogDebug( "" );
return TRUE; return TRUE;
#else #else
@@ -706,8 +717,8 @@ static wxDebugStatsStruct *InsertStatsStruct(wxDebugStatsStruct *head, wxDebugSt
bool wxDebugContext::PrintStatistics(bool detailed) bool wxDebugContext::PrintStatistics(bool detailed)
{ {
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
if (!HasStream()) // if (!HasStream())
return FALSE; // return FALSE;
if (TRUE) if (TRUE)
{ {
@@ -717,11 +728,11 @@ bool wxDebugContext::PrintStatistics(bool detailed)
{ {
appNameStr = wxTheApp->GetAppName(); appNameStr = wxTheApp->GetAppName();
appName = (char*) (const char*) appNameStr; appName = (char*) (const char*) appNameStr;
wxTrace("----- Memory statistics of %s at %s -----\n", appName, WXSTRINGCAST wxNow() ); wxLogDebug("----- Memory statistics of %s at %s -----", appName, WXSTRINGCAST wxNow() );
} }
else else
{ {
wxTrace( "----- Memory statistics -----\n" ); wxLogDebug( "----- Memory statistics -----" );
} }
} }
@@ -742,7 +753,8 @@ bool wxDebugContext::PrintStatistics(bool detailed)
for (st = from; st != 0; st = st->m_next) for (st = from; st != 0; st = st->m_next)
{ {
void* data = st->GetActualData(); void* data = st->GetActualData();
if (detailed && (data != (void*)m_debugStream) && (data != (void*) m_streamBuf)) // if (detailed && (data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
if (detailed && (data != (void*) wxLog::GetActiveTarget()))
{ {
char *className = "nonobject"; char *className = "nonobject";
if (st->m_isObject && st->GetActualData()) if (st->m_isObject && st->GetActualData())
@@ -764,7 +776,8 @@ bool wxDebugContext::PrintStatistics(bool detailed)
stats->totalSize += st->RequestSize(); stats->totalSize += st->RequestSize();
} }
if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf)) // if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
if (data != (void*) wxLog::GetActiveTarget())
{ {
totalSize += st->RequestSize(); totalSize += st->RequestSize();
if (st->m_isObject) if (st->m_isObject)
@@ -778,21 +791,22 @@ bool wxDebugContext::PrintStatistics(bool detailed)
{ {
while (list) while (list)
{ {
wxTrace("%ld objects of class %s, total size %ld\n", wxLogDebug("%ld objects of class %s, total size %ld",
list->instanceCount, list->instanceClass, list->totalSize); list->instanceCount, list->instanceClass, list->totalSize);
wxDebugStatsStruct *old = list; wxDebugStatsStruct *old = list;
list = old->next; list = old->next;
free((char *)old); free((char *)old);
} }
wxTrace("\n"); wxLogDebug("");
} }
SetDebugMode(currentMode); SetDebugMode(currentMode);
wxTrace("Number of object items: %ld\n", noObjectNodes); wxLogDebug("Number of object items: %ld", noObjectNodes);
wxTrace("Number of non-object items: %ld\n", noNonObjectNodes); wxLogDebug("Number of non-object items: %ld", noNonObjectNodes);
wxTrace("Total allocated size: %ld\n", totalSize); wxLogDebug("Total allocated size: %ld", totalSize);
wxTrace("\n\n"); wxLogDebug("");
wxLogDebug("");
return TRUE; return TRUE;
#else #else
@@ -802,8 +816,8 @@ bool wxDebugContext::PrintStatistics(bool detailed)
bool wxDebugContext::PrintClasses(void) bool wxDebugContext::PrintClasses(void)
{ {
if (!HasStream()) // if (!HasStream())
return FALSE; // return FALSE;
if (TRUE) if (TRUE)
{ {
@@ -813,7 +827,7 @@ bool wxDebugContext::PrintClasses(void)
{ {
appNameStr = wxTheApp->GetAppName(); appNameStr = wxTheApp->GetAppName();
appName = (char*) (const char*) appNameStr; appName = (char*) (const char*) appNameStr;
wxTrace("----- Classes in %s -----\n", appName); wxLogDebug("----- Classes in %s -----", appName);
} }
} }
@@ -828,21 +842,33 @@ bool wxDebugContext::PrintClasses(void)
info = (wxClassInfo *)node->Data(); info = (wxClassInfo *)node->Data();
if (info->GetClassName()) if (info->GetClassName())
{ {
wxTrace("%s ", info->GetClassName()); wxString msg(info->GetClassName());
msg += " ";
if (info->GetBaseClassName1() && !info->GetBaseClassName2()) if (info->GetBaseClassName1() && !info->GetBaseClassName2())
wxTrace("is a %s", info->GetBaseClassName1()); {
else if (info->GetBaseClassName1() && info->GetBaseClassName2()) msg += "is a ";
wxTrace("is a %s, %s", info->GetBaseClassName1(), info->GetBaseClassName2()); msg += info->GetBaseClassName1();
if (info->GetConstructor()) }
wxTrace(": dynamic\n"); else if (info->GetBaseClassName1() && info->GetBaseClassName2())
else {
wxTrace("\n"); msg += "is a ";
msg += info->GetBaseClassName1() ;
msg += ", ";
msg += info->GetBaseClassName2() ;
}
if (info->GetConstructor())
msg += ": dynamic";
wxLogDebug(msg);
} }
node = wxClassInfo::sm_classTable->Next(); node = wxClassInfo::sm_classTable->Next();
n ++; n ++;
} }
wxTrace("\nThere are %d classes derived from wxObject.\n\n\n", n); wxLogDebug("");
wxLogDebug("There are %d classes derived from wxObject.", n);
wxLogDebug("");
wxLogDebug("");
return TRUE; return TRUE;
} }
@@ -885,7 +911,8 @@ int wxDebugContext::CountObjectsLeft(void)
for (wxMemStruct * st = from; st != 0; st = st->m_next) for (wxMemStruct * st = from; st != 0; st = st->m_next)
{ {
void* data = st->GetActualData(); void* data = st->GetActualData();
if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf)) // if ((data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
if (data != (void*) wxLog::GetActiveTarget())
n ++; n ++;
} }
@@ -948,7 +975,14 @@ void operator delete (void * buf)
#if _MSC_VER >= 1200 #if _MSC_VER >= 1200
void operator delete(void* pData, char* /* fileName */, int /* lineNum */) void operator delete(void* pData, char* /* fileName */, int /* lineNum */)
{ {
::operator delete(pData); // ::operator delete(pData);
// JACS 21/11/1998: surely we need to call wxDebugFree?
wxDebugFree(pData, FALSE);
}
// New operator 21/11/1998
void operator delete[](void* pData, char* /* fileName */, int /* lineNum */)
{
wxDebugFree(pData, TRUE);
} }
#endif #endif
@@ -979,7 +1013,7 @@ void * wxDebugAlloc(size_t size, char * fileName, int lineNum, bool isObject, bo
char * buf = (char *) malloc(wxDebugContext::TotSize (size)); char * buf = (char *) malloc(wxDebugContext::TotSize (size));
if (!buf) { if (!buf) {
wxTrace("Call to malloc (%ld) failed.\n", (long)size); wxLogDebug("Call to malloc (%ld) failed.", (long)size);
return 0; return 0;
} }
wxMemStruct * st = (wxMemStruct *)buf; wxMemStruct * st = (wxMemStruct *)buf;

View File

@@ -362,13 +362,14 @@ int wxEntry( int argc, char *argv[] )
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();
/* Debug stream no longer used
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf; streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ; ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf); wxDebugContext::SetStream(oStr, sBuf);
#endif #endif
*/
if (!wxTheApp) if (!wxTheApp)
{ {
@@ -445,9 +446,6 @@ int wxEntry( int argc, char *argv[] )
wxDELETE(wxTheApp); wxDELETE(wxTheApp);
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
if (oldLog) delete oldLog;
wxClassInfo::CleanUpClasses(); wxClassInfo::CleanUpClasses();
delete[] wxBuffer; delete[] wxBuffer;
@@ -456,14 +454,18 @@ int wxEntry( int argc, char *argv[] )
if (wxDebugContext::CountObjectsLeft() > 0) if (wxDebugContext::CountObjectsLeft() > 0)
{ {
wxTrace("There were memory leaks.\n"); wxLogDebug("There were memory leaks.\n");
wxDebugContext::Dump(); wxDebugContext::Dump();
wxDebugContext::PrintStatistics(); wxDebugContext::PrintStatistics();
} }
wxDebugContext::SetStream(NULL, NULL); // wxDebugContext::SetStream(NULL, NULL);
#endif #endif
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
if (oldLog) delete oldLog;
return retValue; return retValue;
} }

View File

@@ -362,13 +362,14 @@ int wxEntry( int argc, char *argv[] )
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();
/* Debug stream no longer used
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf; streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ; ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf); wxDebugContext::SetStream(oStr, sBuf);
#endif #endif
*/
if (!wxTheApp) if (!wxTheApp)
{ {
@@ -445,9 +446,6 @@ int wxEntry( int argc, char *argv[] )
wxDELETE(wxTheApp); wxDELETE(wxTheApp);
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
if (oldLog) delete oldLog;
wxClassInfo::CleanUpClasses(); wxClassInfo::CleanUpClasses();
delete[] wxBuffer; delete[] wxBuffer;
@@ -456,14 +454,18 @@ int wxEntry( int argc, char *argv[] )
if (wxDebugContext::CountObjectsLeft() > 0) if (wxDebugContext::CountObjectsLeft() > 0)
{ {
wxTrace("There were memory leaks.\n"); wxLogDebug("There were memory leaks.\n");
wxDebugContext::Dump(); wxDebugContext::Dump();
wxDebugContext::PrintStatistics(); wxDebugContext::PrintStatistics();
} }
wxDebugContext::SetStream(NULL, NULL); // wxDebugContext::SetStream(NULL, NULL);
#endif #endif
wxLog *oldLog = wxLog::SetActiveTarget( NULL );
if (oldLog) delete oldLog;
return retValue; return retValue;
} }

View File

@@ -67,6 +67,7 @@ bool wxApp::Initialize()
wxBuffer = new char[BUFSIZ + 512]; wxBuffer = new char[BUFSIZ + 512];
#endif #endif
/* No longer used
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf; streambuf* sBuf = new wxDebugStreamBuf;
@@ -74,6 +75,7 @@ bool wxApp::Initialize()
wxDebugContext::SetStream(oStr, sBuf); wxDebugContext::SetStream(oStr, sBuf);
#endif #endif
*/
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();
@@ -151,6 +153,23 @@ void wxApp::CleanUp()
wxClassInfo::CleanUpClasses(); wxClassInfo::CleanUpClasses();
delete wxTheApp;
wxTheApp = NULL;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft() > 0)
{
wxLogDebug("There were memory leaks.\n");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
// wxDebugContext::SetStream(NULL, NULL);
#endif
// do it as the very last thing because everything else can log messages // do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand(); wxLog::DontCreateOnDemand();
// do it as the very last thing because everything else can log messages // do it as the very last thing because everything else can log messages
@@ -218,23 +237,6 @@ int wxEntry( int argc, char *argv[] )
wxApp::CleanUp(); wxApp::CleanUp();
delete wxTheApp;
wxTheApp = NULL;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft() > 0)
{
wxTrace("There were memory leaks.\n");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
wxDebugContext::SetStream(NULL, NULL);
#endif
return retValue; return retValue;
}; };

View File

@@ -125,6 +125,11 @@ bool wxApp::Initialize()
#endif // debug build under MS VC++ #endif // debug build under MS VC++
*/ */
// 22/11/98: we're converting to wxLogDebug instead of wxTrace,
// so these are now obsolete.
#if 0
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#if defined(_WINDLL) #if defined(_WINDLL)
streambuf* sBuf = NULL; streambuf* sBuf = NULL;
@@ -135,6 +140,7 @@ bool wxApp::Initialize()
ostream* oStr = new ostream(sBuf) ; ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf); wxDebugContext::SetStream(oStr, sBuf);
#endif // wxUSE_MEMORY_TRACING #endif // wxUSE_MEMORY_TRACING
#endif
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();
@@ -494,6 +500,23 @@ void wxApp::CleanUp()
wxClassInfo::CleanUpClasses(); wxClassInfo::CleanUpClasses();
delete wxTheApp;
wxTheApp = NULL;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft() > 0)
{
wxLogDebug("There were memory leaks.");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
// wxDebugContext::SetStream(NULL, NULL);
#endif
// do it as the very last thing because everything else can log messages // do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand(); wxLog::DontCreateOnDemand();
delete wxLog::SetActiveTarget(NULL); delete wxLog::SetActiveTarget(NULL);
@@ -577,23 +600,6 @@ int wxEntry(WXHINSTANCE hInstance,
wxApp::CleanUp(); wxApp::CleanUp();
delete wxTheApp;
wxTheApp = NULL;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft() > 0)
{
wxTrace("There were memory leaks.\n");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
wxDebugContext::SetStream(NULL, NULL);
#endif
return retValue; return retValue;
#ifndef __WXDEBUG__ // catch exceptions only in release build #ifndef __WXDEBUG__ // catch exceptions only in release build
} }

View File

@@ -133,8 +133,6 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item)
if (!old) if (!old)
return FALSE; return FALSE;
RECT rect = lpDIS->rcItem;
int x = lpDIS->rcItem.left; int x = lpDIS->rcItem.left;
int y = lpDIS->rcItem.top; int y = lpDIS->rcItem.top;
int width = lpDIS->rcItem.right - x; int width = lpDIS->rcItem.right - x;

View File

@@ -170,8 +170,6 @@ bool wxStaticBitmap::MSWOnDraw(WXDRAWITEMSTRUCT *item)
if (!old) if (!old)
return FALSE; return FALSE;
RECT rect = lpDIS->rcItem;
int x = lpDIS->rcItem.left; int x = lpDIS->rcItem.left;
int y = lpDIS->rcItem.top; int y = lpDIS->rcItem.top;
int width = lpDIS->rcItem.right - x; int width = lpDIS->rcItem.right - x;

View File

@@ -503,7 +503,7 @@ bool wxIsBusy(void)
return (wxBusyCursorCount > 0); return (wxBusyCursorCount > 0);
} }
const char* WXDLLEXPORT wxGetHomeDir(wxString *pstr) const char* wxGetHomeDir(wxString *pstr)
{ {
wxString& strDir = *pstr; wxString& strDir = *pstr;

View File

@@ -32,7 +32,7 @@ SRCSUFF=cpp
# If you set wxUSE_IOSTREAMH to 0, remove -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally # If you set wxUSE_IOSTREAMH to 0, remove -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally
WINFLAGS=-c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION) WINFLAGS=-c -W3 -Dtry=__try -Dexcept=__except -Dleave=__leave -Dfinally=__finally -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWIN32 -D__WIN32__ $(WINVERSION)
#WINLINKFLAGS=/NODEFAULTLIB /INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER) #WINLINKFLAGS=/NODEFAULTLIB /INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER)
WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -align:0x1000 -machine:$(CPU) -subsystem:windows,$(APPVER) WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:windows,$(APPVER)
#WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib libc.lib oldnames.lib\ #WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib libc.lib oldnames.lib\
# comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib # libci.lib # libci.lib required for VC++ 4.2 # comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib # libci.lib # libci.lib required for VC++ 4.2
WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\ WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\

View File

@@ -57,13 +57,14 @@ bool wxApp::Initialize()
wxBuffer = new char[BUFSIZ + 512]; wxBuffer = new char[BUFSIZ + 512];
#endif #endif
/* No longer used
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
streambuf* sBuf = new wxDebugStreamBuf; streambuf* sBuf = new wxDebugStreamBuf;
ostream* oStr = new ostream(sBuf) ; ostream* oStr = new ostream(sBuf) ;
wxDebugContext::SetStream(oStr, sBuf); wxDebugContext::SetStream(oStr, sBuf);
#endif #endif
*/
wxClassInfo::InitializeClasses(); wxClassInfo::InitializeClasses();
@@ -119,6 +120,23 @@ void wxApp::CleanUp()
wxClassInfo::CleanUpClasses(); wxClassInfo::CleanUpClasses();
delete wxTheApp;
wxTheApp = NULL;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft() > 0)
{
wxTrace("There were memory leaks.\n");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
// wxDebugContext::SetStream(NULL, NULL);
#endif
// do it as the very last thing because everything else can log messages // do it as the very last thing because everything else can log messages
wxLog::DontCreateOnDemand(); wxLog::DontCreateOnDemand();
// do it as the very last thing because everything else can log messages // do it as the very last thing because everything else can log messages
@@ -174,23 +192,6 @@ int wxEntry( int argc, char *argv[] )
wxApp::CleanUp(); wxApp::CleanUp();
delete wxTheApp;
wxTheApp = NULL;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
// At this point we want to check if there are any memory
// blocks that aren't part of the wxDebugContext itself,
// as a special case. Then when dumping we need to ignore
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft() > 0)
{
wxTrace("There were memory leaks.\n");
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
wxDebugContext::SetStream(NULL, NULL);
#endif
return retValue; return retValue;
}; };