dillo  3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

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 "../lout/signal.hh"
11 #include "../lout/debug.hh"
12 
13 namespace dw {
14 namespace core {
15 
196 namespace style {
197 
198 enum Cursor {
214 };
215 
219 };
220 
232 };
233 
239 };
240 
244 };
245 
252 };
253 
263 };
264 
270 };
271 
287 };
288 
289 enum LineType {
293 };
294 
298 };
299 
322 };
323 
324 enum FontStyle {
328 };
329 
333 };
334 
341 };
342 
349 };
350 
389 typedef int Length;
390 
392 inline Length createAbsLength(int n) { return (n << 2) | 1; }
393 
395 inline Length createPerLength(double v) {
396  return ((int)(v * (1 << 18)) & ~3) | 2; }
397 
399 inline Length createRelLength(double v) {
400  return ((int)(v * (1 << 18)) & ~3) | 3; }
401 
403 inline bool isAbsLength(Length l) { return (l & 3) == 1; }
404 
406 inline bool isPerLength(Length l) { return (l & 3) == 2; }
407 
409 inline bool isRelLength(Length l) { return (l & 3) == 3; }
410 
412 inline int absLengthVal(Length l) { return l >> 2; }
413 
419 inline double perLengthVal(Length l) { return (double)(l & ~3) / (1 << 18); }
420 
426 inline double relLengthVal(Length l) { return (double)(l & ~3) / (1 << 18); }
427 
433 inline int multiplyWithPerLength(int x, Length l) {
434  return x * perLengthVal(l);
435 }
436 
443 inline int multiplyWithPerLengthRounded (int x, Length l) {
444  return lout::misc::roundInt (x * perLengthVal(l));
445 }
446 
447 inline int multiplyWithRelLength(int x, Length l) {
448  return x * relLengthVal(l);
449 }
450 
451 
452 enum {
455 };
456 
463 class Box
464 {
465 public:
466  /* in future also percentages */
468 
469  inline void setVal(int val) { top = right = bottom = left = val; }
470  inline bool equals (Box *other) {
471  return top == other->top &&
472  right == other->right &&
473  bottom == other->bottom &&
474  left == other->left;
475  }
476  inline int hashValue () {
477  return top + right + bottom + left;
478  }
479 };
480 
481 class Tooltip;
482 class Font;
483 class Color;
484 class StyleImage;
485 
490 {
491 public:
493  int textDecoration; /* No TextDecoration because of problems converting
494  * TextDecoration <-> int */
499  Length backgroundPositionX; // "left" defined by "0%" etc. (see CSS spec)
500  Length backgroundPositionY; // "top" defined by "0%" etc. (see CSS spec)
501 
504  char textAlignChar; /* In future, strings will be supported. */
506 
509 
512  struct { Color *top, *right, *bottom, *left; } borderColor;
514 
520 
521  int x_link;
522  int x_img;
524  char x_lang[2]; /* Either x_lang[0] == x_lang[1] == 0 (no language
525  set), or x_lang contains the RFC 1766 country
526  code in lower case letters. (Only two letters
527  allowed, currently.) */
528 
529  void initValues ();
530  void resetValues ();
531 
532  bool sizeDiffs (StyleAttrs *otherStyleAttrs);
533 
534  inline void setBorderColor(Color *val) {
535  borderColor.top = borderColor.right = borderColor.bottom
536  = borderColor.left = val; }
537  inline void setBorderStyle(BorderStyle val) {
538  borderStyle.top = borderStyle.right = borderStyle.bottom
539  = borderStyle.left = val; }
540 
541  inline int boxOffsetX ()
542  {
543  return margin.left + borderWidth.left + padding.left;
544  }
545  inline int boxRestWidth ()
546  {
548  }
549  inline int boxDiffWidth () { return boxOffsetX () + boxRestWidth (); }
550  inline int boxOffsetY ()
551  {
552  return margin.top + borderWidth.top + padding.top;
553  }
554  inline int boxRestHeight ()
555  {
557  }
558  inline int boxDiffHeight () { return boxOffsetY () + boxRestHeight (); }
559 
560  inline bool hasBackground ()
561  { return backgroundColor != NULL || backgroundImage != NULL; }
562 
563  bool equals (lout::object::Object *other);
564  int hashValue ();
565 };
566 
567 
571 class Style: public StyleAttrs
572 {
573 private:
574  static int totalRef;
575  int refCount;
577 
578  Style (StyleAttrs *attrs);
579 
580 protected:
581  ~Style();
582 
583  void copyAttrs (StyleAttrs *attrs);
584 
585 public:
586  inline static Style *create (StyleAttrs *attrs)
587  {
588  Style *style = styleTable->get (attrs);
589  if (style) {
590  style->ref ();
591  } else {
592  style = new Style (attrs);
593  styleTable->put(style, style);
594  }
595  return style;
596  }
597 
598  inline void ref () { refCount++; }
599  inline void unref () { if (--refCount == 0) delete this; }
600 };
601 
602 
607 {
608 public:
609  TooltipAttrs(const char *text): lout::object::String(text) { }
610 };
611 
615 class Tooltip: public TooltipAttrs
616 {
617 private:
618  int refCount;
619 
620 protected:
621  Tooltip (const char *text): TooltipAttrs(text) { refCount = 0; }
622 
623 public:
624  static Tooltip *create (dw::core::Layout *layout, const char *text);
625  inline void ref () { refCount++; }
626  inline void unref ()
627  { if (--refCount == 0) delete this; }
628 
629  inline virtual void onEnter () { }
630  inline virtual void onLeave () { }
631  inline virtual void onMotion () { }
632 };
633 
634 
639 {
640 public:
641  const char *name;
642  int size;
643  int weight;
647 
648  bool equals(lout::object::Object *other);
649  int hashValue();
650 };
651 
652 
656 class Font: public FontAttrs
657 {
658 private:
659  int refCount;
660 
661  static Font *create0 (Layout *layout, FontAttrs *attrs, bool tryEverything);
662 
663 protected:
664  inline Font () {
665  DBG_OBJ_CREATE ("dw::core::style::Font");
666  refCount = 0;
667  }
668  virtual ~Font ();
669 
670  void copyAttrs (FontAttrs *attrs);
671 
672 public:
675  int xHeight;
676 
677  static Font *create (Layout *layout, FontAttrs *attrs);
678  static bool exists (Layout *layout, const char *name);
679 
680  inline void ref () { refCount++; }
681  inline void unref () { if (--refCount == 0) delete this; }
682 };
683 
684 
689 {
690 protected:
691  int color;
692 
693 public:
694  inline ColorAttrs(int color)
695  {
696  this->color = color;
697  }
698 
699  inline int getColor () { return color; }
700 
701  bool equals(lout::object::Object *other);
702  int hashValue();
703 };
704 
705 
709 class Color: public ColorAttrs
710 {
711 private:
712  int refCount;
713 
714  void remove(dw::core::Layout *layout);
715  int shadeColor (int color, int d);
716 
717 protected:
718  inline Color (int color): ColorAttrs (color) {
719  DBG_OBJ_CREATE ("dw::core::style::Color");
720  refCount = 0;
721  }
722  virtual ~Color ();
723 
724 public:
727 
728 protected:
729  int shadeColor (int color, Shading shading);
730 
731 public:
732  static Color *create (Layout *layout, int color);
733 
734  inline void ref () { refCount++; }
735  inline void unref ()
736  { if (--refCount == 0) delete this; }
737 };
738 
739 
741 {
742 private:
744  {
745  private:
747 
748  public:
749  inline StyleImgRenderer (StyleImage *image) { this->image = image; }
750 
751  void setBuffer (core::Imgbuf *buffer, bool resize);
752  void drawRow (int row);
753  void finish ();
754  void fatal ();
755  };
756 
761 
762  StyleImage ();
763  ~StyleImage ();
764 
765 public:
771  {
772  public:
773  void setBuffer (core::Imgbuf *buffer, bool resize);
774  void drawRow (int row);
775  void finish ();
776  void fatal ();
777 
781  virtual bool readyToDraw () = 0;
782 
786  virtual void getBgArea (int *x, int *y, int *width, int *height) = 0;
787 
793  virtual void getRefArea (int *xRef, int *yRef, int *widthRef,
794  int *heightRef) = 0;
795 
796  virtual StyleImage *getBackgroundImage () = 0;
797  virtual BackgroundRepeat getBackgroundRepeat () = 0;
799  virtual Length getBackgroundPositionX () = 0;
800  virtual Length getBackgroundPositionY () = 0;
801 
806  virtual void draw (int x, int y, int width, int height) = 0;
807  };
808 
813  {
814  public:
815  void getPaddingArea (int *x, int *y, int *width, int *height);
816 
822 
826  virtual Style *getStyle () = 0;
827  };
828 
829  static StyleImage *create () { return new StyleImage (); }
830 
831  inline void ref () { refCount++; }
832  inline void unref ()
833  { if (--refCount == 0) delete this; }
834 
835  inline Imgbuf *getImgbufSrc () { return imgbufSrc; }
836  inline Imgbuf *getImgbufTiled (bool repeatX, bool repeatY)
837  { return (imgbufTiled && repeatX && repeatY) ? imgbufTiled : imgbufSrc; }
838  inline int getTilesX (bool repeatX, bool repeatY)
839  { return (imgbufTiled && repeatX && repeatY) ? tilesX : 1; }
840  inline int getTilesY (bool repeatX, bool repeatY)
841  { return (imgbufTiled && repeatX && repeatY) ? tilesY : 1; }
843 
849  { imgRendererDist->put (ir); }
850 
855  { imgRendererDist->remove (ir); }
856 };
857 
858 void drawBorder (View *view, Layout *layout, Rectangle *area,
859  int x, int y, int width, int height,
860  Style *style, bool inverse);
861 void drawBackground (View *view, Layout *layout, Rectangle *area,
862  int x, int y, int width, int height,
863  int xRef, int yRef, int widthRef, int heightRef,
864  Style *style, bool inverse, bool atTop);
865 void drawBackgroundImage (View *view, StyleImage *backgroundImage,
866  BackgroundRepeat backgroundRepeat,
867  BackgroundAttachment backgroundAttachment,
868  Length backgroundPositionX,
869  Length backgroundPositionY,
870  int x, int y, int width, int height,
871  int xRef, int yRef, int widthRef, int heightRef);
872 void numtostr (int num, char *buf, int buflen, ListStyleType listStyleType);
873 
874 } // namespace style
875 } // namespace core
876 } // namespace dw
877 
878 #endif // __DW_STYLE_HH__
879 
dw::core::style::VALIGN_SUPER
Definition: style.hh:260
dw::core::style::StyleImage::ExternalImgRenderer::fatal
void fatal()
Called, when there are problems with the retrieval of image data.
Definition: style.cc:659
dw::core::style::Box::hashValue
int hashValue()
Definition: style.hh:476
dw::core::style::StyleAttrs::initValues
void initValues()
Definition: style.cc:58
dw::core::style::TEXT_DECORATION_UNDERLINE
Definition: style.hh:337
dw::core::style::Tooltip
Definition: style.hh:615
dw::core::style::TooltipAttrs::TooltipAttrs
TooltipAttrs(const char *text)
Definition: style.hh:609
dw::core::style::StyleAttrs::textTransform
TextTransform textTransform
Definition: style.hh:505
dw::core::style::StyleImage::ExternalImgRenderer::getBgArea
virtual void getBgArea(int *x, int *y, int *width, int *height)=0
Return the area covered by the background image.
dw::core::style::CURSOR_SW_RESIZE
Definition: style.hh:208
dw::core::style::StyleAttrs::top
Color * top
Definition: style.hh:512
dw::core::style::StyleImage::putExternalImgRenderer
void putExternalImgRenderer(ImgRenderer *ir)
Add an additional ImgRenderer, especially used for drawing.
Definition: style.hh:848
dw::core::style::StyleAttrs::backgroundPositionY
Length backgroundPositionY
Definition: style.hh:500
dw::core::style::Cursor
Cursor
Definition: style.hh:198
dw::core::style::BORDER_DOUBLE
Definition: style.hh:227
dw::core::style::Tooltip::create
static Tooltip * create(dw::core::Layout *layout, const char *text)
Definition: style.cc:484
dw::core::style::WhiteSpace
WhiteSpace
Definition: style.hh:343
dw::core::style::TEXT_DECORATION_BLINK
Definition: style.hh:340
dw::core::style::StyleImage::StyleImgRenderer::image
StyleImage * image
Definition: style.hh:746
dw::core::style::TEXT_TRANSFORM_NONE
Definition: style.hh:266
dw::core::style::TEXT_ALIGN_LEFT
Definition: style.hh:247
dw::core::style::StyleImage::ExternalImgRenderer::getBackgroundPositionY
virtual Length getBackgroundPositionY()=0
dw::core::style::isPerLength
bool isPerLength(Length l)
Returns true if l is a percentage.
Definition: style.hh:406
dw::core::style::StyleImage::ExternalImgRenderer::draw
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.
dw::core::style::Color::refCount
int refCount
Definition: style.hh:712
dw::core::style::LIST_STYLE_TYPE_DISC
Definition: style.hh:301
dw::core::style::StyleAttrs::right
Color * right
Definition: style.hh:512
dw::core::style::absLengthVal
int absLengthVal(Length l)
Returns the value of a length in pixels, as an integer.
Definition: style.hh:412
dw::core::style::Style::styleTable
static lout::container::typed::HashTable< StyleAttrs, Style > * styleTable
Definition: style.hh:576
dw::core::style::StyleImage::getTilesX
int getTilesX(bool repeatX, bool repeatY)
Definition: style.hh:838
dw::core::style::FontAttrs::style
FontStyle style
Definition: style.hh:646
dw::core::style::Style::ref
void ref()
Definition: style.hh:598
dw::core::style::LIST_STYLE_TYPE_GEORGIAN
Definition: style.hh:315
DBG_OBJ_CREATE
#define DBG_OBJ_CREATE(klass)
Definition: debug.hh:175
dw::core::style::DISPLAY_INLINE
Definition: style.hh:277
dw::core::style::StyleAttrs::height
Length height
Definition: style.hh:508
dw::core::style::TEXT_DECORATION_OVERLINE
Definition: style.hh:338
dw::core::style::DISPLAY_TABLE
Definition: style.hh:281
dw::core::style::WHITE_SPACE_NORMAL
Definition: style.hh:344
dw::core::style::StyleAttrs::boxOffsetY
int boxOffsetY()
Definition: style.hh:550
dw::core::style::WHITE_SPACE_PRE_LINE
Definition: style.hh:348
dw::core::style::StyleAttrs::width
Length width
Definition: style.hh:508
dw::core::style::LINE_DASHED
Definition: style.hh:292
dw::core::style::LENGTH_AUTO
Represents "auto" lengths.
Definition: style.hh:454
dw::core::style::LIST_STYLE_TYPE_UPPER_ROMAN
Definition: style.hh:307
dw::core::style::CURSOR_POINTER
Definition: style.hh:201
dw::core::style::StyleAttrs::boxRestHeight
int boxRestHeight()
Definition: style.hh:554
dw::core::style::StyleAttrs::hashValue
int hashValue()
Return a hash value for the object.
Definition: style.cc:190
dw::core::style::StyleAttrs::textAlignChar
char textAlignChar
Definition: style.hh:504
dw::core::style::DISPLAY_INLINE_BLOCK
Definition: style.hh:278
dw::core::style::TextAlignType
TextAlignType
Definition: style.hh:246
dw::core::style::StyleImage::ExternalImgRenderer
Useful (but not mandatory) base class for updates of areas with background images.
Definition: style.hh:770
dw::core::style::StyleAttrs::margin
Box margin
Definition: style.hh:510
dw::core::style::CURSOR_E_RESIZE
Definition: style.hh:203
dw::core::style::BorderCollapse
BorderCollapse
Definition: style.hh:216
dw::core::style::Font::copyAttrs
void copyAttrs(FontAttrs *attrs)
Definition: style.cc:376
dw::core::style::StyleAttrs::x_lang
char x_lang[2]
Definition: style.hh:524
dw::core::style::Color
Definition: style.hh:709
dw::core::style::VALIGN_TEXT_BOTTOM
Definition: style.hh:262
dw::core::style::StyleAttrs::backgroundColor
Color * backgroundColor
Definition: style.hh:495
dw::core::style::DISPLAY_TABLE_ROW_GROUP
Definition: style.hh:282
dw::core::style::TEXT_TRANSFORM_UPPERCASE
Definition: style.hh:268
dw::core::style::StyleImage::ExternalImgRenderer::getBackgroundPositionX
virtual Length getBackgroundPositionX()=0
dw::core::style::StyleAttrs::cursor
Cursor cursor
Definition: style.hh:519
dw::core::style::Color::SHADING_NUM
Definition: style.hh:726
dw::core::style::StyleAttrs::borderCollapse
BorderCollapse borderCollapse
Definition: style.hh:511
dw::core::style::LIST_STYLE_TYPE_LOWER_ROMAN
Definition: style.hh:306
dw::core::style::DISPLAY_TABLE_ROW
Definition: style.hh:285
dw::core::style::FONT_STYLE_ITALIC
Definition: style.hh:326
dw::core::ImgRendererDist
Implementation of ImgRenderer, which distributes all calls to a set of other implementations of ImgRe...
Definition: imgrenderer.hh:59
dw::core::style::StyleAttrs::lineHeight
Length lineHeight
Definition: style.hh:508
dw::core::style::Style::create
static Style * create(StyleAttrs *attrs)
Definition: style.hh:586
dw::core::style::FontAttrs::weight
int weight
Definition: style.hh:643
dw::core::style::TextDecoration
TextDecoration
Definition: style.hh:335
dw::core::style::Tooltip::ref
void ref()
Definition: style.hh:625
dw::core::style::StyleAttrs::display
DisplayType display
Definition: style.hh:515
dw::core::style::BACKGROUND_REPEAT
Definition: style.hh:235
dw::core::style::LIST_STYLE_TYPE_HIRAGANA
Definition: style.hh:317
dw::core::style::Style::Style
Style(StyleAttrs *attrs)
Definition: style.cc:238
dw::core::style::Tooltip::unref
void unref()
Definition: style.hh:626
dw::core::style::StyleAttrs::listStylePosition
ListStylePosition listStylePosition
Definition: style.hh:517
dw::core::style::StyleAttrs::whiteSpace
WhiteSpace whiteSpace
Definition: style.hh:516
dw::core::style::drawBorder
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:1104
dw::core::style::LIST_STYLE_TYPE_HEBREW
Definition: style.hh:313
dw::core::style::StyleAttrs::resetValues
void resetValues()
Reset those style attributes to their standard values, which are not inherited, according to CSS.
Definition: style.cc:98
dw::core::style::FontAttrs::equals
bool equals(lout::object::Object *other)
Returns, whether two objects are equal.
Definition: style.cc:346
dw::core::style::LIST_STYLE_POSITION_OUTSIDE
Definition: style.hh:297
dw::core::style::LIST_STYLE_TYPE_DECIMAL
Definition: style.hh:304
dw::core::style::Color::SHADING_LIGHT
Definition: style.hh:725
dw::core::style::BACKGROUND_REPEAT_Y
Definition: style.hh:237
dw::core::style::StyleImage::unref
void unref()
Definition: style.hh:832
dw::core::style::CURSOR_MOVE
Definition: style.hh:202
dw::core::style::LIST_STYLE_TYPE_CIRCLE
Definition: style.hh:302
dw::core::style::StyleAttrs::backgroundRepeat
BackgroundRepeat backgroundRepeat
Definition: style.hh:497
dw::core::style::LineType
LineType
Definition: style.hh:289
dw::core::style::Box::right
int right
Definition: style.hh:467
dw::core::style::CURSOR_NE_RESIZE
Definition: style.hh:204
dw::core::style::Color::ref
void ref()
Definition: style.hh:734
dw::core::style::TEXT_ALIGN_CENTER
Definition: style.hh:249
dw::core::style::FontAttrs::letterSpacing
int letterSpacing
Definition: style.hh:644
dw::core::style::BorderStyle
BorderStyle
Definition: style.hh:221
dw::core::style::multiplyWithPerLength
int multiplyWithPerLength(int x, Length l)
Multiply an int with a percentage length, returning int.
Definition: style.hh:433
dw::core::style::StyleImage::ExternalWidgetImgRenderer::getBackgroundPositionX
Length getBackgroundPositionX()
Definition: style.cc:685
dw::core::style::Box::equals
bool equals(Box *other)
Definition: style.hh:470
dw::core::style::Style::refCount
int refCount
Definition: style.hh:575
dw::core::style::LIST_STYLE_TYPE_SQUARE
Definition: style.hh:303
dw::core::style::StyleAttrs::setBorderStyle
void setBorderStyle(BorderStyle val)
Definition: style.hh:537
dw::core::style::numtostr
void numtostr(int num, char *buf, int buflen, ListStyleType listStyleType)
Convert a number into a string, in a given list style.
Definition: style.cc:1350
dw::core::style::FontAttrs
Definition: style.hh:638
dw::core::style::StyleImage::getMainImgRenderer
ImgRenderer * getMainImgRenderer()
Definition: style.hh:842
dw::core::style::BACKGROUND_NO_REPEAT
Definition: style.hh:238
dw::core::style::BORDER_INSET
Definition: style.hh:230
dw::core::style::VALIGN_MIDDLE
Definition: style.hh:257
dw::core::style::LINE_DOTTED
Definition: style.hh:291
dw::core::style::LIST_STYLE_TYPE_KATAKANA
Definition: style.hh:318
dw::core::style::TEXT_DECORATION_NONE
Definition: style.hh:336
dw::core::style::StyleImage::tilesY
int tilesY
Definition: style.hh:757
dw::core::style::Font::spaceWidth
int spaceWidth
Definition: style.hh:674
dw::core::style::StyleImage::ExternalImgRenderer::getBackgroundImage
virtual StyleImage * getBackgroundImage()=0
dw::core::style::relLengthVal
double relLengthVal(Length l)
Returns the value of a relative length, as a float.
Definition: style.hh:426
dw::core::style::StyleImage::StyleImgRenderer::finish
void finish()
Called, when all image data has been retrieved.
Definition: style.cc:557
dw::core::style::TEXT_TRANSFORM_LOWERCASE
Definition: style.hh:269
dw::core::style::Font::~Font
virtual ~Font()
Definition: style.cc:370
lout::object::String
An object::Object wrapper for strings (char*).
Definition: object.hh:134
dw::core::style::Color::unref
void unref()
Definition: style.hh:735
dw::core::style::StyleImage::tilesX
int tilesX
Definition: style.hh:757
dw::core::style::StyleImage::imgbufTiled
Imgbuf * imgbufTiled
Definition: style.hh:758
dw::core::style::Tooltip::Tooltip
Tooltip(const char *text)
Definition: style.hh:621
dw::core::style::BackgroundAttachment
BackgroundAttachment
Definition: style.hh:241
dw::core::style::TEXT_ALIGN_RIGHT
Definition: style.hh:248
dw::core::style::Color::Shading
Shading
Definition: style.hh:725
dw::core::style::Font::ascent
int ascent
Definition: style.hh:673
dw::core::style::multiplyWithPerLengthRounded
int multiplyWithPerLengthRounded(int x, Length l)
Like multiplyWithPerLength, but rounds to nearest integer instead of down.
Definition: style.hh:443
dw::core::style::multiplyWithRelLength
int multiplyWithRelLength(int x, Length l)
Definition: style.hh:447
dw::core::style::BORDER_DASHED
Definition: style.hh:225
dw::core::style::ColorAttrs
Definition: style.hh:688
dw::core::style::StyleAttrs::listStyleType
ListStyleType listStyleType
Definition: style.hh:518
dw::core::style::StyleImage::ExternalWidgetImgRenderer::getBackgroundAttachment
BackgroundAttachment getBackgroundAttachment()
Definition: style.cc:679
dw::core::style::StyleImage::ExternalImgRenderer::finish
void finish()
Called, when all image data has been retrieved.
Definition: style.cc:647
dw::core::style::Tooltip::refCount
int refCount
Definition: style.hh:618
dw::core::style::FontAttrs::name
const char * name
Definition: style.hh:641
dw::core::style::BACKGROUND_REPEAT_X
Definition: style.hh:236
dw::core::style::ColorAttrs::color
int color
Definition: style.hh:691
dw::core::style::Style::totalRef
static int totalRef
Definition: style.hh:574
dw::core::style::StyleAttrs::setBorderColor
void setBorderColor(Color *val)
Definition: style.hh:534
dw::core::style::StyleAttrs::borderStyle
struct dw::core::style::StyleAttrs::@14 borderStyle
dw::core::style::LIST_STYLE_TYPE_LOWER_LATIN
Definition: style.hh:310
dw::core::style::Color::SHADING_NORMAL
Definition: style.hh:725
dw::core::style::StyleAttrs::padding
Box padding
Definition: style.hh:510
dw::core::style::StyleAttrs::vBorderSpacing
int vBorderSpacing
Definition: style.hh:507
dw::core::style::VALIGN_TOP
Definition: style.hh:255
dw::core::style::StyleAttrs::boxDiffHeight
int boxDiffHeight()
Definition: style.hh:558
lout::container::typed::HashTable
Typed version of container::untyped::HashTable.
Definition: container.hh:475
lout::object::Object
This is the base class for many other classes, which defines very common virtual methods.
Definition: object.hh:24
dw::core::style::Font::create
static Font * create(Layout *layout, FontAttrs *attrs)
Definition: style.cc:392
dw::core::style::perLengthVal
double perLengthVal(Length l)
Returns the value of a percentage, relative to 1, as a double.
Definition: style.hh:419
dw::core::style::FontStyle
FontStyle
Definition: style.hh:324
dw::core::style::Style::copyAttrs
void copyAttrs(StyleAttrs *attrs)
Definition: style.cc:304
dw::core::style::LIST_STYLE_TYPE_LOWER_GREEK
Definition: style.hh:308
dw::core::style::DISPLAY_LIST_ITEM
Definition: style.hh:279
dw::core::style::StyleAttrs::equals
bool equals(lout::object::Object *other)
Returns, whether two objects are equal.
Definition: style.cc:142
dw::core::style::DISPLAY_TABLE_HEADER_GROUP
Definition: style.hh:283
dw::core::style::Font
Definition: style.hh:656
dw::core::style::FONT_STYLE_NORMAL
Definition: style.hh:325
dw::core::style::Font::exists
static bool exists(Layout *layout, const char *name)
Definition: style.cc:397
dw::core::style::StyleImage::ExternalImgRenderer::setBuffer
void setBuffer(core::Imgbuf *buffer, bool resize)
Called, when an image buffer is attached.
Definition: style.cc:593
dw::core::style::StyleImage::StyleImgRenderer::StyleImgRenderer
StyleImgRenderer(StyleImage *image)
Definition: style.hh:749
dw::core::style::CURSOR_NW_RESIZE
Definition: style.hh:205
dw::core::style::CURSOR_W_RESIZE
Definition: style.hh:210
dw::core::style::TooltipAttrs
Definition: style.hh:606
dw::core::style::CURSOR_TEXT
Definition: style.hh:211
lout
Definition: container.cc:26
dw::core::style::StyleAttrs::borderColor
struct dw::core::style::StyleAttrs::@13 borderColor
dw::core::style::LIST_STYLE_TYPE_NONE
Definition: style.hh:321
dw::core::style::LIST_STYLE_TYPE_ARMENIAN
Definition: style.hh:314
dw::core::style::StyleAttrs::backgroundAttachment
BackgroundAttachment backgroundAttachment
Definition: style.hh:498
dw::core::style::LIST_STYLE_TYPE_UPPER_ALPHA
Definition: style.hh:311
dw::core::style::StyleAttrs::textAlign
TextAlignType textAlign
Definition: style.hh:502
dw::core::style::isAbsLength
bool isAbsLength(Length l)
Returns true if l is an absolute length.
Definition: style.hh:403
dw::core::style::Color::create
static Color * create(Layout *layout, int color)
Definition: style.cc:477
dw::core::style::StyleImage::ExternalImgRenderer::getBackgroundAttachment
virtual BackgroundAttachment getBackgroundAttachment()=0
dw::core::Layout
The central class for managing and drawing a widget tree.
Definition: layout.hh:16
dw::core::style::Color::Color
Color(int color)
Definition: style.hh:718
dw::core::style::Box::setVal
void setVal(int val)
Definition: style.hh:469
dw::core::style::StyleAttrs::sizeDiffs
bool sizeDiffs(StyleAttrs *otherStyleAttrs)
This method returns whether something may change its size, when its style changes from this style to ...
Definition: style.cc:137
dw::core::style::isRelLength
bool isRelLength(Length l)
Returns true if l is a relative length.
Definition: style.hh:409
dw::core::style::BORDER_OUTSET
Definition: style.hh:231
dw::core::ImgRendererDist::remove
void remove(ImgRenderer *child)
Definition: imgrenderer.hh:77
dw::core::style::Color::SHADING_INVERSE
Definition: style.hh:725
dw::core::style::VAlignType
VAlignType
Definition: style.hh:254
dw::core::Imgbuf
The platform independent interface for image buffers.
Definition: imgbuf.hh:161
dw::core::style::FONT_STYLE_OBLIQUE
Definition: style.hh:327
dw::core::style::StyleAttrs::hasBackground
bool hasBackground()
Definition: style.hh:560
dw::core::style::FONT_VARIANT_SMALL_CAPS
Definition: style.hh:332
dw::core::style::StyleImage::imgbufSrc
Imgbuf * imgbufSrc
Definition: style.hh:758
dw::core::style::StyleImage::ExternalWidgetImgRenderer::getBackgroundRepeat
BackgroundRepeat getBackgroundRepeat()
Definition: style.cc:672
dw::core::style::Color::SHADING_DARK
Definition: style.hh:725
dw::core::style::StyleImage::create
static StyleImage * create()
Definition: style.hh:829
dw::core::style::createPerLength
Length createPerLength(double v)
Returns a percentage, v is relative to 1, not to 100.
Definition: style.hh:395
dw::core::style::CURSOR_SE_RESIZE
Definition: style.hh:207
dw::core::style::Style::unref
void unref()
Definition: style.hh:599
dw::core::Rectangle
dw::core::Shape implemtation for simple rectangles.
Definition: types.hh:69
dw::core::style::LIST_STYLE_TYPE_DECIMAL_LEADING_ZERO
Definition: style.hh:305
dw::core::style::StyleImage::getTilesY
int getTilesY(bool repeatX, bool repeatY)
Definition: style.hh:840
dw::core::style::StyleImage::ExternalWidgetImgRenderer::getPaddingArea
void getPaddingArea(int *x, int *y, int *width, int *height)
dw::core::style::StyleAttrs::left
Color * left
Definition: style.hh:512
dw::core::style::StyleImage::~StyleImage
~StyleImage()
Definition: style.cc:580
dw::core::style::StyleImage::refCount
int refCount
Definition: style.hh:757
dw::core::style::BORDER_DOTTED
Definition: style.hh:224
dw::core::View
An interface to encapsulate platform dependent drawing.
Definition: view.hh:16
dw::core::style::Font::unref
void unref()
Definition: style.hh:681
dw::core::style::StyleImage::ExternalWidgetImgRenderer::getStyle
virtual Style * getStyle()=0
Return the style this background image is part of.
dw::core::style::ColorAttrs::hashValue
int hashValue()
Return a hash value for the object.
Definition: style.cc:410
dw::core::ImgRenderer
...
Definition: imgrenderer.hh:16
dw::core::style::Color::remove
void remove(dw::core::Layout *layout)
dw::core::style::StyleImage::ExternalWidgetImgRenderer
Suitable for widgets and parts of widgets.
Definition: style.hh:812
dw::core::style::StyleAttrs::hBorderSpacing
int hBorderSpacing
Definition: style.hh:507
dw::core::style::LIST_STYLE_TYPE_CJK_IDEOGRAPHIC
Definition: style.hh:316
dw::core::style::VALIGN_SUB
Definition: style.hh:259
dw::core::style::Tooltip::onLeave
virtual void onLeave()
Definition: style.hh:630
dw::core::style::StyleImage::ExternalImgRenderer::readyToDraw
virtual bool readyToDraw()=0
If this method returns false, nothing is done at all.
dw::core::style::TEXT_DECORATION_LINE_THROUGH
Definition: style.hh:339
dw::core::style::LIST_STYLE_POSITION_INSIDE
Definition: style.hh:296
dw::core::style::Font::descent
int descent
Definition: style.hh:673
dw::core::style::FONT_VARIANT_NORMAL
Definition: style.hh:331
dw::core::style::Box::top
int top
Definition: style.hh:467
dw::core::style::StyleAttrs::boxRestWidth
int boxRestWidth()
Definition: style.hh:545
dw::core::style::StyleAttrs::x_tooltip
Tooltip * x_tooltip
Definition: style.hh:523
dw::core::style::Box
Represents a dimension box according to the CSS box model.
Definition: style.hh:463
dw::core::style::StyleImage::ExternalImgRenderer::getBackgroundRepeat
virtual BackgroundRepeat getBackgroundRepeat()=0
dw::core::style::StyleAttrs::textDecoration
int textDecoration
Definition: style.hh:493
dw::core::style::DISPLAY_TABLE_FOOTER_GROUP
Definition: style.hh:284
dw::core::style::LINE_NORMAL
Definition: style.hh:290
dw::core::style::ListStylePosition
ListStylePosition
Definition: style.hh:295
dw::core::style::StyleImage::ExternalWidgetImgRenderer::getBackgroundPositionY
Length getBackgroundPositionY()
Definition: style.cc:691
dw::core::style::StyleAttrs::borderWidth
Box borderWidth
Definition: style.hh:510
dw::core::style::StyleImage::StyleImgRenderer::drawRow
void drawRow(int row)
Called, when data from a row is available and has been copied into the image buffer.
Definition: style.cc:533
dw::core::style::drawBackgroundImage
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:1214
dw::core::style::TextTransform
TextTransform
Definition: style.hh:265
dw::core::style::DISPLAY_NONE
Definition: style.hh:280
dw::core::style::BACKGROUND_ATTACHMENT_SCROLL
Definition: style.hh:242
dw::core::style::Color::~Color
virtual ~Color()
Definition: style.cc:415
dw::core::style::Font::xHeight
int xHeight
Definition: style.hh:675
dw::core::style::StyleAttrs::font
Font * font
Definition: style.hh:492
dw::core::style::StyleImage::ExternalImgRenderer::drawRow
void drawRow(int row)
Called, when data from a row is available and has been copied into the image buffer.
Definition: style.cc:599
lout::signal::ObservedObject
An observed object has a signal emitter, which tells the receivers, when the object is deleted.
Definition: signal.hh:274
dw::core::style::StyleAttrs::wordSpacing
int wordSpacing
Definition: style.hh:507
dw::core::style::StyleImage::ref
void ref()
Definition: style.hh:831
dw::core::style::StyleAttrs::top
BorderStyle top
Definition: style.hh:513
dw::core::style::WHITE_SPACE_NOWRAP
Definition: style.hh:346
dw::core::style::StyleImage::StyleImgRenderer::setBuffer
void setBuffer(core::Imgbuf *buffer, bool resize)
Called, when an image buffer is attached.
Definition: style.cc:491
dw::core::style::StyleAttrs::bottom
Color * bottom
Definition: style.hh:512
dw::core::style::Font::create0
static Font * create0(Layout *layout, FontAttrs *attrs, bool tryEverything)
Definition: style.cc:386
dw::core::style::StyleAttrs::boxDiffWidth
int boxDiffWidth()
Definition: style.hh:549
dw::core::style::DISPLAY_BLOCK
Definition: style.hh:276
dw::core::style::Length
int Length
Type for representing all lengths within dw::core::style.
Definition: style.hh:389
dw::core::style::StyleImage::styleImgRenderer
StyleImgRenderer * styleImgRenderer
Definition: style.hh:760
dw::core::style::LIST_STYLE_TYPE_HIRAGANA_IROHA
Definition: style.hh:319
dw::core::style::CURSOR_WAIT
Definition: style.hh:212
dw::core::style::CURSOR_HELP
Definition: style.hh:213
dw::core::style::StyleAttrs::backgroundImage
StyleImage * backgroundImage
Definition: style.hh:496
dw::core::style::StyleAttrs::x_img
int x_img
Definition: style.hh:522
dw::core::style::FontVariant
FontVariant
Definition: style.hh:330
dw::core::style::Tooltip::onEnter
virtual void onEnter()
Definition: style.hh:629
dw::core::style::ColorAttrs::getColor
int getColor()
Definition: style.hh:699
dw::core::style::TEXT_TRANSFORM_CAPITALIZE
Definition: style.hh:267
dw::core::style::StyleImage::imgRendererDist
ImgRendererDist * imgRendererDist
Definition: style.hh:759
dw::core::style::Font::refCount
int refCount
Definition: style.hh:659
dw::core::style::CURSOR_N_RESIZE
Definition: style.hh:206
dw::core::style::Style::~Style
~Style()
Definition: style.cc:277
dw::core::style::BACKGROUND_ATTACHMENT_FIXED
Definition: style.hh:243
dw::core::ImgRendererDist::put
void put(ImgRenderer *child)
Definition: imgrenderer.hh:75
dw::core::style::StyleAttrs::color
Color * color
Definition: style.hh:495
dw::core::style::DISPLAY_TABLE_CELL
Definition: style.hh:286
dw::core::style::Font::Font
Font()
Definition: style.hh:664
dw::core::style::Tooltip::onMotion
virtual void onMotion()
Definition: style.hh:631
dw::core::style::VALIGN_BOTTOM
Definition: style.hh:256
dw::core::style::TEXT_ALIGN_STRING
Definition: style.hh:251
dw::core::style::StyleAttrs::x_link
int x_link
Definition: style.hh:521
dw::core::style::DisplayType
DisplayType
Definition: style.hh:275
dw::core::style::CURSOR_CROSSHAIR
Definition: style.hh:199
dw::core::style::StyleAttrs
Definition: style.hh:489
dw::core::style::LIST_STYLE_TYPE_UPPER_LATIN
Definition: style.hh:312
dw::core::style::StyleImage::ExternalWidgetImgRenderer::getBackgroundImage
StyleImage * getBackgroundImage()
Definition: style.cc:666
dw::core::style::BORDER_MODEL_SEPARATE
Definition: style.hh:217
dw::core::style::FontAttrs::size
int size
Definition: style.hh:642
dw::core::style::BORDER_SOLID
Definition: style.hh:226
dw::core::style::CURSOR_S_RESIZE
Definition: style.hh:209
dw::core::style::VALIGN_BASELINE
Definition: style.hh:258
lout::misc::roundInt
int roundInt(double d)
Definition: misc.hh:41
dw::core::style::Box::bottom
int bottom
Definition: style.hh:467
dw::core::style::BORDER_RIDGE
Definition: style.hh:229
dw::core::style::StyleImage::getImgbufTiled
Imgbuf * getImgbufTiled(bool repeatX, bool repeatY)
Definition: style.hh:836
dw::core::style::VALIGN_TEXT_TOP
Definition: style.hh:261
dw::core::style::StyleImage::ExternalImgRenderer::getRefArea
virtual void getRefArea(int *xRef, int *yRef, int *widthRef, int *heightRef)=0
Return the "reference area".
dw::core::style::TEXT_ALIGN_JUSTIFY
Definition: style.hh:250
dw::core::style::BORDER_MODEL_COLLAPSE
Definition: style.hh:218
dw::core::style::LIST_STYLE_TYPE_KATAKANA_IROHA
Definition: style.hh:320
dw::core::style::ColorAttrs::equals
bool equals(lout::object::Object *other)
Returns, whether two objects are equal.
Definition: style.cc:404
dw
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtextblock.cc:26
dw::core::style::CURSOR_DEFAULT
Definition: style.hh:200
dw::core::style::StyleImage::StyleImgRenderer
Definition: style.hh:743
dw::core::style::StyleImage::removeExternalImgRenderer
void removeExternalImgRenderer(ImgRenderer *ir)
Remove a previously added additional ImgRenderer.
Definition: style.hh:854
dw::core::style::Color::shadeColor
int shadeColor(int color, int d)
Definition: style.cc:420
dw::core::style::StyleAttrs::backgroundPositionX
Length backgroundPositionX
Definition: style.hh:499
dw::core::style::StyleAttrs::textIndent
Length textIndent
Definition: style.hh:508
dw::core::style::BackgroundRepeat
BackgroundRepeat
Definition: style.hh:234
dw::core::style::FontAttrs::hashValue
int hashValue()
Return a hash value for the object.
Definition: style.cc:359
dw::core::style::StyleImage::getImgbufSrc
Imgbuf * getImgbufSrc()
Definition: style.hh:835
dw::core::style::Font::ref
void ref()
Definition: style.hh:680
dw::core::style::ColorAttrs::ColorAttrs
ColorAttrs(int color)
Definition: style.hh:694
dw::core::style::Box::left
int left
Definition: style.hh:467
dw::core::style::BORDER_GROOVE
Definition: style.hh:228
dw::core::style::FontAttrs::fontVariant
FontVariant fontVariant
Definition: style.hh:645
dw::core::style::Style
Definition: style.hh:571
dw::core::style::createRelLength
Length createRelLength(double v)
Returns a relative length.
Definition: style.hh:399
dw::core::style::drawBackground
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, bool inverse, bool atTop)
Draw the background (content plus padding) of a region in window, according to style.
Definition: style.cc:1161
dw::core::style::StyleAttrs::boxOffsetX
int boxOffsetX()
Definition: style.hh:541
dw::core::style::BORDER_HIDDEN
Definition: style.hh:223
dw::core::style::StyleAttrs::valign
VAlignType valign
Definition: style.hh:503
dw::core::style::ListStyleType
ListStyleType
Definition: style.hh:300
dw::core::style::createAbsLength
Length createAbsLength(int n)
Returns a length of n pixels.
Definition: style.hh:392
dw::core::style::StyleImage::StyleImage
StyleImage()
Definition: style.cc:567
dw::core::style::StyleImage::StyleImgRenderer::fatal
void fatal()
Called, when there are problems with the retrieval of image data.
Definition: style.cc:562
dw::core::style::BORDER_NONE
Definition: style.hh:222
dw::core::style::StyleImage
Definition: style.hh:740
dw::core::style::LIST_STYLE_TYPE_LOWER_ALPHA
Definition: style.hh:309
dw::core::style::WHITE_SPACE_PRE_WRAP
Definition: style.hh:347
dw::core::style::WHITE_SPACE_PRE
Definition: style.hh:345