summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-04-26 12:50:16 +0100
committerVincent Sanders <vince@kyllikki.org>2016-04-26 12:50:16 +0100
commit6a36d4ec2b6fd8ac52da2c3883b4776aec14ba2d (patch)
treed11c9bcad0cc76d8c1b8950e52066d694c1dab84 /render
parent69cea38f41b411ca9e55db365cf94339f4be891c (diff)
downloadnetsurf-6a36d4ec2b6fd8ac52da2c3883b4776aec14ba2d.tar.gz
netsurf-6a36d4ec2b6fd8ac52da2c3883b4776aec14ba2d.tar.bz2
remove all core usage of warn_user API
Diffstat (limited to 'render')
-rw-r--r--render/box.c16
-rw-r--r--render/form.c14
-rw-r--r--render/html.c3
-rw-r--r--render/search.c9
4 files changed, 25 insertions, 17 deletions
diff --git a/render/box.c b/render/box.c
index 5a0735e24..bb1800b00 100644
--- a/render/box.c
+++ b/render/box.c
@@ -28,19 +28,23 @@
#include <stdio.h>
#include <string.h>
#include <dom/dom.h>
+
+#include "utils/nsoption.h"
+#include "utils/log.h"
+#include "utils/talloc.h"
+#include "utils/utils.h"
#include "content/content_protected.h"
#include "content/hlcache.h"
#include "css/css.h"
#include "css/utils.h"
#include "css/dump.h"
#include "desktop/scrollbar.h"
-#include "utils/nsoption.h"
+#include "desktop/gui_misc.h"
+#include "desktop/gui_internal.h"
+
#include "render/box.h"
#include "render/form_internal.h"
#include "render/html_internal.h"
-#include "utils/log.h"
-#include "utils/talloc.h"
-#include "utils/utils.h"
#define box_is_float(box) (box->type == BOX_FLOAT_LEFT || \
box->type == BOX_FLOAT_RIGHT)
@@ -1146,7 +1150,7 @@ bool box_handle_scrollbars(struct content *c, struct box *box,
data = malloc(sizeof(struct html_scrollbar_data));
if (data == NULL) {
LOG("malloc failed");
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
return false;
}
data->c = c;
@@ -1167,7 +1171,7 @@ bool box_handle_scrollbars(struct content *c, struct box *box,
data = malloc(sizeof(struct html_scrollbar_data));
if (data == NULL) {
LOG("malloc failed");
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
return false;
}
data->c = c;
diff --git a/render/form.c b/render/form.c
index f53e9dece..dce906437 100644
--- a/render/form.c
+++ b/render/form.c
@@ -51,6 +51,8 @@
#include "desktop/plotters.h"
#include "desktop/scrollbar.h"
#include "desktop/textarea.h"
+#include "desktop/gui_misc.h"
+#include "desktop/gui_internal.h"
#include "render/box.h"
#include "render/font.h"
@@ -1095,7 +1097,7 @@ bool form_open_select_menu(void *client_data,
menu = calloc(1, sizeof (struct form_select_menu));
if (menu == NULL) {
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
return false;
}
@@ -1710,7 +1712,7 @@ void form_submit(nsurl *page_url, struct browser_window *target,
assert(form != NULL);
if (form_successful_controls_dom(form, submit_button, &success) == false) {
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
return;
}
@@ -1718,7 +1720,7 @@ void form_submit(nsurl *page_url, struct browser_window *target,
if (nsurl_create(form->action, &action_url) != NSERROR_OK) {
free(data);
fetch_multipart_data_destroy(success);
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
return;
}
@@ -1727,7 +1729,7 @@ void form_submit(nsurl *page_url, struct browser_window *target,
data = form_url_encode(form, success, true);
if (data == NULL) {
fetch_multipart_data_destroy(success);
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
return;
}
@@ -1737,7 +1739,7 @@ void form_submit(nsurl *page_url, struct browser_window *target,
nsurl_unref(action_query);
free(data);
fetch_multipart_data_destroy(success);
- warn_user(messages_get_errorcode(error), 0);
+ guit->misc->warning(messages_get_errorcode(error), 0);
return;
}
@@ -1757,7 +1759,7 @@ void form_submit(nsurl *page_url, struct browser_window *target,
data = form_url_encode(form, success, false);
if (data == NULL) {
fetch_multipart_data_destroy(success);
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
nsurl_unref(action_url);
return;
}
diff --git a/render/html.c b/render/html.c
index 68eb11cd2..c809ee159 100644
--- a/render/html.c
+++ b/render/html.c
@@ -51,6 +51,7 @@
#include "desktop/browser.h"
#include "desktop/gui_utf8.h"
#include "desktop/gui_layout.h"
+#include "desktop/gui_misc.h"
#include "desktop/gui_internal.h"
#include "render/box.h"
@@ -2078,7 +2079,7 @@ static bool html_drop_file_at_point(struct content *c, int x, int y, char *file)
assert(ret != NSERROR_BAD_ENCODING);
LOG("local to utf8 encoding failed");
free(buffer);
- warn_user("NoMemory", NULL);
+ guit->misc->warning("NoMemory", NULL);
return true;
}
diff --git a/render/search.c b/render/search.c
index b586ff55f..f5e231ab0 100644
--- a/render/search.c
+++ b/render/search.c
@@ -34,6 +34,7 @@
#include "content/hlcache.h"
#include "desktop/selection.h"
#include "desktop/gui_search.h"
+#include "desktop/gui_misc.h"
#include "desktop/gui_internal.h"
#include "render/box.h"
@@ -85,13 +86,13 @@ struct search_context * search_create_context(struct content *c,
context = malloc(sizeof(struct search_context));
if (context == NULL) {
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
return NULL;
}
search_head = malloc(sizeof(struct list_entry));
if (search_head == NULL) {
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
free(context);
return NULL;
}
@@ -282,7 +283,7 @@ static struct list_entry *add_entry(unsigned start_idx, unsigned end_idx,
/* found string in box => add to list */
entry = calloc(1, sizeof(*entry));
if (!entry) {
- warn_user("NoMemory", 0);
+ guit->misc->warning("NoMemory", 0);
return NULL;
}
@@ -548,7 +549,7 @@ void search_step(struct search_context *context, search_flags_t flags,
int i = 0;
if (context == NULL) {
- warn_user("SearchError", 0);
+ guit->misc->warning("SearchError", 0);
return;
}