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

Go to the source code of this file.

Enumerations

enum  {
  BUTTON_SETTINGS, BUTTON_KEY_SETTINGS, BUTTON_LOGOUT, BUTTON_DISCONNECT,
  BUTTON_NUM
}
 

Functions

static void settings_button_handle (popup_struct *popup, size_t button)
 
static int popup_draw (popup_struct *popup)
 
static int popup_event (popup_struct *popup, SDL_Event *event)
 
static int popup_button_event (popup_button *button)
 
void settings_open (void)
 

Variables

static const char *const button_names [BUTTON_NUM]
 
static size_t button_selected
 

Detailed Description

Settings GUI.

Author
Alex Tokar

Definition in file settings.c.

Enumeration Type Documentation

anonymous enum

The different buttons of the settings popup.

Definition at line 38 of file settings.c.

Function Documentation

static int popup_button_event ( 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 168 of file settings.c.

static int popup_draw ( 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 86 of file settings.c.

static int popup_event ( 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 113 of file settings.c.

static void settings_button_handle ( popup_struct popup,
size_t  button 
)
static

Handle pressing a button in the settings popup.

Parameters
popupThe popup.
buttonThe button ID.

Definition at line 66 of file settings.c.

void settings_open ( void  )

Open the settings popup.

Definition at line 177 of file settings.c.

Variable Documentation

const char* const button_names[BUTTON_NUM]
static
Initial value:
= {
"Client Settings", "Key Settings", "Logout", "Disconnect"
}

Names of the buttons.

Definition at line 50 of file settings.c.

size_t button_selected
static

Currently selected button.

Definition at line 57 of file settings.c.