21#include <oslib/osspriteop.h>
22#include <oslib/wimp.h>
37#define IMAGE_FOREGROUND_FIELD 3
38#define IMAGE_FOREGROUND_MENU 4
39#define IMAGE_BACKGROUND_FIELD 6
40#define IMAGE_BACKGROUND_MENU 7
41#define IMAGE_CURRENT_DISPLAY 8
42#define IMAGE_DISABLE_ANIMATION 11
43#define IMAGE_DEFAULT_BUTTON 12
44#define IMAGE_CANCEL_BUTTON 13
45#define IMAGE_OK_BUTTON 14
68 snprintf(pathname, 256,
"%s.Resources.Image",
NETSURF_DIR);
77 for (i = 0; (i < 4); i++) {
81 data.indirected_text.text,
true);
85 data.indirected_text.text,
true);
134 wimp_icon_state icon_state;
135 osspriteop_header *bg = NULL, *fg = NULL;
136 unsigned int bg_tinct = 0, fg_tinct = 0;
139 icon_state.w = redraw->w;
141 error = xwimp_get_icon_state(&icon_state);
144 "xwimp_get_icon_state: 0x%x: %s",
145 error->errnum, error->errmess);
153 fg_tinct |= 0xeeeeee00;
154 xosspriteop_select_sprite(osspriteop_USER_AREA,
156 xosspriteop_select_sprite(osspriteop_USER_AREA,
161 more = wimp_redraw_window(redraw);
163 int origin_x, origin_y;
164 origin_x = redraw->box.x0 - redraw->xscroll +
165 icon_state.icon.extent.x0 + 2;
166 origin_y = redraw->box.y1 - redraw->yscroll +
167 icon_state.icon.extent.y0 + 2;
170 bg, origin_x, origin_y, bg_tinct);
173 fg, origin_x, origin_y, fg_tinct);
174 more = wimp_get_rectangle(redraw);
184 for (i = 0; i < 4; i++)
186 data.indirected_text.text))
190 for (i = 0; i < 4; i++)
192 data.indirected_text.text))
198 unsigned int old_fg, old_bg, bg, fg;
201 switch (pointer->i) {
206 data.indirected_text.text,
true);
210 data.indirected_text.text,
true);
225 if ((bg != old_bg) || (fg != old_fg))
void ro_gui_options_image_finalise(wimp_w w)
static void ro_gui_options_image_read(wimp_w w, unsigned int *bg, unsigned int *fg)
unsigned int tinct_options[]
static bool ro_gui_options_image_ok(wimp_w w)
#define IMAGE_CANCEL_BUTTON
static bool ro_gui_options_image_update(wimp_w w, wimp_i i, wimp_menu *m, wimp_selection *s, menu_action a)
#define IMAGE_CURRENT_DISPLAY
static void ro_gui_options_update_shading(wimp_w w)
#define IMAGE_DISABLE_ANIMATION
#define IMAGE_DEFAULT_BUTTON
bool ro_gui_options_image_initialise(wimp_w w)
#define IMAGE_FOREGROUND_FIELD
static osspriteop_area * example_images
static bool ro_gui_options_image_click(wimp_pointer *pointer)
#define IMAGE_BACKGROUND_FIELD
#define IMAGE_FOREGROUND_MENU
#define IMAGE_BACKGROUND_MENU
static void ro_gui_options_image_redraw(wimp_draw *redraw)
void ro_gui_save_options(void)
Save the current options.
#define NSLOG(catname, level, logmsg, args...)
nserror ro_warn_user(const char *warning, const char *detail)
Display a warning for a serious problem (eg memory exhaustion).
Tinct SWI numbers and flags for version 0.11.
#define tinct_ERROR_DIFFUSE
#define tinct_USE_OS_SPRITE_OP
#define Tinct_PlotAlpha
Plots an alpha-blended sprite at the specified coordinates.
#define Tinct_Plot
Plots a sprite at the specified coordinates with a constant 0xff value for the alpha channel,...
Option reading and saving interface.
#define nsoption_int(OPTION)
Get the value of an integer option.
#define nsoption_set_bool(OPTION, VALUE)
set a boolean option in the default table
#define nsoption_bool(OPTION)
Get the value of a boolean option.
Interface to a number of general purpose functionality.
#define fallthrough
switch fall through
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.
osspriteop_area * ro_gui_load_sprite_file(const char *pathname)
Load a sprite file into memory.
const char * ro_gui_get_icon_string(wimp_w w, wimp_i i)
Read the contents of a text or sprite icon.
void ro_gui_set_icon_selected_state(wimp_w w, wimp_i i, bool state)
Set the selected state of an icon.
#define ro_gui_redraw_icon(w, i)
Redraws an icon.
bool ro_gui_get_icon_selected_state(wimp_w w, wimp_i i)
Gets the selected state of an icon.
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.
bool ro_gui_wimp_event_register_redraw_window(wimp_w w, void(*callback)(wimp_draw *redraw))
Register a function to be called for all window redraw operations.
bool ro_gui_wimp_event_register_menu_gright(wimp_w w, wimp_i i, wimp_i gright, wimp_menu *menu)
Register an icon menu to be automatically handled.
void ro_gui_wimp_event_finalise(wimp_w w)
Free any resources associated with a window.
bool ro_gui_wimp_event_register_cancel(wimp_w w, wimp_i i)
Register a function to be called for the Cancel action on a window.
bool ro_gui_wimp_event_memorise(wimp_w w)
Memorises the current state of any registered components in a window.
bool ro_gui_wimp_event_register_menu_selection(wimp_w w, bool(*callback)(wimp_w w, wimp_i i, wimp_menu *m, wimp_selection *s, menu_action a))
Register a function to be called following a menu selection.
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_checkbox(wimp_w w, wimp_i i)
Register a checkbox to be automatically handled.
bool ro_gui_wimp_event_restore(wimp_w w)
Restore the state of any registered components in a window to their memorised state.
bool ro_gui_wimp_event_register_ok(wimp_w w, wimp_i i, bool(*callback)(wimp_w w))
Register a function to be called for the OK action on a window.
Automated RISC OS WIMP event handling (interface).
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.