Dillo v3.1.1-95-g3af05307
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 "dlib/dlib.h"
26#include "../lout/msg.h"
27#include "../lout/debug.hh"
28#include "../lout/misc.hh"
29
30using namespace lout;
31using namespace lout::container;
32using namespace lout::object;
33
34namespace dw {
35namespace core {
36
38{
39 return true;
40}
41
42void Layout::LayoutImgRenderer::getBgArea (int *x, int *y, int *width,
43 int *height)
44{
45 // TODO Actually not padding area, but visible area?
46 getRefArea (x, y, width, height);
47}
48
49void Layout::LayoutImgRenderer::getRefArea (int *xRef, int *yRef, int *widthRef,
50 int *heightRef)
51{
52 *xRef = 0;
53 *yRef = 0;
54 *widthRef = misc::max (layout->viewportWidth
55 - (layout->canvasHeightGreater ?
56 layout->vScrollbarThickness : 0),
57 layout->canvasWidth);
58 *heightRef = misc::max (layout->viewportHeight
59 - layout->hScrollbarThickness,
60 layout->canvasAscent + layout->canvasDescent);
61}
62
67
72
78
83
88
89void Layout::LayoutImgRenderer::draw (int x, int y, int width, int height)
90{
91 layout->queueDraw (x, y, width, height);
92}
93
94// ----------------------------------------------------------------------
95
96void Layout::Receiver::resizeQueued (bool extremesChanged)
97{
98}
99
100void Layout::Receiver::canvasSizeChanged (int width, int ascent, int descent)
101{
102}
103
104// ----------------------------------------------------------------------
105
107 int signalNo, int argc,
109{
110 Receiver *layoutReceiver = (Receiver*)receiver;
111
112 switch (signalNo) {
113 case CANVAS_SIZE_CHANGED:
114 layoutReceiver->canvasSizeChanged (((Integer*)argv[0])->getValue (),
115 ((Integer*)argv[1])->getValue (),
116 ((Integer*)argv[2])->getValue ());
117 break;
118
119 case RESIZE_QUEUED:
120 layoutReceiver->resizeQueued (((Boolean*)argv[0])->getValue ());
121 break;
122
123 default:
125 }
126
127 return false;
128}
129
130void Layout::Emitter::emitResizeQueued (bool extremesChanged)
131{
132 Boolean ec (extremesChanged);
133 Object *argv[1] = { &ec };
134 emitVoid (RESIZE_QUEUED, 1, argv);
135}
136
138 int ascent, int descent)
139{
140 Integer w (width), a (ascent), d (descent);
141 Object *argv[3] = { &w, &a, &d };
142 emitVoid (CANVAS_SIZE_CHANGED, 3, argv);
143}
144
145// ----------------------------------------------------------------------
146
147bool Layout::LinkReceiver::enter (Widget *widget, int link, int img,
148 int x, int y)
149{
150 return false;
151}
152
153bool Layout::LinkReceiver::press (Widget *widget, int link, int img,
154 int x, int y, EventButton *event)
155{
156 return false;
157}
158
159bool Layout::LinkReceiver::release (Widget *widget, int link, int img,
160 int x, int y, EventButton *event)
161{
162 return false;
163}
164
165bool Layout::LinkReceiver::click (Widget *widget, int link, int img,
166 int x, int y, EventButton *event)
167{
168 return false;
169}
170
171// ----------------------------------------------------------------------
172
174 int signalNo, int argc,
176{
177 LinkReceiver *linkReceiver = (LinkReceiver*)receiver;
178
179 switch (signalNo) {
180 case ENTER:
181 return linkReceiver->enter ((Widget*)argv[0],
182 ((Integer*)argv[1])->getValue (),
183 ((Integer*)argv[2])->getValue (),
184 ((Integer*)argv[3])->getValue (),
185 ((Integer*)argv[4])->getValue ());
186
187 case PRESS:
188 return linkReceiver->press ((Widget*)argv[0],
189 ((Integer*)argv[1])->getValue (),
190 ((Integer*)argv[2])->getValue (),
191 ((Integer*)argv[3])->getValue (),
192 ((Integer*)argv[4])->getValue (),
193 (EventButton*)argv[5]);
194
195 case RELEASE:
196 return linkReceiver->release ((Widget*)argv[0],
197 ((Integer*)argv[1])->getValue (),
198 ((Integer*)argv[2])->getValue (),
199 ((Integer*)argv[3])->getValue (),
200 ((Integer*)argv[4])->getValue (),
201 (EventButton*)argv[5]);
202
203 case CLICK:
204 return linkReceiver->click ((Widget*)argv[0],
205 ((Integer*)argv[1])->getValue (),
206 ((Integer*)argv[2])->getValue (),
207 ((Integer*)argv[3])->getValue (),
208 ((Integer*)argv[4])->getValue (),
209 (EventButton*)argv[5]);
210
211 default:
213 }
214 return false;
215}
216
217bool Layout::LinkEmitter::emitEnter (Widget *widget, int link, int img,
218 int x, int y)
219{
220 Integer ilink (link), iimg (img), ix (x), iy (y);
221 Object *argv[5] = { widget, &ilink, &iimg, &ix, &iy };
222 return emitBool (ENTER, 5, argv);
223}
224
225bool Layout::LinkEmitter::emitPress (Widget *widget, int link, int img,
226 int x, int y, EventButton *event)
227{
228 Integer ilink (link), iimg (img), ix (x), iy (y);
229 Object *argv[6] = { widget, &ilink, &iimg, &ix, &iy, event };
230 return emitBool (PRESS, 6, argv);
231}
232
233bool Layout::LinkEmitter::emitRelease (Widget *widget, int link, int img,
234 int x, int y, EventButton *event)
235{
236 Integer ilink (link), iimg (img), ix (x), iy (y);
237 Object *argv[6] = { widget, &ilink, &iimg, &ix, &iy, event };
238 return emitBool (RELEASE, 6, argv);
239}
240
241bool Layout::LinkEmitter::emitClick (Widget *widget, int link, int img,
242 int x, int y, EventButton *event)
243{
244 Integer ilink (link), iimg (img), ix (x), iy (y);
245 Object *argv[6] = { widget, &ilink, &iimg, &ix, &iy, event };
246 return emitBool (CLICK, 6, argv);
247}
248
249// ---------------------------------------------------------------------
250
252{
253 free(name);
254}
255
256// ---------------------------------------------------------------------
257
259{
260 this->platform = platform;
261 view = NULL;
262 topLevel = NULL;
263 widgetAtPoint = NULL;
264
265 queueResizeList = new typed::Vector<Widget> (4, false);
266
267 DBG_OBJ_CREATE ("dw::core::Layout");
268
269 bgColor = NULL;
270 bgImage = NULL;
272
274
275 usesViewport = false;
276 drawAfterScrollReq = false;
277 scrollX = scrollY = 0;
280
281 DBG_OBJ_SET_NUM ("viewportWidth", viewportWidth);
282 DBG_OBJ_SET_NUM ("viewportHeight", viewportHeight);
283 DBG_OBJ_SET_NUM ("hScrollbarThickness", hScrollbarThickness);
284 DBG_OBJ_SET_NUM ("vScrollbarThickness", vScrollbarThickness);
285
286 requestedAnchor = NULL;
287 scrollIdleId = -1;
289
291 new container::typed::HashTable <object::String, Anchor> (true, true);
292
293 resizeIdleId = -1;
294
295 textZone = new misc::ZoneAllocator (16 * 1024);
296
299
300 platform->setLayout (this);
301
303
306
307 layoutImgRenderer = NULL;
308
311}
312
314{
315 widgetAtPoint = NULL;
316
317 if (layoutImgRenderer) {
318 if (bgImage)
320 delete layoutImgRenderer;
321 }
322
323 if (scrollIdleId != -1)
325 if (resizeIdleId != -1)
327 if (bgColor)
328 bgColor->unref ();
329 if (bgImage)
330 bgImage->unref ();
331 if (topLevel) {
333 Widget *w = topLevel;
334 topLevel = NULL;
335 delete w;
336 }
337
338 delete queueResizeList;
339 delete platform;
340 delete view;
341 delete anchorsTable;
342 delete textZone;
343
344 if (requestedAnchor)
345 free (requestedAnchor);
346
348}
349
351{
352 // Called form ~Layout. Sometimes, the widgets (not only the toplevel widget)
353 // do some stuff after the layout has been deleted, so *all* widgets have to
354 // be detached, and check "layout != NULL" at relevant points.
355
356 // Could be replaced by a virtual method in Widget, like getWidgetAtPoint,
357 // if performace were really a problem.
358
359 widget->layout = NULL;
360 Iterator *it =
361 widget->iterator ((Content::Type)
363 false);
364 while (it->next ())
366
367 it->unref ();
368}
369
371{
372 if (topLevel) {
373 MSG_WARN("widget already set\n");
374 return;
375 }
376
377 // The toplevel widget always establishes a stacking context. It could
378 // already be set in Widget::setStyle().
379 if (widget->stackingContextMgr == NULL && IMPL_POS) {
380 widget->stackingContextMgr = new StackingContextMgr (widget);
381 DBG_OBJ_ASSOC (widget, widget->stackingContextMgr);
382 widget->stackingContextWidget = widget;
383 }
384
385 topLevel = widget;
386 widget->layout = this;
387 widget->container = NULL;
388 DBG_OBJ_SET_PTR_O (widget, "container", widget->container);
389
390 queueResizeList->clear ();
391 widget->notifySetAsTopLevel ();
392
393 findtextState.setWidget (widget);
394
395 canvasHeightGreater = false;
396 DBG_OBJ_SET_SYM ("canvasHeightGreater",
397 canvasHeightGreater ? "true" : "false");
398
399 // Do not directly call Layout::queueResize(), but
400 // Widget::queueResize(), so that all flags are set properly,
401 // queueResizeList is filled, etc.
402 topLevel->queueResize (-1, false);
403}
404
431
433{
434 DBG_OBJ_ASSOC_CHILD (widget);
435
436 widgetAtPoint = NULL;
437 if (topLevel) {
438 Widget *w = topLevel;
439 topLevel = NULL;
440 delete w;
441 }
442 textZone->zoneFree ();
443 addWidget (widget);
444
445 updateCursor ();
446
447 /* Reset the resizeCounter when we change the top level widget, as we are
448 * changing to another page */
449 resizeCounter = 0;
450}
451
459{
460 if (this->view)
461 MSG_ERR("attachView: Multiple views for layout!\n");
462
464
465 this->view = view;
467
468 /*
469 * The layout of the view is set later, first, we "project" the current
470 * state of the layout into the new view. A view must handle this without
471 * a layout. See also at the end of this function.
472 */
473 if (bgColor)
477
478 if (view->usesViewport ()) {
479 if (usesViewport) {
487 }
488 else {
489 usesViewport = true;
490 scrollX = scrollY = 0;
491 viewportWidth = viewportHeight = 100; // random values
494 }
495
496 DBG_OBJ_SET_NUM ("viewportWidth", viewportWidth);
497 DBG_OBJ_SET_NUM ("viewportHeight", viewportHeight);
498 DBG_OBJ_SET_NUM ("hScrollbarThickness", hScrollbarThickness);
499 DBG_OBJ_SET_NUM ("vScrollbarThickness", vScrollbarThickness);
500 }
501
502 /*
503 * This is the last call within this function, so that it is safe for
504 * the implementation of dw::core::View::setLayout, to call methods
505 * of dw::core::Layout.
506 */
507 view->setLayout (this);
508}
509
511{
512 if (this->view != view) {
513 MSG_ERR("detachView: this->view: %p view %p\n",
514 (void *) this->view, (void *) view);
515 }
516
517 view->setLayout (NULL);
519 this->view = NULL;
526}
527
529{
530 if (view->usesViewport ())
531 view->scroll(cmd);
532}
533
539 int x, int y, int width, int height)
540{
541 scrollTo0 (hpos, vpos, x, y, width, height, true);
542}
543
545 int x, int y, int width, int height,
546 bool scrollingInterrupted)
547{
548 if (usesViewport) {
549 _MSG("scrollTo (%d, %d, %s)\n",
550 x, y, scrollingInterrupted ? "true" : "false");
551
552 scrollTargetHpos = hpos;
553 scrollTargetVpos = vpos;
554 scrollTargetX = x;
555 scrollTargetY = y;
556 scrollTargetWidth = width;
557 scrollTargetHeight = height;
558
559 if (scrollIdleId == -1) {
562 }
563
565 scrollIdleNotInterrupted || !scrollingInterrupted;
566 }
567}
568
570{
571 bool xChanged = true;
572 switch (scrollTargetHpos) {
573 case HPOS_LEFT:
575 break;
576 case HPOS_CENTER:
577 scrollX =
580 break;
581 case HPOS_RIGHT:
582 scrollX =
585 break;
586 case HPOS_INTO_VIEW:
589 break;
590 case HPOS_NO_CHANGE:
591 xChanged = false;
592 break;
593 }
594
595 bool yChanged = true;
596 switch (scrollTargetVpos) {
597 case VPOS_TOP:
599 break;
600 case VPOS_CENTER:
601 scrollY =
604 break;
605 case VPOS_BOTTOM:
606 scrollY =
609 break;
610 case VPOS_INTO_VIEW:
613 break;
614 case VPOS_NO_CHANGE:
615 yChanged = false;
616 break;
617 }
618
619 if (xChanged || yChanged) {
622 if (drawAfterScrollReq) {
623 drawAfterScrollReq = false;
625 }
626 }
627
628 scrollIdleId = -1;
629}
630
632{
636
640
641 _MSG("adjustScrollPos: scrollX=%d scrollY=%d\n", scrollX, scrollY);
642}
643
644bool Layout::calcScrollInto (int requestedValue, int requestedSize,
645 int *value, int viewportSize)
646{
647 if (requestedSize > viewportSize) {
648 // The viewport size is smaller than the size of the region which will
649 // be shown. If the region is already visible, do not change the
650 // position. Otherwise, show the left/upper border, this is most likely
651 // what is needed.
652 if (*value >= requestedValue &&
653 *value + viewportSize < requestedValue + requestedSize)
654 return false;
655 else
656 requestedSize = viewportSize;
657 }
658
659 if (requestedValue < *value) {
660 *value = requestedValue;
661 return true;
662 } else if (requestedValue + requestedSize > *value + viewportSize) {
663 *value = requestedValue - viewportSize + requestedSize;
664 return true;
665 } else
666 return false;
667}
668
670{
671 DBG_OBJ_ENTER ("draw", 0, "draw", "%d, %d, %d * %d",
672 area->x, area->y, area->width, area->height);
673
674 Rectangle widgetArea, intersection, widgetDrawArea;
675
676 // First of all, draw background image. (Unlike background *color*,
677 // this is not a feature of the views.)
678 if (bgImage != NULL && bgImage->getImgbufSrc() != NULL)
681 area->x, area->y, area->width,
682 area->height, 0, 0,
683 // Reference area: maximum of canvas size and
684 // viewport size.
692
693 if (scrollIdleId != -1) {
694 /* scroll is pending, defer draw until after scrollIdle() */
695 drawAfterScrollReq = true;
696
697 } else if (topLevel) {
698 /* Draw the top level widget. */
699 widgetArea.x = topLevel->allocation.x;
700 widgetArea.y = topLevel->allocation.y;
701 widgetArea.width = topLevel->allocation.width;
702 widgetArea.height = topLevel->getHeight ();
703
704 if (area->intersectsWith (&widgetArea, &intersection)) {
705 view->startDrawing (&intersection);
706
707 /* Intersection in widget coordinates. */
708 widgetDrawArea.x = intersection.x - topLevel->allocation.x;
709 widgetDrawArea.y = intersection.y - topLevel->allocation.y;
710 widgetDrawArea.width = intersection.width;
711 widgetDrawArea.height = intersection.height;
712
713 DrawingContext context (&widgetArea);
714 topLevel->draw (view, &widgetDrawArea, &context);
715
716 view->finishDrawing (&intersection);
717 }
718 }
719
720 DBG_OBJ_LEAVE ();
721}
722
727
733
737void Layout::setAnchor (const char *anchor)
738{
739 _MSG("setAnchor (%s)\n", anchor);
740
741 if (requestedAnchor)
742 free (requestedAnchor);
743 requestedAnchor = anchor ? dStrdup (anchor) : NULL;
744 updateAnchor ();
745}
746
750char *Layout::addAnchor (Widget *widget, const char* name)
751{
752 return addAnchor (widget, name, -1);
753}
754
755char *Layout::addAnchor (Widget *widget, const char* name, int y)
756{
757 String key (name);
758 if (anchorsTable->contains (&key))
759 return NULL;
760 else {
761 Anchor *anchor = new Anchor ();
762 anchor->name = dStrdup (name);
763 anchor->widget = widget;
764 anchor->y = y;
765
766 anchorsTable->put (new String (name), anchor);
767 updateAnchor ();
768
769 return anchor->name;
770 }
771}
772
773void Layout::changeAnchor (Widget *widget, char* name, int y)
774{
775 String key (name);
776 Anchor *anchor = anchorsTable->get (&key);
777 assert (anchor);
778 assert (anchor->widget == widget);
779 anchor->y = y;
780 updateAnchor ();
781}
782
783void Layout::removeAnchor (Widget *widget, char* name)
784{
785 String key (name);
786 anchorsTable->remove (&key);
787}
788
790{
791 Anchor *anchor;
792 if (requestedAnchor) {
794 anchor = anchorsTable->get (&key);
795 } else
796 anchor = NULL;
797
798 if (anchor == NULL) {
802 scrollIdleId = -1;
803 }
804 } else
805 if (anchor->y != -1)
806 scrollTo0 (HPOS_NO_CHANGE, VPOS_TOP, 0, anchor->y, 0, 0, false);
807}
808
810{
811 if (cursor != this->cursor) {
812 this->cursor = cursor;
814 }
815}
816
824
826{
827 color->ref ();
828
829 if (bgColor)
830 bgColor->unref ();
831
832 bgColor = color;
833
834 if (view)
836}
837
842{
843 if (layoutImgRenderer && this->bgImage)
845
846 if (bgImage)
847 bgImage->ref ();
848
849 if (this->bgImage)
850 this->bgImage->unref ();
851
852 this->bgImage = bgImage;
853 this->bgRepeat = bgRepeat;
854 this->bgAttachment = bgAttachment;
855 this->bgPositionX = bgPositionX;
856 this->bgPositionY = bgPositionY;
857
858 if (bgImage) {
859 // Create instance of LayoutImgRenderer when needed. Until this
860 // layout is deleted, "layoutImgRenderer" will be kept, since it
861 // is not specific to the style, but only to this layout.
862 if (layoutImgRenderer == NULL)
865 }
866}
867
868
870{
871 DBG_OBJ_ENTER0 ("resize", 0, "resizeIdle");
872
874
875 // There are two commits, 2863:b749629fbfc9 and 4645:ab70f9ce4353, the second
876 // reverting the former. Interrestingly, the second fixes a bug. However, it
877 // should still examined what happens here, and what happens the other calls
878 // to Layout::resizeIdle() which should be still in the queue. (See
879 // Layout::queueResize(), where resizeIdleId is indeed checked.)
880
881 for (int i = 0; resizeIdleId != -1; i++) {
882
883 /* Prevent infinite resize loop, if we reach this point it is very likely
884 * there is a bug in the layouting process */
885 if (resizeCounter >= 1000) {
886 MSG_ERR("Emergency layout stop after %d iterations\n", resizeCounter);
887 MSG_ERR("Please file a bug report with the complete console output\n");
888 resizeIdleId = -1;
889 break;
890 }
891
892 /* Only allow 100 iterations before returning to redraw the screen. */
893 if (i >= 100) {
894 MSG_WARN("Stopping layout loop after %d iterations\n", resizeCounter);
895 break;
896 }
897
899
900 for (typed::Iterator <Widget> it = queueResizeList->iterator();
901 it.hasNext (); ) {
902 Widget *widget = it.getNext ();
903
904 if (widget->resizeQueued ()) {
907 }
908
909 if (widget->allocateQueued ()) {
912 }
913
914 if (widget->extremesQueued ()) {
917 }
918 }
919 queueResizeList->clear ();
920
921 // Reset here, since below, queueResize() may be called again.
922 resizeIdleId = -1;
923
924 // If this method is triggered by a viewport change, we can save
925 // time when the toplevel widget is not affected (as for a toplevel
926 // image resource).
927 if (topLevel &&
929 Requisition requisition;
930 Allocation allocation;
931
932 topLevel->sizeRequest (&requisition);
933 DBG_OBJ_MSGF ("resize", 1, "toplevel size: %d * (%d + %d)",
934 requisition.width, requisition.ascent,
935 requisition.descent);
936
937 // This method is triggered by Widget::queueResize, which will,
938 // in any case, set NEEDS_ALLOCATE (indirectly, as ALLOCATE_QUEUED).
939 // This assertion helps to find inconsistencies. (Cases where
940 // this method is triggered by a viewport change, but the
941 // toplevel widget is not affected, are filtered out some lines
942 // above: "if (topLevel && topLevel->needsResize ())".)
943 assert (topLevel->needsAllocate ());
944
945 allocation.x = allocation.y = 0;
947 allocation.x += currVScrollbarThickness();
948 allocation.width = requisition.width;
949 allocation.ascent = requisition.ascent;
950 allocation.descent = requisition.descent;
951 topLevel->sizeAllocate (&allocation);
952
953 canvasWidth = requisition.width;
954 canvasAscent = requisition.ascent;
955 canvasDescent = requisition.descent;
958 // Tell the view about the new world size.
960
961 if (usesViewport) {
962 int currHThickness = currHScrollbarThickness();
963 int currVThickness = currVScrollbarThickness();
964
965 if (!canvasHeightGreater &&
966 canvasAscent + canvasDescent > viewportHeight - currHThickness) {
967 canvasHeightGreater = true;
968 DBG_OBJ_SET_SYM ("canvasHeightGreater",
969 canvasHeightGreater ? "true" : "false");
971 }
972
973 // Set viewport sizes.
975 currHThickness, currVThickness);
976 }
977
978 // views are redrawn via Widget::resizeDrawImpl ()
979 }
980 }
981 updateAnchor ();
982
983 DBG_OBJ_MSGF ("resize", 1,
984 "after resizeIdle: resizeIdleId = %d", resizeIdleId);
985 DBG_OBJ_LEAVE ();
986
988}
989
990void Layout::queueDraw (int x, int y, int width, int height)
991{
992 Rectangle area;
993 area.x = x;
994 area.y = y;
995 area.width = width;
996 area.height = height;
997
998 if (area.isEmpty ()) return;
999
1000 view->queueDraw (&area);
1001}
1002
1003void Layout::queueDrawExcept (int x, int y, int width, int height,
1004 int ex, int ey, int ewidth, int eheight) {
1005
1006 if (x == ex && y == ey && width == ewidth && height == eheight)
1007 return;
1008
1009 // queueDraw() the four rectangles within rectangle (x, y, width, height)
1010 // around rectangle (ex, ey, ewidth, eheight).
1011 // Some or all of these may be empty.
1012
1013 // upper left corner of the intersection rectangle
1014 int ix1 = misc::max (x, ex);
1015 int iy1 = misc::max (y, ey);
1016 // lower right corner of the intersection rectangle
1017 int ix2 = misc::min (x + width, ex + ewidth);
1018 int iy2 = misc::min (y + height, ey + eheight);
1019
1020 queueDraw (x, y, width, iy1 - y);
1021 queueDraw (x, iy2, width, y + height - iy2);
1022 queueDraw (x, iy1, ix1 - x, iy2 - iy1);
1023 queueDraw (ix2, iy1, x + width - ix2, iy2 - iy1);
1024}
1025
1026void Layout::queueResize (bool extremesChanged)
1027{
1028 DBG_OBJ_ENTER ("resize", 0, "queueResize", "%s",
1029 extremesChanged ? "true" : "false");
1030
1031 if (resizeIdleId == -1) {
1033
1035 DBG_OBJ_MSGF ("resize", 1, "setting resizeIdleId = %d", resizeIdleId);
1036 }
1037
1038 emitter.emitResizeQueued (extremesChanged);
1039
1040 DBG_OBJ_LEAVE ();
1041}
1042
1043
1044// Views
1045
1046bool Layout::buttonEvent (ButtonEventType type, View *view, int numPressed,
1047 int x, int y, ButtonState state, int button)
1048
1049{
1050 EventButton event;
1051
1052 moveToWidgetAtPoint (x, y, state);
1053
1054 event.xCanvas = x;
1055 event.yCanvas = y;
1056 event.state = state;
1057 event.button = button;
1058 event.numPressed = numPressed;
1059
1060 return processMouseEvent (&event, type);
1061}
1062
1069bool Layout::motionNotify (View *view, int x, int y, ButtonState state)
1070{
1071 EventButton event;
1072
1073 moveToWidgetAtPoint (x, y, state);
1074
1075 event.xCanvas = x;
1076 event.yCanvas = y;
1077 event.state = state;
1078
1079 return processMouseEvent (&event, MOTION_NOTIFY);
1080}
1081
1087void Layout::enterNotify (View *view, int x, int y, ButtonState state)
1088{
1089 Widget *lastWidget;
1090 EventCrossing event;
1091
1092 lastWidget = widgetAtPoint;
1093 moveToWidgetAtPoint (x, y, state);
1094
1095 if (widgetAtPoint) {
1096 event.state = state;
1097 event.lastWidget = lastWidget;
1098 event.currentWidget = widgetAtPoint;
1099 widgetAtPoint->enterNotify (&event);
1100 }
1101}
1102
1109{
1110#if 0
1111 Widget *lastWidget;
1112 EventCrossing event;
1113
1114 lastWidget = widgetAtPoint;
1115 moveOutOfView (state);
1116
1117 if (lastWidget) {
1118 event.state = state;
1119 event.lastWidget = lastWidget;
1120 event.currentWidget = widgetAtPoint;
1121 lastWidget->leaveNotify (&event);
1122 }
1123#else
1124 moveOutOfView (state);
1125#endif
1126}
1127
1128/*
1129 * Return the widget at position (x, y). Return NULL, if there is no widget.
1130 */
1132{
1133 DBG_OBJ_ENTER ("events", 0, "getWidgetAtPoint", "%d, %d", x, y);
1134 Widget *widget;
1135
1136 if (topLevel && topLevel->wasAllocated ()) {
1138 widget = topLevel->getWidgetAtPoint (x, y, &context);
1139 } else
1140 widget = NULL;
1141
1142 DBG_OBJ_MSGF ("events", 0, "=> %p", widget);
1143 DBG_OBJ_LEAVE ();
1144 return widget;
1145}
1146
1147
1148/*
1149 * Emit the necessary crossing events, when the mouse pointer has moved to
1150 * the given widget (by mouse or scrolling).
1151 */
1152void Layout::moveToWidget (Widget *newWidgetAtPoint, ButtonState state)
1153{
1154 DBG_OBJ_ENTER ("events", 0, "moveToWidget", "%p, %d",
1155 newWidgetAtPoint, state);
1156
1157 Widget *ancestor, *w;
1158 Widget **track;
1159 int trackLen, i, i_a;
1160 EventCrossing crossingEvent;
1161
1162 DBG_OBJ_MSGF ("events", 1, "(old) widgetAtPoint = %p", widgetAtPoint);
1163
1164 if (newWidgetAtPoint != widgetAtPoint) {
1165 // The mouse pointer has been moved into another widget.
1166 if (newWidgetAtPoint && widgetAtPoint)
1167 ancestor =
1168 newWidgetAtPoint->getNearestCommonAncestor (widgetAtPoint);
1169 else if (newWidgetAtPoint)
1170 ancestor = newWidgetAtPoint->getTopLevel ();
1171 else
1172 ancestor = widgetAtPoint->getTopLevel ();
1173
1174 // Construct the track.
1175 trackLen = 0;
1176 if (widgetAtPoint)
1177 // first part
1178 for (w = widgetAtPoint; w != ancestor; w = w->getParent ())
1179 trackLen++;
1180 trackLen++; // for the ancestor
1181 if (newWidgetAtPoint)
1182 // second part
1183 for (w = newWidgetAtPoint; w != ancestor; w = w->getParent ())
1184 trackLen++;
1185
1186 track = new Widget* [trackLen];
1187 i = 0;
1188 if (widgetAtPoint)
1189 /* first part */
1190 for (w = widgetAtPoint; w != ancestor; w = w->getParent ())
1191 track[i++] = w;
1192 i_a = i;
1193 track[i++] = ancestor;
1194 if (newWidgetAtPoint) {
1195 /* second part */
1196 i = trackLen - 1;
1197 for (w = newWidgetAtPoint; w != ancestor; w = w->getParent ())
1198 track[i--] = w;
1199 }
1200#if 0
1201 MSG("Track: %s[ ", widgetAtPoint ? "" : "nil ");
1202 for (i = 0; i < trackLen; i++)
1203 MSG("%s%p ", i == i_a ? ">" : "", track[i]);
1204 MSG("] %s\n", newWidgetAtPoint ? "" : "nil");
1205#endif
1206
1207 /* Send events to the widgets on the track */
1208 for (i = 0; i < trackLen; i++) {
1209 crossingEvent.state = state;
1210 crossingEvent.currentWidget = widgetAtPoint; // ???
1211 crossingEvent.lastWidget = widgetAtPoint; // ???
1212 if (i < i_a) {
1213 track[i]->leaveNotify (&crossingEvent);
1214 } else if (i == i_a) { /* ancestor */
1215 /* Don't touch ancestor unless:
1216 * - moving into/from NULL,
1217 * - ancestor becomes the newWidgetAtPoint */
1218 if (i_a == trackLen-1 && !newWidgetAtPoint)
1219 track[i]->leaveNotify (&crossingEvent);
1220 else if ((i_a == 0 && !widgetAtPoint) ||
1221 (i_a == trackLen-1 && newWidgetAtPoint))
1222 track[i]->enterNotify (&crossingEvent);
1223 } else {
1224 track[i]->enterNotify (&crossingEvent);
1225 }
1226 }
1227
1228 delete[] track;
1229
1230 widgetAtPoint = newWidgetAtPoint;
1231 updateCursor ();
1232 }
1233
1234 DBG_OBJ_LEAVE ();
1235}
1236
1244 ButtonEventType type)
1245{
1246 Widget *widget;
1247
1248 /*
1249 * If the event is outside of the visible region of the canvas, treat it
1250 * as occurring at the region's edge. Notably, this helps when selecting
1251 * text.
1252 */
1253 if (event->xCanvas < scrollX)
1254 event->xCanvas = scrollX;
1255 else {
1256 int maxX = scrollX + viewportWidth - currVScrollbarThickness() - 1;
1257
1258 if (event->xCanvas > maxX)
1259 event->xCanvas = maxX;
1260 }
1261 if (event->yCanvas < scrollY)
1262 event->yCanvas = scrollY;
1263 else {
1266
1267 if (event->yCanvas > maxY)
1268 event->yCanvas = maxY;
1269 }
1270
1271 widget = getWidgetAtPoint(event->xCanvas, event->yCanvas);
1272
1273 for (; widget; widget = widget->getParent ()) {
1274 if (widget->isButtonSensitive ()) {
1275 event->xWidget = event->xCanvas - widget->getAllocation()->x;
1276 event->yWidget = event->yCanvas - widget->getAllocation()->y;
1277
1278 switch (type) {
1279 case BUTTON_PRESS:
1280 return widget->buttonPress ((EventButton*)event);
1281
1282 case BUTTON_RELEASE:
1283 return widget->buttonRelease ((EventButton*)event);
1284
1285 case MOTION_NOTIFY:
1286 return widget->motionNotify ((EventMotion*)event);
1287
1288 default:
1290 }
1291 }
1292 }
1293 if (type == BUTTON_PRESS)
1294 return emitLinkPress (NULL, -1, -1, -1, -1, (EventButton*)event);
1295 else if (type == BUTTON_RELEASE)
1296 return emitLinkRelease(NULL, -1, -1, -1, -1, (EventButton*)event);
1297
1298 return false;
1299}
1300
1301/*
1302 * This function must be called by a view, when the user has manually changed
1303 * the viewport position. It is *not* called, when the layout has requested the
1304 * position change.
1305 */
1307{
1308 if (x != scrollX || y != scrollY) {
1309 scrollX = x;
1310 scrollY = y;
1311
1312 setAnchor (NULL);
1313 updateAnchor ();
1314 }
1315}
1316
1317/*
1318 * This function must be called by a viewport view, when its viewport size has
1319 * changed. It is *not* called, when the layout has requested the size change.
1320 */
1321void Layout::viewportSizeChanged (View *view, int width, int height)
1322{
1323 DBG_OBJ_ENTER ("resize", 0, "viewportSizeChanged", "%p, %d, %d",
1324 view, width, height);
1325
1326 /* If size changes, redraw this view. */
1327 if (viewportWidth != width || viewportHeight != height) {
1328 canvasHeightGreater = false; // reset value here
1329 viewportWidth = width;
1330 viewportHeight = height;
1332
1333 DBG_OBJ_SET_SYM ("canvasHeightGreater",
1334 canvasHeightGreater ? "true" : "false");
1335 DBG_OBJ_SET_NUM ("viewportWidth", viewportWidth);
1336 DBG_OBJ_SET_NUM ("viewportHeight", viewportHeight);
1337 }
1338
1339 DBG_OBJ_LEAVE ();
1340}
1341
1343{
1344 DBG_OBJ_ENTER0 ("resize", 0, "containerSizeChanged");
1345
1346 if (topLevel) {
1348 queueResize (true);
1349 }
1350
1351 DBG_OBJ_LEAVE ();
1352}
1353
1354} // namespace core
1355} // 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:55
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:106
void emitResizeQueued(bool extremesChanged)
Definition layout.cc:130
void emitCanvasSizeChanged(int width, int ascent, int descent)
Definition layout.cc:137
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:89
void getBgArea(int *x, int *y, int *width, int *height)
Return the area covered by the background image.
Definition layout.cc:42
style::BackgroundRepeat getBackgroundRepeat()
Definition layout.cc:68
style::BackgroundAttachment getBackgroundAttachment()
Definition layout.cc:74
void getRefArea(int *xRef, int *yRef, int *widthRef, int *heightRef)
Return the "reference area".
Definition layout.cc:49
style::Length getBackgroundPositionX()
Definition layout.cc:79
style::Length getBackgroundPositionY()
Definition layout.cc:84
style::StyleImage * getBackgroundImage()
Definition layout.cc:63
bool readyToDraw()
If this method returns false, nothing is done at all.
Definition layout.cc:37
bool emitEnter(Widget *widget, int link, int img, int x, int y)
Definition layout.cc:217
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:173
bool emitPress(Widget *widget, int link, int img, int x, int y, EventButton *event)
Definition layout.cc:225
bool emitRelease(Widget *widget, int link, int img, int x, int y, EventButton *event)
Definition layout.cc:233
bool emitClick(Widget *widget, int link, int img, int x, int y, EventButton *event)
Definition layout.cc:241
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:165
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:153
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:159
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:147
Receiver interface different signals.
Definition layout.hh:48
virtual void resizeQueued(bool extremesChanged)
Definition layout.cc:96
virtual void canvasSizeChanged(int width, int ascent, int descent)
Definition layout.cc:100
void attachView(View *view)
Attach a view to the layout.
Definition layout.cc:458
lout::misc::ZoneAllocator * textZone
Definition layout.hh:276
void changeAnchor(Widget *widget, char *name, int y)
Definition layout.cc:773
void detachWidget(Widget *widget)
Definition layout.cc:350
int currHScrollbarThickness()
Definition layout.cc:723
style::Cursor cursor
Definition layout.hh:167
void updateAnchor()
Definition layout.cc:789
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:809
void scrollIdle()
Definition layout.cc:569
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:1087
void queueDraw(int x, int y, int width, int height)
Definition layout.cc:990
bool scrollIdleNotInterrupted
Definition layout.hh:181
Widget * getWidgetAtPoint(int x, int y)
Definition layout.cc:1131
int scrollTargetWidth
Definition layout.hh:177
void containerSizeChanged()
Definition layout.cc:1342
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:1069
bool drawAfterScrollReq
Definition layout.hh:170
void setWidget(Widget *widget)
Definition layout.cc:432
bool processMouseEvent(MousePositionEvent *event, ButtonEventType type)
Common processing of press, release and motion events.
Definition layout.cc:1243
style::StyleImage * bgImage
Definition layout.hh:162
void setBgColor(style::Color *color)
Definition layout.cc:825
void detachView(View *view)
Definition layout.cc:510
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:750
void leaveNotify(View *view, ButtonState state)
This function is called by a view, to delegate a leave notify event.
Definition layout.cc:1108
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:1003
VPosition scrollTargetVpos
Definition layout.hh:176
void viewportSizeChanged(View *view, int width, int height)
Definition layout.cc:1321
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:370
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:1046
SelectionState selectionState
Definition layout.hh:187
void updateCursor()
Definition layout.cc:817
void resizeIdle()
Definition layout.cc:869
void draw(View *view, Rectangle *area)
Definition layout.cc:669
void moveToWidget(Widget *newWidgetAtPoint, ButtonState state)
Definition layout.cc:1152
void setBgImage(style::StyleImage *bgImage, style::BackgroundRepeat bgRepeat, style::BackgroundAttachment bgAttachment, style::Length bgPositionX, style::Length bgPositionY)
Definition layout.cc:838
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:631
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:544
Widget * widgetAtPoint
Definition layout.hh:157
void removeWidget()
Definition layout.cc:405
int getExtremesCounter
Definition layout.hh:249
Widget * topLevel
Definition layout.hh:157
void removeAnchor(Widget *widget, char *name)
Definition layout.cc:783
style::BackgroundAttachment bgAttachment
Definition layout.hh:164
static bool calcScrollInto(int targetValue, int requestedSize, int *value, int viewportSize)
Definition layout.cc:644
int scrollTargetHeight
Definition layout.hh:177
void scrollPosChanged(View *view, int x, int y)
Definition layout.cc:1306
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:538
void scroll(ScrollCommand)
Definition layout.cc:528
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:728
Emitter emitter
Definition layout.hh:143
Layout(Platform *platform)
Definition layout.cc:258
void setAnchor(const char *anchor)
Sets the anchor to scroll to.
Definition layout.cc:737
bool canvasHeightGreater
Definition layout.hh:172
void queueResize(bool extremesChanged)
Definition layout.cc:1026
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 int getScrollbarOnLeft()=0
virtual void scroll(ScrollCommand)
Scroll the viewport as commanded.
Definition view.hh:87
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:44
Allocation * getAllocation()
Definition widget.hh:484
void sizeAllocate(Allocation *allocation)
Wrapper for Widget::sizeAllocateImpl, calls the latter only when needed.
Definition widget.cc:1209
bool motionNotify(EventMotion *event)
Definition widget.cc:1294
Layout * layout
Definition widget.hh:216
Widget * container
The containing widget, equivalent to the "containing block" defined by CSS.
Definition widget.hh:146
Allocation allocation
The current allocation: size and position, always relative to the canvas.
Definition widget.hh:204
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:76
@ EXTREMES_CHANGED
Set, when dw::core::Widget::extremes is not up to date anymore.
Definition widget.hh:89
@ NEEDS_RESIZE
Set, when dw::core::Widget::requisition is not up to date anymore.
Definition widget.hh:65
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:550
Widget * getParent()
Definition widget.hh:587
void enterNotify(EventCrossing *event)
Definition widget.cc:1299
bool needsAllocate()
Definition widget.hh:472
bool resizeQueued()
Definition widget.hh:469
bool buttonRelease(EventButton *event)
Definition widget.cc:1289
Widget * stackingContextWidget
The bottom-most ancestor (or this) for which stackingContextMgr is set.
Definition widget.hh:238
virtual void notifySetAsTopLevel()
This method is called after a widget has been set as the top of a widget tree.
Definition widget.cc:2179
StackingContextMgr * stackingContextMgr
Set iff this widget constitutes a stacking context, as defined by CSS.
Definition widget.hh:232
bool isButtonSensitive()
Definition widget.hh:585
Widget * getNearestCommonAncestor(Widget *otherWidget)
Get the widget with the highest level, which is a direct ancestor of widget1 and widget2.
Definition widget.cc:1629
bool extremesQueued()
Definition widget.hh:470
bool needsResize()
Definition widget.hh:471
virtual Widget * getWidgetAtPoint(int x, int y, GettingWidgetAtPointContext *context)
Definition widget.cc:223
void leaveNotify(EventCrossing *event)
Definition widget.cc:1304
style::Style * style
Definition widget.hh:150
void containerSizeChanged()
Definition widget.cc:420
void unsetFlags(Flags f)
Definition widget.hh:301
void queueResize(int ref, bool extremesChanged, bool fast)
This method should be called, when a widget changes its size.
Definition widget.cc:321
bool buttonPress(EventButton *event)
Definition widget.cc:1284
Widget * getTopLevel()
Get the widget at the root of the tree, this widget is part from.
Definition widget.cc:1578
bool wasAllocated()
Definition widget.hh:475
bool allocateQueued()
Definition widget.hh:473
void setFlags(Flags f)
Definition widget.hh:299
void putExternalImgRenderer(ImgRenderer *ir)
Add an additional ImgRenderer, especially used for drawing.
Definition style.hh:892
void removeExternalImgRenderer(ImgRenderer *ir)
Remove a previously added additional ImgRenderer.
Definition style.hh:898
Typed version of container::untyped::Vector.
Definition container.hh:447
A simple allocator optimized to handle many small chunks of memory.
Definition misc.hh:631
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)
char * dStrdup(const char *s)
Definition dlib.c:77
#define MSG_ERR(...)
Definition dpid_common.h:23
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:1286
int Length
Type for representing all lengths within dw::core::style.
Definition style.hh:429
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:40
T max(T a, T b)
Definition misc.hh:41
void assertNotReached()
Definition misc.hh:56
Here, some common classes (or interfaces) are defined, to standardize the access to other classes.
Definition object.cc:30
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