From 45bf3b3099ba192b115335889e0aaa9381beb879 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 7 Dec 2017 21:11:47 +0000 Subject: Make viepwort interface opaque --- src/viewport.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/viewport.h') diff --git a/src/viewport.h b/src/viewport.h index bda55f1..fd7a6cf 100644 --- a/src/viewport.h +++ b/src/viewport.h @@ -1,18 +1,11 @@ #ifndef IMV_VIEWPORT_H #define IMV_VIEWPORT_H +#include #include #include "image.h" -struct imv_viewport { - SDL_Window *window; - double scale; - int x, y; - int fullscreen; - int redraw; - int playing; - int locked; -}; +struct imv_viewport; /* Used to signify how a a user requested a zoom */ enum imv_zoom_source { @@ -29,11 +22,20 @@ void imv_viewport_free(struct imv_viewport *view); /* Toggle their viewport's fullscreen mode. Triggers a redraw */ void imv_viewport_toggle_fullscreen(struct imv_viewport *view); +/* Set playback of animated gifs */ +void imv_viewport_set_playing(struct imv_viewport *view, bool playing); + +/* Get playback status of animated gifs */ +bool imv_viewport_is_playing(struct imv_viewport *view); + /* Toggle playback of animated gifs */ void imv_viewport_toggle_playing(struct imv_viewport *view); -/* Reset the viewport to its initial settings */ -void imv_viewport_reset(struct imv_viewport *view); +/* Fetch viewport offset/position */ +void imv_viewport_get_offset(struct imv_viewport *view, int *x, int *y); + +/* Fetch viewport scale */ +void imv_viewport_get_scale(struct imv_viewport *view, double *scale); /* Pan the view by the given amounts without letting the image get too far * off-screen */ @@ -71,5 +73,4 @@ int imv_viewport_needs_redraw(struct imv_viewport *view); #endif - /* vim:set ts=2 sts=2 sw=2 et: */ -- cgit v1.2.3