From 86f60c4c0a6c4577536c797760fa12f097fd31c9 Mon Sep 17 00:00:00 2001 From: Andrew Timmins Date: Sun, 18 Jul 2004 22:21:32 +0000 Subject: [project @ 2004-07-18 22:21:32 by atimmins] svn path=/import/netsurf/; revision=1097 --- riscos/gui.c | 25 ++++++++++++++++++++++--- riscos/theme.c | 14 +++++++++++++- riscos/window.c | 25 ++++++++++++++++++++++++- 3 files changed, 59 insertions(+), 5 deletions(-) (limited to 'riscos') diff --git a/riscos/gui.c b/riscos/gui.c index 8cde110ee..20d360283 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -6,6 +6,7 @@ * Copyright 2004 James Bursa * Copyright 2003 John M Bell * Copyright 2004 Richard Wilson + * Copyright 2004 Andrew Timmins */ #include @@ -159,6 +160,7 @@ void gui_init(int argc, char** argv) { char path[40]; char theme_fname[256]; + char url[80]; os_error *error; int length; @@ -166,8 +168,12 @@ void gui_init(int argc, char** argv) save_complete_init(); + /* We dont have the universal boot sequence on NCOS */ +#ifndef ncos options_read("Choices:WWW.NetSurf.Choices"); - +#else + options_read(".Choices.NetSurf.Choices"); +#endif ro_gui_choose_language(); NETSURF_DIR = getenv("NetSurf$Dir"); @@ -178,17 +184,27 @@ void gui_init(int argc, char** argv) messages_load(path); messages_load(".Resources.LangNames"); + /* Totally pedantic But base the taskname on the buid options! + */ +#ifndef ncos error = xwimp_initialise(wimp_VERSION_RO38, "NetSurf", (const wimp_message_list *) &task_messages, 0, &task_handle); +#else + error = xwimp_initialise(wimp_VERSION_RO38, "NCNetSurf", + (const wimp_message_list *) &task_messages, 0, + &task_handle); +#endif if (error) { LOG(("xwimp_initialise failed: 0x%x: %s", error->errnum, error->errmess)); die(error->errmess); } + /* We dont need to check the fonts on NCOS */ +#ifndef ncos ro_gui_check_fonts(); - +#endif /* Issue a *Desktop to poke AcornURI into life */ if (getenv("NetSurf$Start_URI_Handler")) xwimp_start_task("Desktop", 0); @@ -227,11 +243,14 @@ void gui_init(int argc, char** argv) wimp_close_template(); ro_gui_pointers_init(); ro_gui_hotlist_init(); + + /* We dont create an Iconbar icon on NCOS */ +#ifndef ncos ro_gui_icon_bar_create(); +#endif ro_gui_check_resolvers(); } - /** * Determine the language to use. * diff --git a/riscos/theme.c b/riscos/theme.c index fca63da51..637aa8f52 100644 --- a/riscos/theme.c +++ b/riscos/theme.c @@ -5,6 +5,7 @@ * Copyright 2003 Phil Mellor * Copyright 2003 James Bursa * Copyright 2004 Richard Wilson + * Copyright 2004 Andrew Timmins */ /** \file @@ -52,6 +53,7 @@ void ro_theme_load(char *pathname) { os_coord dimensions; int size, i, n; char *filename = alloca(strlen(pathname) + 16); + char *kioskfilename = alloca(strlen(pathname) + 16); fileswitch_object_type obj_type; /* Release previous sprite are @@ -70,6 +72,17 @@ void ro_theme_load(char *pathname) { sprintf(filename, "%s.Sprites", pathname); xosfile_read_no_path(filename, &obj_type, 0, 0, &size, 0); + /* Load the window furniture if using Kiosk Themes + * + * Yes I know this is one serious hack! + * I'll do something a little more "realistic" when I've + * finished various other bits... Right now it works. + */ +#ifdef WITH_KIOSK_THEMES + sprintf(kioskfilename, "%s.!SetTheme", pathname); + xos_cli(kioskfilename); + +#endif /* Claim memory for a sprite file if we have one */ if (obj_type & fileswitch_IS_FILE) theme_sprite_area = malloc(size + 16); @@ -113,7 +126,6 @@ void ro_theme_load(char *pathname) { } } } - } diff --git a/riscos/window.c b/riscos/window.c index 45fcb5cf8..4dd114a6c 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -6,6 +6,7 @@ * Copyright 2004 James Bursa * Copyright 2003 John M Bell * Copyright 2004 Richard Wilson + * Copyright 2004 Andrew Timmins */ /** \file @@ -121,10 +122,19 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, if (win_height < 100) win_height = 100; } else { + + /* Base how we define the window height/width + on the compile time options set */ +#ifdef WITH_KIOSK_BROWSING + /* We're going fullscreen, forget the iconbar! */ + win_width = screen_width; + win_height = screen_height; +#else win_width = screen_width * 3 / 4; if (1600 < win_width) win_width = 1600; win_height = win_width * 3 / 4; +#endif window.visible.x0 = (screen_width - win_width) / 2; window.visible.y0 = ((screen_height - win_height) / 2) + @@ -139,7 +149,18 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, window.xscroll = 0; window.yscroll = 0; window.next = wimp_TOP; - window.flags = wimp_WINDOW_MOVEABLE | + + /* Base how we define the window characteristics + on the compile time options set */ +#ifdef WITH_KIOSK_BROWSING + window.flags = wimp_WINDOW_NEW_FORMAT | + wimp_WINDOW_VSCROLL | + wimp_WINDOW_HSCROLL | + wimp_WINDOW_IGNORE_XEXTENT | + wimp_WINDOW_IGNORE_YEXTENT | + wimp_WINDOW_SCROLL_REPEAT; +#else + window.flags = wimp_WINDOW_MOVEABLE | wimp_WINDOW_NEW_FORMAT | wimp_WINDOW_BACK_ICON | wimp_WINDOW_CLOSE_ICON | @@ -151,6 +172,8 @@ struct gui_window *gui_create_browser_window(struct browser_window *bw, wimp_WINDOW_IGNORE_XEXTENT | wimp_WINDOW_IGNORE_YEXTENT | wimp_WINDOW_SCROLL_REPEAT; +#endif + window.title_fg = wimp_COLOUR_BLACK; window.title_bg = wimp_COLOUR_LIGHT_GREY; window.work_fg = wimp_COLOUR_LIGHT_GREY; -- cgit v1.2.3