diff options
author | Sebastian Geerken <devnull@localhost> | 2013-09-12 22:52:20 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-09-12 22:52:20 +0200 |
commit | 7ccdc7ac47628f347315e4fd84eb2854ff5e780c (patch) | |
tree | 7019feecf73fcfefaeb1db1380123f5f4e25658d /dw | |
parent | 76a23c134dfd1d98923830b35a9ee630924b2250 (diff) |
Remaning style attributes.
Diffstat (limited to 'dw')
-rw-r--r-- | dw/style.cc | 20 | ||||
-rw-r--r-- | dw/style.hh | 16 |
2 files changed, 36 insertions, 0 deletions
diff --git a/dw/style.cc b/dw/style.cc index 4409bb43..1ea0a9c4 100644 --- a/dw/style.cc +++ b/dw/style.cc @@ -49,6 +49,10 @@ void StyleAttrs::initValues () valign = VALIGN_BASELINE; backgroundColor = NULL; backgroundImage = NULL; + backgroundRepeat = BACKGROUND_REPEAT; + backgroundAttachment = BACKGROUND_ATTACHMENT_SCROLL; + backgroundPositionX = createPerLength (0); + backgroundPositionY = createPerLength (0); width = height = lineHeight = LENGTH_AUTO; textIndent = 0; margin.setVal (0); @@ -78,6 +82,10 @@ void StyleAttrs::resetValues () textAlignChar = '.'; backgroundColor = NULL; backgroundImage = NULL; + backgroundRepeat = BACKGROUND_REPEAT; + backgroundAttachment = BACKGROUND_ATTACHMENT_SCROLL; + backgroundPositionX = createPerLength (0); + backgroundPositionY = createPerLength (0); width = LENGTH_AUTO; height = LENGTH_AUTO; @@ -119,6 +127,10 @@ bool StyleAttrs::equals (object::Object *other) { color == otherAttrs->color && backgroundColor == otherAttrs->backgroundColor && backgroundImage == otherAttrs->backgroundImage && + backgroundRepeat == otherAttrs->backgroundRepeat && + backgroundAttachment == otherAttrs->backgroundAttachment && + backgroundPositionX == otherAttrs->backgroundPositionX && + backgroundPositionY == otherAttrs->backgroundPositionY && textAlign == otherAttrs->textAlign && valign == otherAttrs->valign && textAlignChar == otherAttrs->textAlignChar && @@ -160,6 +172,10 @@ int StyleAttrs::hashValue () { (intptr_t) color + (intptr_t) backgroundColor + (intptr_t) backgroundImage + + backgroundRepeat + + backgroundAttachment + + backgroundPositionX + + backgroundPositionY + textAlign + valign + textAlignChar + @@ -257,6 +273,10 @@ void Style::copyAttrs (StyleAttrs *attrs) color = attrs->color; backgroundColor = attrs->backgroundColor; backgroundImage = attrs->backgroundImage; + backgroundRepeat = attrs->backgroundRepeat; + backgroundAttachment = attrs->backgroundAttachment; + backgroundPositionX = attrs->backgroundPositionX; + backgroundPositionY = attrs->backgroundPositionY; textAlign = attrs->textAlign; valign = attrs->valign; textAlignChar = attrs->textAlignChar; diff --git a/dw/style.hh b/dw/style.hh index 6c82be8d..c09a52f0 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -230,6 +230,18 @@ enum BorderStyle { BORDER_OUTSET }; +enum BackgroundRepeat { + BACKGROUND_REPEAT, + BACKGROUND_REPEAT_X, + BACKGROUND_REPEAT_Y, + BACKGROUND_NO_REPEAT +}; + +enum BackgroundAttachment { + BACKGROUND_ATTACHMENT_SCROLL, + BACKGROUND_ATTACHMENT_FIXED +}; + enum TextAlignType { TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT, @@ -449,6 +461,10 @@ public: * TextDecoration <-> int */ Color *color, *backgroundColor; StyleImage *backgroundImage; + BackgroundRepeat backgroundRepeat; + BackgroundAttachment backgroundAttachment; + Length backgroundPositionX; // "left" defiened by "0%" etc. (see CSS spec) + Length backgroundPositionY; // "top" defiened by "0%" etc. (see CSS spec) TextAlignType textAlign; VAlignType valign; |