nsgmls: resolve coverity warnings related to uninitialed members in C++ classes
[oweals/cde.git] / cde / programs / dtcreate / UxXt.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* @(#)95       1.3  com/config/UxXt.h, aic, aic324, 9322324a 6/1/93 16:14:00 */
24 /*
25  *  COMPONENT_NAME: AIC           AIXwindows Interface Composer
26  *
27  *  ORIGINS: 58
28  *
29  *
30  *                   Copyright IBM Corporation 1991, 1993
31  *
32  *                         All Rights Reserved
33  *
34  *   Permission to use, copy, modify, and distribute this software and its
35  *   documentation for any purpose and without fee is hereby granted,
36  *   provided that the above copyright notice appear in all copies and that
37  *   both that copyright notice and this permission notice appear in
38  *   supporting documentation, and that the name of IBM not be
39  *   used in advertising or publicity pertaining to distribution of the
40  *   software without specific, written prior permission.
41  *
42  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
43  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
44  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
45  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
46  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
47  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
48  *   OR PERFORMANCE OF THIS SOFTWARE.
49 */
50 /*---------------------------------------------------------------------
51  * $XConsortium: UxXt.h /main/4 1995/11/01 16:09:11 rswiston $
52  *---------------------------------------------------------------------
53  *
54  *
55  *             Copyright (c) 1991, Visual Edge Software Ltd.
56  *
57  * ALL  RIGHTS  RESERVED.  Permission  to  use,  copy,  modify,  and
58  * distribute  this  software  and its documentation for any purpose
59  * and  without  fee  is  hereby  granted,  provided  that the above
60  * copyright  notice  appear  in  all  copies  and  that  both  that
61  * copyright  notice and this permission notice appear in supporting
62  * documentation,  and that  the name of Visual Edge Software not be
63  * used  in advertising  or publicity  pertaining to distribution of
64  * the software without specific, written prior permission. The year
65  * included in the notice is the year of the creation of the work.
66  *-------------------------------------------------------------------*/
67
68 /*****************************************************************************/
69 /*                              UxXt.h                                       */
70 /*****************************************************************************/
71
72 #ifndef _UX_XT_H_INCLUDED
73 #define _UX_XT_H_INCLUDED
74
75 #include <Xm/Xm.h>
76
77 #ifdef UIL_CODE
78 #include <Mrm/MrmPublic.h>
79 #endif /* UIL_CODE */
80
81 #if 0
82 #ifdef __STDC__
83 typedef char *caddr_t;
84 #endif
85 #endif
86
87 /*-----------------------------------------------------
88  * UXORB_HEADER, if defined, is the include form for
89  * the header that defines the CORBA Environment type
90  * and exception type codes.
91  *
92  * You can specify a file with a compile option like
93  *      -DUXORB_HEADER='<SomeOrb.h>'
94  *-----------------------------------------------------*/
95 #ifdef UXORB_HEADER
96 #include UXORB_HEADER
97 #else
98         /*
99          * In the absence of an ORB implementation,
100          * these minimal definitions satisfy our method dispatch code.
101          */
102         typedef enum {
103                 NO_EXCEPTION,
104                 USER_EXCEPTION,
105                 SYSTEM_EXCEPTION
106         } exception_type;
107
108         typedef struct Environment {
109                 exception_type  _major;
110         } Environment;
111 #endif  /* UXORB_HEADER */
112
113 /*
114  * UxEnv is provided as a convenience for use in interface methods.
115  */
116 extern  Environment     UxEnv;
117
118
119 /* The following macros are used in converting string values to the form
120    required by the widgets */
121
122 #define RES_CONVERT( res_name, res_value) \
123         XtVaTypedArg, (res_name), XmRString, (res_value), strlen(res_value) + 1
124
125 #define UxPutStrRes( wgt, res_name, res_value ) \
126         XtVaSetValues( wgt, RES_CONVERT( res_name, res_value ), NULL )
127
128
129 #ifndef UX_INTERPRETER  /* Omit this section when interpreting the code */
130
131 /* The following macros are supplied for compatibility with swidget code */
132 #define swidget                 Widget
133 #define UxWidgetToSwidget(w)    (w)
134 #define UxGetWidget(sw)         (sw)
135 #define UxIsValidSwidget(sw)    ((sw) != NULL)
136 #define NO_PARENT               ((Widget) NULL)
137 #define UxThisWidget            (UxWidget)
138
139 /* Macros needed for the method support code */
140 #define UxMalloc(a)             (malloc(a))
141 #define UxRealloc(a,b)          (realloc((a), (b)))
142 #define UxCalloc(a,b)           (calloc((a), (b)))
143 #define UxStrEqual(a,b)         (!strcmp((a),(b)))
144 #define UxGetParent(a)          (XtParent((a)))
145
146 #define no_grab                 XtGrabNone
147 #define nonexclusive_grab       XtGrabNonexclusive
148 #define exclusive_grab          XtGrabExclusive
149
150
151 /* The following global variables are defined in the main() function */
152 extern  XtAppContext    UxAppContext;
153 extern  Widget          UxTopLevel;
154 extern  Display         *UxDisplay;
155 extern  int             UxScreen;
156
157
158 /* The following are error codes returned by the functions in UxXt.c */
159 #define UX_ERROR           -1
160 #define UX_NO_ERROR        0
161
162 #ifdef UIL_CODE
163 extern  void            UxMrmFetchError(MrmHierarchy, char *, Widget, Cardinal);
164 extern  MrmHierarchy    UxMrmOpenHierarchy( char *);
165 extern  void            UxMrmRegisterClass( char *, Widget (*)(Widget, String, Arg *, Cardinal));
166 #endif /* UIL_CODE */
167
168
169
170 /* The following are declarations of the functions in UxXt.c */
171
172
173 extern  void*           UxNewContext (size_t size, int isSubclass);
174 extern  int             UxPopupInterface( Widget wgt, XtGrabKind grab_flag );
175 extern  int             UxPopdownInterface( Widget wgt );
176 extern  int             UxDestroyInterface( Widget wgt);
177 extern  int             UxPutContext( Widget wgt, caddr_t context );
178 extern  caddr_t         UxGetContext( Widget wgt );
179 extern  void            UxFreeClientDataCB( Widget wgt, XtPointer client_data,
180                                                  XtPointer call_data );
181 extern  void            UxLoadResources( char *fname );
182 extern  XmFontList      UxConvertFontList( char *fontlist_str );
183 extern  Pixmap          UxConvertPixmap( char *file_name );
184 extern  Pixmap          UxConvert_bitmap( char *file_name );
185 extern  wchar_t *       UxConvertValueWcs( char *value_str );
186
187 extern  void            UxDestroyContextCB(Widget, XtPointer, XtPointer);
188 extern  void            UxDeleteContextCB( Widget, XtPointer, XtPointer);
189 extern  XtArgVal        UxRemoveValueFromArgList( Arg *args,
190                                                 Cardinal *ptr_num_args,
191                                                 String res_name );
192 extern  Widget          UxChildSite( Widget );
193 extern  Widget          UxRealWidget( Widget );
194
195 extern  Widget          GetTrueToplevel( Widget );
196
197
198 #ifdef __cplusplus
199 class _UxCInterface {
200
201 public:
202
203         virtual swidget childSite (Environment * pEnv) {
204                 if (pEnv)
205                         pEnv->_major = NO_EXCEPTION;
206                 return 0;
207         }
208         virtual swidget UxChildSite (swidget sw);
209
210 protected:
211         swidget UxThis;
212 };
213
214 #define CPLUS_ADAPT_CONTEXT(CLASS) \
215         static inline \
216                 CLASS* UxGetContext(CLASS*self) {return self;} \
217         static inline\
218                 void* UxGetContext(swidget any) {return ::UxGetContext(any);}
219
220 #endif /* _cplusplus */
221
222 #endif /* ! UX_INTERPRETER */
223
224 #endif /* ! _UX_XT_H_INCLUDED */
225