29#ifdef SDL2_PLAIN_INCLUDE
94 errbuf,
sizeof(errbuf)) != -1) {
204 for (i = 0; i < 100; i++) {
221 SDL_Color bg_color = {255, 255, 255, 128};
223 int w = 0, h = 0, count = 0, meta_h;
238 area = label_window->
area;
240 fc_snprintf(cbuf,
sizeof(cbuf),
_(
"Creating Server List..."));
242 pstr->
style = TTF_STYLE_BOLD;
243 pstr->
bgcol = (SDL_Color) {0, 0, 0, 0};
249 (label_window->
size.w - label_window->
area.w)));
251 (label_window->
size.w - label_window->
area.w));
254 (label_window->
size.w - label_window->
area.w) + area.w,
255 (label_window->
size.h - label_window->
area.h) + area.h);
257 area = label_window->
area;
265 area.x + (area.w - new_widget->
size.w) / 2,
266 area.y + (area.h - new_widget->
size.h) / 2);
314 pwindow->
dst,
_(
"Cancel"),
325 fc_snprintf(cbuf,
sizeof(cbuf),
_(
"%s Port %d Ver: %s %s %s %d\n%s"),
342 w =
MAX(w, new_widget->
size.w);
343 h =
MAX(h, new_widget->
size.h);
386 area = pwindow->
area;
401 new_widget = pwindow->
prev;
406 new_widget = new_widget->
prev;
410 new_widget->
size.w = w;
411 new_widget->
size.h = h;
414 new_widget = new_widget->
prev;
416 while (new_widget != NULL) {
417 new_widget->
size.w = w;
418 new_widget->
size.h = h;
426 new_widget = new_widget->
prev;
447 area2.x - 1, area2.y - 1, area2.w, area2.h,
454 area.w - 1, area.h - 1,
633 pwindow->
dst,
_(
"Cancel"),
640 buf->next->size.w =
buf->size.w;
668 start_x =
area.x + (
area.w -
buf->prev->size.w) / 2;
674 pos_y +=
buf->size.h;
677 buf->size.x = start_x;
687 pos_y +=
buf->size.h;
691 buf->size.x = start_x;
701 pos_y +=
buf->size.h;
705 buf->size.x = start_x;
840 buf->next->size.w =
buf->size.w;
1009 pwindow->
dst,
_(
"Cancel"),
1016 buf->next->size.w =
buf->size.w;
void output_window_append(const struct ft_color color, const char *featured_text)
char fc_password[MAX_LEN_PASSWORD]
static struct fc_sockaddr_list * list
int connect_to_server(const char *username, const char *hostname, int port, char *errbuf, int errbufsize)
void disconnect_from_server(void)
void fc_allocate_mutex(fc_mutex *mutex)
void fc_release_mutex(fc_mutex *mutex)
const struct ft_color ftc_client
const struct ft_color ftc_any
void server_connect(void)
void close_connection_dialog(void)
void meswin_dialog_popdown(void)
void meswin_dialog_popup(bool raise)
static struct server_scan_timer_data lan_scan
SDL_Color * get_theme_color(enum theme_color themecolor)
static int convert_first_passwd_callback(struct widget *pwidget)
void handle_game_load(bool load_successful, const char *filename)
static int cancel_connect_dlg_callback(struct widget *pwidget)
static struct small_dialog * connect_dlg
static int convert_playername_callback(struct widget *pwidget)
static int exit_meta_server_dlg_callback(struct widget *pwidget)
static int send_passwd_callback(struct widget *pwidget)
static void popup_new_user_passwd_dialog(const char *message)
static void server_scan_error(struct server_scan *scan, const char *message)
static int meta_server_window_callback(struct widget *pwindow)
static int connect_callback(struct widget *pwidget)
static int select_meta_servers_callback(struct widget *pwidget)
void popup_join_game_dialog(void)
static void popup_user_passwd_dialog(const char *message)
static struct srv_list * sdl_create_server_list(bool lan)
static int convert_second_passwd_callback(struct widget *pwidget)
void handle_authentication_req(enum authentication_type type, const char *message)
void popup_connection_dialog(bool lan_scan)
static int convert_servername_callback(struct widget *pwidget)
static int cancel_passwd_callback(struct widget *pwidget)
static struct server_list * server_list
static struct advanced_dialog * meta_server
static int convert_portnr_callback(struct widget *pwidget)
static int convert_passwd_callback(struct widget *pwidget)
int main_window_width(void)
int fill_rect_alpha(SDL_Surface *surf, SDL_Rect *prect, SDL_Color *pcolor)
struct sdl2_data main_data
void create_frame(SDL_Surface *dest, Sint16 left, Sint16 top, Sint16 width, Sint16 height, SDL_Color *pcolor)
int main_window_height(void)
struct widget * selected_widget
#define PRESSED_EVENT(event)
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
utf8_str * create_utf8_str_fonto(char *in_text, size_t n_alloc, enum font_origin origin)
#define create_utf8_from_char_fonto(string_in, fonto)
#define log_normal(message,...)
#define log_error(message,...)
#define fc_calloc(n, esz)
int send_packet_authentication_reply(struct connection *pc, const struct packet_authentication_reply *packet)
void set_client_page(enum client_pages page)
struct srv_list * server_scan_get_list(struct server_scan *scan)
void server_scan_finish(struct server_scan *scan)
struct server_scan * server_scan_begin(enum server_scan_type type, ServerScanErrorFunc error_func)
enum server_scan_type server_scan_get_type(const struct server_scan *scan)
enum server_scan_status server_scan_poll(struct server_scan *scan)
#define server_list_iterate_end
#define server_list_iterate(serverlist, pserver)
struct widget * active_widget_list
struct widget * end_widget_list
struct widget * begin_widget_list
struct widget * begin_active_widget_list
struct widget * end_active_widget_list
struct scroll_bar * scroll
char password[MAX_LEN_PASSWORD]
struct widget * begin_widget_list
struct widget * end_widget_list
struct server_list * servers
int fc_snprintf(char *str, size_t n, const char *format,...)
#define sz_strlcpy(dest, src)
SDL_Surface * theme_get_background(const struct theme *t, enum theme_background background)
@ BACKGROUND_USERPASSWDDLG
@ COLOR_THEME_CONNECTDLG_INNERFRAME
@ COLOR_THEME_JOINGAMEDLG_TEXT
@ COLOR_THEME_CONNECTDLG_FRAME
@ COLOR_THEME_USERPASSWDDLG_TEXT
struct theme * active_theme