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
126 die(
"ro_gui_configure_translate failed");
142 if (pointer->buttons == wimp_CLICK_MENU)
146 if (tool->
i == pointer->i) {
183 int screen_width, screen_height;
185 int icons_per_line, icon_lines;
187 os_box extent = { 0, 0, 0, 0 };
198 if (icons_per_line < 1)
219 "xwimp_resize_icon: 0x%x: %s",
225 if (l >= icons_per_line) {
232 0, -16384, 16384, 0);
234 NSLOG(netsurf, INFO,
"xwimp_force_redraw: 0x%x: %s",
235 error->errnum, error->errmess);
245 open->visible.y0 =
open->visible.y1 - max_height;
249 int max_icons_per_line;
255 extent.y0 = -max_height;
256 error = xwimp_set_extent(
open->w, &extent);
258 NSLOG(netsurf, INFO,
"xwimp_set_extent: 0x%x: %s",
259 error->errnum, error->errmess);
268 error = xwimp_open_window(
open);
270 NSLOG(netsurf, INFO,
"xwimp_open_window: 0x%x: %s",
271 error->errnum, error->errmess);
280 wimp_icon_create new_icon;
288 NSLOG(netsurf, INFO,
"Insufficient memory for calloc()");
289 die(
"Insufficient memory");
294 tool->
validation = malloc(strlen(window) + 2);
296 NSLOG(netsurf, INFO,
"Insufficient memory for malloc()");
297 die(
"Insufficient memory");
306 new_icon.icon.extent.x0 = 0;
308 new_icon.icon.extent.y1 = 0;
310 new_icon.icon.flags = wimp_ICON_TEXT | wimp_ICON_SPRITE |
311 wimp_ICON_INDIRECTED | wimp_ICON_HCENTRED |
312 (wimp_COLOUR_VERY_LIGHT_GREY << wimp_ICON_BG_COLOUR_SHIFT) |
313 (wimp_COLOUR_BLACK << wimp_ICON_FG_COLOUR_SHIFT) |
314 (wimp_BUTTON_CLICK << wimp_ICON_BUTTON_TYPE_SHIFT);
315 new_icon.icon.data.indirected_text_and_sprite.text =
317 new_icon.icon.data.indirected_text_and_sprite.validation =
319 new_icon.icon.data.indirected_text_and_sprite.size =
321 error = xwimp_create_icon(&new_icon, &tool->
i);
323 NSLOG(netsurf, INFO,
"xwimp_create_icon: 0x%x: %s",
324 error->errnum, error->errmess);
370 error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0,
373 NSLOG(netsurf, INFO,
"failed reading alphabet: 0x%x: %s",
374 error->errnum, error->errmess);
376 alphabet = territory_ALPHABET_LATIN1;
392 error = xwimptextop_string_width(tool->
translated,
396 "xwimptextop_string_width: 0x%x: %s",
412 NSLOG(netsurf, INFO,
"xwimp_resize_icon: 0x%x: %s",
413 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_search_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).