Atrinik Client 2.5
Functions | Variables
gui/book.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

void book_name_change (const char *name, size_t len)
void book_load (const char *data, int len)
void book_show ()
void book_handle_key (SDLKey key)
void book_handle_event (SDL_Event *event)
void book_redraw ()

Variables

static char * book_content = NULL
static char book_name [HUGE_BUF]
static int book_lines = 0
static int book_scroll_lines = 0
static int book_scroll = 0
static SDL_Surface * surface = NULL
static uint8 redraw = 1
static int redraw_scroll = 0

Detailed Description

Book GUI related code.

Definition in file book.c.


Function Documentation

void book_handle_event ( SDL_Event *  event)

Handle book events, such as mouse wheel scrolling.

Parameters:
eventThe event.

Definition at line 222 of file book.c.

void book_handle_key ( SDLKey  key)

Handle a key.

Parameters:
keyThe key.

Definition at line 188 of file book.c.

void book_load ( const char *  data,
int  len 
)

Load the book interface.

Parameters:
dataBook's content.
lenLength of 'data'.

Definition at line 66 of file book.c.

void book_name_change ( const char *  name,
size_t  len 
)

Change the book's displayed name.

Parameters:
nameThe name to change to.
lenLength of the name.

Definition at line 55 of file book.c.

void book_redraw ( )

Redraw the book GUI.

Definition at line 243 of file book.c.

void book_show ( )

Actually show the book interface.

Definition at line 121 of file book.c.


Variable Documentation

char* book_content = NULL [static]

The book's content.

Definition at line 33 of file book.c.

int book_lines = 0 [static]

Number of lines in the book.

Definition at line 37 of file book.c.

char book_name[HUGE_BUF] [static]

Name of the book.

Definition at line 35 of file book.c.

int book_scroll = 0 [static]

Lines scrolled.

Definition at line 41 of file book.c.

int book_scroll_lines = 0 [static]

Number of lines at the end.

Definition at line 39 of file book.c.

uint8 redraw = 1 [static]

Is it time to redraw?

Definition at line 45 of file book.c.

int redraw_scroll = 0 [static]

Cache of book_scroll, used to check whether it's time to redraw due to scroll change.

Definition at line 49 of file book.c.

SDL_Surface* surface = NULL [static]

Book GUI surface.

Definition at line 43 of file book.c.