1 /* @(#)95 1.3 com/config/UxXt.h, aic, aic324, 9322324a 6/1/93 16:14:00 */
3 * COMPONENT_NAME: AIC AIXwindows Interface Composer
8 * Copyright IBM Corporation 1991, 1993
12 * Permission to use, copy, modify, and distribute this software and its
13 * documentation for any purpose and without fee is hereby granted,
14 * provided that the above copyright notice appear in all copies and that
15 * both that copyright notice and this permission notice appear in
16 * supporting documentation, and that the name of IBM not be
17 * used in advertising or publicity pertaining to distribution of the
18 * software without specific, written prior permission.
20 * IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
21 * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
23 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
24 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
26 * OR PERFORMANCE OF THIS SOFTWARE.
28 /*---------------------------------------------------------------------
29 * $XConsortium: UxXt.h /main/4 1995/11/01 16:09:11 rswiston $
30 *---------------------------------------------------------------------
33 * Copyright (c) 1991, Visual Edge Software Ltd.
35 * ALL RIGHTS RESERVED. Permission to use, copy, modify, and
36 * distribute this software and its documentation for any purpose
37 * and without fee is hereby granted, provided that the above
38 * copyright notice appear in all copies and that both that
39 * copyright notice and this permission notice appear in supporting
40 * documentation, and that the name of Visual Edge Software not be
41 * used in advertising or publicity pertaining to distribution of
42 * the software without specific, written prior permission. The year
43 * included in the notice is the year of the creation of the work.
44 *-------------------------------------------------------------------*/
46 /*****************************************************************************/
48 /*****************************************************************************/
50 #ifndef _UX_XT_H_INCLUDED
51 #define _UX_XT_H_INCLUDED
56 #include <Mrm/MrmPublic.h>
61 typedef char *caddr_t;
65 /*-----------------------------------------------------
66 * UXORB_HEADER, if defined, is the include form for
67 * the header that defines the CORBA Environment type
68 * and exception type codes.
70 * You can specify a file with a compile option like
71 * -DUXORB_HEADER='<SomeOrb.h>'
72 *-----------------------------------------------------*/
77 * In the absence of an ORB implementation,
78 * these minimal definitions satisfy our method dispatch code.
86 typedef struct Environment {
87 exception_type _major;
89 #endif /* UXORB_HEADER */
92 * UxEnv is provided as a convenience for use in interface methods.
94 extern Environment UxEnv;
97 /* The following macros are used in converting string values to the form
98 required by the widgets */
100 #define RES_CONVERT( res_name, res_value) \
101 XtVaTypedArg, (res_name), XmRString, (res_value), strlen(res_value) + 1
103 #define UxPutStrRes( wgt, res_name, res_value ) \
104 XtVaSetValues( wgt, RES_CONVERT( res_name, res_value ), NULL )
107 #ifndef UX_INTERPRETER /* Omit this section when interpreting the code */
109 /* The following macros are supplied for compatibility with swidget code */
110 #define swidget Widget
111 #define UxWidgetToSwidget(w) (w)
112 #define UxGetWidget(sw) (sw)
113 #define UxIsValidSwidget(sw) ((sw) != NULL)
114 #define NO_PARENT ((Widget) NULL)
115 #define UxThisWidget (UxWidget)
117 /* Macros needed for the method support code */
118 #define UxMalloc(a) (malloc(a))
119 #define UxRealloc(a,b) (realloc((a), (b)))
120 #define UxCalloc(a,b) (calloc((a), (b)))
121 #define UxStrEqual(a,b) (!strcmp((a),(b)))
122 #define UxGetParent(a) (XtParent((a)))
124 #define no_grab XtGrabNone
125 #define nonexclusive_grab XtGrabNonexclusive
126 #define exclusive_grab XtGrabExclusive
129 /* The following global variables are defined in the main() function */
130 extern XtAppContext UxAppContext;
131 extern Widget UxTopLevel;
132 extern Display *UxDisplay;
136 /* The following are error codes returned by the functions in UxXt.c */
138 #define UX_NO_ERROR 0
141 extern void UxMrmFetchError(MrmHierarchy, char *, Widget, Cardinal);
142 extern MrmHierarchy UxMrmOpenHierarchy( char *);
143 extern void UxMrmRegisterClass( char *, Widget (*)(Widget, String, Arg *, Cardinal));
144 #endif /* UIL_CODE */
148 /* The following are declarations of the functions in UxXt.c */
151 extern int UxPopupInterface( Widget wgt, XtGrabKind grab_flag );
152 extern int UxPopdownInterface( Widget wgt );
153 extern int UxDestroyInterface( Widget wgt);
154 extern int UxPutContext( Widget wgt, caddr_t context );
155 extern caddr_t UxGetContext( Widget wgt );
156 extern void UxFreeClientDataCB( Widget wgt, XtPointer client_data,
157 XtPointer call_data );
158 extern void UxLoadResources( char *fname );
159 extern XmFontList UxConvertFontList( char *fontlist_str );
160 extern Pixmap UxConvertPixmap( char *file_name );
161 extern Pixmap UxConvert_bitmap( char *file_name );
162 extern wchar_t * UxConvertValueWcs( char *value_str );
164 extern void UxDestroyContextCB(Widget, XtPointer, XtPointer);
165 extern void UxDeleteContextCB( Widget, XtPointer, XtPointer);
166 extern XtArgVal UxRemoveValueFromArgList( Arg *args,
167 Cardinal *ptr_num_args,
169 extern Widget UxChildSite( Widget );
170 extern Widget UxRealWidget( Widget );
172 extern Widget GetTrueToplevel( Widget );
176 class _UxCInterface {
180 virtual swidget childSite (Environment * pEnv) {
182 pEnv->_major = NO_EXCEPTION;
185 virtual swidget UxChildSite (swidget sw);
191 #define CPLUS_ADAPT_CONTEXT(CLASS) \
193 CLASS* UxGetContext(CLASS*self) {return self;} \
195 void* UxGetContext(swidget any) {return ::UxGetContext(any);}
197 #endif /* _cplusplus */
199 #endif /* ! UX_INTERPRETER */
201 #endif /* ! _UX_XT_H_INCLUDED */