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 #ifndef FC__PLRDLG_COMMON_H 14 #define FC__PLRDLG_COMMON_H 15 16 #ifdef __cplusplus 17 extern "C" { 18 #endif /* __cplusplus */ 19 20 /* utility */ 21 #include "support.h" /* bool type */ 22 23 /* common */ 24 #include "fc_types.h" 25 #include "player.h" 26 27 28 enum player_dlg_column_type { 29 COL_FLAG, 30 COL_COLOR, 31 COL_BOOLEAN, 32 COL_TEXT, 33 COL_RIGHT_TEXT /* right aligned text */ 34 }; 35 36 typedef int (*plr_dlg_sort_func)(const struct player* p1, 37 const struct player* p2); 38 39 struct player_dlg_column { 40 bool show; 41 enum player_dlg_column_type type; 42 const char *title; /* already translated */ 43 const char *(*func)(const struct player *); /* if type = COL_*TEXT */ 44 bool (*bool_func)(const struct player *); /* if type = COL_BOOLEAN */ 45 plr_dlg_sort_func sort_func; 46 const char *tagname; /* for save_options */ 47 }; 48 49 extern struct player_dlg_column player_dlg_columns[]; 50 extern const int num_player_dlg_columns; 51 52 const char *plrdlg_col_state(const struct player *plr); 53 54 void init_player_dlg_common(void); 55 int player_dlg_default_sort_column(void); 56 57 const char *player_addr_hack(const struct player *pplayer); 58 59 #ifdef __cplusplus 60 } 61 #endif /* __cplusplus */ 62 63 #endif /* FC__PLRDLG_COMMON_H */ 64