00001 #ifndef __XMP_Const_h__ 00002 #define __XMP_Const_h__ 1 00003 00004 // ================================================================================================= 00005 // Copyright 2002 Adobe Systems Incorporated 00006 // All Rights Reserved. 00007 // 00008 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms 00009 // of the Adobe license agreement accompanying it. 00010 // ================================================================================================= 00011 00012 #include "XMP_Environment.h" 00013 00014 #include <stddef.h> 00015 00016 #if XMP_MacBuild | XMP_iOSBuild // ! No stdint.h on Windows and some UNIXes. 00017 #include <stdint.h> 00018 #endif 00019 #if XMP_UNIXBuild // hopefully an inttypes.h on all UNIXes... 00020 #include <inttypes.h> 00021 #endif 00022 00023 00024 #if __cplusplus 00025 extern "C" { 00026 #endif 00027 00028 // ================================================================================================= 00031 // ================================================================================================= 00032 00033 // ================================================================================================= 00034 // Basic types and constants 00035 // ========================= 00036 00037 // The XMP_... types are used on the off chance that the ..._t types present a problem. In that 00038 // case only the declarations of the XMP_... types needs to change, not all of the uses. These 00039 // types are used where fixed sizes are required in order to have a known ABI for a DLL build. 00040 00041 #if XMP_MacBuild | XMP_iOSBuild 00042 00043 typedef int8_t XMP_Int8; 00044 typedef int16_t XMP_Int16; 00045 typedef int32_t XMP_Int32; 00046 typedef int64_t XMP_Int64; 00047 00048 typedef uint8_t XMP_Uns8; 00049 typedef uint16_t XMP_Uns16; 00050 typedef uint32_t XMP_Uns32; 00051 typedef uint64_t XMP_Uns64; 00052 00053 #elif XMP_WinBuild 00054 00055 typedef signed char XMP_Int8; 00056 typedef signed short XMP_Int16; 00057 typedef signed long XMP_Int32; 00058 typedef signed long long XMP_Int64; 00059 00060 typedef unsigned char XMP_Uns8; 00061 typedef unsigned short XMP_Uns16; 00062 typedef unsigned long XMP_Uns32; 00063 typedef unsigned long long XMP_Uns64; 00064 00065 #elif XMP_UNIXBuild 00066 00067 #if ! XMP_64 00068 00069 typedef signed char XMP_Int8; 00070 typedef signed short XMP_Int16; 00071 typedef signed long XMP_Int32; 00072 typedef signed long long XMP_Int64; 00073 00074 typedef unsigned char XMP_Uns8; 00075 typedef unsigned short XMP_Uns16; 00076 typedef unsigned long XMP_Uns32; 00077 typedef unsigned long long XMP_Uns64; 00078 00079 #else 00080 00081 typedef signed char XMP_Int8; 00082 typedef signed short XMP_Int16; 00083 typedef signed int XMP_Int32; 00084 typedef signed long long XMP_Int64; 00085 00086 typedef unsigned char XMP_Uns8; 00087 typedef unsigned short XMP_Uns16; 00088 typedef unsigned int XMP_Uns32; 00089 typedef unsigned long long XMP_Uns64; 00090 00091 #endif 00092 00093 #else 00094 00095 #error "XMP environment error - must define one of XMP_MacBuild, XMP_WinBuild, XMP_UNIXBuild or XMP_iOSBuild" 00096 00097 #endif 00098 00099 typedef XMP_Uns8 XMP_Bool; 00100 00101 const XMP_Uns8 kXMP_Bool_False = 0; 00102 00103 #define ConvertXMP_BoolToBool(a) (a) != kXMP_Bool_False 00104 #define ConvertBoolToXMP_Bool(a) (a) ? !kXMP_Bool_False : kXMP_Bool_False 00105 00108 typedef struct __XMPMeta__ * XMPMetaRef; 00109 00112 typedef struct __XMPIterator__ * XMPIteratorRef; 00113 00116 typedef struct __XMPDocOps__ * XMPDocOpsRef; 00117 00120 typedef struct __XMPFiles__ * XMPFilesRef; 00121 00122 // ================================================================================================= 00123 00126 00130 00134 00138 00145 00146 typedef const char * XMP_StringPtr; // Points to a null terminated UTF-8 string. 00147 typedef XMP_Uns32 XMP_StringLen; 00148 typedef XMP_Int32 XMP_Index; // Signed, sometimes -1 is handy. 00149 typedef XMP_Uns32 XMP_OptionBits; // Used as 32 individual bits. 00150 00155 00160 00161 #define kXMP_TrueStr "True" // Serialized XMP spellings, not for the type bool. 00162 #define kXMP_FalseStr "False" 00163 00166 enum { 00168 kXMPTS_Yes = 1, 00170 kXMPTS_No = 0, 00172 kXMPTS_Maybe = -1 00173 }; 00174 typedef XMP_Int8 XMP_TriState; 00175 00177 00178 // ================================================================================================= 00179 00199 00200 struct XMP_DateTime { 00201 00203 XMP_Int32 year; 00204 00206 XMP_Int32 month; 00207 00209 XMP_Int32 day; 00210 00212 XMP_Int32 hour; 00213 00215 XMP_Int32 minute; 00216 00218 XMP_Int32 second; 00219 00221 XMP_Bool hasDate; 00222 00224 XMP_Bool hasTime; 00225 00227 XMP_Bool hasTimeZone; 00228 00231 XMP_Int8 tzSign; 00232 00234 XMP_Int32 tzHour; 00235 00237 XMP_Int32 tzMinute; 00238 00240 XMP_Int32 nanoSecond; 00241 00242 #if __cplusplus 00243 XMP_DateTime() : year(0), month(0), day(0), hour(0), minute(0), second(0), nanoSecond(0), 00244 tzSign(0), tzHour(0), tzMinute(0), hasDate(false), hasTime(false), hasTimeZone(false) {}; 00245 #endif 00246 00247 }; 00248 00250 enum { 00252 kXMP_TimeWestOfUTC = -1, 00254 kXMP_TimeIsUTC = 0, 00256 kXMP_TimeEastOfUTC = +1 00257 }; 00258 00259 #define XMPDateTime_IsDateOnly(dt) ((dt).hasDate & (! (dt).hasTime)) 00260 #define XMPDateTime_IsTimeOnly(dt) ((dt).hasTime & (! (dt).hasDate)) 00261 00262 #define XMPDateTime_ClearTimeZone(dt) { (dt).hasTimeZone = (dt).tzSign = (dt).tzHour = (dt).tzMinute = 0; } 00263 00264 // ================================================================================================= 00265 // Standard namespace URI constants 00266 // ================================ 00267 00302 00303 #define kXMP_NS_XMP "http://ns.adobe.com/xap/1.0/" 00304 00305 #define kXMP_NS_XMP_Rights "http://ns.adobe.com/xap/1.0/rights/" 00306 #define kXMP_NS_XMP_MM "http://ns.adobe.com/xap/1.0/mm/" 00307 #define kXMP_NS_XMP_BJ "http://ns.adobe.com/xap/1.0/bj/" 00308 00309 #define kXMP_NS_PDF "http://ns.adobe.com/pdf/1.3/" 00310 #define kXMP_NS_Photoshop "http://ns.adobe.com/photoshop/1.0/" 00311 #define kXMP_NS_PSAlbum "http://ns.adobe.com/album/1.0/" 00312 #define kXMP_NS_EXIF "http://ns.adobe.com/exif/1.0/" 00313 #define kXMP_NS_EXIF_Aux "http://ns.adobe.com/exif/1.0/aux/" 00314 #define kXMP_NS_TIFF "http://ns.adobe.com/tiff/1.0/" 00315 #define kXMP_NS_PNG "http://ns.adobe.com/png/1.0/" 00316 #define kXMP_NS_SWF "http://ns.adobe.com/swf/1.0/" 00317 #define kXMP_NS_JPEG "http://ns.adobe.com/jpeg/1.0/" 00318 #define kXMP_NS_JP2K "http://ns.adobe.com/jp2k/1.0/" 00319 #define kXMP_NS_CameraRaw "http://ns.adobe.com/camera-raw-settings/1.0/" 00320 #define kXMP_NS_DM "http://ns.adobe.com/xmp/1.0/DynamicMedia/" 00321 #define kXMP_NS_Script "http://ns.adobe.com/xmp/1.0/Script/" 00322 #define kXMP_NS_ASF "http://ns.adobe.com/asf/1.0/" 00323 #define kXMP_NS_WAV "http://ns.adobe.com/xmp/wav/1.0/" 00324 #define kXMP_NS_BWF "http://ns.adobe.com/bwf/bext/1.0/" 00325 #define kXMP_NS_AEScart "http://ns.adobe.com/aes/cart/" 00326 #define kXMP_NS_RIFFINFO "http://ns.adobe.com/riff/info/" 00327 00328 #define kXMP_NS_XMP_Note "http://ns.adobe.com/xmp/note/" 00329 00330 #define kXMP_NS_AdobeStockPhoto "http://ns.adobe.com/StockPhoto/1.0/" 00331 #define kXMP_NS_CreatorAtom "http://ns.adobe.com/creatorAtom/1.0/" 00332 00333 #define kXMP_NS_ExifEX "http://cipa.jp/exif/1.0/" 00334 00360 00361 #define kXMP_NS_XMP_IdentifierQual "http://ns.adobe.com/xmp/Identifier/qual/1.0/" 00362 #define kXMP_NS_XMP_Dimensions "http://ns.adobe.com/xap/1.0/sType/Dimensions#" 00363 #define kXMP_NS_XMP_Text "http://ns.adobe.com/xap/1.0/t/" 00364 #define kXMP_NS_XMP_PagedFile "http://ns.adobe.com/xap/1.0/t/pg/" 00365 #define kXMP_NS_XMP_Graphics "http://ns.adobe.com/xap/1.0/g/" 00366 #define kXMP_NS_XMP_Image "http://ns.adobe.com/xap/1.0/g/img/" 00367 #define kXMP_NS_XMP_Font "http://ns.adobe.com/xap/1.0/sType/Font#" 00368 #define kXMP_NS_XMP_ResourceEvent "http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" 00369 #define kXMP_NS_XMP_ResourceRef "http://ns.adobe.com/xap/1.0/sType/ResourceRef#" 00370 #define kXMP_NS_XMP_ST_Version "http://ns.adobe.com/xap/1.0/sType/Version#" 00371 #define kXMP_NS_XMP_ST_Job "http://ns.adobe.com/xap/1.0/sType/Job#" 00372 #define kXMP_NS_XMP_ManifestItem "http://ns.adobe.com/xap/1.0/sType/ManifestItem#" 00373 00374 // Deprecated XML namespace constants 00375 #define kXMP_NS_XMP_T "http://ns.adobe.com/xap/1.0/t/" 00376 #define kXMP_NS_XMP_T_PG "http://ns.adobe.com/xap/1.0/t/pg/" 00377 #define kXMP_NS_XMP_G_IMG "http://ns.adobe.com/xap/1.0/g/img/" 00378 00398 00399 #define kXMP_NS_DC "http://purl.org/dc/elements/1.1/" 00400 00401 #define kXMP_NS_IPTCCore "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" 00402 #define kXMP_NS_IPTCExt "http://iptc.org/std/Iptc4xmpExt/2008-02-29/" 00403 00404 #define kXMP_NS_DICOM "http://ns.adobe.com/DICOM/" 00405 00406 #define kXMP_NS_PLUS "http://ns.useplus.org/ldf/xmp/1.0/" 00407 00408 #define kXMP_NS_PDFA_Schema "http://www.aiim.org/pdfa/ns/schema#" 00409 #define kXMP_NS_PDFA_Property "http://www.aiim.org/pdfa/ns/property#" 00410 #define kXMP_NS_PDFA_Type "http://www.aiim.org/pdfa/ns/type#" 00411 #define kXMP_NS_PDFA_Field "http://www.aiim.org/pdfa/ns/field#" 00412 #define kXMP_NS_PDFA_ID "http://www.aiim.org/pdfa/ns/id/" 00413 #define kXMP_NS_PDFA_Extension "http://www.aiim.org/pdfa/ns/extension/" 00414 00415 #define kXMP_NS_PDFX "http://ns.adobe.com/pdfx/1.3/" 00416 #define kXMP_NS_PDFX_ID "http://www.npes.org/pdfx/ns/id/" 00417 00418 #define kXMP_NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" 00419 #define kXMP_NS_XML "http://www.w3.org/XML/1998/namespace" 00420 00421 // ================================================================================================= 00422 // Enums and macros used for option bits 00423 // ===================================== 00424 00438 00439 #define kXMP_ArrayLastItem ((XMP_Index)(-1L)) 00440 #define kXMP_UseNullTermination ((XMP_StringLen)(~0UL)) 00441 #define kXMP_NoOptions ((XMP_OptionBits)0UL) 00442 00475 00476 #define XMP_SetOption(var,opt) var |= (opt) 00477 #define XMP_ClearOption(var,opt) var &= ~(opt) 00478 #define XMP_TestOption(var,opt) (((var) & (opt)) != 0) 00479 #define XMP_OptionIsSet(var,opt) (((var) & (opt)) != 0) 00480 #define XMP_OptionIsClear(var,opt) (((var) & (opt)) == 0) 00481 00534 00535 #define XMP_PropIsSimple(opt) (((opt) & kXMP_PropCompositeMask) == 0) 00536 #define XMP_PropIsStruct(opt) (((opt) & kXMP_PropValueIsStruct) != 0) 00537 #define XMP_PropIsArray(opt) (((opt) & kXMP_PropValueIsArray) != 0) 00538 00539 #define XMP_ArrayIsUnordered(opt) (((opt) & kXMP_PropArrayIsOrdered) == 0) 00540 #define XMP_ArrayIsOrdered(opt) (((opt) & kXMP_PropArrayIsOrdered) != 0) 00541 #define XMP_ArrayIsAlternate(opt) (((opt) & kXMP_PropArrayIsAlternate) != 0) 00542 #define XMP_ArrayIsAltText(opt) (((opt) & kXMP_PropArrayIsAltText) != 0) 00543 00544 #define XMP_PropHasQualifiers(opt) (((opt) & kXMP_PropHasQualifiers) != 0) 00545 #define XMP_PropIsQualifier(opt) (((opt) & kXMP_PropIsQualifier) != 0) 00546 #define XMP_PropHasLang(opt) (((opt) & kXMP_PropHasLang) != 0) 00547 00548 #define XMP_NodeIsSchema(opt) (((opt) & kXMP_SchemaNode) != 0) 00549 #define XMP_PropIsAlias(opt) (((opt) & kXMP_PropIsAlias) != 0) 00550 00551 // ------------------------------------------------------------------------------------------------- 00552 00554 enum { 00555 00557 kXMP_PropValueIsURI = 0x00000002UL, 00558 00559 // ------------------------------------------------------ 00560 // Options relating to qualifiers attached to a property. 00561 00563 kXMP_PropHasQualifiers = 0x00000010UL, 00564 00569 kXMP_PropIsQualifier = 0x00000020UL, 00570 00572 kXMP_PropHasLang = 0x00000040UL, 00573 00575 kXMP_PropHasType = 0x00000080UL, 00576 00577 // -------------------------------------------- 00578 // Options relating to the data structure form. 00579 00581 kXMP_PropValueIsStruct = 0x00000100UL, 00582 00585 kXMP_PropValueIsArray = 0x00000200UL, 00586 00588 kXMP_PropArrayIsUnordered = kXMP_PropValueIsArray, 00589 00591 kXMP_PropArrayIsOrdered = 0x00000400UL, 00592 00594 kXMP_PropArrayIsAlternate = 0x00000800UL, 00595 00596 // ------------------------------------ 00597 // Additional struct and array options. 00598 00601 kXMP_PropArrayIsAltText = 0x00001000UL, 00602 00603 // kXMP_InsertBeforeItem = 0x00004000UL, ! Used by SetXyz functions. 00604 // kXMP_InsertAfterItem = 0x00008000UL, ! Used by SetXyz functions. 00605 00606 // ---------------------------- 00607 // Other miscellaneous options. 00608 00611 kXMP_PropIsAlias = 0x00010000UL, 00612 00615 kXMP_PropHasAliases = 0x00020000UL, 00616 00618 kXMP_PropIsInternal = 0x00040000UL, 00619 00621 kXMP_PropIsStable = 0x00100000UL, 00622 00624 kXMP_PropIsDerived = 0x00200000UL, 00625 00626 // kXMPUtil_AllowCommas = 0x10000000UL, ! Used by TXMPUtils::CatenateArrayItems and ::SeparateArrayItems. 00627 // kXMP_DeleteExisting = 0x20000000UL, ! Used by TXMPMeta::SetXyz functions to delete any pre-existing property. 00628 // kXMP_SchemaNode = 0x80000000UL, ! Returned by iterators - #define to avoid warnings 00629 00630 // ------------------------------ 00631 // Masks that are multiple flags. 00632 00634 kXMP_PropArrayFormMask = kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText, 00635 00637 kXMP_PropCompositeMask = kXMP_PropValueIsStruct | kXMP_PropArrayFormMask, 00638 00640 kXMP_ImplReservedMask = 0x70000000L 00641 00642 }; 00643 00644 #define kXMP_SchemaNode ((XMP_OptionBits)0x80000000UL) 00645 00654 enum { 00655 00657 kXMP_InsertBeforeItem = 0x00004000UL, 00658 00660 kXMP_InsertAfterItem = 0x00008000UL, 00661 00663 kXMP_DeleteExisting = 0x20000000UL, 00664 00666 kXMP_PropValueOptionsMask = kXMP_PropValueIsURI, 00667 00669 kXMP_PropArrayLocationMask = kXMP_InsertBeforeItem | kXMP_InsertAfterItem 00670 00671 }; 00672 00673 // ------------------------------------------------------------------------------------------------- 00674 00676 enum { 00677 00679 kXMP_RequireXMPMeta = 0x0001UL, 00680 00682 kXMP_ParseMoreBuffers = 0x0002UL, 00683 00685 kXMP_StrictAliasing = 0x0004UL 00686 00687 }; 00688 00690 enum { 00691 00692 // *** Option to remove empty struct/array, or leaf with empty value? 00693 00695 kXMP_OmitPacketWrapper = 0x0010UL, 00696 00698 kXMP_ReadOnlyPacket = 0x0020UL, 00699 00701 kXMP_UseCompactFormat = 0x0040UL, 00702 00704 kXMP_UseCanonicalFormat = 0x0080UL, 00705 00707 kXMP_IncludeThumbnailPad = 0x0100UL, 00708 00710 kXMP_ExactPacketLength = 0x0200UL, 00711 00713 kXMP_OmitAllFormatting = 0x0800UL, 00714 00716 kXMP_OmitXMPMetaElement = 0x1000UL, 00717 00718 _XMP_LittleEndian_Bit = 0x0001UL, // ! Don't use directly, see the combined values below! 00719 _XMP_UTF16_Bit = 0x0002UL, 00720 _XMP_UTF32_Bit = 0x0004UL, 00721 00723 kXMP_EncodingMask = 0x0007UL, 00724 00726 kXMP_EncodeUTF8 = 0UL, 00727 00729 kXMP_EncodeUTF16Big = _XMP_UTF16_Bit, 00730 00732 kXMP_EncodeUTF16Little = _XMP_UTF16_Bit | _XMP_LittleEndian_Bit, 00733 00735 kXMP_EncodeUTF32Big = _XMP_UTF32_Bit, 00736 00738 kXMP_EncodeUTF32Little = _XMP_UTF32_Bit | _XMP_LittleEndian_Bit 00739 00740 }; 00741 00742 // ------------------------------------------------------------------------------------------------- 00743 00745 enum { 00746 00748 kXMP_IterClassMask = 0x00FFUL, 00749 00751 kXMP_IterProperties = 0x0000UL, 00752 00754 kXMP_IterAliases = 0x0001UL, 00755 00757 kXMP_IterNamespaces = 0x0002UL, 00758 00760 kXMP_IterJustChildren = 0x0100UL, 00761 00763 kXMP_IterJustLeafNodes = 0x0200UL, 00764 00766 kXMP_IterJustLeafName = 0x0400UL, 00767 00769 kXMP_IterOmitQualifiers = 0x1000UL 00770 00771 }; 00772 00774 enum { 00775 00777 kXMP_IterSkipSubtree = 0x0001UL, 00778 00780 kXMP_IterSkipSiblings = 0x0002UL 00781 00782 }; 00783 00784 // ------------------------------------------------------------------------------------------------- 00785 00792 enum { 00793 00795 kXMPUtil_AllowCommas = 0x10000000UL 00796 00797 }; 00798 00800 enum { 00801 00803 kXMPTemplate_IncludeInternalProperties = 0x0001UL, 00804 00806 kXMPTemplate_ReplaceExistingProperties = 0x0002UL, 00807 00809 kXMPTemplate_ReplaceWithDeleteEmpty = 0x0004UL, 00810 00812 kXMPTemplate_AddNewProperties = 0x0008UL, 00813 00815 kXMPTemplate_ClearUnnamedProperties = 0x0010UL 00816 00817 }; 00818 00820 enum { 00821 00823 kXMPUtil_DoAllProperties = 0x0001UL, 00824 00826 kXMPUtil_ReplaceOldValues = 0x0002UL, 00827 00829 kXMPUtil_DeleteEmptyValues = 0x0004UL, 00830 00832 kXMPUtil_IncludeAliases = 0x0800UL 00833 00834 }; 00835 00836 // ================================================================================================= 00837 // Types and Constants for XMPFiles 00838 // ================================ 00839 00841 enum SeekMode { kXMP_SeekFromStart, kXMP_SeekFromCurrent, kXMP_SeekFromEnd }; 00842 00844 enum { 00845 00846 // ! Hex used to avoid gcc warnings. Leave the constants so the text reads big endian. There 00847 // ! seems to be no decent way on UNIX to determine the target endianness at compile time. 00848 // ! Forcing it on the client isn't acceptable. 00849 00850 // -------------------- 00851 // Public file formats. 00852 00854 kXMP_PDFFile = 0x50444620UL, 00856 kXMP_PostScriptFile = 0x50532020UL, 00858 kXMP_EPSFile = 0x45505320UL, 00859 00861 kXMP_JPEGFile = 0x4A504547UL, 00863 kXMP_JPEG2KFile = 0x4A505820UL, 00865 kXMP_TIFFFile = 0x54494646UL, 00867 kXMP_GIFFile = 0x47494620UL, 00869 kXMP_PNGFile = 0x504E4720UL, 00870 00872 kXMP_SWFFile = 0x53574620UL, 00874 kXMP_FLAFile = 0x464C4120UL, 00876 kXMP_FLVFile = 0x464C5620UL, 00877 00879 kXMP_MOVFile = 0x4D4F5620UL, 00881 kXMP_AVIFile = 0x41564920UL, 00883 kXMP_CINFile = 0x43494E20UL, 00885 kXMP_WAVFile = 0x57415620UL, 00887 kXMP_MP3File = 0x4D503320UL, 00889 kXMP_SESFile = 0x53455320UL, 00891 kXMP_CELFile = 0x43454C20UL, 00893 kXMP_MPEGFile = 0x4D504547UL, 00895 kXMP_MPEG2File = 0x4D503220UL, 00897 kXMP_MPEG4File = 0x4D503420UL, 00899 kXMP_MXFFile = 0x4D584620UL, 00901 kXMP_WMAVFile = 0x574D4156UL, 00903 kXMP_AIFFFile = 0x41494646UL, 00905 kXMP_REDFile = 0x52454420UL, 00907 kXMP_P2File = 0x50322020UL, 00909 kXMP_XDCAM_FAMFile = 0x58444346UL, 00911 kXMP_XDCAM_SAMFile = 0x58444353UL, 00913 kXMP_XDCAM_EXFile = 0x58444358UL, 00915 kXMP_AVCHDFile = 0x41564844UL, 00917 kXMP_SonyHDVFile = 0x53484456UL, 00919 kXMP_CanonXFFile = 0x434E5846UL, 00920 00922 kXMP_HTMLFile = 0x48544D4CUL, 00924 kXMP_XMLFile = 0x584D4C20UL, 00926 kXMP_TextFile = 0x74657874UL, 00927 00928 // ------------------------------- 00929 // Adobe application file formats. 00930 00932 kXMP_PhotoshopFile = 0x50534420UL, 00934 kXMP_IllustratorFile = 0x41492020UL, 00936 kXMP_InDesignFile = 0x494E4444UL, 00938 kXMP_AEProjectFile = 0x41455020UL, 00940 kXMP_AEProjTemplateFile = 0x41455420UL, 00942 kXMP_AEFilterPresetFile = 0x46465820UL, 00944 kXMP_EncoreProjectFile = 0x4E434F52UL, 00946 kXMP_PremiereProjectFile = 0x5052504AUL, 00948 kXMP_PremiereTitleFile = 0x5052544CUL, 00950 kXMP_UCFFile = 0x55434620UL, 00951 00952 // ------- 00953 // Others. 00954 00956 kXMP_UnknownFile = 0x20202020UL 00957 00958 }; 00959 00961 typedef XMP_Uns32 XMP_FileFormat; 00962 00963 // ------------------------------------------------------------------------------------------------- 00964 00966 enum { 00967 kXMP_CharLittleEndianMask = 1, 00968 kXMP_Char16BitMask = 2, 00969 kXMP_Char32BitMask = 4 00970 }; 00971 00973 enum { 00975 kXMP_Char8Bit = 0, 00977 kXMP_Char16BitBig = kXMP_Char16BitMask, 00979 kXMP_Char16BitLittle = kXMP_Char16BitMask | kXMP_CharLittleEndianMask, 00981 kXMP_Char32BitBig = kXMP_Char32BitMask, 00983 kXMP_Char32BitLittle = kXMP_Char32BitMask | kXMP_CharLittleEndianMask, 00985 kXMP_CharUnknown = 1 00986 }; 00987 01020 01021 #define XMP_CharFormIs16Bit(f) ( ((int)(f) & kXMP_Char16BitMask) != 0 ) 01022 #define XMP_CharFormIs32Bit(f) ( ((int)(f) & kXMP_Char32BitMask) != 0 ) 01023 #define XMP_CharFormIsBigEndian(f) ( ((int)(f) & kXMP_CharLittleEndianMask) == 0 ) 01024 #define XMP_CharFormIsLittleEndian(f) ( ((int)(f) & kXMP_CharLittleEndianMask) != 0 ) 01025 #define XMP_GetCharSize(f) ( ((int)(f)&6) == 0 ? 1 : (int)(f)&6 ) 01026 #define XMP_CharToSerializeForm(cf) ( (XMP_OptionBits)(cf) ) 01027 #define XMP_CharFromSerializeForm(sf) ( (XMP_Uns8)(sf) ) 01028 01031 #define kXMPFiles_UnknownOffset ((XMP_Int64)-1) 01032 01035 #define kXMPFiles_UnknownLength ((XMP_Int32)-1) 01036 01038 struct XMP_PacketInfo { 01039 01041 XMP_Int64 offset; 01043 XMP_Int32 length; 01045 XMP_Int32 padSize; // Zero if unknown. 01046 01048 XMP_Uns8 charForm; 01050 XMP_Bool writeable; 01052 XMP_Bool hasWrapper; 01053 01055 XMP_Uns8 pad; 01056 01058 XMP_PacketInfo() : offset(kXMPFiles_UnknownOffset), length(kXMPFiles_UnknownLength), 01059 padSize(0), charForm(0), writeable(0), hasWrapper(0), pad(0) {}; 01060 01061 }; 01062 01064 enum { 01066 kXMP_PacketInfoVersion = 3 01067 }; 01068 01069 // ------------------------------------------------------------------------------------------------- 01070 01072 enum { 01074 kXMPFiles_IgnoreLocalText = 0x0002, 01076 kXMPFiles_ServerMode = kXMPFiles_IgnoreLocalText 01077 }; 01078 01080 enum { 01081 01083 kXMPFiles_CanInjectXMP = 0x00000001, 01084 01086 kXMPFiles_CanExpand = 0x00000002, 01087 01089 kXMPFiles_CanRewrite = 0x00000004, 01090 01092 kXMPFiles_PrefersInPlace = 0x00000008, 01093 01095 kXMPFiles_CanReconcile = 0x00000010, 01096 01098 kXMPFiles_AllowsOnlyXMP = 0x00000020, 01099 01101 kXMPFiles_ReturnsRawPacket = 0x00000040, 01102 01104 kXMPFiles_HandlerOwnsFile = 0x00000100, 01105 01107 kXMPFiles_AllowsSafeUpdate = 0x00000200, 01108 01110 kXMPFiles_NeedsReadOnlyPacket = 0x00000400, 01111 01113 kXMPFiles_UsesSidecarXMP = 0x00000800, 01114 01116 kXMPFiles_FolderBasedFormat = 0x00001000, 01117 01119 kXMPFiles_CanNotifyProgress = 0x00002000, 01120 01122 kXMPFiles_NeedsPreloading = 0x00004000 01123 01124 }; 01125 01127 enum { 01128 01130 kXMPFiles_OpenForRead = 0x00000001, 01131 01133 kXMPFiles_OpenForUpdate = 0x00000002, 01134 01136 kXMPFiles_OpenOnlyXMP = 0x00000004, 01137 01139 kXMPFiles_ForceGivenHandler = 0x00000008, 01140 01142 kXMPFiles_OpenStrictly = 0x00000010, 01143 01145 kXMPFiles_OpenUseSmartHandler = 0x00000020, 01146 01148 kXMPFiles_OpenUsePacketScanning = 0x00000040, 01149 01151 kXMPFiles_OpenLimitedScanning = 0x00000080, 01152 01154 kXMPFiles_OpenRepairFile = 0x00000100 01155 01156 }; 01157 01159 enum { 01161 kXMPFiles_UpdateSafely = 0x0001 01162 }; 01163 01164 // ================================================================================================= 01165 // Error notification and Exceptions 01166 // ================================= 01167 01191 01192 typedef XMP_Uns8 XMP_ErrorSeverity; 01193 01195 enum { 01197 kXMPErrSev_Recoverable = 0, 01199 kXMPErrSev_OperationFatal = 1, 01201 kXMPErrSev_FileFatal = 2, 01203 kXMPErrSev_ProcessFatal = 3 01204 }; 01205 01206 // ------------------------------------------------------------------------------------------------- 01230 01231 typedef bool (* XMPMeta_ErrorCallbackProc) ( void* context, XMP_ErrorSeverity severity, XMP_Int32 cause, XMP_StringPtr message ); 01232 01233 // ------------------------------------------------------------------------------------------------- 01266 01267 typedef bool (* XMPFiles_ErrorCallbackProc) ( void* context, XMP_StringPtr filePath, XMP_ErrorSeverity severity, XMP_Int32 cause, XMP_StringPtr message ); 01268 01269 // ------------------------------------------------------------------------------------------------- 01271 01272 typedef XMP_Bool (* XMPMeta_ErrorCallbackWrapper) ( XMPMeta_ErrorCallbackProc clientProc, void* context, 01273 XMP_ErrorSeverity severity, XMP_Int32 cause, XMP_StringPtr message ); 01274 01275 typedef XMP_Bool (* XMPFiles_ErrorCallbackWrapper) ( XMPFiles_ErrorCallbackProc clientProc, void* context, 01276 XMP_StringPtr filePath, XMP_ErrorSeverity severity, 01277 XMP_Int32 cause, XMP_StringPtr message ); 01278 01280 class XMP_Error { 01281 public: 01282 01289 XMP_Error ( XMP_Int32 _id, XMP_StringPtr _errMsg ) : id(_id), errMsg(_errMsg), notified(false) {}; 01290 01292 inline XMP_Int32 GetID() const { return id; }; 01293 01295 inline XMP_StringPtr GetErrMsg() const { return errMsg; }; 01296 01298 inline XMP_Bool IsNotified() const { return notified; } 01299 01301 inline void SetNotified() { notified = true; }; 01302 01303 private: 01305 XMP_Int32 id; 01308 XMP_StringPtr errMsg; 01310 XMP_Bool notified; 01311 }; 01312 01314 enum { 01315 01316 // -------------------- 01318 01320 kXMPErr_NoError = -1, 01321 01323 kXMPErr_Unknown = 0, 01325 kXMPErr_TBD = 1, 01327 kXMPErr_Unavailable = 2, 01329 kXMPErr_BadObject = 3, 01331 kXMPErr_BadParam = 4, 01333 kXMPErr_BadValue = 5, 01335 kXMPErr_AssertFailure = 6, 01337 kXMPErr_EnforceFailure = 7, 01339 kXMPErr_Unimplemented = 8, 01341 kXMPErr_InternalFailure = 9, 01343 kXMPErr_Deprecated = 10, 01345 kXMPErr_ExternalFailure = 11, 01347 kXMPErr_UserAbort = 12, 01349 kXMPErr_StdException = 13, 01351 kXMPErr_UnknownException = 14, 01353 kXMPErr_NoMemory = 15, 01355 kXMPErr_ProgressAbort = 16, 01356 01357 // ------------------------------------ 01358 // More specific parameter error codes. 01359 01361 kXMPErr_BadSchema = 101, 01363 kXMPErr_BadXPath = 102, 01365 kXMPErr_BadOptions = 103, 01367 kXMPErr_BadIndex = 104, 01369 kXMPErr_BadIterPosition = 105, 01371 kXMPErr_BadParse = 106, 01373 kXMPErr_BadSerialize = 107, 01375 kXMPErr_BadFileFormat = 108, 01377 kXMPErr_NoFileHandler = 109, 01379 kXMPErr_TooLargeForJPEG = 110, 01381 kXMPErr_NoFile = 111, 01383 kXMPErr_FilePermission = 112, 01385 kXMPErr_DiskSpace = 113, 01387 kXMPErr_ReadError = 114, 01389 kXMPErr_WriteError = 115, 01391 kXMPErr_BadBlockFormat = 116, 01393 kXMPErr_FilePathNotAFile = 117, 01395 kXMPErr_RejectedFileExtension = 118, 01396 01397 // ----------------------------------------------- 01398 // File format and internal structure error codes. 01399 01401 kXMPErr_BadXML = 201, 01403 kXMPErr_BadRDF = 202, 01405 kXMPErr_BadXMP = 203, 01407 kXMPErr_EmptyIterator = 204, 01409 kXMPErr_BadUnicode = 205, 01411 kXMPErr_BadTIFF = 206, 01413 kXMPErr_BadJPEG = 207, 01415 kXMPErr_BadPSD = 208, 01417 kXMPErr_BadPSIR = 209, 01419 kXMPErr_BadIPTC = 210, 01421 kXMPErr_BadMPEG = 211 01422 01423 }; 01424 01426 01427 // ================================================================================================= 01428 // Client callbacks 01429 // ================ 01430 01431 // ------------------------------------------------------------------------------------------------- 01434 01439 01440 typedef XMP_Int32 XMP_Status; 01441 01442 // ------------------------------------------------------------------------------------------------- 01457 01458 typedef XMP_Status (* XMP_TextOutputProc) ( void * refCon, 01459 XMP_StringPtr buffer, 01460 XMP_StringLen bufferSize ); 01461 01462 // ------------------------------------------------------------------------------------------------- 01471 01472 typedef bool (* XMP_AbortProc) ( void * arg ); 01473 01474 // ------------------------------------------------------------------------------------------------- 01494 01495 typedef bool (* XMP_ProgressReportProc) ( void * context, float elapsedTime, float fractionDone, float secondsToGo ); 01496 01497 // ------------------------------------------------------------------------------------------------- 01499 01500 typedef XMP_Bool (* XMP_ProgressReportWrapper) ( XMP_ProgressReportProc proc, void * context, 01501 float elapsedTime, float fractionDone, float secondsToGo ); 01502 01504 01505 // ================================================================================================= 01506 // Stuff with no better place to be 01507 // ================================ 01508 01510 typedef struct XMP_VersionInfo { 01512 XMP_Uns8 major; 01514 XMP_Uns8 minor; 01516 XMP_Uns8 micro; 01518 XMP_Bool isDebug; 01520 XMP_Uns32 build; 01522 XMP_Uns32 flags; 01524 XMP_StringPtr message; 01525 } XMP_VersionInfo; 01526 01527 // ================================================================================================= 01528 01529 #if __cplusplus 01530 } // extern "C" 01531 #endif 01532 01533 #include <vector> 01534 01535 #endif // __XMP_Const_h__