#include <CXtEventLoop.h>
Inheritance diagram for CXtEventLoop:
Public Member Functions | |
CXtEventLoop () | |
virtual | ~CXtEventLoop () |
Widget | getTopLevel () const |
Returns the m_TopLevel member data. | |
XtAppContext | getAppContext () const |
Returns the application context. | |
XrmOptionDescRec * | getOptionTable () const |
Returs a pointer to the option table. | |
char ** | getFallbackResources () const |
Returns a pointer to the fallback resource list. | |
STD (string) getApplicationClass() const | |
Returns the application class name. | |
unsigned int | getOptionCount () const |
Returns the number of options in the Option list. | |
void | exit () |
Protected Member Functions | |
void | setTopLevel (const Widget am_TopLevel) |
Set the value of the top level widget:. | |
void | setAppContext (XtAppContext newContext) |
Sets a new value for the application context. | |
void | setOptionTable (XrmOptionDescRec *pTable) |
Set a new option table pointer. | |
void | setFallbackResources (char **resources) |
void | setApplicationClass (const STD(string)&ClassName) |
Set a new application class string. | |
void | setOptionCount (unsigned int nCount) |
Set the number of items in the option list. | |
virtual Widget | InitializeApplication (int &argc, char **argv) |
virtual void | SetupApplicationResources (Widget TopLevel) |
virtual void | SetupWidgetTree (Widget TopLevel) |
Private Member Functions | |
STD (string) m_sClass | |
Application class. | |
virtual int | operator() (int argc, char **argv) |
CXtEventLoop (const CXtEventLoop &aCXtEventLoop) | |
CXtEventLoop & | operator= (const CXtEventLoop &aCXtEventLoop) |
int | operator== (const CXtEventLoop &aCXtEventLoop) const |
Private Attributes | |
Widget | m_TopLevel |
XtAppContext | m_AppContext |
Xt application context. | |
XrmOptionDescRec * | m_pOptionTable |
Command line option table (optional). | |
unsigned int | m_nOptionCount |
Number of options. | |
char ** | m_ppcFallbackResources |
Application fall back resourcelist. | |
bool | m_fExit |
TRUE when supposed to exit. |
while(1) { XtGetEvent() LockMutex() XtDispatchEvent(); UnlockMutex(); yield(); // Let someone else run. }
This implies that work procedures and timer procs are also synchonrized to the application. Note that this synchronization can be costly if there are work procedures continuously active.
Definition at line 330 of file CXtEventLoop.h.
|
The constructor is essentially a no-op. The base class already is checking for duplication of the singleton. We'll just let the exception pass up and through us satisfying the condition that if an exception fires we prevent full construction. The real work of initializing the Xt application is done in operator(), when we have a thread context of our own. Definition at line 319 of file CXtEventLoop.cpp. References FALSE. |
|
In theory the application specific code will destroy all application data and objects including the Xt application context and therefore this function is also a no-op. Subclasses should either replace/supplement this or tear down the Xt stuff prior to destruction. Definition at line 339 of file CXtEventLoop.cpp. |
|
Copy construction, assignment and equality comparison are invalid and hence declared privatge and not implemented. |
|
Definition at line 429 of file CXtEventLoop.h. References m_fExit. |
|
Returns the application context.
Definition at line 369 of file CXtEventLoop.h. |
|
Returns a pointer to the fallback resource list.
Definition at line 379 of file CXtEventLoop.h. |
|
Returns the number of options in the Option list.
Definition at line 389 of file CXtEventLoop.h. |
|
Returs a pointer to the option table.
Definition at line 374 of file CXtEventLoop.h. |
|
Returns the m_TopLevel member data.
Definition at line 364 of file CXtEventLoop.h. |
|
Called to initialize the X toolkit. Default behavior is to call XtAppinit(), and return its result. A typical implementation of a subclass will might setup an options table and call setOptionTable and setOptionCount, Override the default class name via setApplicationClass, and fill in a set of fallback resources via setFallbackResources Definition at line 359 of file CXtEventLoop.cpp. References m_AppContext, and m_TopLevel. Referenced by operator()(). |
|
Entry point for the Xt event loop thread. The initialization functions are called to allow the application to set up the application widget set. After this is done, the event loop is entered. Each call of XtDispatchEvent is bracketed by calls to lock/unlock the application serializatio mutex. Note that throughout the entire initialization of the Xt, the global mutex is held. Implements CEventLoop. Definition at line 425 of file CXtEventLoop.cpp. References CApplicationSerializer::getInstance(), InitializeApplication(), CThreadRecursiveMutex::Lock(), m_AppContext, m_TopLevel, SetupApplicationResources(), SetupWidgetTree(), and CThreadRecursiveMutex::UnLock(). |
|
|
|
|
|
Sets a new value for the application context.
Definition at line 400 of file CXtEventLoop.h. References m_AppContext. |
|
Set a new application class string.
Definition at line 413 of file CXtEventLoop.h. |
|
Set new fallback resource list.
Definition at line 409 of file CXtEventLoop.h. References m_ppcFallbackResources. |
|
Set the number of items in the option list.
Definition at line 417 of file CXtEventLoop.h. References m_nOptionCount. |
|
Set a new option table pointer.
Definition at line 404 of file CXtEventLoop.h. References m_pOptionTable. |
|
Set the value of the top level widget:.
Definition at line 395 of file CXtEventLoop.h. References m_TopLevel. |
|
Called from operator() to process the resource database. Since the resource database requires definitions which are application specific but is not actually required, the default behavior is to do nothing. Normal applications will override this member toset up resource definition structures, invoke XtGetApplicationResrouces() to retrieve the actual values from the resource database and validity check them. \ Definition at line 391 of file CXtEventLoop.cpp. Referenced by operator()(). |
|
operator() calls this function to set up the initial widget tree. This is completely application specific. Most applications will require a widget tree in addition to the shell widget produced by XtAppInitialize(). This member should be overridden to produce this tree. Definition at line 406 of file CXtEventLoop.cpp. Referenced by operator()(). |
|
Returns the application class name.
Definition at line 384 of file CXtEventLoop.h. |
|
Application class.
|
|
Xt application context.
Definition at line 338 of file CXtEventLoop.h. Referenced by InitializeApplication(), operator()(), and setAppContext(). |
|
TRUE when supposed to exit.
Definition at line 344 of file CXtEventLoop.h. Referenced by exit(). |
|
Number of options.
Definition at line 341 of file CXtEventLoop.h. Referenced by setOptionCount(). |
|
Command line option table (optional).
Definition at line 340 of file CXtEventLoop.h. Referenced by setOptionTable(). |
|
Application fall back resourcelist.
Definition at line 342 of file CXtEventLoop.h. Referenced by setFallbackResources(). |
|
m_TopLevel is the top level of the application's widget hierarchy. in order to use the Xm++ library it will be necessary to retrieve this and instantiate Widget object from it. Definition at line 337 of file CXtEventLoop.h. Referenced by InitializeApplication(), operator()(), and setTopLevel(). |