Atrinik Client  4.0
Data Structures | Typedefs | Functions | Variables
settings_client.c File Reference
#include <global.h>
#include <toolkit/string.h>
#include <toolkit/colorspace.h>

Go to the source code of this file.

Data Structures

union  list_settings_graphic_union
 

Typedefs

typedef union
list_settings_graphic_union 
list_settings_graphic_union
 

Functions

static void setting_change_value (int cat, int set, int64_t val)
 
static int setting_find_by_text_input (text_input_struct *text_input)
 
static void settings_list_button_repeat (button_struct *button)
 
static void settings_list_clear (void)
 
static void settings_list_reload (void)
 
static void list_post_column (list_struct *list, uint32_t row, uint32_t col)
 
static void list_handle_enter (list_struct *list, SDL_Event *event)
 
static void list_handle_mouse_row (list_struct *list, uint32_t row, SDL_Event *event)
 
static void color_picker_callback (color_picker_struct *color_picker)
 
static void button_repeat (button_struct *button)
 
static int popup_draw (popup_struct *popup)
 
static int popup_event (popup_struct *popup, SDL_Event *event)
 
static int popup_destroy_callback (popup_struct *popup)
 
static int popup_button_event (popup_button *button)
 
void settings_client_open (void)
 

Variables

static button_struct button_category_left
 
static button_struct button_category_right
 
static button_struct button_apply
 
static button_struct button_done
 
static size_t setting_category_selected
 
static list_structlist_settings
 
static text_input_structtext_input_focused
 
static text_input_structtext_input_selected
 

Detailed Description

Client settings GUI.

Author
Alex Tokar

Definition in file settings_client.c.

Function Documentation

static void button_repeat ( button_struct button)
static

Function called on button repeat

Parameters
buttonThe button.

Definition at line 469 of file settings_client.c.

static void color_picker_callback ( color_picker_struct color_picker)
static

Definition at line 451 of file settings_client.c.

static void list_handle_enter ( list_struct list,
SDL_Event *  event 
)
static

Function to handle enter key being pressed on a selected row, or a row being double clicked.

Parameters
listList.
EventEvent that triggered this.

Definition at line 419 of file settings_client.c.

static void list_handle_mouse_row ( list_struct list,
uint32_t  row,
SDL_Event *  event 
)
static

Callback function to call when a mouse has been detected to be located over a list row.

Parameters
listThe list.
rowThe row in the list the mouse is over.
eventEvent that triggered this - can be used to figure out whether the event was a click, a motion, etc.

Definition at line 443 of file settings_client.c.

static void list_post_column ( list_struct list,
uint32_t  row,
uint32_t  col 
)
static

Callback function to call after drawing one column in a list.

Parameters
listThe list.
rowThe row of the column that was drawn.
colThe column.

Definition at line 297 of file settings_client.c.

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 707 of file settings_client.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 691 of file settings_client.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 497 of file settings_client.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 546 of file settings_client.c.

static void setting_change_value ( int  cat,
int  set,
int64_t  val 
)
static

Change setting value.

Parameters
catCategory.
setSetting.
valModifier.

Definition at line 88 of file settings_client.c.

static int setting_find_by_text_input ( text_input_struct text_input)
static

Figure out setting ID by text input structure pointer.

Parameters
text_inputText input to find.
Returns
The setting ID if found, -1 otherwise.

Definition at line 135 of file settings_client.c.

static void settings_list_button_repeat ( button_struct button)
static

Function called on button repeat

Parameters
buttonThe button.

Definition at line 154 of file settings_client.c.

static void settings_list_clear ( void  )
static

Clear the settings list data.

Definition at line 193 of file settings_client.c.

static void settings_list_reload ( void  )
static

Reload the client settings list.

Definition at line 228 of file settings_client.c.

Variable Documentation

button_struct button_category_left
static

Button buffer.

Definition at line 61 of file settings_client.c.

list_struct* list_settings
static

The settings list.

Definition at line 69 of file settings_client.c.

size_t setting_category_selected
static

Selected setting category.

Definition at line 65 of file settings_client.c.

text_input_struct* text_input_focused
static

Currently focused text input.

Definition at line 73 of file settings_client.c.

text_input_struct* text_input_selected
static

Currently selected text input for color picker.

Definition at line 77 of file settings_client.c.