Back to home page

EIC code displayed by LXR

 
 

    


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

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 _XmPanedP_h
0026 #define _XmPanedP_h
0027 
0028 #if defined(VMS) || defined(__VMS)
0029 #include <X11/apienvset.h>
0030 #endif
0031 
0032 #include <Xm/ManagerP.h>
0033 #include <Xm/Paned.h>
0034 
0035 #ifdef __cplusplus
0036 extern "C" {
0037 #endif
0038 
0039 /*********************************************************************
0040  *
0041  * Paned Widget Private Data
0042  *
0043  *********************************************************************/
0044 
0045 /* New fields for the Paned widget class record */
0046 
0047 typedef struct _XmPanedClassPart {
0048     XtPointer extension;    
0049 } XmPanedClassPart;
0050 
0051 /* Full Class record declaration */
0052 typedef struct _XmPanedClassRec {
0053     CoreClassPart       core_class;
0054     CompositeClassPart  composite_class;
0055     ConstraintClassPart constraint_class;
0056     XmManagerClassPart  manager_class;
0057     XmPanedClassPart     paned_class;
0058 } XmPanedClassRec;
0059 
0060 extern XmPanedClassRec xmPanedClassRec;
0061 
0062 /* Paned constraint record */
0063 typedef struct _XmPanedConstraintsPart {
0064   /* Resources. */
0065     Dimension   min;        /* Minimum height */
0066     Dimension   max;        /* Maximum height */
0067     Boolean allow_resize;   /* TRUE iff child resize requests are ok */
0068     Boolean     show_sash;  /* TRUE iff child will have sash below it,
0069                    when it is not the bottom pane. */
0070     Boolean skip_adjust;    /* TRUE iff child's height should not be */
0071                 /* changed without explicit user action. */
0072     int     position;   /* position location in Paned (relative to
0073                    other children) ** NIY ** */
0074     Dimension   preferred_size; /* The Preferred size of the pane.
0075                    Iff this is zero then ask child for size.*/
0076     Boolean     resize_to_pref; /* resize this pane to its preferred size
0077                    on a resize or change managed after 
0078                    realize. */
0079     Boolean     is_a_pane;  /* INTERNAL INFO */
0080 
0081 
0082   /* Private state. */
0083     Position    delta;      /* Desired Location */
0084     Position    olddelta;   /* The last value of delta. */
0085     Dimension   wp_size;    /* widget's preferred on size */ 
0086     Dimension   wp_off_size;    /* widget's preferred off size */ 
0087     int         size;       /* the size the widget will actually get. */
0088     Widget  sash;       /* The sash for this child */
0089     Widget      separator;      /* The separator for this child */
0090 
0091     Boolean     prefs_inited;   /* Preferences have been inited... */
0092 } XmPanedConstraintsPart, *Pane;
0093 
0094 typedef struct _XmPanedConstraintsRec {
0095     XmManagerConstraintPart manager;
0096     XmPanedConstraintsPart  paned;
0097 } XmPanedConstraintsRec, *XmPanedConstraints;
0098 
0099 /*
0100  * Ugliness:  the XmOffset macros require this naming convention, yet
0101  * epak already depends on the pluralized name ;(
0102  */
0103 typedef XmPanedConstraintsPart XmPanedConstraintPart;
0104 
0105 /*
0106  * The Pane Stack Structure.
0107  */
0108 
0109 typedef struct _PaneStack {
0110     struct _PaneStack * next;   /* The next element on the stack. */
0111     Pane pane;          /* The pane in this element on the stack. */
0112     int start_size;     /* The size of this element when it was pushed
0113                    onto the stack. */
0114 } PaneStack;
0115 
0116 #define NO_ADJUST    ((char) 0)
0117 #define BEGAN_ADJUST ((char) 1)
0118 
0119 /* New Fields for the XmPaned widget record */
0120 typedef struct {
0121     /* resources */
0122     Position    sash_indent;               /* Location of sashs (per motif) */
0123     Boolean     refiguremode;              /* Whether to refigure changes 
0124                           right now */
0125     XtTranslations sash_translations;      /* sash translation table */
0126     Dimension   internal_bw;               /* internal border width. */
0127     unsigned char orientation;             /* Orientation of paned widget. */
0128 
0129     Cursor  cursor;     /* Cursor for paned window */
0130 
0131     /* Things from Motif behaviour */
0132     Boolean     separator_on;        /* make separator visible */
0133     Dimension   margin_width;        /* space between right and left edges of
0134                                         Paned window and it's children */
0135     Dimension   margin_height;       /* space between top and bottom edges of
0136                                         Paned window and it's children */
0137 
0138     /* sash modifying resources */
0139     Dimension   sash_width;            /* Modify sash width */
0140     Dimension   sash_height;           /* Modify sash height */
0141     Dimension   sash_shadow_thickness; /* Modify sash shadow_thickness */
0142 
0143     /* Private */
0144     Boolean recursively_called;        /* for ChangeManaged */
0145     Boolean resize_children_to_pref;   /* override constraint resources
0146                           and resize all children to
0147                           preferred size. */
0148     short       increment_count;           /* Sash increment count */
0149     char    repane_status;         /* current adjust state. */
0150     Position    start_loc;             /* mouse origin when adjusting */
0151     GC          flipgc;                    /* GC to use when animating
0152                           borders */
0153     short   num_panes;                 /* count of managed panes */
0154     short       num_slots;                 /*number of avail. slots for kids */
0155 
0156     PaneStack * stack;                 /* The pane stack for this widget.*/
0157     WidgetList  managed_children;      /* keep track of managed children */
0158  
0159     Boolean     allow_unused_space;      /* should the paned widget allow
0160                                           * a pane to be shrunk to the point
0161                                           * that there is unused space at
0162                                           * the bottom/right of the widget */
0163 } XmPanedPart;
0164 
0165 /**************************************************************************
0166  *
0167  * Full instance record declaration
0168  *
0169  **************************************************************************/
0170 
0171 typedef struct _XmPanedRec {
0172     CorePart       core;
0173     CompositePart  composite;
0174     ConstraintPart constraint;
0175     XmManagerPart  manager;
0176     XmPanedPart     paned;
0177 } XmPanedRec;
0178 
0179 /************************************************************
0180  *
0181  *  Functions
0182  *
0183  ************************************************************/
0184 void _XmFromPanedPixels(Widget, int, XtArgVal *);
0185 XmImportOperator _XmToPanedPixels(Widget, int, XtArgVal *);
0186 
0187 
0188 /************************************************************
0189  *
0190  *  Macros
0191  *
0192  ************************************************************/
0193 /*
0194  * XmResolvePartOffsets stuff follows
0195  */
0196 
0197 #define XmPaned_sash_indent(w) (((XmPanedWidget)(w))->paned.sash_indent)
0198 #define XmPaned_refiguremode(w) (((XmPanedWidget)(w))->paned.refiguremode)
0199 #define XmPaned_sash_translations(w) (((XmPanedWidget)(w))->paned.sash_translations)
0200 #define XmPaned_internal_bw(w) (((XmPanedWidget)(w))->paned.internal_bw)
0201 #define XmPaned_orientation(w) (((XmPanedWidget)(w))->paned.orientation)
0202 #define XmPaned_cursor(w) (((XmPanedWidget)(w))->paned.cursor)
0203 #define XmPaned_separator_on(w) (((XmPanedWidget)(w))->paned.separator_on)
0204 #define XmPaned_margin_width(w) (((XmPanedWidget)(w))->paned.margin_width)
0205 #define XmPaned_margin_height(w) (((XmPanedWidget)(w))->paned.margin_height)
0206 #define XmPaned_sash_width(w) (((XmPanedWidget)(w))->paned.sash_width)
0207 #define XmPaned_sash_height(w) (((XmPanedWidget)(w))->paned.sash_height)
0208 #define XmPaned_sash_shadow_thickness(w) (((XmPanedWidget)(w))->paned.sash_shadow_thickness)
0209 #define XmPaned_recursively_called(w) (((XmPanedWidget)(w))->paned.recursively_called)
0210 #define XmPaned_resize_children_to_pref(w) (((XmPanedWidget)(w))->paned.resize_children_to_pref)
0211 #define XmPaned_increment_count(w) (((XmPanedWidget)(w))->paned.increment_count)
0212 #define XmPaned_repane_status(w) (((XmPanedWidget)(w))->paned.repane_status)
0213 #define XmPaned_start_loc(w) (((XmPanedWidget)(w))->paned.start_loc)
0214 #define XmPaned_flipgc(w) (((XmPanedWidget)(w))->paned.flipgc)
0215 #define XmPaned_num_panes(w) (((XmPanedWidget)(w))->paned.num_panes)
0216 #define XmPaned_num_slots(w) (((XmPanedWidget)(w))->paned.num_slots)
0217 #define XmPaned_stack(w) (((XmPanedWidget)(w))->paned.stack)
0218 #define XmPaned_managed_children(w) (((XmPanedWidget)(w))->paned.managed_children)
0219 #define XmPaned_allow_unused_space(w) (((XmPanedWidget)(w))->paned.allow_unused_space)
0220 
0221 #define XmPanedC_min(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.min)
0222 #define XmPanedC_max(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.max)
0223 #define XmPanedC_allow_resize(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.allow_resize)
0224 #define XmPanedC_show_sash(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.show_sash)
0225 #define XmPanedC_skip_adjust(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.skip_adjust)
0226 #define XmPanedC_position(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.position)
0227 #define XmPanedC_preferred_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.preferred_size)
0228 #define XmPanedC_resize_to_pref(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.resize_to_pref)
0229 #define XmPanedC_is_a_pane(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.is_a_pane)
0230 #define XmPanedC_delta(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.delta)
0231 #define XmPanedC_olddelta(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.olddelta)
0232 #define XmPanedC_wp_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.wp_size)
0233 #define XmPanedC_wp_off_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.wp_off_size)
0234 #define XmPanedC_size(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.size)
0235 #define XmPanedC_sash(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.sash)
0236 #define XmPanedC_separator(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.separator)
0237 #define XmPanedC_prefs_inited(w) (((XmPanedConstraintsRec*)(w)->core.constraints)->paned.prefs_inited)
0238 
0239 #define ForceSashOff(pane) ((pane)->min == (pane)->max)
0240 #define PaneConsRec(w)  ((XmPanedConstraints)(w)->core.constraints)
0241 #define PaneInfo(w) (&(((XmPanedConstraintsRec*)((w)->core.constraints))->paned))
0242 #define HasSash(w)  (XmPanedC_sash(w) != NULL)
0243 #define HasSep(w)   (XmPanedC_separator(w) != NULL)
0244 
0245 #define PaneIndex(w)    (XmPanedC_position(w))
0246 #define IsVert(w)       (XmPaned_orientation(w) == XmVERTICAL)
0247 
0248 #define IsLastPane(pw, childP) ((XmPaned_managed_children((pw)) + \
0249                  XmPaned_num_panes((pw)) - 1) == childP)
0250 
0251 #define ForAllPaned(pw, childP) \
0252   for ( ((childP) = (XmPaned_managed_children((pw)))) ; \
0253     ((childP) < ((XmPaned_managed_children((pw))) \
0254                     + (XmPaned_num_panes((pw))))) ; \
0255     (childP)++ )
0256 
0257 #define NthPane(pw, paneIndex) (XmPaned_managed_children((pw)) + (paneIndex))
0258 
0259 #ifdef _cplusplus
0260 }   /* Closes scope of 'extern "C"' declaration */
0261 #endif
0262 
0263 #if defined(VMS) || defined(__VMS)
0264 #include <X11/apienvrst.h>
0265 #endif
0266 
0267 #endif /* _XmPanedP_h */
0268 /* DON'T ADD STUFF AFTER THIS #endif */