diff options
-rw-r--r-- | doc/dw-interrupted-drawing.doc | 5 | ||||
-rw-r--r-- | doc/dw-miscellaneous.doc | 10 | ||||
-rw-r--r-- | dw/oofawarewidget.cc | 13 | ||||
-rw-r--r-- | dw/textblock.cc | 5 | ||||
-rw-r--r-- | dw/widget.cc | 12 | ||||
-rw-r--r-- | lout/debug_rtfl.hh | 24 |
6 files changed, 57 insertions, 12 deletions
diff --git a/doc/dw-interrupted-drawing.doc b/doc/dw-interrupted-drawing.doc new file mode 100644 index 00000000..a0e2d5e7 --- /dev/null +++ b/doc/dw-interrupted-drawing.doc @@ -0,0 +1,5 @@ +/** \page dw-interrupted-drawing Interrupted drawing + +... + +*/ diff --git a/doc/dw-miscellaneous.doc b/doc/dw-miscellaneous.doc index 118f5024..489819ee 100644 --- a/doc/dw-miscellaneous.doc +++ b/doc/dw-miscellaneous.doc @@ -10,11 +10,15 @@ General A **widget allocation outside of the allocation of the parent** is allowed, but the part outside is not visible. -**Interrupted drawing:** ... +**Interrupted drawing:** \ref dw-interrupted-drawing. -Positioned element -================== +Positioned elements +=================== **Positioned elements outside of the container:** ... +**Relative positions:** ... + +**Fixed positions:** ... + */ diff --git a/dw/oofawarewidget.cc b/dw/oofawarewidget.cc index f9510854..6e34b32f 100644 --- a/dw/oofawarewidget.cc +++ b/dw/oofawarewidget.cc @@ -384,8 +384,7 @@ bool OOFAwareWidget::doesWidgetOOFInterruptDrawing (Widget *widget) int cl = oofContainer[oofmIndex]->stackingContextWidget->getLevel (), gl = stackingContextWidget->getLevel (); - DBG_OBJ_MSGF_O ("draw", 1, (void*)NULL, "%d < %d => %s", - cl, gl, cl < gl ? "true" : "false"); + DBG_OBJ_MSGF ("draw", 1,"%d < %d => %s", cl, gl, cl < gl ? "true" : "false"); DBG_OBJ_LEAVE (); return cl < gl; @@ -405,9 +404,11 @@ void OOFAwareWidget::draw (View *view, Rectangle *area, ((OOFStackingIterator*)iteratorStack->getTop())->majorLevel); if (*interruptedWidget) { + DBG_OBJ_MSGF ("draw", 1, "interrupted at %p (parent = %p)", + *interruptedWidget, (*interruptedWidget)->getParent ()); + if ((*interruptedWidget)->getParent () == this) { - DBG_OBJ_MSGF ("draw", 1, "interrupted at %p, drawing seperately", - *interruptedWidget); + DBG_OBJ_MSG ("draw", 1, "drawing seperately"); DBG_OBJ_MSG_START (); DBG_IF_RTFL { @@ -429,8 +430,8 @@ void OOFAwareWidget::draw (View *view, Rectangle *area, assert (interruptedWidget2 == NULL); //if (interruptedWidget2 != NULL) // DBG_OBJ_MSGF ("draw", 0, - // "<b>===== Assertion failed: " - // "interruptedWidget2 = %p =====</b>", + // "===== Assertion failed: " + // "interruptedWidget2 = %p =====", // interruptedWidget2); } diff --git a/dw/textblock.cc b/dw/textblock.cc index 56b3a6d6..250c12d6 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -1772,8 +1772,11 @@ void Textblock::handleOOFReferences (core::StackingIteratorStack *iteratorStack, Word *word = words->getRef (osi->index); if (word->content.type == core::Content::WIDGET_OOF_REF && getOOFMIndex (word->content.widget) == osi->minorLevel && - doesWidgetOOFInterruptDrawing (word->content.widget)) + doesWidgetOOFInterruptDrawing (word->content.widget)) { *interruptedWidget = word->content.widget; + DBG_OBJ_MSGF ("draw", 0, "widget oof %p interrupts drawing", + interruptedWidget); + } // The index is increased in any case: the iterator must // point to the next element. diff --git a/dw/widget.cc b/dw/widget.cc index c02b007f..ca6abb37 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -125,8 +125,8 @@ Widget::~Widget () * \brief Calculates the intersection of widget->allocation and area, returned * in intersection (in widget coordinates!). * - * Typically used by containers when - * drawing their children. Returns whether intersection is not empty. + * Typically used by containers when drawing their children. Returns whether + * intersection is not empty. */ bool Widget::intersects (Rectangle *area, Rectangle *intersection) { @@ -252,6 +252,10 @@ void Widget::drawToplevel (View *view, Rectangle *area) // Everything should be finished at this point. assert (interruptedWidget == NULL); + //if (interruptedWidget != NULL) + // DBG_OBJ_MSGF ("draw", 0, + // "===== Assertion failed: interruptedWidget = %p =====", + // interruptedWidget); } Widget *Widget::getWidgetAtPoint (int x, int y, @@ -344,6 +348,8 @@ Widget *Widget::getWidgetAtPointToplevel (int x, int y) void Widget::setParent (Widget *parent) { + DBG_OBJ_ENTER ("construct", 0, "setParent", "%p", parent); + this->parent = parent; layout = parent->layout; @@ -381,6 +387,8 @@ void Widget::setParent (Widget *parent) stackingContextWidget = parent->stackingContextWidget; notifySetParent(); + + DBG_OBJ_LEAVE (); } void Widget::setQuasiParent (Widget *quasiParent) diff --git a/lout/debug_rtfl.hh b/lout/debug_rtfl.hh index 7a93b5ce..7134238c 100644 --- a/lout/debug_rtfl.hh +++ b/lout/debug_rtfl.hh @@ -123,6 +123,26 @@ inline void rtfl_print (const char *version, const char *file, int line, DBG_OBJ_MSG_O (aspect, prio, obj, msg); \ } STMT_END +#define DBG_OBJ_MARK(aspect, prio, mark) \ + DBG_OBJ_MARK_O (aspect, prio, this, mark) + +#define DBG_OBJ_MARK_O(aspect, prio, obj, mark) \ + RTFL_OBJ_PRINT ("mark", "p:s:d:s", obj, aspect, prio, mark) + +#define DBG_OBJ_MARKF(aspect, prio, fmt, ...) \ + STMT_START { \ + char mark[256]; \ + snprintf (mark, sizeof (mark), fmt, __VA_ARGS__); \ + DBG_OBJ_MARK (aspect, prio, mark); \ + } STMT_END + +#define DBG_OBJ_MARKF_O(aspect, prio, obj, fmt, ...) \ + STMT_START { \ + char mark[256]; \ + snprintf (mark, sizeof (mark), fmt, __VA_ARGS__); \ + DBG_OBJ_MARK_O (aspect, prio, obj, mark); \ + } STMT_END + #define DBG_OBJ_MSG_START() \ DBG_OBJ_MSG_START_O (this) @@ -309,6 +329,10 @@ inline void rtfl_print (const char *version, const char *file, int line, #define DBG_OBJ_MSG_O(aspect, prio, obj, msg) STMT_NOP #define DBG_OBJ_MSGF(aspect, prio, fmt, ...) STMT_NOP #define DBG_OBJ_MSGF_O(aspect, prio, obj, fmt, ...) STMT_NOP +#define DBG_OBJ_MARK(aspect, prio, mark) STMT_NOP +#define DBG_OBJ_MARK_O(aspect, prio, obj, mark) STMT_NOP +#define DBG_OBJ_MARKF(aspect, prio, fmt, ...) STMT_NOP +#define DBG_OBJ_MARKF_O(aspect, prio, obj, fmt, ...) STMT_NOP #define DBG_OBJ_MSG_START() STMT_NOP #define DBG_OBJ_MSG_START_O(obj) STMT_NOP #define DBG_OBJ_MSG_END() STMT_NOP |