// GSTypes.h
//
// Copyright 1999 Diehl Graphsoft, Inc.
// All Rights Reserved.
//
//  This file contains the type definitions for the Graphsoft core.
//
//	Started 6/4/97 by Robert McBride
//
// SourceSafe information for this version:
//    $Revision: 1 $
//    $Date: 6/06/00 6:13p $
//    $Author: Dave $

#ifndef _GS_TYPES_
#define _GS_TYPES_

#pragma once

///////////////////////////////////////////////////////////////////////////////
// Unsigned integer types.

typedef unsigned char		Uint8;
typedef	unsigned short		Uint16;
typedef	unsigned long		Uint32;
#if _WINDOWS
typedef unsigned __int64	Uint64;
#else
typedef unsigned long long	Uint64;
#endif


///////////////////////////////////////////////////////////////////////////////
// Signed integer types.

typedef	char		Sint8;
typedef	short		Sint16;
typedef	long		Sint32;
#if _WINDOWS
typedef __int64		Sint64;
#else
typedef long long	Sint64;
#endif


///////////////////////////////////////////////////////////////////////////////
// Interger type maximums and minimums.

#define kGSMaxUint8		255
#define kGSMaxUint16	65535
#define kGSMaxUint32	4294967295UL
#define kGSMaxUint64	18446744073709551615ULL
#define kGSMaxSint8		127
#define kGSMaxSint16	32767
#define kGSMaxSint32	2147483647L
#define kGSMaxSint64	9223372036854775807LL

#define kGSMinUint8		0
#define kGSMinUint16	0
#define kGSMinUint32	0UL
#define kGSMinUint64	0ULL
#define kGSMinSint8		(-128)
#define kGSMinSint16	(-32768)
#define kGSMinSint32	(-2147483647-1)
#define kGSMinSint64	(-9223372036854775808LL)


///////////////////////////////////////////////////////////////////////////////
// Floating point types.

typedef	float			Real32;
typedef double			Real64;


///////////////////////////////////////////////////////////////////////////////
// Boolean types.

typedef	unsigned char	Bool8;

#if __cplusplus
	const Bool8		kFalse = 0;
	const Bool8		kTrue = 1;
#else
	enum EBool {
		kFalse = 0,
		kTrue = 1
	};
#endif

///////////////////////////////////////////////////////////////
// XXXKIS : Put this type definition back in temporarily until
//			I find out why it was removed to being with.
typedef unsigned char	Boolean;


///////////////////////////////////////////////////////////////////////////////
// Character types.

// Non-Unicode
typedef unsigned char	Uchar;

// Unicode (Encoding format is UTF-16 in platform-native byte order)
typedef Uint16			UCChar;
typedef UCChar*			UCCharPtr;       // Pointer to one or an array of UCCChars
typedef UCChar**		UCCharHandle;    // Handle to one or an array of UCCChars
typedef UCChar*			UCStrPtr;        // Pointer to NULL-word terminated UCChars
typedef UCChar**		UCStrHandle;     // Handle to NULL-word terminated UCChars
typedef const UCChar*	ConstUCCharPtr;  // Pointer to one or an array of constant UCCChars
typedef const UCChar*	ConstUCStrPtr;   // Pointer to NULL-word terminated constant UCChars
typedef Uint32			UCCharCnt;


///////////////////////////////////////////////////////////////////////////////
// String types.
//   Non-Unicode base types used by our cross-platform string code

// Pascal string types
typedef Uchar			GSStr255[256], GSStr63[64], GSStr32[33], GSStr31[32], GSStr27[28], GSStr15[16];
typedef Uchar			*GSStringPtr, **GSStringHandle;
typedef const Uchar		*ConstGSStringPtr, *ConstGSStr255Param, *ConstGSStr31Param, *ConstGSStr15Param;

// C string types
typedef char			*GSCStrPtr;			// C-String Pointer
typedef const char		*ConstGSCStrPtr;	// Constant C-String Pointer


///////////////////////////////////////////////////////////////////////////////
// GSHandle
//   This is the basic resizable handle structure with cross-platform support
//   from the MiniCAD SDK. SDK memory calls can also be used on MCObjectHandle.

typedef char**	GSHandle;


///////////////////////////////////////////////////////////////////////////////
//	ColorRef
typedef Uint16 ColorRef;

///////////////////////////////////////////////////////////////////////////////
//	OpacityRef
typedef Uint8 OpacityRef;

///////////////////////////////////////////////////////////////////////////////
//	kMaxOpacity
const OpacityRef kMaxOpacity = 100;

#endif //_GS_TYPES
