Dillo v3.1.1-111-gd4f56d0d
Loading...
Searching...
No Matches
dw::core::style Namespace Reference

Anything related to Dillo Widget styles is defined here. More...

Classes

class  Box
 Represents a dimension box according to the CSS box model. More...
 
class  Color
 
class  ColorAttrs
 
class  Font
 
class  FontAttrs
 
class  Style
 
class  StyleAttrs
 
class  StyleImage
 
class  Tooltip
 
class  TooltipAttrs
 

Typedefs

typedef int Length
 Type for representing all lengths within dw::core::style.
 

Enumerations

enum  Cursor {
  CURSOR_CROSSHAIR , CURSOR_DEFAULT , CURSOR_POINTER , CURSOR_MOVE ,
  CURSOR_E_RESIZE , CURSOR_NE_RESIZE , CURSOR_NW_RESIZE , CURSOR_N_RESIZE ,
  CURSOR_SE_RESIZE , CURSOR_SW_RESIZE , CURSOR_S_RESIZE , CURSOR_W_RESIZE ,
  CURSOR_TEXT , CURSOR_WAIT , CURSOR_HELP
}
 
enum  BorderCollapse { BORDER_MODEL_SEPARATE , BORDER_MODEL_COLLAPSE }
 
enum  BorderStyle {
  BORDER_NONE , BORDER_HIDDEN , BORDER_DOTTED , BORDER_DASHED ,
  BORDER_SOLID , BORDER_DOUBLE , BORDER_GROOVE , BORDER_RIDGE ,
  BORDER_INSET , 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 , TEXT_ALIGN_CENTER , TEXT_ALIGN_JUSTIFY ,
  TEXT_ALIGN_STRING
}
 
enum  VAlignType {
  VALIGN_TOP , VALIGN_BOTTOM , VALIGN_MIDDLE , VALIGN_BASELINE ,
  VALIGN_SUB , VALIGN_SUPER , VALIGN_TEXT_TOP , VALIGN_TEXT_BOTTOM
}
 
enum  TextTransform { TEXT_TRANSFORM_NONE , TEXT_TRANSFORM_CAPITALIZE , TEXT_TRANSFORM_UPPERCASE , TEXT_TRANSFORM_LOWERCASE }
 
enum  DisplayType {
  DISPLAY_BLOCK , DISPLAY_INLINE , DISPLAY_INLINE_BLOCK , DISPLAY_LIST_ITEM ,
  DISPLAY_NONE , DISPLAY_TABLE , DISPLAY_TABLE_ROW_GROUP , DISPLAY_TABLE_HEADER_GROUP ,
  DISPLAY_TABLE_FOOTER_GROUP , DISPLAY_TABLE_ROW , DISPLAY_TABLE_CELL
}
 
enum  LineType { LINE_NORMAL , LINE_DOTTED , LINE_DASHED }
 
enum  ListStylePosition { LIST_STYLE_POSITION_INSIDE , LIST_STYLE_POSITION_OUTSIDE }
 
enum  ListStyleType {
  LIST_STYLE_TYPE_DISC , LIST_STYLE_TYPE_CIRCLE , LIST_STYLE_TYPE_SQUARE , LIST_STYLE_TYPE_DECIMAL ,
  LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO , LIST_STYLE_TYPE_LOWER_ROMAN , LIST_STYLE_TYPE_UPPER_ROMAN , LIST_STYLE_TYPE_LOWER_GREEK ,
  LIST_STYLE_TYPE_LOWER_ALPHA , LIST_STYLE_TYPE_LOWER_LATIN , LIST_STYLE_TYPE_UPPER_ALPHA , LIST_STYLE_TYPE_UPPER_LATIN ,
  LIST_STYLE_TYPE_HEBREW , LIST_STYLE_TYPE_ARMENIAN , LIST_STYLE_TYPE_GEORGIAN , LIST_STYLE_TYPE_CJK_IDEOGRAPHIC ,
  LIST_STYLE_TYPE_HIRAGANA , LIST_STYLE_TYPE_KATAKANA , LIST_STYLE_TYPE_HIRAGANA_IROHA , LIST_STYLE_TYPE_KATAKANA_IROHA ,
  LIST_STYLE_TYPE_NONE
}
 
enum  FontStyle { FONT_STYLE_NORMAL , FONT_STYLE_ITALIC , FONT_STYLE_OBLIQUE }
 
enum  FontVariant { FONT_VARIANT_NORMAL , FONT_VARIANT_SMALL_CAPS }
 
enum  Overflow { OVERFLOW_VISIBLE , OVERFLOW_HIDDEN , OVERFLOW_SCROLL , OVERFLOW_AUTO }
 
enum  Position { POSITION_STATIC , POSITION_RELATIVE , POSITION_ABSOLUTE , POSITION_FIXED }
 
enum  TextDecoration {
  TEXT_DECORATION_NONE = 0 , TEXT_DECORATION_UNDERLINE = 1 << 0 , TEXT_DECORATION_OVERLINE = 1 << 1 , TEXT_DECORATION_LINE_THROUGH = 1 << 2 ,
  TEXT_DECORATION_BLINK = 1 << 3
}
 
enum  WhiteSpace {
  WHITE_SPACE_NORMAL , WHITE_SPACE_PRE , WHITE_SPACE_NOWRAP , WHITE_SPACE_PRE_WRAP ,
  WHITE_SPACE_PRE_LINE
}
 
enum  FloatType { FLOAT_NONE , FLOAT_LEFT , FLOAT_RIGHT }
 
enum  ClearType { CLEAR_LEFT , CLEAR_RIGHT , CLEAR_BOTH , CLEAR_NONE }
 
enum  { Z_INDEX_AUTO = INT_MAX }
 
enum  { LENGTH_AUTO = 0 }
 

Functions

static void calcBackgroundRelatedValues (StyleImage *backgroundImage, BackgroundRepeat backgroundRepeat, BackgroundAttachment backgroundAttachment, Length backgroundPositionX, Length backgroundPositionY, int xDraw, int yDraw, int widthDraw, int heightDraw, int xRef, int yRef, int widthRef, int heightRef, bool *repeatX, bool *repeatY, int *origX, int *origY, int *tileX1, int *tileX2, int *tileY1, int *tileY2, bool *doDraw)
 
static void drawBorderTop (View *view, Style *style, int x1, int y1, int x2, int y2)
 
static void drawBorderBottom (View *view, Style *style, int x1, int y1, int x2, int y2)
 
static void drawBorderLeft (View *view, Style *style, int x1, int y1, int x2, int y2)
 
static void drawBorderRight (View *view, Style *style, int x1, int y1, int x2, int y2)
 
void drawBorder (View *view, Layout *layout, Rectangle *area, int x, int y, int width, int height, Style *style, bool inverse)
 Draw the border of a region in window, according to style.
 
void drawBackground (View *view, Layout *layout, Rectangle *area, int x, int y, int width, int height, int xRef, int yRef, int widthRef, int heightRef, Style *style, Color *bgColor, bool inverse, bool atTop)
 Draw the background (content plus padding) of a region in window, according to style.
 
void drawBackgroundImage (View *view, StyleImage *backgroundImage, BackgroundRepeat backgroundRepeat, BackgroundAttachment backgroundAttachment, Length backgroundPositionX, Length backgroundPositionY, int x, int y, int width, int height, int xRef, int yRef, int widthRef, int heightRef)
 
static void strAsciiTolower (char *s)
 
void numtostr (int num, char *buf, int buflen, ListStyleType listStyleType)
 Convert a number into a string, in a given list style.
 
Length createAbsLength (int n)
 Returns a length of n pixels.
 
Length createPerLength (double v)
 Returns a percentage, v is relative to 1, not to 100.
 
Length createRelLength (double v)
 Returns a relative length.
 
bool isAbsLength (Length l)
 Returns true if l is an absolute length.
 
bool isPerLength (Length l)
 Returns true if l is a percentage.
 
bool isRelLength (Length l)
 Returns true if l is a relative length.
 
int absLengthVal (Length l)
 Returns the value of a length in pixels, as an integer.
 
double perLengthVal_useThisOnlyForDebugging (Length l)
 Returns the value of a percentage, relative to 1, as a double.
 
double relLengthVal (Length l)
 Returns the value of a relative length, as a float.
 
int multiplyWithPerLength (int x, Length l)
 Multiply an int with a percentage length, returning int.
 
int multiplyWithPerLengthRounded (int x, Length l)
 Like multiplyWithPerLength, but rounds to nearest integer instead of down.
 
int multiplyWithRelLength (int x, Length l)
 

Variables

const bool drawBackgroundLineByLine = false
 
const int MIN_BG_IMG_W = 10
 
const int MIN_BG_IMG_H = 10
 
const int OPT_BG_IMG_W = 50
 
const int OPT_BG_IMG_H = 50
 
static const char *const roman_I0 [] = { "","I","II","III","IV","V","VI","VII","VIII","IX" }
 
static const char *const *const roman_I1 [] = { "","X","XX","XXX","XL","L","LX","LXX","LXXX","XC" }
 
static const char *const *const *const roman_I2 [] = { "","C","CC","CCC","CD","D","DC","DCC","DCCC","CM" }
 
static const char *const *const *const *const roman_I3 [] = { "","M","MM","MMM","MMMM" }
 

Detailed Description

Anything related to Dillo Widget styles is defined here.

Overview

dw::core::style::Style provides some resources and attributes for drawing widgets, as well as for parts of a widget (e.g., dw::Textblock uses styles for its words). Creating a style is done by filling a dw::core::style::StyleAttrs with the attributes and calling dw::core::style::Style::create:

// ...
styleAttrs.foo = bar;
// etc.
style = dw::core::style::Style::create (&styleAttrs, layout);
// do something with style
The central class for managing and drawing a widget tree.
Definition layout.hh:17
static Style * create(StyleAttrs *attrs)
Definition style.hh:629
static Layout * layout

After this, the attributes of a dw::core::style::Style should not be changed anymore, since styles are often shared between different widgets etc. (see below). Most times, you simply copy the attributes of another style (possible, since dw::core::style::Style is a sub class of dw::core::style::StyleAttrs), modify them and create a new style:

styleAttrs = *anotherStyle;
styleAttrs.foo = baz;
style = dw::core::style::Style::create (&styleAttrs, layout);

The dw::core::style::Font structure can be created by dw::core::style::Font::create, in a similar, with dw::core::style::FontAttrs, and colors by dw::core::style::Color::create, passing 0xrrggbb as an argument. Furthermore, there is dw::core::style::Tooltip, created by dw::core::style::Tooltip::create.

Notice that fonts, colors and tooltips are only intended to be used in conjunction with dw::core::style::Style.

Naming

dw::core::style::Style will become important for CSS, each CSS attribute, which is supported by dillo, will refer to an attribute in dw::core::style::Style. For this reason, the attributes in dw::core::style::Style get the names from the CSS attributes, with "camelCase" instead of hyphens (e.g. "background-color" becomes "backgroundColor").

However, dw::core::style::Style will be extended by some more attributes, which are not defined by CSS. To distinguish them, they get the prefix "x_", e.g. dw::core::style::Style::x_link.

Lengths and Percentages

dw::core::style::Length is a simple data type for lengths and percentages:

  • A length refers to an absolute measurement. It is used to represent the HTML type Pixels; and the CSS type <length>.

    For CSS lengths, there are two units: (i) pixels and absolute units, which have to be converted to pixels (a pixel is, unlike in the CSS specification, treated as absolute unit), and (ii) the relative units "em" and "ex" (see below).

  • A percentage refers to a value relative to another value. It is used for the HTML type Length; (except Pixels;), and the CSS type <percentage>.

  • A relative length can be used in lists of HTML MultiLengths.

Since many values in CSS may be either lengths or percentages, a single type is very useful.

Useful Functions

Creating lengths:

Examine lengths:

Boxes

The CSS Box Model

For borders, margins etc., the box model defined by CSS2 is used. dw::core::style::Style contains some members defining these attributes. A dw::core::Widget must use these values for any calculation of sizes. There are some helper functions (see dw/style.hh). A dw::core::style::Style box looks quite similar to a CSS box:

Background colors

The background color is stored in dw::core::style::Style::backgroundColor, which may be NULL (the background color of the parent widget is shining through).

For toplevel widgets, this color is set as the background color of the views (dw::core::View::setBgColor), for other widgets, a filled rectangle is drawn, covering the content and padding. (This is compliant with CSS2, the background color of the toplevel element covers the whole canvas.)

Drawing

The following methods may be useful:

Notes on Memory Management

Memory management is done by reference counting, dw::core::style::Style::create returns a pointer to dw::core::style::Style with an increased reference counter, so you should care about calling dw::core::style::Style::unref if it is not used anymore. You do not need to care about the reference counters of fonts and styles.

In detail:

Typedef Documentation

◆ Length

Type for representing all lengths within dw::core::style.

Lengths are int's. Absolute lengths are represented in the following way:

Percentages:

Relative lengths (only used in HTML):

This is an implementation detail, use one of the following functions:

Creating lengths:

Examine lengths:

"auto" lengths are represented as dw::core::style::LENGTH_AUTO.

Definition at line 429 of file style.hh.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
Z_INDEX_AUTO 

'z-index' is stored as int; use this for the value 'auto'.

Only some random value, which has to be checked explicitly; do not compare this (less or greater) to integer values of 'z-index'.

Definition at line 380 of file style.hh.

◆ anonymous enum

anonymous enum
Enumerator
LENGTH_AUTO 

Represents "auto" lengths.

Definition at line 493 of file style.hh.

◆ BackgroundAttachment

Enumerator
BACKGROUND_ATTACHMENT_SCROLL 
BACKGROUND_ATTACHMENT_FIXED 

Definition at line 244 of file style.hh.

◆ BackgroundRepeat

Enumerator
BACKGROUND_REPEAT 
BACKGROUND_REPEAT_X 
BACKGROUND_REPEAT_Y 
BACKGROUND_NO_REPEAT 

Definition at line 237 of file style.hh.

◆ BorderCollapse

Enumerator
BORDER_MODEL_SEPARATE 
BORDER_MODEL_COLLAPSE 

Definition at line 219 of file style.hh.

◆ BorderStyle

Enumerator
BORDER_NONE 
BORDER_HIDDEN 
BORDER_DOTTED 
BORDER_DASHED 
BORDER_SOLID 
BORDER_DOUBLE 
BORDER_GROOVE 
BORDER_RIDGE 
BORDER_INSET 
BORDER_OUTSET 

Definition at line 224 of file style.hh.

◆ ClearType

Enumerator
CLEAR_LEFT 
CLEAR_RIGHT 
CLEAR_BOTH 
CLEAR_NONE 

Definition at line 373 of file style.hh.

◆ Cursor

Enumerator
CURSOR_CROSSHAIR 
CURSOR_DEFAULT 
CURSOR_POINTER 
CURSOR_MOVE 
CURSOR_E_RESIZE 
CURSOR_NE_RESIZE 
CURSOR_NW_RESIZE 
CURSOR_N_RESIZE 
CURSOR_SE_RESIZE 
CURSOR_SW_RESIZE 
CURSOR_S_RESIZE 
CURSOR_W_RESIZE 
CURSOR_TEXT 
CURSOR_WAIT 
CURSOR_HELP 

Definition at line 201 of file style.hh.

◆ DisplayType

Todo:
Incomplete. Has to be completed for a CSS implementation.
Enumerator
DISPLAY_BLOCK 
DISPLAY_INLINE 
DISPLAY_INLINE_BLOCK 
DISPLAY_LIST_ITEM 
DISPLAY_NONE 
DISPLAY_TABLE 
DISPLAY_TABLE_ROW_GROUP 
DISPLAY_TABLE_HEADER_GROUP 
DISPLAY_TABLE_FOOTER_GROUP 
DISPLAY_TABLE_ROW 
DISPLAY_TABLE_CELL 

Definition at line 278 of file style.hh.

◆ FloatType

Enumerator
FLOAT_NONE 
FLOAT_LEFT 
FLOAT_RIGHT 

Definition at line 367 of file style.hh.

◆ FontStyle

Enumerator
FONT_STYLE_NORMAL 
FONT_STYLE_ITALIC 
FONT_STYLE_OBLIQUE 

Definition at line 326 of file style.hh.

◆ FontVariant

Enumerator
FONT_VARIANT_NORMAL 
FONT_VARIANT_SMALL_CAPS 

Definition at line 332 of file style.hh.

◆ LineType

Enumerator
LINE_NORMAL 
LINE_DOTTED 
LINE_DASHED 

Definition at line 292 of file style.hh.

◆ ListStylePosition

Enumerator
LIST_STYLE_POSITION_INSIDE 
LIST_STYLE_POSITION_OUTSIDE 

Definition at line 298 of file style.hh.

◆ ListStyleType

Enumerator
LIST_STYLE_TYPE_DISC 
LIST_STYLE_TYPE_CIRCLE 
LIST_STYLE_TYPE_SQUARE 
LIST_STYLE_TYPE_DECIMAL 
LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO 
LIST_STYLE_TYPE_LOWER_ROMAN 
LIST_STYLE_TYPE_UPPER_ROMAN 
LIST_STYLE_TYPE_LOWER_GREEK 
LIST_STYLE_TYPE_LOWER_ALPHA 
LIST_STYLE_TYPE_LOWER_LATIN 
LIST_STYLE_TYPE_UPPER_ALPHA 
LIST_STYLE_TYPE_UPPER_LATIN 
LIST_STYLE_TYPE_HEBREW 
LIST_STYLE_TYPE_ARMENIAN 
LIST_STYLE_TYPE_GEORGIAN 
LIST_STYLE_TYPE_CJK_IDEOGRAPHIC 
LIST_STYLE_TYPE_HIRAGANA 
LIST_STYLE_TYPE_KATAKANA 
LIST_STYLE_TYPE_HIRAGANA_IROHA 
LIST_STYLE_TYPE_KATAKANA_IROHA 
LIST_STYLE_TYPE_NONE 

Definition at line 302 of file style.hh.

◆ Overflow

Enumerator
OVERFLOW_VISIBLE 
OVERFLOW_HIDDEN 
OVERFLOW_SCROLL 
OVERFLOW_AUTO 

Definition at line 337 of file style.hh.

◆ Position

Enumerator
POSITION_STATIC 
POSITION_RELATIVE 
POSITION_ABSOLUTE 
POSITION_FIXED 

Definition at line 344 of file style.hh.

◆ TextAlignType

Enumerator
TEXT_ALIGN_LEFT 
TEXT_ALIGN_RIGHT 
TEXT_ALIGN_CENTER 
TEXT_ALIGN_JUSTIFY 
TEXT_ALIGN_STRING 

Definition at line 249 of file style.hh.

◆ TextDecoration

Enumerator
TEXT_DECORATION_NONE 
TEXT_DECORATION_UNDERLINE 
TEXT_DECORATION_OVERLINE 
TEXT_DECORATION_LINE_THROUGH 
TEXT_DECORATION_BLINK 

Definition at line 351 of file style.hh.

◆ TextTransform

Enumerator
TEXT_TRANSFORM_NONE 
TEXT_TRANSFORM_CAPITALIZE 
TEXT_TRANSFORM_UPPERCASE 
TEXT_TRANSFORM_LOWERCASE 

Definition at line 268 of file style.hh.

◆ VAlignType

Enumerator
VALIGN_TOP 
VALIGN_BOTTOM 
VALIGN_MIDDLE 
VALIGN_BASELINE 
VALIGN_SUB 
VALIGN_SUPER 
VALIGN_TEXT_TOP 
VALIGN_TEXT_BOTTOM 

Definition at line 257 of file style.hh.

◆ WhiteSpace

Enumerator
WHITE_SPACE_NORMAL 
WHITE_SPACE_PRE 
WHITE_SPACE_NOWRAP 
WHITE_SPACE_PRE_WRAP 
WHITE_SPACE_PRE_LINE 

Definition at line 359 of file style.hh.

Function Documentation

◆ absLengthVal()

◆ calcBackgroundRelatedValues()

void dw::core::style::calcBackgroundRelatedValues ( StyleImage backgroundImage,
BackgroundRepeat  backgroundRepeat,
BackgroundAttachment  backgroundAttachment,
Length  backgroundPositionX,
Length  backgroundPositionY,
int  xDraw,
int  yDraw,
int  widthDraw,
int  heightDraw,
int  xRef,
int  yRef,
int  widthRef,
int  heightRef,
bool *  repeatX,
bool *  repeatY,
int *  origX,
int *  origY,
int *  tileX1,
int *  tileX2,
int *  tileY1,
int *  tileY2,
bool *  doDraw 
)
static

◆ createAbsLength()

Length dw::core::style::createAbsLength ( int  n)
inline

Returns a length of n pixels.

Definition at line 432 of file style.hh.

Referenced by StyleEngine::apply(), StyleEngine::computeLength(), and main().

◆ createPerLength()

◆ createRelLength()

Length dw::core::style::createRelLength ( double  v)
inline

Returns a relative length.

Definition at line 439 of file style.hh.

◆ drawBackground()

void dw::core::style::drawBackground ( View view,
Layout layout,
Rectangle area,
int  x,
int  y,
int  width,
int  height,
int  xRef,
int  yRef,
int  widthRef,
int  heightRef,
Style style,
Color bgColor,
bool  inverse,
bool  atTop 
)

Draw the background (content plus padding) of a region in window, according to style.

Used by dw::core::Widget::drawBox and dw::core::Widget::drawWidgetBox.

"area" is the area to be drawn, "x", "y", "width" and "height" define the box itself (padding box). "xRef", "yRef", "widthRef" and "heightRef" define the reference area, which is important for the tiling of background images (for position 0%/0%, a tile is set at xRef/yRef; for position 100%/100%, a tile is set at xRef + widthRef/yRef + widthRef). See calls for more informations; in most cases, these boxes are identical (padding box). All these coordinates are given in canvas coordinates.

"atTop" should be true, only if the area is drawn directly on the canvas, not on top of other areas; this is only true for the toplevel widget itself (not parts of its contents). Toplevel widget background colors are already set as viewport background color, so that drawing again is is not neccessary, but some time can be saved.

Otherwise, the caller should not try to increase the performance by doing some tests before; this is all done in this method.

"bgColor" is passes implicitly. For non-inversed drawing, style->backgroundColor may simply used. However, when drawing is inversed, and style->backgroundColor is undefined (NULL), a background color defined higher in the hierarchy (which is not accessable here) must be used.

(Background images are never drawn inverse.)

Definition at line 1233 of file style.cc.

References dw::core::style::StyleAttrs::backgroundAttachment, dw::core::style::StyleAttrs::backgroundImage, dw::core::style::StyleAttrs::backgroundPositionX, dw::core::style::StyleAttrs::backgroundPositionY, dw::core::style::StyleAttrs::backgroundRepeat, drawBackgroundImage(), dw::core::View::drawRectangle(), dw::core::style::StyleImage::getImgbufSrc(), dw::core::Rectangle::height, dw::core::Rectangle::intersectsWith(), layout, dw::core::style::Color::SHADING_INVERSE, dw::core::style::Color::SHADING_NORMAL, dw::core::Rectangle::width, dw::core::Rectangle::x, and dw::core::Rectangle::y.

Referenced by dw::core::Widget::drawBox(), and dw::core::Widget::drawWidgetBox().

◆ drawBackgroundImage()

void dw::core::style::drawBackgroundImage ( View view,
StyleImage backgroundImage,
BackgroundRepeat  backgroundRepeat,
BackgroundAttachment  backgroundAttachment,
Length  backgroundPositionX,
Length  backgroundPositionY,
int  x,
int  y,
int  width,
int  height,
int  xRef,
int  yRef,
int  widthRef,
int  heightRef 
)

◆ drawBorder()

void dw::core::style::drawBorder ( View view,
Layout layout,
Rectangle area,
int  x,
int  y,
int  width,
int  height,
Style style,
bool  inverse 
)

Draw the border of a region in window, according to style.

Used by dw::core::Widget::drawBox and dw::core::Widget::drawWidgetBox.

"area" is the area to be drawn, "x", "y", "width" and "height" define the box itself. All are given in canvas coordinates.

Todo:
a lot!

Definition at line 1168 of file style.cc.

References dw::core::style::Box::bottom, drawBorderBottom(), drawBorderLeft(), drawBorderRight(), drawBorderTop(), dw::core::style::Box::left, dw::core::style::StyleAttrs::margin, dw::core::style::Box::right, and dw::core::style::Box::top.

Referenced by dw::core::Widget::drawBox(), and dw::core::Widget::drawWidgetBox().

◆ drawBorderBottom()

◆ drawBorderLeft()

◆ drawBorderRight()

◆ drawBorderTop()

◆ isAbsLength()

◆ isPerLength()

◆ isRelLength()

bool dw::core::style::isRelLength ( Length  l)
inline

Returns true if l is a relative length.

Definition at line 449 of file style.hh.

◆ multiplyWithPerLength()

◆ multiplyWithPerLengthRounded()

int dw::core::style::multiplyWithPerLengthRounded ( int  x,
Length  l 
)
inline

Like multiplyWithPerLength, but rounds to nearest integer instead of down.

(This function exists for backward compatibility.)

Definition at line 484 of file style.hh.

References perLengthVal_useThisOnlyForDebugging(), and lout::misc::roundInt().

Referenced by dw::Textblock::calcTextSize(), and dw::Textblock::initLine1Offset().

◆ multiplyWithRelLength()

int dw::core::style::multiplyWithRelLength ( int  x,
Length  l 
)
inline

Definition at line 488 of file style.hh.

References relLengthVal().

◆ numtostr()

void dw::core::style::numtostr ( int  num,
char *  buf,
int  buflen,
ListStyleType  listStyleType 
)

◆ perLengthVal_useThisOnlyForDebugging()

double dw::core::style::perLengthVal_useThisOnlyForDebugging ( Length  l)
inline

Returns the value of a percentage, relative to 1, as a double.

When possible, do not use this function directly; it may be removed soon. Instead, use multiplyWithPerLength or multiplyWithPerLengthRounded.

Definition at line 459 of file style.hh.

Referenced by dw::core::Widget::calcHeight(), dw::oof::OOFPosAbsLikeMgr::calcHPosAndSizeChildOfChild(), dw::oof::OOFPosAbsLikeMgr::calcVPosAndSizeChildOfChild(), dw::core::Widget::calcWidth(), dw::core::Widget::getAvailHeight(), dw::core::Widget::getAvailHeightOfChild(), multiplyWithPerLength(), and multiplyWithPerLengthRounded().

◆ relLengthVal()

double dw::core::style::relLengthVal ( Length  l)
inline

Returns the value of a relative length, as a float.

When possible, do not use this function directly; it may be removed soon.

Definition at line 467 of file style.hh.

Referenced by multiplyWithRelLength().

◆ strAsciiTolower()

static void dw::core::style::strAsciiTolower ( char *  s)
static

Definition at line 1411 of file style.cc.

References lout::misc::AsciiTolower().

Referenced by numtostr().

Variable Documentation

◆ drawBackgroundLineByLine

const bool dw::core::style::drawBackgroundLineByLine = false

◆ MIN_BG_IMG_H

const int dw::core::style::MIN_BG_IMG_H = 10

Definition at line 39 of file style.cc.

Referenced by dw::core::style::StyleImage::StyleImgRenderer::setBuffer().

◆ MIN_BG_IMG_W

const int dw::core::style::MIN_BG_IMG_W = 10

Definition at line 38 of file style.cc.

Referenced by dw::core::style::StyleImage::StyleImgRenderer::setBuffer().

◆ OPT_BG_IMG_H

const int dw::core::style::OPT_BG_IMG_H = 50

Definition at line 41 of file style.cc.

Referenced by dw::core::style::StyleImage::StyleImgRenderer::setBuffer().

◆ OPT_BG_IMG_W

const int dw::core::style::OPT_BG_IMG_W = 50

Definition at line 40 of file style.cc.

Referenced by dw::core::style::StyleImage::StyleImgRenderer::setBuffer().

◆ roman_I0

const char* const dw::core::style::roman_I0[] = { "","I","II","III","IV","V","VI","VII","VIII","IX" }
static

Definition at line 1406 of file style.cc.

Referenced by numtostr().

◆ roman_I1

const char* const * const dw::core::style::roman_I1[] = { "","X","XX","XXX","XL","L","LX","LXX","LXXX","XC" }
static

Definition at line 1407 of file style.cc.

Referenced by numtostr().

◆ roman_I2

const char* const * const * const dw::core::style::roman_I2[] = { "","C","CC","CCC","CD","D","DC","DCC","DCCC","CM" }
static

Definition at line 1408 of file style.cc.

Referenced by numtostr().

◆ roman_I3

const char* const * const * const * const dw::core::style::roman_I3[] = { "","M","MM","MMM","MMMM" }
static

Definition at line 1409 of file style.cc.

Referenced by numtostr().