/*------------------------------------------------------------------------------*
 *	File Name: 	MOAPI.h															*
 *	Purpose:	Origin interface constants and def's							*
 *  Creation:	by Dr. C. P. Yang, 4/15/95										* 
 *  	Copyright Microcal Software Inc. 1995									*
 *	Modification log															*
 *	CPY v3.8 6/7/95 MOPSTR, add MOPSTR											*
 *	CPY v3.8 CONTOUR_SPLIT 8/2/95, separate MoBaseMX for contour grids			*
 *  ML 8/9/95 NO_CAST                                                           *
 *  ML 9/20/95 POINTER_TO_MOINDEX                                               *
 *  ML 10/11/95 PSTR_TO_MOPSTR                                                  *
 *  ML v3.980 1/4/96 MOMASK_IMPLEMENTATION                                      *
 *  ML 1/8/96 MO_ASSERT_VALID                                                   *
 *  ML 1/8/96 MOUINT                                                            *
 *  ML 1/11/96 LONGPOINTER_TO_MOINT                                             *
 *  ML 1/11/96 LONGPOINTER_TO_LPMOSTR                                           *
 *  ML 1/12/96 GET_AND_SET_VECTOR_SIZE                                          *
 *  ML 2/14/96 LPCMOSTR															*
 *  ML 3/27/96 MO_ASSERT_EMPTY_FOR_NOW											*
 *	CPY v4.09 5/22/96 MAKE_MFC_COMPATIBLE										*
 *	ML v4.090 5/28/96 MO_VERIFY_MACRO											*
 *	ML 5/30/96 MOCOLNUM_TYPE													*
 *	CPY v4.13 7/28/96 MOBASE_HUGE_FAR_CHANGE									*
 *	ML v4.133 8/30/96 FRAME_AND_MEMORY_OBJECT_ACCESS							*
 *  JLIU v.4.14  MOVE_TO_ORIGIN50												*
 *	ANU	v4.14 12/20/96 UPPERCASE_INT_IN_16_BIT									*
 *	ML 1/2/97 MOVE_FROM_MOAPI_H_TO_MODLL_H_AND_ODLLINT_H						*
 *	ML 1/2/97 DEFINE_MO_RETURN_NO												*
 *	EJP 01-15-97 MORE_SUPPORT_FOR_MODLL											*
 *	ML 1/29/97 MORE_OLD_TYPES_THROUGH_NEW_TYPES									*
 *	ML 7/28/98 MORE_CONTOUR_DRAW_WORK											*
 *------------------------------------------------------------------------------*/      


/// ML 1/2/97 MOVE_FROM_MOAPI_H_TO_MODLL_H_AND_ODLLINT_H
/*
/// ML 12/28/96 OK_SUPPORT_FOR_MODLL 
#ifndef		OK_SUPPORT_FOR_MODLL
/// end OK_SUPPORT_FOR_MODLL 
///ANU	v4.14 12/20/96 UPPERCASE_INT_IN_16_BIT
///uppercase INT is not defined in 16 bit unless we include
///otypes16.h.  INT is needed in okconst.h.  
#ifndef		_OTYPES_H
#include	"otypes.h"
#endif
///end UPPERCASE_INT_IN_16_BIT

/// JLIU v.4.14  MOVE_TO_ORIGIN50
#include "okconst.h"                                                                 
///end MOVE_TO_ORIGIN50

#ifndef ORG_ORGDLL
#include "orgdll.h"                                                                 
#endif
/// ML 12/28/96 OK_SUPPORT_FOR_MODLL 
#endif		// !OK_SUPPORT_FOR_MODLL
/// end OK_SUPPORT_FOR_MODLL 
*/

// This is moved out of MOAPI.h because MOAPI.h is exported,
/// end MOVE_FROM_MOAPI_H_TO_MODLL_H_AND_ODLLINT_H

#ifndef		_MOAPI_H
#define 	_MOAPI_H   


/// EJP 01-15-97 MORE_SUPPORT_FOR_MODLL
#ifdef OK_SUPPORT_FOR_MODLL
	#include "okconst.h"
	typedef OKREAL			MOREAL;
	typedef OKINT			MOINT;
#else // OK_SUPPORT_FOR_MODLL
	// The following were moved here from elsewhere in this file.
	typedef	int				MOINT;
	typedef	double			MOREAL;
#endif // OK_SUPPORT_FOR_MODLL
/// end MORE_SUPPORT_FOR_MODLL


/// ML 1/8/96 MO_ASSERT_VALID
#define		MO_ASSERT_VALID(expression)
/// end MO_ASSERT_VALID

/// ML 3/27/96 MO_ASSERT_EMPTY_FOR_NOW
#ifdef		_DEBUG
	#define		MO_ASSERT(b)		{ O_ASSERT(b); }
#else
	#define		MO_ASSERT(b)		{}
#endif
/// end MO_ASSERT_EMPTY_FOR_NOW 
/// ML 5/28/96 MO_VERIFY_MACRO
#define			MO_VERIFY(b)		O_VERIFY(b)
/// end MO_VERIFY_MACRO




///

/// EJP 01-15-97 MORE_SUPPORT_FOR_MODLL
/// Moved to top of file.
///typedef	int				MOINT;
/// end MORE_SUPPORT_FOR_MODLL

/// ML 1/8/96 MOUINT
typedef		UINT		MOUINT;
/// end MOUINT
/// ML 5/30/96 MOCOLNUM_TYPE
typedef		UINT		MOCOLNUM;
/// end MOCOLNUM_TYPE




typedef unsigned short	MOUINT16;
typedef	short			MOINT16;
typedef	long			MOINT32;
typedef	unsigned long	MOUNS32;
typedef	unsigned short	MOMSG;
typedef	unsigned long	MORETURN;
typedef	long			MOINDEX;   
/// ML 7/28/98 MORE_CONTOUR_DRAW_WORK
#ifndef		_OC3DXDLL__
/// end MORE_CONTOUR_DRAW_WORK
///CPY v3.8 CONTOUR_SPLIT
#ifndef MOLDREAL_IS_DEFINED 
typedef	long double MOLDREAL;
///CPY v4.13 7/28/96 MOBASE_HUGE_FAR_CHANGE
#define	MOLDREAL_IS_LONG_DOUBLE	/// to allow later differentiaion for other basic type change
#endif
/// ML 7/28/98 MORE_CONTOUR_DRAW_WORK
#endif		// !_OC3DXDLL__
/// end MORE_CONTOUR_DRAW_WORK

/// ML v3.980 1/4/96 MOMASK_IMPLEMENTATION
typedef		BYTE	MOMASK;	
/// end MOMASK_IMPLEMENTATION



///CPY v4.09 5/22/96 MAKE_MFC_COMPATIBLE
typedef const char *CMOPSTR;
///
	
/// ML 10/11/95 PSTR_TO_MOPSTR
typedef	char *	MOPSTR;
/// end PSTR_TO_MOPSTR

#ifndef	_OTYPES
 /// ML 8/9/95 NO_CAST
 //#define NewPtr(x)		LocalAlloc(LPTR,x)
 //#define DisposPtr(x)	LocalFree((LOCALHANDLE) x)
 #define NewPtr(x)		(PSTR)LocalAlloc(LPTR,x)
 #define DisposPtr(x)	LocalFree((LOCALHANDLE) (PSTR)x)
 #define NewHandle(x)	GlobalAlloc(GHND,(x))
 #define DisposHandle(x)	GlobalFree(x)
 #define Handle2Ptr(x)	GlobalLock(x)
 #define HUnlock(x)		GlobalUnlock(x)
 #define GetHandleSize(x)	GlobalSize(x)
 #define SetHandleSize(x,y)	GlobalReAlloc(x,(y),GHND)
#endif //_OTYPES                    

#ifdef	_WIN32
	#define	O_HUGE
#else                     
	#define O_HUGE 			huge
#endif

/// EJP 01-15-97 MORE_SUPPORT_FOR_MODLL
/// Moved to top of file.
///typedef	double			MOREAL;
/// end MORE_SUPPORT_FOR_MODLL

/// ML 1/29/97 MORE_OLD_TYPES_THROUGH_NEW_TYPES		
#ifdef OK_SUPPORT_FOR_MODLL
typedef	LPOKREAL		LPMOREAL;   
#else	// !OK_SUPPORT_FOR_MODLL
/// end MORE_OLD_TYPES_THROUGH_NEW_TYPES		
typedef	MOREAL FAR 		*LPMOREAL;   
/// ML 1/29/97 MORE_OLD_TYPES_THROUGH_NEW_TYPES		
#endif	// !OK_SUPPORT_FOR_MODLL
/// end MORE_OLD_TYPES_THROUGH_NEW_TYPES		
typedef MOREAL O_HUGE 	*HPMOREAL;


#define	LPDOUBLE		LPMOREAL	
#define	LPMOSTR			LPSTR 
/// ML 2/14/96 LPCMOSTR
#define	LPCMOSTR		LPCSTR
/// end LPCMOSTR

/// ML 9/20/95 POINTER_TO_MOINDEX
typedef	MOINDEX	FAR		*LPMOINDEX;
/// end POINTER_TO_MOINDEX

/// ML 1/29/97 MORE_OLD_TYPES_THROUGH_NEW_TYPES		
#ifdef OK_SUPPORT_FOR_MODLL
typedef	LPOKINT			LPMOINT;   
#else	// !OK_SUPPORT_FOR_MODLL
/// end MORE_OLD_TYPES_THROUGH_NEW_TYPES		
/// ML 1/11/96 LONGPOINTER_TO_MOINT
typedef	MOINT	FAR		*LPMOINT;
/// end LONGPOINTER_TO_MOINT
/// ML 1/29/97 MORE_OLD_TYPES_THROUGH_NEW_TYPES		
#endif	// !OK_SUPPORT_FOR_MODLL
/// end MORE_OLD_TYPES_THROUGH_NEW_TYPES		
/// ML 1/11/96 LONGPOINTER_TO_LPMOSTR
typedef	LPMOSTR	FAR		*LPLPMOSTR;
/// end LONGPOINTER_TO_LPMOSTR

/// ML v4.133 8/30/96 FRAME_AND_MEMORY_OBJECT_ACCESS
// moved from madata.h to moapi.h
typedef unsigned long	MODATAID;
/// end FRAME_AND_MEMORY_OBJECT_ACCESS


#define	MODLLAPI		FAR PASCAL// _export

#define	LPMONULL		0L

/// ML 1/2/97 MOVE_FROM_MOAPI_H_TO_MODLL_H_AND_ODLLINT_H
/*
#ifdef	__cplusplus
extern "C" {
#endif
/// ML 12/28/96 OK_SUPPORT_FOR_MODLL 
//#ifndef		OK_SUPPORT_FOR_MODLL
#ifdef		USING_MODLL_OLD_WAY
/// end OK_SUPPORT_FOR_MODLL 

MORETURN ScriptInterface(HWND hWnd, LPSTR lpStr1,LPSTR lpStr2, LPMOREAL lpValue, 
			LPCALLBK lpProc, MOMSG msg);

void	MoDLLInit(HINSTANCE hInst);
/// ML 12/28/96 OK_SUPPORT_FOR_MODLL 
//#endif		// !OK_SUPPORT_FOR_MODLL
#endif		// USING_MODLL_OLD_WAY
/// end OK_SUPPORT_FOR_MODLL 

#ifdef	__cplusplus
} // end of __cplusplus 
#endif
*/
/// end MOVE_FROM_MOAPI_H_TO_MODLL_H_AND_ODLLINT_H

///CPY v3.85 WIN32_UPDATE
//#define NO_ERROR	0
#define MO_NO_ERROR	0 /// NO_ERROR is a system keyword

#define	MO_SET_VALUE	0x0004
#define	MO_GET_VALUE	0x0008
#define	MO_MASK_STRING  0x0001
#define	MO_MASK_METHOD	0x0002
#define	MO_MASK_ARRAY	0x0010
#define	MO_MASK_TYPE	(MO_MASK_METHOD | MO_MASK_STRING)
/// ML 1/12/96 GET_AND_SET_VECTOR_SIZE
#define	MO_SET_VECTOR_SIZE	0x0020
#define	MO_GET_VECTOR_SIZE	0x0040
#define	MO_VECTOR_SIZE	(MO_SET_VECTOR_SIZE | MO_GET_VECTOR_SIZE)
/// end GET_AND_SET_VECTOR_SIZE


/// ML 1/2/97 DEFINE_MO_RETURN_NO
#ifndef		MO_RETURN_NO
	// This must be defined (for the macro
	// COMMON_MEMBERS to be compilable) in new way to 0
	// This is because MO_RETURN_NO in old way is defined
	// as EGOR_NO and orgdll.h is not included in
	// the new way.
	// It must have the same value as EGOR_NO
	#define		MO_RETURN_NO		0
#endif		// MO_RETURN_NO		
/// end MOVE_FROM_MOAPI_H_TO_MODLL_H_AND_ODLLINT_H

typedef	struct	XY
{
	MOREAL	x;
	MOREAL	y;
} XY, FAR *LPXY;

#endif //_MOAPI_H

