summaryrefslogtreecommitdiff
path: root/atari/gui.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-11-28 23:23:28 +0000
committerOle Loots <ole@monochrom.net>2011-11-28 23:23:28 +0000
commit999410adc818e9bc9e566580b38954720d7dad55 (patch)
tree6abf17a5a94a9835673e2b5b5a6542087f010737 /atari/gui.c
parenta7ba1b7ccd1178717e8e4a0546282270ed2fb1d6 (diff)
downloadnetsurf-999410adc818e9bc9e566580b38954720d7dad55.tar.gz
netsurf-999410adc818e9bc9e566580b38954720d7dad55.tar.bz2
I'm actually trying to simplify the frontend code, changes:
- Optimized browser window caret, uses back-buffer now. ( So no content redraw is scheduled by the frontend just for a caret move ) - Fixed a double redraw issue when the browser reformat is pending and the AES also sends an redraw request because of the resize. - Started to use netsurfs textarea instead of a custom implementation ( to reduce code size ). svn path=/trunk/netsurf/; revision=13191
Diffstat (limited to 'atari/gui.c')
-rwxr-xr-xatari/gui.c60
1 files changed, 25 insertions, 35 deletions
diff --git a/atari/gui.c b/atari/gui.c
index 69e69bbcc..c6dfb4f87 100755
--- a/atari/gui.c
+++ b/atari/gui.c
@@ -68,7 +68,7 @@
#include "atari/hotlist.h"
#include "atari/login.h"
#include "atari/global_evnt.h"
-#include "atari/font.h"
+#include "atari/encoding.h"
#include "atari/res/netsurf.rsh"
#include "atari/plot.h"
#include "atari/clipboard.h"
@@ -171,11 +171,16 @@ void gui_poll(bool active)
for( g = window_list; g != NULL; g=g->next ) {
if( browser_redraw_required( g ) ){
browser_redraw( g );
+ }
+ if( g->root->toolbar ){
+ if(g->root->toolbar->url.redraw ){
+ tb_url_redraw( g );
+ }
}
}
if( evnt.timer != 0 && !active ){
- /* this suits for stuff with lower priority */
- //hotlist_redraw();
+ /* this suits for stuff with lower priority */
+ /* TBD: really be spare on redraws??? */
atari_treeview_redraw( hl.tv );
}
}
@@ -310,7 +315,7 @@ void gui_window_redraw_window(struct gui_window *gw)
if (gw == NULL)
return;
b = gw->browser;
- browser_get_rect( gw, BR_CONTENT, &rect );
+ browser_get_rect( gw, BR_CONTENT, &rect );
browser_schedule_redraw( gw, 0, 0, rect.g_w, rect.g_h );
}
@@ -326,7 +331,7 @@ void gui_window_update_box(struct gui_window *gw, const struct rect *rect)
int y0 = rect->y0 - b->scroll.current.y;
int w,h;
w = rect->x1 - rect->x0;
- h = rect->y1 - rect->y0;
+ h = rect->y1 - rect->y0;
browser_schedule_redraw_rect( gw, x0, y0, w,h);
}
@@ -367,7 +372,7 @@ void gui_window_set_scroll(struct gui_window *w, int sx, int sy)
void gui_window_scroll_visible(struct gui_window *w, int x0, int y0, int x1, int y1)
{
LOG(("%s:(%p, %d, %d, %d, %d)", __func__, w, x0, y0, x1, y1));
- gui_window_set_scroll(w,x0,y0);
+ gui_window_set_scroll(w,x0,y0);
browser_schedule_redraw_rect( w, 0, 0, x1-x0,y1-y0);
}
@@ -530,7 +535,7 @@ void gui_window_stop_throbber(struct gui_window *w)
work.g_x, work.g_y, work.g_w, work.g_h );
}
-/* Place caret in window */
+/* Place caret in window */
void gui_window_place_caret(struct gui_window *w, int x, int y, int height)
{
LGRECT work;
@@ -540,46 +545,37 @@ void gui_window_place_caret(struct gui_window *w, int x, int y, int height)
if( w->browser->caret.current.g_w > 0 )
gui_window_remove_caret( w );
w->browser->caret.requested.g_x = x;
- w->browser->caret.requested.g_y = y;
- w->browser->caret.requested.g_w = 2;
+ w->browser->caret.requested.g_y = y;
+ w->browser->caret.requested.g_w = 1;
w->browser->caret.requested.g_h = height;
w->browser->caret.redraw = true;
- browser_schedule_redraw_rect(
- w,
- x - b->scroll.current.x,
- y - b->scroll.current.y,
- w->browser->caret.requested.g_w,
- w->browser->caret.requested.g_h
- );
return;
}
/**
* clear window caret
- */
+ */
void
gui_window_remove_caret(struct gui_window *w)
-{
+{
+ LGRECT rect;
if (w == NULL)
return;
- CMP_BROWSER b = w->browser;
- w->browser->caret.requested.g_w = 0;
- w->browser->caret.redraw = true;
- browser_schedule_redraw_rect( w,
- w->browser->caret.current.g_x - b->scroll.current.x,
- w->browser->caret.current.g_y - b->scroll.current.y,
- w->browser->caret.current.g_w,
- w->browser->caret.current.g_h
- );
+ CMP_BROWSER b = w->browser;
+
+ if( w->browser->caret.background.fd_addr != NULL ){
+ browser_restore_caret_background( w, NULL );
+ w->browser->caret.requested.g_w = 0;
+ w->browser->caret.current.g_w = 0;
+ }
+ return;
}
void
gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
{
- /* Untestet, favicon support has been dropped, so this is dead code. */
g->icon = (icon != NULL) ? content_get_bitmap(icon) : NULL;
-
}
void
@@ -871,8 +867,6 @@ void gui_quit(void)
hotlist_destroy();
- /* send WM_DESTROY to windows purely managed by windom: */
-
urldb_save_cookies(option_cookie_file);
urldb_save(option_url_file);
@@ -1025,10 +1019,6 @@ static void gui_init(int argc, char** argv)
atari_plotter_init( option_atari_screen_driver, option_atari_font_driver );
LOG(("Knockout rendering: %s\n", option_atari_knockout ? "yes" : "no"));
plot_set_knockout( option_atari_knockout );
- /* Interface colours */
- option_gui_colour_bg_1 = 0xFFFFFF; /** Background (bbggrr) */
- option_gui_colour_fg_1 = 0xFF0000; /** Foreground (bbggrr) */
- option_gui_colour_fg_2 = 0x000000; /** Foreground selected (bbggrr) */
}
static char *theapp = (char*)"NetSurf";