Dillo v3.1.1-14-g8f67d6e0
Loading...
Searching...
No Matches
layout.cc
Go to the documentation of this file.
1/*
2 * Dillo Widget
3 *
4 * Copyright 2005-2007 Sebastian Geerken <sgeerken@dillo.org>
5 * Copyright 2024 Rodrigo Arias Mallo <rodarima@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21
22
23#include "core.hh"
24
25#include "../lout/msg.h"
26#include "../lout/debug.hh"
27#include "../lout/misc.hh"
28
29using namespace lout;
30using namespace lout::container;
31using namespace lout::object;
32
33namespace dw {
34namespace core {
35
37{
38 return true;
39}
40
41void Layout::LayoutImgRenderer::getBgArea (int *x, int *y, int *width,
42 int *height)
43{
44 // TODO Actually not padding area, but visible area?
45 getRefArea (x, y, width, height);
46}
47
48void Layout::LayoutImgRenderer::getRefArea (int *xRef, int *yRef, int *widthRef,
49 int *heightRef)
50{
51 *xRef = 0;
52 *yRef = 0;
53 *widthRef = misc::max (layout->viewportWidth
54 - (layout->canvasHeightGreater ?
55 layout->vScrollbarThickness : 0),
56 layout->canvasWidth);
57 *heightRef = misc::max (layout->viewportHeight
58 - layout->hScrollbarThickness,
59 layout->canvasAscent + layout->canvasDescent);
60}
61
66
71
77
82
87
88void Layout::LayoutImgRenderer::draw (int x, int y, int width, int height)
89{
90 layout->queueDraw (x, y, width, height);
91}
92
93// ----------------------------------------------------------------------
94
95void Layout::Receiver::resizeQueued (bool extremesChanged)
96{
97}
98
99void Layout::Receiver::canvasSizeChanged (int width, int ascent, int descent)
100{
101}
102
103// ----------------------------------------------------------------------
104
106 int signalNo, int argc,
108{
109 Receiver *layoutReceiver = (Receiver*)receiver;
110
111 switch (signalNo) {
112 case CANVAS_SIZE_CHANGED:
113 layoutReceiver->canvasSizeChanged (((Integer*)argv[0])->getValue (),
114 ((Integer*)argv[1])->getValue (),
115 ((Integer*)argv[2])->getValue ());
116 break;
117
118 case RESIZE_QUEUED:
119 layoutReceiver->resizeQueued (((Boolean*)argv[0])->getValue ());
120 break;
121
122 default:
124 }
125
126 return false;
127}
128
129void Layout::Emitter::emitResizeQueued (bool extremesChanged)
130{
131 Boolean ec (extremesChanged);
132 Object *argv[1] = { &ec };
133 emitVoid (RESIZE_QUEUED, 1, argv);
134}
135
137 int ascent, int descent)
138{
139 Integer w (width), a (ascent), d (descent);
140 Object *argv[3] = { &w, &a, &d };
141 emitVoid (CANVAS_SIZE_CHANGED, 3, argv);
142}
143
144// ----------------------------------------------------------------------
145
146bool Layout::LinkReceiver::enter (Widget *widget, int link, int img,
147 int x, int y)
148{
149 return false;
150}
151
152bool Layout::LinkReceiver::press (Widget *widget, int link, int img,
153 int x, int y, EventButton *event)
154{
155 return false;
156}
157
158bool Layout::LinkReceiver::release (Widget *widget, int link, int img,
159 int x, int y, EventButton *event)
160{
161 return false;
162}
163
164bool Layout::LinkReceiver::click (Widget *widget, int link, int img,
165 int x, int y, EventButton *event)
166{
167 return false;
168}
169
170// ----------------------------------------------------------------------
171
173 int signalNo, int argc,
175{
176 LinkReceiver *linkReceiver = (LinkReceiver*)receiver;
177
178 switch (signalNo) {
179 case ENTER:
180 return linkReceiver->enter ((Widget*)argv[0],
181 ((Integer*)argv[1])->getValue (),
182 ((Integer*)argv[2])->getValue (),
183 ((Integer*)argv[3])->getValue (),
184 ((Integer*)argv[4])->getValue ());
185
186 case PRESS:
187 return linkReceiver->press ((Widget*)argv[0],
188 ((Integer*)argv[1])->getValue (),
189 ((Integer*)argv[2])->getValue (),
190 ((Integer*)argv[3])->getValue (),
191 ((Integer*)argv[4])->getValue (),
192 (EventButton*)argv[5]);
193
194 case RELEASE:
195 return linkReceiver->release ((Widget*)argv[0],
196 ((Integer*)argv[1])->getValue (),
197 ((Integer*)argv[2])->getValue (),
198 ((Integer*)argv[3])->getValue (),
199 ((Integer*)argv[4])->getValue (),
200 (EventButton*)argv[5]);
201
202 case CLICK:
203 return linkReceiver->click ((Widget*)argv[0],
204 ((Integer*)argv[1])->getValue (),
205 ((Integer*)argv[2])->getValue (),
206 ((Integer*)argv[3])->getValue (),
207 ((Integer*)argv[4])->getValue (),
208 (EventButton*)argv[5]);
209
210 default:
212 }
213 return false;
214}
215
216bool Layout::LinkEmitter::emitEnter (Widget *widget, int link, int img,
217 int x, int y)
218{
219 Integer ilink (link), iimg (img), ix (x), iy (y);
220 Object *argv[5] = { widget, &ilink, &iimg, &ix, &iy };
221 return emitBool (ENTER, 5, argv);
222}
223
224bool Layout::LinkEmitter::emitPress (Widget *widget, int link, int img,
225 int x, int y, EventButton *event)
226{
227 Integer ilink (link), iimg (img), ix (x), iy (y);
228 Object *argv[6] = { widget, &ilink, &iimg, &ix, &iy, event };
229 return emitBool (PRESS, 6, argv);
230}
231
232bool Layout::LinkEmitter::emitRelease (Widget *widget, int link, int img,
233 int x, int y, EventButton *event)
234{
235 Integer ilink (link), iimg (img), ix (x), iy (y);
236 Object *argv[6] = { widget, &ilink, &iimg, &ix, &iy, event };
237 return emitBool (RELEASE, 6, argv);
238}
239
240bool Layout::LinkEmitter::emitClick (Widget *widget, int link, int img,
241 int x, int y, EventButton *event)
242{
243 Integer ilink (link), iimg (img), ix (x), iy (y);
244 Object *argv[6] = { widget, &ilink, &iimg, &ix, &iy, event };
245 return emitBool (CLICK, 6, argv);
246}
247
248// ---------------------------------------------------------------------
249
251{
252 free(name);
253}
254
255// ---------------------------------------------------------------------
256
258{
259 this->platform = platform;
260 view = NULL;
261 topLevel = NULL;
262 widgetAtPoint = NULL;
263
264 queueResizeList = new typed::Vector<Widget> (4, false);
265
266 DBG_OBJ_CREATE ("dw::core::Layout");
267
268 bgColor = NULL;
269 bgImage = NULL;
271
273
274 usesViewport = false;
275 drawAfterScrollReq = false;
276 scrollX = scrollY = 0;
279
280 DBG_OBJ_SET_NUM ("viewportWidth", viewportWidth);
281 DBG_OBJ_SET_NUM ("viewportHeight", viewportHeight);
282 DBG_OBJ_SET_NUM ("hScrollbarThickness", hScrollbarThickness);
283 DBG_OBJ_SET_NUM ("vScrollbarThickness", vScrollbarThickness);
284
285 requestedAnchor = NULL;
286 scrollIdleId = -1;
288
290 new container::typed::HashTable <object::String, Anchor> (true, true);
291
292 resizeIdleId = -1;
293
294 textZone = new misc::ZoneAllocator (16 * 1024);
295
298
299 platform->setLayout (this);
300
302
305
306 layoutImgRenderer = NULL;
307
310}
311
313{
314 widgetAtPoint = NULL;
315
316 if (layoutImgRenderer) {
317 if (bgImage)
319 delete layoutImgRenderer;
320 }
321
322 if (scrollIdleId != -1)
324 if (resizeIdleId != -1)
326 if (bgColor)
327 bgColor->unref ();
328 if (bgImage)
329 bgImage->unref ();
330 if (topLevel) {
332 Widget *w = topLevel;
333 topLevel = NULL;
334 delete w;
335 }
336
337 delete queueResizeList;
338 delete platform;
339 delete view;
340 delete anchorsTable;
341 delete textZone;
342
343 if (requestedAnchor)
344 free (requestedAnchor);
345
347}
348
350{
351 // Called form ~Layout. Sometimes, the widgets (not only the toplevel widget)
352 // do some stuff after the layout has been deleted, so *all* widgets have to
353 // be detached, and check "layout != NULL" at relevant points.
354
355 // Could be replaced by a virtual method in Widget, like getWidgetAtPoint,
356 // if performace were really a problem.
357
358 widget->layout = NULL;
359 Iterator *it =
360 widget->iterator ((Content::Type)
362 false);
363 while (it->next ())
365
366 it->unref ();
367}
368
370{
371 if (topLevel) {
372 MSG_WARN("widget already set\n");
373 return;
374 }
375
376 // The toplevel widget always establishes a stacking context. It could
377 // already be set in Widget::setStyle().
378 if (widget->stackingContextMgr == NULL && IMPL_POS) {
379 widget->stackingContextMgr = new StackingContextMgr (widget);
380 DBG_OBJ_ASSOC (widget, widget->stackingContextMgr);
381 widget->stackingContextWidget = widget;
382 }
383
384 topLevel = widget;
385 widget->layout = this;
386 widget->container = NULL;
387 DBG_OBJ_SET_PTR_O (widget, "container", widget->container);
388
389 queueResizeList->clear ();
390 widget->notifySetAsTopLevel ();
391
392 findtextState.setWidget (widget);
393
394 canvasHeightGreater = false;
395 DBG_OBJ_SET_SYM ("canvasHeightGreater",
396 canvasHeightGreater ? "true" : "false");
397
398 // Do not directly call Layout::queueResize(), but
399 // Widget::queueResize(), so that all flags are set properly,
400 // queueResizeList is filled, etc.
401 topLevel->queueResize (-1, false);
402}
403
430
432{
433 DBG_OBJ_ASSOC_CHILD (widget);
434
435 widgetAtPoint = NULL;
436 if (topLevel) {
437 Widget *w = topLevel;
438 topLevel = NULL;
439 delete w;
440 }
441 textZone->zoneFree ();
442 addWidget (widget);
443
444 updateCursor ();
445}
446
454{
455 if (this->view)
456 MSG_ERR("attachView: Multiple views for layout!\n");
457
459
460 this->view = view;
462
463 /*
464 * The layout of the view is set later, first, we "project" the current
465 * state of the layout into the new view. A view must handle this without
466 * a layout. See also at the end of this function.
467 */
468 if (bgColor)
472
473 if (view->usesViewport ()) {
474 if (usesViewport) {
482 }
483 else {
484 usesViewport = true;
485 scrollX = scrollY = 0;
486 viewportWidth = viewportHeight = 100; // random values
489 }
490
491 DBG_OBJ_SET_NUM ("viewportWidth", viewportWidth);
492 DBG_OBJ_SET_NUM ("viewportHeight", viewportHeight);
493 DBG_OBJ_SET_NUM ("hScrollbarThickness", hScrollbarThickness);
494 DBG_OBJ_SET_NUM ("vScrollbarThickness", vScrollbarThickness);
495 }
496
497 /*
498 * This is the last call within this function, so that it is safe for
499 * the implementation of dw::core::View::setLayout, to call methods
500 * of dw::core::Layout.
501 */
502 view->setLayout (this);
503}
504
506{
507 if (this->view != view)
508 MSG_ERR("detachView: this->view: %p view %p\n", this->view, view);
509
510 view->setLayout (NULL);
512 this->view = NULL;
519}
520
522{
523 if (view->usesViewport ())
524 view->scroll(cmd);
525}
526
532 int x, int y, int width, int height)
533{
534 scrollTo0 (hpos, vpos, x, y, width, height, true);
535}
536
538 int x, int y, int width, int height,
539 bool scrollingInterrupted)
540{
541 if (usesViewport) {
542 _MSG("scrollTo (%d, %d, %s)\n",
543 x, y, scrollingInterrupted ? "true" : "false");
544
545 scrollTargetHpos = hpos;
546 scrollTargetVpos = vpos;
547 scrollTargetX = x;
548 scrollTargetY = y;
549 scrollTargetWidth = width;
550 scrollTargetHeight = height;
551
552 if (scrollIdleId == -1) {
555 }
556
558 scrollIdleNotInterrupted || !scrollingInterrupted;
559 }
560}
561
563{
564 bool xChanged = true;
565 switch (scrollTargetHpos) {
566 case HPOS_LEFT:
568 break;
569 case HPOS_CENTER:
570 scrollX =
573 break;
574 case HPOS_RIGHT:
575 scrollX =
578 break;
579 case HPOS_INTO_VIEW:
582 break;
583 case HPOS_NO_CHANGE:
584 xChanged = false;
585 break;
586 }
587
588 bool yChanged = true;
589 switch (scrollTargetVpos) {
590 case VPOS_TOP:
592 break;
593 case VPOS_CENTER:
594 scrollY =
597 break;
598 case VPOS_BOTTOM:
599 scrollY =
602 break;
603 case VPOS_INTO_VIEW:
606 break;
607 case VPOS_NO_CHANGE:
608 yChanged = false;
609 break;
610 }
611
612 if (xChanged || yChanged) {
615 if (drawAfterScrollReq) {
616 drawAfterScrollReq = false;
618 }
619 }
620
621 scrollIdleId = -1;
622}
623
625{
629
633
634 _MSG("adjustScrollPos: scrollX=%d scrollY=%d\n", scrollX, scrollY);
635}
636
637bool Layout::calcScrollInto (int requestedValue, int requestedSize,
638 int *value, int viewportSize)
639{
640 if (requestedSize > viewportSize) {
641 // The viewport size is smaller than the size of the region which will
642 // be shown. If the region is already visible, do not change the
643 // position. Otherwise, show the left/upper border, this is most likely
644 // what is needed.
645 if (*value >= requestedValue &&
646 *value + viewportSize < requestedValue + requestedSize)
647 return false;
648 else
649 requestedSize = viewportSize;
650 }
651
652 if (requestedValue < *value) {
653 *value = requestedValue;
654 return true;
655 } else if (requestedValue + requestedSize > *value + viewportSize) {
656 *value = requestedValue - viewportSize + requestedSize;
657 return true;
658 } else
659 return false;
660}
661
663{
664 DBG_OBJ_ENTER ("draw", 0, "draw", "%d, %d, %d * %d",
665 area->x, area->y, area->width, area->height);
666
667 Rectangle widgetArea, intersection, widgetDrawArea;
668
669 // First of all, draw background image. (Unlike background *color*,
670 // this is not a feature of the views.)
671 if (bgImage != NULL && bgImage->getImgbufSrc() != NULL)
674 area->x, area->y, area->width,
675 area->height, 0, 0,
676 // Reference area: maximum of canvas size and
677 // viewport size.
685
686 if (scrollIdleId != -1) {
687 /* scroll is pending, defer draw until after scrollIdle() */
688 drawAfterScrollReq = true;
689
690 } else if (topLevel) {
691 /* Draw the top level widget. */
692 widgetArea.x = topLevel->allocation.x;
693 widgetArea.y = topLevel->allocation.y;
694 widgetArea.width = topLevel->allocation.width;
695 widgetArea.height = topLevel->getHeight ();
696
697 if (area->intersectsWith (&widgetArea, &intersection)) {
698 view->startDrawing (&intersection);
699
700 /* Intersection in widget coordinates. */
701 widgetDrawArea.x = intersection.x - topLevel->allocation.x;
702 widgetDrawArea.y = intersection.y - topLevel->allocation.y;
703 widgetDrawArea.width = intersection.width;
704 widgetDrawArea.height = intersection.height;
705
706 DrawingContext context (&widgetArea);
707 topLevel->draw (view, &widgetDrawArea, &context);
708
709 view->finishDrawing (&intersection);
710 }
711 }
712
713 DBG_OBJ_LEAVE ();
714}
715
720
726
730void Layout::setAnchor (const char *anchor)
731{
732 _MSG("setAnchor (%s)\n", anchor);
733
734 if (requestedAnchor)
735 free (requestedAnchor);
736 requestedAnchor = anchor ? strdup (anchor) : NULL;
737 updateAnchor ();
738}
739
743char *Layout::addAnchor (Widget *widget, const char* name)
744{
745 return addAnchor (widget, name, -1);
746}
747
748char *Layout::addAnchor (Widget *widget, const char* name, int y)
749{
750 String key (name);
751 if (anchorsTable->contains (&key))
752 return NULL;
753 else {
754 Anchor *anchor = new Anchor ();
755 anchor->name = strdup (name);
756 anchor->widget = widget;
757 anchor->y = y;
758
759 anchorsTable->put (new String (name), anchor);
760 updateAnchor ();
761
762 return anchor->name;
763 }
764}
765
766void Layout::changeAnchor (Widget *widget, char* name, int y)
767{
768 String key (name);
769 Anchor *anchor = anchorsTable->get (&key);
770 assert (anchor);
771 assert (anchor->widget == widget);
772 anchor->y = y;
773 updateAnchor ();
774}
775
776void Layout::removeAnchor (Widget *widget, char* name)
777{
778 String key (name);
779 anchorsTable->remove (&key);
780}
781
783{
784 Anchor *anchor;
785 if (requestedAnchor) {
787 anchor = anchorsTable->get (&key);
788 } else
789 anchor = NULL;
790
791 if (anchor == NULL) {
795 scrollIdleId = -1;
796 }
797 } else
798 if (anchor->y != -1)
799 scrollTo0 (HPOS_NO_CHANGE, VPOS_TOP, 0, anchor->y, 0, 0, false);
800}
801
803{
804 if (cursor != this->cursor) {
805 this->cursor = cursor;
807 }
808}
809
817
819{
820 color->ref ();
821
822 if (bgColor)
823 bgColor->unref ();
824
825 bgColor = color;
826
827 if (view)
829}
830
835{
836 if (layoutImgRenderer && this->bgImage)
838
839 if (bgImage)
840 bgImage->ref ();
841
842 if (this->bgImage)
843 this->bgImage->unref ();
844
845 this->bgImage = bgImage;
846 this->bgRepeat = bgRepeat;
847 this->bgAttachment = bgAttachment;
848 this->bgPositionX = bgPositionX;
849 this->bgPositionY = bgPositionY;
850
851 if (bgImage) {
852 // Create instance of LayoutImgRenderer when needed. Until this
853 // layout is deleted, "layoutImgRenderer" will be kept, since it
854 // is not specific to the style, but only to this layout.
855 if (layoutImgRenderer == NULL)
858 }
859}
860
861
863{
864 DBG_OBJ_ENTER0 ("resize", 0, "resizeIdle");
865
867
868 static int calls = 0;
869
870 // There are two commits, 2863:b749629fbfc9 and 4645:ab70f9ce4353, the second
871 // reverting the former. Interrestingly, the second fixes a bug. However, it
872 // should still examined what happens here, and what happens the other calls
873 // to Layout::resizeIdle() which should be still in the queue. (See
874 // Layout::queueResize(), where resizeIdleId is indeed checked.)
875
876 while (resizeIdleId != -1) {
877 _MSG("Layout::resizeIdle calls = %d\n", ++calls);
878
879 for (typed::Iterator <Widget> it = queueResizeList->iterator();
880 it.hasNext (); ) {
881 Widget *widget = it.getNext ();
882
883 if (widget->resizeQueued ()) {
886 }
887
888 if (widget->allocateQueued ()) {
891 }
892
893 if (widget->extremesQueued ()) {
896 }
897 }
898 queueResizeList->clear ();
899
900 // Reset here, since below, queueResize() may be called again.
901 resizeIdleId = -1;
902
903 // If this method is triggered by a viewport change, we can save
904 // time when the toplevel widget is not affected (as for a toplevel
905 // image resource).
906 if (topLevel &&
908 Requisition requisition;
909 Allocation allocation;
910
911 topLevel->sizeRequest (&requisition);
912 DBG_OBJ_MSGF ("resize", 1, "toplevel size: %d * (%d + %d)",
913 requisition.width, requisition.ascent,
914 requisition.descent);
915
916 // This method is triggered by Widget::queueResize, which will,
917 // in any case, set NEEDS_ALLOCATE (indirectly, as ALLOCATE_QUEUED).
918 // This assertion helps to find inconsistencies. (Cases where
919 // this method is triggered by a viewport change, but the
920 // toplevel widget is not affected, are filtered out some lines
921 // above: "if (topLevel && topLevel->needsResize ())".)
922 assert (topLevel->needsAllocate ());
923
924 allocation.x = allocation.y = 0;
925 allocation.width = requisition.width;
926 allocation.ascent = requisition.ascent;
927 allocation.descent = requisition.descent;
928 topLevel->sizeAllocate (&allocation);
929
930 canvasWidth = requisition.width;
931 canvasAscent = requisition.ascent;
932 canvasDescent = requisition.descent;
935 // Tell the view about the new world size.
937
938 if (usesViewport) {
939 int currHThickness = currHScrollbarThickness();
940 int currVThickness = currVScrollbarThickness();
941
942 if (!canvasHeightGreater &&
943 canvasAscent + canvasDescent > viewportHeight - currHThickness) {
944 canvasHeightGreater = true;
945 DBG_OBJ_SET_SYM ("canvasHeightGreater",
946 canvasHeightGreater ? "true" : "false");
948 }
949
950 // Set viewport sizes.
952 currHThickness, currVThickness);
953 }
954
955 // views are redrawn via Widget::resizeDrawImpl ()
956 }
957 }
958 updateAnchor ();
959
960 DBG_OBJ_MSGF ("resize", 1,
961 "after resizeIdle: resizeIdleId = %d", resizeIdleId);
962 DBG_OBJ_LEAVE ();
963
965}
966
967void Layout::queueDraw (int x, int y, int width, int height)
968{
969 Rectangle area;
970 area.x = x;
971 area.y = y;
972 area.width = width;
973 area.height = height;
974
975 if (area.isEmpty ()) return;
976
977 view->queueDraw (&area);
978}
979
980void Layout::queueDrawExcept (int x, int y, int width, int height,
981 int ex, int ey, int ewidth, int eheight) {
982
983 if (x == ex && y == ey && width == ewidth && height == eheight)
984 return;
985
986 // queueDraw() the four rectangles within rectangle (x, y, width, height)
987 // around rectangle (ex, ey, ewidth, eheight).
988 // Some or all of these may be empty.
989
990 // upper left corner of the intersection rectangle
991 int ix1 = misc::max (x, ex);
992 int iy1 = misc::max (y, ey);
993 // lower right corner of the intersection rectangle
994 int ix2 = misc::min (x + width, ex + ewidth);
995 int iy2 = misc::min (y + height, ey + eheight);
996
997 queueDraw (x, y, width, iy1 - y);
998 queueDraw (x, iy2, width, y + height - iy2);
999 queueDraw (x, iy1, ix1 - x, iy2 - iy1);
1000 queueDraw (ix2, iy1, x + width - ix2, iy2 - iy1);
1001}
1002
1003void Layout::queueResize (bool extremesChanged)
1004{
1005 DBG_OBJ_ENTER ("resize", 0, "queueResize", "%s",
1006 extremesChanged ? "true" : "false");
1007
1008 if (resizeIdleId == -1) {
1010
1012 DBG_OBJ_MSGF ("resize", 1, "setting resizeIdleId = %d", resizeIdleId);
1013 }
1014
1015 emitter.emitResizeQueued (extremesChanged);
1016
1017 DBG_OBJ_LEAVE ();
1018}
1019
1020
1021// Views
1022
1023bool Layout::buttonEvent (ButtonEventType type, View *view, int numPressed,
1024 int x, int y, ButtonState state, int button)
1025
1026{
1027 EventButton event;
1028
1029 moveToWidgetAtPoint (x, y, state);
1030
1031 event.xCanvas = x;
1032 event.yCanvas = y;
1033 event.state = state;
1034 event.button = button;
1035 event.numPressed = numPressed;
1036
1037 return processMouseEvent (&event, type);
1038}
1039
1046bool Layout::motionNotify (View *view, int x, int y, ButtonState state)
1047{
1048 EventButton event;
1049
1050 moveToWidgetAtPoint (x, y, state);
1051
1052 event.xCanvas = x;
1053 event.yCanvas = y;
1054 event.state = state;
1055
1056 return processMouseEvent (&event, MOTION_NOTIFY);
1057}
1058
1064void Layout::enterNotify (View *view, int x, int y, ButtonState state)
1065{
1066 Widget *lastWidget;
1067 EventCrossing event;
1068
1069 lastWidget = widgetAtPoint;
1070 moveToWidgetAtPoint (x, y, state);
1071
1072 if (widgetAtPoint) {
1073 event.state = state;
1074 event.lastWidget = lastWidget;
1075 event.currentWidget = widgetAtPoint;
1076 widgetAtPoint->enterNotify (&event);
1077 }
1078}
1079
1086{
1087#if 0
1088 Widget *lastWidget;
1089 EventCrossing event;
1090
1091 lastWidget = widgetAtPoint;
1092 moveOutOfView (state);
1093
1094 if (lastWidget) {
1095 event.state = state;
1096 event.lastWidget = lastWidget;
1097 event.currentWidget = widgetAtPoint;
1098 lastWidget->leaveNotify (&event);
1099 }
1100#else
1101 moveOutOfView (state);
1102#endif
1103}
1104
1105/*
1106 * Return the widget at position (x, y). Return NULL, if there is no widget.
1107 */
1109{
1110 DBG_OBJ_ENTER ("events", 0, "getWidgetAtPoint", "%d, %d", x, y);
1111 Widget *widget;
1112
1113 if (topLevel && topLevel->wasAllocated ()) {
1115 widget = topLevel->getWidgetAtPoint (x, y, &context);
1116 } else
1117 widget = NULL;
1118
1119 DBG_OBJ_MSGF ("events", 0, "=> %p", widget);
1120 DBG_OBJ_LEAVE ();
1121 return widget;
1122}
1123
1124
1125/*
1126 * Emit the necessary crossing events, when the mouse pointer has moved to
1127 * the given widget (by mouse or scrolling).
1128 */
1129void Layout::moveToWidget (Widget *newWidgetAtPoint, ButtonState state)
1130{
1131 DBG_OBJ_ENTER ("events", 0, "moveToWidget", "%p, %d",
1132 newWidgetAtPoint, state);
1133
1134 Widget *ancestor, *w;
1135 Widget **track;
1136 int trackLen, i, i_a;
1137 EventCrossing crossingEvent;
1138
1139 DBG_OBJ_MSGF ("events", 1, "(old) widgetAtPoint = %p", widgetAtPoint);
1140
1141 if (newWidgetAtPoint != widgetAtPoint) {
1142 // The mouse pointer has been moved into another widget.
1143 if (newWidgetAtPoint && widgetAtPoint)
1144 ancestor =
1145 newWidgetAtPoint->getNearestCommonAncestor (widgetAtPoint);
1146 else if (newWidgetAtPoint)
1147 ancestor = newWidgetAtPoint->getTopLevel ();
1148 else
1149 ancestor = widgetAtPoint->getTopLevel ();
1150
1151 // Construct the track.
1152 trackLen = 0;
1153 if (widgetAtPoint)
1154 // first part
1155 for (w = widgetAtPoint; w != ancestor; w = w->getParent ())
1156 trackLen++;
1157 trackLen++; // for the ancestor
1158 if (newWidgetAtPoint)
1159 // second part
1160 for (w = newWidgetAtPoint; w != ancestor; w = w->getParent ())
1161 trackLen++;
1162
1163 track = new Widget* [trackLen];
1164 i = 0;
1165 if (widgetAtPoint)
1166 /* first part */
1167 for (w = widgetAtPoint; w != ancestor; w = w->getParent ())
1168 track[i++] = w;
1169 i_a = i;
1170 track[i++] = ancestor;
1171 if (newWidgetAtPoint) {
1172 /* second part */
1173 i = trackLen - 1;
1174 for (w = newWidgetAtPoint; w != ancestor; w = w->getParent ())
1175 track[i--] = w;
1176 }
1177#if 0
1178 MSG("Track: %s[ ", widgetAtPoint ? "" : "nil ");
1179 for (i = 0; i < trackLen; i++)
1180 MSG("%s%p ", i == i_a ? ">" : "", track[i]);
1181 MSG("] %s\n", newWidgetAtPoint ? "" : "nil");
1182#endif
1183
1184 /* Send events to the widgets on the track */
1185 for (i = 0; i < trackLen; i++) {
1186 crossingEvent.state = state;
1187 crossingEvent.currentWidget = widgetAtPoint; // ???
1188 crossingEvent.lastWidget = widgetAtPoint; // ???
1189 if (i < i_a) {
1190 track[i]->leaveNotify (&crossingEvent);
1191 } else if (i == i_a) { /* ancestor */
1192 /* Don't touch ancestor unless:
1193 * - moving into/from NULL,
1194 * - ancestor becomes the newWidgetAtPoint */
1195 if (i_a == trackLen-1 && !newWidgetAtPoint)
1196 track[i]->leaveNotify (&crossingEvent);
1197 else if ((i_a == 0 && !widgetAtPoint) ||
1198 (i_a == trackLen-1 && newWidgetAtPoint))
1199 track[i]->enterNotify (&crossingEvent);
1200 } else {
1201 track[i]->enterNotify (&crossingEvent);
1202 }
1203 }
1204
1205 delete[] track;
1206
1207 widgetAtPoint = newWidgetAtPoint;
1208 updateCursor ();
1209 }
1210
1211 DBG_OBJ_LEAVE ();
1212}
1213
1221 ButtonEventType type)
1222{
1223 Widget *widget;
1224
1225 /*
1226 * If the event is outside of the visible region of the canvas, treat it
1227 * as occurring at the region's edge. Notably, this helps when selecting
1228 * text.
1229 */
1230 if (event->xCanvas < scrollX)
1231 event->xCanvas = scrollX;
1232 else {
1233 int maxX = scrollX + viewportWidth - currVScrollbarThickness() - 1;
1234
1235 if (event->xCanvas > maxX)
1236 event->xCanvas = maxX;
1237 }
1238 if (event->yCanvas < scrollY)
1239 event->yCanvas = scrollY;
1240 else {
1243
1244 if (event->yCanvas > maxY)
1245 event->yCanvas = maxY;
1246 }
1247
1248 widget = getWidgetAtPoint(event->xCanvas, event->yCanvas);
1249
1250 for (; widget; widget = widget->getParent ()) {
1251 if (widget->isButtonSensitive ()) {
1252 event->xWidget = event->xCanvas - widget->getAllocation()->x;
1253 event->yWidget = event->yCanvas - widget->getAllocation()->y;
1254
1255 switch (type) {
1256 case BUTTON_PRESS:
1257 return widget->buttonPress ((EventButton*)event);
1258
1259 case BUTTON_RELEASE:
1260 return widget->buttonRelease ((EventButton*)event);
1261
1262 case MOTION_NOTIFY:
1263 return widget->motionNotify ((EventMotion*)event);
1264
1265 default:
1267 }
1268 }
1269 }
1270 if (type == BUTTON_PRESS)
1271 return emitLinkPress (NULL, -1, -1, -1, -1, (EventButton*)event);
1272 else if (type == BUTTON_RELEASE)
1273 return emitLinkRelease(NULL, -1, -1, -1, -1, (EventButton*)event);
1274
1275 return false;
1276}
1277
1278/*
1279 * This function must be called by a view, when the user has manually changed
1280 * the viewport position. It is *not* called, when the layout has requested the
1281 * position change.
1282 */
1284{
1285 if (x != scrollX || y != scrollY) {
1286 scrollX = x;
1287 scrollY = y;
1288
1289 setAnchor (NULL);
1290 updateAnchor ();
1291 }
1292}
1293
1294/*
1295 * This function must be called by a viewport view, when its viewport size has
1296 * changed. It is *not* called, when the layout has requested the size change.
1297 */
1298void Layout::viewportSizeChanged (View *view, int width, int height)
1299{
1300 DBG_OBJ_ENTER ("resize", 0, "viewportSizeChanged", "%p, %d, %d",
1301 view, width, height);
1302
1303 /* If size changes, redraw this view. */
1304 if (viewportWidth != width || viewportHeight != height) {
1305 canvasHeightGreater = false; // reset value here
1306 viewportWidth = width;
1307 viewportHeight = height;
1309
1310 DBG_OBJ_SET_SYM ("canvasHeightGreater",
1311 canvasHeightGreater ? "true" : "false");
1312 DBG_OBJ_SET_NUM ("viewportWidth", viewportWidth);
1313 DBG_OBJ_SET_NUM ("viewportHeight", viewportHeight);
1314 }
1315
1316 DBG_OBJ_LEAVE ();
1317}
1318
1320{
1321 DBG_OBJ_ENTER0 ("resize", 0, "containerSizeChanged");
1322
1323 if (topLevel) {
1325 queueResize (true);
1326 }
1327
1328 DBG_OBJ_LEAVE ();
1329}
1330
1331} // namespace core
1332} // namespace dw
#define _MSG(...)
Definition bookmarks.c:45
#define MSG(...)
Definition bookmarks.c:46
Set at the top when drawing.
Definition types.hh:295
Represents a button press or release event.
Definition events.hh:58
Represents a enter or leave notify event.
Definition events.hh:75
Represents a mouse motion event.
Definition events.hh:68
void setWidget(Widget *widget)
Definition findtext.cc:54
Set at the top when getting the widget at the point.
Definition types.hh:313
Iterators are used to iterate through the contents of a widget.
Definition iterator.hh:20
virtual void unref()
Delete the iterator.
Definition iterator.cc:82
virtual bool next()=0
Move iterator forward and store content it.
Content * getContent()
Definition iterator.hh:37
bool emitToReceiver(lout::signal::Receiver *receiver, int signalNo, int argc, lout::object::Object **argv)
A sub class must implement this for a call to a single receiver.
Definition layout.cc:105
void emitResizeQueued(bool extremesChanged)
Definition layout.cc:129
void emitCanvasSizeChanged(int width, int ascent, int descent)
Definition layout.cc:136
void draw(int x, int y, int width, int height)
Draw (or queue for drawing) an area, which is given in canvas coordinates.
Definition layout.cc:88
void getBgArea(int *x, int *y, int *width, int *height)
Return the area covered by the background image.
Definition layout.cc:41
style::BackgroundRepeat getBackgroundRepeat()
Definition layout.cc:67
style::BackgroundAttachment getBackgroundAttachment()
Definition layout.cc:73
void getRefArea(int *xRef, int *yRef, int *widthRef, int *heightRef)
Return the "reference area".
Definition layout.cc:48
style::Length getBackgroundPositionX()
Definition layout.cc:78
style::Length getBackgroundPositionY()
Definition layout.cc:83
style::StyleImage * getBackgroundImage()
Definition layout.cc:62
bool readyToDraw()
If this method returns false, nothing is done at all.
Definition layout.cc:36
bool emitEnter(Widget *widget, int link, int img, int x, int y)
Definition layout.cc:216
bool emitToReceiver(lout::signal::Receiver *receiver, int signalNo, int argc, lout::object::Object **argv)
A sub class must implement this for a call to a single receiver.
Definition layout.cc:172
bool emitPress(Widget *widget, int link, int img, int x, int y, EventButton *event)
Definition layout.cc:224
bool emitRelease(Widget *widget, int link, int img, int x, int y, EventButton *event)
Definition layout.cc:232
bool emitClick(Widget *widget, int link, int img, int x, int y, EventButton *event)
Definition layout.cc:240
virtual bool click(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has clicked on a link.
Definition layout.cc:164
virtual bool press(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has pressed the mouse button on a link (but not yet released).
Definition layout.cc:152
virtual bool release(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has released the mouse button on a link.
Definition layout.cc:158
virtual bool enter(Widget *widget, int link, int img, int x, int y)
Called, when a link is entered, left, or the position has changed.
Definition layout.cc:146
Receiver interface different signals.
Definition layout.hh:48
virtual void resizeQueued(bool extremesChanged)
Definition layout.cc:95
virtual void canvasSizeChanged(int width, int ascent, int descent)
Definition layout.cc:99
void attachView(View *view)
Attach a view to the layout.
Definition layout.cc:453
lout::misc::ZoneAllocator * textZone
Definition layout.hh:276
void changeAnchor(Widget *widget, char *name, int y)
Definition layout.cc:766
void detachWidget(Widget *widget)
Definition layout.cc:349
int currHScrollbarThickness()
Definition layout.cc:716
style::Cursor cursor
Definition layout.hh:167
void updateAnchor()
Definition layout.cc:782
bool emitLinkRelease(Widget *w, int link, int img, int x, int y, EventButton *event)
Definition layout.hh:268
void setCursor(style::Cursor cursor)
Definition layout.cc:802
void scrollIdle()
Definition layout.cc:562
void enterNotify(View *view, int x, int y, ButtonState state)
This function is called by a view, to delegate a enter notify event.
Definition layout.cc:1064
void queueDraw(int x, int y, int width, int height)
Definition layout.cc:967
bool scrollIdleNotInterrupted
Definition layout.hh:181
Widget * getWidgetAtPoint(int x, int y)
Definition layout.cc:1108
int scrollTargetWidth
Definition layout.hh:177
void containerSizeChanged()
Definition layout.cc:1319
bool motionNotify(View *view, int x, int y, ButtonState state)
This function is called by a view, to delegate a motion notify event.
Definition layout.cc:1046
bool drawAfterScrollReq
Definition layout.hh:170
void setWidget(Widget *widget)
Definition layout.cc:431
bool processMouseEvent(MousePositionEvent *event, ButtonEventType type)
Common processing of press, release and motion events.
Definition layout.cc:1220
style::StyleImage * bgImage
Definition layout.hh:162
void setBgColor(style::Color *color)
Definition layout.cc:818
void detachView(View *view)
Definition layout.cc:505
void moveToWidgetAtPoint(int x, int y, ButtonState state)
Emit the necessary crossing events, when the mouse pointer has moved to position (x,...
Definition layout.hh:201
char * addAnchor(Widget *widget, const char *name)
Used, when the widget is not allocated yet.
Definition layout.cc:743
void leaveNotify(View *view, ButtonState state)
This function is called by a view, to delegate a leave notify event.
Definition layout.cc:1085
lout::container::typed::HashTable< lout::object::String, Anchor > * anchorsTable
Definition layout.hh:185
void queueDrawExcept(int x, int y, int width, int height, int ex, int ey, int ewidth, int eheight)
Definition layout.cc:980
VPosition scrollTargetVpos
Definition layout.hh:176
void viewportSizeChanged(View *view, int width, int height)
Definition layout.cc:1298
HPosition scrollTargetHpos
Definition layout.hh:175
int sizeRequestCounter
Definition layout.hh:249
lout::container::typed::Vector< Widget > * queueResizeList
Definition layout.hh:158
int vScrollbarThickness
Definition layout.hh:173
void addWidget(Widget *widget)
Definition layout.cc:369
int queueResizeCounter
Definition layout.hh:248
bool buttonEvent(ButtonEventType type, View *view, int numPressed, int x, int y, ButtonState state, int button)
Definition layout.cc:1023
SelectionState selectionState
Definition layout.hh:187
void updateCursor()
Definition layout.cc:810
void resizeIdle()
Definition layout.cc:862
void draw(View *view, Rectangle *area)
Definition layout.cc:662
void moveToWidget(Widget *newWidgetAtPoint, ButtonState state)
Definition layout.cc:1129
void setBgImage(style::StyleImage *bgImage, style::BackgroundRepeat bgRepeat, style::BackgroundAttachment bgAttachment, style::Length bgPositionX, style::Length bgPositionY)
Definition layout.cc:831
void moveOutOfView(ButtonState state)
Emit the necessary crossing events, when the mouse pointer has moved out of the view.
Definition layout.hh:208
bool emitLinkPress(Widget *w, int link, int img, int x, int y, EventButton *event)
Definition layout.hh:264
void adjustScrollPos()
Definition layout.cc:624
int sizeAllocateCounter
Definition layout.hh:248
FindtextState findtextState
Definition layout.hh:188
Platform * platform
Definition layout.hh:155
style::Color * bgColor
Definition layout.hh:161
void enterResizeIdle()
Definition layout.hh:251
style::BackgroundRepeat bgRepeat
Definition layout.hh:163
void scrollTo0(HPosition hpos, VPosition vpos, int x, int y, int width, int height, bool scrollingInterrupted)
Definition layout.cc:537
Widget * widgetAtPoint
Definition layout.hh:157
void removeWidget()
Definition layout.cc:404
int getExtremesCounter
Definition layout.hh:249
Widget * topLevel
Definition layout.hh:157
void removeAnchor(Widget *widget, char *name)
Definition layout.cc:776
style::BackgroundAttachment bgAttachment
Definition layout.hh:164
static bool calcScrollInto(int targetValue, int requestedSize, int *value, int viewportSize)
Definition layout.cc:637
int scrollTargetHeight
Definition layout.hh:177
void scrollPosChanged(View *view, int x, int y)
Definition layout.cc:1283
int resizeIdleCounter
Definition layout.hh:248
void scrollTo(HPosition hpos, VPosition vpos, int x, int y, int width, int height)
Scrolls all viewports, so that the region [x, y, width, height] is seen, according to hpos and vpos.
Definition layout.cc:531
void scroll(ScrollCommand)
Definition layout.cc:521
style::Length bgPositionX
Definition layout.hh:165
style::Length bgPositionY
Definition layout.hh:165
int hScrollbarThickness
Definition layout.hh:173
char * requestedAnchor
Definition layout.hh:179
int currVScrollbarThickness()
Definition layout.cc:721
Emitter emitter
Definition layout.hh:143
Layout(Platform *platform)
Definition layout.cc:257
void setAnchor(const char *anchor)
Sets the anchor to scroll to.
Definition layout.cc:730
bool canvasHeightGreater
Definition layout.hh:172
void queueResize(bool extremesChanged)
Definition layout.cc:1003
LayoutImgRenderer * layoutImgRenderer
Definition layout.hh:39
void leaveResizeIdle()
Definition layout.hh:252
ButtonState state
Definition events.hh:42
Base class for all mouse events related to a specific position.
Definition events.hh:49
An interface to encapsulate some platform dependencies.
Definition platform.hh:17
virtual void removeIdle(int idleId)=0
Remove an idle function, which has not been processed yet.
virtual void detachView(View *view)=0
This methods notifies the platform, that a view has been detached from the related layout.
virtual void attachView(View *view)=0
This methods notifies the platform, that a view has been attached to the related layout.
virtual void setLayout(Layout *layout)=0
This methods notifies the platform, that it has been attached to a layout.
virtual int addIdle(void(Layout::*func)())=0
Add an idle function.
dw::core::Shape implemtation for simple rectangles.
Definition types.hh:70
bool intersectsWith(Rectangle *otherRect, Rectangle *dest)
Return whether this rectangle and otherRect intersect.
Definition types.cc:53
void setLayout(Layout *layout)
Definition selection.hh:225
See Handling stacking contexts.
An interface to encapsulate platform dependent drawing.
Definition view.hh:17
virtual void setViewportSize(int width, int height, int hScrollbarThickness, int vScrollbarThickness)=0
Set the viewport size.
virtual void queueDraw(Rectangle *area)=0
Queue a region, which is given in canvas coordinates, for drawing.
virtual void startDrawing(Rectangle *area)=0
Called before drawing.
virtual void scroll(ScrollCommand)
Scroll the viewport as commanded.
Definition view.hh:85
virtual int getHScrollbarThickness()=0
Get the thickness of the horizontal scrollbar, when it is visible.
virtual void setCanvasSize(int width, int ascent, int descent)=0
Set the canvas size.
virtual void finishDrawing(Rectangle *area)=0
Called after drawing.
virtual void queueDrawTotal()=0
Queue the total viewport for drawing.
virtual void setCursor(style::Cursor cursor)=0
Set the cursor appearance.
virtual bool usesViewport()=0
Return, whether this view uses a viewport.
virtual int getVScrollbarThickness()=0
Get the thickness of the vertical scrollbar, when it is visible.
virtual void setBgColor(style::Color *color)=0
Set the background of the view.
virtual void cancelQueueDraw()=0
Cancel a draw queue request.
virtual void scrollTo(int x, int y)=0
Scroll the vieport to the given position.
virtual void setLayout(Layout *layout)=0
This methods notifies the view, that it has been attached to a layout.
The base class of all dillo widgets.
Definition widget.hh:24
Allocation * getAllocation()
Definition widget.hh:450
void sizeAllocate(Allocation *allocation)
Wrapper for Widget::sizeAllocateImpl, calls the latter only when needed.
Definition widget.cc:1126
bool motionNotify(EventMotion *event)
Definition widget.cc:1211
Layout * layout
Definition widget.hh:189
Widget * container
The containing widget, equivalent to the "containing block" defined by CSS.
Definition widget.hh:126
Allocation allocation
The current allocation: size and position, always relative to the canvas.
Definition widget.hh:183
virtual Iterator * iterator(Content::Type mask, bool atEnd)=0
Return an iterator for this widget.
virtual void draw(View *view, Rectangle *area, DrawingContext *context)=0
Area is given in widget coordinates.
@ NEEDS_ALLOCATE
Only used internally, set to enforce size allocation.
Definition widget.hh:56
@ EXTREMES_CHANGED
Set, when dw::core::Widget::extremes is not up to date anymore.
Definition widget.hh:69
@ NEEDS_RESIZE
Set, when dw::core::Widget::requisition is not up to date anymore.
Definition widget.hh:45
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:534
Widget * getParent()
Definition widget.hh:552
void enterNotify(EventCrossing *event)
Definition widget.cc:1216
bool needsAllocate()
Definition widget.hh:438
bool resizeQueued()
Definition widget.hh:435
bool buttonRelease(EventButton *event)
Definition widget.cc:1206
Widget * stackingContextWidget
The bottom-most ancestor (or this) for which stackingContextMgr is set.
Definition widget.hh:211
virtual void notifySetAsTopLevel()
This method is called after a widget has been set as the top of a widget tree.
Definition widget.cc:1945
StackingContextMgr * stackingContextMgr
Set iff this widget constitutes a stacking context, as defined by CSS.
Definition widget.hh:205
bool isButtonSensitive()
Definition widget.hh:550
Widget * getNearestCommonAncestor(Widget *otherWidget)
Get the widget with the highest level, which is a direct ancestor of widget1 and widget2.
Definition widget.cc:1529
bool extremesQueued()
Definition widget.hh:436
bool needsResize()
Definition widget.hh:437
virtual Widget * getWidgetAtPoint(int x, int y, GettingWidgetAtPointContext *context)
Definition widget.cc:211
void leaveNotify(EventCrossing *event)
Definition widget.cc:1221
style::Style * style
Definition widget.hh:130
void containerSizeChanged()
Definition widget.cc:408
void unsetFlags(Flags f)
Definition widget.hh:274
void queueResize(int ref, bool extremesChanged, bool fast)
This method should be called, when a widget changes its size.
Definition widget.cc:309
bool buttonPress(EventButton *event)
Definition widget.cc:1201
Widget * getTopLevel()
Get the widget at the root of the tree, this widget is part from.
Definition widget.cc:1478
bool wasAllocated()
Definition widget.hh:441
bool allocateQueued()
Definition widget.hh:439
void setFlags(Flags f)
Definition widget.hh:272
void putExternalImgRenderer(ImgRenderer *ir)
Add an additional ImgRenderer, especially used for drawing.
Definition style.hh:890
void removeExternalImgRenderer(ImgRenderer *ir)
Remove a previously added additional ImgRenderer.
Definition style.hh:896
Typed version of container::untyped::Vector.
Definition container.hh:447
A simple allocator optimized to handle many small chunks of memory.
Definition misc.hh:627
An object::Object wrapper for bool's.
Definition object.hh:144
An object::Object wrapper for int's.
Definition object.hh:127
This is the base class for many other classes, which defines very common virtual methods.
Definition object.hh:25
An object::Object wrapper for strings (char*).
Definition object.hh:186
The base class for signal receiver base classes.
Definition signal.hh:254
#define DBG_OBJ_ENTER0(aspect, prio, funname)
#define DBG_OBJ_DELETE()
#define DBG_OBJ_CREATE(klass)
#define DBG_OBJ_SET_SYM(var, val)
#define DBG_OBJ_MSGF(aspect, prio, fmt,...)
#define DBG_OBJ_SET_NUM(var, val)
#define DBG_OBJ_ENTER(aspect, prio, funname, fmt,...)
#define DBG_OBJ_ASSOC(parent, child)
#define DBG_OBJ_LEAVE()
#define DBG_OBJ_ASSOC_CHILD(child)
#define DBG_OBJ_SET_PTR_O(obj, var, val)
#define MSG_ERR(...)
Definition dpid_common.h:21
static Layout * layout
#define MSG_WARN(...)
Definition msg.h:26
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 Length
Type for representing all lengths within dw::core::style.
Definition style.hh:428
ButtonState
Platform independent representation.
Definition events.hh:15
VPosition
Definition types.hh:26
@ VPOS_TOP
Definition types.hh:27
@ VPOS_INTO_VIEW
Definition types.hh:30
@ VPOS_CENTER
Definition types.hh:28
@ VPOS_NO_CHANGE
Definition types.hh:32
@ VPOS_BOTTOM
Definition types.hh:29
HPosition
Definition types.hh:16
@ HPOS_CENTER
Definition types.hh:18
@ HPOS_INTO_VIEW
Definition types.hh:20
@ HPOS_LEFT
Definition types.hh:17
@ HPOS_NO_CHANGE
Definition types.hh:22
@ HPOS_RIGHT
Definition types.hh:19
ScrollCommand
Definition types.hh:35
Dw is in this namespace, or sub namespaces of this one.
@ IMPL_POS
Definition core.hh:16
This namespace contains a framework for container classes, which members are instances of object::Obj...
Definition container.cc:31
T min(T a, T b)
Definition misc.hh:19
T max(T a, T b)
Definition misc.hh:20
void assertNotReached()
Definition misc.hh:35
Here, some common classes (or interfaces) are defined, to standardize the access to other classes.
Definition object.cc:29
Represents the allocation, i.e.
Definition types.hh:164
@ WIDGET_IN_FLOW
widget in normal flow, so that this widget (containing this content) is both container (parent) and g...
Definition types.hh:207
@ WIDGET_OOF_CONT
widget out of flow (OOF); this widget (containing this content) is only the container (parent),...
Definition types.hh:212
Widget * widget
Definition types.hh:237