From 9c918930289b18dbfd4bb44081891d5780105bfd Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 13 Jul 2011 13:20:26 +0000 Subject: Fix selection for non-gui browser windows (iframes). Selection no longer uses current_redraw_browser. Fix long-standing selection bugs on platforms that use action on release behaviour. svn path=/trunk/netsurf/; revision=12598 --- desktop/browser.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'desktop/browser.h') diff --git a/desktop/browser.h b/desktop/browser.h index d0695f295..f008cfc00 100644 --- a/desktop/browser.h +++ b/desktop/browser.h @@ -78,9 +78,6 @@ struct browser_window { /** Window history structure. */ struct history *history; - /** Selection state */ - struct selection *sel; - /** Handler for keyboard input, or 0. */ browser_caret_callback caret_callback; /** Handler for pasting text, or 0. */ @@ -193,6 +190,9 @@ struct browser_window { /** search context for free text search */ struct search_context *search_context; + /** Content with current selection, or NULL if none */ + struct selection *cur_sel; + /** cache of the currently displayed status text. */ char *status_text; /**< Current status bar text. */ int status_text_len; /**< Length of the ::status_text buffer. */ @@ -365,6 +365,23 @@ struct browser_window * browser_window_get_root(struct browser_window *bw); */ bool browser_window_has_selection(struct browser_window *bw); +/** + * Set pointer to current selection. Clears any existing selection. + * + * \param bw The browser window + * \param s The new selection + */ +void browser_window_set_selection(struct browser_window *bw, + struct selection *s); + +/** + * Get the current selection context from a root browser window + * + * \param bw The browser window + * \return the selection context, or NULL + */ +struct selection *browser_window_get_selection(struct browser_window *bw); + /* In platform specific hotlist.c. */ void hotlist_visited(struct hlcache_handle *c); -- cgit v1.2.3