PanedP.h revision 7a84e134
1/***********************************************************
2
3  $Xorg: PanedP.h,v 1.4 2001/02/09 02:03:45 xorgcvs Exp $
4
5
6Copyright 1987, 1988, 1998  The Open Group
7
8Permission to use, copy, modify, distribute, and sell this software and its
9documentation for any purpose is hereby granted without fee, provided that
10the above copyright notice appear in all copies and that both that
11copyright notice and this permission notice appear in supporting
12documentation.
13
14The above copyright notice and this permission notice shall be included in
15all copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
20OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24Except as contained in this notice, the name of The Open Group shall not be
25used in advertising or otherwise to promote the sale, use or other dealings
26in this Software without prior written authorization from The Open Group.
27
28
29Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
30
31                        All Rights Reserved
32
33Permission to use, copy, modify, and distribute this software and its
34documentation for any purpose and without fee is hereby granted,
35provided that the above copyright notice appear in all copies and that
36both that copyright notice and this permission notice appear in
37supporting documentation, and that the name of Digital not be
38used in advertising or publicity pertaining to distribution of the
39software without specific, written prior permission.
40
41DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
42ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
43DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
44ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
45WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
46ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
47SOFTWARE.
48
49******************************************************************/
50/* $XFree86: xc/lib/Xaw/PanedP.h,v 1.7 2001/01/17 19:42:28 dawes Exp $ */
51
52/*
53 * Updated and significantly modified from the Athena VPaned Widget.
54 *
55 * Date:    March 1, 1989
56 *
57 * By:      Chris D. Peterson
58 *          MIT X Consortium
59 *          kit@expo.lcs.mit.edu
60 */
61
62#ifndef _XawPanedP_h
63#define _XawPanedP_h
64
65#include <X11/Xaw/Paned.h>
66
67/* New fields for the Paned widget class record */
68typedef struct _PanedClassPart {
69    XtPointer extension;
70} PanedClassPart;
71
72/* Full Class record declaration */
73typedef struct _PanedClassRec {
74    CoreClassPart       core_class;
75    CompositeClassPart  composite_class;
76    ConstraintClassPart constraint_class;
77    PanedClassPart      paned_class;
78} PanedClassRec;
79
80extern PanedClassRec panedClassRec;
81
82/* Paned constraint record */
83typedef struct _PanedConstraintsPart {
84    /* Resources */
85    Dimension	min;		/* Minimum height */
86    Dimension	max;		/* Maximum height */
87    Boolean	allow_resize;	/* True if child resize requests are ok */
88    Boolean	show_grip;	/* True if child will have grip below it,
89				   when it is not the bottom pane */
90    Boolean skip_adjust;	/* True if child's height should not be
91				   changed without explicit user action */
92    int		position;	/* position location in Paned (relative to
93				   other children) ** NIY ** */
94    Dimension   preferred_size;	/* The Preferred size of the pane.
95				   If this is zero then ask child for size*/
96    Boolean     resize_to_pref;	/* resize this pane to its preferred size
97				   on a resize or change managed after
98				   realize */
99
100    /* Private state */
101    Position	delta;		/* Desired Location */
102    Position	olddelta;	/* The last value of dy */
103    Boolean     paned_adjusted_me; /* Has the vpaned adjusted this widget w/o
104				     user interaction to make things fit? */
105    Dimension	wp_size;	/* widget's preferred size */
106    int size;			/* the size the widget will actually get */
107    Widget	grip;		/* The grip for this child */
108} PanedConstraintsPart, *Pane;
109
110typedef struct _PanedConstraintsRec {
111    PanedConstraintsPart paned;
112} PanedConstraintsRec, *PanedConstraints;
113
114/*
115 * The Pane Stack Structure
116 */
117typedef struct _PaneStack {
118    struct _PaneStack *next;	/* The next element on the stack */
119    Pane pane;			/* The pane in this element on the stack */
120    int start_size;		/* The size of this element when it
121				   was pushed onto the stack */
122} PaneStack;
123
124/* New Fields for the Paned widget record */
125typedef struct {
126    /* resources */
127    Position    grip_indent;               /* Location of grips (offset
128					      from right margin) */
129    Boolean     refiguremode;              /* Whether to refigure changes
130					      right now */
131    XtTranslations grip_translations;      /* grip translation table */
132    Pixel	internal_bp;		/* color of internal borders */
133    Dimension	internal_bw;		/* internal border width */
134    XtOrientation orientation;		/* Orientation of paned widget */
135
136    Cursor	cursor;		           /* Cursor for paned window */
137    Cursor	grip_cursor;               /* inactive grip cursor */
138    Cursor	v_grip_cursor;             /* inactive vert grip cursor */
139    Cursor	h_grip_cursor;             /* inactive horiz grip cursor */
140    Cursor	adjust_this_cursor;        /* active grip cursor: T */
141    Cursor	v_adjust_this_cursor;      /* active vert grip cursor: T */
142    Cursor	h_adjust_this_cursor;      /* active horiz grip cursor: T */
143
144    /* vertical */
145    Cursor	adjust_upper_cursor;      /* active grip cursor: U */
146    Cursor	adjust_lower_cursor;      /* active grip cursor: D */
147
148    /* horizontal */
149    Cursor	adjust_left_cursor;        /* active grip cursor: U */
150    Cursor	adjust_right_cursor;       /* active grip cursor: D */
151
152    /* private */
153    Boolean	recursively_called;        /* for ChangeManaged */
154    Boolean	resize_children_to_pref;   /* override constrain resources
155					      and resize all children to
156					   preferred size */
157    int         start_loc;	           /* mouse origin when adjusting */
158    Widget      whichadd;                  /* Which pane to add changes to */
159    Widget      whichsub;                  /* Which pane to sub changes from */
160    GC          normgc;                    /* GC to use when drawing borders */
161    GC          invgc;                     /* GC to use when erasing borders */
162    GC		flipgc;			   /* GC to use when animating borders */
163    int		num_panes;                 /* count of managed panes */
164    PaneStack	*stack;			   /* The pane stack for this widget */
165#ifndef OLDXAW
166    XtPointer pad[4];	/* for future use and keep binary compatability */
167#endif
168} PanedPart;
169
170/*
171 * Full instance record declaration
172 */
173typedef struct _PanedRec {
174    CorePart	   core;
175    CompositePart  composite;
176    ConstraintPart constraint;
177    PanedPart	   paned;
178} PanedRec;
179
180#endif /* _XawPanedP_h */
181