Dillo
style.hh
Go to the documentation of this file.
1 #ifndef __DW_STYLE_HH__
2 #define __DW_STYLE_HH__
3 
4 #include <stdint.h>
5 
6 #ifndef __INCLUDED_FROM_DW_CORE_HH__
7 # error Do not include this file directly, use "core.hh" instead.
8 #endif
9 
10 #include <limits.h>
11 
12 #include "../lout/signal.hh"
13 #include "../lout/debug.hh"
14 
15 namespace dw {
16 namespace core {
17 
198 namespace style {
199 
200 enum Cursor {
216 };
217 
221 };
222 
234 };
235 
241 };
242 
246 };
247 
254 };
255 
265 };
266 
272 };
273 
289 };
290 
291 enum LineType {
295 };
296 
300 };
323 };
324 
325 enum FontStyle {
329 };
330 
334 };
335 
336 enum Overflow {
341 };
342 
343 enum Position {
348 };
349 
356 };
357 
364 };
365 
366 enum FloatType {
370 };
371 
372 enum ClearType {
377 };
378 
379 enum {
387  Z_INDEX_AUTO = INT_MAX
388 };
389 
428 typedef int Length;
429 
431 inline Length createAbsLength(int n) { return (n << 2) | 1; }
432 
434 inline Length createPerLength(double v) {
435  return ((int)(v * (1 << 18)) & ~3) | 2; }
436 
438 inline Length createRelLength(double v) {
439  return ((int)(v * (1 << 18)) & ~3) | 3; }
440 
442 inline bool isAbsLength(Length l) { return (l & 3) == 1; }
443 
445 inline bool isPerLength(Length l) { return (l & 3) == 2; }
446 
448 inline bool isRelLength(Length l) { return (l & 3) == 3; }
449 
451 inline int absLengthVal(Length l) { return l >> 2; }
452 
459 { return (double)(l & ~3) / (1 << 18); }
460 
466 inline double relLengthVal(Length l) { return (double)(l & ~3) / (1 << 18); }
467 
473 inline int multiplyWithPerLength(int x, Length l) {
475 }
476 
483 inline int multiplyWithPerLengthRounded(int x, Length l) {
485 }
486 
487 inline int multiplyWithRelLength(int x, Length l) {
488  return x * relLengthVal(l);
489 }
490 
491 
492 enum {
495 };
496 
503 class Box
504 {
505 public:
506  /* in future also percentages */
508 
509  inline void setVal(int val) { top = right = bottom = left = val; }
510  inline bool equals (Box *other) {
511  return top == other->top &&
512  right == other->right &&
513  bottom == other->bottom &&
514  left == other->left;
515  }
516  inline int hashValue () {
517  return top + right + bottom + left;
518  }
519 };
520 
521 class Tooltip;
522 class Font;
523 class Color;
524 class StyleImage;
525 
530 {
531 public:
533  int textDecoration; /* No TextDecoration because of problems converting
534  * TextDecoration <-> int */
539  Length backgroundPositionX; // "left" defined by "0%" etc. (see CSS spec)
540  Length backgroundPositionY; // "top" defined by "0%" etc. (see CSS spec)
541 
544  char textAlignChar; /* In future, strings will be supported. */
546 
547  FloatType vloat; /* "float" is a keyword. */
549 
551 
553  Length top, bottom, left, right;
554 
558 
561  struct { Color *top, *right, *bottom, *left; } borderColor;
563 
569  int zIndex;
570 
571  int x_link;
572  int x_img;
574  char x_lang[2]; /* Either x_lang[0] == x_lang[1] == 0 (no language
575  set), or x_lang contains the RFC 1766 country
576  code in lower case letters. (Only two letters
577  allowed, currently.) */
578 
579  void initValues ();
580  void resetValues ();
581 
582  bool sizeDiffs (StyleAttrs *otherStyleAttrs);
583 
584  inline void setBorderColor(Color *val) {
585  borderColor.top = borderColor.right = borderColor.bottom
586  = borderColor.left = val; }
587  inline void setBorderStyle(BorderStyle val) {
588  borderStyle.top = borderStyle.right = borderStyle.bottom
589  = borderStyle.left = val; }
590 
591  inline int boxOffsetX ()
592  { return margin.left + borderWidth.left + padding.left; }
593  inline int boxRestWidth ()
594  { return margin.right + borderWidth.right + padding.right; }
595  inline int boxDiffWidth () { return boxOffsetX () + boxRestWidth (); }
596  inline int boxOffsetY ()
597  { return margin.top + borderWidth.top + padding.top; }
598  inline int boxRestHeight ()
599  { return margin.bottom + borderWidth.bottom + padding.bottom; }
600  inline int boxDiffHeight () { return boxOffsetY () + boxRestHeight (); }
601 
602  inline bool hasBackground ()
603  { return backgroundColor != NULL || backgroundImage != NULL; }
604 
605  bool equals (lout::object::Object *other);
606  int hashValue ();
607 };
608 
609 
613 class Style: public StyleAttrs
614 {
615 private:
616  static int totalRef;
617  int refCount;
619 
620  Style (StyleAttrs *attrs);
621 
622 protected:
623  ~Style();
624 
625  void copyAttrs (StyleAttrs *attrs);
626 
627 public:
628  inline static Style *create (StyleAttrs *attrs)
629  {
630  Style *style = styleTable->get (attrs);
631  if (style) {
632  style->ref ();
633  } else {
634  style = new Style (attrs);
635  styleTable->put(style, style);
636  }
637  return style;
638  }
639 
640  inline void ref () { refCount++; }
641  inline void unref () { if (--refCount == 0) delete this; }
642 };
643 
644 
649 {
650 public:
651  TooltipAttrs(const char *text): lout::object::String(text) { }
652 };
653 
657 class Tooltip: public TooltipAttrs
658 {
659 private:
660  int refCount;
661 
662 protected:
663  Tooltip (const char *text): TooltipAttrs(text) { refCount = 0; }
664 
665 public:
666  static Tooltip *create (dw::core::Layout *layout, const char *text);
667  inline void ref () { refCount++; }
668  inline void unref ()
669  { if (--refCount == 0) delete this; }
670 
671  inline virtual void onEnter () { }
672  inline virtual void onLeave () { }
673  inline virtual void onMotion () { }
674 };
675 
676 
681 {
682 public:
683  const char *name;
684  int size;
685  int weight;
689 
690  bool equals(lout::object::Object *other);
691  int hashValue();
692 };
693 
694 
698 class Font: public FontAttrs
699 {
700 private:
701  int refCount;
702 
703  static Font *create0 (Layout *layout, FontAttrs *attrs, bool tryEverything);
704 
705 protected:
706  inline Font () {
707  DBG_OBJ_CREATE ("dw::core::style::Font");
708  refCount = 0;
709  }
710  virtual ~Font ();
711 
712  void copyAttrs (FontAttrs *attrs);
713 
714 public:
717  int xHeight;
718 
719  static Font *create (Layout *layout, FontAttrs *attrs);
720  static bool exists (Layout *layout, const char *name);
721 
722  inline void ref () { refCount++; }
723  inline void unref () { if (--refCount == 0) delete this; }
724 };
725 
726 
731 {
732 protected:
733  int color;
734 
735 public:
736  inline ColorAttrs(int color)
737  {
738  this->color = color;
739  }
740 
741  inline int getColor () { return color; }
742 
743  bool equals(lout::object::Object *other);
744  int hashValue();
745 };
746 
747 
751 class Color: public ColorAttrs
752 {
753 private:
754  int refCount;
755 
756  void remove(dw::core::Layout *layout);
757  int shadeColor (int color, int d);
758 
759 protected:
760  inline Color (int color): ColorAttrs (color) {
761  DBG_OBJ_CREATE ("dw::core::style::Color");
762  refCount = 0;
763  }
764  virtual ~Color ();
765 
766 public:
769 
770 protected:
771  int shadeColor (int color, Shading shading);
772 
773 public:
774  static Color *create (Layout *layout, int color);
775 
776  inline void ref () { refCount++; }
777  inline void unref ()
778  { if (--refCount == 0) delete this; }
779 };
780 
781 
783 {
784 private:
786  {
787  private:
789 
790  public:
791  inline StyleImgRenderer (StyleImage *image) { this->image = image; }
792 
793  void setBuffer (core::Imgbuf *buffer, bool resize);
794  void drawRow (int row);
795  void finish ();
796  void fatal ();
797  };
798 
803 
804  StyleImage ();
805  ~StyleImage ();
806 
807 public:
813  {
814  public:
815  void setBuffer (core::Imgbuf *buffer, bool resize);
816  void drawRow (int row);
817  void finish ();
818  void fatal ();
819 
823  virtual bool readyToDraw () = 0;
824 
828  virtual void getBgArea (int *x, int *y, int *width, int *height) = 0;
829 
835  virtual void getRefArea (int *xRef, int *yRef, int *widthRef,
836  int *heightRef) = 0;
837 
838  virtual StyleImage *getBackgroundImage () = 0;
839  virtual BackgroundRepeat getBackgroundRepeat () = 0;
841  virtual Length getBackgroundPositionX () = 0;
842  virtual Length getBackgroundPositionY () = 0;
843 
848  virtual void draw (int x, int y, int width, int height) = 0;
849  };
850 
855  {
856  public:
857  void getPaddingArea (int *x, int *y, int *width, int *height);
858 
862  Length getBackgroundPositionX ();
863  Length getBackgroundPositionY ();
864 
868  virtual Style *getStyle () = 0;
869  };
870 
871  static StyleImage *create () { return new StyleImage (); }
872 
873  inline void ref () { refCount++; }
874  inline void unref ()
875  { if (--refCount == 0) delete this; }
876 
877  inline Imgbuf *getImgbufSrc () { return imgbufSrc; }
878  inline Imgbuf *getImgbufTiled (bool repeatX, bool repeatY)
879  { return (imgbufTiled && repeatX && repeatY) ? imgbufTiled : imgbufSrc; }
880  inline int getTilesX (bool repeatX, bool repeatY)
881  { return (imgbufTiled && repeatX && repeatY) ? tilesX : 1; }
882  inline int getTilesY (bool repeatX, bool repeatY)
883  { return (imgbufTiled && repeatX && repeatY) ? tilesY : 1; }
885 
891  { imgRendererDist->put (ir); }
892 
897  { imgRendererDist->remove (ir); }
898 };
899 
900 void drawBorder (View *view, Layout *layout, Rectangle *area,
901  int x, int y, int width, int height,
902  Style *style, bool inverse);
903 void drawBackground (View *view, Layout *layout, Rectangle *area,
904  int x, int y, int width, int height,
905  int xRef, int yRef, int widthRef, int heightRef,
906  Style *style, Color *bgColor, bool inverse, bool atTop);
907 void drawBackgroundImage (View *view, StyleImage *backgroundImage,
908  BackgroundRepeat backgroundRepeat,
909  BackgroundAttachment backgroundAttachment,
910  Length backgroundPositionX,
911  Length backgroundPositionY,
912  int x, int y, int width, int height,
913  int xRef, int yRef, int widthRef, int heightRef);
914 void numtostr (int num, char *buf, int buflen, ListStyleType listStyleType);
915 
916 } // namespace style
917 } // namespace core
918 } // namespace dw
919 
920 #endif // __DW_STYLE_HH__
921 
Implementation of ImgRenderer, which distributes all calls to a set of other implementations of ImgRe...
Definition: imgrenderer.hh:59
Definition: style.hh:224
int wordSpacing
Definition: style.hh:555
bool equals(lout::object::Object *other)
Returns, whether two objects are equal.
Definition: style.cc:154
Cursor
Definition: style.hh:200
Length createAbsLength(int n)
Returns a length of n pixels.
Definition: style.hh:431
Definition: style.hh:202
static Font * create(Layout *layout, FontAttrs *attrs)
Definition: style.cc:443
bool sizeDiffs(StyleAttrs *otherStyleAttrs)
This method returns whether something may change its size, when its style changes from this style to ...
Definition: style.cc:149
Definition: style.hh:252
const char * name
Definition: style.hh:683
Definition: style.hh:337
virtual void onLeave()
Definition: style.hh:672
void fatal()
Called, when there are problems with the retrieval of image data.
Definition: style.cc:710
int boxOffsetX()
Definition: style.hh:591
Length backgroundPositionX
Definition: style.hh:539
void drawRow(int row)
Called, when data from a row is available and has been copied into the image buffer.
Definition: style.cc:650
Overflow
Definition: style.hh:336
void ref()
Definition: style.hh:873
Length right
Definition: style.hh:553
int bottom
Definition: style.hh:507
TextAlignType textAlign
Definition: style.hh:542
Definition: style.hh:345
Box margin
Definition: style.hh:559
An object::Object wrapper for strings (char*).
Definition: object.hh:185
StyleImage * image
Definition: style.hh:788
Definition: style.hh:347
Definition: style.hh:751
Imgbuf * imgbufSrc
Definition: style.hh:800
virtual ~Font()
Definition: style.cc:421
Length createRelLength(double v)
Returns a relative length.
Definition: style.hh:438
virtual BackgroundAttachment getBackgroundAttachment()=0
Suitable for widgets and parts of widgets.
Definition: style.hh:854
void initValues()
Definition: style.cc:56
void unref()
Definition: style.hh:777
int getTilesY(bool repeatX, bool repeatY)
Definition: style.hh:882
Typed version of container::untyped::HashTable.
Definition: container.hh:514
Represents a dimension box according to the CSS box model.
Definition: style.hh:503
Shading
Definition: style.hh:767
dw::core::Shape implemtation for simple rectangles.
Definition: types.hh:69
Definition: style.hh:344
Definition: style.hh:373
static StyleImage * create()
Definition: style.hh:871
Length left
Definition: style.hh:553
Definition: style.hh:209
Color * color
Definition: style.hh:535
TooltipAttrs(const char *text)
Definition: style.hh:651
Definition: style.hh:374
Definition: style.hh:258
int right
Definition: style.hh:507
Length minWidth
Definition: style.hh:557
Definition: style.hh:294
void unref()
Definition: style.hh:668
Definition: style.hh:211
int vBorderSpacing
Definition: style.hh:555
void unref()
Definition: style.hh:874
bool equals(lout::object::Object *other)
Returns, whether two objects are equal.
Definition: style.cc:455
int top
Definition: style.hh:507
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.
Definition: style.cc:1220
bool isPerLength(Length l)
Returns true if l is a percentage.
Definition: style.hh:445
Definition: style.hh:227
LineType
Definition: style.hh:291
The central class for managing and drawing a widget tree.
Definition: layout.hh:16
Definition: style.hh:361
This is the base class for many other classes, which defines very common virtual methods.
Definition: object.hh:24
int absLengthVal(Length l)
Returns the value of a length in pixels, as an integer.
Definition: style.hh:451
void finish()
Called, when all image data has been retrieved.
Definition: style.cc:608
void ref()
Definition: style.hh:722
Definition: style.hh:239
BorderStyle
Definition: style.hh:223
StyleImgRenderer * styleImgRenderer
Definition: style.hh:802
int shadeColor(int color, int d)
Definition: style.cc:471
Box borderWidth
Definition: style.hh:559
Definition: style.hh:213
V * get(K *key) const
Definition: container.hh:523
Definition: style.hh:201
StyleImage * backgroundImage
Definition: style.hh:536
int tilesX
Definition: style.hh:799
Definition: style.hh:253
Length lineHeight
Definition: style.hh:556
BorderCollapse
Definition: style.hh:218
Tooltip(const char *text)
Definition: style.hh:663
int refCount
Definition: style.hh:701
Definition: style.hh:375
DisplayType display
Definition: style.hh:564
int xHeight
Definition: style.hh:717
Definition: style.hh:228
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.
Definition: style.cc:1155
FloatType vloat
Definition: style.hh:547
static Layout * layout
Definition: dw_anchors_test.cc:38
int refCount
Definition: style.hh:617
bool equals(Box *other)
Definition: style.hh:510
Useful (but not mandatory) base class for updates of areas with background images.
Definition: style.hh:812
Definition: style.hh:261
Definition: style.hh:768
Definition: style.hh:207
Definition: style.hh:263
int hashValue()
Return a hash value for the object.
Definition: style.cc:410
int textDecoration
Definition: style.hh:533
Definition: style.hh:249
int hashValue()
Definition: style.hh:516
void finish()
Called, when all image data has been retrieved.
Definition: style.cc:698
double relLengthVal(Length l)
Returns the value of a relative length, as a float.
Definition: style.hh:466
ListStyleType listStyleType
Definition: style.hh:567
int hBorderSpacing
Definition: style.hh:555
Definition: style.hh:230
Definition: style.hh:292
BackgroundAttachment
Definition: style.hh:243
Definition: style.hh:730
WhiteSpace whiteSpace
Definition: style.hh:565
Definition: style.hh:698
TextTransform textTransform
Definition: style.hh:545
TextDecoration
Definition: style.hh:350
BackgroundAttachment getBackgroundAttachment()
Definition: style.cc:730
Length textIndent
Definition: style.hh:556
void setVal(int val)
Definition: style.hh:509
Definition: style.hh:328
Imgbuf * getImgbufSrc()
Definition: style.hh:877
void numtostr(int num, char *buf, int buflen, ListStyleType listStyleType)
Convert a number into a string, in a given list style.
Definition: style.cc:1409
~StyleImage()
Definition: style.cc:631
BorderStyle top
Definition: style.hh:562
char textAlignChar
Definition: style.hh:544
int multiplyWithPerLength(int x, Length l)
Multiply an int with a percentage length, returning int.
Definition: style.hh:473
Length maxHeight
Definition: style.hh:557
FloatType
Definition: style.hh:366
ImgRenderer * getMainImgRenderer()
Definition: style.hh:884
Definition: style.hh:268
void copyAttrs(StyleAttrs *attrs)
Definition: style.cc:342
Definition: style.hh:214
BackgroundAttachment backgroundAttachment
Definition: style.hh:538
static lout::container::typed::HashTable< StyleAttrs, Style > * styleTable
Definition: style.hh:618
Definition: style.hh:613
int getTilesX(bool repeatX, bool repeatY)
Definition: style.hh:880
int tilesY
Definition: style.hh:799
bool isRelLength(Length l)
Returns true if l is a relative length.
Definition: style.hh:448
Font()
Definition: style.hh:706
int boxDiffWidth()
Definition: style.hh:595
int boxRestHeight()
Definition: style.hh:598
Length height
Definition: style.hh:556
Definition: style.hh:327
FontStyle
Definition: style.hh:325
Imgbuf * imgbufTiled
Definition: style.hh:800
int multiplyWithPerLengthRounded(int x, Length l)
Like multiplyWithPerLength, but rounds to nearest integer instead of down.
Definition: style.hh:483
Length getBackgroundPositionX()
Definition: style.cc:736
int letterSpacing
Definition: style.hh:686
FontStyle style
Definition: style.hh:688
Definition: style.hh:259
Definition: style.hh:215
int weight
Definition: style.hh:685
virtual ~Color()
Definition: style.cc:466
Color * backgroundColor
Definition: style.hh:535
StyleImgRenderer(StyleImage *image)
Definition: style.hh:791
StyleImage()
Definition: style.cc:618
static Font * create0(Layout *layout, FontAttrs *attrs, bool tryEverything)
Definition: style.cc:437
Length bottom
Definition: style.hh:553
Definition: style.hh:376
Definition: style.hh:237
int color
Definition: style.hh:733
BorderCollapse borderCollapse
Definition: style.hh:560
Definition: style.hh:283
Definition: style.hh:293
Definition: style.hh:288
Length minHeight
Definition: style.hh:557
Represents "auto" lengths.
Definition: style.hh:494
#define DBG_OBJ_CREATE(klass)
Definition: debug_rtfl.hh:412
ImgRendererDist * imgRendererDist
Definition: style.hh:801
int boxDiffHeight()
Definition: style.hh:600
~Style()
Definition: style.cc:315
int multiplyWithRelLength(int x, Length l)
Definition: style.hh:487
Definition: style.hh:260
bool equals(lout::object::Object *other)
Returns, whether two objects are equal.
Definition: style.cc:397
void put(ImgRenderer *child)
Definition: imgrenderer.hh:75
Definition: style.hh:657
void put(K *key, V *value)
Definition: container.hh:521
FontVariant fontVariant
Definition: style.hh:687
Tooltip * x_tooltip
Definition: style.hh:573
BackgroundRepeat getBackgroundRepeat()
Definition: style.cc:723
Definition: style.hh:232
An observed object has a signal emitter, which tells the receivers, when the object is deleted...
Definition: signal.hh:274
int refCount
Definition: style.hh:660
static Tooltip * create(dw::core::Layout *layout, const char *text)
Definition: style.cc:535
Definition: container.cc:27
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)
Definition: style.cc:1273
int hashValue()
Return a hash value for the object.
Definition: style.cc:461
Color * top
Definition: style.hh:561
Definition: style.hh:238
void putExternalImgRenderer(ImgRenderer *ir)
Add an additional ImgRenderer, especially used for drawing.
Definition: style.hh:890
Length backgroundPositionY
Definition: style.hh:540
int hashValue()
Return a hash value for the object.
Definition: style.cc:215
ListStylePosition listStylePosition
Definition: style.hh:566
Definition: style.hh:282
Definition: style.hh:229
FontVariant
Definition: style.hh:331
Imgbuf * getImgbufTiled(bool repeatX, bool repeatY)
Definition: style.hh:878
Definition: style.hh:360
void resetValues()
Reset those style attributes to their standard values, which are not inherited, according to CSS...
Definition: style.cc:103
int spaceWidth
Definition: style.hh:716
int boxRestWidth()
Definition: style.hh:593
'z-index' is stored as int; use this for the value 'auto'.
Definition: style.hh:387
Definition: style.hh:204
bool isAbsLength(Length l)
Returns true if l is an absolute length.
Definition: style.hh:442
Definition: style.hh:359
virtual bool readyToDraw()=0
If this method returns false, nothing is done at all.
Definition: style.hh:233
void unref()
Definition: style.hh:641
VAlignType
Definition: style.hh:256
ClearType
Definition: style.hh:372
Definition: style.hh:278
ListStylePosition
Definition: style.hh:297
char x_lang[2]
Definition: style.hh:574
ClearType clear
Definition: style.hh:548
void getPaddingArea(int *x, int *y, int *width, int *height)
static int totalRef
Definition: style.hh:616
virtual Style * getStyle()=0
Return the style this background image is part of.
Definition: style.hh:212
Definition: style.hh:529
Definition: style.hh:340
int size
Definition: style.hh:684
Overflow overflow
Definition: style.hh:550
void setBuffer(core::Imgbuf *buffer, bool resize)
Called, when an image buffer is attached.
Definition: style.cc:542
struct dw::core::style::StyleAttrs::@17 borderColor
void setBorderStyle(BorderStyle val)
Definition: style.hh:587
virtual void getRefArea(int *xRef, int *yRef, int *widthRef, int *heightRef)=0
Return the "reference area".
virtual void getBgArea(int *x, int *y, int *width, int *height)=0
Return the area covered by the background image.
virtual void onMotion()
Definition: style.hh:673
VAlignType valign
Definition: style.hh:543
The platform independent interface for image buffers.
Definition: imgbuf.hh:161
Length maxWidth
Definition: style.hh:557
BackgroundRepeat backgroundRepeat
Definition: style.hh:537
int zIndex
Definition: style.hh:569
void copyAttrs(FontAttrs *attrs)
Definition: style.cc:427
Definition: style.hh:231
Length createPerLength(double v)
Returns a percentage, v is relative to 1, not to 100.
Definition: style.hh:434
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtablecell.cc:28
Definition: style.hh:367
void remove(ImgRenderer *child)
Definition: imgrenderer.hh:77
void drawRow(int row)
Called, when data from a row is available and has been copied into the image buffer.
Definition: style.cc:584
Length width
Definition: style.hh:556
An interface to encapsulate platform dependent drawing.
Definition: view.hh:16
double perLengthVal_useThisOnlyForDebugging(Length l)
Returns the value of a percentage, relative to 1, as a double.
Definition: style.hh:458
int ascent
Definition: style.hh:715
virtual void onEnter()
Definition: style.hh:671
Definition: style.hh:368
int roundInt(double d)
Definition: misc.hh:61
int boxOffsetY()
Definition: style.hh:596
Definition: style.hh:262
Definition: style.hh:264
Definition: style.hh:287
int refCount
Definition: style.hh:754
Definition: style.hh:257
Definition: style.hh:279
Definition: style.hh:338
Cursor cursor
Definition: style.hh:568
Color(int color)
Definition: style.hh:760
Definition: style.hh:782
Definition: style.hh:648
Position position
Definition: style.hh:552
void fatal()
Called, when there are problems with the retrieval of image data.
Definition: style.cc:613
Definition: style.hh:251
static Style * create(StyleAttrs *attrs)
Definition: style.hh:628
int getColor()
Definition: style.hh:741
TextTransform
Definition: style.hh:267
virtual BackgroundRepeat getBackgroundRepeat()=0
Length getBackgroundPositionY()
Definition: style.cc:742
Definition: style.hh:326
void ref()
Definition: style.hh:667
ColorAttrs(int color)
Definition: style.hh:736
void setBuffer(core::Imgbuf *buffer, bool resize)
Called, when an image buffer is attached.
Definition: style.cc:644
void unref()
Definition: style.hh:723
Style(StyleAttrs *attrs)
Definition: style.cc:276
Definition: style.hh:203
WhiteSpace
Definition: style.hh:358
int x_img
Definition: style.hh:572
Definition: style.hh:346
Definition: style.hh:332
BackgroundRepeat
Definition: style.hh:236
static bool exists(Layout *layout, const char *name)
Definition: style.cc:448
bool hasBackground()
Definition: style.hh:602
Definition: style.hh:225
static Color * create(Layout *layout, int color)
Definition: style.cc:528
Definition: style.hh:281
Length top
Definition: style.hh:553
int Length
Type for representing all lengths within dw::core::style.
Definition: style.hh:428
int left
Definition: style.hh:507
int descent
Definition: style.hh:715
struct dw::core::style::StyleAttrs::@18 borderStyle
Definition: style.hh:205
void setBorderColor(Color *val)
Definition: style.hh:584
void ref()
Definition: style.hh:776
...
Definition: imgrenderer.hh:16
ListStyleType
Definition: style.hh:301
Definition: style.hh:226
int x_link
Definition: style.hh:571
Box padding
Definition: style.hh:559
Definition: style.hh:250
void ref()
Definition: style.hh:640
Definition: style.hh:208
Definition: style.hh:767
int refCount
Definition: style.hh:799
Definition: style.hh:339
Definition: style.hh:369
DisplayType
Definition: style.hh:277
Position
Definition: style.hh:343
Definition: style.hh:206
void removeExternalImgRenderer(ImgRenderer *ir)
Remove a previously added additional ImgRenderer.
Definition: style.hh:896
Definition: style.hh:680
StyleImage * getBackgroundImage()
Definition: style.cc:717
Definition: style.hh:210
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.
Font * font
Definition: style.hh:532
TextAlignType
Definition: style.hh:248