diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/css.cc | 3 | ||||
-rw-r--r-- | src/cssparser.cc | 11 | ||||
-rw-r--r-- | src/cssparser.hh | 9 |
3 files changed, 14 insertions, 9 deletions
@@ -20,7 +20,8 @@ using namespace dw::core::style; void CssProperty::print () { - fprintf (stderr, "%s - %d\n", Css_property_info[name].symbol, value.intVal); + fprintf (stderr, "%s - %d\n", + CssParser::propertyNameString((CssPropertyName) name), value.intVal); } CssPropertyList::~CssPropertyList () { diff --git a/src/cssparser.cc b/src/cssparser.cc index 876c6301..8910bdcd 100644 --- a/src/cssparser.cc +++ b/src/cssparser.cc @@ -42,6 +42,12 @@ using namespace dw::core::style; (CSS_PROPERTY_LAST - CSS_NUM_INTERNAL_PROPERTIES) +typedef struct { + const char *symbol; + const CssValueType type[3]; + const char *const *enum_symbols; +} CssPropertyInfo; + static const char *const Css_border_style_enum_vals[] = { "none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset", NULL @@ -1191,6 +1197,11 @@ void CssParser::parseRuleset() nextToken(); } +const char * CssParser::propertyNameString(CssPropertyName name) +{ + return Css_property_info[name].symbol; +} + void CssParser::parse(CssContext * context, const char *buf, int buflen, CssOrigin origin) diff --git a/src/cssparser.hh b/src/cssparser.hh index 8e29d303..e28516a6 100644 --- a/src/cssparser.hh +++ b/src/cssparser.hh @@ -3,14 +3,6 @@ #include "css.hh" -typedef struct { - const char *symbol; - const CssValueType type[3]; - const char *const *enum_symbols; -} CssPropertyInfo; - -extern const CssPropertyInfo Css_property_info[CSS_PROPERTY_LAST]; - class CssParser { private: typedef enum { @@ -49,6 +41,7 @@ class CssParser { static CssPropertyList *parseDeclarationBlock(const char *buf, int buflen); static void parse(CssContext *context, const char *buf, int buflen, CssOrigin origin); + static const char *propertyNameString(CssPropertyName name); }; #endif |