diff options
Diffstat (limited to 'frontends/riscos/gui.c')
-rw-r--r-- | frontends/riscos/gui.c | 117 |
1 files changed, 41 insertions, 76 deletions
diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c index b0eb23256..1a2b944a8 100644 --- a/frontends/riscos/gui.c +++ b/frontends/riscos/gui.c @@ -94,6 +94,7 @@ bool riscos_done = false; extern bool ro_plot_patterned_lines; int os_version = 0; +bool os_alpha_sprite_supported = false; const char * const __dynamic_da_name = "NetSurf"; /**< For UnixLib. */ int __dynamic_da_max_size = 128 * 1024 * 1024; /**< For UnixLib. */ @@ -143,27 +144,6 @@ static ns_wimp_message_list task_messages = { message_URI_PROCESS, message_URI_RETURN_RESULT, message_INET_SUITE_OPEN_URL, -#ifdef WITH_PLUGIN - message_PLUG_IN_OPENING, - message_PLUG_IN_CLOSED, - message_PLUG_IN_RESHAPE_REQUEST, - message_PLUG_IN_FOCUS, - message_PLUG_IN_URL_ACCESS, - message_PLUG_IN_STATUS, - message_PLUG_IN_BUSY, - message_PLUG_IN_STREAM_NEW, - message_PLUG_IN_STREAM_WRITE, - message_PLUG_IN_STREAM_WRITTEN, - message_PLUG_IN_STREAM_DESTROY, - message_PLUG_IN_OPEN, - message_PLUG_IN_CLOSE, - message_PLUG_IN_RESHAPE, - message_PLUG_IN_STREAM_AS_FILE, - message_PLUG_IN_NOTIFY, - message_PLUG_IN_ABORT, - message_PLUG_IN_ACTION, - /* message_PLUG_IN_INFORMED, (not provided by oslib) */ -#endif message_PRINT_SAVE, message_PRINT_ERROR, message_PRINT_TYPE_ODD, @@ -305,7 +285,7 @@ set_colour_from_wimp(struct nsoption_s *opts, static nserror set_defaults(struct nsoption_s *defaults) { /* Set defaults for absent option strings */ - nsoption_setnull_charp(ca_bundle, strdup("NetSurf:Resources.ca-bundle")); + nsoption_setnull_charp(ca_bundle, strdup("<NetSurf$CABundle>")); nsoption_setnull_charp(cookie_file, strdup("NetSurf:Cookies")); nsoption_setnull_charp(cookie_jar, strdup(CHOICES_PREFIX "Cookies")); @@ -827,6 +807,7 @@ static void ro_msg_dataload(wimp_message *message) case osfile_TYPE_TEXT: case FILETYPE_ARTWORKS: case FILETYPE_SVG: + case FILETYPE_WEBP: /* display the actual file */ error = netsurf_path_to_nsurl(message->data.data_xfer.file_name, &url); break; @@ -929,7 +910,8 @@ static void ro_msg_datasave(wimp_message *message) case osfile_TYPE_SPRITE: case osfile_TYPE_TEXT: case FILETYPE_ARTWORKS: - case FILETYPE_SVG: { + case FILETYPE_SVG: + case FILETYPE_WEBP: { os_error *error; dataxfer->your_ref = dataxfer->my_ref; @@ -1108,6 +1090,28 @@ static void ro_gui_check_resolvers(void) } } +/** + * Determine whether the OS version supports alpha channels. + * + * \return true iff alpha channels are supported, false otherwise. + */ +static bool ro_gui__os_alpha_sprites_supported(void) +{ + os_error *error; + int var_val; + bits psr; + + psr = 0; + error = xos_read_mode_variable(alpha_SPRITE_MODE, + os_MODEVAR_MODE_FLAGS, &var_val, &psr); + if (error) { + NSLOG(netsurf, ERROR, "xos_read_mode_variable: 0x%x: %s", + error->errnum, error->errmess); + return false; + } + + return (var_val == (1 << 15)); +} /** * Initialise the RISC OS specific GUI. @@ -1150,6 +1154,10 @@ static nserror gui_init(int argc, char** argv) * being present) */ xos_byte(osbyte_IN_KEY, 0, 0xff, &os_version, NULL); + os_alpha_sprite_supported = ro_gui__os_alpha_sprites_supported(); + NSLOG(netsurf, INFO, "OS supports alpha sprites: %s", + os_alpha_sprite_supported ? "yes" : "no"); + /* the first release version of the A9home OS is incapable of plotting patterned lines (presumably a fault in the hw acceleration) */ if (!xosmodule_lookup("VideoHWSMI", NULL, NULL, &base, NULL, NULL)) { @@ -1202,16 +1210,9 @@ static nserror gui_init(int argc, char** argv) /* Initialise save complete functionality */ save_complete_init(); - /* Initialise the font subsystem */ - nsfont_init(); - - /* Load in visited URLs, Cookies, and hostlist */ + /* Load in visited URLs and Cookies */ urldb_load(nsoption_charp(url_path)); urldb_load_cookies(nsoption_charp(cookie_file)); - hotlist_init(nsoption_charp(hotlist_path), - nsoption_bool(external_hotlists) ? - NULL : - nsoption_charp(hotlist_save)); /* Initialise with the wimp */ error = xwimp_initialise(wimp_VERSION_RO38, task_name, @@ -1242,6 +1243,15 @@ static nserror gui_init(int argc, char** argv) ro_message_register_route(message_WINDOW_INFO, ro_msg_window_info); + /* Initialise the font subsystem (must be after Wimp_Initialise) */ + nsfont_init(); + + /* Initialise the hotlist (must be after fonts) */ + hotlist_init(nsoption_charp(hotlist_path), + nsoption_bool(external_hotlists) ? + NULL : + nsoption_charp(hotlist_save)); + /* Initialise global information */ ro_gui_get_screen_properties(); ro_gui_wimp_get_desktop_font(); @@ -1748,51 +1758,6 @@ static void ro_gui_user_message(wimp_event_no event, wimp_message *message) ro_url_message_received(message); } break; -#ifdef WITH_PLUGIN - case message_PLUG_IN_OPENING: - plugin_opening(message); - break; - case message_PLUG_IN_CLOSED: - plugin_closed(message); - break; - case message_PLUG_IN_RESHAPE_REQUEST: - plugin_reshape_request(message); - break; - case message_PLUG_IN_FOCUS: - break; - case message_PLUG_IN_URL_ACCESS: - plugin_url_access(message); - break; - case message_PLUG_IN_STATUS: - plugin_status(message); - break; - case message_PLUG_IN_BUSY: - break; - case message_PLUG_IN_STREAM_NEW: - plugin_stream_new(message); - break; - case message_PLUG_IN_STREAM_WRITE: - break; - case message_PLUG_IN_STREAM_WRITTEN: - plugin_stream_written(message); - break; - case message_PLUG_IN_STREAM_DESTROY: - break; - case message_PLUG_IN_OPEN: - if (event == wimp_USER_MESSAGE_ACKNOWLEDGE) - plugin_open_msg(message); - break; - case message_PLUG_IN_CLOSE: - if (event == wimp_USER_MESSAGE_ACKNOWLEDGE) - plugin_close_msg(message); - break; - case message_PLUG_IN_RESHAPE: - case message_PLUG_IN_STREAM_AS_FILE: - case message_PLUG_IN_NOTIFY: - case message_PLUG_IN_ABORT: - case message_PLUG_IN_ACTION: - break; -#endif case message_PRINT_SAVE: if (event == wimp_USER_MESSAGE_ACKNOWLEDGE) ro_print_save_bounce(message); |