1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
|
/*
* Motif Tools Library, Version 3.1
* $Id$
*
* Written by David Flanagan.
* Copyright (c) 1992-2001 by David Flanagan.
* All Rights Reserved. See the file COPYRIGHT for details.
* This is open source software. See the file LICENSE for details.
* There is no warranty for this software. See NO_WARRANTY for details.
*
* $Log$
* Revision 1.1.1.1 2001/07/18 11:06:03 root
* Initial checkin.
*
* Revision 1.2 2001/06/12 16:25:28 andre
* *** empty log message ***
*
*
*/
#ifndef _XmtProcedures_h
#define _XmtProcedures_h
/*
* This is maximum number of arguments that an Xmt callback procedure
* can take. If you change it here, you've also got to change the code
* that actually passes the arguments and calls the functions, and
* also change the definition of an XmtProcedure below.
*/
#define XmtMAX_PROCEDURE_ARGS 8
typedef XtPointer (*XmtProcedure) (
#if NeedFunctionPrototypes
XtPointer, XtPointer, XtPointer,
XtPointer, XtPointer, XtPointer,
XtPointer, XtPointer
#endif
);
/*
* Each callback has a name and procedure pointer, of course.
* Each procedure will be passed 8 (this number is arbitrary) arguments.
* The argument_types array specifies the types of each of these arguments.
* Specify the type of each argument that the procedure expects, and
* set the remaining fields to NULL. Use the special values
* XmtRCallbackWidget and XmtRCallbackData to specify that the widget
* or call_data values are expected in a particular position.
* Also, use XmtRCallbackAppContext, XmtRCallbackWindow, XmtCallbackDisplay,
* to pass the app context, Window, and Display of the callback widget.
* Also, use XmtRCallbackUnused if the procedure has an unused argument--
* Xmt will always pass NULL for that arg.
*
* expected_args is a private field; leave it uninitialized.
*
* Procedures that return values should specify the type of the return
* value in return_type, or NULL if they don't return anything.
* return_type is currently unimplemented, so always specify NULL.
*/
typedef struct {
/* Only the first 2 are always required */
StringConst name;
XmtProcedure function;
/* The expected arg. types and return value of the function */
StringConst argument_types[XmtMAX_PROCEDURE_ARGS];
StringConst return_type;
/* private state, not initialized */
int expected_args;
} XmtProcedureInfo;
/*
* Special resource types that tell the callback converter to figure
* out the procedure argument from information it already has, not
* from a passed argument
*/
#define XmtRCallbackWidget "XmtCallbackWidget"
#define XmtRCallbackData "XmtCallbackData"
#define XmtRCallbackAppContext "XmtCallbackAppContext"
#define XmtRCallbackWindow "XmtCallbackWindow"
#define XmtRCallbackDisplay "XmtCallbackDisplay"
#define XmtRCallbackUnused "XmtCallbackUnused"
_XFUNCPROTOBEGIN
#if NeedFunctionPrototypes
extern void XmtRegisterProcedures(XmtProcedureInfo *, Cardinal);
extern void XmtRegisterCallbackProcedure(StringConst, XtCallbackProc,
StringConst);
extern XmtProcedureInfo *XmtLookupProcedure(StringConst);
extern Boolean XmtCallbackCheckList(XtCallbackList, XmtProcedure);
extern void XmtRegisterXtProcedures(void);
extern void XmtRegisterUnixProcedures(void);
extern void XmtRegisterXmtProcedures(void);
#else
extern void XmtRegisterProcedures();
extern void XmtRegisterCallbackProcedure();
extern XmtProcedureInfo *XmtLookupProcedure();
extern Boolean XmtCallbackCheckList();
extern void XmtRegisterXtProcedures();
extern void XmtRegisterUnixProcedures();
extern void XmtRegisterXmtProcedures();
#endif
#if NeedVarargsPrototypes
extern void XmtVaRegisterCallbackProcedures(StringConst,XtCallbackProc,
StringConst,...);
#else
extern void XmtVaRegisterCallbackProcedures();
#endif
_XFUNCPROTOEND
#endif /* _XmtProcedures_h */
|