summaryrefslogtreecommitdiff
path: root/atari/browser.h
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/browser.h
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/browser.h')
-rwxr-xr-xatari/browser.h51
1 files changed, 14 insertions, 37 deletions
diff --git a/atari/browser.h b/atari/browser.h
index 32c0fec72..3eb94374f 100755
--- a/atari/browser.h
+++ b/atari/browser.h
@@ -17,7 +17,9 @@
*/
#ifndef NS_ATARI_BROWSER_H
-#define NS_ATARI_BROWSER_H
+#define NS_ATARI_BROWSER_H
+
+#include "atari/redrawslots.h"
/*
Each browser_window in the Atari Port is represented by an struct s_browser,
@@ -30,13 +32,6 @@
*/
#define BROWSER_SCROLL_SVAL 64
-/*
- MAX_REDRW_SLOTS
- This is the number of redraw requests that an browser window can queue.
- If a redraw is scheduled and all slots are used, the rectangle will
- be merged to one of the existing slots.
- */
-#define MAX_REDRW_SLOTS 32
enum browser_rect
{
@@ -65,21 +60,10 @@ struct s_scroll_info
*/
struct s_caret
{
- GRECT requested;
- GRECT current;
- bool redraw;
-};
-
-/*
- This struct holds scheduled redraw requests.
-*/
-struct rect;
-struct s_browser_redrw_info
-{
- struct rect areas[MAX_REDRW_SLOTS];
- short areas_used;
- /* used for clipping of content redraw: */
- struct rect area;
+ LGRECT requested;
+ LGRECT current;
+ bool redraw;
+ MFDB background;
};
/*
@@ -99,9 +83,10 @@ struct s_browser
COMPONENT * comp;
struct browser_window * bw;
struct s_scroll_info scroll;
- struct s_browser_redrw_info redraw;
+ struct s_redrw_slots redraw;
struct s_caret caret;
- bool attached;
+ bool attached;
+ bool reformat_pending;
};
struct s_browser * browser_create( struct gui_window * gw, struct browser_window * clone, struct browser_window *bw, int lt, int w, int flex );
@@ -113,8 +98,10 @@ void browser_set_content_size(struct gui_window * gw, int w, int h);
void browser_scroll( struct gui_window * gw, short MODE, int value, bool abs );
struct gui_window * browser_find_root( struct gui_window * gw );
bool browser_redraw_required( struct gui_window * gw);
-static void browser_process_scroll( struct gui_window * gw, LGRECT bwrect );
-
+void browser_redraw_caret( struct gui_window * gw, LGRECT * area);
+void browser_restore_caret_background(struct gui_window * gw, LGRECT * area);
+/* update loc / size of the browser widgets: */
+void browser_update_rects(struct gui_window * gw );
/*
This queues an redraw to one of the slots.
The following strategy is used:
@@ -126,17 +113,7 @@ static void browser_process_scroll( struct gui_window * gw, LGRECT bwrect );
4. if no slot is available, it will simply merge the new rectangle with
the last available slot.
*/
-void browser_redraw_caret( struct gui_window * gw, GRECT * area );
-static void browser_redraw_content( struct gui_window * gw, int xoff, int yoff );
-
-/* update loc / size of the browser widgets: */
-void browser_update_rects(struct gui_window * gw );
void browser_schedule_redraw_rect(struct gui_window * gw, short x, short y, short w, short h);
void browser_schedule_redraw(struct gui_window * gw, short x, short y, short w, short h );
-static void __CDECL browser_evnt_resize( COMPONENT * c, long buff[8], void * data);
-static void __CDECL browser_evnt_destroy( COMPONENT * c, long buff[8], void * data);
-static void __CDECL browser_evnt_redraw( COMPONENT * c, long buff[8], void * data);
-static void __CDECL browser_evnt_mbutton( COMPONENT * c, long buff[8], void * data);
-
#endif