From 184b5d99a5382cd7a19888c85aff11f8a21af2f6 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 22 Nov 1998 22:32:53 +0000 Subject: [PATCH] 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 --- docs/msw/changes.txt | 13 +++ include/wx/defs.h | 2 +- include/wx/filefn.h | 64 ++++++------ include/wx/generic/choicdgg.h | 14 +-- include/wx/intl.h | 4 +- include/wx/log.h | 4 +- include/wx/memory.h | 11 +- include/wx/msw/clipbrd.h | 22 ++-- include/wx/msw/filedlg.h | 8 +- include/wx/msw/listbox.h | 6 ++ include/wx/msw/notebook.h | 7 ++ include/wx/msw/private.h | 30 +++--- include/wx/msw/setup.h | 2 +- include/wx/msw/window.h | 8 +- include/wx/object.h | 4 +- include/wx/postscrp.h | 40 ++++---- include/wx/resource.h | 30 +++--- include/wx/stream.h | 2 +- include/wx/string.h | 2 +- include/wx/utils.h | 112 ++++++++++---------- include/wx/version.h | 2 +- include/wx/wx.h | 2 +- include/wx/wxexpr.h | 10 +- samples/mdi/makefile.nt | 2 +- samples/minimal/makefile.nt | 2 +- src/common/log.cpp | 6 +- src/common/memory.cpp | 188 ++++++++++++++++++++-------------- src/gtk/app.cpp | 14 +-- src/gtk1/app.cpp | 14 +-- src/motif/app.cpp | 36 ++++--- src/msw/app.cpp | 40 +++++--- src/msw/bmpbuttn.cpp | 2 - src/msw/statbmp.cpp | 2 - src/msw/utils.cpp | 2 +- src/ntwxwin.mak | 2 +- src/stubs/app.cpp | 37 +++---- 36 files changed, 410 insertions(+), 336 deletions(-) diff --git a/docs/msw/changes.txt b/docs/msw/changes.txt index e15f54455b..f2ad9cdb14 100644 --- a/docs/msw/changes.txt +++ b/docs/msw/changes.txt @@ -2,6 +2,19 @@ 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 ---------------------------- diff --git a/include/wx/defs.h b/include/wx/defs.h index f3eb99881e..9a97532c80 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -150,7 +150,7 @@ typedef int wxWindowID; # ifdef WXMAKINGDLL # define WXDLLEXPORT __declspec( dllexport ) # define WXDLLEXPORT_DATA(type) __declspec( dllexport ) type -# define WXDLLEXPORT_CTORFN __declspec( dllexport ) +# define WXDLLEXPORT_CTORFN // __declspec( dllexport ) # elif defined(WXUSINGDLL) # define WXDLLEXPORT __declspec( dllimport ) # define WXDLLEXPORT_DATA(type) __declspec( dllimport ) type diff --git a/include/wx/filefn.h b/include/wx/filefn.h index c7c5b3ff7f..e5a12a873a 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -40,101 +40,101 @@ typedef enum { // ---------------------------------------------------------------------------- // functions // ---------------------------------------------------------------------------- -bool WXDLLEXPORT wxFileExists(const wxString& filename); +WXDLLEXPORT bool wxFileExists(const wxString& filename); #define FileExists wxFileExists // 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 DirExists wxDirExists -bool WXDLLEXPORT wxIsAbsolutePath(const wxString& filename); +WXDLLEXPORT bool wxIsAbsolutePath(const wxString& filename); #define IsAbsolutePath wxIsAbsolutePath // Get filename -char* WXDLLEXPORT wxFileNameFromPath(char *path); -wxString WXDLLEXPORT wxFileNameFromPath(const wxString& path); +WXDLLEXPORT char* wxFileNameFromPath(char *path); +WXDLLEXPORT wxString wxFileNameFromPath(const wxString& path); #define FileNameFromPath wxFileNameFromPath // Get directory -char* WXDLLEXPORT wxPathOnly(char *path); -wxString WXDLLEXPORT wxPathOnly(const wxString& path); +WXDLLEXPORT char* wxPathOnly(char *path); +WXDLLEXPORT wxString wxPathOnly(const wxString& path); #define PathOnly wxPathOnly // 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 -void WXDLLEXPORT wxUnix2DosFilename(char *s); +WXDLLEXPORT void wxUnix2DosFilename(char *s); #define Unix2DosFilename wxUnix2DosFilename // Strip the extension, in situ -void WXDLLEXPORT wxStripExtension(char *buffer); -void WXDLLEXPORT wxStripExtension(wxString& buffer); +WXDLLEXPORT void wxStripExtension(char *buffer); +WXDLLEXPORT void wxStripExtension(wxString& buffer); // 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) -char* WXDLLEXPORT wxExpandPath(char *dest, const char *path); +WXDLLEXPORT char* wxExpandPath(char *dest, const char *path); // Contract w.r.t environment ( -> ${OPENWINHOME}/lib) // and make (if under the home tree) relative to home // [caller must copy-- volatile] -char* WXDLLEXPORT wxContractPath (const wxString& filename, +WXDLLEXPORT char* wxContractPath (const wxString& filename, const wxString& envname = "", const wxString& user = ""); // Destructive removal of /./ and /../ stuff -char* WXDLLEXPORT wxRealPath(char *path); +WXDLLEXPORT char* wxRealPath(char *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. // Flags are reserved for future use. #define wxFILE 1 #define wxDIR 2 -char* WXDLLEXPORT wxFindFirstFile(const char *spec, int flags = wxFILE); -char* WXDLLEXPORT wxFindNextFile(void); +WXDLLEXPORT char* wxFindFirstFile(const char *spec, int flags = wxFILE); +WXDLLEXPORT char* wxFindNextFile(void); // 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)? // If dot_special is TRUE, doesn't match * against . (eliminating // `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 -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 -bool WXDLLEXPORT wxCopyFile(const wxString& file1, const wxString& file2); +WXDLLEXPORT bool wxCopyFile(const wxString& file1, const wxString& file2); // Remove file -bool WXDLLEXPORT wxRemoveFile(const wxString& file); +WXDLLEXPORT bool wxRemoveFile(const wxString& 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. // If buf is NULL, allocates space using new, else // copies into buf. // IMPORTANT NOTE getcwd is know not to work under some releases // 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 -bool WXDLLEXPORT wxSetWorkingDirectory(const wxString& d); +WXDLLEXPORT bool wxSetWorkingDirectory(const wxString& d); // Make directory -bool WXDLLEXPORT wxMkdir(const wxString& dir); +WXDLLEXPORT bool wxMkdir(const wxString& dir); // 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 #define FILE_SEP_EXT '.' @@ -169,17 +169,17 @@ inline bool wxIsPathSeparator(char c) { return c == FILE_SEP_PATH_DOS || c == FILE_SEP_PATH_UNIX; } // 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 // (understands both '/' and '\\') -void WXDLLEXPORT wxSplitPath(const char *pszFileName, +WXDLLEXPORT void wxSplitPath(const char *pszFileName, wxString *pstrPath, wxString *pstrName, wxString *pstrExt); // 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 diff --git a/include/wx/generic/choicdgg.h b/include/wx/generic/choicdgg.h index 0fbf506718..1f0ba8dacf 100644 --- a/include/wx/generic/choicdgg.h +++ b/include/wx/generic/choicdgg.h @@ -56,43 +56,43 @@ protected: 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 x = -1, int y = -1, bool centre = TRUE, 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 x = -1, int y = -1, bool centre = TRUE, int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT); // Same as above but gets position in list of strings, instead of string, // 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 x = -1, int y = -1, bool centre = TRUE, 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 x = -1, int y = -1, bool centre = TRUE, int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT); // 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, wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1, bool centre = TRUE, 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, wxWindow *parent = (wxWindow *) NULL, int x = -1, int y = -1, bool centre = TRUE, 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 nsel, int * selection, wxWindow *parent = NULL, int x = -1 , int y = -1, bool centre = TRUE, diff --git a/include/wx/intl.h b/include/wx/intl.h index 193c4cc0e2..fd26e1054c 100644 --- a/include/wx/intl.h +++ b/include/wx/intl.h @@ -115,10 +115,10 @@ private: // ---------------------------------------------------------------------------- // global functions // ---------------------------------------------------------------------------- -wxLocale* WXDLLEXPORT wxGetLocale(); +WXDLLEXPORT wxLocale* wxGetLocale(); // 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(); return pLoc == (wxLocale *) NULL ? sz : pLoc->GetString(sz); diff --git a/include/wx/log.h b/include/wx/log.h index 4e482faf1c..32c9b1f0e8 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -379,9 +379,9 @@ WXDLLEXPORT_DATA(extern bool) g_bVerbose; // ---------------------------------------------------------------------------- // 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 -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 diff --git a/include/wx/memory.h b/include/wx/memory.h index 9cfff090e0..6216211d25 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -56,16 +56,17 @@ void wxDebugFree(void * buf, bool isVect = FALSE); void * operator new (size_t size, char * fileName, int lineNum); 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) ) void * operator new[] (size_t size, char * fileName, int lineNum); void operator delete[] (void * buf); #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 diff --git a/include/wx/msw/clipbrd.h b/include/wx/msw/clipbrd.h index b556727098..ac81d40d45 100644 --- a/include/wx/msw/clipbrd.h +++ b/include/wx/msw/clipbrd.h @@ -23,16 +23,16 @@ #include "wx/list.h" -bool WXDLLEXPORT wxOpenClipboard(void); -bool WXDLLEXPORT wxClipboardOpen(void); -bool WXDLLEXPORT wxCloseClipboard(void); -bool WXDLLEXPORT wxEmptyClipboard(void); -bool WXDLLEXPORT wxIsClipboardFormatAvailable(int dataFormat); -bool WXDLLEXPORT wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0); -wxObject* WXDLLEXPORT wxGetClipboardData(int dataFormat, long *len = NULL); -int WXDLLEXPORT wxEnumClipboardFormats(int dataFormat); -int WXDLLEXPORT wxRegisterClipboardFormat(char *formatName); -bool WXDLLEXPORT wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount); +WXDLLEXPORT bool wxOpenClipboard(void); +WXDLLEXPORT bool wxClipboardOpen(void); +WXDLLEXPORT bool wxCloseClipboard(void); +WXDLLEXPORT bool wxEmptyClipboard(void); +WXDLLEXPORT bool wxIsClipboardFormatAvailable(int dataFormat); +WXDLLEXPORT bool wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0); +WXDLLEXPORT wxObject* wxGetClipboardData(int dataFormat, long *len = NULL); +WXDLLEXPORT int wxEnumClipboardFormats(int dataFormat); +WXDLLEXPORT int wxRegisterClipboardFormat(char *formatName); +WXDLLEXPORT bool wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount); /* The following is Matthew Flatt's implementation of the MSW * side of generic clipboard functionality. @@ -101,7 +101,7 @@ class WXDLLEXPORT wxClipboard : public wxObject }; /* Initialize wxTheClipboard. Can be called repeatedly */ -void WXDLLEXPORT wxInitClipboard(void); +WXDLLEXPORT void wxInitClipboard(void); /* The clipboard */ WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard; diff --git a/include/wx/msw/filedlg.h b/include/wx/msw/filedlg.h index 356dc8ea03..58869bdb74 100644 --- a/include/wx/msw/filedlg.h +++ b/include/wx/msw/filedlg.h @@ -68,22 +68,22 @@ public: #define wxFILE_MUST_EXIST 0x0010 // 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 *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, wxWindow *parent = NULL, int x = -1, int y = -1); // 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 *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, wxWindow *parent = NULL, int x = -1, int y = -1); // 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 -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 // _WX_FILEDLG_H_ diff --git a/include/wx/msw/listbox.h b/include/wx/msw/listbox.h index fecc9b2fbc..ac0efc056f 100644 --- a/include/wx/msw/listbox.h +++ b/include/wx/msw/listbox.h @@ -25,7 +25,13 @@ WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr; // define the array of list box items #include + + #undef WXDLLEXPORTLOCAL + #define WXDLLEXPORTLOCAL WXDLLEXPORT WX_DEFINE_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray); + #undef WXDLLEXPORTLOCAL + #define WXDLLEXPORTLOCAL + #endif // forward decl for GetSelections() diff --git a/include/wx/msw/notebook.h b/include/wx/msw/notebook.h index 7ce1bd4274..bebae78055 100644 --- a/include/wx/msw/notebook.h +++ b/include/wx/msw/notebook.h @@ -32,8 +32,15 @@ class WXDLLEXPORT wxWindow; // array of notebook pages typedef wxWindow WXDLLEXPORT wxNotebookPage; // so far, any window can be a page + +#undef WXDLLEXPORTLOCAL +#define WXDLLEXPORTLOCAL WXDLLEXPORT + WX_DEFINE_ARRAY(wxNotebookPage *, wxArrayPages); +#undef WXDLLEXPORTLOCAL +#define WXDLLEXPORTLOCAL + // ---------------------------------------------------------------------------- // notebook events // ---------------------------------------------------------------------------- diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 8633deb50b..8963d452e3 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -20,10 +20,10 @@ class WXDLLEXPORT wxFont ; -void WXDLLEXPORT wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font); -void WXDLLEXPORT wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos); -wxWindow* WXDLLEXPORT wxFindWinFromHandle(WXHWND hWnd); -void WXDLLEXPORT wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos); +WXDLLEXPORT void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font); +WXDLLEXPORT void wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos); +WXDLLEXPORT wxWindow* wxFindWinFromHandle(WXHWND hWnd); +WXDLLEXPORT void wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos); WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_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 HFONT) wxSTATUS_LINE_FONT; -extern HINSTANCE WXDLLEXPORT wxGetInstance(); -void WXDLLEXPORT wxFillLogFont(LOGFONT *logFont, wxFont *font); -wxFont WXDLLEXPORT wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNew = TRUE); +WXDLLEXPORT HINSTANCE wxGetInstance(); +WXDLLEXPORT void wxFillLogFont(LOGFONT *logFont, wxFont *font); +WXDLLEXPORT wxFont wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNew = TRUE); #ifdef __GNUWIN32__ # define CASTWNDPROC (long unsigned) @@ -68,9 +68,9 @@ typedef signed short int SHORT ; #endif #if wxUSE_PENWIN -void WXDLLEXPORT wxRegisterPenWin(void); -void WXDLLEXPORT wxCleanUpPenWin(void); -void WXDLLEXPORT wxEnablePenAppHooks (bool hook); +WXDLLEXPORT void wxRegisterPenWin(void); +WXDLLEXPORT void wxCleanUpPenWin(void); +WXDLLEXPORT void wxEnablePenAppHooks (bool hook); #endif #if wxUSE_ITSY_BITSY @@ -136,7 +136,7 @@ extern LONG APIENTRY _EXPORT wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); // 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 WXDLLEXPORT_DATA(extern wxList) wxScrollBarList; @@ -145,14 +145,14 @@ WXDLLEXPORT_DATA(extern FARPROC) wxGenericControlSubClassProc; WXDLLEXPORT_DATA(extern char*) wxBuffer; WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance; -wxWindow* WXDLLEXPORT wxFindControlFromHandle(WXHWND hWnd); -void WXDLLEXPORT wxAddControlHandle(WXHWND hWnd, wxWindow *item); +WXDLLEXPORT wxWindow* wxFindControlFromHandle(WXHWND hWnd); +WXDLLEXPORT void wxAddControlHandle(WXHWND hWnd, wxWindow *item); // 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? -inline bool WXDLLEXPORT wxStyleHasBorder(long style) +inline bool wxStyleHasBorder(long style) { return (style & (wxSIMPLE_BORDER | wxRAISED_BORDER | wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0; diff --git a/include/wx/msw/setup.h b/include/wx/msw/setup.h index ad0df4d227..9e205cc1f2 100644 --- a/include/wx/msw/setup.h +++ b/include/wx/msw/setup.h @@ -30,7 +30,7 @@ #define wxUSE_AUTOTRANS 1 // Define wxTString -#define wxUSE_POSTSCRIPT 1 +#define wxUSE_POSTSCRIPT 0 // 0 for no PostScript device context #define wxUSE_AFM_FOR_POSTSCRIPT 0 // 1 to use font metric files in GetTextExtent diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 1fc2958ab1..51b44fdaf8 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -728,15 +728,15 @@ inline int wxWindow::GetReturnCode(void) { return m_returnCode; } inline bool wxWindow::IsBeingDeleted(void) { return m_isBeingDeleted; } // Window specific (so far) -wxWindow* WXDLLEXPORT wxGetActiveWindow(void); +WXDLLEXPORT wxWindow* wxGetActiveWindow(void); WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows; -int WXDLLEXPORT wxCharCodeMSWToWX(int keySym); -int WXDLLEXPORT wxCharCodeWXToMSW(int id, bool *IsVirtual); +WXDLLEXPORT int wxCharCodeMSWToWX(int keySym); +WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual); // Allocates control ids -int WXDLLEXPORT NewControlId(void); +WXDLLEXPORT int NewControlId(void); #endif // _WX_WINDOW_H_ diff --git a/include/wx/object.h b/include/wx/object.h index f56d1fd41f..4dd391fb06 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -96,10 +96,10 @@ public: static wxHashTable* sm_classTable; }; -wxObject* WXDLLEXPORT wxCreateDynamicObject(const char *name); +WXDLLEXPORT wxObject* wxCreateDynamicObject(const char *name); #ifdef wxUSE_SERIAL -wxObject* WXDLLEXPORT wxCreateStoredObject( wxInputStream& stream ); +WXDLLEXPORT wxObject* wxCreateStoredObject( wxInputStream& stream ); #endif #define DECLARE_DYNAMIC_CLASS(name) \ diff --git a/include/wx/postscrp.h b/include/wx/postscrp.h index bd222d8715..1270ff477a 100644 --- a/include/wx/postscrp.h +++ b/include/wx/postscrp.h @@ -186,26 +186,26 @@ enum { };// ps_action = PS_PREVIEW; // PostScript printer settings -void WXDLLEXPORT wxSetPrinterCommand(const char *cmd); -void WXDLLEXPORT wxSetPrintPreviewCommand(const char *cmd); -void WXDLLEXPORT wxSetPrinterOptions(const char *flags); -void WXDLLEXPORT wxSetPrinterOrientation(int orientation); -void WXDLLEXPORT wxSetPrinterScaling(double x, double y); -void WXDLLEXPORT wxSetPrinterTranslation(long x, long y); -void WXDLLEXPORT wxSetPrinterMode(int mode); -void WXDLLEXPORT wxSetPrinterFile(const char *f); -void WXDLLEXPORT wxSetAFMPath(const char *f); +WXDLLEXPORT void wxSetPrinterCommand(const char *cmd); +WXDLLEXPORT void wxSetPrintPreviewCommand(const char *cmd); +WXDLLEXPORT void wxSetPrinterOptions(const char *flags); +WXDLLEXPORT void wxSetPrinterOrientation(int orientation); +WXDLLEXPORT void wxSetPrinterScaling(double x, double y); +WXDLLEXPORT void wxSetPrinterTranslation(long x, long y); +WXDLLEXPORT void wxSetPrinterMode(int mode); +WXDLLEXPORT void wxSetPrinterFile(const char *f); +WXDLLEXPORT void wxSetAFMPath(const char *f); // Get current values -char* WXDLLEXPORT wxGetPrinterCommand(void); -char* WXDLLEXPORT wxGetPrintPreviewCommand(void); -char* WXDLLEXPORT wxGetPrinterOptions(void); -int WXDLLEXPORT wxGetPrinterOrientation(void); -void WXDLLEXPORT wxGetPrinterScaling(double* x, double* y); -void WXDLLEXPORT wxGetPrinterTranslation(long *x, long *y); -int WXDLLEXPORT wxGetPrinterMode(void); -char* WXDLLEXPORT wxGetPrinterFile(void); -char* WXDLLEXPORT wxGetAFMPath(void); +WXDLLEXPORT char* wxGetPrinterCommand(void); +WXDLLEXPORT char* wxGetPrintPreviewCommand(void); +WXDLLEXPORT char* wxGetPrinterOptions(void); +WXDLLEXPORT int wxGetPrinterOrientation(void); +WXDLLEXPORT void wxGetPrinterScaling(double* x, double* y); +WXDLLEXPORT void wxGetPrinterTranslation(long *x, long *y); +WXDLLEXPORT int wxGetPrinterMode(void); +WXDLLEXPORT char* wxGetPrinterFile(void); +WXDLLEXPORT char* wxGetAFMPath(void); /* * PostScript print setup information @@ -264,8 +264,8 @@ class WXDLLEXPORT wxPrintSetupData: public wxObject void operator=(wxPrintSetupData& data); }; -extern wxPrintSetupData* WXDLLEXPORT wxThePrintSetupData; -extern void WXDLLEXPORT wxInitializePrintSetupData(bool init = TRUE); +WXDLLEXPORT_DATA(extern wxPrintSetupData*) wxThePrintSetupData; +WXDLLEXPORT extern void wxInitializePrintSetupData(bool init = TRUE); /* * Again, this only really needed for non-Windows platforms diff --git a/include/wx/resource.h b/include/wx/resource.h index 86e126f833..0b0357e554 100644 --- a/include/wx/resource.h +++ b/include/wx/resource.h @@ -155,35 +155,35 @@ class WXDLLEXPORT wxResourceTable: public wxHashTable virtual void ClearTable(); }; -extern void WXDLLEXPORT wxInitializeResourceSystem(); -extern void WXDLLEXPORT wxCleanUpResourceSystem(); +WXDLLEXPORT extern void wxInitializeResourceSystem(); +WXDLLEXPORT extern void wxCleanUpResourceSystem(); WXDLLEXPORT_DATA(extern wxResourceTable*) wxDefaultResourceTable; -extern long WXDLLEXPORT wxParseWindowStyle(const wxString& style); +WXDLLEXPORT extern long wxParseWindowStyle(const wxString& style); class WXDLLEXPORT wxMenuBar; class WXDLLEXPORT wxMenu; class WXDLLEXPORT wxBitmap; class WXDLLEXPORT wxIcon; -extern wxBitmap WXDLLEXPORT wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); -extern wxIcon WXDLLEXPORT wxResourceCreateIcon(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); -extern wxMenuBar* WXDLLEXPORT wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL, wxMenuBar *menuBar = (wxMenuBar *) NULL); -extern wxMenu* WXDLLEXPORT wxResourceCreateMenu(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); -extern bool WXDLLEXPORT wxResourceParseData(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); -extern bool WXDLLEXPORT wxResourceParseFile(const wxString& filename, wxResourceTable *table = (wxResourceTable *) NULL); -extern bool WXDLLEXPORT wxResourceParseString(char* s, wxResourceTable *table = (wxResourceTable *) NULL); -extern void WXDLLEXPORT wxResourceClear(wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern wxMenuBar* wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL, wxMenuBar *menuBar = (wxMenuBar *) NULL); +WXDLLEXPORT extern wxMenu* wxResourceCreateMenu(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern bool wxResourceParseData(const wxString& resource, wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern bool wxResourceParseFile(const wxString& filename, wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern bool wxResourceParseString(char* s, wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern void wxResourceClear(wxResourceTable *table = (wxResourceTable *) NULL); // Register XBM/XPM data -extern bool WXDLLEXPORT 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 bits[], int width, int height, wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern bool wxResourceRegisterBitmapData(const wxString& name, char **data, wxResourceTable *table = (wxResourceTable *) NULL); #define wxResourceRegisterIconData wxResourceRegisterBitmapData /* * Resource identifer code: #define storage */ -extern bool WXDLLEXPORT wxResourceAddIdentifier(const wxString& name, int value, wxResourceTable *table = (wxResourceTable *) NULL); -extern int WXDLLEXPORT wxResourceGetIdentifier(const wxString& name, wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern bool wxResourceAddIdentifier(const wxString& name, int value, wxResourceTable *table = (wxResourceTable *) NULL); +WXDLLEXPORT extern int wxResourceGetIdentifier(const wxString& name, wxResourceTable *table = (wxResourceTable *) NULL); #endif #endif diff --git a/include/wx/stream.h b/include/wx/stream.h index fe62bbfccd..f70fb820ea 100644 --- a/include/wx/stream.h +++ b/include/wx/stream.h @@ -28,7 +28,7 @@ class WXDLLEXPORT wxOutputStream; typedef wxInputStream& (*__wxInputManip)(wxInputStream&); typedef wxOutputStream& (*__wxOutputManip)(wxOutputStream&); -wxOutputStream& WXDLLEXPORT wxEndL(wxOutputStream& o_stream); +WXDLLEXPORT wxOutputStream& wxEndL(wxOutputStream& o_stream); // --------------------------------------------------------------------------- // Stream buffer diff --git a/include/wx/string.h b/include/wx/string.h index 1db45300c4..4c1b663b9e 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -937,7 +937,7 @@ wxString WXDLLEXPORT operator+(const char *psz, const wxString& string); # endif #endif -istream& WXDLLEXPORT operator>>(istream& is, wxString& str); +WXDLLEXPORT istream& operator>>(istream& is, wxString& str); #endif //std::string compatibility diff --git a/include/wx/utils.h b/include/wx/utils.h index cebdd6c3dc..ac617007e0 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -55,21 +55,21 @@ class WXDLLEXPORT wxFrame; #define wxToLower(C) (((C) >= 'A' && (C) <= 'Z')? (C) - 'A' + 'a': (C)) // Return a string with the current date/time -wxString WXDLLEXPORT wxNow(void); +WXDLLEXPORT wxString wxNow(void); // Make a copy of this string using 'new' -char* WXDLLEXPORT copystring(const char *s); +WXDLLEXPORT char* copystring(const char *s); // Generate a unique ID -long WXDLLEXPORT wxNewId(void); +WXDLLEXPORT long wxNewId(void); #define NewId wxNewId // Ensure subsequent IDs don't clash with this one -void WXDLLEXPORT wxRegisterId(long id); +WXDLLEXPORT void wxRegisterId(long id); #define RegisterId wxRegisterId // Return the current ID -long WXDLLEXPORT wxGetCurrentId(void); +WXDLLEXPORT long wxGetCurrentId(void); // Useful buffer WXDLLEXPORT_DATA(extern char*) wxBuffer; @@ -78,50 +78,50 @@ WXDLLEXPORT_DATA(extern const char*) wxFloatToStringStr; WXDLLEXPORT_DATA(extern const char*) wxDoubleToStringStr; // Various conversions -void WXDLLEXPORT StringToFloat(char *s, float *number); -char* WXDLLEXPORT FloatToString(float number, const char *fmt = wxFloatToStringStr); -void WXDLLEXPORT StringToDouble(char *s, double *number); -char* WXDLLEXPORT DoubleToString(double number, const char *fmt = wxDoubleToStringStr); -void WXDLLEXPORT StringToInt(char *s, int *number); -void WXDLLEXPORT StringToLong(char *s, long *number); -char* WXDLLEXPORT IntToString(int number); -char* WXDLLEXPORT LongToString(long number); +WXDLLEXPORT void StringToFloat(char *s, float *number); +WXDLLEXPORT char* FloatToString(float number, const char *fmt = wxFloatToStringStr); +WXDLLEXPORT void StringToDouble(char *s, double *number); +WXDLLEXPORT char* DoubleToString(double number, const char *fmt = wxDoubleToStringStr); +WXDLLEXPORT void StringToInt(char *s, int *number); +WXDLLEXPORT void StringToLong(char *s, long *number); +WXDLLEXPORT char* IntToString(int number); +WXDLLEXPORT char* LongToString(long number); // 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 #define wxStringEq(s1, s2) (s1 && s2 && (strcmp(s1, s2) == 0)) // 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 -void WXDLLEXPORT wxDecToHex(int dec, char *buf); -wxString WXDLLEXPORT wxDecToHex(int dec); +WXDLLEXPORT void wxDecToHex(int dec, char *buf); +WXDLLEXPORT wxString wxDecToHex(int dec); // 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); -long WXDLLEXPORT wxExecute(const wxString& command, bool sync = FALSE, +WXDLLEXPORT long wxExecute(const wxString& command, bool sync = FALSE, wxProcess *process = (wxProcess *) NULL); #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 // 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 -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) -long WXDLLEXPORT wxGetFreeMemory(void); +WXDLLEXPORT long wxGetFreeMemory(void); // Consume all events until no more left -void WXDLLEXPORT wxFlushEvents(void); +WXDLLEXPORT void wxFlushEvents(void); /* * Network and username functions. @@ -129,33 +129,33 @@ void WXDLLEXPORT wxFlushEvents(void); */ // Get eMail address -bool WXDLLEXPORT wxGetEmailAddress(char *buf, int maxSize); +WXDLLEXPORT bool wxGetEmailAddress(char *buf, int maxSize); // Get hostname. -bool WXDLLEXPORT wxGetHostName(char *buf, int maxSize); +WXDLLEXPORT bool wxGetHostName(char *buf, int maxSize); // 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 -bool WXDLLEXPORT wxGetUserName(char *buf, int maxSize); +WXDLLEXPORT bool wxGetUserName(char *buf, int maxSize); /* * Strip out any menu codes */ -char* WXDLLEXPORT wxStripMenuCodes(char *in, char *out = (char *) NULL); -wxString WXDLLEXPORT wxStripMenuCodes(const wxString& str); +WXDLLEXPORT char* wxStripMenuCodes(char *in, char *out = (char *) NULL); +WXDLLEXPORT wxString wxStripMenuCodes(const wxString& str); // Find the window/widget with the given title or label. // Pass a parent to begin the search from, or NULL to look through // 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. -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. -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. // 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)) // Yield to other apps/messages -bool WXDLLEXPORT wxYield(void); +WXDLLEXPORT bool wxYield(void); // Format a message on the standard error (UNIX) or the debugging // stream (Windows) -void WXDLLEXPORT wxDebugMsg(const char *fmt ...) ; +WXDLLEXPORT void wxDebugMsg(const char *fmt ...) ; // Sound the bell -void WXDLLEXPORT wxBell(void) ; +WXDLLEXPORT void wxBell(void) ; // 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 class WXDLLEXPORT wxCursor; WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR; -void WXDLLEXPORT wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR); +WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR); // Restore cursor to normal -void WXDLLEXPORT wxEndBusyCursor(void); +WXDLLEXPORT void wxEndBusyCursor(void); // TRUE if we're between the above two calls -bool WXDLLEXPORT wxIsBusy(void); +WXDLLEXPORT bool wxIsBusy(void); /* Error message functions used by wxWindows */ // Non-fatal error (continues) 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) 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) #if wxUSE_RESOURCES -bool WXDLLEXPORT 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 = ""); -bool WXDLLEXPORT 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 = ""); - -bool WXDLLEXPORT 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 = ""); -bool WXDLLEXPORT 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 wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = ""); +WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = ""); +WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = ""); +WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = ""); + +WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file = ""); +WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = ""); +WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = ""); +WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = ""); #endif // wxUSE_RESOURCES // 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) // 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 // in long calculations. -bool WXDLLEXPORT wxCheckForInterrupt(wxWindow *wnd); +WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd); void WXDLLEXPORT wxGetMousePosition( int* x, int* y ); // MSW only: get user-defined resource from the .res file. // Returns NULL or newly-allocated memory, so use delete[] to clean up. #ifdef __WXMSW__ -extern const char* WXDLLEXPORT wxUserResourceStr; -char* WXDLLEXPORT wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = wxUserResourceStr); +WXDLLEXPORT extern const char* wxUserResourceStr; +WXDLLEXPORT char* wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = wxUserResourceStr); #endif // X only diff --git a/include/wx/version.h b/include/wx/version.h index d5dc85bd37..5426016a32 100644 --- a/include/wx/version.h +++ b/include/wx/version.h @@ -18,7 +18,7 @@ #define wxRELEASE_NUMBER 0 #define wxVERSION_STRING "wxWindows 2.0" #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)) #endif diff --git a/include/wx/wx.h b/include/wx/wx.h index ff42680734..525fa9114a 100644 --- a/include/wx/wx.h +++ b/include/wx/wx.h @@ -15,6 +15,7 @@ #include "wx/setup.h" // Which features to include - user editable #include "wx/defs.h" #include "wx/string.h" +#include "wx/log.h" #include "wx/window.h" #include "wx/panel.h" #include "wx/frame.h" @@ -23,7 +24,6 @@ #include "wx/dcmemory.h" #include "wx/dcprint.h" #include "wx/dcscreen.h" -#include "wx/postscrp.h" #include "wx/button.h" #include "wx/bmpbuttn.h" #include "wx/checkbox.h" diff --git a/include/wx/wxexpr.h b/include/wx/wxexpr.h index a07e6f3171..1135438fbd 100644 --- a/include/wx/wxexpr.h +++ b/include/wx/wxexpr.h @@ -59,9 +59,9 @@ typedef bool (*wxExprErrorHandler) (int errorType, char *msg); 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 { wxExprNull, @@ -263,7 +263,7 @@ class WXDLLEXPORT wxExprDatabase: public wxList // Function call-style interface - some more convenience wrappers/unwrappers // Make a call -wxExpr* WXDLLEXPORT wxExprMakeCall(const wxString& functor ...); +WXDLLEXPORT wxExpr* wxExprMakeCall(const wxString& functor ...); #define wxExprMakeInteger(x) (new wxExpr((long)x)) #define wxExprMakeReal(x) (new wxExpr((double)x)) @@ -272,13 +272,13 @@ wxExpr* WXDLLEXPORT wxExprMakeCall(const wxString& functor ...); #define wxExprMake(x) (new wxExpr(x)) // 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 WXDLLEXPORT_DATA(extern wxExprDatabase*) thewxExprDatabase; // YACC/LEX can leave memory lying around... -extern "C" int WXDLLEXPORT wxExprCleanUp(); +extern "C" WXDLLEXPORT int wxExprCleanUp(); #endif diff --git a/samples/mdi/makefile.nt b/samples/mdi/makefile.nt index c79a4f8d78..7e0b86c583 100644 --- a/samples/mdi/makefile.nt +++ b/samples/mdi/makefile.nt @@ -13,7 +13,7 @@ # Set WXDIR for your system WXDIR = $(WXWIN) -WXUSINGDLL=0 +WXUSINGDLL=1 !include $(WXDIR)\src\ntwxwin.mak diff --git a/samples/minimal/makefile.nt b/samples/minimal/makefile.nt index 0416630669..05af65af8a 100644 --- a/samples/minimal/makefile.nt +++ b/samples/minimal/makefile.nt @@ -14,7 +14,7 @@ # Set WXDIR for your system WXDIR = $(WXWIN) -WXUSINGDLL=0 +WXUSINGDLL=1 !include $(WXDIR)\src\ntwxwin.mak diff --git a/src/common/log.cpp b/src/common/log.cpp index 8f7ebe11fd..fb2b01148f 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -285,6 +285,9 @@ wxString wxLog::TimeStamp() const { 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) ) { char szBuf[128]; time_t timeNow; @@ -296,6 +299,7 @@ wxString wxLog::TimeStamp() const strftime(szBuf, WXSIZEOF(szBuf), m_szTimeFormat, ptmNow); str = szBuf; } +*/ return str; } @@ -496,7 +500,7 @@ void wxLogGui::DoLog(wxLogLevel level, const char *szString) { 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 // anyhow, but do put a timestamp OutputDebugString(strTime + szString + "\n\r"); diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 1b89cd78be..37bf42aa41 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -35,6 +35,7 @@ #include "wx/app.h" #endif +#include #include #if wxUSE_IOSTREAMH @@ -112,7 +113,7 @@ */ void wxMemStruct::ErrorMsg (const char * mesg) { - wxTrace("wxWindows memory checking error: %s\n", mesg); + wxLogDebug("wxWindows memory checking error: %s", mesg); PrintNode (); // << m_fileName << ' ' << m_lineNum << endl; @@ -123,7 +124,7 @@ void wxMemStruct::ErrorMsg (const char * mesg) */ void wxMemStruct::ErrorMsg () { - wxTrace("wxWindows over/underwrite memory error: \n"); + wxLogDebug("wxWindows over/underwrite memory error:"); PrintNode (); // cerr << m_fileName << ' ' << m_lineNum << endl; @@ -328,35 +329,37 @@ void wxMemStruct::PrintNode () { wxObject *obj = (wxObject *)m_actualData; 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 // line + wxString msg(""); + if (m_fileName) - wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); + msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum); if (info && info->GetClassName()) - wxTrace("%s", info->GetClassName()); + msg += info->GetClassName(); else - wxTrace("object"); + msg += "object"; + + wxString msg2; + msg2.Printf(" at $%lX, size %d", (long)GetActualData(), (int)RequestSize()); + msg += msg2; - wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); + wxLogDebug(msg); } else { + wxString msg(""); + if (m_fileName) - wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); - wxTrace("non-object data"); - wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); + msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum); + msg += ("non-object data"); + 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; + wxString msg(""); 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()); - 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 { + wxString msg(""); if (m_fileName) - wxTrace("%s(%d): ", m_fileName, (int)m_lineNum); - wxTrace("non-object data"); - wxTrace(" at $%lX, size %d\n", (long)GetActualData(), (int)RequestSize()); + msg.Printf("%s(%d): ", m_fileName, (int)m_lineNum); + + 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 { // Can't use the error routines as we have no recognisable object. #ifndef __WXGTK__ - wxTrace("Can't verify memory struct - all bets are off!\n"); + wxLogDebug("Can't verify memory struct - all bets are off!"); #endif } return 0; @@ -470,15 +493,6 @@ wxDebugContext::~wxDebugContext(void) 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) { m_debugStream->flush(); @@ -511,11 +525,6 @@ bool wxDebugContext::SetFile(const wxString& file) } else { -/* - char buf[40]; - sprintf(buf, "SetFile: str is %ld", (long) str); - MessageBox(NULL, buf, "Memory", MB_OK); -*/ SetStream(str); return TRUE; } @@ -622,7 +631,8 @@ void wxDebugContext::TraverseList (PmSFV func, wxMemStruct *from) for (wxMemStruct * st = from; st != 0; st = st->m_next) { 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) (); } @@ -636,8 +646,8 @@ void wxDebugContext::TraverseList (PmSFV func, wxMemStruct *from) bool wxDebugContext::PrintList (void) { #ifdef __WXDEBUG__ - if (!HasStream()) - return FALSE; +// if (!HasStream()) +// return FALSE; TraverseList ((PmSFV)&wxMemStruct::PrintNode, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL)); @@ -650,8 +660,8 @@ bool wxDebugContext::PrintList (void) bool wxDebugContext::Dump(void) { #ifdef __WXDEBUG__ - if (!HasStream()) - return FALSE; +// if (!HasStream()) +// return FALSE; if (TRUE) { @@ -661,16 +671,17 @@ bool wxDebugContext::Dump(void) { appNameStr = wxTheApp->GetAppName(); 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 { - wxTrace( "----- Memory dump -----\n" ); + wxLogDebug( "----- Memory dump -----" ); } } TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL)); - wxTrace( "\n\n" ); + wxLogDebug( "" ); + wxLogDebug( "" ); return TRUE; #else @@ -706,8 +717,8 @@ static wxDebugStatsStruct *InsertStatsStruct(wxDebugStatsStruct *head, wxDebugSt bool wxDebugContext::PrintStatistics(bool detailed) { #ifdef __WXDEBUG__ - if (!HasStream()) - return FALSE; +// if (!HasStream()) +// return FALSE; if (TRUE) { @@ -717,11 +728,11 @@ bool wxDebugContext::PrintStatistics(bool detailed) { appNameStr = wxTheApp->GetAppName(); 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 { - 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) { 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"; if (st->m_isObject && st->GetActualData()) @@ -764,7 +776,8 @@ bool wxDebugContext::PrintStatistics(bool detailed) 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(); if (st->m_isObject) @@ -778,21 +791,22 @@ bool wxDebugContext::PrintStatistics(bool detailed) { 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); wxDebugStatsStruct *old = list; list = old->next; free((char *)old); } - wxTrace("\n"); + wxLogDebug(""); } SetDebugMode(currentMode); - wxTrace("Number of object items: %ld\n", noObjectNodes); - wxTrace("Number of non-object items: %ld\n", noNonObjectNodes); - wxTrace("Total allocated size: %ld\n", totalSize); - wxTrace("\n\n"); + wxLogDebug("Number of object items: %ld", noObjectNodes); + wxLogDebug("Number of non-object items: %ld", noNonObjectNodes); + wxLogDebug("Total allocated size: %ld", totalSize); + wxLogDebug(""); + wxLogDebug(""); return TRUE; #else @@ -802,8 +816,8 @@ bool wxDebugContext::PrintStatistics(bool detailed) bool wxDebugContext::PrintClasses(void) { - if (!HasStream()) - return FALSE; +// if (!HasStream()) +// return FALSE; if (TRUE) { @@ -813,7 +827,7 @@ bool wxDebugContext::PrintClasses(void) { appNameStr = wxTheApp->GetAppName(); 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(); if (info->GetClassName()) { - wxTrace("%s ", info->GetClassName()); - - if (info->GetBaseClassName1() && !info->GetBaseClassName2()) - wxTrace("is a %s", info->GetBaseClassName1()); - else if (info->GetBaseClassName1() && info->GetBaseClassName2()) - wxTrace("is a %s, %s", info->GetBaseClassName1(), info->GetBaseClassName2()); - if (info->GetConstructor()) - wxTrace(": dynamic\n"); - else - wxTrace("\n"); + wxString msg(info->GetClassName()); + msg += " "; + + if (info->GetBaseClassName1() && !info->GetBaseClassName2()) + { + msg += "is a "; + msg += info->GetBaseClassName1(); + } + else if (info->GetBaseClassName1() && info->GetBaseClassName2()) + { + msg += "is a "; + msg += info->GetBaseClassName1() ; + msg += ", "; + msg += info->GetBaseClassName2() ; + } + if (info->GetConstructor()) + msg += ": dynamic"; + + wxLogDebug(msg); } node = wxClassInfo::sm_classTable->Next(); 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; } @@ -885,7 +911,8 @@ int wxDebugContext::CountObjectsLeft(void) for (wxMemStruct * st = from; st != 0; st = st->m_next) { 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 ++; } @@ -948,7 +975,14 @@ void operator delete (void * buf) #if _MSC_VER >= 1200 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 @@ -979,7 +1013,7 @@ void * wxDebugAlloc(size_t size, char * fileName, int lineNum, bool isObject, bo char * buf = (char *) malloc(wxDebugContext::TotSize (size)); if (!buf) { - wxTrace("Call to malloc (%ld) failed.\n", (long)size); + wxLogDebug("Call to malloc (%ld) failed.", (long)size); return 0; } wxMemStruct * st = (wxMemStruct *)buf; diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index f65ab8ecaf..22643c5c5e 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -362,13 +362,14 @@ int wxEntry( int argc, char *argv[] ) wxClassInfo::InitializeClasses(); + /* Debug stream no longer used #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT streambuf* sBuf = new wxDebugStreamBuf; ostream* oStr = new ostream(sBuf) ; wxDebugContext::SetStream(oStr, sBuf); - #endif +*/ if (!wxTheApp) { @@ -445,9 +446,6 @@ int wxEntry( int argc, char *argv[] ) wxDELETE(wxTheApp); - wxLog *oldLog = wxLog::SetActiveTarget( NULL ); - if (oldLog) delete oldLog; - wxClassInfo::CleanUpClasses(); delete[] wxBuffer; @@ -456,14 +454,18 @@ int wxEntry( int argc, char *argv[] ) if (wxDebugContext::CountObjectsLeft() > 0) { - wxTrace("There were memory leaks.\n"); + wxLogDebug("There were memory leaks.\n"); wxDebugContext::Dump(); wxDebugContext::PrintStatistics(); } - wxDebugContext::SetStream(NULL, NULL); +// wxDebugContext::SetStream(NULL, NULL); #endif + wxLog *oldLog = wxLog::SetActiveTarget( NULL ); + if (oldLog) delete oldLog; + + return retValue; } diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index f65ab8ecaf..22643c5c5e 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -362,13 +362,14 @@ int wxEntry( int argc, char *argv[] ) wxClassInfo::InitializeClasses(); + /* Debug stream no longer used #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT streambuf* sBuf = new wxDebugStreamBuf; ostream* oStr = new ostream(sBuf) ; wxDebugContext::SetStream(oStr, sBuf); - #endif +*/ if (!wxTheApp) { @@ -445,9 +446,6 @@ int wxEntry( int argc, char *argv[] ) wxDELETE(wxTheApp); - wxLog *oldLog = wxLog::SetActiveTarget( NULL ); - if (oldLog) delete oldLog; - wxClassInfo::CleanUpClasses(); delete[] wxBuffer; @@ -456,14 +454,18 @@ int wxEntry( int argc, char *argv[] ) if (wxDebugContext::CountObjectsLeft() > 0) { - wxTrace("There were memory leaks.\n"); + wxLogDebug("There were memory leaks.\n"); wxDebugContext::Dump(); wxDebugContext::PrintStatistics(); } - wxDebugContext::SetStream(NULL, NULL); +// wxDebugContext::SetStream(NULL, NULL); #endif + wxLog *oldLog = wxLog::SetActiveTarget( NULL ); + if (oldLog) delete oldLog; + + return retValue; } diff --git a/src/motif/app.cpp b/src/motif/app.cpp index 79e667aa01..e0f7726e4a 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -67,6 +67,7 @@ bool wxApp::Initialize() wxBuffer = new char[BUFSIZ + 512]; #endif +/* No longer used #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT streambuf* sBuf = new wxDebugStreamBuf; @@ -74,6 +75,7 @@ bool wxApp::Initialize() wxDebugContext::SetStream(oStr, sBuf); #endif +*/ wxClassInfo::InitializeClasses(); @@ -151,6 +153,23 @@ void wxApp::CleanUp() 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 wxLog::DontCreateOnDemand(); // 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(); - 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; }; diff --git a/src/msw/app.cpp b/src/msw/app.cpp index a38890a323..f0c45de1cd 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -125,6 +125,11 @@ bool wxApp::Initialize() #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(_WINDLL) streambuf* sBuf = NULL; @@ -135,6 +140,7 @@ bool wxApp::Initialize() ostream* oStr = new ostream(sBuf) ; wxDebugContext::SetStream(oStr, sBuf); #endif // wxUSE_MEMORY_TRACING +#endif wxClassInfo::InitializeClasses(); @@ -494,6 +500,23 @@ void wxApp::CleanUp() 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 wxLog::DontCreateOnDemand(); delete wxLog::SetActiveTarget(NULL); @@ -577,23 +600,6 @@ int wxEntry(WXHINSTANCE hInstance, 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; #ifndef __WXDEBUG__ // catch exceptions only in release build } diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index d9d1da958b..ecfd0ea1d5 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -133,8 +133,6 @@ bool wxBitmapButton::MSWOnDraw(WXDRAWITEMSTRUCT *item) if (!old) return FALSE; - RECT rect = lpDIS->rcItem; - int x = lpDIS->rcItem.left; int y = lpDIS->rcItem.top; int width = lpDIS->rcItem.right - x; diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 8cf17984c8..de089033e5 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -170,8 +170,6 @@ bool wxStaticBitmap::MSWOnDraw(WXDRAWITEMSTRUCT *item) if (!old) return FALSE; - RECT rect = lpDIS->rcItem; - int x = lpDIS->rcItem.left; int y = lpDIS->rcItem.top; int width = lpDIS->rcItem.right - x; diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 907a17eeea..6d3ca69dff 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -503,7 +503,7 @@ bool wxIsBusy(void) return (wxBusyCursorCount > 0); } -const char* WXDLLEXPORT wxGetHomeDir(wxString *pstr) +const char* wxGetHomeDir(wxString *pstr) { wxString& strDir = *pstr; diff --git a/src/ntwxwin.mak b/src/ntwxwin.mak index 34958c0c0b..d4c10fcf39 100644 --- a/src/ntwxwin.mak +++ b/src/ntwxwin.mak @@ -32,7 +32,7 @@ SRCSUFF=cpp # 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) #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\ # 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\ diff --git a/src/stubs/app.cpp b/src/stubs/app.cpp index 76f528db8f..bfe240f225 100644 --- a/src/stubs/app.cpp +++ b/src/stubs/app.cpp @@ -57,13 +57,14 @@ bool wxApp::Initialize() wxBuffer = new char[BUFSIZ + 512]; #endif +/* No longer used #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT streambuf* sBuf = new wxDebugStreamBuf; ostream* oStr = new ostream(sBuf) ; wxDebugContext::SetStream(oStr, sBuf); - #endif +*/ wxClassInfo::InitializeClasses(); @@ -119,6 +120,23 @@ void wxApp::CleanUp() 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 wxLog::DontCreateOnDemand(); // 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(); - 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; }; -- 2.45.2