38#include "atari/res/netsurf.rsh"
42#ifdef WITH_CUSTOM_STATUSBAR
46void __CDECL evnt_sb_redraw( COMPONENT *c,
long buff[8] )
59 short pxy[8], d, pxyclip[4];
61 mt_CompGetLGrect(&app, sb->comp, WF_WORKXYWH, &work);
63 if ( !rc_lintersect( (LGRECT*)&buff[4], &lclip ) ) {
75 pxyclip[0] = lclip.g_x;
76 pxyclip[1] = lclip.g_y;
77 pxyclip[2] = lclip.g_x + lclip.g_w-1;
78 pxyclip[3] = lclip.g_y + lclip.g_h-1;
83 if( lclip.g_y <= work.g_y ) {
86 pxy[2] =
MIN( work.g_x + work.g_w, lclip.g_x + lclip.g_w );
99 pxy[2] = work.g_x + work.g_w-1;
100 pxy[3] = work.g_y + work.g_h-1;
117 for( curx = work.g_x + 2, i=0 ; (curx+cw < work.g_x+work.g_w ) && i < sb->textlen; i++ ){
123 if( curx >= lclip.g_x - cw ) {
127 if( curx >= lclip.g_x + lclip.g_w )
132 pxy[0] = work.g_x + work.g_w;
133 pxy[1] = work.g_y + work.g_h;
134 pxy[2] = work.g_x + work.g_w;
135 pxy[3] = work.g_y + work.g_h-work.g_h;
142static void __CDECL evnt_sb_click( COMPONENT *c,
long buff[8] )
144 static bool prevstate;
146 mt_CompGetLGrect(&app, c, WF_WORKXYWH, &work);
147 if( evnt.mx >= work.g_x + (work.g_w) && evnt.mx <= work.g_x + work.g_w &&
148 evnt.my >= work.g_y + (work.g_h) && evnt.my <= work.g_y + work.g_h ) {
157 s->comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL,
STATUSBAR_HEIGHT, 0);
160 mt_CompDataAttach( &app, s->comp,
CDT_OWNER, gw );
161 mt_CompEvntAttach( &app, s->comp, WM_REDRAW, evnt_sb_redraw );
162 mt_CompEvntAttach( &app, s->comp, WM_XBUTTON, evnt_sb_click );
169 NSLOG(netsurf, INFO,
"%s\n", __FUNCTION__);
172 mt_CompDelete( &app, s->comp );
182 assert( sb != NULL );
183 assert( sb->comp != NULL );
190 mt_CompGetLGrect(&app, sb->comp, WF_WORKXYWH, &work);
191 ApplWrite( _AESapid, WM_REDRAW, gw->
root->handle->handle,
192 work.g_x, work.g_y, work.g_w, work.g_h );
209 NSLOG(netsurf, INFO,
"%s\n", __FUNCTION__);
223 assert( sb != NULL );
Core mouse and pointer states.
Target independent plotting interface.
#define NSLOG(catname, level, logmsg, args...)
NS_ATARI_SYSINFO atari_sysinfo
void sb_set_text(CMP_STATUSBAR sb, const char *text)
CMP_STATUSBAR sb_create(struct gui_window *gw)
void sb_attach(CMP_STATUSBAR sb, struct gui_window *gw)
void sb_destroy(CMP_STATUSBAR s)
#define STATUSBAR_MAX_SLEN
Interface to utility string handling.
unsigned short medium_sfont_pxh
first entry in window list
struct s_gui_win_root * root
char text[STATUSBAR_MAX_SLEN+1]
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.