From 8fd04922cc25bfd2205881fc5d4220c84b2c6fe0 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 26 Apr 2016 15:16:33 +0100 Subject: [PATCH] update RISC OS frontend to not use the depricated warn_user API --- riscos/401login.c | 8 +-- riscos/bitmap.c | 16 ++--- riscos/configure.c | 8 +-- riscos/configure/con_fonts.c | 2 +- riscos/configure/con_image.c | 2 +- riscos/configure/con_language.c | 4 +- riscos/configure/con_theme.c | 21 +++--- riscos/dialog.c | 22 +++--- riscos/download.c | 74 +++++++++---------- riscos/filetype.c | 8 ++- riscos/font.c | 14 ++-- riscos/gui/button_bar.c | 12 ++-- riscos/gui/throbber.c | 7 +- riscos/gui/url_bar.c | 30 ++++---- riscos/help.c | 12 ++-- riscos/history.c | 28 ++++---- riscos/hotlist.c | 2 +- riscos/iconbar.c | 4 +- riscos/image.c | 2 +- riscos/menus.c | 18 ++--- riscos/message.c | 7 +- riscos/mouse.c | 5 +- riscos/print.c | 28 ++++---- riscos/query.c | 10 +-- riscos/save.c | 46 ++++++------ riscos/save_draw.c | 14 ++-- riscos/search.c | 2 +- riscos/sslcert.c | 4 +- riscos/textselection.c | 16 ++--- riscos/theme.c | 28 ++++---- riscos/theme_install.c | 12 ++-- riscos/toolbar.c | 24 +++---- riscos/treeview.c | 34 ++++----- riscos/uri.c | 2 +- riscos/url_complete.c | 36 +++++----- riscos/url_protocol.c | 14 ++-- riscos/wimp.c | 76 ++++++++++---------- riscos/wimp_event.c | 16 ++--- riscos/window.c | 122 ++++++++++++++++---------------- 39 files changed, 399 insertions(+), 391 deletions(-) diff --git a/riscos/401login.c b/riscos/401login.c index acb7a0165..1494b85b1 100644 --- a/riscos/401login.c +++ b/riscos/401login.c @@ -99,7 +99,7 @@ void ro_gui_401login_open(nsurl *url, lwc_string *host, const char *realm, session = calloc(1, sizeof(struct session_401)); if (!session) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return; } @@ -133,7 +133,7 @@ void ro_gui_401login_open(nsurl *url, lwc_string *host, const char *realm, nsurl_unref(session->url); lwc_string_unref(session->host); free(session); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return; } @@ -195,7 +195,7 @@ void ro_gui_401login_close(wimp_w w) error = xwimp_delete_window(w); if (error) { LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } ro_gui_wimp_event_finalise(w); } @@ -216,7 +216,7 @@ bool ro_gui_401login_apply(wimp_w w) auth = malloc(strlen(session->uname) + strlen(session->pwd) + 2); if (!auth) { LOG("calloc failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return false; } diff --git a/riscos/bitmap.c b/riscos/bitmap.c index 162a8c6f6..8fa7265cf 100644 --- a/riscos/bitmap.c +++ b/riscos/bitmap.c @@ -274,7 +274,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) os_error *error; if (bitmap == NULL) { - warn_user("SaveError", messages_get("SprIsNull")); + ro_warn_user("SaveError", messages_get("SprIsNull")); return false; } @@ -289,7 +289,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) (bitmap->sprite_area), path); if (error) { LOG("xosspriteop_save_sprite_file: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } return true; @@ -319,7 +319,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) chunk_buf = malloc(SAVE_CHUNK_SIZE); if (!chunk_buf) { - warn_user("NoMemory", NULL); + ro_warn_user("NoMemory", NULL); return false; } @@ -350,7 +350,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) if (error) { LOG("xosfind_openoutw: 0x%x: %s", error->errnum, error->errmess); free(chunk_buf); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } @@ -365,7 +365,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) LOG("xosgbpb_writew: 0x%x: %s", error->errnum, error->errmess); free(chunk_buf); xosfind_closew(fw); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } @@ -410,7 +410,7 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) LOG("xosgbpb_writew: 0x%x: %s", error->errnum, error->errmess); free(chunk_buf); xosfind_closew(fw); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } } @@ -418,13 +418,13 @@ bool riscos_bitmap_save(void *vbitmap, const char *path, unsigned flags) error = xosfind_closew(fw); if (error) { LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); } error = xosfile_set_type(path, osfile_TYPE_SPRITE); if (error) { LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); } free(chunk_buf); diff --git a/riscos/configure.c b/riscos/configure.c index 62937b543..9953fb9b6 100644 --- a/riscos/configure.c +++ b/riscos/configure.c @@ -185,7 +185,7 @@ void ro_gui_configure_open_window(wimp_open *open) struct configure_tool *tool; if (!ro_gui_configure_translate()) { - warn_user("ro_gui_configure_translate failed", 0); + ro_warn_user("ro_gui_configure_translate failed", 0); return; } @@ -226,7 +226,7 @@ void ro_gui_configure_open_window(wimp_open *open) 0, -16384, 16384, 0); if (error) { LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -249,7 +249,7 @@ void ro_gui_configure_open_window(wimp_open *open) error = xwimp_set_extent(open->w, &extent); if (error) { LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } configure_height = height; @@ -260,7 +260,7 @@ void ro_gui_configure_open_window(wimp_open *open) error = xwimp_open_window(open); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } diff --git a/riscos/configure/con_fonts.c b/riscos/configure/con_fonts.c index 485f0c943..fdae9761b 100644 --- a/riscos/configure/con_fonts.c +++ b/riscos/configure/con_fonts.c @@ -194,7 +194,7 @@ bool ro_gui_options_fonts_init_menu(void) default_menu = malloc(wimp_SIZEOF_MENU(5)); if (!default_menu) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return false; } default_menu->title_data.indirected_text.text = diff --git a/riscos/configure/con_image.c b/riscos/configure/con_image.c index 1c9531c6d..cab7ef01b 100644 --- a/riscos/configure/con_image.c +++ b/riscos/configure/con_image.c @@ -153,7 +153,7 @@ void ro_gui_options_image_redraw(wimp_draw *redraw) if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("MenuError", error->errmess); + ro_warn_user("MenuError", error->errmess); return; } diff --git a/riscos/configure/con_language.c b/riscos/configure/con_language.c index 48c20fc46..b12a79588 100644 --- a/riscos/configure/con_language.c +++ b/riscos/configure/con_language.c @@ -100,7 +100,7 @@ bool ro_gui_options_language_ok(wimp_w w) nsoption_set_charp(language, temp); } else { LOG("No memory to duplicate language code"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); } } } @@ -115,7 +115,7 @@ bool ro_gui_options_language_ok(wimp_w w) nsoption_set_charp(accept_language,temp); } else { LOG("No memory to duplicate language code"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); } } } diff --git a/riscos/configure/con_theme.c b/riscos/configure/con_theme.c index bee2231cd..e80538446 100644 --- a/riscos/configure/con_theme.c +++ b/riscos/configure/con_theme.c @@ -19,11 +19,17 @@ #include #include #include -#include "oslib/osspriteop.h" -#include "oslib/wimp.h" -#include "oslib/wimpspriteop.h" +#include +#include +#include + #include "utils/config.h" #include "utils/nsoption.h" +#include "utils/log.h" +#include "utils/messages.h" +#include "utils/utils.h" + +#include "riscos/gui.h" #include "riscos/configure/configure.h" #include "riscos/configure.h" #include "riscos/dialog.h" @@ -34,9 +40,6 @@ #include "riscos/wimp.h" #include "riscos/wimp_event.h" #include "riscos/wimputils.h" -#include "utils/log.h" -#include "utils/messages.h" -#include "utils/utils.h" #define THEME_PANE_AREA 0 @@ -175,7 +178,7 @@ void ro_gui_options_theme_finalise(wimp_w w) error = xwimp_delete_window(theme_pane); if (error) { LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } theme_pane = 0; } @@ -268,7 +271,7 @@ void ro_gui_options_theme_load(void) toolbar_display = calloc(sizeof(struct toolbar_display), 1); if (!toolbar_display) { LOG("No memory for calloc()"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return; } toolbar_display->toolbar = toolbar; @@ -290,7 +293,7 @@ void ro_gui_options_theme_load(void) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } diff --git a/riscos/dialog.c b/riscos/dialog.c index e5c972f66..d3f6caffb 100644 --- a/riscos/dialog.c +++ b/riscos/dialog.c @@ -306,7 +306,7 @@ void ro_gui_dialog_open(wimp_w w) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } dx = (state.visible.x1 - state.visible.x0) / 2; @@ -353,7 +353,7 @@ void ro_gui_dialog_close(wimp_w close) error = xwimp_get_caret_position(&caret); if (error) { LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } else if (caret.w == close) { /* Check if we are a persistent window */ if (i < MAX_PERSISTENT) { @@ -364,7 +364,7 @@ void ro_gui_dialog_close(wimp_w close) /* parent may have been closed first */ if ((error) && (error->errnum != 0x287)) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } } @@ -372,7 +372,7 @@ void ro_gui_dialog_close(wimp_w close) error = xwimp_close_window(close); if (error) { LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -406,7 +406,7 @@ bool ro_gui_dialog_open_top(wimp_w w, struct toolbar *toolbar, state.w = w; error = xwimp_get_window_state(&state); if (error) { - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -457,7 +457,7 @@ void ro_gui_dialog_open_at_pointer(wimp_w w) error = xwimp_get_pointer_info(&ptr); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -480,7 +480,7 @@ void ro_gui_dialog_open_xy(wimp_w w, int x, int y) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } dx = (state.visible.x1 - state.visible.x0); @@ -495,7 +495,7 @@ void ro_gui_dialog_open_xy(wimp_w w, int x, int y) error = xwimp_close_window(w); if (error) { LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -523,7 +523,7 @@ void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child) { error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } scroll_width = ro_get_vscroll_width(parent); @@ -540,7 +540,7 @@ void ro_gui_dialog_open_centre_parent(wimp_w parent, wimp_w child) { error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -770,7 +770,7 @@ bool ro_gui_dialog_openurl_apply(wimp_w w) { nsurl_unref(url); } if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); return false; } diff --git a/riscos/download.c b/riscos/download.c index cf4f8f475..cddb449de 100644 --- a/riscos/download.c +++ b/riscos/download.c @@ -261,7 +261,7 @@ static nserror download_ro_filetype(download_context *ctx, bits *ftype_out) error = xmimemaptranslate_mime_type_to_filetype(mime_type, &ftype); if (error) { LOG("xmimemaptranslate_mime_type_to_filetype: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); ftype = 0xffd; } } @@ -294,7 +294,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) dw = malloc(sizeof *dw); if (!dw) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return 0; } @@ -323,7 +323,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) /* get filetype */ err = download_ro_filetype(ctx, &dw->file_type); if (err != NSERROR_OK) { - warn_user(messages_get_errorcode(err), 0); + ro_warn_user(messages_get_errorcode(err), 0); free(dw); return 0; } @@ -339,7 +339,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) temp_name, 0, &dw->file); if (error) { LOG("xosfind_openoutw: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); free(dw); return 0; } @@ -372,7 +372,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) if (filename == NULL) { LOG("Failed to establish download filename."); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); free(dw); return 0; } @@ -404,7 +404,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) /* badenc should never happen */ assert(err !=NSERROR_BAD_ENCODING); LOG("utf8_to_local_encoding failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); free(dw); return 0; } @@ -430,7 +430,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) error = xwimp_create_window(download_template, &dw->window); if (error) { LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); free(dw); return 0; } @@ -453,7 +453,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) /* issue the warning now, so that it appears in front of the download * window! */ if (space_warning) - warn_user("DownloadWarn", messages_get("NoDiscSpace")); + ro_warn_user("DownloadWarn", messages_get("NoDiscSpace")); return dw; } @@ -485,7 +485,7 @@ static void gui_download_window_error(struct gui_download_window *dw, wimp_ICON_FG_COLOUR); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } /* grey out pathname icon */ @@ -493,7 +493,7 @@ static void gui_download_window_error(struct gui_download_window *dw, wimp_ICON_SHADED, 0); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } /* grey out file icon */ @@ -501,7 +501,7 @@ static void gui_download_window_error(struct gui_download_window *dw, 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_warn_user("WimpError", error->errmess); } ro_gui_download_window_hide_caret(dw); @@ -539,7 +539,7 @@ static nserror gui_download_window_data(struct gui_download_window *dw, return NSERROR_OK; } - warn_user("SaveError", msg); + ro_warn_user("SaveError", msg); if (dw->saved) { /* try to continue with the temporary file */ @@ -555,20 +555,20 @@ static nserror gui_download_window_data(struct gui_download_window *dw, wimp_ICON_SHADED, 0); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_DESTINATION, wimp_ICON_DELETED, wimp_ICON_DELETED); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_PATH, wimp_ICON_DELETED, 0); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } continue; @@ -717,13 +717,13 @@ void ro_gui_download_update_status(struct gui_download_window *dw) download_progress_y1); if (error) { LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_STATUS, 0, 0); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } if (dw->ctx) { @@ -759,13 +759,13 @@ void ro_gui_download_window_hide_caret(struct gui_download_window *dw) error = xwimp_get_caret_position(&caret); if (error) { LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } else if (caret.w == dw->window) { error = xwimp_set_caret_position(dw->window, (wimp_i)-1, 0, 0, 1 << 25, -1); if (error) { LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } } @@ -791,7 +791,7 @@ static void gui_download_window_done(struct gui_download_window *dw) error = xosfind_closew(dw->file); if (error) { LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); } dw->file = 0; @@ -800,7 +800,7 @@ static void gui_download_window_done(struct gui_download_window *dw) dw->file_type); if (error) { LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); } if (dw->send_dataload) { @@ -856,7 +856,7 @@ bool ro_gui_download_click(wimp_pointer *pointer) error = xos_cli(command); if (error) { LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); } } } @@ -886,7 +886,7 @@ bool ro_gui_download_keypress(wimp_key *key) const char *name = ro_gui_get_icon_string(dw->window, ICON_DOWNLOAD_PATH); if (!strrchr(name, '.')) { - warn_user("NoPathError", NULL); + ro_warn_user("NoPathError", NULL); return true; } ro_gui_convert_save_path(dw->path, sizeof dw->path, name); @@ -929,7 +929,7 @@ static void ro_gui_download_drag_end(wimp_dragged *drag, void *data) error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -959,7 +959,7 @@ static void ro_gui_download_drag_end(wimp_dragged *drag, void *data) pointer.w, pointer.i, 0); if (error) { LOG("xwimp_send_message_to_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } gui_current_drag_type = GUI_DRAG_DOWNLOAD_SAVE; @@ -1179,7 +1179,7 @@ os_error *ro_gui_download_move(struct gui_download_window *dw, fileswitch_ATTR_OWNER_WRITE); if (error) { LOG("xosfile_write: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); } error = xosfind_openupw(osfind_NO_PATH | osfind_ERROR_IF_DIR, @@ -1201,7 +1201,7 @@ os_error *ro_gui_download_move(struct gui_download_window *dw, dw->file_type); if (error) { LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); } } @@ -1289,19 +1289,19 @@ bool ro_gui_download_save(struct gui_download_window *dw, default: error = xosfile_make_error(file_name, obj_type); assert(error); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } } if (!ro_gui_download_check_space(dw, file_name, temp_name)) { - warn_user("SaveError", messages_get("NoDiscSpace")); + ro_warn_user("SaveError", messages_get("NoDiscSpace")); return false; } error = ro_gui_download_move(dw, file_name, temp_name); if (error) { - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); /* try to reopen at old location so that the download can continue to the temporary file */ @@ -1336,7 +1336,7 @@ bool ro_gui_download_save(struct gui_download_window *dw, 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_warn_user("WimpError", error->errmess); } /* hide writeable path icon and show destination icon @@ -1349,13 +1349,13 @@ bool ro_gui_download_save(struct gui_download_window *dw, wimp_ICON_DELETED, wimp_ICON_DELETED); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_set_icon_state(dw->window, ICON_DOWNLOAD_DESTINATION, wimp_ICON_DELETED, 0); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } ro_gui_download_window_hide_caret(dw); @@ -1401,7 +1401,7 @@ void ro_gui_download_send_dataload(struct gui_download_window *dw) */ if (error && error->errnum != error_WIMP_BAD_HANDLE) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } riscos_schedule(2000, ro_gui_download_window_destroy_wrapper, dw); @@ -1482,7 +1482,7 @@ bool ro_gui_download_window_destroy(struct gui_download_window *dw, bool quit) error = xwimp_delete_window(dw->window); if (error) { LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } ro_gui_wimp_event_finalise(dw->window); @@ -1491,7 +1491,7 @@ bool ro_gui_download_window_destroy(struct gui_download_window *dw, bool quit) error = xosfind_closew(dw->file); if (error) { LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); } } @@ -1502,7 +1502,7 @@ bool ro_gui_download_window_destroy(struct gui_download_window *dw, bool quit) error = xosfile_delete(temp_name, 0, 0, 0, 0, 0); if (error) { LOG("xosfile_delete: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); } } diff --git a/riscos/filetype.c b/riscos/filetype.c index 63f8a857d..1a16df0a1 100644 --- a/riscos/filetype.c +++ b/riscos/filetype.c @@ -21,6 +21,7 @@ #include #include "oslib/mimemap.h" #include "oslib/osfile.h" + #include "content/content.h" #include "content/fetch.h" #include "content/hlcache.h" @@ -28,6 +29,7 @@ #include "utils/config.h" #include "utils/log.h" #include "utils/utils.h" +#include "riscos/gui.h" /* type_map must be in sorted order by file_type */ struct type_entry { @@ -73,7 +75,7 @@ const char *fetch_filetype(const char *unix_path) if (!path) { LOG("Insufficient memory for calloc"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return "application/riscos"; } @@ -156,7 +158,7 @@ char *fetch_mimetype(const char *ro_path) if (!mime) { LOG("Insufficient memory for calloc"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return 0; } @@ -323,7 +325,7 @@ bits ro_filetype_from_unix_path(const char *unix_path) if (!path) { LOG("Insufficient memory for calloc"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return osfile_TYPE_DATA; } diff --git a/riscos/font.c b/riscos/font.c index 08351b5d8..99542a424 100644 --- a/riscos/font.c +++ b/riscos/font.c @@ -232,7 +232,7 @@ ro_font_width(const plot_font_style_t *fstyle, LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); else LOG("rufl_width: 0x%x", code); -/* warn_user("MiscError", "font error"); */ +/* ro_warn_user("MiscError", "font error"); */ *width = 0; return false; } @@ -278,7 +278,7 @@ ro_font_position(const plot_font_style_t *fstyle, LOG("rufl_x_to_offset: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); else LOG("rufl_x_to_offset: 0x%x", code); -/* warn_user("MiscError", "font error"); */ +/* ro_warn_user("MiscError", "font error"); */ *char_offset = 0; *actual_x = 0; return false; @@ -336,7 +336,7 @@ ro_font_split(const plot_font_style_t *fstyle, LOG("rufl_split: rufl_FONT_MANAGER_ERROR: ""0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); else LOG("rufl_split: 0x%x", code); -/* warn_user("MiscError", "font error"); */ +/* ro_warn_user("MiscError", "font error"); */ *char_offset = 0; *actual_x = 0; return false; @@ -367,7 +367,7 @@ ro_font_split(const plot_font_style_t *fstyle, LOG("rufl_width: rufl_FONT_MANAGER_ERROR: 0x%x: %s", rufl_fm_error->errnum, rufl_fm_error->errmess); else LOG("rufl_width: 0x%x", code); -/* warn_user("MiscError", "font error"); */ +/* ro_warn_user("MiscError", "font error"); */ *char_offset = 0; *actual_x = 0; return false; @@ -505,7 +505,7 @@ ro_gui_wimp_desktop_font(char *family, error = xwimpreadsysinfo_font(&font_handle, NULL); if (error) { LOG("xwimpreadsysinfo_font: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); goto failsafe; } @@ -517,7 +517,7 @@ ro_gui_wimp_desktop_font(char *family, error = xfont_read_identifier(font_handle, NULL, &used); if (error) { LOG("xfont_read_identifier: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); goto failsafe; } @@ -530,7 +530,7 @@ ro_gui_wimp_desktop_font(char *family, &ptx, &pty, NULL, NULL, NULL, NULL); if (error) { LOG("xfont_read_defn: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); goto failsafe; } diff --git a/riscos/gui/button_bar.c b/riscos/gui/button_bar.c index e04bfc270..6f8920cfc 100644 --- a/riscos/gui/button_bar.c +++ b/riscos/gui/button_bar.c @@ -540,7 +540,7 @@ bool ro_gui_button_bar_icon_update(struct button_bar *button_bar) error = xwimp_create_icon(&icon, &button->icon); if (error) { LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); button->icon = -1; return false; } @@ -550,7 +550,7 @@ bool ro_gui_button_bar_icon_update(struct button_bar *button_bar) button->icon); if (error != NULL) { LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -600,7 +600,7 @@ bool ro_gui_button_bar_icon_resize(struct button_bar *button_bar) button->y_size); if (error != NULL) { LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); button->icon = -1; return false; } @@ -872,7 +872,7 @@ void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data) error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -882,7 +882,7 @@ void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1070,7 +1070,7 @@ char *ro_gui_button_bar_get_config(struct button_bar *button_bar) config = malloc(size); if (config == NULL) { LOG("No memory for malloc()"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return NULL; } diff --git a/riscos/gui/throbber.c b/riscos/gui/throbber.c index 2eabb3e7e..437c4faba 100644 --- a/riscos/gui/throbber.c +++ b/riscos/gui/throbber.c @@ -35,6 +35,7 @@ #include "riscos/wimp.h" #include "utils/log.h" #include "utils/utils.h" +#include "riscos/gui.h" #define THROBBER_SPRITE_NAME_LENGTH 12 #define THROBBER_ANIMATE_INTERVAL 10 @@ -247,7 +248,7 @@ bool ro_gui_throbber_icon_update(struct throbber *throbber) error = xwimp_create_icon(&icon, &throbber->icon); if (error != NULL) { LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); throbber->icon = -1; return false; } @@ -258,7 +259,7 @@ bool ro_gui_throbber_icon_update(struct throbber *throbber) error = xwimp_delete_icon(throbber->window, throbber->icon); if (error != NULL) { LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -294,7 +295,7 @@ bool ro_gui_throbber_icon_resize(struct throbber *throbber) throbber->extent.x1, throbber->extent.y1); if (error != NULL) { LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); throbber->icon = -1; return false; } diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c index adaa8c03c..053014784 100644 --- a/riscos/gui/url_bar.c +++ b/riscos/gui/url_bar.c @@ -235,7 +235,7 @@ static bool ro_gui_url_bar_icon_resize(struct url_bar *url_bar, bool full) x0, y0, x1, y1); if (error != NULL) { LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); url_bar->container_icon = -1; return false; } @@ -255,7 +255,7 @@ static bool ro_gui_url_bar_icon_resize(struct url_bar *url_bar, bool full) x0, y0, x1, y1); if (error != NULL) { LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); url_bar->suggest_icon = -1; return false; } @@ -276,7 +276,7 @@ static bool ro_gui_url_bar_icon_resize(struct url_bar *url_bar, bool full) x0, y0, x1, y1); if (error != NULL) { LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); url_bar->text_icon = -1; return false; } @@ -357,7 +357,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) error = xwimp_create_icon(&icon, &url_bar->container_icon); if (error != NULL) { LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); url_bar->container_icon = -1; return false; } @@ -368,7 +368,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) url_bar->container_icon); if (error != NULL) { LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -394,7 +394,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) error = xwimp_create_icon(&icon, &url_bar->text_icon); if (error) { LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); url_bar->text_icon = -1; return false; } @@ -405,7 +405,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) url_bar->text_icon); if (error != NULL) { LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -425,7 +425,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) error = xwimp_create_icon(&icon, &url_bar->suggest_icon); if (error) { LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -445,7 +445,7 @@ static bool ro_gui_url_bar_icon_update(struct url_bar *url_bar) url_bar->suggest_icon); if (error != NULL) { LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -856,7 +856,7 @@ bool ro_gui_url_bar_menu_select(struct url_bar *url_bar, wimp_i i, error = nsurl_create(urltxt, &url); if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); } else { ro_gui_window_set_url(g, url); @@ -935,7 +935,7 @@ bool ro_gui_url_bar_take_caret(struct url_bar *url_bar) -1, -1, -1, 0); if (error) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -986,7 +986,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, if (strlen(local_url) >= url_bar->text_size) { url_bar->text_buffer[0] = '\0'; - warn_user("LongURL", NULL); + ro_warn_user("LongURL", NULL); LOG("Long URL (%zu chars): %s", strlen(url), url); } else { strncpy(url_bar->text_buffer, local_url, @@ -1016,7 +1016,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, error = xwimp_get_caret_position(&caret); if (error) { LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1029,7 +1029,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url, url_bar->text_icon, 0, 0, -1, strlen(set_url)); if (error) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } } @@ -1118,7 +1118,7 @@ bool ro_gui_url_bar_get_url_extent(struct url_bar *url_bar, os_box *extent) error = xwimp_get_icon_state(&state); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } diff --git a/riscos/help.c b/riscos/help.c index c54af1ded..3c9f5488b 100644 --- a/riscos/help.c +++ b/riscos/help.c @@ -168,7 +168,7 @@ void ro_gui_interactive_help_request(wimp_message *message) &menu_tree, window, icon); if (error) { LOG("xwimp_get_menu_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } if (menu_tree.items[0] == -1) @@ -271,7 +271,7 @@ static void ro_gui_interactive_help_broadcast(wimp_message *message, reply->sender); if (error) { LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -299,7 +299,7 @@ bool ro_gui_interactive_help_available(void) sizeof(taskmanager_task), &context, 0); if (error) { LOG("xtaskmanager_enumerate_tasks: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); } /* we can't just use strcmp due to string termination issues */ @@ -336,7 +336,7 @@ void ro_gui_interactive_help_start(void) error = xwimp_start_task("", &task); if (error) { LOG("xwimp_start_tast: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -346,7 +346,7 @@ void ro_gui_interactive_help_start(void) error = xwimp_start_task("Resources:$.Apps.!Help", &task); if (error) { LOG("xwimp_start_tast: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -356,7 +356,7 @@ void ro_gui_interactive_help_start(void) error = xos_read_monotonic_time(&help_time); if (error) { LOG("xwimp_read_monotonic_time: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } } diff --git a/riscos/history.c b/riscos/history.c index 3dc9f0d7d..4b3bed2c4 100644 --- a/riscos/history.c +++ b/riscos/history.c @@ -101,7 +101,7 @@ void ro_gui_history_open(struct gui_window *g, bool at_pointer) error = xwimp_set_extent(history_window, &box); if (error) { LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -110,7 +110,7 @@ void ro_gui_history_open(struct gui_window *g, bool at_pointer) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } state.visible.x0 = 0; @@ -121,7 +121,7 @@ void ro_gui_history_open(struct gui_window *g, bool at_pointer) error = xwimp_open_window(PTR_WIMP_OPEN(&state)); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -146,7 +146,7 @@ void ro_gui_history_redraw(wimp_draw *redraw) error = xwimp_redraw_window(redraw, &more); if (error) { LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } while (more) { @@ -156,7 +156,7 @@ void ro_gui_history_redraw(wimp_draw *redraw) error = xwimp_get_rectangle(redraw, &more); if (error) { LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -220,7 +220,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -232,7 +232,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data) error = xwimp_close_window(dialog_tooltip); if (error) { LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } return; @@ -244,7 +244,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data) &width); if (error) { LOG("xwimptextop_string_width: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -256,7 +256,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data) error = xwimp_get_icon_state(&ic); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } error = xwimp_resize_icon(dialog_tooltip, 0, @@ -264,7 +264,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data) width + 16, ic.icon.extent.y1); if (error) { LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -272,7 +272,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -282,7 +282,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data) error = xwimp_set_extent(dialog_tooltip, &box); if (error) { LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -296,7 +296,7 @@ void ro_gui_history_mouse_at(wimp_pointer *pointer, void *data) error = xwimp_open_window(PTR_WIMP_OPEN(&state)); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -323,7 +323,7 @@ bool ro_gui_history_click(wimp_pointer *pointer) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return true; } diff --git a/riscos/hotlist.c b/riscos/hotlist.c index 0ddc3c858..c72840448 100644 --- a/riscos/hotlist.c +++ b/riscos/hotlist.c @@ -234,7 +234,7 @@ void ro_gui_hotlist_open(void) return; LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess); - warn_user("Failed to launch external hotlist: %s", + ro_warn_user("Failed to launch external hotlist: %s", error->errmess); } diff --git a/riscos/iconbar.c b/riscos/iconbar.c index 7b7bb250e..6024ea9b4 100644 --- a/riscos/iconbar.c +++ b/riscos/iconbar.c @@ -144,7 +144,7 @@ bool ro_gui_iconbar_click(wimp_pointer *pointer) nsurl_unref(url); } if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); } break; @@ -215,7 +215,7 @@ bool ro_gui_iconbar_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, nsurl_unref(url); } if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); } return true; diff --git a/riscos/image.c b/riscos/image.c index 3f23691a4..71d63349b 100644 --- a/riscos/image.c +++ b/riscos/image.c @@ -184,7 +184,7 @@ bool image_redraw_os(osspriteop_id header, int x, int y, int req_width, table = calloc(size, sizeof(char)); if (!table) { LOG("malloc failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return false; } diff --git a/riscos/menus.c b/riscos/menus.c index b803f8cf8..dcb0bf95d 100644 --- a/riscos/menus.c +++ b/riscos/menus.c @@ -224,7 +224,7 @@ void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w) definition = ro_gui_menu_find_menu(menu); if (definition) { if (!ro_gui_menu_translate(definition)) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return; } } @@ -239,7 +239,7 @@ void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w) error = xwimp_create_menu(menu, x - 64, y); if (error) { LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess); - warn_user("MenuError", error->errmess); + ro_warn_user("MenuError", error->errmess); ro_gui_menu_closed(); } } @@ -265,14 +265,14 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("MenuError", error->errmess); + ro_warn_user("MenuError", error->errmess); return; } error = xwimp_get_icon_state(&icon_state); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("MenuError", error->errmess); + ro_warn_user("MenuError", error->errmess); return; } @@ -298,7 +298,7 @@ void ro_gui_menu_destroy(void) error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0); if (error) { LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess); - warn_user("MenuError", error->errmess); + ro_warn_user("MenuError", error->errmess); } ro_gui_menu_closed(); @@ -361,7 +361,7 @@ void ro_gui_menu_selection(wimp_selection *selection) error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); ro_gui_menu_closed(); return; } @@ -427,7 +427,7 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning) warning->pos.x, warning->pos.y); if (error) { LOG("xwimp_create_sub_menu: 0x%x: %s", error->errnum, error->errmess); - warn_user("MenuError", error->errmess); + ro_warn_user("MenuError", error->errmess); } } @@ -492,7 +492,7 @@ void ro_gui_menu_refresh(wimp_menu *menu) error = xwimp_create_menu(current_menu, 0, 0); if (error) { LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess); - warn_user("MenuError", error->errmess); + ro_warn_user("MenuError", error->errmess); } } } @@ -858,7 +858,7 @@ int ro_gui_menu_get_checksum(void) &menu_tree, 0, 0); if (error) { LOG("xwimp_get_menu_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("MenuError", error->errmess); + ro_warn_user("MenuError", error->errmess); return 0; } diff --git a/riscos/message.c b/riscos/message.c index c97434b8a..70efcc1e9 100644 --- a/riscos/message.c +++ b/riscos/message.c @@ -25,10 +25,11 @@ #include #include "oslib/os.h" #include "oslib/wimp.h" + #include "riscos/message.h" #include "utils/log.h" #include "utils/utils.h" - +#include "riscos/gui.h" struct active_message { unsigned int message_code; @@ -64,7 +65,7 @@ bool ro_message_send_message(wimp_event_no event, wimp_message *message, error = xwimp_send_message(event, message, task); if (error) { LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -101,7 +102,7 @@ bool ro_message_send_message_to_window(wimp_event_no event, wimp_message *messag error = xwimp_send_message_to_window(event, message, to_w, to_i, to_t); if (error) { LOG("xwimp_send_message_to_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } diff --git a/riscos/mouse.c b/riscos/mouse.c index 2f8011529..25db2ff9a 100644 --- a/riscos/mouse.c +++ b/riscos/mouse.c @@ -42,6 +42,7 @@ #include "utils/utils.h" #include "riscos/mouse.h" +#include "riscos/gui.h" /* Data for the wimp drag handler. */ @@ -82,7 +83,7 @@ void ro_mouse_poll(void) error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -147,7 +148,7 @@ void ro_mouse_drag_end(wimp_dragged *dragged) if (ro_mouse_drag_end_callback != NULL) ro_mouse_drag_end_callback(dragged, ro_mouse_drag_data); else - warn_user("WimpError", "No callback"); + ro_warn_user("WimpError", "No callback"); /* Wimp_DragEnd is a one-shot event, so clear the data ready for * another claimant. diff --git a/riscos/print.c b/riscos/print.c index 0ec541a2d..95730d6be 100644 --- a/riscos/print.c +++ b/riscos/print.c @@ -335,7 +335,7 @@ void print_send_printsave(hlcache_handle *h) (wimp_message *)&m, 0); if (e) { LOG("xwimp_send_message: 0x%x: %s", e->errnum, e->errmess); - warn_user("WimpError", e->errmess); + ro_warn_user("WimpError", e->errmess); ro_print_cleanup(); } print_prev_message = m.my_ref; @@ -359,7 +359,7 @@ bool print_send_printtypeknown(wimp_message *m) e = xwimp_send_message(wimp_USER_MESSAGE, m, m->sender); if (e) { LOG("xwimp_send_message: 0x%x: %s", e->errnum, e->errmess); - warn_user("WimpError", e->errmess); + ro_warn_user("WimpError", e->errmess); return false; } @@ -399,9 +399,9 @@ void ro_print_error(wimp_message *m) return; if (m->size == 20) - warn_user("PrintErrorRO2", 0); + ro_warn_user("PrintErrorRO2", 0); else - warn_user("PrintError", p->errmess); + ro_warn_user("PrintError", p->errmess); ro_print_cleanup(); } @@ -465,7 +465,7 @@ bool ro_print_ack(wimp_message *m) error = xpdriver_info(&info_type, 0, 0, 0, 0, 0, 0, 0); if (error) { LOG("xpdriver_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("PrintError", error->errmess); + ro_warn_user("PrintError", error->errmess); ro_print_cleanup(); return true; } @@ -490,7 +490,7 @@ bool ro_print_ack(wimp_message *m) error = xwimp_send_message(wimp_USER_MESSAGE_RECORDED, m, m->sender); if (error) { LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); /* and delete temporary file */ xosfile_delete(m->data.data_xfer.file_name, 0, 0, 0, 0, 0); @@ -554,7 +554,7 @@ bool print_document(struct gui_window *g, const char *filename) /* no point printing a blank page */ if (!h) { - warn_user("PrintError", "nothing to print"); + ro_warn_user("PrintError", "nothing to print"); return false; } @@ -562,7 +562,7 @@ bool print_document(struct gui_window *g, const char *filename) error = xpdriver_info(0, 0, 0, &features, 0, 0, 0, 0); if (error) { LOG("xpdriver_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("PrintError", error->errmess); + ro_warn_user("PrintError", error->errmess); return false; } @@ -570,7 +570,7 @@ bool print_document(struct gui_window *g, const char *filename) error = xpdriver_page_size(0, 0, &left, &bottom, &right, &top); if (error) { LOG("xpdriver_page_size: 0x%x: %s", error->errnum, error->errmess); - warn_user("PrintError", error->errmess); + ro_warn_user("PrintError", error->errmess); return false; } @@ -593,7 +593,7 @@ bool print_document(struct gui_window *g, const char *filename) osfind_ERROR_IF_ABSENT, filename, 0, &fhandle); if (error) { LOG("xosfind_openoutw: 0x%x: %s", error->errnum, error->errmess); - warn_user("PrintError", error->errmess); + ro_warn_user("PrintError", error->errmess); return false; } @@ -601,7 +601,7 @@ bool print_document(struct gui_window *g, const char *filename) error = xpdriver_select_jobw(fhandle, "NetSurf", &old_job); if (error) { LOG("xpdriver_select_jobw: 0x%x: %s", error->errnum, error->errmess); - warn_user("PrintError", error->errmess); + ro_warn_user("PrintError", error->errmess); xosfind_closew(fhandle); return false; } @@ -737,7 +737,7 @@ bool print_document(struct gui_window *g, const char *filename) error = xosfind_closew(fhandle); if (error) { LOG("xosfind_closew: 0x%x: %s", error->errnum, error->errmess); - warn_user("PrintError", error->errmess); + ro_warn_user("PrintError", error->errmess); return false; } @@ -745,7 +745,7 @@ bool print_document(struct gui_window *g, const char *filename) error = xpdriver_select_jobw(old_job, 0, 0); if (error) { LOG("xpdriver_select_jobw: 0x%x: %s", error->errnum, error->errmess); - warn_user("PrintError", error->errmess); + ro_warn_user("PrintError", error->errmess); /* the printing succeeded anyway */ return true; } @@ -769,7 +769,7 @@ error: print_active = false; ro_gui_current_redraw_gui = 0; - warn_user("PrintError", error_message); + ro_warn_user("PrintError", error_message); rufl_invalidate_cache(); diff --git a/riscos/query.c b/riscos/query.c index 178dcaf5b..1d7cf5120 100644 --- a/riscos/query.c +++ b/riscos/query.c @@ -156,7 +156,7 @@ query_id query_user_xy(const char *query, const char *detail, qw = malloc(sizeof(struct gui_query_window)); if (!qw) { - warn_user("NoMemory", NULL); + ro_warn_user("NoMemory", NULL); return QUERY_INVALID; } @@ -232,7 +232,7 @@ query_id query_user_xy(const char *query, const char *detail, error = xwimp_create_window(query_template, &qw->window); if (error) { - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); free(qw); return QUERY_INVALID; } @@ -264,7 +264,7 @@ query_id query_user_xy(const char *query, const char *detail, error = xwimp_set_caret_position(qw->window, (wimp_i)-1, 0, 0, 1 << 25, -1); if (error) { LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } /* put this query window at the head of our list */ @@ -308,7 +308,7 @@ void ro_gui_query_window_bring_to_front(query_id id) error = xwimp_set_caret_position(qw->window, (wimp_i)-1, 0, 0, 1 << 25, -1); if (error) { LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } } @@ -328,7 +328,7 @@ void ro_gui_query_close(wimp_w w) error = xwimp_delete_window(qw->window); if (error) { LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } ro_gui_wimp_event_finalise(w); diff --git a/riscos/save.c b/riscos/save.c index 1816cec0d..d547e0e12 100644 --- a/riscos/save.c +++ b/riscos/save.c @@ -191,7 +191,7 @@ wimp_w ro_gui_saveas_create(const char *template_name) error = xosspriteop_clear_sprites(osspriteop_USER_AREA, saveas_area); if (error) { LOG("xosspriteop_clear_sprites: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); xosmodule_free(saveas_area); saveas_area = NULL; @@ -228,7 +228,7 @@ void ro_gui_saveas_quit(void) os_error *error = xosmodule_free(saveas_area); if (error) { LOG("xosmodule_free: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); } saveas_area = NULL; } @@ -337,7 +337,7 @@ bool ro_gui_save_ok(wimp_w w) char path[256]; if (!strrchr(name, '.')) { - warn_user("NoPathError", NULL); + ro_warn_user("NoPathError", NULL); return false; } @@ -383,7 +383,7 @@ void gui_drag_save_object(struct gui_window *g, hlcache_handle *c, error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -421,7 +421,7 @@ void gui_drag_save_selection(struct gui_window *g, const char *selection) error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -474,7 +474,7 @@ void ro_gui_drag_save_link(gui_save_type save_type, const nsurl *url, error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -512,7 +512,7 @@ void ro_gui_drag_icon(int x, int y, const char *sprite) if (error) { if (error->errnum != error_SPRITE_OP_DOESNT_EXIST) { LOG("xosspriteop_select_sprite: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); } } else @@ -545,7 +545,7 @@ void ro_gui_drag_icon(int x, int y, const char *sprite) if (error) { LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess); - warn_user("DragError", error->errmess); + ro_warn_user("DragError", error->errmess); } else dragbox_active = true; @@ -584,14 +584,14 @@ void ro_gui_drag_box_cancel(void) error = xdragasprite_stop(); if (error) { LOG("xdragasprite_stop: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } else { error = xwimp_drag_box(NULL); if (error) { LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } dragbox_active = false; @@ -621,7 +621,7 @@ static void ro_gui_save_drag_end(wimp_dragged *drag, void *data) error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -808,7 +808,7 @@ bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite) NULL, NULL, NULL, NULL, NULL); if (error) { LOG("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } @@ -825,7 +825,7 @@ bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite) default: error = xosfile_make_error(path, obj_type); assert(error); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } } @@ -865,7 +865,7 @@ bool ro_gui_save_content(hlcache_handle *h, char *path, bool force_overwrite) (byte *) source_data + source_size); if (error) { LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } break; @@ -941,7 +941,7 @@ void ro_gui_save_done(void) message->sender); if (error) { LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); } } @@ -981,7 +981,7 @@ void ro_gui_save_done(void) error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0); if (error) { LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess); - warn_user("MenuError", error->errmess); + ro_warn_user("MenuError", error->errmess); } } } @@ -1025,7 +1025,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path) error = xosfile_create_dir(path, 0); if (error) { LOG("xosfile_create_dir: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } @@ -1034,7 +1034,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path) fp = fopen(buf, "w"); if (!fp) { LOG("fopen(): errno = %i", errno); - warn_user("SaveError", strerror(errno)); + ro_warn_user("SaveError", strerror(errno)); return false; } fprintf(fp, "IconSprites .!Sprites\n"); @@ -1043,7 +1043,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path) error = xosfile_set_type(buf, 0xfeb); if (error) { LOG("xosfile_set_type: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } @@ -1078,7 +1078,7 @@ bool ro_gui_save_complete(hlcache_handle *h, char *path) error = xosspriteop_save_sprite_file(osspriteop_NAME, saveas_area, buf); if (error) { LOG("xosspriteop_save_sprite_file: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } @@ -1110,7 +1110,7 @@ bool ro_gui_save_object_native(hlcache_handle *h, char *path) (byte *) source_data + source_size); if (error != NULL) { LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } } else { @@ -1151,7 +1151,7 @@ bool ro_gui_save_link(const char *url, const char *title, link_format format, FILE *fp = fopen(path, "w"); if (!fp) { - warn_user("SaveError", strerror(errno)); + ro_warn_user("SaveError", strerror(errno)); return false; } @@ -1309,7 +1309,7 @@ void ro_gui_save_set_state(hlcache_handle *h, gui_save_type save_type, if (error) { LOG("ro_gui_wimp_get_sprite: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); } else { /* the sprite area should always be large enough for * file_xxx sprites */ diff --git a/riscos/save_draw.c b/riscos/save_draw.c index 8b8d72cd6..50febf3b2 100644 --- a/riscos/save_draw.c +++ b/riscos/save_draw.c @@ -103,7 +103,7 @@ bool save_as_draw(hlcache_handle *h, const char *path) ro_save_draw_diagram = pencil_create(); if (!ro_save_draw_diagram) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return false; } @@ -132,7 +132,7 @@ bool save_as_draw(hlcache_handle *h, const char *path) code = pencil_save_drawfile(ro_save_draw_diagram, "NetSurf", &drawfile_buffer, &drawfile_size); if (code != pencil_OK) { - warn_user("SaveError", 0); + ro_warn_user("SaveError", 0); pencil_free(ro_save_draw_diagram); return false; } @@ -143,7 +143,7 @@ bool save_as_draw(hlcache_handle *h, const char *path) (byte *) drawfile_buffer + drawfile_size); if (error) { LOG("xosfile_save_stamped failed: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); pencil_free(ro_save_draw_diagram); return false; } @@ -401,7 +401,7 @@ bool ro_save_draw_bitmap(int x, int y, int width, int height, buffer = riscos_bitmap_get_buffer(bitmap); if (!buffer) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return false; } @@ -456,15 +456,15 @@ bool ro_save_draw_error(pencil_code code) assert(0); break; case pencil_OUT_OF_MEMORY: - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); break; case pencil_FONT_MANAGER_ERROR: - warn_user("SaveError", rufl_fm_error->errmess); + ro_warn_user("SaveError", rufl_fm_error->errmess); break; case pencil_FONT_NOT_FOUND: case pencil_IO_ERROR: case pencil_IO_EOF: - warn_user("SaveError", "generating the DrawFile failed"); + ro_warn_user("SaveError", "generating the DrawFile failed"); break; } diff --git a/riscos/search.c b/riscos/search.c index 9c438bf72..1a178f25e 100644 --- a/riscos/search.c +++ b/riscos/search.c @@ -226,7 +226,7 @@ void ro_gui_search_add_recent(const char *search, void *p) tmp = strdup(search); if (!tmp) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return; } free(search_data.recent_searches[RECENT_SEARCHES - 1]); diff --git a/riscos/sslcert.c b/riscos/sslcert.c index 5812dff12..31e81ebff 100644 --- a/riscos/sslcert.c +++ b/riscos/sslcert.c @@ -336,12 +336,12 @@ void ro_gui_cert_release_window(struct ro_sslcert *s) error = xwimp_delete_window(s->window); if (error) { LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_delete_window(s->pane); if (error) { LOG("xwimp_delete_window: 0x%x:%s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } free(s); diff --git a/riscos/textselection.c b/riscos/textselection.c index 38a33ef74..718171db0 100644 --- a/riscos/textselection.c +++ b/riscos/textselection.c @@ -98,7 +98,7 @@ void gui_start_selection(struct gui_window *g) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -112,7 +112,7 @@ void gui_start_selection(struct gui_window *g) (wimp_message*)&msg, wimp_BROADCAST); if (error) { LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } owns_caret_and_selection = true; @@ -142,7 +142,7 @@ void gui_start_selection(struct gui_window *g) error = xwimp_drag_box(&drag); if (error) { LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } last_start_window = g; } @@ -171,13 +171,13 @@ static void ro_gui_selection_drag_end(wimp_dragged *drag, void *data) error = xwimp_drag_box((wimp_drag*)-1); if (error) { LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -228,7 +228,7 @@ static void gui_set_clipboard(const char *buffer, size_t length, (wimp_message*)&msg, wimp_BROADCAST); if (error) { LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } owns_clipboard = true; } @@ -513,7 +513,7 @@ bool ro_gui_save_clipboard(const char *path) ret = utf8_to_local_encoding(clipboard, clip_length, &local_cb); if (ret != NSERROR_OK) { - warn_user("SaveError", "Could not convert"); + ro_warn_user("SaveError", "Could not convert"); return false; } @@ -525,7 +525,7 @@ bool ro_gui_save_clipboard(const char *path) if (error) { LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess); - warn_user("SaveError", error->errmess); + ro_warn_user("SaveError", error->errmess); return false; } diff --git a/riscos/theme.c b/riscos/theme.c index 333c9e6f8..7f2beea32 100644 --- a/riscos/theme.c +++ b/riscos/theme.c @@ -186,7 +186,7 @@ static void ro_gui_theme_get_available_in_dir(const char *directory) error->errnum, error->errmess); if (error->errnum == 0xd6) /* no such dir */ return; - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); break; } @@ -367,7 +367,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname) filename = malloc(strlen(folder) + strlen(leafname) + 2); if (!filename) { LOG("No memory for malloc"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return false; } sprintf(filename, "%s.%s", folder, leafname); @@ -377,7 +377,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname) &file_handle); if (error) { LOG("xosfind_openinw: 0x%x: %s", error->errnum, error->errmess); - warn_user("FileError", error->errmess); + ro_warn_user("FileError", error->errmess); free(filename); return false; } @@ -392,7 +392,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname) xosfind_closew(file_handle); if (error) { LOG("xosbgpb_read_atw: 0x%x: %s", error->errnum, error->errmess); - warn_user("FileError", error->errmess); + ro_warn_user("FileError", error->errmess); free(filename); return false; } @@ -406,7 +406,7 @@ bool ro_gui_theme_add_descriptor(const char *folder, const char *leafname) sizeof(struct theme_descriptor)); if (!current) { LOG("calloc failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); free(filename); return false; } @@ -524,7 +524,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) sizeof(struct theme)); if (!descriptor->theme) { LOG("calloc() failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); continue; } descriptor->theme->users = 1; @@ -534,7 +534,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) &obj_type, 0, 0, &file_size, 0, 0); if (error) { LOG("xosfile_read_stamped_no_path: 0x%x: %s", error->errnum, error->errmess); - warn_user("FileError", error->errmess); + ro_warn_user("FileError", error->errmess); continue; } if (obj_type != fileswitch_IS_FILE) @@ -542,7 +542,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) raw_data = malloc(file_size); if (!raw_data) { LOG("malloc() failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); continue; } error = xosfile_load_stamped_no_path(descriptor->filename, @@ -550,7 +550,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) if (error) { free(raw_data); LOG("xosfile_load_stamped_no_path: 0x%x: %s", error->errnum, error->errmess); - warn_user("FileError", error->errmess); + ro_warn_user("FileError", error->errmess); continue; } @@ -559,7 +559,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) if (error) { free(raw_data); LOG("xsquash_decompress_return_sizes: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); continue; } decompressed = (osspriteop_area *)malloc( @@ -569,7 +569,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) free(decompressed); free(raw_data); LOG("malloc() failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); continue; } error = xsquash_decompress(squash_INPUT_ALL_PRESENT, workspace, @@ -584,7 +584,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) if (error) { free(decompressed); LOG("xsquash_decompress: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); continue; } if (status != 0) { @@ -602,7 +602,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) sprite_name, 16, i, 0); if (error) { LOG("xosspriteop_return_name: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); continue; } if (strncmp(sprite_name, "throbber", 8)) @@ -617,7 +617,7 @@ bool ro_gui_theme_open(struct theme_descriptor *descriptor, bool list) (osbool *) 0, &mode); if (error) { LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); continue; } ro_convert_pixels_to_os_units(&dimensions, mode); diff --git a/riscos/theme_install.c b/riscos/theme_install.c index 5270bd3c2..05efce49d 100644 --- a/riscos/theme_install.c +++ b/riscos/theme_install.c @@ -63,7 +63,7 @@ void theme_install_start(hlcache_handle *c) assert(content_get_type(c) == CONTENT_THEME); if (ro_gui_dialog_open_top(dialog_theme_install, NULL, 0, 0)) { - warn_user("ThemeInstActive", 0); + ro_warn_user("ThemeInstActive", 0); return; } @@ -102,7 +102,7 @@ nserror theme_install_callback(hlcache_handle *handle, source_data = content_get_source_data(handle, &source_size); if (!theme_install_read(source_data, source_size)) { - warn_user("ThemeInvalid", 0); + ro_warn_user("ThemeInvalid", 0); theme_install_close(dialog_theme_install); break; } @@ -126,7 +126,7 @@ nserror theme_install_callback(hlcache_handle *handle, case CONTENT_MSG_ERROR: theme_install_close(dialog_theme_install); - warn_user(event->data.error, 0); + ro_warn_user(event->data.error, 0); break; default: @@ -185,7 +185,7 @@ bool ro_gui_theme_install_apply(wimp_w w) theme_file = strdup(theme_install_descriptor.name); if (!theme_file) { LOG("malloc failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return false; } for (fix = theme_file; *fix != '\0'; fix++) @@ -206,7 +206,7 @@ bool ro_gui_theme_install_apply(wimp_w w) (byte *) source_data + source_size); if (error) { LOG("xosfile_save_stamped: 0x%x: %s", error->errnum, error->errmess); - warn_user("ThemeInstallErr", 0); + ro_warn_user("ThemeInstallErr", 0); free(theme_file); return false; } @@ -215,7 +215,7 @@ bool ro_gui_theme_install_apply(wimp_w w) ro_gui_theme_get_available(); theme_install = ro_gui_theme_find(theme_file); if (!theme_install || !ro_gui_theme_apply(theme_install)) { - warn_user("ThemeApplyErr", 0); + ro_warn_user("ThemeApplyErr", 0); } else { nsoption_set_charp(theme, strdup(theme_install->leafname)); } diff --git a/riscos/toolbar.c b/riscos/toolbar.c index b6e1d917e..173d437d6 100644 --- a/riscos/toolbar.c +++ b/riscos/toolbar.c @@ -232,7 +232,7 @@ struct toolbar *ro_toolbar_create(struct theme_descriptor *descriptor, toolbar = calloc(sizeof(struct toolbar), 1); if (toolbar == NULL) { LOG("No memory for malloc()"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return NULL; } @@ -380,7 +380,7 @@ bool ro_toolbar_rebuild(struct toolbar *toolbar) &toolbar->toolbar_handle); if (error) { LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -498,7 +498,7 @@ bool ro_toolbar_rebuild(struct toolbar *toolbar) error = xwimp_create_icon(&icon, &toolbar->editor_div1); if (error) { LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); toolbar->editor_div1 = -1; } } @@ -563,7 +563,7 @@ bool ro_toolbar_attach(struct toolbar *toolbar, wimp_w parent) << wimp_CHILD_TS_EDGE_SHIFT); if (error) { LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -573,7 +573,7 @@ bool ro_toolbar_attach(struct toolbar *toolbar, wimp_w parent) error = xwimp_close_window(toolbar->toolbar_handle); if (error) { LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } return true; @@ -606,7 +606,7 @@ bool ro_toolbar_process(struct toolbar *toolbar, int width, bool reformat) error = xwimp_get_window_outline(&outline); if (error) { LOG("xwimp_get_window_outline: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -626,7 +626,7 @@ bool ro_toolbar_process(struct toolbar *toolbar, int width, bool reformat) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -652,7 +652,7 @@ bool ro_toolbar_process(struct toolbar *toolbar, int width, bool reformat) &extent); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } ro_toolbar_attach(toolbar, toolbar->parent_handle); @@ -999,7 +999,7 @@ void ro_toolbar_redraw(wimp_draw *redraw) error = xwimp_redraw_window(redraw, &more); if (error) { LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } while (more) { @@ -1018,7 +1018,7 @@ void ro_toolbar_redraw(wimp_draw *redraw) error = xwimp_get_rectangle(redraw, &more); if (error) { LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -1051,7 +1051,7 @@ bool ro_toolbar_click(wimp_pointer *pointer) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -1330,7 +1330,7 @@ const char *ro_toolbar_get_help_suffix(wimp_w w, wimp_i i, os_coord *pos, error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return NULL; } diff --git a/riscos/treeview.c b/riscos/treeview.c index aa86d209c..83c9f7ecc 100644 --- a/riscos/treeview.c +++ b/riscos/treeview.c @@ -312,7 +312,7 @@ void ro_treeview_redraw_request(int x, int y, int width, int height, error = xwimp_update_window(&update, &more); if (error) { LOG("xwimp_update_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } ro_treeview_redraw_loop(&update, tv, more); @@ -343,7 +343,7 @@ void ro_treeview_redraw(wimp_draw *redraw) error = xwimp_redraw_window(redraw, &more); if (error) { LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -457,7 +457,7 @@ void ro_treeview_redraw_loop(wimp_draw *redraw, ro_treeview *tv, osbool more) error = xwimp_get_rectangle(redraw, &more); if (error) { LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -510,7 +510,7 @@ void ro_treeview_scroll_visible(int y, int height, void *pw) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -548,7 +548,7 @@ void ro_treeview_scroll_visible(int y, int height, void *pw) error = xwimp_open_window((wimp_open *) &state); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -575,7 +575,7 @@ void ro_treeview_get_window_dimensions(int *width, int *height, error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -617,7 +617,7 @@ void ro_treeview_set_window_extent(ro_treeview *tv, int width, int height) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -676,7 +676,7 @@ void ro_treeview_set_window_extent(ro_treeview *tv, int width, int height) error = xwimp_open_window((wimp_open *) &state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -700,7 +700,7 @@ void ro_treeview_set_window_extent(ro_treeview *tv, int width, int height) error = xwimp_set_extent(tv->w, &extent); if (error) { LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -753,7 +753,7 @@ static void ro_treeview_open(wimp_open *open) error = xwimp_set_extent(tv->w, &extent); if (error) { LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -766,7 +766,7 @@ static void ro_treeview_open(wimp_open *open) error = xwimp_open_window(open); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } if (tv->tb) @@ -800,7 +800,7 @@ static bool ro_treeview_mouse_click(wimp_pointer *pointer) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -938,7 +938,7 @@ void ro_treeview_mouse_at(wimp_pointer *pointer, void *data) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1022,7 +1022,7 @@ static void ro_treeview_drag_start(ro_treeview *tv, wimp_pointer *pointer, wimp_DRAG_BOX_KEEP_IN_LINE | wimp_DRAG_BOX_CLIP); if (error) { LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } else { auto_scroll.w = tv->w; auto_scroll.pause_zone_sizes.x0 = 80; @@ -1037,7 +1037,7 @@ static void ro_treeview_drag_start(ro_treeview *tv, wimp_pointer *pointer, &auto_scroll, NULL); if (error) { LOG("xwimp_auto_scroll: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } ro_mouse_drag_start(ro_treeview_drag_end, ro_treeview_mouse_at, @@ -1061,13 +1061,13 @@ static void ro_treeview_drag_end(wimp_dragged *drag, void *data) error = xwimp_drag_box((wimp_drag *) -1); if (error) { LOG("xwimp_drag_box: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_auto_scroll(0, NULL, NULL); if (error) { LOG("xwimp_auto_scroll: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } diff --git a/riscos/uri.c b/riscos/uri.c index 2c45d75a9..0e4c0b867 100644 --- a/riscos/uri.c +++ b/riscos/uri.c @@ -82,7 +82,7 @@ void ro_uri_message_received(wimp_message *msg) nsurl_unref(url); } if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); } } diff --git a/riscos/url_complete.c b/riscos/url_complete.c index ff91b1c18..2ed82e2a6 100644 --- a/riscos/url_complete.c +++ b/riscos/url_complete.c @@ -170,7 +170,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) 65536, -url_complete_matches_selection * 44); if (error) { LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } /* clear our state */ @@ -209,7 +209,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } url_complete_matches_reset = true; @@ -227,7 +227,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) 0, -(i + 1) * 44, 65536, -i * 44); if (error) { LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", + ro_warn_user("WimpError", error->errmess); } } @@ -280,7 +280,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) 65536, -old_selection * 44); if (error) { LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_force_redraw(dialog_url_complete, @@ -288,7 +288,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) 65536, -url_complete_matches_selection * 44); if (error) { LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } if (old_selection == -1) { @@ -319,7 +319,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return true; } @@ -334,7 +334,7 @@ bool ro_gui_url_complete_keypress(struct toolbar *toolbar, uint32_t key) error = xwimp_open_window(PTR_WIMP_OPEN(&state)); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return true; } @@ -410,7 +410,7 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -422,7 +422,7 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open) error = xwimp_get_window_state(&toolbar_state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -437,7 +437,7 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open) error = xwimp_set_extent(dialog_url_complete, &extent); if (error) { LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -459,14 +459,14 @@ void ro_gui_url_complete_resize(struct toolbar *toolbar, wimp_open *open) error = xwimp_close_window(dialog_url_complete); if (error) { LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } else { error = xwimp_open_window_nested_with_flags(&state, (wimp_w)-1, 0); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } open->next = dialog_url_complete; @@ -506,7 +506,7 @@ bool ro_gui_url_complete_close(void) error = xwimp_close_window(dialog_url_complete); if (error) { LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } return currently_open; @@ -581,7 +581,7 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw) error = xwimp_plot_icon(&url_complete_icon); if (error) { LOG("xwimp_plot_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } data = urldb_get_url_data(url_complete_matches[line]); @@ -603,7 +603,7 @@ void ro_gui_url_complete_redraw(wimp_draw *redraw) error = xwimp_plot_icon(&url_complete_sprite); if (error) { LOG("xwimp_plot_icon: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } more = wimp_get_rectangle(redraw); @@ -657,7 +657,7 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -684,14 +684,14 @@ bool ro_gui_url_complete_click(wimp_pointer *pointer) 65536, -old_selection * 44); if (error) { LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_force_redraw(dialog_url_complete, 0, -(url_complete_matches_selection + 1) * 44, 65536, -url_complete_matches_selection * 44); if (error) { LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } if (!pointer->buttons) diff --git a/riscos/url_protocol.c b/riscos/url_protocol.c index 34c281444..97c9e1626 100644 --- a/riscos/url_protocol.c +++ b/riscos/url_protocol.c @@ -65,7 +65,7 @@ void ro_url_message_received(wimp_message *message) if (url_message->indirect.tag != 0) { url = strndup(url_message->url, 236); if (!url) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return; } /* terminate at first control character */ @@ -96,7 +96,7 @@ void ro_url_message_received(wimp_message *message) url_message->indirect.url.offset, 236 - url_message->indirect.url.offset); if (!url) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return; } for (i = 0; !iscntrl(url[i]); i++) @@ -123,7 +123,7 @@ void ro_url_message_received(wimp_message *message) message->sender); if (error) { LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } /* create new browser window */ @@ -136,7 +136,7 @@ void ro_url_message_received(wimp_message *message) nsurl_unref(nsurl); if (errorns != NSERROR_OK) { - warn_user(messages_get_errorcode(errorns), 0); + ro_warn_user(messages_get_errorcode(errorns), 0); } } @@ -166,7 +166,7 @@ void ro_url_broadcast(const char *url) (wimp_message *) &message, 0); if (error) { LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -190,7 +190,7 @@ void ro_url_load(const char *url) command = malloc(40 + (colon - url) + strlen(url)); if (!command) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return; } @@ -205,7 +205,7 @@ void ro_url_load(const char *url) error = xwimp_start_task(command, 0); if (error) { LOG("xwimp_start_task: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } free(command); diff --git a/riscos/wimp.c b/riscos/wimp.c index 93fedc3dc..19e5aa7d4 100644 --- a/riscos/wimp.c +++ b/riscos/wimp.c @@ -105,7 +105,7 @@ void ro_gui_wimp_cache_furniture_sizes(wimp_w w) error = xwimpextend_get_furniture_sizes(&furniture_sizes); if (error) { LOG("xwimpextend_get_furniture_sizes: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -125,13 +125,13 @@ bool ro_gui_wimp_read_eig_factors(os_mode mode, int *xeig, int *yeig) error = xos_read_mode_variable(mode, os_MODEVAR_XEIG_FACTOR, xeig, 0); if (error) { LOG("xos_read_mode_variable: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); return false; } error = xos_read_mode_variable(mode, os_MODEVAR_YEIG_FACTOR, yeig, 0); if (error) { LOG("xos_read_mode_variable: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); return false; } return true; @@ -198,14 +198,14 @@ void ro_gui_force_redraw_icon(wimp_w w, wimp_i i) error = xwimp_get_icon_state(&ic); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } error = xwimp_force_redraw(w, ic.icon.extent.x0, ic.icon.extent.y0, ic.icon.extent.x1, ic.icon.extent.y1); if (error) { LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -237,7 +237,7 @@ const char *ro_gui_get_icon_string(wimp_w w, wimp_i i) error = xwimp_get_icon_state(&ic); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return NULL; } itext = (ic.icon.flags & wimp_ICON_INDIRECTED) @@ -294,7 +294,7 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8) error = xwimp_get_icon_state(&ic); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); goto exit; } @@ -327,7 +327,7 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8) error = xwimp_get_caret_position(&caret); if (error) { LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); goto exit; } if ((caret.w == w) && (caret.i == i)) { @@ -338,7 +338,7 @@ void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8) caret.pos.y, -1, caret.index); if (error) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } } @@ -447,7 +447,7 @@ void ro_gui_set_icon_selected_state(wimp_w w, wimp_i i, bool state) (state ? wimp_ICON_SELECTED : 0), wimp_ICON_SELECTED); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -466,7 +466,7 @@ bool ro_gui_get_icon_selected_state(wimp_w w, wimp_i i) error = xwimp_get_icon_state(&ic); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } return ((ic.icon.flags & wimp_ICON_SELECTED) != 0); @@ -492,7 +492,7 @@ void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state) (state ? wimp_ICON_SHADED : 0), wimp_ICON_SHADED); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } if (!state) return; @@ -501,7 +501,7 @@ void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state) error = xwimp_get_caret_position(&caret); if (error) { LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } if ((caret.w != w) || (caret.i != i)) @@ -513,7 +513,7 @@ void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state) error = xwimp_set_caret_position((wimp_w)-1, (wimp_i)-1, -1, -1, -1, -1); if (error) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -554,7 +554,7 @@ void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state) (state ? wimp_ICON_DELETED : 0), wimp_ICON_DELETED); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } if (!state) return; @@ -563,7 +563,7 @@ void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state) error = xwimp_get_caret_position(&caret); if (error) { LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } if ((caret.w != w) || (caret.i != i)) @@ -575,7 +575,7 @@ void ro_gui_set_icon_deleted_state(wimp_w w, wimp_i i, bool state) error = xwimp_set_caret_position((wimp_w)-1, (wimp_i)-1, -1, -1, -1, -1); if (error) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -611,7 +611,7 @@ void ro_gui_set_icon_button_type(wimp_w w, wimp_i i, int type) (type << wimp_ICON_BUTTON_TYPE_SHIFT)); if (error) { LOG("xwimp_set_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -636,7 +636,7 @@ void ro_gui_set_icon_sprite(wimp_w w, wimp_i i, osspriteop_area *area, error = xwimp_get_icon_state(&ic); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -673,7 +673,7 @@ void ro_gui_set_window_title(wimp_w w, const char *text) error = xwimp_get_window_info_header_only((wimp_window_info *)&window); if (error) { LOG("xwimp_get_window_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -700,7 +700,7 @@ void ro_gui_set_window_title(wimp_w w, const char *text) error = xwimp_force_redraw_title(w); if (error) { LOG("xwimp_force_redraw_title: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -727,7 +727,7 @@ bool ro_gui_set_caret_first(wimp_w w) error = xwimp_get_window_state(&win_state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } if (!(win_state.flags & wimp_WINDOW_OPEN)) @@ -738,7 +738,7 @@ bool ro_gui_set_caret_first(wimp_w w) error = xwimp_get_window_info_header_only((wimp_window_info *)&window); if (error) { LOG("xwimp_get_window_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -749,7 +749,7 @@ bool ro_gui_set_caret_first(wimp_w w) error = xwimp_get_icon_state(&state); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -766,7 +766,7 @@ bool ro_gui_set_caret_first(wimp_w w) strlen(state.icon.data.indirected_text.text)); if (error) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } return true; } @@ -792,17 +792,17 @@ osspriteop_area *ro_gui_load_sprite_file(const char *pathname) &obj_type, 0, 0, &len, 0, 0); if (error) { LOG("xosfile_read_stamped_no_path: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); return 0; } if (obj_type != fileswitch_IS_FILE) { - warn_user("FileError", pathname); + ro_warn_user("FileError", pathname); return 0; } area = malloc(len + 4); if (!area) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return 0; } @@ -815,7 +815,7 @@ osspriteop_area *ro_gui_load_sprite_file(const char *pathname) area, pathname); if (error) { LOG("xosspriteop_load_sprite_file: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); free(area); return 0; } @@ -845,7 +845,7 @@ bool ro_gui_wimp_sprite_exists(const char *sprite) if (error) { if (error->errnum != error_SPRITE_OP_DOESNT_EXIST) { LOG("xwimpspriteop_select_sprite: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); } return false; } @@ -918,7 +918,7 @@ bool ro_gui_wimp_get_sprite_dimensions(osspriteop_area *area, char *sprite, *height = dimensions.y; } else if (error->errnum != error_SPRITE_OP_DOESNT_EXIST) { LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); return false; } @@ -943,7 +943,7 @@ void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, error = xwimp_redraw_window(redraw, &more); if (error) { LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } while (more) { @@ -953,14 +953,14 @@ void ro_gui_user_redraw(wimp_draw *redraw, bool user_fill, os_ACTION_OVERWRITE, 0, 0); if (error) { LOG("xcolourtrans_set_gcol: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); } os_clg(); } error = xwimp_get_rectangle(redraw, &more); if (error) { LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -987,7 +987,7 @@ void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask, error = xwimp_get_window_state_and_nesting(&state, &parent, &linkage); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1000,7 +1000,7 @@ void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask, error = xwimp_open_window_nested_with_flags(&state, parent, linkage); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1008,7 +1008,7 @@ void ro_gui_wimp_update_window_furniture(wimp_w w, wimp_window_flags bic_mask, error = xwimp_close_window(w); if (error) { LOG("xwimp_close_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -1030,7 +1030,7 @@ bool ro_gui_wimp_check_window_furniture(wimp_w w, wimp_window_flags mask) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } return state.flags & mask; diff --git a/riscos/wimp_event.c b/riscos/wimp_event.c index 4951fb9bd..b26600492 100644 --- a/riscos/wimp_event.c +++ b/riscos/wimp_event.c @@ -578,7 +578,7 @@ bool ro_gui_wimp_event_menu_selection(wimp_w w, wimp_i i, wimp_menu *menu, error = xwimp_get_icon_state(&ic); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } button_type = (ic.icon.flags & wimp_ICON_BUTTON_TYPE) >> wimp_ICON_BUTTON_TYPE_SHIFT; @@ -588,7 +588,7 @@ bool ro_gui_wimp_event_menu_selection(wimp_w w, wimp_i i, wimp_menu *menu, error = xwimp_get_caret_position(&caret); if (error) { LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } if ((caret.w != window->w) || (caret.i != event->data.menu_gright.field)) { @@ -596,7 +596,7 @@ bool ro_gui_wimp_event_menu_selection(wimp_w w, wimp_i i, wimp_menu *menu, -1, -1, -1, strlen(menu_entry->data.indirected_text.text)); if (error) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } if (window->keypress) { @@ -705,13 +705,13 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer) error = xwimp_get_window_state(&open); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } error = xwimp_get_caret_position(&caret); if (error) { LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } ro_gui_dialog_add_persistent(current_menu_window, @@ -720,7 +720,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer) error = xwimp_open_window(PTR_WIMP_OPEN(&open)); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } if (caret.w == pointer->w) { @@ -730,7 +730,7 @@ bool ro_gui_wimp_event_mouse_click(wimp_pointer *pointer) -1, caret.index); if (error) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } } @@ -798,7 +798,7 @@ void ro_gui_wimp_event_prepare_gright_menu(wimp_w w, struct icon_event *event) error = xwimp_get_icon_state(&ic); if (error) { LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } button_type = (ic.icon.flags & wimp_ICON_BUTTON_TYPE) diff --git a/riscos/window.c b/riscos/window.c index acf51c546..ab1501cd6 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -390,7 +390,7 @@ static void gui_window_place_caret(struct gui_window *g, int x, int y, int heigh x * 2, -(y + height) * 2, height * 2, -1); if (error) { LOG("xwimp_set_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -417,7 +417,7 @@ static struct gui_window *gui_window_create(struct browser_window *bw, g = malloc(sizeof *g); if (!g) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return 0; } g->bw = bw; @@ -439,7 +439,7 @@ static struct gui_window *gui_window_create(struct browser_window *bw, error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } window.visible.x0 = state.visible.x0; window.visible.x1 = state.visible.x1; @@ -543,7 +543,7 @@ static struct gui_window *gui_window_create(struct browser_window *bw, error = xwimp_create_window(&window, &g->window); if (error) { LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); free(g); return 0; } @@ -604,7 +604,7 @@ static struct gui_window *gui_window_create(struct browser_window *bw, error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return g; } @@ -663,7 +663,7 @@ static void gui_window_destroy(struct gui_window *g) error = xwimp_delete_window(w); if (error) { LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } ro_gui_wimp_event_finalise(w); @@ -715,14 +715,14 @@ void gui_window_redraw_window(struct gui_window *g) error = xwimp_get_window_info_header_only(&info); if (error) { LOG("xwimp_get_window_info_header_only: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } error = xwimp_force_redraw(g->window, info.extent.x0, info.extent.y0, info.extent.x1, info.extent.y1); if (error) { LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -766,7 +766,7 @@ static void gui_window_update_box(struct gui_window *g, const struct rect *rect) cur = malloc(sizeof(struct update_box)); if (!cur) { LOG("No memory for malloc."); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); return; } cur->x0 = x0; @@ -801,7 +801,7 @@ static bool gui_window_get_scroll(struct gui_window *g, int *sx, int *sy) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -832,7 +832,7 @@ static void gui_window_set_scroll(struct gui_window *g, int sx, int sy) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -868,7 +868,7 @@ static void gui_window_scroll_visible(struct gui_window *g, int x0, int y0, int error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -966,7 +966,7 @@ static void gui_window_update_extent(struct gui_window *g) error = xwimp_get_window_info_header_only(&info); if (error) { LOG("xwimp_get_window_info_header_only: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1020,7 +1020,7 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape) 1, entry->xactive, entry->yactive, 0, 0); if (error) { LOG("xwimpspriteop_set_pointer_shape: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } else { /* pointer in our own sprite area */ @@ -1030,7 +1030,7 @@ void gui_window_set_pointer(struct gui_window *g, gui_pointer_shape shape) 1, entry->xactive, entry->yactive, 0, 0); if (error) { LOG("xosspriteop_set_pointer_shape: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } } @@ -1122,7 +1122,7 @@ static void gui_window_remove_caret(struct gui_window *g) error = xwimp_get_caret_position(&caret); if (error) { LOG("xwimp_get_caret_position: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1168,7 +1168,7 @@ static bool gui_window_scroll_start(struct gui_window *g) error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -1176,7 +1176,7 @@ static bool gui_window_scroll_start(struct gui_window *g) error = xwimp_get_window_info_header_only((wimp_window_info*)&info); if (error) { LOG("xwimp_get_window_state: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -1198,7 +1198,7 @@ static bool gui_window_scroll_start(struct gui_window *g) error = xwimp_drag_box(&drag); if (error) { LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -1229,7 +1229,7 @@ static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type, os_error *error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } @@ -1246,7 +1246,7 @@ static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type, error = xwimp_drag_box(&drag); if (error) { LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } } @@ -1307,7 +1307,7 @@ void gui_window_set_extent(struct gui_window *g, int width, int height) error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } if (width == -1) @@ -1338,7 +1338,7 @@ void gui_window_set_extent(struct gui_window *g, int width, int height) error = xwimp_set_extent(g->window, &extent); if (error) { LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } } @@ -1369,7 +1369,7 @@ static void gui_window_create_form_select_menu(struct gui_window *g, error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); ro_gui_menu_destroy(); return; } @@ -1411,7 +1411,7 @@ void ro_gui_window_redraw(wimp_draw *redraw) error = xwimp_redraw_window(redraw, &more); if (error) { LOG("xwimp_redraw_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } while (more) { @@ -1453,7 +1453,7 @@ void ro_gui_window_redraw(wimp_draw *redraw) option.buffer_everything && error->errnum == error_WIMP_GET_RECT)) { LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); ro_gui_current_redraw_gui = NULL; return; } @@ -1504,7 +1504,7 @@ void ro_gui_window_open(wimp_open *open) error = xwimp_get_window_state_and_nesting(&state, &parent, &linkage); if (error) { LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1609,7 +1609,7 @@ void ro_gui_window_open(wimp_open *open) error = xwimp_open_window_nested_with_flags(&state, parent, linkage); if (error) { LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1648,7 +1648,7 @@ void ro_gui_window_close(wimp_w w) error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -1676,7 +1676,7 @@ void ro_gui_window_close(wimp_w w) error = xos_cli(temp_name); if (error) { LOG("xos_cli: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); return; } free(temp_name); @@ -1866,7 +1866,7 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key, ro_error = xwimp_get_pointer_info(&pointer); if (ro_error) { LOG("xwimp_get_pointer_info: 0x%x: %s\n", ro_error->errnum, ro_error->errmess); - warn_user("WimpError", ro_error->errmess); + ro_warn_user("WimpError", ro_error->errmess); return false; } @@ -1890,7 +1890,7 @@ bool ro_gui_window_handle_local_keypress(struct gui_window *g, wimp_key *key, nsurl_unref(url); } if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); } return true; } @@ -2950,7 +2950,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, oserror = xwimp_get_window_state(&state); if (oserror) { LOG("xwimp_get_window_state: 0x%x: %s", oserror->errnum, oserror->errmess); - warn_user("WimpError", oserror->errmess); + ro_warn_user("WimpError", oserror->errmess); } nsoption_set_int(window_x, state.visible.x0); nsoption_set_int(window_y, state.visible.y0); @@ -3005,7 +3005,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu, } if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); } return true; @@ -3154,7 +3154,7 @@ void ro_gui_window_scroll_action(struct gui_window *g, error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } @@ -3312,7 +3312,7 @@ bool ro_gui_window_dataload(struct gui_window *g, wimp_message *message) error = xwimp_send_message(wimp_USER_MESSAGE, message, message->sender); if (error) { LOG("xwimp_send_message: 0x%x: %s\n", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } return true; @@ -3378,7 +3378,7 @@ void ro_gui_window_iconise(struct gui_window *g, NULL); if (error) { LOG("xosspriteop_read_sprite_info: 0x%x: %s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); overlay = NULL; } else if (sprite_bpp(overlay) != 8) { @@ -3423,7 +3423,7 @@ void ro_gui_window_iconise(struct gui_window *g, area, temp_fname); if (error) { LOG("xosspriteop_save_sprite_file: 0x%x:%s", error->errnum, error->errmess); - warn_user("MiscError", error->errmess); + ro_warn_user("MiscError", error->errmess); free(area); return; } @@ -3431,7 +3431,7 @@ void ro_gui_window_iconise(struct gui_window *g, error = xwimpspriteop_merge_sprite_file(temp_fname); if (error) { LOG("xwimpspriteop_merge_sprite_file: 0x%x:%s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); remove(temp_fname); free(area); return; @@ -3456,7 +3456,7 @@ void ro_gui_window_iconise(struct gui_window *g, wi->sender); if (error) { LOG("xwimp_send_message: 0x%x:%s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } else { g->iconise_icon = id; @@ -3487,20 +3487,20 @@ static void ro_gui_window_scroll_end(wimp_dragged *drag, void *data) error = xwimp_drag_box((wimp_drag*)-1); if (error) { LOG("xwimp_drag_box: 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } error = xwimp_get_pointer_info(&pointer); if (error) { LOG("xwimp_get_pointer_info 0x%x : %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return; } error = xwimpspriteop_set_pointer_shape("ptr_default", 0x31, 0, 0, 0, 0); if (error) { LOG("xwimpspriteop_set_pointer_shape: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } if (ro_gui_window_to_window_pos(g, drag->final.x0, drag->final.y0, &pos)) @@ -3649,14 +3649,14 @@ void ro_gui_window_toolbar_click(void *data, case TOOLBAR_BUTTON_UP: err = browser_window_navigate_up(g->bw, false); if (err != NSERROR_OK) { - warn_user(messages_get_errorcode(err), NULL); + ro_warn_user(messages_get_errorcode(err), NULL); } break; case TOOLBAR_BUTTON_UP_NEW: err = browser_window_navigate_up(g->bw, true); if (err != NSERROR_OK) { - warn_user(messages_get_errorcode(err), NULL); + ro_warn_user(messages_get_errorcode(err), NULL); } break; @@ -3693,7 +3693,7 @@ bool ro_gui_toolbar_dataload(struct gui_window *g, wimp_message *message) message->sender); if (error) { LOG("xwimp_send_message: 0x%x: %s\n", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); } return true; } @@ -3885,7 +3885,7 @@ void ro_gui_window_launch_url(struct gui_window *g, const char *url1) error = nsurl_create(url1, &url); if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); } else { ro_gui_window_set_url(g, url); @@ -3928,7 +3928,7 @@ void ro_gui_window_action_home(struct gui_window *g) nsurl_unref(url); } if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); } } @@ -3951,7 +3951,7 @@ void ro_gui_window_action_new_window(struct gui_window *g) NULL, g->bw, NULL); if (error != NSERROR_OK) { - warn_user(messages_get_errorcode(error), 0); + ro_warn_user(messages_get_errorcode(error), 0); } } @@ -4164,7 +4164,7 @@ void ro_gui_window_update_boxes(void) error = xwimp_update_window(&update, &more); if (error) { LOG("xwimp_update_window: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); continue; } @@ -4197,7 +4197,7 @@ void ro_gui_window_update_boxes(void) if (error && !(use_buffer && error->errnum == error_WIMP_GET_RECT)) { LOG("xwimp_get_rectangle: 0x%x: %s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); ro_gui_current_redraw_gui = NULL; continue; } @@ -4390,7 +4390,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename) &size, NULL, NULL); if (error) { LOG("xosfile_read_stamped: 0x%x:%s", error->errnum, error->errmess); - warn_user("FileError", error->errmess); + ro_warn_user("FileError", error->errmess); return true; /* was for us, but it didn't work! */ } @@ -4400,7 +4400,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename) buf = calloc(size + 1, sizeof(char)); if (!buf) { - warn_user("NoMemory", NULL); + ro_warn_user("NoMemory", NULL); return true; } @@ -4409,7 +4409,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename) if (error) { LOG("xosfile_load_stamped: 0x%x:%s", error->errnum, error->errmess); - warn_user("LoadError", error->errmess); + ro_warn_user("LoadError", error->errmess); free(buf); return true; } @@ -4420,7 +4420,7 @@ bool ro_gui_window_import_text(struct gui_window *g, const char *filename) assert(ret != NSERROR_BAD_ENCODING); LOG("utf8_from_local_encoding failed"); free(buf); - warn_user("NoMemory", NULL); + ro_warn_user("NoMemory", NULL); return true; } size = strlen(utf8_buf); @@ -4582,7 +4582,7 @@ bool ro_gui_window_prepare_form_select_menu(struct gui_window *g, reopen = false; gui_form_select_menu = malloc(wimp_SIZEOF_MENU(entries)); if (!gui_form_select_menu) { - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); ro_gui_menu_destroy(); return false; } @@ -4592,7 +4592,7 @@ bool ro_gui_window_prepare_form_select_menu(struct gui_window *g, /* badenc should never happen */ assert(err != NSERROR_BAD_ENCODING); LOG("utf8_to_local_encoding failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); ro_gui_menu_destroy(); return false; } @@ -4618,7 +4618,7 @@ bool ro_gui_window_prepare_form_select_menu(struct gui_window *g, temp = cnv_space2nbsp(option->text); if (!temp) { LOG("cnv_space2nbsp failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); ro_gui_menu_destroy(); return false; } @@ -4630,7 +4630,7 @@ bool ro_gui_window_prepare_form_select_menu(struct gui_window *g, * so assert this */ assert(err != NSERROR_BAD_ENCODING); LOG("utf8_to_enc failed"); - warn_user("NoMemory", 0); + ro_warn_user("NoMemory", 0); ro_gui_menu_destroy(); return false; } @@ -4741,7 +4741,7 @@ bool ro_gui_window_to_window_pos(struct gui_window *g, int x, int y, error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x:%s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } pos->x = (x - (state.visible.x0 - state.xscroll)) / 2 / g->scale; @@ -4772,7 +4772,7 @@ bool ro_gui_window_to_screen_pos(struct gui_window *g, int x, int y, error = xwimp_get_window_state(&state); if (error) { LOG("xwimp_get_window_state: 0x%x:%s", error->errnum, error->errmess); - warn_user("WimpError", error->errmess); + ro_warn_user("WimpError", error->errmess); return false; } pos->x = (x * 2 * g->scale) + (state.visible.x0 - state.xscroll);