diff options
author | Sebastian Geerken <devnull@localhost> | 2012-11-26 23:00:47 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2012-11-26 23:00:47 +0100 |
commit | 056ee1ab2d4e07582651cb95e0abf46a5ccce506 (patch) | |
tree | 24c4bd5829ab002016a48d4a7f10be03a95c9e82 | |
parent | bccc6503f4677953a8cd2bbac2c962dc432577d9 (diff) | |
parent | 7830f229f724f74960b31c4089caf2838ee7fc77 (diff) |
Merge.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | dpi/datauri.c | 2 | ||||
-rw-r--r-- | dw/fltkplatform.cc | 4 | ||||
-rw-r--r-- | dw/fltkplatform.hh | 3 | ||||
-rw-r--r-- | dw/fltkui.cc | 35 | ||||
-rw-r--r-- | dw/fltkui.hh | 8 | ||||
-rw-r--r-- | dw/style.hh | 2 | ||||
-rw-r--r-- | dw/textblock.cc | 8 | ||||
-rw-r--r-- | dw/ui.hh | 6 | ||||
-rw-r--r-- | dw/widget.hh | 4 | ||||
-rw-r--r-- | src/decode.c | 21 | ||||
-rw-r--r-- | src/domain.c | 8 | ||||
-rw-r--r-- | src/form.cc | 58 | ||||
-rw-r--r-- | src/form.hh | 8 | ||||
-rw-r--r-- | src/html.cc | 44 | ||||
-rw-r--r-- | src/styleengine.cc | 8 | ||||
-rw-r--r-- | src/table.cc | 6 | ||||
-rw-r--r-- | test/dw_anchors_test.cc | 8 | ||||
-rw-r--r-- | test/dw_border_test.cc | 6 | ||||
-rw-r--r-- | test/dw_example.cc | 4 | ||||
-rw-r--r-- | test/dw_find_test.cc | 6 | ||||
-rw-r--r-- | test/dw_images_scaled.cc | 4 | ||||
-rw-r--r-- | test/dw_images_scaled2.cc | 8 | ||||
-rw-r--r-- | test/dw_images_simple.cc | 4 | ||||
-rw-r--r-- | test/dw_links.cc | 6 | ||||
-rw-r--r-- | test/dw_links2.cc | 6 | ||||
-rw-r--r-- | test/dw_lists.cc | 6 | ||||
-rw-r--r-- | test/dw_resource_test.cc | 4 | ||||
-rw-r--r-- | test/dw_table.cc | 6 | ||||
-rw-r--r-- | test/dw_table_aligned.cc | 6 | ||||
-rw-r--r-- | test/dw_ui_test.cc | 4 |
31 files changed, 145 insertions, 160 deletions
@@ -12,6 +12,7 @@ dillo-3.0.3 [not released yet] +- Support for CSS display property - Replace polling in DNS with a pipe. - Packed trie to optimize hyphenator memory consumption. + - Fix crash in datauri dpi. Patches: Johannes Hofmann +- Fix image input coordinates (BUG#1070) - When location bar is given focus, temporarily show panels if hidden @@ -21,6 +22,7 @@ dillo-3.0.3 [not released yet] - Add some more info to various bug meter messages. - For text selection, fix releasing mouse button outside of boundary. - While selecting text, moving cursor outside viewport will scroll it. + - Make form resetting work for <select>. Patches: corvid +- Automatic hyphenation. Patch: Sebastian Geerken diff --git a/dpi/datauri.c b/dpi/datauri.c index 055ecd9f..0e3560ec 100644 --- a/dpi/datauri.c +++ b/dpi/datauri.c @@ -150,8 +150,8 @@ char *a_Url_decode_hex_str(const char *str, size_t *p_sz) } *dest = 0; - new_str = dRealloc(new_str, sizeof(char) * (dest - new_str + 1)); *p_sz = (size_t)(dest - new_str); + new_str = dRealloc(new_str, sizeof(char) * (dest - new_str + 1)); return new_str; } diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc index d8e95a6e..7dd87a18 100644 --- a/dw/fltkplatform.cc +++ b/dw/fltkplatform.cc @@ -419,11 +419,11 @@ FltkPlatform::FltkResourceFactory::createOptionMenuResource () } core::ui::EntryResource * -FltkPlatform::FltkResourceFactory::createEntryResource (int maxLength, +FltkPlatform::FltkResourceFactory::createEntryResource (int size, bool password, const char *label) { - return new ui::FltkEntryResource (platform, maxLength, password, label); + return new ui::FltkEntryResource (platform, size, password, label); } core::ui::MultiLineTextResource * diff --git a/dw/fltkplatform.hh b/dw/fltkplatform.hh index 7b4272eb..64605b68 100644 --- a/dw/fltkplatform.hh +++ b/dw/fltkplatform.hh @@ -109,8 +109,7 @@ private: createListResource (core::ui::ListResource::SelectionMode selectionMode, int rows); core::ui::OptionMenuResource *createOptionMenuResource (); - core::ui::EntryResource *createEntryResource (int maxLength, - bool password, + core::ui::EntryResource *createEntryResource (int size, bool password, const char *label); core::ui::MultiLineTextResource *createMultiLineTextResource (int cols, int rows); diff --git a/dw/fltkui.cc b/dw/fltkui.cc index 5e4f3c56..14914dfe 100644 --- a/dw/fltkui.cc +++ b/dw/fltkui.cc @@ -536,11 +536,11 @@ Fl_Widget *FltkComplexButtonResource::createNewWidget (core::Allocation // ---------------------------------------------------------------------- -FltkEntryResource::FltkEntryResource (FltkPlatform *platform, int maxLength, +FltkEntryResource::FltkEntryResource (FltkPlatform *platform, int size, bool password, const char *label): FltkSpecificResource <dw::core::ui::EntryResource> (platform) { - this->maxLength = maxLength; + this->size = size; this->password = password; this->label = label ? strdup(label) : NULL; this->label_w = 0; @@ -615,7 +615,7 @@ void FltkEntryResource::sizeRequest (core::Requisition *requisition) // 1.3.0 (STR #2688). requisition->width = (int)fl_width ("n") - * (maxLength == UNLIMITED_MAX_LENGTH ? 10 : maxLength) + * (size == UNLIMITED_SIZE ? 10 : size) + label_w + (2 * RELIEF_X_THICKNESS); requisition->ascent = font->ascent + RELIEF_Y_THICKNESS; requisition->descent = font->descent + RELIEF_Y_THICKNESS; @@ -670,6 +670,11 @@ void FltkEntryResource::setEditable (bool editable) this->editable = editable; } +void FltkEntryResource::setMaxLength (int maxlen) +{ + ((Fl_Input *)widget)->maximum_size(maxlen); +} + // ---------------------------------------------------------------------- FltkMultiLineTextResource::FltkMultiLineTextResource (FltkPlatform *platform, @@ -1131,6 +1136,14 @@ void FltkOptionMenuResource::addItem (const char *str, queueResize (true); } +void FltkOptionMenuResource::setItem (int index, bool selected) +{ + if (selected) { + ((Fl_Choice *)widget)->value(menu+index); + queueResize (true); + } +} + void FltkOptionMenuResource::pushGroup (const char *name, bool enabled) { Fl_Menu_Item *item = newItem(); @@ -1257,6 +1270,22 @@ void FltkListResource::addItem (const char *str, bool enabled, bool selected) queueResize (true); } +void FltkListResource::setItem (int index, bool selected) +{ + Fl_Tree *tree = (Fl_Tree *) widget; + Fl_Tree_Item *item = tree->root()->child(index); + + /* TODO: handle groups */ + if (item) { + itemsSelected.set (index, selected); + if (mode == SELECTION_MULTIPLE) + item->select(selected); + else if (selected) + tree->select_only(item); + queueResize (true); + } +} + void FltkListResource::pushGroup (const char *name, bool enabled) { bool selected = false; diff --git a/dw/fltkui.hh b/dw/fltkui.hh index ff927c80..e1845abd 100644 --- a/dw/fltkui.hh +++ b/dw/fltkui.hh @@ -282,7 +282,7 @@ class FltkEntryResource: public FltkSpecificResource <dw::core::ui::EntryResource> { private: - int maxLength; + int size; bool password; const char *initText; char *label; @@ -297,7 +297,7 @@ protected: void setWidgetStyle (Fl_Widget *widget, core::style::Style *style); public: - FltkEntryResource (FltkPlatform *platform, int maxLength, bool password, + FltkEntryResource (FltkPlatform *platform, int size, bool password, const char *label); ~FltkEntryResource (); @@ -308,6 +308,7 @@ public: void setText (const char *text); bool isEditable (); void setEditable (bool editable); + void setMaxLength (int maxlen); }; @@ -445,6 +446,7 @@ template <class I> class FltkSelectionResource: protected: virtual bool setSelectedItems() { return false; } virtual void addItem (const char *str, bool enabled, bool selected) = 0; + virtual void setItem (int index, bool selected) = 0; virtual void pushGroup (const char *name, bool enabled) = 0; virtual void popGroup () = 0; public: @@ -475,6 +477,7 @@ public: ~FltkOptionMenuResource (); void addItem (const char *str, bool enabled, bool selected); + void setItem (int index, bool selected); void pushGroup (const char *name, bool enabled); void popGroup (); @@ -506,6 +509,7 @@ public: ~FltkListResource (); void addItem (const char *str, bool enabled, bool selected); + void setItem (int index, bool selected); void pushGroup (const char *name, bool enabled); void popGroup (); diff --git a/dw/style.hh b/dw/style.hh index 2422bfa9..cd9012c5 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -529,7 +529,7 @@ protected: void copyAttrs (StyleAttrs *attrs); public: - inline static Style *create (Layout *layout, StyleAttrs *attrs) + inline static Style *create (StyleAttrs *attrs) { Style *style = styleTable->get (attrs); if (style) { diff --git a/dw/textblock.cc b/dw/textblock.cc index 0d8a6a3e..b49362cd 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -1918,14 +1918,13 @@ void Textblock::changeLinkColor (int link, int newColor) styleAttrs = *old_style; styleAttrs.color = core::style::Color::create (layout, newColor); - word->style = core::style::Style::create (layout, &styleAttrs); + word->style = core::style::Style::create (&styleAttrs); old_style->unref(); old_style = word->spaceStyle; styleAttrs = *old_style; styleAttrs.color = core::style::Color::create (layout, newColor); - word->spaceStyle = - core::style::Style::create(layout, &styleAttrs); + word->spaceStyle = core::style::Style::create(&styleAttrs); old_style->unref(); break; } @@ -1936,8 +1935,7 @@ void Textblock::changeLinkColor (int link, int newColor) newColor); styleAttrs.setBorderColor( core::style::Color::create (layout, newColor)); - widget->setStyle( - core::style::Style::create (layout, &styleAttrs)); + widget->setStyle(core::style::Style::create (&styleAttrs)); break; } default: @@ -421,6 +421,7 @@ class SelectionResource: public Resource { public: virtual void addItem (const char *str, bool enabled, bool selected) = 0; + virtual void setItem (int index, bool selected) = 0; virtual void pushGroup (const char *name, bool enabled) = 0; virtual void popGroup () = 0; @@ -480,7 +481,8 @@ public: class EntryResource: public TextResource { public: - enum { UNLIMITED_MAX_LENGTH = -1 }; + enum { UNLIMITED_SIZE = -1 }; + virtual void setMaxLength (int maxlen) = 0; }; class MultiLineTextResource: public TextResource @@ -540,7 +542,7 @@ public: virtual ListResource *createListResource (ListResource::SelectionMode selectionMode, int rows) = 0; virtual OptionMenuResource *createOptionMenuResource () = 0; - virtual EntryResource *createEntryResource (int maxLength, bool password, + virtual EntryResource *createEntryResource (int size, bool password, const char *label) = 0; virtual MultiLineTextResource *createMultiLineTextResource (int cols, int rows) = 0; diff --git a/dw/widget.hh b/dw/widget.hh index b751a282..02a20f44 100644 --- a/dw/widget.hh +++ b/dw/widget.hh @@ -200,7 +200,7 @@ protected: inline void setCursor (style::Cursor cursor) { layout->setCursor (cursor); } - +#if 0 inline bool selectionButtonPress (Iterator *it, int charPos, int linkNo, EventButton *event, bool withinContent) { return layout->selectionState.buttonPress (it, charPos, linkNo, event); } @@ -212,7 +212,7 @@ protected: inline bool selectionButtonMotion (Iterator *it, int charPos, int linkNo, EventMotion *event, bool withinContent) { return layout->selectionState.buttonMotion (it, charPos, linkNo, event); } - +#endif inline bool selectionHandleEvent (SelectionState::EventType eventType, Iterator *it, int charPos, int linkNo, MousePositionEvent *event) diff --git a/src/decode.c b/src/decode.c index 7ea3dc25..c5752e62 100644 --- a/src/decode.c +++ b/src/decode.c @@ -242,24 +242,6 @@ Decode *a_Decode_content_init(const char *format) } /* - * Legal names for the ASCII character set - */ -static int Decode_is_ascii(const char *str) -{ - return (!(dStrAsciiCasecmp(str, "ASCII") && - dStrAsciiCasecmp(str, "US-ASCII") && - dStrAsciiCasecmp(str, "us") && - dStrAsciiCasecmp(str, "IBM367") && - dStrAsciiCasecmp(str, "cp367") && - dStrAsciiCasecmp(str, "csASCII") && - dStrAsciiCasecmp(str, "ANSI_X3.4-1968") && - dStrAsciiCasecmp(str, "iso-ir-6") && - dStrAsciiCasecmp(str, "ANSI_X3.4-1986") && - dStrAsciiCasecmp(str, "ISO_646.irv:1991") && - dStrAsciiCasecmp(str, "ISO646-US"))); -} - -/* * Initialize decoder to translate from any character set known to iconv() * to UTF-8. * @@ -272,8 +254,7 @@ Decode *a_Decode_charset_init(const char *format) if (format && strlen(format) && - dStrAsciiCasecmp(format,"UTF-8") && - !Decode_is_ascii(format)) { + dStrAsciiCasecmp(format,"UTF-8")) { iconv_t ic = iconv_open("UTF-8", format); if (ic != (iconv_t) -1) { diff --git a/src/domain.c b/src/domain.c index af8c8075..90d6b414 100644 --- a/src/domain.c +++ b/src/domain.c @@ -132,17 +132,17 @@ bool_t a_Domain_permit(const DilloUrl *source, const DilloUrl *dest) if (a_Url_same_organization(source, dest)) return TRUE; + ret = default_deny ? FALSE : TRUE; + for (i = 0; i < num_exceptions; i++) { - if(Domain_match(source_host, exceptions[i].origin) && - Domain_match(dest_host, exceptions[i].destination)) { + if (Domain_match(source_host, exceptions[i].origin) && + Domain_match(dest_host, exceptions[i].destination)) { ret = default_deny; MSG("Domain: Matched rule from %s to %s.\n", exceptions[i].origin, exceptions[i].destination); break; } } - if (i == num_exceptions) - ret = default_deny ? FALSE : TRUE; MSG("Domain: %s from %s to %s.\n", (ret == TRUE ? "permitted" : "DENIED"), source_host, dest_host); diff --git a/src/form.cc b/src/form.cc index 11f27b47..d5bd71da 100644 --- a/src/form.cc +++ b/src/form.cc @@ -177,6 +177,7 @@ public: void addOption (char *value, bool selected, bool enabled); void ensureSelection (); void addOptionsTo (SelectionResource *res); + void reset (SelectionResource *res); void appendValuesTo (Dlist *values, SelectionResource *res); }; @@ -360,7 +361,7 @@ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize) a_Url_free(action); } -void Html_tag_close_form(DilloHtml *html, int TagIdx) +void Html_tag_close_form(DilloHtml *html) { // DilloHtmlForm *form; // int i; @@ -547,10 +548,11 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize) if (a_Html_get_attr(html, tag, tagsize, "readonly")) ((EntryResource *) resource)->setEditable(false); -// /* Maximum length of the text in the entry */ -// if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "maxlength"))) -// gtk_entry_set_max_length(GTK_ENTRY(widget), -// strtol(attrbuf, NULL, 10)); + /* Maximum length of the text in the entry */ + if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "maxlength"))) { + int maxlen = strtol(attrbuf, NULL, 10); + ((EntryResource *) resource)->setMaxLength(maxlen); + } } if (prefs.show_tooltip && (attrbuf = a_Html_get_attr(html, tag, tagsize, "title"))) { @@ -680,7 +682,7 @@ void Html_tag_content_textarea(DilloHtml *html, const char *tag, int tagsize) * Close textarea * (TEXTAREA is parsed in VERBATIM mode, and entities are handled here) */ -void Html_tag_close_textarea(DilloHtml *html, int TagIdx) +void Html_tag_close_textarea(DilloHtml *html) { char *str; DilloHtmlInput *input; @@ -774,7 +776,7 @@ void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize) /* * ? */ -void Html_tag_close_select(DilloHtml *html, int TagIdx) +void Html_tag_close_select(DilloHtml *html) { if (html->InFlags & IN_SELECT) { if (html->InFlags & IN_OPTION) @@ -898,7 +900,7 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize) /* * Handle close <BUTTON> */ -void Html_tag_close_button(DilloHtml *html, int TagIdx) +void Html_tag_close_button(DilloHtml *html) { html->InFlags &= ~IN_BUTTON; } @@ -982,8 +984,6 @@ void DilloHtmlForm::submit(DilloHtmlInput *active_input, EventButton *event) } a_Url_free(url); } - // /* now, make the rendered area have its focus back */ - // gtk_widget_grab_focus(GTK_BIN(bw->render_main_scroll)->child); } /* @@ -1764,35 +1764,12 @@ void DilloHtmlInput::reset () } break; case DILLO_HTML_INPUT_SELECT: + case DILLO_HTML_INPUT_SEL_LIST: if (select != NULL) { - /* this is in reverse order so that, in case more than one was - * selected, we get the last one, which is consistent with handling - * of multiple selected options in the layout code. */ -// for (i = select->num_options - 1; i >= 0; i--) { -// if (select->options[i].init_val) { -// gtk_menu_item_activate(GTK_MENU_ITEM -// (select->options[i].menuitem)); -// Html_select_set_history(input); -// break; -// } -// } + SelectionResource *sr = (SelectionResource *) embed->getResource(); + select->reset(sr); } break; - case DILLO_HTML_INPUT_SEL_LIST: - if (!select) - break; -// for (i = 0; i < select->num_options; i++) { -// if (select->options[i].init_val) { -// if (select->options[i].menuitem->state == GTK_STATE_NORMAL) -// gtk_list_select_child(GTK_LIST(select->menu), -// select->options[i].menuitem); -// } else { -// if (select->options[i].menuitem->state==GTK_STATE_SELECTED) -// gtk_list_unselect_child(GTK_LIST(select->menu), -// select->options[i].menuitem); -// } -// } - break; case DILLO_HTML_INPUT_TEXTAREA: if (init_str != NULL) { MultiLineTextResource *textres = @@ -1874,6 +1851,15 @@ void DilloHtmlSelect::addOptionsTo (SelectionResource *res) } } +void DilloHtmlSelect::reset (SelectionResource *res) +{ + int size = options->size (); + for (int i = 0; i < size; i++) { + DilloHtmlOption *option = options->get (i); + res->setItem(i, option->selected); + } +} + void DilloHtmlSelect::appendValuesTo (Dlist *values, SelectionResource *res) { int size = options->size (); diff --git a/src/form.hh b/src/form.hh index cd04543f..297442e0 100644 --- a/src/form.hh +++ b/src/form.hh @@ -48,16 +48,16 @@ void a_Html_form_display_hiddens2(void *v_form, bool display); */ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize); -void Html_tag_close_form(DilloHtml *html, int TagIdx); +void Html_tag_close_form(DilloHtml *html); void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize); void Html_tag_open_isindex(DilloHtml *html, const char *tag, int tagsize); void Html_tag_open_textarea(DilloHtml *html, const char *tag, int tagsize); void Html_tag_content_textarea(DilloHtml *html, const char *tag, int tagsize); -void Html_tag_close_textarea(DilloHtml *html, int TagIdx); +void Html_tag_close_textarea(DilloHtml *html); void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize); -void Html_tag_close_select(DilloHtml *html, int TagIdx); +void Html_tag_close_select(DilloHtml *html); void Html_tag_open_option(DilloHtml *html, const char *tag, int tagsize); void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize); -void Html_tag_close_button(DilloHtml *html, int TagIdx); +void Html_tag_close_button(DilloHtml *html); #endif /* __FORM_HH__ */ diff --git a/src/html.cc b/src/html.cc index 812b5c7c..0efe1bbf 100644 --- a/src/html.cc +++ b/src/html.cc @@ -69,7 +69,7 @@ using namespace dw::core::style; *---------------------------------------------------------------------------*/ class DilloHtml; typedef void (*TagOpenFunct) (DilloHtml *html, const char *tag, int tagsize); -typedef void (*TagCloseFunct) (DilloHtml *html, int TagIdx); +typedef void (*TagCloseFunct) (DilloHtml *html); typedef enum { SEEK_ATTR_START, @@ -1305,7 +1305,7 @@ static void Html_tag_cleanup_to_idx(DilloHtml *html, int idx) BUG_MSG(" - forcing close of open tag: <%s>\n", toptag.name); _MSG("Close: %*s%s\n", size," ", toptag.name); if (toptag.close) - toptag.close(html, toptag_idx); + toptag.close(html); Html_real_pop_tag(html); } } @@ -1571,7 +1571,7 @@ static void Html_tag_open_html(DilloHtml *html, const char *tag, int tagsize) /* * Handle close HTML element */ -static void Html_tag_close_html(DilloHtml *html, int TagIdx) +static void Html_tag_close_html(DilloHtml *html) { /* TODO: may add some checks here */ if (html->Num_HTML == 1) { @@ -1606,7 +1606,7 @@ static void Html_tag_open_head(DilloHtml *html, const char *tag, int tagsize) * twice when the head element is closed implicitly. * Note2: HEAD is parsed once completely got. */ -static void Html_tag_close_head(DilloHtml *html, int TagIdx) +static void Html_tag_close_head(DilloHtml *html) { if (html->InFlags & IN_HEAD) { _MSG("Closing HEAD section\n"); @@ -1636,7 +1636,7 @@ static void Html_tag_open_title(DilloHtml *html, const char *tag, int tagsize) * Handle close TITLE * set page-title in the browser window and in the history. */ -static void Html_tag_close_title(DilloHtml *html, int TagIdx) +static void Html_tag_close_title(DilloHtml *html) { if (html->InFlags & IN_HEAD) { /* title is only valid inside HEAD */ @@ -1661,7 +1661,7 @@ static void Html_tag_open_script(DilloHtml *html, const char *tag, int tagsize) /* * Handle close SCRIPT */ -static void Html_tag_close_script(DilloHtml *html, int TagIdx) +static void Html_tag_close_script(DilloHtml *html) { /* eventually the stash will be sent to an interpreter for parsing */ } @@ -1698,7 +1698,7 @@ static void Html_tag_open_style(DilloHtml *html, const char *tag, int tagsize) /* * Handle close STYLE */ -static void Html_tag_close_style(DilloHtml *html, int TagIdx) +static void Html_tag_close_style(DilloHtml *html) { if (prefs.parse_embedded_css && html->loadCssFromStash) html->styleEngine->parse(html, NULL, html->Stash->str, html->Stash->len, @@ -1788,7 +1788,7 @@ static void Html_tag_open_body(DilloHtml *html, const char *tag, int tagsize) /* * BODY */ -static void Html_tag_close_body(DilloHtml *html, int TagIdx) +static void Html_tag_close_body(DilloHtml *html) { if (html->Num_BODY == 1) { /* some tag soup pages use multiple BODY tags... */ @@ -2224,7 +2224,7 @@ static void Html_tag_content_map(DilloHtml *html, const char *tag, int tagsize) /* * Handle close <MAP> */ -static void Html_tag_close_map(DilloHtml *html, int TagIdx) +static void Html_tag_close_map(DilloHtml *html) { /* This is a hack for the perhaps frivolous feature of drawing image map * shapes when there is no image to display. If this map is defined after @@ -2495,7 +2495,7 @@ static void Html_tag_open_a(DilloHtml *html, const char *tag, int tagsize) /* * <A> close function */ -static void Html_tag_close_a(DilloHtml *html, int TagIdx) +static void Html_tag_close_a(DilloHtml *html) { html->InVisitedLink = false; } @@ -2527,7 +2527,7 @@ static void Html_tag_open_q(DilloHtml *html, const char *tag, int tagsize) /* * </Q> */ -static void Html_tag_close_q(DilloHtml *html, int TagIdx) +static void Html_tag_close_q(DilloHtml *html) { /* Right Double Quotation Mark */ const char *U201D = "\xe2\x80\x9d"; @@ -2657,7 +2657,7 @@ static void Html_tag_open_li(DilloHtml *html, const char *tag, int tagsize) /* * Close <LI> */ -static void Html_tag_close_li(DilloHtml *html, int TagIdx) +static void Html_tag_close_li(DilloHtml *html) { html->InFlags &= ~IN_LI; ((ListItem *)html->dw)->flush (); @@ -2769,7 +2769,7 @@ static void Html_tag_open_pre(DilloHtml *html, const char *tag, int tagsize) /* * Custom close for <PRE> */ -static void Html_tag_close_pre(DilloHtml *html, int TagIdx) +static void Html_tag_close_pre(DilloHtml *html) { html->InFlags &= ~IN_PRE; } @@ -3023,22 +3023,6 @@ static void Html_tag_open_link(DilloHtml *html, const char *tag, int tagsize) } /* - * Set the history of the menu to be consistent with the active menuitem. - */ -//static void Html_select_set_history(DilloHtmlInput *input) -//{ -// int i; -// -// for (i = 0; i < input->select->num_options; i++) { -// if (GTK_CHECK_MENU_ITEM(input->select->options[i].menuitem)->active) { -// gtk_option_menu_set_history(GTK_OPTION_MENU(input->widget), i); -// break; -// } -// } -//} - - -/* * Set the Document Base URI */ static void Html_tag_open_base(DilloHtml *html, const char *tag, int tagsize) @@ -3107,7 +3091,7 @@ static void Html_tag_open_div(DilloHtml *html, const char *tag, int tagsize) /* * Default close for paragraph tags - pop the stack and break. */ -static void Html_tag_close_par(DilloHtml *html, int TagIdx) +static void Html_tag_close_par(DilloHtml *html) { HT2TB(html)->addParbreak (9, html->styleEngine->wordStyle ()); } diff --git a/src/styleengine.cc b/src/styleengine.cc index 2c7b1d7a..c394887e 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -51,7 +51,7 @@ StyleEngine::StyleEngine (dw::core::Layout *layout) { style_attrs.color = Color::create (layout, 0); style_attrs.backgroundColor = Color::create (layout, 0xffffff); - n->style = Style::create (layout, &style_attrs); + n->style = Style::create (&style_attrs); } StyleEngine::~StyleEngine () { @@ -715,7 +715,7 @@ Style * StyleEngine::backgroundStyle () { assert (attrs.backgroundColor); stack->getRef (stack->size () - 1)->backgroundStyle = - Style::create (layout, &attrs); + Style::create (&attrs); } return stack->getRef (stack->size () - 1)->backgroundStyle; } @@ -757,7 +757,7 @@ Style * StyleEngine::style0 (int i) { postprocessAttrs (&attrs); - stack->getRef (i)->style = Style::create (layout, &attrs); + stack->getRef (i)->style = Style::create (&attrs); return stack->getRef (i)->style; } @@ -771,7 +771,7 @@ Style * StyleEngine::wordStyle0 () { attrs.valign = style ()->valign; - stack->getRef(stack->size() - 1)->wordStyle = Style::create(layout, &attrs); + stack->getRef(stack->size() - 1)->wordStyle = Style::create(&attrs); return stack->getRef (stack->size () - 1)->wordStyle; } diff --git a/src/table.cc b/src/table.cc index 98157e76..41f2b686 100644 --- a/src/table.cc +++ b/src/table.cc @@ -297,7 +297,7 @@ static void Html_set_collapsing_border_model(DilloHtml *html, Widget *col_tb) collapseCellAttrs.borderWidth.bottom = borderWidth; collapseCellAttrs.hBorderSpacing = 0; collapseCellAttrs.vBorderSpacing = 0; - collapseStyle = Style::create(HT2LT(html), &collapseCellAttrs); + collapseStyle = Style::create(&collapseCellAttrs); col_tb->setStyle (collapseStyle); if (Html_table_get_border_model(html) != DILLO_HTML_TABLE_BORDER_COLLAPSE) { @@ -314,7 +314,7 @@ static void Html_set_collapsing_border_model(DilloHtml *html, Widget *col_tb) collapseTableAttrs.borderStyle = collapseCellAttrs.borderStyle; /* CSS2 17.6.2: table does not have padding (in collapsing mode) */ collapseTableAttrs.padding.setVal (0); - collapseStyle = Style::create(HT2LT(html), &collapseTableAttrs); + collapseStyle = Style::create(&collapseTableAttrs); ((dw::Table*)S_TOP(html)->table)->setStyle (collapseStyle); } } @@ -331,7 +331,7 @@ static void Html_set_separate_border_model(DilloHtml *html, Widget *col_tb) separateCellAttrs = *(html->styleEngine->style ()); /* CSS2 17.5: Internal table elements do not have margins */ separateCellAttrs.margin.setVal (0); - separateStyle = Style::create(HT2LT(html), &separateCellAttrs); + separateStyle = Style::create(&separateCellAttrs); col_tb->setStyle (separateStyle); } diff --git a/test/dw_anchors_test.cc b/test/dw_anchors_test.cc index cb839f40..d7201053 100644 --- a/test/dw_anchors_test.cc +++ b/test/dw_anchors_test.cc @@ -130,20 +130,20 @@ int main(int argc, char **argv) styleAttrs.margin.setVal (5); styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - topWidgetStyle = Style::create (layout, &styleAttrs); + topWidgetStyle = Style::create (&styleAttrs); styleAttrs.margin.left = 20; styleAttrs.margin.right = 0; styleAttrs.backgroundColor = NULL; - widgetStyle = Style::create (layout, &styleAttrs); + widgetStyle = Style::create (&styleAttrs); styleAttrs.margin.left = 0; - wordStyle = Style::create (layout, &styleAttrs); + wordStyle = Style::create (&styleAttrs); fontAttrs.size = 28; fontAttrs.weight = 700; styleAttrs.font = dw::core::style::Font::create (layout, &fontAttrs); - headingStyle = Style::create (layout, &styleAttrs); + headingStyle = Style::create (&styleAttrs); Fl::add_timeout (0, textTimeout, NULL); diff --git a/test/dw_border_test.cc b/test/dw_border_test.cc index 988abc33..ec5a09a5 100644 --- a/test/dw_border_test.cc +++ b/test/dw_border_test.cc @@ -65,7 +65,7 @@ int main(int argc, char **argv) styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - Style *widgetStyle1 = Style::create (layout, &styleAttrs); + Style *widgetStyle1 = Style::create (&styleAttrs); styleAttrs.backgroundColor = Color::create (layout, 0xffff80); styleAttrs.margin.setVal (0); @@ -74,7 +74,7 @@ int main(int argc, char **argv) styleAttrs.setBorderStyle (BORDER_SOLID); styleAttrs.padding.setVal (1); - Style *widgetStyle2 = Style::create (layout, &styleAttrs); + Style *widgetStyle2 = Style::create (&styleAttrs); Textblock *textblock1 = new Textblock (false); textblock1->setStyle (widgetStyle1); @@ -87,7 +87,7 @@ int main(int argc, char **argv) styleAttrs.backgroundColor = NULL; styleAttrs.cursor = CURSOR_TEXT; - Style *wordStyle = Style::create (layout, &styleAttrs); + Style *wordStyle = Style::create (&styleAttrs); const char *words1[] = { "Some", "random", "text.", NULL }; const char *words2[] = { "A", "nested", "paragraph.", NULL }; diff --git a/test/dw_example.cc b/test/dw_example.cc index 52aa2440..259650cf 100644 --- a/test/dw_example.cc +++ b/test/dw_example.cc @@ -60,7 +60,7 @@ int main(int argc, char **argv) dw::core::style::Color::create (layout, 0xffffff); dw::core::style::Style *widgetStyle = - dw::core::style::Style::create (layout, &styleAttrs); + dw::core::style::Style::create (&styleAttrs); dw::Textblock *textblock = new dw::Textblock (false); textblock->setStyle (widgetStyle); @@ -72,7 +72,7 @@ int main(int argc, char **argv) styleAttrs.backgroundColor = NULL; dw::core::style::Style *wordStyle = - dw::core::style::Style::create (layout, &styleAttrs); + dw::core::style::Style::create (&styleAttrs); for(int i = 1; i <= 10; i++) { char buf[4]; diff --git a/test/dw_find_test.cc b/test/dw_find_test.cc index e5c79fd3..5bddda10 100644 --- a/test/dw_find_test.cc +++ b/test/dw_find_test.cc @@ -107,15 +107,15 @@ int main(int argc, char **argv) styleAttrs.margin.setVal (10); styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - Style *topWidgetStyle = Style::create (layout, &styleAttrs); + Style *topWidgetStyle = Style::create (&styleAttrs); styleAttrs.margin.setVal (0); styleAttrs.margin.left = 30; styleAttrs.backgroundColor = NULL; - Style *widgetStyle = Style::create (layout, &styleAttrs); + Style *widgetStyle = Style::create (&styleAttrs); styleAttrs.margin.left = 0; - Style *wordStyle = Style::create (layout, &styleAttrs); + Style *wordStyle = Style::create (&styleAttrs); Textblock *textblock = new Textblock (false); textblock->setStyle (topWidgetStyle); diff --git a/test/dw_images_scaled.cc b/test/dw_images_scaled.cc index 2f8896e6..34a72c21 100644 --- a/test/dw_images_scaled.cc +++ b/test/dw_images_scaled.cc @@ -120,7 +120,7 @@ int main(int argc, char **argv) styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - Style *widgetStyle = Style::create (layout, &styleAttrs); + Style *widgetStyle = Style::create (&styleAttrs); Textblock *textblock = new Textblock (false); textblock->setStyle (widgetStyle); @@ -131,7 +131,7 @@ int main(int argc, char **argv) styleAttrs.margin.setVal (0); styleAttrs.backgroundColor = NULL; - Style *imageStyle = Style::create (layout, &styleAttrs); + Style *imageStyle = Style::create (&styleAttrs); image = new dw::Image (""); textblock->addWidget (image, imageStyle); diff --git a/test/dw_images_scaled2.cc b/test/dw_images_scaled2.cc index 2adb1770..81cdd2e8 100644 --- a/test/dw_images_scaled2.cc +++ b/test/dw_images_scaled2.cc @@ -95,7 +95,7 @@ int main(int argc, char **argv) styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - Style *widgetStyle = Style::create (layout, &styleAttrs); + Style *widgetStyle = Style::create (&styleAttrs); Textblock *textblock = new Textblock (false); textblock->setStyle (widgetStyle); @@ -108,7 +108,7 @@ int main(int argc, char **argv) styleAttrs.padding.setVal (0); styleAttrs.backgroundColor = NULL; - Style *wordStyle = Style::create (layout, &styleAttrs); + Style *wordStyle = Style::create (&styleAttrs); styleAttrs.borderWidth.setVal (1); styleAttrs.setBorderColor (Color::create (layout, 0x000080)); @@ -118,7 +118,7 @@ int main(int argc, char **argv) styleAttrs.width = createPerLength (0.25); styleAttrs.height = createPerLength (0.25); - Style *imageStyle1 = Style::create (layout, &styleAttrs); + Style *imageStyle1 = Style::create (&styleAttrs); image1 = new dw::Image ("A longer ALT Text to demonstrate clipping."); textblock->addWidget (image1, imageStyle1); imageStyle1->unref(); @@ -128,7 +128,7 @@ int main(int argc, char **argv) styleAttrs.width = LENGTH_AUTO; styleAttrs.height = LENGTH_AUTO; - Style *imageStyle2 = Style::create (layout, &styleAttrs); + Style *imageStyle2 = Style::create (&styleAttrs); image2 = new dw::Image ("A longer ALT Text to demonstrate clipping."); textblock->addWidget (image2, imageStyle2); imageStyle2->unref(); diff --git a/test/dw_images_simple.cc b/test/dw_images_simple.cc index 8f00f847..34de20ea 100644 --- a/test/dw_images_simple.cc +++ b/test/dw_images_simple.cc @@ -119,7 +119,7 @@ int main(int argc, char **argv) styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - Style *widgetStyle = Style::create (layout, &styleAttrs); + Style *widgetStyle = Style::create (&styleAttrs); Textblock *textblock = new Textblock (false); textblock->setStyle (widgetStyle); @@ -130,7 +130,7 @@ int main(int argc, char **argv) styleAttrs.margin.setVal (0); styleAttrs.backgroundColor = NULL; - Style *imageStyle = Style::create (layout, &styleAttrs); + Style *imageStyle = Style::create (&styleAttrs); image = new dw::Image (""); textblock->addWidget (image, imageStyle); diff --git a/test/dw_links.cc b/test/dw_links.cc index 5622cbd5..79ccbb54 100644 --- a/test/dw_links.cc +++ b/test/dw_links.cc @@ -99,7 +99,7 @@ int main(int argc, char **argv) styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - Style *widgetStyle = Style::create (layout, &styleAttrs); + Style *widgetStyle = Style::create (&styleAttrs); Textblock *textblock = new Textblock (false); textblock->setStyle (widgetStyle); @@ -113,7 +113,7 @@ int main(int argc, char **argv) styleAttrs.backgroundColor = NULL; styleAttrs.cursor = CURSOR_TEXT; - Style *wordStyle = Style::create (layout, &styleAttrs); + Style *wordStyle = Style::create (&styleAttrs); styleAttrs.color = Color::create (layout, 0x0000ff); styleAttrs.textDecoration = TEXT_DECORATION_UNDERLINE; @@ -137,7 +137,7 @@ int main(int argc, char **argv) } styleAttrs.x_link = i; - Style *linkStyle = Style::create (layout, &styleAttrs); + Style *linkStyle = Style::create (&styleAttrs); for(int j = 0; words2[j]; j++) { textblock->addText(words2[j], linkStyle); diff --git a/test/dw_links2.cc b/test/dw_links2.cc index b8e8c55b..acb095f3 100644 --- a/test/dw_links2.cc +++ b/test/dw_links2.cc @@ -128,7 +128,7 @@ int main(int argc, char **argv) styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - Style *widgetStyle = Style::create (layout, &styleAttrs); + Style *widgetStyle = Style::create (&styleAttrs); Textblock *textblock = new Textblock (false); textblock->setStyle (widgetStyle); @@ -142,7 +142,7 @@ int main(int argc, char **argv) styleAttrs.backgroundColor = NULL; styleAttrs.cursor = CURSOR_TEXT; - Style *wordStyle = Style::create (layout, &styleAttrs); + Style *wordStyle = Style::create (&styleAttrs); styleAttrs.color = Color::create (layout, 0x0000ff); styleAttrs.textDecoration = TEXT_DECORATION_UNDERLINE; @@ -166,7 +166,7 @@ int main(int argc, char **argv) } styleAttrs.x_link = i; - Style *linkStyle = Style::create (layout, &styleAttrs); + Style *linkStyle = Style::create (&styleAttrs); for(int j = 0; words2[j]; j++) { textblock->addText (words2[j], linkStyle); diff --git a/test/dw_lists.cc b/test/dw_lists.cc index 12fa1627..2aa0abb7 100644 --- a/test/dw_lists.cc +++ b/test/dw_lists.cc @@ -61,7 +61,7 @@ int main(int argc, char **argv) styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - Style *widgetStyle = Style::create (layout, &styleAttrs); + Style *widgetStyle = Style::create (&styleAttrs); Textblock *textblock = new Textblock (false); textblock->setStyle (widgetStyle); @@ -73,7 +73,7 @@ int main(int argc, char **argv) styleAttrs.backgroundColor = NULL; styleAttrs.cursor = CURSOR_TEXT; - Style *wordStyle = Style::create (layout, &styleAttrs); + Style *wordStyle = Style::create (&styleAttrs); styleAttrs.margin.setVal (5); styleAttrs.padding.setVal (5); @@ -82,7 +82,7 @@ int main(int argc, char **argv) styleAttrs.setBorderStyle (BORDER_SOLID); styleAttrs.borderWidth.setVal (1); - Style *itemStyle = Style::create (layout, &styleAttrs); + Style *itemStyle = Style::create (&styleAttrs); const char *wordsPar[] = { "This", "is", "a", "normal", "paragraph.", "And", diff --git a/test/dw_resource_test.cc b/test/dw_resource_test.cc index a2a26c62..e8a8b227 100644 --- a/test/dw_resource_test.cc +++ b/test/dw_resource_test.cc @@ -62,7 +62,7 @@ int main(int argc, char **argv) styleAttrs.color = Color::create (layout, 0x000000); styleAttrs.backgroundColor = Color::create (layout, 0xffffff); - Style *widgetStyle = Style::create (layout, &styleAttrs); + Style *widgetStyle = Style::create (&styleAttrs); Textblock *textblock = new Textblock (false); textblock->setStyle (widgetStyle); @@ -73,7 +73,7 @@ int main(int argc, char **argv) styleAttrs.margin.setVal (0); styleAttrs.backgroundColor = NULL; - widgetStyle = Style::create (layout, &styleAttrs); + widgetStyle = Style::create (&styleAttrs); SelectionResource *res = layout->getResourceFactory()->createListResource (ListResource::SELECTION_AT_MOST_ONE, 4); diff --git a/test/dw_table.cc b/test/dw_table.cc index 75842e60..5416d05b 100644 --- a/test/dw_table.cc +++ b/test/dw_table.cc @@ -66,7 +66,7 @@ int main(int argc, char **argv) fontAttrs.fontVariant = FONT_VARIANT_NORMAL; styleAttrs.font = dw::core::style::Font::create (layout, &fontAttrs); - Style *tableStyle = Style::create (layout, &styleAttrs); + Style *tableStyle = Style::create (&styleAttrs); Table *table = new Table (false); table->setStyle (tableStyle); @@ -79,14 +79,14 @@ int main(int argc, char **argv) styleAttrs.margin.setVal (0); styleAttrs.padding.setVal (5); - Style *cellStyle = Style::create (layout, &styleAttrs); + Style *cellStyle = Style::create (&styleAttrs); styleAttrs.borderWidth.setVal (0); styleAttrs.margin.setVal (0); styleAttrs.cursor = CURSOR_TEXT; styleAttrs.textAlignChar = '.'; - Style *wordStyle = Style::create (layout, &styleAttrs); + Style *wordStyle = Style::create (&styleAttrs); for (int i = 0; i < 4; i++) { table->addRow (wordStyle); diff --git a/test/dw_table_aligned.cc b/test/dw_table_aligned.cc index 022e7026..96cb0602 100644 --- a/test/dw_table_aligned.cc +++ b/test/dw_table_aligned.cc @@ -66,7 +66,7 @@ int main(int argc, char **argv) styleAttrs.hBorderSpacing = 5; styleAttrs.vBorderSpacing = 5; - Style *tableStyle = Style::create (layout, &styleAttrs); + Style *tableStyle = Style::create (&styleAttrs); Table *table = new Table (false); table->setStyle (tableStyle); @@ -77,7 +77,7 @@ int main(int argc, char **argv) styleAttrs.borderWidth.setVal (1); styleAttrs.setBorderStyle (BORDER_INSET); - Style *cellStyle = Style::create (layout, &styleAttrs); + Style *cellStyle = Style::create (&styleAttrs); styleAttrs.borderWidth.setVal (0); styleAttrs.margin.setVal (0); @@ -85,7 +85,7 @@ int main(int argc, char **argv) styleAttrs.cursor = CURSOR_TEXT; styleAttrs.textAlignChar = '.'; - Style *wordStyle = Style::create (layout, &styleAttrs); + Style *wordStyle = Style::create (&styleAttrs); TableCell *ref = NULL; for(int i = 0; i < 10; i++) { diff --git a/test/dw_ui_test.cc b/test/dw_ui_test.cc index 60893f06..2bcee1c5 100644 --- a/test/dw_ui_test.cc +++ b/test/dw_ui_test.cc @@ -65,7 +65,7 @@ int main(int argc, char **argv) fontAttrs.fontVariant = FONT_VARIANT_NORMAL; styleAttrs.font = dw::core::style::Font::create (layout, &fontAttrs); - Style *tableStyle = Style::create (layout, &styleAttrs); + Style *tableStyle = Style::create (&styleAttrs); Table *table = new Table (false); table->setStyle (tableStyle); @@ -76,7 +76,7 @@ int main(int argc, char **argv) styleAttrs.backgroundColor = NULL; styleAttrs.margin.setVal (0); - Style *cellStyle = Style::create (layout, &styleAttrs); + Style *cellStyle = Style::create (&styleAttrs); // First of all, the resources. Later, they are embedded into the // widget tree. |