Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:26:37

0001 /*
0002 
0003 Copyright 1990, 1998  The Open Group
0004 
0005 Permission to use, copy, modify, distribute, and sell this software and its
0006 documentation for any purpose is hereby granted without fee, provided that
0007 the above copyright notice appear in all copies and that both that
0008 copyright notice and this permission notice appear in supporting
0009 documentation.
0010 
0011 The above copyright notice and this permission notice shall be included in
0012 all copies or substantial portions of the Software.
0013 
0014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0017 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0018 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0019 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0020 
0021 Except as contained in this notice, the name of The Open Group shall not be
0022 used in advertising or otherwise to promote the sale, use or other dealings
0023 in this Software without prior written authorization from The Open Group.
0024 
0025  * Copyright 1989 Prentice Hall
0026  *
0027  * Permission to use, copy, modify, and distribute this software for any
0028  * purpose and without fee is hereby granted, provided that the above
0029  * copyright notice appear in all copies and that both the copyright notice
0030  * and this permission notice appear in supporting documentation.
0031  *
0032  * Prentice Hall and the authors disclaim all warranties with regard
0033  * to this software, including all implied warranties of merchantability and
0034  * fitness.  In no event shall Prentice Hall or the authors be liable
0035  * for any special, indirect or cosequential damages or any damages whatsoever
0036  * resulting from loss of use, data or profits, whether in an action of
0037  * contract, negligence or other tortious action, arising out of or in
0038  * connection with the use or performance of this software.
0039  *
0040  * Authors:  Jim Fulton, MIT X Consortium,
0041  *           based on a version by Douglas Young, Prentice Hall
0042  *
0043  * This widget is based on the Tree widget described on pages 397-419 of
0044  * Douglas Young's book "The X Window System, Programming and Applications
0045  * with Xt OSF/Motif Edition."  The layout code has been rewritten to use
0046  * additional blank space to make the structure of the graph easier to see
0047  * as well as to support vertical trees.
0048  */
0049 
0050 #ifndef _XawTreeP_h
0051 #define _XawTreeP_h
0052 
0053 #include <X11/Xaw/Tree.h>
0054 
0055 typedef struct _TreeClassPart {
0056     XtPointer extension;
0057 } TreeClassPart;
0058 
0059 typedef struct _TreeClassRec {
0060     CoreClassPart core_class;
0061     CompositeClassPart composite_class;
0062     ConstraintClassPart constraint_class;
0063     TreeClassPart tree_class;
0064 } TreeClassRec;
0065 
0066 extern TreeClassRec treeClassRec;
0067 
0068 typedef struct {
0069     /* fields available through resources */
0070     Dimension hpad;         /* hSpace/HSpace */
0071     Dimension vpad;         /* vSpace/VSpace */
0072     Dimension line_width;       /* lineWidth/LineWidth */
0073     Pixel foreground;           /* foreground/Foreground */
0074     XtGravity gravity;          /* gravity/Gravity */
0075     Boolean auto_reconfigure;       /* autoReconfigure/AutoReconfigure */
0076     /* private fields */
0077     GC gc;              /* used to draw lines */
0078     Widget tree_root;           /* hidden root off all children */
0079     Dimension *largest;         /* list of largest per depth */
0080     int n_largest;          /* number of elements in largest */
0081     Dimension maxwidth, maxheight;  /* for shrink wrapping */
0082 #ifndef OLDXAW
0083     XawDisplayList *display_list;
0084     XtPointer pad[4];   /* for future use and keep binary compatibility */
0085 #endif
0086 } TreePart;
0087 
0088 
0089 typedef struct _TreeRec {
0090     CorePart core;
0091     CompositePart composite;
0092     ConstraintPart constraint;
0093     TreePart tree;
0094 }  TreeRec;
0095 
0096 
0097 /*
0098  * structure attached to all children
0099  */
0100 typedef struct _TreeConstraintsPart {
0101     /* resources */
0102     Widget parent;          /* treeParent/TreeParent */
0103     GC gc;              /* treeGC/TreeGC */
0104     /* private data */
0105     Widget *children;
0106     int n_children;
0107     int max_children;
0108     Dimension bbsubwidth, bbsubheight;  /* bounding box of sub tree */
0109     Dimension bbwidth, bbheight;    /* bounding box including node */
0110     Position x, y;
0111 #ifndef OLDXAW
0112     XtPointer pad[2];   /* leave some space for future optimizations, and
0113              * keep binary compatibility
0114              */
0115 #endif
0116 } TreeConstraintsPart;
0117 
0118 typedef struct _TreeConstraintsRec {
0119    TreeConstraintsPart tree;
0120 } TreeConstraintsRec, *TreeConstraints;
0121 
0122 
0123 /*
0124  * useful macros
0125  */
0126 
0127 #define TREE_CONSTRAINT(w) \
0128                    ((TreeConstraints)((w)->core.constraints))
0129 
0130 #define TREE_INITIAL_DEPTH 10       /* for allocating largest array */
0131 #define TREE_HORIZONTAL_DEFAULT_SPACING 20
0132 #define TREE_VERTICAL_DEFAULT_SPACING 6
0133 
0134 #endif /* _XawTreeP_h */
0135 
0136 
0137