From: Francesco Montorsi Date: Sat, 10 Jan 2009 22:10:54 +0000 (+0000) Subject: fix the definition of many static functions marked as 'const' or functions which... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/57bf907d8e45ced18486d74c04f41c06034b7e65?ds=inline fix the definition of many static functions marked as 'const' or functions which had incoherent default values for their arguments or duplicated functions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/interface/wx/access.h b/interface/wx/access.h index 953e9092b4..5a540f5964 100644 --- a/interface/wx/access.h +++ b/interface/wx/access.h @@ -401,9 +401,9 @@ public: Allows the application to send an event when something changes in an accessible object. */ - virtual static void NotifyEvent(int eventType, wxWindow* window, - wxAccObject objectType, - int objectType); + static void NotifyEvent(int eventType, wxWindow* window, + wxAccObject objectType, + int objectType); /** Selects the object or child. See wxAccSelectionFlags for a list diff --git a/interface/wx/archive.h b/interface/wx/archive.h index c20c3ef841..1a06aabad6 100644 --- a/interface/wx/archive.h +++ b/interface/wx/archive.h @@ -392,7 +392,7 @@ public: GetFirst() and GetNext() return a pointer to a factory or @NULL if no more are available. They do not give away ownership of the factory. */ - static const wxArchiveClassFactory* GetFirst() const; + static const wxArchiveClassFactory* GetFirst(); const wxArchiveClassFactory* GetNext() const; //@} diff --git a/interface/wx/combobox.h b/interface/wx/combobox.h index 2aa5c1d63e..11b57b1c8e 100644 --- a/interface/wx/combobox.h +++ b/interface/wx/combobox.h @@ -157,22 +157,22 @@ public: Creates the combobox for two-step construction. Derived classes should call or replace this function. See wxComboBox() for further details. */ - bool Create(wxWindow* parent, wxWindowID id, - const wxString& value = "", + bool Create(wxWindow *parent, wxWindowID id, + const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n, const wxString choices[], + int n = 0, const wxString choices[] = (const wxString *) NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "comboBox"); - bool Create(wxWindow* parent, wxWindowID id, + const wxString& name = wxComboBoxNameStr); + bool Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "comboBox"); + const wxString& name = wxComboBoxNameStr); //@} /** diff --git a/interface/wx/dcps.h b/interface/wx/dcps.h index 0f5ab59229..614d53d723 100644 --- a/interface/wx/dcps.h +++ b/interface/wx/dcps.h @@ -29,12 +29,12 @@ public: @see SetResolution() */ - static int GetResolution() const; + virtual int GetResolution() const; /** Set resolution (in pixels per inch) that will be used in PostScript output. Default is 720ppi. */ - static void SetResolution(int ppi); + virtual wxRect GetPaperRect() const; }; diff --git a/interface/wx/file.h b/interface/wx/file.h index 6b32e84dca..18e138400d 100644 --- a/interface/wx/file.h +++ b/interface/wx/file.h @@ -102,6 +102,8 @@ class wxTempFile public: /** Associates wxTempFile with the file to be replaced and opens it. + + @warning You should use IsOpened() to verify that the constructor succeeded. */ wxTempFile(const wxString& strName); @@ -248,6 +250,9 @@ public: The filename. @param mode The mode in which to open the file. + + @warning + You should use IsOpened() to verify that the constructor succeeded. */ wxFile(const wxString& filename, wxFile::OpenMode mode = wxFile::read); diff --git a/interface/wx/grid.h b/interface/wx/grid.h index d5bae11d30..458e578383 100644 --- a/interface/wx/grid.h +++ b/interface/wx/grid.h @@ -321,7 +321,7 @@ public: an empty string otherwise. */ static void UseStringValues(const wxString& valueTrue = "1", - const wxString& valueFalse = wxEmptyString) const; + const wxString& valueFalse = wxEmptyString); }; /** diff --git a/interface/wx/htmllbox.h b/interface/wx/htmllbox.h index 64c8096403..2813c2ba76 100644 --- a/interface/wx/htmllbox.h +++ b/interface/wx/htmllbox.h @@ -284,15 +284,14 @@ public: Creates the HTML listbox for two-step construction. See wxSimpleHtmlListBox() for further details. */ - bool Create(wxWindow* parent, wxWindowID id, + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n, - const wxString choices[] = NULL, + int n = 0, const wxString choices[] = NULL, long style = wxHLB_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxSimpleHtmlListBoxNameStr); - bool Create(wxWindow* parent, wxWindowID id, + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, diff --git a/interface/wx/intl.h b/interface/wx/intl.h index 0548bff2b4..6b37c635b0 100644 --- a/interface/wx/intl.h +++ b/interface/wx/intl.h @@ -513,7 +513,7 @@ public: as an argument to this function and in this case the result of GetSystemLanguage() is used. */ - static wxLanguageInfo* GetLanguageInfo(int lang) const; + static const wxLanguageInfo* GetLanguageInfo(int lang); /** Returns English name of the given language or empty string if this @@ -521,7 +521,7 @@ public: See GetLanguageInfo() for a remark about special meaning of @c wxLANGUAGE_DEFAULT. */ - static wxString GetLanguageName(int lang) const; + static wxString GetLanguageName(int lang); /** Returns the locale name as passed to the constructor or Init(). @@ -592,7 +592,7 @@ public: Returns wxFontEncoding() value or @c wxFONTENCODING_SYSTEM if it couldn't be determined. */ - static wxFontEncoding GetSystemEncoding() const; + static wxFontEncoding GetSystemEncoding(); /** Tries to detect the name of the user's default font encoding. @@ -602,14 +602,14 @@ public: Returns a user-readable string value or an empty string if it couldn't be determined. */ - static wxString GetSystemEncodingName() const; + static wxString GetSystemEncodingName(); /** Tries to detect the user's default language setting. Returns the ::wxLanguage value or @b wxLANGUAGE_UNKNOWN if the language-guessing algorithm failed. */ - static int GetSystemLanguage() const; + static int GetSystemLanguage(); /** Initializes the wxLocale instance. diff --git a/interface/wx/listbox.h b/interface/wx/listbox.h index 07f2540d83..275ec8d903 100644 --- a/interface/wx/listbox.h +++ b/interface/wx/listbox.h @@ -129,21 +129,20 @@ public: Creates the listbox for two-step construction. See wxListBox() for further details. */ - bool Create(wxWindow* parent, wxWindowID id, + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n, - const wxString choices[] = NULL, + int n = 0, const wxString choices[] = NULL, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "listBox"); - bool Create(wxWindow* parent, wxWindowID id, + const wxString& name = wxListBoxNameStr); + bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "listBox"); + const wxString& name = wxListBoxNameStr); //@} /** diff --git a/interface/wx/odcombo.h b/interface/wx/odcombo.h index 7544ba228d..f1958bbbcf 100644 --- a/interface/wx/odcombo.h +++ b/interface/wx/odcombo.h @@ -152,22 +152,33 @@ public: @remarks Derived classes should call or replace this function. */ - bool Create(wxWindow* parent, wxWindowID id, + bool Create(wxWindow *parent, + wxWindowID id, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - int n, const wxString choices[], long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "comboBox"); - bool Create(wxWindow* parent, wxWindowID id, + const wxString& name = wxComboBoxNameStr); + bool Create(wxWindow *parent, + wxWindowID id, + const wxString& value, + const wxPoint& pos, + const wxSize& size, + int n, + const wxString choices[], + long style = 0, + const wxValidator& validator = wxDefaultValidator, + const wxString& name = wxComboBoxNameStr); + bool Create(wxWindow *parent, + wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, - const wxString& name = "comboBox"); + const wxString& name = wxComboBoxNameStr); //@} /** diff --git a/interface/wx/platinfo.h b/interface/wx/platinfo.h index 7b6a1821e6..3e8d768522 100644 --- a/interface/wx/platinfo.h +++ b/interface/wx/platinfo.h @@ -181,7 +181,7 @@ public: /** Returns the name for the given wxArchitecture enumeration value. */ - static wxString GetArchName(wxArchitecture arch) const; + static wxString GetArchName(wxArchitecture arch); /** Returns the name for the architecture of this wxPlatformInfo instance. @@ -198,7 +198,7 @@ public: @c wxENDIAN_INVALID if the given string is not a valid endianness string (i.e. does not contain nor little nor big strings). */ - static wxEndianness GetEndianness(const wxString& end) const; + static wxEndianness GetEndianness(const wxString& end); /** Returns the endianness ID of this wxPlatformInfo instance. @@ -208,7 +208,7 @@ public: /** Returns name for the given wxEndianness enumeration value. */ - static wxString GetEndiannessName(wxEndianness end) const; + static wxString GetEndiannessName(wxEndianness end); /** Returns the name for the endianness of this wxPlatformInfo instance. @@ -236,7 +236,7 @@ public: enumeration value: @c Unix for @c wxOS_UNIX, @c Macintosh for @c wxOS_MAC, @c Windows for @c wxOS_WINDOWS, @c DOS for @c wxOS_DOS, @c OS/2 for @c wxOS_OS2. */ - static wxString GetOperatingSystemFamilyName(wxOperatingSystemId os) const; + static wxString GetOperatingSystemFamilyName(wxOperatingSystemId os); /** Returns the operating system family name of the OS associated with this @@ -248,7 +248,7 @@ public: Converts the given string to a wxOperatingSystemId enum value or to @c wxOS_UNKNOWN if the given string is not a valid operating system name. */ - static wxOperatingSystemId GetOperatingSystemId(const wxString& name) const; + static wxOperatingSystemId GetOperatingSystemId(const wxString& name); /** Returns the operating system ID of this wxPlatformInfo instance. @@ -261,7 +261,7 @@ public: This can be a long name (e.g. Microsoft Windows NT); use GetOperatingSystemFamilyName() to retrieve a short, generic name. */ - static wxString GetOperatingSystemIdName(wxOperatingSystemId os) const; + static wxString GetOperatingSystemIdName(wxOperatingSystemId os); /** Returns the operating system name of the OS associated with this wxPlatformInfo @@ -275,7 +275,7 @@ public: if the given string does not match any of the wxWidgets canonical name ports ("wxGTK", "wxMSW", etc) nor any of the short wxWidgets name ports ("gtk", "msw", etc). */ - static wxPortId GetPortId(const wxString& portname) const; + static wxPortId GetPortId(const wxString& portname); /** Returns the wxWidgets port ID associated with this wxPlatformInfo instance. @@ -289,7 +289,7 @@ public: The returned string always starts with the "wx" prefix and is a mixed-case string. */ - static wxString GetPortIdName(wxPortId port, bool usingUniversal) const; + static wxString GetPortIdName(wxPortId port, bool usingUniversal); /** Returns the name of the wxWidgets port ID associated with this wxPlatformInfo @@ -305,7 +305,7 @@ public: The returned string does not start with the "wx" prefix and is always lower case. */ static wxString GetPortIdShortName(wxPortId port, - bool usingUniversal) const; + bool usingUniversal); /** Returns the short name of the wxWidgets port ID associated with this diff --git a/interface/wx/richtext/richtextbuffer.h b/interface/wx/richtext/richtextbuffer.h index 5731c8c28b..f6d6fa55ba 100644 --- a/interface/wx/richtext/richtextbuffer.h +++ b/interface/wx/richtext/richtextbuffer.h @@ -361,7 +361,6 @@ public: */ virtual void Clear(); - //@{ /** Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph. @@ -373,9 +372,6 @@ public: */ bool ClearListStyle(const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - bool ClearListStyle(const wxRichTextRange& range, - int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - //@} /** Clears the style stack. diff --git a/interface/wx/richtext/richtextctrl.h b/interface/wx/richtext/richtextctrl.h index f70ad5a7dd..11a5b60b08 100644 --- a/interface/wx/richtext/richtextctrl.h +++ b/interface/wx/richtext/richtextctrl.h @@ -443,7 +443,6 @@ public: */ virtual void Clear(); - //@{ /** Clears the list style from the given range, clearing list-related attributes and applying any named paragraph style associated with each paragraph. @@ -455,9 +454,6 @@ public: */ bool ClearListStyle(const wxRichTextRange& range, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - bool ClearListStyle(const wxRichTextRange& range, - int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO); - //@} /** Sends the event to the control. diff --git a/interface/wx/sound.h b/interface/wx/sound.h index 5d38e6c5a0..b4e65d0e50 100644 --- a/interface/wx/sound.h +++ b/interface/wx/sound.h @@ -64,7 +64,7 @@ public: Returns @true if a sound is played at the moment. This method is currently not implemented under Windows. */ - static bool IsPlaying() const; + static bool IsPlaying(); //@{ /** diff --git a/interface/wx/stream.h b/interface/wx/stream.h index 0d7511ce44..d668a6d6d4 100644 --- a/interface/wx/stream.h +++ b/interface/wx/stream.h @@ -561,7 +561,7 @@ public: GetFirst()/GetNext() return a pointer to a factory or @NULL if no more are available. They do not give away ownership of the factory. */ - static const wxFilterClassFactory* GetFirst() const; + static const wxFilterClassFactory* GetFirst(); const wxFilterClassFactory* GetNext() const; //@} diff --git a/interface/wx/string.h b/interface/wx/string.h index a88ae09f14..b42f6b8edd 100644 --- a/interface/wx/string.h +++ b/interface/wx/string.h @@ -488,26 +488,6 @@ public: */ int CmpNoCase(const wxString& s) const; - - //@{ - /** - Comparison operators - */ - bool operator ==(const wxString& x, const wxString& y); - bool operator ==(const wxString& x, wxUniChar ch); - bool operator !=(const wxString& x, const wxString& y); - bool operator !=(const wxString& x, wxUniChar ch); - bool operator(const wxString& x, const wxString& y); - bool operator(const wxString& x, wxUniChar ch); - bool operator =(const wxString& x, const wxString& y); - bool operator =(const wxString& x, wxUniChar ch); - bool operator(const wxString& x, const wxString& y); - bool operator(const wxString& x, wxUniChar ch); - bool operator =(const wxString& x, const wxString& y); - bool operator =(const wxString& x, wxUniChar ch); - //@} - - /** Returns @true if target appears anywhere in wxString; else @false. This is a wxWidgets 1.xx compatibility function; you should not use it in new @@ -1119,8 +1099,6 @@ public: wxString& operator<<(const char* psz); wxString& operator<<(const wchar_t* pwz); wxString& operator<<(const wxCStrData& psz); - wxString& operator<<(const char* psz); - wxString& operator<<(wxUniCharRef ch); wxString& operator<<(char ch); wxString& operator<<(unsigned char ch); wxString& operator<<(wchar_t ch); @@ -1368,6 +1346,57 @@ public: //@} }; +/** @addtogroup group_string_operators */ +//@{ +/** + Comparison operators for wxString. +*/ +inline bool operator==(const wxString& s1, const wxString& s2); +inline bool operator!=(const wxString& s1, const wxString& s2); +inline bool operator< (const wxString& s1, const wxString& s2); +inline bool operator> (const wxString& s1, const wxString& s2); +inline bool operator<=(const wxString& s1, const wxString& s2); +inline bool operator>=(const wxString& s1, const wxString& s2); +inline bool operator==(const wxString& s1, const wxCStrData& s2); +inline bool operator==(const wxCStrData& s1, const wxString& s2); +inline bool operator!=(const wxString& s1, const wxCStrData& s2); +inline bool operator!=(const wxCStrData& s1, const wxString& s2); +inline bool operator==(const wxString& s1, const wxWCharBuffer& s2); +inline bool operator==(const wxWCharBuffer& s1, const wxString& s2); +inline bool operator!=(const wxString& s1, const wxWCharBuffer& s2); +inline bool operator!=(const wxWCharBuffer& s1, const wxString& s2); +inline bool operator==(const wxString& s1, const wxCharBuffer& s2); +inline bool operator==(const wxCharBuffer& s1, const wxString& s2); +inline bool operator!=(const wxString& s1, const wxCharBuffer& s2); +inline bool operator!=(const wxCharBuffer& s1, const wxString& s2); +inline wxString operator+(const wxString& string, const wxWCharBuffer& buf) +inline wxString operator+(const wxWCharBuffer& buf, const wxString& string) +inline wxString operator+(const wxString& string, const wxCharBuffer& buf) +inline wxString operator+(const wxCharBuffer& buf, const wxString& string) + +/** + Comparison operators with wxUniChar or wxUniCharRef. +*/ +inline bool operator==(const wxUniChar& c, const wxString& s); +inline bool operator==(const wxUniCharRef& c, const wxString& s); +inline bool operator==(char c, const wxString& s); +inline bool operator==(wchar_t c, const wxString& s); +inline bool operator==(int c, const wxString& s); +inline bool operator==(const wxString& s, const wxUniChar& c); +inline bool operator==(const wxString& s, const wxUniCharRef& c); +inline bool operator==(const wxString& s, char c); +inline bool operator==(const wxString& s, wchar_t c); +inline bool operator!=(const wxUniChar& c, const wxString& s); +inline bool operator!=(const wxUniCharRef& c, const wxString& s); +inline bool operator!=(char c, const wxString& s); +inline bool operator!=(wchar_t c, const wxString& s); +inline bool operator!=(int c, const wxString& s); +inline bool operator!=(const wxString& s, const wxUniChar& c); +inline bool operator!=(const wxString& s, const wxUniCharRef& c); +inline bool operator!=(const wxString& s, char c); +inline bool operator!=(const wxString& s, wchar_t c); +//@} + /** The global wxString instance of an empty string. Used extensively in the entire wxWidgets API. diff --git a/interface/wx/textfile.h b/interface/wx/textfile.h index 044dc9529e..3547925681 100644 --- a/interface/wx/textfile.h +++ b/interface/wx/textfile.h @@ -145,7 +145,7 @@ public: compiling with the Apple Developer Tools) and @c wxTextFileType_Mac under Mac OS (including Mac OS X when compiling with CodeWarrior). */ - static const char* GetEOL(wxTextFileType type = typeDefault) const; + static const char* GetEOL(wxTextFileType type = typeDefault); /** This method together with GetNextLine() allows more "iterator-like"