Dillo
widget.hh
Go to the documentation of this file.
1 #ifndef __DW_WIDGET_HH__
2 #define __DW_WIDGET_HH__
3 
4 #ifndef __INCLUDED_FROM_DW_CORE_HH__
5 # error Do not include this file directly, use "core.hh" instead.
6 #endif
7 
8 #include "../lout/identity.hh"
9 
13 typedef void (*DW_Callback_t)(void *data);
14 
15 namespace dw {
16 namespace core {
17 
24 {
25  friend class Layout;
26 
27 protected:
28  enum Flags {
32  RESIZE_QUEUED = 1 << 0,
33 
37  EXTREMES_QUEUED = 1 << 1,
38 
45  NEEDS_RESIZE = 1 << 2,
46 
56  NEEDS_ALLOCATE = 1 << 3,
57 
61  ALLOCATE_QUEUED = 1 << 4,
62 
69  EXTREMES_CHANGED = 1 << 5,
70 
76  WAS_ALLOCATED = 1 << 6,
77  };
78 
85  {
86  private:
88 
89  public:
90  inline WidgetImgRenderer (Widget *widget) { this->widget = widget; }
91 
92  bool readyToDraw ();
93  void getBgArea (int *x, int *y, int *width, int *height);
94  void getRefArea (int *xRef, int *yRef, int *widthRef, int *heightRef);
96  void draw (int x, int y, int width, int height);
97  };
98 
100 
101 private:
102  static bool adjustMinWidth;
103 
108 
113 
120 
127 
129 
131 
133 
142 
148 
153 
158 
163 
164  void queueResize (int ref, bool extremesChanged, bool fast);
165  inline void queueResizeFast (int ref, bool extremesChanged)
166  { queueResize (ref, extremesChanged, true); }
167 
168 public:
176 
177 protected:
178 
184 
185  inline int getHeight () { return allocation.ascent + allocation.descent; }
186  inline int getContentWidth() { return allocation.width - boxDiffWidth (); }
187  inline int getContentHeight() { return getHeight () - boxDiffHeight (); }
188 
190 
200 
206 
212 
214  { return stackingContextWidget->stackingContextMgr; }
215 
216  /*inline void printFlags () {
217  DBG_IF_RTFL {
218  char buf[10 * 3 - 1 + 1];
219  snprintf (buf, sizeof (buf), "%s:%s:%s:%s:%s:%s:%s",
220  (flags & RESIZE_QUEUED) ? "Rq" : "--",
221  (flags & EXTREMES_QUEUED) ? "Eq" : "--",
222  (flags & NEEDS_RESIZE) ? "nR" : "--",
223  (flags & NEEDS_ALLOCATE) ? "nA" : "--",
224  (flags & ALLOCATE_QUEUED) ? "Aq" : "--",
225  (flags & EXTREMES_CHANGED) ? "Ec" : "--",
226  (flags & WAS_ALLOCATED) ? "wA" : "--");
227  DBG_OBJ_SET_SYM ("flags", buf);
228  }
229  }*/
230 
231  inline void printFlag (Flags f) {
232  DBG_IF_RTFL {
233  switch (f) {
234  case RESIZE_QUEUED:
235  DBG_OBJ_SET_SYM ("flags.RESIZE_QUEUED",
236  (flags & RESIZE_QUEUED) ? "true" : "false");
237  break;
238 
239  case EXTREMES_QUEUED:
240  DBG_OBJ_SET_SYM ("flags.EXTREMES_QUEUED",
241  (flags & EXTREMES_QUEUED) ? "true" : "false");
242  break;
243 
244  case NEEDS_RESIZE:
245  DBG_OBJ_SET_SYM ("flags.NEEDS_RESIZE",
246  (flags & NEEDS_RESIZE) ? "true" : "false");
247  break;
248 
249  case NEEDS_ALLOCATE:
250  DBG_OBJ_SET_SYM ("flags.NEEDS_ALLOCATE",
251  (flags & NEEDS_ALLOCATE) ? "true" : "false");
252  break;
253 
254  case ALLOCATE_QUEUED:
255  DBG_OBJ_SET_SYM ("flags.ALLOCATE_QUEUED",
256  (flags & ALLOCATE_QUEUED) ? "true" : "false");
257  break;
258 
259  case EXTREMES_CHANGED:
260  DBG_OBJ_SET_SYM ("flags.EXTREMES_CHANGED",
261  (flags & EXTREMES_CHANGED) ? "true" : "false");
262  break;
263 
264  case WAS_ALLOCATED:
265  DBG_OBJ_SET_SYM ("flags.WAS_ALLOCATED",
266  (flags & WAS_ALLOCATED) ? "true" : "false");
267  break;
268  }
269  }
270  }
271 
272  inline void setFlags (Flags f)
273  { flags = (Flags)(flags | f); printFlag (f); }
274  inline void unsetFlags (Flags f)
275  { flags = (Flags)(flags & ~f); printFlag (f); }
276 
277  inline void queueDraw ()
278  { queueDrawArea (0, 0, allocation.width, getHeight()); }
279  void queueDrawArea (int x, int y, int width, int height);
280  inline void queueResize (int ref, bool extremesChanged)
281  { queueResize (ref, extremesChanged, false); }
282 
286  virtual void sizeRequestImpl (Requisition *requisition, int numPos,
287  Widget **references, int *x, int *y);
288 
293  virtual void sizeRequestSimpl (Requisition *requisition);
294 
298  virtual void getExtremesImpl (Extremes *extremes, int numPos,
299  Widget **references, int *x, int *y);
300 
305  virtual void getExtremesSimpl (Extremes *extremes);
306 
307  virtual void calcExtraSpaceImpl (int numPos, Widget **references, int *x,
308  int *y);
309 
313  virtual void sizeAllocateImpl (Allocation *allocation);
314 
319  virtual void resizeDrawImpl () { queueDraw (); };
320 
324  virtual void markSizeChange (int ref);
325 
329  virtual void markExtremesChange (int ref);
330 
331  virtual int getAvailWidthOfChild (Widget *child, bool forceValue);
332  virtual int getAvailHeightOfChild (Widget *child, bool forceValue);
333  virtual void correctRequisitionOfChild (Widget *child,
334  Requisition *requisition,
335  void (*splitHeightFun) (int, int*,
336  int*),
337  bool allowDecreaseWidth,
338  bool allowDecreaseHeight);
339  void correctReqWidthOfChild (Widget *child, Requisition *requisition,
340  bool allowDecreaseWidth);
341  void correctReqHeightOfChild (Widget *child, Requisition *requisition,
342  void (*splitHeightFun) (int, int*, int*),
343  bool allowDecreaseHeight);
344  virtual void correctExtremesOfChild (Widget *child, Extremes *extremes,
345  bool useAdjustmentWidth);
346 
347  virtual void containerSizeChangedForChildren ();
348 
349  virtual bool affectedByContainerSizeChange ();
350  virtual bool affectsSizeChangeContainerChild (Widget *child);
351  virtual bool usesAvailWidth ();
352  virtual bool usesAvailHeight ();
353 
354  virtual void notifySetAsTopLevel();
355  virtual void notifySetParent();
356 
357  virtual bool buttonPressImpl (EventButton *event);
358  virtual bool buttonReleaseImpl (EventButton *event);
359  virtual bool motionNotifyImpl (EventMotion *event);
360  virtual void enterNotifyImpl (EventCrossing *event);
361  virtual void leaveNotifyImpl (EventCrossing *event);
362 
363  inline char *addAnchor (const char* name)
364  { return layout->addAnchor (this, name); }
365 
366  inline char *addAnchor (const char* name, int y)
367  { return layout->addAnchor (this, name, y); }
368 
369  inline void changeAnchor (char* name, int y)
370  { layout->changeAnchor (this, name, y); }
371 
372  inline void removeAnchor (char* name)
373  { if (layout) layout->removeAnchor (this, name); }
374 
375  //inline void updateBgColor () { layout->updateBgColor (); }
376 
377  inline void setCursor (style::Cursor cursor)
378  { layout->setCursor (cursor); }
379 #if 0
380  inline bool selectionButtonPress (Iterator *it, int charPos, int linkNo,
381  EventButton *event, bool withinContent)
382  { return layout->selectionState.buttonPress (it, charPos, linkNo, event); }
383 
384  inline bool selectionButtonRelease (Iterator *it, int charPos, int linkNo,
385  EventButton *event, bool withinContent)
386  { return layout->selectionState.buttonRelease (it, charPos, linkNo, event);}
387 
388  inline bool selectionButtonMotion (Iterator *it, int charPos, int linkNo,
389  EventMotion *event, bool withinContent)
390  { return layout->selectionState.buttonMotion (it, charPos, linkNo, event); }
391 #endif
393  Iterator *it, int charPos, int linkNo,
394  MousePositionEvent *event)
395  { return layout->selectionState.handleEvent (eventType, it, charPos, linkNo,
396  event); }
397 
398 private:
401 
402 public:
403  inline void setDeleteCallback(DW_Callback_t func, void *data)
404  { deleteCallbackFunc = func; deleteCallbackData = data; }
405 
406 private:
407  bool resizeIdleEntered () { return layout && layout->resizeIdleCounter; }
408 
409  void enterQueueResize () { if (layout) layout->queueResizeCounter++; }
410  void leaveQueueResize () { if (layout) layout->queueResizeCounter--; }
411  bool queueResizeEntered () { return layout && layout->queueResizeCounter; }
412 
413  void enterSizeAllocate () { if (layout) layout->sizeAllocateCounter++; }
414  void leaveSizeAllocate () { if (layout) layout->sizeAllocateCounter--; }
415  bool sizeAllocateEntered () { return layout && layout->sizeAllocateCounter; }
416 
417  void enterSizeRequest () { if (layout) layout->sizeRequestCounter++; }
418  void leaveSizeRequest () { if (layout) layout->sizeRequestCounter--; }
419  bool sizeRequestEntered () { return layout && layout->sizeRequestCounter; }
420 
421  void enterGetExtremes () { if (layout) layout->getExtremesCounter++; }
422  void leaveGetExtremes () { if (layout) layout->getExtremesCounter--; }
423  bool getExtremesEntered () { return layout && layout->getExtremesCounter; }
424 
425 
426 public:
427  static int CLASS_ID;
428 
429  inline static void setAdjustMinWidth (bool adjustMinWidth)
431 
432  Widget ();
433  ~Widget ();
434 
435  inline bool resizeQueued () { return flags & RESIZE_QUEUED; }
436  inline bool extremesQueued () { return flags & EXTREMES_QUEUED; }
437  inline bool needsResize () { return flags & NEEDS_RESIZE; }
438  inline bool needsAllocate () { return flags & NEEDS_ALLOCATE; }
439  inline bool allocateQueued () { return flags & ALLOCATE_QUEUED; }
440  inline bool extremesChanged () { return flags & EXTREMES_CHANGED; }
441  inline bool wasAllocated () { return flags & WAS_ALLOCATED; }
442 
443  void setParent (Widget *parent);
444  void setQuasiParent (Widget *quasiParent);
445 
446  void setGenerator (Widget *generator) { this->generator = generator; }
447 
448  inline style::Style *getStyle () { return style; }
450  inline Allocation *getAllocation () { return &allocation; }
451  inline bool inAllocation (int x, int y) {
452  return wasAllocated () && x >= allocation.x && y >= allocation.y &&
453  x <= allocation.x + allocation.width &&
454  y <= allocation.y + getHeight ();
455  }
456 
457  inline int boxOffsetX ()
458  { return extraSpace.left + getStyle()->boxOffsetX (); }
459  inline int boxRestWidth ()
460  { return extraSpace.right + getStyle()->boxRestWidth (); }
461  inline int boxDiffWidth () { return boxOffsetX () + boxRestWidth (); }
462  inline int boxOffsetY ()
463  { return extraSpace.top + getStyle()->boxOffsetY (); }
464  inline int boxRestHeight ()
465  { return extraSpace.bottom + getStyle()->boxRestHeight (); }
466  inline int boxDiffHeight () { return boxOffsetY () + boxRestHeight (); }
467 
471  virtual int numSizeRequestReferences ();
472 
476  virtual Widget *sizeRequestReference (int index);
477 
481  virtual int numGetExtremesReferences ();
482 
486  virtual Widget *getExtremesReference (int index);
487 
488  void sizeRequest (Requisition *requisition, int numPos = 0,
489  Widget **references = NULL, int *x = NULL, int *y = NULL);
490  void getExtremes (Extremes *extremes, int numPos = 0,
491  Widget **references = NULL, int *x = NULL, int *y = NULL);
492  void sizeAllocate (Allocation *allocation);
493 
494  void calcExtraSpace (int numPos, Widget **references, int *x, int *y);
495 
496  int getAvailWidth (bool forceValue);
497  int getAvailHeight (bool forceValue);
498  virtual bool getAdjustMinWidth () { return Widget::adjustMinWidth; }
499  void correctRequisition (Requisition *requisition,
500  void (*splitHeightFun) (int, int*, int*),
501  bool allowDecreaseWidth, bool allowDecreaseHeight);
502  void correctExtremes (Extremes *extremes, bool useAdjustmentWidth);
503  int calcWidth (style::Length cssValue, int refWidth, Widget *refWidget,
504  int limitMinWidth, bool forceValue);
505  void calcFinalWidth (style::Style *style, int refWidth, Widget *refWidget,
506  int limitMinWidth, bool forceValue, int *finalWidth);
507  int calcHeight (style::Length cssValue, bool usePercentage, int refHeight,
508  Widget *refWidget, bool forceValue);
509  static void adjustHeight (int *height, bool allowDecreaseHeight, int ascent,
510  int descent);
511 
512  virtual int applyPerWidth (int containerWidth, style::Length perWidth);
513  virtual int applyPerHeight (int containerHeight, style::Length perHeight);
514 
515  int getMinWidth (Extremes *extremes, bool forceValue);
516 
517  virtual bool isBlockLevel ();
518  virtual bool isPossibleContainer ();
519 
520  void containerSizeChanged ();
521 
522  bool intersects (Widget *refWidget, Rectangle *area,
523  Rectangle *intersection);
524 
526  virtual void draw (View *view, Rectangle *area, DrawingContext *context) = 0;
527  void drawInterruption (View *view, Rectangle *area, DrawingContext *context);
528 
529  virtual Widget *getWidgetAtPoint (int x, int y,
530  GettingWidgetAtPointContext *context);
531  Widget *getWidgetAtPointInterrupted (int x, int y,
532  GettingWidgetAtPointContext *context);
533 
534  bool buttonPress (EventButton *event);
535  bool buttonRelease (EventButton *event);
536  bool motionNotify (EventMotion *event);
537  void enterNotify (EventCrossing *event);
538  void leaveNotify (EventCrossing *event);
539 
540  virtual void setStyle (style::Style *style);
541  void setBgColor (style::Color *bgColor);
543 
544  void drawBox (View *view, style::Style *style, Rectangle *area,
545  int x, int y, int width, int height, bool inverse);
546  void drawWidgetBox (View *view, Rectangle *area, bool inverse);
547  void drawSelected (View *view, Rectangle *area);
548 
549  void setButtonSensitive (bool buttonSensitive);
550  inline bool isButtonSensitive () { return buttonSensitive; }
551 
552  inline Widget *getParent () { return parent; }
553  inline Widget *getContainer () { return container; }
554  Widget *getTopLevel ();
555  int getLevel ();
556  int getGeneratorLevel ();
557  Widget *getNearestCommonAncestor (Widget *otherWidget);
558 
560  inline void setWidgetReference (WidgetReference *widgetReference) {
561  this->widgetReference = widgetReference;
562  DBG_OBJ_SET_PTR ("widgetReference", widgetReference);
563  }
564 
565  inline Widget *getGenerator () { return generator ? generator : parent; }
566 
567  inline Layout *getLayout () { return layout; }
568 
569  void scrollTo (HPosition hpos, VPosition vpos,
570  int x, int y, int width, int height);
571 
572  void getMarginArea (int *xMar, int *yMar, int *widthMar, int *heightMar);
573  void getBorderArea (int *xBor, int *yBor, int *widthBor, int *heightBor);
574  void getPaddingArea (int *xPad, int *yPad, int *widthPad, int *heightPad);
575 
589  virtual Iterator *iterator (Content::Type mask, bool atEnd) = 0;
590 
591  virtual void removeChild (Widget *child);
592 };
593 
594 void splitHeightPreserveAscent (int height, int *ascent, int *descent);
595 void splitHeightPreserveDescent (int height, int *ascent, int *descent);
596 
597 } // namespace core
598 } // namespace dw
599 
600 #endif // __DW_WIDGET_HH__
int boxRestWidth()
Definition: widget.hh:459
Cursor
Definition: style.hh:200
void splitHeightPreserveAscent(int height, int *ascent, int *descent)
Definition: widget.cc:1944
virtual void correctRequisitionOfChild(Widget *child, Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseWidth, bool allowDecreaseHeight)
Definition: widget.cc:1727
void getPaddingArea(int *xPad, int *yPad, int *widthPad, int *heightPad)
Return the padding area (content plus padding).
Definition: widget.cc:1551
int boxDiffHeight()
Definition: widget.hh:466
int x
Definition: types.hh:165
virtual void draw(View *view, Rectangle *area, DrawingContext *context)=0
Extremes extremes
Analogue to dw::core::Widget::requisition.
Definition: widget.hh:146
int boxOffsetX()
Definition: style.hh:591
void setParent(Widget *parent)
Definition: widget.cc:230
int boxOffsetX()
Definition: widget.hh:457
virtual int numSizeRequestReferences()
See Sizes of Dillo Widgets (or Size requisitions depending on positions).
Definition: widget.cc:1061
void sizeAllocate(Allocation *allocation)
Wrapper for Widget::sizeAllocateImpl, calls the latter only when needed.
Definition: widget.cc:1087
void queueDrawArea(int x, int y, int width, int height)
Definition: widget.cc:284
void calcFinalWidth(style::Style *style, int refWidth, Widget *refWidget, int limitMinWidth, bool forceValue, int *finalWidth)
Definition: widget.cc:892
int bottom
Definition: style.hh:507
void setButtonSensitive(bool buttonSensitive)
Definition: widget.cc:1429
style::Style * style
Definition: widget.hh:130
virtual Iterator * iterator(Content::Type mask, bool atEnd)=0
Return an iterator for this widget.
void getExtremes(Extremes *extremes, int numPos=0, Widget **references=NULL, int *x=NULL, int *y=NULL)
Wrapper for Widget::getExtremesImpl().
Definition: widget.cc:975
static void setAdjustMinWidth(bool adjustMinWidth)
Definition: widget.hh:429
Set at the top when getting the widget at the point.
Definition: types.hh:312
Layout * getLayout()
Definition: widget.hh:567
bool buttonSensitiveSet
See dw::core::Widget::setButtonSensitive().
Definition: widget.hh:162
void removeAnchor(Widget *widget, char *name)
Definition: layout.cc:775
bool buttonRelease(EventButton *event)
Definition: widget.cc:1167
Definition: style.hh:751
SelectionState selectionState
Definition: layout.hh:187
Widget * getGenerator()
Definition: widget.hh:565
virtual void correctExtremesOfChild(Widget *child, Extremes *extremes, bool useAdjustmentWidth)
Definition: widget.cc:1828
Suitable for widgets and parts of widgets.
Definition: style.hh:854
void getRefArea(int *xRef, int *yRef, int *widthRef, int *heightRef)
Return the "reference area".
Definition: widget.cc:45
void setBgColor(style::Color *bgColor)
Set the background "behind" the widget, if it is not the background of the parent widget...
Definition: widget.cc:1301
void enterGetExtremes()
Definition: widget.hh:421
int getContentHeight()
Definition: widget.hh:187
Requisition requisition
Size_request() stores the result of the last call of size_request_impl().
Definition: widget.hh:140
WidgetReference * getWidgetReference()
Definition: widget.hh:559
Represents a dimension box according to the CSS box model.
Definition: style.hh:503
void containerSizeChanged()
Definition: widget.cc:398
void changeAnchor(char *name, int y)
Definition: widget.hh:369
WidgetImgRenderer * widgetImgRenderer
Definition: widget.hh:99
dw::core::Shape implemtation for simple rectangles.
Definition: types.hh:69
Widget * getNearestCommonAncestor(Widget *otherWidget)
Get the widget with the highest level, which is a direct ancestor of widget1 and widget2.
Definition: widget.cc:1490
Instances of classes, which are sub classes of this class, may be identified at run-time.
Definition: identity.hh:98
void leaveNotify(EventCrossing *event)
Definition: widget.cc:1182
void draw(int x, int y, int width, int height)
Draw (or queue for drawing) an area, which is given in canvas coordinates.
Definition: widget.cc:56
Widget * getParent()
Definition: widget.hh:552
Type
Definition: types.hh:199
void correctExtremes(Extremes *extremes, bool useAdjustmentWidth)
Definition: widget.cc:800
virtual void markSizeChange(int ref)
See Sizes of Dillo Widgets.
Definition: widget.cc:1610
int right
Definition: style.hh:507
bool needsAllocate()
Definition: widget.hh:438
static void adjustHeight(int *height, bool allowDecreaseHeight, int ascent, int descent)
Definition: widget.cc:965
Widget * widget
Definition: widget.hh:87
virtual bool usesAvailHeight()
Must be implemengted by a method returning true, when getAvailHeight() is called. ...
Definition: widget.cc:515
int queueResizeCounter
Definition: layout.hh:248
int top
Definition: style.hh:507
style::Box extraSpace
Space around the margin box. Allocation is extraSpace + margin + border + padding + contents...
Definition: widget.hh:199
bool inAllocation(int x, int y)
Definition: widget.hh:451
virtual void sizeAllocateImpl(Allocation *allocation)
See Sizes of Dillo Widgets.
Definition: widget.cc:1592
The central class for managing and drawing a widget tree.
Definition: layout.hh:16
SizeParams requisitionParams
Definition: widget.hh:141
bool allocateQueued()
Definition: widget.hh:439
Allocation * getAllocation()
Definition: widget.hh:450
int getExtremesCounter
Definition: layout.hh:248
virtual bool isPossibleContainer()
Definition: widget.cc:1898
int sizeRequestCounter
Definition: layout.hh:248
void drawBox(View *view, style::Style *style, Rectangle *area, int x, int y, int width, int height, bool inverse)
Draw borders and background of a widget part, which allocation is given by (x, y, width...
Definition: widget.cc:1332
Represents a button press or release event.
Definition: events.hh:57
#define DBG_IF_RTFL
Definition: debug.hh:73
Represents a enter or leave notify event.
Definition: events.hh:74
Flags flags
Definition: widget.hh:132
DW_Callback_t deleteCallbackFunc
Definition: widget.hh:400
void printFlag(Flags f)
Definition: widget.hh:231
bool handleEvent(EventType eventType, Iterator *it, int charPos, int linkNo, MousePositionEvent *event)
General form of dw::core::SelectionState::buttonPress, dw::core::SelectionState::buttonRelease and dw...
Definition: selection.cc:233
See Handling stacking contexts.
Definition: stackingcontextmgr.hh:19
void queueResize(int ref, bool extremesChanged)
Definition: widget.hh:280
static int CLASS_ID
Definition: widget.hh:427
void changeAnchor(Widget *widget, char *name, int y)
Definition: layout.cc:765
void setCursor(style::Cursor cursor)
Definition: layout.cc:801
virtual void getExtremesImpl(Extremes *extremes, int numPos, Widget **references, int *x, int *y)
See Sizes of Dillo Widgets.
Definition: widget.cc:1577
Hold arguments passed to dw::core::Widget::sizeRequest and dw::core::Widget::getExtremes, as described in Size requisitions depending on positions.
Definition: tools.hh:18
void setDeleteCallback(DW_Callback_t func, void *data)
Definition: widget.hh:403
virtual Widget * getExtremesReference(int index)
See Sizes of Dillo Widgets (or Size requisitions depending on positions).
Definition: widget.cc:1077
virtual int getAvailHeightOfChild(Widget *child, bool forceValue)
Definition: widget.cc:1670
int sizeAllocateCounter
Definition: layout.hh:248
void unsetFlags(Flags f)
Definition: widget.hh:274
virtual void notifySetParent()
This method is called after a widget has been added to a parent.
Definition: widget.cc:1888
Iterators are used to iterate through the contents of a widget.
Definition: iterator.hh:19
int getContentWidth()
Definition: widget.hh:186
int getAvailHeight(bool forceValue)
Definition: widget.cc:670
void leaveSizeRequest()
Definition: widget.hh:418
Widget * parent
The parent widget, NULL for top-level widgets.
Definition: widget.hh:107
bool extremesChanged()
Definition: widget.hh:440
WidgetImgRenderer(Widget *widget)
Definition: widget.hh:90
virtual bool motionNotifyImpl(EventMotion *event)
Definition: widget.cc:1914
Set, when dw::core::Widget::requisition is not up to date anymore.
Definition: widget.hh:45
StackingContextMgr * getNextStackingContextMgr()
Definition: widget.hh:213
int calcHeight(style::Length cssValue, bool usePercentage, int refHeight, Widget *refWidget, bool forceValue)
Definition: widget.cc:919
void getBgArea(int *x, int *y, int *width, int *height)
Return the area covered by the background image.
Definition: widget.cc:39
char * addAnchor(const char *name, int y)
Definition: widget.hh:366
virtual void sizeRequestSimpl(Requisition *requisition)
Simple variant, to be implemented by widgets with sizes not depending on positions.
Definition: widget.cc:1571
void drawInterruption(View *view, Rectangle *area, DrawingContext *context)
Definition: widget.cc:200
virtual void leaveNotifyImpl(EventCrossing *event)
Definition: widget.cc:1927
Widget * generator
The generating widget, NULL for top-level widgets, or if not set; in the latter case, the effective generator (see getGenerator) is the parent.
Definition: widget.hh:119
bool extremesQueued()
Definition: widget.hh:436
bool isButtonSensitive()
Definition: widget.hh:550
char * addAnchor(const char *name)
Definition: widget.hh:363
Widget * getWidgetAtPointInterrupted(int x, int y, GettingWidgetAtPointContext *context)
Definition: widget.cc:221
virtual void notifySetAsTopLevel()
This method is called after a widget has been set as the top of a widget tree.
Definition: widget.cc:1879
bool buttonPress(EventButton *event)
Definition: widget.cc:1162
Flags
Definition: widget.hh:28
Definition: style.hh:613
~Widget()
Definition: widget.cc:103
#define DBG_OBJ_SET_SYM(var, val)
Definition: debug_rtfl.hh:422
bool wasAllocated()
Definition: widget.hh:441
bool buttonPress(Iterator *it, int charPos, int linkNo, EventButton *event)
Definition: selection.cc:93
void leaveGetExtremes()
Definition: widget.hh:422
style::Color * getBgColor()
Get the actual background of a widget.
Definition: widget.cc:1309
void enterNotify(EventCrossing *event)
Definition: widget.cc:1177
virtual void containerSizeChangedForChildren()
Definition: widget.cc:487
void calcExtraSpace(int numPos, Widget **references, int *x, int *y)
Calculates dw::core::Widget::extraSpace.
Definition: widget.cc:1046
int boxDiffWidth()
Definition: widget.hh:461
int boxRestHeight()
Definition: style.hh:598
int width
Definition: types.hh:167
Widget * getTopLevel()
Get the widget at the root of the tree, this widget is part from.
Definition: widget.cc:1439
Definition: types.hh:172
Only used internally, set to enforce size allocation.
Definition: widget.hh:56
void setQuasiParent(Widget *quasiParent)
Definition: widget.cc:275
Represents the allocation, i.e. actual position and size of a dw::core::Widget.
Definition: types.hh:163
void enterQueueResize()
Definition: widget.hh:409
HPosition
Definition: types.hh:15
bool buttonMotion(Iterator *it, int charPos, int linkNo, EventMotion *event)
Definition: selection.cc:210
virtual void setStyle(style::Style *style)
Change the style of a widget.
Definition: widget.cc:1194
VPosition
Definition: types.hh:25
void queueDraw()
Definition: widget.hh:277
int getGeneratorLevel()
Get the level of the widget within the tree, regarting the generators, not the parents.
Definition: widget.cc:1473
virtual void removeChild(Widget *child)
Definition: widget.cc:1936
Set, when dw::core::Widget::extremes is not up to date anymore.
Definition: widget.hh:69
virtual int applyPerHeight(int containerHeight, style::Length perHeight)
Definition: widget.cc:1624
bool motionNotify(EventMotion *event)
Definition: widget.cc:1172
bool sizeRequestEntered()
Definition: widget.hh:419
Layout * layout
Definition: widget.hh:189
virtual Widget * sizeRequestReference(int index)
See Sizes of Dillo Widgets (or Size requisitions depending on positions).
Definition: widget.cc:1066
void leaveQueueResize()
Definition: widget.hh:410
The base class of all dillo widgets.
Definition: widget.hh:23
Base class for all mouse events related to a specific position.
Definition: events.hh:48
Set at the top when drawing.
Definition: types.hh:294
virtual void calcExtraSpaceImpl(int numPos, Widget **references, int *x, int *y)
The actual implementation for calculating dw::core::Widget::extraSpace.
Definition: widget.cc:1605
virtual bool affectedByContainerSizeChange()
Definition: widget.cc:423
void setFlags(Flags f)
Definition: widget.hh:272
void setCursor(style::Cursor cursor)
Definition: widget.hh:377
Definition: widget.hh:32
virtual bool affectsSizeChangeContainerChild(Widget *child)
Definition: widget.cc:457
bool selectionHandleEvent(SelectionState::EventType eventType, Iterator *it, int charPos, int linkNo, MousePositionEvent *event)
Definition: widget.hh:392
void correctReqHeightOfChild(Widget *child, Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseHeight)
Definition: widget.cc:1784
Definition: types.hh:179
static bool adjustMinWidth
Definition: widget.hh:102
int boxRestWidth()
Definition: style.hh:593
virtual bool buttonReleaseImpl(EventButton *event)
Definition: widget.cc:1909
Widget * stackingContextWidget
The bottom-most ancestor (or this) for which stackingContextMgr is set.
Definition: widget.hh:211
Allocation allocation
The current allocation: size and position, always relative to the canvas.
Definition: widget.hh:183
virtual void markExtremesChange(int ref)
See Sizes of Dillo Widgets.
Definition: widget.cc:1614
int ascent
Definition: types.hh:168
void splitHeightPreserveDescent(int height, int *ascent, int *descent)
Definition: widget.cc:1958
bool intersects(Widget *refWidget, Rectangle *area, Rectangle *intersection)
Calculates the intersection of the visible allocation (i. e. the intersection with the visible parent...
Definition: widget.cc:138
Definition: widget.hh:61
void setGenerator(Widget *generator)
Definition: widget.hh:446
EventType
Definition: selection.hh:220
Definition: widget.hh:37
bool buttonSensitive
See dw::core::Widget::setButtonSensitive().
Definition: widget.hh:157
void(* DW_Callback_t)(void *data)
The type for callback functions.
Definition: widget.hh:13
void correctRequisition(Requisition *requisition, void(*splitHeightFun)(int, int *, int *), bool allowDecreaseWidth, bool allowDecreaseHeight)
Definition: widget.cc:723
char * addAnchor(Widget *widget, const char *name)
Definition: layout.cc:742
virtual int applyPerWidth(int containerWidth, style::Length perWidth)
Definition: widget.cc:1618
void removeAnchor(char *name)
Definition: widget.hh:372
int getHeight()
Definition: widget.hh:185
virtual void resizeDrawImpl()
Called after sizeAllocateImpl() to redraw necessary areas. By default the whole widget is redrawn...
Definition: widget.hh:319
bool sizeAllocateEntered()
Definition: widget.hh:415
int calcWidth(style::Length cssValue, int refWidth, Widget *refWidget, int limitMinWidth, bool forceValue)
Definition: widget.cc:852
style::Color * bgColor
See dw::core::Widget::setBgColor().
Definition: widget.hh:152
virtual int getAvailWidthOfChild(Widget *child, bool forceValue)
Definition: widget.cc:1630
bool resizeIdleEntered()
Definition: widget.hh:407
virtual int numGetExtremesReferences()
See Sizes of Dillo Widgets (or Size requisitions depending on positions).
Definition: widget.cc:1072
int resizeIdleCounter
Definition: layout.hh:248
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtablecell.cc:28
void drawSelected(View *view, Rectangle *area)
Definition: widget.cc:1424
An interface to encapsulate platform dependent drawing.
Definition: view.hh:16
void drawWidgetBox(View *view, Rectangle *area, bool inverse)
Draw borders and background of a widget.
Definition: widget.cc:1373
Set, when a widget was already once allocated,.
Definition: widget.hh:76
void queueResize(int ref, bool extremesChanged, bool fast)
This method should be called, when a widget changes its size.
Definition: widget.cc:308
Widget * getContainer()
Definition: widget.hh:553
bool queueResizeEntered()
Definition: widget.hh:411
Widget()
Definition: widget.cc:67
int boxOffsetY()
Definition: style.hh:596
void setWidgetReference(WidgetReference *widgetReference)
Definition: widget.hh:560
bool readyToDraw()
If this method returns false, nothing is done at all.
Definition: widget.cc:34
void correctReqWidthOfChild(Widget *child, Requisition *requisition, bool allowDecreaseWidth)
Definition: widget.cc:1763
virtual void getExtremesSimpl(Extremes *extremes)
Simple variant, to be implemented by widgets with extremes not depending on positions.
Definition: widget.cc:1586
int getLevel()
Get the level of the widget within the tree.
Definition: widget.cc:1454
virtual bool usesAvailWidth()
Must be implemengted by a method returning true, when getAvailWidth() is called.
Definition: widget.cc:506
virtual bool buttonPressImpl(EventButton *event)
Definition: widget.cc:1904
void getBorderArea(int *xBor, int *yBor, int *widthBor, int *heightBor)
Definition: widget.cc:1535
Represents a mouse motion event.
Definition: events.hh:67
bool resizeQueued()
Definition: widget.hh:435
int boxRestHeight()
Definition: widget.hh:464
int boxOffsetY()
Definition: widget.hh:462
Implementation which represents the whole widget.
Definition: widget.hh:84
int getAvailWidth(bool forceValue)
Definition: widget.cc:628
virtual Widget * getWidgetAtPoint(int x, int y, GettingWidgetAtPointContext *context)
Definition: widget.cc:210
bool getExtremesEntered()
Definition: widget.hh:423
int getMinWidth(Extremes *extremes, bool forceValue)
Used to evaluate Widget::adjustMinWidth.
Definition: widget.cc:586
int descent
Definition: types.hh:169
void enterSizeRequest()
Definition: widget.hh:417
WidgetReference * widgetReference
Definition: widget.hh:128
virtual bool isBlockLevel()
Definition: widget.cc:1892
void getMarginArea(int *xMar, int *yMar, int *widthMar, int *heightMar)
Definition: widget.cc:1527
style::Style * getStyle()
Return the style this background image is part of.
Definition: widget.cc:51
int parentRef
This value is defined by the parent widget, and used for incremential resizing.
Definition: widget.hh:175
void queueResizeFast(int ref, bool extremesChanged)
Definition: widget.hh:165
bool needsResize()
Definition: widget.hh:437
void scrollTo(HPosition hpos, VPosition vpos, int x, int y, int width, int height)
Definition: widget.cc:1520
virtual bool getAdjustMinWidth()
Definition: widget.hh:498
Definition: types.hh:188
#define DBG_OBJ_SET_PTR(var, val)
Definition: debug_rtfl.hh:428
Widget * quasiParent
...
Definition: widget.hh:112
StackingContextMgr * stackingContextMgr
Set iff this widget constitutes a stacking context, as defined by CSS.
Definition: widget.hh:205
int Length
Type for representing all lengths within dw::core::style.
Definition: style.hh:428
SizeParams extremesParams
Definition: widget.hh:147
int left
Definition: style.hh:507
style::Style * getStyle()
Definition: widget.hh:448
void * deleteCallbackData
Definition: widget.hh:399
virtual void enterNotifyImpl(EventCrossing *event)
Definition: widget.cc:1919
void enterSizeAllocate()
Definition: widget.hh:413
bool buttonRelease(Iterator *it, int charPos, int linkNo, EventButton *event)
Definition: selection.cc:159
void sizeRequest(Requisition *requisition, int numPos=0, Widget **references=NULL, int *x=NULL, int *y=NULL)
This method is a wrapper for Widget::sizeRequestImpl(); it calls the latter only when needed...
Definition: widget.cc:524
void leaveSizeAllocate()
Definition: widget.hh:414
int y
Definition: types.hh:166
Widget * container
The containing widget, equivalent to the "containing block" defined by CSS. May be NULL...
Definition: widget.hh:126
virtual void sizeRequestImpl(Requisition *requisition, int numPos, Widget **references, int *x, int *y)
See Sizes of Dillo Widgets.
Definition: widget.cc:1562