From c528d108640f9cdc7c5268a1e464b7e18b04cd59 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Fri, 19 Oct 2012 00:14:11 +0200 Subject: Use GEM Window Statusbar when WITH_CUSTOM_STATUSBAR is undefined. --- atari/statusbar.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- atari/statusbar.h | 12 ++++++++---- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/atari/statusbar.c b/atari/statusbar.c index f4dbbe578..08a62c55d 100755 --- a/atari/statusbar.c +++ b/atari/statusbar.c @@ -44,7 +44,8 @@ #include "atari/res/netsurf.rsh" #include "atari/plot/plot.h" #include "atari/osspec.h" - + +#ifdef WITH_CUSTOM_STATUSBAR extern int atari_plot_vdi_handle; static @@ -182,7 +183,8 @@ void sb_destroy( CMP_STATUSBAR s ) } void sb_set_text( CMP_STATUSBAR sb , char * text ) -{ +{ + LGRECT work; assert( sb != NULL ); assert( sb->comp != NULL ); @@ -197,4 +199,42 @@ void sb_set_text( CMP_STATUSBAR sb , char * text ) work.g_x, work.g_y, work.g_w, work.g_h ); } } +} + +#else + +CMP_STATUSBAR sb_create( struct gui_window * gw ) +{ + CMP_STATUSBAR s = malloc( sizeof(struct s_statusbar) ); + s->attached = false; + sb_set_text( s, (char*)"" ); + return( s ); } + +void sb_destroy( CMP_STATUSBAR s ) +{ + LOG(("%s\n", __FUNCTION__ )); + if( s ) { + free( s ); + } +} + +void sb_attach(CMP_STATUSBAR sb, struct gui_window * gw) +{ + sb->aes_win = gw->root->handle->handle; + sb->attached = true; +} + +void sb_set_text(CMP_STATUSBAR sb, char * text ) +{ + LGRECT work; + assert( sb != NULL ); + strncpy(sb->text, text, STATUSBAR_MAX_SLEN); + sb->text[STATUSBAR_MAX_SLEN]=0; + sb->textlen = strlen(sb->text); + if(sb->attached){ + wind_set_str(sb->aes_win, WF_INFO, sb->text); + } +} + +#endif diff --git a/atari/statusbar.h b/atari/statusbar.h index fd01a0c79..fc6749e91 100755 --- a/atari/statusbar.h +++ b/atari/statusbar.h @@ -23,15 +23,19 @@ #define STATUSBAR_MAX_SLEN 255 struct s_statusbar -{ - COMPONENT * comp; +{ +#ifdef WITH_COMPONENT_STATUSBAR + COMPONENT * comp; +#endif char text[STATUSBAR_MAX_SLEN+1]; size_t textlen; - bool attached; + bool attached; + short aes_win; }; CMP_STATUSBAR sb_create( struct gui_window * gw ); void sb_destroy( CMP_STATUSBAR s ); -void sb_set_text( CMP_STATUSBAR sb , char * text ); +void sb_set_text( CMP_STATUSBAR sb , char * text ); +void sb_attach(CMP_STATUSBAR sb, struct gui_window * gw); #endif -- cgit v1.2.3