00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef SkSVGAttribute_DEFINED
00018 #define SkSVGAttribute_DEFINED
00019
00020 #include "SkTypes.h"
00021
00022 struct SkSVGAttribute {
00023 const char* fName;
00024 #ifdef SK_DEBUG
00025 size_t fOffset;
00026 #endif
00027 };
00028
00029 #ifndef SK_OFFSETOF
00030 #define SK_OFFSETOF(a, b) (((size_t) (&(((a*) 1)->b)))-1)
00031 #endif
00032
00033 #ifdef SK_DEBUG
00034 #define SVG_ATTRIBUTE(attr) { #attr, SK_OFFSETOF(BASE_CLASS, f_##attr) }
00035 #define SVG_LITERAL_ATTRIBUTE(svgAttr, cAttr) { #svgAttr, SK_OFFSETOF(BASE_CLASS, cAttr) }
00036 #else
00037 #define SVG_ATTRIBUTE(attr) { #attr }
00038 #define SVG_LITERAL_ATTRIBUTE(svgAttr, cAttr) { #svgAttr }
00039 #endif
00040
00041 #define SVG_ADD_ATTRIBUTE(attr) \
00042 if (f_##attr.size() > 0) \
00043 parser._addAttributeLen(#attr, f_##attr.c_str(), f_##attr.size())
00044
00045 #define SVG_ADD_ATTRIBUTE_ALIAS(attr, alias) \
00046 if (f_##alias.size() > 0) \
00047 parser._addAttributeLen(#attr, f_##alias.c_str(), f_##alias.size())
00048
00049 #endif // SkSVGAttribute_DEFINED