summaryrefslogtreecommitdiff
path: root/framebuffer
diff options
context:
space:
mode:
Diffstat (limited to 'framebuffer')
-rw-r--r--framebuffer/Makefile.target2
-rw-r--r--framebuffer/gui.c20
-rw-r--r--framebuffer/misc.c33
3 files changed, 19 insertions, 36 deletions
diff --git a/framebuffer/Makefile.target b/framebuffer/Makefile.target
index c0f5e2292..44fa5aa4a 100644
--- a/framebuffer/Makefile.target
+++ b/framebuffer/Makefile.target
@@ -174,7 +174,7 @@ $(eval $(foreach V,$(filter FB_FONT_$(NETSURF_FB_FONTLIB)_%,$(.VARIABLES)),$(cal
# ----------------------------------------------------------------------------
# S_FRAMEBUFFER are sources purely for the framebuffer build
-S_FRAMEBUFFER := gui.c framebuffer.c schedule.c misc.c bitmap.c fetch.c \
+S_FRAMEBUFFER := gui.c framebuffer.c schedule.c bitmap.c fetch.c \
findfile.c localhistory.c clipboard.c
S_FRAMEBUFFER_FBTK := fbtk.c event.c fill.c bitmap.c user.c window.c \
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index 11511fe0e..7e48b654e 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -108,6 +108,21 @@ static void die(const char *error)
exit(1);
}
+
+/**
+ * Warn the user of an event.
+ *
+ * \param[in] message A warning looked up in the message translation table
+ * \param[in] detail Additional text to be displayed or NULL.
+ * \return NSERROR_OK on success or error code if there was a
+ * faliure displaying the message to the user.
+ */
+static nserror fb_warn_user(const char *warning, const char *detail)
+{
+ LOG("%s %s", warning, detail);
+ return NSERROR_OK;
+}
+
/* queue a redraw operation, co-ordinates are relative to the window */
static void
fb_queue_redraw(struct fbtk_widget_s *widget, int x0, int y0, int x1, int y1)
@@ -1103,7 +1118,7 @@ fb_url_enter(void *pw, char *text)
error = nsurl_create(text, &url);
if (error != NSERROR_OK) {
- warn_user(messages_get_errorcode(error), 0);
+ fb_warn_user(messages_get_errorcode(error), 0);
} else {
browser_window_navigate(bw, url, NULL, BW_NAVIGATE_HISTORY,
NULL, NULL, NULL);
@@ -2056,6 +2071,7 @@ static struct gui_window_table framebuffer_window_table = {
static struct gui_misc_table framebuffer_misc_table = {
.schedule = framebuffer_schedule,
+ .warning = fb_warn_user,
.quit = gui_quit,
};
@@ -2156,7 +2172,7 @@ main(int argc, char** argv)
nsurl_unref(url);
}
if (ret != NSERROR_OK) {
- warn_user(messages_get_errorcode(ret), 0);
+ fb_warn_user(messages_get_errorcode(ret), 0);
} else {
framebuffer_run();
diff --git a/framebuffer/misc.c b/framebuffer/misc.c
deleted file mode 100644
index f1f96816a..000000000
--- a/framebuffer/misc.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2008 Vincent Sanders <vince@simtec.co.uk>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "utils/log.h"
-#include "utils/messages.h"
-#include "utils/utils.h"
-
-void warn_user(const char *warning, const char *detail)
-{
- LOG("%s %s", warning, detail);
-}
-
-