#ifndef __HGDEF_H__ #define __HGDEF_H__ /**************************************************************************** * Platform Dependent Definitions and Typedefs * ****************************************************************************/ /* Microsoft C/C++ Compiler */ #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) || defined (_WINDOWS) #define HG_CMP_MSC #if defined(_WIN64) || defined(WIN64) #define HG_64BIT #elif defined(_WIN32) || defined(WIN32) #define HG_32BIT #endif /* Apple Compiler (which is GNU now) */ #elif defined(__APPLE__) #define HG_CMP_XCODE #define HG_64BIT /* GNU C/C++ Compiler */ #elif defined(__GNUC__) #define HG_CMP_GNU #if defined(__alpha__) || defined(__ia64__) || defined(__ppc64__) || defined(__s390x__) || defined(__x86_64__) #define HG_64BIT #else #define HG_32BIT #endif /* Unrecognized */ #else #error Unrecognized compiler #endif #if defined(HG_CMP_MSC) #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #endif /* type defines */ typedef void HGVoid; typedef char HGChar; typedef unsigned char HGByte; typedef short HGShort; typedef unsigned short HGUShort; typedef int HGInt; typedef unsigned int HGUInt; typedef long long HGLonglong; typedef unsigned long long HGULonglong; typedef void* HGPointer; typedef HGInt HGBool; typedef float HGFloat; typedef double HGDouble; #ifdef HG_64BIT typedef HGLonglong HGSize; typedef HGULonglong HGUSize; #else typedef HGInt HGSize; typedef HGUInt HGUSize; #endif typedef HGUInt HGColor; #define HG_MAKECOLOR(r, g, b, a) (HGColor)(((HGUInt)a << 24) | ((HGUInt)b << 16) | ((HGUInt)g << 8) | (HGUInt)r) #define HG_GETCOLOR_R(color) (HGUInt)((HGColor)color & 0xFF) #define HG_GETCOLOR_G(color) (HGUInt)(((HGColor)color >> 8) & 0xFF) #define HG_GETCOLOR_B(color) (HGUInt)(((HGColor)color >> 16) & 0xFF) #define HG_GETCOLOR_A(color) (HGUInt)(((HGColor)color >> 24) & 0xFF) /* error code */ typedef HGUInt HGResult; #define HGTRUE 1 #define HGFALSE 0 #ifndef HGMAX #define HGMAX(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef HGMIN #define HGMIN(a,b) (((a) < (b)) ? (a) : (b)) #endif #if defined(HG_CMP_MSC) #ifdef __cplusplus #define HGEXPORT extern "C" #else #define HGEXPORT #endif /* __cplusplus */ #define HGAPI __stdcall #define HGAPIV __cdecl #else #ifdef __cplusplus #define HGEXPORT extern "C" __attribute ((visibility("default"))) #else #define HGEXPORT __attribute ((visibility("default"))) #endif /* __cplusplus */ #define HGAPI #define HGAPIV #endif #if defined(HG_CMP_MSC) #include typedef HWND HGWindow; #else #ifdef __cplusplus typedef class QWidget* HGWindow; #else typedef void* HGWindow; #endif #endif #define HG_DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name #pragma pack(push) #pragma pack(4) typedef struct { HGInt left; HGInt top; HGInt right; HGInt bottom; }HGRect; typedef struct { HGFloat left; HGFloat top; HGFloat right; HGFloat bottom; }HGRectF; typedef struct { HGInt x; HGInt y; }HGPoint; typedef struct { HGFloat x; HGFloat y; }HGPointF; #pragma pack(pop) #endif /* __HGDEF_H__ */