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 // ! 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 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 #if ! XMP_64 00067 typedef signed char XMP_Int8; 00068 typedef signed short XMP_Int16; 00069 typedef signed long XMP_Int32; 00070 typedef signed long long XMP_Int64; 00071 00072 typedef unsigned char XMP_Uns8; 00073 typedef unsigned short XMP_Uns16; 00074 typedef unsigned long XMP_Uns32; 00075 typedef unsigned long long XMP_Uns64; 00076 #else 00077 typedef signed char XMP_Int8; 00078 typedef signed short XMP_Int16; 00079 typedef signed int XMP_Int32; 00080 typedef signed long long XMP_Int64; 00081 00082 typedef unsigned char XMP_Uns8; 00083 typedef unsigned short XMP_Uns16; 00084 typedef unsigned int XMP_Uns32; 00085 typedef unsigned long long XMP_Uns64; 00086 #endif 00087 00088 #else 00089 00090 #error "XMP environment error - must define one of XMP_MacBuild, XMP_WinBuild, or XMP_UNIXBuild" 00091 00092 #endif 00093 00094 typedef XMP_Uns8 XMP_Bool; 00095 00098 typedef struct __XMPMeta__ * XMPMetaRef; 00099 00102 typedef struct __XMPIterator__ * XMPIteratorRef; 00103 00106 typedef struct __XMPDocOps__ * XMPDocOpsRef; 00107 00110 typedef struct __XMPFiles__ * XMPFilesRef; 00111 00112 // ================================================================================================= 00113 00116 00120 00124 00128 00135 00136 typedef const char * XMP_StringPtr; // Points to a null terminated UTF-8 string. 00137 typedef XMP_Uns32 XMP_StringLen; 00138 typedef XMP_Int32 XMP_Index; // Signed, sometimes -1 is handy. 00139 typedef XMP_Uns32 XMP_OptionBits; // Used as 32 individual bits. 00140 00145 00150 00151 #define kXMP_TrueStr "True" // Serialized XMP spellings, not for the type bool. 00152 #define kXMP_FalseStr "False" 00153 00156 enum { 00158 kXMPTS_Yes = 1, 00160 kXMPTS_No = 0, 00162 kXMPTS_Maybe = -1 00163 }; 00164 typedef XMP_Int8 XMP_TriState; 00165 00167 00168 // ================================================================================================= 00169 00189 00190 struct XMP_DateTime { 00191 00193 XMP_Int32 year; 00194 00196 XMP_Int32 month; 00197 00199 XMP_Int32 day; 00200 00202 XMP_Int32 hour; 00203 00205 XMP_Int32 minute; 00206 00208 XMP_Int32 second; 00209 00211 XMP_Bool hasDate; 00212 00214 XMP_Bool hasTime; 00215 00217 XMP_Bool hasTimeZone; 00218 00221 XMP_Int8 tzSign; 00222 00224 XMP_Int32 tzHour; 00225 00227 XMP_Int32 tzMinute; 00228 00230 XMP_Int32 nanoSecond; 00231 00232 #if __cplusplus 00233 XMP_DateTime() : year(0), month(0), day(0), hour(0), minute(0), second(0), nanoSecond(0), 00234 tzSign(0), tzHour(0), tzMinute(0), hasDate(false), hasTime(false), hasTimeZone(false) {}; 00235 #endif 00236 00237 }; 00238 00240 enum { 00242 kXMP_TimeWestOfUTC = -1, 00244 kXMP_TimeIsUTC = 0, 00246 kXMP_TimeEastOfUTC = +1 00247 }; 00248 00249 #define XMPDateTime_IsDateOnly(dt) ((dt).hasDate & (! (dt).hasTime)) 00250 #define XMPDateTime_IsTimeOnly(dt) ((dt).hasTime & (! (dt).hasDate)) 00251 00252 #define XMPDateTime_ClearTimeZone(dt) { (dt).hasTimeZone = (dt).tzSign = (dt).tzHour = (dt).tzMinute = 0; } 00253 00254 // ================================================================================================= 00255 // Standard namespace URI constants 00256 // ================================ 00257 00292 00293 #define kXMP_NS_XMP "http://ns.adobe.com/xap/1.0/" 00294 00295 #define kXMP_NS_XMP_Rights "http://ns.adobe.com/xap/1.0/rights/" 00296 #define kXMP_NS_XMP_MM "http://ns.adobe.com/xap/1.0/mm/" 00297 #define kXMP_NS_XMP_BJ "http://ns.adobe.com/xap/1.0/bj/" 00298 00299 #define kXMP_NS_PDF "http://ns.adobe.com/pdf/1.3/" 00300 #define kXMP_NS_Photoshop "http://ns.adobe.com/photoshop/1.0/" 00301 #define kXMP_NS_PSAlbum "http://ns.adobe.com/album/1.0/" 00302 #define kXMP_NS_EXIF "http://ns.adobe.com/exif/1.0/" 00303 #define kXMP_NS_EXIF_Aux "http://ns.adobe.com/exif/1.0/aux/" 00304 #define kXMP_NS_TIFF "http://ns.adobe.com/tiff/1.0/" 00305 #define kXMP_NS_PNG "http://ns.adobe.com/png/1.0/" 00306 #define kXMP_NS_SWF "http://ns.adobe.com/swf/1.0/" 00307 #define kXMP_NS_JPEG "http://ns.adobe.com/jpeg/1.0/" 00308 #define kXMP_NS_JP2K "http://ns.adobe.com/jp2k/1.0/" 00309 #define kXMP_NS_CameraRaw "http://ns.adobe.com/camera-raw-settings/1.0/" 00310 #define kXMP_NS_DM "http://ns.adobe.com/xmp/1.0/DynamicMedia/" 00311 #define kXMP_NS_Script "http://ns.adobe.com/xmp/1.0/Script/" 00312 #define kXMP_NS_ASF "http://ns.adobe.com/asf/1.0/" 00313 #define kXMP_NS_WAV "http://ns.adobe.com/xmp/wav/1.0/" 00314 #define kXMP_NS_BWF "http://ns.adobe.com/bwf/bext/1.0/" 00315 00316 #define kXMP_NS_XMP_Note "http://ns.adobe.com/xmp/note/" 00317 00318 #define kXMP_NS_AdobeStockPhoto "http://ns.adobe.com/StockPhoto/1.0/" 00319 #define kXMP_NS_CreatorAtom "http://ns.adobe.com/creatorAtom/1.0/" 00320 00346 00347 #define kXMP_NS_XMP_IdentifierQual "http://ns.adobe.com/xmp/Identifier/qual/1.0/" 00348 #define kXMP_NS_XMP_Dimensions "http://ns.adobe.com/xap/1.0/sType/Dimensions#" 00349 #define kXMP_NS_XMP_Text "http://ns.adobe.com/xap/1.0/t/" 00350 #define kXMP_NS_XMP_PagedFile "http://ns.adobe.com/xap/1.0/t/pg/" 00351 #define kXMP_NS_XMP_Graphics "http://ns.adobe.com/xap/1.0/g/" 00352 #define kXMP_NS_XMP_Image "http://ns.adobe.com/xap/1.0/g/img/" 00353 #define kXMP_NS_XMP_Font "http://ns.adobe.com/xap/1.0/sType/Font#" 00354 #define kXMP_NS_XMP_ResourceEvent "http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" 00355 #define kXMP_NS_XMP_ResourceRef "http://ns.adobe.com/xap/1.0/sType/ResourceRef#" 00356 #define kXMP_NS_XMP_ST_Version "http://ns.adobe.com/xap/1.0/sType/Version#" 00357 #define kXMP_NS_XMP_ST_Job "http://ns.adobe.com/xap/1.0/sType/Job#" 00358 #define kXMP_NS_XMP_ManifestItem "http://ns.adobe.com/xap/1.0/sType/ManifestItem#" 00359 00360 // Deprecated XML namespace constants 00361 #define kXMP_NS_XMP_T "http://ns.adobe.com/xap/1.0/t/" 00362 #define kXMP_NS_XMP_T_PG "http://ns.adobe.com/xap/1.0/t/pg/" 00363 #define kXMP_NS_XMP_G_IMG "http://ns.adobe.com/xap/1.0/g/img/" 00364 00381 00382 #define kXMP_NS_DC "http://purl.org/dc/elements/1.1/" 00383 00384 #define kXMP_NS_IPTCCore "http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" 00385 00386 #define kXMP_NS_DICOM "http://ns.adobe.com/DICOM/" 00387 00388 #define kXMP_NS_PDFA_Schema "http://www.aiim.org/pdfa/ns/schema#" 00389 #define kXMP_NS_PDFA_Property "http://www.aiim.org/pdfa/ns/property#" 00390 #define kXMP_NS_PDFA_Type "http://www.aiim.org/pdfa/ns/type#" 00391 #define kXMP_NS_PDFA_Field "http://www.aiim.org/pdfa/ns/field#" 00392 #define kXMP_NS_PDFA_ID "http://www.aiim.org/pdfa/ns/id/" 00393 #define kXMP_NS_PDFA_Extension "http://www.aiim.org/pdfa/ns/extension/" 00394 00395 #define kXMP_NS_PDFX "http://ns.adobe.com/pdfx/1.3/" 00396 #define kXMP_NS_PDFX_ID "http://www.npes.org/pdfx/ns/id/" 00397 00398 #define kXMP_NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" 00399 #define kXMP_NS_XML "http://www.w3.org/XML/1998/namespace" 00400 00401 // ================================================================================================= 00402 // Enums and macros used for option bits 00403 // ===================================== 00404 00418 00419 #define kXMP_ArrayLastItem ((XMP_Index)(-1L)) 00420 #define kXMP_UseNullTermination ((XMP_StringLen)(~0UL)) 00421 #define kXMP_NoOptions ((XMP_OptionBits)0UL) 00422 00455 00456 #define XMP_SetOption(var,opt) var |= (opt) 00457 #define XMP_ClearOption(var,opt) var &= ~(opt) 00458 #define XMP_TestOption(var,opt) (((var) & (opt)) != 0) 00459 #define XMP_OptionIsSet(var,opt) (((var) & (opt)) != 0) 00460 #define XMP_OptionIsClear(var,opt) (((var) & (opt)) == 0) 00461 00514 00515 #define XMP_PropIsSimple(opt) (((opt) & kXMP_PropCompositeMask) == 0) 00516 #define XMP_PropIsStruct(opt) (((opt) & kXMP_PropValueIsStruct) != 0) 00517 #define XMP_PropIsArray(opt) (((opt) & kXMP_PropValueIsArray) != 0) 00518 00519 #define XMP_ArrayIsUnordered(opt) (((opt) & kXMP_PropArrayIsOrdered) == 0) 00520 #define XMP_ArrayIsOrdered(opt) (((opt) & kXMP_PropArrayIsOrdered) != 0) 00521 #define XMP_ArrayIsAlternate(opt) (((opt) & kXMP_PropArrayIsAlternate) != 0) 00522 #define XMP_ArrayIsAltText(opt) (((opt) & kXMP_PropArrayIsAltText) != 0) 00523 00524 #define XMP_PropHasQualifiers(opt) (((opt) & kXMP_PropHasQualifiers) != 0) 00525 #define XMP_PropIsQualifier(opt) (((opt) & kXMP_PropIsQualifier) != 0) 00526 #define XMP_PropHasLang(opt) (((opt) & kXMP_PropHasLang) != 0) 00527 00528 #define XMP_NodeIsSchema(opt) (((opt) & kXMP_SchemaNode) != 0) 00529 #define XMP_PropIsAlias(opt) (((opt) & kXMP_PropIsAlias) != 0) 00530 00531 // ------------------------------------------------------------------------------------------------- 00532 00534 enum { 00535 00537 kXMP_PropValueIsURI = 0x00000002UL, 00538 00539 // ------------------------------------------------------ 00540 // Options relating to qualifiers attached to a property. 00541 00543 kXMP_PropHasQualifiers = 0x00000010UL, 00544 00549 kXMP_PropIsQualifier = 0x00000020UL, 00550 00552 kXMP_PropHasLang = 0x00000040UL, 00553 00555 kXMP_PropHasType = 0x00000080UL, 00556 00557 // -------------------------------------------- 00558 // Options relating to the data structure form. 00559 00561 kXMP_PropValueIsStruct = 0x00000100UL, 00562 00565 kXMP_PropValueIsArray = 0x00000200UL, 00566 00568 kXMP_PropArrayIsUnordered = kXMP_PropValueIsArray, 00569 00571 kXMP_PropArrayIsOrdered = 0x00000400UL, 00572 00574 kXMP_PropArrayIsAlternate = 0x00000800UL, 00575 00576 // ------------------------------------ 00577 // Additional struct and array options. 00578 00581 kXMP_PropArrayIsAltText = 0x00001000UL, 00582 00583 // kXMP_InsertBeforeItem = 0x00004000UL, ! Used by SetXyz functions. 00584 // kXMP_InsertAfterItem = 0x00008000UL, ! Used by SetXyz functions. 00585 00586 // ---------------------------- 00587 // Other miscellaneous options. 00588 00591 kXMP_PropIsAlias = 0x00010000UL, 00592 00595 kXMP_PropHasAliases = 0x00020000UL, 00596 00598 kXMP_PropIsInternal = 0x00040000UL, 00599 00601 kXMP_PropIsStable = 0x00100000UL, 00602 00604 kXMP_PropIsDerived = 0x00200000UL, 00605 00606 // kXMPUtil_AllowCommas = 0x10000000UL, ! Used by TXMPUtils::CatenateArrayItems and ::SeparateArrayItems. 00607 // kXMP_DeleteExisting = 0x20000000UL, ! Used by TXMPMeta::SetXyz functions to delete any pre-existing property. 00608 // kXMP_SchemaNode = 0x80000000UL, ! Returned by iterators - #define to avoid warnings 00609 00610 // ------------------------------ 00611 // Masks that are multiple flags. 00612 00614 kXMP_PropArrayFormMask = kXMP_PropValueIsArray | kXMP_PropArrayIsOrdered | kXMP_PropArrayIsAlternate | kXMP_PropArrayIsAltText, 00615 00617 kXMP_PropCompositeMask = kXMP_PropValueIsStruct | kXMP_PropArrayFormMask, 00618 00620 kXMP_ImplReservedMask = 0x70000000L 00621 00622 }; 00623 00624 #define kXMP_SchemaNode ((XMP_OptionBits)0x80000000UL) 00625 00634 enum { 00635 00637 kXMP_InsertBeforeItem = 0x00004000UL, 00638 00640 kXMP_InsertAfterItem = 0x00008000UL, 00641 00643 kXMP_DeleteExisting = 0x20000000UL, 00644 00646 kXMP_PropValueOptionsMask = kXMP_PropValueIsURI, 00647 00649 kXMP_PropArrayLocationMask = kXMP_InsertBeforeItem | kXMP_InsertAfterItem 00650 00651 }; 00652 00653 // ------------------------------------------------------------------------------------------------- 00654 00656 enum { 00657 00659 kXMP_RequireXMPMeta = 0x0001UL, 00660 00662 kXMP_ParseMoreBuffers = 0x0002UL, 00663 00665 kXMP_StrictAliasing = 0x0004UL 00666 00667 }; 00668 00670 enum { 00671 00672 // *** Option to remove empty struct/array, or leaf with empty value? 00673 00675 kXMP_OmitPacketWrapper = 0x0010UL, 00676 00678 kXMP_ReadOnlyPacket = 0x0020UL, 00679 00681 kXMP_UseCompactFormat = 0x0040UL, 00682 00684 kXMP_IncludeThumbnailPad = 0x0100UL, 00685 00687 kXMP_ExactPacketLength = 0x0200UL, 00688 00690 kXMP_OmitAllFormatting = 0x0800UL, 00691 00693 kXMP_OmitXMPMetaElement = 0x1000UL, 00694 00695 _XMP_LittleEndian_Bit = 0x0001UL, // ! Don't use directly, see the combined values below! 00696 _XMP_UTF16_Bit = 0x0002UL, 00697 _XMP_UTF32_Bit = 0x0004UL, 00698 00700 kXMP_EncodingMask = 0x0007UL, 00701 00703 kXMP_EncodeUTF8 = 0UL, 00704 00706 kXMP_EncodeUTF16Big = _XMP_UTF16_Bit, 00707 00709 kXMP_EncodeUTF16Little = _XMP_UTF16_Bit | _XMP_LittleEndian_Bit, 00710 00712 kXMP_EncodeUTF32Big = _XMP_UTF32_Bit, 00713 00715 kXMP_EncodeUTF32Little = _XMP_UTF32_Bit | _XMP_LittleEndian_Bit 00716 00717 }; 00718 00719 // ------------------------------------------------------------------------------------------------- 00720 00722 enum { 00723 00725 kXMP_IterClassMask = 0x00FFUL, 00726 00728 kXMP_IterProperties = 0x0000UL, 00729 00731 kXMP_IterAliases = 0x0001UL, 00732 00734 kXMP_IterNamespaces = 0x0002UL, 00735 00737 kXMP_IterJustChildren = 0x0100UL, 00738 00740 kXMP_IterJustLeafNodes = 0x0200UL, 00741 00743 kXMP_IterJustLeafName = 0x0400UL, 00744 00746 kXMP_IterOmitQualifiers = 0x1000UL 00747 00748 }; 00749 00751 enum { 00752 00754 kXMP_IterSkipSubtree = 0x0001UL, 00755 00757 kXMP_IterSkipSiblings = 0x0002UL 00758 00759 }; 00760 00761 // ------------------------------------------------------------------------------------------------- 00762 00769 enum { 00770 00772 kXMPUtil_AllowCommas = 0x10000000UL 00773 00774 }; 00775 00777 enum { 00778 00780 kXMPTemplate_IncludeInternalProperties = 0x0001UL, 00781 00783 kXMPTemplate_ReplaceExistingProperties = 0x0002UL, 00784 00786 kXMPTemplate_ReplaceWithDeleteEmpty = 0x0004UL, 00787 00789 kXMPTemplate_AddNewProperties = 0x0008UL, 00790 00792 kXMPTemplate_ClearUnnamedProperties = 0x0010UL 00793 00794 }; 00795 00797 enum { 00798 00800 kXMPUtil_DoAllProperties = 0x0001UL, 00801 00803 kXMPUtil_ReplaceOldValues = 0x0002UL, 00804 00806 kXMPUtil_DeleteEmptyValues = 0x0004UL, 00807 00809 kXMPUtil_IncludeAliases = 0x0800UL 00810 00811 }; 00812 00813 // ================================================================================================= 00814 // Types and Constants for XMPFiles 00815 // ================================ 00816 00818 enum { 00819 00820 // ! Hex used to avoid gcc warnings. Leave the constants so the text reads big endian. There 00821 // ! seems to be no decent way on UNIX to determine the target endianness at compile time. 00822 // ! Forcing it on the client isn't acceptable. 00823 00824 // -------------------- 00825 // Public file formats. 00826 00828 kXMP_PDFFile = 0x50444620UL, 00830 kXMP_PostScriptFile = 0x50532020UL, 00832 kXMP_EPSFile = 0x45505320UL, 00833 00835 kXMP_JPEGFile = 0x4A504547UL, 00837 kXMP_JPEG2KFile = 0x4A505820UL, 00839 kXMP_TIFFFile = 0x54494646UL, 00841 kXMP_GIFFile = 0x47494620UL, 00843 kXMP_PNGFile = 0x504E4720UL, 00844 00846 kXMP_SWFFile = 0x53574620UL, 00848 kXMP_FLAFile = 0x464C4120UL, 00850 kXMP_FLVFile = 0x464C5620UL, 00851 00853 kXMP_MOVFile = 0x4D4F5620UL, 00855 kXMP_AVIFile = 0x41564920UL, 00857 kXMP_CINFile = 0x43494E20UL, 00859 kXMP_WAVFile = 0x57415620UL, 00861 kXMP_MP3File = 0x4D503320UL, 00863 kXMP_SESFile = 0x53455320UL, 00865 kXMP_CELFile = 0x43454C20UL, 00867 kXMP_MPEGFile = 0x4D504547UL, 00869 kXMP_MPEG2File = 0x4D503220UL, 00871 kXMP_MPEG4File = 0x4D503420UL, 00873 kXMP_WMAVFile = 0x574D4156UL, 00875 kXMP_AIFFFile = 0x41494646UL, 00877 kXMP_P2File = 0x50322020UL, 00879 kXMP_XDCAM_FAMFile = 0x58444346UL, 00881 kXMP_XDCAM_SAMFile = 0x58444353UL, 00883 kXMP_XDCAM_EXFile = 0x58444358UL, 00885 kXMP_AVCHDFile = 0x41564844UL, 00887 kXMP_SonyHDVFile = 0x53484456UL, 00888 00890 kXMP_HTMLFile = 0x48544D4CUL, 00892 kXMP_XMLFile = 0x584D4C20UL, 00894 kXMP_TextFile = 0x74657874UL, 00895 00896 // ------------------------------- 00897 // Adobe application file formats. 00898 00900 kXMP_PhotoshopFile = 0x50534420UL, 00902 kXMP_IllustratorFile = 0x41492020UL, 00904 kXMP_InDesignFile = 0x494E4444UL, 00906 kXMP_AEProjectFile = 0x41455020UL, 00908 kXMP_AEProjTemplateFile = 0x41455420UL, 00910 kXMP_AEFilterPresetFile = 0x46465820UL, 00912 kXMP_EncoreProjectFile = 0x4E434F52UL, 00914 kXMP_PremiereProjectFile = 0x5052504AUL, 00916 kXMP_PremiereTitleFile = 0x5052544CUL, 00918 kXMP_UCFFile = 0x55434620UL, 00919 00920 // ------- 00921 // Others. 00922 00924 kXMP_UnknownFile = 0x20202020UL 00925 00926 }; 00927 00929 typedef XMP_Uns32 XMP_FileFormat; 00930 00931 // ------------------------------------------------------------------------------------------------- 00932 00934 enum { 00935 kXMP_CharLittleEndianMask = 1, 00936 kXMP_Char16BitMask = 2, 00937 kXMP_Char32BitMask = 4 00938 }; 00939 00941 enum { 00943 kXMP_Char8Bit = 0, 00945 kXMP_Char16BitBig = kXMP_Char16BitMask, 00947 kXMP_Char16BitLittle = kXMP_Char16BitMask | kXMP_CharLittleEndianMask, 00949 kXMP_Char32BitBig = kXMP_Char32BitMask, 00951 kXMP_Char32BitLittle = kXMP_Char32BitMask | kXMP_CharLittleEndianMask, 00953 kXMP_CharUnknown = 1 00954 }; 00955 00988 00989 #define XMP_CharFormIs16Bit(f) ( ((int)(f) & kXMP_Char16BitMask) != 0 ) 00990 #define XMP_CharFormIs32Bit(f) ( ((int)(f) & kXMP_Char32BitMask) != 0 ) 00991 #define XMP_CharFormIsBigEndian(f) ( ((int)(f) & kXMP_CharLittleEndianMask) == 0 ) 00992 #define XMP_CharFormIsLittleEndian(f) ( ((int)(f) & kXMP_CharLittleEndianMask) != 0 ) 00993 #define XMP_GetCharSize(f) ( ((int)(f)&6) == 0 ? 1 : (int)(f)&6 ) 00994 #define XMP_CharToSerializeForm(cf) ( (XMP_OptionBits)(cf) ) 00995 #define XMP_CharFromSerializeForm(sf) ( (XMP_Uns8)(sf) ) 00996 00999 #define kXMPFiles_UnknownOffset ((XMP_Int64)-1) 01000 01003 #define kXMPFiles_UnknownLength ((XMP_Int32)-1) 01004 01006 struct XMP_PacketInfo { 01007 01009 XMP_Int64 offset; 01011 XMP_Int32 length; 01013 XMP_Int32 padSize; // Zero if unknown. 01014 01016 XMP_Uns8 charForm; 01018 XMP_Bool writeable; 01020 XMP_Bool hasWrapper; 01021 01023 XMP_Uns8 pad; 01024 01026 XMP_PacketInfo() : offset(kXMPFiles_UnknownOffset), length(kXMPFiles_UnknownLength), 01027 padSize(0), charForm(0), writeable(0), hasWrapper(0), pad(0) {}; 01028 01029 }; 01030 01032 enum { 01034 kXMP_PacketInfoVersion = 3 01035 }; 01036 01037 // ------------------------------------------------------------------------------------------------- 01038 01040 enum { 01042 kXMPFiles_IgnoreLocalText = 0x0002, 01044 kXMPFiles_ServerMode = kXMPFiles_IgnoreLocalText 01045 }; 01046 01048 enum { 01049 01051 kXMPFiles_CanInjectXMP = 0x00000001, 01052 01054 kXMPFiles_CanExpand = 0x00000002, 01055 01057 kXMPFiles_CanRewrite = 0x00000004, 01058 01060 kXMPFiles_PrefersInPlace = 0x00000008, 01061 01063 kXMPFiles_CanReconcile = 0x00000010, 01064 01066 kXMPFiles_AllowsOnlyXMP = 0x00000020, 01067 01069 kXMPFiles_ReturnsRawPacket = 0x00000040, 01070 01072 kXMPFiles_HandlerOwnsFile = 0x00000100, 01073 01075 kXMPFiles_AllowsSafeUpdate = 0x00000200, 01076 01078 kXMPFiles_NeedsReadOnlyPacket = 0x00000400, 01079 01081 kXMPFiles_UsesSidecarXMP = 0x00000800, 01082 01084 kXMPFiles_FolderBasedFormat = 0x00001000 01085 01086 }; 01087 01089 enum { 01090 01092 kXMPFiles_OpenForRead = 0x00000001, 01093 01095 kXMPFiles_OpenForUpdate = 0x00000002, 01096 01098 kXMPFiles_OpenOnlyXMP = 0x00000004, 01099 01101 kXMPFiles_OpenStrictly = 0x00000010, 01102 01104 kXMPFiles_OpenUseSmartHandler = 0x00000020, 01105 01107 kXMPFiles_OpenUsePacketScanning = 0x00000040, 01108 01110 kXMPFiles_OpenLimitedScanning = 0x00000080, 01111 01113 kXMPFiles_OpenRepairFile = 0x00000100 01114 01115 }; 01116 01118 enum { 01120 kXMPFiles_UpdateSafely = 0x0001 01121 }; 01122 01123 // ================================================================================================= 01124 // Exception codes 01125 // =============== 01126 01140 01142 class XMP_Error { 01143 public: 01144 01151 XMP_Error ( XMP_Int32 _id, XMP_StringPtr _errMsg ) : id(_id), errMsg(_errMsg) {}; 01152 01154 inline XMP_Int32 GetID() const { return id; }; 01155 01157 inline XMP_StringPtr GetErrMsg() const { return errMsg; }; 01158 01159 private: 01161 XMP_Int32 id; 01164 XMP_StringPtr errMsg; 01165 }; 01166 01168 enum { 01169 01170 // -------------------- 01171 // Generic error codes. 01172 01174 kXMPErr_Unknown = 0, 01176 kXMPErr_TBD = 1, 01178 kXMPErr_Unavailable = 2, 01180 kXMPErr_BadObject = 3, 01182 kXMPErr_BadParam = 4, 01184 kXMPErr_BadValue = 5, 01186 kXMPErr_AssertFailure = 6, 01188 kXMPErr_EnforceFailure = 7, 01190 kXMPErr_Unimplemented = 8, 01192 kXMPErr_InternalFailure = 9, 01194 kXMPErr_Deprecated = 10, 01196 kXMPErr_ExternalFailure = 11, 01198 kXMPErr_UserAbort = 12, 01200 kXMPErr_StdException = 13, 01202 kXMPErr_UnknownException = 14, 01204 kXMPErr_NoMemory = 15, 01205 01206 // ------------------------------------ 01207 // More specific parameter error codes. 01208 01210 kXMPErr_BadSchema = 101, 01212 kXMPErr_BadXPath = 102, 01214 kXMPErr_BadOptions = 103, 01216 kXMPErr_BadIndex = 104, 01218 kXMPErr_BadIterPosition = 105, 01220 kXMPErr_BadParse = 106, 01222 kXMPErr_BadSerialize = 107, 01224 kXMPErr_BadFileFormat = 108, 01226 kXMPErr_NoFileHandler = 109, 01228 kXMPErr_TooLargeForJPEG = 110, 01229 01230 // ----------------------------------------------- 01231 // File format and internal structure error codes. 01232 01234 kXMPErr_BadXML = 201, 01236 kXMPErr_BadRDF = 202, 01238 kXMPErr_BadXMP = 203, 01240 kXMPErr_EmptyIterator = 204, 01242 kXMPErr_BadUnicode = 205, 01244 kXMPErr_BadTIFF = 206, 01246 kXMPErr_BadJPEG = 207, 01248 kXMPErr_BadPSD = 208, 01250 kXMPErr_BadPSIR = 209, 01252 kXMPErr_BadIPTC = 210, 01254 kXMPErr_BadMPEG = 211 01255 01256 }; 01257 01259 01260 // ================================================================================================= 01261 // Client callbacks 01262 // ================ 01263 01264 // ------------------------------------------------------------------------------------------------- 01267 01272 01273 typedef XMP_Int32 XMP_Status; 01274 01275 // ------------------------------------------------------------------------------------------------- 01290 01291 typedef XMP_Status (* XMP_TextOutputProc) ( void * refCon, 01292 XMP_StringPtr buffer, 01293 XMP_StringLen bufferSize ); 01294 01295 // ------------------------------------------------------------------------------------------------- 01304 01305 typedef bool (* XMP_AbortProc) ( void * arg ); // Used by . 01306 01308 01309 // ================================================================================================= 01310 // Stuff with no better place to be 01311 // ================================ 01312 01314 typedef struct XMP_VersionInfo { 01316 XMP_Uns8 major; 01318 XMP_Uns8 minor; 01320 XMP_Uns8 micro; 01322 XMP_Bool isDebug; 01324 XMP_Uns32 build; 01326 XMP_Uns32 flags; 01328 XMP_StringPtr message; 01329 } XMP_VersionInfo; 01330 01331 // ================================================================================================= 01332 01333 #if __cplusplus 01334 } // extern "C" 01335 #endif 01336 01337 #endif // __XMP_Const_h__