Fix focus element

svn path=/trunk/netsurf/; revision=13251
This commit is contained in:
Ole Loots 2011-12-06 21:06:41 +00:00
parent 3ba6a15fa7
commit e7e8024be8
16 changed files with 289 additions and 117 deletions

View File

@ -41,7 +41,7 @@ S_ATARI := gui.c findfile.c filetype.c misc.c bitmap.c schedule.c \
redrawslots.c encoding.c \ redrawslots.c encoding.c \
browser_win.c toolbar.c statusbar.c browser.c \ browser_win.c toolbar.c statusbar.c browser.c \
global_evnt.c osspec.c dragdrop.c system_colour.c \ global_evnt.c osspec.c dragdrop.c system_colour.c \
ctxmenu.c ctxmenu.c save.c
S_ATARI := $(addprefix atari/,$(S_ATARI)) S_ATARI := $(addprefix atari/,$(S_ATARI))
# This is the final source build list # This is the final source build list

View File

@ -239,6 +239,8 @@ void window_open( struct gui_window * gw, GRECT pos )
} }
tb_adjust_size( gw ); tb_adjust_size( gw );
/*TBD: get already present content and set size? */ /*TBD: get already present content and set size? */
input_window = gw;
window_set_focus( gw, BROWSER, gw->browser );
} }
@ -484,8 +486,11 @@ static void __CDECL evnt_window_close( WINDOW *win, short buff[8], void *data )
static void __CDECL evnt_window_newtop( WINDOW *win, short buff[8], void *data ) static void __CDECL evnt_window_newtop( WINDOW *win, short buff[8], void *data )
{ {
input_window = (struct gui_window *) data; printf("oldtop: iw: %p\n", input_window);
input_window = (struct gui_window *) data;
printf("newtop: iw: %p, win: %p", input_window, win );
window_set_focus( input_window, BROWSER, &input_window->browser )
LOG(("newtop: iw: %p, win: %p", input_window, win )); LOG(("newtop: iw: %p, win: %p", input_window, win ));
assert( input_window != NULL ); assert( input_window != NULL );
} }

View File

@ -0,0 +1,10 @@
- Fixed redraw of rectangle outlines.
- Fixed redraw of Hotlist, looks better now.
- Use netsurfs textarea implementation for URL, to reduce code size.
- Fixed several redraw glitches.
- Added a context menu, offering some handy functions.
- NetSurf core now supports frames & iframes.
- Debug rendering works now ( fixed redraw of rectangle outlines )
- process commandline parameter w (width) / h (height) for default window size
- improved mouse drag within treeview, browser win, toolbar.
- Fixed file drop in frames

View File

@ -3,33 +3,29 @@ TODO's (no priority order)
- Optimize remove / redraw of caret, use pixbuffer instead? - Optimize remove / redraw of caret, use pixbuffer instead?
- Optimize drawing of bitmaps on Low-Memory machines - Optimize drawing of bitmaps on Low-Memory machines
- Restore the Palette when Windows get's the Focus - Restore the Palette when Windows get's the Focus
-> only needed for <= 256 colors -> only needed for <= 256 colors
- Make drawing of tiled bitmaps optional ( they are slooow ) - Make drawing of tiled bitmaps optional ( they are slooow )
-> already optimized, still needed? -> already optimized, still needed?
- Implement PopUp Context Menu ( + "Open link in new Window" ) - only copy visible rects when copying screen rects ( during scroll ).
- Make context menu more stable, Bug lurking within core?
- Implement TreeView History - Implement TreeView History
- Implement TreeView SSL Dialog - Implement TreeView SSL Dialog
- Implement Native Select Menu - Implement Native Select Menu
- Implement offscreen plotter - Implement offscreen plotter
- Implement Options Dialog - Implement Options Dialog
- Implement Favicon Display
- Implement SystemColors - Implement SystemColors
- Replace RSC strings with string from messages file. - Replace RSC strings with string from messages file.
- Implement Selection within URL Widget by depressing SHIFT + Mouse Click
- Implement Home / End Cursors within the URL Widget
- Implement Offscreen plotter.
- Test more pages that use a refferer.
- Optimize Offscreen Plotter: Save inactive framebuffers to disk? - Optimize Offscreen Plotter: Save inactive framebuffers to disk?
- Ensure that a font-face is set to the default font when it couldn't be loaded. - Ensure that a font-face is set to the default font when it couldn't be loaded.
- Loose focus for browser / url widget etc. when changing focus - Loose focus for browser / url widget etc. when changing focus
( at best, implement callback for this...) ( at best, implement callback for this...)
- Have browser_window specific cursor, window specifc cursor - Have browser_window specific cursor, window specifc cursor
- When minimized (not iconyfied) NetSurf doesn't recognize that. - When minimized (not iconyfied) NetSurf doesn't recognize that.
- complete Iconify (webpage favicon ) - Tabs? ( several tab-favicons when iconyfied?)
- improve mouse tracking - improve mouse tracking
- fix this: - fix this:
path2url in: ./res/icons/dir.png path2url in: ./res/icons/dir.png
path2url out: file:///./res/icons/dir.png path2url out: file:///./res/icons/dir.png
url2path in: file:///./res/icons/dir.png url2path in: file:///./res/icons/dir.png
- loesung fuer kompletten tree icons path finden - loesung fuer kompletten tree icons path finden

View File

@ -38,25 +38,53 @@ const char *fetch_filetype(const char *unix_path)
LOG(("unix path: %s", unix_path)); LOG(("unix path: %s", unix_path));
/* This line is added for devlopment versions running from the root dir: */ /* This line is added for devlopment versions running from the root dir: */
if (2 < l && strcasecmp(unix_path + l - 3, "f79") == 0) if( strchr( unix_path, (int)'.' ) ){
res = (char*)"text/css"; if (2 < l && strcasecmp(unix_path + l - 3, "f79") == 0)
else if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0) res = (char*)"text/css";
res = (char*)"text/css"; else if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0)
else if (2 < l && strcasecmp(unix_path + l - 3, "jpg") == 0) res = (char*)"text/css";
res = (char*)"image/jpeg"; else if (2 < l && strcasecmp(unix_path + l - 3, "jpg") == 0)
else if (3 < l && strcasecmp(unix_path + l - 4, "jpeg") == 0) res = (char*)"image/jpeg";
res = (char*)"image/jpeg"; else if (3 < l && strcasecmp(unix_path + l - 4, "jpeg") == 0)
else if (2 < l && strcasecmp(unix_path + l - 3, "gif") == 0) res = (char*)"image/jpeg";
res = (char*)"image/gif"; else if (2 < l && strcasecmp(unix_path + l - 3, "gif") == 0)
else if (2 < l && strcasecmp(unix_path + l - 3, "png") == 0) res = (char*)"image/gif";
res = (char*)"image/png"; else if (2 < l && strcasecmp(unix_path + l - 3, "png") == 0)
else if (2 < l && strcasecmp(unix_path + l - 3, "jng") == 0) res = (char*)"image/png";
res = (char*)"image/jng"; else if (2 < l && strcasecmp(unix_path + l - 3, "jng") == 0)
else if (2 < l && strcasecmp(unix_path + l - 3, "svg") == 0) res = (char*)"image/jng";
res = (char*)"image/svg"; else if (2 < l && strcasecmp(unix_path + l - 3, "svg") == 0)
else if (2 < l && strcasecmp(unix_path + l - 3, "txt") == 0) res = (char*)"image/svg";
res = (char*)"text/plain"; else if (2 < l && strcasecmp(unix_path + l - 3, "txt") == 0)
res = (char*)"text/plain";
} else {
int n=0;
int c;
FILE * fp;
char buffer[16];
fp = fopen( unix_path, "r" );
if( fp ){
do {
c = fgetc (fp);
if( c != EOF )
buffer[n] = (char)c;
else
buffer[n] = 0;
n++;
} while (c != EOF && n<15);
fclose( fp );
if( n > 0 ){
if( n > 5 && strncasecmp("GIF89", buffer, 5) == 0 )
res = "image/gif";
else if( n > 4 && strncasecmp("PNG", &buffer[1], 3) ==0 )
res = "image/png";
else if( n > 10 && strncasecmp("JFIF", &buffer[5], 4) == 0 )
res = "image/jpeg";
}
}
}
error: error:
LOG(("mime type: %s", res )); LOG(("mime type: %s", res ));
return( res ); return( res );

View File

@ -33,8 +33,53 @@
#include "atari/misc.h" #include "atari/misc.h"
#include "atari/osspec.h" #include "atari/osspec.h"
char * local_file_to_url( const char * filename )
{
#define BACKSLASH 0x5C
char * url;
if( strlen(filename) <= 2){
return( NULL );
}
char * fname_local = alloca( strlen(filename)+1 );
char * start = (char*)fname_local;
strcpy( start, filename );
/* if path points to unified filesystem, skip that info: */
if( fname_local[1] == ':' && fname_local[0] == 'U' ){
start = &fname_local[2];
}
/* if we got something like "C:\folder\file.txt", handle that: */
if( start[1] == ':' ){
start[1] = (char)tolower(start[0]);
start++;
}
/* skip leading slash, already included in file scheme: */
if( start[0] == (char)BACKSLASH || start[0] == '/' ){
start++;
}
/* convert backslashes: */
for( int i=0; i<strlen(start); i++ ){
if( start[i] == BACKSLASH ){
start[i] = '/';
}
}
// TODO: make file path absolute if it isn't yet.
url = malloc( strlen(start) + FILE_SCHEME_PREFIX_LEN + 1);
strcpy( url, FILE_SCHEME_PREFIX );
strcat( url, start );
return( url );
#undef BACKSLASH
}
/* convert an local path to an URL, memory for URL is allocated. */
char *path_to_url(const char *path_in) char *path_to_url(const char *path_in)
{ {
#define BACKSLASH 0x5C
char * path_ptr=NULL; char * path_ptr=NULL;
char * path; char * path;
LOG(("path2url in: %s\n", path_in)); LOG(("path2url in: %s\n", path_in));
@ -45,7 +90,8 @@ char *path_to_url(const char *path_in)
} else { } else {
path = path_ptr = (char*)malloc(PATH_MAX+1); path = path_ptr = (char*)malloc(PATH_MAX+1);
gemdos_realpath(path_in, path); gemdos_realpath(path_in, path);
if( *path == '/' || *path == 0x5C ) {
if( *path == '/' || *path == BACKSLASH ) {
path++; path++;
} }
if( sys_type() != SYS_MINT ){ if( sys_type() != SYS_MINT ){
@ -63,15 +109,16 @@ char *path_to_url(const char *path_in)
int i=0; int i=0;
while( url[i] != 0 ){ while( url[i] != 0 ){
if( url[i] == 0x5C ){ if( url[i] == BACKSLASH ){
url[i] = '/'; url[i] = '/';
} }
i++; i++;
} }
if( path_ptr ) if( path_ptr )
free( path_ptr ); free( path_ptr );
LOG(("path2url out: %s\n", url)); LOG(("path2url out: %s\n", url));
return url; return url;
#undef BACKSLASH
} }
@ -108,10 +155,10 @@ char *url_to_path(const char *url)
* \return buf * \return buf
* *
* Search order is: ./, NETSURF_GEM_RESPATH, ./$HOME/.netsurf/, $NETSURFRES/ (where NETSURFRES is an * Search order is: ./, NETSURF_GEM_RESPATH, ./$HOME/.netsurf/, $NETSURFRES/ (where NETSURFRES is an
* environment variable), * environment variable),
*/ */
#ifndef NETSURF_GEM_RESPATH #ifndef NETSURF_GEM_RESPATH
#define NETSURF_GEM_RESPATH "./res/" #define NETSURF_GEM_RESPATH "./res/"
#endif #endif
char * atari_find_resource(char *buf, const char *filename, const char *def) char * atari_find_resource(char *buf, const char *filename, const char *def)

View File

@ -21,5 +21,6 @@
#define NS_ATARI_FINDFILE_H #define NS_ATARI_FINDFILE_H
extern char *atari_find_resource(char *buf, const char *filename, const char *def); extern char *atari_find_resource(char *buf, const char *filename, const char *def);
char * local_file_to_url( const char * filename );
#endif /* NETSURF_ATARI_FINDFILE_H */ #endif /* NETSURF_ATARI_FINDFILE_H */

View File

@ -30,9 +30,11 @@
#include "desktop/browser.h" #include "desktop/browser.h"
#include "desktop/mouse.h" #include "desktop/mouse.h"
#include "desktop/textinput.h" #include "desktop/textinput.h"
#include "desktop/hotlist.h" #include "desktop/hotlist.h"
#include "desktop/save_complete.h"
#include "utils/log.h" #include "utils/log.h"
#include "utils/messages.h" #include "utils/messages.h"
#include "utils/url.h"
#include "atari/gui.h" #include "atari/gui.h"
#include "atari/browser_win.h" #include "atari/browser_win.h"
@ -44,7 +46,8 @@
#include "atari/browser_win.h" #include "atari/browser_win.h"
#include "atari/res/netsurf.rsh" #include "atari/res/netsurf.rsh"
#include "atari/search.h" #include "atari/search.h"
#include "atari/options.h" #include "atari/options.h"
#include "atari/findfile.h"
#include "cflib.h" #include "cflib.h"
extern const char * cfg_homepage_url; extern const char * cfg_homepage_url;
@ -100,19 +103,39 @@ static void __CDECL menu_open_url(WINDOW *win, int item, int title, void *data)
{ {
struct gui_window * gw; struct gui_window * gw;
struct browser_window * bw ; struct browser_window * bw ;
LOG(("%s", __FUNCTION__));
gw = input_window; gw = input_window;
if( gw == NULL ) { if( gw == NULL ) {
bw = browser_window_create("", 0, 0, true, false); bw = browser_window_create("", 0, 0, true, false);
gw = bw->window; gw = bw->window;
}
/* TODO: reset url? */ }
LOG(("%s", __FUNCTION__)); /* Loose focus: */
window_set_focus( gw, WIDGET_NONE, NULL );
/* trigger on-focus event (select all text): */
window_set_focus( gw, URL_WIDGET, &gw->root->toolbar->url );
/* delete selection: */
tb_url_input( gw, NK_DEL );
} }
static void __CDECL menu_open_file(WINDOW *win, int item, int title, void *data) static void __CDECL menu_open_file(WINDOW *win, int item, int title, void *data)
{ {
LOG(("%s", __FUNCTION__)); struct gui_window * gw;
struct browser_window * bw ;
LOG(("%s", __FUNCTION__));
const char * filename = file_select( messages_get("OpenFile"), "" );
if( filename != NULL ){
char * url = local_file_to_url( filename );
if( url ){
bw = browser_window_create(url, NULL, NULL, true, false);
free( url );
}
}
} }
static void __CDECL menu_close_win(WINDOW *win, int item, int title, void *data) static void __CDECL menu_close_win(WINDOW *win, int item, int title, void *data)
@ -125,7 +148,42 @@ static void __CDECL menu_close_win(WINDOW *win, int item, int title, void *data)
static void __CDECL menu_save_page(WINDOW *win, int item, int title, void *data) static void __CDECL menu_save_page(WINDOW *win, int item, int title, void *data)
{ {
LOG(("%s", __FUNCTION__)); LOG(("%s", __FUNCTION__));
static bool init = true;
bool is_folder=false;
const char * path;
if( !input_window )
return;
if( init ){
init = false;
save_complete_init();
}
do {
// TODO: localize string
path = file_select( "Select folder", "" );
if( path ) {
printf("testing: %s\n", path );
// dumb check if the selection is an folder:
/*FILE * fp;
fp = fopen( path, "r" );
if( !fp ){
is_folder = true;
} else {
fclose( fp );
form_alert(1, "[1][Please select an folder or abort!][OK]");
}
*/
is_folder = true;
}
} while( !is_folder && path != NULL );
if( path != NULL ){
save_complete( input_window->browser->bw->current_content, path );
}
} }
static void __CDECL menu_quit(WINDOW *win, int item, int title, void *data) static void __CDECL menu_quit(WINDOW *win, int item, int title, void *data)
@ -516,9 +574,11 @@ static void set_menu_title(int rid, const char * nsid)
{ {
static int count=0; static int count=0;
char * msgstr; char * msgstr;
msgstr = (char*)messages_get(nsid); msgstr = (char*)messages_get(nsid);
if(msgstr != NULL) { if(msgstr != NULL) {
if(msgstr[0] != 0) { if(msgstr[0] != 0) {
// TODO: modify resource tree, adjust width of menu to chars
// actually used.
assert(count < NUM_MENU_TITLES); assert(count < NUM_MENU_TITLES);
menu_titles[count] = malloc( strlen(msgstr)+3 ); menu_titles[count] = malloc( strlen(msgstr)+3 );
strcpy((char*)menu_titles[count], " "); strcpy((char*)menu_titles[count], " ");
@ -543,7 +603,6 @@ void bind_global_events( void )
EvntAttach( NULL, AP_TERM, global_evnt_apterm ); EvntAttach( NULL, AP_TERM, global_evnt_apterm );
EvntAttach( NULL, MN_SELECTED, global_evnt_menu ); EvntAttach( NULL, MN_SELECTED, global_evnt_menu );
/* TODO: maybe instant redraw after this is better! */
set_menu_title( MAINMENU_T_FILE, "Page"); set_menu_title( MAINMENU_T_FILE, "Page");
set_menu_title( MAINMENU_T_EDIT, "Edit" ); set_menu_title( MAINMENU_T_EDIT, "Edit" );
set_menu_title( MAINMENU_T_NAVIGATE, "Navigate"); set_menu_title( MAINMENU_T_NAVIGATE, "Navigate");
@ -617,7 +676,9 @@ void bind_global_events( void )
} }
i=0; i=0;
while( menu_evnt_tbl[i].rid != -1 ) { while( menu_evnt_tbl[i].rid != -1 ) {
if( menu_evnt_tbl[i].menustr != NULL ) { if( menu_evnt_tbl[i].menustr != NULL ) {
// TODO: modify resource tree, adjust width of menu to chars
// actually used.
MenuText( NULL, menu_evnt_tbl[i].rid, menu_evnt_tbl[i].menustr ); MenuText( NULL, menu_evnt_tbl[i].rid, menu_evnt_tbl[i].menustr );
} }
i++; i++;

View File

@ -555,31 +555,6 @@ gui_window_set_search_ico(hlcache_handle *ico)
TODO(); TODO();
} }
bool
save_complete_gui_save(const char *path,
const char *filename,
size_t len,
const char *sourcedata,
lwc_string *mime_type)
{
TODO();
LOG(("%s", filename));
return false;
}
int
save_complete_htmlSaveFileFormat(const char *path,
const char *filename,
xmlDocPtr cur,
const char *encoding,
int format)
{
LOG(("%s", filename));
TODO();
return 0;
}
void gui_window_new_content(struct gui_window *w) void gui_window_new_content(struct gui_window *w)
{ {
w->browser->scroll.current.x = 0; w->browser->scroll.current.x = 0;
@ -809,7 +784,8 @@ void gui_cert_verify(const char *url, const struct ssl_cert_info *certs,
/*bres = verify_ssl_form_do(url, certs, num); /*bres = verify_ssl_form_do(url, certs, num);
if( bres ) if( bres )
urldb_set_cert_permissions(url, true); urldb_set_cert_permissions(url, true);
*/ */
// TODO: localize string
int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort]"); int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort]");
bres = (b==1)? true : false; bres = (b==1)? true : false;
LOG(("Trust: %d", bres )); LOG(("Trust: %d", bres ));

View File

@ -301,6 +301,36 @@ long nkc_to_input_key(short nkc, long * ucs4_out)
} }
return ( ik ); return ( ik );
} }
/**
* Show default file selector
*
* \param title The selector title.
* \param name Default file name
* \return a static char pointer or null if the user aborted the selection.
*/
const char * file_select( const char * title, const char * name ) {
static char path[PATH_MAX]=""; // First usage : current directory
static char fullname[PATH_MAX]="";
char tmpname[255];
char * use_title = (char*)title;
if( strlen(name)>254)
return( NULL );
strcpy( tmpname, name );
if( use_title == NULL ){
use_title = (char*)"";
}
if( FselInput( path, tmpname, (char*)"", use_title, NULL, NULL)) {
strncpy( fullname, path, PATH_MAX-1 );
strncat( fullname, tmpname, PATH_MAX-strlen(fullname)-1 );
return( (const char*)&fullname );
}
return( NULL );
}
void dbg_lgrect( char * str, LGRECT * r ) void dbg_lgrect( char * str, LGRECT * r )

View File

@ -43,4 +43,5 @@ void * ldg_open( char * name, short * global );
void * ldg_find( char * name, short * ldg ); void * ldg_find( char * name, short * ldg );
int ldg_close( void * ldg, short * global ); int ldg_close( void * ldg, short * global );
long nkc_to_input_key(short nkc, long * ucs4_out); long nkc_to_input_key(short nkc, long * ucs4_out);
const char * file_select( const char * title, const char * name );
#endif #endif

View File

@ -19,7 +19,7 @@ unsigned short _systype (void)
{ {
int32_t * cptr = NULL; int32_t * cptr = NULL;
_systype_v = SYS_TOS; _systype_v = SYS_TOS;
cptr = Setexc(0x0168, -1L); cptr = Setexc(0x0168, -1L);
if (cptr == NULL ) { if (cptr == NULL ) {
return _systype_v; /* stone old TOS without any cookie support */ return _systype_v; /* stone old TOS without any cookie support */
@ -77,7 +77,7 @@ void init_os_info(void)
if (sys_XAAES()) { if (sys_XAAES()) {
atari_sysinfo.aes_max_win_title_len = 200; atari_sysinfo.aes_max_win_title_len = 200;
} }
} }
} }
int tos_getcookie(long tag, long * value) int tos_getcookie(long tag, long * value)
@ -105,8 +105,8 @@ int tos_getcookie(long tag, long * value)
return( C_NOTFOUND ); return( C_NOTFOUND );
} }
/* /*
a fixed version of realpath() which returns valid a fixed version of realpath() which returns valid
paths for TOS which have no root fs. (/ , U: ) paths for TOS which have no root fs. (/ , U: )
*/ */
@ -125,7 +125,7 @@ char * gemdos_realpath(const char * path, char * rpath)
LOG(("gdos rpath in: %s\n", path)); LOG(("gdos rpath in: %s\n", path));
memset( rpath, 0, PATH_MAX ); memset( rpath, 0, PATH_MAX );
/* first, absolutize relative path: */ /* first, absolutize relative path: */
if( *path == '.' ){ if( *path == '.' ){
char cwd[PATH_MAX+1]; char cwd[PATH_MAX+1];
@ -144,7 +144,7 @@ char * gemdos_realpath(const char * path, char * rpath)
int off = 0; int off = 0;
if( path[1] == '/' || path[1] == 0x5C ){ if( path[1] == '/' || path[1] == 0x5C ){
off = 2; off = 2;
} }
strncat( (char*)&work, (char*)(path+off), PATH_MAX-l ); strncat( (char*)&work, (char*)(path+off), PATH_MAX-l );
} }
work_ptr = (char*)&work; work_ptr = (char*)&work;
@ -157,7 +157,7 @@ char * gemdos_realpath(const char * path, char * rpath)
if( strncmp( (char*)work_ptr, "/dev/", 5) == 0 ){ if( strncmp( (char*)work_ptr, "/dev/", 5) == 0 ){
work_ptr += 4; work_ptr += 4;
} }
/* make TOS compatible path, step 1: */ /* make TOS compatible path, step 1: */
l = strlen( work_ptr); l = strlen( work_ptr);
if( l > 1 ){ if( l > 1 ){
@ -176,7 +176,7 @@ char * gemdos_realpath(const char * path, char * rpath)
do{ do{
if( *work_ptr == '/' ) if( *work_ptr == '/' )
*work_ptr = 0x5C; *work_ptr = 0x5C;
work_ptr++; work_ptr++;
} while( *work_ptr != 0 ); } while( *work_ptr != 0 );
if( rpath[l-1] == 0x5C || rpath[l-1] == '/' ) if( rpath[l-1] == 0x5C || rpath[l-1] == '/' )

View File

@ -71,13 +71,17 @@ int atari_plotter_init( char* drvrname, char * fdrvrname )
LOG(("using plotters: %s, %s", drvrname, fdrvrname)); LOG(("using plotters: %s, %s", drvrname, fdrvrname));
fplotter = new_font_plotter(vdih, fdrvrname, 0, &err ); fplotter = new_font_plotter(vdih, fdrvrname, 0, &err );
if(err) if(err){
die(("Unable to load font plotter %s -> %s", fdrvrname, plotter_err_str(err) )); char * desc = plotter_err_str(err);
die(("Unable to load font plotter %s -> %s", fdrvrname, desc ));
}
plotter = new_plotter( vdih, drvrname, &loc_pos, drvinfo->max_bpp, plotter = new_plotter( vdih, drvrname, &loc_pos, drvinfo->max_bpp,
flags, fplotter, &err ); flags, fplotter, &err );
if(err) if(err){
die(("Unable to load graphics plotter %s -> %s", drvrname, plotter_err_str(err) )); char * desc = plotter_err_str(err);
die(("Unable to load graphics plotter %s -> %s", drvrname, desc ));
}
return( err ); return( err );
} }

View File

@ -60,14 +60,14 @@ void schedule( int cs_ival, void (*callback)(void *p), void *p)
struct nscallback *nscb; struct nscallback *nscb;
nscb = calloc(1, sizeof(struct nscallback)); nscb = calloc(1, sizeof(struct nscallback));
nscb->timeout = CS_NOW() + cs_ival; nscb->timeout = CS_NOW() + cs_ival;
LOG(("adding callback %p for %p(%p) at %d cs", nscb, callback, p, nscb->timeout )); LOG(("adding callback %p for %p(%p) at %d cs", nscb, callback, p, nscb->timeout ));
nscb->callback = callback; nscb->callback = callback;
nscb->p = p; nscb->p = p;
/* add to list front */ /* add to list front */
nscb->next = schedule_list; nscb->next = schedule_list;
schedule_list = nscb; schedule_list = nscb;
} }
@ -90,7 +90,9 @@ void schedule_remove(void (*callback)(void *p), void *p)
if (schedule_list == NULL) if (schedule_list == NULL)
return; return;
#ifdef DEBUG_SCHEDULER
LOG(("removing %p, %p", callback, p)); LOG(("removing %p, %p", callback, p));
#endif
cur_nscb = schedule_list; cur_nscb = schedule_list;
prev_nscb = NULL; prev_nscb = NULL;
@ -99,7 +101,9 @@ void schedule_remove(void (*callback)(void *p), void *p)
if ((cur_nscb->callback == callback) && if ((cur_nscb->callback == callback) &&
(cur_nscb->p == p)) { (cur_nscb->p == p)) {
/* item to remove */ /* item to remove */
#ifdef DEBUG_SCHEDULER
LOG(("callback entry %p removing %p(%p)", cur_nscb, cur_nscb->callback, cur_nscb->p)); LOG(("callback entry %p removing %p(%p)", cur_nscb, cur_nscb->callback, cur_nscb->p));
#endif
/* remove callback */ /* remove callback */
unlnk_nscb = cur_nscb; unlnk_nscb = cur_nscb;
@ -123,7 +127,7 @@ void schedule_remove(void (*callback)(void *p), void *p)
* Process events up to current time. * Process events up to current time.
*/ */
int int
schedule_run(void) schedule_run(void)
{ {
unsigned long nexttime; unsigned long nexttime;
@ -152,24 +156,28 @@ schedule_run(void)
prev_nscb->next = unlnk_nscb->next; prev_nscb->next = unlnk_nscb->next;
} }
#ifdef DEBUG_SCHEDULER
LOG(("callback entry %p running %p(%p)", unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p)); LOG(("callback entry %p running %p(%p)", unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p));
#endif
/* call callback */ /* call callback */
unlnk_nscb->callback(unlnk_nscb->p); unlnk_nscb->callback(unlnk_nscb->p);
free(unlnk_nscb); free(unlnk_nscb);
/* need to deal with callback modifying the list. */ /* need to deal with callback modifying the list. */
if (schedule_list == NULL) { if (schedule_list == NULL) {
#ifdef DEBUG_SCHEDULER
LOG(("schedule_list == NULL")); LOG(("schedule_list == NULL"));
#endif
return -1; /* no more callbacks scheduled */ return -1; /* no more callbacks scheduled */
} }
/* reset enumeration to the start of the list */ /* reset enumeration to the start of the list */
cur_nscb = schedule_list; cur_nscb = schedule_list;
prev_nscb = NULL; prev_nscb = NULL;
nexttime = cur_nscb->timeout; nexttime = cur_nscb->timeout;
} else { } else {
/* if the time to the event is sooner than the /* if the time to the event is sooner than the
* currently recorded soonest event record it * currently recorded soonest event record it
*/ */
if( nexttime > cur_nscb->timeout ){ if( nexttime > cur_nscb->timeout ){
nexttime = cur_nscb->timeout; nexttime = cur_nscb->timeout;
@ -182,8 +190,9 @@ schedule_run(void)
/* make rettime relative to now and convert to ms */ /* make rettime relative to now and convert to ms */
nexttime = (nexttime - now)*10; nexttime = (nexttime - now)*10;
#ifdef DEBUG_SCHEDULER
LOG(("returning time to next event as %ldms", nexttime )); LOG(("returning time to next event as %ldms", nexttime ));
#endif
/*return next event time in milliseconds (24days max wait) */ /*return next event time in milliseconds (24days max wait) */
return ( nexttime ); return ( nexttime );
} }

View File

@ -101,24 +101,28 @@ touch $dst"cookies"
cp $src"atari/doc" $dst -R cp $src"atari/doc" $dst -R
cp $src"ns.prg" $dst cp $src"ns.prg" $dst
chmod +x $dst"ns.prg" chmod +x $dst"ns.prg"
strip $dst"ns.prg" m68k-atari-mint-strip $dst"ns.prg"
stack -S 256k $dst"ns.prg" m68k-atari-mint-stack -S 256k $dst"ns.prg"
cp $src"atari/res/" $dst -rL cp $src"atari/res/" $dst -rL
cp $src"\!NetSurf/Resources/AdBlock,f79" $dst"res/adblock.css" -rL cp $src"!NetSurf/Resources/AdBlock,f79" $dst"res/adblock.css" -rL
cp $src"\!NetSurf/Resources/CSS,f79" $dst"res/default.css" -rL cp $src"!NetSurf/Resources/CSS,f79" $dst"res/default.css" -rL
cp $src"\!NetSurf/Resources/Quirks,f79" $dst"res/quirks.css" -rL cp $src"!NetSurf/Resources/Quirks,f79" $dst"res/quirks.css" -rL
cp $src"\!NetSurf/Resources/internal.css,f79" $dst"res/internal.css" -rL cp $src"!NetSurf/Resources/internal.css,f79" $dst"res/internal.css" -rL
cp $src"\!NetSurf/Resources/SearchEngines" $dst"res/search" -rL cp $src"!NetSurf/Resources/SearchEngines" $dst"res/search" -rL
cp $src"\!NetSurf/Resources/ca-bundle" $dst"res/cabundle" -rL cp $src"!NetSurf/Resources/ca-bundle" $dst"res/cabundle" -rL
cp $src"\!NetSurf/Resources/en/Messages" $dst"res/messages" -rL cp $src"!NetSurf/Resources/en/Messages" $dst"res/messages" -rL
cp $src"\!NetSurf/Resources/Icons/content.png" $dst"res/icons/content.png" -rL cp $src"!NetSurf/Resources/Icons/content.png" $dst"res/icons/content.png" -rL
cp $src"\!NetSurf/Resources/Icons/directory.png" $dst"res/icons/dir.png" -rL cp $src"!NetSurf/Resources/Icons/directory.png" $dst"res/icons/dir.png" -rL
#remove uneeded files: #remove uneeded files:
rm $dst"res/netsurf.rsm" rm $dst"res/netsurf.rsm"
rm $dst"res/netsurf.rsh" rm $dst"res/netsurf.rsh"
rm $dst"res/.svn" -r
rm $dst"res/icons/.svn" -r
rm $dst"res/fonts/.svn" -r
rm $dst"doc/.svn" -r
rm $dst"download/.svn" -r
if [ "$inc_short_fonts" = "1" ] if [ "$inc_short_fonts" = "1" ]
then then
@ -159,8 +163,8 @@ http_proxy_auth:0
http_proxy_auth_user: http_proxy_auth_user:
http_proxy_auth_pass: http_proxy_auth_pass:
suppress_curl_debug:1 suppress_curl_debug:1
font_size:120 font_size:130
font_min_size:110 font_min_size:120
memory_cache_size:204800 memory_cache_size:204800
block_advertisements:0 block_advertisements:0
minimum_gif_delay:0 minimum_gif_delay:0
@ -177,9 +181,9 @@ hotlist_path:./res/hotlist
incremental_reflow:1 incremental_reflow:1
min_reflow_period:350 min_reflow_period:350
core_select_menu:1 core_select_menu:1
max_fetchers:6 max_fetchers:3
max_fetchers_per_host:2 max_fetchers_per_host:2
max_cached_fetch_handles:6 max_cached_fetch_handles:5
target_blank:1 target_blank:1
suppress_images:0 suppress_images:0
remove_backgrounds:0 remove_backgrounds:0

View File

@ -688,7 +688,7 @@ bool tb_url_input( struct gui_window * gw, short nkc )
else if( ik == KEY_CR || ik == KEY_NL ){ else if( ik == KEY_CR || ik == KEY_NL ){
char tmp_url[PATH_MAX]; char tmp_url[PATH_MAX];
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( gw, BROWSER, gw->browser->bw); window_set_focus( gw, BROWSER, gw->browser);
browser_window_go(gw->browser->bw, (const char*)&tmp_url, 0, true); browser_window_go(gw->browser->bw, (const char*)&tmp_url, 0, true);
ret = true; ret = true;
} }