1/* 2 * Motif Tools Library, Version 3.1 3 * $Id: XmtP.h.in,v 1.1 2001/09/19 02:57:18 grmcdorman Exp $ 4 * 5 * Written by David Flanagan. 6 * Copyright (c) 1992-2001 by David Flanagan. 7 * All Rights Reserved. See the file COPYRIGHT for details. 8 * This is open source software. See the file LICENSE for details. 9 * There is no warranty for this software. See NO_WARRANTY for details. 10 * 11 * $Log: XmtP.h.in,v $ 12 * Revision 1.1 2001/09/19 02:57:18 grmcdorman 13 * This change makes the following modifications: 14 * A new program, printConfig, is provided. This is built by a 15 * simple rule in the Makefile and not installed. It prints 16 * significant defines from Xmt.tmpl. 17 * 18 * XmtP.h is now generated from XmtP.h.in using printConfig. As 19 * a result, code compiled outside of the Xmt Imakefiles will 20 * have all of the Xmt.tmpl defines. 21 * 22 * Source files are modified to use XmtP.h instead of Xmt.h. 23 * 24 * WorkingBox.c is modified to use the new Progress widget. 25 * It can be compiled in the old style if WORKINGBOX_USE_SCALE is 26 * defined at compile time. 27 * 28 * Because XmtP.h is generated dynamically, it is removed from CVS 29 * with this check-in. 30 * 31 * Revision 1.1.1.1 2001/02/10 13:52:09 motiftools 32 * Initial import of Xmt310 to CVS 33 * 34 * 35 */ 36 37#ifndef _XmtP_h 38#define _XmtP_h 39 40/* 41 * Configuration defines. These are based on values in Xmt.tmpl in the build. 42 */ 43@CONFIG@ 44 45/* 46 * This header includes XmP.h and fixes problems with it 47 * and handles 1.1 to 1.2 portability issues 48 */ 49 50#include <Xmt/Xmt.h> 51#include <Xm/XmP.h> 52 53#if XmVersion == 1001 54#include <Xm/Traversal.h> 55#endif 56 57#if XmVersion >= 1002 58#include <Xm/PrimitiveP.h> 59#include <Xm/GadgetP.h> 60#include <Xm/ManagerP.h> 61#endif 62 63#if !defined (XMT_HAS_STRERROR) 64# if defined (XMT_HAS_SYS_ERRLIST) 65extern char *sys_errlist[]; 66# define strerror(err) sys_errlist[err] 67# else 68# define strerror(err) "strerror is unsupported" 69# endif /* XMT_HAS_SYS_ERRLIST */ 70#endif /* !XMT_HAS_STERROR */ 71 72/* 73 * DECWindows can't handle XtRemoveCallback, so we make these patches: 74 */ 75#ifdef DECWINDOWS_CALLBACK_HACK 76#define XtAddCallback _XmtDECAddCallback 77#define XtRemoveCallback _XmtDECRemoveCallback 78#if NeedFunctionPrototypes 79extern void _XmtDECAddCallback(Widget, String, XtCallbackProc, XtPointer); 80extern void _XmtDECRemoveCallback(Widget, String, XtCallbackProc, XtPointer); 81#else 82extern void _XmtDECAddCallback(); 83extern void _XmtDECRemoveCallback(); 84#endif 85#endif 86 87/* 88 * Some systems (e.g. SunOS 4.1.3_U1) still don't have memmove() 89 */ 90#ifdef NO_MEMMOVE 91#undef memmove 92#define memmove(a,b,n) bcopy(b,a,n) 93#endif 94 95/* 96 * In Unix, app-defaults files have the suffix ".ad". In VMS 97 * they have the suffix ".dat". We define a symbolic constant 98 * to take care of this difference and use it in ContextHelp.c 99 * and Include.c 100 */ 101#ifndef APPDEFAULTSSUFFIX 102#ifndef VMS 103#define APPDEFAULTSSUFFIX ".ad" 104#else 105#define APPDEFAULTSSUFFIX ".dat" 106#endif 107#endif 108 109 110#if XmVersion == 1001 111/* XmP.h uses NULL instead of None, resulting in a compiler warning */ 112#ifdef XtIsRealized 113#undef XtIsRealized 114#endif 115#define XtIsRealized(widget) \ 116 (XtIsWidget(widget) ? \ 117 ((Widget)(widget))->core.window != None : \ 118 ((Object)(widget))->object.parent->core.window != None) 119 120#endif /* XmVersion 1001 */ 121 122/* 123 * In Motif 1.1.0, and maybe other old 1.1 versions as well, 124 * XmMenuProc and other XmRowColumn method types are not defined. 125 * If needed, we define them here. 126 */ 127#ifdef MISSING_METHOD_TYPES 128#define XmMenuProc XtProc 129#define XmArmAndActivate XtProc 130#define XmMenuTrav XtProc 131#endif 132 133/* 134 * Inheritance symbols not defined in Motif 1.1 135 */ 136#if XmVersion == 1001 137/* HP Motif does these inheritance symbols a little differently */ 138#if defined(HP_MOTIF) || defined(HP_NLS) 139#ifndef XmInheritArmAndActivate 140#define XmInheritArmAndActivate (XtActionProc) _XtInherit 141#endif 142#ifndef XmInheritMenuTraversalProc 143#define XmInheritMenuTraversalProc (XmMenuTraversalProc) _XtInherit 144#endif 145#else /* if not HP/Motif */ 146#ifndef XmInheritArmAndActivate 147#define XmInheritArmAndActivate (XmArmAndActivate) _XtInherit 148#endif 149#ifndef XmInheritMenuTraversalProc 150#define XmInheritMenuTraversalProc (XmMenuTrav) _XtInherit 151#endif 152#ifndef XmInheritFocusMovedProc 153#define XmInheritFocusMovedProc XtInheritFocusMovedProc 154#endif 155#endif 156#ifndef XmInheritMenuProc 157#define XmInheritMenuProc (XmMenuProc) _XtInherit 158#endif 159#ifndef XmInheritBorderHighlight 160#define XmInheritBorderHighlight (XtWidgetProc) _XtInherit 161#endif 162#ifndef XmInheritBorderUnhighlight 163#define XmInheritBorderUnhighlight (XtWidgetProc) _XtInherit 164#endif 165#endif 166 167/* 168 * An inheritance symbol omited from 1.2.0 169 */ 170#if XmVersion == 1002 171#ifndef XmInheritMenuTraversalProc 172#define XmInheritMenuTraversalProc (XmMenuTraversalProc) _XtInherit 173#endif 174#endif 175 176/* 177 * Some internal functions' signatures changed between 1.1 and 1.2, 178 * so define some wrapper macros that work correctly for either release. 179 */ 180#if XmVersion <= 1001 181#define _XmtConfigureObject(g, x, y, w, h, b)\ 182 _XmConfigureObject((RectObj)g, x, y, w, h, b) 183#define _XmtResizeObject(g, w, h, bw) _XmResizeObject((RectObj)g, w, h, bw); 184#define _XmtMoveObject(g, x, y) _XmMoveObject((RectObj)g, x, y); 185#define _XmtRedisplayGadgets(w, e, r)\ 186 _XmRedisplayGadgets((CompositeWidget)w, (XExposeEvent *)e, r) 187#else 188#define _XmtConfigureObject(g,x,y,w,h,b) _XmConfigureObject(g, x, y, w, h, b) 189#define _XmtResizeObject(g, w, h, bw) _XmResizeObject(g, w, h, bw); 190#define _XmtMoveObject(g, x, y) _XmMoveObject(g, x, y); 191#define _XmtRedisplayGadgets(w, e, r) _XmRedisplayGadgets(w, e, r) 192#endif 193 194#if XmVersion >= 2000 195/* 196 * ARH These functions have been removed from view in Motif 2.0. 197 * Suitable replacements need to be provided, but this will 198 * get us going. 199 */ 200extern void _XmTextMarginsProc(Widget w, XmBaselineMargins *margins_rec) ; 201 202extern void _XmDestroyParentCallback(Widget w, XtPointer client_data, 203 XtPointer call_data) ; 204#endif 205 206 207 208#endif /* _XmtP_h */ 209