Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:26

0001 /*
0002  * Motif
0003  *
0004  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
0005  *
0006  * These libraries and programs are free software; you can
0007  * redistribute them and/or modify them under the terms of the GNU
0008  * Lesser General Public License as published by the Free Software
0009  * Foundation; either version 2 of the License, or (at your option)
0010  * any later version.
0011  *
0012  * These libraries and programs are distributed in the hope that
0013  * they will be useful, but WITHOUT ANY WARRANTY; without even the
0014  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
0015  * PURPOSE. See the GNU Lesser General Public License for more
0016  * details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with these librararies and programs; if not, write
0020  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
0021  * Floor, Boston, MA 02110-1301 USA
0022  * 
0023  */
0024 
0025 #ifndef _XmHierarchyP_h
0026 #define _XmHierarchyP_h
0027 
0028 #if defined(VMS) || defined(__VMS)
0029 #include <X11/apienvset.h>
0030 #endif
0031 
0032 /************************************************************
0033 *   INCLUDE FILES
0034 *************************************************************/
0035 #include <Xm/ManagerP.h>
0036 #include <Xm/ExtP.h>
0037 #include <Xm/Hierarchy.h>
0038 
0039 /************************************************************
0040 *   TYPEDEFS AND DEFINES
0041 *************************************************************/
0042 
0043 #ifdef __cplusplus
0044 extern "C" {
0045 #endif
0046 
0047 #define IS_MAPPED   (1L << 1)
0048 #define IS_COMPRESSED   (1L << 2)
0049 #define PARENT_GONE (1L << 3)
0050 #define IS_SELECTED (1L << 4)
0051 
0052 /************************************************************
0053 *   MACROS
0054 *************************************************************/
0055 
0056 /************************************************************
0057 *   GLOBAL DECLARATIONS
0058 *************************************************************/
0059 
0060 typedef struct _HierNodeInfo {
0061     /*
0062      * Public (Resource) data.
0063      */
0064 
0065     XmHierarchyNodeState state; /* State of the node. */
0066     Widget parent;      /* parent of this child. */
0067     Widget insert_before;   /* Sibling to insert this node before;
0068                    NULL will place it at the end. */
0069     Pixmap open_folder, close_folder; /* Images for open/close buttons. */
0070 
0071     /*
0072      * Private data.
0073      */
0074 
0075     Widget widget;      /* Back pointer to this node's widget. */
0076     Widget open_close_button;   /* The open or close button. */
0077 
0078     struct _HierarchyConstraintRec ** children;       /* norm children. */
0079     Cardinal num_children;  /* number of each type of children. */
0080     Cardinal alloc_attrs, alloc;   /* amount of allocated space for each */
0081 
0082     unsigned char status;   /* 8 status bits. */
0083 } HierNodeInfo;
0084 
0085 typedef struct _HierarchyConstraintRec {
0086     XmManagerConstraintPart manager;
0087     HierNodeInfo hierarchy;
0088 } HierarchyConstraintRec, XmHierarchyConstraintRec, *HierarchyConstraints;
0089 
0090 typedef void    (*XmHierarchyNodeProc)(HierarchyConstraints);
0091 typedef void    (*XmHierarchyExtraNodeProc)(Widget, HierarchyConstraints);
0092 typedef void    (*XmHierarchyBuildTableProc)(Widget, 
0093                          HierarchyConstraints, Cardinal *);
0094 typedef void    (*XmHierarchyResetButtonProc)(Widget, HierarchyConstraints);
0095     
0096 typedef struct {
0097     /* Class function for changing node state. */
0098     XmHierarchyNodeProc     change_node_state;
0099     /* map or unmap a given node. */
0100     XmHierarchyNodeProc     map_node;
0101     XmHierarchyNodeProc     unmap_node;
0102     /* Unmaps all the extra nodes. */
0103     XmHierarchyExtraNodeProc    unmap_all_extra_nodes;
0104     /* Builds the node table. */
0105     XmHierarchyBuildTableProc   build_node_table;
0106     /* Correctly sets the state of the open/close button. */
0107     XmHierarchyResetButtonProc  reset_open_close_button;
0108     /* Toggles state of a node. */
0109     XtCallbackProc      toggle_node_state;
0110     /* Just in case we need it later. */
0111     XtPointer           extension;  
0112 } HierarchyClassPart;
0113 
0114 typedef struct _XmHierarchyClassRec {
0115     CoreClassPart       core_class;
0116     CompositeClassPart      composite_class;
0117     ConstraintClassPart     constraint_class;
0118     XmManagerClassPart      manager_class;
0119     HierarchyClassPart          hierarchy_class;
0120 } XmHierarchyClassRec;
0121 
0122 externalref XmHierarchyClassRec xmHierarchyClassRec;
0123 
0124 typedef struct _HierarchyPart {
0125     /* resources */
0126 
0127     Boolean auto_close;     /* Auto-close children when parent is closed?*/
0128     Boolean refigure_mode;  /* Do refigures? */
0129 
0130     Dimension h_margin;     /* The horizontal margin. */
0131     Dimension v_margin;     /* The vertical margin. */
0132     Pixmap open_folder, close_folder; /* Images for open/close buttons. */
0133 
0134     XtCallbackList node_state_callback; /* Called when the node button is
0135                        clicked */
0136     XtCallbackList node_state_changed_callback; /* Called when the node state
0137                            changes */
0138     XtCallbackList node_state_beg_end_callback; /* Called when beginning
0139                              or ending a set of node
0140                              state changes */
0141 
0142     /* private state */
0143 
0144     HierarchyConstraintRec ** node_table;
0145     HierarchyConstraints top_node; 
0146     Cardinal num_nodes, alloc_nodes;
0147     Pixmap def_open_folder, def_close_folder; /* Default folder button Images*/
0148 
0149     XtWorkProcId work_proc_id;  /* work proc id for the move nodes wp */
0150 } HierarchyPart;
0151 
0152 typedef struct _XmHierarchyRec {
0153     CorePart        core;
0154     CompositePart   composite;
0155     ConstraintPart  constraint;
0156     XmManagerPart   manager;
0157     HierarchyPart   hierarchy;
0158 } XmHierarchyRec;
0159 
0160 /*
0161  * These are necessary because the XmResolvePartOffset macros assume a
0162  * certain naming convention
0163  */
0164 typedef HierarchyPart XmHierarchyPart;
0165 typedef HierNodeInfo  XmHierarchyConstraintPart;
0166 
0167 #define XmHierarchy_auto_close(w) (((XmHierarchyWidget)(w))->hierarchy.auto_close)
0168 #define XmHierarchy_refigure_mode(w) (((XmHierarchyWidget)(w))->hierarchy.refigure_mode)
0169 #define XmHierarchy_h_margin(w) (((XmHierarchyWidget)(w))->hierarchy.h_margin)
0170 #define XmHierarchy_v_margin(w) (((XmHierarchyWidget)(w))->hierarchy.v_margin)
0171 #define XmHierarchy_open_folder(w) (((XmHierarchyWidget)(w))->hierarchy.open_folder)
0172 #define XmHierarchy_close_folder(w) (((XmHierarchyWidget)(w))->hierarchy.close_folder)
0173 #define XmHierarchy_node_state_callback(w) (((XmHierarchyWidget)(w))->hierarchy.node_state_callback)
0174 #define XmHierarchy_node_state_changed_callback(w) (((XmHierarchyWidget)(w))->hierarchy.node_state_changed_callback)
0175 #define XmHierarchy_node_state_beg_end_callback(w) (((XmHierarchyWidget)(w))->hierarchy.node_state_beg_end_callback)
0176 #define XmHierarchy_node_table(w) (((XmHierarchyWidget)(w))->hierarchy.node_table)
0177 #define XmHierarchy_top_node(w) (((XmHierarchyWidget)(w))->hierarchy.top_node)
0178 #define XmHierarchy_num_nodes(w) (((XmHierarchyWidget)(w))->hierarchy.num_nodes)
0179 #define XmHierarchy_alloc_nodes(w) (((XmHierarchyWidget)(w))->hierarchy.alloc_nodes)
0180 #define XmHierarchy_def_open_folder(w) (((XmHierarchyWidget)(w))->hierarchy.def_open_folder)
0181 #define XmHierarchy_def_close_folder(w) (((XmHierarchyWidget)(w))->hierarchy.def_close_folder)
0182 #define XmHierarchy_work_proc_id(w) (((XmHierarchyWidget)(w))->hierarchy.work_proc_id)
0183 
0184 #define XmHierarchyC_state(constraints) ((constraints)->hierarchy.state)
0185 #define XmHierarchyC_parent(constraints) ((constraints)->hierarchy.parent)
0186 #define XmHierarchyC_insert_before(constraints) ((constraints)->hierarchy.insert_before)
0187 #define XmHierarchyC_open_folder(constraints) ((constraints)->hierarchy.open_folder)
0188 #define XmHierarchyC_close_folder(constraints) ((constraints)->hierarchy.close_folder)
0189 #define XmHierarchyC_widget(constraints) ((constraints)->hierarchy.widget)
0190 #define XmHierarchyC_open_close_button(constraints) ((constraints)->hierarchy.open_close_button)
0191 #define XmHierarchyC_children(constraints) ((constraints)->hierarchy.children)
0192 #define XmHierarchyC_num_children(constraints) ((constraints)->hierarchy.num_children)
0193 #define XmHierarchyC_alloc_attrs(constraints) ((constraints)->hierarchy.alloc_attrs)
0194 #define XmHierarchyC_alloc(constraints) ((constraints)->hierarchy.alloc)
0195 #define XmHierarchyC_status(constraints) ((constraints)->hierarchy.status)
0196 
0197 #define XtInheritChangeNodeState       ((XmHierarchyNodeProc)_XtInherit)
0198 #define XtInheritUnmapAllExtraNodes    ((XmHierarchyExtraNodeProc)_XtInherit)
0199 #define XtInheritUnmapNode         ((XmHierarchyNodeProc)_XtInherit)
0200 #define XtInheritMapNode           ((XmHierarchyNodeProc)_XtInherit)
0201 #define XtInheritBuildNodeTable        ((XmHierarchyBuildTableProc)_XtInherit)
0202 #define XtInheritResetOpenCloseButton  ((XmHierarchyResetButtonProc)_XtInherit)
0203 #define XtInheritToggleNodeState       ((XtCallbackProc)_XtInherit)
0204 
0205 /************************************************************
0206 *   EXTERNAL DECLARATIONS
0207 *************************************************************/
0208 
0209 
0210 /************************************************************
0211 *   STATIC DECLARATIONS
0212 *************************************************************/
0213 
0214 #ifdef __cplusplus
0215 }   /* Closes scope of 'extern "C"' declaration */
0216 #endif
0217 
0218 #if defined(VMS) || defined(__VMS)
0219 #include <X11/apienvrst.h>
0220 #endif
0221 
0222 #endif /* _HierarchyP_h */