From 0a98423eb038738b5c4c76c575435034ee8b7d56 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Mon, 10 Nov 2008 21:33:25 +0000 Subject: [PATCH] other ifacecheck fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- interface/wx/buffer.h | 2 +- interface/wx/image.h | 15 +++++++++++---- interface/wx/imaglist.h | 4 ++++ interface/wx/joystick.h | 4 ++-- interface/wx/kbdstate.h | 10 +++++----- interface/wx/listbook.h | 2 +- interface/wx/listbox.h | 6 +++--- interface/wx/listctrl.h | 10 +++++----- interface/wx/log.h | 2 +- interface/wx/mediactrl.h | 12 ++++++------ interface/wx/menu.h | 27 +++++++++++++++------------ interface/wx/menuitem.h | 4 ++-- interface/wx/msgdlg.h | 2 +- interface/wx/mstream.h | 2 +- interface/wx/panel.h | 2 +- interface/wx/pen.h | 2 ++ interface/wx/socket.h | 6 +++--- interface/wx/strconv.h | 8 ++++---- interface/wx/stream.h | 10 +++++----- 19 files changed, 73 insertions(+), 57 deletions(-) diff --git a/interface/wx/buffer.h b/interface/wx/buffer.h index 830330adfc..c94116f001 100644 --- a/interface/wx/buffer.h +++ b/interface/wx/buffer.h @@ -34,7 +34,7 @@ public: @param size size of the new buffer. */ - wxMemoryBuffer(size_t size); + wxMemoryBuffer(size_t size = DefBufSize); /** Append a single byte to the buffer. diff --git a/interface/wx/image.h b/interface/wx/image.h index 4ab6761c9e..89a1713893 100644 --- a/interface/wx/image.h +++ b/interface/wx/image.h @@ -641,7 +641,7 @@ public: does have it, this pointer may be used to directly manipulate the alpha values which are stored as the RGB ones. */ - const unsigned char * GetAlpha() const; + unsigned char* GetAlpha() const; /** Returns the blue intensity at the given coordinate. @@ -932,7 +932,9 @@ public: @see SaveFile() */ - bool LoadFile(wxInputStream& stream, wxBitmapType type, int index = -1); + virtual bool LoadFile(wxInputStream& stream, + wxBitmapType type = wxBITMAP_TYPE_ANY, + int index = -1); /** Loads an image from a file. @@ -1221,6 +1223,7 @@ public: */ void SetAlpha(int x, int y, unsigned char alpha); + //@{ /** Sets the image data without performing checks. @@ -1235,7 +1238,10 @@ public: that will be responsible for deleting it. Do not pass to this function a pointer obtained through GetData(). */ - void SetData(unsigned char* data); + void SetData(unsigned char* data, bool static_data = false); + void SetData(unsigned char* data, int new_width, int new_height, + bool static_data = false); + //@} /** Specifies whether there is a mask or not. @@ -1303,7 +1309,8 @@ public: This routine performs bounds-checks for the coordinate so it can be considered a safe way to manipulate the data. */ - void SetRGB(wxRect& rect, unsigned char red, + void SetRGB(const wxRect& rect, + unsigned char red, unsigned char green, unsigned char blue); diff --git a/interface/wx/imaglist.h b/interface/wx/imaglist.h index 76a8eaf5db..e0b8a2d4fe 100644 --- a/interface/wx/imaglist.h +++ b/interface/wx/imaglist.h @@ -100,6 +100,8 @@ public: bitmap will automatically be split into smaller images, each matching the dimensions of the image list. This does not apply when adding icons. + + @onlyfor{wxmsw,wxmac} */ int Add(const wxIcon& icon); @@ -206,6 +208,8 @@ public: @remarks The original bitmap or icon is not affected by the Replace() operation, and can be deleted afterwards. + + @onlyfor{wxmsw,wxmac} */ bool Replace(int index, const wxIcon& icon); }; diff --git a/interface/wx/joystick.h b/interface/wx/joystick.h index 70e5b807e7..a75ba92148 100644 --- a/interface/wx/joystick.h +++ b/interface/wx/joystick.h @@ -48,7 +48,7 @@ public: @param id The button id to report, from 0 to GetNumberButtons() - 1 */ - bool GetButtonState(unsigned id) const; + bool GetButtonState(unsigned int id) const; /** Returns the manufacturer id. @@ -114,7 +114,7 @@ public: @param axis The joystick axis to report, from 0 to GetNumberAxes() - 1. */ - int GetPosition(unsigned axis) const; + int GetPosition(unsigned int axis) const; /** Returns the product id for the joystick. diff --git a/interface/wx/kbdstate.h b/interface/wx/kbdstate.h index 49162c98e3..45310d19c5 100644 --- a/interface/wx/kbdstate.h +++ b/interface/wx/kbdstate.h @@ -30,14 +30,14 @@ public: By default, no modifiers are active. */ - wxKeyboardState(bool controlDown, - bool shiftDown, - bool altDown, - bool metaDown); + wxKeyboardState(bool controlDown = false, + bool shiftDown = false, + bool altDown = false, + bool metaDown = false); /** Return the bit mask of all pressed modifier keys. - + The return value is a combination of @c wxMOD_ALT, @c wxMOD_CONTROL, @c wxMOD_SHIFT and @c wxMOD_META bit masks. Additionally, @c wxMOD_NONE is defined as 0, i.e. corresponds to no modifiers (see HasModifiers()) diff --git a/interface/wx/listbook.h b/interface/wx/listbook.h index eda83765d0..8ba18d5906 100644 --- a/interface/wx/listbook.h +++ b/interface/wx/listbook.h @@ -65,7 +65,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString& name = wxEmptyStr); + const wxString& name = wxEmptyString); /** Returns the wxListView associated with the control. diff --git a/interface/wx/listbox.h b/interface/wx/listbox.h index 029a510b5a..07f2540d83 100644 --- a/interface/wx/listbox.h +++ b/interface/wx/listbox.h @@ -199,7 +199,7 @@ public: Position before which to insert the items: if pos is 0 the items will be inserted in the beginning of the listbox */ - void InsertItems(int nItems, const wxString *items, + void InsertItems(unsigned int nItems, const wxString *items, unsigned int pos); /** @@ -234,7 +234,7 @@ public: @param clientData Options array of client data pointers */ - void Set(int n, const wxString* choices, void **clientData = NULL); + void Set(unsigned int n, const wxString* choices, void *clientData); /** Clears the list box and adds the given strings to it. @@ -246,7 +246,7 @@ public: @param clientData Options array of client data pointers */ - void Set(const wxArrayString& choices, void **clientData = NULL); + void Set(const wxArrayString& choices, void *clientData); /** Set the specified item to be the first visible item. diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h index 69022eaebf..d6ede9abb4 100644 --- a/interface/wx/listctrl.h +++ b/interface/wx/listctrl.h @@ -273,7 +273,7 @@ public: Find an item whose data matches this data, starting from start or the beginning if 'start' is @c -1. */ - long FindItem(long start, long data); + long FindItem(long start, wxUIntPtr data); /** Find an item nearest this position in the specified direction, @@ -923,7 +923,7 @@ public: /** Constructor. */ - wxListEvent(wxEventType commandType = 0, int id = 0); + wxListEvent(wxEventType commandType = wxEVT_NULL, int id = 0); /** For @c EVT_LIST_CACHE_HINT event only: return the first item which the @@ -1025,9 +1025,9 @@ public: Construct a wxListItemAttr with the specified foreground and background colors and font. */ - wxListItemAttr(const wxColour colText, - const wxColour colBack, - const wxFont font); + wxListItemAttr(const wxColour& colText, + const wxColour& colBack, + const wxFont& font); /** Returns the currently set background color. diff --git a/interface/wx/log.h b/interface/wx/log.h index ef8b2a9d83..97f0223098 100644 --- a/interface/wx/log.h +++ b/interface/wx/log.h @@ -396,7 +396,7 @@ public: Constructs a log target which sends all the log messages to the given output stream. If it is @NULL, the messages are sent to @c cerr. */ - wxLogStream(std::ostream ostr = NULL); + wxLogStream(std::ostream *ostr = NULL); }; diff --git a/interface/wx/mediactrl.h b/interface/wx/mediactrl.h index 263e6b42cb..19e1dfeaa2 100644 --- a/interface/wx/mediactrl.h +++ b/interface/wx/mediactrl.h @@ -250,11 +250,11 @@ public: @param name Window name. */ - wxMediaCtrl(wxWindow* parent, wxWindowID id, const wxString& fileName = wxT(""), + wxMediaCtrl(wxWindow* parent, wxWindowID id, const wxString& fileName = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, const wxString& szBackend = wxT(""), + long style = 0, const wxString& szBackend = wxEmptyString, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxPanelNameStr); + const wxString& name = "mediaCtrl"); /** Creates this control. @@ -284,11 +284,11 @@ public: @param name Window name. */ - bool Create(wxWindow* parent, wxWindowID id, const wxString& fileName = wxT(""), + bool Create(wxWindow* parent, wxWindowID id, const wxString& fileName = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, const wxString& szBackend = wxT(""), + long style = 0, const wxString& szBackend = wxEmptyString, const wxValidator& validator = wxDefaultValidator, - const wxString& name = wxPanelNameStr); + const wxString& name = "mediaCtrl"); /** Obtains the best size relative to the original/natural size of the diff --git a/interface/wx/menu.h b/interface/wx/menu.h index 3e17236f68..a90a802a0a 100644 --- a/interface/wx/menu.h +++ b/interface/wx/menu.h @@ -102,7 +102,7 @@ public: @remarks Only use this when the menu bar has been associated with a frame; otherwise, use the wxMenu equivalent call. */ - void Enable(int id, const bool enable); + void Enable(int id, bool enable); /** Enables or disables a whole menu. @@ -451,7 +451,7 @@ public: @param style If set to wxMENU_TEAROFF, the menu will be detachable (wxGTK only). */ - wxMenu(const wxString& title = "", long style = 0); + wxMenu(const wxString& title, long style = 0); /** Destructor, destroying the menu. @@ -624,7 +624,7 @@ public: @see FindItem(), Destroy(), Remove() */ - void Delete(int id); + bool Delete(int id); /** Deletes the menu item from the menu. If the item is a submenu, it will @@ -635,7 +635,7 @@ public: @see FindItem(), Destroy(), Remove() */ - void Delete(wxMenuItem* item); + bool Delete(wxMenuItem* item); /** Deletes the menu item from the menu. If the item is a submenu, it will @@ -647,7 +647,7 @@ public: @see FindItem(), Deletes(), Remove() */ - void Destroy(int id); + bool Destroy(int id); /** Deletes the menu item from the menu. If the item is a submenu, it will @@ -659,7 +659,7 @@ public: @see FindItem(), Deletes(), Remove() */ - void Destroy(wxMenuItem* item); + bool Destroy(wxMenuItem* item); /** Enables or disables (greys out) a menu item. @@ -698,7 +698,7 @@ public: @return Menu item object or NULL if none is found. */ - const wxMenuItem* FindItem(int id, wxMenu** menu = NULL) const; + wxMenuItem* FindItem(int id, wxMenu** menu = NULL) const; /** Returns the wxMenuItem given a position in the menu. @@ -748,13 +748,16 @@ public: */ size_t GetMenuItemCount() const; + //@{ /** Returns the list of items in the menu. wxMenuItemList is a pseudo-template list class containing wxMenuItem pointers, see wxList. */ - wxMenuItemList GetMenuItems() const; + wxMenuItemList& GetMenuItems() const; + const wxMenuItemList& GetMenuItems() const; + //@} /** Returns the title of the menu. @@ -785,8 +788,8 @@ public: @see Append(), Prepend() */ wxMenuItem* Insert(size_t pos, int id, - const wxString& item = "", - const wxString& helpString = "", + const wxString& item = wxEmptyString, + const wxString& helpString = wxEmptyString, wxItemKind kind = wxITEM_NORMAL); /** @@ -850,8 +853,8 @@ public: @see Append(), Insert() */ - wxMenuItem* Prepend(int id, const wxString& item = "", - const wxString& helpString = "", + wxMenuItem* Prepend(int id, const wxString& item = wxEmptyString, + const wxString& helpString = wxEmptyString, wxItemKind kind = wxITEM_NORMAL); /** diff --git a/interface/wx/menuitem.h b/interface/wx/menuitem.h index 93f66572ee..e74e7bde17 100644 --- a/interface/wx/menuitem.h +++ b/interface/wx/menuitem.h @@ -80,8 +80,8 @@ public: If non-@NULL, indicates that the menu item is a submenu. */ wxMenuItem(wxMenu* parentMenu = NULL, int id = wxID_SEPARATOR, - const wxString& text = "", - const wxString& helpString = "", + const wxString& text = wxEmptyString, + const wxString& helpString = wxEmptyString, wxItemKind kind = wxITEM_NORMAL, wxMenu* subMenu = NULL); diff --git a/interface/wx/msgdlg.h b/interface/wx/msgdlg.h index 88243d4bec..781ec79cf9 100644 --- a/interface/wx/msgdlg.h +++ b/interface/wx/msgdlg.h @@ -82,7 +82,7 @@ public: Dialog position (ignored under MSW). */ wxMessageDialog(wxWindow* parent, const wxString& message, - const wxString& caption = "Message box", + const wxString& caption = wxMessageBoxCaptionStr, long style = wxOK | wxCENTRE, const wxPoint& pos = wxDefaultPosition); diff --git a/interface/wx/mstream.h b/interface/wx/mstream.h index c6c2eacd6c..eec704124a 100644 --- a/interface/wx/mstream.h +++ b/interface/wx/mstream.h @@ -66,7 +66,7 @@ public: buffer data of length len. The stream does not take ownership of the buffer, i.e. the buffer will not be deleted in its destructor. */ - wxMemoryInputStream(const char* data, size_t len); + wxMemoryInputStream(const void* data, size_t len); /** Creates a new read-only memory stream, initializing it with the data from diff --git a/interface/wx/panel.h b/interface/wx/panel.h index cd76e4bee9..59acc6534a 100644 --- a/interface/wx/panel.h +++ b/interface/wx/panel.h @@ -64,7 +64,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, - const wxString& name = "panel"); + const wxString& name = wxPanelNameStr); /** Destructor. Deletes any child windows before deleting the physical window. diff --git a/interface/wx/pen.h b/interface/wx/pen.h index 38a652feed..4c5fb7eb7b 100644 --- a/interface/wx/pen.h +++ b/interface/wx/pen.h @@ -179,6 +179,8 @@ public: @param stipple A stipple bitmap. + @onlyfor{wxmsw,wxmac} + @see SetWidth(), SetStipple() */ wxPen(const wxBitmap& stipple, int width); diff --git a/interface/wx/socket.h b/interface/wx/socket.h index 3a7adebb30..0c7b0eceae 100644 --- a/interface/wx/socket.h +++ b/interface/wx/socket.h @@ -70,12 +70,12 @@ public: @return @true on success, @false if something goes wrong (invalid @a service). */ - bool Service(unsigned short service); + bool Service(unsigned short service) = 0; /** Returns the current service. */ - unsigned short Service(); + unsigned short Service() const = 0; }; @@ -262,7 +262,7 @@ public: /** Returns the current service. */ - virtual unsigned short Service(); + virtual unsigned short Service() const; }; diff --git a/interface/wx/strconv.h b/interface/wx/strconv.h index 9a40c5cdec..22e9de2850 100644 --- a/interface/wx/strconv.h +++ b/interface/wx/strconv.h @@ -174,8 +174,8 @@ public: compatibility concerns). */ const wxWCharBuffer cMB2WC(const char* in, - size_t inLen = wxNO_LEN, - size_t *outLen = NULL) const; + size_t inLen, + size_t *outLen) const; //@{ /** @@ -201,8 +201,8 @@ public: FromWChar(), please see the description of cMB2WC() for more details. */ const wxCharBuffer cWC2MB(const wchar_t* in, - size_t inLen = wxNO_LEN, - size_t *outLen = NULL) const; + size_t inLen, + size_t *outLen) const; //@{ /** diff --git a/interface/wx/stream.h b/interface/wx/stream.h index 88d2604103..6de6fa871c 100644 --- a/interface/wx/stream.h +++ b/interface/wx/stream.h @@ -463,14 +463,14 @@ public: This function returns a reference on the current object, so the user can test any states of the stream right away. */ - wxOutputStream Write(const void* buffer, size_t size); + wxOutputStream& Write(const void* buffer, size_t size); /** Reads data from the specified input stream and stores them in the current stream. The data is read until an error is raised by one of the two streams. */ - wxOutputStream Write(wxInputStream& stream_in); + wxOutputStream& Write(wxInputStream& stream_in); }; @@ -817,7 +817,7 @@ public: @return This function returns a reference on the current object, so the user can test any states of the stream right away. */ - wxInputStream Read(void* buffer, size_t size); + virtual wxInputStream& Read(void* buffer, size_t size); /** Reads data from the input queue and stores it in the specified output stream. @@ -861,13 +861,13 @@ public: @return Returns the amount of bytes saved in the Write-Back buffer. */ - size_t Ungetch(const char* buffer, size_t size); + size_t Ungetch(const void* buffer, size_t size); /** This function acts like the previous one except that it takes only one character: it is sometimes shorter to use than the generic function. */ - Return value bool Ungetch(char c); + bool Ungetch(char c); }; -- 2.45.2