3 Copyright 1990, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
25 * Copyright 1989 Prentice Hall
27 * Permission to use, copy, modify, and distribute this software for any
28 * purpose and without fee is hereby granted, provided that the above
29 * copyright notice appear in all copies and that both the copyright notice
30 * and this permission notice appear in supporting documentation.
32 * Prentice Hall and the authors disclaim all warranties with regard
33 * to this software, including all implied warranties of merchantability and
34 * fitness. In no event shall Prentice Hall or the authors be liable
35 * for any special, indirect or cosequential damages or any damages whatsoever
36 * resulting from loss of use, data or profits, whether in an action of
37 * contract, negligence or other tortious action, arising out of or in
38 * connection with the use or performance of this software.
40 * Authors: Jim Fulton, MIT X Consortium,
41 * based on a version by Douglas Young, Prentice Hall
43 * This widget is based on the Tree widget described on pages 397-419 of
44 * Douglas Young's book "The X Window System, Programming and Applications
45 * with Xt OSF/Motif Edition." The layout code has been rewritten to use
46 * additional blank space to make the structure of the graph easier to see
47 * as well as to support vertical trees.
53 #include <X11/Xaw/Tree.h>
55 typedef struct _TreeClassPart {
59 typedef struct _TreeClassRec {
60 CoreClassPart core_class;
61 CompositeClassPart composite_class;
62 ConstraintClassPart constraint_class;
63 TreeClassPart tree_class;
66 extern TreeClassRec treeClassRec;
69 /* fields available through resources */
70 Dimension hpad; /* hSpace/HSpace */
71 Dimension vpad; /* vSpace/VSpace */
72 Dimension line_width; /* lineWidth/LineWidth */
73 Pixel foreground; /* foreground/Foreground */
74 XtGravity gravity; /* gravity/Gravity */
75 Boolean auto_reconfigure; /* autoReconfigure/AutoReconfigure */
77 GC gc; /* used to draw lines */
78 Widget tree_root; /* hidden root off all children */
79 Dimension *largest; /* list of largest per depth */
80 int n_largest; /* number of elements in largest */
81 Dimension maxwidth, maxheight; /* for shrink wrapping */
83 XawDisplayList *display_list;
84 XtPointer pad[4]; /* for future use and keep binary compatability */
89 typedef struct _TreeRec {
91 CompositePart composite;
92 ConstraintPart constraint;
98 * structure attached to all children
100 typedef struct _TreeConstraintsPart {
102 Widget parent; /* treeParent/TreeParent */
103 GC gc; /* treeGC/TreeGC */
108 Dimension bbsubwidth, bbsubheight; /* bounding box of sub tree */
109 Dimension bbwidth, bbheight; /* bounding box including node */
112 XtPointer pad[2]; /* leave some space for future optimizations, and
113 * keep binary compatability
116 } TreeConstraintsPart;
118 typedef struct _TreeConstraintsRec {
119 TreeConstraintsPart tree;
120 } TreeConstraintsRec, *TreeConstraints;
127 #define TREE_CONSTRAINT(w) \
128 ((TreeConstraints)((w)->core.constraints))
130 #define TREE_INITIAL_DEPTH 10 /* for allocating largest array */
131 #define TREE_HORIZONTAL_DEFAULT_SPACING 20
132 #define TREE_VERTICAL_DEFAULT_SPACING 6
134 #endif /* _XawTreeP_h */