17a84e134Smrg/* 27a84e134Smrg 37a84e134SmrgCopyright 1990, 1998 The Open Group 47a84e134Smrg 57a84e134SmrgPermission to use, copy, modify, distribute, and sell this software and its 67a84e134Smrgdocumentation for any purpose is hereby granted without fee, provided that 77a84e134Smrgthe above copyright notice appear in all copies and that both that 87a84e134Smrgcopyright notice and this permission notice appear in supporting 97a84e134Smrgdocumentation. 107a84e134Smrg 117a84e134SmrgThe above copyright notice and this permission notice shall be included in 127a84e134Smrgall copies or substantial portions of the Software. 137a84e134Smrg 147a84e134SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 157a84e134SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 167a84e134SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 177a84e134SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 187a84e134SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 197a84e134SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 207a84e134Smrg 217a84e134SmrgExcept as contained in this notice, the name of The Open Group shall not be 227a84e134Smrgused in advertising or otherwise to promote the sale, use or other dealings 237a84e134Smrgin this Software without prior written authorization from The Open Group. 247a84e134Smrg 257a84e134Smrg * Copyright 1989 Prentice Hall 267a84e134Smrg * 277a84e134Smrg * Permission to use, copy, modify, and distribute this software for any 287a84e134Smrg * purpose and without fee is hereby granted, provided that the above 297a84e134Smrg * copyright notice appear in all copies and that both the copyright notice 307a84e134Smrg * and this permission notice appear in supporting documentation. 31421c997bSmrg * 327a84e134Smrg * Prentice Hall and the authors disclaim all warranties with regard 337a84e134Smrg * to this software, including all implied warranties of merchantability and 347a84e134Smrg * fitness. In no event shall Prentice Hall or the authors be liable 357a84e134Smrg * for any special, indirect or cosequential damages or any damages whatsoever 367a84e134Smrg * resulting from loss of use, data or profits, whether in an action of 377a84e134Smrg * contract, negligence or other tortious action, arising out of or in 387a84e134Smrg * connection with the use or performance of this software. 39421c997bSmrg * 407a84e134Smrg * Authors: Jim Fulton, MIT X Consortium, 417a84e134Smrg * based on a version by Douglas Young, Prentice Hall 42421c997bSmrg * 437a84e134Smrg * This widget is based on the Tree widget described on pages 397-419 of 44421c997bSmrg * Douglas Young's book "The X Window System, Programming and Applications 457a84e134Smrg * with Xt OSF/Motif Edition." The layout code has been rewritten to use 467a84e134Smrg * additional blank space to make the structure of the graph easier to see 477a84e134Smrg * as well as to support vertical trees. 487a84e134Smrg */ 497a84e134Smrg 507a84e134Smrg#ifndef _XawTreeP_h 517a84e134Smrg#define _XawTreeP_h 527a84e134Smrg 537a84e134Smrg#include <X11/Xaw/Tree.h> 547a84e134Smrg 557a84e134Smrgtypedef struct _TreeClassPart { 567a84e134Smrg XtPointer extension; 577a84e134Smrg} TreeClassPart; 587a84e134Smrg 597a84e134Smrgtypedef struct _TreeClassRec { 607a84e134Smrg CoreClassPart core_class; 617a84e134Smrg CompositeClassPart composite_class; 627a84e134Smrg ConstraintClassPart constraint_class; 637a84e134Smrg TreeClassPart tree_class; 647a84e134Smrg} TreeClassRec; 657a84e134Smrg 667a84e134Smrgextern TreeClassRec treeClassRec; 677a84e134Smrg 687a84e134Smrgtypedef struct { 697a84e134Smrg /* fields available through resources */ 707a84e134Smrg Dimension hpad; /* hSpace/HSpace */ 717a84e134Smrg Dimension vpad; /* vSpace/VSpace */ 727a84e134Smrg Dimension line_width; /* lineWidth/LineWidth */ 737a84e134Smrg Pixel foreground; /* foreground/Foreground */ 747a84e134Smrg XtGravity gravity; /* gravity/Gravity */ 757a84e134Smrg Boolean auto_reconfigure; /* autoReconfigure/AutoReconfigure */ 767a84e134Smrg /* private fields */ 777a84e134Smrg GC gc; /* used to draw lines */ 787a84e134Smrg Widget tree_root; /* hidden root off all children */ 797a84e134Smrg Dimension *largest; /* list of largest per depth */ 807a84e134Smrg int n_largest; /* number of elements in largest */ 817a84e134Smrg Dimension maxwidth, maxheight; /* for shrink wrapping */ 827a84e134Smrg#ifndef OLDXAW 837a84e134Smrg XawDisplayList *display_list; 845b16253fSmrg XtPointer pad[4]; /* for future use and keep binary compatibility */ 857a84e134Smrg#endif 867a84e134Smrg} TreePart; 877a84e134Smrg 887a84e134Smrg 897a84e134Smrgtypedef struct _TreeRec { 907a84e134Smrg CorePart core; 917a84e134Smrg CompositePart composite; 927a84e134Smrg ConstraintPart constraint; 937a84e134Smrg TreePart tree; 947a84e134Smrg} TreeRec; 957a84e134Smrg 967a84e134Smrg 977a84e134Smrg/* 987a84e134Smrg * structure attached to all children 997a84e134Smrg */ 1007a84e134Smrgtypedef struct _TreeConstraintsPart { 1017a84e134Smrg /* resources */ 1027a84e134Smrg Widget parent; /* treeParent/TreeParent */ 1037a84e134Smrg GC gc; /* treeGC/TreeGC */ 1047a84e134Smrg /* private data */ 1057a84e134Smrg Widget *children; 1067a84e134Smrg int n_children; 1077a84e134Smrg int max_children; 1087a84e134Smrg Dimension bbsubwidth, bbsubheight; /* bounding box of sub tree */ 1097a84e134Smrg Dimension bbwidth, bbheight; /* bounding box including node */ 1107a84e134Smrg Position x, y; 1117a84e134Smrg#ifndef OLDXAW 1127a84e134Smrg XtPointer pad[2]; /* leave some space for future optimizations, and 1135b16253fSmrg * keep binary compatibility 1147a84e134Smrg */ 1157a84e134Smrg#endif 1167a84e134Smrg} TreeConstraintsPart; 1177a84e134Smrg 1187a84e134Smrgtypedef struct _TreeConstraintsRec { 1197a84e134Smrg TreeConstraintsPart tree; 1207a84e134Smrg} TreeConstraintsRec, *TreeConstraints; 1217a84e134Smrg 1227a84e134Smrg 1237a84e134Smrg/* 1247a84e134Smrg * useful macros 1257a84e134Smrg */ 1267a84e134Smrg 1277a84e134Smrg#define TREE_CONSTRAINT(w) \ 1287a84e134Smrg ((TreeConstraints)((w)->core.constraints)) 1297a84e134Smrg 1307a84e134Smrg#define TREE_INITIAL_DEPTH 10 /* for allocating largest array */ 1317a84e134Smrg#define TREE_HORIZONTAL_DEFAULT_SPACING 20 1327a84e134Smrg#define TREE_VERTICAL_DEFAULT_SPACING 6 1337a84e134Smrg 1347a84e134Smrg#endif /* _XawTreeP_h */ 1357a84e134Smrg 1367a84e134Smrg 1377a84e134Smrg 138