X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4e4152e4a8d433ba26885ba7f9313b7177daa058..b25757395caa6b2b05c982709b1767ed61004887:/utils/helpview/src/helpview.h?ds=inline diff --git a/utils/helpview/src/helpview.h b/utils/helpview/src/helpview.h index 72651faf1d..d4fc4cde2e 100644 --- a/utils/helpview/src/helpview.h +++ b/utils/helpview/src/helpview.h @@ -12,29 +12,92 @@ #ifndef _WX_HELPVIEW_H_ #define _WX_HELPVIEW_H_ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "help.cpp" +#endif + +#define hvVERSION 1.03 + +// If 1, start a server to allow this to be used +// as an external help viewer. +#if defined(__WXMAC__) && !defined(__UNIX__) +#define hvUSE_IPC 0 +#else +#define hvUSE_IPC 1 +#endif + +#if hvUSE_IPC +#include + +class hvConnection; +class hvServer; +#endif + +/*! + * The helpview application class. + */ -// Define a new application type, each program should derive a class from wxApp class hvApp : public wxApp { - public: - // override base class virtuals - // ---------------------------- +public: + hvApp(); + + /// Initialise the application. + virtual bool OnInit(); + + /// Clean up the application's data. + virtual int OnExit(); - // this one is called on application startup and is a good place for the app - // initialization (doing it here and not in the ctor allows to have an error - // return: if OnInit() returns false, the application terminates) +#ifdef __WXMAC__ + /// Respond to Apple Event for opening a document + virtual void MacOpenFile(const wxString& filename); +#endif + + /// Prompt the user for a book to open + bool OpenBook(wxHtmlHelpController* controller); - virtual bool OnInit(); - virtual int OnExit(); + /// Returns the help controller. + wxHtmlHelpController* GetHelpController() { return m_helpController; } - // Prompt the user for a book to open - bool OpenBook(wxHtmlHelpController* controller); +#if hvUSE_IPC + /// Returns the list of connections. + wxList& GetConnections() { return m_connections; } +#endif - private: - wxHtmlHelpController *help; +private: + wxHtmlHelpController* m_helpController; + +#if hvUSE_IPC + wxList m_connections; + hvServer* m_server; +#endif + +}; + +#if hvUSE_IPC +class hvConnection : public wxConnection +{ +public: + hvConnection(); + ~hvConnection(); + + bool OnExecute(const wxString& topic, wxChar*data, int size, wxIPCFormat format); + wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format); + bool OnPoke(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format); + bool OnStartAdvise(const wxString& topic, const wxString& item); + +private: }; +class hvServer: public wxServer +{ +public: + wxConnectionBase *OnAcceptConnection(const wxString& topic); +}; + + +#endif + #endif // _WX_HELPVIEW_H_