2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
23 /* @(#)95 1.3 com/config/UxXt.h, aic, aic324, 9322324a 6/1/93 16:14:00 */
25 * COMPONENT_NAME: AIC AIXwindows Interface Composer
30 * Copyright IBM Corporation 1991, 1993
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.
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.
50 /*---------------------------------------------------------------------
51 * $XConsortium: UxXt.h /main/4 1995/11/01 16:09:11 rswiston $
52 *---------------------------------------------------------------------
55 * Copyright (c) 1991, Visual Edge Software Ltd.
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 *-------------------------------------------------------------------*/
68 /*****************************************************************************/
70 /*****************************************************************************/
72 #ifndef _UX_XT_H_INCLUDED
73 #define _UX_XT_H_INCLUDED
78 #include <Mrm/MrmPublic.h>
83 typedef char *caddr_t;
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.
92 * You can specify a file with a compile option like
93 * -DUXORB_HEADER='<SomeOrb.h>'
94 *-----------------------------------------------------*/
99 * In the absence of an ORB implementation,
100 * these minimal definitions satisfy our method dispatch code.
108 typedef struct Environment {
109 exception_type _major;
111 #endif /* UXORB_HEADER */
114 * UxEnv is provided as a convenience for use in interface methods.
116 extern Environment UxEnv;
119 /* The following macros are used in converting string values to the form
120 required by the widgets */
122 #define RES_CONVERT( res_name, res_value) \
123 XtVaTypedArg, (res_name), XmRString, (res_value), strlen(res_value) + 1
125 #define UxPutStrRes( wgt, res_name, res_value ) \
126 XtVaSetValues( wgt, RES_CONVERT( res_name, res_value ), NULL )
129 #ifndef UX_INTERPRETER /* Omit this section when interpreting the code */
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)
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)))
146 #define no_grab XtGrabNone
147 #define nonexclusive_grab XtGrabNonexclusive
148 #define exclusive_grab XtGrabExclusive
151 /* The following global variables are defined in the main() function */
152 extern XtAppContext UxAppContext;
153 extern Widget UxTopLevel;
154 extern Display *UxDisplay;
158 /* The following are error codes returned by the functions in UxXt.c */
160 #define UX_NO_ERROR 0
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 */
170 /* The following are declarations of the functions in UxXt.c */
173 extern int UxPopupInterface( Widget wgt, XtGrabKind grab_flag );
174 extern int UxPopdownInterface( Widget wgt );
175 extern int UxDestroyInterface( Widget wgt);
176 extern int UxPutContext( Widget wgt, caddr_t context );
177 extern caddr_t UxGetContext( Widget wgt );
178 extern void UxFreeClientDataCB( Widget wgt, XtPointer client_data,
179 XtPointer call_data );
180 extern void UxLoadResources( char *fname );
181 extern XmFontList UxConvertFontList( char *fontlist_str );
182 extern Pixmap UxConvertPixmap( char *file_name );
183 extern Pixmap UxConvert_bitmap( char *file_name );
184 extern wchar_t * UxConvertValueWcs( char *value_str );
186 extern void UxDestroyContextCB(Widget, XtPointer, XtPointer);
187 extern void UxDeleteContextCB( Widget, XtPointer, XtPointer);
188 extern XtArgVal UxRemoveValueFromArgList( Arg *args,
189 Cardinal *ptr_num_args,
191 extern Widget UxChildSite( Widget );
192 extern Widget UxRealWidget( Widget );
194 extern Widget GetTrueToplevel( Widget );
198 class _UxCInterface {
202 virtual swidget childSite (Environment * pEnv) {
204 pEnv->_major = NO_EXCEPTION;
207 virtual swidget UxChildSite (swidget sw);
213 #define CPLUS_ADAPT_CONTEXT(CLASS) \
215 CLASS* UxGetContext(CLASS*self) {return self;} \
217 void* UxGetContext(swidget any) {return ::UxGetContext(any);}
219 #endif /* _cplusplus */
221 #endif /* ! UX_INTERPRETER */
223 #endif /* ! _UX_XT_H_INCLUDED */