diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-08-18 14:41:31 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-08-18 14:41:31 +0100 |
commit | c0e27bd0da9c6804c788473b891bff6c0c98af66 (patch) | |
tree | 523d0eb4a97ee538801a556c340da907c4e245b0 /frontends/gtk/throbber.h | |
parent | 01f3879b647e69684ef8cbcc53f44b2c9b7b5df8 (diff) | |
download | netsurf-c0e27bd0da9c6804c788473b891bff6c0c98af66.tar.gz netsurf-c0e27bd0da9c6804c788473b891bff6c0c98af66.tar.bz2 |
access gtk throbber frames through an interface
This changes the gtk throbber frames to be accessed through an API
This removes teh nsgtk_throbber global and hides the implementation
details from the rest of the code.
Diffstat (limited to 'frontends/gtk/throbber.h')
-rw-r--r-- | frontends/gtk/throbber.h | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/frontends/gtk/throbber.h b/frontends/gtk/throbber.h index e0b47e15c..c8529d2e2 100644 --- a/frontends/gtk/throbber.h +++ b/frontends/gtk/throbber.h @@ -16,20 +16,27 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __GTK_THROBBER_H__ -#define __GTK_THROBBER_H__ - -#include <gtk/gtk.h> - -struct nsgtk_throbber -{ - int nframes; /**< Number of frames in the throbber */ - GdkPixbuf **framedata; -}; - -extern struct nsgtk_throbber *nsgtk_throbber; +#ifndef NETSURF_GTK_THROBBER_H +#define NETSURF_GTK_THROBBER_H +/** + * Initialise global throbber context + */ nserror nsgtk_throbber_init(void); + +/** + * release global throbber context + */ void nsgtk_throbber_finalise(void); -#endif /* __GTK_THROBBER_H__ */ +/** + * get the pixbuf of a given frame of the throbber + * + * \param frame The frame number starting at 0 for stopped frame + * \param pixbuf updated on success + * \return NSERROR_OK and pixbuf updated on success, NSERROR_BAD_SIZE if frame + * is out of range else error code. + */ +nserror nsgtk_throbber_get_frame(int frame, GdkPixbuf **pixbuf); + +#endif /* NETSURF_GTK_THROBBER_H */ |