diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/content.c | 16 | ||||
-rw-r--r-- | content/content.h | 1 | ||||
-rw-r--r-- | content/content_protected.h | 1 |
3 files changed, 18 insertions, 0 deletions
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); |