update atari frontend to remove usage of depricated warn_user API

This commit is contained in:
Vincent Sanders 2016-04-30 11:34:45 +01:00
parent 03566a1182
commit 545644f23d
12 changed files with 25 additions and 35 deletions

View File

@ -177,7 +177,7 @@ void atari_about_show(void)
nsurl_unref(url);
}
if (nserr != NSERROR_OK) {
warn_user(messages_get_errorcode(nserr), 0);
atari_warn_user(messages_get_errorcode(nserr), 0);
}
}
/*

View File

@ -24,6 +24,7 @@
#include "content/hlcache.h"
#include "atari/gui.h"
#include "atari/misc.h"
#include "atari/rootwin.h"
#include "atari/clipboard.h"
#include "atari/gemtk/gemtk.h"
@ -237,7 +238,7 @@ void context_popup(struct gui_window * gw, short x, short y)
NULL);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
atari_warn_user(messages_get_errorcode(error), 0);
}
}
@ -271,7 +272,7 @@ void context_popup(struct gui_window * gw, short x, short y)
gw->browser->bw,
NULL);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
atari_warn_user(messages_get_errorcode(error), 0);
}
}
break;

View File

@ -195,7 +195,7 @@ static void __CDECL menu_about(short item, short title, void *data)
nsurl_unref(url);
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
atari_warn_user(messages_get_errorcode(error), 0);
}
*/
atari_about_show();
@ -227,7 +227,7 @@ static void __CDECL menu_new_win(short item, short title, void *data)
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
atari_warn_user(messages_get_errorcode(error), 0);
}
}
@ -270,7 +270,7 @@ static void __CDECL menu_open_file(short item, short title, void *data)
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
atari_warn_user(messages_get_errorcode(error), 0);
}
free( urltxt );
}

View File

@ -287,7 +287,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *parent)
gdw = calloc(1, sizeof(struct gui_download_window));
if( gdw == NULL ){
warn_user(NULL, "Out of memory!");
atari_warn_user(NULL, "Out of memory!");
free( destination );
return( NULL );
}

View File

@ -93,7 +93,7 @@ static void atari_hotlist_keypress(struct core_window *cw, uint32_t ucs4)
{
GUIWIN *gemtk_win;
GRECT area;
LOG("ucs4: %lu\n", ucs4);
LOG("ucs4: %"PRIu32 , ucs4);
hotlist_keypress(ucs4);
gemtk_win = atari_treeview_get_gemtk_window(cw);
atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &area);

View File

@ -194,18 +194,6 @@ bool is_process_running(const char * name)
}
/**
* Callback for load_icon(). Should be removed once bitmaps get loaded directly
* from disc
*/
static nserror load_icon_callback(hlcache_handle *handle,
const hlcache_event *event, void *pw)
{
return NSERROR_OK;
}
void gem_set_cursor( MFORM_EX * cursor )
{
static unsigned char flags = 255;
@ -221,13 +209,8 @@ void gem_set_cursor( MFORM_EX * cursor )
flags = cursor->flags;
}
/**
* Convert NKC (atari normalized key code) to netsurf
* Input key code and/or to ucs4 (depends on keycode).
* When the input key can not be found for the NKC,
* the function will return 0 and fill ucs4_out with
* the NKC converted to UC4 encoding.
*/
/* exported interface documented in atari/misc.h */
long nkc_to_input_key(short nkc, long * ucs4_out)
{
unsigned char ascii = (nkc & 0xFF);

View File

@ -75,8 +75,12 @@ void dbg_rect(const char * str, int * pxy);
const char * file_select(const char * title, const char * name);
/**
* Convert NKC (atari normalized key code) to netsurf
* Input key code and/or to ucs4 (depends on keycode).
* Convert NKC to netsurf input key code and/or to ucs4 (depends on keycode).
*
* \param[in] nkc atari normalized key code
* \param[out] ucs4_out The ucs4 converted keycode
* \return The netsurf input keycode or 0 and ucs4_out updated with
* the NKC converted to UC4 encoding.
*/
long nkc_to_input_key(short nkc, long * ucs4_out);

View File

@ -40,7 +40,7 @@ NS_ATARI_SYSINFO atari_sysinfo;
void init_os_info(void)
{
int16_t out[4];
unsigned long cookie_FSMC = 0;
long cookie_FSMC = 0;
atari_sysinfo.gemdos_version = Sversion();
@ -71,6 +71,8 @@ void init_os_info(void)
}
}
/* exported interface documented in atari/osspec.h */
int tos_getcookie(long tag, long * value)
{
COOKIE * cptr;

View File

@ -224,7 +224,7 @@ void nsatari_search_restore_form( struct s_search_form_session *s, OBJECT *obj)
void nsatari_search_session_destroy(struct s_search_form_session *s)
{
if (s != NULL) {
LOG("");
LOG("session %p", s);
browser_window_search_clear(s->g->browser->bw);
free(s);
}

View File

@ -168,7 +168,7 @@ static char **read_locales(void)
fp_locales = fopen(buf, "r");
if (fp_locales == NULL) {
warn_user("Failed to load locales: %s",buf);
atari_warn_user("Failed to load locales: %s",buf);
return(NULL);
} else {
LOG("Reading locales from: %s...", buf);

View File

@ -699,7 +699,7 @@ bool toolbar_key_input(struct s_toolbar *tb, short nkc)
if ( textarea_get_text( tb->url.textarea, tmp_url, PATH_MAX) > 0 ) {
window_set_focus(tb->owner, BROWSER, gw->browser);
if (nsurl_create((const char*)&tmp_url, &url) != NSERROR_OK) {
warn_user("NoMemory", 0);
atari_warn_user("NoMemory", 0);
} else {
browser_window_navigate(gw->browser->bw, url, NULL,
BW_NAVIGATE_HISTORY,
@ -977,7 +977,7 @@ void toolbar_home_click(struct s_toolbar *tb)
}
if (nsurl_create(use_url, &url) != NSERROR_OK) {
warn_user("NoMemory", 0);
atari_warn_user("NoMemory", 0);
} else {
browser_window_navigate(bw,
url,

View File

@ -528,7 +528,7 @@ atari_treeview_create(GUIWIN *win, struct atari_treeview_callbacks * callbacks,
tv = calloc(1, sizeof(struct atari_treeview_window));
if (tv == NULL) {
LOG("calloc failed");
warn_user(messages_get_errorcode(NSERROR_NOMEM), 0);
atari_warn_user(messages_get_errorcode(NSERROR_NOMEM), 0);
return NULL;
}