mp::ui Class Reference

#include <multiplayer_ui.hpp>

Inheritance diagram for mp::ui:

Inheritance graph
[legend]
Collaboration diagram for mp::ui:

Collaboration graph
[legend]

List of all members.

Public Types

enum  result {
  CONTINUE, JOIN, OBSERVE, CREATE,
  PREFERENCES, PLAY, QUIT
}
enum  user_relation { ME, FRIEND, NEUTRAL, IGNORED }
enum  user_state { LOBBY, GAME, SEL_GAME }

Public Member Functions

 ui (game_display &d, const std::string &title, const config &cfg, chat &c, config &gamelist)
void process_network ()
result get_result ()
void set_location (const SDL_Rect &rect)

Protected Member Functions

int xscale (int x) const
int yscale (int y) const
SDL_Rect client_area () const
game_displaydisp ()
const configgame_config () const
virtual void draw_contents ()
virtual void process_event ()
virtual void handle_event (const SDL_Event &event)
virtual void handle_key_event (const SDL_KeyboardEvent &event)
void add_chat_message (const time_t &time, const std::string &speaker, int side, const std::string &message, game_display::MESSAGE_TYPE type=game_display::MESSAGE_PRIVATE)
void send_chat_message (const std::string &message, bool allies_only=false)
void process_message (const config &msg, const bool whisper=false)
 Process chat messages.
virtual void process_network_data (const config &data, const network::connection sock)
virtual void process_network_error (network::error &error)
virtual bool accept_connections ()
virtual void process_network_connection (const network::connection sock)
virtual void hide_children (bool hide=true)
virtual void layout_children (const SDL_Rect &rect)
result set_result (result res)
void set_selected_game (const std::string game_name)
virtual void gamelist_updated (bool silent=true)
void set_user_list (const std::vector< std::string > &, bool silent)
void set_user_menu_items (const std::vector< std::string > &list)
configgamelist ()
void append_to_title (const std::string &name)
const gui::labeltitle () const

Protected Attributes

game_displaydisp_

Static Protected Attributes

static const int xscale_base = 1024
static const int yscale_base = 768

Private Attributes

bool initialized_
 Set to true when the widgets are intialized.
bool gamelist_initialized_
const hotkey::basic_handler hotkey_handler_
const preferences::display_manager disp_manager_
const configgame_config_
chatchat_
configgamelist_
gui::label title_
gui::textbox entry_textbox_
gui::textbox chat_textbox_
gui::menu users_menu_
std::vector< std::string > user_list_
std::string selected_game_
result result_
bool gamelist_refresh_
Uint32 lobby_clock_

Classes

struct  user_info


Detailed Description

Definition at line 72 of file multiplayer_ui.hpp.


Member Enumeration Documentation

Enumerator:
CONTINUE 
JOIN 
OBSERVE 
CREATE 
PREFERENCES 
PLAY 
QUIT 

Definition at line 75 of file multiplayer_ui.hpp.

Enumerator:
ME 
FRIEND 
NEUTRAL 
IGNORED 

Definition at line 210 of file multiplayer_ui.hpp.

Enumerator:
LOBBY 
GAME 
SEL_GAME 

Definition at line 211 of file multiplayer_ui.hpp.


Constructor & Destructor Documentation

mp::ui::ui ( game_display d,
const std::string &  title,
const config cfg,
chat c,
config gamelist 
)


Member Function Documentation

void mp::ui::process_network (  ) 

ui::result mp::ui::get_result (  ) 

void mp::ui::set_location ( const SDL_Rect &  rect  )  [virtual]

int mp::ui::xscale ( int  x  )  const [protected]

Definition at line 310 of file multiplayer_ui.cpp.

References gui::widget::width(), and xscale_base.

Referenced by client_area(), layout_children(), and mp::lobby::layout_children().

int mp::ui::yscale ( int  y  )  const [protected]

Definition at line 315 of file multiplayer_ui.cpp.

References gui::widget::height(), and yscale_base.

Referenced by client_area(), layout_children(), and mp::lobby::layout_children().

SDL_Rect mp::ui::client_area (  )  const [protected]

game_display& mp::ui::disp (  )  [inline, protected]

const config & mp::ui::game_config (  )  const [protected]

void mp::ui::draw_contents (  )  [protected, virtual]

void mp::ui::process_event (  )  [protected, virtual]

Reimplemented from events::handler.

Reimplemented in mp::connect, mp::create, mp::lobby, and mp::wait.

Definition at line 368 of file multiplayer_ui.cpp.

void mp::ui::handle_event ( const SDL_Event &  event  )  [protected, virtual]

void mp::ui::handle_key_event ( const SDL_KeyboardEvent &  event  )  [protected, virtual]

void mp::ui::add_chat_message ( const time_t &  time,
const std::string &  speaker,
int  side,
const std::string &  message,
game_display::MESSAGE_TYPE  type = game_display::MESSAGE_PRIVATE 
) [protected, virtual]

void mp::ui::send_chat_message ( const std::string &  message,
bool  allies_only = false 
) [protected, virtual]

void mp::ui::process_message ( const config msg,
const bool  whisper = false 
) [protected]

void mp::ui::process_network_data ( const config data,
const network::connection  sock 
) [protected, virtual]

void mp::ui::process_network_error ( network::error error  )  [protected, virtual]

Reimplemented in mp::connect.

Definition at line 495 of file multiplayer_ui.cpp.

References ERR_NW, and network::error::message.

Referenced by process_network().

virtual bool mp::ui::accept_connections (  )  [inline, protected, virtual]

Reimplemented in mp::connect.

Definition at line 138 of file multiplayer_ui.hpp.

Referenced by process_network().

void mp::ui::process_network_connection ( const network::connection  sock  )  [protected, virtual]

Reimplemented in mp::connect.

Definition at line 503 of file multiplayer_ui.cpp.

References LOG_NW.

Referenced by process_network(), and mp::connect::process_network_connection().

void mp::ui::hide_children ( bool  hide = true  )  [protected, virtual]

void mp::ui::layout_children ( const SDL_Rect &  rect  )  [protected, virtual]

ui::result mp::ui::set_result ( ui::result  res  )  [protected]

void mp::ui::set_selected_game ( const std::string  game_name  )  [protected]

void mp::ui::gamelist_updated ( bool  silent = true  )  [protected, virtual]

void mp::ui::set_user_list ( const std::vector< std::string > &  list,
bool  silent 
) [protected]

void mp::ui::set_user_menu_items ( const std::vector< std::string > &  list  )  [protected]

config& mp::ui::gamelist (  )  [inline, protected]

void mp::ui::append_to_title ( const std::string &  name  )  [protected]

const gui::label & mp::ui::title (  )  const [protected]


Member Data Documentation

const int mp::ui::xscale_base = 1024 [static, protected]

Definition at line 98 of file multiplayer_ui.hpp.

Referenced by mp::lobby::layout_children(), and xscale().

const int mp::ui::yscale_base = 768 [static, protected]

Definition at line 99 of file multiplayer_ui.hpp.

Referenced by yscale().

Definition at line 103 of file multiplayer_ui.hpp.

Referenced by disp(), mp::lobby::process_event(), and mp::create::process_event().

bool mp::ui::initialized_ [private]

Set to true when the widgets are intialized.

Allows delayed initialization on first positioning.

Definition at line 175 of file multiplayer_ui.hpp.

Referenced by set_location().

Definition at line 176 of file multiplayer_ui.hpp.

Referenced by process_network_data().

Definition at line 179 of file multiplayer_ui.hpp.

Definition at line 181 of file multiplayer_ui.hpp.

const config& mp::ui::game_config_ [private]

Definition at line 185 of file multiplayer_ui.hpp.

Referenced by game_config().

chat& mp::ui::chat_ [private]

Definition at line 189 of file multiplayer_ui.hpp.

Referenced by gamelist(), gamelist_updated(), and process_network_data().

Definition at line 191 of file multiplayer_ui.hpp.

Referenced by append_to_title(), hide_children(), layout_children(), and title().

Definition at line 193 of file multiplayer_ui.hpp.

Referenced by handle_key_event(), hide_children(), and layout_children().

std::vector<std::string> mp::ui::user_list_ [private]

Definition at line 199 of file multiplayer_ui.hpp.

Referenced by handle_event(), handle_key_event(), and set_user_list().

std::string mp::ui::selected_game_ [private]

Definition at line 201 of file multiplayer_ui.hpp.

Referenced by gamelist_updated(), and set_selected_game().

Definition at line 203 of file multiplayer_ui.hpp.

Referenced by get_result(), and set_result().

bool mp::ui::gamelist_refresh_ [private]

Definition at line 205 of file multiplayer_ui.hpp.

Referenced by process_network(), and process_network_data().

Uint32 mp::ui::lobby_clock_ [private]

Definition at line 207 of file multiplayer_ui.hpp.

Referenced by process_network(), and process_network_data().


The documentation for this class was generated from the following files:

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs