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) 
|
Go to the documentation of this file. 22 #include "../lout/msg.h" 23 #include "../lout/debug.hh" 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> 52 FltkFont> (
false,
false);
61 FL_HELVETICA_BOLD_ITALIC);
64 Fl_Font fontItalic, Fl_Font fontBoldItalic)
69 font[3] = fontBoldItalic;
77 if (attrs & FL_ITALIC)
87 if (attrs & FL_ITALIC)
92 return font[idx] >= 0 ? font[idx] : font[0];
113 family = &standardFontFamily;
115 font = family->
get (fa);
120 spaceWidth =
misc::max(0, (
int)fl_width(
" ") + letterSpacing);
122 fl_text_extents(
"x", xx, xy, xw, xh);
124 descent = fl_descent();
125 ascent = fl_height() - descent;
130 fontsTable->remove (
this);
133 static void strstrip(
char *big,
const char *little)
135 if (strlen(big) >= strlen(little) &&
137 *(big + strlen(big) - strlen(little)) =
'\0';
145 int k = Fl::set_fonts (
"-*-iso10646-1");
146 for (
int i = 0; i < k; i++) {
148 char *name = strdup (Fl::get_font_name ((Fl_Font) i, &t));
156 _MSG(
"Found font: %s%s%s\n", name, t & FL_BOLD ?
" bold" :
"",
157 t & FL_ITALIC ?
" italic" :
"");
164 family->
set ((Fl_Font) i, t);
169 family =
new FontFamily ((Fl_Font) i, -1, -1, -1);
170 family->
set ((Fl_Font) i, t);
171 systemFonts->put (familyName, family);
182 return systemFonts->get (&familyName) != NULL;
193 return family->
get (attrs);
211 fontsTable->put (font, font);
283 _MSG(
"FltkTooltip::onEnter\n");
294 tt_window =
new Fl_Menu_Window(0,0,100,24);
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);
303 b->align(FL_ALIGN_WRAP|FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
310 Fl_Box *box = (Fl_Box*)
tt_window->child(0);
312 Fl::get_mouse(x,y); y += 6;
316 box->measure_label(ww, hh);
317 ww += 6 + 2 * Fl::box_dx(box->box());
318 hh += 6 + 2 * Fl::box_dy(box->box());
354 Fl_Widget *widget = Fl::belowmouse();
355 if (widget && widget->window()) {
356 widget->window()->damage(FL_DAMAGE_EXPOSE,0,0,1,1);
402 selectionMode,
int rows)
417 const char *placeholder)
426 const char *placeholder)
485 MSG_ERR(
"FltkPlatform::attachView: multiple views!\n");
489 resources->iterator (); it.hasNext (); ) {
498 if (this->view !=
view)
499 MSG_ERR(
"FltkPlatform::detachView: this->view: %p view: %p\n",
503 resources->iterator (); it.hasNext (); ) {
518 int curr = 0, next = 0, nb;
522 for (curr = 0; next < len; curr = next) {
524 c = fl_utf8decode(text + curr, text + next, &nb);
525 if ((cu = fl_toupper(c)) == c) {
528 if (fl_nonspacing(cu) == 0) {
530 width += (int)fl_width(text + curr, next - curr);
534 nb = fl_utf8encode(cu, chbuf);
535 fl_font(ff->
font, sc_fontsize);
536 if (fl_nonspacing(cu) == 0) {
538 width += (int)fl_width(chbuf, nb);
544 width = (int) fl_width (text, len);
547 int curr = 0, next = 0;
551 c = fl_utf8decode(text + curr, text + next, &nb);
552 if (fl_nonspacing(c) == 0)
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';
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';
594 return fl_utf8fwd (&text[idx + 1], text, &text[strlen (text)]) - text;
599 return fl_utf8back (&text[idx - 1], text, &text[strlen (text)]) - text;
604 float horizontal, vertical;
606 Fl::screen_dpi(horizontal, vertical);
612 float horizontal, vertical;
614 Fl::screen_dpi(horizontal, vertical);
660 idleFunc->
func = func;
674 if (idleFunc->
id == idleId) {
703 Fl::copy(text, strlen(text), 0);
707 int width,
int height,
double gamma)
709 return new FltkImgbuf (type, width, height, gamma);
static lout::container::typed::HashTable< dw::core::style::ColorAttrs, FltkColor > * colorsTable
This interface adds some more methods for all flkt-based views.
virtual void removeFltkWidget(Fl_Widget *widget)
FltkFont(core::style::FontAttrs *attrs)
#define DBG_OBJ_CREATE(klass)
FontFamily(Fl_Font fontNormal, Fl_Font fontBold, Fl_Font fontItalic, Fl_Font fontBoldItalic)
static void initSystemFonts()
virtual void drawFltkWidget(Fl_Widget *widget, core::Rectangle *area)
An object::Object wrapper for constant strings (char*).
static FontFamily standardFontFamily
static FltkColor * create(int color)
static void tooltip_tcb(void *data)
static FltkFont * create(core::style::FontAttrs *attrs)
virtual void allocateFltkWidget(Fl_Widget *widget, core::Allocation *allocation)
static Fl_Font get(const char *name, int attrs)
Represents the allocation, i.e. actual position and size of a dw::core::Widget.
static lout::container::typed::HashTable< dw::core::style::FontAttrs, FltkFont > * fontsTable
virtual void detachView(FltkView *view)
An object::Object wrapper for strings (char*).
#define DBG_OBJ_ASSOC_CHILD(child)
virtual void attachView(FltkView *view)
Typed version of container::untyped::Iterator.
Typed version of container::untyped::HashTable.
A factory for the common resource.
static bool fontExists(const char *name)
int AsciiStrcasecmp(const char *s1, const char *s2)
void set(Fl_Font, int attrs)
The central class for managing and drawing a widget tree.
The platform independent interface for image buffers.
static lout::container::typed::HashTable< lout::object::ConstString, FontFamily > * systemFonts
virtual void addFltkWidget(Fl_Widget *widget, core::Allocation *allocation)
dw::core::Shape implemtation for simple rectangles.
Typed version of container::untyped::List.
An interface to encapsulate platform dependent drawing.
Dw is in this namespace, or sub namespaces of this one.
int shadeColor(int color, int d)
static void strstrip(char *big, const char *little)