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)
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__CITYREPDATA_H
14 #define FC__CITYREPDATA_H
18 #endif /* __cplusplus */
20 #include "support.h" /* bool type */
24 /* Number of city report columns: have to set this manually now... */
25 #define NUM_CREPORT_COLS (num_city_report_spec())
27 struct city_report_spec
{
28 bool show
; /* modify this to customize */
29 int width
; /* 0 means variable; rightmost only */
30 int space
; /* number of leading spaces (see below) */
31 const char *title1
; /* already translated or NULL */
32 const char *title2
; /* already translated or NULL */
33 const char *explanation
; /* already translated */
35 const char *(*func
)(const struct city
* pcity
, const void *data
);
36 const char *tagname
; /* for save_options */
39 extern struct city_report_spec
*city_report_specs
;
41 /* Use tagname rather than index for load/save, because later
42 additions won't necessarily be at the end.
45 /* Note on space: you can do spacing and alignment in various ways;
46 you can avoid explicit space between columns if they are bracketted,
47 but the problem is that with a configurable report you don't know
48 what's going to be next to what.
50 Here specify width, and leading space, although different clients
51 may interpret these differently (gui-gtk and gui-mui ignore space
52 field, handling columns without additional spacing).
53 For some clients negative width means left justified (gui-gtk
54 always treats width as negative; gui-mui ignores width field).
57 /* Following are wanted to save/load options; use wrappers rather
58 than expose the grotty details of the city_report_spec:
59 (well, the details are exposed now too, but still keep
60 this "clean" interface...)
62 int num_city_report_spec(void);
63 bool *city_report_spec_show_ptr(int i
);
64 const char *city_report_spec_tagname(int i
);
66 void init_city_report_game_data(void);
68 int cityrepfield_compare(const char *field1
, const char *field2
);
72 #endif /* __cplusplus */
74 #endif /* FC__CITYREPDATA_H */