summaryrefslogtreecommitdiff
path: root/content/content.h
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-04-23 15:47:28 +0100
committerVincent Sanders <vince@kyllikki.org>2015-04-23 15:47:28 +0100
commitea2e1c4d987421ff8b96a098566c6bd24bac3bef (patch)
tree5e46d871e7d172c389e2a5ebb1357120b3859d29 /content/content.h
parentde98108e7f5dde136164a6e74596d70fd1289397 (diff)
downloadnetsurf-ea2e1c4d987421ff8b96a098566c6bd24bac3bef.tar.gz
netsurf-ea2e1c4d987421ff8b96a098566c6bd24bac3bef.tar.bz2
Add scaled content redraw interface.
Add a new interface to the content to allow automaticaly scaled content redraws. This is intended to replace the thumbnail_redraw interface with something more generic.
Diffstat (limited to 'content/content.h')
-rw-r--r--content/content.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/content/content.h b/content/content.h
index f0761d748..6c05df9c5 100644
--- a/content/content.h
+++ b/content/content.h
@@ -270,6 +270,27 @@ void content_mouse_action(struct hlcache_handle *h, struct browser_window *bw,
bool content_keypress(struct hlcache_handle *h, uint32_t key);
bool content_redraw(struct hlcache_handle *h, struct content_redraw_data *data,
const struct rect *clip, const struct redraw_context *ctx);
+
+
+/**
+ * Redraw a content with scale set for horizontal fit.
+ *
+ * Redraws the content at a specified width and height with the
+ * content drawing scaled to fit within the area.
+ *
+ * \param content The content to redraw
+ * \param width The target width
+ * \param height The target height
+ * \param ctx current redraw context
+ * \return true if successful, false otherwise
+ *
+ * The thumbnail is guaranteed to be filled to its width/height extents, so
+ * there is no need to render a solid background first.
+ *
+ * Units for width and height are pixels.
+ */
+bool content_scaled_redraw(struct hlcache_handle *content, int width, int height, const struct redraw_context *ctx);
+
void content_open(struct hlcache_handle *h, struct browser_window *bw,
struct content *page, struct object_params *params);
void content_close(struct hlcache_handle *h);