changeset 4:9a9338f78888

+- Connected signals to <li> elements (fixes links within lists). - Enabled text and background color-choice in preferences. - Enabled clicking over image links. Patches: place +- Fixed a va_list-related SEGFAULT on 64bit-arch in dStr_vsprintfa(). Patch: Vincent Thomasset +- Fixed void to int conversions for 64bit-arch. Patch: Jorge Arellano, higuita +- Added a strndup() replacement in dw2 Patch: Alexander Becher, Johannes Hofmann, Jorge Arellano +- Fixed calcHashValue() to only return non-negative numbers (was SEGFAULT). - Improved scrolling performance on large pages by copying screen data instead of rendering. Patches: Johannes Hofmann
author jcid
date Thu, 11 Oct 2007 20:55:12 +0200
parents 05a33a2ac9ba
children 17a3024e47ff
files ChangeLog dlib/dlib.c dlib/dlib.h src/IO/IO.c src/dns.c src/html.cc src/menu.cc src/plain.cc src/ui.cc src/web.cc
diffstat 10 files changed, 34 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 08 16:07:55 2007 +0200
+++ b/ChangeLog	Thu Oct 11 20:55:12 2007 +0200
@@ -4,7 +4,7 @@
 
 dillo-fltk2
 
- - Ported Dillo from GTK1 to FLTK2.
++- Ported Dillo from GTK1 to FLTK2.
  - Ported a susbstantial part of the code from C to C++ (FLTK2 is in C++).
  - Wrote a new library: Dlib. With "Dlib" Dillo doesn't need glib anymore.
  - Ported all the code to Dlib.
@@ -31,8 +31,20 @@
  - Rewrote the DNS API and the Dpid start code inside Dillo.
  - Implemented Stop button to not only stop rendering but also networking.
    Patches: Jorge Arellano
- - Connected signals to <li> elements
-   Patch: place
++- Connected signals to <li> elements (fixes links within lists).
+ - Enabled text and background color-choice in preferences.
+ - Enabled clicking over image links.
+   Patches: place
++- Fixed a va_list-related SEGFAULT on 64bit-arch in dStr_vsprintfa().
+   Patch: Vincent Thomasset
++- Fixed void to int conversions for 64bit-arch.
+   Patch: Jorge Arellano, higuita
++- Added a strndup() replacement in dw2
+   Patch: Alexander Becher, Johannes Hofmann, Jorge Arellano
++- Fixed calcHashValue() to only return non-negative numbers (was SEGFAULT).
+ - Improved scrolling performance on large pages by copying screen data
+    instead of rendering.
+   Patches: Johannes Hofmann
 
  TODO:
 
--- a/dlib/dlib.c	Mon Oct 08 16:07:55 2007 +0200
+++ b/dlib/dlib.c	Thu Oct 11 20:55:12 2007 +0200
@@ -345,8 +345,11 @@
    int n, n_sz;
 
    if (ds && format) {
+      va_list argp2;         /* Needed in case of looping on non-32bit arch */
       while (1) {
+         va_copy(argp2, argp);
          n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp);
+         va_end(argp2);
          if (n > -1 && n < ds->sz - ds->len) {
             ds->len += n;      /* Success! */
             break;
--- a/dlib/dlib.h	Mon Oct 08 16:07:55 2007 +0200
+++ b/dlib/dlib.h	Thu Oct 11 20:55:12 2007 +0200
@@ -33,7 +33,8 @@
  *-- Casts -------------------------------------------------------------------
  */
 /* TODO: include a void* size test in configure.in */
-#define VOIDP2INT(p)    ((int)(p))
+/* (long) works for both 32bit and 64bit */
+#define VOIDP2INT(p)    ((long)(p))
 #define INT2VOIDP(i)    ((void*)(i))
 
 /*
--- a/src/IO/IO.c	Mon Oct 08 16:07:55 2007 +0200
+++ b/src/IO/IO.c	Thu Oct 11 20:55:12 2007 +0200
@@ -255,7 +255,7 @@
  */
 static void IO_fd_read_cb(int fd, void *data)
 {
-   int io_key = (int)data;
+   int io_key = VOIDP2INT(data);
    IOData_t *io = IO_get(io_key);
 
    /* There should be no more events on already closed FDs  --Jcid */
@@ -274,7 +274,7 @@
  */
 static void IO_fd_write_cb(int fd, void *data)
 {
-   int io_key = (int)data;
+   int io_key = VOIDP2INT(data);
    IOData_t *io = IO_get(io_key);
 
    if (io == NULL) {
--- a/src/dns.c	Mon Oct 08 16:07:55 2007 +0200
+++ b/src/dns.c	Thu Oct 11 20:55:12 2007 +0200
@@ -498,7 +498,7 @@
  */
 static void Dns_timeout_client(void *data)
 {
-   int channel = (int)data;
+   int channel = VOIDP2INT(data);
    DnsServer *srv = &dns_server[channel];
 
    if (srv->ip_ready) {
--- a/src/html.cc	Mon Oct 08 16:07:55 2007 +0200
+++ b/src/html.cc	Thu Oct 11 20:55:12 2007 +0200
@@ -2423,8 +2423,9 @@
    /* Add a new image widget to this page */
    Image = a_Image_new(0, 0, alt_ptr, S_TOP(html)->current_bg_color);
    if (add) {
-      Html_add_widget(html, (Widget*)Image->dw,
-                      width_ptr, height_ptr, style_attrs);
+      Widget *w = (Widget*)Image->dw;
+      Html_add_widget(html, w, width_ptr, height_ptr, style_attrs);
+      Html_connect_signals(html, w);
    }
 
    dFree(width_ptr);
--- a/src/menu.cc	Mon Oct 08 16:07:55 2007 +0200
+++ b/src/menu.cc	Thu Oct 11 20:55:12 2007 +0200
@@ -57,8 +57,10 @@
  * TODO: erase the URL on popup close.
  */
 void NewItem::draw() {
+   DilloUrl *url;
+
    if (flags() & SELECTED) {
-      DilloUrl *url = a_History_get_url(history_list[((int)user_data())-1]);
+      url = a_History_get_url(history_list[(VOIDP2INT(user_data()))-1]);
       a_UIcmd_set_msg(popup_bw, "%s", URL_STR(url));
    }
    Item::draw();
@@ -170,7 +172,7 @@
 static void Menu_history_cb(Widget *wid, void *data)
 {
    int k = event_button();
-   int offset = history_direction * (int)data;
+   int offset = history_direction * VOIDP2INT(data);
 
    if (k == 2) {
       /* middle button, open in a new window */
--- a/src/plain.cc	Mon Oct 08 16:07:55 2007 +0200
+++ b/src/plain.cc	Thu Oct 11 20:55:12 2007 +0200
@@ -124,9 +124,9 @@
    styleAttrs.initValues ();
    styleAttrs.margin.setVal (5);
    styleAttrs.font = style::Font::create (layout, &fontAttrs);
-   styleAttrs.color = style::Color::createSimple (layout, 0x0000ff);
+   styleAttrs.color = style::Color::createSimple (layout, prefs.text_color);
    styleAttrs.backgroundColor = 
-      style::Color::createSimple (layout, 0xdcd1ba);
+      style::Color::createSimple (layout, prefs.bg_color);
    plain->widgetStyle = style::Style::create (layout, &styleAttrs);
 
    /* The context menu */
--- a/src/ui.cc	Mon Oct 08 16:07:55 2007 +0200
+++ b/src/ui.cc	Thu Oct 11 20:55:12 2007 +0200
@@ -232,7 +232,7 @@
  */
 void b1_cb(Widget *wid, void *cb_data)
 {
-   int bn = (int)cb_data;
+   int bn = VOIDP2INT(cb_data);
    int k = event_key();
    if (k && k <= 7) {
       _MSG("[%s], mouse button %d was pressed\n", button_names[bn], k);
--- a/src/web.cc	Mon Oct 08 16:07:55 2007 +0200
+++ b/src/web.cc	Thu Oct 11 20:55:12 2007 +0200
@@ -85,7 +85,7 @@
       styleAttrs.font = style::Font::create (layout, &fontAttrs);
       styleAttrs.color = style::Color::createSimple (layout, 0xff0000);
       styleAttrs.backgroundColor = 
-         style::Color::createSimple (layout, 0xdcd1ba);
+         style::Color::createSimple (layout, prefs.bg_color);
       widgetStyle = style::Style::create (layout, &styleAttrs);
       dw->setStyle (widgetStyle);
       widgetStyle->unref ();