Cleanup classes that are moved to ACL
[AXE.git] / doc / index.html
1 <HTML>
2 <HEAD>
3 <TITLE>ANDROMEDA X-Windows Encapsulation</TITLE>
4 <!--Created by Applixware HTML Authoring System, Release 4.3 on Wed May 20 22:15:22 1998-->
5 </HEAD>
6 <BODY BGCOLOR="#ffffff">
7 <H1>AXE - Andromeda X-Windows Encapsulation</H1>
8 <P>AXE is an application framework which encapsulates much of the
9 functionality in X-Windows. The classes in AXE encapsulate the usual resources
10 in X, like windows, graphic contexts, cursors and fonts. Creating objects of
11 these classes also creates the corresponding resources on the X workstation.
12 These objects and their X resources are controlled though member functions of
13 the classes. Other classes add represent user interface concepts, like menu's
14 dialog panels, button and scrollbars. Using the classes in AXE, it is easy to
15 create application programs that use a graphical user interface.</P>
16 <P>The core of an AXE-application is a <A HREF="xapplication.html">xapplication
17 </A>-derived object. There is a single object derived from <B>xapplication
18 </B> in each application program. This object takes takes of initialization,
19 event dispatching and cleanup. Unlike traditional C programs, a program
20 written with AXE does not need to have a <TT>main()</TT> function. AXE has its
21 own <TT>main()</TT> which calls the member functions of the application's 
22 <B>xapplication</B>-derived object.</P>
23 <P>Everything visible on the screen and all user interaction is done by 
24 <A HREF="window.html">window</A> objects. Windows are used for drawing
25 graphics and capturing input from the mouse and keyboard. Some windows can
26 send commands back to the <I>xapplication</I> object, e.g. when a menu item or
27 a button is clicked.</P>
28 <P>Windows are organized in a tree-structured hierarchy. At the top of the
29 hierarchy is the root window. The root window is created by the X server and
30 cover the whole screen. All application's windows are children of the root
31 window. An application creates one or more top-level windows, which may
32 themselves contain many children or subwindows. The top-level windows of an
33 application are direct children of the root window and are usually managed by
34 the window manager. These top-level windows of the applications are of the 
35 <B>managed_window</B> class. The <B>xapplication</B>-derived object maintains
36 a hashtable of all windows that are created by the application.</P>
37 <P>A program written with AXE is driven by three communication mechanisms:
38 </P>
39 <OL>
40 <LI>Events.
41 <P>Events originate from the X server and are sent to a window as a result of
42 input from the mouse or keyboard.</P>
43 <P></P>
44 <LI>Commands.
45 <P>Commands are notifications from certain windows and are sent to either the
46 top-level window which currently has the focus or to the application itself.
47 </P>
48 <P></P>
49 <LI>Messages.
50 <P>Messages are sent from child windows to their parent window.</P>
51 </OL>
52 <P>The figure below shows how these three communication mechanisms are related:
53 </P>
54 <P><IMG SRC="communication.png"></P>
55 <H2>Menu</H2>
56 <P>Constructing menus involves two class hierarchies, both of which are
57 derived from the <B>window</B> class. The interaction of menus is implemented
58 in <A HREF="menu_item.html">menu_item</A> objects. A menu_item is a selectable
59 object that can either send a command to the application or show a submenu.
60 Collections of menu items are contained in a <A HREF="menu_container.html">menu_container
61 </A> objects, like a <I>menu_bar</I> or a <I>popup_menu</I>. Both container
62 have equivalent auto-sizing behaviour but a menu_bar is a long-stretched
63 window on the edge of a parent window and a popup_menu is a direct child of
64 the root window. The similarity lies in the fact that both the menu_bar and
65 the popup_menu rearrange their child windows (usually menu items) to make them
66 fit nicely in the container window.</P>
67 <H3>Menu Bar</H3>
68 <P>A <I>menu_bar</I> is a window that sits at the edge of it parent window and
69 acts as a container for other windows. It puts all its child windows next to
70 each other and makes itself fit exactly in its parent window. The size of a
71 menu_bar is dictated by the parent window on one side and the child windows on
72 the other side.</P>
73 <P>Menu bars come in two flavors: horizontal and vertical. A horizontal menu
74 bar has a larger width than height. A vertical menu bar has a large height and
75 a relatively smaller width. Depending on the flavor of the menu bar it will
76 span its parent window horizontally or vertically. A horizontal menu bar
77 matches its width with the parent window; a vertical menu bar changes its
78 height to fit in its parent window.</P>
79 <P>A menu bar rearranges its child windows so they appear next to eachother.
80 Child windows are spread left to right in a horizontal menu bar and top to
81 bottom in a vertical menu bar.</P>
82 <P>In the direction that does not span the parent of the menu bar, all sizes
83 of the menu bar's children and the menu bar itself are set to the same value.
84 So the menu bar spans its parent in one direction and the menu bar's children
85 span the menu bar in the other direction. In that direction the size of the
86 menu bar and its child windows is determined by the largest child window.
87 </P>
88 <P>A menu bar may be user-dockable, i.e. click and drag in the background of
89 the menu_bar can move the menu bar to an other edge of its parent window.
90 </P>
91 <H3>Popup Menu</H3>
92 <P>A <I>popup_menu</I> is another container for <I>menu_item</I> objects. It
93 is an unmanaged child of the root window and is made visible as a result of
94 the selection of another menu item. A <I>popup_menu</I> rearranges its child
95 windows similarly to a <I>menu_bar</I> but its size does not depend on a
96 parent window.</P>
97 <H2>Dialog</H2>
98 <P>A <B>dialog</B> is a <B>managed_window</B> used for obtaining input from
99 the user. A dialog contains various user interface objects like buttons,
100 edits, static texts and scrollbars</P>
101 <H3>Button</H3>
102 <H2>Alphabethical list of classes</H2>
103 <P>Below is an alphabethical list of all classes in AXE. The <A HREF="class_diagram.html">Class
104 Diagram</A> shows how these classes are related.</P>
105 <UL>
106 <LI><A HREF="button.html">button</A>
107 <LI><A HREF="color.html">color</A>
108 <LI><A HREF="cursor.html">cursor</A>
109 <LI><A HREF="display.html">display</A>
110 <LI><A HREF="edit.html">edit</A>
111 <LI><A HREF="font.html">font</A>
112 <LI><A HREF="frame.html">frame</A>
113 <LI><A HREF="gc.html">gc</A>
114 <LI><A HREF="menu_bar.html">menu_bar</A>
115 <LI><A HREF="menu_container.html">menu_container</A>
116 <LI><A HREF="menu_item.html">menu_item</A>
117 <LI><A HREF="menu_label.html">menu_label</A>
118 <LI><A HREF="menu_separator.html">menu_separator</A>
119 <LI><A HREF="pixmap.html">pixmap</A>
120 <LI><A HREF="point.html">point</A>
121 <LI><A HREF="popup_menu.html">popup_menu</A>
122 <LI><A HREF="rectangle.html">rectangle</A>
123 <LI><A HREF="scrollbar.html">scrollbar</A>
124 <LI><A HREF="size.html">size</A>
125 <LI><A HREF="stipple.html">stipple</A>
126 <LI><A HREF="window.html">window</A>
127 <LI><A HREF="xapplication.html">xapplication</A></UL>
128 <P></P>
129 <P>The xapplication or display object may contain 'standard' GC's which can be
130 used by all windows.</P>
131 <P>Graphic output happens in a device context which is a combination of a
132 drawable and a GC, but can also relate to another output device, like
133 printers, plotters or meta-files.</P>
134 </BODY>
135 </HTML>