|
JX Application Framework
|
#include <JMDIServer.h>
Public Member Functions | |
| JMDIServer (const JUtf8Byte *signature) | |
| virtual | ~JMDIServer () |
| void | HandleCmdLineOptions (const int argc, char *argv[]) |
| void | CheckForConnections () |
Static Public Member Functions | |
| static bool | WillBeMDIServer (const JUtf8Byte *signature, const int argc, char *argv[]) |
Static Public Attributes | |
| static const JUtf8Byte * | kQuitOptionName = "--quit" |
Protected Member Functions | |
| bool | IsFirstTime () const |
| virtual bool | CanAcceptMDIRequest ()=0 |
| virtual void | PreprocessArgList (JPtrArray< JString > *argList) |
| virtual void | HandleMDIRequest (const JString &dir, const JPtrArray< JString > &argList)=0 |
Base class for handling Multiple Document Interface (MDI) requests.
It creates a UNIX domain socket so all jnew invocations of the application
will be passed to us (via WillBeMDIServer()).
If the application supports MDI, it must create a derived class and
construct it with a unique application signature.
The derived class must implement the following functions:
CanAcceptMDIReqest
Return false if the application is busy and cannot accept
the request (e.g. due to re-entrancy problems).
HandleMDIRequest
The arguments to this function are the directory from which the
MDI request was made and argv[].
| JMDIServer::JMDIServer | ( | const JUtf8Byte * | signature | ) |
|
virtual |
|
protectedpure virtual |
Implemented in JXMDIServer.
| void JMDIServer::CheckForConnections | ( | ) |
By having an existing ACE_LSOCK_Stream, accept() is as fast as possible.
| void JMDIServer::HandleCmdLineOptions | ( | const int | argc, |
| char * | argv[] | ||
| ) |
Convenience function to convert the command line options from the first invocation of the program into an MDI request. This allows the argument parsing code to be in one place.
|
protectedpure virtual |
|
inlineprotected |
Derived classes can override to remove options that only make sense for an initial invocation.
Reimplemented in JXMDIServer.
|
static |
If the application supports MDI, main() should call this before creating an application object. If this function returns false, main() can exit immediately.
|
static |