1/***********************************************************
2Copyright (c) 1993, Oracle and/or its affiliates.
3
4Permission is hereby granted, free of charge, to any person obtaining a
5copy of this software and associated documentation files (the "Software"),
6to deal in the Software without restriction, including without limitation
7the rights to use, copy, modify, merge, publish, distribute, sublicense,
8and/or sell copies of the Software, and to permit persons to whom the
9Software is furnished to do so, subject to the following conditions:
10
11The above copyright notice and this permission notice (including the next
12paragraph) shall be included in all copies or substantial portions of the
13Software.
14
15THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21DEALINGS IN THE SOFTWARE.
22
23Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
24
25                        All Rights Reserved
26
27Permission to use, copy, modify, and distribute this software and its
28documentation for any purpose and without fee is hereby granted,
29provided that the above copyright notice appear in all copies and that
30both that copyright notice and this permission notice appear in
31supporting documentation, and that the name of Digital not be
32used in advertising or publicity pertaining to distribution of the
33software without specific, written prior permission.
34
35DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
36ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
37DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
38ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
39WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
40ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
41SOFTWARE.
42
43******************************************************************/
44
45/*
46
47Copyright 1987, 1988, 1998  The Open Group
48
49Permission to use, copy, modify, distribute, and sell this software and its
50documentation for any purpose is hereby granted without fee, provided that
51the above copyright notice appear in all copies and that both that
52copyright notice and this permission notice appear in supporting
53documentation.
54
55The above copyright notice and this permission notice shall be included in
56all copies or substantial portions of the Software.
57
58THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
59IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
61OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
62AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
63CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
64
65Except as contained in this notice, the name of The Open Group shall not be
66used in advertising or otherwise to promote the sale, use or other dealings
67in this Software without prior written authorization from The Open Group.
68
69*/
70
71#ifdef HAVE_CONFIG_H
72#include <config.h>
73#endif
74#include "IntrinsicI.h"
75#include "StringDefs.h"
76
77static void ConstraintPartInitialize(WidgetClass wc);
78
79externaldef(constraintclassrec)
80ConstraintClassRec constraintClassRec = {
81    {
82    /******* CorePart *******/
83     /* superclass           */ (WidgetClass) &compositeClassRec,
84     /* class_name           */ "Constraint",
85     /* widget_size          */ sizeof(ConstraintRec),
86     /* class_initialize     */ NULL,
87     /* class_part_initialize */ ConstraintPartInitialize,
88     /* class_inited         */ FALSE,
89     /* initialize           */ NULL,
90     /* initialize_hook      */ NULL,
91     /* realize              */ XtInheritRealize,
92     /* actions              */ NULL,
93     /* num_actions          */ 0,
94     /* resources            */ NULL,
95     /* num_resources        */ 0,
96     /* xrm_class            */ NULLQUARK,
97     /* compress_motion      */ FALSE,
98     /* compress_exposure    */ TRUE,
99     /* compress_enterleave  */ FALSE,
100     /* visible_interest     */ FALSE,
101     /* destroy              */ NULL,
102     /* resize               */ NULL,
103     /* expose               */ NULL,
104     /* set_values           */ NULL,
105     /* set_values_hook      */ NULL,
106     /* set_values_almost    */ XtInheritSetValuesAlmost,
107     /* get_values_hook      */ NULL,
108     /* accept_focus         */ NULL,
109     /* version              */ XtVersion,
110     /* callback_offsets     */ NULL,
111     /* tm_table             */ NULL,
112     /* query_geometry       */ NULL,
113     /* display_accelerator  */ NULL,
114     /* extension            */ NULL
115     }
116    , {
117      /**** CompositePart *****/
118       /* geometry_handler     */ NULL,
119       /* change_managed       */ NULL,
120       /* insert_child         */ XtInheritInsertChild,
121       /* delete_child         */ XtInheritDeleteChild,
122       /* extension            */ NULL
123       }
124    , {
125      /**** ConstraintPart ****/
126       /* resources            */ NULL,
127       /* num_resources        */ 0,
128       /* constraint_size      */ 0,
129       /* initialize           */ NULL,
130       /* destroy              */ NULL,
131       /* set_values           */ NULL,
132       /* extension            */ NULL
133       }
134};
135
136externaldef(constraintwidgetclass)
137WidgetClass constraintWidgetClass = (WidgetClass) &constraintClassRec;
138
139static void
140ConstraintPartInitialize(WidgetClass wc)
141{
142    ConstraintWidgetClass cwc = (ConstraintWidgetClass) wc;
143
144    if (cwc->constraint_class.resources)
145        _XtCompileResourceList(cwc->constraint_class.resources,
146                               cwc->constraint_class.num_resources);
147
148    _XtConstraintResDependencies((ConstraintWidgetClass) wc);
149}
150