X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7dc3cc31af71522b8fc55b7f97bcba7f5ef9eac5..f5ba273ecd799f652736ce2bc830283787302a56:/src/common/mimecmn.cpp diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index 9dedb8ec86..25a0eedb28 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -15,6 +15,7 @@ // for compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/module.h" #ifdef __BORLANDC__ #pragma hdrstop @@ -68,6 +69,8 @@ class WXDLLEXPORT wxIcon; #include "wx/msw/mimetype.h" #elif defined (__WXMAC__) #include "wx/mac/mimetype.h" +#elif defined (__WXPM__) +#include "wx/os2/mimetype.h" #else #include "wx/unix/mimetype.h" #endif @@ -215,6 +218,11 @@ bool wxFileType::GetMimeType(wxString *mimeType) const return m_impl->GetMimeType(mimeType); } +bool wxFileType::GetMimeTypes(wxArrayString& mimeTypes) const +{ + return m_impl->GetMimeTypes(mimeTypes); +} + bool wxFileType::GetIcon(wxIcon *icon) const { return m_impl->GetIcon(icon); @@ -334,6 +342,29 @@ static wxMimeTypesManager gs_mimeTypesManager; wxMimeTypesManager * wxTheMimeTypesManager = &gs_mimeTypesManager; + + + +class wxMimeTypeCmnModule: public wxModule +{ +DECLARE_DYNAMIC_CLASS(wxMimeTypeCmnModule) +public: + wxMimeTypeCmnModule() : wxModule() {} + bool OnInit() { return TRUE; } + void OnExit() + { // this avoids false memory leak allerts: + if (gs_mimeTypesManager.m_impl != NULL) + { + delete gs_mimeTypesManager.m_impl; + gs_mimeTypesManager.m_impl = NULL; + } + } +}; + +IMPLEMENT_DYNAMIC_CLASS(wxMimeTypeCmnModule, wxModule) + + + #endif // wxUSE_FILE && wxUSE_TEXTFILE