Freeciv-3.3
Loading...
Searching...
No Matches
chatline.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14/***********************************************************************
15 chatline.c - description
16 -------------------
17 begin : Sun Jun 30 2002
18 copyright : (C) 2002 by Rafał Bursig
19 email : Rafał Bursig <bursig@poczta.fm>
20***********************************************************************/
21
22#ifdef HAVE_CONFIG_H
23#include <fc_config.h>
24#endif
25
26/* SDL2 */
27#ifdef SDL2_PLAIN_INCLUDE
28#include <SDL.h>
29#else /* SDL2_PLAIN_INCLUDE */
30#include <SDL2/SDL.h>
31#endif /* SDL2_PLAIN_INCLUDE */
32
33/* utility */
34#include "fcintl.h"
35#include "log.h"
36
37/* common */
38#include "game.h"
39#include "packets.h"
40
41/* client */
42#include "client_main.h"
43#include "clinet.h"
44#include "connectdlg_common.h"
45#include "ratesdlg_g.h"
46#include "update_queue.h"
47
48/* gui-sdl2 */
49#include "colors.h"
50#include "dialogs.h"
51#include "graphics.h"
52#include "gui_id.h"
53#include "gui_main.h"
54#include "gui_tilespec.h"
55#include "mapview.h"
56#include "messagewin.h"
57#include "themespec.h"
58#include "utf8string.h"
59#include "widget.h"
60
61#include "chatline.h"
62
77
78static void popup_conn_list_dialog(void);
79static void add_to_chat_list(char *msg, size_t n_alloc);
80
81/**************************************************************************
82 LOAD GAME
83**************************************************************************/
84
86
87/**********************************************************************/
90static int move_load_game_dlg_callback(struct widget *pwindow)
91{
94 }
95
96 return -1;
97}
98
99/**********************************************************************/
124
125/**********************************************************************/
128static int exit_load_dlg_callback(struct widget *pwidget)
129{
131 if (get_client_page() == PAGE_LOAD) {
133 } else {
135 }
136 }
137
138 return -1;
139}
140
141/**********************************************************************/
144static int load_selected_game_callback(struct widget *pwidget)
145{
147 char *filename = (char*)pwidget->data.ptr;
148
149 if (is_server_running()) {
150 send_chat_printf("/load %s", filename);
151
152 if (get_client_page() == PAGE_LOAD) {
154 } else if (get_client_page() == PAGE_START) {
156 }
157 } else {
159 }
160 }
161
162 return -1;
163}
164
165/**********************************************************************/
168static void popup_load_game_dialog(void)
169{
170 struct widget *pwindow;
171 struct widget *close_button;
172 struct widget *filename_label = NULL;
173 struct widget *first_label = NULL;
174 struct widget *last_label = NULL;
175 struct widget *next_label = NULL;
176 utf8_str *title, *filename;
178 struct fileinfo_list *files;
179 int count = 0;
180 int scrollbar_width = 0;
181 int max_label_width = 0;
182
183 if (load_dialog) {
184 return;
185 }
186
187 /* Disable buttons */
200
201 /* Create dialog */
202 load_dialog = fc_calloc(1, sizeof(struct advanced_dialog));
203
204 title = create_utf8_from_char_fonto(_("Choose Saved Game to Load"),
206 title->style |= TTF_STYLE_BOLD;
207
208 pwindow = create_window_skeleton(NULL, title, 0);
210 set_wstate(pwindow, FC_WS_NORMAL);
211
212 add_to_gui_list(ID_WINDOW, pwindow);
213
214 load_dialog->end_widget_list = pwindow;
215
216 area = pwindow->area;
217
218 /* Close button */
219 close_button = create_themeicon(current_theme->small_cancel_icon,
220 pwindow->dst,
223 close_button->info_label
224 = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), FONTO_ATTENTION);
225 close_button->action = exit_load_dlg_callback;
226 set_wstate(close_button, FC_WS_NORMAL);
227 close_button->key = SDLK_ESCAPE;
228
229 add_to_gui_list(ID_BUTTON, close_button);
230
231 area.w += close_button->size.w;
232
233 load_dialog->begin_widget_list = close_button;
234
235 /* Create scrollbar */
238
239 /* Search for user saved games. */
240 files = fileinfolist_infix(get_save_dirs(), ".sav", FALSE);
242 count++;
243
245 filename->style |= SF_CENTER;
246 filename_label = create_iconlabel(NULL, pwindow->dst, filename,
248
249 /* Store filename */
250 filename_label->data.ptr = fc_calloc(1, strlen(pfile->fullname) + 1);
251 fc_strlcpy((char*)filename_label->data.ptr, pfile->fullname,
252 strlen(pfile->fullname) + 1);
253
255
257
258 /* FIXME: This was supposed to be add_widget_to_vertical_scroll_widget_list(), but
259 * add_widget_to_vertical_scroll_widget_list() needs the scrollbar area to be defined
260 * for updating the scrollbar position, but the area is not known yet (depends on
261 * maximum label width) */
263
264 if (count == 1) {
266 }
267
271
273
274 area.w = MAX(area.w, max_label_width + scrollbar_width + 1);
275
276 if (count > 0) {
277 area.h = (load_dialog->scroll->active * filename_label->size.h) + adj_size(5);
278 }
279
282 NULL,
283 (pwindow->size.w - pwindow->area.w) + area.w,
284 (pwindow->size.h - pwindow->area.h) + area.h);
285
286 area = pwindow->area;
287
289 area.x + area.w - 1,
290 area.y + 1,
291 area.h - adj_size(2), TRUE);
292
293 /* Add filename labels to list */
295 while (filename_label) {
296 filename_label->size.w = area.w - scrollbar_width - 3;
297
299
303 filename_label, close_button,
304 FALSE,
305 area.x + 1,
306 area.y + adj_size(2));
307 } else {
311 FALSE,
312 area.x + 1,
313 area.y + adj_size(2));
314 }
315
316 if (filename_label == last_label) {
317 break;
318 }
319
321 }
322
323 widget_set_position(pwindow,
324 (main_window_width() - pwindow->size.w) / 2,
325 (main_window_height() - pwindow->size.h) / 2);
326
327 widget_set_position(close_button,
328 area.x + area.w - close_button->size.w - 1,
329 pwindow->size.y + adj_size(2));
330
331 /* FIXME: The scrollbar already got a background saved in
332 * add_widget_to_vertical_scroll_widget_list(), but the window
333 * is not drawn yet, so this saved background is wrong.
334 * Deleting it here as a workaround. */
336
338 flush_dirty();
339}
340
341/**********************************************************************/
344static int inputline_return_callback(struct widget *pwidget)
345{
346 if (pwidget->string_utf8->text != NULL
347 && pwidget->string_utf8->text[0] != '\0') {
348 send_chat(pwidget->string_utf8->text);
349
351 }
352
353 return -1;
354}
355
356/**********************************************************************/
360{
361 struct widget *input_edit;
362
365 adj_size(400), 0);
366
367 input_edit->size.x = (main_window_width() - input_edit->size.w) / 2;
368 input_edit->size.y = (main_window_height() - input_edit->size.h) / 2;
369
370 if (edit(input_edit) != ED_ESC) {
371 inputline_return_callback(input_edit);
372 }
373
374 widget_undraw(input_edit);
375 widget_mark_dirty(input_edit);
376 FREEWIDGET(input_edit);
377
378 flush_dirty();
379}
380
381/**********************************************************************/
386 const struct text_tag_list *tags,
387 int conn_id)
388{
389 /* Currently this is a wrapper to the message subsystem. */
390 if (conn_dlg) {
391 size_t n = strlen(astring);
392 char *buffer = fc_strdup(astring);
393
394 add_to_chat_list(buffer, n);
395 } else {
398 }
399}
400
401/**********************************************************************/
406{
407 /* TODO */
408}
409
410/**********************************************************************/
414{
415 /* TODO */
416}
417
418/* ====================================================================== */
419
420/**********************************************************************/
423static int conn_dlg_callback(struct widget *pwindow)
424{
425 return -1;
426}
427
428/**********************************************************************/
431static int disconnect_conn_callback(struct widget *pwidget)
432{
435 flush_dirty();
437 }
438
439 return -1;
440}
441
442/**********************************************************************/
445static void add_to_chat_list(char *msg, size_t n_alloc)
446{
447 utf8_str *pstr;
448 struct widget *buf, *pwindow = conn_dlg->end_widget_list;
449
450 fc_assert_ret(msg != NULL);
452
454
458 int count = 0;
460
461 while (utf8_texts[count] != NULL) {
463 strlen(utf8_texts[count]) + 1,
465 pstr2->bgcol = (SDL_Color) {0, 0, 0, 0};
466 buf = create_themelabel2(NULL, pwindow->dst,
469
470 buf->size.w = conn_dlg->text_width;
473 pwindow->size.x + adj_size(10 + 60 + 10),
474 pwindow->size.y + adj_size(14));
475 count++;
476 }
480 } else {
481 pstr->bgcol = (SDL_Color) {0, 0, 0, 0};
482 buf = create_themelabel2(NULL, pwindow->dst,
485
486 buf->size.w = conn_dlg->text_width;
487
490 pwindow->size.x + adj_size(10 + 60 + 10),
491 pwindow->size.y + adj_size(14))) {
494 } else {
497 }
498 }
499
500 flush_dirty();
501}
502
503/**********************************************************************/
506static int input_edit_conn_callback(struct widget *pwidget)
507{
508 if (pwidget->string_utf8->text != NULL) {
509 if (pwidget->string_utf8->text[0] != '\0') {
510 send_chat(pwidget->string_utf8->text);
511 }
512
513 free(pwidget->string_utf8->text);
514 pwidget->string_utf8->text = fc_malloc(1);
515 pwidget->string_utf8->text[0] = '\0';
516 pwidget->string_utf8->n_alloc = 0;
517 }
518
519 return -1;
520}
521
522/**********************************************************************/
525static int start_game_callback(struct widget *pwidget)
526{
528 send_chat("/start");
529 }
530
531 return -1;
532}
533
534/**********************************************************************/
537static int select_nation_callback(struct widget *pwidget)
538{
541 }
542
543 return -1;
544}
545
546/* not implemented yet */
547#if 0
548/**********************************************************************/
551static int server_config_callback(struct widget *pwidget)
552{
553 return -1;
554}
555#endif /* 0 */
556
557/**********************************************************************/
560static int load_game_callback(struct widget *pwidget)
561{
563 /* set_wstate(conn_dlg->load_game_button, FC_WS_NORMAL);
564 * widget_redraw(conn_dlg->load_game_button);
565 * flush_dirty(); */
567 }
568
569 return -1;
570}
571
572/**********************************************************************/
576{
577 if (C_S_PREPARING == client_state()) {
578 if (conn_dlg) {
579 struct widget *buf = NULL, *pwindow = conn_dlg->end_widget_list;
581 bool create;
582
583 pstr->bgcol = (SDL_Color) {0, 0, 0, 0};
584
585 if (conn_dlg->users_dlg) {
592 } else {
593 conn_dlg->users_dlg = fc_calloc(1, sizeof(struct advanced_dialog));
596
602 pwindow->size.x + pwindow->size.w - adj_size(30),
603 pwindow->size.y + adj_size(14),
604 pwindow->size.h - adj_size(44) - adj_size(40), FALSE);
605 }
606
608 create = TRUE;
611
612 buf = create_themelabel2(NULL, pwindow->dst, pstr, adj_size(100), 0,
615
616 buf->id = ID_LABEL;
617
618 /* add to widget list */
619 if (create) {
622 pwindow->area.x + pwindow->area.w - adj_size(130),
623 pwindow->size.y + adj_size(14));
624 create = FALSE;
625 } else {
628 pwindow->area.x + pwindow->area.w - adj_size(130),
629 pwindow->size.y + adj_size(14));
630 }
632
635
636/* FIXME: implement the server settings dialog and then reactivate this part */
637#if 0
641 } else {
643 }
644#endif /* 0 */
645
646 /* redraw */
648
650 } else {
652 }
653
654 /* PAGE_LOAD -> the server was started from the main page to load a game */
655 if (get_client_page() == PAGE_LOAD) {
657 }
658 } else {
660 flush_dirty();
661 }
662 }
663}
664
665/**********************************************************************/
668static void popup_conn_list_dialog(void)
669{
670 SDL_Color window_bg_color = {255, 255, 255, 96};
671
672 struct widget *pwindow = NULL, *buf = NULL, *label = NULL;
673 struct widget* back_button = NULL;
674 struct widget *start_game_button = NULL;
675 struct widget *select_nation_button = NULL;
676/* struct widget *server_settings_button = NULL; */
677 utf8_str *pstr = NULL;
678 int n;
680 SDL_Surface *surf;
681
683 return;
684 }
685
687
688 conn_dlg = fc_calloc(1, sizeof(struct CONNLIST));
689
690 pwindow = create_window_skeleton(NULL, NULL, 0);
691 pwindow->action = conn_dlg_callback;
692 set_wstate(pwindow, FC_WS_NORMAL);
694
695 conn_dlg->end_widget_list = pwindow;
696 add_to_gui_list(ID_WINDOW, pwindow);
697
698 widget_set_position(pwindow, 0, 0);
699
700 /* Create window background */
702 if (resize_window(pwindow, surf, NULL, main_window_width(),
704 FREESURFACE(surf);
705 }
706
708 = pwindow->size.w - adj_size(130) - adj_size(20) - adj_size(20);
709
710 /* Chat area background */
711 area.x = adj_size(10);
712 area.y = adj_size(14);
713 area.w = conn_dlg->text_width + adj_size(20);
714 area.h = pwindow->size.h - adj_size(44) - adj_size(40);
716
717 create_frame(pwindow->theme,
718 area.x - 1, area.y - 1, area.w + 1, area.h + 1,
720
721 /* User list background */
722 area.x = pwindow->size.w - adj_size(130);
723 area.y = adj_size(14);
724 area.w = adj_size(120);
725 area.h = pwindow->size.h - adj_size(44) - adj_size(40);
727
728 create_frame(pwindow->theme,
729 area.x - 1, area.y - 1, area.w + 1, area.h + 1,
731
732 draw_frame(pwindow->theme, 0, 0, pwindow->theme->w, pwindow->theme->h);
733
734 /* -------------------------------- */
735
736 /* Chat area */
737
738 conn_dlg->chat_dlg = fc_calloc(1, sizeof(struct advanced_dialog));
739
741
742 {
743 char cbuf[256];
744
745 fc_snprintf(cbuf, sizeof(cbuf), _("Total users logged in : %d"), n);
747 }
748
749 pstr->bgcol = (SDL_Color) {0, 0, 0, 0};
750
751 label = create_themelabel2(NULL, pwindow->dst,
754
755 widget_set_position(label, adj_size(10), adj_size(14));
756
758
763
764 n = (pwindow->size.h - adj_size(44) - adj_size(40)) / label->size.h;
765 conn_dlg->active = n;
766
769
771 adj_size(10) + conn_dlg->text_width + 1,
772 adj_size(14), pwindow->size.h - adj_size(44) - adj_size(40), FALSE);
774
775 /* -------------------------------- */
776
777 /* Input field */
778
781 pwindow->size.w - adj_size(10) - adj_size(10),
783
784 buf->size.x = adj_size(10);
785 buf->size.y = pwindow->size.h - adj_size(40) - adj_size(5) - buf->size.h;
788 conn_dlg->pedit = buf;
790
791 /* Buttons */
792
794 pwindow->dst,
795 _("Back"), FONTO_ATTENTION, 0);
796 buf->size.x = adj_size(10);
797 buf->size.y = pwindow->size.h - adj_size(10) - buf->size.h;
801 buf->key = SDLK_ESCAPE;
803 back_button = buf;
804
806 pwindow->dst,
807 _("Start"),
808 FONTO_ATTENTION, 0);
809 buf->size.x = pwindow->size.w - adj_size(10) - buf->size.w;
810 buf->size.y = back_button->size.y;
816
818 _("Pick Nation"),
819 FONTO_ATTENTION, 0);
820 buf->size.h = start_game_button->size.h;
821 buf->size.x = start_game_button->size.x - adj_size(10) - buf->size.w;
822 buf->size.y = start_game_button->size.y;
827 select_nation_button = buf;
828
830 _("Load Game"),
831 FONTO_ATTENTION, 0);
832 buf->size.h = select_nation_button->size.h;
833 buf->size.x = select_nation_button->size.x - adj_size(10) - buf->size.w;
834 buf->size.y = select_nation_button->size.y;
839
840 /* Not implemented yet */
841#if 0
843 _("Server Settings"),
844 FONTO_ATTENTION, 0);
845 buf->size.h = select_nation_button->size.h;
846 buf->size.x = select_nation_button->size.x - adj_size(10) - buf->size.w;
847 buf->size.y = select_nation_button->size.y;
853#endif /* 0 */
854
855 /* Not implemented yet */
856#if 0
858 "?", FONTO_ATTENTION, 0);
859 buf->size.y = pwindow->size.y + pwindow->size.h - (buf->size.h + 7);
860 buf->size.x = pwindow->size.x + pwindow->size.w - (buf->size.w + 10) - 5;
861
862 buf->action = client_config_callback;
865#endif /* 0 */
866
868 /* ------------------------------------------------------------ */
869
871}
872
873/**********************************************************************/
877{
878 if (conn_dlg) {
881 }
882
885 if (conn_dlg->users_dlg) {
888 }
889
890 if (conn_dlg->chat_dlg) {
893 }
894
896
897 return TRUE;
898 }
899
900 return FALSE;
901}
902
903/**********************************************************************/
#define n_alloc
Definition astring.c:78
#define n
Definition astring.c:77
int send_chat_printf(const char *format,...)
int send_chat(const char *message)
void output_window_append(const struct ft_color color, const char *featured_text)
struct civclient client
enum client_states client_state(void)
@ C_S_PREPARING
Definition client_main.h:46
void disconnect_from_server(bool leaving_sound)
Definition clinet.c:306
char * incite_cost
Definition comments.c:76
bool is_server_running(void)
#define conn_list_iterate(connlist, pconn)
Definition connection.h:108
#define conn_list_iterate_end
Definition connection.h:110
QString current_theme
Definition fc_client.cpp:64
#define _(String)
Definition fcintl.h:67
const struct ft_color ftc_client
const struct ft_color ftc_any
struct civ_game game
Definition game.c:61
void version_message(const char *vertext)
Definition chatline.c:1478
void log_output_window(void)
Definition chatline.c:929
void clear_output_window(void)
Definition chatline.c:944
void real_output_window_append(const char *astring, const struct text_tag_list *tags, int conn_id)
Definition chatline.c:875
void popup_races_dialog(struct player *pplayer)
Definition dialogs.c:1215
void flush_dirty(void)
Definition mapview.c:468
void meswin_dialog_popdown(void)
Definition messagewin.c:432
const char * title
Definition repodlgs.c:1314
bool popdown_conn_list_dialog(void)
Definition chatline.c:876
struct advanced_dialog * load_dialog
Definition chatline.c:85
static int load_selected_game_callback(struct widget *pwidget)
Definition chatline.c:144
void popdown_load_game_dialog(void)
Definition chatline.c:102
static void popup_conn_list_dialog(void)
Definition chatline.c:668
static int disconnect_conn_callback(struct widget *pwidget)
Definition chatline.c:431
static int select_nation_callback(struct widget *pwidget)
Definition chatline.c:537
static int start_game_callback(struct widget *pwidget)
Definition chatline.c:525
void real_conn_list_dialog_update(void *unused)
Definition chatline.c:575
static void popup_load_game_dialog(void)
Definition chatline.c:168
static int conn_dlg_callback(struct widget *pwindow)
Definition chatline.c:423
void popup_input_line(void)
Definition chatline.c:359
static void add_to_chat_list(char *msg, size_t n_alloc)
Definition chatline.c:445
static int exit_load_dlg_callback(struct widget *pwidget)
Definition chatline.c:128
static int load_game_callback(struct widget *pwidget)
Definition chatline.c:560
struct CONNLIST * conn_dlg
static int input_edit_conn_callback(struct widget *pwidget)
Definition chatline.c:506
static int move_load_game_dlg_callback(struct widget *pwindow)
Definition chatline.c:90
static int inputline_return_callback(struct widget *pwidget)
Definition chatline.c:344
SDL_Color * get_theme_color(enum theme_color themecolor)
Definition colors.c:47
int main_window_width(void)
Definition graphics.c:685
int fill_rect_alpha(SDL_Surface *surf, SDL_Rect *prect, SDL_Color *pcolor)
Definition graphics.c:865
struct sdl2_data main_data
Definition graphics.c:57
void create_frame(SDL_Surface *dest, Sint16 left, Sint16 top, Sint16 width, Sint16 height, SDL_Color *pcolor)
Definition graphics.c:1350
int main_window_height(void)
Definition graphics.c:693
#define FREESURFACE(ptr)
Definition graphics.h:322
@ ID_BUTTON
Definition gui_id.h:29
@ ID_EDIT
Definition gui_id.h:34
@ ID_LABEL
Definition gui_id.h:27
@ ID_WINDOW
Definition gui_id.h:30
void force_exit_from_event_loop(void)
Definition gui_main.c:566
#define adj_size(size)
Definition gui_main.h:141
#define PRESSED_EVENT(event)
Definition gui_main.h:71
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
Definition gui_string.c:251
utf8_str * create_utf8_str_fonto(char *in_text, size_t n_alloc, enum font_origin origin)
Definition gui_string.c:241
bool convert_utf8_str_to_const_surface_width(utf8_str *pstr, int width)
Definition gui_string.c:449
#define FREEUTF8STR(pstr)
Definition gui_string.h:93
#define SF_CENTER
Definition gui_string.h:40
@ FONTO_ATTENTION
Definition gui_string.h:67
@ FONTO_ATTENTION_PLUS
Definition gui_string.h:68
#define create_utf8_from_char_fonto(string_in, fonto)
Definition gui_string.h:108
SDL_Surface * theme_get_background(const struct theme *t, enum theme_background background)
@ BACKGROUND_LOADGAMEDLG
@ BACKGROUND_CONNLISTDLG
@ COLOR_THEME_CONNLISTDLG_FRAME
Definition themecolors.h:80
struct theme * active_theme
Definition themespec.c:154
char ** create_new_line_utf8strs(const char *pstr)
Definition utf8string.c:35
void del_widget_pointer_from_gui_list(struct widget *gui)
Definition widget.c:622
void add_to_gui_list(Uint16 id, struct widget *gui)
Definition widget.c:586
void draw_frame(SDL_Surface *pdest, Sint16 start_x, Sint16 start_y, Uint16 w, Uint16 h)
Definition widget.c:1114
Uint16 redraw_group(const struct widget *begin_group_widget_list, const struct widget *end_group_widget_list, int add_to_update)
Definition widget.c:720
void popdown_window_group_dialog(struct widget *begin_group_widget_list, struct widget *end_group_widget_list)
Definition widget.c:983
void move_window_group(struct widget *begin_widget_list, struct widget *pwindow)
Definition widget.c:1039
static void widget_set_position(struct widget *pwidget, int x, int y)
Definition widget.h:266
@ FC_WS_DISABLED
Definition widget.h:99
@ FC_WS_NORMAL
Definition widget.h:96
@ FC_WS_PRESSED
Definition widget.h:98
void clear_wflag(struct widget *pwidget, enum widget_flag flag)
Definition widget_core.c:62
bool add_widget_to_vertical_scroll_widget_list(struct advanced_dialog *dlg, struct widget *new_widget, struct widget *add_dock, bool dir, Sint16 start_x, Sint16 start_y) fc__attribute((nonnull(2)))
static void widget_mark_dirty(struct widget *pwidget)
Definition widget.h:286
static void widget_flush(struct widget *pwidget)
Definition widget.h:291
#define FREEWIDGET(pwidget)
Definition widget.h:305
void set_wstate(struct widget *pwidget, enum widget_state state)
Definition widget_core.c:36
enum widget_state get_wstate(const struct widget *pwidget)
Definition widget_core.c:70
static void widget_undraw(struct widget *pwidget)
Definition widget.h:296
@ WF_EDIT_LOOP
Definition widget.h:91
@ WF_WIDGET_HAS_INFO_LABEL
Definition widget.h:88
@ WF_DRAW_FRAME_AROUND_WIDGET
Definition widget.h:86
@ WF_FREE_DATA
Definition widget.h:78
@ WF_FREE_STRING
Definition widget.h:76
@ WF_SELECT_WITHOUT_BAR
Definition widget.h:89
@ WF_RESTORE_BACKGROUND
Definition widget.h:85
@ WF_DRAW_TEXT_LABEL_WITH_SPACE
Definition widget.h:87
static int widget_redraw(struct widget *pwidget)
Definition widget.h:276
#define del_group(begin_group_widget_list, end_group_widget_list)
Definition widget.h:389
#define create_themeicon_button_from_chars_fonto(icon_theme, pdest, char_string, fonto, flags)
#define create_edit_from_chars_fonto(background, pdest, char_string, fonto, length, flags)
Definition widget_edit.h:29
@ ED_ESC
Definition widget_edit.h:19
#define edit(pedit)
Definition widget_edit.h:34
struct widget * create_themeicon(SDL_Surface *icon_theme, struct gui_layer *pdest, Uint32 flags)
struct widget * create_themelabel2(SDL_Surface *icon, struct gui_layer *pdest, utf8_str *pstr, Uint16 w, Uint16 h, Uint32 flags)
struct widget * create_iconlabel(SDL_Surface *icon, struct gui_layer *pdest, utf8_str *pstr, Uint32 flags)
void setup_vertical_scrollbar_area(struct scroll_bar *scroll, Sint16 start_x, Sint16 start_y, Uint16 height, bool swap_start_x)
Uint32 create_vertical_scrollbar(struct advanced_dialog *dlg, Uint8 step, Uint8 active, bool create_scrollbar, bool create_buttons)
#define hide_scrollbar(scrollbar)
bool resize_window(struct widget *pwindow, SDL_Surface *bcgd, SDL_Color *pcolor, Uint16 new_w, Uint16 new_h)
struct widget * create_window_skeleton(struct gui_layer *pdest, utf8_str *title, Uint32 flags)
void conn_list_dialog_update(void)
#define fc_assert_ret(condition)
Definition log.h:192
static int max_label_width
#define fc_calloc(n, esz)
Definition mem.h:38
#define FC_FREE(ptr)
Definition mem.h:41
#define fc_strdup(str)
Definition mem.h:43
#define fc_malloc(sz)
Definition mem.h:34
void meswin_add(const char *message, const struct text_tag_list *tags, struct tile *ptile, enum event_type event, int turn, int phase)
const struct strvec * get_save_dirs(void)
Definition shared.c:934
struct fileinfo_list * fileinfolist_infix(const struct strvec *dirs, const char *infix, bool nodups)
Definition shared.c:1204
#define MAX(x, y)
Definition shared.h:54
#define fileinfo_list_iterate(list, pnode)
Definition shared.h:182
#define fileinfo_list_iterate_end
Definition shared.h:184
struct widget * configure
Definition chatline.c:71
struct widget * pedit
Definition chatline.c:73
struct widget * select_nation_button
Definition chatline.c:69
struct widget * load_game_button
Definition chatline.c:70
struct widget * start_button
Definition chatline.c:68
int text_width
Definition chatline.c:74
struct advanced_dialog * chat_dlg
Definition chatline.c:65
struct advanced_dialog * users_dlg
Definition chatline.c:64
struct widget * end_widget_list
Definition chatline.c:67
int active
Definition chatline.c:75
struct widget * begin_widget_list
Definition chatline.c:66
struct widget * back_button
Definition chatline.c:72
struct widget * begin_active_widget_list
Definition widget.h:184
struct widget * end_widget_list
Definition widget.h:182
struct widget * end_active_widget_list
Definition widget.h:185
struct widget * active_widget_list
Definition widget.h:186
struct scroll_bar * scroll
Definition widget.h:187
struct widget * begin_widget_list
Definition widget.h:181
struct conn_list * est_connections
Definition game.h:97
struct packet_game_info info
Definition game.h:89
struct connection conn
Definition client_main.h:96
bool established
Definition connection.h:140
struct player * playing
Definition connection.h:151
enum cmdlevel access_level
Definition connection.h:177
SDL_Surface * surface
Definition graphics.h:229
struct widget * pscroll_bar
struct gui_layer * gui
Definition graphics.h:215
SDL_Event event
Definition graphics.h:217
Uint8 style
Definition gui_string.h:53
size_t n_alloc
Definition gui_string.h:56
char * text
Definition gui_string.h:60
void * ptr
Definition widget.h:133
SDL_Keycode key
Definition widget.h:153
SDL_Surface * theme
Definition widget.h:118
union widget::@223 data
struct widget * prev
Definition widget.h:114
struct gui_layer * dst
Definition widget.h:116
utf8_str * string_utf8
Definition widget.h:121
int(* action)(struct widget *)
Definition widget.h:157
SDL_Rect area
Definition widget.h:149
SDL_Surface * gfx
Definition widget.h:120
utf8_str * info_label
Definition widget.h:122
SDL_Rect size
Definition widget.h:145
int fc_snprintf(char *str, size_t n, const char *format,...)
Definition support.c:960
size_t fc_strlcpy(char *dest, const char *src, size_t n)
Definition support.c:777
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
void set_client_page(enum client_pages page)
enum client_pages get_client_page(void)