Atrinik Client  4.0
Macros | Functions | Variables
region_map.c File Reference
#include <global.h>
#include <region_map.h>

Go to the source code of this file.

Macros

#define RM_BORDER_SIZE   25
 
#define RM_SCROLL   10
 
#define RM_SCROLL_SHIFT   50
 
#define RM_MAP_STARTX   25
 
#define RM_MAP_STARTY   60
 
#define RM_MAP_WIDTH   630
 
#define RM_MAP_HEIGHT   345
 
#define RM_BUTTON_LEFT_STARTX   25
 
#define RM_BUTTON_LEFT_STARTY   25
 
#define RM_BUTTON_RIGHT_STARTX   649
 
#define RM_BUTTON_RIGHT_STARTY   25
 
#define RM_TITLE_STARTX   60
 
#define RM_TITLE_STARTY   27
 
#define RM_TITLE_WIDTH   580
 
#define RM_TITLE_HEIGHT   22
 
#define RM_SCROLLBAR_STARTX   662
 
#define RM_SCROLLBAR_STARTY   60
 
#define RM_SCROLLBAR_WIDTH   13
 
#define RM_SCROLLBAR_HEIGHT   345
 
#define RM_SCROLLBARH_STARTX   25
 
#define RM_SCROLLBARH_STARTY   412
 
#define RM_SCROLLBARH_WIDTH   630
 
#define RM_SCROLLBARH_HEIGHT   13
 
#define RM_IN_MAP(_popup, _mx, _my)
 

Functions

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)
 
void region_map_open (void)
 

Variables

static scrollbar_struct scrollbar
 
static scrollbar_info_struct scrollbar_info
 
static scrollbar_struct scrollbar_horizontal
 
static scrollbar_info_struct scrollbar_horizontal_info
 
static bool region_map_dragging = false
 
static region_map_tregion_map = NULL
 

Detailed Description

The region map dialog.

Author
Alex Tokar

Definition in file region_map.c.

Macro Definition Documentation

#define RM_BORDER_SIZE   25

Size of the book GUI borders.

Definition at line 36 of file region_map.c.

#define RM_IN_MAP (   _popup,
  _mx,
  _my 
)
Value:
((_mx) >= (_popup)->x + RM_MAP_STARTX && \
(_mx) < (_popup)->x + RM_MAP_STARTX + RM_MAP_WIDTH && \
(_my) >= (_popup)->y + RM_MAP_STARTY && \
(_my) < (_popup)->y + RM_MAP_STARTY + RM_MAP_HEIGHT)
#define RM_MAP_STARTX
Definition: region_map.c:48
#define RM_MAP_STARTY
Definition: region_map.c:50
#define RM_MAP_WIDTH
Definition: region_map.c:52
#define RM_MAP_HEIGHT
Definition: region_map.c:54

Check whether the mouse is inside the region map.

Definition at line 122 of file region_map.c.

#define RM_SCROLL   10

Number of pixels to scroll using the keyboard arrows.

Definition at line 39 of file region_map.c.

#define RM_SCROLL_SHIFT   50

Number of pixels to scroll using the keyboard arrows when shift is held.

Definition at line 41 of file region_map.c.

Function Documentation

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 275 of file region_map.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 451 of file region_map.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 148 of file region_map.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 282 of file region_map.c.

void region_map_open ( void  )

Opens the region map popup.

Definition at line 464 of file region_map.c.

Variable Documentation

region_map_t* region_map = NULL
static

Local copy of the region map.

Definition at line 145 of file region_map.c.

bool region_map_dragging = false
static

Whether the region map is being dragged with the mouse.

Definition at line 141 of file region_map.c.

scrollbar_struct scrollbar
static

Region map scrollbar.

Definition at line 128 of file region_map.c.

scrollbar_struct scrollbar_horizontal
static

Region map horizontal scrollbar.

Definition at line 132 of file region_map.c.

scrollbar_info_struct scrollbar_horizontal_info
static

Storage for the scroll offset and the like of the horizontal scrollbar.

Definition at line 137 of file region_map.c.

scrollbar_info_struct scrollbar_info
static

Storage for the scroll offset and the like of the scrollbar.

Definition at line 130 of file region_map.c.