fix up riscos build errors

This commit is contained in:
Vincent Sanders 2014-01-16 14:28:25 +00:00
parent a1361f22b4
commit 54b7482f78
8 changed files with 62 additions and 56 deletions

View File

@ -435,6 +435,57 @@ static struct gui_download_window *gui_download_window_create(download_context *
return dw;
}
/**
* Handle failed downloads.
*
* \param dw download window
* \param error_msg error message
*/
static void gui_download_window_error(struct gui_download_window *dw,
const char *error_msg)
{
os_error *error;
if (dw->ctx != NULL)
download_context_destroy(dw->ctx);
dw->ctx = NULL;
dw->error = true;
schedule_remove(ro_gui_download_update_status_wrapper, dw);
/* place error message in status icon in red */
strncpy(dw->status, error_msg, sizeof dw->status);
error = xwimp_set_icon_state(dw->window,
ICON_DOWNLOAD_STATUS,
wimp_COLOUR_RED << wimp_ICON_FG_COLOUR_SHIFT,
wimp_ICON_FG_COLOUR);
if (error) {
LOG(("xwimp_set_icon_state: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
}
/* grey out pathname icon */
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_PATH,
wimp_ICON_SHADED, 0);
if (error) {
LOG(("xwimp_set_icon_state: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
}
/* grey out file icon */
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_ICON,
wimp_ICON_SHADED, wimp_ICON_SHADED);
if (error) {
LOG(("xwimp_set_icon_state: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
}
ro_gui_download_window_hide_caret(dw);
}
/**
* Handle received download data.
@ -707,57 +758,6 @@ void ro_gui_download_window_hide_caret(struct gui_download_window *dw)
}
/**
* Handle failed downloads.
*
* \param dw download window
* \param error_msg error message
*/
static void gui_download_window_error(struct gui_download_window *dw,
const char *error_msg)
{
os_error *error;
if (dw->ctx != NULL)
download_context_destroy(dw->ctx);
dw->ctx = NULL;
dw->error = true;
schedule_remove(ro_gui_download_update_status_wrapper, dw);
/* place error message in status icon in red */
strncpy(dw->status, error_msg, sizeof dw->status);
error = xwimp_set_icon_state(dw->window,
ICON_DOWNLOAD_STATUS,
wimp_COLOUR_RED << wimp_ICON_FG_COLOUR_SHIFT,
wimp_ICON_FG_COLOUR);
if (error) {
LOG(("xwimp_set_icon_state: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
}
/* grey out pathname icon */
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_PATH,
wimp_ICON_SHADED, 0);
if (error) {
LOG(("xwimp_set_icon_state: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
}
/* grey out file icon */
error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_ICON,
wimp_ICON_SHADED, wimp_ICON_SHADED);
if (error) {
LOG(("xwimp_set_icon_state: 0x%x: %s",
error->errnum, error->errmess));
warn_user("WimpError", error->errmess);
}
ro_gui_download_window_hide_caret(dw);
}
/**

View File

@ -948,7 +948,7 @@ void ro_gui_cleanup(void)
* \param active return as soon as possible
*/
static void gui_poll(bool active)
void gui_poll(bool active)
{
wimp_event_no event;
wimp_block block;

View File

@ -118,6 +118,7 @@ void ro_gui_dump_browser_window(struct browser_window *bw);
void ro_gui_drag_box_start(wimp_pointer *pointer);
bool ro_gui_prequit(void);
const char *ro_gui_default_language(void);
void gui_poll(bool active); /* exported for riscos/wimp_event.c:722 */
/* in download.c */
void ro_gui_download_init(void);

View File

@ -36,6 +36,7 @@
#include "riscos/url_suggest.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/window.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/utils.h"

View File

@ -45,6 +45,7 @@
#include "riscos/treeview.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/query.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "utils/schedule.h"

View File

@ -32,6 +32,7 @@
#include "oslib/serviceinternational.h"
#include "oslib/wimp.h"
#include "desktop/gui.h"
#include "riscos/gui.h"
#include "riscos/dialog.h"
#include "riscos/menus.h"
#include "riscos/ucstables.h"

View File

@ -1069,7 +1069,7 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape)
* \param url new url for address bar
*/
static void gui_window_set_url(struct gui_window *g, const char *url)
void gui_window_set_url(struct gui_window *g, const char *url)
{
if (!g->toolbar)
return;
@ -5240,7 +5240,7 @@ bool ro_gui_alt_pressed(void)
return (alt == 0xff);
}
static struct gui_window_table gui_window_table = {
static struct gui_window_table window_table = {
.create = gui_window_create,
.destroy = gui_window_destroy,
.redraw = gui_window_redraw_window,
@ -5273,4 +5273,4 @@ static struct gui_window_table gui_window_table = {
.start_selection = gui_start_selection,
};
struct gui_window_table *riscos_gui_window_table = &gui_window_table;
struct gui_window_table *riscos_window_table = &window_table;

View File

@ -25,11 +25,13 @@
#ifndef _NETSURF_RISCOS_WINDOW_H_
#define _NETSURF_RISCOS_WINDOW_H_
extern struct gui_window_table *riscos_gui_window_table;
extern struct gui_window_table *riscos_window_table;
void ro_gui_window_initialise(void);
bool ro_gui_window_check_menu(wimp_menu *menu);
void gui_window_set_url(struct gui_window *g, const char *url);
#endif