25#include <oslib/osfile.h>
26#include <oslib/wimp.h>
93 const void *data = source_data;
114 switch (event->
type) {
118 const uint8_t *source_data;
120 int author_indent = 0;
173 char theme_save[256];
178 const uint8_t *source_data;
186 NSLOG(netsurf, INFO,
"malloc failed");
190 for (fix = theme_file; *fix !=
'\0'; fix++)
195 snprintf(theme_save,
sizeof theme_save,
"%s.%s",
198 theme_save[
sizeof theme_save - 1] =
'\0';
203 error = xosfile_save_stamped(theme_save, 0xffd,
204 (
byte *) source_data,
205 (
byte *) source_data + source_size);
207 NSLOG(netsurf, INFO,
"xosfile_save_stamped: 0x%x: %s",
208 error->errnum, error->errmess);
static osspriteop_area * buffer
The buffer characteristics.
@ CONTENT_THEME
RISC OS themes content.
@ CONTENT_MSG_DONE
content has finished processing
@ CONTENT_MSG_ERROR
error occurred
void ro_gui_save_options(void)
Save the current options.
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.
nserror
Enumeration of error codes.
Window themes(interface).
nserror hlcache_handle_replace_callback(hlcache_handle *handle, hlcache_handle_callback cb, void *pw)
Replace a high-level cache handle's callback.
nserror hlcache_handle_release(hlcache_handle *handle)
Release a high-level cache handle.
High-level resource cache interface.
Public content interface.
const uint8_t * content_get_source_data(struct hlcache_handle *h, size_t *size)
Retrieve source of content.
void content_invalidate_reuse_data(struct hlcache_handle *h)
Invalidate content reuse data.
content_type content_get_type(struct hlcache_handle *h)
Retrieve computed type of content.
#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).
nserror ro_warn_user(const char *warning, const char *detail)
Display a warning for a serious problem (eg memory exhaustion).
#define ICON_THEME_INSTALL_MESSAGE
#define ICON_THEME_INSTALL_INSTALL
bool ro_gui_theme_read_file_header(struct theme_descriptor *descriptor, struct theme_file_header *file_header)
Fills in the basic details for a descriptor from a file header.
struct theme_descriptor * ro_gui_theme_get_available(void)
Reads and caches the currently available themes.
struct theme_descriptor * ro_gui_theme_find(const char *leafname)
Finds a theme from the cached values.
bool ro_gui_theme_apply(struct theme_descriptor *descriptor)
Applies the theme to all current windows and subsequent ones.
content_msg type
Event type.
union content_msg_data data
Event data.
char * leafname
theme leafname
char author[64]
theme author
unsigned int compressed_size
compressed sprite size
static struct hlcache_handle * theme_install_content
static struct theme_descriptor theme_install_descriptor
bool ro_gui_theme_install_apply(wimp_w w)
Install the downloaded theme.
static nserror theme_install_callback(struct hlcache_handle *handle, const hlcache_event *event, void *pw)
Callback for fetchcache() for theme install fetches.
static bool theme_install_read(const uint8_t *source_data, size_t source_size)
Fill in theme_install_descriptor from received theme data.
static void theme_install_close(wimp_w w)
Close the theme installer and free resources.
wimp_w dialog_theme_install
void theme_install_start(struct hlcache_handle *c)
Handle a CONTENT_THEME that has started loading.
struct content_msg_data::@99 errordata
CONTENT_MSG_ERROR - Error from content or underlying fetch.
const char * errormsg
The message.
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
#define nsoption_set_charp(OPTION, VALUE)
set string option in default table
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.
void ro_gui_set_icon_shaded_state(wimp_w w, wimp_i i, bool state)
Set the shaded state of an icon.
General RISC OS WIMP/OS library functions (interface).
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.
Automated RISC OS WIMP event handling (interface).