|
|
|
@ -86,18 +86,18 @@ OBJECT * h_gem_menu;
|
|
|
|
|
OBJECT **rsc_trindex;
|
|
|
|
|
short vdih;
|
|
|
|
|
short rsc_ntree;
|
|
|
|
|
long next_poll;
|
|
|
|
|
long next_poll;
|
|
|
|
|
bool rendering = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Comandline / Options: */
|
|
|
|
|
int cfg_width;
|
|
|
|
|
int cfg_height;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Defaults to option_homepage_url, commandline options overwrites that value */
|
|
|
|
|
const char * cfg_homepage_url;
|
|
|
|
|
|
|
|
|
|
/* path to choices file: */
|
|
|
|
|
|
|
|
|
|
/* path to choices file: */
|
|
|
|
|
char options[PATH_MAX];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -108,47 +108,47 @@ void gui_poll(bool active)
|
|
|
|
|
int flags = MU_MESAG | MU_KEYBD | MU_BUTTON ;
|
|
|
|
|
short mx, my, dummy;
|
|
|
|
|
short aestop;
|
|
|
|
|
|
|
|
|
|
evnt.timer = schedule_run();
|
|
|
|
|
|
|
|
|
|
evnt.timer = schedule_run();
|
|
|
|
|
|
|
|
|
|
if( active || rendering ) {
|
|
|
|
|
if( clock() >= next_poll ) {
|
|
|
|
|
if( clock() >= next_poll ) {
|
|
|
|
|
evnt.timer = 0;
|
|
|
|
|
flags |= MU_TIMER;
|
|
|
|
|
EvntWindom( flags );
|
|
|
|
|
next_poll = clock() + (CLOCKS_PER_SEC>>2);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if( input_window != NULL ){
|
|
|
|
|
} else {
|
|
|
|
|
if( input_window != NULL ){
|
|
|
|
|
wind_get( 0, WF_TOP, &aestop, &winloc[1], &winloc[2], &winloc[3]);
|
|
|
|
|
if( winloc[1] == _AESapid ){
|
|
|
|
|
/* only check for mouse move when netsurf is on top: */
|
|
|
|
|
// move that into m1 event handler
|
|
|
|
|
graf_mkstate( &mx, &my, &dummy, &dummy );
|
|
|
|
|
flags |= MU_M1;
|
|
|
|
|
evnt.m1_flag = MO_LEAVE;
|
|
|
|
|
evnt.m1_w = evnt.m1_h = 1;
|
|
|
|
|
evnt.m1_x = mx;
|
|
|
|
|
evnt.m1_y = my;
|
|
|
|
|
if( winloc[1] == _AESapid ){
|
|
|
|
|
/* only check for mouse move when netsurf is on top: */
|
|
|
|
|
// move that into m1 event handler
|
|
|
|
|
graf_mkstate( &mx, &my, &dummy, &dummy );
|
|
|
|
|
flags |= MU_M1;
|
|
|
|
|
evnt.m1_flag = MO_LEAVE;
|
|
|
|
|
evnt.m1_w = evnt.m1_h = 1;
|
|
|
|
|
evnt.m1_x = mx;
|
|
|
|
|
evnt.m1_y = my;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
flags |= MU_TIMER;
|
|
|
|
|
EvntWindom( flags );
|
|
|
|
|
EvntWindom( flags );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct gui_window * g;
|
|
|
|
|
for( g = window_list; g != NULL; g=g->next ) {
|
|
|
|
|
if( browser_redraw_required( g ) ){
|
|
|
|
|
browser_redraw( g );
|
|
|
|
|
}
|
|
|
|
|
if( g->root->toolbar ){
|
|
|
|
|
if(g->root->toolbar->url.redraw ){
|
|
|
|
|
tb_url_redraw( g );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if( g->root->toolbar ){
|
|
|
|
|
if(g->root->toolbar->url.redraw ){
|
|
|
|
|
tb_url_redraw( g );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if( evnt.timer != 0 && !active ){
|
|
|
|
|
/* this suits for stuff with lower priority */
|
|
|
|
|
/* this suits for stuff with lower priority */
|
|
|
|
|
/* TBD: really be spare on redraws??? */
|
|
|
|
|
atari_treeview_redraw( hl.tv );
|
|
|
|
|
}
|
|
|
|
@ -171,10 +171,10 @@ gui_create_browser_window(struct browser_window *bw,
|
|
|
|
|
|
|
|
|
|
LOG(("new window: %p, bw: %p\n", gw, bw));
|
|
|
|
|
window_create(gw, bw, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE|WIDGET_SCROLL );
|
|
|
|
|
if( gw->root->handle ) {
|
|
|
|
|
GRECT pos = {
|
|
|
|
|
app.w/2-(cfg_width/2), (app.h/2)-(cfg_height/2)+16,
|
|
|
|
|
cfg_width, cfg_height
|
|
|
|
|
if( gw->root->handle ) {
|
|
|
|
|
GRECT pos = {
|
|
|
|
|
app.w/2-(cfg_width/2), (app.h/2)-(cfg_height/2)+16,
|
|
|
|
|
cfg_width, cfg_height
|
|
|
|
|
};
|
|
|
|
|
window_open( gw , pos );
|
|
|
|
|
/* Recalculate windows browser area now */
|
|
|
|
@ -272,31 +272,31 @@ void gui_window_set_title(struct gui_window *gw, const char *title)
|
|
|
|
|
*/
|
|
|
|
|
void gui_window_set_status(struct gui_window *w, const char *text)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
static char * msg_done = NULL;
|
|
|
|
|
static char * msg_loading = NULL;
|
|
|
|
|
static char * msg_fetch = NULL;
|
|
|
|
|
|
|
|
|
|
if( msg_done == NULL ){
|
|
|
|
|
msg_done = messages_get("Done");
|
|
|
|
|
msg_loading = messages_get("Loading");
|
|
|
|
|
msg_fetch = messages_get("Fetch");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( strncmp(msg_done, text, 4) == 0 ){
|
|
|
|
|
rendering = false;
|
|
|
|
|
} else {
|
|
|
|
|
if( !rendering
|
|
|
|
|
&&
|
|
|
|
|
(
|
|
|
|
|
strncmp(msg_loading, text, 4) == 0 ||
|
|
|
|
|
strncmp(msg_fetch, text, 4) == 0)) {
|
|
|
|
|
rendering = true;
|
|
|
|
|
}
|
|
|
|
|
static char * msg_done = NULL;
|
|
|
|
|
static char * msg_loading = NULL;
|
|
|
|
|
static char * msg_fetch = NULL;
|
|
|
|
|
|
|
|
|
|
if( msg_done == NULL ){
|
|
|
|
|
msg_done = messages_get("Done");
|
|
|
|
|
msg_loading = messages_get("Loading");
|
|
|
|
|
msg_fetch = messages_get("Fetch");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if( strncmp(msg_done, text, 4) == 0 ){
|
|
|
|
|
rendering = false;
|
|
|
|
|
} else {
|
|
|
|
|
if( !rendering
|
|
|
|
|
&&
|
|
|
|
|
(
|
|
|
|
|
strncmp(msg_loading, text, 4) == 0 ||
|
|
|
|
|
strncmp(msg_fetch, text, 4) == 0)) {
|
|
|
|
|
rendering = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (w == NULL || text == NULL )
|
|
|
|
|
return;
|
|
|
|
|
window_set_stauts( w , (char*)text );
|
|
|
|
|
window_set_stauts( w , (char*)text );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gui_window_redraw_window(struct gui_window *gw)
|
|
|
|
@ -306,7 +306,7 @@ void gui_window_redraw_window(struct gui_window *gw)
|
|
|
|
|
if (gw == NULL)
|
|
|
|
|
return;
|
|
|
|
|
b = gw->browser;
|
|
|
|
|
browser_get_rect( gw, BR_CONTENT, &rect );
|
|
|
|
|
browser_get_rect( gw, BR_CONTENT, &rect );
|
|
|
|
|
browser_schedule_redraw( gw, 0, 0, rect.g_w, rect.g_h );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -321,7 +321,7 @@ void gui_window_update_box(struct gui_window *gw, const struct rect *rect)
|
|
|
|
|
int y0 = rect->y0 - b->scroll.current.y;
|
|
|
|
|
int w,h;
|
|
|
|
|
w = rect->x1 - rect->x0;
|
|
|
|
|
h = rect->y1 - rect->y0;
|
|
|
|
|
h = rect->y1 - rect->y0;
|
|
|
|
|
browser_schedule_redraw_rect( gw, x0, y0, w,h);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -362,7 +362,7 @@ void gui_window_set_scroll(struct gui_window *w, int sx, int sy)
|
|
|
|
|
void gui_window_scroll_visible(struct gui_window *w, int x0, int y0, int x1, int y1)
|
|
|
|
|
{
|
|
|
|
|
LOG(("%s:(%p, %d, %d, %d, %d)", __func__, w, x0, y0, x1, y1));
|
|
|
|
|
gui_window_set_scroll(w,x0,y0);
|
|
|
|
|
gui_window_set_scroll(w,x0,y0);
|
|
|
|
|
browser_schedule_redraw_rect( w, 0, 0, x1-x0,y1-y0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -503,8 +503,8 @@ void gui_window_start_throbber(struct gui_window *w)
|
|
|
|
|
{
|
|
|
|
|
LGRECT work;
|
|
|
|
|
if (w == NULL)
|
|
|
|
|
return;
|
|
|
|
|
if( w->root->toolbar->throbber.running == true )
|
|
|
|
|
return;
|
|
|
|
|
if( w->root->toolbar->throbber.running == true )
|
|
|
|
|
return;
|
|
|
|
|
mt_CompGetLGrect(&app, w->root->toolbar->throbber.comp,
|
|
|
|
|
WF_WORKXYWH, &work);
|
|
|
|
@ -519,11 +519,11 @@ void gui_window_stop_throbber(struct gui_window *w)
|
|
|
|
|
{
|
|
|
|
|
LGRECT work;
|
|
|
|
|
if (w == NULL)
|
|
|
|
|
return;
|
|
|
|
|
if( w->root->toolbar->throbber.running == false )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
schedule_remove(throbber_advance, w);
|
|
|
|
|
return;
|
|
|
|
|
if( w->root->toolbar->throbber.running == false )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
schedule_remove(throbber_advance, w);
|
|
|
|
|
|
|
|
|
|
mt_CompGetLGrect(&app, w->root->toolbar->throbber.comp,
|
|
|
|
|
WF_WORKXYWH, &work);
|
|
|
|
@ -532,7 +532,7 @@ void gui_window_stop_throbber(struct gui_window *w)
|
|
|
|
|
work.g_x, work.g_y, work.g_w, work.g_h );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Place caret in window */
|
|
|
|
|
/* Place caret in window */
|
|
|
|
|
void gui_window_place_caret(struct gui_window *w, int x, int y, int height)
|
|
|
|
|
{
|
|
|
|
|
if (w == NULL)
|
|
|
|
@ -540,7 +540,7 @@ void gui_window_place_caret(struct gui_window *w, int x, int y, int height)
|
|
|
|
|
if( w->browser->caret.current.g_w > 0 )
|
|
|
|
|
gui_window_remove_caret( w );
|
|
|
|
|
w->browser->caret.requested.g_x = x;
|
|
|
|
|
w->browser->caret.requested.g_y = y;
|
|
|
|
|
w->browser->caret.requested.g_y = y;
|
|
|
|
|
w->browser->caret.requested.g_w = 1;
|
|
|
|
|
w->browser->caret.requested.g_h = height;
|
|
|
|
|
w->browser->caret.redraw = true;
|
|
|
|
@ -550,19 +550,19 @@ void gui_window_place_caret(struct gui_window *w, int x, int y, int height)
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* clear window caret
|
|
|
|
|
*/
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
gui_window_remove_caret(struct gui_window *w)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
if (w == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if( w->browser->caret.background.fd_addr != NULL ){
|
|
|
|
|
browser_restore_caret_background( w, NULL );
|
|
|
|
|
w->browser->caret.requested.g_w = 0;
|
|
|
|
|
w->browser->caret.current.g_w = 0;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if( w->browser->caret.background.fd_addr != NULL ){
|
|
|
|
|
browser_restore_caret_background( w, NULL );
|
|
|
|
|
w->browser->caret.requested.g_w = 0;
|
|
|
|
|
w->browser->caret.current.g_w = 0;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@ -594,7 +594,7 @@ bool gui_window_scroll_start(struct gui_window *w)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool gui_window_drag_start(struct gui_window *g, gui_drag_type type,
|
|
|
|
|
struct rect *rect)
|
|
|
|
|
const struct rect *rect)
|
|
|
|
|
{
|
|
|
|
|
TODO();
|
|
|
|
|
return true;
|
|
|
|
@ -806,7 +806,7 @@ void gui_cert_verify(const char *url, const struct ssl_cert_info *certs,
|
|
|
|
|
/*bres = verify_ssl_form_do(url, certs, num);
|
|
|
|
|
if( bres )
|
|
|
|
|
urldb_set_cert_permissions(url, true);
|
|
|
|
|
*/
|
|
|
|
|
*/
|
|
|
|
|
// TODO: localize string
|
|
|
|
|
int b = form_alert(1, "[2][SSL Verify failed, continue?][Continue|Abort]");
|
|
|
|
|
bres = (b==1)? true : false;
|
|
|
|
@ -861,14 +861,14 @@ process_cmdline(int argc, char** argv)
|
|
|
|
|
if ((option_window_width != 0) && (option_window_height != 0)) {
|
|
|
|
|
cfg_width = option_window_width;
|
|
|
|
|
cfg_height = option_window_height;
|
|
|
|
|
} else {
|
|
|
|
|
if( sys_type() == SYS_TOS ){
|
|
|
|
|
/* on single tasking OS, start as fulled window: */
|
|
|
|
|
} else {
|
|
|
|
|
if( sys_type() == SYS_TOS ){
|
|
|
|
|
/* on single tasking OS, start as fulled window: */
|
|
|
|
|
cfg_width = app.w;
|
|
|
|
|
cfg_height = app.h;
|
|
|
|
|
cfg_height = app.h;
|
|
|
|
|
} else {
|
|
|
|
|
cfg_width = 600;
|
|
|
|
|
cfg_height = 360;
|
|
|
|
|
cfg_height = 360;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1028,7 +1028,7 @@ int main(int argc, char** argv)
|
|
|
|
|
browser_window_create(cfg_homepage_url, 0, 0, true, false);
|
|
|
|
|
graf_mouse( ARROW , NULL);
|
|
|
|
|
netsurf_main_loop();
|
|
|
|
|
netsurf_exit();
|
|
|
|
|
netsurf_exit();
|
|
|
|
|
LOG(("ApplExit"));
|
|
|
|
|
ApplExit();
|
|
|
|
|
#ifdef WITH_DBG_LOGFILE
|
|
|
|
|