FormP.h revision 749
70N/A/* $XConsortium: FormP.h,v 1.22 94/04/17 20:12:09 kaleb Exp $ */
70N/A
1104N/A/***********************************************************
70N/A
70N/ACopyright (c) 1987, 1988, 1994 X Consortium
919N/A
919N/APermission is hereby granted, free of charge, to any person obtaining a copy
919N/Aof this software and associated documentation files (the "Software"), to deal
919N/Ain the Software without restriction, including without limitation the rights
919N/Ato use, copy, modify, merge, publish, distribute, sublicense, and/or sell
919N/Acopies of the Software, and to permit persons to whom the Software is
919N/Afurnished to do so, subject to the following conditions:
919N/A
919N/AThe above copyright notice and this permission notice shall be included in
919N/Aall copies or substantial portions of the Software.
919N/A
919N/ATHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/AIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/AFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
919N/AX CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
919N/AAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
919N/ACONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
70N/A
70N/AExcept as contained in this notice, the name of the X Consortium shall not be
70N/Aused in advertising or otherwise to promote the sale, use or other dealings
70N/Ain this Software without prior written authorization from the X Consortium.
851N/A
851N/A
851N/ACopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
851N/A
851N/A All Rights Reserved
98N/A
551N/APermission to use, copy, modify, and distribute this software and its
321N/Adocumentation for any purpose and without fee is hereby granted,
321N/Aprovided that the above copyright notice appear in all copies and that
550N/Aboth that copyright notice and this permission notice appear in
550N/Asupporting documentation, and that the name of Digital not be
213N/Aused in advertising or publicity pertaining to distribution of the
649N/Asoftware without specific, written prior permission.
304N/A
530N/ADIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
425N/AALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
425N/ADIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
325N/AANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
493N/AWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
536N/AARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
456N/ASOFTWARE.
320N/A
332N/A******************************************************************/
501N/A
231N/A/* Form widget private definitions */
550N/A
347N/A#ifndef _XawFormP_h
532N/A#define _XawFormP_h
463N/A
493N/A#include <X11/Xaw/Form.h>
425N/A
493N/A#define XtREdgeType "EdgeType"
791N/A
472N/Atypedef enum {LayoutPending, LayoutInProgress, LayoutDone} LayoutState;
324N/A#define XtInheritLayout ((Boolean (*)())_XtInherit)
347N/A
310N/Atypedef struct {
316N/A Boolean (*layout)(/* FormWidget, Dimension, Dimension */);
474N/A} FormClassPart;
290N/A
332N/A/*
464N/A * Layout(
332N/A * FormWidget w - the widget whose children are to be configured
509N/A * Dimension w, h - bounding box of layout to be calculated
835N/A *
835N/A * Stores preferred geometry in w->form.preferred_{width,height}.
332N/A * If w->form.resize_in_layout is True, then a geometry request
210N/A * may be made for the preferred bounding box if necessary.
493N/A *
792N/A * Returns True if a geometry request was granted, False otherwise.
128N/A */
414N/A
484N/Atypedef struct _FormClassRec {
326N/A CoreClassPart core_class;
493N/A CompositeClassPart composite_class;
335N/A ConstraintClassPart constraint_class;
493N/A FormClassPart form_class;
493N/A} FormClassRec;
729N/A
425N/Aextern FormClassRec formClassRec;
370N/A
70N/Atypedef struct _FormPart {
400N/A /* resources */
294N/A int default_spacing; /* default distance between children */
435N/A /* private state */
800N/A Dimension old_width, old_height; /* last known dimensions */
98N/A int no_refigure; /* no re-layout while > 0 */
434N/A Boolean needs_relayout; /* next time no_refigure == 0 */
505N/A Boolean resize_in_layout; /* should layout() do geom request? */
277N/A Dimension preferred_width, preferred_height; /* cached from layout */
433N/A Boolean resize_is_no_op; /* Causes resize to take not action. */
546N/A} FormPart;
356N/A
289N/Atypedef struct _FormRec {
326N/A CorePart core;
439N/A CompositePart composite;
501N/A ConstraintPart constraint;
469N/A FormPart form;
290N/A} FormRec;
542N/A
424N/Atypedef struct _FormConstraintsPart {
286N/A/*
90N/A * Constraint Resources.
475N/A */
295N/A XtEdgeType top, bottom, /* where to drag edge on resize */
70N/A left, right;
299N/A int dx; /* desired horiz offset */
262N/A int dy; /* desired vertical offset */
539N/A Widget horiz_base; /* measure dx from here if non-null */
277N/A Widget vert_base; /* measure dy from here if non-null */
332N/A Boolean allow_resize; /* TRUE if child may request resize */
332N/A
493N/A/*
70N/A * Private contstraint resources.
70N/A */
319N/A
280N/A/*
319N/A * What the size of this child would be if we did not impose the
70N/A * constraint the width and height must be greater than zero (0).
1117N/A */
1117N/A short virtual_width, virtual_height;
98N/A
414N/A/*
98N/A * Temporary Storage for children's new possible possition.
744N/A */
1104N/A
744N/A Position new_x, new_y;
763N/A
1122N/A LayoutState layout_state; /* temporary layout state */
763N/A Boolean deferred_resize; /* was resized while no_refigure is set */
763N/A} FormConstraintsPart;
744N/A
493N/Atypedef struct _FormConstraintsRec {
967N/A FormConstraintsPart form;
70N/A} FormConstraintsRec, *FormConstraints;
493N/A
493N/A#endif /* _XawFormP_h */
967N/A