00001 /* 00002 * $XConsortium: TreeP.h,v 1.14 94/04/17 20:13:24 jim Exp $ 00003 * 00004 00005 Copyright (c) 1990 X Consortium 00006 00007 Permission is hereby granted, free of charge, to any person obtaining a copy 00008 of this software and associated documentation files (the "Software"), to deal 00009 in the Software without restriction, including without limitation the rights 00010 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00011 copies of the Software, and to permit persons to whom the Software is 00012 furnished to do so, subject to the following conditions: 00013 00014 The above copyright notice and this permission notice shall be included in 00015 all copies or substantial portions of the Software. 00016 00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00020 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00021 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00022 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 00024 Except as contained in this notice, the name of the X Consortium shall not be 00025 used in advertising or otherwise to promote the sale, use or other dealings 00026 in this Software without prior written authorization from the X Consortium. 00027 00028 * Copyright 1989 Prentice Hall 00029 * 00030 * Permission to use, copy, modify, and distribute this software for any 00031 * purpose and without fee is hereby granted, provided that the above 00032 * copyright notice appear in all copies and that both the copyright notice 00033 * and this permission notice appear in supporting documentation. 00034 * 00035 * Prentice Hall and the authors disclaim all warranties with regard 00036 * to this software, including all implied warranties of merchantability and 00037 * fitness. In no event shall Prentice Hall or the authors be liable 00038 * for any special, indirect or cosequential damages or any damages whatsoever 00039 * resulting from loss of use, data or profits, whether in an action of 00040 * contract, negligence or other tortious action, arising out of or in 00041 * connection with the use or performance of this software. 00042 * 00043 * Authors: Jim Fulton, MIT X Consortium, 00044 * based on a version by Douglas Young, Prentice Hall 00045 * 00046 * This widget is based on the Tree widget described on pages 397-419 of 00047 * Douglas Young's book "The X Window System, Programming and Applications 00048 * with Xt OSF/Motif Edition." The layout code has been rewritten to use 00049 * additional blank space to make the structure of the graph easier to see 00050 * as well as to support vertical trees. 00051 */ 00052 00053 00054 #ifndef _XawTreeP_h 00055 #define _XawTreeP_h 00056 00057 #include <X11/Xaw3d/Tree.h> 00058 00059 typedef struct _TreeClassPart { 00060 int ignore; 00061 } TreeClassPart; 00062 00063 typedef struct _TreeClassRec { 00064 CoreClassPart core_class; 00065 CompositeClassPart composite_class; 00066 ConstraintClassPart constraint_class; 00067 TreeClassPart tree_class; 00068 } TreeClassRec; 00069 00070 extern TreeClassRec treeClassRec; 00071 00072 typedef struct { 00073 /* fields available through resources */ 00074 Dimension hpad; /* hSpace/HSpace */ 00075 Dimension vpad; /* vSpace/VSpace */ 00076 Dimension line_width; /* lineWidth/LineWidth */ 00077 Pixel foreground; /* foreground/Foreground */ 00078 XtGravity gravity; /* gravity/Gravity */ 00079 Boolean auto_reconfigure; /* autoReconfigure/AutoReconfigure */ 00080 /* private fields */ 00081 GC gc; /* used to draw lines */ 00082 Widget tree_root; /* hidden root off all children */ 00083 Dimension *largest; /* list of largest per depth */ 00084 int n_largest; /* number of elements in largest */ 00085 Dimension maxwidth, maxheight; /* for shrink wrapping */ 00086 } TreePart; 00087 00088 00089 typedef struct _TreeRec { 00090 CorePart core; 00091 CompositePart composite; 00092 ConstraintPart constraint; 00093 TreePart tree; 00094 } TreeRec; 00095 00096 00097 /* 00098 * structure attached to all children 00099 */ 00100 typedef struct _TreeConstraintsPart { 00101 /* resources */ 00102 Widget parent; /* treeParent/TreeParent */ 00103 GC gc; /* treeGC/TreeGC */ 00104 /* private data */ 00105 Widget *children; 00106 int n_children; 00107 int max_children; 00108 Dimension bbsubwidth, bbsubheight; /* bounding box of sub tree */ 00109 Dimension bbwidth, bbheight; /* bounding box including node */ 00110 Position x, y; 00111 } TreeConstraintsPart; 00112 00113 typedef struct _TreeConstraintsRec { 00114 TreeConstraintsPart tree; 00115 } TreeConstraintsRec, *TreeConstraints; 00116 00117 00118 /* 00119 * useful macros 00120 */ 00121 00122 #define TREE_CONSTRAINT(w) \ 00123 ((TreeConstraints)((w)->core.constraints)) 00124 00125 #define TREE_INITIAL_DEPTH 10 /* for allocating largest array */ 00126 #define TREE_HORIZONTAL_DEFAULT_SPACING 20 00127 #define TREE_VERTICAL_DEFAULT_SPACING 6 00128 00129 #endif /* _XawTreeP_h */ 00130 00131 00132
1.5.1