r13337 tlsa - /trunk/netsurf/riscos/print.c
by netsurf@semichrome.net
Author: tlsa
Date: Fri Dec 23 16:52:40 2011
New Revision: 13337
URL: http://source.netsurf-browser.org?rev=13337&view=rev
Log:
Make RISC OS print background images option work.
Modified:
trunk/netsurf/riscos/print.c
Modified: trunk/netsurf/riscos/print.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/print.c?rev=13337&...
==============================================================================
--- trunk/netsurf/riscos/print.c (original)
+++ trunk/netsurf/riscos/print.c Fri Dec 23 16:52:40 2011
@@ -193,8 +193,6 @@
printers_exists = false;
}
- print_bg_images = option_background_images;
-
ro_gui_set_icon_selected_state(dialog_print, ICON_PRINT_TO_BOTTOM,
true);
@@ -274,7 +272,7 @@
print_max_sheets = sheets;
else
print_max_sheets = -1;
- option_background_images = ro_gui_get_icon_selected_state(dialog_print,
+ print_bg_images = ro_gui_get_icon_selected_state(dialog_print,
ICON_PRINT_BG_IMAGES);
print_send_printsave(ro_print_current_window->bw->current_content);
@@ -521,7 +519,6 @@
void ro_print_cleanup(void)
{
- option_background_images = print_bg_images;
ro_print_current_window = NULL;
print_text_black = false;
print_prev_message = 0;
@@ -686,7 +683,7 @@
/* TODO: turn knockout off for print */
struct redraw_context ctx = {
.interactive = false,
- .background_images = false,
+ .background_images = print_bg_images,
.plot = &ro_plotters
};
11 years, 5 months
r13336 tlsa - /trunk/netsurf/render/html_redraw.c
by netsurf@semichrome.net
Author: tlsa
Date: Fri Dec 23 16:44:30 2011
New Revision: 13336
URL: http://source.netsurf-browser.org?rev=13336&view=rev
Log:
Make html_redraw obey background image redraw requirement.
Modified:
trunk/netsurf/render/html_redraw.c
Modified: trunk/netsurf/render/html_redraw.c
URL: http://source.netsurf-browser.org/trunk/netsurf/render/html_redraw.c?rev=...
==============================================================================
--- trunk/netsurf/render/html_redraw.c (original)
+++ trunk/netsurf/render/html_redraw.c Fri Dec 23 16:44:30 2011
@@ -2035,7 +2035,8 @@
.fill_colour = *background_colour,
};
- if (html_redraw_printing && option_remove_backgrounds)
+ if ((html_redraw_printing && option_remove_backgrounds) ||
+ ctx->background_images == false)
return true;
plot_content = (background->background != NULL);
11 years, 5 months
r13335 tlsa - in /trunk/netsurf: amiga/ atari/ beos/ cocoa/ framebuffer/ gtk/ monkey/ riscos/ riscos/gui/ utils/ windows/
by netsurf@semichrome.net
Author: tlsa
Date: Fri Dec 23 16:39:25 2011
New Revision: 13335
URL: http://source.netsurf-browser.org?rev=13335&view=rev
Log:
Pass whether background images are wanted in redraw_context.
Modified:
trunk/netsurf/amiga/gui.c
trunk/netsurf/amiga/history_local.c
trunk/netsurf/amiga/thumbnail.c
trunk/netsurf/amiga/tree.c
trunk/netsurf/atari/browser.c
trunk/netsurf/atari/toolbar.c
trunk/netsurf/atari/treeview.c
trunk/netsurf/beos/beos_scaffolding.cpp
trunk/netsurf/beos/beos_thumbnail.cpp
trunk/netsurf/beos/beos_window.cpp
trunk/netsurf/cocoa/BrowserView.m
trunk/netsurf/cocoa/HistoryView.m
trunk/netsurf/cocoa/Tree.m
trunk/netsurf/cocoa/thumbnail.m
trunk/netsurf/framebuffer/gui.c
trunk/netsurf/framebuffer/localhistory.c
trunk/netsurf/framebuffer/thumbnail.c
trunk/netsurf/gtk/scaffolding.c
trunk/netsurf/gtk/thumbnail.c
trunk/netsurf/gtk/treeview.c
trunk/netsurf/gtk/window.c
trunk/netsurf/monkey/browser.c
trunk/netsurf/riscos/gui/url_bar.c
trunk/netsurf/riscos/history.c
trunk/netsurf/riscos/print.c
trunk/netsurf/riscos/save_draw.c
trunk/netsurf/riscos/thumbnail.c
trunk/netsurf/riscos/treeview.c
trunk/netsurf/riscos/window.c
trunk/netsurf/utils/types.h
trunk/netsurf/windows/drawable.c
trunk/netsurf/windows/localhistory.c
trunk/netsurf/windows/thumbnail.c
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=13335&r1=...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Fri Dec 23 16:39:25 2011
@@ -3170,6 +3170,7 @@
int posx, posy;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &amiplot
};
@@ -3373,6 +3374,7 @@
struct rect clip;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &amiplot
};
Modified: trunk/netsurf/amiga/history_local.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/history_local.c?rev...
==============================================================================
--- trunk/netsurf/amiga/history_local.c (original)
+++ trunk/netsurf/amiga/history_local.c Fri Dec 23 16:39:25 2011
@@ -159,6 +159,7 @@
ULONG xs,ys;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &amiplot
};
Modified: trunk/netsurf/amiga/thumbnail.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/thumbnail.c?rev=133...
==============================================================================
--- trunk/netsurf/amiga/thumbnail.c (original)
+++ trunk/netsurf/amiga/thumbnail.c Fri Dec 23 16:39:25 2011
@@ -44,6 +44,7 @@
int plot_height;
struct redraw_context ctx = {
.interactive = false,
+ .background_images = true,
.plot = &amiplot
};
Modified: trunk/netsurf/amiga/tree.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/tree.c?rev=13335&r1...
==============================================================================
--- trunk/netsurf/amiga/tree.c (original)
+++ trunk/netsurf/amiga/tree.c Fri Dec 23 16:39:25 2011
@@ -1218,6 +1218,7 @@
int pos_x, pos_y;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &amiplot
};
Modified: trunk/netsurf/atari/browser.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/browser.c?rev=13335...
==============================================================================
--- trunk/netsurf/atari/browser.c (original)
+++ trunk/netsurf/atari/browser.c Fri Dec 23 16:39:25 2011
@@ -13,12 +13,12 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * Module Description:
- *
- * This WinDom compo
- *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Module Description:
+ *
+ * This WinDom compo
+ *
*
*/
@@ -33,9 +33,9 @@
#include "desktop/gui.h"
#include "desktop/netsurf.h"
-#include "desktop/browser.h"
+#include "desktop/browser.h"
#include "desktop/mouse.h"
-#include "desktop/textinput.h"
+#include "desktop/textinput.h"
#include "content/content.h"
#include "content/hlcache.h"
#include "content/urldb.h"
@@ -49,34 +49,34 @@
#include "atari/browser_win.h"
#include "atari/misc.h"
#include "atari/global_evnt.h"
-#include "atari/res/netsurf.rsh"
+#include "atari/res/netsurf.rsh"
#include "atari/redrawslots.h"
#include "atari/browser.h"
#include "atari/plot/plotter.h"
#include "atari/plot.h"
-#include "atari/encoding.h"
-#include "atari/ctxmenu.h"
+#include "atari/encoding.h"
+#include "atari/ctxmenu.h"
#include "cflib.h"
extern GEM_PLOTTER plotter;
extern struct gui_window *input_window;
-
-static void browser_process_scroll( struct gui_window * gw, LGRECT bwrect );
-static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff,
- struct rect * area );
-static void __CDECL browser_evnt_destroy( COMPONENT * c, long buff[8],
+
+static void browser_process_scroll( struct gui_window * gw, LGRECT bwrect );
+static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff,
+ struct rect * area );
+static void __CDECL browser_evnt_destroy( COMPONENT * c, long buff[8],
void * data);
-static void __CDECL browser_evnt_redraw( COMPONENT * c, long buff[8],
+static void __CDECL browser_evnt_redraw( COMPONENT * c, long buff[8],
void * data);
-static void __CDECL browser_evnt_mbutton( COMPONENT * c, long buff[8],
+static void __CDECL browser_evnt_mbutton( COMPONENT * c, long buff[8],
void * data);
-/*
- Create an browser component.
- Currently, this area is the area which is used to display HTML content.
- However, it could also contains other areas, these need to be handled within
- "browser_get_rect" function.
+/*
+ Create an browser component.
+ Currently, this area is the area which is used to display HTML content.
+ However, it could also contains other areas, these need to be handled within
+ "browser_get_rect" function.
*/
struct s_browser * browser_create
(
@@ -95,34 +95,34 @@
if(clone)
bw->scale = clone->scale;
else
- bw->scale = 1;
+ bw->scale = 1;
redraw_slots_init( &bnew->redraw, MAX_REDRW_SLOTS );
bnew->comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL, 100, 1);
if( bnew->comp == NULL ) {
free(bnew);
return(NULL);
- }
-
+ }
+
/* Attach events to the component: */
mt_CompEvntDataAdd( &app, bnew->comp, WM_XBUTTON,
- browser_evnt_mbutton, (void*)gw, EV_BOT
+ browser_evnt_mbutton, (void*)gw, EV_BOT
);
mt_CompEvntDataAttach( &app, bnew->comp, WM_REDRAW,
- browser_evnt_redraw, (void*)gw
+ browser_evnt_redraw, (void*)gw
);
mt_CompEvntDataAttach( &app, bnew->comp, WM_DESTROY,
- browser_evnt_destroy, (void*)bnew
- );
-
- /* Set the gui_window owner. */
+ browser_evnt_destroy, (void*)bnew
+ );
+
+ /* Set the gui_window owner. */
/* it is an link to the netsurf window system */
mt_CompDataAttach( &app, bnew->comp, CDT_OWNER, gw );
-
+
bnew->scroll.requested.y = 0;
bnew->scroll.requested.x = 0;
bnew->scroll.current.x = 0;
- bnew->scroll.current.y = 0;
- bnew->reformat_pending = false;
+ bnew->scroll.current.y = 0;
+ bnew->reformat_pending = false;
}
return( bnew );
@@ -131,37 +131,37 @@
bool browser_destroy( struct s_browser * b )
{
- LOG(("%s\n", b->bw->name ));
+ LOG(("%s\n", b->bw->name ));
assert( b != NULL );
assert( b->comp != NULL );
assert( b->bw != NULL );
-
- if( b->comp != NULL ){
- mt_CompDelete(&app, b->comp );
+
+ if( b->comp != NULL ){
+ mt_CompDelete(&app, b->comp );
}
return( true );
}
-
-/*
- Query the browser component for widget rectangles.
+
+/*
+ Query the browser component for widget rectangles.
*/
void browser_get_rect( struct gui_window * gw, enum browser_rect type, LGRECT * out)
-{
- LGRECT cur;
-
- /* Query component for it's current size: */
- mt_CompGetLGrect(&app, gw->browser->comp, WF_WORKXYWH, &cur);
-
- /* And extract the different widget dimensions: */
+{
+ LGRECT cur;
+
+ /* Query component for it's current size: */
+ mt_CompGetLGrect(&app, gw->browser->comp, WF_WORKXYWH, &cur);
+
+ /* And extract the different widget dimensions: */
if( type == BR_CONTENT ){
out->g_w = cur.g_w;
out->g_h = cur.g_h;
out->g_x = cur.g_x;
out->g_y = cur.g_y;
}
-
- return;
+
+ return;
}
/* Report an resize to the COMPONENT interface */
@@ -172,18 +172,18 @@
buff[0] = CM_REFLOW;
buff[1] = _AESapid;
buff[2] = 0;
- EvntExec(gw->root->handle, buff);
-}
+ EvntExec(gw->root->handle, buff);
+}
void browser_set_content_size(struct gui_window * gw, int w, int h)
{
CMP_BROWSER b = gw->browser;
LGRECT work;
- browser_get_rect( gw, BR_CONTENT, &work );
-
- gw->root->handle->xpos_max = w;
- gw->root->handle->ypos_max = h;
-
+ browser_get_rect( gw, BR_CONTENT, &work );
+
+ gw->root->handle->xpos_max = w;
+ gw->root->handle->ypos_max = h;
+
if( w < work.g_w + b->scroll.current.x || w < work.g_h + b->scroll.current.y ) {
/* let the scroll routine detect invalid scroll values... */
browser_scroll(gw, WA_LFLINE, b->scroll.current.x, true );
@@ -191,8 +191,8 @@
/* force update of scrollbars: */
b->scroll.required = true;
}
-}
-
+}
+
static void __CDECL browser_evnt_destroy( COMPONENT * c, long buff[8], void * data)
{
@@ -206,29 +206,29 @@
gw->browser = NULL;
LOG(("evnt_destroy done!"));
}
-
-/*
- Mouse Button handler for browser component.
-*/
-
+
+/*
+ Mouse Button handler for browser component.
+*/
+
static void __CDECL browser_evnt_mbutton( COMPONENT * c, long buff[8], void * data)
-{
+{
short mx, my, dummy, mbut;
- LGRECT cwork;
+ LGRECT cwork;
browser_mouse_state bmstate = 0;
- struct gui_window * gw = data;
-
- if( input_window != gw ){
- input_window = gw;
- }
+ struct gui_window * gw = data;
+
+ if( input_window != gw ){
+ input_window = gw;
+ }
window_set_focus( gw, BROWSER, (void*)gw->browser );
- browser_get_rect( gw, BR_CONTENT, &cwork );
-
+ browser_get_rect( gw, BR_CONTENT, &cwork );
+
/* convert screen coords to component coords: */
mx = evnt.mx - cwork.g_x;
- my = evnt.my - cwork.g_y;
-
+ my = evnt.my - cwork.g_y;
+
/* Translate GEM key state to netsurf mouse modifier */
if( evnt.mkstate & (K_RSHIFT | K_LSHIFT) ){
bmstate |= BROWSER_MOUSE_MOD_1;
@@ -244,60 +244,60 @@
bmstate |= BROWSER_MOUSE_MOD_3;
} else {
bmstate &= ~(BROWSER_MOUSE_MOD_3);
- }
-
+ }
+
/* convert component coords to scrolled content coords: */
int sx_origin = (mx + gw->browser->scroll.current.x);
- int sy_origin = (my + gw->browser->scroll.current.y);
-
- short rel_cur_x, rel_cur_y;
- short prev_x=sx_origin, prev_y=sy_origin;
-
+ int sy_origin = (my + gw->browser->scroll.current.y);
+
+ short rel_cur_x, rel_cur_y;
+ short prev_x=sx_origin, prev_y=sy_origin;
+
/* Detect left mouse button state and compare with event state: */
- graf_mkstate(&rel_cur_x, &rel_cur_y, &mbut, &dummy);
- if( (mbut & 1) && (evnt.mbut & 1) ){
- /* Mouse still pressed, report drag */
+ graf_mkstate(&rel_cur_x, &rel_cur_y, &mbut, &dummy);
+ if( (mbut & 1) && (evnt.mbut & 1) ){
+ /* Mouse still pressed, report drag */
rel_cur_x = (rel_cur_x - cwork.g_x) + gw->browser->scroll.current.x;
- rel_cur_y = (rel_cur_y - cwork.g_y) + gw->browser->scroll.current.y;
- browser_window_mouse_click( gw->browser->bw,
- BROWSER_MOUSE_DRAG_ON|BROWSER_MOUSE_DRAG_1,
+ rel_cur_y = (rel_cur_y - cwork.g_y) + gw->browser->scroll.current.y;
+ browser_window_mouse_click( gw->browser->bw,
+ BROWSER_MOUSE_DRAG_ON|BROWSER_MOUSE_DRAG_1,
sx_origin, sy_origin);
- do{
- if( abs(prev_x-rel_cur_x) > 5 || abs(prev_y-rel_cur_y) > 5 ){
- browser_window_mouse_track( gw->browser->bw,
- BROWSER_MOUSE_DRAG_ON|BROWSER_MOUSE_HOLDING_1,
- rel_cur_x, rel_cur_y);
- prev_x = rel_cur_x;
- prev_y = rel_cur_y;
- if( browser_redraw_required( gw ) ){
- browser_redraw( gw );
- }
- }
- graf_mkstate(&rel_cur_x, &rel_cur_y, &mbut, &dummy);
+ do{
+ if( abs(prev_x-rel_cur_x) > 5 || abs(prev_y-rel_cur_y) > 5 ){
+ browser_window_mouse_track( gw->browser->bw,
+ BROWSER_MOUSE_DRAG_ON|BROWSER_MOUSE_HOLDING_1,
+ rel_cur_x, rel_cur_y);
+ prev_x = rel_cur_x;
+ prev_y = rel_cur_y;
+ if( browser_redraw_required( gw ) ){
+ browser_redraw( gw );
+ }
+ }
+ graf_mkstate(&rel_cur_x, &rel_cur_y, &mbut, &dummy);
rel_cur_x = (rel_cur_x - cwork.g_x) + gw->browser->scroll.current.x;
- rel_cur_y = (rel_cur_y - cwork.g_y) + gw->browser->scroll.current.y;
- } while( mbut & 1 );
- browser_window_mouse_track(gw->browser->bw, 0, rel_cur_x,rel_cur_y);
- } else {
- /* Right button pressed? */
- if( (evnt.mbut & 2 ) ) {
- context_popup( gw, evnt.mx, evnt.my );
- } else {
- browser_window_mouse_click(gw->browser->bw,
- bmstate|BROWSER_MOUSE_PRESS_1,
+ rel_cur_y = (rel_cur_y - cwork.g_y) + gw->browser->scroll.current.y;
+ } while( mbut & 1 );
+ browser_window_mouse_track(gw->browser->bw, 0, rel_cur_x,rel_cur_y);
+ } else {
+ /* Right button pressed? */
+ if( (evnt.mbut & 2 ) ) {
+ context_popup( gw, evnt.mx, evnt.my );
+ } else {
+ browser_window_mouse_click(gw->browser->bw,
+ bmstate|BROWSER_MOUSE_PRESS_1,
sx_origin,sy_origin);
- browser_window_mouse_click(gw->browser->bw,
- bmstate|BROWSER_MOUSE_CLICK_1,
- sx_origin,sy_origin);
- }
- }
-
-
-}
-
-
-/*
- Report scroll event to the browser component.
+ browser_window_mouse_click(gw->browser->bw,
+ bmstate|BROWSER_MOUSE_CLICK_1,
+ sx_origin,sy_origin);
+ }
+ }
+
+
+}
+
+
+/*
+ Report scroll event to the browser component.
*/
void browser_scroll( struct gui_window * gw, short mode, int value, bool abs )
{
@@ -474,80 +474,80 @@
browser_schedule_redraw( gw, bwrect.g_w - w, 0, bwrect.g_w, bwrect.g_h );
}
b->scroll.requested.y = 0;
- b->scroll.requested.x = 0;
- if( b->caret.requested.g_w > 0 ){
- b->caret.redraw = true;
- }
-
+ b->scroll.requested.x = 0;
+ if( b->caret.requested.g_w > 0 ){
+ b->caret.redraw = true;
+ }
+
gw->root->handle->xpos = b->scroll.current.x;
gw->root->handle->ypos = b->scroll.current.y;
-
+
mt_WindSlider( &app, gw->root->handle, HSLIDER|VSLIDER );
}
-/*
- Report keypress to browser component.
- The browser component doesn't listen for keyinput by itself.
- parameter:
- - gui_window ( compocnent owner ).
- - unsigned short nkc ( CFLIB normalised key code )
+/*
+ Report keypress to browser component.
+ The browser component doesn't listen for keyinput by itself.
+ parameter:
+ - gui_window ( compocnent owner ).
+ - unsigned short nkc ( CFLIB normalised key code )
*/
bool browser_input( struct gui_window * gw, unsigned short nkc )
{
LGRECT work;
bool r = false;
unsigned char ascii = (nkc & 0xFF);
- long ucs4;
- long ik = nkc_to_input_key( nkc, &ucs4 );
-
- // pass event to specific control?
-
- if( ik == 0 ){
+ long ucs4;
+ long ik = nkc_to_input_key( nkc, &ucs4 );
+
+ // pass event to specific control?
+
+ if( ik == 0 ){
if (ascii >= 9 ) {
r = browser_window_key_press(gw->browser->bw, ucs4 );
- }
- } else {
- r = browser_window_key_press(gw->browser->bw, ik );
- if( r == false ){
- browser_get_rect(gw, BR_CONTENT, &work);
- switch( ik ){
- case KEY_LINE_START:
- browser_scroll( gw, WA_LFPAGE, work.g_w, false );
- break;
-
- case KEY_LINE_END:
- browser_scroll( gw, WA_RTPAGE, work.g_w, false );
- break;
-
- case KEY_PAGE_UP:
- browser_scroll( gw, WA_UPPAGE, work.g_h, false );
- break;
-
- case KEY_PAGE_DOWN:
- browser_scroll( gw, WA_DNPAGE, work.g_h, false );
- break;
-
- case KEY_RIGHT:
- browser_scroll( gw, WA_RTLINE, 16, false );
- break;
-
- case KEY_LEFT:
- browser_scroll( gw, WA_LFLINE, 16, false );
- break;
-
- case KEY_UP:
- browser_scroll( gw, WA_UPLINE, 16, false);
- break;
-
- case KEY_DOWN:
- browser_scroll( gw, WA_DNLINE, 16, false);
- break;
-
- default:
- break;
- }
- }
- }
+ }
+ } else {
+ r = browser_window_key_press(gw->browser->bw, ik );
+ if( r == false ){
+ browser_get_rect(gw, BR_CONTENT, &work);
+ switch( ik ){
+ case KEY_LINE_START:
+ browser_scroll( gw, WA_LFPAGE, work.g_w, false );
+ break;
+
+ case KEY_LINE_END:
+ browser_scroll( gw, WA_RTPAGE, work.g_w, false );
+ break;
+
+ case KEY_PAGE_UP:
+ browser_scroll( gw, WA_UPPAGE, work.g_h, false );
+ break;
+
+ case KEY_PAGE_DOWN:
+ browser_scroll( gw, WA_DNPAGE, work.g_h, false );
+ break;
+
+ case KEY_RIGHT:
+ browser_scroll( gw, WA_RTLINE, 16, false );
+ break;
+
+ case KEY_LEFT:
+ browser_scroll( gw, WA_LFLINE, 16, false );
+ break;
+
+ case KEY_UP:
+ browser_scroll( gw, WA_UPLINE, 16, false);
+ break;
+
+ case KEY_DOWN:
+ browser_scroll( gw, WA_DNLINE, 16, false);
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
return( r );
}
@@ -559,10 +559,10 @@
CMP_BROWSER b = gw->browser;
if( b->bw->current_content == NULL )
- return ( false );
-
- /* disable redraws when the browser awaits WM_REDRAW caused by resize */
- if( b->reformat_pending )
+ return ( false );
+
+ /* disable redraws when the browser awaits WM_REDRAW caused by resize */
+ if( b->reformat_pending )
return( false );
ret = ( ((b->redraw.areas_used > 0) )
@@ -607,18 +607,19 @@
if( y0 > work.g_h )
return;
- redraw_slot_schedule( &b->redraw, x0, y0, x1, y1 );
+ redraw_slot_schedule( &b->redraw, x0, y0, x1, y1 );
return;
}
-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 )
{
CMP_BROWSER b = gw->browser;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &atari_plotters
};
@@ -631,80 +632,80 @@
-b->scroll.current.y, area, &ctx );
}
-
-/*
- area: the browser canvas
-*/
-void browser_restore_caret_background( struct gui_window * gw, LGRECT * area)
-{
- CMP_BROWSER b = gw->browser;
- LGRECT rect;
- if( area == NULL ){
- browser_get_rect( gw, BR_CONTENT, &rect );
- area = ▭
- }
- /* This call restores the background and releases the memory: */
- // TODO: only release memory/clear flag when the caret is not clipped.
- // TODO: apply clipping.
- w_put_bkgr( &app,
- area->g_x-b->scroll.current.x+b->caret.current.g_x,
- area->g_y-b->scroll.current.y+b->caret.current.g_y,
- gw->browser->caret.current.g_w,
- gw->browser->caret.current.g_h,
- &gw->browser->caret.background
- );
- gw->browser->caret.background.fd_addr = NULL;
-}
-
-/*
- area: the browser canvas
+
+/*
+ area: the browser canvas
+*/
+void browser_restore_caret_background( struct gui_window * gw, LGRECT * area)
+{
+ CMP_BROWSER b = gw->browser;
+ LGRECT rect;
+ if( area == NULL ){
+ browser_get_rect( gw, BR_CONTENT, &rect );
+ area = ▭
+ }
+ /* This call restores the background and releases the memory: */
+ // TODO: only release memory/clear flag when the caret is not clipped.
+ // TODO: apply clipping.
+ w_put_bkgr( &app,
+ area->g_x-b->scroll.current.x+b->caret.current.g_x,
+ area->g_y-b->scroll.current.y+b->caret.current.g_y,
+ gw->browser->caret.current.g_w,
+ gw->browser->caret.current.g_h,
+ &gw->browser->caret.background
+ );
+ gw->browser->caret.background.fd_addr = NULL;
+}
+
+/*
+ area: the browser canvas
*/
void browser_redraw_caret( struct gui_window * gw, LGRECT * area )
{
// TODO: only redraw caret when window is topped.
- if( gw->browser->caret.redraw && gw->browser->caret.requested.g_w > 0 ){
+ if( gw->browser->caret.redraw && gw->browser->caret.requested.g_w > 0 ){
LGRECT caret;
struct s_browser * b = gw->browser;
struct rect old_clip;
- struct rect clip;
-
- if( b->caret.current.g_w > 0 && b->caret.background.fd_addr != NULL ){
- browser_restore_caret_background( gw, area );
- }
+ struct rect clip;
+
+ if( b->caret.current.g_w > 0 && b->caret.background.fd_addr != NULL ){
+ browser_restore_caret_background( gw, area );
+ }
caret = b->caret.requested;
caret.g_x -= b->scroll.current.x - area->g_x;
- caret.g_y -= b->scroll.current.y - area->g_y;
-
- if( !rc_lintersect( area, &caret ) ) {
- return;
- }
-
- MFDB screen;
- short pxy[8];
-
- /* save background: */
- //assert( b->caret.background.fd_addr == NULL );
- init_mfdb( app.nplanes, caret.g_w, caret.g_h, 0,
- &b->caret.background );
- init_mfdb( 0, caret.g_w, caret.g_h, 0, &screen );
- pxy[0] = caret.g_x;
- pxy[1] = caret.g_y;
- pxy[2] = caret.g_x + caret.g_w - 1;
- pxy[3] = caret.g_y + caret.g_h - 1;
- pxy[4] = 0;
- pxy[5] = 0;
- pxy[6] = caret.g_w - 1;
- pxy[7] = caret.g_h - 1;
- /* hide the mouse */
- v_hide_c ( app.graf.handle);
- /* copy screen image */
- vro_cpyfm ( app.graf.handle, S_ONLY, pxy, &screen, &b->caret.background);
- /* restore the mouse */
- v_show_c ( app.graf.handle, 1);
- /* draw caret: */
- caret.g_x -= area->g_x;
- caret.g_y -= area->g_y;
+ caret.g_y -= b->scroll.current.y - area->g_y;
+
+ if( !rc_lintersect( area, &caret ) ) {
+ return;
+ }
+
+ MFDB screen;
+ short pxy[8];
+
+ /* save background: */
+ //assert( b->caret.background.fd_addr == NULL );
+ init_mfdb( app.nplanes, caret.g_w, caret.g_h, 0,
+ &b->caret.background );
+ init_mfdb( 0, caret.g_w, caret.g_h, 0, &screen );
+ pxy[0] = caret.g_x;
+ pxy[1] = caret.g_y;
+ pxy[2] = caret.g_x + caret.g_w - 1;
+ pxy[3] = caret.g_y + caret.g_h - 1;
+ pxy[4] = 0;
+ pxy[5] = 0;
+ pxy[6] = caret.g_w - 1;
+ pxy[7] = caret.g_h - 1;
+ /* hide the mouse */
+ v_hide_c ( app.graf.handle);
+ /* copy screen image */
+ vro_cpyfm ( app.graf.handle, S_ONLY, pxy, &screen, &b->caret.background);
+ /* restore the mouse */
+ v_show_c ( app.graf.handle, 1);
+ /* draw caret: */
+ caret.g_x -= area->g_x;
+ caret.g_y -= area->g_y;
clip.x0 = caret.g_x;
clip.y0 = caret.g_y;
clip.x1 = caret.g_x + caret.g_w-1;
@@ -712,14 +713,14 @@
/* store old clip before adjusting it: */
plot_get_clip( &old_clip );
/* clip to cursor: */
- plot_clip( &clip );
- plot_line( caret.g_x, caret.g_y, caret.g_x, caret.g_y + caret.g_h,
+ plot_clip( &clip );
+ plot_line( caret.g_x, caret.g_y, caret.g_x, caret.g_y + caret.g_h,
plot_style_caret );
/* restore old clip area: */
plot_clip( &old_clip );
b->caret.current.g_x = caret.g_x + gw->browser->scroll.current.x;
b->caret.current.g_y = caret.g_y + gw->browser->scroll.current.y;
- b->caret.current.g_w = caret.g_w;
+ b->caret.current.g_w = caret.g_w;
b->caret.current.g_h = caret.g_h;
}
}
@@ -729,7 +730,7 @@
LGRECT bwrect;
struct s_browser * b = gw->browser;
short todo[4];
- struct rect clip;
+ struct rect clip;
/* used for clipping of content redraw: */
struct rect redraw_area;
@@ -737,7 +738,7 @@
return;
}
- browser_get_rect(gw, BR_CONTENT, &bwrect);
+ browser_get_rect(gw, BR_CONTENT, &bwrect);
plotter->resize(plotter, bwrect.g_w, bwrect.g_h);
plotter->move(plotter, bwrect.g_x, bwrect.g_y );
@@ -746,7 +747,7 @@
clip.x1 = bwrect.g_w;
clip.y1 = bwrect.g_h;
plotter->clip( plotter, &clip );
- if( plotter->lock(plotter) == 0 )
+ if( plotter->lock(plotter) == 0 )
return;
if( b->scroll.required == true && b->bw->current_content != NULL) {
@@ -792,7 +793,7 @@
redraw_area.x0 = area.g_x;
redraw_area.y0 = area.g_y;
redraw_area.x1 = area.g_x + area.g_w;
- redraw_area.y1 = area.g_y + area.g_h;
+ redraw_area.y1 = area.g_y + area.g_h;
browser_redraw_content( gw, 0, 0, &redraw_area );
} else {
/*
@@ -814,7 +815,7 @@
}
b->redraw.areas_used = 0;
}
- if( b->caret.redraw == true && b->bw->current_content != NULL ) {
+ if( b->caret.redraw == true && b->bw->current_content != NULL ) {
LGRECT area;
todo[0] = bwrect.g_x;
todo[1] = bwrect.g_y;
@@ -842,19 +843,19 @@
browser_get_rect( gw, BR_CONTENT, &work );
lclip = work;
if ( !rc_lintersect( (LGRECT*)&buff[4], &lclip ) ) return;
-
- if( b->bw->current_content == NULL ){
- short pxy[4];
- pxy[0] = lclip.g_x;
- pxy[1] = lclip.g_y;
- pxy[2] = lclip.g_x + lclip.g_w - 1;
- pxy[3] = lclip.g_y + lclip.g_h - 1;
+
+ if( b->bw->current_content == NULL ){
+ short pxy[4];
+ pxy[0] = lclip.g_x;
+ pxy[1] = lclip.g_y;
+ pxy[2] = lclip.g_x + lclip.g_w - 1;
+ pxy[3] = lclip.g_y + lclip.g_h - 1;
vsf_color( gw->root->handle->graf->handle, WHITE );
vsf_perimeter( gw->root->handle->graf->handle, 0);
vsf_interior( gw->root->handle->graf->handle, FIS_SOLID );
vsf_style( gw->root->handle->graf->handle, 1);
- v_bar( gw->root->handle->graf->handle, (short*)&pxy );
- return;
+ v_bar( gw->root->handle->graf->handle, (short*)&pxy );
+ return;
}
/* convert redraw coords to framebuffer coords: */
@@ -871,22 +872,22 @@
lclip.g_y = 0;
}
- if( lclip.g_h > 0 && lclip.g_w > 0 ) {
-
- if( gw->browser->reformat_pending == true ){
- LGRECT newsize;
- gw->browser->reformat_pending = false;
- browser_get_rect(gw, BR_CONTENT, &newsize);
- /* this call will also schedule an redraw for the complete */
- /* area. */
- /* Resize must be handled here, because otherwise */
- /* a redraw is scheduled twice (1. by the frontend, 2. by AES) */
- browser_window_reformat(b->bw, false, newsize.g_w, newsize.g_h );
- } else {
+ if( lclip.g_h > 0 && lclip.g_w > 0 ) {
+
+ if( gw->browser->reformat_pending == true ){
+ LGRECT newsize;
+ gw->browser->reformat_pending = false;
+ browser_get_rect(gw, BR_CONTENT, &newsize);
+ /* this call will also schedule an redraw for the complete */
+ /* area. */
+ /* Resize must be handled here, because otherwise */
+ /* a redraw is scheduled twice (1. by the frontend, 2. by AES) */
+ browser_window_reformat(b->bw, false, newsize.g_w, newsize.g_h );
+ } else {
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/toolbar.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/toolbar.c?rev=13335...
==============================================================================
--- trunk/netsurf/atari/toolbar.c (original)
+++ trunk/netsurf/atari/toolbar.c Fri Dec 23 16:39:25 2011
@@ -33,8 +33,8 @@
#include "desktop/history_core.h"
#include "desktop/netsurf.h"
#include "desktop/browser.h"
-#include "desktop/mouse.h"
-#include "desktop/plot_style.h"
+#include "desktop/mouse.h"
+#include "desktop/plot_style.h"
#include "desktop/plotters.h"
#include "atari/clipboard.h"
#include "atari/gui.h"
@@ -44,25 +44,25 @@
#include "atari/clipboard.h"
#include "atari/misc.h"
#include "atari/global_evnt.h"
-#include "atari/plot.h"
+#include "atari/plot.h"
#include "cflib.h"
#include "atari/res/netsurf.rsh"
-#include "atari/plot/plotter.h"
-
-
+#include "atari/plot/plotter.h"
+
+
extern char * cfg_homepage_url;
extern short vdih;
-extern void * h_gem_rsrc;
-extern GEM_PLOTTER plotter;
-static OBJECT * throbber_form = NULL;
-
-static const plot_font_style_t font_style_url = {
- .family = PLOT_FONT_FAMILY_SANS_SERIF,
- .size = TOOLBAR_URL_TEXT_SIZE_PT*FONT_SIZE_SCALE,
- .weight = 400,
- .flags = FONTF_NONE,
- .background = 0xffffff,
- .foreground = 0x0
+extern void * h_gem_rsrc;
+extern GEM_PLOTTER plotter;
+static OBJECT * throbber_form = NULL;
+
+static const plot_font_style_t font_style_url = {
+ .family = PLOT_FONT_FAMILY_SANS_SERIF,
+ .size = TOOLBAR_URL_TEXT_SIZE_PT*FONT_SIZE_SCALE,
+ .weight = 400,
+ .flags = FONTF_NONE,
+ .background = 0xffffff,
+ .foreground = 0x0
};
/* prototypes & order for button widgets: */
@@ -74,24 +74,24 @@
{ TOOLBAR_BT_RELOAD, tb_reload_click, NULL },
{ TOOLBAR_BT_STOP, tb_stop_click, NULL },
{ 0, NULL, NULL }
-};
-
+};
+
static void tb_txt_request_redraw(void *data, int x, int y, int w, int h);
static void __CDECL button_redraw( COMPONENT *c, long buff[8])
{
OBJECT *tree = (OBJECT*)mt_CompDataSearch( &app, c, CDT_OBJECT );
struct gui_window * gw = mt_CompDataSearch( &app, c, CDT_OWNER );
- LGRECT work,clip;
+ LGRECT work,clip;
GRECT todo,crect;
short pxy[4];
mt_CompGetLGrect(&app, c, WF_WORKXYWH, &work);
- clip = work;
+ clip = work;
/* return if component and redraw region does not intersect: */
if ( !rc_lintersect( (LGRECT*)&buff[4], &clip ) ) {
return;
- }
+ }
/* clip contains intersecting part: */
pxy[0] = clip.g_x;
pxy[1] = clip.g_y;
@@ -112,23 +112,23 @@
pxy[3] = MIN( (short)buff[5] + buff[7], work.g_y + work.g_h - 2);
vswr_mode( vdih, MD_REPLACE);
v_bar( vdih, (short*)&pxy );
-
- /* go through the rectangle list, using classic AES methods. */
- /* Windom ComGetLGrect is buggy for WF_FIRST/NEXTXYWH */
- crect.g_x = clip.g_x;
- crect.g_y = clip.g_y;
- crect.g_w = clip.g_w;
- crect.g_h = clip.g_h;
+
+ /* go through the rectangle list, using classic AES methods. */
+ /* Windom ComGetLGrect is buggy for WF_FIRST/NEXTXYWH */
+ crect.g_x = clip.g_x;
+ crect.g_y = clip.g_y;
+ crect.g_w = clip.g_w;
+ crect.g_h = clip.g_h;
wind_get(gw->root->handle->handle, WF_FIRSTXYWH,
- &todo.g_x, &todo.g_y, &todo.g_w, &todo.g_h );
- while( (todo.g_w > 0) && (todo.g_h > 0) ){
-
- if( rc_intersect(&crect, &todo) ){
- objc_draw( tree, 0, 0, todo.g_x, todo.g_y, todo.g_w, todo.g_h );
- }
+ &todo.g_x, &todo.g_y, &todo.g_w, &todo.g_h );
+ while( (todo.g_w > 0) && (todo.g_h > 0) ){
+
+ if( rc_intersect(&crect, &todo) ){
+ objc_draw( tree, 0, 0, todo.g_x, todo.g_y, todo.g_w, todo.g_h );
+ }
wind_get(gw->root->handle->handle, WF_NEXTXYWH,
- &todo.g_x, &todo.g_y, &todo.g_w, &todo.g_h );
- }
+ &todo.g_x, &todo.g_y, &todo.g_w, &todo.g_h );
+ }
if( gw->root->toolbar->buttons[0].comp == c && work.g_x == buff[4] ){
vsl_color( vdih, LWHITE );
@@ -231,67 +231,67 @@
static
void __CDECL evnt_url_redraw( COMPONENT *c, long buff[8] )
-{
+{
LGRECT work, clip;
- struct gui_window * gw;
+ struct gui_window * gw;
short pxy[10];
- gw = (struct gui_window *)mt_CompDataSearch(&app, c, CDT_OWNER);
+ gw = (struct gui_window *)mt_CompDataSearch(&app, c, CDT_OWNER);
if( gw == NULL )
return;
- CMP_TOOLBAR tb = gw->root->toolbar;
- mt_CompGetLGrect(&app, tb->url.comp, WF_WORKXYWH, &work);
-
- // this last pixel is drawn by the root component of the toolbar:
- // it's the black border, so we leave it out:
+ CMP_TOOLBAR tb = gw->root->toolbar;
+ mt_CompGetLGrect(&app, tb->url.comp, WF_WORKXYWH, &work);
+
+ // this last pixel is drawn by the root component of the toolbar:
+ // it's the black border, so we leave it out:
work.g_h--;
clip = work;
- if ( !rc_lintersect( (LGRECT*)&buff[4], &clip ) ) return;
-
+ if ( !rc_lintersect( (LGRECT*)&buff[4], &clip ) ) return;
+
pxy[0] = clip.g_x;
pxy[1] = clip.g_y;
- pxy[2] = clip.g_w + clip.g_x-1;
+ pxy[2] = clip.g_w + clip.g_x-1;
pxy[3] = clip.g_h + clip.g_y-1;
- vs_clip( vdih, 1, (short*)&pxy );
+ vs_clip( vdih, 1, (short*)&pxy );
vsf_perimeter( vdih, 0 );
vsf_interior( vdih , 1 );
- vsf_color( vdih, LWHITE );
-
- //left margin:
+ vsf_color( vdih, LWHITE );
+
+ //left margin:
pxy[0] = work.g_x;
pxy[1] = work.g_y;
pxy[2] = work.g_x + TOOLBAR_URL_MARGIN_LEFT-1;
- pxy[3] = work.g_y + work.g_h-1;
- v_bar( vdih, pxy );
-
- // right margin:
+ pxy[3] = work.g_y + work.g_h-1;
+ v_bar( vdih, pxy );
+
+ // right margin:
pxy[0] = work.g_x+work.g_w-TOOLBAR_URL_MARGIN_RIGHT;
pxy[1] = work.g_y;
pxy[2] = work.g_x+work.g_w-1;
- pxy[3] = work.g_y+work.g_h-1;
- v_bar( vdih, pxy );
-
- // top margin:
+ pxy[3] = work.g_y+work.g_h-1;
+ v_bar( vdih, pxy );
+
+ // top margin:
pxy[0] = work.g_x;
pxy[1] = work.g_y;
pxy[2] = work.g_x+work.g_w-1;
- pxy[3] = work.g_y+TOOLBAR_URL_MARGIN_TOP-1;
- v_bar( vdih, pxy );
-
- // bottom margin:
+ pxy[3] = work.g_y+TOOLBAR_URL_MARGIN_TOP-1;
+ v_bar( vdih, pxy );
+
+ // bottom margin:
pxy[0] = work.g_x;
pxy[1] = work.g_y+work.g_h-TOOLBAR_URL_MARGIN_BOTTOM;
pxy[2] = work.g_x+work.g_w-1;
- pxy[3] = work.g_y+work.g_h-1;
- v_bar( vdih, pxy );
-
- vs_clip( vdih, 0, (short*)&pxy );
-
- // TBD: request redraw of textarea for specific region.
- clip.g_x -= work.g_x+TOOLBAR_URL_MARGIN_LEFT;
- clip.g_y -= work.g_y+TOOLBAR_URL_MARGIN_TOP;
- tb_txt_request_redraw( tb, clip.g_x, clip.g_y, clip.g_w, clip.g_h );
+ pxy[3] = work.g_y+work.g_h-1;
+ v_bar( vdih, pxy );
+
+ vs_clip( vdih, 0, (short*)&pxy );
+
+ // TBD: request redraw of textarea for specific region.
+ clip.g_x -= work.g_x+TOOLBAR_URL_MARGIN_LEFT;
+ clip.g_y -= work.g_y+TOOLBAR_URL_MARGIN_TOP;
+ tb_txt_request_redraw( tb, clip.g_x, clip.g_y, clip.g_w, clip.g_h );
}
static
@@ -312,34 +312,34 @@
/* TODO: reset mouse state of browser window? */
/* select whole text when newly focused, otherwise set caret to end of text */
if( !window_url_widget_has_focus(gw) ) {
- window_set_focus( gw, URL_WIDGET, (void*)&tb->url );
+ window_set_focus( gw, URL_WIDGET, (void*)&tb->url );
} else {
if( mb & 1 ) {
- textarea_mouse_action( tb->url.textarea, BROWSER_MOUSE_DRAG_1,
- mx, my );
- short prev_x = mx;
- short prev_y = my;
- do{
- if( abs(prev_x-mx) > 5 || abs(prev_y-my) > 5 ){
- textarea_mouse_action( tb->url.textarea,
- BROWSER_MOUSE_HOLDING_1, mx, my );
- prev_x = mx;
- prev_y = my;
- if( tb->url.redraw ){
- tb_url_redraw( gw );
- }
- }
- graf_mkstate( &mx, &my, &mb, &kstat );
+ textarea_mouse_action( tb->url.textarea, BROWSER_MOUSE_DRAG_1,
+ mx, my );
+ short prev_x = mx;
+ short prev_y = my;
+ do{
+ if( abs(prev_x-mx) > 5 || abs(prev_y-my) > 5 ){
+ textarea_mouse_action( tb->url.textarea,
+ BROWSER_MOUSE_HOLDING_1, mx, my );
+ prev_x = mx;
+ prev_y = my;
+ if( tb->url.redraw ){
+ tb_url_redraw( gw );
+ }
+ }
+ graf_mkstate( &mx, &my, &mb, &kstat );
mx = mx - (work.g_x + TOOLBAR_URL_MARGIN_LEFT);
- my = my - (work.g_y + TOOLBAR_URL_MARGIN_TOP);
- }while( mb & 1 );
- textarea_drag_end( tb->url.textarea, 0, mx, my );
+ my = my - (work.g_y + TOOLBAR_URL_MARGIN_TOP);
+ }while( mb & 1 );
+ textarea_drag_end( tb->url.textarea, 0, mx, my );
} else {
- /* TODO: recognize click + shift key */
- int mstate = BROWSER_MOUSE_PRESS_1;
- if( (kstat & (K_LSHIFT|K_RSHIFT)) != 0 )
+ /* TODO: recognize click + shift key */
+ int mstate = BROWSER_MOUSE_PRESS_1;
+ if( (kstat & (K_LSHIFT|K_RSHIFT)) != 0 )
mstate = BROWSER_MOUSE_MOD_1;
- textarea_mouse_action( tb->url.textarea,
+ textarea_mouse_action( tb->url.textarea,
BROWSER_MOUSE_PRESS_1, mx, my );
}
}
@@ -347,21 +347,21 @@
ApplWrite( _AESapid, WM_REDRAW, gw->root->handle->handle,
work.g_x, work.g_y, work.g_w, work.g_h );
-}
-
-void tb_adjust_size( struct gui_window * gw )
-{
- LGRECT work;
- CMP_TOOLBAR t = gw->root->toolbar;
-
- mt_CompGetLGrect( &app, t->url.comp, WF_WORKXYWH, &work);
- 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);
- textarea_set_dimensions( t->url.textarea, work.g_w, work.g_h );
- tb_txt_request_redraw( t, 0,0, work.g_w-1, work.g_h-1);
-}
-
+}
+
+void tb_adjust_size( struct gui_window * gw )
+{
+ LGRECT work;
+ CMP_TOOLBAR t = gw->root->toolbar;
+
+ mt_CompGetLGrect( &app, t->url.comp, WF_WORKXYWH, &work);
+ 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);
+ textarea_set_dimensions( t->url.textarea, work.g_w, work.g_h );
+ tb_txt_request_redraw( t, 0,0, work.g_w-1, work.g_h-1);
+}
+
static void __CDECL evnt_toolbar_redraw( COMPONENT *c, long buff[8], void *data )
{
LGRECT work, clip;
@@ -381,15 +381,15 @@
pxy[1] = pxy[3] = work.g_y + work.g_h-1 ;
pxy[2] = clip.g_x + clip.g_w;
v_pline( vdih, 2, (short*)&pxy );
-}
-
-
-static void tb_txt_request_redraw(void *data, int x, int y, int w, int h)
-{
- LGRECT work;
- if( data == NULL )
- return;
- CMP_TOOLBAR t = data;
+}
+
+
+static void tb_txt_request_redraw(void *data, int x, int y, int w, int h)
+{
+ LGRECT work;
+ if( data == NULL )
+ return;
+ CMP_TOOLBAR t = data;
if( t->url.redraw == false ){
t->url.redraw = true;
t->url.rdw_area.g_x = x;
@@ -404,41 +404,42 @@
int oldy1 = t->url.rdw_area.g_y + t->url.rdw_area.g_h;
t->url.rdw_area.g_x = MIN(t->url.rdw_area.g_x, x);
t->url.rdw_area.g_y = MIN(t->url.rdw_area.g_y, y);
- t->url.rdw_area.g_w = ( oldx1 > newx1 ) ?
+ t->url.rdw_area.g_w = ( oldx1 > newx1 ) ?
oldx1 - t->url.rdw_area.g_x : newx1 - t->url.rdw_area.g_x;
- t->url.rdw_area.g_h = ( oldy1 > newy1 ) ?
+ t->url.rdw_area.g_h = ( oldy1 > newy1 ) ?
oldy1 - t->url.rdw_area.g_y : newy1 - t->url.rdw_area.g_y;
- }
-}
-
-void tb_url_redraw( struct gui_window * gw )
-{
- CMP_TOOLBAR t = gw->root->toolbar;
+ }
+}
+
+void tb_url_redraw( struct gui_window * gw )
+{
+ CMP_TOOLBAR t = gw->root->toolbar;
if (t != NULL) {
if( t->url.redraw && ((plotter->flags & PLOT_FLAG_OFFSCREEN) == 0) ) {
const struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &atari_plotters
};
short todo[4];
- LGRECT work;
-
+ LGRECT work;
+
mt_CompGetLGrect(&app, gw->root->toolbar->url.comp, WF_WORKXYWH, &work);
- 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;
+ 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 );
- if( plotter->lock( plotter ) == 0 )
+ plotter->move(plotter, work.g_x, work.g_y );
+ if( plotter->lock( plotter ) == 0 )
return;
todo[0] = work.g_x;
todo[1] = work.g_y;
todo[2] = todo[0] + work.g_w-1;
- todo[3] = todo[1] + work.g_h-1;
+ todo[3] = todo[1] + work.g_h-1;
vs_clip(plotter->vdi_handle, 1, (short*)&todo );
if( wind_get(gw->root->handle->handle, WF_FIRSTXYWH,
@@ -457,12 +458,12 @@
todo[1] = 0;
}
- if (rc_intersect(&t->url.rdw_area,(GRECT *)&todo)) {
- struct rect clip = {
- .x0 = todo[0],
- .y0 = todo[1],
- .x1 = todo[0]+todo[2],
- .y1 = todo[1]+todo[3]
+ if (rc_intersect(&t->url.rdw_area,(GRECT *)&todo)) {
+ struct rect clip = {
+ .x0 = todo[0],
+ .y0 = todo[1],
+ .x1 = todo[0]+todo[2],
+ .y1 = todo[1]+todo[3]
};
textarea_redraw( t->url.textarea, 0, 0, &clip, &ctx );
}
@@ -471,10 +472,10 @@
break;
}
}
- } else {
+ } else {
plotter->unlock( plotter );
return;
- }
+ }
plotter->unlock( plotter );
vs_clip(plotter->vdi_handle, 0, (short*)&todo);
t->url.redraw = false;
@@ -485,9 +486,9 @@
} else {
/* just copy stuff from the offscreen buffer */
}
- }
-}
-
+ }
+}
+
CMP_TOOLBAR tb_create( struct gui_window * gw )
{
int i;
@@ -497,7 +498,7 @@
if( t == NULL )
return( NULL );
- t->owner = gw;
+ t->owner = gw;
/* create the root component: */
t->comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL, TOOLBAR_HEIGHT, 0);
@@ -528,12 +529,12 @@
}
/* create the url widget: */
- t->url.textarea = textarea_create( 300, TOOLBAR_TEXTAREA_HEIGHT, 0,
- &font_style_url, tb_txt_request_redraw,
- t );
- if( t->url.textarea != NULL ){
- textarea_set_text(t->url.textarea, "http://");
- }
+ t->url.textarea = textarea_create( 300, TOOLBAR_TEXTAREA_HEIGHT, 0,
+ &font_style_url, tb_txt_request_redraw,
+ t );
+ if( t->url.textarea != NULL ){
+ textarea_set_text(t->url.textarea, "http://");
+ }
t->url.comp = (COMPONENT*)mt_CompCreate(&app, CLT_HORIZONTAL, TOOLBAR_HEIGHT, 1);
mt_CompEvntAttach( &app, t->url.comp, WM_REDRAW, evnt_url_redraw );
@@ -570,7 +571,7 @@
mt_ObjcFree( &app, (OBJECT*)mt_CompDataSearch(&app, tb->buttons[i].comp, CDT_OBJECT) );
i++;
}
- free( tb->buttons );
+ free( tb->buttons );
textarea_destroy( tb->url.textarea );
mt_CompDelete( &app, tb->comp);
free( tb );
@@ -646,20 +647,20 @@
if( gw->browser->attached == false )
return;
- struct s_url_widget * url = &gw->root->toolbar->url;
-
+ struct s_url_widget * url = &gw->root->toolbar->url;
+
assert( gw != NULL );
assert( gw->browser != NULL );
assert( gw->root != NULL );
- assert( gw->browser->bw != NULL );
-
- textarea_set_text(url->textarea, text);
-
- mt_CompGetLGrect( &app, gw->root->toolbar->url.comp, WF_WORKXYWH, &work);
- 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 );
+ assert( gw->browser->bw != NULL );
+
+ textarea_set_text(url->textarea, text);
+
+ mt_CompGetLGrect( &app, gw->root->toolbar->url.comp, WF_WORKXYWH, &work);
+ 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 );
return;
}
@@ -673,41 +674,41 @@
CMP_TOOLBAR tb = gw->root->toolbar;
assert(tb!=NULL);
LGRECT work;
- bool ret = false;
-
- assert( gw != NULL );
-
- long ucs4;
- long ik = nkc_to_input_key( nkc, &ucs4 );
-
- if( ik == 0 ){
+ bool ret = false;
+
+ assert( gw != NULL );
+
+ long ucs4;
+ long ik = nkc_to_input_key( nkc, &ucs4 );
+
+ if( ik == 0 ){
if ( (nkc&0xFF) >= 9 ) {
ret = textarea_keypress( tb->url.textarea, ucs4 );
- }
- }
- else if( ik == KEY_CR || ik == KEY_NL ){
- char tmp_url[PATH_MAX];
- if( textarea_get_text( tb->url.textarea, tmp_url, PATH_MAX) > 0 ) {
+ }
+ }
+ else if( ik == KEY_CR || ik == KEY_NL ){
+ char tmp_url[PATH_MAX];
+ if( textarea_get_text( tb->url.textarea, tmp_url, PATH_MAX) > 0 ) {
window_set_focus( gw, BROWSER, gw->browser);
- browser_window_go(gw->browser->bw, (const char*)&tmp_url, 0, true);
- ret = true;
- }
- }
- else if( ik == KEY_COPY_SELECTION ){
- // copy whole text
- char * text;
- int len;
- len = textarea_get_text( tb->url.textarea, NULL, 0 );
- text = malloc( len+1 );
- if( text ){
- textarea_get_text( tb->url.textarea, text, len+1 );
- scrap_txt_write( &app, text );
- free( text );
- }
- }
- else {
- ret = textarea_keypress( tb->url.textarea, ik );
- }
+ browser_window_go(gw->browser->bw, (const char*)&tmp_url, 0, true);
+ ret = true;
+ }
+ }
+ else if( ik == KEY_COPY_SELECTION ){
+ // copy whole text
+ char * text;
+ int len;
+ len = textarea_get_text( tb->url.textarea, NULL, 0 );
+ text = malloc( len+1 );
+ if( text ){
+ textarea_get_text( tb->url.textarea, text, len+1 );
+ scrap_txt_write( &app, text );
+ free( text );
+ }
+ }
+ else {
+ ret = textarea_keypress( tb->url.textarea, ik );
+ }
return( ret );
}
Modified: trunk/netsurf/atari/treeview.c
URL: http://source.netsurf-browser.org/trunk/netsurf/atari/treeview.c?rev=1333...
==============================================================================
--- trunk/netsurf/atari/treeview.c (original)
+++ trunk/netsurf/atari/treeview.c Fri Dec 23 16:39:25 2011
@@ -61,25 +61,25 @@
bool r=false;
long kstate = 0;
long kcode = 0;
- long ucs4;
- long ik;
+ long ucs4;
+ long ik;
unsigned short nkc = 0;
unsigned short nks = 0;
unsigned char ascii;
-
- NSTREEVIEW tv = (NSTREEVIEW) data;
+
+ NSTREEVIEW tv = (NSTREEVIEW) data;
kstate = evnt.mkstate;
kcode = evnt.keybd;
- nkc= gem_to_norm( (short)kstate, (short)kcode );
+ nkc= gem_to_norm( (short)kstate, (short)kcode );
ascii = (nkc & 0xFF);
- ik = nkc_to_input_key( nkc, &ucs4 );
-
- if( ik == 0 ){
+ ik = nkc_to_input_key( nkc, &ucs4 );
+
+ if( ik == 0 ){
if (ascii >= 9 ) {
r = tree_keypress( tv->tree, ucs4 );
- }
- } else {
- r = tree_keypress( tv->tree, ik );
+ }
+ } else {
+ r = tree_keypress( tv->tree, ik );
}
}
@@ -104,16 +104,16 @@
clip.g_y = 0;
}
if( clip.g_h > 0 && clip.g_w > 0 ) {
- atari_treeview_request_redraw(
- win->xpos*win->w_u + clip.g_x,
+ atari_treeview_request_redraw(
+ win->xpos*win->w_u + clip.g_x,
win->ypos*win->h_u + clip.g_y,
- clip.g_w, clip.g_h, tv
+ clip.g_w, clip.g_h, tv
);
}
}
-static void __CDECL evnt_tv_mbutton( WINDOW *win, short buff[8], void * data )
-{
+static void __CDECL evnt_tv_mbutton( WINDOW *win, short buff[8], void * data )
+{
GRECT work;
NSTREEVIEW tv = (NSTREEVIEW) data;
if( tv == NULL )
@@ -121,81 +121,81 @@
if( evnt.mbut & 2 ) {
/* do not handle right click */
return;
- }
-
- WindGetGrect( tv->window, WF_WORKXYWH, &work );
-
+ }
+
+ WindGetGrect( tv->window, WF_WORKXYWH, &work );
+
/* mouse click relative origin: */
short origin_rel_x = (evnt.mx-work.g_x)+(win->xpos*win->w_u);
- short origin_rel_y = (evnt.my-work.g_y)+(win->ypos*win->h_u);
-
- if( origin_rel_x >= 0 && origin_rel_y >= 0
- && evnt.mx < work.g_x + work.g_w
- && evnt.my < work.g_y + work.g_h )
- {
- int bms;
- bool ignore=false;
- short cur_rel_x, cur_rel_y, dummy, mbut;
-
+ short origin_rel_y = (evnt.my-work.g_y)+(win->ypos*win->h_u);
+
+ if( origin_rel_x >= 0 && origin_rel_y >= 0
+ && evnt.mx < work.g_x + work.g_w
+ && evnt.my < work.g_y + work.g_h )
+ {
+ int bms;
+ bool ignore=false;
+ short cur_rel_x, cur_rel_y, dummy, mbut;
+
if( evnt.nb_click == 2 ){
- tree_mouse_action(tv->tree,
- BROWSER_MOUSE_CLICK_1 | BROWSER_MOUSE_DOUBLE_CLICK,
- origin_rel_x, origin_rel_y );
- return;
- }
-
- graf_mkstate(&cur_rel_x, &cur_rel_x, &mbut, &dummy);
- if( (mbut&1) == 0 ){
- bms = BROWSER_MOUSE_CLICK_1 | BROWSER_MOUSE_PRESS_1;
- if( evnt.nb_click == 2 ) {
- bms = BROWSER_MOUSE_DOUBLE_CLICK;
+ tree_mouse_action(tv->tree,
+ BROWSER_MOUSE_CLICK_1 | BROWSER_MOUSE_DOUBLE_CLICK,
+ origin_rel_x, origin_rel_y );
+ return;
+ }
+
+ graf_mkstate(&cur_rel_x, &cur_rel_x, &mbut, &dummy);
+ if( (mbut&1) == 0 ){
+ bms = BROWSER_MOUSE_CLICK_1 | BROWSER_MOUSE_PRESS_1;
+ if( evnt.nb_click == 2 ) {
+ bms = BROWSER_MOUSE_DOUBLE_CLICK;
}
- tree_mouse_action(tv->tree, bms, origin_rel_x, origin_rel_y );
- } else {
- /* button still pressed */
-
- short prev_x = origin_rel_x;
- short prev_y = origin_rel_y;
-
- cur_rel_x = origin_rel_x;
- cur_rel_y = origin_rel_y;
-
- if( tree_is_edited(tv->tree) ){
- gem_set_cursor(&gem_cursors.ibeam);
- } else {
- gem_set_cursor(&gem_cursors.hand);
- }
-
+ tree_mouse_action(tv->tree, bms, origin_rel_x, origin_rel_y );
+ } else {
+ /* button still pressed */
+
+ short prev_x = origin_rel_x;
+ short prev_y = origin_rel_y;
+
+ cur_rel_x = origin_rel_x;
+ cur_rel_y = origin_rel_y;
+
+ if( tree_is_edited(tv->tree) ){
+ gem_set_cursor(&gem_cursors.ibeam);
+ } else {
+ gem_set_cursor(&gem_cursors.hand);
+ }
+
tv->startdrag.x = origin_rel_x;
- tv->startdrag.y = origin_rel_y;
-
- tree_mouse_action( tv->tree,
- BROWSER_MOUSE_DRAG_1 | BROWSER_MOUSE_DRAG_ON ,
- cur_rel_x, cur_rel_y );
- do{
- if( abs(prev_x-cur_rel_x) > 5 || abs(prev_y-cur_rel_y) > 5 ){
- tree_mouse_action( tv->tree,
- BROWSER_MOUSE_HOLDING_1 | BROWSER_MOUSE_DRAG_ON,
- cur_rel_x, cur_rel_y);
- prev_x = cur_rel_x;
- prev_y = cur_rel_y;
- }
-
- if( tv->redraw )
- atari_treeview_redraw( tv );
- /* sample mouse button state: */
- graf_mkstate(&cur_rel_x, &cur_rel_y, &mbut, &dummy);
+ tv->startdrag.y = origin_rel_y;
+
+ tree_mouse_action( tv->tree,
+ BROWSER_MOUSE_DRAG_1 | BROWSER_MOUSE_DRAG_ON ,
+ cur_rel_x, cur_rel_y );
+ do{
+ if( abs(prev_x-cur_rel_x) > 5 || abs(prev_y-cur_rel_y) > 5 ){
+ tree_mouse_action( tv->tree,
+ BROWSER_MOUSE_HOLDING_1 | BROWSER_MOUSE_DRAG_ON,
+ cur_rel_x, cur_rel_y);
+ prev_x = cur_rel_x;
+ prev_y = cur_rel_y;
+ }
+
+ if( tv->redraw )
+ atari_treeview_redraw( tv );
+ /* sample mouse button state: */
+ graf_mkstate(&cur_rel_x, &cur_rel_y, &mbut, &dummy);
cur_rel_x = (cur_rel_x-work.g_x)+(win->xpos*win->w_u);
- cur_rel_y = (cur_rel_y-work.g_y)+(win->ypos*win->h_u);
- } while( mbut & 1 );
-
- tree_drag_end(tv->tree, 0, tv->startdrag.x, tv->startdrag.y,
- cur_rel_x, cur_rel_y );
- gem_set_cursor(&gem_cursors.arrow);
- }
- }
-}
-
+ cur_rel_y = (cur_rel_y-work.g_y)+(win->ypos*win->h_u);
+ } while( mbut & 1 );
+
+ tree_drag_end(tv->tree, 0, tv->startdrag.x, tv->startdrag.y,
+ cur_rel_x, cur_rel_y );
+ gem_set_cursor(&gem_cursors.arrow);
+ }
+ }
+}
+
NSTREEVIEW atari_treeview_create( uint32_t flags, WINDOW *win )
{
if( win == NULL )
@@ -274,12 +274,13 @@
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &atari_plotters
};
plotter->resize(plotter, work.g_w, work.g_h);
- plotter->move(plotter, work.g_x, work.g_y );
- if( plotter->lock( plotter ) == 0 )
+ plotter->move(plotter, work.g_x, work.g_y );
+ if( plotter->lock( plotter ) == 0 )
return;
todo[0] = work.g_x;
@@ -314,10 +315,10 @@
break;
}
}
- } else {
+ } else {
plotter->unlock( plotter );
return;
- }
+ }
plotter->unlock( plotter );
vs_clip(plotter->vdi_handle, 0, (short*)&todo);
tv->redraw = false;
Modified: trunk/netsurf/beos/beos_scaffolding.cpp
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/beos_scaffolding.cpp...
==============================================================================
--- trunk/netsurf/beos/beos_scaffolding.cpp (original)
+++ trunk/netsurf/beos/beos_scaffolding.cpp Fri Dec 23 16:39:25 2011
@@ -1387,6 +1387,7 @@
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &nsbeos_plotters
};
Modified: trunk/netsurf/beos/beos_thumbnail.cpp
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/beos_thumbnail.cpp?r...
==============================================================================
--- trunk/netsurf/beos/beos_thumbnail.cpp (original)
+++ trunk/netsurf/beos/beos_thumbnail.cpp Fri Dec 23 16:39:25 2011
@@ -73,6 +73,7 @@
struct redraw_context ctx;
ctx.interactive = false;
+ ctx.background_images = true;
ctx.plot = &nsbeos_plotters;
assert(content);
Modified: trunk/netsurf/beos/beos_window.cpp
URL: http://source.netsurf-browser.org/trunk/netsurf/beos/beos_window.cpp?rev=...
==============================================================================
--- trunk/netsurf/beos/beos_window.cpp (original)
+++ trunk/netsurf/beos/beos_window.cpp Fri Dec 23 16:39:25 2011
@@ -783,7 +783,7 @@
float scale = g->bw->scale;
struct rect clip;
- struct redraw_context ctx = { true, &nsbeos_plotters };
+ struct redraw_context ctx = { true, true, &nsbeos_plotters };
assert(g);
assert(g->bw);
Modified: trunk/netsurf/cocoa/BrowserView.m
URL: http://source.netsurf-browser.org/trunk/netsurf/cocoa/BrowserView.m?rev=1...
==============================================================================
--- trunk/netsurf/cocoa/BrowserView.m (original)
+++ trunk/netsurf/cocoa/BrowserView.m Fri Dec 23 16:39:25 2011
@@ -148,6 +148,7 @@
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &cocoa_plotters
};
Modified: trunk/netsurf/cocoa/HistoryView.m
URL: http://source.netsurf-browser.org/trunk/netsurf/cocoa/HistoryView.m?rev=1...
==============================================================================
--- trunk/netsurf/cocoa/HistoryView.m (original)
+++ trunk/netsurf/cocoa/HistoryView.m Fri Dec 23 16:39:25 2011
@@ -59,6 +59,7 @@
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &cocoa_plotters
};
Modified: trunk/netsurf/cocoa/Tree.m
URL: http://source.netsurf-browser.org/trunk/netsurf/cocoa/Tree.m?rev=13335&r1...
==============================================================================
--- trunk/netsurf/cocoa/Tree.m (original)
+++ trunk/netsurf/cocoa/Tree.m Fri Dec 23 16:39:25 2011
@@ -127,6 +127,7 @@
{
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &cocoa_plotters
};
Modified: trunk/netsurf/cocoa/thumbnail.m
URL: http://source.netsurf-browser.org/trunk/netsurf/cocoa/thumbnail.m?rev=133...
==============================================================================
--- trunk/netsurf/cocoa/thumbnail.m (original)
+++ trunk/netsurf/cocoa/thumbnail.m Fri Dec 23 16:39:25 2011
@@ -34,6 +34,7 @@
struct redraw_context ctx = {
.interactive = false,
+ .background_images = true,
.plot = &cocoa_plotters
};
Modified: trunk/netsurf/framebuffer/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/gui.c?rev=133...
==============================================================================
--- trunk/netsurf/framebuffer/gui.c (original)
+++ trunk/netsurf/framebuffer/gui.c Fri Dec 23 16:39:25 2011
@@ -304,6 +304,7 @@
struct rect clip;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &fb_plotters
};
Modified: trunk/netsurf/framebuffer/localhistory.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/localhistory....
==============================================================================
--- trunk/netsurf/framebuffer/localhistory.c (original)
+++ trunk/netsurf/framebuffer/localhistory.c Fri Dec 23 16:39:25 2011
@@ -62,6 +62,7 @@
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &fb_plotters
};
Modified: trunk/netsurf/framebuffer/thumbnail.c
URL: http://source.netsurf-browser.org/trunk/netsurf/framebuffer/thumbnail.c?r...
==============================================================================
--- trunk/netsurf/framebuffer/thumbnail.c (original)
+++ trunk/netsurf/framebuffer/thumbnail.c Fri Dec 23 16:39:25 2011
@@ -43,6 +43,7 @@
struct redraw_context ctx = {
.interactive = false,
+ .background_images = true,
.plot = &fb_plotters
};
Modified: trunk/netsurf/gtk/scaffolding.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/scaffolding.c?rev=133...
==============================================================================
--- trunk/netsurf/gtk/scaffolding.c (original)
+++ trunk/netsurf/gtk/scaffolding.c Fri Dec 23 16:39:25 2011
@@ -1512,6 +1512,7 @@
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &nsgtk_plotters
};
Modified: trunk/netsurf/gtk/thumbnail.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/thumbnail.c?rev=13335...
==============================================================================
--- trunk/netsurf/gtk/thumbnail.c (original)
+++ trunk/netsurf/gtk/thumbnail.c Fri Dec 23 16:39:25 2011
@@ -63,6 +63,7 @@
struct redraw_context ctx = {
.interactive = false,
+ .background_images = true,
.plot = &nsgtk_plotters
};
Modified: trunk/netsurf/gtk/treeview.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/treeview.c?rev=13335&...
==============================================================================
--- trunk/netsurf/gtk/treeview.c (original)
+++ trunk/netsurf/gtk/treeview.c Fri Dec 23 16:39:25 2011
@@ -171,6 +171,7 @@
struct tree *tree = (struct tree *) g;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &nsgtk_plotters
};
int x, y, width, height;
Modified: trunk/netsurf/gtk/window.c
URL: http://source.netsurf-browser.org/trunk/netsurf/gtk/window.c?rev=13335&r1...
==============================================================================
--- trunk/netsurf/gtk/window.c (original)
+++ trunk/netsurf/gtk/window.c Fri Dec 23 16:39:25 2011
@@ -145,6 +145,7 @@
struct rect clip;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &nsgtk_plotters
};
Modified: trunk/netsurf/monkey/browser.c
URL: http://source.netsurf-browser.org/trunk/netsurf/monkey/browser.c?rev=1333...
==============================================================================
--- trunk/netsurf/monkey/browser.c (original)
+++ trunk/netsurf/monkey/browser.c Fri Dec 23 16:39:25 2011
@@ -449,6 +449,7 @@
struct rect clip;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &monkey_plotters
};
Modified: trunk/netsurf/riscos/gui/url_bar.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/gui/url_bar.c?rev=...
==============================================================================
--- trunk/netsurf/riscos/gui/url_bar.c (original)
+++ trunk/netsurf/riscos/gui/url_bar.c Fri Dec 23 16:39:25 2011
@@ -584,6 +584,7 @@
struct content_redraw_data data;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &ro_plotters
};
Modified: trunk/netsurf/riscos/history.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/history.c?rev=1333...
==============================================================================
--- trunk/netsurf/riscos/history.c (original)
+++ trunk/netsurf/riscos/history.c Fri Dec 23 16:39:25 2011
@@ -141,6 +141,7 @@
os_error *error;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &ro_plotters
};
Modified: trunk/netsurf/riscos/print.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/print.c?rev=13335&...
==============================================================================
--- trunk/netsurf/riscos/print.c (original)
+++ trunk/netsurf/riscos/print.c Fri Dec 23 16:39:25 2011
@@ -686,6 +686,7 @@
/* TODO: turn knockout off for print */
struct redraw_context ctx = {
.interactive = false,
+ .background_images = false,
.plot = &ro_plotters
};
@@ -806,6 +807,7 @@
os_error *error;
struct redraw_context ctx = {
.interactive = false,
+ .background_images = false,
.plot = &print_fonts_plotters
};
Modified: trunk/netsurf/riscos/save_draw.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/save_draw.c?rev=13...
==============================================================================
--- trunk/netsurf/riscos/save_draw.c (original)
+++ trunk/netsurf/riscos/save_draw.c Fri Dec 23 16:39:25 2011
@@ -95,6 +95,7 @@
os_error *error;
struct redraw_context ctx = {
.interactive = false,
+ .background_images = true,
.plot = &ro_save_draw_plotters
};
Modified: trunk/netsurf/riscos/thumbnail.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/thumbnail.c?rev=13...
==============================================================================
--- trunk/netsurf/riscos/thumbnail.c (original)
+++ trunk/netsurf/riscos/thumbnail.c Fri Dec 23 16:39:25 2011
@@ -88,6 +88,7 @@
_kernel_oserror *error;
struct redraw_context ctx = {
.interactive = false,
+ .background_images = true,
.plot = &ro_plotters
};
Modified: trunk/netsurf/riscos/treeview.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/treeview.c?rev=133...
==============================================================================
--- trunk/netsurf/riscos/treeview.c (original)
+++ trunk/netsurf/riscos/treeview.c Fri Dec 23 16:39:25 2011
@@ -445,6 +445,7 @@
os_error *error;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &ro_plotters
};
Modified: trunk/netsurf/riscos/window.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/window.c?rev=13335...
==============================================================================
--- trunk/netsurf/riscos/window.c (original)
+++ trunk/netsurf/riscos/window.c Fri Dec 23 16:39:25 2011
@@ -1419,6 +1419,7 @@
os_error *error;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &ro_plotters
};
@@ -4097,6 +4098,7 @@
struct gui_window *g;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &ro_plotters
};
Modified: trunk/netsurf/utils/types.h
URL: http://source.netsurf-browser.org/trunk/netsurf/utils/types.h?rev=13335&r...
==============================================================================
--- trunk/netsurf/utils/types.h (original)
+++ trunk/netsurf/utils/types.h Fri Dec 23 16:39:25 2011
@@ -39,6 +39,9 @@
* etc. Should be off for printing. */
bool interactive;
+ /** Render background images. May want it off for printing. */
+ bool background_images;
+
/** Current plotters, must be assigned before use. */
const struct plotter_table *plot;
};
Modified: trunk/netsurf/windows/drawable.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/drawable.c?rev=13...
==============================================================================
--- trunk/netsurf/windows/drawable.c (original)
+++ trunk/netsurf/windows/drawable.c Fri Dec 23 16:39:25 2011
@@ -307,6 +307,7 @@
PAINTSTRUCT ps;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &win_plotters
};
Modified: trunk/netsurf/windows/localhistory.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/localhistory.c?re...
==============================================================================
--- trunk/netsurf/windows/localhistory.c (original)
+++ trunk/netsurf/windows/localhistory.c Fri Dec 23 16:39:25 2011
@@ -81,6 +81,7 @@
HDC tmp_hdc;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &win_plotters
};
@@ -274,6 +275,7 @@
HDC hdc, tmp_hdc;
struct redraw_context ctx = {
.interactive = true,
+ .background_images = true,
.plot = &win_plotters
};
Modified: trunk/netsurf/windows/thumbnail.c
URL: http://source.netsurf-browser.org/trunk/netsurf/windows/thumbnail.c?rev=1...
==============================================================================
--- trunk/netsurf/windows/thumbnail.c (original)
+++ trunk/netsurf/windows/thumbnail.c Fri Dec 23 16:39:25 2011
@@ -40,6 +40,7 @@
HDC hdc, bufferdc, minidc;
struct redraw_context ctx = {
.interactive = false,
+ .background_images = true,
.plot = &win_plotters
};
11 years, 5 months
r13334 chris_y - /trunk/netsurf/amiga/gui.c
by netsurf@semichrome.net
Author: chris_y
Date: Fri Dec 23 16:14:00 2011
New Revision: 13334
URL: http://source.netsurf-browser.org?rev=13334&view=rev
Log:
Pass keyboard scroll events to the core
Modified:
trunk/netsurf/amiga/gui.c
Modified: trunk/netsurf/amiga/gui.c
URL: http://source.netsurf-browser.org/trunk/netsurf/amiga/gui.c?rev=13334&r1=...
==============================================================================
--- trunk/netsurf/amiga/gui.c (original)
+++ trunk/netsurf/amiga/gui.c Fri Dec 23 16:14:00 2011
@@ -24,6 +24,7 @@
#include "desktop/netsurf.h"
#include "desktop/options.h"
#include "desktop/save_complete.h"
+#include "desktop/scrollbar.h"
#include "desktop/searchweb.h"
#include "desktop/selection.h"
#include "desktop/textinput.h"
@@ -1020,6 +1021,75 @@
return true;
}
+void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
+{
+ struct IBox *bbox;
+ int x, y;
+
+ GetAttr(SPACE_AreaBox,
+ (Object *)gwin->objects[GID_BROWSER],
+ (ULONG *)&bbox);
+
+ if(ami_mouse_to_ns_coords(gwin, &x, &y, -1, -1) == true)
+ {
+ if(browser_window_scroll_at_point(gwin->bw, x, y,
+ xs, ys) == false)
+ {
+ gui_window_get_scroll(gwin->bw->window,
+ &gwin->bw->window->scrollx,
+ &gwin->bw->window->scrolly);
+
+ switch(xs)
+ {
+ case SCROLL_PAGE_UP:
+ xs = gwin->bw->window->scrollx - bbox->Width;
+ break;
+
+ case SCROLL_PAGE_DOWN:
+ xs = gwin->bw->window->scrollx + bbox->Width;
+ break;
+
+ case SCROLL_TOP:
+ xs = 0;
+ break;
+
+ case SCROLL_BOTTOM:
+ xs = content_get_width(gwin->bw->current_content);
+ break;
+
+ default:
+ xs += gwin->bw->window->scrollx;
+ break;
+ }
+
+ switch(ys)
+ {
+ case SCROLL_PAGE_UP:
+ ys = gwin->bw->window->scrolly - bbox->Height;
+ break;
+
+ case SCROLL_PAGE_DOWN:
+ ys = gwin->bw->window->scrolly + bbox->Height;
+ break;
+
+ case SCROLL_TOP:
+ ys = 0;
+ break;
+
+ case SCROLL_BOTTOM:
+ ys = content_get_height(gwin->bw->current_content);
+ break;
+
+ default:
+ ys += gwin->bw->window->scrolly;
+ break;
+ }
+
+ gui_window_set_scroll(gwin->bw->window, xs, ys);
+ }
+ }
+}
+
void ami_handle_msg(void)
{
struct IntuiMessage *message = NULL;
@@ -1579,72 +1649,46 @@
{
if(!browser_window_key_press(gwin->bw, nskey))
{
- GetAttr(SPACE_AreaBox,
- (Object *)gwin->objects[GID_BROWSER],
- (ULONG *)&bbox);
-
- gui_window_get_scroll(gwin->bw->window,
- &gwin->bw->window->scrollx,
- &gwin->bw->window->scrolly);
-
switch(nskey)
{
case KEY_UP:
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx,
- gwin->bw->window->scrolly - NSA_KBD_SCROLL_PX);
+ ami_gui_scroll_internal(gwin, 0, -NSA_KBD_SCROLL_PX);
break;
case KEY_DOWN:
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx,
- gwin->bw->window->scrolly + NSA_KBD_SCROLL_PX);
+ ami_gui_scroll_internal(gwin, 0, +NSA_KBD_SCROLL_PX);
break;
case KEY_LEFT:
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx - NSA_KBD_SCROLL_PX,
- gwin->bw->window->scrolly);
+ ami_gui_scroll_internal(gwin, -NSA_KBD_SCROLL_PX, 0);
break;
case KEY_RIGHT:
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx + NSA_KBD_SCROLL_PX,
- gwin->bw->window->scrolly);
+ ami_gui_scroll_internal(gwin, +NSA_KBD_SCROLL_PX, 0);
break;
case KEY_PAGE_UP:
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx,
- gwin->bw->window->scrolly - bbox->Height);
+ ami_gui_scroll_internal(gwin, 0, SCROLL_PAGE_UP);
break;
case KEY_PAGE_DOWN:
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx,
- gwin->bw->window->scrolly + bbox->Height);
+ ami_gui_scroll_internal(gwin, 0, SCROLL_PAGE_DOWN);
break;
case KEY_LINE_START: // page left
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx - bbox->Width,
- gwin->bw->window->scrolly);
+ ami_gui_scroll_internal(gwin, SCROLL_PAGE_UP, 0);
break;
case KEY_LINE_END: // page right
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx + bbox->Width,
- gwin->bw->window->scrolly);
+ ami_gui_scroll_internal(gwin, SCROLL_PAGE_DOWN, 0);
break;
case KEY_TEXT_START: // home
- gui_window_set_scroll(gwin->bw->window, 0, 0);
+ ami_gui_scroll_internal(gwin, SCROLL_TOP, SCROLL_TOP);
break;
case KEY_TEXT_END: // end
- gui_window_set_scroll(gwin->bw->window,
- content_get_width(gwin->bw->current_content),
- content_get_height(gwin->bw->current_content));
+ ami_gui_scroll_internal(gwin, SCROLL_BOTTOM, SCROLL_BOTTOM);
break;
case KEY_WORD_RIGHT: // alt+right
@@ -3804,13 +3848,9 @@
void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg)
{
ULONG gid;
- int x, y;
struct gui_window_2 *gwin = hook->h_Data;
struct IntuiWheelData *wheel;
Object *reqrefresh = NULL;
-
- gui_window_get_scroll(gwin->bw->window,
- &gwin->bw->window->scrollx,&gwin->bw->window->scrolly);
switch(msg->Class)
{
@@ -3835,16 +3875,7 @@
{
wheel = (struct IntuiWheelData *)msg->IAddress;
- if(ami_mouse_to_ns_coords(gwin, &x, &y, -1, -1) == true)
- {
- if(browser_window_scroll_at_point(gwin->bw, x, y,
- wheel->WheelX * 50, wheel->WheelY * 50) == false)
- {
- gui_window_set_scroll(gwin->bw->window,
- gwin->bw->window->scrollx + (wheel->WheelX * 50),
- gwin->bw->window->scrolly + (wheel->WheelY * 50));
- }
- }
+ ami_gui_scroll_internal(gwin, wheel->WheelX * 50, wheel->WheelY * 50);
}
break;
11 years, 5 months
r13333 tlsa - in /trunk/netsurf/riscos: gui.h print.c window.c
by netsurf@semichrome.net
Author: tlsa
Date: Fri Dec 23 15:49:13 2011
New Revision: 13333
URL: http://source.netsurf-browser.org?rev=13333&view=rev
Log:
Make the RISC OS front end foreground/background menu options work.
Modified:
trunk/netsurf/riscos/gui.h
trunk/netsurf/riscos/print.c
trunk/netsurf/riscos/window.c
Modified: trunk/netsurf/riscos/gui.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/gui.h?rev=13333&r1...
==============================================================================
--- trunk/netsurf/riscos/gui.h (original)
+++ trunk/netsurf/riscos/gui.h Fri Dec 23 15:49:13 2011
@@ -100,7 +100,6 @@
/** Options. */
struct {
- bool background_images; /**< Display background images. */
bool buffer_animations; /**< Use screen buffering for animations. */
bool buffer_everything; /**< Use screen buffering for everything. */
} option;
Modified: trunk/netsurf/riscos/print.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/print.c?rev=13333&...
==============================================================================
--- trunk/netsurf/riscos/print.c (original)
+++ trunk/netsurf/riscos/print.c Fri Dec 23 15:49:13 2011
@@ -32,6 +32,7 @@
#include "utils/config.h"
#include "content/content.h"
#include "content/hlcache.h"
+#include "desktop/options.h"
#include "desktop/plotters.h"
#include "riscos/dialog.h"
#include "riscos/menus.h"
@@ -192,7 +193,7 @@
printers_exists = false;
}
- print_bg_images = g->option.background_images;
+ print_bg_images = option_background_images;
ro_gui_set_icon_selected_state(dialog_print, ICON_PRINT_TO_BOTTOM,
true);
@@ -273,9 +274,8 @@
print_max_sheets = sheets;
else
print_max_sheets = -1;
- ro_print_current_window->option.background_images =
- ro_gui_get_icon_selected_state(dialog_print,
- ICON_PRINT_BG_IMAGES);
+ option_background_images = ro_gui_get_icon_selected_state(dialog_print,
+ ICON_PRINT_BG_IMAGES);
print_send_printsave(ro_print_current_window->bw->current_content);
@@ -521,9 +521,7 @@
void ro_print_cleanup(void)
{
- if (ro_print_current_window)
- ro_print_current_window->option.background_images =
- print_bg_images;
+ option_background_images = print_bg_images;
ro_print_current_window = NULL;
print_text_black = false;
print_prev_message = 0;
Modified: trunk/netsurf/riscos/window.c
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/window.c?rev=13333...
==============================================================================
--- trunk/netsurf/riscos/window.c (original)
+++ trunk/netsurf/riscos/window.c Fri Dec 23 15:49:13 2011
@@ -2330,12 +2330,11 @@
/* View Submenu */
- ro_gui_menu_set_entry_shaded(menu, BROWSER_IMAGES_FOREGROUND, true);
- ro_gui_menu_set_entry_ticked(menu, BROWSER_IMAGES_FOREGROUND, true);
- /* Not yet implemented. */
+ ro_gui_menu_set_entry_ticked(menu, BROWSER_IMAGES_FOREGROUND,
+ g != NULL && option_foreground_images);
ro_gui_menu_set_entry_ticked(menu, BROWSER_IMAGES_BACKGROUND,
- g != NULL && g->option.background_images);
+ g != NULL && option_background_images);
ro_gui_menu_set_entry_shaded(menu, BROWSER_BUFFER_ANIMS,
g == NULL || g->option.buffer_everything);
@@ -2849,12 +2848,15 @@
case BROWSER_FIND_TEXT:
ro_gui_window_action_search(g);
break;
+ case BROWSER_IMAGES_FOREGROUND:
+ if (g != NULL)
+ option_foreground_images =
+ !option_foreground_images;
+ break;
case BROWSER_IMAGES_BACKGROUND:
- if (g != NULL) {
- g->option.background_images =
- !g->option.background_images;
- gui_window_redraw_window(g);
- }
+ if (g != NULL)
+ option_background_images =
+ !option_background_images;
break;
case BROWSER_BUFFER_ANIMS:
if (g != NULL)
@@ -4447,7 +4449,6 @@
*/
if (!old_gui) {
new_bw->scale = ((float)option_scale) / 100;
- new_gui->option.background_images = option_background_images;
new_gui->option.buffer_animations = option_buffer_animations;
new_gui->option.buffer_everything = option_buffer_everything;
} else {
11 years, 5 months
r13332 tlsa - in /trunk/netsurf: desktop/options.c desktop/options.h render/box_construct.c riscos/options.h
by netsurf@semichrome.net
Author: tlsa
Date: Fri Dec 23 13:48:09 2011
New Revision: 13332
URL: http://source.netsurf-browser.org?rev=13332&view=rev
Log:
Add core options to disable fetch of foreground & background images.
Remove broken background image option from RISC OS front end.
Modified:
trunk/netsurf/desktop/options.c
trunk/netsurf/desktop/options.h
trunk/netsurf/render/box_construct.c
trunk/netsurf/riscos/options.h
Modified: trunk/netsurf/desktop/options.c
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/options.c?rev=133...
==============================================================================
--- trunk/netsurf/desktop/options.c (original)
+++ trunk/netsurf/desktop/options.c Fri Dec 23 13:48:09 2011
@@ -97,6 +97,10 @@
int option_minimum_gif_delay = 10;
/** Whether to send the referer HTTP header */
bool option_send_referer = true;
+/** Whether to fetch foreground images */
+bool option_foreground_images = true;
+/** Whether to fetch background images */
+bool option_background_images = true;
/** Whether to animate images */
bool option_animate_images = true;
/** How many days to retain URL data for */
@@ -262,6 +266,8 @@
{ "block_advertisements", OPTION_BOOL, &option_block_ads },
{ "minimum_gif_delay", OPTION_INTEGER, &option_minimum_gif_delay },
{ "send_referer", OPTION_BOOL, &option_send_referer },
+ { "foreground_images", OPTION_BOOL, &option_foreground_images },
+ { "background_images", OPTION_BOOL, &option_background_images },
{ "animate_images", OPTION_BOOL, &option_animate_images },
{ "expire_url", OPTION_INTEGER, &option_expire_url },
{ "font_default", OPTION_INTEGER, &option_font_default },
Modified: trunk/netsurf/desktop/options.h
URL: http://source.netsurf-browser.org/trunk/netsurf/desktop/options.h?rev=133...
==============================================================================
--- trunk/netsurf/desktop/options.h (original)
+++ trunk/netsurf/desktop/options.h Fri Dec 23 13:48:09 2011
@@ -58,6 +58,8 @@
extern bool option_block_ads;
extern int option_minimum_gif_delay;
extern bool option_send_referer;
+extern bool option_foreground_images;
+extern bool option_background_images;
extern bool option_animate_images;
extern int option_expire_url;
extern int option_font_default; /* a css_font_family */
Modified: trunk/netsurf/render/box_construct.c
URL: http://source.netsurf-browser.org/trunk/netsurf/render/box_construct.c?re...
==============================================================================
--- trunk/netsurf/render/box_construct.c (original)
+++ trunk/netsurf/render/box_construct.c Fri Dec 23 13:48:09 2011
@@ -405,7 +405,8 @@
}
if (css_computed_list_style_image(box->style, &image_uri) ==
- CSS_LIST_STYLE_IMAGE_URI && image_uri != NULL) {
+ CSS_LIST_STYLE_IMAGE_URI && image_uri != NULL &&
+ option_foreground_images == true) {
nsurl *url;
nserror error;
@@ -710,7 +711,8 @@
/* Kick off fetch for any background image */
if (css_computed_background_image(box->style, &bgimage_uri) ==
- CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL) {
+ CSS_BACKGROUND_IMAGE_IMAGE && bgimage_uri != NULL &&
+ option_background_images == true) {
nsurl *url;
nserror error;
@@ -1377,6 +1379,9 @@
return false;
box->length = strlen(box->text);
}
+
+ if (option_foreground_images == false)
+ return true;
/* imagemap associated with this image */
if (!box_get_attribute(n, "usemap", content, &box->usemap))
@@ -2035,7 +2040,8 @@
gadget->type = GADGET_IMAGE;
if (box->style && css_computed_display(box->style,
- n->parent == NULL) != CSS_DISPLAY_NONE) {
+ n->parent == NULL) != CSS_DISPLAY_NONE &&
+ option_foreground_images == true) {
if ((s = (char *) xmlGetProp(n,
(const xmlChar*) "src"))) {
error = nsurl_join(content->base_url, s, &url);
Modified: trunk/netsurf/riscos/options.h
URL: http://source.netsurf-browser.org/trunk/netsurf/riscos/options.h?rev=1333...
==============================================================================
--- trunk/netsurf/riscos/options.h (original)
+++ trunk/netsurf/riscos/options.h Fri Dec 23 13:48:09 2011
@@ -44,7 +44,6 @@
extern char *option_toolbar_cookies;
extern bool option_window_stagger;
extern bool option_window_size_clone;
-extern bool option_background_images;
extern bool option_buffer_animations;
extern bool option_buffer_everything;
extern bool option_open_browser_at_startup;
@@ -84,7 +83,6 @@
char *option_toolbar_cookies = 0; \
bool option_window_stagger = true; \
bool option_window_size_clone = true; \
-bool option_background_images = true; \
bool option_buffer_animations = true; \
bool option_buffer_everything = true; \
bool option_open_browser_at_startup = false; \
@@ -124,7 +122,6 @@
{ "toolbar_cookies", OPTION_STRING, &option_toolbar_cookies }, \
{ "window_stagger", OPTION_BOOL, &option_window_stagger }, \
{ "window_size_clone", OPTION_BOOL, &option_window_size_clone }, \
-{ "background_images", OPTION_BOOL, &option_background_images }, \
{ "buffer_animations", OPTION_BOOL, &option_buffer_animations }, \
{ "buffer_everything", OPTION_BOOL, &option_buffer_everything }, \
{ "open_browser_at_startup",OPTION_BOOL, &option_open_browser_at_startup }, \
11 years, 5 months
r13331 tlsa - /trunk/netsurfweb/documentation/roinfo.en
by netsurf@semichrome.net
Author: tlsa
Date: Fri Dec 23 06:00:29 2011
New Revision: 13331
URL: http://source.netsurf-browser.org?rev=13331&view=rev
Log:
Update TTF2f link.
Modified:
trunk/netsurfweb/documentation/roinfo.en
Modified: trunk/netsurfweb/documentation/roinfo.en
URL: http://source.netsurf-browser.org/trunk/netsurfweb/documentation/roinfo.e...
==============================================================================
--- trunk/netsurfweb/documentation/roinfo.en (original)
+++ trunk/netsurfweb/documentation/roinfo.en Fri Dec 23 06:00:29 2011
@@ -72,7 +72,7 @@
<li><a href="#Printing">Printing</a></li>
</ul>
-<p class="updated">Last updated 10 November 2007</p>
+<p class="updated">Last updated 23 December 2011</p>
<h2 id="GettingStarted">Getting started</h2>
@@ -144,7 +144,7 @@
<p>If you see the codes 0091, 0092, 0096, or others starting 009, that indicates that the page is not specifying the character set that it is using correctly. Installing fonts won't help. We haven't yet decided what the best way to work around this problem is.</p>
-<p>Any font supplied with a correctly designed "Encoding" file should work. In practice, native fonts covering anything other than Latin 1 are rare. The solution is to convert TrueType fonts using <a href="http://jmb.drobe.co.uk/ttf2f-003.zip">TTF2f</a> (this currently produces fonts suitable for RISC OS 5 only).</p>
+<p>Any font supplied with a correctly designed "Encoding" file should work. In practice, native fonts covering anything other than Latin 1 are rare. The solution is to convert TrueType fonts using <a href="/projects/ttf2f/">TTF2f</a> (this currently produces fonts suitable for RISC OS 5 only).</p>
<p>After installing new fonts, NetSurf will need restarting so that it detects them.</p>
11 years, 5 months
r13330 vince - in /branches/vince/netsurf-cairo: gtk/bitmap.c gtk/bitmap.h gtk/plotters.c gtk/thumbnail.c image/image.c
by netsurf@semichrome.net
Author: vince
Date: Thu Dec 22 18:48:21 2011
New Revision: 13330
URL: http://source.netsurf-browser.org?rev=13330&view=rev
Log:
fix opacity testing and setting
Modified:
branches/vince/netsurf-cairo/gtk/bitmap.c
branches/vince/netsurf-cairo/gtk/bitmap.h
branches/vince/netsurf-cairo/gtk/plotters.c
branches/vince/netsurf-cairo/gtk/thumbnail.c
branches/vince/netsurf-cairo/image/image.c
Modified: branches/vince/netsurf-cairo/gtk/bitmap.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-cairo/gtk/bitmap...
==============================================================================
--- branches/vince/netsurf-cairo/gtk/bitmap.c (original)
+++ branches/vince/netsurf-cairo/gtk/bitmap.c Thu Dec 22 18:48:21 2011
@@ -48,37 +48,76 @@
void *bitmap_create(int width, int height, unsigned int state)
{
- cairo_surface_t *surface;
-
- if ((state & BITMAP_OPAQUE) != 0) {
- surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
+ struct bitmap *gbitmap;
+
+ gbitmap = calloc(1, sizeof(struct bitmap));
+ if (gbitmap != NULL) {
+ if ((state & BITMAP_OPAQUE) != 0) {
+ gbitmap->surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, width, height);
+ } else {
+ gbitmap->surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
+ }
+
+ if (cairo_surface_status(gbitmap->surface) != CAIRO_STATUS_SUCCESS) {
+ cairo_surface_destroy(gbitmap->surface);
+ free(gbitmap);
+ gbitmap = NULL;
+ }
+ }
+
+ return gbitmap;
+}
+
+
+/**
+ * Sets whether a bitmap should be plotted opaque
+ *
+ * \param vbitmap a bitmap, as returned by bitmap_create()
+ * \param opaque whether the bitmap should be plotted opaque
+ */
+void bitmap_set_opaque(void *vbitmap, bool opaque)
+{
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
+ cairo_format_t fmt;
+ cairo_surface_t *nsurface = NULL;
+
+ assert(gbitmap);
+
+ fmt = cairo_image_surface_get_format(gbitmap->surface);
+ if (fmt == CAIRO_FORMAT_RGB24) {
+ if (opaque == false) {
+ /* opaque to transparent */
+ nsurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
+ cairo_image_surface_get_width(gbitmap->surface),
+ cairo_image_surface_get_height(gbitmap->surface));
+
+ }
+
} else {
- surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
- }
-
- if (cairo_surface_status(surface) != CAIRO_STATUS_SUCCESS) {
- cairo_surface_destroy(surface);
- surface = NULL;
- }
-
- return surface;
-}
-
-
-/**
- * Sets whether a bitmap should be plotted opaque
- *
- * \param vbitmap a bitmap, as returned by bitmap_create()
- * \param opaque whether the bitmap should be plotted opaque
- */
-void bitmap_set_opaque(void *vbitmap, bool opaque)
-{
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
- assert(surface);
- /* gtk image surface cannot change format. but its harmless to
- * plot with alpha. this does not cope with opaque to
- * transparent conversions but currently those never happen
- */
+ if (opaque == true) {
+ /* transparent to opaque */
+ nsurface = cairo_image_surface_create(CAIRO_FORMAT_RGB24,
+ cairo_image_surface_get_width(gbitmap->surface),
+ cairo_image_surface_get_height(gbitmap->surface));
+
+ }
+ }
+
+ if (nsurface != NULL) {
+ if (cairo_surface_status(nsurface) != CAIRO_STATUS_SUCCESS) {
+ cairo_surface_destroy(nsurface);
+ } else {
+ memcpy(cairo_image_surface_get_data(nsurface),
+ cairo_image_surface_get_data(gbitmap->surface),
+ cairo_image_surface_get_stride(gbitmap->surface) * cairo_image_surface_get_height(gbitmap->surface));
+ cairo_surface_destroy(gbitmap->surface);
+ gbitmap->surface = nsurface;
+
+ cairo_surface_mark_dirty(gbitmap->surface);
+
+ }
+
+ }
}
@@ -90,10 +129,24 @@
*/
bool bitmap_test_opaque(void *vbitmap)
{
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
- assert(surface);
- /* todo: test if bitmap is opaque */
- return false;
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
+ unsigned char *pixels;
+ int pcount;
+ int ploop;
+ assert(gbitmap);
+
+ pixels = cairo_image_surface_get_data(gbitmap->surface);
+
+ pcount = cairo_image_surface_get_stride(gbitmap->surface) *
+ cairo_image_surface_get_height(gbitmap->surface);
+
+ for (ploop=3; ploop < pcount; ploop+=4) {
+ if (pixels[ploop] != 0xff) {
+ return false;
+ }
+ }
+
+ return true;
}
@@ -104,12 +157,12 @@
*/
bool bitmap_get_opaque(void *vbitmap)
{
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
cairo_format_t fmt;
- assert(surface);
-
- fmt = cairo_image_surface_get_format(surface);
+ assert(gbitmap);
+
+ fmt = cairo_image_surface_get_format(gbitmap->surface);
if (fmt == CAIRO_FORMAT_RGB24) {
return true;
}
@@ -130,12 +183,12 @@
unsigned char *bitmap_get_buffer(void *vbitmap)
{
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
- assert(surface);
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
+ assert(gbitmap);
- cairo_surface_flush (surface);
+ cairo_surface_flush(gbitmap->surface);
- return cairo_image_surface_get_data(surface);
+ return cairo_image_surface_get_data(gbitmap->surface);
}
@@ -148,9 +201,10 @@
size_t bitmap_get_rowstride(void *vbitmap)
{
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
- assert(surface);
- return cairo_image_surface_get_stride(surface);
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
+ assert(gbitmap);
+
+ return cairo_image_surface_get_stride(gbitmap->surface);
}
@@ -163,8 +217,9 @@
size_t bitmap_get_bpp(void *vbitmap)
{
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
- assert(surface);
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
+ assert(gbitmap);
+
return 4;
}
@@ -178,10 +233,11 @@
void bitmap_destroy(void *vbitmap)
{
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
- assert(surface);
-
- cairo_surface_destroy(surface);
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
+ assert(gbitmap);
+
+ cairo_surface_destroy(gbitmap->surface);
+ free(gbitmap);
}
@@ -196,8 +252,8 @@
bool bitmap_save(void *vbitmap, const char *path, unsigned flags)
{
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
- assert(surface);
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
+ assert(gbitmap);
return false;
}
@@ -209,20 +265,20 @@
* \param bitmap a bitmap, as returned by bitmap_create()
*/
void bitmap_modified(void *vbitmap) {
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
int pixel_loop;
int pixel_count;
uint32_t *pixels;
uint32_t pixel;
cairo_format_t fmt;
- assert(surface);
-
- fmt = cairo_image_surface_get_format(surface);
-
- pixel_count = cairo_image_surface_get_width(surface) *
- cairo_image_surface_get_height(surface);
- pixels = (uint32_t *)cairo_image_surface_get_data(surface);
+ assert(gbitmap);
+
+ fmt = cairo_image_surface_get_format(gbitmap->surface);
+
+ pixel_count = cairo_image_surface_get_width(gbitmap->surface) *
+ cairo_image_surface_get_height(gbitmap->surface);
+ pixels = (uint32_t *)cairo_image_surface_get_data(gbitmap->surface);
if (fmt == CAIRO_FORMAT_RGB24) {
for (pixel_loop=0; pixel_loop < pixel_count; pixel_loop++) {
@@ -252,7 +308,9 @@
}
}
- cairo_surface_mark_dirty (surface);
+ cairo_surface_mark_dirty(gbitmap->surface);
+
+ gbitmap->converted = true;
}
@@ -268,13 +326,17 @@
}
int bitmap_get_width(void *vbitmap){
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
- return cairo_image_surface_get_width(surface);
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
+ assert(gbitmap);
+
+ return cairo_image_surface_get_width(gbitmap->surface);
}
int bitmap_get_height(void *vbitmap){
- cairo_surface_t *surface = (cairo_surface_t *)vbitmap;
- return cairo_image_surface_get_height(surface);
-}
-
-
+ struct bitmap *gbitmap = (struct bitmap *)vbitmap;
+ assert(gbitmap);
+
+ return cairo_image_surface_get_height(gbitmap->surface);
+}
+
+
Modified: branches/vince/netsurf-cairo/gtk/bitmap.h
URL: http://source.netsurf-browser.org/branches/vince/netsurf-cairo/gtk/bitmap...
==============================================================================
--- branches/vince/netsurf-cairo/gtk/bitmap.h (original)
+++ branches/vince/netsurf-cairo/gtk/bitmap.h Thu Dec 22 18:48:21 2011
@@ -22,6 +22,9 @@
#include <cairo.h>
#include "image/bitmap.h"
-cairo_surface_t *gtk_bitmap_get_surface(struct bitmap *bitmap);
+struct bitmap {
+ cairo_surface_t *surface;
+ bool converted; /** set if the surface data has been converted */
+};
#endif /* NS_GTK_BITMAP_H */
Modified: branches/vince/netsurf-cairo/gtk/plotters.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-cairo/gtk/plotte...
==============================================================================
--- branches/vince/netsurf-cairo/gtk/plotters.c (original)
+++ branches/vince/netsurf-cairo/gtk/plotters.c Thu Dec 22 18:48:21 2011
@@ -391,7 +391,7 @@
bool repeat_x = (flags & BITMAPF_REPEAT_X);
bool repeat_y = (flags & BITMAPF_REPEAT_Y);
- cairo_surface_t *bmsurface = (cairo_surface_t *)bitmap;
+ cairo_surface_t *bmsurface = bitmap->surface;
if (!(repeat_x || repeat_y)) {
/* Not repeating at all, so just pass it on */
Modified: branches/vince/netsurf-cairo/gtk/thumbnail.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-cairo/gtk/thumbn...
==============================================================================
--- branches/vince/netsurf-cairo/gtk/thumbnail.c (original)
+++ branches/vince/netsurf-cairo/gtk/thumbnail.c Thu Dec 22 18:48:21 2011
@@ -52,7 +52,7 @@
bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap,
const char *url)
{
- cairo_surface_t *dsurface = (cairo_surface_t *)bitmap;
+ cairo_surface_t *dsurface = bitmap->surface;
cairo_surface_t *surface;
cairo_t *old_cr;
gint dwidth, dheight;
Modified: branches/vince/netsurf-cairo/image/image.c
URL: http://source.netsurf-browser.org/branches/vince/netsurf-cairo/image/imag...
==============================================================================
--- branches/vince/netsurf-cairo/image/image.c (original)
+++ branches/vince/netsurf-cairo/image/image.c Thu Dec 22 18:48:21 2011
@@ -154,7 +154,7 @@
fill_style.stroke_type = PLOT_OP_TYPE_NONE;
fill_style.fill_type = PLOT_OP_TYPE_SOLID;
- LOG(("area %d,%d -> %d,%d", area.x0, area.y0, area.x1, area.y1));
+ /* LOG(("area %d,%d -> %d,%d", area.x0, area.y0, area.x1, area.y1)); */
return ctx->plot->rectangle(area.x0, area.y0,
area.x1, area.y1,
&fill_style);
11 years, 5 months