NetSurf
Data Structures | Macros | Functions | Variables
throbber.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <gtk/gtk.h>
#include <stdint.h>
#include "utils/log.h"
#include "gtk/resources.h"
#include "gtk/throbber.h"
Include dependency graph for throbber.c:

Go to the source code of this file.

Data Structures

struct  nsgtk_throbber
 Throbber images context. More...
 

Macros

#define THROBBER_FRAMES   9
 
#define THROBBER_FMT   "throbber/throbber%d.png"
 

Functions

nserror nsgtk_throbber_init (void)
 Initialise global throbber context. More...
 
void nsgtk_throbber_finalise (void)
 release global throbber context More...
 
nserror nsgtk_throbber_get_frame (int frame, GdkPixbuf **pixbuf)
 get the pixbuf of a given frame of the throbber More...
 

Variables

static struct nsgtk_throbbernsgtk_throbber = NULL
 

Macro Definition Documentation

◆ THROBBER_FMT

#define THROBBER_FMT   "throbber/throbber%d.png"

Definition at line 43 of file throbber.c.

◆ THROBBER_FRAMES

#define THROBBER_FRAMES   9

Definition at line 42 of file throbber.c.

Function Documentation

◆ nsgtk_throbber_finalise()

void nsgtk_throbber_finalise ( void  )

release global throbber context

Definition at line 88 of file throbber.c.

References nsgtk_throbber::framedata, and nsgtk_throbber::nframes.

◆ nsgtk_throbber_get_frame()

nserror nsgtk_throbber_get_frame ( int  frame,
GdkPixbuf **  pixbuf 
)

get the pixbuf of a given frame of the throbber

Parameters
frameThe frame number starting at 0 for stopped frame
pixbufupdated on success
Returns
NSERROR_OK and pixbuf updated on success, NSERROR_BAD_SIZE if frame is out of range else error code.

Definition at line 103 of file throbber.c.

References nsgtk_throbber::framedata, nsgtk_throbber::nframes, NSERROR_BAD_SIZE, NSERROR_INVALID, NSERROR_OK, and nsgtk_throbber_init().

Referenced by make_toolbar_item_throbber(), next_throbber_frame(), and set_throbber_frame().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_throbber_init()

nserror nsgtk_throbber_init ( void  )

Initialise global throbber context.

Definition at line 46 of file throbber.c.

References nsgtk_throbber::framedata, nsgtk_throbber::nframes, NSERROR_INIT_FAILED, NSERROR_NOMEM, NSERROR_OK, nsgdk_pixbuf_new_from_resname(), NSLOG, THROBBER_FMT, and THROBBER_FRAMES.

Referenced by nsgtk_setup(), and nsgtk_throbber_get_frame().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ nsgtk_throbber

struct nsgtk_throbber* nsgtk_throbber = NULL
static

Definition at line 40 of file throbber.c.