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 --- content/content.c | 16 ++++++++++++++++ content/content.h | 1 + content/content_protected.h | 1 + 3 files changed, 18 insertions(+) (limited to 'content') diff --git a/content/content.c b/content/content.c index 1f7003404..c3f8d7855 100644 --- a/content/content.c +++ b/content/content.c @@ -676,6 +676,22 @@ void content_close(hlcache_handle *h) } +/** + * Find this content's selection context, if it has one. + */ + +struct selection *content_get_selection(hlcache_handle *h) +{ + struct content *c = hlcache_handle_get_content(h); + assert(c != 0); + + if (c->handler->get_selection != NULL) + return c->handler->get_selection(c); + else + return NULL; +} + + void content_add_error(struct content *c, const char *token, unsigned int line) { diff --git a/content/content.h b/content/content.h index ca267060c..40e7f2089 100644 --- a/content/content.h +++ b/content/content.h @@ -157,6 +157,7 @@ void content_open(struct hlcache_handle *h, struct browser_window *bw, struct content *page, struct box *box, struct object_params *params); void content_close(struct hlcache_handle *h); +struct selection *content_get_selection(struct hlcache_handle *h); /* Member accessors */ content_type content_get_type(struct hlcache_handle *c); diff --git a/content/content_protected.h b/content/content_protected.h index bc2079017..4fe9b942a 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -64,6 +64,7 @@ struct content_handler { struct box *box, struct object_params *params); void (*close)(struct content *c); + struct selection * (*get_selection)(struct content *c); nserror (*clone)(const struct content *old, struct content **newc); bool (*matches_quirks)(const struct content *c, bool quirks); content_type (*type)(lwc_string *mime_type); -- cgit v1.2.3