summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--dpid/dpid.c2
-rw-r--r--dpid/main.c2
-rw-r--r--src/IO/IO.c1
-rw-r--r--src/IO/IO.h1
-rw-r--r--src/IO/dpi.c1
-rw-r--r--src/IO/http.c1
-rw-r--r--src/IO/mime.c1
-rw-r--r--src/cache.c1
-rw-r--r--src/capi.c1
-rw-r--r--src/dillo.cc3
-rw-r--r--src/dns.h2
-rw-r--r--src/html.cc398
-rw-r--r--src/klist.c1
-rw-r--r--src/nav.c1
-rw-r--r--src/pixmaps.h58
-rw-r--r--src/plain.cc3
17 files changed, 208 insertions, 270 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ad42f6c..34532ca5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -96,6 +96,7 @@ dillo-fltk2
Patch: Frank Gevaerts
+- Bound Ctrl-R to reload.
Made dialogs use font_factor (e.g. view source).
+ Implemented the SELECT element in FORMS!
Patches: Jeremy Henty
TODO:
diff --git a/dpid/dpid.c b/dpid/dpid.c
index 46c80109..f62aab5f 100644
--- a/dpid/dpid.c
+++ b/dpid/dpid.c
@@ -38,7 +38,7 @@ volatile sig_atomic_t caught_sigchld = 0;
/*! Return the basename of a filename
*/
-char *get_basename(char *filename)
+static char *get_basename(char *filename)
{
char *p;
diff --git a/dpid/main.c b/dpid/main.c
index 9a6ac6e1..065e7858 100644
--- a/dpid/main.c
+++ b/dpid/main.c
@@ -185,7 +185,7 @@ static int get_command(int sock, char *dpi_tag, struct dp *dpi_attr_list)
/*
* Check whether a dpi server is running
*/
-int server_is_running(char *server_id)
+static int server_is_running(char *server_id)
{
int i;
diff --git a/src/IO/IO.c b/src/IO/IO.c
index 335b4378..e833f970 100644
--- a/src/IO/IO.c
+++ b/src/IO/IO.c
@@ -24,7 +24,6 @@
#include "../msg.h"
#include "../chain.h"
#include "../klist.h"
-#include "../list.h"
#include "IO.h"
#include "iowatch.hh"
diff --git a/src/IO/IO.h b/src/IO/IO.h
index 71ed25b4..459e6e4a 100644
--- a/src/IO/IO.h
+++ b/src/IO/IO.h
@@ -7,7 +7,6 @@
#include "d_size.h"
#include "../../dlib/dlib.h"
#include "../chain.h"
-#include "iowatch.hh"
/*
* IO Operations
diff --git a/src/IO/dpi.c b/src/IO/dpi.c
index c253f08c..52ee7d87 100644
--- a/src/IO/dpi.c
+++ b/src/IO/dpi.c
@@ -38,7 +38,6 @@
#include "../klist.h"
#include "IO.h"
#include "Url.h"
-#include "../misc.h"
#include "../../dpip/dpip.h"
/* #define DEBUG_LEVEL 2 */
diff --git a/src/IO/http.c b/src/IO/http.c
index f6a2cc27..79afc2fa 100644
--- a/src/IO/http.c
+++ b/src/IO/http.c
@@ -31,7 +31,6 @@
#include "../msg.h"
#include "../klist.h"
#include "../dns.h"
-#include "../cache.h"
#include "../web.hh"
#include "../cookies.h"
#include "../prefs.h"
diff --git a/src/IO/mime.c b/src/IO/mime.c
index 7581f62a..33ec3322 100644
--- a/src/IO/mime.c
+++ b/src/IO/mime.c
@@ -10,7 +10,6 @@
*/
#include "mime.h"
-#include "../msg.h"
#include "../list.h"
diff --git a/src/cache.c b/src/cache.c
index 74f26cca..0d8b537c 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -23,7 +23,6 @@
#include <unistd.h>
#include "msg.h"
-#include "list.h"
#include "IO/Url.h"
#include "IO/IO.h"
#include "web.hh"
diff --git a/src/capi.c b/src/capi.c
index f560fb62..662a3718 100644
--- a/src/capi.c
+++ b/src/capi.c
@@ -25,7 +25,6 @@
#include "list.h"
#include "history.h"
#include "nav.h"
-#include "misc.h"
#include "dpiapi.h"
#include "uicmd.hh"
#include "../dpip/dpip.h"
diff --git a/src/dillo.cc b/src/dillo.cc
index bc2c0410..cd1e31fa 100644
--- a/src/dillo.cc
+++ b/src/dillo.cc
@@ -27,9 +27,8 @@
#include "dir.h"
#include "uicmd.hh"
-#include "msg.h"
+#include "prefs.h"
#include "bw.h"
-#include "bookmark.h"
#include "misc.h"
#include "nav.h"
diff --git a/src/dns.h b/src/dns.h
index cd051132..1749044f 100644
--- a/src/dns.h
+++ b/src/dns.h
@@ -3,8 +3,6 @@
#include <netinet/in.h>
-#include "chain.h"
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
diff --git a/src/html.cc b/src/html.cc
index 16601653..53da3b10 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -38,7 +38,6 @@
#include "nav.h"
#include "menu.hh"
#include "prefs.h"
-#include "misc.h"
#include "capi.h"
#include "html.hh"
@@ -90,9 +89,9 @@ typedef struct _DilloLinkImage DilloLinkImage;
typedef struct _DilloHtmlClass DilloHtmlClass;
typedef struct _DilloHtmlState DilloHtmlState;
typedef struct _DilloHtmlForm DilloHtmlForm;
-typedef struct _DilloHtmlOption DilloHtmlOption;
-typedef struct _DilloHtmlSelect DilloHtmlSelect;
typedef struct _DilloHtmlInput DilloHtmlInput;
+typedef struct _DilloHtmlSelect DilloHtmlSelect;
+typedef struct _DilloHtmlOption DilloHtmlOption;
typedef enum {
DT_NONE,
@@ -175,10 +174,11 @@ typedef enum {
IN_BODY = 1 << 2,
IN_FORM = 1 << 3,
IN_SELECT = 1 << 4,
- IN_TEXTAREA = 1 << 5,
- IN_MAP = 1 << 6,
- IN_PRE = 1 << 7,
- IN_BUTTON = 1 << 8
+ IN_OPTION = 1 << 5,
+ IN_TEXTAREA = 1 << 6,
+ IN_MAP = 1 << 7,
+ IN_PRE = 1 << 8,
+ IN_BUTTON = 1 << 9,
} DilloHtmlProcessingState;
/*-----------------------------------------------------------------------------
@@ -231,18 +231,12 @@ struct _DilloHtmlForm {
};
struct _DilloHtmlOption {
- //GtkWidget *menuitem;
- char *value;
- bool_t init_val;
+ char *value, *content;
+ bool selected, enabled;
};
struct _DilloHtmlSelect {
- //GtkWidget *menu;
- int size;
-
- DilloHtmlOption *options;
- int num_options;
- int num_options_max;
+ misc::SimpleVector<DilloHtmlOption *> *options;
};
struct _DilloHtmlInput {
@@ -858,31 +852,33 @@ void DilloHtml::initDw()
*/
DilloHtml::~DilloHtml()
{
- int i, j, k;
- DilloHtmlForm *form;
- DilloHtmlInput *input_j;
-
_MSG("::~DilloHtml(this=%p)\n", this);
a_Bw_remove_doc(bw, this);
a_Url_free(base_url);
- for (i = 0; i < forms->size(); i++) {
- form = forms->getRef(i);
+ for (int i = 0; i < forms->size(); i++) {
+ DilloHtmlForm *form = forms->getRef(i);
a_Url_free(form->action);
- for (j = 0; j < form->inputs->size(); j++) {
- input_j = form->inputs->getRef(j);
- dFree(input_j->name);
- dFree(input_j->init_str);
-
- if (input_j->type == DILLO_HTML_INPUT_SELECT ||
- input_j->type == DILLO_HTML_INPUT_SEL_LIST) {
- for (k = 0; k < input_j->select->num_options; k++) {
- dFree(input_j->select->options[k].value);
+ for (int j = 0; j < form->inputs->size(); j++) {
+ DilloHtmlInput *input = form->inputs->getRef(j);
+ dFree(input->name);
+ dFree(input->init_str);
+
+ if (input->type == DILLO_HTML_INPUT_SELECT ||
+ input->type == DILLO_HTML_INPUT_SEL_LIST) {
+
+ int size = input->select->options->size ();
+ for (int k = 0; k < size; k++) {
+ DilloHtmlOption *option =
+ input->select->options->get (k);
+ dFree(option->value);
+ dFree(option->content);
+ delete(option);
}
- dFree(input_j->select->options);
- dFree(input_j->select);
+ delete(input->select->options);
+ delete(input->select);
}
}
delete(form->inputs);
@@ -890,12 +886,12 @@ DilloHtml::~DilloHtml()
}
delete(forms);
- for (i = 0; i < links->size(); i++)
+ for (int i = 0; i < links->size(); i++)
if (links->get(i))
a_Url_free(links->get(i));
delete (links);
- for (i = 0; i < images->size(); i++) {
+ for (int i = 0; i < images->size(); i++) {
DilloLinkImage *li = images->get(i);
a_Url_free(li->url);
if (li->image)
@@ -3428,6 +3424,9 @@ static void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize)
return;
}
html->InFlags |= IN_FORM;
+ html->InFlags &= ~IN_SELECT;
+ html->InFlags &= ~IN_OPTION;
+ html->InFlags &= ~IN_TEXTAREA;
method = DILLO_HTML_METHOD_GET;
if ((attrbuf = Html_get_attr(html, tag, tagsize, "method"))) {
@@ -3484,9 +3483,12 @@ static void Html_tag_close_form(DilloHtml *html, int TagIdx)
// }
// }
}
+
html->InFlags &= ~IN_FORM;
html->InFlags &= ~IN_SELECT;
+ html->InFlags &= ~IN_OPTION;
html->InFlags &= ~IN_TEXTAREA;
+
Html_pop_tag(html, TagIdx);
}
@@ -3574,8 +3576,6 @@ static void Html_tag_open_meta(DilloHtml *html, const char *tag, int tagsize)
*/
static void Html_reset_input(DilloHtmlInput *input)
{
- int i;
-
switch (input->type) {
case DILLO_HTML_INPUT_TEXT:
case DILLO_HTML_INPUT_PASSWORD:
@@ -3594,20 +3594,20 @@ static void Html_reset_input(DilloHtmlInput *input)
/* 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 = input->select->num_options - 1; i >= 0; i--) {
- if (input->select->options[i].init_val) {
+// for (i = input->select->num_options - 1; i >= 0; i--) {
+// if (input->select->options[i].init_val) {
// gtk_menu_item_activate(GTK_MENU_ITEM
// (input->select->options[i].menuitem));
// Html_select_set_history(input);
- break;
- }
- }
+// break;
+// }
+// }
}
break;
case DILLO_HTML_INPUT_SEL_LIST:
if (!input->select)
break;
- for (i = 0; i < input->select->num_options; i++) {
+// for (i = 0; i < input->select->num_options; i++) {
// if (input->select->options[i].init_val) {
// if (input->select->options[i].menuitem->state == GTK_STATE_NORMAL)
// gtk_list_select_child(GTK_LIST(input->select->menu),
@@ -3617,7 +3617,7 @@ static void Html_reset_input(DilloHtmlInput *input)
// gtk_list_unselect_child(GTK_LIST(input->select->menu),
// input->select->options[i].menuitem);
// }
- }
+// }
break;
case DILLO_HTML_INPUT_TEXTAREA:
if (input->init_str != NULL) {
@@ -3798,25 +3798,21 @@ static void Html_submit_form2(DilloHtml *html, DilloHtmlForm *form,
case DILLO_HTML_INPUT_HIDDEN:
Html_append_input(DataStr, input->name, input->init_str);
break;
-// case DILLO_HTML_INPUT_SELECT:
-// for (i = 0; i < input->select->num_options; i++) {
-// if (GTK_CHECK_MENU_ITEM(input->select->options[i].menuitem)->
-// active) {
-// Html_append_input(DataStr, input->name,
-// input->select->options[i].value);
-// break;
-// }
-// }
-// break;
-// case DILLO_HTML_INPUT_SEL_LIST:
-// for (i = 0; i < input->select->num_options; i++) {
-// if (input->select->options[i].menuitem->state ==
-// GTK_STATE_SELECTED) {
-// Html_append_input(DataStr, input->name,
-// input->select->options[i].value);
-// }
-// }
-// break;
+ case DILLO_HTML_INPUT_SELECT:
+ case DILLO_HTML_INPUT_SEL_LIST:
+ { // brackets for compiler happiness.
+ SelectionResource *sel_res =
+ (SelectionResource*)((Embed*)input->widget)->getResource();
+ int size = input->select->options->size ();
+ for (int i = 0; i < size; i++) {
+ if (sel_res->isSelected(i)) {
+ DilloHtmlOption *option =
+ input->select->options->get (i);
+ Html_append_input(DataStr, input->name, option->value);
+ }
+ }
+ break;
+ }
// case DILLO_HTML_INPUT_INDEX:
// Html_urlencode_append(DataStr,
// gtk_entry_get_text(GTK_ENTRY(input->widget)));
@@ -4205,7 +4201,8 @@ static void Html_tag_close_textarea(DilloHtml *html, int TagIdx)
Widget *widget;
int i;
- if (html->InFlags & IN_FORM && html->InFlags & IN_TEXTAREA) {
+ if (html->InFlags & IN_FORM &&
+ html->InFlags & IN_TEXTAREA) {
/* Remove the line ending that follows the opening tag */
if (html->Stash->str[0] == '\r')
dStr_erase(html->Stash, 0, 1);
@@ -4332,28 +4329,29 @@ static void Html_tag_open_textarea(DilloHtml *html,
/* The select tag is quite tricky, because of gorpy html syntax. */
static void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize)
{
-// DilloHtmlForm *form;
-// DilloHtmlSelect *Select;
-// GtkWidget *widget, *menu;
-// char *name;
// const char *attrbuf;
// int size, type, multi;
-//
-// if (!(html->InFlags & IN_FORM)) {
-// MSG_HTML("<select> outside <form>\n");
-// return;
-// }
-// if (html->InFlags & IN_SELECT) {
-// MSG_HTML("nested <select>\n");
-// return;
-// }
-// html->InFlags |= IN_SELECT;
-//
-//
-// form = forms->getRef (forms->size() - 1);
-//
-// name = Html_get_attr_wdef(html, tag, tagsize, "name", NULL);
-//
+
+ if (!(html->InFlags & IN_FORM)) {
+ MSG_HTML("<select> outside <form>\n");
+ return;
+ }
+ if (html->InFlags & IN_SELECT) {
+ MSG_HTML("nested <select>\n");
+ return;
+ }
+ html->InFlags |= IN_SELECT;
+ html->InFlags &= ~IN_OPTION;
+
+ DilloHtmlForm *form = html->forms->getRef (html->forms->size() - 1);
+ char *name = Html_get_attr_wdef(html, tag, tagsize, "name", NULL);
+ OptionMenuResource *res =
+ HT2LT(html)->getResourceFactory()->createOptionMenuResource ();
+ Widget *widget;
+ Embed *embed;
+ widget = embed = new Embed(res);
+ DW2TB(html->dw)->addWidget (embed, S_TOP(html)->style);
+
// size = 0;
// if ((attrbuf = Html_get_attr(html, tag, tagsize, "size")))
// size = strtol(attrbuf, NULL, 10);
@@ -4373,17 +4371,13 @@ static void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize)
// gtk_list_set_selection_mode(GTK_LIST(menu), GTK_SELECTION_MULTIPLE);
// type = DILLO_HTML_INPUT_SEL_LIST;
// }
-//
-// Select = dNew(DilloHtmlSelect, 1);
-// Select->menu = menu;
-// Select->size = size;
-// Select->num_options = 0;
-// Select->num_options_max = 8;
-// Select->options = dNew(DilloHtmlOption, Select->num_options_max);
-//
-// Html_add_input(form, type, widget, name, NULL, Select, FALSE);
-// Html_stash_init(html);
-// dFree(name);
+
+ DilloHtmlSelect *select = new DilloHtmlSelect;
+ select->options = new misc::SimpleVector<DilloHtmlOption *> (4);
+ Html_add_input(form, DILLO_HTML_INPUT_SELECT, widget, embed, name,
+ NULL, select, false);
+ Html_stash_init(html);
+ dFree(name);
}
/*
@@ -4391,47 +4385,19 @@ static void Html_tag_open_select(DilloHtml *html, const char *tag, int tagsize)
*/
static void Html_option_finish(DilloHtml *html)
{
-// DilloHtmlForm *form;
-// DilloHtmlInput *input;
-// GtkWidget *menuitem;
-// GSList *group;
-// DilloHtmlSelect *select;
-//
-// if (!(html->InFlags & IN_FORM))
-// return;
-//
-// form = html->forms->getRef (html->forms->size() - 1);
-// input = form->inputs->getRef (form->inputs->size() - 1);
-// if (input->select->num_options <= 0)
-// return;
-//
-// select = input->select;
-// if (input->type == DILLO_HTML_INPUT_SELECT ) {
-// if (select->num_options == 1)
-// group = NULL;
-// else
-// group = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM
-// (select->options[0].menuitem));
-// menuitem = gtk_radio_menu_item_new_with_label(group, html->Stash->str);
-// select->options[select->num_options - 1].menuitem = menuitem;
-// if (select->options[select->num_options - 1].value == NULL)
-// select->options[select->num_options - 1].value =
-// dStrdup(html->Stash->str);
-// gtk_menu_append(GTK_MENU(select->menu), menuitem);
-// if (select->options[select->num_options - 1].init_val)
-// gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
-// gtk_widget_show(menuitem);
-// } else if (input->type == DILLO_HTML_INPUT_SEL_LIST) {
-// menuitem = gtk_list_item_new_with_label(html->Stash->str);
-// select->options[select->num_options - 1].menuitem = menuitem;
-// if (select->options[select->num_options - 1].value == NULL)
-// select->options[select->num_options - 1].value =
-// dStrdup(html->Stash->str);
-// gtk_container_add(GTK_CONTAINER(select->menu), menuitem);
-// if (select->options[select->num_options - 1].init_val)
-// gtk_list_select_child(GTK_LIST(select->menu), menuitem);
-// gtk_widget_show(menuitem);
-// }
+ DilloHtmlForm *form =
+ html->forms->getRef (html->forms->size() - 1);
+ DilloHtmlInput *input =
+ form->inputs->getRef (form->inputs->size() - 1);
+ if (input->type == DILLO_HTML_INPUT_SELECT ||
+ input->type == DILLO_HTML_INPUT_SEL_LIST) {
+ DilloHtmlSelect *select =
+ input->select;
+ DilloHtmlOption *option =
+ select->options->get (select->options->size() - 1);
+ option->content =
+ Html_parse_entities(html, html->Stash->str, html->Stash->len);
+ }
}
/*
@@ -4439,28 +4405,36 @@ static void Html_option_finish(DilloHtml *html)
*/
static void Html_tag_open_option(DilloHtml *html, const char *tag, int tagsize)
{
-// DilloHtmlForm *form;
-// DilloHtmlInput *input;
-// int no;
-//
-// if (!(html->InFlags & IN_SELECT))
-// return;
-//
-// form = forms->getRef (forms->size() - 1);
-// input = form->inputs->getRef (form->inputs->size() - 1);
-// if (input->type == DILLO_HTML_INPUT_SELECT ||
-// input->type == DILLO_HTML_INPUT_SEL_LIST) {
-// Html_option_finish(html);
-// no = input->select->num_options;
-// a_List_add(input->select->options, no, input->select->num_options_max);
-// input->select->options[no].menuitem = NULL;
-// input->select->options[no].value = Html_get_attr_wdef(html, tag, tagsize,
-// "value", NULL);
-// input->select->options[no].init_val =
-// (Html_get_attr(html, tag, tagsize, "selected") != NULL);
-// input->select->num_options++;
-// }
-// Html_stash_init(html);
+ if (!(html->InFlags & IN_FORM &&
+ html->InFlags & IN_SELECT ))
+ return;
+ if (html->InFlags & IN_OPTION)
+ Html_option_finish(html);
+ html->InFlags |= IN_OPTION;
+
+ DilloHtmlForm *form =
+ html->forms->getRef (html->forms->size() - 1);
+ DilloHtmlInput *input =
+ form->inputs->getRef (form->inputs->size() - 1);
+
+ if (input->type == DILLO_HTML_INPUT_SELECT ||
+ input->type == DILLO_HTML_INPUT_SEL_LIST) {
+
+ DilloHtmlOption *option = new DilloHtmlOption;
+ option->value =
+ Html_get_attr_wdef(html, tag, tagsize, "value", NULL);
+ option->content = NULL;
+ option->selected =
+ (Html_get_attr(html, tag, tagsize, "selected") != NULL);
+ option->enabled =
+ (Html_get_attr(html, tag, tagsize, "disabled") == NULL);
+
+ int size = input->select->options->size ();
+ input->select->options->increase ();
+ input->select->options->set (size, option);
+ }
+
+ Html_stash_init(html);
}
/*
@@ -4468,71 +4442,49 @@ static void Html_tag_open_option(DilloHtml *html, const char *tag, int tagsize)
*/
static void Html_tag_close_select(DilloHtml *html, int TagIdx)
{
-// // AL
-// DilloHtmlForm *form;
-// DilloHtmlInput *input;
-// GtkWidget *scrolledwindow;
-// Widget *embed_gtk;
-// GtkRequisition req;
-// int height;
-//
-// if (html->InFlags & IN_SELECT) {
-// html->InFlags &= ~IN_SELECT;
-//
-// form = forms->getRef (forms->size() - 1);
-// input = form->inputs->getRef (form->inputs->size() - 1);
-// if (input->type == DILLO_HTML_INPUT_SELECT) {
-// Html_option_finish(html);
-//
-// gtk_option_menu_set_menu(GTK_OPTION_MENU(input->widget),
-// input->select->menu);
-// Html_select_set_history(input);
-//
-// // gtk_option_menu_set_history(GTK_OPTION_MENU(input->widget), 1);
-//
-// gtk_widget_show(input->widget);
-//
-// embed_gtk = a_Dw_embed_gtk_new ();
-// a_Dw_embed_gtk_add_gtk (DW_EMBED_GTK (embed_gtk), input->widget);
-// DW2TB(html->dw)->addWidget (embed_gtk,
-// S_TOP(html)->style);
-// } else if (input->type == DILLO_HTML_INPUT_SEL_LIST) {
-// Html_option_finish(html);
-//
-// if (input->select->size < input->select->num_options) {
-// scrolledwindow = gtk_scrolled_window_new(NULL, NULL);
-// gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledwindow),
-// GTK_POLICY_NEVER,
-// GTK_POLICY_AUTOMATIC);
-// gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW
-// (scrolledwindow),
-// input->widget);
-//
-// gtk_container_set_focus_vadjustment
-// (GTK_CONTAINER (input->widget),
-// gtk_scrolled_window_get_vadjustment
-// (GTK_SCROLLED_WINDOW(scrolledwindow)));
-//
-// /* Calculate the height of the scrolled window */
-// gtk_widget_size_request(input->select->options[0].menuitem, &req);
-// height = input->select->size * req.height +
-// 2 * scrolledwindow->style->klass->ythickness;
-// gtk_widget_set_usize(scrolledwindow, -1, height);
-//
-// gtk_widget_show(input->widget);
-// input->widget = scrolledwindow;
-// }
-// gtk_widget_show(input->widget);
-//
-// /* note: In this next call, scrolledwindows get a warning from
-// * gdkwindow.c:422. I'm not really going to sweat it now - the
-// * embedded widget stuff is going to get massively redone anyway. */
-// embed_gtk = a_Dw_embed_gtk_new ();
-// a_Dw_embed_gtk_add_gtk (DW_EMBED_GTK (embed_gtk), input->widget);
-// DW2TB(html->dw)->addWidget (embed_gtk,
-// S_TOP(html)->style);
-// }
-// }
+ if (html->InFlags & IN_FORM &&
+ html->InFlags & IN_SELECT) {
+ if (html->InFlags & IN_OPTION)
+ Html_option_finish(html);
+ html->InFlags &= ~IN_SELECT;
+ html->InFlags &= ~IN_OPTION;
+
+ DilloHtmlForm *form =
+ html->forms->getRef (html->forms->size() - 1);
+ DilloHtmlInput *input =
+ form->inputs->getRef (form->inputs->size() - 1);
+ SelectionResource *res =
+ (SelectionResource*)((Embed*)input->widget)->getResource();
+
+ int size = input->select->options->size ();
+ if (size > 0) {
+ // is anything selected?
+ bool some_selected = false;
+ for (int i = 0; i < size; i++) {
+ DilloHtmlOption *option =
+ input->select->options->get (i);
+ if (option->selected) {
+ some_selected = true;
+ break;
+ }
+ }
+
+ // select the first if nothing else is selected
+ // BUG(?): should not do this for MULTI selections
+ if (! some_selected)
+ input->select->options->get (0)->selected = true;
+
+ // add the items to the resource
+ for (int i = 0; i < size; i++) {
+ DilloHtmlOption *option =
+ input->select->options->get (i);
+ bool enabled = option->enabled;
+ bool selected = option->selected;
+ res->addItem(option->content,enabled,selected);
+ }
+ }
+ }
+
Html_pop_tag(html, TagIdx);
}
diff --git a/src/klist.c b/src/klist.c
index 7c3e771d..a0652499 100644
--- a/src/klist.c
+++ b/src/klist.c
@@ -18,7 +18,6 @@
* remains with the caller.
*/
-#include "msg.h"
#include "klist.h"
diff --git a/src/nav.c b/src/nav.c
index 9da92686..705dbc23 100644
--- a/src/nav.c
+++ b/src/nav.c
@@ -14,7 +14,6 @@
#include <stdio.h>
#include <sys/stat.h>
#include "msg.h"
-#include "list.h"
#include "nav.h"
#include "history.h"
#include "web.hh"
diff --git a/src/pixmaps.h b/src/pixmaps.h
index c85492f0..f971795e 100644
--- a/src/pixmaps.h
+++ b/src/pixmaps.h
@@ -14,7 +14,7 @@
#define __PIXMAPS_H__
/* XPM
-static char * history_xpm[] = {
+static const char *const history_xpm[] = {
"11 20 6 1",
" c None",
". c #000000000000",
@@ -44,7 +44,7 @@ static char * history_xpm[] = {
" "};
*/
/* XPM */
-static char * left_xpm[] = {
+static const char *const left_xpm[] = {
"22 22 46 1",
" c None",
". c #000000",
@@ -115,7 +115,7 @@ static char * left_xpm[] = {
" . ",
" "};
/* XPM */
-static char * right_xpm[] = {
+static const char *const right_xpm[] = {
"22 22 46 1",
" c None",
". c #000000",
@@ -186,7 +186,7 @@ static char * right_xpm[] = {
" . ",
" "};
/* XPM */
-static char * reload_xpm[] = {
+static const char *const reload_xpm[] = {
"22 22 147 2",
" c None",
". c #000000",
@@ -358,7 +358,7 @@ static char * reload_xpm[] = {
" . k.l.m.j j n.[.o.h.p.3 3 3 3 3 3 { . ",
" . . . . . . . . . . . . . . . . . "};
/* XPM */
-static char * home_xpm[] = {
+static const char *const home_xpm[] = {
"22 22 106 2",
" c None",
". c #190E0B",
@@ -489,7 +489,7 @@ static char * home_xpm[] = {
" # # # # # # # # # # # # # # ",
" "};
/* XPM */
-static char * save_xpm[] = {
+static const char *const save_xpm[] = {
"22 22 59 1",
" c None",
". c #000000",
@@ -574,7 +574,7 @@ static char * save_xpm[] = {
" "};
/* XPM */
-static char * stop_xpm[] = {
+static const char *const stop_xpm[] = {
"22 22 77 1",
" c None",
". c #000000",
@@ -676,7 +676,7 @@ static char * stop_xpm[] = {
" ......... ",
" "};
/* XPM */
-static char * bm_xpm[] = {
+static const char *const bm_xpm[] = {
"22 22 86 1",
" c None",
". c #000000",
@@ -790,7 +790,7 @@ static char * bm_xpm[] = {
/* Small icons here */
/* XPM */
-static char * left_s_xpm[] = {
+static const char *const left_s_xpm[] = {
"16 16 33 1",
" c None",
". c #000000",
@@ -842,7 +842,7 @@ static char * left_s_xpm[] = {
" .. .;. ",
" . "};
/* XPM */
-static char * right_s_xpm[] = {
+static const char *const right_s_xpm[] = {
"16 16 56 1",
" c None",
". c #000000",
@@ -917,7 +917,7 @@ static char * right_s_xpm[] = {
" .. .>. ",
" . "};
/* XPM */
-static char * home_s_xpm[] = {
+static const char *const home_s_xpm[] = {
"16 16 54 1",
" c None",
". c #170E0B",
@@ -990,7 +990,7 @@ static char * home_s_xpm[] = {
" +lm+n+mmmml+ ",
" ++++o+++++++ "};
/* XPM */
-static char * reload_s_xpm[] = {
+static const char *const reload_s_xpm[] = {
"16 16 74 1",
" c None",
". c #000000",
@@ -1083,7 +1083,7 @@ static char * reload_s_xpm[] = {
" .GHI%%IHG. ",
" ...... "};
/* XPM */
-static char * save_s_xpm[] = {
+static const char *const save_s_xpm[] = {
"16 16 51 1",
" c None",
". c #000000",
@@ -1153,7 +1153,7 @@ static char * save_s_xpm[] = {
".h.iiijkkkkkl.. ",
" ............. "};
/* XPM */
-static char * stop_s_xpm[] = {
+static const char *const stop_s_xpm[] = {
"16 16 65 1",
" c None",
". c #000000",
@@ -1238,7 +1238,7 @@ static char * stop_s_xpm[] = {
" ........ "};
/* XPM */
-static char * bm_s_xpm[] = {
+static const char *const bm_s_xpm[] = {
"16 16 63 1",
" c None",
". c #000000",
@@ -1321,7 +1321,7 @@ static char * bm_s_xpm[] = {
" .v. wx. "};
/* XPM */
-static char * new_s_xpm[] = {
+static const char *const new_s_xpm[] = {
"11 11 35 1",
" c None",
". c #000000",
@@ -1371,7 +1371,7 @@ static char * new_s_xpm[] = {
" . . "};
/* XPM */
-static char * search_xpm[] = {
+static const char *const search_xpm[] = {
"14 16 11 1",
" c None",
". c #000000",
@@ -1402,7 +1402,7 @@ static char * search_xpm[] = {
" 11 "};
/* XPM */
-static char * full_screen_on_xpm[] = {
+static const char *const full_screen_on_xpm[] = {
"13 15 2 1",
" c None",
". c #000000",
@@ -1423,7 +1423,7 @@ static char * full_screen_on_xpm[] = {
" "};
/* XPM */
-static char * full_screen_off_xpm[] = {
+static const char *const full_screen_off_xpm[] = {
"13 15 2 1",
" c None",
". c #000000",
@@ -1444,7 +1444,7 @@ static char * full_screen_off_xpm[] = {
" "};
/* XPM */
-static char * mini_bug_xpm[] = {
+static const char *const mini_bug_xpm[] = {
"15 16 6 1",
" c None",
". c #000000000000",
@@ -1470,7 +1470,7 @@ static char * mini_bug_xpm[] = {
" . "};
/* XPM */
-static char * mini_ok_xpm[] = {
+static const char *const mini_ok_xpm[] = {
"15 15 5 1",
"@ c #000000",
"a c #808080",
@@ -1495,7 +1495,7 @@ static char * mini_ok_xpm[] = {
};
/* XPM */
-static char * imgload_on_xpm[] = {
+static const char *const imgload_on_xpm[] = {
"15 15 2 1",
" c #FFFFFFFFFFFF",
". c #00000000CF3C",
@@ -1516,7 +1516,7 @@ static char * imgload_on_xpm[] = {
" "};
/* XPM */
-static char * imgload_off_xpm[] = {
+static const char *const imgload_off_xpm[] = {
"15 15 2 1",
" c #FFFFFFFFFFFF",
". c #CF3C00000000",
@@ -1537,7 +1537,7 @@ static char * imgload_off_xpm[] = {
" "};
/* XPM */
-static char *left_i_xpm[] = {
+static const char *const left_i_xpm[] = {
"22 22 3 1",
" c None",
". c #000000",
@@ -1566,7 +1566,7 @@ static char *left_i_xpm[] = {
" "};
/* XPM */
-static char *right_i_xpm[] = {
+static const char *const right_i_xpm[] = {
"22 22 3 1",
" c None",
". c #000000",
@@ -1595,7 +1595,7 @@ static char *right_i_xpm[] = {
" "};
/* XPM */
-static char *stop_i_xpm[] = {
+static const char *const stop_i_xpm[] = {
/* columns rows colors chars-per-pixel */
"22 22 2 1",
" c None",
@@ -1626,7 +1626,7 @@ static char *stop_i_xpm[] = {
};
/* XPM */
-static char * stop_si_xpm[] = {
+static const char *const stop_si_xpm[] = {
"16 16 2 1",
" c None",
"@ c gray70",
@@ -1648,7 +1648,7 @@ static char * stop_si_xpm[] = {
" @@@@@@@@ "};
/* XPM */
-static char * left_si_xpm[] = {
+static const char *const left_si_xpm[] = {
"16 16 2 1",
" c None",
"@ c gray70",
@@ -1670,7 +1670,7 @@ static char * left_si_xpm[] = {
" @ "};
/* XPM */
-static char * right_si_xpm[] = {
+static const char *const right_si_xpm[] = {
"16 16 2 1",
" c None",
"@ c gray70",
diff --git a/src/plain.cc b/src/plain.cc
index 33199f89..79a7bf98 100644
--- a/src/plain.cc
+++ b/src/plain.cc
@@ -22,9 +22,6 @@
#include "bw.h"
#include "web.hh"
#include "misc.h"
-#include "history.h"
-#include "nav.h"
-#include "menu.hh"
#include "uicmd.hh"