From 5892ca57c20364cb3c18dcf3f381ad4aca38fb4f Mon Sep 17 00:00:00 2001 From: PHO Date: Fri, 8 Oct 2010 01:13:36 +0900 Subject: [PATCH 1/1] MacTypes.h --- .gitignore | 5 + Bindings/CoreServices/CarbonCore/MacTypes.hsc | 244 ++++++++++++++++++ COPYING | 29 +++ GNUmakefile | 5 + Setup.hs | 4 + bindings-carbon-core.cabal | 38 +++ cabal-package.mk | 95 +++++++ cbits/helper_mactypes.c | 4 + 8 files changed, 424 insertions(+) create mode 100644 .gitignore create mode 100644 Bindings/CoreServices/CarbonCore/MacTypes.hsc create mode 100644 COPYING create mode 100644 GNUmakefile create mode 100644 Setup.hs create mode 100644 bindings-carbon-core.cabal create mode 100644 cabal-package.mk create mode 100644 cbits/helper_mactypes.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f76a6e2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.hi +*.o + +Setup +dist diff --git a/Bindings/CoreServices/CarbonCore/MacTypes.hsc b/Bindings/CoreServices/CarbonCore/MacTypes.hsc new file mode 100644 index 0000000..109cef2 --- /dev/null +++ b/Bindings/CoreServices/CarbonCore/MacTypes.hsc @@ -0,0 +1,244 @@ +#include +#include + +module Bindings.CoreServices.CarbonCore.MacTypes where +#strict_import + +#integral_t UInt8 +#integral_t SInt8 +#integral_t UInt16 +#integral_t SInt16 +#integral_t UInt32 +#integral_t SInt32 + +#starttype struct wide +# field hi, +# field lo, +#stoptype + +#starttype struct UnsignedWide +# field hi, +# field lo, +#stoptype + +#if TYPE_LONGLONG +# integral_t SInt64 +# integral_t UInt64 +#else +# synonym_t SInt64, +# synonym_t UInt64, +#endif + +#integral_t Fixed +#synonym_t FixedPtr, Ptr +#integral_t Fract +#synonym_t FractPtr, Ptr +#integral_t UnsignedFixed +#synonym_t UnsignedFixedPtr, Ptr +#integral_t ShortFixed +#synonym_t ShortFixedPtr, Ptr + +#synonym_t Float32, CFloat +#synonym_t Float64, CDouble + +#starttype struct Float80 +# field exp, +# array_field man, +#stoptype + +#starttype struct Float96 +# array_field exp, +# array_field man, +#stoptype + +#starttype struct Float32Point +# field x, +# field y, +#stoptype + +#synonym_t Ptr , Ptr CChar +#synonym_t Handle, Ptr +#integral_t Size + +#integral_t OSErr +#integral_t OSStatus +#synonym_t LogicalAddress , Ptr () +#synonym_t ConstLogicalAddress, Ptr () +#synonym_t PhysicalAddress , Ptr () +#synonym_t BytePtr , Ptr +#integral_t ByteCount +#integral_t ByteOffset +#integral_t Duration +#synonym_t AbsoluteTime, +#integral_t OptionBits +#integral_t ItemCount +#integral_t PBVersion +#integral_t ScriptCode +#integral_t LangCode +#integral_t RegionCode +#integral_t FourCharCode +#integral_t OSType +#integral_t ResType +#synonym_t OSTypePtr , Ptr +#synonym_t ResTypePtr, Ptr + +#integral_t Boolean + +#callback ProcPtr, IO CLong +#callback Register68kProcPtr, IO () + +#if TARGET_RT_MAC_CFM +# error CFM Carbon is not supported. +#else +# synonym_t UniversalProcPtr , +#endif + +#synonym_t ProcHandle , Ptr +#synonym_t UniversalProcHandle, Ptr + +#synonym_t PRefCon, Ptr () + +#if __LP64__ +# synonym_t URefCon, Ptr () +# synonym_t SRefCon, Ptr () +#else +# integral_t URefCon +# integral_t SRefCon +#endif + +#num noErr +#num kNilOptions +#num kInvalidID +#num kVariableLengthArray +#num kUnknownType + +#integral_t UnicodeScalarValue +#integral_t UTF32Char +#integral_t UniChar +#integral_t UTF16Char +#integral_t UTF8Char +#synonym_t UniCharPtr, Ptr +#integral_t UniCharCount +#synonym_t UniCharCountPtr , Ptr +#synonym_t Str255 , Ptr CUChar +#synonym_t Str63 , Ptr CUChar +#synonym_t Str32 , Ptr CUChar +#synonym_t Str31 , Ptr CUChar +#synonym_t Str27 , Ptr CUChar +#synonym_t Str15 , Ptr CUChar +#synonym_t Str32Field , Ptr CUChar +#synonym_t StrFileName , +#synonym_t StringPtr , Ptr CUChar +#synonym_t StringHandle , Ptr +#synonym_t ConstStringPtr , Ptr CUChar +#synonym_t ConstStr255Param, Ptr CUChar +#synonym_t ConstStr63Param , Ptr CUChar +#synonym_t ConstStr32Param , Ptr CUChar +#synonym_t ConstStr31Param , Ptr CUChar +#synonym_t ConstStr27Param , Ptr CUChar +#synonym_t ConstStr15Param , Ptr CUChar +#synonym_t ConstStrFileNameParam, + +#cinline StrLength, -> IO CUChar + +#starttype struct ProcessSerialNumber +# field highLongOfPSN, +# field lowLongOfPSN , +#stoptype +#synonym_t ProcessSerialNumberPtr, Ptr + +#starttype struct Point +# field v, CShort +# field h, CShort +#stoptype +#synonym_t PointPtr, Ptr + +#starttype struct Rect +# field top , CShort +# field left , CShort +# field bottom, CShort +# field right , CShort +#stoptype +#synonym_t RectPtr, Ptr + +#starttype struct FixedPoint +# field x, +# field y, +#stoptype + +#starttype struct FixedRect +# field top , +# field left , +# field bottom, +# field right , +#stoptype + +#integral_t CharParameter +#num normal +#num bold +#num italic +#num underline +#num outline +#num shadow +#num condense +#num extend + +#integral_t Style +#integral_t StyleParameter +#synonym_t StyleField,