19#ifdef SDL2_PLAIN_INCLUDE
159static int info_city_report_callback(
struct widget *pwidget)
180 SDL_Color bg_color = {255, 255, 255, 136};
183 struct widget *pwindow, *last;
317 pbuf->data.city = pcity;
318 if (count > 13 *
COL) {
331 if (count > 13 *
COL) {
342 if (count > 13 *
COL) {
359 if (count > 13 *
COL) {
373 if (count > 13 *
COL) {
401 if (count > 13 *
COL) {
415 if (count > 13 *
COL) {
428 if (count > 13 *
COL) {
442 if (count > 13 *
COL) {
456 if (count > 13 *
COL) {
470 if (count > 13 *
COL) {
485 if (count > 13 *
COL) {
498 if (count > 13 *
COL) {
513 if (count > 13 *
COL) {
527 if (count > 13 *
COL) {
535 if (
VUT_UTYPE == pcity->production.kind) {
536 const struct unit_type *punittype = pcity->production.value.utype;
539 direction8_invalid()),
545 const struct impr_type *pimprove = pcity->production.value.building;
559 name, pcity->shield_stock, togrow,
_(
"worklist"));
562 name, pcity->shield_stock, togrow,
563 pcity->shield_stock > togrow ?
_(
"\nfinished"):
"" );
575 togrow,
PL_(
"turn",
"turns", togrow));
582 if (count > 13 *
COL) {
596 if (count > 13 *
COL) {
600 prod_w =
MAX(prod_w, pbuf->
size.w);
622 if (count > 14 *
COL) {
640 (pwindow->
size.w - pwindow->
area.w) + area.w,
641 (pwindow->
size.h - pwindow->
area.h) + area.h);
645 logo = SDL_DisplayFormat(pwindow->
theme);
647 pwindow->
theme = logo;
651 area = pwindow->
area;
658 pbuf = pwindow->
prev;
659 pbuf->
size.x = area.x + area.w - pbuf->
size.w - 1;
693 dst.x , dst.y, dst.w, dst.h - 1,
696 dst.y += (text2->h - text3->h) / 2;
697 dst.x += ((name_w +
adj_size(6)) - text3->w) / 2;
709 dst.y = area.y + 1 + (text2->h - cma_icon->h) / 2;
727 dst.x, dst.y, dst.w, dst.h - 1,
764 dst.x , dst.y, dst.w, dst.h - 1,
803 dst.x , dst.y, dst.w, dst.h - 1,
816 dst.y = area.y + 1 + (hh - units_icon->h) / 2;
836 dst.x , dst.y, dst.w, dst.h - 1,
839 dst.y = area.y + 1 + (hh - text4->h) / 2;
840 dst.x += (dst.w - text4->w) / 2;
846 int start_y = area.y + hh +
adj_size(3);
854 pbuf->
size.x = start_x;
855 pbuf->
size.y = start_y + (h - pbuf->
size.h) / 2;
856 pbuf->
size.w = name_w;
861 pbuf->
size.y = start_y + (h - pbuf->
size.h) / 2;
865 pbuf->
size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(6);
866 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
870 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(6);
871 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
875 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
876 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
880 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
881 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
885 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(5);
886 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
890 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
891 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
895 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
896 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
900 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
901 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
905 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
906 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
910 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(6);
911 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
915 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
916 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
920 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
921 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
925 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
926 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
931 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(10);
932 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
936 pbuf->size.x = pbuf->next->size.x + pbuf->next->size.w +
adj_size(5);
937 pbuf->size.y = start_y + (h - pbuf->size.h) / 2;
938 pbuf->size.w = prod_w;
949 area.x + area.w, area.y,
987 pwidget = pwidget->
prev;
992 pwidget = pwidget->
prev;
998 pwidget = pwidget->
prev;
1004 pwidget = pwidget->
prev;
1009 pwidget = pwidget->
prev;
1031 pwidget = pwidget->
prev;
1036 pwidget = pwidget->
prev;
1041 pwidget = pwidget->
prev;
1046 pwidget = pwidget->
prev;
1051 pwidget = pwidget->
prev;
1056 pwidget = pwidget->
prev;
1062 pwidget = pwidget->
prev;
1067 pwidget = pwidget->
prev;
1073 pwidget = pwidget->
prev;
1098 fc_snprintf(cbuf,
sizeof(cbuf),
"%s\n(%d/%d)\n%s",
1105 pwidget = pwidget->
prev;
1108 pwidget->
theme = logo;
1111 pwidget = pwidget->
prev;
1113 if (togrow == 999) {
1117 togrow,
PL_(
"turn",
"turns", togrow));
1122 return pwidget->
prev;
1158 if (pcity->id ==
MAX_ID - pwidget->
id) {
1163 pwidget = pwidget->
prev;
1226 log_debug(
"hilite_cities_from_canvas : PORT ME");
1234 log_debug(
"toggle_city_hilite : PORT ME");
const char * city_name_get(const struct city *pcity)
int city_production_turns_to_build(const struct city *pcity, bool include_shield_stock)
bool city_unhappy(const struct city *pcity)
bool city_celebrating(const struct city *pcity)
bool city_happy(const struct city *pcity)
int city_turns_to_grow(const struct city *pcity)
#define city_list_iterate(citylist, pcity)
static citizens city_size_get(const struct city *pcity)
#define city_list_iterate_end
bool city_can_buy(const struct city *pcity)
void popup_city_dialog(struct city *pcity)
void city_report_dialog_update_city(struct city *pcity)
bool cma_is_city_under_agent(const struct city *pcity, struct cm_parameter *parameter)
void cma_release_city(struct city *pcity)
#define PL_(String1, String2, n)
struct city * game_city_by_number(int id)
void real_city_report_dialog_update(void *unused)
void real_city_report_update_city(struct city *pcity)
void toggle_city_hilite(struct city *pcity, bool on_off)
void hilite_cities_from_canvas(void)
void city_report_dialog_popdown(void)
void city_report_dialog_popup(bool raise)
void popup_hurry_production_dialog(struct city *pcity, SDL_Surface *pdest)
static int exit_city_report_callback(struct widget *pwidget)
static int popup_worklist_from_city_report_callback(struct widget *pwidget)
static int popup_citydlg_from_city_report_callback(struct widget *pwidget)
static int city_report_windows_callback(struct widget *pwindow)
static struct advanced_dialog * city_rep
static struct widget * real_city_report_dialog_update_city(struct widget *pwidget, struct city *pcity)
static int popup_cma_from_city_report_callback(struct widget *pwidget)
static int popup_buy_production_from_city_report_callback(struct widget *pwidget)
static void real_info_city_report_dialog_update(void)
bool is_city_report_open(void)
void popup_city_cma_dialog(struct city *pcity)
SDL_Color * get_theme_color(enum theme_color themecolor)
SDL_Color * get_game_color(enum color_std stdcolor)
SDL_Surface * resize_surface(const SDL_Surface *psrc, Uint16 new_width, Uint16 new_height, int smooth)
int main_window_width(void)
int fill_rect_alpha(SDL_Surface *surf, SDL_Rect *prect, SDL_Color *pcolor)
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
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)
SDL_Surface * resize_surface_box(const SDL_Surface *psrc, Uint16 new_width, Uint16 new_height, int smooth, bool scale_up, bool absolute_dimensions)
struct widget * selected_widget
#define PRESSED_EVENT(event)
void enable_and_redraw_find_city_button(void)
void popup_worklist_editor(struct city *pcity, struct global_worklist *gwl)
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
SDL_Surface * create_text_surf_from_utf8(utf8_str *pstr)
#define FREEUTF8STR(pstr)
#define create_utf8_from_char_fonto(string_in, fonto)
static SDL_Surface * get_building_surface(const struct impr_type *pimprove)
static SDL_Surface * get_unittype_surface(const struct unit_type *punittype, enum direction8 facing)
int impr_build_shield_cost(const struct city *pcity, const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define fc_assert(condition)
#define log_debug(message,...)
#define fc_calloc(n, esz)
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
SDL_Surface * big_food_corr
SDL_Surface * big_shield_corr
SDL_Surface * big_food_surplus
SDL_Surface * big_shield_surplus
SDL_Surface * big_trade_corr
struct universal production
struct city_list * cities
int fc_snprintf(char *str, size_t n, const char *format,...)
SDL_Surface * theme_get_background(const struct theme *t, enum theme_background background)
@ COLOR_THEME_CITYDLG_CELEB
@ COLOR_THEME_CITYREP_FRAME
@ COLOR_THEME_CITYDLG_LUX
@ COLOR_THEME_CITYDLG_TRADE
@ COLOR_THEME_CITYDLG_PROD
@ COLOR_THEME_CITYDLG_SUPPORT
@ COLOR_THEME_CITYREP_FOODSTOCK
@ COLOR_THEME_CITYREP_TEXT
@ COLOR_THEME_CITYDLG_HAPPY
@ COLOR_THEME_CITYDLG_SCIENCE
@ COLOR_THEME_CITYREP_TRADE
@ COLOR_THEME_CITYDLG_GOLD
@ COLOR_THEME_CITYREP_PROD
@ COLOR_THEME_CITYDLG_FOOD_SURPLUS
struct theme * active_theme
const struct unit_type * utype
const struct impr_type * building
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
bool worklist_is_empty(const struct worklist *pwl)