Add wxVersionInfo and functions returning it for 3rd party libraries.

Add simple wxVersionInfo class holding the version information.

Also add GetLibraryVersionInfo() static method to wx{JPEG,PNG,TIFF}Handler,
wxStyledTextCtrl and wxXmlDocument classes and wxGetZlibVersionInfo() and
wxGetLibraryVersionInfo() global functions using it.

Closes #12690.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-11-25 00:53:44 +00:00
parent 5b70f2de3f
commit ccec90930c
33 changed files with 411 additions and 9 deletions

View File

@@ -254,6 +254,20 @@ public:
Handler name.
*/
void SetName(const wxString& name);
/**
Retrieve the version information about the image library used by this
handler.
This method is not present in wxImageHandler class itself but is
present in a few of the classes deriving from it, currently
wxJPEGHandler, wxPNGHandler and wxTIFFHandler. It returns the
information about the version of the image library being used for the
corresponding handler implementation.
@since 2.9.2
*/
static wxVersionInfo GetLibraryVersionInfo();
};

View File

@@ -3153,5 +3153,12 @@ public:
*/
void SwapMainAnchorCaret();
/**
Get Scintilla library version information.
@since 2.9.2
@see wxVersionInfo
*/
static wxVersionInfo GetLibraryVersionInfo();
};

View File

@@ -145,10 +145,19 @@ void wxBell();
doesn't otherwise handle this event.
@since 2.9.0
@see wxGetLibraryVersionInfo()
@header{wx/utils.h}
*/
void wxInfoMessageBox(wxWindow parent = NULL);
void wxInfoMessageBox(wxWindow* parent);
/**
Get wxWidgets version information.
@since 2.9.2
@see wxVersionInfo
@header{wx/utils.h}
*/
wxVersionInfo wxGetLibraryVersionInfo();
//@}

130
interface/wx/versioninfo.h Normal file
View File

@@ -0,0 +1,130 @@
/////////////////////////////////////////////////////////////////////////////
// Name: versioninfo.h
// Purpose: interface of wxVersionInfo
// Author: Troels K
// RCS-ID: $Id: versioninfo.h
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
@class wxVersionInfo
wxVersionInfo contains version information.
This class is used by wxWidgets to provide version information about the
libraries it uses and itself, but you can also apply it in user space, to
provide version information about your own libraries, or other libraries
that you use.
@library{wxbase}
@category{data}
@header{wx/versioninfo.h}
@since 2.9.2
*/
class wxVersionInfo
{
public:
/**
Constructor.
The version information objects need to be initialized with this
constructor and are immutable once they are created.
@param name The name of the library or other entity that this object
pertains to.
@param major The major version component.
@param minor The minor version component.
@param micro The micro version component, 0 by default.
@param description Free form description of this version, none by
default.
@param copyright Copyright string, none by default.
*/
wxVersionInfo(const wxString& name,
int major,
int minor,
int micro = 0,
const wxString& description = wxString(),
const wxString& copyright = wxString());
/**
Get the name of the object (library).
@return Name string.
*/
const wxString& GetName() const;
/**
Get the major version number.
@return Major version number.
*/
int GetMajor() const;
/**
Get the minor version number.
@return Minor version number.
*/
int GetMinor() const;
/**
Get the micro version, or release number.
@return Micro version, or release number.
*/
int GetMicro() const;
/**
Get the string representation of this version object.
This function returns the description if it is non-empty or
GetVersionString() if there is no description.
@see GetDescription(), GetVersionString()
*/
wxString ToString() const;
/**
Get the string representation.
The micro component of the version is ignored/not used if it is 0.
@return The version string in the form "name major.minor[.micro]".
*/
wxString GetVersionString() const
/**
Return @true if a description string has been specified.
@see GetDescription()
*/
bool HasDescription() const;
/**
Get the description string.
The description may be empty.
@return The description string, free-form.
*/
const wxString& GetDescription();
/**
Returns @true if a copyright string has been specified.
@see GetCopyright()
*/
bool HasCopyright() const;
/**
Get the copyright string.
The copyright string may be empty.
@return The copyright string.
*/
const wxString& GetCopyright() const;
};
//@}

View File

@@ -645,5 +645,13 @@ public:
Deep copies the given document.
*/
wxXmlDocument& operator=(const wxXmlDocument& doc);
/**
Get expat library version information.
@since 2.9.2
@see wxVersionInfo
*/
static wxVersionInfo GetLibraryVersionInfo();
};