X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8d0f1c1cbf825faf281c305931a1ade38589212c..741cca6b380ccacd162d1c662b6063021c8ee3ee:/utils/helpview/src/helpview.cpp diff --git a/utils/helpview/src/helpview.cpp b/utils/helpview/src/helpview.cpp index e09236ebe0..bbb44a061d 100644 --- a/utils/helpview/src/helpview.cpp +++ b/utils/helpview/src/helpview.cpp @@ -10,10 +10,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "help.cpp" -#endif - // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" @@ -48,7 +44,7 @@ IMPLEMENT_APP(hvApp) hvApp::hvApp() { -#if hvUSE_IPC +#if wxUSE_IPC m_server = NULL; #endif } @@ -59,23 +55,24 @@ bool hvApp::OnInit() delete wxLog::SetActiveTarget(new wxLogStderr); // So dialog boxes aren't used #endif - wxArtProvider::PushProvider(new AlternateArtProvider); + wxArtProvider::Push(new AlternateArtProvider); -#ifdef __WXMAC__ +#if defined( __WXOSX_MAC__ ) && wxOSX_USE_CARBON wxApp::s_macAboutMenuItemId = wxID_ABOUT; - wxFileName::MacRegisterDefaultTypeAndCreator( "htb" , 'HTBD' , 'HTBA' ) ; + wxFileName::MacRegisterDefaultTypeAndCreator( wxT("htb") , 'HTBD' , 'HTBA' ) ; #endif int istyle = wxHF_DEFAULT_STYLE; - wxString service, windowName, book[10], titleFormat, argStr; + wxString service, windowName, titleFormat, argStr; + wxString book[10]; int bookCount = 0; int i; bool hasService = false; bool hasWindowName = false; bool createServer = false; -#if hvUSE_IPC +#if wxUSE_IPC m_server = NULL; #endif @@ -155,10 +152,10 @@ bool hvApp::OnInit() wxEmptyString, wxEmptyString, wxT("Help books (*.htb)|*.htb|Help books (*.zip)|*.zip|HTML Help Project (*.hhp)|*.hhp"), - wxOPEN | wxFILE_MUST_EXIST, + wxFD_OPEN | wxFD_FILE_MUST_EXIST, NULL); - if (!s.IsEmpty()) + if (!s.empty()) { book[0] = s; bookCount = 1; @@ -166,7 +163,7 @@ bool hvApp::OnInit() } #endif -#if hvUSE_IPC +#if wxUSE_IPC if ( createServer ) { @@ -185,7 +182,7 @@ bool hvApp::OnInit() wxUnusedVar(createServer); } -#endif // hvUSE_IPC +#endif // wxUSE_IPC //now add help wxInitAllImageHandlers(); @@ -228,7 +225,7 @@ bool hvApp::OnInit() int hvApp::OnExit() { -#if hvUSE_IPC +#if wxUSE_IPC wxObjectList::compatibility_iterator node = m_connections.GetFirst(); while (node) { @@ -262,7 +259,7 @@ bool hvApp::OpenBook(wxHtmlHelpController* controller) _( "Help books (*.htb)|*.htb|Help books (*.zip)|*.zip|\ HTML Help Project (*.hhp)|*.hhp"), - wxOPEN | wxFILE_MUST_EXIST, + wxFD_OPEN | wxFD_FILE_MUST_EXIST, NULL); if ( !s.empty() ) @@ -304,22 +301,7 @@ void hvApp::MacOpenFile(const wxString& filename) #define ART(artId, xpmRc) \ if ( id == artId ) return wxBitmap(xpmRc##_xpm); -// Compatibility hack to use wxApp::GetStdIcon of overriden by the user -#if WXWIN_COMPATIBILITY_2_2 -#define GET_STD_ICON_FROM_APP(iconId) \ - if ( client == wxART_MESSAGE_BOX ) \ -{ \ - wxIcon icon = wxTheApp->GetStdIcon(iconId); \ - if ( icon.Ok() ) \ -{ \ - wxBitmap bmp; \ - bmp.CopyFromIcon(icon); \ - return bmp; \ -} \ -} -#else #define GET_STD_ICON_FROM_APP(iconId) -#endif // There are two ways of getting the standard icon: either via XPMs or via // wxIcon ctor. This depends on the platform: @@ -400,7 +382,7 @@ wxBitmap AlternateArtProvider::CreateBitmap(const wxArtID& id, return wxNullBitmap; } -#if hvUSE_IPC +#if wxUSE_IPC wxConnectionBase *hvServer::OnAcceptConnection(const wxString& topic) { @@ -425,14 +407,12 @@ hvConnection::~hvConnection() wxGetApp().GetConnections().DeleteObject(this); } -bool hvConnection::OnExecute(const wxString& WXUNUSED(topic), - wxChar *data, - int WXUNUSED(size), - wxIPCFormat WXUNUSED(format)) +bool hvConnection::OnExec(const wxString& WXUNUSED(topic), + const wxString& data) { // wxLogStatus("Execute command: %s", data); - if ( !wxStrncmp( data, wxT("--intstring"), 11 ) ) + if ( data == "--intstring" ) { long i; wxString argStr = data; @@ -456,10 +436,12 @@ bool hvConnection::OnExecute(const wxString& WXUNUSED(topic), bool hvConnection::OnPoke(const wxString& WXUNUSED(topic), const wxString& item, - wxChar *data, - int WXUNUSED(size), - wxIPCFormat WXUNUSED(format)) + const void *buf, + size_t size, + wxIPCFormat format) { + const wxString data = GetTextFromData(buf, size, format); + // wxLogStatus("Poke command: %s = %s", item.c_str(), data); //topic is not tested @@ -506,18 +488,4 @@ bool hvConnection::OnPoke(const wxString& WXUNUSED(topic), return true; } -wxChar *hvConnection::OnRequest(const wxString& WXUNUSED(topic), - const wxString& WXUNUSED(item), - int * WXUNUSED(size), - wxIPCFormat WXUNUSED(format)) -{ - return NULL; -} - -bool hvConnection::OnStartAdvise(const wxString& WXUNUSED(topic), - const wxString& WXUNUSED(item)) -{ - return true; -} - -#endif // #if hvUSE_IPC +#endif // #if wxUSE_IPC