Freeciv-3.3: /fast/freeciv/nightly/main/client/plrdlg_common.h Source File

Freeciv-3.3

Loading...
Searching...
No Matches
plrdlg_common.h
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#ifndef FC__PLRDLG_COMMON_H
14#define FC__PLRDLG_COMMON_H
15
16#ifdef __cplusplus
17extern "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
49extern struct player_dlg_column player_dlg_columns[];
50extern const int num_player_dlg_columns;
51
52const char *plrdlg_col_state(const struct player *plr);
53
54void init_player_dlg_common(void);
55int player_dlg_default_sort_column(void);
56
57#ifdef __cplusplus
58}
59#endif /* __cplusplus */
60
61#endif /* FC__PLRDLG_COMMON_H */
incite_cost
char * incite_cost
Definition comments.c:74
fc_types.h
player.h
player_dlg_default_sort_column
int player_dlg_default_sort_column(void)
Definition plrdlg_common.c:606
init_player_dlg_common
void init_player_dlg_common(void)
Definition plrdlg_common.c:614
plrdlg_col_state
const char * plrdlg_col_state(const struct player *plr)
Definition plrdlg_common.c:230
plr_dlg_sort_func
int(* plr_dlg_sort_func)(const struct player *p1, const struct player *p2)
Definition plrdlg_common.h:36
player_dlg_columns
struct player_dlg_column player_dlg_columns[]
Definition plrdlg_common.c:574
player_dlg_column_type
player_dlg_column_type
Definition plrdlg_common.h:28
COL_TEXT
@ COL_TEXT
Definition plrdlg_common.h:32
COL_BOOLEAN
@ COL_BOOLEAN
Definition plrdlg_common.h:31
COL_FLAG
@ COL_FLAG
Definition plrdlg_common.h:29
COL_RIGHT_TEXT
@ COL_RIGHT_TEXT
Definition plrdlg_common.h:33
COL_COLOR
@ COL_COLOR
Definition plrdlg_common.h:30
num_player_dlg_columns
const int num_player_dlg_columns
Definition plrdlg_common.c:601
player_dlg_column
Definition plrdlg_common.h:39
player_dlg_column::bool_func
bool(* bool_func)(const struct player *)
Definition plrdlg_common.h:44
player_dlg_column::show
bool show
Definition plrdlg_common.h:40
player_dlg_column::tagname
const char * tagname
Definition plrdlg_common.h:46
player_dlg_column::sort_func
plr_dlg_sort_func sort_func
Definition plrdlg_common.h:45
player_dlg_column::title
const char * title
Definition plrdlg_common.h:42
player_dlg_column::type
enum player_dlg_column_type type
Definition plrdlg_common.h:41
player
Definition player.h:249
support.h
bool
#define bool
Definition support.h:71