From 4856a4c1fba73c5ae20723cc1e5f93f5b0bfbefc Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 29 Nov 2011 17:47:29 +0000 Subject: Pass scroll wheel action into contents. Handle scrolling of box scrollbars and iframes. svn path=/trunk/netsurf/; revision=13200 --- content/content.c | 13 +++++++++++++ content/content.h | 2 ++ content/content_protected.h | 4 +++- 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'content') diff --git a/content/content.c b/content/content.c index 28d18bcab..a4f36e2f6 100644 --- a/content/content.c +++ b/content/content.c @@ -733,6 +733,19 @@ void content_get_contextual_content(struct hlcache_handle *h, } +bool content_scroll_at_point(struct hlcache_handle *h, + int x, int y, int scrx, int scry) +{ + struct content *c = hlcache_handle_get_content(h); + assert(c != 0); + + if (c->handler->scroll_at_point != NULL) + return c->handler->scroll_at_point(c, x, y, scrx, scry); + + return false; +} + + void content_add_error(struct content *c, const char *token, unsigned int line) { diff --git a/content/content.h b/content/content.h index 3fd0bd63a..6e900922a 100644 --- a/content/content.h +++ b/content/content.h @@ -175,6 +175,8 @@ void content_close(struct hlcache_handle *h); struct selection *content_get_selection(struct hlcache_handle *h); void content_get_contextual_content(struct hlcache_handle *h, int x, int y, struct contextual_content *data); +bool content_scroll_at_point(struct hlcache_handle *h, + int x, int y, int scrx, int scry); struct content_rfc5988_link *content_find_rfc5988_link(struct hlcache_handle *c, lwc_string *rel); diff --git a/content/content_protected.h b/content/content_protected.h index 05b1940f2..54825589e 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -68,7 +68,9 @@ struct content_handler { void (*close)(struct content *c); struct selection * (*get_selection)(struct content *c); void (*get_contextual_content)(struct content *c, int x, int y, - struct contextual_content *data); + struct contextual_content *data); + bool (*scroll_at_point)(struct content *c, int x, int y, + int scrx, int scry); nserror (*clone)(const struct content *old, struct content **newc); bool (*matches_quirks)(const struct content *c, bool quirks); content_type (*type)(void); -- cgit v1.2.3