1 /* $XConsortium: FormP.h,v 1.17 89/07/21 01:51:27 kit Exp $ */
2 /* Copyright Massachusetts Institute of Technology 1987 */
5 /***********************************************************
6 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
7 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
11 Permission to use, copy, modify, and distribute this software and its
12 documentation for any purpose and without fee is hereby granted,
13 provided that the above copyright notice appear in all copies and that
14 both that copyright notice and this permission notice appear in
15 supporting documentation, and that the names of Digital or MIT not be
16 used in advertising or publicity pertaining to distribution of the
17 software without specific, written prior permission.
19 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
20 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
21 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
22 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
23 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
27 ******************************************************************/
29 /* Form widget private definitions */
34 #include <./Xaw3_1Form.h>
35 #include <X11/ConstrainP.h>
37 #define XtREdgeType "EdgeType"
39 typedef enum {LayoutPending
, LayoutInProgress
, LayoutDone
} LayoutState
;
40 #define XtInheritLayout ((Boolean (*)())_XtInherit)
43 Boolean (*layout
)(/* FormWidget, Dimension, Dimension */);
48 * FormWidget w - the widget whose children are to be configured
49 * Dimension w, h - bounding box of layout to be calculated
51 * Stores preferred geometry in w->form.preferred_{width,height}.
52 * If w->form.resize_in_layout is True, then a geometry request
53 * may be made for the preferred bounding box if necessary.
55 * Returns True if a geometry request was granted, False otherwise.
58 typedef struct _FormClassRec
{
59 CoreClassPart core_class
;
60 CompositeClassPart composite_class
;
61 ConstraintClassPart constraint_class
;
62 FormClassPart form_class
;
65 extern FormClassRec formClassRec
;
67 typedef struct _FormPart
{
69 int default_spacing
; /* default distance between children */
71 Dimension old_width
, old_height
; /* last known dimensions */
72 int no_refigure
; /* no re-layout while > 0 */
73 Boolean needs_relayout
; /* next time no_refigure == 0 */
74 Boolean resize_in_layout
; /* should layout() do geom request? */
75 Dimension preferred_width
, preferred_height
; /* cached from layout */
78 typedef struct _FormRec
{
80 CompositePart composite
;
81 ConstraintPart constraint
;
85 typedef struct _FormConstraintsPart
{
87 * Constraint Resources.
89 XtEdgeType top
, bottom
, /* where to drag edge on resize */
91 int dx
; /* desired horiz offset */
92 int dy
; /* desired vertical offset */
93 Widget horiz_base
; /* measure dx from here if non-null */
94 Widget vert_base
; /* measure dy from here if non-null */
95 Boolean allow_resize
; /* TRUE if child may request resize */
98 * Private contstraint resources.
101 int virtual_width
, virtual_height
;
104 * What the size of this child would be if we did not impose the
105 * constraint the width and height must be greater than zero (0).
108 LayoutState layout_state
; /* temporary layout state */
109 } FormConstraintsPart
;
111 typedef struct _FormConstraintsRec
{
112 FormConstraintsPart form
;
113 } FormConstraintsRec
, *FormConstraints
;
115 #endif /* _XawFormP_h */