r12550 mono - in /trunk/netsurf/atari: browser.c browser.h browser_win.c browser_win.h global_evnt.c gui.c gui.h misc.c misc.h osspec.c statusbar.c toolbar.c
by netsurf@semichrome.net
Author: mono
Date: Thu Jun 30 15:20:27 2011
New Revision: 12550
URL: http://source.netsurf-browser.org?rev=12550&view=rev
Log:
removed preparations for frames. (will be handled within the core)
Modified:
trunk/netsurf/atari/browser.c
trunk/netsurf/atari/browser.h
trunk/netsurf/atari/browser_win.c
trunk/netsurf/atari/browser_win.h
trunk/netsurf/atari/global_evnt.c
trunk/netsurf/atari/gui.c
trunk/netsurf/atari/gui.h
trunk/netsurf/atari/misc.c
trunk/netsurf/atari/misc.h
trunk/netsurf/atari/osspec.c
trunk/netsurf/atari/statusbar.c
trunk/netsurf/atari/toolbar.c
Modified: trunk/netsurf/atari/browser.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/browser.c?rev=12550...
==============================================================================
--- trunk/netsurf/atari/browser.c (original)
+++ trunk/netsurf/atari/browser.c Thu Jun 30 15:20:27 2011
@@ -62,11 +62,13 @@
/* create an browser component */
-struct s_browser * browser_create( struct gui_window * gw,
- struct browser_window *bw,
- struct browser_window * clone,
- enum browser_type type,
- int lt, int w, int flex )
+struct s_browser * browser_create
+(
+ struct gui_window * gw,
+ struct browser_window *bw,
+ struct browser_window * clone,
+ int lt, int w, int flex
+)
{
LGRECT cwork;
COMPONENT * scrollv, * scrollh, * drawable;
@@ -80,7 +82,6 @@
if( bnew )
{
memset(bnew, 0, sizeof(struct s_browser) );
- bnew->type = type;
bnew->bw = bw;
bnew->attached = false;
if(clone)
@@ -126,27 +127,13 @@
bool browser_destroy( struct s_browser * b )
{
- short type = BT_ROOT;
- LGRECT restore;
- /* only free the components if it is an root browser,
- this should delete all attached COMPONENTS...
- */
-
- LOG(("%s (%s)\n", b->bw->name, (b->type == BT_ROOT) ? "ROOT" : "FRAME"));
+
+ LOG(("%s\n", b->bw->name ));
assert( b != NULL );
assert( b->comp != NULL );
assert( b->bw != NULL );
- struct gui_window * rootgw = browser_find_root( b->bw->window );
-
- if( b->type == BT_ROOT ) {
-
- } else if( BT_FRAME ){
- type = BT_FRAME;
- } else {
- assert( 1 == 0 );
- }
-
- if( b->compwin != NULL ){
+
+ if( b->compwin != NULL ) {
COMPONENT * old = b->comp;
WINDOW * oldwin = b->compwin;
b->comp = NULL;
@@ -159,10 +146,6 @@
WindDelete( oldwin );
mt_CompDelete(&app, old );
}
-
- if( type == BT_FRAME ) {
- /* TODO: restore the remaining frameset (rebuild???) */
- }
return( true );
}
@@ -185,19 +168,6 @@
mt_CompAttach( &app, container->browser->comp, frame->browser->comp );
browser_update_rects( container );
frame->browser->attached = true;
-}
-
-/* find the root of an frame ( or just return gw if is already the root) */
-struct gui_window * browser_find_root( struct gui_window * gw )
-{
- if( gw->parent == NULL )
- return( gw );
- struct gui_window * g;
- for( g=window_list; g; g=g->next){
- if( g->root == gw->root && g->parent == NULL )
- return( g );
- }
- return( NULL );
}
void browser_get_rect( struct gui_window * gw, enum browser_rect type, LGRECT * out)
@@ -274,13 +244,12 @@
{
struct s_browser * b = (struct s_browser*)data;
struct gui_window * gw = b->bw->window;
- LOG(("%s: %s (%s)\n", __FUNCTION__ ,gw->browser->bw->name, ( gw->browser->type ==BT_FRAME) ? "FRAME" : "NOFRAME"));
-
+ LOG(("%s\n",gw->browser->bw->name));
+
assert( b != NULL );
assert( gw != NULL );
- /* TODO: inspect why this assert fails with frames / iframes
- /* this should have been happened alrdy */
- /* assert( b->comp == NULL ); */
+
+ assert( b->comp == NULL );
free( b );
gw->browser = NULL;
@@ -306,7 +275,7 @@
case WA_RTPAGE:
value = cwork.g_w;
break;
-
+
default:
break;
}
@@ -623,7 +592,7 @@
case 'A':
r = browser_window_key_press(gw->browser->bw, KEY_SELECT_ALL);
break;
-
+
case 'C':
r = browser_window_key_press(gw->browser->bw, KEY_COPY_SELECTION);
break;
@@ -631,14 +600,14 @@
case 'X':
r = browser_window_key_press(gw->browser->bw, KEY_CUT_SELECTION);
break;
-
+
case 'V':
r = browser_window_key_press(gw->browser->bw, KEY_PASTE);
break;
default:
- break;
- }
+ break;
+ }
}
if( (nkc & NKF_SHIFT) != 0 ) {
switch( ascii ) {
@@ -777,26 +746,13 @@
bool browser_redraw_required( struct gui_window * gw)
{
bool ret = true;
- int frames = 0;
CMP_BROWSER b = gw->browser;
if( b->bw->current_content == NULL )
return ( false );
- {
- /* don't do redraws if we have subframes */
- /* iframes will be an special case and must be handled special... */
- struct gui_window * g;
- for( g=window_list; g; g=g->next ) {
- if ( g != gw && g->parent == gw ) {
- if( g->browser->type == BT_FRAME ) {
- frames++;
- }
- }
- }
- }
- ret = ( ((b->redraw.areas_used > 0) && frames == 0)
- || b->scroll.required
+ ret = ( ((b->redraw.areas_used > 0) )
+ || b->scroll.required
|| b->caret.redraw );
return( ret );
}
@@ -1071,34 +1027,41 @@
WINDOW * w;
struct gui_window * gw = (struct gui_window *) data;
CMP_BROWSER b = gw->browser;
- struct gui_window * rgw = browser_find_root( gw );
LGRECT work, lclip, rwork;
+
+ // TODO: maybe implement something like validate_gw()
+ // to fetch spurious redraw events? the function should
+ // traverse all gui_windows and see if gw exists in the list
+
int xoff,yoff,width,heigth;
short cw, ch, cellw, cellh;
/* use that instead of browser_find_root() ? */
w = (WINDOW*)mt_CompGetPtr( &app, c, CF_WINDOW );
browser_get_rect( gw, BR_CONTENT, &work );
- browser_get_rect( rgw, BR_CONTENT, &rwork );
lclip = work;
if ( !rc_lintersect( (LGRECT*)&buff[4], &lclip ) ) return;
-
+
if( b->bw->current_content == NULL )
return;
+
/* convert redraw coords to framebuffer coords: */
lclip.g_x -= work.g_x;
lclip.g_y -= work.g_y;
+
if( lclip.g_x < 0 ) {
lclip.g_w = work.g_w + lclip.g_x;
lclip.g_x = 0;
}
+
if( lclip.g_y < 0 ) {
lclip.g_h = work.g_h + lclip.g_y;
lclip.g_y = 0;
}
- if( lclip.g_h > 0 && lclip.g_w > 0 ) {
- browser_schedule_redraw( gw, lclip.g_x, lclip.g_y,
- lclip.g_x + lclip.g_w, lclip.g_y + lclip.g_h
- );
+
+ if( lclip.g_h > 0 && lclip.g_w > 0 ) {
+ browser_schedule_redraw( gw, lclip.g_x, lclip.g_y,
+ lclip.g_x + lclip.g_w, lclip.g_y + lclip.g_h
+ );
}
return;
Modified: trunk/netsurf/atari/browser.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/browser.h?rev=12550...
==============================================================================
--- trunk/netsurf/atari/browser.h (original)
+++ trunk/netsurf/atari/browser.h Thu Jun 30 15:20:27 2011
@@ -19,32 +19,24 @@
#ifndef NS_ATARI_BROWSER_H
#define NS_ATARI_BROWSER_H
-/*
+/*
Each browser_window in the Atari Port is represented by an struct s_browser,
which cosnist mainly of an WinDom COMPONENT.
-*/
+*/
-/*
+/*
BROWSER_SCROLL_SVAL
- The small scroll inc. value (used by scroll-wheel, arrow click):
+ The small scroll inc. value (used by scroll-wheel, arrow click):
*/
-#define BROWSER_SCROLL_SVAL 64
+#define BROWSER_SCROLL_SVAL 64
-/*
+/*
MAX_REDRW_SLOTS
- This is the number of redraw requests that an browser window can queue.
+ This is the number of redraw requests that an browser window can queue.
If a redraw is scheduled and all slots are used, the rectangle will
be merged to one of the existing slots.
*/
-#define MAX_REDRW_SLOTS 32
-
-enum browser_type
-{
- BT_ROOT=1,
- BT_FRAME=2,
- BT_FRAMESET=3,
- BT_IFRAME=4
-};
+#define MAX_REDRW_SLOTS 32
enum browser_rect
{
@@ -55,10 +47,10 @@
};
-/*
- This struct contains info of current browser viewport scroll
- and the scroll which is requested. If a scroll is requested,
- the field required is set to true.
+/*
+ This struct contains info of current browser viewport scroll
+ and the scroll which is requested. If a scroll is requested,
+ the field required is set to true.
*/
struct s_scroll_info
{
@@ -88,9 +80,9 @@
BBOX area; /* used for clipping of content redraw */
};
-/*
- This is the actual browser widget, containings GUI elements and
- the current state of the browser widget.
+/*
+ This is the actual browser widget, containings GUI elements and
+ the current state of the browser widget.
*/
struct s_browser
{
@@ -104,7 +96,7 @@
bool attached;
};
-struct s_browser * browser_create( struct gui_window * gw, struct browser_window * clone, struct browser_window *bw, enum browser_type, int lt, int w, int flex );
+struct s_browser * browser_create( struct gui_window * gw, struct browser_window * clone, struct browser_window *bw, int lt, int w, int flex );
bool browser_destroy( struct s_browser * b );
void browser_get_rect( struct gui_window * gw, enum browser_rect type, LGRECT * out);
bool browser_input( struct gui_window * gw, unsigned short nkc ) ;
@@ -118,14 +110,14 @@
/*
This queues an redraw to one of the slots.
- The following strategy is used:
+ The following strategy is used:
1. It checks if the rectangle to be scheduled is within one of the
- already queued bboxes. If yes, it will return.
- 2. It checks for an intersection, and it will merge the rectangle to
+ already queued bboxes. If yes, it will return.
+ 2. It checks for an intersection, and it will merge the rectangle to
already queued rectangle where it fits best.
- 3. it tries to put the rectangle into one available slot.
- 4. if no slot is available, it will simply merge the new rectangle with
- the last available slot.
+ 3. it tries to put the rectangle into one available slot.
+ 4. if no slot is available, it will simply merge the new rectangle with
+ the last available slot.
*/
void browser_redraw_caret( struct gui_window * gw, GRECT * area );
static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff );
Modified: trunk/netsurf/atari/browser_win.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/browser_win.c?rev=1...
==============================================================================
--- trunk/netsurf/atari/browser_win.c (original)
+++ trunk/netsurf/atari/browser_win.c Thu Jun 30 15:20:27 2011
@@ -174,13 +174,13 @@
);
}
}
- }
- }
- }
-}
-
-
-static void __CDECL evnt_window_m1( WINDOW * win, short buff[8])
+ }
+ }
+ }
+}
+
+
+static void __CDECL evnt_window_m1( WINDOW * win, short buff[8], void * data)
{
struct gui_window * gw = input_window;
static bool prev_url = false;
@@ -253,7 +253,7 @@
}
}
} else {
- /* set input window? */
+ /* set input window? */
}
}
@@ -267,7 +267,7 @@
sb = (inflags & WIDGET_STATUSBAR);
short w,h, wx, wy, wh, ww;
int flags = CLOSER | MOVER | NAME | FULLER | SMALLER ;
- gw->parent = NULL;
+
gw->root = malloc( sizeof(struct s_gui_win_root) );
if( gw->root == NULL )
return( -1 );
@@ -286,12 +286,12 @@
gw->root->toolbar = tb_create( gw );
assert( gw->root->toolbar );
mt_CompAttach( &app, gw->root->cmproot, gw->root->toolbar->comp );
-
+
} else {
gw->root->toolbar = NULL;
}
- gw->browser = browser_create( gw, bw, NULL, BT_ROOT, CLT_HORIZONTAL, 1, 1 );
+ gw->browser = browser_create( gw, bw, NULL, CLT_HORIZONTAL, 1, 1 );
mt_CompAttach( &app, gw->root->cmproot, gw->browser->comp );
if( sb ) {
@@ -302,28 +302,28 @@
}
WindSetStr(gw->root->handle, WF_ICONTITLE, (char*)"NetSurf");
-
+
/* Event Handlers: */
- EvntDataAttach( gw->root->handle, WM_CLOSED, evnt_window_close, NULL );
+ EvntDataAttach( gw->root->handle, WM_CLOSED, evnt_window_close, gw );
/* capture resize/move events so we can handle that manually */
if( !cfg_rt_resize ) {
- EvntAttach( gw->root->handle, WM_SIZED, evnt_window_resize);
+ EvntDataAttach( gw->root->handle, WM_SIZED, evnt_window_resize, gw );
} else {
- EvntAdd( gw->root->handle, WM_SIZED, evnt_window_rt_resize, EV_BOT );
+ EvntDataAdd( gw->root->handle, WM_SIZED, evnt_window_rt_resize, gw, EV_BOT );
}
if( !cfg_rt_move ) {
- EvntAttach( gw->root->handle, WM_MOVED, evnt_window_move );
+ EvntDataAttach( gw->root->handle, WM_MOVED, evnt_window_move, gw );
} else {
- EvntAdd( gw->root->handle, WM_MOVED, evnt_window_rt_resize, EV_BOT );
- }
- EvntAttach( gw->root->handle, WM_FORCE_MOVE, evnt_window_rt_resize );
+ EvntDataAdd( gw->root->handle, WM_MOVED, evnt_window_rt_resize, gw, EV_BOT );
+ }
+ EvntDataAttach( gw->root->handle, WM_FORCE_MOVE, evnt_window_rt_resize, gw );
EvntDataAttach( gw->root->handle, AP_DRAGDROP, evnt_window_dd, gw );
- EvntDataAdd( gw->root->handle, WM_DESTROY,evnt_window_destroy, NULL, EV_TOP );
- EvntDataAdd( gw->root->handle, WM_ARROWED,evnt_window_arrowed, NULL, EV_TOP );
- EvntDataAdd( gw->root->handle, WM_NEWTOP, evnt_window_newtop, &evnt_data, EV_BOT);
- EvntDataAdd( gw->root->handle, WM_TOPPED, evnt_window_newtop, &evnt_data, EV_BOT);
+ EvntDataAdd( gw->root->handle, WM_DESTROY,evnt_window_destroy, gw, EV_TOP );
+ EvntDataAdd( gw->root->handle, WM_ARROWED,evnt_window_arrowed, gw, EV_TOP );
+ EvntDataAdd( gw->root->handle, WM_NEWTOP, evnt_window_newtop, gw, EV_BOT);
+ EvntDataAdd( gw->root->handle, WM_TOPPED, evnt_window_newtop, gw, EV_BOT);
EvntDataAttach( gw->root->handle, WM_ICONDRAW, evnt_window_icondraw, gw);
- EvntAttach( gw->root->handle, WM_XM1, evnt_window_m1 );
+ EvntDataAttach( gw->root->handle, WM_XM1, evnt_window_m1, gw );
/*
OBJECT * tbut;
@@ -340,13 +340,6 @@
short buff[8];
int err = 0;
- if( gw->browser->type != BT_ROOT ) {
- return(0);
- }
-
- /* test this with frames: */
- /* assert( gw->parent == NULL); */
-
search_destroy( gw );
if( input_window == gw )
@@ -366,7 +359,6 @@
if( gw->browser )
browser_destroy( gw->browser );
-
/* destroy the icon: */
/*window_set_icon(gw, NULL, false );*/
@@ -455,7 +447,7 @@
browser_get_rect( gw, BR_VSLIDER, &rect);
ApplWrite( _AESapid, WM_REDRAW, gw->root->handle->handle,
rect.g_x, rect.g_y, rect.g_w, rect.g_h );
-
+
browser_get_rect( gw, BR_HSLIDER, &rect);
ApplWrite( _AESapid, WM_REDRAW, gw->root->handle->handle,
rect.g_x, rect.g_y, rect.g_w, rect.g_h );
@@ -633,8 +625,8 @@
}
}
}
-error:
- ddclose( dd_hdl);
+error:
+ ddclose( dd_hdl);
}
/* -------------------------------------------------------------------------- */
@@ -650,7 +642,7 @@
static void __CDECL evnt_window_close( WINDOW *win, short buff[8], void *data )
{
- struct gui_window * gw = find_root_gui_window( win );
+ struct gui_window * gw = (struct gui_window *) data ;
if( gw != NULL ) {
browser_window_destroy( gw->browser->bw );
}
@@ -659,7 +651,7 @@
static void __CDECL evnt_window_newtop( WINDOW *win, short buff[8], void *data )
{
- input_window = find_root_gui_window( win );
+ input_window = (struct gui_window *) data;
LOG(("newtop: iw: %p, win: %p", input_window, win ));
assert( input_window != NULL );
@@ -684,7 +676,7 @@
WindClear( win);
WindGet( win, WF_WORKXYWH, &x, &y, &w, &h);
-
+
if( has_favicon == false ) {
OBJECT * tree;
RsrcGaddr( h_gem_rsrc, R_TREE, ICONIFY , &tree );
@@ -696,7 +688,7 @@
}
}
-static void __CDECL evnt_window_move( WINDOW *win, short buff[8] )
+static void __CDECL evnt_window_move( WINDOW *win, short buff[8], void * data )
{
short mx,my, mb, ks;
short wx, wy, wh, ww, nx, ny;
@@ -704,7 +696,7 @@
short xoff, yoff;
if( cfg_rt_move ) {
std_mvd( win, buff, &app );
- evnt_window_rt_resize( win, buff );
+ evnt_window_rt_resize( win, buff, data );
} else {
wind_get( win->handle, WF_CURRXYWH, &wx, &wy, &ww, &wh );
if( graf_dragbox( ww, wh, wx, wy, app.x-ww, app.y, app.w+ww, app.h+wh, &nx, &ny )){
@@ -713,12 +705,12 @@
buff[6] = ww;
buff[7] = wh;
std_mvd( win, buff, &app );
- evnt_window_rt_resize( win, buff );
- }
- }
-}
-
-void __CDECL evnt_window_resize( WINDOW *win, short buff[8] )
+ evnt_window_rt_resize( win, buff, data );
+ }
+ }
+}
+
+void __CDECL evnt_window_resize( WINDOW *win, short buff[8], void * data )
{
short mx,my, mb, ks;
short wx, wy, wh, ww, nw, nh;
@@ -726,7 +718,7 @@
graf_mkstate( &mx, &my, &mb, &ks );
if( cfg_rt_resize ) {
std_szd( win, buff, &app );
- evnt_window_rt_resize( win, buff );
+ evnt_window_rt_resize( win, buff, data );
} else {
wind_get( win->handle, WF_CURRXYWH, &wx, &wy, &ww, &wh );
r = graf_rubberbox(wx, wy, 20, 20, &nw, &nh);
@@ -737,26 +729,26 @@
buff[6] = nw;
buff[7] = nh;
std_szd( win, buff, &app );
- evnt_window_rt_resize( win, buff );
+ evnt_window_rt_resize( win, buff, data );
}
}
/* perform the actual resize */
-static void __CDECL evnt_window_rt_resize( WINDOW *win, short buff[8] )
+static void __CDECL evnt_window_rt_resize( WINDOW *win, short buff[8], void * data )
{
short x,y,w,h;
struct gui_window * gw;
LGRECT rect;
bool resized;
bool moved;
-
+
if(buff[0] == WM_FORCE_MOVE ) {
std_mvd(win, buff, &app);
std_szd(win, buff, &app);
}
wind_get( win->handle, WF_WORKXYWH, &x, &y, &w, &h );
- gw = find_root_gui_window( win );
+ gw = (struct gui_window *)data;
assert( gw != NULL );
Modified: trunk/netsurf/atari/browser_win.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/browser_win.h?rev=1...
==============================================================================
--- trunk/netsurf/atari/browser_win.h (original)
+++ trunk/netsurf/atari/browser_win.h Thu Jun 30 15:20:27 2011
@@ -66,18 +66,18 @@
/* -------------------------------------------------------------------------- */
/* Static module methods follow here: */
/* -------------------------------------------------------------------------- */
-static void evnt_toolbar_click(WINDOW * win, short buf[8]);
+static void evnt_toolbar_click(WINDOW * win, short buf[8], void * data);
static void __CDECL evnt_window_redraw( WINDOW *win, short buff[8], void *data );
static void __CDECL evnt_window_icondraw( WINDOW *win, short buff[8], void *data );
static void __CDECL evnt_window_newtop( WINDOW *win, short buff[8], void *data );
-void __CDECL evnt_window_resize( WINDOW *win, short buff[8] );
-static void __CDECL evnt_window_move( WINDOW *win, short buff[8] );
-static void __CDECL evnt_window_rt_resize( WINDOW *win, short buff[8] );
+void __CDECL evnt_window_resize( WINDOW *win, short buff[8], void * data );
+static void __CDECL evnt_window_move( WINDOW *win, short buff[8], void * data );
+static void __CDECL evnt_window_rt_resize( WINDOW *win, short buff[8], void * date );
static void __CDECL evnt_window_close( WINDOW *win, short buff[8], void *data );
static void __CDECL evnt_window_dd( WINDOW *win, short wbuff[8], void * data ) ;
static void __CDECL evnt_window_destroy( WINDOW *win, short buff[8], void *data );
static void __CDECL evnt_window_keybd(WINDOW *win, short buff[8], void *data );
static void __CDECL evnt_window_mbutton(WINDOW *win, short buff[8], void *data );
-static void __CDECL evnt_window_m1( WINDOW * win, short buff[8]);
+static void __CDECL evnt_window_m1( WINDOW * win, short buff[8], void * data);
#endif
Modified: trunk/netsurf/atari/global_evnt.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/global_evnt.c?rev=1...
==============================================================================
--- trunk/netsurf/atari/global_evnt.c (original)
+++ trunk/netsurf/atari/global_evnt.c Thu Jun 30 15:20:27 2011
@@ -326,7 +326,7 @@
kstate |= K_LSHIFT|K_RSHIFT;
if( window_url_widget_has_focus( gw ) ) {
/* make sure we report for the root window and report...: */
- done = tb_url_input( browser_find_root(gw), nkc );
+ done = tb_url_input( gw, nkc );
if( done ) return;
} else {
gw_tmp = window_list;
Modified: trunk/netsurf/atari/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/gui.c?rev=12550&r1=...
==============================================================================
--- trunk/netsurf/atari/gui.c (original)
+++ trunk/netsurf/atari/gui.c Thu Jun 30 15:20:27 2011
@@ -207,34 +207,28 @@
}
break;
+/*
case BROWSER_WINDOW_FRAME:
gwroot = bw->parent->window;
LOG(("create frame: %p, clone: %p\n", bw, clone));
- gw->parent = gwroot;
gw->root = gwroot->root;
- gw->browser = browser_create( gw, bw, clone, BT_FRAME, CLT_VERTICAL, 1, 1);
- /*browser_attach_frame( gwroot, gw );*/
+ gw->browser = browser_create( gw, bw, clone, CLT_VERTICAL, 1, 1);
break;
case BROWSER_WINDOW_FRAMESET:
LOG(("frameset: %p, clone: %p\n", bw, clone));
gwroot = bw->parent->window;
- gw->parent = gwroot;
gw->root = gwroot->root;
- gw->browser = browser_create( gw, bw, clone, BT_FRAME, CLT_VERTICAL, 1, 1);
- /*browser_attach_frame( gwroot, gw );*/
+ gw->browser = browser_create( gw, bw, clone, CLT_VERTICAL, 1, 1);
break;
case BROWSER_WINDOW_IFRAME:
LOG(("iframe: %p, clone: %p\n", bw, clone));
- /* just dummy code here! */
gwroot = bw->parent->window;
- gw->parent = gwroot;
gw->root = bw->parent->window->root;
- gw->browser = browser_create( gw, bw, NULL, BT_FRAME, CLT_VERTICAL, 1, 1);
- /*browser_attach_frame( gwroot, gw );*/
- break;
-
+ gw->browser = browser_create( gw, bw, NULL, CLT_VERTICAL, 1, 1);
+ break;
+*/
default:
LOG(("unhandled type!"));
}
@@ -267,13 +261,13 @@
input_window = NULL;
- LGRECT dbg;
- struct gui_window * root = browser_find_root( w );
- browser_get_rect( root, BR_CONTENT, &dbg );
switch(w->browser->bw->browser_window_type) {
+
case BROWSER_WINDOW_NORMAL:
window_destroy( w );
break;
+
+/*
case BROWSER_WINDOW_FRAME:
browser_destroy( w->browser );
break;
@@ -283,10 +277,9 @@
break;
case BROWSER_WINDOW_IFRAME:
- /* just dummy code here: */
window_destroy( w );
break;
-
+*/
default:
LOG(("Unhandled type!"));
assert( 1 == 0 );
@@ -323,8 +316,7 @@
{
if (gw == NULL)
return;
- /* TODO: query AES for max. title length */
- if( gw->root && gw->parent == NULL ){
+ if( gw->root ){
strncpy(gw->root->title, title, atari_sysinfo.aes_max_win_title_len);
gw->root->title[atari_sysinfo.aes_max_win_title_len] = 0;
WindSetStr( gw->root->handle, WF_NAME, gw->root->title );
@@ -417,8 +409,8 @@
LGRECT pardim;
int width = x1 - x0 + 2, height = y1 - y0 + 2;
/* get available width/height: */
- if( gw->parent ) {
- browser_get_rect( gw->parent, BR_CONTENT, &pardim );
+ if( gw ) {
+ browser_get_rect( gw, BR_CONTENT, &pardim );
LOG(("posframe %s: x0,y0: %d/%d, x1,y1: %d/%d, w: %d, h: %d \n",gw->browser->bw->name, x0,y0, x1,y1, width, height));
}
}
@@ -923,9 +915,7 @@
while( gw ) {
tmp = gw->next;
- if( gw->parent == NULL ) {
- browser_window_destroy(gw->browser->bw);
- }
+ browser_window_destroy(gw->browser->bw);
gw = tmp;
}
Modified: trunk/netsurf/atari/gui.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/gui.h?rev=12550&r1=...
==============================================================================
--- trunk/netsurf/atari/gui.h (original)
+++ trunk/netsurf/atari/gui.h Thu Jun 30 15:20:27 2011
@@ -81,20 +81,10 @@
void * element;
};
-/*
-struct s_gui_input_state {
- short mbut;
- short mkstat;
- short mx;
- short my;
- browser_mouse_state bms;
-} prev_inp_state;
-*/
-
/* defines for data attached to components: */
-#define CDT_OBJECT 0x004f424aUL
-#define CDT_OWNER 0x03UL
-#define CDT_ICON 0x04UL
+#define CDT_OBJECT 0x004f424aUL
+#define CDT_OWNER 0x03UL
+#define CDT_ICON 0x04UL
#define CDT_ICON_TYPE 0x05UL
@@ -107,10 +97,10 @@
typedef struct s_statusbar * CMP_STATUSBAR;
typedef struct s_browser * CMP_BROWSER;
-/*
- This is the "main" window. It can consist of several components
+/*
+ This is the "main" window. It can consist of several components
and also holds information shared by several frames within
- the window. Each frame, no matter how deep nested,
+ the window. Each frame, no matter how deep nested,
knows about it's root (GEM window).
*/
struct s_gui_win_root
@@ -127,17 +117,16 @@
GRECT loc; /* current size of window on screen */
};
-/*
- This is the part of the gui which is known by netsurf core.
- You must implement it. Altough, you are free how to do it.
- Each of the browser "viewports" managed by netsurf are bound
- to this structure. gui_window does not mean that it is an
- comple window - also frames own an gui_window.
+/*
+ This is the part of the gui which is known by netsurf core.
+ You must implement it. Altough, you are free how to do it.
+ Each of the browser "viewports" managed by netsurf are bound
+ to this structure. gui_window does not mean that it is an
+ comple window - also frames own an gui_window.
*/
struct gui_window {
struct s_gui_win_root * root;
CMP_BROWSER browser;
- struct gui_window * parent;
struct gui_window *next, *prev;
};
Modified: trunk/netsurf/atari/misc.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/misc.c?rev=12550&r1...
==============================================================================
--- trunk/netsurf/atari/misc.c (original)
+++ trunk/netsurf/atari/misc.c Thu Jun 30 15:20:27 2011
@@ -100,22 +100,6 @@
return true;
}
-#define IS_TOPLEVEL_BROWSER_WIN( gw ) (gw->root->handle == win && gw->parent == NULL )
-struct gui_window * find_root_gui_window( WINDOW * win )
-{
-
- struct gui_window * gw;
- gw = window_list;
- while( gw != NULL ) {
- if( IS_TOPLEVEL_BROWSER_WIN( gw ) ) {
- return( gw );
- }
- else
- gw = gw->next;
- }
- return( NULL );
-}
-
struct gui_window * find_cmp_window( COMPONENT * c )
{
Modified: trunk/netsurf/atari/misc.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/misc.h?rev=12550&r1...
==============================================================================
--- trunk/netsurf/atari/misc.h (original)
+++ trunk/netsurf/atari/misc.h Thu Jun 30 15:20:27 2011
@@ -30,7 +30,6 @@
lbuf[7] = (long)sbuf[7];
-struct gui_window * find_root_gui_window( WINDOW * win );
struct gui_window * find_cmp_window( COMPONENT * c );
OBJECT *get_tree( int idx );
char *get_rsc_string( int idx );
@@ -39,4 +38,4 @@
void * ldg_open( char * name, short * global );
void * ldg_find( char * name, short * ldg );
int ldg_close( void * ldg, short * global );
-#endif
+#endif
Modified: trunk/netsurf/atari/osspec.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/osspec.c?rev=12550&...
==============================================================================
--- trunk/netsurf/atari/osspec.c (original)
+++ trunk/netsurf/atari/osspec.c Thu Jun 30 15:20:27 2011
@@ -189,47 +189,3 @@
return( rpath );
}
-char * gemdos_realpathX(const char * path, char * rpath)
-{
- size_t l;
- size_t i;
- char old = '/';
- char fsep = 0x5C;
- if( rpath == NULL ){
- return( NULL );
- }
- if( sys_type() & SYS_MINT ){
- return( realpath(path, rpath) );
- }
-
- if( path[0] != '/' && path[0] != 0x5c && path[1] != ':') {
- /* it is not an absolute path */
- char cwd[PATH_MAX];
- getcwd((char*)&cwd, PATH_MAX);
- //fix_path((char*)&cwd);
- strcpy(rpath, (char*)&cwd);
- l = strlen(rpath);
- /* append path seperator if needed: */
- if(rpath[l-1] != 0x5C && rpath[l-1] != '/') {
- rpath[l] = fsep;
- rpath[l+1] = 0;
- }
- /* check if path is starting with: ./ */
- if( (path[1] == '/' || path[1] == 0x5C ) ) {
- strcat(rpath, &path[2]);
- } else {
- /* otherwise just append it */
- strcat(rpath, path);
- }
- } else {
- strcpy(rpath, path);
- }
- /* convert path seperator to configured value: */
- l = strlen(rpath);
- for( i = 0; i<l-1; i++){
- if( rpath[i] == old ){
- rpath[i] = fsep;
- }
- }
- return( rpath );
-}
Modified: trunk/netsurf/atari/statusbar.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/statusbar.c?rev=125...
==============================================================================
--- trunk/netsurf/atari/statusbar.c (original)
+++ trunk/netsurf/atari/statusbar.c Thu Jun 30 15:20:27 2011
@@ -169,7 +169,7 @@
sbuff[5] = g->root->loc.g_y;
sbuff[6] = g->root->loc.g_w;
sbuff[7] = g->root->loc.g_h;
- evnt_window_resize( g->root->handle, sbuff );
+ evnt_window_resize( g->root->handle, sbuff, g );
}
}
}
Modified: trunk/netsurf/atari/toolbar.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/toolbar.c?rev=12550...
==============================================================================
--- trunk/netsurf/atari/toolbar.c (original)
+++ trunk/netsurf/atari/toolbar.c Thu Jun 30 15:20:27 2011
@@ -624,8 +624,6 @@
char code = (nkc & 0xFF);
assert( gw != NULL );
- /* make sure we navigate within the root window on enter: */
- assert( gw->parent == NULL );
if( (code == NK_LEFT) && !shift ){
/* TODO: recognize shift + click */