r13945 dsilvers - /trunk/netsurf/.gitignore
by netsurf@semichrome.net
Author: dsilvers
Date: Mon Jun 4 10:48:09 2012
New Revision: 13945
URL: http://source.netsurf-browser.org?rev=13945&view=rev
Log:
Add a gitignore file
Added:
trunk/netsurf/.gitignore
Added: trunk/netsurf/.gitignore
URL: http://source.netsurf-browser.org/trunk/netsurf/.gitignore?rev=13945&view...
==============================================================================
--- trunk/netsurf/.gitignore (added)
+++ trunk/netsurf/.gitignore Mon Jun 4 10:48:09 2012
@@ -1,0 +1,28 @@
+*~
+gtk/res/toolbarIndices
+windows/res/preferences
+!NetSurf/!Run,feb
+!NetSurf/!RunImage,ff8
+!NetSurf/Resources/en/Templates,fec
+!NetSurf/Resources/fr/Templates,fec
+!NetSurf/Resources/de/Templates,fec
+!NetSurf/Resources/nl/Templates,fec
+test/nsurl
+test/urldbtest
+test/llcache
+utils/translit.c
+utils/testament.h
+codedocs
+nsgtk
+nsfb
+nsmonkey
+nsdebug
+Makefile.config
+NetSurf.exe
+NetSurf.app
+NetSurf.dbg
+NetSurf.dmg
+NetSurf
+core
+nsfb-*
+build-*
10 years, 8 months
r13944 chris_y - /trunk/netsurf/amiga/download.c
by netsurf@semichrome.net
Author: chris_y
Date: Mon Jun 4 10:10:13 2012
New Revision: 13944
URL: http://source.netsurf-browser.org?rev=13944&view=rev
Log:
Don't show a "download complete" message if there was an error or the user
aborted.
Modified:
trunk/netsurf/amiga/download.c
Modified: trunk/netsurf/amiga/download.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/download.c?rev=1394...
==============================================================================
--- trunk/netsurf/amiga/download.c (original)
+++ trunk/netsurf/amiga/download.c Mon Jun 4 10:10:13 2012
@@ -74,6 +74,13 @@
struct download_context *ctx;
char *url;
char fname[1024];
+ int result;
+};
+
+enum {
+ AMINS_DLOAD_OK = 0,
+ AMINS_DLOAD_ERROR,
+ AMINS_DLOAD_ABORT,
};
struct gui_download_window *gui_download_window_create(download_context *ctx,
@@ -215,12 +222,14 @@
const char *error_msg)
{
warn_user("Unwritten","");
+ dw->result = AMINS_DLOAD_ERROR;
gui_download_window_done(dw);
}
void ami_download_window_abort(struct gui_download_window *dw)
{
download_context_abort(dw->ctx);
+ dw->result = AMINS_DLOAD_ABORT;
gui_download_window_done(dw);
}
@@ -233,7 +242,7 @@
if(!dw) return;
- if(nsoption_bool(download_notify))
+ if((nsoption_bool(download_notify)) && (dw->result == AMINS_DLOAD_OK))
{
Notify(ami_appid, APPNOTIFY_Title, messages_get("amiDownloadComplete"),
APPNOTIFY_PubScreenName, "FRONT",
10 years, 8 months
r13943 mono - in /trunk/netsurf/atari: toolbar.c toolbar.h
by netsurf@semichrome.net
Author: mono
Date: Sun Jun 3 17:07:57 2012
New Revision: 13943
URL: http://source.netsurf-browser.org?rev=13943&view=rev
Log:
Removed the use of duplicated OBJECT trees.
Modified:
trunk/netsurf/atari/toolbar.c
trunk/netsurf/atari/toolbar.h
Modified: trunk/netsurf/atari/toolbar.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/toolbar.c?rev=13943...
==============================================================================
--- trunk/netsurf/atari/toolbar.c (original)
+++ trunk/netsurf/atari/toolbar.c Sun Jun 3 17:07:57 2012
@@ -57,6 +57,8 @@
extern void * h_gem_rsrc;
extern GEM_PLOTTER plotter;
extern struct gui_window * input_window;
+
+static OBJECT * toolbar_buttons = NULL;
static OBJECT * throbber_form = NULL;
static bool img_toolbar = false;
static char * img_toolbar_folder = (char *)"default";
@@ -84,7 +86,7 @@
TOOLBAR_BT_BACK,
tb_back_click,
"toolbar/%s/bck_%s.png",
- 0, 0,
+ 0,
{0,0},
0, 0, 0
},
@@ -92,13 +94,13 @@
TOOLBAR_BT_HOME,
tb_home_click,
"toolbar/%s/hme_%s.png",
- 0, 0, {0,0}, 0, 0, 0
+ 0, {0,0}, 0, 0, 0
},
{
TOOLBAR_BT_FORWARD,
tb_forward_click,
"toolbar/%s/fwd_%s.png",
- 0, 0,
+ 0,
{0,0},
0, 0, 0
},
@@ -106,7 +108,7 @@
TOOLBAR_BT_STOP,
tb_stop_click,
"toolbar/%s/stp_%s.png",
- 0, 0,
+ 0,
{0,0},
0, 0, 0
},
@@ -114,11 +116,11 @@
TOOLBAR_BT_RELOAD,
tb_reload_click,
"toolbar/%s/rld_%s.png",
- 0, 0,
+ 0,
{0,0},
0, 0, 0
},
- { 0, 0, 0, 0, 0, {0,0}, 0, 0, -1 }
+ { 0, 0, 0, 0, {0,0}, 0, 0, -1 }
};
struct s_toolbar_style {
@@ -266,15 +268,15 @@
plot_clip( &icon_clip );
} else {
/* Place the CICON into workarea: */
- tree = bt->aes_object;
+ OBJECT * tree = &toolbar_buttons[bt->rsc_id];
if( tree == NULL )
return;
tree->ob_x = work.g_x;
tree->ob_y = work.g_y + (work.g_h - tree->ob_height) / 2;
if( drawstate == button_off ) {
- bt->aes_object->ob_state |= OS_DISABLED;
+ tree->ob_state |= OS_DISABLED;
} else {
- bt->aes_object->ob_state &= ~OS_DISABLED;
+ tree->ob_state &= ~OS_DISABLED;
}
}
@@ -314,19 +316,8 @@
&todo.g_x, &todo.g_y, &todo.g_w, &todo.g_h );
}
}
-
-static void __CDECL button_enable( COMPONENT *c, long buff[8], void * data )
-{
- struct s_tb_button * bt = (struct s_tb_button *)data;
- bt->aes_object->ob_state &= ~OS_DISABLED;
-}
-
-static void __CDECL button_disable( COMPONENT *c, long buff[8], void * data )
-{
- struct s_tb_button * bt = (struct s_tb_button *)data;
- bt->aes_object->ob_state |= OS_DISABLED;
-}
-
+
+
static void __CDECL button_click( COMPONENT *c, long buff[8], void * data )
{
struct s_tb_button * bt = (struct s_tb_button *)data;
@@ -335,6 +326,7 @@
assert( gw );
gw->root->toolbar->buttons[bt->index].cb_click( gw );
}
+
static struct s_tb_button * find_button( struct gui_window * gw, int rsc_id )
{
@@ -363,14 +355,6 @@
assert( instance->comp );
instance->comp->bounds.max_width = comp_width;
-
- if( img_toolbar == false ){
- // FIXME: is it really required to dup the object? Can this be moved
- // to toolbar_init() ?
- OBJECT *oc = mt_ObjcNDup( &app, &tree[instance->rsc_id], NULL, 1);
- oc->ob_next = oc->ob_head = oc->ob_tail = -1;
- instance->aes_object = oc;
- }
mt_CompEvntDataAttach( &app, instance->comp, WM_REDRAW, button_redraw,
instance );
mt_CompEvntDataAttach( &app, instance->comp, WM_XBUTTON, button_click,
@@ -439,8 +423,7 @@
for some reason, adding
toolbar_styles[tb->style].button_vmargin to the x pos of
the plotter shifts the icon a bit to much.
- That shouldn't happen... maybe the URL widget
- size is a bit to large - to be inspected...
+ Maybe that's becasue the icon is inside an padded form.
*/
plot_set_dimensions(
work.g_x-(toolbar_styles[tb->style].icon_width * idx),
@@ -739,7 +722,7 @@
CMP_TOOLBAR tb_create( struct gui_window * gw )
{
int i;
- OBJECT * tbut = NULL;
+
CMP_TOOLBAR t = malloc( sizeof(struct s_toolbar) );
if( t == NULL )
@@ -757,7 +740,7 @@
NULL, EV_BOT);
if( img_toolbar == false ){
- RsrcGaddr( h_gem_rsrc, R_TREE, TOOLBAR, &tbut );
+ RsrcGaddr( h_gem_rsrc, R_TREE, TOOLBAR, &toolbar_buttons );
}
/* count buttons and add them as components: */
@@ -769,7 +752,7 @@
t->buttons = malloc( t->btcnt * sizeof(struct s_tb_button) );
memset( t->buttons, 0, t->btcnt * sizeof(struct s_tb_button) );
for( i=0; i < t->btcnt; i++ ) {
- button_init( t, tbut, i, &t->buttons[i] );
+ button_init( t, toolbar_buttons, i, &t->buttons[i] );
mt_CompAttach( &app, t->comp, t->buttons[i].comp );
}
@@ -824,14 +807,7 @@
void tb_destroy( CMP_TOOLBAR tb )
-{
- int i=0;
- while( i < tb->btcnt ) {
- if( tb->buttons[i].aes_object ){
- mt_ObjcFree( &app, tb->buttons[i].aes_object );
- }
- i++;
- }
+{
free( tb->buttons );
textarea_destroy( tb->url.textarea );
mt_CompDelete( &app, tb->comp);
Modified: trunk/netsurf/atari/toolbar.h
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/toolbar.h?rev=13943...
==============================================================================
--- trunk/netsurf/atari/toolbar.h (original)
+++ trunk/netsurf/atari/toolbar.h Sun Jun 3 17:07:57 2012
@@ -47,7 +47,6 @@
void (*cb_click)(struct gui_window * gw);
const char * iconfile;
COMPONENT * comp;
- OBJECT * aes_object;
hlcache_handle * icon[TOOLBAR_BUTTON_NUM_STATES];
struct gui_window * gw;
short state;
10 years, 8 months
r13942 mono - /trunk/netsurf/atari/toolbar.c
by netsurf@semichrome.net
Author: mono
Date: Sun Jun 3 16:37:18 2012
New Revision: 13942
URL: http://source.netsurf-browser.org?rev=13942&view=rev
Log:
Fixed redraw of embedded toolbar icons ( enabled / disabled state was incorrectly handled ).
Modified:
trunk/netsurf/atari/toolbar.c
Modified: trunk/netsurf/atari/toolbar.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/toolbar.c?rev=13942...
==============================================================================
--- trunk/netsurf/atari/toolbar.c (original)
+++ trunk/netsurf/atari/toolbar.c Sun Jun 3 16:37:18 2012
@@ -226,26 +226,27 @@
int bmpx=0, bmpy=0, bmpw=0, bmph = 0, drawstate=0;
struct rect icon_clip;
struct bitmap * icon = NULL;
- bool draw_bitmap = false;
mt_CompGetLGrect(&app, c, WF_WORKXYWH, &work);
work.g_h = work.g_h - 1;
- clip = work;
+ clip = work;
+
/* return if component and redraw region does not intersect: */
if ( !rc_lintersect( (LGRECT*)&buff[4], &clip ) ) {
return;
}
- if( img_toolbar && toolbar_image != NULL ){
+ drawstate = bt->state;
+ if( img_toolbar ){
+
if( toolbar_image_ready == false ){
return;
}
+
icon = content_get_bitmap( toolbar_image );
if( icon == NULL ){
return;
- }
- draw_bitmap = true;
- drawstate = bt->state;
+ }
bmpw = bitmap_get_width(icon);
bmph = bitmap_get_height(icon);
@@ -263,15 +264,18 @@
icon_clip.x1 = icon_clip.x0+toolbar_styles[tb->style].icon_width;
icon_clip.y1 = icon_clip.y0+toolbar_styles[tb->style].icon_height;
plot_clip( &icon_clip );
- }
-
- if( draw_bitmap == false ){
+ } else {
/* Place the CICON into workarea: */
tree = bt->aes_object;
if( tree == NULL )
return;
tree->ob_x = work.g_x;
tree->ob_y = work.g_y + (work.g_h - tree->ob_height) / 2;
+ if( drawstate == button_off ) {
+ bt->aes_object->ob_state |= OS_DISABLED;
+ } else {
+ bt->aes_object->ob_state &= ~OS_DISABLED;
+ }
}
/* Setup draw mode: */
@@ -297,7 +301,7 @@
vs_clip( vdih, 1, (short*)&pxy );
v_bar( vdih, (short*)&pxy );
- if( draw_bitmap ){
+ if( img_toolbar == true ){
atari_plotters.bitmap( bmpx, bmpy, bmpw, bmph, icon,
toolbar_styles[tb->style].icon_bgcolor,
BITMAPF_BUFFER_NATIVE );
@@ -403,7 +407,7 @@
v_bar( vdih, (short*)&pxy );
vs_clip( vdih, 1, (short*)&pxy );
- if( img_toolbar && throbber_image != NULL ){
+ if( img_toolbar ){
int bmpx=0, bmpy=0, bmpw=0, bmph = 0, drawstate=0;
struct rect icon_clip;
@@ -804,7 +808,7 @@
toolbar_styles[t->style].icon_width + \
(2*toolbar_styles[t->style].button_vmargin );
t->throbber.comp->bounds.max_height = toolbar_styles[t->style].height;
- if( img_toolbar ){
+ if( img_toolbar == true ){
t->throbber.index = 0;
t->throbber.max_index = 8;
} else {
@@ -866,15 +870,6 @@
} else {
bt->state = button_off;
}
- if( bt->aes_object ){
- if( enable ) {
- bt->aes_object->ob_state |= OS_DISABLED;
- } else {
- bt->aes_object->ob_state &= ~OS_DISABLED;
- }
- } else {
- // TODOs
- }
mt_CompEvntRedraw( &app, bt->comp );
}
@@ -891,15 +886,6 @@
} else {
bt->state = button_off;
}
- if( bt->aes_object ){
- if( enable ) {
- bt->aes_object->ob_state |= OS_DISABLED;
- } else {
- bt->aes_object->ob_state &= ~OS_DISABLED;
- }
- } else {
- // TODOs
- }
mt_CompEvntRedraw( &app, bt->comp );
}
@@ -911,15 +897,6 @@
} else {
bt->state = button_off;
}
- if( bt->aes_object ){
- if( enable ) {
- bt->aes_object->ob_state |= OS_DISABLED;
- } else {
- bt->aes_object->ob_state &= ~OS_DISABLED;
- }
- } else {
- // TODOs
- }
mt_CompEvntRedraw( &app, bt->comp );
}
@@ -931,15 +908,6 @@
} else {
bt->state = button_off;
}
- if( bt->aes_object ){
- if( enable ) {
- bt->aes_object->ob_state |= OS_DISABLED;
- } else {
- bt->aes_object->ob_state &= ~OS_DISABLED;
- }
- } else {
- // TODOs
- }
mt_CompEvntRedraw( &app, bt->comp );
}
10 years, 8 months
r13940 mono - /trunk/netsurf/atari/toolbar.c
by netsurf@semichrome.net
Author: mono
Date: Sun Jun 3 15:38:28 2012
New Revision: 13940
URL: http://source.netsurf-browser.org?rev=13940&view=rev
Log:
Load & use throbber image.
Modified:
trunk/netsurf/atari/toolbar.c
Modified: trunk/netsurf/atari/toolbar.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/toolbar.c?rev=13940...
==============================================================================
--- trunk/netsurf/atari/toolbar.c (original)
+++ trunk/netsurf/atari/toolbar.c Sun Jun 3 15:38:28 2012
@@ -62,7 +62,9 @@
static char * img_toolbar_folder = (char *)"default";
static short toolbar_bg_color = LWHITE;
static hlcache_handle * toolbar_image;
+static hlcache_handle * throbber_image;
static bool toolbar_image_ready = false;
+static bool throbber_image_ready = false;
static plot_font_style_t font_style_url = {
@@ -158,15 +160,15 @@
if( img_toolbar ){
char imgfile[PATH_MAX];
- const char * states[] = {"on", "off"};
-
- toolbar_image = load_icon( "toolbar/default/main.png", toolbar_icon_callback, NULL );
+
while( tb_buttons[i].rsc_id != 0){
tb_buttons[i].index = i;
i++;
}
-
-
+ toolbar_image = load_icon( "toolbar/default/main.png",
+ toolbar_icon_callback, NULL );
+ throbber_image = load_icon( "toolbar/default/throbber.png",
+ toolbar_icon_callback, NULL );
}
n = (sizeof( toolbar_styles ) / sizeof( struct s_toolbar_style ));
@@ -182,7 +184,10 @@
void toolbar_exit( void )
{
- hlcache_handle_release( toolbar_image );
+ if( toolbar_image )
+ hlcache_handle_release( toolbar_image );
+ if( throbber_image )
+ hlcache_handle_release( throbber_image );
}
/**
@@ -193,9 +198,14 @@
const hlcache_event *event, void *pw)
{
if( event->type == CONTENT_MSG_READY ){
- toolbar_image_ready = true;
- if( input_window != NULL )
- tb_update_buttons( input_window, 0 );
+ if( handle == toolbar_image ){
+ toolbar_image_ready = true;
+ if( input_window != NULL )
+ tb_update_buttons( input_window, 0 );
+ }
+ else if( handle == throbber_image ){
+ throbber_image_ready = true;
+ }
}
return NSERROR_OK;
@@ -246,7 +256,7 @@
work.g_x-(toolbar_styles[tb->style].icon_width * bt->index)+toolbar_styles[tb->style].button_vmargin,
work.g_y-(toolbar_styles[tb->style].icon_height * drawstate)+toolbar_styles[tb->style].button_hmargin,
toolbar_styles[tb->style].icon_width*(bt->index+1),
- work.g_y-(toolbar_styles[tb->style].icon_height * drawstate)
+ toolbar_styles[tb->style].icon_height*(drawstate+1)
);
icon_clip.x0 = bmpx+(toolbar_styles[tb->style].icon_width*bt->index);
icon_clip.y0 = bmpy+(toolbar_styles[tb->style].icon_height*drawstate);
@@ -370,39 +380,95 @@
{
LGRECT work, clip;
int idx;
- short pxy[4];
+ short pxy[4];
+ struct s_toolbar * tb;
struct gui_window * gw = (struct gui_window *)mt_CompDataSearch(&app,
c,
- CDT_OWNER );
- if( gw->root->toolbar->throbber.running == false ) {
- idx = THROBBER_INACTIVE_INDEX;
- } else {
- idx = gw->root->toolbar->throbber.index;
- if( idx > THROBBER_MAX_INDEX || idx < THROBBER_MIN_INDEX ) {
- idx = THROBBER_MIN_INDEX;
- }
- }
-
+ CDT_OWNER );
+
+ tb = gw->root->toolbar;
mt_CompGetLGrect(&app, c, WF_WORKXYWH, &work);
clip = work;
if ( !rc_lintersect( (LGRECT*)&buff[4], &clip ) ) return;
vsf_interior( vdih , 1 );
if(app.nplanes > 2 )
- vsf_color( vdih, toolbar_styles[gw->root->toolbar->style].bgcolor );
+ vsf_color( vdih, toolbar_styles[tb->style].bgcolor );
else
vsf_color( vdih, WHITE );
pxy[0] = (short)buff[4];
pxy[1] = (short)buff[5];
pxy[2] = (short)buff[4] + buff[6]-1;
pxy[3] = (short)buff[5] + buff[7]-2;
- v_bar( vdih, (short*)&pxy );
-
- if( throbber_form != NULL ) {
- throbber_form[idx].ob_x = work.g_x+1;
- throbber_form[idx].ob_y = work.g_y+4;
- mt_objc_draw( throbber_form, idx, 8, clip.g_x, clip.g_y, clip.g_w, clip.g_h, app.aes_global );
- }
+ v_bar( vdih, (short*)&pxy );
+ vs_clip( vdih, 1, (short*)&pxy );
+
+ if( img_toolbar && throbber_image != NULL ){
+
+ int bmpx=0, bmpy=0, bmpw=0, bmph = 0, drawstate=0;
+ struct rect icon_clip;
+ struct bitmap * icon = NULL;
+
+ if( throbber_image_ready == false ){
+ return;
+ }
+ icon = content_get_bitmap( throbber_image );
+ if( icon == NULL ){
+ return;
+ }
+
+ if( tb->throbber.running == false ) {
+ idx = 0;
+ }
+ else {
+ idx = tb->throbber.index;
+ if( idx > tb->throbber.max_index ) {
+ idx = tb->throbber.index = 1;
+ }
+ }
+ bmpw = bitmap_get_width(icon);
+ bmph = bitmap_get_height(icon);
+ bmpx = 0;
+ bmpy = 0;
+
+ /*
+ for some reason, adding
+ toolbar_styles[tb->style].button_vmargin to the x pos of
+ the plotter shifts the icon a bit to much.
+ That shouldn't happen... maybe the URL widget
+ size is a bit to large - to be inspected...
+ */
+ plot_set_dimensions(
+ work.g_x-(toolbar_styles[tb->style].icon_width * idx),
+ work.g_y+toolbar_styles[tb->style].button_hmargin,
+ toolbar_styles[tb->style].icon_width*(idx+1),
+ toolbar_styles[tb->style].icon_height
+ );
+ icon_clip.x0 = bmpx+(toolbar_styles[tb->style].icon_width*idx);
+ icon_clip.y0 = bmpy;
+ icon_clip.x1 = icon_clip.x0+toolbar_styles[tb->style].icon_width;
+ icon_clip.y1 = icon_clip.y0+toolbar_styles[tb->style].icon_height;
+ plot_clip( &icon_clip );
+ atari_plotters.bitmap( bmpx, bmpy, bmpw, bmph, icon,
+ toolbar_styles[tb->style].icon_bgcolor,
+ BITMAPF_BUFFER_NATIVE );
+ }
+ else {
+ if( throbber_form != NULL ) {
+ if( gw->root->toolbar->throbber.running == false ) {
+ idx = THROBBER_INACTIVE_INDEX;
+ } else {
+ idx = gw->root->toolbar->throbber.index;
+ if( idx > THROBBER_MAX_INDEX || idx < THROBBER_MIN_INDEX ) {
+ idx = THROBBER_MIN_INDEX;
+ }
+ }
+ throbber_form[idx].ob_x = work.g_x+1;
+ throbber_form[idx].ob_y = work.g_y+4;
+ mt_objc_draw( throbber_form, idx, 8, clip.g_x, clip.g_y, clip.g_w, clip.g_h, app.aes_global );
+ }
+ }
+
}
static
@@ -607,10 +673,9 @@
work.g_x += TOOLBAR_URL_MARGIN_RIGHT;
work.g_y += TOOLBAR_URL_MARGIN_LEFT;
work.g_w -= TOOLBAR_URL_MARGIN_RIGHT;
- work.g_h -= TOOLBAR_URL_MARGIN_BOTTOM;
-
- plotter->resize(plotter, work.g_w, work.g_h );
- plotter->move(plotter, work.g_x, work.g_y );
+ work.g_h -= TOOLBAR_URL_MARGIN_BOTTOM;
+
+ plot_set_dimensions( work.g_x, work.g_y, work.g_w, work.g_h );
if( plotter->lock( plotter ) == 0 )
return;
@@ -727,7 +792,7 @@
mt_CompAttach( &app, t->comp, t->url.comp );
/* create the throbber widget: */
- if( throbber_form == NULL ) {
+ if( throbber_form == NULL && img_toolbar == false ) {
RsrcGaddr( h_gem_rsrc, R_TREE, THROBBER , &throbber_form );
throbber_form->ob_x = 0;
throbber_form->ob_y = 0;
@@ -735,11 +800,17 @@
t->throbber.comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL,
toolbar_styles[t->style].height, 0);
t->throbber.comp->rect.g_h = toolbar_styles[t->style].height;
- t->throbber.comp->rect.g_w = 32;
- t->throbber.comp->bounds.max_height = toolbar_styles[t->style].height;
- t->throbber.comp->bounds.max_width = 32;
- t->throbber.index = THROBBER_MIN_INDEX;
- t->throbber.max_index = THROBBER_MAX_INDEX;
+ t->throbber.comp->rect.g_w = t->throbber.comp->bounds.max_width = \
+ toolbar_styles[t->style].icon_width + \
+ (2*toolbar_styles[t->style].button_vmargin );
+ t->throbber.comp->bounds.max_height = toolbar_styles[t->style].height;
+ if( img_toolbar ){
+ t->throbber.index = 0;
+ t->throbber.max_index = 8;
+ } else {
+ t->throbber.index = THROBBER_MIN_INDEX;
+ t->throbber.max_index = THROBBER_MAX_INDEX;
+ }
t->throbber.running = false;
mt_CompEvntAttach( &app, t->throbber.comp, WM_REDRAW, evnt_throbber_redraw );
mt_CompDataAttach( &app, t->throbber.comp, CDT_OWNER, gw );
10 years, 8 months
r13939 mono - /trunk/netsurf/atari/toolbar.c
by netsurf@semichrome.net
Author: mono
Date: Sun Jun 3 13:02:11 2012
New Revision: 13939
URL: http://source.netsurf-browser.org?rev=13939&view=rev
Log:
Reset stop button when url changes.
Modified:
trunk/netsurf/atari/toolbar.c
Modified: trunk/netsurf/atari/toolbar.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/toolbar.c?rev=13939...
==============================================================================
--- trunk/netsurf/atari/toolbar.c (original)
+++ trunk/netsurf/atari/toolbar.c Sun Jun 3 13:02:11 2012
@@ -170,10 +170,6 @@
}
n = (sizeof( toolbar_styles ) / sizeof( struct s_toolbar_style ));
- printf("toolbar styles: %d\n", n );
-
-
-
for( i=0; i<n; i++ ){
toolbar_styles[i].bgcolor = toolbar_bg_color;
if( img_toolbar ){
@@ -907,7 +903,8 @@
work.g_w -= (TOOLBAR_URL_MARGIN_LEFT + TOOLBAR_URL_MARGIN_RIGHT);
/* do not overwrite the black border, because of that, add 1 */
work.g_h -= (TOOLBAR_URL_MARGIN_TOP + TOOLBAR_URL_MARGIN_BOTTOM+1);
- tb_txt_request_redraw( gw->root->toolbar, 0,0,work.g_w,work.g_h );
+ tb_txt_request_redraw( gw->root->toolbar, 0,0,work.g_w,work.g_h );
+ tb_update_buttons( gw, TOOLBAR_BT_STOP );
return;
}
10 years, 8 months
r13937 mono - /trunk/netsurf/atari/plot/plotter_vdi.c
by netsurf@semichrome.net
Author: mono
Date: Sun Jun 3 12:09:19 2012
New Revision: 13937
URL: http://source.netsurf-browser.org?rev=13937&view=rev
Log:
Some cleanups and additions required for the toolbar icon redraw.
Modified:
trunk/netsurf/atari/plot/plotter_vdi.c
Modified: trunk/netsurf/atari/plot/plotter_vdi.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/plot/plotter_vdi.c?...
==============================================================================
--- trunk/netsurf/atari/plot/plotter_vdi.c (original)
+++ trunk/netsurf/atari/plot/plotter_vdi.c Sun Jun 3 12:09:19 2012
@@ -1331,6 +1331,70 @@
#endif
/*
+ Aplha blends the foreground image (img) onto the
+ background images (bg). The background receives the blended
+ image pixels.
+*/
+static int ablend_bitmap( struct bitmap * img, struct bitmap * bg,
+ GRECT * img_clip, GRECT * bg_clip )
+{
+ uint32_t * imgrow;
+ uint32_t * screenrow;
+ int img_x, img_y, bg_x, bg_y, img_stride, bg_stride;
+
+ bg_clip = bg_clip;
+ img_stride= bitmap_get_rowstride(img);
+ bg_stride = bitmap_get_rowstride(bg);
+
+ for( img_y = img_clip->g_y, bg_y = 0; bg_y < img_clip->g_h; bg_y++, img_y++) {
+ imgrow = (uint32_t *)(img->pixdata + (img_stride * img_y));
+ screenrow = (uint32_t *)(bg->pixdata + (bg_stride * bg_y));
+ for( img_x = img_clip->g_x, bg_x = 0; bg_x < img_clip->g_w; bg_x++, img_x++ ) {
+
+ // when the pixel isn't fully transparent,...:
+ if( (imgrow[img_x] & 0x0FF) != 0 ){
+ screenrow[bg_x] = ablend( imgrow[img_x], screenrow[bg_x]);
+ }
+
+ // FIXME, maybe this loop would be faster??:
+ // ---
+ //if( (imgrow[img_x] & 0x0FF) != 0xFF ){
+ // imgrow[bg_x] = ablend( imgrow[img_x], screenrow[bg_x]);
+ //}
+
+ // or maybe even this???
+ // ---
+ //if( (imgrow[img_x] & 0x0FF) == 0xFF ){
+ // screenrow[bg_x] = imgrow[img_x];
+ //} else if( (imgrow[img_x] & 0x0FF) != 0x00 ) {
+ // screenrow[bg_x] = ablend( imgrow[img_x], screenrow[bg_x]);
+ //}
+ }
+ }
+ return( 0 );
+}
+
+/*
+ Alpha blends an image, using one pixel as the background.
+ The bitmap receives the result.
+*/
+static int ablend_pixel( struct bitmap * img, uint32_t bg, GRECT * clip )
+{
+ uint32_t * imgrow;
+ int img_x, img_y, img_stride;
+
+ img_stride= bitmap_get_rowstride(img);
+
+ for( img_y = 0; img_y < clip->g_h; img_y++) {
+ imgrow = (uint32_t *)(img->pixdata + (img_stride * img_y));
+ for( img_x = 0; img_x < clip->g_w; img_x++ ) {
+ imgrow[img_x] = ablend( imgrow[img_x], bg );
+ }
+ }
+ return( 0 );
+}
+
+/*
*
* Convert bitmap to the native screen format
* self: the plotter instance
@@ -1352,7 +1416,7 @@
int err;
int bw, bh;
struct bitmap * scrbuf = NULL;
- struct bitmap * source;
+ struct bitmap * source = NULL;
bool cache = ( flags & BITMAPF_BUFFER_NATIVE );
bool opaque = bitmap_get_opaque( img );
@@ -1394,54 +1458,35 @@
/* rem. if eddi xy is installed, we could directly access the screen! */
/* apply transparency to the image: */
- if( ( opaque == false ) ) {
- uint32_t * imgrow;
- uint32_t * screenrow;
- int img_x, img_y; /* points into old bitmap */
- int screen_x, screen_y; /* pointers into new bitmap */
-
+ if( ( opaque == false ) ) {
/* copy the screen to an temp buffer: */
- scrbuf = snapshot_create(self, x, y, clip->g_w, clip->g_h );
- if( scrbuf != NULL ) {
- // copy blended pixels to the new buffer (which contains screen content):
- int img_stride = bitmap_get_rowstride(img);
- int screen_stride = bitmap_get_rowstride(scrbuf);
- for( img_y = clip->g_y, screen_y = 0; screen_y < clip->g_h; screen_y++, img_y++) {
- imgrow = (uint32_t *)(img->pixdata + (img_stride * img_y));
- screenrow = (uint32_t *)(scrbuf->pixdata + (screen_stride * screen_y));
- for( img_x = clip->g_x, screen_x = 0; screen_x < clip->g_w; screen_x++, img_x++ ) {
-
- // when the pixel isn't fully opaque,...:
- if( (imgrow[img_x] & 0x0FF) != 0 ){
- screenrow[screen_x] = ablend( imgrow[img_x], screenrow[screen_x]);
- }
-
- // FIXME, maybe this loop would be faster??:
- // ---
- //if( (imgrow[img_x] & 0x0FF) != 0xFF ){
- // imgrow[screen_x] = ablend( imgrow[img_x], screenrow[screen_x]);
- //}
-
- // or maybe even this???
- // ---
- //if( (imgrow[img_x] & 0x0FF) == 0xFF ){
- // screenrow[screen_x] = imgrow[img_x];
- //} else if( (imgrow[img_x] & 0x0FF) != 0x00 ) {
- // screenrow[screen_x] = ablend( imgrow[img_x], screenrow[screen_x]);
- //}
- }
+ if( (flags & BITMAPF_BUFFER_NATIVE) == 0 ){
+ scrbuf = snapshot_create(self, x, y, clip->g_w, clip->g_h );
+ if( scrbuf != NULL ) {
+
+ assert( clip->g_w <= bw );
+ assert( clip->g_h <= bh );
+
+ // copy blended pixels to the screen buffer:
+ ablend_bitmap( img, scrbuf, clip, NULL );
+ /* adjust size which gets converted: */
+ bw = clip->g_w;
+ bh = clip->g_h;
+ /* adjust output position: */
+ clip->g_x = 0;
+ clip->g_y = 0;
+ /* set the source of conversion: */
+ source = scrbuf;
}
- assert( clip->g_w <= bw );
- assert( clip->g_h <= bh );
- /* adjust size which gets converted: */
- bw = clip->g_w;
- bh = clip->g_h;
- /* adjust output position: */
- clip->g_x = 0;
- clip->g_y = 0;
- /* set the source of conversion: */
- source = scrbuf;
- }
+ } else {
+ /*
+ The whole bitmap can be transformed to an mfdb
+ (and get's cached)
+ */
+ GRECT region = { 0, 0, bw, bh };
+ ablend_pixel( img, bg, ®ion );
+ source = img;
+ }
} else {
source = img;
}
@@ -1558,7 +1603,7 @@
// clip the visible rectangle of the plot area
// this is the area of the plotter which falls into
// screen region:
- plotter_get_visible_grect( self, &vis );
+ plotter_get_visible_grect( self, &vis );
if( !rc_intersect( &vis, &off) ) {
return( 1 );
}
10 years, 8 months
r13936 mono - in /trunk/netsurf/atari/res: netsurf.rsc netsurf.rsh netsurf.rsm
by netsurf@semichrome.net
Author: mono
Date: Sun Jun 3 12:07:12 2012
New Revision: 13936
URL: http://source.netsurf-browser.org?rev=13936&view=rev
Log:
Fix order of embedded toolbar resource icons.
Modified:
trunk/netsurf/atari/res/netsurf.rsc
trunk/netsurf/atari/res/netsurf.rsh
trunk/netsurf/atari/res/netsurf.rsm
Modified: trunk/netsurf/atari/res/netsurf.rsc
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/res/netsurf.rsc?rev...
==============================================================================
Binary files - no diff available.
Modified: trunk/netsurf/atari/res/netsurf.rsh
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/res/netsurf.rsh?rev...
==============================================================================
--- trunk/netsurf/atari/res/netsurf.rsh (original)
+++ trunk/netsurf/atari/res/netsurf.rsh Sun Jun 3 12:07:12 2012
@@ -44,8 +44,8 @@
#define TOOLBAR_BT_BACK 2 /* CICON in tree TOOLBAR */
#define TOOLBAR_BT_HOME 3 /* CICON in tree TOOLBAR */
#define TOOLBAR_BT_FORWARD 4 /* CICON in tree TOOLBAR */
-#define TOOLBAR_BT_RELOAD 5 /* CICON in tree TOOLBAR */
-#define TOOLBAR_BT_STOP 6 /* CICON in tree TOOLBAR */
+#define TOOLBAR_BT_STOP 5 /* CICON in tree TOOLBAR */
+#define TOOLBAR_BT_RELOAD 6 /* CICON in tree TOOLBAR */
#define ICONIFY 2 /* form/dial */
#define ICONIFY_GLOBE 1 /* CICON in tree ICONIFY */
Modified: trunk/netsurf/atari/res/netsurf.rsm
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/res/netsurf.rsm?rev...
==============================================================================
--- trunk/netsurf/atari/res/netsurf.rsm (original)
+++ trunk/netsurf/atari/res/netsurf.rsm Sun Jun 3 12:07:12 2012
@@ -3,7 +3,7 @@
#N 99@32@AZAaza___ _@AZAaza090___ _@@_@
#FoC-Header@rsm2out@C-Header@rsh@@@[C-Header@0@
#R 0@0@1@1@1@1@
-#M 20010100@0@7728@597@
+#M 20010100@0@7728@599@
#T 0@1@MAINMENU@@62@@
#O 4@32@T_FILE@@
#O 5@32@T_EDIT@@
@@ -47,8 +47,8 @@
#O 2@33@BT_BACK@@
#O 3@33@BT_HOME@@
#O 4@33@BT_FORWARD@@
-#O 5@33@BT_RELOAD@@
-#O 6@33@BT_STOP@@
+#O 5@33@BT_STOP@@
+#O 6@33@BT_RELOAD@@
#T 2@2@ICONIFY@@3@@
#O 1@33@GLOBE@@
#T 3@2@FAVICON@@2@@
@@ -183,4 +183,4 @@
#O 101@26@CB_BG_IMAGES@@
#O 98@26@ABORT@@
#O 99@26@OK@@
-#c 24229@
+#c 24297@
10 years, 8 months