Helpview mods
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17895 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
#pragma interface "help.cpp"
|
#pragma interface "help.cpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define hvVERSION 1.01
|
#define hvVERSION 1.02
|
||||||
|
|
||||||
// If 1, start a server to allow this to be used
|
// If 1, start a server to allow this to be used
|
||||||
// as an external help viewer.
|
// as an external help viewer.
|
||||||
|
35
utils/helpview/src/readme.txt
Normal file
35
utils/helpview/src/readme.txt
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
The HTML help client-server pair sample consists of three parts:
|
||||||
|
|
||||||
|
1) The Client, derived from Client from the IPC samples and now containing wxRemoteHtmlHelpController
|
||||||
|
2) The Server, derived from helpview - the app is called helpview
|
||||||
|
3) The sample help files, specifically called by the Client, which are from the HTML/Help sample
|
||||||
|
|
||||||
|
Normally, the Client is started first, and it will in turn start up the Server (helpview) the first time help is requested with Display. If the Server is to be started first, the default service name ("generic_helpservice" for MSW, "/tmp/generic_helpservice" for Unix or "4242" otherwise) should be used for the connection in the client.
|
||||||
|
|
||||||
|
It is assumed that there will be one copy of the server for each app which uses help. Depending on the OS, it may be possible to use different instances of the same server, or even to use one instance of the server (probably not a good idea) to service more than one app requesting help.
|
||||||
|
|
||||||
|
At the moment, if a connection has been established and if the client is killed, the server is also killed. If the client is started up again, it will use the same connection.
|
||||||
|
|
||||||
|
If USE_REMOTE in client.cpp is undefined, the "client" app will use wxHtmlHelpController instead of wxRemoteHtmlHelpController, that is the remote server will not be used. In MSW, this results in freezing of the help window when called from a modal dialog. In GTK, the window is not frozen, but it must be closed before you can return to the app itself.
|
||||||
|
|
||||||
|
------------------------------------------------
|
||||||
|
wxRemoteHtmlHelpController Class
|
||||||
|
|
||||||
|
This class can be added to an application (the client) to provide wxWindows HTML help. It will start up the remote help controller (helpview) the first time the Display member function is called, passing the server the connection name or port number, the name of the help window and the help book (.hhp, .htb, .zip). This class will only work with a particular server app, helpview.
|
||||||
|
|
||||||
|
Most of the functions of wxHtmlHelpController are available - the relevant arguments are just passed to wxHtmlHelpController in the server. The functions involving wxConfig are not implemented - the config parameters (font, windows size and position) are kept in the server.
|
||||||
|
|
||||||
|
Use the members SetServer and SetService to pass the name of the server app and service name or port. This must be done before the first call to the Display member function, or defaults will be used. The default server app is "helpview" and default service depends on the platform: for MSW it is "appname_helpservice" (a service name string); for UNIX platforms it is "/tmp/appname_helpservice" (a file name) and otherwise it is "4242" (a TCP/IP port number), where "appname" is the name of the application without extension.
|
||||||
|
|
||||||
|
A wxRemoteHtmlHelpController can be created in wxApp::OnInit, or some high level window like a mainframe. It should be deleted explicitly, for example in wxApp::OnExit, or else the various connection objects are deleted in the wrong order. Using a wxRemoteHtmlHelpController member of wxApp does not work because of problems on exit.
|
||||||
|
|
||||||
|
This has been tested on wxMSW and wxGTK. It does not work on wxMac because the connection classes, as well as wxExecute, are not fully supported.
|
||||||
|
|
||||||
|
----------------------------------------------
|
||||||
|
|
||||||
|
Changes to helpview sample
|
||||||
|
|
||||||
|
The constructor now tests the command-line arguments, looking first for help books (containing .hhp, .htb, .zip). Then it looks for "--server". If arguments not falling in these categories are present, they are taken to be 1) the service name or 2) the window name (see wxRemoteHtmlHelpController for the meaning of service name).
|
||||||
|
|
||||||
|
The client passes most functions of wxHtmlHelpController, with argument, to helpview using wxConnection::Poke. The string for the Display function is passed with wxConnection::Execute.
|
||||||
|
|
409
utils/helpview/src/remhelp.cpp
Normal file
409
utils/helpview/src/remhelp.cpp
Normal file
@@ -0,0 +1,409 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: remhelp.cpp
|
||||||
|
// Purpose: Remote help controller class
|
||||||
|
// Author: Eric Dowty
|
||||||
|
// Modified by:
|
||||||
|
// Created: 2002-11-18
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
||||||
|
#pragma implementation remhelp.h
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// For compilers that support precompilation, includes "wx.h".
|
||||||
|
#include "wx/wxprec.h"
|
||||||
|
|
||||||
|
#ifdef __BORLANDC__
|
||||||
|
#pragma hdrstop
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef WX_PRECOMP
|
||||||
|
#include "wx/wx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "wx/process.h"
|
||||||
|
#include "wx/confbase.h"
|
||||||
|
|
||||||
|
// Settings common to both executables: determines whether
|
||||||
|
// we're using TCP/IP or real DDE.
|
||||||
|
|
||||||
|
//#include "ddesetup.h"
|
||||||
|
//#define wxUSE_DDE_FOR_IPC 0
|
||||||
|
|
||||||
|
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||||
|
#include "mondrian.xpm"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "remhelp.h"
|
||||||
|
#include "client.h"
|
||||||
|
|
||||||
|
#if !defined(USE_REMOTE)
|
||||||
|
#include <wx/html/helpctrl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//////////////////
|
||||||
|
//////////////////
|
||||||
|
// helper classes
|
||||||
|
|
||||||
|
rhhcClient::rhhcClient( bool *isconn_a )
|
||||||
|
{
|
||||||
|
isconn_2 = isconn_a;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxConnectionBase *rhhcClient::OnMakeConnection()
|
||||||
|
{
|
||||||
|
return new rhhcConnection( isconn_2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
rhhcConnection::rhhcConnection( bool *isconn_a )
|
||||||
|
: wxConnection()
|
||||||
|
{
|
||||||
|
isconn_3 = isconn_a;
|
||||||
|
*isconn_3 = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
rhhcConnection::~rhhcConnection()
|
||||||
|
{
|
||||||
|
*isconn_3 = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool rhhcConnection::OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool rhhcConnection::OnDisconnect()
|
||||||
|
{
|
||||||
|
*isconn_3 = FALSE;
|
||||||
|
|
||||||
|
return wxConnection::OnDisconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////
|
||||||
|
/////////////////////////////////////////
|
||||||
|
|
||||||
|
// wxRemoteHtmlHelpController class
|
||||||
|
|
||||||
|
IMPLEMENT_CLASS(wxRemoteHtmlHelpController, wxHelpControllerBase)
|
||||||
|
|
||||||
|
wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style )
|
||||||
|
{
|
||||||
|
m_style = style;
|
||||||
|
m_connection = NULL;
|
||||||
|
m_client = NULL;
|
||||||
|
m_pid = 0;
|
||||||
|
isconn_1 = FALSE;
|
||||||
|
m_process = NULL;
|
||||||
|
|
||||||
|
// defaults
|
||||||
|
//
|
||||||
|
// server app is assumed to be local
|
||||||
|
//
|
||||||
|
// for MSW (DDE classes), a_service is 'service name', apparently an arbitrary string
|
||||||
|
// for Unix, should be a valid file name (for a nonexistent file)
|
||||||
|
// for nonMSW, nonUnix, must be port number, for example "4242" (TCP/IP based classes)
|
||||||
|
// should be unique to the client app
|
||||||
|
|
||||||
|
wxString thename = wxGetApp().GetAppName();
|
||||||
|
#if defined(__WXMSW__)
|
||||||
|
m_appname = wxT("helpview.exe");
|
||||||
|
m_service = thename + wxString(wxT("_helpservice"));
|
||||||
|
#elif defined(__UNIX__)
|
||||||
|
m_appname = wxT("./helpview");
|
||||||
|
m_service = wxT("/tmp/") + thename + wxString(wxT("_helpservice"));
|
||||||
|
#else
|
||||||
|
m_appname = wxT("./helpview");
|
||||||
|
m_service = wxT("4242");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_book = thename + wxT(".hhp"); // or .htb or .zip
|
||||||
|
m_windowname = thename + wxT(" Help: %s");
|
||||||
|
//underscores for spaces
|
||||||
|
m_windowname.Replace( wxT(" "), wxT("_") );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRemoteHtmlHelpController::SetService(wxString& a_service)
|
||||||
|
{
|
||||||
|
m_service = a_service;
|
||||||
|
}
|
||||||
|
void wxRemoteHtmlHelpController::SetServer(wxString& a_appname)
|
||||||
|
{
|
||||||
|
m_appname = a_appname;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRemoteHtmlHelpController::OnQuit()
|
||||||
|
{
|
||||||
|
//kill the Server here?
|
||||||
|
//this function is not called ?
|
||||||
|
}
|
||||||
|
|
||||||
|
wxRemoteHtmlHelpController::~wxRemoteHtmlHelpController()
|
||||||
|
{
|
||||||
|
if ( isconn_1 )
|
||||||
|
{
|
||||||
|
//if (!m_connection->Poke( wxT("--YouAreDead"), wxT("") ) )
|
||||||
|
// wxLogError(wxT("wxRemoteHtmlHelpController - YouAreDead Failed"));
|
||||||
|
|
||||||
|
// Kill the server. This could be an option.
|
||||||
|
Quit();
|
||||||
|
|
||||||
|
m_connection->Disconnect();
|
||||||
|
delete m_connection;
|
||||||
|
|
||||||
|
delete m_process;
|
||||||
|
m_process = NULL;
|
||||||
|
}
|
||||||
|
if( m_client )
|
||||||
|
delete m_client; //should be automatic?
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxRemoteHtmlHelpController::DoConnection()
|
||||||
|
{
|
||||||
|
wxString cmd, blank;
|
||||||
|
int nsleep;
|
||||||
|
|
||||||
|
blank = wxT(" ");
|
||||||
|
|
||||||
|
// ignored under DDE, host name in TCP/IP based classes
|
||||||
|
wxString hostName = wxT("localhost");
|
||||||
|
|
||||||
|
// Create a new client
|
||||||
|
if( !m_client ) m_client = new rhhcClient(&isconn_1);
|
||||||
|
|
||||||
|
nsleep = 0;
|
||||||
|
|
||||||
|
// suppress the log messages from MakeConnection()
|
||||||
|
{
|
||||||
|
wxLogNull nolog;
|
||||||
|
|
||||||
|
//first try to connect assuming server is running
|
||||||
|
if( !isconn_1 )
|
||||||
|
m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") );
|
||||||
|
|
||||||
|
//if not, start server
|
||||||
|
if( !isconn_1 ) {
|
||||||
|
|
||||||
|
wxString stylestr;
|
||||||
|
stylestr.Printf( wxT("--Style%d"), m_style );
|
||||||
|
|
||||||
|
cmd = m_appname + blank + m_service + blank + m_windowname + blank + m_book + blank + stylestr;
|
||||||
|
|
||||||
|
m_process = new wxProcess(NULL);
|
||||||
|
m_pid = wxExecute( cmd, FALSE, m_process );
|
||||||
|
// leaks - wxExecute itself (if not deleted) and in wxExecute at
|
||||||
|
// wxExecuteData *data = new wxExecuteData;
|
||||||
|
if( m_pid <= 0 ) {
|
||||||
|
wxLogError( wxT("wxRemoteHtmlHelpController - Failed to start Help server") );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while ( !isconn_1 )
|
||||||
|
{
|
||||||
|
//try every second for a while, then leave it to user
|
||||||
|
wxSleep(1);
|
||||||
|
if( nsleep > 4 ) {
|
||||||
|
if ( wxMessageBox( wxT("Failed to make connection to Help server.\nRetry?") ,
|
||||||
|
wxT("wxRemoteHtmlHelpController Error"),
|
||||||
|
wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES )
|
||||||
|
{
|
||||||
|
// no server
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
nsleep++;
|
||||||
|
|
||||||
|
m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_connection->StartAdvise(wxT("Item"))) {
|
||||||
|
wxLogError(wxT("wxRemoteHtmlHelpController - StartAdvise failed") );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxRemoteHtmlHelpController::LoadFile(const wxString& WXUNUSED(file))
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
bool wxRemoteHtmlHelpController::DisplaySection(int sectionNo)
|
||||||
|
{
|
||||||
|
Display(sectionNo);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
bool wxRemoteHtmlHelpController::DisplayBlock(long blockNo)
|
||||||
|
{
|
||||||
|
return DisplaySection((int)blockNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxRemoteHtmlHelpController::Quit()
|
||||||
|
{
|
||||||
|
//this code from exec sample - branches left in for testing
|
||||||
|
// sig = 3, 6, 9 or 12 all kill server with no apparent problem
|
||||||
|
// but give error message on MSW - timout?
|
||||||
|
int sig = 15; //3 = quit; 6 = abort; 9 = kill; 15 = terminate
|
||||||
|
|
||||||
|
/*
|
||||||
|
switch ( sig )
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
wxFAIL_MSG( _T("unexpected return value") );
|
||||||
|
// fall through
|
||||||
|
|
||||||
|
case -1:
|
||||||
|
// cancelled
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
case wxSIGNONE:
|
||||||
|
case wxSIGHUP:
|
||||||
|
case wxSIGINT:
|
||||||
|
case wxSIGQUIT:
|
||||||
|
case wxSIGILL:
|
||||||
|
case wxSIGTRAP:
|
||||||
|
case wxSIGABRT:
|
||||||
|
case wxSIGEMT:
|
||||||
|
case wxSIGFPE:
|
||||||
|
case wxSIGKILL:
|
||||||
|
case wxSIGBUS:
|
||||||
|
case wxSIGSEGV:
|
||||||
|
case wxSIGSYS:
|
||||||
|
case wxSIGPIPE:
|
||||||
|
case wxSIGALRM:
|
||||||
|
case wxSIGTERM:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ( sig == 0 )
|
||||||
|
{
|
||||||
|
if ( wxProcess::Exists(m_pid) )
|
||||||
|
wxLogStatus(_T("Process %ld is running."), m_pid);
|
||||||
|
else
|
||||||
|
wxLogStatus(_T("No process with pid = %ld."), m_pid);
|
||||||
|
}
|
||||||
|
else // not SIGNONE
|
||||||
|
{
|
||||||
|
wxKillError rc = wxProcess::Kill(m_pid, (wxSignal)sig);
|
||||||
|
if ( rc == wxKILL_OK )
|
||||||
|
{
|
||||||
|
wxLogStatus(_T("Process %ld killed with signal %d."), m_pid, sig);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
static const wxChar *errorText[] =
|
||||||
|
{
|
||||||
|
_T(""), // no error
|
||||||
|
_T("signal not supported"),
|
||||||
|
_T("permission denied"),
|
||||||
|
_T("no such process"),
|
||||||
|
_T("unspecified error"),
|
||||||
|
};
|
||||||
|
|
||||||
|
// sig = 3, 6, 9 or 12 all kill server with no apparent problem
|
||||||
|
// but give error message on MSW - timout?
|
||||||
|
//
|
||||||
|
//wxLogError(_T("Failed to kill process %ld with signal %d: %s"),
|
||||||
|
// m_pid, sig, errorText[rc]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRemoteHtmlHelpController::Display(const wxString& helpfile)
|
||||||
|
{
|
||||||
|
if( !isconn_1 ) {
|
||||||
|
if( !DoConnection() ) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_connection->Execute( helpfile, -1 ) )
|
||||||
|
wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRemoteHtmlHelpController::Display(const int id)
|
||||||
|
{
|
||||||
|
if( !isconn_1 ) {
|
||||||
|
if( !DoConnection() ) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString intstring;
|
||||||
|
intstring.Printf( "--intstring%d", id );
|
||||||
|
|
||||||
|
if (!m_connection->Execute( intstring, -1 ) )
|
||||||
|
wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxRemoteHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg)
|
||||||
|
{
|
||||||
|
//ignore show_wait_msg - there shouldn't be a delay in this step
|
||||||
|
//show_wait_msg = TRUE could be transmitted with ++AddBook
|
||||||
|
m_book = book;
|
||||||
|
|
||||||
|
if( isconn_1 ) {
|
||||||
|
if (!m_connection->Poke( wxT("--AddBook"), (char*)book.c_str() ) )
|
||||||
|
wxLogError(wxT("wxRemoteHtmlHelpController - AddBook Failed"));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool wxRemoteHtmlHelpController::DisplayContents()
|
||||||
|
{
|
||||||
|
if( isconn_1 ) {
|
||||||
|
if (!m_connection->Poke( wxT("--DisplayContents"), wxT("") ) ) {
|
||||||
|
wxLogError(wxT("wxRemoteHtmlHelpController - DisplayContents Failed"));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
void wxRemoteHtmlHelpController::DisplayIndex()
|
||||||
|
{
|
||||||
|
if( isconn_1 ) {
|
||||||
|
if (!m_connection->Poke( wxT("--DisplayIndex"), wxT("") ) )
|
||||||
|
wxLogError(wxT("wxRemoteHtmlHelpController - DisplayIndex Failed"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool wxRemoteHtmlHelpController::KeywordSearch(const wxString& keyword)
|
||||||
|
{
|
||||||
|
if( isconn_1 ) {
|
||||||
|
if (!m_connection->Poke( wxT("--KeywordSearch"), (char*)keyword.c_str() ) ) {
|
||||||
|
wxLogError(wxT("wxRemoteHtmlHelpController - KeywordSearch Failed"));
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRemoteHtmlHelpController::SetTitleFormat(const wxString& format)
|
||||||
|
{
|
||||||
|
m_windowname = format;
|
||||||
|
m_windowname.Replace( wxT(" "), wxT("_") );
|
||||||
|
|
||||||
|
if( isconn_1 ) {
|
||||||
|
if (!m_connection->Poke( wxT("--SetTitleFormat"), (char*)format.c_str() ) )
|
||||||
|
wxLogError(wxT("wxRemoteHtmlHelpController - SetTitleFormat Failed"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRemoteHtmlHelpController::SetTempDir(const wxString& path)
|
||||||
|
{
|
||||||
|
if( isconn_1 ) {
|
||||||
|
if (!m_connection->Poke( wxT("--SetTempDir"), (char*)path.c_str() ) )
|
||||||
|
wxLogError(wxT("wxRemoteHtmlHelpController - SetTempDir Failed"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
97
utils/helpview/src/remhelp.h
Normal file
97
utils/helpview/src/remhelp.h
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Name: remhelp.h
|
||||||
|
// Purpose: Remote help controller class
|
||||||
|
// Author: Eric Dowty
|
||||||
|
// Modified by:
|
||||||
|
// Created: 2002-11-18
|
||||||
|
// RCS-ID: $Id$
|
||||||
|
// Copyright: (c) Julian Smart
|
||||||
|
// Licence: wxWindows licence
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
||||||
|
#pragma interface remhelp.h
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WX_REMHELP_H_
|
||||||
|
#define _WX_REMHELP_H_
|
||||||
|
|
||||||
|
#include <wx/helpbase.h>
|
||||||
|
#include <wx/ipc.h>
|
||||||
|
#include <wx/html/helpctrl.h>
|
||||||
|
|
||||||
|
class WXDLLEXPORT wxConfigBase;
|
||||||
|
|
||||||
|
class rhhcConnection : public wxConnection
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
rhhcConnection(bool *isconn_a);
|
||||||
|
~rhhcConnection();
|
||||||
|
|
||||||
|
bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format);
|
||||||
|
bool OnDisconnect();
|
||||||
|
bool *isconn_3;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class rhhcClient: public wxClient
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
rhhcClient(bool *isconn_a);
|
||||||
|
//~rhhcClient( );
|
||||||
|
wxConnectionBase *OnMakeConnection();
|
||||||
|
bool *isconn_2;
|
||||||
|
};
|
||||||
|
|
||||||
|
class wxRemoteHtmlHelpController : public wxHelpControllerBase
|
||||||
|
{
|
||||||
|
DECLARE_CLASS(wxRemoteHtmlHelpController)
|
||||||
|
public:
|
||||||
|
wxRemoteHtmlHelpController(int style = wxHF_DEFAULT_STYLE);
|
||||||
|
~wxRemoteHtmlHelpController();
|
||||||
|
void OnQuit(void);
|
||||||
|
|
||||||
|
void SetService(wxString& a_service);
|
||||||
|
void SetServer(wxString& a_appname); //could be wxHelpController::SetViewer
|
||||||
|
|
||||||
|
//standard wxHtmlHelpController functions
|
||||||
|
bool AddBook(const wxString& book, bool show_wait_msg = FALSE);
|
||||||
|
void Display(const wxString& x);
|
||||||
|
void Display(const int id);
|
||||||
|
bool DisplayContents();
|
||||||
|
void DisplayIndex();
|
||||||
|
bool KeywordSearch(const wxString& keyword);
|
||||||
|
void SetTempDir(const wxString& path);
|
||||||
|
void SetTitleFormat(const wxString& format);
|
||||||
|
|
||||||
|
//dummies - config is in server
|
||||||
|
void UseConfig(wxConfigBase* config, const wxString& rootpath = wxEmptyString) {};
|
||||||
|
void ReadCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {};
|
||||||
|
void WriteCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {};
|
||||||
|
|
||||||
|
//virtuals from wxHelpControllerBase - not in wxHtmlHelpController
|
||||||
|
//won't compile without these
|
||||||
|
bool LoadFile(const class wxString &); //dummy
|
||||||
|
bool DisplaySection(int);
|
||||||
|
bool DisplayBlock(long);
|
||||||
|
bool Quit(void);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void OnExit(wxCommandEvent& event);
|
||||||
|
bool DoConnection();
|
||||||
|
|
||||||
|
rhhcConnection *m_connection;
|
||||||
|
rhhcClient *m_client;
|
||||||
|
wxProcess *m_process;
|
||||||
|
|
||||||
|
int m_pid;
|
||||||
|
int m_style;
|
||||||
|
wxString m_appname;
|
||||||
|
wxString m_service;
|
||||||
|
wxString m_windowname;
|
||||||
|
wxString m_book;
|
||||||
|
bool isconn_1;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
// _WX_REMHELP_H_
|
Reference in New Issue
Block a user