dillo  3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
  Fossies Dox: dillo-3.0.5.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

fltkplatform.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 #include <stdio.h>
21 
22 #include "../lout/msg.h"
23 #include "../lout/debug.hh"
24 #include "fltkcore.hh"
25 
26 #include <FL/fl_draw.H>
27 #include <FL/Fl_Box.H>
28 #include <FL/Fl_Tooltip.H>
29 #include <FL/Fl_Menu_Window.H>
30 #include <FL/Fl_Paged_Device.H>
31 
32 /*
33  * Local data
34  */
35 
36 /* Tooltips */
37 static Fl_Menu_Window *tt_window = NULL;
38 static int in_tooltip = 0, req_tooltip = 0;
39 
40 namespace dw {
41 namespace fltk {
42 
43 using namespace lout;
44 
50  FltkFont> *FltkFont::fontsTable =
52  FltkFont> (false, false);
53 
55  FltkFont::FontFamily> *FltkFont::systemFonts =
56  NULL;
57 
58 FltkFont::FontFamily FltkFont::standardFontFamily (FL_HELVETICA,
59  FL_HELVETICA_BOLD,
60  FL_HELVETICA_ITALIC,
61  FL_HELVETICA_BOLD_ITALIC);
62 
63 FltkFont::FontFamily::FontFamily (Fl_Font fontNormal, Fl_Font fontBold,
64  Fl_Font fontItalic, Fl_Font fontBoldItalic)
65 {
66  font[0] = fontNormal;
67  font[1] = fontBold;
68  font[2] = fontItalic;
69  font[3] = fontBoldItalic;
70 }
71 
72 void FltkFont::FontFamily::set (Fl_Font f, int attrs)
73 {
74  int idx = 0;
75  if (attrs & FL_BOLD)
76  idx += 1;
77  if (attrs & FL_ITALIC)
78  idx += 2;
79  font[idx] = f;
80 }
81 
82 Fl_Font FltkFont::FontFamily::get (int attrs)
83 {
84  int idx = 0;
85  if (attrs & FL_BOLD)
86  idx += 1;
87  if (attrs & FL_ITALIC)
88  idx += 2;
89 
90  // should the desired font style not exist, we
91  // return the normal font of the fontFamily
92  return font[idx] >= 0 ? font[idx] : font[0];
93 }
94 
95 
96 
98 {
99  if (!systemFonts)
100  initSystemFonts ();
101 
102  copyAttrs (attrs);
103 
104  int fa = 0;
105  if (weight >= 500)
106  fa |= FL_BOLD;
107  if (style != core::style::FONT_STYLE_NORMAL)
108  fa |= FL_ITALIC;
109 
110  object::ConstString nameString (name);
111  FontFamily *family = systemFonts->get (&nameString);
112  if (!family)
113  family = &standardFontFamily;
114 
115  font = family->get (fa);
116 
117  fl_font(font, size);
118  // WORKAROUND: A bug with fl_width(uint_t) on non-xft X was present in
119  // 1.3.0 (STR #2688).
120  spaceWidth = misc::max(0, (int)fl_width(" ") + letterSpacing);
121  int xx, xy, xw, xh;
122  fl_text_extents("x", xx, xy, xw, xh);
123  xHeight = xh;
124  descent = fl_descent();
125  ascent = fl_height() - descent;
126 }
127 
129 {
130  fontsTable->remove (this);
131 }
132 
133 static void strstrip(char *big, const char *little)
134 {
135  if (strlen(big) >= strlen(little) &&
136  misc::AsciiStrcasecmp(big + strlen(big) - strlen(little), little) == 0)
137  *(big + strlen(big) - strlen(little)) = '\0';
138 }
139 
141 {
142  systemFonts = new container::typed::HashTable
143  <lout::object::ConstString, FontFamily> (true, true);
144 
145  int k = Fl::set_fonts ("-*-iso10646-1");
146  for (int i = 0; i < k; i++) {
147  int t;
148  char *name = strdup (Fl::get_font_name ((Fl_Font) i, &t));
149 
150  // normalize font family names (strip off "bold", "italic")
151  if (t & FL_ITALIC)
152  strstrip(name, " italic");
153  if (t & FL_BOLD)
154  strstrip(name, " bold");
155 
156  _MSG("Found font: %s%s%s\n", name, t & FL_BOLD ? " bold" : "",
157  t & FL_ITALIC ? " italic" : "");
158 
159  object::String *familyName = new object::String(name);
160  free (name);
161  FontFamily *family = systemFonts->get (familyName);
162 
163  if (family) {
164  family->set ((Fl_Font) i, t);
165  delete familyName;
166  } else {
167  // set first font of family also as normal font in case there
168  // is no normal (non-bold, non-italic) font
169  family = new FontFamily ((Fl_Font) i, -1, -1, -1);
170  family->set ((Fl_Font) i, t);
171  systemFonts->put (familyName, family);
172  }
173  }
174 }
175 
176 bool
177 FltkFont::fontExists (const char *name)
178 {
179  if (!systemFonts)
180  initSystemFonts ();
181  object::ConstString familyName (name);
182  return systemFonts->get (&familyName) != NULL;
183 }
184 
185 Fl_Font
186 FltkFont::get (const char *name, int attrs)
187 {
188  if (!systemFonts)
189  initSystemFonts ();
190  object::ConstString familyName (name);
191  FontFamily *family = systemFonts->get (&familyName);
192  if (family)
193  return family->get (attrs);
194  else
195  return FL_HELVETICA;
196 }
197 
198 bool
199 FltkPlatform::fontExists (const char *name)
200 {
201  return FltkFont::fontExists (name);
202 }
203 
204 FltkFont*
206 {
207  FltkFont *font = fontsTable->get (attrs);
208 
209  if (font == NULL) {
210  font = new FltkFont (attrs);
211  fontsTable->put (font, font);
212  }
213 
214  return font;
215 }
216 
218  FltkColor>
221  FltkColor> (false, false);
222 
223 FltkColor::FltkColor (int color): Color (color)
224 {
225  this->color = color;
226 
228  colors[SHADING_NORMAL] = FL_BLACK;
230  colors[SHADING_INVERSE] = FL_BLACK;
231  if (!(colors[SHADING_DARK] = shadeColor (color, SHADING_DARK) << 8))
232  colors[SHADING_DARK] = FL_BLACK;
234  colors[SHADING_LIGHT] = FL_BLACK;
235 }
236 
238 {
239  colorsTable->remove (this);
240 }
241 
243 {
244  ColorAttrs attrs(col);
245  FltkColor *color = colorsTable->get (&attrs);
246 
247  if (color == NULL) {
248  color = new FltkColor (col);
249  colorsTable->put (color, color);
250  }
251 
252  return color;
253 }
254 
255 FltkTooltip::FltkTooltip (const char *text) : Tooltip(text)
256 {
257 }
258 
260 {
261  if (in_tooltip || req_tooltip)
262  cancel(); /* cancel tooltip window */
263 }
264 
265 FltkTooltip *FltkTooltip::create (const char *text)
266 {
267  return new FltkTooltip(text);
268 }
269 
270 /*
271  * Tooltip callback: used to delay it a bit
272  * INVARIANT: Only one instance of this function is requested.
273  */
274 static void tooltip_tcb(void *data)
275 {
276  req_tooltip = 2;
277  ((FltkTooltip *)data)->onEnter();
278  req_tooltip = 0;
279 }
280 
282 {
283  _MSG("FltkTooltip::onEnter\n");
284  if (!str || !*str)
285  return;
286  if (req_tooltip == 0) {
287  Fl::remove_timeout(tooltip_tcb);
288  Fl::add_timeout(1.0, tooltip_tcb, this);
289  req_tooltip = 1;
290  return;
291  }
292 
293  if (!tt_window) {
294  tt_window = new Fl_Menu_Window(0,0,100,24);
295  tt_window->set_override();
296  tt_window->box(FL_NO_BOX);
297  Fl_Box *b = new Fl_Box(0,0,100,24);
298  b->box(FL_BORDER_BOX);
299  b->color(fl_color_cube(FL_NUM_RED-1, FL_NUM_GREEN-1, FL_NUM_BLUE-2));
300  b->labelcolor(FL_BLACK);
301  b->labelfont(FL_HELVETICA);
302  b->labelsize(14);
303  b->align(FL_ALIGN_WRAP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
304  tt_window->resizable(b);
305  tt_window->end();
306  }
307 
308  /* prepare tooltip window */
309  int x, y;
310  Fl_Box *box = (Fl_Box*)tt_window->child(0);
311  box->label(str);
312  Fl::get_mouse(x,y); y += 6;
313  /* calculate window size */
314  int ww, hh;
315  ww = 800; // max width;
316  box->measure_label(ww, hh);
317  ww += 6 + 2 * Fl::box_dx(box->box());
318  hh += 6 + 2 * Fl::box_dy(box->box());
319  tt_window->resize(x,y,ww,hh);
320  tt_window->show();
321  in_tooltip = 1;
322 }
323 
324 /*
325  * Leaving the widget cancels the tooltip
326  */
328 {
329  _MSG(" FltkTooltip::onLeave in_tooltip=%d\n", in_tooltip);
330  cancel();
331 }
332 
334 {
336 }
337 
338 /*
339  * Remove a shown tooltip or cancel a pending one
340  */
342 {
343  if (req_tooltip) {
344  Fl::remove_timeout(tooltip_tcb);
345  req_tooltip = 0;
346  }
347  if (!in_tooltip) return;
348  in_tooltip = 0;
349  tt_window->hide();
350 
351  /* WORKAROUND: (Black magic here)
352  * Hiding a tooltip with the keyboard or mousewheel doesn't work.
353  * The code below "fixes" the problem */
354  Fl_Widget *widget = Fl::belowmouse();
355  if (widget && widget->window()) {
356  widget->window()->damage(FL_DAMAGE_EXPOSE,0,0,1,1);
357  }
358 }
359 
361 {
362 }
363 
364 void FltkView::addFltkWidget (Fl_Widget *widget,
365  core::Allocation *allocation)
366 {
367 }
368 
369 void FltkView::removeFltkWidget (Fl_Widget *widget)
370 {
371 }
372 
373 void FltkView::allocateFltkWidget (Fl_Widget *widget,
374  core::Allocation *allocation)
375 {
376 }
377 
378 void FltkView::drawFltkWidget (Fl_Widget *widget, core::Rectangle *area)
379 {
380 }
381 
382 
385  *label)
386 {
387  return new ui::FltkLabelButtonResource (platform, label);
388 }
389 
392  *widget,
393  bool relief)
394 {
395  return new ui::FltkComplexButtonResource (platform, widget, relief);
396 }
397 
400  ::ListResource
401  ::SelectionMode
402  selectionMode, int rows)
403 {
404  return new ui::FltkListResource (platform, selectionMode, rows);
405 }
406 
409 {
410  return new ui::FltkOptionMenuResource (platform);
411 }
412 
415  bool password,
416  const char *label,
417  const char *placeholder)
418 {
419  return new ui::FltkEntryResource (platform, size, password, label,
420  placeholder);
421 }
422 
425  int rows,
426  const char *placeholder)
427 {
428  return new ui::FltkMultiLineTextResource (platform, cols, rows,placeholder);
429 }
430 
433 {
434  return new ui::FltkCheckButtonResource (platform, activated);
435 }
436 
439 (core::ui::RadioButtonResource *groupedWith, bool activated)
440 {
441  return
442  new ui::FltkRadioButtonResource (platform,
444  groupedWith,
445  activated);
446 }
447 
448 // ----------------------------------------------------------------------
449 
451 {
452  DBG_OBJ_CREATE ("dw::fltk::FltkPlatform");
453 
454  layout = NULL;
456  idleFuncRunning = false;
457  idleFuncId = 0;
458 
459  view = NULL;
461 
463 }
464 
466 {
467  if (idleFuncRunning)
468  Fl::remove_idle (generalStaticIdle, (void*)this);
469  delete idleQueue;
470  delete resources;
471 
472  DBG_OBJ_DELETE ();
473 }
474 
476 {
477  this->layout = layout;
479 }
480 
481 
483 {
484  if (this->view)
485  MSG_ERR("FltkPlatform::attachView: multiple views!\n");
486  this->view = (FltkView*)view;
487 
489  resources->iterator (); it.hasNext (); ) {
490  ui::FltkResource *resource = it.getNext ();
491  resource->attachView (this->view);
492  }
493 }
494 
495 
497 {
498  if (this->view != view)
499  MSG_ERR("FltkPlatform::detachView: this->view: %p view: %p\n",
500  this->view, view);
501 
503  resources->iterator (); it.hasNext (); ) {
504  ui::FltkResource *resource = it.getNext ();
505  resource->detachView ((FltkView*)view);
506  }
507  this->view = NULL;
508 }
509 
510 
511 int FltkPlatform::textWidth (core::style::Font *font, const char *text,
512  int len)
513 {
514  char chbuf[4];
515  int c, cu;
516  int width = 0;
517  FltkFont *ff = (FltkFont*) font;
518  int curr = 0, next = 0, nb;
519 
521  int sc_fontsize = lout::misc::roundInt(ff->size * 0.78);
522  for (curr = 0; next < len; curr = next) {
523  next = nextGlyph(text, curr);
524  c = fl_utf8decode(text + curr, text + next, &nb);
525  if ((cu = fl_toupper(c)) == c) {
526  /* already uppercase, just draw the character */
527  fl_font(ff->font, ff->size);
528  if (fl_nonspacing(cu) == 0) {
529  width += font->letterSpacing;
530  width += (int)fl_width(text + curr, next - curr);
531  }
532  } else {
533  /* make utf8 string for converted char */
534  nb = fl_utf8encode(cu, chbuf);
535  fl_font(ff->font, sc_fontsize);
536  if (fl_nonspacing(cu) == 0) {
537  width += font->letterSpacing;
538  width += (int)fl_width(chbuf, nb);
539  }
540  }
541  }
542  } else {
543  fl_font (ff->font, ff->size);
544  width = (int) fl_width (text, len);
545 
546  if (font->letterSpacing) {
547  int curr = 0, next = 0;
548 
549  while (next < len) {
550  next = nextGlyph(text, curr);
551  c = fl_utf8decode(text + curr, text + next, &nb);
552  if (fl_nonspacing(c) == 0)
553  width += font->letterSpacing;
554  curr = next;
555  }
556  }
557  }
558 
559  return width;
560 }
561 
562 char *FltkPlatform::textToUpper (const char *text, int len)
563 {
564  char *newstr = NULL;
565 
566  if (len > 0) {
567  int newlen;
568 
569  newstr = (char*) malloc(3 * len + 1);
570  newlen = fl_utf_toupper((const unsigned char*)text, len, newstr);
571  assert(newlen <= 3 * len);
572  newstr[newlen] = '\0';
573  }
574  return newstr;
575 }
576 
577 char *FltkPlatform::textToLower (const char *text, int len)
578 {
579  char *newstr = NULL;
580 
581  if (len > 0) {
582  int newlen;
583 
584  newstr = (char*) malloc(3 * len + 1);
585  newlen = fl_utf_tolower((const unsigned char*)text, len, newstr);
586  assert(newlen <= 3 * len);
587  newstr[newlen] = '\0';
588  }
589  return newstr;
590 }
591 
592 int FltkPlatform::nextGlyph (const char *text, int idx)
593 {
594  return fl_utf8fwd (&text[idx + 1], text, &text[strlen (text)]) - text;
595 }
596 
597 int FltkPlatform::prevGlyph (const char *text, int idx)
598 {
599  return fl_utf8back (&text[idx - 1], text, &text[strlen (text)]) - text;
600 }
601 
603 {
604  float horizontal, vertical;
605 
606  Fl::screen_dpi(horizontal, vertical);
607  return horizontal;
608 }
609 
611 {
612  float horizontal, vertical;
613 
614  Fl::screen_dpi(horizontal, vertical);
615  return vertical;
616 }
617 
619 {
620  ((FltkPlatform*)data)->generalIdle();
621 }
622 
624 {
625  IdleFunc *idleFunc;
626 
627  if (!idleQueue->isEmpty ()) {
628  /* Execute the first function in the list. */
629  idleFunc = idleQueue->getFirst ();
630  (layout->*(idleFunc->func)) ();
631 
632  /* Remove this function. */
633  idleQueue->removeRef(idleFunc);
634  }
635 
636  if (idleQueue->isEmpty()) {
637  idleFuncRunning = false;
638  Fl::remove_idle (generalStaticIdle, (void*)this);
639  }
640 }
641 
645 int FltkPlatform::addIdle (void (core::Layout::*func) ())
646 {
647  /*
648  * Since ... (todo) we have to wrap around fltk_add_idle. There is only one
649  * idle function, the passed idle function is put into a queue.
650  */
651  if (!idleFuncRunning) {
652  Fl::add_idle (generalStaticIdle, (void*)this);
653  idleFuncRunning = true;
654  }
655 
656  idleFuncId++;
657 
658  IdleFunc *idleFunc = new IdleFunc();
659  idleFunc->id = idleFuncId;
660  idleFunc->func = func;
661  idleQueue->append (idleFunc);
662 
663  return idleFuncId;
664 }
665 
666 void FltkPlatform::removeIdle (int idleId)
667 {
668  bool found;
670  IdleFunc *idleFunc;
671 
672  for (found = false, it = idleQueue->iterator(); !found && it.hasNext(); ) {
673  idleFunc = it.getNext();
674  if (idleFunc->id == idleId) {
675  idleQueue->removeRef (idleFunc);
676  found = true;
677  }
678  }
679 
680  if (idleFuncRunning && idleQueue->isEmpty())
681  Fl::remove_idle (generalStaticIdle, (void*)this);
682 }
683 
685  *attrs,
686  bool tryEverything)
687 {
688  return FltkFont::create (attrs);
689 }
690 
692 {
693  return FltkColor::create (color);
694 }
695 
697 {
698  return FltkTooltip::create (text);
699 }
700 
701 void FltkPlatform::copySelection(const char *text)
702 {
703  Fl::copy(text, strlen(text), 0);
704 }
705 
707  int width, int height, double gamma)
708 {
709  return new FltkImgbuf (type, width, height, gamma);
710 }
711 
713 {
714  return &resourceFactory;
715 }
716 
717 
719 {
720  resources->append (resource);
721  resource->attachView (view);
722 }
723 
725 {
726  resources->removeRef (resource);
727 }
728 
729 } // namespace fltk
730 } // namespace dw
dw::core::style::Tooltip
Definition: style.hh:615
DBG_OBJ_DELETE
#define DBG_OBJ_DELETE()
Definition: debug.hh:176
dw::fltk::FltkPlatform::FltkResourceFactory::setPlatform
void setPlatform(FltkPlatform *platform)
Definition: fltkplatform.hh:101
dw::fltk::FltkColor::colorsTable
static lout::container::typed::HashTable< dw::core::style::ColorAttrs, FltkColor > * colorsTable
Definition: fltkplatform.hh:50
fltkcore.hh
dw::fltk::FltkView
This interface adds some more methods for all flkt-based views.
Definition: fltkplatform.hh:78
dw::fltk::FltkPlatform::createFont
core::style::Font * createFont(core::style::FontAttrs *attrs, bool tryEverything)
Create a (platform dependent) font.
Definition: fltkplatform.cc:684
dw::fltk::FltkView::removeFltkWidget
virtual void removeFltkWidget(Fl_Widget *widget)
Definition: fltkplatform.cc:369
dw::fltk::FltkPlatform::resourceFactory
FltkResourceFactory resourceFactory
Definition: fltkplatform.hh:125
dw::fltk::FltkFont::FltkFont
FltkFont(core::style::FontAttrs *attrs)
Definition: fltkplatform.cc:97
DBG_OBJ_CREATE
#define DBG_OBJ_CREATE(klass)
Definition: debug.hh:175
dw::fltk::FltkFont::FontFamily::FontFamily
FontFamily(Fl_Font fontNormal, Fl_Font fontBold, Fl_Font fontItalic, Fl_Font fontBoldItalic)
Definition: fltkplatform.cc:63
dw::fltk::FltkPlatform::addIdle
int addIdle(void(core::Layout::*func)())
Definition: fltkplatform.cc:645
dw::fltk::FltkPlatform::FltkResourceFactory::createMultiLineTextResource
core::ui::MultiLineTextResource * createMultiLineTextResource(int cols, int rows, const char *placeholder)
Definition: fltkplatform.cc:424
dw::fltk::FltkFont::initSystemFonts
static void initSystemFonts()
Definition: fltkplatform.cc:140
dw::fltk::FltkFont::~FltkFont
~FltkFont()
Definition: fltkplatform.cc:128
dw::fltk::FltkView::drawFltkWidget
virtual void drawFltkWidget(Fl_Widget *widget, core::Rectangle *area)
Definition: fltkplatform.cc:378
dw::fltk::FltkColor::FltkColor
FltkColor(int color)
Definition: fltkplatform.cc:223
dw::core::style::Color
Definition: style.hh:709
lout::object::ConstString
An object::Object wrapper for constant strings (char*).
Definition: object.hh:111
dw::fltk::FltkTooltip::onEnter
void onEnter()
Definition: fltkplatform.cc:281
dw::fltk::FltkPlatform::FltkResourceFactory::createLabelButtonResource
core::ui::LabelButtonResource * createLabelButtonResource(const char *label)
Definition: fltkplatform.cc:384
dw::fltk::ui::FltkCheckButtonResource
Definition: fltkui.hh:378
dw::fltk::FltkPlatform::getResourceFactory
core::ui::ResourceFactory * getResourceFactory()
Definition: fltkplatform.cc:712
dw::fltk::FltkFont::standardFontFamily
static FontFamily standardFontFamily
Definition: fltkplatform.hh:26
dw::fltk::FltkColor::create
static FltkColor * create(int color)
Definition: fltkplatform.cc:242
dw::fltk::FltkColor::~FltkColor
~FltkColor()
Definition: fltkplatform.cc:237
lout::container::typed::Iterator::hasNext
bool hasNext()
Definition: container.hh:369
dw::fltk::tooltip_tcb
static void tooltip_tcb(void *data)
Definition: fltkplatform.cc:274
dw::fltk::FltkPlatform::generalStaticIdle
static void generalStaticIdle(void *data)
Definition: fltkplatform.cc:618
dw::fltk::FltkPlatform::createColor
core::style::Color * createColor(int color)
Create a color resource for a given 0xrrggbb value.
Definition: fltkplatform.cc:691
dw::fltk::FltkFont::create
static FltkFont * create(core::style::FontAttrs *attrs)
Definition: fltkplatform.cc:205
dw::fltk::FltkView::allocateFltkWidget
virtual void allocateFltkWidget(Fl_Widget *widget, core::Allocation *allocation)
Definition: fltkplatform.cc:373
dw::fltk::FltkPlatform::FltkResourceFactory::createCheckButtonResource
core::ui::CheckButtonResource * createCheckButtonResource(bool activated)
Definition: fltkplatform.cc:432
dw::core::ui::ComplexButtonResource
Definition: ui.hh:372
dw::fltk::FltkPlatform::dpiY
float dpiY()
Return screen resolution in y-direction.
Definition: fltkplatform.cc:610
dw::fltk::FltkTooltip::cancel
static void cancel()
Definition: fltkplatform.cc:341
dw::core::style::Color::SHADING_LIGHT
Definition: style.hh:725
dw::fltk::FltkFont::get
static Fl_Font get(const char *name, int attrs)
Definition: fltkplatform.cc:186
dw::core::Allocation
Represents the allocation, i.e. actual position and size of a dw::core::Widget.
Definition: types.hh:163
dw::core::style::FontAttrs::letterSpacing
int letterSpacing
Definition: style.hh:644
dw::fltk::FltkPlatform::attachResource
void attachResource(ui::FltkResource *resource)
Definition: fltkplatform.cc:718
dw::core::ui::ListResource
Definition: ui.hh:433
dw::fltk::FltkPlatform::nextGlyph
int nextGlyph(const char *text, int idx)
Return the index of the next glyph in string text.
Definition: fltkplatform.cc:592
dw::fltk::FltkPlatform::setLayout
void setLayout(core::Layout *layout)
This methods notifies the platform, that it has been attached to a layout.
Definition: fltkplatform.cc:475
dw::core::style::FontAttrs
Definition: style.hh:638
dw::fltk::FltkImgbuf
Definition: fltkimgbuf.hh:11
dw::fltk::FltkFont::fontsTable
static lout::container::typed::HashTable< dw::core::style::FontAttrs, FltkFont > * fontsTable
Definition: fltkplatform.hh:31
dw::fltk::ui::FltkResource::detachView
virtual void detachView(FltkView *view)
Definition: fltkui.cc:455
dw::fltk::FltkPlatform::copySelection
void copySelection(const char *text)
Copy selected text (0-terminated).
Definition: fltkplatform.cc:701
dw::fltk::FltkPlatform::~FltkPlatform
~FltkPlatform()
Definition: fltkplatform.cc:465
lout::object::String
An object::Object wrapper for strings (char*).
Definition: object.hh:134
lout::misc::max
T max(T a, T b)
Definition: misc.hh:20
dw::fltk::ui::FltkResource
Definition: fltkui.hh:187
dw::fltk::FltkTooltip
Definition: fltkplatform.hh:61
DBG_OBJ_ASSOC_CHILD
#define DBG_OBJ_ASSOC_CHILD(child)
Definition: debug.hh:179
dw::fltk::ui::FltkResource::attachView
virtual void attachView(FltkView *view)
Definition: fltkui.cc:438
dw::fltk::ui::FltkRadioButtonResource
Definition: fltkui.hh:391
dw::fltk::ui::FltkOptionMenuResource
Definition: fltkui.hh:473
dw::core::ui::OptionMenuResource
Definition: ui.hh:467
dw::core::style::ColorAttrs
Definition: style.hh:688
dw::fltk::FltkPlatform::removeIdle
void removeIdle(int idleId)
Remove an idle function, which has not been processed yet.
Definition: fltkplatform.cc:666
lout::container::typed::Iterator
Typed version of container::untyped::Iterator.
Definition: container.hh:352
dw::core::style::ColorAttrs::color
int color
Definition: style.hh:691
dw::fltk::FltkPlatform::view
FltkView * view
Definition: fltkplatform.hh:143
dw::fltk::FltkPlatform::detachView
void detachView(core::View *view)
This methods notifies the platform, that a view has been detached from the related layout.
Definition: fltkplatform.cc:496
dw::fltk::FltkTooltip::create
static FltkTooltip * create(const char *text)
Definition: fltkplatform.cc:265
dw::core::style::Color::SHADING_NORMAL
Definition: style.hh:725
dw::fltk::FltkPlatform::prevGlyph
int prevGlyph(const char *text, int idx)
Return the index of the previous glyph in string text.
Definition: fltkplatform.cc:597
dw::fltk::FltkPlatform::FltkResourceFactory::createListResource
core::ui::ListResource * createListResource(core::ui::ListResource::SelectionMode selectionMode, int rows)
Definition: fltkplatform.cc:399
lout::container::typed::HashTable
Typed version of container::untyped::HashTable.
Definition: container.hh:475
dw::fltk::ui::FltkComplexButtonResource
Definition: fltkui.hh:260
dw::core::ui::ResourceFactory
A factory for the common resource.
Definition: ui.hh:535
dw::fltk::FltkPlatform::idleFuncRunning
bool idleFuncRunning
Definition: fltkplatform.hh:137
dw::fltk::FltkPlatform::createTooltip
core::style::Tooltip * createTooltip(const char *text)
Create a tooltip.
Definition: fltkplatform.cc:696
in_tooltip
static int in_tooltip
Definition: fltkplatform.cc:38
dw::fltk::FltkFont::fontExists
static bool fontExists(const char *name)
Definition: fltkplatform.cc:177
dw::core::style::Font
Definition: style.hh:656
dw::fltk::FltkPlatform::attachView
void attachView(core::View *view)
This methods notifies the platform, that a view has been attached to the related layout.
Definition: fltkplatform.cc:482
dw::core::style::FONT_STYLE_NORMAL
Definition: style.hh:325
dw::fltk::ui::FltkListResource
Definition: fltkui.hh:501
dw::fltk::FltkTooltip::~FltkTooltip
~FltkTooltip()
Definition: fltkplatform.cc:259
lout::misc::AsciiStrcasecmp
int AsciiStrcasecmp(const char *s1, const char *s2)
Definition: misc.hh:56
dw::fltk::FltkPlatform::detachResource
void detachResource(ui::FltkResource *resource)
Definition: fltkplatform.cc:724
lout
Definition: container.cc:26
dw::fltk::FltkFont::FontFamily::set
void set(Fl_Font, int attrs)
Definition: fltkplatform.cc:72
dw::fltk::FltkTooltip::onLeave
void onLeave()
Definition: fltkplatform.cc:327
dw::fltk::FltkColor::colors
int colors[SHADING_NUM]
Definition: fltkplatform.hh:56
dw::core::ui::EntryResource
Definition: ui.hh:482
dw::core::Layout
The central class for managing and drawing a widget tree.
Definition: layout.hh:16
dw::fltk::FltkPlatform::IdleFunc
Definition: fltkplatform.hh:127
dw::fltk::FltkFont
Definition: fltkplatform.hh:15
dw::core::style::Color::SHADING_INVERSE
Definition: style.hh:725
dw::fltk::FltkPlatform::layout
core::Layout * layout
Definition: fltkplatform.hh:134
dw::core::Imgbuf
The platform independent interface for image buffers.
Definition: imgbuf.hh:161
dw::fltk::FltkFont::font
Fl_Font font
Definition: fltkplatform.hh:39
dw::core::style::FONT_VARIANT_SMALL_CAPS
Definition: style.hh:332
MSG_ERR
#define MSG_ERR(...)
Definition: dpid_common.h:22
dw::fltk::ui::FltkLabelButtonResource
Definition: fltkui.hh:238
dw::fltk::FltkPlatform::dpiX
float dpiX()
Return screen resolution in x-direction.
Definition: fltkplatform.cc:602
dw::core::style::Color::SHADING_DARK
Definition: style.hh:725
dw::fltk::FltkPlatform::createImgbuf
core::Imgbuf * createImgbuf(core::Imgbuf::Type type, int width, int height, double gamma)
Create a (platform speficic) image buffer.
Definition: fltkplatform.cc:706
dw::fltk::FltkFont::systemFonts
static lout::container::typed::HashTable< lout::object::ConstString, FontFamily > * systemFonts
Definition: fltkplatform.hh:29
dw::fltk::FltkView::addFltkWidget
virtual void addFltkWidget(Fl_Widget *widget, core::Allocation *allocation)
Definition: fltkplatform.cc:364
dw::core::Rectangle
dw::core::Shape implemtation for simple rectangles.
Definition: types.hh:69
lout::container::typed::List
Typed version of container::untyped::List.
Definition: container.hh:425
dw::fltk::FltkPlatform::resources
lout::container::typed::List< ui::FltkResource > * resources
Definition: fltkplatform.hh:144
dw::core::View
An interface to encapsulate platform dependent drawing.
Definition: view.hh:16
dw::core::Imgbuf::Type
Type
Definition: imgbuf.hh:164
dw::fltk::ui::FltkEntryResource
Definition: fltkui.hh:295
dw::fltk::FltkPlatform::FltkPlatform
FltkPlatform()
Definition: fltkplatform.cc:450
dw::fltk::FltkPlatform::fontExists
bool fontExists(const char *name)
Definition: fltkplatform.cc:199
dw::fltk::FltkTooltip::FltkTooltip
FltkTooltip(const char *text)
Definition: fltkplatform.cc:255
lout::container::typed::Iterator::getNext
T * getNext()
Definition: container.hh:370
req_tooltip
static int req_tooltip
Definition: fltkplatform.cc:38
dw::fltk::FltkPlatform::generalIdle
void generalIdle()
Definition: fltkplatform.cc:623
dw::fltk::FltkPlatform::FltkResourceFactory::createRadioButtonResource
core::ui::RadioButtonResource * createRadioButtonResource(core::ui::RadioButtonResource *groupedWith, bool activated)
Definition: fltkplatform.cc:439
dw::fltk::FltkPlatform::IdleFunc::func
void(core::Layout::* func)()
Definition: fltkplatform.hh:131
dw::fltk::FltkPlatform::idleQueue
lout::container::typed::List< IdleFunc > * idleQueue
Definition: fltkplatform.hh:136
dw::fltk::FltkPlatform::FltkResourceFactory::platform
FltkPlatform * platform
Definition: fltkplatform.hh:98
dw::core::ui::LabelButtonResource
Interface for labelled buttons resources.
Definition: ui.hh:363
tt_window
static Fl_Menu_Window * tt_window
Definition: fltkplatform.cc:37
_MSG
#define _MSG(...)
Definition: bookmarks.c:44
dw::fltk::FltkPlatform::FltkResourceFactory::createComplexButtonResource
core::ui::ComplexButtonResource * createComplexButtonResource(core::Widget *widget, bool relief)
Definition: fltkplatform.cc:391
dw::fltk::FltkColor
Definition: fltkplatform.hh:47
dw::fltk::FltkPlatform::FltkResourceFactory::createEntryResource
core::ui::EntryResource * createEntryResource(int size, bool password, const char *label, const char *placeholder)
Definition: fltkplatform.cc:414
dw::fltk::FltkPlatform::IdleFunc::id
int id
Definition: fltkplatform.hh:130
dw::core::style::FontAttrs::size
int size
Definition: style.hh:642
dw::fltk::ui::FltkMultiLineTextResource
Definition: fltkui.hh:330
dw::fltk::FltkPlatform::idleFuncId
int idleFuncId
Definition: fltkplatform.hh:138
dw::fltk::FltkPlatform::textToUpper
char * textToUpper(const char *text, int len)
Return the string resulting from transforming text to uppercase.
Definition: fltkplatform.cc:562
dw::fltk::FltkTooltip::onMotion
void onMotion()
Definition: fltkplatform.cc:360
lout::misc::roundInt
int roundInt(double d)
Definition: misc.hh:41
dw::fltk::FltkPlatform::FltkResourceFactory::createOptionMenuResource
core::ui::OptionMenuResource * createOptionMenuResource()
Definition: fltkplatform.cc:408
dw::core::Widget
The base class of all dillo widgets.
Definition: widget.hh:23
dw::fltk::FltkFont::FontFamily
Definition: fltkplatform.hh:17
dw::core::ui::RadioButtonResource
Definition: ui.hh:507
dw::fltk::FltkPlatform::cancelTooltip
void cancelTooltip()
Cancel a tooltip (either shown or requested)
Definition: fltkplatform.cc:333
dw
Dw is in this namespace, or sub namespaces of this one.
Definition: alignedtextblock.cc:26
dw::core::ui::CheckButtonResource
Definition: ui.hh:501
dw::core::style::Color::shadeColor
int shadeColor(int color, int d)
Definition: style.cc:420
dw::fltk::FltkPlatform::textToLower
char * textToLower(const char *text, int len)
Return the string resulting from transforming text to lowercase.
Definition: fltkplatform.cc:577
dw::core::style::ColorAttrs::ColorAttrs
ColorAttrs(int color)
Definition: style.hh:694
dw::core::style::FontAttrs::fontVariant
FontVariant fontVariant
Definition: style.hh:645
lout::object::ConstString::str
const char * str
Definition: object.hh:114
dw::fltk::strstrip
static void strstrip(char *big, const char *little)
Definition: fltkplatform.cc:133
dw::fltk::FltkPlatform
Definition: fltkplatform.hh:92
dw::fltk::FltkFont::FontFamily::get
Fl_Font get(int attrs)
Definition: fltkplatform.cc:82
dw::core::ui::MultiLineTextResource
Definition: ui.hh:489
dw::fltk::FltkPlatform::textWidth
int textWidth(core::style::Font *font, const char *text, int len)
Return the width of a text, with a given length and font.
Definition: fltkplatform.cc:511