Cleanup classes that are moved to ACL
[AXE.git] / doc / xapplication.html
1 <html>
2 <head>
3 <title>xapplication - ANDROMEDA X-winows Encapsulation</title>
4 </head>
5 <body bgcolor=white>
6
7 <h1>class xapplication</h1>
8 <hr>
9 <h2> NAME</h2>
10 xapplication - X-windows application object
11 <h2> SYNOPSIS</h2>
12 class xapplication
13
14 <h2> DESCRIPTION</h2>
15
16 The <code>xapplication</code> is a base class which implements the main
17 thread of control in an application: initialization, event loop and
18 termination.
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>.
26
27 <p>
28
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 :
34
35 <ul>
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.
40 <li>Dispatch events.
41 <li>Cleanup when the application terminates.
42 </ul>
43
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
47 by the application.
48 The list of windows is maintained by the contructor and destructor
49 of the window class.
50
51 <p>
52
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.
62
63 <p>
64
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
67 clicked.
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.
71
72 <table>
73 <tr><th colspan=2>Member functions</th></tr>
74
75 <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
78 <tr>
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
81 <tr>
82    <td width=150><a href="xappl_Pgrab.html">Pgrab</a></td>
83    <td>Set the window that grabs the pointer
84 <tr>
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>
87 </tr>
88 <tr><th colspan=2>Overridable member functions</th></tr>
89
90 <tr>
91    <td><a href="xappl_initialize.html">Initialize</a></td>
92    <td>Initialize the application</td>
93 <tr>
94
95 <tr>
96    <td><a href="xappl_parsearguments.html">ParseArguments</a></td>
97    <td>Parse the command-line arguments</td>
98 <tr>
99
100 <tr>
101    <td><a href="xappl_setupresources.html">SetupResources</a></td>
102    <td>Create all visible objects</td>
103 <tr>
104
105 <tr>
106    <td><a href="xappl_userinit.html"> UserInit</a></td>
107    <td>Perform user-specific initialization</td>
108 <tr>
109
110 <tr>
111    <td><a href="xappl_docommand.html"> DoCommand</a></td>
112    <td>Handle a command form another object</td>
113 <tr>
114
115 <tr>
116    <td><a href="xappl_cleanup.html"> Cleanup</a></td>
117    <td>Cleanup the application when it exits</td>
118 <tr>
119
120 </table>
121
122 <h2> SEE ALSO</h2>
123 <h2> DIAGNOSTICS</h2>
124
125 </body>
126 </html>