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

Go to the source code of this file.

Data Structures

struct  widget_quickslots
 

Typedefs

typedef struct widget_quickslots widget_quickslots_t
 

Functions

void quickslots_init (void)
 
static void quickslots_set (widgetdata *widget, uint32_t row, uint32_t col, tag_t tag)
 
void quickslots_scroll (widgetdata *widget, int up, int scroll)
 
void quickslots_cycle (widgetdata *widget)
 
static void quickslots_remove (widgetdata *widget, tag_t tag)
 
static int quickslots_trigger (widgetdata *widget, uint32_t row, uint32_t col)
 
static int quickslots_change (widgetdata *widget, uint32_t row, uint32_t col)
 
void quickslots_handle_key (int slot)
 
static void list_post_column (list_struct *list, uint32_t row, uint32_t col)
 
static void list_row_color (list_struct *list, int row, SDL_Rect box)
 
static void widget_draw (widgetdata *widget)
 
static int widget_event (widgetdata *widget, SDL_Event *event)
 
static void widget_deinit (widgetdata *widget)
 
void widget_quickslots_init (widgetdata *widget)
 
void socket_command_quickslots (uint8_t *data, size_t len, size_t pos)
 

Detailed Description

Implements quickslots type widgets.

Author
Alex Tokar

Definition in file quickslots.c.

Typedef Documentation

Structure that holds custom data for quickslot type widgets.

Function Documentation

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 247 of file quickslots.c.

static void list_row_color ( list_struct list,
int  row,
SDL_Rect  box 
)
static

Function that will color the specified row.

Parameters
listList.
rowRow number, 0-[max visible rows].
boxContains base x/y/width/height information to use.

Definition at line 281 of file quickslots.c.

static int quickslots_change ( widgetdata widget,
uint32_t  row,
uint32_t  col 
)
static

Changes the specified quickslot.

Parameters
widgetQuickslots widget.
rowRow.
colColumn.
Returns
1 if the change was handled, 0 otherwise.

Definition at line 201 of file quickslots.c.

void quickslots_cycle ( widgetdata widget)

Cycle the quickslots list.

Parameters
widgetQuickslots widget.

Definition at line 111 of file quickslots.c.

void quickslots_handle_key ( int  slot)

Handle quickslot key event.

Parameters
slotThe quickslot to handle.

Definition at line 230 of file quickslots.c.

void quickslots_init ( void  )

Initialize all quickslot widgets.

Definition at line 46 of file quickslots.c.

static void quickslots_remove ( widgetdata widget,
tag_t  tag 
)
static

Remove item from the quickslots by tag.

Parameters
tagItem tag to remove from quickslots.

Definition at line 129 of file quickslots.c.

void quickslots_scroll ( widgetdata widget,
int  up,
int  scroll 
)

Scroll the quickslots list.

Parameters
widgetQuickslots widget.
upIf 1, scroll upwards, otherwise scroll downwards.
scrollScroll amount.

Definition at line 98 of file quickslots.c.

static void quickslots_set ( widgetdata widget,
uint32_t  row,
uint32_t  col,
tag_t  tag 
)
static

Tell the server to set quickslot with ID 'slot' to the item with ID 'tag'.

Parameters
slotQuickslot ID.
tagID of the item to set. Zero will clear any item from the slot.

Definition at line 67 of file quickslots.c.

static int quickslots_trigger ( widgetdata widget,
uint32_t  row,
uint32_t  col 
)
static

Trigger the specified quickslot.

Parameters
widgetQuickslots widget.
rowRow.
colColumn.
Returns
1 if the trigger was handled, 0 otherwise.

Definition at line 159 of file quickslots.c.

void socket_command_quickslots ( uint8_t *  data,
size_t  len,
size_t  pos 
)

Definition at line 403 of file quickslots.c.

static void widget_deinit ( widgetdata widget)
static

Definition at line 365 of file quickslots.c.

static void widget_draw ( widgetdata widget)
static

Definition at line 295 of file quickslots.c.

static int widget_event ( widgetdata widget,
SDL_Event *  event 
)
static

Definition at line 308 of file quickslots.c.

void widget_quickslots_init ( widgetdata widget)

Initialize one quickslots widget.

Parameters
widgetThe widget to initialize.

Definition at line 376 of file quickslots.c.