Open window by configured width,

removed unused variables

svn path=/trunk/netsurf/; revision=13212
This commit is contained in:
Ole Loots 2011-11-30 23:08:21 +00:00
parent 9efb276f97
commit b20f47262b
5 changed files with 17 additions and 31 deletions

View File

@ -91,9 +91,6 @@ struct s_browser * browser_create
int lt, int w, int flex int lt, int w, int flex
) )
{ {
LGRECT cwork;
COMPONENT * scrollv, * scrollh, * drawable;
CMP_BROWSER bnew = (CMP_BROWSER)malloc( sizeof(struct s_browser) ); CMP_BROWSER bnew = (CMP_BROWSER)malloc( sizeof(struct s_browser) );
if( bnew ) if( bnew )
{ {
@ -177,7 +174,6 @@ void browser_get_rect( struct gui_window * gw, enum browser_rect type, LGRECT *
void browser_update_rects(struct gui_window * gw ) void browser_update_rects(struct gui_window * gw )
{ {
short buff[8]; short buff[8];
LGRECT cmprect;
mt_WindGetGrect( &app, gw->root->handle, WF_CURRXYWH, (GRECT*)&buff[4]); mt_WindGetGrect( &app, gw->root->handle, WF_CURRXYWH, (GRECT*)&buff[4]);
buff[0] = CM_REFLOW; buff[0] = CM_REFLOW;
buff[1] = _AESapid; buff[1] = _AESapid;
@ -223,7 +219,6 @@ static void __CDECL browser_evnt_destroy( COMPONENT * c, long buff[8], void * da
static void __CDECL browser_evnt_mbutton( COMPONENT * c, long buff[8], void * data) static void __CDECL browser_evnt_mbutton( COMPONENT * c, long buff[8], void * data)
{ {
long lbuff[8];
short mx, my, dummy, mbut; short mx, my, dummy, mbut;
uint32_t tnow = clock()*1000 / CLOCKS_PER_SEC; uint32_t tnow = clock()*1000 / CLOCKS_PER_SEC;
LGRECT cwork; LGRECT cwork;
@ -597,8 +592,6 @@ void browser_schedule_redraw(struct gui_window * gw, short x0, short y0, short x
{ {
assert( gw != NULL ); assert( gw != NULL );
CMP_BROWSER b = gw->browser; CMP_BROWSER b = gw->browser;
int i;
struct rect area;
LGRECT work; LGRECT work;
if( y1 < 0 || x1 < 0 ) if( y1 < 0 || x1 < 0 )
@ -618,7 +611,6 @@ void browser_schedule_redraw(struct gui_window * gw, short x0, short y0, short x
static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff, static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff,
struct rect * area ) struct rect * area )
{ {
LGRECT work;
CMP_BROWSER b = gw->browser; CMP_BROWSER b = gw->browser;
struct redraw_context ctx = { struct redraw_context ctx = {
@ -839,7 +831,6 @@ void browser_redraw( struct gui_window * gw )
static void __CDECL browser_evnt_redraw( COMPONENT * c, long buff[8], void * data) static void __CDECL browser_evnt_redraw( COMPONENT * c, long buff[8], void * data)
{ {
short pxy[8];
struct gui_window * gw = (struct gui_window *) data; struct gui_window * gw = (struct gui_window *) data;
CMP_BROWSER b = gw->browser; CMP_BROWSER b = gw->browser;
LGRECT work, lclip; LGRECT work, lclip;

View File

@ -163,14 +163,12 @@ static void window_track_mouse_state( LGRECT * bwrect, bool within, short mx, sh
} }
} }
int window_create( struct gui_window * gw, struct browser_window * bw, unsigned long inflags) int window_create( struct gui_window * gw,
struct browser_window * bw,
unsigned long inflags )
{ {
short buff[8];
OBJECT * tbtree;
int err = 0; int err = 0;
bool tb, sb; bool tb, sb;
short sc;
short w,h, wx, wy, wh, ww;
int flags; int flags;
tb = (inflags & WIDGET_TOOLBAR ); tb = (inflags & WIDGET_TOOLBAR );
@ -255,7 +253,6 @@ int window_create( struct gui_window * gw, struct browser_window * bw, unsigned
int window_destroy( struct gui_window * gw) int window_destroy( struct gui_window * gw)
{ {
short buff[8];
int err = 0; int err = 0;
search_destroy( gw ); search_destroy( gw );
@ -294,12 +291,11 @@ int window_destroy( struct gui_window * gw)
void window_open( struct gui_window * gw) void window_open( struct gui_window * gw, GRECT pos )
{ {
LGRECT br; LGRECT br;
GRECT dim;
WindOpen(gw->root->handle, 20, 20, app.w/2, app.h/2 ); WindOpen(gw->root->handle, pos.g_x, pos.g_y, pos.g_w, pos.g_h );
WindClear( gw->root->handle ); WindClear( gw->root->handle );
WindSetStr( gw->root->handle, WF_NAME, (char *)"" ); WindSetStr( gw->root->handle, WF_NAME, (char *)"" );
@ -642,7 +638,6 @@ static void __CDECL evnt_window_slider( WINDOW * win, short buff[8], void * data
{ {
int dx = buff[4]; int dx = buff[4];
int dy = buff[5]; int dy = buff[5];
GRECT work, screen;
struct gui_window * gw = data; struct gui_window * gw = data;
if (!dx && !dy) return; if (!dx && !dy) return;
@ -697,10 +692,7 @@ static void __CDECL evnt_window_icondraw( WINDOW *win, short buff[8], void * dat
static void __CDECL evnt_window_move( WINDOW *win, short buff[8], void * data ) 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; short wx, wy, wh, ww, nx, ny;
short r;
short xoff, yoff;
if( option_atari_realtime_move ) { if( option_atari_realtime_move ) {
std_mvd( win, buff, &app ); std_mvd( win, buff, &app );
evnt_window_rt_resize( win, buff, data ); evnt_window_rt_resize( win, buff, data );
@ -738,8 +730,7 @@ void __CDECL evnt_window_resize( WINDOW *win, short buff[8], void * data )
static void __CDECL evnt_window_rt_resize( WINDOW *win, short buff[8], void * data ) static void __CDECL evnt_window_rt_resize( WINDOW *win, short buff[8], void * data )
{ {
short x,y,w,h; short x,y,w,h;
struct gui_window * gw; struct gui_window * gw;
LGRECT rect;
if(buff[0] == WM_FORCE_MOVE ) { if(buff[0] == WM_FORCE_MOVE ) {
std_mvd(win, buff, &app); std_mvd(win, buff, &app);

View File

@ -34,12 +34,13 @@
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* Creates an normal Browser window with [toolbar], [statusbar] */ /* Creates an normal Browser window with [toolbar], [statusbar] */
int window_create( struct gui_window * gw, struct browser_window * bw, unsigned long flags ); int window_create( struct gui_window * gw,
struct browser_window * bw, unsigned long flags );
/* Destroys WinDom part of gui_window */ /* Destroys WinDom part of gui_window */
int window_destroy( struct gui_window * gw ); int window_destroy( struct gui_window * gw );
/* show the window */ /* show the window */
void window_open( struct gui_window * gw); void window_open( struct gui_window * gw, GRECT pos);
void window_snd_redraw(struct gui_window * gw, short x, short y, short w, short h ); void window_snd_redraw(struct gui_window * gw, short x, short y, short w, short h );
/* Update Shade / Unshade state of the fwd/back buttons*/ /* Update Shade / Unshade state of the fwd/back buttons*/
@ -56,7 +57,6 @@ bool window_widget_has_focus( struct gui_window * gw, enum focus_element_type t,
bool window_url_widget_has_focus( struct gui_window * gw ); bool window_url_widget_has_focus( struct gui_window * gw );
void window_set_url( struct gui_window * gw, const char * text); void window_set_url( struct gui_window * gw, const char * text);
void window_set_stauts( struct gui_window * gw , char * text ); void window_set_stauts( struct gui_window * gw , char * text );
void window_center(struct gui_window * gw);
void window_set_icon(struct gui_window * gw, struct bitmap * bmp ); void window_set_icon(struct gui_window * gw, struct bitmap * bmp );

View File

@ -476,7 +476,7 @@ static int parse_accel( char * message, struct s_accelerator * accel)
accel->mod |= K_CTRL; accel->mod |= K_CTRL;
s++; s++;
} }
parsekey:
/* expect F1/F10 or something like A, B, C ... : */ /* expect F1/F10 or something like A, B, C ... : */
if(strlen(s) >= 2 && s[0] == 'F' ) { if(strlen(s) >= 2 && s[0] == 'F' ) {
if(s[1] >= 49 && s[1] <= 57) { if(s[1] >= 49 && s[1] <= 57) {

View File

@ -204,8 +204,12 @@ gui_create_browser_window(struct browser_window *bw,
LOG(("new window: %p, bw: %p\n", gw, bw)); LOG(("new window: %p, bw: %p\n", gw, bw));
window_create(gw, bw, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE|WIDGET_SCROLL ); window_create(gw, bw, WIDGET_STATUSBAR|WIDGET_TOOLBAR|WIDGET_RESIZE|WIDGET_SCROLL );
if( gw->root->handle ) { if( gw->root->handle ) {
window_open( gw ); GRECT pos = {
app.w/2-(cfg_width/2), app.h/2-(cfg_height/2),
cfg_width, cfg_height
};
window_open( gw , pos );
/* Recalculate windows browser area now */ /* Recalculate windows browser area now */
browser_update_rects( gw ); browser_update_rects( gw );
tb_update_buttons( gw ); tb_update_buttons( gw );