30#include <oslib/osbyte.h>
31#include <oslib/territory.h>
32#include <oslib/wimp.h>
44#define CONFIGURE_ICON_PADDING_H 32
45#define CONFIGURE_ICON_PADDING_V 32
46#define CONFIGURE_DEFAULT_ICON_WIDTH (68 + CONFIGURE_ICON_PADDING_H)
47#define CONFIGURE_DEFAULT_ICON_HEIGHT (128 + CONFIGURE_ICON_PADDING_V)
51#define CONFIGURE_TOOL_TRANSLATED_SIZE 64
123 die(
"ro_gui_configure_translate failed");
139 if (pointer->buttons == wimp_CLICK_MENU)
143 if (tool->
i == pointer->i) {
180 int screen_width, screen_height;
182 int icons_per_line, icon_lines;
184 os_box extent = { 0, 0, 0, 0 };
195 if (icons_per_line < 1)
216 "xwimp_resize_icon: 0x%x: %s",
222 if (l >= icons_per_line) {
229 0, -16384, 16384, 0);
231 NSLOG(netsurf, INFO,
"xwimp_force_redraw: 0x%x: %s",
232 error->errnum, error->errmess);
242 open->visible.y0 =
open->visible.y1 - max_height;
246 int max_icons_per_line;
252 extent.y0 = -max_height;
253 error = xwimp_set_extent(
open->w, &extent);
255 NSLOG(netsurf, INFO,
"xwimp_set_extent: 0x%x: %s",
256 error->errnum, error->errmess);
265 error = xwimp_open_window(
open);
267 NSLOG(netsurf, INFO,
"xwimp_open_window: 0x%x: %s",
268 error->errnum, error->errmess);
277 wimp_icon_create new_icon;
285 NSLOG(netsurf, INFO,
"Insufficient memory for calloc()");
286 die(
"Insufficient memory");
291 tool->
validation = malloc(strlen(window) + 2);
293 NSLOG(netsurf, INFO,
"Insufficient memory for malloc()");
294 die(
"Insufficient memory");
303 new_icon.icon.extent.x0 = 0;
305 new_icon.icon.extent.y1 = 0;
307 new_icon.icon.flags = wimp_ICON_TEXT | wimp_ICON_SPRITE |
308 wimp_ICON_INDIRECTED | wimp_ICON_HCENTRED |
309 (wimp_COLOUR_VERY_LIGHT_GREY << wimp_ICON_BG_COLOUR_SHIFT) |
310 (wimp_COLOUR_BLACK << wimp_ICON_FG_COLOUR_SHIFT) |
311 (wimp_BUTTON_CLICK << wimp_ICON_BUTTON_TYPE_SHIFT);
312 new_icon.icon.data.indirected_text_and_sprite.text =
314 new_icon.icon.data.indirected_text_and_sprite.validation =
316 new_icon.icon.data.indirected_text_and_sprite.size =
318 error = xwimp_create_icon(&new_icon, &tool->
i);
320 NSLOG(netsurf, INFO,
"xwimp_create_icon: 0x%x: %s",
321 error->errnum, error->errmess);
367 error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0,
370 NSLOG(netsurf, INFO,
"failed reading alphabet: 0x%x: %s",
371 error->errnum, error->errmess);
373 alphabet = territory_ALPHABET_LATIN1;
389 error = xwimptextop_string_width(tool->
translated,
393 "xwimptextop_string_width: 0x%x: %s",
409 NSLOG(netsurf, INFO,
"xwimp_resize_icon: 0x%x: %s",
410 error->errnum, error->errmess);
void die(const char *error)
Cause an abnormal program termination.
bool ro_gui_options_cache_initialise(wimp_w w)
bool ro_gui_options_connection_initialise(wimp_w w)
bool ro_gui_options_content_initialise(wimp_w w)
bool ro_gui_options_fonts_initialise(wimp_w w)
bool ro_gui_options_home_initialise(wimp_w w)
void ro_gui_options_image_finalise(wimp_w w)
bool ro_gui_options_image_initialise(wimp_w w)
bool ro_gui_options_interface_initialise(wimp_w w)
bool ro_gui_options_language_initialise(wimp_w w)
bool ro_gui_options_security_initialise(wimp_w w)
bool ro_gui_options_theme_initialise(wimp_w w)
void ro_gui_options_theme_finalise(wimp_w w)
void ro_gui_dialog_open_persistent(wimp_w parent, wimp_w w, bool pointer)
Open a persistent dialog box relative to the pointer.
bool ro_gui_dialog_open_top(wimp_w w, struct toolbar *toolbar, int width, int height)
Moves a window to the top of the stack.
wimp_w ro_gui_dialog_create(const char *template_name)
Create a window from a template.
static nserror initialise(const struct llcache_store_parameters *parameters)
Initialise the backing store.
static nserror finalise(void)
Finalise the backing store.
#define NSLOG(catname, level, logmsg, args...)
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Localised message support (interface).
void ro_gui_screen_size(int *width, int *height)
Find screen size in OS units.
nserror ro_warn_user(const char *warning, const char *detail)
Display a warning for a serious problem (eg memory exhaustion).
Interface to utility string handling.
void ro_gui_set_icon_string(wimp_w w, wimp_i i, const char *text, bool is_utf8)
Set the contents of a text or sprite icon to a string.
General RISC OS WIMP/OS library functions (interface).
bool ro_gui_wimp_event_set_help_prefix(wimp_w w, const char *help_prefix)
Set the associated help prefix for a given window.
void ro_gui_wimp_event_finalise(wimp_w w)
Free any resources associated with a window.
bool ro_gui_wimp_event_register_mouse_click(wimp_w w, bool(*callback)(wimp_pointer *pointer))
Register a function to be called for all mouse-clicks to icons in a window that don't have registered...
bool ro_gui_wimp_event_register_close_window(wimp_w w, void(*callback)(wimp_w w))
Register a function to be called after the window has been closed.
bool ro_gui_wimp_event_register_open_window(wimp_w w, void(*callback)(wimp_open *open))
Register a function to be called for all window opening requests.
Automated RISC OS WIMP event handling (interface).