NetSurf
|
Theme auto-installing. More...
#include <assert.h>
#include <stdbool.h>
#include <oslib/osfile.h>
#include <oslib/wimp.h>
#include "utils/nsoption.h"
#include "utils/log.h"
#include "utils/messages.h"
#include "netsurf/content.h"
#include "content/hlcache.h"
#include "desktop/theme.h"
#include "riscos/dialog.h"
#include "riscos/gui.h"
#include "riscos/theme.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
Go to the source code of this file.
Functions | |
static void | theme_install_close (wimp_w w) |
Close the theme installer and free resources. More... | |
static nserror | theme_install_callback (struct hlcache_handle *handle, const hlcache_event *event, void *pw) |
Callback for fetchcache() for theme install fetches. More... | |
void | theme_install_start (struct hlcache_handle *c) |
Handle a CONTENT_THEME that has started loading. More... | |
static bool | theme_install_read (const uint8_t *source_data, size_t source_size) |
Fill in theme_install_descriptor from received theme data. More... | |
bool | ro_gui_theme_install_apply (wimp_w w) |
Install the downloaded theme. More... | |
Variables | |
static struct hlcache_handle * | theme_install_content = NULL |
static struct theme_descriptor | theme_install_descriptor |
wimp_w | dialog_theme_install |
Theme auto-installing.
Definition in file theme_install.c.
bool ro_gui_theme_install_apply | ( | wimp_w | w | ) |
Install the downloaded theme.
w | the theme install window handle |
Definition at line 171 of file theme_install.c.
References content_get_source_data(), theme_descriptor::leafname, theme_descriptor::name, NSLOG, nsoption_charp, nsoption_set_charp, ro_gui_save_options(), ro_gui_theme_apply(), ro_gui_theme_find(), ro_gui_theme_get_available(), ro_warn_user(), theme_install_content, and theme_install_descriptor.
Referenced by ro_gui_dialog_init().
|
static |
Callback for fetchcache() for theme install fetches.
Definition at line 111 of file theme_install.c.
References theme_descriptor::author, buffer, content_get_source_data(), CONTENT_MSG_DONE, CONTENT_MSG_ERROR, hlcache_event::data, dialog_theme_install, content_msg_data::errordata, content_msg_data::errormsg, ICON_THEME_INSTALL_INSTALL, ICON_THEME_INSTALL_MESSAGE, messages_get(), theme_descriptor::name, NSERROR_OK, ro_gui_set_icon_shaded_state(), ro_gui_set_icon_string(), ro_warn_user(), theme_install_close(), theme_install_content, theme_install_descriptor, theme_install_read(), and hlcache_event::type.
Referenced by theme_install_start().
|
static |
Close the theme installer and free resources.
Definition at line 232 of file theme_install.c.
References hlcache_handle_release(), and theme_install_content.
Referenced by theme_install_callback(), and theme_install_start().
|
static |
Fill in theme_install_descriptor from received theme data.
source_data | received data |
source_size | size of data |
If the data is a correct theme, theme_install_descriptor is filled in.
Definition at line 91 of file theme_install.c.
References theme_descriptor::compressed_size, ro_gui_theme_read_file_header(), and theme_install_descriptor.
Referenced by theme_install_callback().
void theme_install_start | ( | struct hlcache_handle * | c | ) |
Handle a CONTENT_THEME that has started loading.
Definition at line 56 of file theme_install.c.
References content_get_type(), content_invalidate_reuse_data(), CONTENT_THEME, dialog_theme_install, hlcache_handle_replace_callback(), ICON_THEME_INSTALL_INSTALL, ICON_THEME_INSTALL_MESSAGE, messages_get(), ro_gui_dialog_open_top(), ro_gui_set_icon_shaded_state(), ro_gui_set_icon_string(), ro_gui_wimp_event_register_close_window(), ro_warn_user(), theme_install_callback(), and theme_install_close().
Referenced by browser_window_callback().
wimp_w dialog_theme_install |
Definition at line 44 of file theme_install.c.
Referenced by theme_install_callback(), and theme_install_start().
|
static |
Definition at line 42 of file theme_install.c.
Referenced by ro_gui_theme_install_apply(), theme_install_callback(), and theme_install_close().
|
static |
Definition at line 43 of file theme_install.c.
Referenced by ro_gui_theme_install_apply(), theme_install_callback(), and theme_install_read().