ObjectP.h revision 444c061a
1444c061aSmrg/* $Xorg: ObjectP.h,v 1.4 2001/02/09 02:03:56 xorgcvs Exp $ */
2444c061aSmrg
3444c061aSmrg/***********************************************************
4444c061aSmrg
5444c061aSmrgCopyright 1987, 1988, 1994, 1998  The Open Group
6444c061aSmrg
7444c061aSmrgPermission to use, copy, modify, distribute, and sell this software and its
8444c061aSmrgdocumentation for any purpose is hereby granted without fee, provided that
9444c061aSmrgthe above copyright notice appear in all copies and that both that
10444c061aSmrgcopyright notice and this permission notice appear in supporting
11444c061aSmrgdocumentation.
12444c061aSmrg
13444c061aSmrgThe above copyright notice and this permission notice shall be included in
14444c061aSmrgall copies or substantial portions of the Software.
15444c061aSmrg
16444c061aSmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17444c061aSmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18444c061aSmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
19444c061aSmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20444c061aSmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21444c061aSmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22444c061aSmrg
23444c061aSmrgExcept as contained in this notice, the name of The Open Group shall not be
24444c061aSmrgused in advertising or otherwise to promote the sale, use or other dealings
25444c061aSmrgin this Software without prior written authorization from The Open Group.
26444c061aSmrg
27444c061aSmrg
28444c061aSmrgCopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
29444c061aSmrg
30444c061aSmrg                        All Rights Reserved
31444c061aSmrg
32444c061aSmrgPermission to use, copy, modify, and distribute this software and its
33444c061aSmrgdocumentation for any purpose and without fee is hereby granted,
34444c061aSmrgprovided that the above copyright notice appear in all copies and that
35444c061aSmrgboth that copyright notice and this permission notice appear in
36444c061aSmrgsupporting documentation, and that the name of Digital not be
37444c061aSmrgused in advertising or publicity pertaining to distribution of the
38444c061aSmrgsoftware without specific, written prior permission.
39444c061aSmrg
40444c061aSmrgDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
41444c061aSmrgALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
42444c061aSmrgDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
43444c061aSmrgANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
44444c061aSmrgWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45444c061aSmrgARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
46444c061aSmrgSOFTWARE.
47444c061aSmrg
48444c061aSmrg******************************************************************/
49444c061aSmrg
50444c061aSmrg#ifndef _Xt_ObjectP_h_
51444c061aSmrg#define _Xt_ObjectP_h_
52444c061aSmrg
53444c061aSmrg#include <X11/Object.h>
54444c061aSmrg
55444c061aSmrg/**********************************************************
56444c061aSmrg * Object Instance Data Structures
57444c061aSmrg *
58444c061aSmrg **********************************************************/
59444c061aSmrg/* these fields match CorePart and can not be changed */
60444c061aSmrg
61444c061aSmrgtypedef struct _ObjectPart {
62444c061aSmrg    Widget          self;               /* pointer to widget itself          */
63444c061aSmrg    WidgetClass     widget_class;       /* pointer to Widget's ClassRec      */
64444c061aSmrg    Widget          parent;             /* parent widget                     */
65444c061aSmrg    XrmName         xrm_name;           /* widget resource name quarkified   */
66444c061aSmrg    Boolean         being_destroyed;    /* marked for destroy                */
67444c061aSmrg    XtCallbackList  destroy_callbacks;  /* who to call when widget destroyed */
68444c061aSmrg    XtPointer       constraints;        /* constraint record                 */
69444c061aSmrg} ObjectPart;
70444c061aSmrg
71444c061aSmrgtypedef struct _ObjectRec {
72444c061aSmrg    ObjectPart  object;
73444c061aSmrg} ObjectRec;
74444c061aSmrg
75444c061aSmrg/********************************************************
76444c061aSmrg * Object Class Data Structures
77444c061aSmrg *
78444c061aSmrg ********************************************************/
79444c061aSmrg/* these fields match CoreClassPart and can not be changed */
80444c061aSmrg/* ideally these structures would only contain the fields required;
81444c061aSmrg   but because the CoreClassPart cannot be changed at this late date
82444c061aSmrg   extraneous fields are necessary to make the field offsets match */
83444c061aSmrg
84444c061aSmrgtypedef struct _ObjectClassPart {
85444c061aSmrg
86444c061aSmrg    WidgetClass     superclass;         /* pointer to superclass ClassRec   */
87444c061aSmrg    String          class_name;         /* widget resource class name       */
88444c061aSmrg    Cardinal        widget_size;        /* size in bytes of widget record   */
89444c061aSmrg    XtProc          class_initialize;   /* class initialization proc        */
90444c061aSmrg    XtWidgetClassProc class_part_initialize; /* dynamic initialization      */
91444c061aSmrg    XtEnum          class_inited;       /* has class been initialized?      */
92444c061aSmrg    XtInitProc      initialize;         /* initialize subclass fields       */
93444c061aSmrg    XtArgsProc      initialize_hook;    /* notify that initialize called    */
94444c061aSmrg    XtProc          obj1;		/* NULL                             */
95444c061aSmrg    XtPointer       obj2;               /* NULL                             */
96444c061aSmrg    Cardinal        obj3;               /* NULL                             */
97444c061aSmrg    XtResourceList  resources;          /* resources for subclass fields    */
98444c061aSmrg    Cardinal        num_resources;      /* number of entries in resources   */
99444c061aSmrg    XrmClass        xrm_class;          /* resource class quarkified        */
100444c061aSmrg    Boolean         obj4;               /* NULL                             */
101444c061aSmrg    XtEnum          obj5;               /* NULL                             */
102444c061aSmrg    Boolean         obj6;               /* NULL				    */
103444c061aSmrg    Boolean         obj7;               /* NULL                             */
104444c061aSmrg    XtWidgetProc    destroy;            /* free data for subclass pointers  */
105444c061aSmrg    XtProc          obj8;               /* NULL                             */
106444c061aSmrg    XtProc          obj9;               /* NULL			            */
107444c061aSmrg    XtSetValuesFunc set_values;         /* set subclass resource values     */
108444c061aSmrg    XtArgsFunc      set_values_hook;    /* notify that set_values called    */
109444c061aSmrg    XtProc          obj10;              /* NULL                             */
110444c061aSmrg    XtArgsProc      get_values_hook;    /* notify that get_values called    */
111444c061aSmrg    XtProc          obj11;              /* NULL                             */
112444c061aSmrg    XtVersionType   version;            /* version of intrinsics used       */
113444c061aSmrg    XtPointer       callback_private;   /* list of callback offsets         */
114444c061aSmrg    String          obj12;              /* NULL                             */
115444c061aSmrg    XtProc          obj13;              /* NULL                             */
116444c061aSmrg    XtProc          obj14;              /* NULL                             */
117444c061aSmrg    XtPointer       extension;          /* pointer to extension record      */
118444c061aSmrg}ObjectClassPart;
119444c061aSmrg
120444c061aSmrgtypedef struct {
121444c061aSmrg    XtPointer next_extension;	/* 1st 4 required for all extension records */
122444c061aSmrg    XrmQuark record_type;	/* NULLQUARK; when on ObjectClassPart */
123444c061aSmrg    long version;		/* must be XtObjectExtensionVersion */
124444c061aSmrg    Cardinal record_size;	/* sizeof(ObjectClassExtensionRec) */
125444c061aSmrg    XtAllocateProc allocate;
126444c061aSmrg    XtDeallocateProc deallocate;
127444c061aSmrg} ObjectClassExtensionRec, *ObjectClassExtension;
128444c061aSmrg
129444c061aSmrgtypedef struct _ObjectClassRec {
130444c061aSmrg    ObjectClassPart object_class;
131444c061aSmrg} ObjectClassRec;
132444c061aSmrg
133444c061aSmrgexternalref ObjectClassRec objectClassRec;
134444c061aSmrg
135444c061aSmrg#define XtObjectExtensionVersion 1L
136444c061aSmrg#define XtInheritAllocate ((XtAllocateProc) _XtInherit)
137444c061aSmrg#define XtInheritDeallocate ((XtDeallocateProc) _XtInherit)
138444c061aSmrg
139444c061aSmrg#endif /*_Xt_ObjectP_h_*/
140