16c321187Smrg/*
26c321187Smrg
36c321187SmrgCopyright 1990, 1998  The Open Group
46c321187Smrg
56c321187SmrgPermission to use, copy, modify, distribute, and sell this software and its
66c321187Smrgdocumentation for any purpose is hereby granted without fee, provided that
76c321187Smrgthe above copyright notice appear in all copies and that both that
86c321187Smrgcopyright notice and this permission notice appear in supporting
96c321187Smrgdocumentation.
106c321187Smrg
116c321187SmrgThe above copyright notice and this permission notice shall be included in
126c321187Smrgall copies or substantial portions of the Software.
136c321187Smrg
146c321187SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
156c321187SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
166c321187SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
176c321187SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
186c321187SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
196c321187SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
206c321187Smrg
216c321187SmrgExcept as contained in this notice, the name of The Open Group shall not be
226c321187Smrgused in advertising or otherwise to promote the sale, use or other dealings
236c321187Smrgin this Software without prior written authorization from The Open Group.
246c321187Smrg
256c321187Smrg*/
266c321187Smrg
276c321187Smrg/*
286c321187Smrg * Author:  Jim Fulton, MIT X Consortium
296c321187Smrg */
306c321187Smrg
316c321187Smrg#ifndef _XmuWidgetNode_h
326c321187Smrg#define _XmuWidgetNode_h
336c321187Smrg
346c321187Smrg#include <X11/Intrinsic.h>
356c321187Smrg#include <X11/Xfuncproto.h>
366c321187Smrg
376c321187Smrg/*
386c321187Smrg * This is usually initialized by setting the first two fields and letting
396c321187Smrg * rest be implicitly nulled (by genlist.sh, for example)
406c321187Smrg */
416c321187Smrgtypedef struct _XmuWidgetNode {
426c321187Smrg    char *label;			/* mixed case name */
436c321187Smrg    WidgetClass *widget_class_ptr;	/* addr of widget class */
446c321187Smrg    struct _XmuWidgetNode *superclass;	/* superclass of widget_class */
456c321187Smrg    struct _XmuWidgetNode *children, *siblings;	/* subclass links */
466c321187Smrg    char *lowered_label;		/* lowercase version of label */
476c321187Smrg    char *lowered_classname;		/* lowercase version of class_name */
486c321187Smrg    Bool have_resources;		/* resources have been fetched */
496c321187Smrg    XtResourceList resources;		/* extracted resource database */
506c321187Smrg    struct _XmuWidgetNode **resourcewn;	/* where resources come from */
516c321187Smrg    Cardinal nresources;		/* number of resources */
526c321187Smrg    XtResourceList constraints;		/* extracted constraint resources */
536c321187Smrg    struct _XmuWidgetNode **constraintwn;  /* where constraints come from */
546c321187Smrg    Cardinal nconstraints;		/* number of constraint resources */
556c321187Smrg    XtPointer data;			/* extra data */
566c321187Smrg} XmuWidgetNode;
576c321187Smrg
586c321187Smrg#define XmuWnClass(wn) ((wn)->widget_class_ptr[0])
596c321187Smrg#define XmuWnClassname(wn) (XmuWnClass(wn)->core_class.class_name)
606c321187Smrg#define XmuWnSuperclass(wn) ((XmuWnClass(wn))->core_class.superclass)
616c321187Smrg
626c321187Smrg					/* external interfaces */
636c321187Smrg_XFUNCPROTOBEGIN
646c321187Smrg
656c321187Smrgvoid XmuWnInitializeNodes
666c321187Smrg(
676c321187Smrg XmuWidgetNode		*nodearray,
686c321187Smrg int			nnodes
696c321187Smrg );
706c321187Smrg
716c321187Smrgvoid XmuWnFetchResources
726c321187Smrg(
736c321187Smrg XmuWidgetNode		*node,
746c321187Smrg Widget			toplevel,
756c321187Smrg XmuWidgetNode		*topnode
766c321187Smrg );
776c321187Smrg
786c321187Smrgint XmuWnCountOwnedResources
796c321187Smrg(
806c321187Smrg XmuWidgetNode		*node,
816c321187Smrg XmuWidgetNode		*ownernode,
826c321187Smrg Bool			constraints
836c321187Smrg );
846c321187Smrg
856c321187SmrgXmuWidgetNode *XmuWnNameToNode
866c321187Smrg(
876c321187Smrg XmuWidgetNode		*nodelist,
886c321187Smrg int			nnodes,
896c321187Smrg _Xconst char		*name
906c321187Smrg );
916c321187Smrg
926c321187Smrg_XFUNCPROTOEND
936c321187Smrg
946c321187Smrg#endif /* _XmuWidgetNode_h */
956c321187Smrg
96