mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-19 02:32:44 +03:00
update atari frontend to remove usage of depricated warn_user API
This commit is contained in:
parent
03566a1182
commit
545644f23d
@ -177,7 +177,7 @@ void atari_about_show(void)
|
|||||||
nsurl_unref(url);
|
nsurl_unref(url);
|
||||||
}
|
}
|
||||||
if (nserr != NSERROR_OK) {
|
if (nserr != NSERROR_OK) {
|
||||||
warn_user(messages_get_errorcode(nserr), 0);
|
atari_warn_user(messages_get_errorcode(nserr), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "content/hlcache.h"
|
#include "content/hlcache.h"
|
||||||
|
|
||||||
#include "atari/gui.h"
|
#include "atari/gui.h"
|
||||||
|
#include "atari/misc.h"
|
||||||
#include "atari/rootwin.h"
|
#include "atari/rootwin.h"
|
||||||
#include "atari/clipboard.h"
|
#include "atari/clipboard.h"
|
||||||
#include "atari/gemtk/gemtk.h"
|
#include "atari/gemtk/gemtk.h"
|
||||||
@ -237,7 +238,7 @@ void context_popup(struct gui_window * gw, short x, short y)
|
|||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if (error != NSERROR_OK) {
|
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,
|
gw->browser->bw,
|
||||||
NULL);
|
NULL);
|
||||||
if (error != NSERROR_OK) {
|
if (error != NSERROR_OK) {
|
||||||
warn_user(messages_get_errorcode(error), 0);
|
atari_warn_user(messages_get_errorcode(error), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -195,7 +195,7 @@ static void __CDECL menu_about(short item, short title, void *data)
|
|||||||
nsurl_unref(url);
|
nsurl_unref(url);
|
||||||
}
|
}
|
||||||
if (error != NSERROR_OK) {
|
if (error != NSERROR_OK) {
|
||||||
warn_user(messages_get_errorcode(error), 0);
|
atari_warn_user(messages_get_errorcode(error), 0);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
atari_about_show();
|
atari_about_show();
|
||||||
@ -227,7 +227,7 @@ static void __CDECL menu_new_win(short item, short title, void *data)
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (error != NSERROR_OK) {
|
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) {
|
if (error != NSERROR_OK) {
|
||||||
warn_user(messages_get_errorcode(error), 0);
|
atari_warn_user(messages_get_errorcode(error), 0);
|
||||||
}
|
}
|
||||||
free( urltxt );
|
free( urltxt );
|
||||||
}
|
}
|
||||||
|
@ -287,7 +287,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *parent)
|
|||||||
|
|
||||||
gdw = calloc(1, sizeof(struct gui_download_window));
|
gdw = calloc(1, sizeof(struct gui_download_window));
|
||||||
if( gdw == NULL ){
|
if( gdw == NULL ){
|
||||||
warn_user(NULL, "Out of memory!");
|
atari_warn_user(NULL, "Out of memory!");
|
||||||
free( destination );
|
free( destination );
|
||||||
return( NULL );
|
return( NULL );
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ static void atari_hotlist_keypress(struct core_window *cw, uint32_t ucs4)
|
|||||||
{
|
{
|
||||||
GUIWIN *gemtk_win;
|
GUIWIN *gemtk_win;
|
||||||
GRECT area;
|
GRECT area;
|
||||||
LOG("ucs4: %lu\n", ucs4);
|
LOG("ucs4: %"PRIu32 , ucs4);
|
||||||
hotlist_keypress(ucs4);
|
hotlist_keypress(ucs4);
|
||||||
gemtk_win = atari_treeview_get_gemtk_window(cw);
|
gemtk_win = atari_treeview_get_gemtk_window(cw);
|
||||||
atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &area);
|
atari_treeview_get_grect(cw, TREEVIEW_AREA_CONTENT, &area);
|
||||||
|
21
atari/misc.c
21
atari/misc.c
@ -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 )
|
void gem_set_cursor( MFORM_EX * cursor )
|
||||||
{
|
{
|
||||||
static unsigned char flags = 255;
|
static unsigned char flags = 255;
|
||||||
@ -221,13 +209,8 @@ void gem_set_cursor( MFORM_EX * cursor )
|
|||||||
flags = cursor->flags;
|
flags = cursor->flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert NKC (atari normalized key code) to netsurf
|
/* exported interface documented in atari/misc.h */
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
long nkc_to_input_key(short nkc, long * ucs4_out)
|
long nkc_to_input_key(short nkc, long * ucs4_out)
|
||||||
{
|
{
|
||||||
unsigned char ascii = (nkc & 0xFF);
|
unsigned char ascii = (nkc & 0xFF);
|
||||||
|
@ -75,8 +75,12 @@ void dbg_rect(const char * str, int * pxy);
|
|||||||
const char * file_select(const char * title, const char * name);
|
const char * file_select(const char * title, const char * name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert NKC (atari normalized key code) to netsurf
|
* Convert NKC to netsurf input key code and/or to ucs4 (depends on keycode).
|
||||||
* 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);
|
long nkc_to_input_key(short nkc, long * ucs4_out);
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ NS_ATARI_SYSINFO atari_sysinfo;
|
|||||||
void init_os_info(void)
|
void init_os_info(void)
|
||||||
{
|
{
|
||||||
int16_t out[4];
|
int16_t out[4];
|
||||||
unsigned long cookie_FSMC = 0;
|
long cookie_FSMC = 0;
|
||||||
|
|
||||||
atari_sysinfo.gemdos_version = Sversion();
|
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)
|
int tos_getcookie(long tag, long * value)
|
||||||
{
|
{
|
||||||
COOKIE * cptr;
|
COOKIE * cptr;
|
||||||
|
@ -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)
|
void nsatari_search_session_destroy(struct s_search_form_session *s)
|
||||||
{
|
{
|
||||||
if (s != NULL) {
|
if (s != NULL) {
|
||||||
LOG("");
|
LOG("session %p", s);
|
||||||
browser_window_search_clear(s->g->browser->bw);
|
browser_window_search_clear(s->g->browser->bw);
|
||||||
free(s);
|
free(s);
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ static char **read_locales(void)
|
|||||||
fp_locales = fopen(buf, "r");
|
fp_locales = fopen(buf, "r");
|
||||||
|
|
||||||
if (fp_locales == NULL) {
|
if (fp_locales == NULL) {
|
||||||
warn_user("Failed to load locales: %s",buf);
|
atari_warn_user("Failed to load locales: %s",buf);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
} else {
|
} else {
|
||||||
LOG("Reading locales from: %s...", buf);
|
LOG("Reading locales from: %s...", buf);
|
||||||
|
@ -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 ) {
|
if ( textarea_get_text( tb->url.textarea, tmp_url, PATH_MAX) > 0 ) {
|
||||||
window_set_focus(tb->owner, BROWSER, gw->browser);
|
window_set_focus(tb->owner, BROWSER, gw->browser);
|
||||||
if (nsurl_create((const char*)&tmp_url, &url) != NSERROR_OK) {
|
if (nsurl_create((const char*)&tmp_url, &url) != NSERROR_OK) {
|
||||||
warn_user("NoMemory", 0);
|
atari_warn_user("NoMemory", 0);
|
||||||
} else {
|
} else {
|
||||||
browser_window_navigate(gw->browser->bw, url, NULL,
|
browser_window_navigate(gw->browser->bw, url, NULL,
|
||||||
BW_NAVIGATE_HISTORY,
|
BW_NAVIGATE_HISTORY,
|
||||||
@ -977,7 +977,7 @@ void toolbar_home_click(struct s_toolbar *tb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nsurl_create(use_url, &url) != NSERROR_OK) {
|
if (nsurl_create(use_url, &url) != NSERROR_OK) {
|
||||||
warn_user("NoMemory", 0);
|
atari_warn_user("NoMemory", 0);
|
||||||
} else {
|
} else {
|
||||||
browser_window_navigate(bw,
|
browser_window_navigate(bw,
|
||||||
url,
|
url,
|
||||||
|
@ -528,7 +528,7 @@ atari_treeview_create(GUIWIN *win, struct atari_treeview_callbacks * callbacks,
|
|||||||
tv = calloc(1, sizeof(struct atari_treeview_window));
|
tv = calloc(1, sizeof(struct atari_treeview_window));
|
||||||
if (tv == NULL) {
|
if (tv == NULL) {
|
||||||
LOG("calloc failed");
|
LOG("calloc failed");
|
||||||
warn_user(messages_get_errorcode(NSERROR_NOMEM), 0);
|
atari_warn_user(messages_get_errorcode(NSERROR_NOMEM), 0);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user