From ffdf7684226e067aa9fbd3f94e5fba4408bfd3fe Mon Sep 17 00:00:00 2001 From: jcid Date: Wed, 22 Oct 2008 22:13:21 +0200 Subject: . --- src/uicmd.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/uicmd.cc b/src/uicmd.cc index 564e9957..ac6decb8 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -33,6 +33,8 @@ #include "nav.h" +#define DEFAULT_TAB_LABEL "Dillo" + // Handy macro #define BW2UI(bw) ((UI*)((bw)->ui)) @@ -177,7 +179,7 @@ BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, const void *vbw) win->add(DilloTabs); // Create and set the UI - UI *new_ui = new UI(0, 0, ww, wh, "Label", old_bw ? BW2UI(old_bw) : NULL); + UI *new_ui = new UI(0, 0, ww, wh, DEFAULT_TAB_LABEL, old_bw ? BW2UI(old_bw) : NULL); new_ui->set_status("http://www.dillo.org/"); new_ui->tabs(DilloTabs); @@ -242,7 +244,7 @@ BrowserWindow *UIcmd_tab_new(const void *vbw) vbw); // Create and set the UI - UI *new_ui = new UI(0, 0, ui->w(), ui->h(), "Label", ui); + UI *new_ui = new UI(0, 0, ui->w(), ui->h(), DEFAULT_TAB_LABEL, ui); new_ui->tabs(ui->tabs()); new_ui->tabs()->add(new_ui); -- cgit v1.2.3 From 098e2b5ef7e5e4fe8653924b334f2dbdd0a6e841 Mon Sep 17 00:00:00 2001 From: jcid Date: Thu, 23 Oct 2008 20:55:15 +0200 Subject: - Made cookierc parsing more robust. --- ChangeLog | 7 ++++--- dpi/cookies.c | 3 +-- src/cookies.c | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 614f67e7..cf34ec5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,21 +4,22 @@ Dillo project dillo-2.1 ++- Added ipv6 addresses iteration and ipv4 fallback. + Patch: James Turner, Jorge Arellano +- Added support for numeric IPv6 addresses entered into the url bar. - Used the URL authority part instead of stripped default port in HTTP query. Patches: Justus Winter +- Fix for file inputs without values (forms). - Tuned input width a bit. - Cleaned up resource embedding (forms) + - Made cookierc parsing more robust. Patches: place (AKA corvid) +- Switched SSL enabled to configure.in (./configure --enable-ssl). Patch: Jeremy Henty +- Allowed compilation with older machines by removing a few C99isms. - Added use of inttypes.h when stdint.h isn't found. Patches: Dan Fandrich -+- Added ipv6 addresses iteration and ipv4 fallback. - Patch: James Turner, Jorge Arellano -+- Set the File menu label to hide when the File menu button is shown. ++- Set the File menu label to hide when the File menu-button is shown. ? Trying a new iconv() test in configure.in. Patch: Jorge Arellano diff --git a/dpi/cookies.c b/dpi/cookies.c index bfdf3b3d..63a1b7f8 100644 --- a/dpi/cookies.c +++ b/dpi/cookies.c @@ -1247,12 +1247,11 @@ static int Cookie_control_init(void) j = 0; /* Get the domain */ - while (!isspace(line[i])) + while (line[i] != '\0' && !isspace(line[i])) domain[j++] = line[i++]; domain[j] = '\0'; /* Skip past whitespaces */ - i++; while (isspace(line[i])) i++; diff --git a/src/cookies.c b/src/cookies.c index 1b336b83..b4843a1d 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -254,12 +254,11 @@ static int Cookie_control_init(void) j = 0; /* Get the domain */ - while (!isspace(line[i])) + while (line[i] != '\0' && !isspace(line[i])) domain[j++] = line[i++]; domain[j] = '\0'; /* Skip past whitespaces */ - i++; while (isspace(line[i])) i++; -- cgit v1.2.3 From 78f638749225fccd6d2d912f5ceefb21835033b1 Mon Sep 17 00:00:00 2001 From: jcid Date: Fri, 24 Oct 2008 16:59:01 +0200 Subject: . --- src/table.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/table.cc b/src/table.cc index 589f7e1e..a72411d6 100644 --- a/src/table.cc +++ b/src/table.cc @@ -34,7 +34,7 @@ using namespace dw::core::style; static void Html_tag_open_table_cell(DilloHtml *html, const char *tag, int tagsize, - dw::core::style::TextAlignType text_align); + dw::core::style::TextAlignType text_align); /* * @@ -301,8 +301,9 @@ static void Html_tag_open_table_cell(DilloHtml *html, if (S_TOP(html)->style->textAlign == TEXT_ALIGN_STRING) - col_tb = new dw::TableCell (((dw::Table*)S_TOP(html)->table)->getCellRef (), - prefs.limit_text_width); + col_tb = new dw::TableCell ( + ((dw::Table*)S_TOP(html)->table)->getCellRef (), + prefs.limit_text_width); else col_tb = new Textblock (prefs.limit_text_width); -- cgit v1.2.3 From 989c6785ff153d4a84a176639420aa1837ead2d7 Mon Sep 17 00:00:00 2001 From: jcid Date: Sun, 26 Oct 2008 19:21:51 +0100 Subject: - Added the "middle_click_drags_page" dillorc option. --- ChangeLog | 2 ++ dillorc | 5 +++++ src/html.cc | 2 ++ src/prefs.c | 6 ++++++ src/prefs.h | 1 + src/ui.cc | 10 ++++++++++ src/ui.hh | 3 +++ src/uicmd.cc | 16 ++++++++++++++++ src/uicmd.hh | 3 ++- 9 files changed, 47 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index cf34ec5d..9a65c1d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,8 @@ dillo-2.1 +- Allowed compilation with older machines by removing a few C99isms. - Added use of inttypes.h when stdint.h isn't found. Patches: Dan Fandrich ++- Added the "middle_click_drags_page" dillorc option. + Patch: Jorge Arellano, Thomas Orgis +- Set the File menu label to hide when the File menu-button is shown. ? Trying a new iconv() test in configure.in. Patch: Jorge Arellano diff --git a/dillorc b/dillorc index 05debda6..e61b1c40 100644 --- a/dillorc +++ b/dillorc @@ -203,6 +203,11 @@ # If you prefer to open a new Window instead, set it to NO. #middle_click_opens_new_tab=YES +# Mouse middle click by default drives drag-scrolling. +# To paste an URL into the window instead of scrolling, set it to NO. +# Note: You could always paste the URL onto the URL box clear button. +#middle_click_drags_page=YES + # Focus follows new Tabs. # You can hold SHIFT to temporarily revert this behaviour. #focus_new_tab=YES diff --git a/src/html.cc b/src/html.cc index cc2c236a..248091aa 100644 --- a/src/html.cc +++ b/src/html.cc @@ -732,10 +732,12 @@ bool DilloHtml::HtmlLinkReceiver::enter (Widget *widget, int link, int img, if (link == -1) { _MSG(" Link LEAVE notify...\n"); a_UIcmd_set_msg(bw, ""); + a_UIcmd_set_pointer_on_link(bw, FALSE); } else { _MSG(" Link ENTER notify...\n"); Html_set_link_coordinates(html, link, x, y); a_UIcmd_set_msg(bw, "%s", URL_STR(html->links->get(link))); + a_UIcmd_set_pointer_on_link(bw, TRUE); } return true; } diff --git a/src/prefs.c b/src/prefs.c index 10e87d0c..29ed9442 100644 --- a/src/prefs.c +++ b/src/prefs.c @@ -61,6 +61,7 @@ DilloPrefs prefs; /* define enumeration values to be returned for specific symbols */ typedef enum { + DRC_TOKEN_MIDDLE_CLICK_DRAGS_PAGE, DRC_TOKEN_ALLOW_WHITE_BG, DRC_TOKEN_BG_COLOR, DRC_TOKEN_CONTRAST_VISITED_COLOR, @@ -141,6 +142,7 @@ static const SymNode_t symbols[] = { { "limit_text_width", DRC_TOKEN_LIMIT_TEXT_WIDTH }, { "link_color", DRC_TOKEN_LINK_COLOR }, { "load_images", DRC_TOKEN_LOAD_IMAGES }, + { "middle_click_drags_page", DRC_TOKEN_MIDDLE_CLICK_DRAGS_PAGE }, { "middle_click_opens_new_tab", DRC_TOKEN_MIDDLE_CLICK_OPENS_NEW_TAB }, { "no_proxy", DRC_TOKEN_NOPROXY }, { "panel_size", DRC_TOKEN_PANEL_SIZE }, @@ -236,6 +238,9 @@ static int Prefs_parse_pair(char *name, char *value) case DRC_TOKEN_ALLOW_WHITE_BG: prefs.allow_white_bg = (strcmp(value, "YES") == 0); break; + case DRC_TOKEN_MIDDLE_CLICK_DRAGS_PAGE: + prefs.middle_click_drags_page = (strcmp(value, "YES") == 0); + break; case DRC_TOKEN_FORCE_MY_COLORS: prefs.force_my_colors = (strcmp(value, "YES") == 0); break; @@ -459,6 +464,7 @@ void a_Prefs_init(void) prefs.save_dir = dStrdup(D_SAVE_DIR); prefs.show_msg = TRUE; prefs.show_extra_warnings = FALSE; + prefs.middle_click_drags_page = TRUE; /* this locale stuff is to avoid parsing problems with float numbers */ old_locale = dStrdup (setlocale (LC_NUMERIC, NULL)); diff --git a/src/prefs.h b/src/prefs.h index 7a409631..ec807f46 100644 --- a/src/prefs.h +++ b/src/prefs.h @@ -62,6 +62,7 @@ struct _DilloPrefs { char *save_dir; bool_t show_msg; bool_t show_extra_warnings; + bool_t middle_click_drags_page; }; /* Global Data */ diff --git a/src/ui.cc b/src/ui.cc index 87fab74f..47c6d220 100644 --- a/src/ui.cc +++ b/src/ui.cc @@ -625,6 +625,8 @@ UI::UI(int x, int y, int ww, int wh, const char* label, const UI *cur_ui) : if (f) this->labelfont(f); + PointerOnLink = FALSE; + Tabs = NULL; TabTooltip = NULL; TopGroup = new PackedGroup(0, 0, ww, wh); @@ -801,6 +803,14 @@ int UI::handle(int event) ret = 1; } } + + } else if (event == PUSH) { + if (prefs.middle_click_drags_page == 0 && + event_button() == MiddleButton && + !a_UIcmd_pointer_on_link(a_UIcmd_get_bw_by_widget(this))) { + paste_url(); + ret = 1; + } } if (!ret) diff --git a/src/ui.hh b/src/ui.hh index 7a302efd..926a800f 100644 --- a/src/ui.hh +++ b/src/ui.hh @@ -64,6 +64,7 @@ class UI : public fltk::Group { UIPanelmode Panelmode; Findbar *findbar; + int PointerOnLink; PackedGroup *make_toolbar(int tw, int th); PackedGroup *make_location(); @@ -103,6 +104,8 @@ public: CustTabGroup *tabs() { return Tabs; } void tabs(CustTabGroup *tabs) { Tabs = tabs; } + int pointerOnLink() { return PointerOnLink; } + void pointerOnLink(int flag) { PointerOnLink = flag; } // Hooks to method callbacks void panel_cb_i(); diff --git a/src/uicmd.cc b/src/uicmd.cc index ac6decb8..e315417e 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -913,6 +913,22 @@ void a_UIcmd_set_buttons_sens(BrowserWindow *bw) BW2UI(bw)->button_set_sens(UI_FORW, sens); } +/* + * Keep track of mouse pointer over a link. + */ +void a_UIcmd_set_pointer_on_link(BrowserWindow *bw, int flag) +{ + BW2UI(bw)->pointerOnLink(flag); +} + +/* + * Is the mouse pointer over a link? + */ +int a_UIcmd_pointer_on_link(BrowserWindow *bw) +{ + return BW2UI(bw)->pointerOnLink(); +} + /* * Toggle control panel (aka. fullscreen) */ diff --git a/src/uicmd.hh b/src/uicmd.hh index 02dbae8a..c4e34736 100644 --- a/src/uicmd.hh +++ b/src/uicmd.hh @@ -73,7 +73,8 @@ bool_t a_UIcmd_get_images_enabled(BrowserWindow *bw); void a_UIcmd_set_images_enabled(BrowserWindow *bw, int flag); void a_UIcmd_set_buttons_sens(BrowserWindow *bw); void a_UIcmd_fullscreen_toggle(BrowserWindow *bw); - +void a_UIcmd_set_pointer_on_link(BrowserWindow *bw, int flag); +int a_UIcmd_pointer_on_link(BrowserWindow *bw); #ifdef __cplusplus } -- cgit v1.2.3 From 3309d5e5590c510f8518cb2cce4cd555df2211e5 Mon Sep 17 00:00:00 2001 From: jcid Date: Thu, 30 Oct 2008 18:23:03 +0100 Subject: - Reduced warnings with gcc-4.3. --- ChangeLog | 2 ++ dpi/downloads.cc | 2 +- dw/findtext.hh | 2 +- dw/style.hh | 4 ++-- lout/object.cc | 4 ++-- src/dialog.cc | 2 +- src/html.cc | 18 +++++++++--------- src/uicmd.cc | 3 ++- src/url.h | 12 ++++++------ 9 files changed, 26 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 3c5bb149..ec75e075 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,8 @@ dillo-2.1 +- Allowed compilation with older machines by removing a few C99isms. - Added use of inttypes.h when stdint.h isn't found. Patches: Dan Fandrich ++- Reduced warnings with gcc-4.3. + Patch: Thomas Orgis +- Added the "middle_click_drags_page" dillorc option. Patch: Jorge Arellano, Thomas Orgis +- Set the File menu label to hide when the File menu-button is shown. diff --git a/dpi/downloads.cc b/dpi/downloads.cc index d2f3a54b..9252d4cf 100644 --- a/dpi/downloads.cc +++ b/dpi/downloads.cc @@ -513,7 +513,7 @@ void DLItem::log_text_add(const char *buf, ssize_t st) if (isdigit(*q++ = *p)) { // keep here } else if (*p == 'K') { - for(--q; isdigit(q[-1]); --q); log_state = ST_discard; + for(--q; isdigit(q[-1]); --q) ; log_state = ST_discard; } else { log_state = ST_copy; } diff --git a/dw/findtext.hh b/dw/findtext.hh index d0c20206..e9fb57c2 100644 --- a/dw/findtext.hh +++ b/dw/findtext.hh @@ -65,7 +65,7 @@ private: inline static bool charsEqual (char c1, char c2, bool caseSens) { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) || - isspace (c1) && isspace (c2); } + (isspace (c1) && isspace (c2)); } public: FindtextState (); diff --git a/dw/style.hh b/dw/style.hh index 492efd30..0dd7fbd4 100644 --- a/dw/style.hh +++ b/dw/style.hh @@ -346,11 +346,11 @@ inline Length createAbsLength(int n) { return (n << 2) | 1; } /** \brief Returns a percentage, \em v is relative to 1, not to 100. */ inline Length createPerLength(double v) { - return (int)(v * (1 << 18)) & ~3 | 2; } + return ((int)(v * (1 << 18)) & ~3) | 2; } /** \brief Returns a relative length. */ inline Length createRelLength(double v) { - return (int)(v * (1 << 18)) & ~3 | 3; } + return ((int)(v * (1 << 18)) & ~3) | 3; } /** \brief Returns true if \em l is an absolute length. */ inline bool isAbsLength(Length l) { return (l & 3) == 1; } diff --git a/lout/object.cc b/lout/object.cc index 7da124fa..9e36e20c 100644 --- a/lout/object.cc +++ b/lout/object.cc @@ -251,7 +251,7 @@ bool PairBase::equals(Object *other) return // Identical? - this == other || + this == other || ( (// Both first parts are NULL, ... (first == NULL && otherPair->first == NULL) || // ... or both first parts are not NULL and equal @@ -260,7 +260,7 @@ bool PairBase::equals(Object *other) // Same with second part. ((second == NULL && otherPair->second == NULL) || (second != NULL && otherPair->second != NULL - && second->equals (otherPair->second))); + && second->equals (otherPair->second)))); } int PairBase::hashValue() diff --git a/src/dialog.cc b/src/dialog.cc index 69781f32..8408782f 100644 --- a/src/dialog.cc +++ b/src/dialog.cc @@ -193,7 +193,7 @@ int a_Dialog_choice5(const char *QuestionTxt, txt[0] = txt[6] = NULL; txt[1] = alt1; txt[2] = alt2; txt[3] = alt3; txt[4] = alt4; txt[5] = alt5; - for (int i=1; txt[i]; ++i, ++nb); + for (int i=1; txt[i]; ++i, ++nb) ; Window *window = new Window(ww,wh,"Choice5"); window->begin(); diff --git a/src/html.cc b/src/html.cc index 248091aa..88607395 100644 --- a/src/html.cc +++ b/src/html.cc @@ -1007,7 +1007,7 @@ static int Html_parse_entity(DilloHtml *html, const char *token, } else if (isalpha(*s)) { /* character entity reference */ - while (*++s && (isalnum(*s) || strchr(":_.-", *s))); + while (*++s && (isalnum(*s) || strchr(":_.-", *s))) ; c = *s; *s = 0; @@ -1187,10 +1187,10 @@ static void Html_process_word(DilloHtml *html, const char *word, int size) Pword = a_Html_parse_entities(html, word, size); for (start = i = 0; Pword[i]; start = i) if (isspace(Pword[i])) { - while (Pword[++i] && isspace(Pword[i])); + while (Pword[++i] && isspace(Pword[i])) ; Html_process_space(html, Pword + start, i - start); } else { - while (Pword[++i] && !isspace(Pword[i])); + while (Pword[++i] && !isspace(Pword[i])) ; ch = Pword[i]; Pword[i] = 0; DW2TB(html->dw)->addText(Pword, S_TOP(html)->style); @@ -1209,7 +1209,7 @@ static void Html_process_word(DilloHtml *html, const char *word, int size) Pword = a_Html_parse_entities(html, word, size); for (i = 0; Pword[i]; ++i) if (strchr("\t\f\n\r", Pword[i])) - for (j = i; (Pword[j] = Pword[j+1]); ++j); + for (j = i; (Pword[j] = Pword[j+1]); ++j) ; DW2TB(html->dw)->addText(Pword, S_TOP(html)->style); dFree(Pword); @@ -1331,8 +1331,8 @@ static void Html_tag_cleanup_at_close(DilloHtml *html, int TagIdx) (cmp = (new_idx != html->stack->getRef(stack_idx)->tag_idx)) && ((w3c_mode && Tags[html->stack->getRef(stack_idx)->tag_idx].EndTag == 'O') || - (!w3c_mode && - (Tags[html->stack->getRef(stack_idx)->tag_idx].EndTag == 'O') || + ((!w3c_mode && + (Tags[html->stack->getRef(stack_idx)->tag_idx].EndTag == 'O')) || Tags[html->stack->getRef(stack_idx)->tag_idx].TagLevel < Tags[new_idx].TagLevel))) { --stack_idx; @@ -1516,7 +1516,7 @@ static void Html_parse_doctype(DilloHtml *html, const char *tag, int tagsize) * and replace '\n' and '\r' with ' ' inside quoted strings. */ for (i = 0, p = ntag; *p; ++p) { if (isspace(*p)) { - for (ntag[i++] = ' '; isspace(p[1]); ++p); + for (ntag[i++] = ' '; isspace(p[1]); ++p) ; } else if ((quote = *p) == '"' || *p == '\'') { for (ntag[i++] = *p++; (ntag[i++] = *p) && *p != quote; ++p) { if (*p == '\n' || *p == '\r') @@ -2945,7 +2945,7 @@ static void Html_tag_open_meta(DilloHtml *html, const char *tag, int tagsize) sprintf(delay_str, "."); /* Skip to anything after "URL=" */ - while (*content && *(content++) != '='); + while (*content && *(content++) != '=') ; /* Send a custom HTML message. * TODO: This is a hairy hack, @@ -3766,7 +3766,7 @@ static int Html_write_raw(DilloHtml *html, char *buf, int bufsize, int Eof) if (isspace(buf[buf_index])) { /* whitespace: group all available whitespace */ - while (++buf_index < bufsize && isspace(buf[buf_index])); + while (++buf_index < bufsize && isspace(buf[buf_index])) ; Html_process_space(html, buf + token_start, buf_index - token_start); token_start = buf_index; diff --git a/src/uicmd.cc b/src/uicmd.cc index e315417e..c093f73e 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -85,11 +85,12 @@ public: void remove (Widget *w) { TabGroup::remove (w); /* fixup resizable in case we just removed it */ - if (resizable () == w) + if (resizable () == w) { if (children () > 0) resizable (child (children () - 1)); else resizable (NULL); + } if (children () < 2) hideLabels (); diff --git a/src/url.h b/src/url.h index 32b173e6..02e89539 100644 --- a/src/url.h +++ b/src/url.h @@ -95,12 +95,12 @@ extern "C" { struct _DilloUrl { Dstr *url_string; const char *buffer; - const char *scheme; // - const char *authority; // - const char *path; // These are references only - const char *query; // (no need to free them) - const char *fragment; // - const char *hostname; // + const char *scheme; /**/ + const char *authority; /**/ + const char *path; /* These are references only */ + const char *query; /* (no need to free them) */ + const char *fragment; /**/ + const char *hostname; /**/ int port; int flags; Dstr *data; /* POST */ -- cgit v1.2.3 From 8d11ae65472e4a9c70476f9b165df7a114d06908 Mon Sep 17 00:00:00 2001 From: jcid Date: Wed, 5 Nov 2008 19:11:02 +0100 Subject: - Cleaned up and normalized D_SUN_LEN usage. --- ChangeLog | 1 + dpi/bookmarks.c | 5 ----- dpi/cookies.c | 6 ------ dpi/https.c | 2 +- dpid/dpid.c | 2 +- src/IO/dpi.c | 6 +++--- 6 files changed, 6 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index debba0a8..3592f376 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ dillo-2.1 +- Switched SSL-enabled to configure.in (./configure --enable-ssl). - Standardised the installation of dpid/dpidrc with auto* tools. - Set the ScrollGroup as the resizable widget in downloads dpi. + - Cleaned up and normalized D_SUN_LEN usage. Patches: Jeremy Henty +- Allowed compilation with older machines by removing a few C99isms. - Added use of inttypes.h when stdint.h isn't found. diff --git a/dpi/bookmarks.c b/dpi/bookmarks.c index e5447331..a20d8ef6 100644 --- a/dpi/bookmarks.c +++ b/dpi/bookmarks.c @@ -44,11 +44,6 @@ #define _MSG(...) #define MSG(...) printf("[bookmarks dpi]: " __VA_ARGS__) -/* This one is tricky, some sources state it should include the byte - * for the terminating NULL, and others say it shouldn't. */ -# define D_SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ - + strlen ((ptr)->sun_path)) - #define DOCTYPE \ "\n" diff --git a/dpi/cookies.c b/dpi/cookies.c index 63a1b7f8..5b5bc35d 100644 --- a/dpi/cookies.c +++ b/dpi/cookies.c @@ -64,12 +64,6 @@ int main(void) #define MSG(...) printf("[cookies dpi]: " __VA_ARGS__) -/* This one is tricky, some sources state it should include the byte - * for the terminating NULL, and others say it shouldn't. */ -# define D_SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \ - + strlen ((ptr)->sun_path)) - - /* * a_List_add() * diff --git a/dpi/https.c b/dpi/https.c index 33c9b2d6..fff0be3b 100644 --- a/dpi/https.c +++ b/dpi/https.c @@ -25,7 +25,7 @@ * the https dillo plugin with the OpenSSL project's "OpenSSL" * library, and distribute the linked executables, without including * the source code for OpenSSL in the source distribution. You must - * obey the GNU General Public License, version 2, in all respects + * obey the GNU General Public License, version 3, in all respects * for all of the code used other than "OpenSSL". * */ diff --git a/dpid/dpid.c b/dpid/dpid.c index 97e6414d..2eed0f02 100644 --- a/dpid/dpid.c +++ b/dpid/dpid.c @@ -728,7 +728,6 @@ void stop_active_dpis(struct dp *dpi_attr_list, int numdpis) DpiBye_cmd = a_Dpip_build_cmd("cmd=%s", "DpiBye"); sun_path_len = sizeof(sa.sun_path); - addr_len = sizeof(dpi_addr); dpi_addr.sun_family = AF_LOCAL; @@ -746,6 +745,7 @@ void stop_active_dpis(struct dp *dpi_attr_list, int numdpis) MSG_ERR("\n - socket path = %s\n", dpi_attr_list[i].sockpath); } strncpy(dpi_addr.sun_path, dpi_attr_list[i].sockpath, sun_path_len); + addr_len = D_SUN_LEN(&dpi_addr); if (connect(dpi_socket, (struct sockaddr *) &dpi_addr, addr_len) == -1) { ERRMSG("stop_active_dpis", "connect", errno); MSG_ERR("%s\n", dpi_addr.sun_path); diff --git a/src/IO/dpi.c b/src/IO/dpi.c index 7c4357da..01d3a5b5 100644 --- a/src/IO/dpi.c +++ b/src/IO/dpi.c @@ -353,7 +353,7 @@ static int Dpi_check_uds(char *uds_name) strncpy(pun.sun_path, uds_name, sizeof (pun.sun_path)); if ((SockFD = socket(AF_LOCAL, SOCK_STREAM, 0)) == -1 || - connect(SockFD, (void*)&pun, D_SUN_LEN(&pun)) == -1) { + connect(SockFD, (struct sockaddr *) &pun, D_SUN_LEN(&pun)) == -1) { MSG("Dpi_check_uds: %s %s\n", dStrerror(errno), uds_name); } else { Dpi_close_fd(SockFD); @@ -497,7 +497,7 @@ static char *Dpi_get_server_uds_name(const char *server_name) _MSG("dpid_uds_name = [%s]\n", dpid_uds_name); strncpy(dpid.sun_path, dpid_uds_name, sizeof(dpid.sun_path)); - if (connect(sock, (struct sockaddr *) &dpid, sizeof(dpid)) == -1) + if (connect(sock, (struct sockaddr *) &dpid, D_SUN_LEN(&dpid)) == -1) perror("connect"); /* ask dpid to check the server plugin and send its UDS name back */ request = a_Dpip_build_cmd("cmd=%s msg=%s", "check_server", server_name); @@ -717,7 +717,6 @@ void a_Dpi_bye_dpid() srs_name = Dpi_get_dpid_uds_name(); sun_path_len = sizeof(sa.sun_path); - addr_len = sizeof(sa); sa.sun_family = AF_LOCAL; @@ -725,6 +724,7 @@ void a_Dpi_bye_dpid() MSG("a_Dpi_bye_dpid: %s\n", dStrerror(errno)); } strncpy(sa.sun_path, srs_name, sizeof (sa.sun_path)); + addr_len = D_SUN_LEN(&sa); if (connect(new_socket, (struct sockaddr *) &sa, addr_len) == -1) { MSG("a_Dpi_bye_dpid: %s\n", dStrerror(errno)); MSG("%s\n", sa.sun_path); -- cgit v1.2.3 From 7ae4abd9c6779fd721fc5a012cddb94493ea97d9 Mon Sep 17 00:00:00 2001 From: jcid Date: Sun, 9 Nov 2008 13:17:56 +0100 Subject: - Switched a_UIcmd_save() to take its URL from history (not location bar). --- ChangeLog | 1 + src/uicmd.cc | 29 +++++++++++++---------------- 2 files changed, 14 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 3592f376..ca1bffd4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,7 @@ dillo-2.1 - Tuned input width a bit. - Cleaned up resource embedding (forms) - Made cookierc parsing more robust. + - Switched a_UIcmd_save() to take its URL from history (not location bar). Patches: place (AKA corvid) +- Switched SSL-enabled to configure.in (./configure --enable-ssl). - Standardised the installation of dpid/dpidrc with auto* tools. diff --git a/src/uicmd.cc b/src/uicmd.cc index c093f73e..9534a7fb 100644 --- a/src/uicmd.cc +++ b/src/uicmd.cc @@ -484,24 +484,21 @@ void a_UIcmd_set_save_dir(const char *dir) void a_UIcmd_save(void *vbw) { const char *name; - char *SuggestedName, *urlstr; - DilloUrl *url; - - a_UIcmd_set_save_dir(prefs.save_dir); - - urlstr = a_UIcmd_get_location_text((BrowserWindow*)vbw); - url = a_Url_new(urlstr, NULL); - SuggestedName = UIcmd_make_save_filename(URL_PATH(url)); - name = a_Dialog_save_file("Save Page as File", NULL, SuggestedName); - MSG("a_UIcmd_save: %s\n", name); - dFree(SuggestedName); - dFree(urlstr); + char *SuggestedName; + BrowserWindow *bw = (BrowserWindow *)vbw; + const DilloUrl *url = a_History_get_url(NAV_TOP_UIDX(bw)); - if (name) { - a_Nav_save_url((BrowserWindow*)vbw, url, name); - } + if (url) { + a_UIcmd_set_save_dir(prefs.save_dir); + SuggestedName = UIcmd_make_save_filename(URL_PATH(url)); + name = a_Dialog_save_file("Save Page as File", NULL, SuggestedName); + MSG("a_UIcmd_save: %s\n", name); + dFree(SuggestedName); - a_Url_free(url); + if (name) { + a_Nav_save_url(bw, url, name); + } + } } /* -- cgit v1.2.3 From 1685afb2c6fc9570dc841ff5f5099cec9124252b Mon Sep 17 00:00:00 2001 From: jcid Date: Sun, 9 Nov 2008 14:09:09 +0100 Subject: - Made the DNS resolver report in numeric address notation. --- ChangeLog | 2 ++ src/dns.c | 34 ++++++++++++++++++++++++++++++++-- src/dns.h | 2 +- 3 files changed, 35 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index ca1bffd4..f3e13f45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,8 @@ dillo-2.1 +- Allowed compilation with older machines by removing a few C99isms. - Added use of inttypes.h when stdint.h isn't found. Patches: Dan Fandrich ++- Made the DNS resolver report in numeric address notation. + Patch: Justus Winter +- Reduced warnings with gcc-4.3. Patch: Thomas Orgis +- Added the "middle_click_drags_page" dillorc option. diff --git a/src/dns.c b/src/dns.c index 4ff2cb76..5c47aee5 100644 --- a/src/dns.c +++ b/src/dns.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -268,6 +269,8 @@ static void *Dns_server(void *data) struct addrinfo hints, *res0; int error; Dlist *hosts; + size_t length, i; + char addr_string[40]; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; @@ -307,8 +310,18 @@ static void *Dns_server(void *data) } /* tell our findings */ - MSG("Dns_server [%d]: %s is %p\n", channel, - dns_server[channel].hostname, hosts); + MSG("Dns_server [%d]: %s is", channel, + dns_server[channel].hostname); + if ((length = dList_length(hosts))) { + for (i = 0; i < length; i++) { + a_Dns_dillohost_to_string(dList_nth_data(hosts, i), + addr_string, sizeof(addr_string)); + MSG(" %s", addr_string); + } + MSG("\n"); + } else { + MSG(" (nil)\n"); + } dns_server[channel].addr_list = hosts; dns_server[channel].ip_ready = TRUE; @@ -482,3 +495,20 @@ void a_Dns_freeall(void) dFree(dns_cache); } +/* + * Writes a string representation of the given DilloHost + * into dst. dst will be \0 terminated. + * Please note that dst must be at least 40 bytes long for IPv6 + * addresses. + */ +void a_Dns_dillohost_to_string(DilloHost *host, char *dst, size_t size) +{ + if (!inet_ntop(host->af, host->data, dst, size)) { + switch (errno) { + case EAFNOSUPPORT: + snprintf(dst, size, "Unknown address family"); + case ENOSPC: + snprintf(dst, size, "Buffer too small"); + } + } +} diff --git a/src/dns.h b/src/dns.h index 1749044f..fca28727 100644 --- a/src/dns.h +++ b/src/dns.h @@ -22,7 +22,7 @@ typedef struct _DilloHost int alen; char data[DILLO_ADDR_MAX]; } DilloHost; - +void a_Dns_dillohost_to_string(DilloHost *host, char *dst, size_t size); #ifdef __cplusplus } -- cgit v1.2.3 From 738baf46845187b39922573816922281ca276f14 Mon Sep 17 00:00:00 2001 From: jcid Date: Mon, 10 Nov 2008 15:00:04 +0100 Subject: - Set prefs.vw_fontname as deafult font for the UI. --- ChangeLog | 1 + src/dillo.cc | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index f3e13f45..16c88689 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,7 @@ dillo-2.1 - Cleaned up resource embedding (forms) - Made cookierc parsing more robust. - Switched a_UIcmd_save() to take its URL from history (not location bar). + - Set prefs.vw_fontname as deafult font for the UI. Patches: place (AKA corvid) +- Switched SSL-enabled to configure.in (./configure --enable-ssl). - Standardised the installation of dpid/dpidrc with auto* tools. diff --git a/src/dillo.cc b/src/dillo.cc index 7e29ac32..c20d1f02 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -26,6 +26,7 @@ #include #include +#include #include #include "msg.h" @@ -108,6 +109,12 @@ int main(int argc, char **argv) // WORKAROUND: sometimes the default pager triggers redraw storms fltk::TabGroup::default_pager(fltk::PAGER_SHRINK); + fltk::Font *dfont = fltk::font(prefs.vw_fontname, 0); + if (dfont) { + fltk::Widget::default_style->textfont(dfont); + fltk::Widget::default_style->labelfont(dfont); + } + // Create a new UI/bw pair BrowserWindow *bw = a_UIcmd_browser_window_new(0, 0, NULL); -- cgit v1.2.3 From e70b960ae5c27dfbda861dec25f57d5d83a2f64e Mon Sep 17 00:00:00 2001 From: jcid Date: Mon, 10 Nov 2008 18:50:00 +0100 Subject: - Fixed the proxy URL parameter for Http_must_use_proxy(). --- ChangeLog | 2 ++ src/IO/http.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index 6e2e78f2..cd0eb14b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,8 @@ dillo-2.1 Patch: Justus Winter +- Reduced warnings with gcc-4.3. Patch: Thomas Orgis ++- Fixed the proxy URL parameter for Http_must_use_proxy(). + Patch: David McKee +- Added the "middle_click_drags_page" dillorc option. Patch: Jorge Arellano, Thomas Orgis +- Set the File menu label to hide when the File menu-button is shown. diff --git a/src/IO/http.c b/src/IO/http.c index 692a9520..bcb78b1f 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -459,7 +459,7 @@ static int Http_get(ChainLink *Info, void *Data1) S->Info = Info; /* Proxy support */ - if (Http_must_use_proxy(S->web->url)) { + if (Http_must_use_proxy(URL_HOST(S->web->url))) { hostname = dStrdup(URL_HOST(HTTP_Proxy)); S->port = URL_PORT(HTTP_Proxy); S->use_proxy = TRUE; -- cgit v1.2.3 From 09835eb26ffd2df0a3b9988f3d8b3f82ef0a4226 Mon Sep 17 00:00:00 2001 From: jcid Date: Tue, 11 Nov 2008 13:53:18 +0100 Subject: - removed the tab labelfont setting --- src/ui.cc | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/ui.cc b/src/ui.cc index 47c6d220..b47e11cf 100644 --- a/src/ui.cc +++ b/src/ui.cc @@ -621,10 +621,6 @@ UI::UI(int x, int y, int ww, int wh, const char* label, const UI *cur_ui) : { int s_h = 20; - Font *f = font(prefs.vw_fontname, 0); - if (f) - this->labelfont(f); - PointerOnLink = FALSE; Tabs = NULL; -- cgit v1.2.3 From 41fcd4d8148404ebcad1ed19f11858a4b502148e Mon Sep 17 00:00:00 2001 From: jcid Date: Tue, 11 Nov 2008 15:15:58 +0100 Subject: - Allowed the rc parser to skip whitespace around the equal sign. --- ChangeLog | 5 ++--- dlib/dlib.c | 4 ++++ src/IO/http.c | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/ChangeLog b/ChangeLog index cd0eb14b..7589c70a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,13 +29,12 @@ dillo-2.1 Patch: Justus Winter +- Reduced warnings with gcc-4.3. Patch: Thomas Orgis -+- Fixed the proxy URL parameter for Http_must_use_proxy(). - Patch: David McKee +- Added the "middle_click_drags_page" dillorc option. Patch: Jorge Arellano, Thomas Orgis +- Set the File menu label to hide when the File menu-button is shown. ? Trying a new iconv() test in configure.in. - Patch: Jorge Arellano + - Allowed the rc parser to skip whitespace around the equal sign. + Patches: Jorge Arellano dw diff --git a/dlib/dlib.c b/dlib/dlib.c index 76797af5..0f318134 100644 --- a/dlib/dlib.c +++ b/dlib/dlib.c @@ -776,6 +776,10 @@ int dParser_get_rc_pair(char **line, char **name, char **value) *p = 0; *name = *line; + /* skip whitespace */ + if (p < eq) + for (++p; isspace(*p); ++p); + /* get value */ if (p == eq) { for (++p; isspace(*p); ++p); diff --git a/src/IO/http.c b/src/IO/http.c index bcb78b1f..2c50e829 100644 --- a/src/IO/http.c +++ b/src/IO/http.c @@ -398,6 +398,7 @@ static int Http_must_use_proxy(const DilloUrl *url) dFree(np); } } + _MSG("Http_must_use_proxy: %s\n %s\n", URL_STR(url), ret ? "YES":"NO"); return ret; } @@ -459,7 +460,7 @@ static int Http_get(ChainLink *Info, void *Data1) S->Info = Info; /* Proxy support */ - if (Http_must_use_proxy(URL_HOST(S->web->url))) { + if (Http_must_use_proxy(S->web->url)) { hostname = dStrdup(URL_HOST(HTTP_Proxy)); S->port = URL_PORT(HTTP_Proxy); S->use_proxy = TRUE; -- cgit v1.2.3