Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
fltkviewbase.cc
Go to the documentation of this file.
1/*
2 * Dillo Widget
3 *
4 * Copyright 2005-2007 Sebastian Geerken <sgeerken@dillo.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20
21
22#include "fltkviewport.hh"
23
24#include <FL/Fl.H>
25#include <FL/fl_draw.H>
26
27#include <stdio.h>
28#include "../lout/msg.h"
29
30using namespace lout::object;
31using namespace lout::container::typed;
32
33namespace dw {
34namespace fltk {
35
37{
38 w = 0;
39 h = 0;
40 created = false;
41}
42
44{
45 if (created)
46 fl_delete_offscreen (offscreen);
47}
48
50{
51 if (!created || w > this->w || h > this->h) {
52 this->w = w;
53 this->h = h;
54 if (created)
55 fl_delete_offscreen (offscreen);
56 offscreen = fl_create_offscreen (w, h);
57 created = true;
58 }
59}
60
63
64FltkViewBase::FltkViewBase (int x, int y, int w, int h, const char *label):
65 Fl_Group (x, y, w, h, label)
66{
67 Fl_Group::current(0);
68 canvasWidth = 1;
69 canvasHeight = 1;
70 bgColor = FL_WHITE;
71 mouse_x = mouse_y = 0;
72 focused_child = NULL;
73 exposeArea = NULL;
74 if (backBuffer == NULL) {
75 backBuffer = new BackBuffer ();
76 }
77 box(FL_NO_BOX);
78 resizable(NULL);
79}
80
85
87 if (b && backBuffer == NULL) {
88 backBuffer = new BackBuffer ();
89 } else if (!b && backBuffer != NULL) {
90 delete backBuffer;
91 backBuffer = NULL;
92 }
93}
94
96{
97 int d = damage ();
98
99 if ((d & FL_DAMAGE_USER1) && !(d & FL_DAMAGE_EXPOSE)) {
100 lout::container::typed::Iterator <core::Rectangle> it;
101
102 for (it = drawRegion.rectangles (); it.hasNext (); ) {
103 draw (it.getNext (), DRAW_BUFFERED);
104 }
105
106 drawRegion.clear ();
107 d &= ~FL_DAMAGE_USER1;
108 }
109
110 if (d & FL_DAMAGE_CHILD) {
112 d &= ~FL_DAMAGE_CHILD;
113 }
114
115 if (d) {
119 w (),
120 h ());
121
122 if (d == FL_DAMAGE_SCROLL) {
123 // a clipping rectangle has already been set by fltk::scrollrect ()
124 draw (&rect, DRAW_PLAIN);
125 } else {
126 draw (&rect, DRAW_CLIPPED);
127 drawRegion.clear ();
128 }
129 }
130}
131
133 DrawType type)
134{
135 int X = translateCanvasXToViewX (rect->x);
136 int Y = translateCanvasYToViewY (rect->y);
137 int W, H;
138
139 // fl_clip_box() can't handle values greater than SHRT_MAX!
140 if (X > x () + w () || Y > y () + h ())
141 return;
142
143 W = X + rect->width > x () + w () ? x () + w () - X : rect->width;
144 H = Y + rect->height > y () + h () ? y () + h () - Y : rect->height;
145
146 fl_clip_box(X, Y, W, H, X, Y, W, H);
147
149 translateViewYToCanvasY (Y), W, H);
150
151 if (r.isEmpty ())
152 return;
153
154 exposeArea = &r;
155
156 if (type == DRAW_BUFFERED && backBuffer && !backBufferInUse) {
157 backBufferInUse = true;
158 backBuffer->setSize (X + W, Y + H); // would be nicer to use (W, H)...
159 fl_begin_offscreen (backBuffer->offscreen);
160 fl_push_matrix ();
161 fl_color (bgColor);
162 fl_rectf (X, Y, W, H);
163 theLayout->expose (this, &r);
164 fl_pop_matrix ();
165 fl_end_offscreen ();
166 fl_copy_offscreen (X, Y, W, H, backBuffer->offscreen, X, Y);
167 backBufferInUse = false;
168 } else if (type == DRAW_BUFFERED || type == DRAW_CLIPPED) {
169 // if type == DRAW_BUFFERED but we do not have backBuffer available
170 // we fall back to clipped drawing
171 fl_push_clip (X, Y, W, H);
172 fl_color (bgColor);
173 fl_rectf (X, Y, W, H);
174 theLayout->expose (this, &r);
175 fl_pop_clip ();
176 } else {
177 fl_color (bgColor);
178 fl_rectf (X, Y, W, H);
179 theLayout->expose (this, &r);
180 }
181 // DEBUG:
182 //fl_color(FL_RED);
183 //fl_rect(X, Y, W, H);
184
185 exposeArea = NULL;
186}
187
189 for (int i = children () - 1; i >= 0; i--) {
190 Fl_Widget& w = *child(i);
191#if 0
192PORT1.3
193 if (w.damage() & DAMAGE_CHILD_LABEL) {
194 draw_outside_label(w);
195 w.set_damage(w.damage() & ~DAMAGE_CHILD_LABEL);
196 }
197#endif
198 update_child(w);
199 }
200}
201
203{
204 int s1 = Fl::event_state ();
205 int s2 = (core::ButtonState)0;
206
207 if (s1 & FL_SHIFT) s2 |= core::SHIFT_MASK;
208 if (s1 & FL_CTRL) s2 |= core::CONTROL_MASK;
209 if (s1 & FL_ALT) s2 |= core::META_MASK;
210 if (s1 & FL_BUTTON1) s2 |= core::BUTTON1_MASK;
211 if (s1 & FL_BUTTON2) s2 |= core::BUTTON2_MASK;
212 if (s1 & FL_BUTTON3) s2 |= core::BUTTON3_MASK;
213
214 return (core::ButtonState)s2;
215}
216
217/*
218 * We handle Tab to determine which FLTK widget should get focus.
219 *
220 * Presumably a proper solution that allows focusing links, etc., would live
221 * in Textblock and use iterators.
222 */
224{
225 int i, ret = 0;
226 Fl_Widget *old_child = NULL;
227
228 if (this == Fl::focus()) {
229 // if we have focus, give it to a child. Go forward typically,
230 // or backward with Shift pressed.
231 if (!(Fl::event_state() & FL_SHIFT)) {
232 for (i = 0; i < children(); i++) {
233 if (child(i)->take_focus()) {
234 ret = 1;
235 break;
236 }
237 }
238 } else {
239 for (i = children() - 1; i >= 0; i--) {
240 if (child(i)->take_focus()) {
241 ret = 1;
242 break;
243 }
244 }
245 }
246 } else {
247 // tabbing between children
248 old_child = Fl::focus();
249
250 if (!(ret = Fl_Group::handle (FL_KEYBOARD))) {
251 // group didn't have any more children to focus.
252 Fl::focus(this);
253 return 1;
254 } else {
255 // which one did it focus? (Note i == children() if not found)
256 i = find(Fl::focus());
257 }
258 }
259 if (ret) {
260 if (i >= 0 && i < children()) {
261 Fl_Widget *c = child(i);
262 int canvasX = translateViewXToCanvasX(c->x()),
263 canvasY = translateViewYToCanvasY(c->y());
264
266 canvasX, canvasY, c->w(), c->h());
267
268 // Draw the children who gained and lost focus. Otherwise a
269 // widget that had been only partly visible still shows its old
270 // appearance in the previously-visible portion.
271 core::Rectangle r(canvasX, canvasY, c->w(), c->h());
272
273 queueDraw(&r);
274
275 if (old_child) {
276 r.x = translateViewXToCanvasX(old_child->x());
277 r.y = translateViewYToCanvasY(old_child->y());
278 r.width = old_child->w();
279 r.height = old_child->h();
280 queueDraw(&r);
281 }
282 }
283 }
284 return ret;
285}
286
287int FltkViewBase::handle (int event)
288{
289 bool processed;
290
296 switch(event) {
297 case FL_PUSH:
298 /* Hide the tooltip */
300
301 processed =
302 theLayout->buttonPress (this, Fl::event_clicks () + 1,
303 translateViewXToCanvasX (Fl::event_x ()),
304 translateViewYToCanvasY (Fl::event_y ()),
305 getDwButtonState (), Fl::event_button ());
306 _MSG("PUSH => %s\n", processed ? "true" : "false");
307 if (processed) {
308 /* pressed dw content; give focus to the view */
309 if (Fl::event_button() != FL_RIGHT_MOUSE)
310 Fl::focus(this);
311 return true;
312 }
313 break;
314 case FL_RELEASE:
315 processed =
316 theLayout->buttonRelease (this, Fl::event_clicks () + 1,
317 translateViewXToCanvasX (Fl::event_x ()),
318 translateViewYToCanvasY (Fl::event_y ()),
319 getDwButtonState (), Fl::event_button ());
320 _MSG("RELEASE => %s\n", processed ? "true" : "false");
321 if (processed)
322 return true;
323 break;
324 case FL_MOVE:
325 mouse_x = Fl::event_x();
326 mouse_y = Fl::event_y();
327 processed =
328 theLayout->motionNotify (this,
332 _MSG("MOVE => %s\n", processed ? "true" : "false");
333 if (processed)
334 return true;
335 break;
336 case FL_DRAG:
337 processed =
338 theLayout->motionNotify (this,
339 translateViewXToCanvasX (Fl::event_x ()),
340 translateViewYToCanvasY (Fl::event_y ()),
342 _MSG("DRAG => %s\n", processed ? "true" : "false");
343 if (processed)
344 return true;
345 break;
346 case FL_ENTER:
347 theLayout->enterNotify (this,
348 translateViewXToCanvasX (Fl::event_x ()),
349 translateViewYToCanvasY (Fl::event_y ()),
351 break;
352 case FL_HIDE:
353 /* WORKAROUND: strangely, the tooltip window is not automatically hidden
354 * with its parent. Here we fake a LEAVE to achieve it. */
355 case FL_LEAVE:
357 break;
358 case FL_FOCUS:
359 if (focused_child && find(focused_child) < children()) {
360 /* strangely, find() == children() if the child is not found */
361 focused_child->take_focus();
362 }
363 return 1;
364 case FL_UNFOCUS:
365 // FLTK delivers UNFOCUS to the previously focused widget
366 if (find(Fl::focus()) < children())
367 focused_child = Fl::focus(); // remember the focused child!
368 else if (Fl::focus() == this)
369 focused_child = NULL; // no focused child this time
370 return 0;
371 case FL_KEYBOARD:
372 if (Fl::event_key() == FL_Tab)
373 return manageTabToFocus();
374 break;
375 default:
376 break;
377 }
378 return Fl_Group::handle (event);
379}
380
381// ----------------------------------------------------------------------
382
389
390void FltkViewBase::setCanvasSize (int width, int ascent, int descent)
391{
392 canvasWidth = width;
393 canvasHeight = ascent + descent;
394}
395
397{
398 static Fl_Cursor mapDwToFltk[] = {
399 FL_CURSOR_CROSS,
400 FL_CURSOR_DEFAULT,
401 FL_CURSOR_HAND,
402 FL_CURSOR_MOVE,
403 FL_CURSOR_WE,
404 FL_CURSOR_NESW,
405 FL_CURSOR_NWSE,
406 FL_CURSOR_NS,
407 FL_CURSOR_NWSE,
408 FL_CURSOR_NESW,
409 FL_CURSOR_NS,
410 FL_CURSOR_WE,
411 FL_CURSOR_INSERT,
412 FL_CURSOR_WAIT,
413 FL_CURSOR_HELP
414 };
415
416 fl_cursor (mapDwToFltk[cursor]);
417}
418
420{
421 bgColor = color ?
423 FL_WHITE;
424}
425
429
433
435{
437 damage (FL_DAMAGE_USER1); // USER1 for buffered draw
438}
439
441{
442 damage (FL_DAMAGE_EXPOSE);
443}
444
448
451 int x, int y)
452{
453}
454
457 int x1, int y1, int x2, int y2)
458{
459 fl_color(((FltkColor*)color)->colors[shading]);
460 // we clip with a large border (5000px), as clipping causes artefacts
461 // with non-solid line styles.
462 // However it's still better than no clipping at all.
463 clipPoint (&x1, &y1, 5000);
464 clipPoint (&x2, &y2, 5000);
465 fl_line (translateCanvasXToViewX (x1),
469}
470
473 core::style::LineType type, int width,
474 int x1, int y1, int x2, int y2)
475{
476 char dashes[3], w, ng, d, gap, len;
477 const int f = 2;
478
479 w = (width == 1) ? 0 : width;
480 if (type == core::style::LINE_DOTTED) {
481 /* customized drawing for dotted lines */
482 len = (x2 == x1) ? y2 - y1 + 1 : (y2 == y1) ? x2 - x1 + 1 : 0;
483 ng = len / f*width;
484 d = len % f*width;
485 gap = ng ? d/ng + (w > 3 ? 2 : 0) : 0;
486 dashes[0] = 1; dashes[1] = f*width-gap; dashes[2] = 0;
487 fl_line_style(FL_DASH + FL_CAP_ROUND, w, dashes);
488
489 /* These formulas also work, but ain't pretty ;)
490 * fl_line_style(FL_DOT + FL_CAP_ROUND, w);
491 * dashes[0] = 1; dashes[1] = 3*width-2; dashes[2] = 0;
492 */
493 } else if (type == core::style::LINE_DASHED) {
494 fl_line_style(FL_DASH + FL_CAP_ROUND, w);
495 }
496
497 fl_color(((FltkColor*)color)->colors[shading]);
498 drawLine (color, shading, x1, y1, x2, y2);
499
500 if (type != core::style::LINE_NORMAL)
501 fl_line_style(FL_SOLID);
502}
503
506 bool filled,
507 int X, int Y, int width, int height)
508{
509 fl_color(((FltkColor*)color)->colors[shading]);
510 if (width < 0) {
511 X += width;
512 width = -width;
513 }
514 if (height < 0) {
515 Y += height;
516 height = -height;
517 }
518
519 int x1 = X;
520 int y1 = Y;
521 int x2 = X + width;
522 int y2 = Y + height;
523
524 // We only support rectangles with line width 1px, so we clip with
525 // a rectangle 1px wider and higher than what we actually expose.
526 // This is only really necessary for non-filled rectangles.
527 clipPoint (&x1, &y1, 1);
528 clipPoint (&x2, &y2, 1);
529
530 x1 = translateCanvasXToViewX (x1);
531 y1 = translateCanvasYToViewY (y1);
532 x2 = translateCanvasXToViewX (x2);
533 y2 = translateCanvasYToViewY (y2);
534
535 if (filled)
536 fl_rectf (x1, y1, x2 - x1, y2 - y1);
537 else
538 fl_rect (x1, y1, x2 - x1, y2 - y1);
539}
540
542 core::style::Color::Shading shading, bool filled,
543 int centerX, int centerY, int width, int height,
544 int angle1, int angle2)
545{
546 fl_color(((FltkColor*)color)->colors[shading]);
547 int x = translateCanvasXToViewX (centerX) - width / 2;
548 int y = translateCanvasYToViewY (centerY) - height / 2;
549
550 fl_arc(x, y, width, height, angle1, angle2);
551 if (filled) {
552 // WORKAROUND: We call both fl_arc and fl_pie due to a FLTK bug
553 // (STR #2703) that was present in 1.3.0.
554 fl_pie(x, y, width, height, angle1, angle2);
555 }
556}
557
560 bool filled, bool convex, core::Point *points,
561 int npoints)
562{
563 if (npoints > 0) {
564 fl_color(((FltkColor*)color)->colors[shading]);
565
566 if (filled) {
567 if (convex)
568 fl_begin_polygon();
569 else
570 fl_begin_complex_polygon();
571 } else
572 fl_begin_loop();
573
574 for (int i = 0; i < npoints; i++) {
575 fl_vertex(translateCanvasXToViewX(points[i].x),
576 translateCanvasYToViewY(points[i].y));
577 }
578 if (filled) {
579 if (convex)
580 fl_end_polygon();
581 else
582 fl_end_complex_polygon();
583 } else
584 fl_end_loop();
585 }
586}
587
588core::View *FltkViewBase::getClippingView (int x, int y, int width, int height)
589{
591 width, height);
592 return this;
593}
594
596{
597 fl_pop_clip ();
598}
599
600// ----------------------------------------------------------------------
601
602FltkWidgetView::FltkWidgetView (int x, int y, int w, int h,
603 const char *label):
604 FltkViewBase (x, y, w, h, label)
605{
606}
607
611
613 core::style::Color *color,
615 int X, int Y, const char *text, int len)
616{
617 //printf ("drawText (..., %d, %d, '", X, Y);
618 //for (int i = 0; i < len; i++)
619 // putchar (text[i]);
620 //printf ("'\n");
621
622 FltkFont *ff = (FltkFont*)font;
623 fl_font(ff->font, ff->size);
624 fl_color(((FltkColor*)color)->colors[shading]);
625
626 if (!font->letterSpacing && !font->fontVariant) {
627 fl_draw(text, len,
629 } else {
630 /* Nonzero letter spacing adjustment, draw each glyph individually */
631 int viewX = translateCanvasXToViewX (X),
632 viewY = translateCanvasYToViewY (Y);
633 int curr = 0, next = 0, nb;
634 char chbuf[4];
635 int c, cu, width;
636
638 int sc_fontsize = lout::misc::roundInt(ff->size * 0.78);
639 for (curr = 0; next < len; curr = next) {
640 next = theLayout->nextGlyph(text, curr);
641 c = fl_utf8decode(text + curr, text + next, &nb);
642 if ((cu = fl_toupper(c)) == c) {
643 /* already uppercase, just draw the character */
644 fl_font(ff->font, ff->size);
645 width = (int)fl_width(text + curr, next - curr);
646 if (curr && width)
647 viewX += font->letterSpacing;
648 fl_draw(text + curr, next - curr, viewX, viewY);
649 viewX += width;
650 } else {
651 /* make utf8 string for converted char */
652 nb = fl_utf8encode(cu, chbuf);
653 fl_font(ff->font, sc_fontsize);
654 width = (int)fl_width(chbuf, nb);
655 if (curr && width)
656 viewX += font->letterSpacing;
657 fl_draw(chbuf, nb, viewX, viewY);
658 viewX += width;
659 }
660 }
661 } else {
662 while (next < len) {
663 next = theLayout->nextGlyph(text, curr);
664 width = (int)fl_width(text + curr, next - curr);
665 if (curr && width)
666 viewX += font->letterSpacing;
667 fl_draw(text + curr, next - curr, viewX, viewY);
668 viewX += width;
669 curr = next;
670 }
671 }
672 }
673}
674
675/*
676 * "simple" in that it ignores letter-spacing, etc. This was added for image
677 * alt text where none of that matters.
678 */
680 core::style::Color *color,
682 int X, int Y, int W, int H,
683 const char *text)
684{
685 FltkFont *ff = (FltkFont*)font;
686 fl_font(ff->font, ff->size);
687 fl_color(((FltkColor*)color)->colors[shading]);
688 fl_draw(text,
690 W, H, FL_ALIGN_TOP|FL_ALIGN_LEFT|FL_ALIGN_WRAP, NULL, 0);
691}
692
693void FltkWidgetView::drawImage (core::Imgbuf *imgbuf, int xRoot, int yRoot,
694 int X, int Y, int width, int height)
695{
696 ((FltkImgbuf*)imgbuf)->draw (this,
699 X, Y, width, height);
700}
701
703{
704 return true;
705}
706
707void FltkWidgetView::addFltkWidget (Fl_Widget *widget,
708 core::Allocation *allocation)
709{
710 allocateFltkWidget (widget, allocation);
711 add (widget);
712}
713
714void FltkWidgetView::removeFltkWidget (Fl_Widget *widget)
715{
716 remove (widget);
717}
718
720 core::Allocation *allocation)
721{
722 widget->resize (translateCanvasXToViewX (allocation->x),
723 translateCanvasYToViewY (allocation->y),
724 allocation->width,
725 allocation->ascent + allocation->descent);
726}
727
728void FltkWidgetView::drawFltkWidget (Fl_Widget *widget,
729 core::Rectangle *area)
730{
731 draw_child (*widget);
732 draw_outside_label(*widget);
733}
734
735} // namespace fltk
736} // namespace dw
#define _MSG(...)
Definition bookmarks.c:45
The platform independent interface for image buffers.
Definition imgbuf.hh:162
The central class for managing and drawing a widget tree.
Definition layout.hh:17
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:1088
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:1070
void cancelTooltip()
Definition layout.hh:405
void leaveNotify(View *view, ButtonState state)
This function is called by a view, to delegate a leave notify event.
Definition layout.cc:1109
void expose(View *view, Rectangle *area)
Definition layout.hh:300
int nextGlyph(const char *text, int idx)
Definition layout.hh:365
void viewportSizeChanged(View *view, int width, int height)
Definition layout.cc:1322
bool buttonRelease(View *view, int numPressed, int x, int y, ButtonState state, int button)
This function is called by a view, to delegate a button press event.
Definition layout.hh:329
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:539
bool buttonPress(View *view, int numPressed, int x, int y, ButtonState state, int button)
This function is called by a view, to delegate a button press event.
Definition layout.hh:315
dw::core::Shape implemtation for simple rectangles.
Definition types.hh:70
void addRectangle(Rectangle *r)
Add a rectangle to the region and combine it with existing rectangles if possible.
Definition types.cc:239
lout::container::typed::Iterator< Rectangle > rectangles()
Definition types.hh:153
An interface to encapsulate platform dependent drawing.
Definition view.hh:17
virtual bool usesViewport()=0
Return, whether this view uses a viewport.
FontVariant fontVariant
Definition style.hh:688
void setBgColor(core::style::Color *color)
Set the background of the view.
virtual int translateCanvasXToViewX(int x)=0
void clipPoint(int *x, int *y, int border)
FltkViewBase(int x, int y, int w, int h, const char *label=0)
void drawTypedLine(core::style::Color *color, core::style::Color::Shading shading, core::style::LineType type, int width, int x1, int y1, int x2, int y2)
void queueDraw(core::Rectangle *area)
Queue a region, which is given in canvas coordinates, for drawing.
void drawRectangle(core::style::Color *color, core::style::Color::Shading shading, bool filled, int x, int y, int width, int height)
static bool backBufferInUse
void drawLine(core::style::Color *color, core::style::Color::Shading shading, int x1, int y1, int x2, int y2)
void startDrawing(core::Rectangle *area)
Called before drawing.
void cancelQueueDraw()
Cancel a draw queue request.
void drawArc(core::style::Color *color, core::style::Color::Shading shading, bool filled, int centerX, int centerY, int width, int height, int angle1, int angle2)
void drawPoint(core::style::Color *color, core::style::Color::Shading shading, int x, int y)
void setCanvasSize(int width, int ascent, int descent)
Set the canvas size.
static BackBuffer * backBuffer
void finishDrawing(core::Rectangle *area)
Called after drawing.
void drawPolygon(core::style::Color *color, core::style::Color::Shading shading, bool filled, bool convex, core::Point *points, int npoints)
void setLayout(core::Layout *layout)
This methods notifies the view, that it has been attached to a layout.
void setBufferedDrawing(bool b)
void mergeClippingView(core::View *clippingView)
core::View * getClippingView(int x, int y, int width, int height)
virtual int translateViewXToCanvasX(int x)=0
virtual int translateCanvasYToViewY(int y)=0
void queueDrawTotal()
Queue the total viewport for drawing.
void setCursor(core::style::Cursor cursor)
Set the cursor appearance.
virtual int translateViewYToCanvasY(int y)=0
core::Layout * theLayout
core::Rectangle * exposeArea
FltkWidgetView(int x, int y, int w, int h, const char *label=0)
void drawFltkWidget(Fl_Widget *widget, core::Rectangle *area)
void removeFltkWidget(Fl_Widget *widget)
void drawImage(core::Imgbuf *imgbuf, int xRoot, int yRoot, int x, int y, int width, int height)
void drawSimpleWrappedText(core::style::Font *font, core::style::Color *color, core::style::Color::Shading shading, int x, int y, int w, int h, const char *text)
void allocateFltkWidget(Fl_Widget *widget, core::Allocation *allocation)
void addFltkWidget(Fl_Widget *widget, core::Allocation *allocation)
void drawText(core::style::Font *font, core::style::Color *color, core::style::Color::Shading shading, int x, int y, const char *text, int len)
static Layout * layout
static core::Imgbuf * imgbuf
#define H(x, y, z)
@ FONT_VARIANT_SMALL_CAPS
Definition style.hh:334
ButtonState
Platform independent representation.
Definition events.hh:15
@ SHIFT_MASK
Definition events.hh:17
@ BUTTON3_MASK
Definition events.hh:22
@ META_MASK
Definition events.hh:19
@ BUTTON1_MASK
Definition events.hh:20
@ CONTROL_MASK
Definition events.hh:18
@ BUTTON2_MASK
Definition events.hh:21
@ VPOS_INTO_VIEW
Definition types.hh:30
@ HPOS_INTO_VIEW
Definition types.hh:20
core::ButtonState getDwButtonState()
Dw is in this namespace, or sub namespaces of this one.
This namespace provides thin wrappers, implemented as C++ templates, to gain type-safety.
Definition container.hh:387
int roundInt(double d)
Definition misc.hh:82
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