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

Go to the source code of this file.

Functions

popup_structpopup_create (texture_struct *texture)
 
static void popup_button_free (popup_button *button)
 
void popup_destroy (popup_struct *popup)
 
void popup_destroy_all (void)
 
static void popup_button_show (popup_struct *popup, popup_button *button)
 
void popup_render (popup_struct *popup)
 
void popup_render_all (void)
 
static int popup_button_handle_event (popup_button *button, SDL_Event *event)
 
int popup_handle_event (SDL_Event *event)
 
popup_structpopup_get_head (void)
 
void popup_button_set_text (popup_button *button, const char *text)
 
int popup_need_redraw (void)
 

Variables

static popup_structpopup_head = NULL
 

Detailed Description

Popup API.

Author
Alex Tokar

Definition in file popup.c.

Function Documentation

static void popup_button_free ( popup_button button)
static

Free the data used by a popup button.

Parameters
buttonThe button.

Definition at line 89 of file popup.c.

static int popup_button_handle_event ( popup_button button,
SDL_Event *  event 
)
static

Handle popup button event.

Parameters
buttonThe button.
eventThe event.
Return values
1Handled the event.
-1Handled the event and the button was handled by callback function.
0Did not handle the event.

Definition at line 225 of file popup.c.

void popup_button_set_text ( popup_button button,
const char *  text 
)

Set the text of a generic popup button.

Parameters
buttonThe button.
textText to set.

Definition at line 359 of file popup.c.

static void popup_button_show ( popup_struct popup,
popup_button button 
)
static

Render a single popup button.

Parameters
popupPopup.
buttonThe button to render.

Definition at line 146 of file popup.c.

popup_struct* popup_create ( texture_struct texture)

Create a new popup.

Parameters
textureThe texture to use.
Returns
The created popup.

Definition at line 48 of file popup.c.

void popup_destroy ( popup_struct popup)

Destroy the visible popup, freeing it.

Definition at line 101 of file popup.c.

void popup_destroy_all ( void  )

Destroy all visible popups.

Definition at line 129 of file popup.c.

popup_struct* popup_get_head ( void  )

Get the currently visible popup.

Returns
The visible popup, or NULL if there isn't any.

Definition at line 347 of file popup.c.

int popup_handle_event ( SDL_Event *  event)

Handle mouse and keyboard events when a popup is active.

Parameters
eventEvent.
Returns
1 to disable any other mouse/keyboard actions, 0 otherwise.

Definition at line 245 of file popup.c.

int popup_need_redraw ( void  )

Check whether any popup needs redrawing.

Returns
1 if any popup needs redrawing, 0 otherwise.
Todo:
Actual redrawing logic in popups.

Definition at line 374 of file popup.c.

void popup_render ( popup_struct popup)

Render the specified popup.

Parameters
popupThe popup to render.

Definition at line 160 of file popup.c.

void popup_render_all ( void  )

Render the visible popups.

Definition at line 204 of file popup.c.

Variable Documentation

popup_struct* popup_head = NULL
static

Doubly-linked list of the visible popups.

Definition at line 39 of file popup.c.