7#ifndef __INCLUDED_FROM_DW_CORE_HH__
8# error Do not include this file directly, use "core.hh" instead.
13#include "../lout/signal.hh"
14#include "../lout/debug.hh"
436 return ((
int)(v * (1 << 18)) & ~3) | 2; }
440 return ((
int)(v * (1 << 18)) & ~3) | 3; }
460{
return (
double)(l & ~3) / (1 << 18); }
512 return top == other->
top &&
619 static lout::container::typed::HashTable <StyleAttrs, Style> *
styleTable;
635 style =
new Style (attrs);
670 {
if (--
refCount == 0)
delete this; }
780 {
if (--
refCount == 0)
delete this; }
830 virtual void getBgArea (
int *x,
int *y,
int *width,
int *height) = 0;
837 virtual void getRefArea (
int *xRef,
int *yRef,
int *widthRef,
850 virtual void draw (
int x,
int y,
int width,
int height) = 0;
877 {
if (--
refCount == 0)
delete this; }
903 int x,
int y,
int width,
int height,
904 Style *style,
bool inverse);
906 int x,
int y,
int width,
int height,
907 int xRef,
int yRef,
int widthRef,
int heightRef,
908 Style *style, Color *bgColor,
bool inverse,
bool atTop);
912 Length backgroundPositionX,
913 Length backgroundPositionY,
914 int x,
int y,
int width,
int height,
915 int xRef,
int yRef,
int widthRef,
int heightRef);
Implementation of ImgRenderer, which distributes all calls to a set of other implementations of ImgRe...
void remove(ImgRenderer *child)
void put(ImgRenderer *child)
The platform independent interface for image buffers.
The central class for managing and drawing a widget tree.
dw::core::Shape implemtation for simple rectangles.
An interface to encapsulate platform dependent drawing.
Represents a dimension box according to the CSS box model.
bool equals(lout::object::Object *other)
Returns, whether two objects are equal.
int hashValue()
Return a hash value for the object.
int shadeColor(int color, int d)
void remove(dw::core::Layout *layout)
static Color * create(Layout *layout, int color)
bool equals(lout::object::Object *other)
Returns, whether two objects are equal.
int hashValue()
Return a hash value for the object.
static bool exists(Layout *layout, const char *name)
static Font * create(Layout *layout, FontAttrs *attrs)
void copyAttrs(FontAttrs *attrs)
static Font * create0(Layout *layout, FontAttrs *attrs, bool tryEverything)
ListStyleType listStyleType
ListStylePosition listStylePosition
TextTransform textTransform
StyleImage * backgroundImage
bool equals(lout::object::Object *other)
Returns, whether two objects are equal.
Length backgroundPositionY
BackgroundRepeat backgroundRepeat
struct dw::core::style::StyleAttrs::@20 borderColor
BackgroundAttachment backgroundAttachment
int hashValue()
Return a hash value for the object.
void setBorderStyle(BorderStyle val)
bool sizeDiffs(StyleAttrs *otherStyleAttrs)
This method returns whether something may change its size, when its style changes from this style to ...
void setBorderColor(Color *val)
BorderCollapse borderCollapse
struct dw::core::style::StyleAttrs::@21 borderStyle
void resetValues()
Reset those style attributes to their standard values, which are not inherited, according to CSS.
Length backgroundPositionX
Useful (but not mandatory) base class for updates of areas with background images.
virtual StyleImage * getBackgroundImage()=0
virtual Length getBackgroundPositionX()=0
void finish()
Called, when all image data has been retrieved.
virtual void draw(int x, int y, int width, int height)=0
Draw (or queue for drawing) an area, which is given in canvas coordinates.
virtual BackgroundRepeat getBackgroundRepeat()=0
virtual BackgroundAttachment getBackgroundAttachment()=0
void drawRow(int row)
Called, when data from a row is available and has been copied into the image buffer.
virtual Length getBackgroundPositionY()=0
virtual void getBgArea(int *x, int *y, int *width, int *height)=0
Return the area covered by the background image.
void fatal()
Called, when there are problems with the retrieval of image data.
virtual bool readyToDraw()=0
If this method returns false, nothing is done at all.
virtual void getRefArea(int *xRef, int *yRef, int *widthRef, int *heightRef)=0
Return the "reference area".
void setBuffer(core::Imgbuf *buffer, bool resize)
Called, when an image buffer is attached.
void fatal()
Called, when there are problems with the retrieval of image data.
StyleImgRenderer(StyleImage *image)
void setBuffer(core::Imgbuf *buffer, bool resize)
Called, when an image buffer is attached.
void drawRow(int row)
Called, when data from a row is available and has been copied into the image buffer.
void finish()
Called, when all image data has been retrieved.
void putExternalImgRenderer(ImgRenderer *ir)
Add an additional ImgRenderer, especially used for drawing.
int getTilesX(bool repeatX, bool repeatY)
Imgbuf * getImgbufTiled(bool repeatX, bool repeatY)
StyleImgRenderer * styleImgRenderer
int getTilesY(bool repeatX, bool repeatY)
ImgRenderer * getMainImgRenderer()
void removeExternalImgRenderer(ImgRenderer *ir)
Remove a previously added additional ImgRenderer.
static StyleImage * create()
ImgRendererDist * imgRendererDist
static lout::container::typed::HashTable< StyleAttrs, Style > * styleTable
static Style * create(StyleAttrs *attrs)
void copyAttrs(StyleAttrs *attrs)
This is the base class for many other classes, which defines very common virtual methods.
An object::Object wrapper for strings (char*).
An observed object has a signal emitter, which tells the receivers, when the object is deleted.
#define DBG_OBJ_CREATE(klass)
int multiplyWithRelLength(int x, Length l)
@ LIST_STYLE_POSITION_INSIDE
@ LIST_STYLE_POSITION_OUTSIDE
int multiplyWithPerLength(int x, Length l)
Multiply an int with a percentage length, returning int.
@ BACKGROUND_ATTACHMENT_FIXED
@ BACKGROUND_ATTACHMENT_SCROLL
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.
@ LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO
@ LIST_STYLE_TYPE_HIRAGANA
@ LIST_STYLE_TYPE_GEORGIAN
@ LIST_STYLE_TYPE_LOWER_LATIN
@ LIST_STYLE_TYPE_UPPER_LATIN
@ LIST_STYLE_TYPE_UPPER_ALPHA
@ LIST_STYLE_TYPE_LOWER_ALPHA
@ LIST_STYLE_TYPE_HIRAGANA_IROHA
@ LIST_STYLE_TYPE_LOWER_GREEK
@ LIST_STYLE_TYPE_KATAKANA
@ LIST_STYLE_TYPE_ARMENIAN
@ LIST_STYLE_TYPE_UPPER_ROMAN
@ LIST_STYLE_TYPE_KATAKANA_IROHA
@ LIST_STYLE_TYPE_DECIMAL
@ LIST_STYLE_TYPE_CJK_IDEOGRAPHIC
@ LIST_STYLE_TYPE_LOWER_ROMAN
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)
double relLengthVal(Length l)
Returns the value of a relative length, as a float.
@ DISPLAY_TABLE_HEADER_GROUP
@ DISPLAY_TABLE_ROW_GROUP
@ DISPLAY_TABLE_FOOTER_GROUP
int multiplyWithPerLengthRounded(int x, Length l)
Like multiplyWithPerLength, but rounds to nearest integer instead of down.
Length createPerLength(double v)
Returns a percentage, v is relative to 1, not to 100.
int Length
Type for representing all lengths within dw::core::style.
@ TEXT_TRANSFORM_LOWERCASE
@ TEXT_TRANSFORM_UPPERCASE
@ TEXT_TRANSFORM_CAPITALIZE
double perLengthVal_useThisOnlyForDebugging(Length l)
Returns the value of a percentage, relative to 1, as a double.
Length createAbsLength(int n)
Returns a length of n pixels.
@ TEXT_DECORATION_OVERLINE
@ TEXT_DECORATION_LINE_THROUGH
@ TEXT_DECORATION_UNDERLINE
bool isRelLength(Length l)
Returns true if l is a relative length.
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.
@ FONT_VARIANT_SMALL_CAPS
void numtostr(int num, char *buf, int buflen, ListStyleType listStyleType)
Convert a number into a string, in a given list style.
Length createRelLength(double v)
Returns a relative length.
@ Z_INDEX_AUTO
'z-index' is stored as int; use this for the value 'auto'.
bool isPerLength(Length l)
Returns true if l is a percentage.
bool isAbsLength(Length l)
Returns true if l is an absolute length.
int absLengthVal(Length l)
Returns the value of a length in pixels, as an integer.
@ LENGTH_AUTO
Represents "auto" lengths.
Dw is in this namespace, or sub namespaces of this one.