Atrinik Client  4.0
Functions | Variables
book.c File Reference
#include <global.h>
#include <toolkit/string.h>

Go to the source code of this file.

Functions

void book_name_change (const char *name, size_t len)
 
static int popup_draw_func (popup_struct *popup)
 
static int popup_draw_post_func (popup_struct *popup)
 
static int popup_button_event_func (popup_button *button)
 
static int popup_event_func (popup_struct *popup, SDL_Event *event)
 
static int popup_destroy_callback (popup_struct *popup)
 
static const char * popup_clipboard_copy_func (popup_struct *popup)
 
void book_load (const char *data, int len)
 
void book_redraw (void)
 
void book_add_help_history (const char *name)
 

Variables

static char * book_content = NULL
 
static char book_name [HUGE_BUF]
 
static uint32_t book_lines = 0
 
static uint32_t book_scroll_lines = 0
 
static uint32_t book_scroll = 0
 
UT_array * book_help_history = NULL
 
static uint8_t book_help_history_enabled = 0
 
static scrollbar_struct scrollbar
 

Detailed Description

Book GUI related code.

Author
Alex Tokar

Definition in file book.c.

Function Documentation

void book_add_help_history ( const char *  name)

Enable book help history.

Definition at line 296 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 209 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 59 of file book.c.

void book_redraw ( void  )

Redraw the book GUI.

Definition at line 286 of file book.c.

static int popup_button_event_func ( popup_button button)
static

Callback function to call when the button is clicked.

Parameters
buttonThe clicked button.
Return values
1Handled the event, should not do generic handling.
0Did not handle the event.

Definition at line 104 of file book.c.

static const char* popup_clipboard_copy_func ( popup_struct popup)
static

Function used to get contents for clipboard copy operation.

Parameters
popupPopup.
Returns
Contents to copy.

Definition at line 196 of file book.c.

static int popup_destroy_callback ( popup_struct popup)
static

Function used right before the visible popup is destroyed using popup_destroy_visible().

Parameters
popupThe popup.
Returns
1 to proceed with the destruction of the popup, 0 otherwise.

Definition at line 176 of file book.c.

static int popup_draw_func ( popup_struct popup)
static

Function used for drawing on the popup's surface.

Parameters
popupThe popup.
Returns
0 to destroy the popup, 1 otherwise.

Definition at line 67 of file book.c.

static int popup_draw_post_func ( popup_struct popup)
static

Function used for drawing after drawing the popup's surface on the main surface.

Parameters
popupThe popup.
Returns
0 to destroy the popup, 1 otherwise.

Definition at line 95 of file book.c.

static int popup_event_func ( popup_struct popup,
SDL_Event *  event 
)
static

Function used for handling mouse/key events when popup is visible.

Parameters
eventSDL event.
Return values
-1Did not handle the event.
0Did not handle the event, but allow other keyboard events.
1Handled the event.

Definition at line 132 of file book.c.

Variable Documentation

char* book_content = NULL
static

The book's content.

Definition at line 36 of file book.c.

UT_array* book_help_history = NULL

Help history - used for the 'Back' button.

Definition at line 46 of file book.c.

uint8_t book_help_history_enabled = 0
static

Whether the help history is enabled for this book GUI.

Definition at line 48 of file book.c.

uint32_t book_lines = 0
static

Number of lines in the book.

Definition at line 40 of file book.c.

char book_name[HUGE_BUF]
static

Name of the book.

Definition at line 38 of file book.c.

uint32_t book_scroll = 0
static

Lines scrolled.

Definition at line 44 of file book.c.

uint32_t book_scroll_lines = 0
static

Number of lines at the end.

Definition at line 42 of file book.c.

scrollbar_struct scrollbar
static

Scrollbar in the book GUI.

Definition at line 50 of file book.c.