3 <title>xapplication - ANDROMEDA X-winows Encapsulation</title>
7 <h1>class xapplication</h1>
10 xapplication - X-windows application object
16 The <code>xapplication</code> is a base class which implements the main
17 thread of control in an application: initialization, event loop and
19 Each application must derive a subclass from <code>xapplication</code> and
20 define exactly one static object of this class.
21 An application does not need a <code>main()</code> function.
22 AXE has its own <code>main</code> which calls the member functions of the
23 <code>xapplication</code> object.
24 The baseclass constructor registers its <code>this</code> pointer in a
25 global area: <code>xapplication *XApp</code>.
29 The main thread of control for an application is implemented in virtual
30 functions of <code>xapplication</code>.
31 The class derived from <code>xapplication</code> may override these
32 functions to implement application-specific behavior.
33 The functionality performed in <code>xapplication</code> is :
36 <li>Parse command-line argumnets.
37 <li>Create a main-frame window.
38 <li>Setup user interface objects, possibly from an external resource.
39 <li>Perform user-specific initialization, e.g. read the $HOME/.foorc.
41 <li>Cleanup when the application terminates.
44 For dispatching events to the windows that should receive them,
45 the <code>xapplication</code> object maintains a list of all
46 <a href="window.html"><code>window</code></a> objects that are used
48 The list of windows is maintained by the contructor and destructor
53 A window object handles events through virtual functions.
54 Classes derived from <code>window</code>, like buttons, menu items,
55 slider and scrollbars implement their specific behavior by overriding
56 these event-handling functions.
57 The event dispatcher in the <code>xapplication</code> object passes
58 an appropriate XEvent structure as a parameter to the event-handling
59 function of the window.
60 The event-handling function returns TRUE if the application can
61 continue, or FALSE if the application should terminate.
65 Some windows may send commands back to the <em>xapplication</em> object.
66 A menu item, for instance sends a command to the application when it is
68 To send a command to the application, an object (usually a window)
69 calls the function <code>XApp->DoCommand(code)</code>.
70 This function dispatches the command to a handler function.
73 <tr><th colspan=2>Member functions</th></tr>
76 <td width=150><a href="xappl_add_window.html">add_window</a></td>
77 <td>Add a window to the application's list of windows
79 <td width=150><a href="xappl_remove_window.html">remove_window</a></td>
80 <td>Remove a window from the application's list of windows
82 <td width=150><a href="xappl_Pgrab.html">Pgrab</a></td>
83 <td>Set the window that grabs the pointer
85 <td width=150><a href="xappl_dispatchevent.html">DispatchEvent</a></td>
86 <td>Find the window object and call its event-handling function</td>
88 <tr><th colspan=2>Overridable member functions</th></tr>
91 <td><a href="xappl_initialize.html">Initialize</a></td>
92 <td>Initialize the application</td>
96 <td><a href="xappl_parsearguments.html">ParseArguments</a></td>
97 <td>Parse the command-line arguments</td>
101 <td><a href="xappl_setupresources.html">SetupResources</a></td>
102 <td>Create all visible objects</td>
106 <td><a href="xappl_userinit.html"> UserInit</a></td>
107 <td>Perform user-specific initialization</td>
111 <td><a href="xappl_docommand.html"> DoCommand</a></td>
112 <td>Handle a command form another object</td>
116 <td><a href="xappl_cleanup.html"> Cleanup</a></td>
117 <td>Cleanup the application when it exits</td>
123 <h2> DIAGNOSTICS</h2>