DELTA 14209 77171 178
SVN  ¨&¨<  …| €b T†6Ÿ ƒF‡;Š 5+ aŒ@Š š{+/* utility */
#include "support.h"

/* common */
#include "game.h"
#include "unit.h"

/* client */lient_main.h"
#include "climiscclient.conclient.conENDREP
DELTA 15359 0 15903
SVN  ƒ¸ƒ·!"( †p €i Y‡>¿ î'ˆG ã`÷ °J‚Û> «_ƒŒ>/* utility */
#include "fcintl.h"
#include "log.h"
#include "shared.h"
#include "support.h"

/* common *//* client */
#include "chatline_common.h"
#include "client_mainENDREP
DELTA 14121 16777 1212
SVN  ‰.‰Jr …j €r G  ‚'‡/* common */
#include "game.h"

/* client */
#include "client_main.h"
#include "control.h"

#include "gotodlg.h"

ENDREP
DELTA 13286 36645 5054
SVN  ‚¤:‚£H5Š} ˆ' ¹ 6ˆ[¥ CŠ £i˜'“ 4¼ „|½\“ ÜQÂg€‚ Š1¡"¥ ‚)«e€# o¯ƒ ‰t°
¥ lã1 E»|ˆ V¼U„ ‡4¾.“ Åqª ‚Ç7¸ ‰[ÉY€R =Ôs€q T×/€\ ^Ør (Ùiª …oç& ‘2í"¬ ‚Tþk J‚H€e žp‚…J/* common & utility */
#include "city.h"
#include "fcintl/* client */
#include "client_main.h"client.conn.playingPREREQS_KNOWNclient.conn.playing)
{
  char buf[64000];
  struct impr_type *imp = find_improvement_by_translated_name(title);
  
  create_help_page(HELP_IMPROVEMENT);

  if (imp  &&  !is_great_wonder(imp)) {
    char req_buf[512];
    int i;

    sprintf(buf, "%d ", impr_build_shield_cost(impclient.conn.playing, pitem->text, imp)
{
  char buf[64000];
  struct impr_type *imp = find_improvement_by_translated_name(title);

  create_help_page(HELP_WONDER);

  if (imp  &&  is_great_wonder(imp)impclient.conn.playing, pitem->text, impbuf[6400typeclient.conn.playingU_NOT_OBSOLETED == punittype->obsoleted_bysizeof(buf), client.conn.playing, pitem->text, punittypeadvance(buf, sizeof(buf), client.conn.playing, pitem->text, i);

    improvement_iterate(pimprove) {
      /*if (i == j->tech_req) 
	sprintf(buf+strlen(buf), _("Allows %s.\n"),
		improvement_name_translation(j)pimprove->reqs, preq) {
	if (VUT_IMPROVEMENT == preq->source.kind
	    && preq->source.value.building == pimprovepimprove));
        }
      } requirement_vector_iterate_end;
      if (padvance == pimprovepimprove));
    } improvementclient.conn.playing, pitem->text, pterrainclient.conn.playing, pitem->text, pgovernmenhelp_update_improvement(pitem, top);
    break;
  case HELP_WONDER:
    help_update_wonder(pitem, topENDREP
DELTA 11187 713 753
SVN  Œ!Œa&6 ˆ( – wˆ(€T Ÿ‰IŠ ¨¨qŠ ƒ3Ñ¸ X¾  ¶RÕO/* common & utility *//* client */
#include "client_main.h"
#include "clinet.h"		/* connect_to_server() */client.conclient.conclient.conn, &reply);
    break;
  default:
    assert(0ENDREP
DELTA 15200 1987 4935
SVN  „ö*„ö,
 Š( Š „ëzŠ0lient_mainENDREP
DELTA 14427 120045 287
SVN  ØØ

 ‡ Š Ði‡lient_mainENDREP
DELTA 5500 8968 35752
SVN  †  †  ‰@…ˆ ‡< « ‡e€„: A„ß€} c¡€ƒv ©€‚0 ¬¥ Q°<€q Rƒ¾?¥ TÀ@€j E‚³@€0 W¾} TÀ@€‡ ‚4¾}€ŒG Y¬2 kÏiž YÀ@€v B‚³@€D _å ³ XÀ@€~ _å ² ZƒÅ@€K B‚³@€~ _å ± XÀ@€‚ _å ² XÀ@€‚ _å ² XÀ@€ƒ+ _å ³ XÀ@€‚ _å ² XÀ@€u _å ž XÀ@§ ‚÷;€¸6 ‚J¬2¤ TÀ@€Œv IÂ<² OÂ6² OÃ@€w S‚ú@€ TÀ@€b VÉ?€T YÐ+€‰0 Rƒ¾?§ SƒÅ<€‚ W¾} ß@€‚A å €‚W ‚ë6€‚A ‚ñv€‚K `å “ XÀ@€Œd _å ƒ TÀ@€y a‚„>€ a‚‘:» S‚ú@ ‚£6€‚A _¬2 O„¹@ƒ YÀ@€3 _å ‘ XÀ@€ y¬2³ °=œ YÀ@€| _å  XÀ@€ƒz _å š XÀ@€‚ _å š TÀ@€z W¾}¤ XÀ@€6 _å š MÀ@€„+ r‚À/€†R G‚Å>€†# H‚Ê}€“A O¬>€O K°=‚ P„¹?£ YÀ@€‚ [¬2€O K°=‚ P„¹?¯ XÀ@€x B‚³@€N _å ¬ XÀ@€‚{ B‚³@€„ _å ’ Yµ €œU J°= S‚±@ƒ MÀ@€Œ; W¾}ƒ TÀ@€‚D m„¤2« K°= $Ñ €‚9 S‚ú@¡ XÀ@€ƒ Z¬2 N‚±@ D„È5€ S‚ú@¢ XÀ@€‹ W…ë/€" _å ‘ YÀ?€„O y¬2 ƒ„ß>€ƒR \…ˆ{° TÀ@ª !„ç@€ S…®s€ƒ" S‚ú@³ TÀ@€L „ý<€ o„ò5€ S…®s€I I…ƒ|€‚N s„ú´ k„û@­ TÀ@ª {„ç@€ƒ& S…®s€G I…ƒ|€‚N s„ú´ k„û@© TÀ@ª <…ŠU€) P…®s€Ž: …œe€… }…¢[€‚% c…¥_€@ J…¨½ TÀ@€ƒW S…®s€~ T…°m€¦	 a…Éj€ }…ËS€G …Î€ƒ. }…Ò0€Ÿ a…Éj€~ =…Ø|€@ s…Î€	 …Ý€„G …â<€* S‚ú@’ TÀ@ S…åq€ƒ …ér¡ W…ë/£ l…ì=€| C‚Å>€, S…ñ}€B V…ó{€‚U I…ó{€ƒ C‚Å>€ƒ2 W…þ;€„ V†‚l€† v†‰ Œ  †Š« t†l€ˆ m†“T€Š] 3†l€( C‚Å>€‡E S†“n€‰@ s†m€ˆ a†‹w€‡p a†‹w€³ U†‹~€™eÅ‚ Bursig
    email                : RafaÅ‚"SDL.h"

/* utility */
#include "fcintl.h"
#include "log.h"

/* common */
#include "game.h"
#include "unitlist.h"

/* client */
#include "client_main.h"
#include "climisc.h"
#include "control.h"
#include "text.h"

/* gui-sdl */
#include "cityrep.h"
#include "cma_fe.h"
#include "colors.h"
#include "dialogs.h"
#include "graphics.h"
#include "gui_iconv.h"
#include "gui_id.h"
#include "gui_main.h"
#include "gui_tilespec.h"
#include "mapview.h"
#include "menu.h"
#include "sprite.h"
#include "themespec.h"
#include "widget.h"
#include "wldlg.h"

#include "citydlg.h"

/* #define SCALLED_TILE_WIDTH	48
#define SCALLED_TILE_HEIGHT	24

static struct city_dialog {
  struct city *pCity;

  enum {
   page;

  /* main window group list */
  struct widget *pBeginCityWidgetList;
  struct widget *pEndCityWidgetList;

  /* Imprvm. vscrollbar */
  struct ADVANCED_DLG *pImprv;
  
  /* Penel group list */
  struct ADVANCED_DLG *pPanel;
    
  /* Menu imprv. dlg. */
  struct widget *pBeginCityMenuWidgetList;
  struct widget *pEndCityMenuWidgetList;

  /* shortcuts */
  struct widget *pAdd_Point;
  struct widget *pBuy_Button;
  struct widget *pResource_Map;
  struct widget *pCity_Name_Edit;

  SDL_Rect   bool specs[3];
  
  bool lock;
} *pCityDlg = NULL;

enum specialist_type {
  SP_ELVIS, SP_SCIENTIST, SP_TAXMAN, SP_LAST   
};

static float city_map_zoom = 1;

static struct SMALL_DLG *pHurry_Prod_Dlg = NULL;

static void popdown_hurry_production_dialog(void);
static void disable_city_dlg_widgets(voidwidget *pWindow, struct city *pCity);struct impr_type *get_building_for_effect(enum effect_type effect_type) {
 
  improvement_iterate(pImprove) {
    if (building_has_effect(pImprove, effect_type))
      return pImprove;        
  } improvement_iterate_end;
  
  return NULL;  Destroy City Menu Dlg but not undraw.void popdown_city_menu_dlg(bool enable_city_dialog_widgets)
{
  if (pCityDlg->pEndCityMenuWidgetList) {
  	pCityDlg->pEndCityMenuWidgetList);
    pCityDlg->pEndCityMenuWidgetList = NULL;
  }
  if (enable_city_dialog_widgets) {
    /* enable city dlg */
    enable_city_dlg_widgets()Destroy City Dlgvoid del_city_dialog(void)
{
  if (pCityDlg) {

    if (pCityDlg->pImprv->pEndWidgetList) {
      del_group_of_widgets_from_gui_list(pCityDlg->pImprv->pBeginWidgetList,
					 pCityDlg->pImprv->pEndWidgetList);
    }
    FC_FREE(pCityDlg->pImprv->pScroll);
    FC_FREE(pCityDlg->pImprv);

    if (pCityDlg->pPanel) {
      del_group_of_widgets_from_gui_list(pCityDlg->pPanel->pBeginWidgetList,
					 pCityDlg->pPanel->pEndWidgetList);
      FC_FREE(pCityDlg->pPanel->pScroll);
      FC_FREE(pCityDlg->pPanel);
    }
        
    if (pHurry_Prod_Dlg)
    {
      del_group_of_widgets_from_gui_list(pHurry_Prod_Dlg->pBeginWidgetList,
			      		 pHurry_Prod_Dlg->pEndWidgetList);

      FC_FREE(pHurry_Prod_Dlg);
    }
    
    free_city_units_lists();
    popdown_city_menu_dlg(FALSE);
    
    popdown_window_group_dialog(pCityDlg->pBeginCityWidgetList,
				       pCityDlg->pEndCityWidgetList);
    FC_FREE(pCityDlg)widget *pWindow)
{  
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    if (!cma_is_city_under_agent(pCityDlg->pCity, NULL)
       && city_owner(pCityDlg->pCity) == client.conn.playing) {
         
      /* check elvis area */
      if (pCityDlg->specs[0]
         && is_in_rect_area(Main.event.motion.x, Main.event.motion.y,
                                          pCityDlg->specs_area[0])) {
        city_change_specialist(pCityDlg->pCity, SP_ELVIS, SP_TAXMAN);
        return -1;
      }
  
      /* check TAXMANs area */
      if (pCityDlg->specs[1]
         && is_in_rect_area(Main.event.motion.x, Main.event.motion.y,
                                          pCityDlg->specs_area[1])) {
        city_change_specialist(pCityDlg->pCity, SP_TAXMAN, SP_SCIENTIST);
        return -1;
      }
  
      /* check SCIENTISTs area */
      if (pCityDlg->specs[2]
         && is_in_rect_area(Main.event.motion.x, Main.event.motion.y,
                                          pCityDlg->specs_area[2])) {
        city_change_specialist(pCityDlg->pCity, SP_SCIENTIST, SP_ELVIS);
        return -1;
      }
      
    }
    
    if (!pCityDlg->lock) {
      if (pCityDlg->pPanel) {      
        sellect_window_group_dialog(pCityDlg->pBeginCityWidgetList, pWindow);
        sellect_window_group_dialog(pCityDlg->pPanel->pBeginWidgetList,
                                    pCityDlg->pPanel->pEndWidgetList);
        widget_flush(pWindow);
      } else {
        if (sellect_window_group_dialog(pCityDlg->pBeginCityWidgetList, pWindow)) {
          widget_flush(pWindow);
        }
      }
    }      
  }Popdown unit city orders menu.ancel_units_orders_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
                                  pCityDlg->pEndCityMenuWidgetList);
    pCityDlg->pEndCityMenuWidgetList = NULL;
    
    /* enable city dlg */
    enable_city_dlg_widgets();
    flush_dirty();
  }activate unit and del unit order dlg. widget group.activate_units_orders_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct unit *pUnit = pButton->data.unit;
  
    popdown_city_menu_dlg(TRUE);
    if(pUnit) {
      set_unit_focus(pUnit);
    }
  }activate unit and popdow city dlg. + center on uniactivate_and_exit_units_orders_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct unit *pUnit = pButton->data.unit;
  
    if(pUnit) {
      
                                      pCityDlg->pEndCityMenuWidgetList);
      pCityDlg->pEndCityMenuWidgetList = NULL;
      
      popdown_city_dialog(pCityDlg->pCity);
      
      center_tile_mapcanvas(pUnit->tile);
      set_unit_focus(pUnit);
    }
  }sentry unit and del unit order dlg. widget group.sentry_units_orders_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct unit *pUnit = pButton->data.unit;
  
    popdown_city_menu_dlg(TRUE);
    if(pUnit) {
      request_unit_sentry(pUnit);
    }
  }fortify unit and del unit order dlg. widget group.fortify_units_orders_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct unit *pUnit = pButton->data.unit;
  
    popdown_city_menu_dlg(TRUE);
    if(pUnit) {
      request_unit_fortify(pUnit);
    }
  }disband unit and del unit order dlg. widget group.disband_units_orders_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct unit *pUnit = pButton->data.unit;
  
    free_city_units_lists();
    popdown_city_menu_dlg(TRUE);
  
    /* ugly hack becouse this free unit widget list*/
    /* FIX ME: add remove from list support */
    pCityDlg->page = INFO_PAGE;
  
    if(pUnit) {
      request_unit_disband(pUnit);
    }
  }homecity unit and del unit order dlg. widget group.homecity_units_orders_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct unit *pUnit = pButton->data.unit;
  
    popdown_city_menu_dlg(TRUE);
    if(pUnit) {
      request_unit_change_homecity(pUnit);
    }
  }upgrade unit and del unit order dlg. widget group.upgrade_units_orders_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct unit *pUnit = pButton->data.unit;

    popdown_city_menu_dlg(TRUE);    
    popup_unit_upgrade_dlg(pUnit, TRUE);
  }Main unit order dlg. callback.units_orders_dlg_callback(struct widgetwidget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    SDL_String16 *pStr;
    char cBuf[80];
    struct widget *pBuf, *pWindow = pCityDlg->pEndCityWidgetList;
    struct unit *pUnit;
    struct unit_type *pUType;
    Uint16 i = 0, hh = 0;
    SDL_Rect area;
  
    pUnit = player_find_unit_by_id(client.conn.playing, MAX_ID - pButton->ID);
    
    if(!pUnit || !can_client_issue_orders()) {
      return -1;
    }
    
    if(Main.event.button.button == SDL_BUTTON_RIGHT) {
      popdown_city_dialog(pCityDlg->pCity);
      center_tile_mapcanvas(pUnit->tile);
      set_unit_focus(pUnit);
      return -1;
    }
      
    /* Disable city dlg */
    unsellect_widget_action();
    disable_city_dlg_widgets();
  
    pUType = unit_type(pUnit);
  
    /* window */
    my_snprintf(cBuf, sizeof(cBuf), "%s:", _("Unit commands"));
    pStr = create_str16_from_char(cBuf, adj_font(12));
    pStr->style |= TTF_STYLE_BOLD;
    pWindow = create_window_skeleton(NULL, pStr, 0);
    
    pWindow->action = units_orders_dlg_callback;
    set_wstate(pWindow, FC_WS_NORMAL);
    add_to_gui_list(ID_REVOLUTION_DLG_WINDOW, pWindow);
    pCityDlg->pEndCityMenuWidgetList = pWindow;

    area = pWindow->area;
    
    /* unit description */
    my_snprintf(cBuf, sizeof(cBuf), "%s", unit_description(pUnit));
    pStr = create_str16_from_char(cBuf, adj_font(12));
    pStr->style |= (TTF_STYLE_BOLD|SF_CENTER);
    pBuf = create_iconlabel(adj_surf(get_unittype_surface(pUType)),
                            pWindow->dst, pStr, WF_FREE_THEME);
    area.w = MAX(area.w, pBuf->size.w);
    add_to_gui_list(ID_LABEL, pBuf);
    
    /* Activate unit */
    pBuf =
        create_icon_button_from_chars(NULL, pWindow->dst,
                                                _("Activate unit"), adj_font(12), 0);
    i++;
    area.w = MAX(area.w, pBuf->size.w);
    hh = MAX(hh, pBuf->size.h);
    pBuf->action = activate_units_orders_city_dlg_callback;
    pBuf->data = pButton->data;
    set_wstate(pBuf, FC_WS_NORMAL);
    add_to_gui_list(pButton->ID, pBuf);
    
    /* Activate unit, close dlg. */
    pBuf = create_icon_button_from_chars(NULL, pWindow->dst,
                    _("Activate unit, close dialog"),  adj_font(12), 0);
    i++;
    area.w = MAX(area.w, pBuf->size.w);
    hh = MAX(hh, pBuf->size.h);
    pBuf->action = activate_and_exit_units_orders_city_dlg_callback;
    pBuf->data = pButton->data;
    set_wstate(pBuf, FC_WS_NORMAL);
    add_to_gui_list(pButton->ID, pBuf);
    /* ----- */
    
    if (pCityDlg->page == ARMY_PAGE) {
      /* Sentry unit */
      pBuf = create_icon_button_from_chars(NULL, pWindow->dst,
                                          _("Sentry unit"), adj_font(12), 0);
      i++;
      area.w = MAX(area.w, pBuf->size.w);
      hh = MAX(hh, pBuf->size.h);
      pBuf->data = pButton->data;
      pBuf->action = sentry_units_orders_city_dlg_callback;
      if (pUnit->activity != ACTIVITY_SENTRY
          && can_unit_do_activity(pUnit, ACTIVITY_SENTRY)) {
        set_wstate(pBuf, FC_WS_NORMAL);
      }
      add_to_gui_list(pButton->ID, pBuf);
      /* ----- */
      
      /* Fortify unit */
      pBuf = create_icon_button_from_chars(NULL, pWindow->dst,
                                              _("Fortify unit"), adj_font(12), 0);
      i++;
      area.w = MAX(area.w, pBuf->size.w);
      hh = MAX(hh, pBuf->size.h);
      pBuf->data = pButton->data;
      pBuf->action = fortify_units_orders_city_dlg_callback;
      if (pUnit->activity != ACTIVITY_FORTIFYING
          && can_unit_do_activity(pUnit, ACTIVITY_FORTIFYING)) {
        set_wstate(pBuf, FC_WS_NORMAL);
      }
      add_to_gui_list(pButton->ID, pBuf);
    }
    /* ----- */
    
    /* Disband unit */
    pBuf = create_icon_button_from_chars(NULL, pWindow->dst,
                                    _("Disband unit"), adj_font(12), 0);
    i++;
    area.w = MAX(area.w, pBuf->size.w);
    hh = MAX(hh, pBuf->size.h);
    pBuf->data = pButton->data;
    pBuf->action = disband_units_orders_city_dlg_callback;
    set_wstate(pBuf, FC_WS_NORMAL);
    add_to_gui_list(pButton->ID, pBuf);
    /* ----- */
  
    if (pCityDlg->page == ARMY_PAGE) {
      if (pUnit->homecity != pCityDlg->pCity->id) {
        /* Make new Homecity */
        pBuf = create_icon_button_from_chars(NULL, pWindow->dst, 
                                          _("Make new homecity"), adj_font(12), 0);
        i++;
        area.w = MAX(area.w, pBuf->size.w);
        hh = MAX(hh, pBuf->size.h);
        pBuf->data = pButton->data;
        pBuf->action = homecity_units_orders_city_dlg_callback;
        set_wstate(pBuf, FC_WS_NORMAL);
        add_to_gui_list(pButton->ID, pBuf);
      }
      /* ----- */
      
      if (can_upgrade_unittype(client.conn.playing, pUType)) {
        /* Upgrade unit */
        pBuf = create_icon_button_from_chars(NULL, pWindow->dst,
                                              _("Upgrade unit"), adj_font(12), 0);
        i++;
        area.w = MAX(area.w, pBuf->size.w);
        hh = MAX(hh, pBuf->size.h);
        pBuf->data = pButton->data;
        pBuf->action = upgrade_units_orders_city_dlg_callback;
        set_wstate(pBuf, FC_WS_NORMAL);
        add_to_gui_list(pButton->ID, pBuf);
      }
    }
  
    /* ----- */
    /* Cancel */
    pBuf = create_icon_button_from_chars(NULL, pWindow->dst,
                                                  _("Cancel"), adj_font(12), 0);
    i++;
    area.w = MAX(area.w, pBuf->size.w);
    hh = MAX(hh, pBuf->size.h);
    pBuf->key = SDLK_ESCAPE;
    pBuf->action = cancel_units_orders_city_dlg_callback;
    set_wstate(pBuf, FC_WS_NORMAL);
    add_to_gui_list(pButton->ID, pBuf);
    pCityDlg->pBeginCityMenuWidgetList = pBuf;
  
    /* ================================================== */
    unsellect_widget_action();
    /* ================================================== */
  
    area.w += adj_size(10);
    hh += adj_size(4);
  
    /* create window background */
    resize_window(pWindow, NULL, get_game_colorRGB(COLOR_THEME_BACKGROUND),
                  (pWindow->size.w - pWindow->area.w) + area.w,
                  (pWindow->size.h - pWindow->area.h) + pWindow->prev->size.h +
                  (i * hh) + adj_size(5)); 
    
    area = pWindow->area;

    widget_set_position(pWindow,
                        pButton->size.x + adj_size(2),
                        pWindow->area.y + pButton->size.y + 1);

    /* label */
    pBuf = pWindow->prev;
    pBuf->size.w = area.w;
    pBuf->size.x = area.x;
    pBuf->size.y = area.y + 1;
    pBuf = pBuf->prev;
  
    /* first button */
    pBuf->size.w = area.w;
    pBuf->size.h = hh;
    pBuf->size.x = area.x;
    pBuf->size.y = pBuf->next->size.y + pBuf->next->size.h + adj_size(5);
    pBuf = pBuf->prev;
  
    while (pBuf) {
      pBuf->size.w = area.w;
      pBuf->size.h = hh;
      pBuf->size.x = pBuf->next->size.x;
      pBuf->size.y = pBuf->next->size.y + pBuf->next->size.h;
      if (pBuf == pCityDlg->pBeginCityMenuWidgetList) {
        break;
      }
      pBuf = pBuf->prev;
    }
  
    /* ================================================== */
    /* redraw */
    redraw_group(pCityDlg->pBeginCityMenuWidgetList, pWindow, 0);
    widget_flush(pWindow);
  }create unit icon with support icons.SDL_Surface *create_unit_surface(struct unit *pUnit, bool support, int w, int h)
{
  int i, step;
  SDL_Rect src_rect, dest;
  SDL_Surface *pSurf, *pZoomed;
  
  int upkeep_cost[O_COUNT];
  int free_upkeep[O_COUNT];
  int free_unhappy;
  int happy_cost;

  struct canvas *destcanvas = canvas_create_with_alpha(
                                tileset_full_tile_width(tileset),
                                tileset_full_tile_height(tileset));  
  
  put_unit(pUnit, destcanvas, 0, 0);
  
  src_rect = get_smaller_surface_rect(destcanvas->surf);
  pSurf = create_surf_alpha(src_rect.w, src_rect.h, SDL_SWSURFACE);
  alphablit(destcanvas->surf, &src_rect, pSurf, NULL);

  canvas_free(destcanvas);

  pZoomed = ResizeSurfaceBox(pSurf, w, h, 1, TRUE, TRUE);
  FREESURFACE(pSurf);
  pSurf = pZoomed;
  
  if (support) {
    
    free_unhappy = get_city_bonus(pCityDlg->pCity, EFT_MAKE_CONTENT_MIL);
    happy_cost = city_unit_unhappiness(pUnit, &free_unhappy);
    
    output_type_iterate(o) {
      free_upkeep[o] = get_city_output_bonus(pCityDlg->pCity, get_output_type(o),
                                             EFT_UNIT_UPKEEP_FREE_PER_CITY);
    } output_type_iterate_end;
    
    city_unit_upkeep(pUnit, upkeep_cost, free_upkeep);

    i = upkeep_cost[O_SHIELD] + upkeep_cost[O_FOOD] +
	upkeep_cost[O_GOLD] + happy_cost;

    if (i * pIcons->pFood->w > pSurf->w / 2) {
      step = (pSurf->w / 2 - pIcons->pFood->w) / (i - 1);
    } else {
      step = pIcons->pFood->w;
    }

    dest.y = pSurf->h - pIcons->pFood->h - adj_size(2);
    dest.x = pSurf->w / 8;

    for (i = 0; i < upkeep_cost[O_SHIELD]; i++) {
      alphablit(pIcons->pShielupkeep_cost[O_FOOD]; i++) {
      alphablit(pIconsupkeep_cost[O_GOLD]; i++) {
      alphablit(pIconshappy_cost; i++) {
      alphablit(pIcons->pFace, NULL, pSurf, &dest);
      dest.x += step;
    }

  }

  return pSurfcreate present/supported units widget list
  207 pixels is panel width in city dlg.
  220 - max y position pixel position belong to panel area.void create_present_supported_units_widget_list(struct unit_list *pList)
{
  int i;
  struct widget *pBuf = NULL;
  struct widget *pEnd = NULL;
  struct widget *pWindow = pCityDlg->pEndCityWidgetList;
  struct city *pHome_City256];
  int num_x, num_y, w, h;
  
  i = 0;

  num_x = (adj_size(160) / (tileset_full_tile_width(tileset) + adj_size(4)));
  if (num_x < 4) {
    num_x = 4;
    w = adj_size(160 - 4*4) / 4;
  } else {
    w = tileset_full_tile_width(tileset) + (adj_size(160) % (tileset_full_tile_width(tileset)+4)) / num_x;
  }

  num_y = (adj_size(151) / (tileset_full_tile_height(tileset)+4));
  if (num_y < 4) {
    num_y = 4;
    h = adj_size(151 - 4*4) / 4;
  } else {
    h = tileset_full_tile_height(tileset) + (adj_size(151) % (tileset_full_tile_height(tileset)+4)) / num_y;
  }

  unit_list_iterate(pList, pUnit) {
        
    pUType = unit_type(pUnit);
    pHome_City = game_find_city_by_number(pUnit->homecity);
    my_snprintf(cBuf, sizeof(cBuf), "%s (%d,%d,%d)%s\n%s\n(%d/%d)\n%s",
		utype_name_translation(pUType),
		pUType->attack_strength,
		pUType->defense_strength, pUType->move_rate / SINGLE_MOVE,
                (pUnit->veteran ? _("\nveteran") : ""),
                unit_activity_text(pUnit),
		pUnit->hp, pUType->hp,
		pHome_City ? pHome_City->name : _("None"));
    
    if (pCityDlg->page == SUPPORTED_UNITS_PAGE) {
      int pCity_near_dist;
      struct city *pNear_City = get_nearest_city(pUnit, &pCity_near_dist);

      sz_strlcat(cBuf, "\n");
      sz_strlcat(cBuf, get_nearest_city_text(pNear_City, pCity_near_dist));
      pSurf = adj_surf(create_unit_surface(pUnit, 1, w, h));
    } else {
      pSurf = adj_surf(create_unit_surface(pUnit, 0, w, h));
    }
        
    pStr = create_str16_from_char(cBuf, adj_font(10));
    pStr->style |= SF_CENTER;
    
    pBuf = create_icon2(pSurf, pWindow->dst,
	(WF_FREE_THEME | WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL));
	
    pBuf->string16 = pStr;
    pBuf->data.unit = pUnit;}
    
    if (++i > num_x * num_y) {
      set_wflag(pBuf, WF_HIDDEN);
    }
  
    if (city_owner(pCityDlg->pCity) == client.conn.playing) {
      set_wstate(pBuf, FC_WS_NORMAL);
    }
    
    pBuf->action = units_orders_city_dlg_callback;

  } unit_list_iterate_end;
  
  pCityDlg->pPanel = fc_calloc(1, sizeof(struct ADVANCED_DLG));
  pCityDlg->pPanel->pEndWidgetList = pEnd;
  pCityDlg->pPanel->pBeginWidgetList = pBuf;  
  pCityDlg->pPanel->pEndActiveWidgetList = pCityDlg->pPanel->pEndWidgetList;
  pCityDlg->pPanel->pBeginActiveWidgetList = pCityDlg->pPanel->pBeginWidgetList;
  pCityDlg->pPanel->pActiveWidgetList = pCityDlg->pPanel->pEndActiveWidgetList;
  
  setup_vertical_widgets_position(num_x,
	pWindow->area.x + adj_size(5),
	pWindow->area.y + adj_size(44),
	  0, 0, pCityDlg->pPanel->pBeginActiveWidgetList,
			  pCityDlg->pPanel->pEndActiveWidgetList);
  
  if (i > num_x * num_y) {
    
    create_vertical_scrollbar(pCityDlg->pPanel,
	                      num_x, num_y, TRUE, TRUE);
    
    setup_vertical_scrollbar_area(pCityDlg->pPanel->pScroll,
		pWindow->area.x + adj_size(185),
                pWindow->area.y + adj_size(45),
                adj_size(150), TRUE);
  }
    free city present/supported units panelvoid free_city_units_lists(void)
{
  if (pCityDlg && pCityDlg->pPanel) {
    del_group_of_widgets_from_gui_list(pCityDlg->pPanel->pBeginWidgetList,
					 pCityDlg->pPanel->pEndWidgetList);
    FC_FREE(pCityDlg->pPanel->pScroll);
    FC_FREE(pCityDlg->pPanel)widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    if (pCityDlg->page != ARMY_PAGE) {
      free_city_units_lists();
      pCityDlg->page = ARMY_PAGE;
      redraw_city_dialog(pCityDlg->pCity);
      flush_dirty();
    } else {
      widget_redraw(pButton);
      widget_flush(pButton);
    }
  }widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    if (pCityDlg->page != SUPPORTED_UNITS_PAGE) {
      free_city_units_lists();
      pCityDlg->page = SUPPORTED_UNITS_PAGE;
      redraw_city_dialog(pCityDlg->pCity);
      flush_dirty();
    } else {
      widget_redraw(pButton);
      widget_flush(pButton);
    }
  }widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    if (pCityDlg->page != INFO_PAGE) {
      free_city_units_lists();
      pCityDlg->page = INFO_PAGE;
      redraw_city_dialog(pCityDlg->pCity);
      flush_dirty();
    } else {
      widget_redraw(pButton);
      widget_flush(pButton);
    }
  }widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    if (pCityDlg->page != HAPPINESS_PAGE) {
      free_city_units_lists();
      pCityDlg->page = HAPPINESS_PAGE;
      redraw_city_dialog(pCityDlg->pCity);
      flush_dirty();
    } else {
      widget_redraw(pButton);
      widget_flush(pButton);
    }
  }ity option callbackmisc_panel_city_dlg_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
/*  int new = pCityDlg->pCity->city_options & 0xff; */
    bv_city_options new_options = pCityDlg->pCity->city_options;
  
    switch (MAX_ID - pWidget->ID) {
    case 0x10:
      if (BV_ISSET(new_options, CITYO_DISBAND))
        BV_CLR(new_options, CITYO_DISBAND);
      else
        BV_SET(new_options, CITYO_DISBAND);
      break;
    case 0x20:
      if (BV_ISSET(new_options, CITYO_NEW_EINSTEIN))
        BV_CLR(new_options, CITYO_NEW_EINSTEIN);
      else
        BV_SET(new_options, CITYO_NEW_EINSTEIN);
   
      if (BV_ISSET(new_options, CITYO_NEW_TAXMAN))
        BV_CLR(new_options, CITYO_NEW_TAXMAN);
      else
        BV_SET(new_options, CITYO_NEW_TAXMAN);
    
      pWidget->theme2 = get_tax_surface(O_GOLD);
      pWidget->ID = MAX_ID - 0x40;
      widget_redraw(pWidget);
      widget_flush(pWidget);
      break;
    case 0x40:
      BV_CLR(new_options, CITYO_NEW_EINSTEIN);
      BV_CLR(new_options, CITYO_NEW_TAXMAN);
      pWidget->theme2 = get_tax_surface(O_LUXURY);
      pWidget->ID = MAX_ID - 0x60;
      widget_redraw(pWidget);
      widget_flush(pWidget);
      break;
    case 0x60:
      if (BV_ISSET(new_options, CITYO_NEW_EINSTEIN))
        BV_CLR(new_options, CITYO_NEW_EINSTEIN);
      else
        BV_SET(new_options, CITYO_NEW_EINSTEIN);
      pWidget->theme2 = get_tax_surface(O_SCIENCE);
      pWidget->ID = MAX_ID - 0x20;
      widget_redraw(pWidget);
      widget_flush(pWidget);
      break;
    }
  
    dsend_packet_city_options_req(&client.conn, pCityDlg->pCity->id, new_options);
  }...void create_city_options_widget_list(struct city *pCity)
{
  struct widget *pBuf, *pWindow = pCityDlg->pEndCityWidgetList
	      _("Disband if build\nsettler at size 1"));
  pStr = create_str16_from_char(cBuf, adj_font(10));
  pStr->style |= TTF_STYLE_BOLD;
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CHECKBOX_LABEL_TEXT);
  
  pBuf =
      create_textcheckbox(pWindow->dst, BV_ISSET(pCity->city_options, CITYO_DISBAND), pStr,
			  WF_RESTORE_BACKGROUND);
  set_wstate(pBuf, FC_WS_NORMAL);
  pBuf->action = misc_panel_city_dlg_callback;
  add_to_gui_list(MAX_ID - 0x10, pBuf);
  pBuf->size.x = pWindow->area.x + adj_size(7);
  pBuf->size.y = pWindow->area.y + adj_size(45);

  /* ----- */
  
  pCityDlg->pPanel = fc_calloc(1, sizeof(struct ADVANCED_DLG));
  pCityDlg->pPanel->pEndWidgetList = pBuf;

  /* ----- */
  
  my_snprintf(cBuf, sizeof(cBuf), "%s:", _("New citizens are"));
  pStr = create_str16_from_char(cBuf, adj_font(11));
  pStr->style |= SF_CENTER;

  if (BV_ISSET(pCity->city_options, CITYO_NEW_EINSTEIN)) {
    pSurf = get_tax_surface(O_SCIENCE);
    pBuf = create_icon_button(pSurf, pWindow->dst, pStr, WF_ICON_CENTER_RIGHT | WF_FREE_THEME2);
    add_to_gui_list(MAX_ID - 0x20, pBuf);
  } else {
    if (BV_ISSET(pCity->city_options, CITYO_NEW_TAXMAN)) {
      pSurf = get_tax_surface(O_GOLD);
      pBuf = create_icon_button(pSurf, pWindow->dst,
				      pStr, WF_ICON_CENTER_RIGHT | WF_FREE_THEME2);
      add_to_gui_list(MAX_ID - 0x40, pBuf);
    } else {
      pSurf = get_tax_surface(O_LUXURY);
      pBuf = create_icon_button(pSurf, pWindow->dst,
				pStr, WF_ICON_CENTER_RIGHT | WF_FREE_THEME2);
      add_to_gui_list(MAX_ID - 0x60, pBuf);
    }
  }

  pBuf->size.w = adj_size(177);
  pBuf->action = misc_panel_city_dlg_callback;
  set_wstate(pBuf, FC_WS_NORMAL + adj_size(5);
  pCityDlg->pPanel->pBeginWidgetList = pBufwidget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    if (pCityDlg->page != MISC_PAGE) {
      free_city_units_lists();
      pCityDlg->page = MISC_PAGE;
      redraw_city_dialog(pCityDlg->pCity);
      flush_dirty();
    } else {
      widget_redraw(pButton);
      widget_flush(pButton);
    }
  }...ma_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    disable_city_dlg_widgets();
    popup_city_cma_dialog(pCityDlg->pCity);
  }Exit city dialog.exit_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    popdown_city_dialog(pCityDlg->pCity);
  }= Buy Production Dlg. ========================== */popdown buy productions dlg.ancel_buy_prod_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    popdown_hurry_production_dialog();
    
    if (pCityDlg)
    {
      /* enable city dlg */
      enable_city_dlg_widgets();
    }
  }  buy productions.ok_buy_prod_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    popdown_hurry_production_dialog();

    city_buy_production(pButton->data.city);
    
    if (pCityDlg) {
      /* enable city dlg */
      enable_city_dlg_widgets();
      
      /* disable buy button */
      set_wstate(pCityDlg->pBuy_Button, FC_WS_DISABLED);
      widget_redraw(pCityDlg->pBuy_Button);
      widget_mark_dirty(pCityDlg->pBuy_Button);
      flush_dirty();
    }
    
  }    popup buy productions dlg.buy_prod_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    widget_redraw(pButton);
    widget_flush(pButton);
    disable_city_dlg_widgets();
    popup_hurry_production_dialog(pCityDlg->pCity, pButton->dst->surface);
  }popup buy productions dlg.void popdown_hurry_production_dialog(void)
{
  if (pHurry_Prod_Dlg) {
    popdown_window_group_dialog(pHurry_Prod_Dlg->pBeginWidgetList,
                                pHurry_Prod_Dlg->pEndWidgetList);
    FC_FREE(pHurry_Prod_Dlg);
    flush_dirty()main hurry productions dlg. callbackhurry_production_window_callback(struct widget *pWindow)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    move_window_group(pHurry_Prod_Dlg->pBeginWidgetList, pWindow);
  }popup buy productions dlg.void popup_hurry_production_dialog(struct city *pCity, SDL_Surface *pDest)
{

  char cBuf[512];
  struct widget *pBuf = NULL, *pWindow;
  SDL_String16 *pStr;
  SDL_Surface *pText;
  SDL_Rect dst;
  int window_x = 0, window_y = 0;
  SDL_Rect area;
  const char *name = city_production_name_translation(pCity);
  int value = city_production_buy_gold_cost(pCity);

  if (pHurry_Prod_Dlg) {
    return;
  }
  
  pHurry_Prod_Dlg = fc_calloc(1, sizeof(struct SMALL_DLG));
  
  if (city_can_buy(pCity)) {
    if (value <= client.conn.playing->economic.gold) {
  client.conn.playing->economic.gold);
    } else {
      my_snprintf(cBuf, sizeof(cBuf),
		_("%s costs %d gold.\n"
		  "Treasury contains %d gold."),
		name, value, client.conn.playing->economic.gold);
    }
  } else {
    if (pCity->did_buy) {
      my_snprintf(cBuf, sizeof(cBuf),
                  _("Sorry, you have already bought here in this turn."));
    } else {
      my_snprintf(cBuf, sizeof(cBuf),
                  _("Sorry, you can't buy here in this turn."));
    }
  }

  pStr = create_str16_from_char(_("Buy it?"), adj_font(12));
  pStr->style |= TTF_STYLE_BOLD;
  pWindow = create_window_skeleton(NULL, pStr, 0);
  pWindow->action = hurry_production_window_callback;
  set_wstate(pWindow, FC_WS_NORMAL);
  add_to_gui_list(ID_WINDOW, pWindow);

  pHurry_Prod_Dlg->pEndWidgetList = pWindow;

  area = pWindow->area;
  
  area.h += 1;
    
  /* label */
  pStr = create_str16_from_char(cBuf, adj_font(10));
  pStr->style |= (TTF_STYLE_BOLD|SF_CENTER);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_BUY);
  
  pText = create_text_surf_from_str16(pStr);
  FREESTRING16(pStr);
  area.w = MAX(area.w , pText->w);
  area.h += pText->h + adj_size(5);

  pBuf = create_themeicon_button_from_chars(pTheme->CANCEL_Icon,
			    pWindow->dst, _("No"), adj_font(12), 0);

  pBuf->action = cancel_buy_prod_city_dlg_callback;
  set_wstate(pBuf, FC_WS_NORMAL);
  pBuf->key = SDLK_ESCAPE;
  area.h += pBuf->size.h;

  add_to_gui_list(ID_BUTTON, pBuf);

  if (city_can_buy(pCity) && (value <= client.conn.playing->economic.gold)) {
    pBuf = create_themeicon_button_from_chars(pTheme->OK_Icon, pWindow->dst,
					      _("Yes"), adj_font(12), 0);
FC_WS_NORMAL);
    pBuf->data.city = pCity;
    pBuf->key = SDLK_RETURN;
    add_to_gui_list(ID_BUTTON, pBuf);
    pBuf->size.w = MAX(pBuf->next->size.w, pBuf->size.w);
    pBuf->next->size.w = pBuf->size.w;
    area.w = MAX(area.w , 2 * pBuf->size.w + adj_size(20));
  }
  
  pHurry_Prod_Dlg->pBeginWidgetList = pBuf;
  
  /* setup window size and start position */
  area.w += adj_size(10);
  area.h += adj_size(5);

  resize_window(pWindow, NULL, get_game_colorRGB(COLOR_THEME_BACKGROUND),
                (pWindow->size.w - pWindow->area.w) + area.w,
                (pWindow->size.h - pWindow->area.h) + area.h);
  
  area = pWindow->area;
  
  pBuf = pWindow->prev;
  
  if (city_dialog_is_open(pCity))
  {
    window_x = pCityDlg->pBuy_Button->size.x;
    window_y = pCityDlg->pBuy_Button->size.y - pWindow->size.h;
  } else {
    if(is_city_report_open()) {
      assert(pSellected_Widget != NULL);
      if (pSellected_Widget->size.x + tileset_tile_width(tileset) + pWindow->size.w > Main.screen->w)
      {
        window_x = pSellected_Widget->size.x - pWindow->size.w;
      } else {
        window_x = pSellected_Widget->size.x + tileset_tile_width(tileset);
      }
    
      window_y = pSellected_Widget->size.y + (pSellected_Widget->size.h - pWindow->size.h) / 2;
      if (window_y + pWindow->size.h > Main.screen->h)
      {
	window_y = Main.screen->h - pWindow->size.h - 1;
      } else {
        if (window_y < 0) {
	  window_y = 0;
	}
      }
    } else {
      put_window_near_map_tile(pWindow, pWindow->size.w, pWindow->size.h, pCity->tile);
    }
    
  }

  widget_set_position(pWindow, window_x, window_y);
  
  /* setup rest of widgets */
  /* label */
  dst.x = area.x + (area.w - pText->w) / 2;
  dst.y = area.y + 1;
  alphablit(pText, NULL, pWindow->theme, &dst);
  dst.y += pText->h + adj_size(5);
  FREESURFACE(pText);
  
  /* no */
  pBuf = pWindow->prev;
  pBuf->size.y = dst.y;
  
  if (city_can_buy(pCity) && value <= client.conn.playing->economic.gold) {
    /* yes */
    pBuf = pBuf->prev;
    pBuf->size.x = area.x + (area.w - (2 * pBuf->size.w + adj_size(20))) / 2;
    pBuf->size.y = dst.y;
    
    /* no */
    pBuf->next->size.x = pBuf->size.x + pBuf->size.w + adj_size(20);
  } else {
    /* no */
    pBuf->size.x = area.x + area.w - pBuf->size.w - adj_size(10);
  }
  /* ================================================== */
  /* redraw */
  redraw_group(pHurry_Prod_Dlg->pBeginWidgetList, pWindow, 0);
  widget_mark_dirty(pWindow);
  flush_dirty()*/
/* ========================== CHANGE PRODUCTION ==========================*/*/Popup the change production dialog.hange_prod_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    widget_redraw(pButton);
    widget_flush(pButton);
  
    disable_city_dlg_widgets();
    popup_worklist_editor(pCityDlg->pCity, &pCityDlg->pCity->worklist);
  }*/
/* =========================== SELL IMPROVMENTS ==========================*/*/Popdown Sell Imprv. Dlg. and exit without sell.sell_imprvm_dlg_cancel_callback(struct widget *pCancel_Button)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
                                  pCityDlg->pEndCityMenuWidgetList);
    pCityDlg->pEndCityMenuWidgetList = NULL;
    enable_city_dlg_widgets();
    redraw_city_dialog(pCityDlg->pCity);
    flush_dirty();
  }Popdown Sell Imprv. Dlg. and exit with sell.sell_imprvm_dlg_ok_callback(struct widget *pOK_Button)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct widget *pTmp = (struct widget *)pOK_Button->data.ptr;
  
    city_sell_improvement(pCityDlg->pCity, MAX_ID - 3000 - pTmp->ID);
    
    /* popdown, we don't redraw and flush becouse this is make by redraw city dlg.
       when response from server come */
                                  pCityDlg->pEndCityMenuWidgetList);
  
    pCityDlg->pEndCityMenuWidgetList = NULL;
  
    /* del imprv from widget list */
    del_widget_from_vertical_scroll_widget_list(pCityDlg->pImprv, pTmp);
    
    enable_city_dlg_widgets();
  
    if (pCityDlg->pImprv->pEndWidgetList) {
      set_group_state(pCityDlg->pImprv->pBeginActiveWidgetList,
                      pCityDlg->pImprv->pEndActiveWidgetList, FC_WS_DISABLED);
    }
  
    redraw_city_dialog(pCityDlg->pCity);
    flush_dirty();
  }  Popup Sell Imprvm.int sell_imprvm_dlg_callback(struct widget *pImpr)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct SDL_String16 *pStr = NULL;
    struct widget *pLabel = NULL;
    struct widget *pWindow = NULL;
    struct widget *pCancel_Button = NULL;
    struct widget *pOK_Button = NULL;
    char cBuf[80];
    int id;
    SDL_Rect area;
  
    unsellect_widget_action();
    disable_city_dlg_widgets();
  
    pStr = create_str16_from_char(_("Sell it?"), adj_font(12));
    pStr->style |= TTF_STYLE_BOLD;
    pWindow = create_window_skeleton(NULL, pStr, 0);
    /*pWindow->action = move_sell_imprvm_dlg_callback; */
    /*set_wstate( pWindow, FC_WS_NORMAL ); */
    add_to_gui_list(ID_WINDOW, pWindow);
    pCityDlg->pEndCityMenuWidgetList = pWindow;  

    area = pWindow->area;
    
    /* create text label */
    id = MAX_ID - 3000 - pImpr->ID;
  
    my_snprintf(cBuf, sizeof(cBuf), _("Sell %s for %d gold?"),
                city_improvement_name_translation(pCityDlg->pCity, improvement_by_number(id)),
                impr_sell_gold(improvement_by_number(id)));
    pStr = create_str16_from_char(cBuf, adj_font(10));
    pStr->style |= (TTF_STYLE_BOLD|SF_CENTER);
    pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_SELL);
    pLabel = create_iconlabel(NULL, pWindow->dst, pStr, 0);
    add_to_gui_list(ID_LABEL, pLabel);
  
    /* create cancel button */
    pCancel_Button =
        create_themeicon_button_from_chars(pTheme->Small_CANCEL_Icon,
                          pWindow->dst, _("Cancel"), adj_font(10), 0);
    pCancel_Button->action = sell_imprvm_dlg_cancel_callback;
    pCancel_Button->key = SDLK_ESCAPE;  
    set_wstate(pCancel_Button, FC_WS_NORMAL);
    add_to_gui_list(ID_BUTTON, pCancel_Button);
    
    /* create ok button */
    pOK_Button = create_themeicon_button_from_chars(
                  pTheme->Small_OK_Icon, pWindow->dst, _("Sell"), adj_font(10),  0);
    pOK_Button->data.ptr = (void *)pImpr;
    pOK_Button->size.w = pCancel_Button->size.w;
    pOK_Button->action = sell_imprvm_dlg_ok_callback;
    pOK_Button->key = SDLK_RETURN;
    set_wstate(pOK_Button, FC_WS_NORMAL);    
    add_to_gui_list(ID_BUTTON, pOK_Button);
  
    pCityDlg->pBeginCityMenuWidgetList = pOK_Button;
    
    /* correct sizes */
    if ((pOK_Button->size.w + pCancel_Button->size.w + adj_size(30)) >
        pLabel->size.w + adj_size(20)) {
      area.w = MAX(area.w, pOK_Button->size.w + pCancel_Button->size.w + adj_size(30));
    } else {
      area.w = MAX(area.w, pLabel->size.w + adj_size(20));
    }
  
    area.h = MAX(area.h, pOK_Button->size.h + pLabel->size.h + adj_size(25));

    /* create window background */
    resize_window(pWindow, NULL, get_game_colorRGB(COLOR_THEME_BACKGROUND),
                  (pWindow->size.w - pWindow->area.w) + area.w,
                  (pWindow->size.h - pWindow->area.h) + area.h);

    area = pWindow->area;
    
    /* set start positions */
    widget_set_position(pWindow,
                        (Main.screen->w - pWindow->size.w) / 2,
                        (Main.screen->h - pWindow->size.h) / 2 + adj_size(10));
  
    pOK_Button->size.x = area.x + adj_size(10);
    pOK_Button->size.y = area.y + area.h - pOK_Button->size.h - adj_size(10);
  
    pCancel_Button->size.y = pOK_Button->size.y;
    pCancel_Button->size.x = area.x + area.w - pCancel_Button->size.w - adj_size(10);
  
    pLabel->size.x = area.x;
    pLabel->size.y = area.y + adj_size(4);
    pLabel->size.w = area.w;
  
    /* redraw */
    redraw_group(pCityDlg->pBeginCityMenuWidgetList,
                 pCityDlg->pEndCityMenuWidgetList, 0);
  
    widget_mark_dirty(pWindow);
    flush_dirty();
  }
  return -1;
}...void enable_city_dlg_widgets(void)
{
  if (pCityDlg) {
    set_group_state(pCityDlg->pBeginCityWidgetList,
		  pCityDlg->pEndCityWidgetList->prev, FC_WS_NORMAL);
  
    if (pCityDlg->pImprv->pEndActiveWidgetList) {
        
      if (pCityDlg->pImprv->pScroll) {
        set_wstate(pCityDlg->pImprv->pScroll->pScrollBar, FC_WS_NORMAL);	/* vscroll */
        set_wstate(pCityDlg->pImprv->pScroll->pUp_Left_Button, FC_WS_NORMAL); /* up */
        set_wstate(pCityDlg->pImprv->pScroll->pDown_Right_Button, FC_WS_NORMAL); /* down */
      }

      if (pCityDlg->pCity->did_sell) {
        set_group_state(pCityDlg->pImprv->pBeginActiveWidgetList,
		      pCityDlg->pImprv->pEndActiveWidgetList, FC_WS_DISABLED);
      } else {
        struct widget *pTmpWidget = pCityDlg->pImprv->pEndActiveWidgetList;

        while (TRUE) {
	  if (is_wonder(improvement_by_number(MAX_ID - 3000 - pTmpWidget->ID))) {
	    set_wstate(pTmpWidget, FC_WS_DISABLED);
	  } else {
	    set_wstate(pTmpWidget, FC_WS_NORMAL);
	  }

	  if (pTmpWidget == pCityDlg->pImprv->pBeginActiveWidgetList) {
	    break;
	  }

	  pTmpWidget = pTmpWidget->prev;

        }				/* while */
      }
    }
  
    if (!city_can_buy(pCityDlg->pCity) && pCityDlg->pBuy_Button) {
      set_wstate(pCityDlg->pBuy_Button, FC_WS_DISABLED);
    }

    if (pCityDlg->pPanel) {
      set_group_state(pCityDlg->pPanel->pBeginWidgetList,
		    pCityDlg->pPanel->pEndWidgetList, FC_WS_NORMAL);
    }

    if (cma_is_city_under_agent(pCityDlg->pCity, NULL)) {
      set_wstate(pCityDlg->pResource_Map, FC_WS_DISABLED);
    }
  
    pCityDlg->lock = FALSE...void disable_city_dlg_widgets(void)
{
  if (pCityDlg->pPanel) {
    set_group_state(pCityDlg->pPanel->pBeginWidgetList,
		    pCityDlg->pPanel->pEndWidgetList, FC_WS_DISABLED);
  }


  if (pCityDlg->pImprv->pEndWidgetList) {
    set_group_state(pCityDlg->pImprv->pBeginWidgetList,
		    pCityDlg->pImprv->pEndWidgetList, FC_FC_WS_DISABLED);
  pCityDlg->lock = TRUE;
}SDL_Surface *get_scaled_city_map(struct city *pCity)
{
  SDL_Surface *pBuf = create_city_map(pCity);
  
  city_map_zoom = ((pBuf->w > pBuf->h) ?
                     (float)adj_size(249) / pBuf->w
                   : (float)adj_size(159) / pBuf->h);
  
  return zoomSurface(pBuf, city_map_zoom, city_map_zoom, 1)city resource map: event callbackresource_map_city_dlg_callback(struct widget *pMap)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    int col, row;
  
    if (canvas_to_city_pos(&col, &row,
      1/city_map_zoom * (Main.event.motion.x - pMap->dst->dest_rect.x - pMap->size.x),
      1/city_map_zoom * (Main.event.motion.y - pMap->dst->dest_rect.y - pMap->size.y))) {
  
      city_toggle_worker(pCityDlg->pCity, col, row);
    }
  }City1 = *((struct city **) a);
  struct city *pCity2 = *((struct city **) b);

  return pCity1->turn_founded - pCity2->turn_foundedCallback for next/prev city buttonnext_prev_city_dlg_callback(struct widget *pButton)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct city **array;
    int i, dir, non_open_size;
    int size = city_list_size(client.conn.playing->cities);
  
    assert(size >= 1);
    assert(city_owner(pCityDlg->pCity) == client.conn.playing);
  
    if (size == 1) {
      return -1;
    }
  
    /* dir = 1 will advance to the city, dir = -1 will get previous */
    if (pButton->ID == ID_CITY_DLG_NEXT_BUTTON) {
      dir = 1;
    } else {
      if (pButton->ID == ID_CITY_DLG_PREV_BUTTON) {
        dir = -1;
      } else {
        assert(0);
        dir = 1;
      }
    }
  
    array = fc_calloc(1, size * sizeof(struct city *));
  
    non_open_size = 0;
    for (i = 0; i < size; i++) {
      array[non_open_size++] = city_list_get(client.conn.playing->cities, i);
    }
  
    assert(non_open_size > 0);
  
    if (non_open_size == 1) {
      FC_FREE(array);
      return -1;
    }
  
    qsort(array, non_open_size, sizeof(struct city *),
                                                  city_comp_by_turn_founded);
  
    for (i = 0; i < non_open_size; i++) {
      if (pCityDlg->pCity == array[i]) {
        break;
      }
    }
  
    assert(i < non_open_size);
    pCityDlg->pCity = array[(i + dir + non_open_size) % non_open_size];
    FC_FREE(array);
  
    /* free panel widgets */
    free_city_units_lists();
    /* refresh resource map */get_scaled_city_map(pCityDlg->pCity);
    rebuild_imprm_list(pCityDlg->pCity);
  
    /* redraw */
    redraw_city_dialog(pCityDlg->pCity);
    flush_dirty();
  }Rename city name:new_name_city_dlg_callback(struct widget *pEdit)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    char *tmp = convert_to_chars(pEdit->string16->text);
  
    if(tmp) {
      if(strcmp(tmp, city_name(pCityDlg->pCity))) {
        SDL_Client_Flags |= CF_CHANGED_CITY_NAME;
        city_rename(pCityDlg->pCity, tmp);
      }
      
      FC_FREE(tmp);
    } else {
      /* empty input -> restore previous content */
      copy_chars_to_string16(pEdit->string16, city_name(pCityDlg->pCity));
      widget_redraw(pEdit);
      widget_mark_dirty(pEdit);
      flush_dirty();
    }  
  } if (pCityDlg->pCity_Name_Edit) {
    char name[MAX_LEN_NAME];
    
    convertcopy_to_chars(name, MAX_LEN_NAME,
			    pCityDlg->pCity_Name_Edit->string16->text);
    if ((strcmp(city_name(pCity), name) != 0)
      || (SDL_Client_Flags & CF_CHANGED_CITY_NAME)) {
      copy_chars_to_string16(pCityDlg->pCity_Name_Edit->string16, city_name(pCity));
      rebuild_citydlg_title_str(pCityDlg->pEndCityWidgetList, pCity);
      SDL_Client_Flags &= ~CF_CHANGED_CITY_NAME;Redraw city option panel
  207 = max panel widthvoid redraw_misc_city_dialog(struct widgetCity options"));

  pStr = create_str16_from_char(cBuf, adj_font(10));
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_PANEL);dest.x = pCityWindow->area.x + adj_size(2) + (adj_size(192) - pSurf->w) / 2;
  dest.y = pCityWindow->area.y + adj_size(4) + pTheme->INFO_Icon->h;

  alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);

  FREESURFACE(pSurf);
  FREESTRING16(pStr);

  if (!pCityDlg->pPanel) {
    create_city_options_widget_list(pCity);
  }
  redraw_group(pCityDlg->pPanel->pBeginWidgetList,
		 pCityDlg->pPanel->pEndWidgetList, 0)Redraw supported unit panel
  207 = max panel widthvoid redraw_supported_units_city_dialog(struct widget *pCityWindow,
					     int size;

  if (city_owner(pCityDlg->pCity) != client.conn.playing) {
    pList = (pCityDlg->pCity->info_units_supported);
  } else {
    pList = Supported units: %d"), size);

  pStr = create_str16_from_char(cBuf, adj_font(10));
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_PANEL);dest.x = pCityWindow->area.x + adj_size(2) + (adj_size(192) - pSurf->w) / 2;
  dest.y = pCityWindow->area.y + + adj_size(4) + pTheme->INFO_Icon->h;
  
  alphablit(pSurf, NULL, pCityWindow->dst->surfacePanel) {
    if (size) {
      redraw_group(pCityDlg->pPanel->pBeginWidgetList,
		   pCityDlg->pPanel->pEndWidgetList, 0);
    } else {
      del_group_of_widgets_from_gui_list(pCityDlg->pPanel->pBeginWidgetList,
					 pCityDlg->pPanel->pEndWidgetList);
      FC_FREE(pCityDlg->pPanel->pScroll);
      FC_FREE(pCityDlg->pPanel);
    }Panel->pBeginWidgetList,
		   pCityDlg->pPanel->pEndRedraw garrison panel
  207 = max panel widthvoid redraw_army_city_dialog(struct widget  struct unit_list *pList;

  int size;

  if (city_owner(pCityDlg->pCity) != client.conn.playing) {
    pList = pCityDlg->pCity->info_units_present;
  } else {
    pList = pCityDlg->pCity->tile->units;
  }

  size = unit_list_size(pList);

  my_snprintf(cBuf, sizeof(cBuf), _("Present units: %d"), size);

  pStr = create_str16_from_char(cBuf, adj_font(10));
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_PANEL);dest.x = pCityWindow->area.x + adj_size(2) + (adj_size(192) - pSurf->w) / 2;
  dest.y = pCityWindow->area.y + adj_size(4) + pTheme->INFO_Icon->h;
  
  alphablit(pSurf, NULL, pCityWindow->dst->surfacePanel) {
    if (size) {
      redraw_group(pCityDlg->pPanel->pBeginWidgetList,
		   pCityDlg->pPanel->pEndWidgetList, 0);
    } else {
      del_group_of_widgets_from_gui_list(pCityDlg->pPanel->pBeginWidgetList,
					 pCityDlg->pPanel->pEndWidgetList);
      FC_FREE(pCityDlg->pPanel->pScroll);
      FC_FREE(pCityDlg->pPanel);
    }Panel->pBeginWidgetList,
		   pCityDlg->pPanel->pEndRedraw Info panel
  207 = max panel widthvoid redraw_info_city_dialog(struct widget;

  my_snprintf(cBuf, sizeof(cBuf), _("City info"));
  pStr = create_str16_from_char(cBuf, adj_font(10));
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_PANEL);  
  dest.x = pCityWindow->area.x + adj_size(2) + (adj_size(192) - pSurf->w) / 2;
  dest.y = pCityWindow->area.y + adj_size(4) + pTheme->INFO_Icon->h;
  
  alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);

  dest.x = pCityWindow->size.x + adj_size(10);
  dest.y += pSurf->h + 1;

  FREESURFACE(pSurf);

  change_ptsize16(pStr, adj_font(11));
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_INFOPANEL);
  
  if (pCity->pollution) {
    my_snprintf(cBuf, sizeof(cBuf), _("Pollution: %d"),
		pCity->pollution);

    copy_chars_to_string16(pStr, cBuf);
    
    pSurf = create_text_surf_from_str16(pStr);

    alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);

    dest.y += pSurf->h + adj_size(3);

    FREESURFACE(pSurf);

    if (((pIcons->pPollution->w + 1) * pCity->pollution) > adj_size(187)) {
      step = (adj_size(187) - pIcons->pPollution->w) / (pCity->pollution - 1);
    } else {
      step = pIcons->pPollution->w + 1;
    }

    for (i = 0; i < pCity->pollution; i++) {
      alphablit(pIcons->pPollution, NULL, pCityWindow->dst->surface, &dest);
      dest.x += step;
    }

    dest.x = pCityWindow->size.x + adj_size(10);
    dest.y += pIcons->pPollution->h + adj_size(30);

  } else {
    my_snprintf(cBuf, sizeof(cBuf), _("Pollution: none"));

    copy_chars_to_string16(pStr, cBuf);

    pSurf = create_text_surf_from_str16(pStr);

    alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);

    dest.y += pSurf->h + adj_size(3);

    FREESURFACE(pSurf);
  }

  my_snprintf(cBuf, sizeof(cBuf), _("Trade routes: "));

  copy_chars_to_string16(pStr, cBuf);

  pSurf = create_text_surf_from_str16(pStr);

  alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);

  xx = dest.x + pSurf->w;
  dest.y += pSurf->h + adj_size(3);

  FREESURFACE(pSurf);

  step = 0;
  dest.x = pCityWindow->size.x + adj_size(10)game_find_city_by_number(pCity->trade[i]))) {
	my_snprintf(cBuf, sizeof(cBuf), "%s: +%d", city_name(pTradeCity),
		    pCity->trade_value[i]);
      } else {
	my_snprintf(cBuf, sizeof(cBuf), "%s: +%d", _("Unknown"),
		    pCity->trade_value[i]);
      }


      copy_chars_to_string16(pStr, cBuf);

      pSurf = create_text_surf_from_str16(pStr);

      alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);

      /* blit trade icon */
      dest.x += pSurf->w + adj_size(3);
      dest.y += adj_size(4);
      alphablit(pIcons->pTrade, NULL, pCityWindow->dst->surface, &dest);
      dest.x = pCityWindow->size.x + adj_size(10);
      dest.y -= adj_size(4): +%d"), step);

    copy_chars_to_string16(pStr, cBuf);
    pSurf = create_text_surf_from_str16(pStr);
    alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);

    dest.x += pSurf->w + adj_size(3);
    dest.y += adj_size(4);
    alphablit(pIcons->pTrade, NULL, pCityWindow->dst->surfacecopy_chars_to_string16(pStr, cBuf);

    pSurf = create_text_surf_from_str16(pStr);

    dest.x = xx;
    dest.y -= pSurf->h + adj_size(3);
    alphablit(pSurf, NULL, pCityWindow->dst->surface  207 - max panel width
  180 - max citizens icons area widthvoid redraw_happyness_city_dialog(const struct widget *pCityWindow,
					 struct city *pCity)
{
  char cBuf[30];
  int step, i, j, count;
  SDL_Surface *pTmp;
  SDL_String16 *pStr = NULL;
  SDL_Surface *pSurf = NULL;
  SDL_Rect dest = {0, 0, 0, 0};
  struct effect_list *sources = effect_list_new();   

  my_snprintf(cBuf, sizeof(cBuf), _("Happiness"));

  pStr = create_str16_from_char(cBuf, adj_font(10));
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_PANEL);dest.x = pCityWindow->area.x + adj_size(2) + (adj_size(192) - pSurf->w) / 2;
  dest.y = pCityWindow->area.y + adj_size(4) + pTheme->INFO_Icon->h;
  alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);
  
  dest.x = pCityWindow->size.x + adj_size(10)(pCity->feel[CITIZEN_HAPPY][FEELING_FINAL] + pCity->feel[CITIZEN_CONTENT][FEELING_FINAL]
	   + pCity->feel[CITIZEN_UNHAPPY][FEELING_FINAL] + pCity->feel[CITIZEN_ANGRY][FEELING_FINAL]
	   + pCity->specialists[SP_ELVIS] + pCity->specialists[SP_SCIENTIST]
	   + pCity->specialists[SP_TAXMAN]);

  if (count * pIcons->pMale_Happy->w > adj_size(166)) {
    step = (adj_size(166) - pIcons->pMale_Happy->w) / (count - 1);
  } else {
    step = pIcons->pMale_Happy->w;
  }

  for (j = 0; j < FEELING_LAST; j++) {
    if (j == 0 || pCity->feel[CITIZEN_HAPPY][j - 1] != pCity->feel[CITIZEN_HAPPY][j]
	|| pCity->feel[CITIZEN_CONTENT][j - 1] != pCity->feel[CITIZEN_CONTENT][j]
	|| pCity->feel[CITIZEN_UNHAPPY][j - 1] != pCity->feel[CITIZEN_UNHAPPY][j]
	|| pCity->feel[CITIZEN_ANGRY][j - 1] != pCity->feel[CITIZEN_ANGRY][j]) {

      if (j != 0) {
	putline(pCityWindow->dst->surface, dest.x, dest.y, dest.x + adj_size(176), dest.y,
          map_rgba(pCityWindow->dst->surface->format, *get_game_colorRGB(COLOR_THEME_CITYDLG_FRAME)));
	dest.y += adj_size(5);
      }

      if (pCity->feel[CITIZEN_HAPPY][j]) {
	pSurf = pIcons->pMale_Happy;
	for (i = 0; i < pCity->feel[CITIZEN_HAPPY][j]; i++) {
	  alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);
	  dest.x += step;
	  if (pSurf == pIcons->pMale_Happy) {
	    pSurf = pIcons->pFemale_Happy;
	  } else {
	    pSurf = pIcons->pMale_Happy;
	  }
	}
      }

      if (pCity->feel[CITIZEN_CONTENT][j]) {
	pSurf = pIcons->pMale_Content;
	for (i = 0; i < pCity->feel[CITIZEN_CONTENT][j]; i++) {
	  alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);
	  dest.x += step;
	  if (pSurf == pIcons->pMale_Content) {
	    pSurf = pIcons->pFemale_Content;
	  } else {
	    pSurf = pIcons->pMale_Content;
	  }
	}
      }

      if (pCity->feel[CITIZEN_UNHAPPY][j]) {
	pSurf = pIcons->pMale_Unhappy;
	for (i = 0; i < pCity->feel[CITIZEN_UNHAPPY][j]; i++) {
	  alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);
	  dest.x += step;
	  if (pSurf == pIcons->pMale_Unhappy) {
	    pSurf = pIcons->pFemale_Unhappy;
	  } else {
	    pSurf = pIcons->pMale_Unhappy;
	  }
	}
      }

      if (pCity->feel[CITIZEN_ANGRY][j]) {
	pSurf = pIcons->pMale_Angry;
	for (i = 0; i < pCity->feel[CITIZEN_ANGRY][j]; i++) {
	  alphablit(pSurf, NULL, pCityWindow->dst->surface, &dest);
	  dest.x += step;
	  if (pSurf == pIcons->pMale_Angry) {
	    pSurf = pIcons->pFemale_Angry;
	  } else {
	    pSurf = pIcons->pMale_Angry;
	  }
	}
      }

      if (pCity->specialists[SP_ELVIS]) {
	for (i = 0; i < pCity->specialists[SP_ELVIS]; i++) {
	  alphablit(pIcons->pSpec_Lux, NULL, pCityWindow->dst->surface, &dest);
	  dest.x += step;
	}
      }

      if (pCity->specialists[SP_TAXMAN]) {
	for (i = 0; i < pCity->specialists[SP_TAXMAN]; i++) {
	  alphablit(pIcons->pSpec_Tax, NULL, pCityWindow->dst->surface, &dest);
	  dest.x += step;
	}
      }

      if (pCity->specialists[SP_SCIENTIST]) {
	for (i = 0; i < pCity->specialists[SP_SCIENTIST]; i++) {
	  alphablit(pIcons->pSpec_Sci, NULL, pCityWindow->dst->surface, &dest);
	  dest.x += step;
	}
      }

      if (j == 1) { /* luxury effect */
	dest.x =
	    pCityWindow->size.x + adj_size(212) - pIcons->pBIG_Luxury->w - adj_size(2);
	count = dest.y;
	dest.y += (pIcons->pMale_Happy->h -
		   pIcons->pBIG_Luxury->h) / 2;
	alphablit(pIcons->pBIG_Luxury, NULL, pCityWindow->dst->surface, &dest);
	dest.y = count;
      }

      if (j == 2) { /* improvments effects */
	pSurf = NULL;
	count = 0;

        get_city_bonus_effects(sources, pCity, NULL, EFT_MAKE_CONTENT);
        
        effect_list_iterate(sources, psource) {

          pTmp = get_building_surface(get_building_for_effect(psource->type));
          pTmp = zoomSurface(pTmp, DEFAULT_ZOOM * ((float)18 / pTmp->w), DEFAULT_ZOOM * ((float)18 / pTmp->w), 1);
          
	  count += (pTmp->h + 1);

          if (!pSurf) {
	    pSurf = pTmp;
	  } else {
            FREESURFACE(pTmp);
          }
             
        } effect_list_iterate_end;

	dest.x = pCityWindow->size.x + adj_size(187) - pSurf->w - adj_size(2);
	i = dest.y;
	dest.y += (pIcons->pMale_Happy->h - count) / 2;
        
        FREESURFACE(pSurf);
        
        effect_list_iterate(sources, psource) {

          pTmp = get_building_surface(get_building_for_effect(psource->type));
          pTmp = zoomSurface(pTmp, DEFAULT_ZOOM * ((float)18 / pTmp->w), DEFAULT_ZOOM * ((float)18 / pTmp->w), 1);

	  alphablit(pTmp, NULL, pCityWindow->dst->surface, &dest);
	  dest.y += (pTmp->h + 1);
 
          FREESURFACE(pTmp);            
        } effect_list_iterate_end;
        
        effect_list_clear(sources);

	dest.y = i;        
        
        /* TODO: check if code replacement above is correct */
#if 0          
	if (city_has_building(pCity, improvement_by_number(B_TEMPLE))) {
	  pTmp1 =
	    zoomSurface(GET_SURF(improvement_by_number(B_TEMPLE)->sprite),
			0.5,has_building(pCity, improvement_by_number(B_COLOSSEUM))) {
	  pTmp2 =
	    zoomSurface(GET_SURF(improvement_by_number(B_COLOSSEUM)->sprite),
			has_building(pCity, improvement_by_number(B_CATHEDRAL)) ||
	    city_affected_by_wonder(pCity, B_MICHELANGELO)) {
	  pTmp3 =
	    zoomSurface(GET_SURF(improvement_by_number(B_CATHEDRAL)->sprite),
			adj_size(212) - pSurf->w - adj_size(2);
	i = dest.y;
	dest.y += (pIcons->pMale_Happy->h - count) / 2;


	if (pTmp1) { /* Temple */
	  alphablit(pTmp1, NULL, pCityWindow->dst->surface, &dest);
	  dest.y += (pTmp1->h + 1);
	}

	if (pTmp2) { /* Colosseum */
	  alphablit(pTmp2, NULL, pCityWindow->dst->surface, &dest);
	  dest.y += (pTmp2->h + 1);
	}

	if (pTmp3) { /* Cathedral */
	  alphablit(pTmp3, NULL, pCityWindow->dst->surface#endif        
      }

      if (j == 3) { /* police effect */
	dest.x = pCityWindow->size.x + adj_size(187) - pIcons->pPolice->w - adj_size(5);
	i = dest.y;
	dest.y +=
	    (pIcons->pMale_Happy->h - pIcons->pPolice->h) / 2;
	alphablit(pIcons->pPolice, NULL, pCityWindow->dst->surface, &dest);
	dest.y = i;
      }

      if (j == 4) { /* wonders effect */
	count = 0;

        get_city_bonus_effects(sources, pCity, NULL, EFT_MAKE_HAPPY);          
        effect_list_iterate(sources, psource) {

          pTmp = get_building_surface(get_building_for_effect( psource->type));
          pTmp = zoomSurface(pTmp, DEFAULT_ZOOM * ((float)18 / pTmp->w), DEFAULT_ZOOM * ((float)18 / pTmp->w), 1);
          
	  count += (pTmp->h + 1);

          if (!pSurf) {
	    pSurf = pTmp;
	  } else {
            FREESURFACE(pTmp);           
          }
             
        } effect_list_iterate_end;

        effect_list_clear(sources);

        get_city_bonus_effects(sources, pCity, NULL, EFT_FORCE_CONTENT);
        
        effect_list_iterate(sources, psource) {

          pTmp = get_building_surface(get_building_for_effect(psource->type));
          pTmp = zoomSurface(pTmp, DEFAULT_ZOOM * ((float)18 / pTmp->w), DEFAULT_ZOOM * ((float)18 / pTmp->w), 1);
	  count += (pTmp->h + 1);

          if (!pSurf) {
	    pSurf = pTmp;
	  } else {
            FREESURFACE(pTmp);            
          }
             
        } effect_list_iterate_end;

        effect_list_clear(sources);

        get_city_bonus_effects(sources, pCity, NULL, EFT_NO_UNHAPPY);

        effect_list_iterate(sources, psource) {

          pTmp = get_building_surface(get_building_for_effect(psource->type));
          pTmp = zoomSurface(pTmp, DEFAULT_ZOOM * ((float)18 / pTmp->w), DEFAULT_ZOOM * ((float)18 / pTmp->w), 1);
            
	  count += (pTmp->h + 1);

          FREESURFACE(pTmp);

        } effect_list_iterate_end;

        effect_list_clear(sources);

        
	dest.x = pCityWindow->size.x + adj_size(187) - pSurf->w - adj_size(2);
	i = dest.y;
	dest.y += (pIcons->pMale_Happy->h - count) / 2;
        
        FREESURFACE(pSurf);

        get_city_bonus_effects(sources, pCity, NULL, EFT_MAKE_HAPPY);        

        effect_list_iterate(sources, psource) {

          pTmp = get_building_surface(get_building_for_effect(psource->type));
          pTmp = zoomSurface(pTmp, DEFAULT_ZOOM * ((float)18 / pTmp->w), DEFAULT_ZOOM * ((float)18 / pTmp->w), 1);

          alphablit(pTmp, NULL, pCityWindow->dst->surface, &dest);
	  dest.y += (pTmp->h + 1);
 
          FREESURFACE(pTmp);            
          
        } effect_list_iterate_end;
        effect_list_clear(sources);        

        get_city_bonus_effects(sources, pCity, NULL, EFT_FORCE_CONTENT);        

        effect_list_iterate(sources, psource) {

          pTmp = get_building_surface(get_building_for_effect(psource->type));
          pTmp = zoomSurface(pTmp, DEFAULT_ZOOM * ((float)18 / pTmp->w), DEFAULT_ZOOM * ((float)18 / pTmp->w), 1);

	  alphablit(pTmp, NULL, pCityWindow->dst->surface, &dest);
	  dest.y += (pTmp->h + 1);
 
          FREESURFACE(pTmp);            
          
        } effect_list_iterate_end;
        effect_list_clear(sources);        

        get_city_bonus_effects(sources, pCity, NULL, EFT_NO_UNHAPPY);        

        effect_list_iterate(sources, psource) {

          pTmp = get_building_surface(get_building_for_effect(psource->type));
          pTmp = zoomSurface(pTmp, DEFAULT_ZOOM * ((float)18 / pTmp->w), DEFAULT_ZOOM * ((float)18 / pTmp->w), 1);

	  alphablit(pTmp, NULL, pCityWindow->dst->surface, &dest);
	  dest.y += (pTmp->h + 1);
 
          FREESURFACE(pTmp);            
          
        } effect_list_iterate_end;
        effect_list_clear(sources);
        
	dest.y = i;        

        /* TODO: check if code replacement above is correct */        
#if 0	  
	if (city_affected_by_wonder(pCity, B_CURE)) {
	  pTmp1 =
	    zoomSurface(GET_SURF(improvement_by_number(B_CURE)->sprite),
			0.5,affected_by_wonder(pCity, B_SHAKESPEARE)) {
	  pTmp2 = zoomSurface(
	  	GET_SURF(improvement_by_number(B_SHAKESPEARE)->sprite)zoomSurface(GET_SURF(improvement_by_number(B_BACH)->sprite),
				if (city_affected_by_wonder(pCity, B_HANGING)) {
	  pTmp4 =
	    zoomSurface(GET_SURF(improvement_by_number(B_HANGING)->sprite),
			0.5,adj_size(187) - pSurf->w - adj_size(2);
	i = dest.y;
	dest.y += (pIcons->pMale_Happy->h - count) / 2;


	if (pTmp1) { /* Cure of Cancer */
	  alphablit(pTmp1, NULL, pCityWindow->dst->surface, &dest);
	  dest.y += (pTmp1->h + 1);
	}

	if (pTmp2) { /* Shakespeare Theater */
	  alphablit(pTmp2, NULL, pCityWindow->dst->surface, &dest);
	  dest.y += (pTmp2->h + 1);
	}

	if (pTmp3) { /* J. S. Bach ... */
	  alphablit(pTmp3, NULL, pCityWindow->dst->surface, &dest);
	  dest.y += (pTmp3->h + 1);
	}

	if (pTmp4) { /* Hanging Gardens */
	  alphablit(pTmp4, NULL, pCityWindow->dst->surface#endif        
      }

      dest.x = pCityWindow->size.x + adj_size(10);
      dest.y += pIcons->pMale_Happy->h + adj_size(5);

    }
  }
  
  effect_list_free(sources)Redraw the dialog., limit;
  int cost = 0;
  SDL_Rect dest;
  struct widget *pWindow = pCityDlg->pEndCityWidgetList;
  SDL_Surface *pBuf = NULL, *pBuf2 = NULL;
  SDL_String16 *pStr = NULL;

  refresh_city_names(pCity);

  if ((city_unhappy(pCity) || city_celebrating(pCity) || city_happy(pCity) ||
      cma_is_city_under_agent(pCity, NULL))
      ^ ((SDL_Client_Flags & CF_CITY_STATUS_SPECIAL) == CF_CITY_STATUS_SPECIAL#if 0
    /* upd. resource map */get_scaled_city_map(pCity);
#endif	update resource map */
  FREESURFACE(pCityDlg->pResource_Map->theme);
  pCityDlg->pResource_Map->theme = get_scaled_city_map(pCity);

  /* redraw city dlg */
  redraw_group(pCityDlg->pBeginCityWidgetList,
	       			pCityDlg->pEndCityWidgetList, 0);
  ==== */
  my_snprintf(cBuf, sizeof(cBuf), _("City map"));

  pStr = create_str16_from_char(cBuf, adj_font(10));
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_GOLD)dest.x = pWindow->size.x + adj_size(196) + (adj_size(132) - pBuf->w) / 2;
  dest.y = pWindow->size.y + adj_size(49) + (adj_size(13) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surfacecopy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_LUX);
  
  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(344) + (adj_size(146) - pBuf->w) / 2;
  dest.y = pWindow->size.y + adj_size(47) + (adj_size(13) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surfacey improvements"));

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_GOLD);
  
  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(504) + (adj_size(132) - pBuf->w) / 2;
  dest.y = pWindow->size.y + adj_size(49) + (adj_size(13) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);==== */
  /* food label */
  my_snprintf(cBuf, sizeof(cBuf), _("Food: %d per turn"),
	      pCity->prod[O_FOOD]);

  copy_chars_to_string16(pStr, cBuf);

  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_FOODPERTURN);

  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(200);
  dest.y = pWindow->size.y + adj_size(228) + (adj_size(16) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surfaceadj_size(246) + (adj_size(16) - pIcons->pBIG_Food->h) / 2;
  dest.x = pWindow->size.x + adj_size(203);

  if (pCity->surplus[O_FOOD] >= 0) {
    count = pCity->prod[O_FOOD] - pCity->surplus[O_FOOD];
  } else {
    count = pCity->prod[O_FOOD];
  }

  if (((pIcons->pBIG_Food->w + 1) * count) > adj_size(200)) {
    step = (adj_size(200) - pIcons->pBIG_Food->w) / (count - 1);
  } else {
    step = pIcons->pBIG_Food->w + 1;
  }

  for (i = 0; i < count; i++) {
    alphablit(pIcons->pBIG_Food, NULL, pWindow->dst->surface: %d"),
					      pCity->surplus[O_FOOD]);

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_FOOD_SURPLUS);
  
  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(440) - pBuf->w;
  dest.y = pWindow->size.y + adj_size(228) + (adj_size(16) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);

  /* draw surplus of food */
  if (pCity->surplus[O_FOOD]) {

    if (pCity->surplus[O_FOOD] > 0) {
      count = pCity->surplus[O_FOOD];
      pBuf = pIcons->pBIG_Food;
    } else {
      count = -1 * pCity->surplus[O_FOOD];
      pBuf = pIcons->pBIG_Food_Corr;
    }

    dest.x = pWindow->size.x + adj_size(423);
    dest.y = pWindow->size.y + adj_size(246) + (adj_size(16)adj_size(30)alphablit(pBuf, NULL, pWindow->dst->surface  /* productions label */
  my_snprintf(cBuf, sizeof(cBuf), _("Production: %d (%d) per turn"),
	      pCity->surplus[O_SHIELD] ,
		  pCity->prod[O_SHIELD] + pCity->waste[O_SHIELD]);

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_PROD);
  
  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(200);
  dest.y = pWindow->size.y + adj_size(263) + (adj_size(15) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);

  /* draw productions schields */
  if (pCity->surplus[O_SHIELD]) {

    if (pCity->surplus[O_SHIELD] > 0) {
      count = pCity->surplus[O_SHIELD] + pCity->waste[O_SHIELD];
      pBuf = pIcons->pBIG_Shield;
    } else {
      count = -1 * pCity->surplus[O_SHIELD];
      pBuf = pIcons->pBIG_Shield_Corr;
    }

    dest.y = pWindow->size.y + adj_size(281) + (adj_size(16) - pBuf->h) / 2;
    dest.x = pWindow->size.x + adj_size(203);
    
    if ((pBuf->w * count) > adj_size(200)) {
      step = (adj_size(200)alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
      if(i > pCity->surplus[O_SHIELD]) {
	pBuf = pIcons->pBIG_Shield_Corr;
      }
    }
  }

  /* support shields label */
  my_snprintf(cBuf, sizeof(cBuf), Q_("?production:Support: %d"),
	  pCity->prod[O_SHIELD] + pCity->waste[O_SHIELD] - pCity->surplus[O_SHIELD]);

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_SUPPORT);
  
  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(440) - pBuf->w;
  dest.y = pWindow->size.y + adj_size(263) + (adj_size(15) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);

  /* draw support shields */
  if (pCity->prod[O_SHIELD] - pCity->surplus[O_SHIELD]) {
    dest.x = pWindow->size.x + adj_size(423);
    dest.y =
	pWindow->size.y + adj_size(281) + (adj_size(16) - pIcons->pBIG_Shield->h) / 2;

    if ((pIcons->pBIG_Shield->w + 1) * (pCity->prod[O_SHIELD] -
					    pCity->surplus[O_SHIELD]) > adj_size(30)) {
      step =
	  (adj_size(30) - pIcons->pBIG_Food->w) / (pCity->prod[O_SHIELD] -
					     pCity->surplus[O_SHIELD] - 1);
    } else {
      step = pIcons->pBIG_Shield->w + 1;
    }

    for (i = 0; i < (pCity->prod[O_SHIELD] - pCity->surplus[O_SHIELD]); i++) {
      alphablit(pIcons->pBIG_Shield, NULL, pWindow->dst->surface: %d per turn"),
	      pCity->surplus[O_TRADE]);

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_TRADE);
  
  pBuf = create_text_surf_from_str16(pStr);
  
  dest.x = pWindow->size.x + adj_size(200);
  dest.y = pWindow->size.y + adj_size(298) + (adj_size(15) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);

  /* draw total (trade - corruption) */
  if (pCity->surplus[O_TRADE]) {
    dest.y =
	pWindow->size.y + adj_size(316) + (adj_size(16) - pIcons->pBIG_Trade->h) / 2;
    dest.x = pWindow->size.x + adj_size(203);
    
    if (((pIcons->pBIG_Trade->w + 1) * pCity->surplus[O_TRADE]) > adj_size(200)) {
      step = (adj_size(200) - pIcons->pBIG_Trade->w) / (pCity->surplus[O_TRADE] - 1);
    } else {
      step = pIcons->pBIG_Trade->w + 1;
    }

    for (i = 0; i < pCity->surplus[O_TRADE]; i++) {
      alphablit(pIcons->pBIG_Trade, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
    }
  }

  /* corruption label */
  my_snprintf(cBuf, sizeof(cBuf), _("Corruption: %d"),
	      pCity->waste[O_TRADE]);

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_CORRUPTION);

  pBuf = create_text_surf_from_str16(pStr);
  
  dest.x = pWindow->size.x + adj_size(440) - pBuf->w;
  dest.y = pWindow->size.y + adj_size(298) + (adj_size(15) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);

  /* draw corruption */
  if (pCity->waste[O_TRADE] > 0) {
    dest.x = pWindow->size.x + adj_size(423);
    dest.y =
	pWindow->size.y + adj_size(316) + (adj_size(16) - pIcons->pBIG_Trade->h) / 2;
    
    if (((pIcons->pBIG_Trade_Corr->w + 1) * pCity->waste[O_TRADE]) > adj_size(30)) {
      step =
	  (adj_size(30) - pIcons->pBIG_Trade_Corr->w) / (pCity->waste[O_TRADE] - 1);
    } else {
      step = pIcons->pBIG_Trade_Corr->w + 1;
    }

    for (i = 0; i < pCity->waste[O_TRADE]; i++) {
      alphablit(pIcons->pBIG_Trade_Corr, NULL, pWindow->dst->surface,
		      &dest);
      dest.x -= step;
    }

  }==== */
  /* gold label */
  my_snprintf(cBuf, sizeof(cBuf), _("Gold: %d (%d) per turn"),
	      pCity->surplus[O_GOLD], pCity->prod[O_GOLD]);

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_GOLD);
  
  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(200);
  dest.y = pWindow->size.y + adj_size(342) + (adj_size(15) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);

  /* draw coins */
  count = pCity->surplus[O_GOLD];
  if (count) {

    if (count > 0) {
      pBuf = pIcons->pBIG_Coin;
    } else {
      count *= -1;
      pBuf = pIcons->pBIG_Coin_Corr;
    }

    dest.y = pWindow->size.y + adj_size(359) + (adj_size(16) - pBuf->h) / 2;
    dest.x = pWindow->size.x + adj_size(203);
    
    if ((pBuf->w * count) > adj_size(110)) {
      step = (adj_size(110) - pBuf->w) / (count - 1);
      if (!step) {
	step = 1;
	count = 97;
      }alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
    }

  }

  /* upkeep label */
  my_snprintf(cBuf, sizeof(cBuf), _("Upkeep: %d"),
	      pCity->prod[O_GOLD] - pCity->surplus[O_GOLD]);

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_UPKEEP);
  
  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(440) - pBuf->w;
  dest.y = pWindow->size.y + adj_size(342) + (adj_size(15) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);

  /* draw upkeep */
  count = pCity->surplus[O_GOLD];
  if (pCity->prod[O_GOLD] - count) {

    dest.x = pWindow->size.x + adj_size(423);
    dest.y = pWindow->size.y + adj_size(359)
      + (adj_size(16) - pIcons->pBIG_Coin_UpKeep->h) / 2;
    
    if (((pIcons->pBIG_Coin_UpKeep->w + 1) *
	 (pCity->prod[O_GOLD] - count)) > adj_size(110)) {
      step = (adj_size(110) - pIcons->pBIG_Coin_UpKeep->w) /
	  (pCity->prod[O_GOLD] - count - 1);
    } else {
      step = pIcons->pBIG_Coin_UpKeep->w + 1;
    }

    for (i = 0; i < (pCity->prod[O_GOLD] - count); i++) {
      alphablit(pIcons->pBIG_Coin_UpKeep, NULL, pWindow->dst->surface,
		       /* science label */
  my_snprintf(cBuf, sizeof(cBuf), _("Science: %d per turn"),
	      pCity->prod[O_SCIENCE]);

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_SCIENCE);
  
  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(200);
  dest.y = pWindow->size.y + adj_size(376) + (adj_size(15) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);

  /* draw colb */
  count = pCity->prod[O_SCIENCE];
  if (count) {

    dest.y =
	pWindow->size.y + adj_size(394) + (adj_size(16) - pIcons->pBIG_Colb->h) / 2;
    dest.x = pWindow->size.x + adj_size(203);
    
    if ((pIcons->pBIG_Colb->w * count) > adj_size(235)) {
      step = (adj_size(235) - pIcons->pBIG_Colb->w) / (count - 1);
      if (!step) {
	step = 1;
	count = 222;
      }
    } else {
      step = pIcons->pBIG_Colb->w;
    }

    for (i = 0; i < count; i++) {
      alphablit(pIcons->pBIG_Colb, NULL, pWindow->dst->surface, &dest);
      dest.x +luxury label */
  my_snprintf(cBuf, sizeof(cBuf), _("Luxury: %d per turn"),
	      pCity->prod[O_LUXURY]);

  copy_chars_to_string16(pStr, cBuf);
  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_LUX);
  
  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(200);
  dest.y = pWindow->size.y + adj_size(412) + (adj_size(15) - pBuf->h) / 2;

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);

  /* draw luxury */
  if (pCity->prod[O_LUXURY]) {

    dest.y =
	pWindow->size.y + adj_size(429) + (adj_size(16) - pIcons->pBIG_Luxury->h) / 2;
    dest.x = pWindow->size.x + adj_size(203);
    
    if ((pIcons->pBIG_Luxury->w * pCity->prod[O_LUXURY]) > adj_size(235)) {
      step =
	  (adj_size(235) - pIcons->pBIG_Luxury->w) / (pCity->prod[O_LUXURY] - 1);
    } else {
      step = pIcons->pBIG_Luxury->w;
    }

    for (i = 0; i < pCity->prod[O_LUXURY]; i++) {
      alphablit(pIcons->pBIG_Luxury, NULL, pWindow->dst->surface, &dest);
      dest.x +turns to grow label */
  count = city_turns_to_grow(pCity);
  if (count == 0) {
    my_snprintf(cBuf, sizeof(cBuf), _("City growth: blocked"));
  } else if (count == FC_INFINITY) {
    my_snprintf(cBuf, sizeof(cBuf), _("City growth: never"));
  } else if (count < 0) {
    /* turns until famine */
    my_snprintf(cBuf, sizeof(cBuf),
		_("City shrinks: %d %s"), abs(count),
		PL_("turn", "turns", abs(count)));
  } else {
    my_snprintf(cBuf, sizeof(cBuf),
		_("City growth: %d %s"), count,
		PL_("turn", "turns", count));
  }

  copy_chars_to_string16(pStr, cBuf);

  pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_GROWTH);  

  pBuf = create_text_surf_from_str16(pStr);

  dest.x = pWindow->size.x + adj_size(445) + (adj_size(192) - pBuf->w) / 2;
  dest.y = pWindow->size.y + adj_size(227);

  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);


  count = (city_granary_size(pCity->size)) / 10;

  if (count > 12) {
    step = (adj_size(168) - pIcons->pBIG_Food->h) / adj_size((11 + count - 12));
    i = (count - 1) * step + 14;
    count = 12;
  } else {
    step = pIcons->pBIG_Food->h;
    i = count * step;
  }

  /* food stock */
  
    /* FIXME: check if this code replacement is correct */
    /*  if (city_has_building(pCity, improvement_by_number(B_GRANARY)) */
    /*      || city_affected_by_wonder(pCity, B_PYRAMIDS)) { */
          
    if (get_city_bonus(pCity, EFT_GROWTH_FOOD) > 0) {

    /* with granary */
    /* stocks label */
    copy_chars_to_string16(pStr, _("Stock"));
    pBuf = create_text_surf_from_str16(pStr);

    dest.x = pWindow->size.x + adj_size(461) + (adj_size(76) - pBuf->w) / 2;
    dest.y = pWindow->size.y + adj_size(258) - pBuf->h - 1;

    alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

    FREESURFACE(pBuf);

    /* granary label */
    copy_chars_to_string16(pStr, _("Granary"));
    pBuf = create_text_surf_from_str16(pStr);

    dest.x = pWindow->size.x + adj_size(549) + (adj_size(76) - pBuf->w) / 2;
    dest.y = pWindow->size.y + adj_size(258) - pBuf->h - 1;

    alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

    FREESURFACE(pBuf);

    /* draw bcgd granary */
    dest.x = pWindow->size.x + adj_size(462);
    dest.y = pWindow->size.y + adj_size(260);
    dest.w = 70 + 4;
    dest.h = i + 4;

    SDL_FillRectAlpha(pWindow->dst->surface, &dest, get_game_colorRGB(COLOR_THEME_CITYDLG_GRANARY));

    putframe(pWindow->dst->surface, dest.x - 1, dest.y - 1, dest.x + dest.w, dest.y + dest.h,
      map_rgba(pWindow->dst->surface->format, *get_game_colorRGB(COLOR_THEME_CITYDLG_FRAME)));
		
    /* draw bcgd stocks*/
    dest.x = pWindow->size.x + adj_size(550);
    dest.y = pWindow->size.y + adj_size(260);

    SDL_FillRectAlpha(pWindow->dst->surface, &dest, get_game_colorRGB(COLOR_THEME_CITYDLG_STOCKS));

    putframe(pWindow->dst->surface, dest.x - 1, dest.y - 1, dest.x + dest.w, dest.y + dest.h,
      map_rgba(pWindow->dst->surface->format, *get_game_colorRGB(COLOR_THEME_CITYDLG_FRAME)));

    /* draw stocks icons */
    cost = city_granary_size(pCity->size);
    if (pCity->food_stock + pCity->surplus[O_FOOD] > cost) {
      count = cost;
    } else {
      if(pCity->surplus[O_FOOD] < 0) {
        count = pCity->food_stock;
      } else {
	count = pCity->food_stock + pCity->surplus[O_FOOD];
      }
    }
    cost /= 2;
    
    if(pCity->surplus[O_FOOD] < 0) {
      limit = pCity->food_stock + pCity->surplus[O_FOOD];
      if(limit < 0) {
	limit = 0;
      }
    } else {
      limit = 0xffff;
    }
    
    dest.x += 2;
    dest.y += 2;
    i = 0;
    pBuf = pIcons->pBIG_Food;
    while (count && cost) {
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += pBuf->w;
      count--;
      cost--;
      i++;
      if (dest.x > pWindow->size.x + adj_size(620)) {
	dest.x = pWindow->size.x + adj_size(552);
	dest.y += step;
      }
      if(i > limit - 1) {
	pBuf = pIcons->pBIG_Food_Corr;
      } else {
        if(i > pCity->food_stock - 1)
        {
	  pBuf = pIcons->pBIG_Food_Surplus;
        }
      }
    }
    /* draw granary icons */
    dest.x = pWindow->size.x + adj_size(462) + adj_size(2);
    dest.y = pWindow->size.y + adj_size(260) + adj_size(2);
        
    while (count) {
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += pBuf->w;
      count--;
      i++;
      if (dest.x > pWindow->size.x + adj_size(532)) {
	dest.x = pWindow->size.x + adj_size(464);
	dest.y += step;
      }
      if(i > limit - 1) {
	pBuf = pIcons->pBIG_Food_Corr;
      } else {
        if(i > pCity->food_stock - 1)
        {
	  pBuf = pIcons->pBIG_Food_Surplus;
        }
      }
    }
    
  } else {
    /* without granary */
    /* stocks label */
    copy_chars_to_string16(pStr, _("Stock"));
    pBuf = create_text_surf_from_str16(pStr);

    dest.x = pWindow->size.x + adj_size(461) + (adj_size(144) - pBuf->w) / 2;
    dest.y = pWindow->size.y + adj_size(258) - pBuf->h - 1;

    alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
    FREESURFACE(pBuf);
    
    /* food stock */

    /* draw bcgd */
    dest.x = pWindow->size.x + adj_size(462);
    dest.y = pWindow->size.y + adj_size(260);
    dest.w = adj_size(144);
    dest.h = i + adj_size(4);

    SDL_FillRectAlpha(pWindow->dst->surface, &dest, get_game_colorRGB(COLOR_THEME_CITYDLG_FOODSTOCK));

    putframe(pWindow->dst->surface, dest.x - 1, dest.y - 1, dest.x + dest.w, dest.y + dest.h,
      map_rgba(pWindow->dst->surface->format, *get_game_colorRGB(COLOR_THEME_CITYDLG_FRAME)));

    /* draw icons */
    cost = city_granary_size(pCity->size);
    if (pCity->food_stock + pCity->surplus[O_FOOD] > cost) {
      count = cost;
    } else {
      if(pCity->surplus[O_FOOD] < 0) {
        count = pCity->food_stock;
      } else {
	count = pCity->food_stock + pCity->surplus[O_FOOD];
      }
    }
        
    if(pCity->surplus[O_FOOD] < 0) {
      limit = pCity->food_stock + pCity->surplus[O_FOOD];
      if(limit < 0) {
	limit = 0;
      }
    } else {
      limit = 0xffff;
    }
        
    dest.x += adj_size(2);
    dest.y += adj_size(2);
    i = 0;
    pBuf = pIcons->pBIG_Food;
    while (count) {
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += pBuf->w;
      count--;
      i++;
      if (dest.x > pWindow->size.x + adj_size(602)) {
	dest.x = pWindow->size.x + adj_size(464);
	dest.y += step;
      }
      if(i > limit - 1) {
	pBuf = pIcons->pBIG_Food_Corr;
      } else {
        if(i > pCity->food_stock - 1)
        {
	  pBuf = pIcons->pBIG_Food_Surplus;
        }
      }
  /* draw productions shields progress */
  if (VUT_UTYPE == pCity->production.kind) {
    struct unit_type *pUnitType = pCity->production.value.utype;
    cost = utype_build_shield_cost(pUnitType);
    count = cost / 10;
        
    copy_chars_to_string16(pStr, utype_name_translation(pUnitType));
    pBuf = create_text_surf_from_str16(pStr);
    
    pBuf2 = get_unittype_surface(pUnitType);
    pBuf2 = zoomSurface(pBuf2, DEFAULT_ZOOM * ((float)32 / pBuf2->h), DEFAULT_ZOOM * ((float)32 / pBuf2->h), 1);

    /* blit unit icon */
    dest.x = pWindow->size.x + adj_size(6) + (adj_size(185) - (pBuf->w + pBuf2->w + adj_size(5))) / 2;
    dest.y = pWindow->size.y + adj_size(233);
    
    alphablit(pBuf2, NULL, pWindow->dst->surface, &dest);

    dest.y += (pBuf2->h - pBuf->h) / 2;
    dest.x += pBuf2->w + adj_size(5);

  } else {
    struct impr_type *pImprove = pCity->production.value.building;

    if (improvement_has_flag(pImprove, IF_GOLD)) {

      if (pCityDlg->pBuy_Button
	 && get_wstate(pCityDlg->pBuy_Button) != FC_WS_DISABLED) {
	set_wstate(pCityDlg->pBuy_Button, FC_WS_DISABLED);
	widget_redraw(pCityDlg->pBuy_Button);
      }

      /* You can't see capitalization progres */
      count = 0;

    } else {

      if (city_can_buy(pCity) && pCityDlg->pBuy_Button
	 && (get_wstate(pCityDlg->pBuy_Button) == FC_WS_DISABLED)) {
	set_wstate(pCityDlg->pBuy_Button, FC_WS_NORMAL);
	widget_redraw(pCityDlg->pBuy_Button);
      }

      cost = impr_build_shield_cost(pImprove);
      count = cost / 10;
      
    }

    copy_chars_to_string16(pStr, improvement_name_translation(pImprove));
    pBuf = create_text_surf_from_str16(pStr);
    
    pBuf2 = get_building_surface(pCity->production.value.building);
    pBuf2 = zoomSurface(pBuf2, DEFAULT_ZOOM * ((float)32 / pBuf2->h), DEFAULT_ZOOM * ((float)32 / pBuf2->h), 1);

    /* blit impr icon */
    dest.x = pWindow->size.x + adj_size(6) + (adj_size(185) - (pBuf->w + pBuf2->w + adj_size(5))) / 2;
    dest.y = pWindow->size.y + adj_size(233);

    alphablit(pBuf2, NULL, pWindow->dst->surface, &dest);
    
    dest.y += (pBuf2->h - pBuf->h) / 2;
    dest.x += pBuf2->w + adj_size(5);
  }

  /* blit unit/impr name */
  alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

  FREESURFACE(pBuf);
  FREESURFACE(pBuf2);
  
  if (count) {
    if (count > 11) {
      step = (adj_size(154) - pIcons->pBIG_Shield->h) / adj_size((10 + count - 11));
      
      if(!step) step = 1;
      
      i = (step * (count - 1)) + pIcons->pBIG_Shield->h;
    } else {
      step = pIcons->pBIG_Shield->h;
      i = count * step;
    }
    
    /* draw sheild stock background */
    dest.x = pWindow->size.x + adj_size(28);
    dest.y = pWindow->size.y + adj_size(270);
    dest.w = adj_size(144);
    dest.h = i + adj_size(4);

    SDL_FillRectAlpha(pWindow->dst->surface, &dest, get_game_colorRGB(COLOR_THEME_CITYDLG_SHIELDSTOCK));
    putframe(pWindow->dst->surface, dest.x - 1, dest.y - 1, dest.x + dest.w, dest.y + dest.h,
      map_rgba(pWindow->dst->surface->format, *get_game_colorRGB(COLOR_THEME_CITYDLG_FRAME)));
    
    /* draw production progres text */
    dest.y = pWindow->size.y + adj_size(270) + dest.h + 1;
    
    if (pCity->shield_stock < cost) {
      count = city_production_turns_to_build(pCity, TRUE);
      if (count ==†  ƒÍT¦}E‡*€ƒh Oá}€†f rò^€œm Z/ƒ ƒ7€< ‚ž2„ E¸ €•S R‚Ò@„ E¸ º ²Z˜ ‚a³v€Y ‚F¼=¤ K–9€ˆ, MÇ?€“[ hü€’P Héx€’g ‚Sþb R‚Ò@¥ E¸ † o‚l€` R‚Ò@š E¸ €l R‚Ò@ V‚t¿ R‚Ò@ ‚K‚” €[ e‚—'€X S‚Ò? 1‚›2µ 999) {
        my_snprintf(cBuf, sizeof(cBuf), "(%d/%d) %s!",
		  		pCity->shield_stock, cost,  _("blocked"));
      } else {
        my_snprintf(cBuf, sizeof(cBuf), "(%d/%d) %d %s",
	    pCity->shield_stock, cost, count, PL_("turn", "turns", count));
     }
   } else {
     my_snprintf(cBuf, sizeof(cBuf), "(%d/%d) %s!",
		    		pCity->shield_stock, cost, _("finished"));
   }

    copy_chars_to_string16(pStr, cBuf);
    pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_LUX);
    adj_size(6) + (adj_size(185) - pBuf->w) / 2;

    alphablit(pBuf, NULL, pWindow->dst->surface, &dest);

    FREESTRING16(pStr);
    FREESURFACE(pBuf);
    
    /* draw sheild stock */
    if (pCity->shield_stock + pCity->surplus[O_SHIELD] <= cost) {
      count = pCity->shield_stock + pCity->surplus[O_SHIELD];
    } else {
      count = cost;
    }
    dest.x = pWindow->size.x + adj_size(29) + adj_size(2);
    dest.y = pWindow->size.y + adj_size(270) + adj_size(2);
    i = 0;
    
    pBuf = pIcons->pBIG_Shield;
    while (count > 0) {
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += pBuf->w;
      count--;
      if (dest.x > pWindow->size.x + adj_size(170)) {
	dest.x = pWindow->size.x + adj_size(31);
	dest.y += step;
      }
      i++;
      if(i > pCity->shield_stock - 1) {
	pBuf = pIcons->pBIG_Shield_Surplus;
      }
    }   
  }(pCity->feel[CITIZEN_HAPPY][FEELING_FINAL] + pCity->feel[CITIZEN_CONTENT][FEELING_FINAL]
	   + pCity->feel[CITIZEN_UNHAPPY][FEELING_FINAL] + pCity->feel[CITIZEN_ANGRY][FEELING_FINAL]
	   + pCity->specialists[SP_ELVIS] + pCity->specialists[SP_SCIENTIST]
	   + pCity->specialists[SP_TAXMAN]);

  pBuf = get_tax_surface(O_LUXURY);
  
  if (count > 13) {
    step = (adj_size(440) - pBuf->w) / (adj_size(12 + count - 13));
  } else {
    step = pBuf->w;
  }

  dest.x = pWindow->size.x + adj_size(198);
  dest.y = pWindow->size.y + pWindow->area.y + adj_size(1) + (adj_size(22) - pBuf->h) / 2;

  FREESURFACE(pBuf);
  
  if (pCity->feel[CITIZEN_HAPPY][FEELING_FINAL]) {
    for (i = 0; i < pCity->feel[CITIZEN_HAPPY][FEELING_FINAL]; i++) {
      pBuf = adj_surf(get_citizen_surface(CITIZEN_HAPPY, i));
      
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
      FREESURFACE(pBuf);
    }
  }

  if (pCity->feel[CITIZEN_CONTENT][FEELING_FINAL]) {
    for (i = 0; i < pCity->feel[CITIZEN_CONTENT][FEELING_FINAL]; i++) {
      pBuf = adj_surf(get_citizen_surface(CITIZEN_CONTENT, i));
      
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
      FREESURFACE(pBuf);
    }
  }

  if (pCity->feel[CITIZEN_UNHAPPY][FEELING_FINAL]) {
    for (i = 0; i < pCity->feel[CITIZEN_UNHAPPY][FEELING_FINAL]; i++) {
      pBuf = adj_surf(get_citizen_surface(CITIZEN_UNHAPPY, i));
      
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
      FREESURFACE(pBuf);
    }
  }

  if (pCity->feel[CITIZEN_ANGRY][FEELING_FINAL]) {
    for (i = 0; i < pCity->feel[CITIZEN_ANGRY][FEELING_FINAL]; i++) {
      pBuf = adj_surf(get_citizen_surface(CITIZEN_ANGRY, i));
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
      FREESURFACE(pBuf);
    }
  }
    
  pCityDlg->specs[0] = FALSE;
  pCityDlg->specs[1] = FALSE;
  pCityDlg->specs[2] = FALSE;
  
  if (pCity->specialists[SP_ELVIS]) {
    pBuf = get_tax_surface(O_LUXURY);
    
    pCityDlg->specs_area[0].x = pWindow->dst->dest_rect.x + dest.x;
    pCityDlg->specs_area[0].y = pWindow->dst->dest_rect.y + dest.y;
    pCityDlg->specs_area[0].w = pBuf->w;
    pCityDlg->specs_area[0].h = pBuf->h;
    for (i = 0; i < pCity->specialists[SP_ELVIS]; i++) {
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
      pCityDlg->specs_area[0].w += step;
    }
    FREESURFACE(pBuf);
    pCityDlg->specs_area[0].w -= step;
    pCityDlg->specs[0] = TRUE;
  }

  if (pCity->specialists[SP_TAXMAN]) {
    pBuf = get_tax_surface(O_GOLD);
    
    pCityDlg->specs_area[1].x = pWindow->dst->dest_rect.x + dest.x;
    pCityDlg->specs_area[1].y = pWindow->dst->dest_rect.y + dest.y;
    pCityDlg->specs_area[1].w = pBuf->w;
    pCityDlg->specs_area[1].h = pBuf->h;
    for (i = 0; i < pCity->specialists[SP_TAXMAN]; i++) {
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
      pCityDlg->specs_area[1].w += step;
    }
    FREESURFACE(pBuf);
    pCityDlg->specs_area[1].w -= step;
    pCityDlg->specs[1] = TRUE;
  }

  if (pCity->specialists[SP_SCIENTIST]) {
    pBuf = get_tax_surface(O_SCIENCE);
    
    pCityDlg->specs_area[2].x = pWindow->dst->dest_rect.x + dest.x;
    pCityDlg->specs_area[2].y = pWindow->dst->dest_rect.y + dest.y;
    pCityDlg->specs_area[2].w = pBuf->w;
    pCityDlg->specs_area[2].h = pBuf->h;
    for (i = 0; i < pCity->specialists[SP_SCIENTIST]; i++) {
      alphablit(pBuf, NULL, pWindow->dst->surface, &dest);
      dest.x += step;
      pCityDlg->specs_area[2].w += step;
    }
    FREESURFACE(pBuf);
    pCityDlg->specs_area[2].w -= step;
    pCityDlg->specs[2] = TRUEpag  
  /* redraw "sell improvement" dialog */
  redraw_group(pCityDlg->pBeginCityMenuWidgetList,
	       pCityDlg->pEndCityMenuWidgetList, 0);
 
  widget_mark_dirty(pWindow);
}

/* =========...
*****/
static void rebuild_imprm_list(struct city *pCity)
{
  int count = 0;
  struct widget *pWindow = pCityDlg->pEndCityWidgetList;
  struct widget *pAdd_Dock, *pBuf, *pLast;
  SDL_Surface *pLogo = NULL;
  SDL_String16 *pStr = NULL;
  struct player *pOwner = city_owner(pCity);
  int prev_y = 0;
    
  if(!pCityDlg->pImprv) {
    pCityDlg->pImprv = fc_calloc(1, sizeof(struct ADVANCED_DLG));
  }
  
  /* free old list */
  if (pCityDlg->pImprv->pEndWidgetList) {
    del_group_of_widgets_from_gui_list(pCityDlg->pImprv->pBeginWidgetList,
				       pCityDlg->pImprv->pEndWidgetList);
    pCityDlg->pImprv->pEndWidgetList = NULL;
    pCityDlg->pImprv->pBeginWidgetList = NULL;
    pCityDlg->pImprv->pEndActiveWidgetList = NULL;
    pCityDlg->pImprv->pBeginActiveWidgetList = NULL;
    pCityDlg->pImprv->pActiveWidgetList = NULL;
    FC_FREE(pCityDlg->pImprv->pScroll);
  } 
    
  pAdd_Dock = pCityDlg->pAdd_Point;
  pBuf = pLast = pAdd_Dock;
  
  /* allock new */
  city_built_iterate(pCity, pImprove) {

    pStr = create_str16_from_char(city_improvement_name_translation(pCity, pImprove), adj_font(10));
    pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_IMPR);

    pStr->style |= TTF_STYLE_BOLD;

    pLogo = get_building_surface(pImprove);
    pLogo = ResizeSurfaceBox(pLogo, adj_size(22), adj_size(22), 1, TRUE, TRUE);
    
    pBuf = create_iconlabel(pLogo, pWindow->dst, pStr,
			 (WF_FREE_THEME | WF_RESTORE_BACKGROUND));

    pBuf->size.x = pWindow->size.x + adj_size(450);
    pBuf->size.y = pWindow->size.y + adj_size(66) + prev_y;
    
    prev_y += pBuf->size.h;
    
    pBuf->size.w = adj_size(165);
    pBuf->action = sell_imprvm_dlg_callback;

    if (!pCityDlg->pCity->did_sell
        && !is_wonder(pImprove) && (pOwner == client.conn.playing)) {
      set_wstate(pBuf, FC_WS_NORMAL);
    }

    pBuf->ID = MAX_ID - improvement_number(pImprove) - 3000;
    DownAdd(pBuf, pAdd_Dock);
    pAdd_Dock = pBuf;
        
    count++;

    if (count > 7) {
      set_wflag(pBuf, WF_HIDDEN);
    }

  } city_built_iterate_end;

  if (count) {
    pCityDlg->pImprv->pEndWidgetList = pLast->prev;
    pCityDlg->pImprv->pEndActiveWidgetList = pCityDlg->pImprv->pEndWidgetList;
    pCityDlg->pImprv->pBeginWidgetList = pBuf;
    pCityDlg->pImprv->pBeginActiveWidgetList = pCityDlg->pImprv->pBeginWidgetList;

    if (count > 7) {
      pCityDlg->pImprv->pActiveWidgetList = pCityDlg->pImprv->pEndActiveWidgetList;
      
      create_vertical_scrollbar(pCityDlg->pImprv, 1, 7, TRUE, TRUE);
    
      setup_vertical_scrollbar_area(pCityDlg->pImprv->pScroll,
	                            pWindow->size.x + adj_size(635),
                                    pWindow->size.y + adj_size(66),
                                    adj_size(155), TRUE);
    }
  }...
*****/
static void rebuild_citydlg_title_str(struct widget
	      city_name(pCity)if (cma_is_city_under_agent(pCity, NULL)) {
    mystrlcat(cBuf, _(" - under Citizen Governor control."), sizeof(cBuf));
  }
  
  copy_chars_to_string16(pWindow->string16, cBuf);
}


/* ========================= Public)
{
  struct widget *pWindow = NULL,int cs;
  struct player *pOwner = city_owner(pCity);
  SDL_Rect area;
    
  if (pCityDlg) {
    return;
  }

  update_menus();

  pCityDlg = fc_calloc(1, sizeof(struct city_dialog));
  pCityDlg->pCity = pCity;
  pCityDlg->page = ARMY_PAGE;
  
  pStr = create_string16(NULL, 0, adj_font(12));
  pStr->style |= TTF_STYLE_BOLD;
  pWindow = create_window(NULL, pStr, adj_size(640), adj_size(480), 0);

  rebuild_citydlg_title_str(pWindow, pCity);

  pWindow->action = city_dlg_callback;
  set_wstate(pWindow, FC_WS_NORMAL);
 
  add_to_gui_list(ID_CITY_DLG_WINDOW, pWindow);

  pCityDlg->pEndCityWidgetList = pWindow;
  
  /* create window background */
  pLogo = theme_get_background(theme, BACKGROUND_CITYDLG);
  if (resize_window(pWindow, pLogo, NULL, adj_size(640), adj_size(480))) {
    FREESURFACE(pLogo);
  }

  pLogo = get_city_gfx();
  alphablit(pLogo, NULL, pWindow->theme, NULL);

  area = pWindow->area;
  
  widget_set_position(pWindow,
                      (Main.screen->w - pWindow->size.w) / 2,
                      (Main.screen->h - pWindow->size.h) / 2/* close dialog button */
  pBuf = create_themeicon(pTheme->Small_CANCEL_Icon, pWindow->dst,
			  (WF_WIDGET_HAS_INFO_LABEL |
			   WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("Close Dialog (Esc)"), adj_font(12));
  pBuf->action = exit_city_dlg_callback;
  pBuf->size.x = area.x + area.w - pBuf->size.w;
  pBuf->size.y = pWindow->size.y + adj_size(2);
  pBuf->key = SDLK_ESCAPE;
  set_wstate(pBuf, FC_WS_NORMAL);
  add_to_gui_list(ID_CITY_DLG_EXIT_BUTTON, pBuf);

  /* -------- */
  
  pBuf = create_themeicon(pTheme->Army_Icon, pWindow->dst,
                          (WF_WIDGET_HAS_INFO_LABEL |
                           WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("Present units"), adj_font(12));
  pBuf->action = army_city_dlg_callback;
  pBuf->size.x = area.x + adj_size(2) + ((adj_size(183) - 5 * pBuf->size.w) / 6);
  pBuf->size.y = area.y + adj_size(2);
  set_wstate(pBuf, FC_WS_NORMAL);
  add_to_gui_list(ID_CITY_DLG_ARMY_BUTTON, pBuf);
  /* -------- */
  
  pBuf = create_themeicon(pTheme->Support_Icon, pWindow->dst,
			  (WF_WIDGET_HAS_INFO_LABEL |
			   WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("Supported units"), adj_font(12));
  pBuf->action = supported_unit_city_dlg_callback;
  pBuf->size.x =
      area.x + adj_size(2) + 2 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + pBuf->size.w;
  pBuf->size.y = area.y + adj_size(2);

  set_wstate(pBuf, FC_WS_NORMAL);
  add_to_gui_list(ID_CITY_DLG_SUPPORT_BUTTON, pBuf);
  /* -------- */
  
  pBuf = create_themeicon(pTheme->Happy_Icon, pWindow->dst,
			  (WF_WIDGET_HAS_INFO_LABEL |
			   WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("Happiness"), adj_font(12));
  pBuf->action = happy_city_dlg_callback;
  pBuf->size.x =
      area.x + adj_size(2) + 3 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 2 * pBuf->size.w;
  pBuf->size.y = area.y + adj_size(2);
  set_wstate(pBuf, FC_WS_NORMAL);
  add_to_gui_list(ID_CITY_DLG_HAPPY_BUTTON, pBuf);
  /* -------- */
  
  pBuf = create_themeicon(pTheme->INFO_Icon, pWindow->dst,
			  (WF_WIDGET_HAS_INFO_LABEL |
			   WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("City info"), adj_font(12));
  pBuf->action = info_city_dlg_callback;
  pBuf->size.x =
      area.x + adj_size(4) + 4 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 3 * pBuf->size.w;
  pBuf->size.y = area.y + adj_size(2);
  set_wstate(pBuf, FC_WS_NORMAL);
  add_to_gui_list(ID_CITY_DLG_INFO_BUTTON, pBuf);

  pCityDlg->pAdd_Point = pBuf;  rebuild_imprm_list(pCity);
  /* ===================================================== */
  
  pLogo = get_scaled_city_map(pCity);

  pBuf = create_themelabel(pLogo, pWindow->dst, NULL,
                           pLogo->w, pLogo->h, WF_SELLECT_WITHOUT_BAR);

  pCityDlg->pResource_Map = pBuf;

  pBuf->action = resource_map_city_dlg_callback;
  if (!cma_is_city_under_agent(pCity, NULL) && (pOwner == client.conn.playing)) {
    set_wstate(pBuf, FC_WS_NORMAL);
  }
  pBuf->size.x = area.x + adj_size(193) + (adj_size(249) - pBuf->size.w) / 2;
  pBuf->size.y = area.y + adj_size(41) + (adj_size(158) - pBuf->size.h) / 2;
  add_to_gui_list(ID_CITY_DLG_RESOURCE_MAP, pBuf);  
  /* -------- */
  
  pBuf = create_themeicon(pTheme->Options_Icon, pWindow->dst,
                        (WF_WIDGET_HAS_INFO_LABEL |
                         WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("City options"), adj_font(12));
  pBuf->action = options_city_dlg_callback;
  pBuf->size.x =
    area.x + adj_size(4) + 5 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 4 * pBuf->size.w;
  pBuf->size.y = area.y + adj_size(2);
  if (pOwner == client.conn.playing) {
    set_wstate(pBuf, FC_WS_NORMAL);
  }
  add_to_gui_list(ID_CITY_DLG_OPTIONS_BUTTON, pBuf);
  /* -------- */

  pBuf = create_themeicon(pTheme->PROD_Icon, pWindow->dst,
                        (WF_WIDGET_HAS_INFO_LABEL |
                         WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("Change production"), adj_font(12));
  pBuf->action = change_prod_dlg_callback;
  pBuf->size.x = area.x + adj_size(7);
  pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5);
  if (pOwner == client.conn.playing) {
    set_wstate(pBuf, FC_WS_NORMAL);
  }
  pBuf->key = SDLK_c;
  add_to_gui_list(ID_CITY_DLG_CHANGE_PROD_BUTTON, pBuf);
  /* -------- */

  pBuf = create_themeicon(pTheme->Buy_PROD_Icon, pWindow->dst,
                        (WF_WIDGET_HAS_INFO_LABEL |
                         WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("Hurry production"), adj_font(12));
  pBuf->action = buy_prod_city_dlg_callback;
  pBuf->size.x = area.x + adj_size(7) + (pBuf->size.w + adj_size(2));
  pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5);
  pCityDlg->pBuy_Button = pBuf;
  pBuf->key = SDLK_h;
  if (city_can_buy(pCity)) {
    set_wstate(pBuf, FC_WS_NORMAL);
  }
  pBuf = create_themeicon(pTheme->CMA_Icon, pWindow->dst,
                        (WF_WIDGET_HAS_INFO_LABEL |
                         WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("Citizen Governor"), adj_font(12));
  pBuf->action = cma_city_dlg_callback;
  pBuf->key = SDLK_a;
  pBuf->size.x = area.x + adj_size(7) + (pBuf->size.w + adj_size(2)) * 2;
  pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5);
  if (pOwner == client.conn.playing) {
    set_wstate(pBuf, FC_WS_NORMAL);
  }
  add_to_gui_list(ID_CITY_DLG_CMA_BUTTON, pBuf);


  /* -------- */
  pBuf = create_themeicon(pTheme->L_ARROW_Icon, pWindow->dst,
                        (WF_WIDGET_HAS_INFO_LABEL |
                         WF_RESTORE_BACKGROUND));

  pBuf->string16 = create_str16_from_char(_("Previous city"), adj_font(12));
  pBuf->action = next_prev_city_dlg_callback;
  pBuf->size.x = area.x + adj_size(220) - pBuf->size.w - adj_size(8);
  pBuf->size.y = area.y + area.h - pBuf->size.h;
  if (pOwner == client.conn.playing) {
    set_wstate(pBuf, FC_WS_NORMAL);
  }
  pBuf->key = SDLK_LEFT;
  pBuf->mod = KMOD_LSHIFT;
  add_to_gui_list(ID_CITY_DLG_PREV_BUTTON, pBuf);
  /* -------- */
  
  pBuf = create_themeicon(pTheme->R_ARROW_Icon, pWindow->dst,
                        (WF_WIDGET_HAS_INFO_LABEL |
                         WF_RESTORE_BACKGROUND));
  pBuf->string16 = create_str16_from_char(_("Next city"), adj_font(12));
  pBuf->action = next_prev_city_dlg_callback;
  pBuf->size.x = area.x + adj_size(420) + adj_size(2);
  pBuf->size.y = area.y + area.h - pBuf->size.h;
  if (pOwner == client.conn.playing) {
    set_wstate(pBuf, FC_WS_NORMAL);
  }
  pBuf->key = SDLK_RIGHT;
  pBuf->mod = KMOD_LSHIFT;
  add_to_gui_list(ID_CITY_DLG_NEXT_BUTTON, pBuf);
  /* -------- */
  
  pBuf = create_edit_from_chars(NULL, pWindow->dst, city_name(pCity),
                              adj_font(10), adj_size(200), WF_RESTORE_BACKGROUND);
  pBuf->action = new_name_city_dlg_callback;
  pBuf->size.x = area.x + (area.w - pBuf->size.w) / 2;
  pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(2);
  if (pOwner == client.conn.playing) {
    set_wstate(pBuf, FC_WS_NORMAL);
  }

  pCityDlg->pCity_Name_Edit = pBuf;
  add_to_gui_list(ID_CITY_DLG_NAME_EDIT, pBuf);
  
  pCityDlg->pBeginCityWidgetList = pBuf;
  
  /* check if Citizen Icons style was loaded */
  cs = style_of_city(pCity);

  if (cs != pIcons  flush_dirty();Close the dialog for the given city.
*****/
    flush_dirty();
	  
    SDL_Client_Flags &= ~CF_CITY_STATUS_SPECIAL;
    update_menus();
  }Close all cities dialogs.
*****/
void popdown_all_city_dialogs(void)
{
  if (pCityDlg) {
    popdown_city_dialog(pCityDlg->pCity);
  }    redraw_city_dialog(pCityDlg->pCity);
    flush_dirty();
  }game_find_city_by_number(pUnit->homecity);
  struct city *pCity_pre = tile_city(pUnit->tilefree_city_units_lists();
    redraw_city_dialog(pCityDlg->pCity);
    flush_dirty();
  }  return (pCityDlg && (pCityDlg->pCity == pCity));
}
ENDREP
DELTA 15296 1142 283
SVN  …‚r…‡R•~ †k – †j¢ ‚_ˆ ‚ÞP‹% ‚F‚éq€ƒ S„×>€1 Uõ@€†3 R„×?… Z‚†| \‚ðv€w ›‚òf€‰C æ=ƒœ5/* common & utility *//* client */
#include "client_mainGtkWidget *menu
  gtk_tree_model_get(model, &iter, CL_COL_PLAYER_NUMBER, &player_no, -1);
  pplayer = valid_player_by_number(player_no);

  gtk_tree_model_get(model, &iter, CL_COL_CONN_ID, &conn_id, -1);
  pconn = find_conn_by_id(conn_id);

  menu = create_conn_menu(pplayer, pconn);
  gtk_menu_popup(GTK_MENU(menu), NULL, NULL,
                 NULL, NULL, event->button, 0);

  gtk_tree_path_free(path);
  return TRUEHelper function for adding columns to a tree view. If 'key' is not NULL
  then the added column is added to the object data of the treeview using
  g_object_set_data under 'key'void add_tree_col(GtkWidget *treeview, GType gtype,
                         const char *title, int colnum, const char *key)
{
  GtkTreeViewColumn *col;
  GtkCellRenderer *rend;
  const char *attr;

  if (gtype == G_TYPE_BOOLEAN) {
    rend = gtk_cell_renderer_toggle_new();
    attr = "active";
  } else if (gtype == GDK_TYPE_PIXBUF) {
    rend = gtk_cell_renderer_pixbuf_new();
    attr = "pixbuf";
  } else {
    rend = gtk_cell_renderer_text_new();
    attr = "text";
  }

  col = gtk_tree_view_column_new_with_attributes(title, rend, attr,
                                                 colnum, NULL);
  gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
  gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), col);

  if (key != NULL) {
    g_object_set_data(G_OBJECT(treeview), key, col);
  }creat  GtkWidget *view, *sw, *text, *entry, *button, *spin, *option;
  GtkWidget *label, *menu, *item;
  GtkTreeStore *store  /* NB: Must match order and type of enum
   * connection_list_columns in gui_main.h. */
  store = gtk_tree_store_new(CL_NUM_COLUMNS, G_TYPE_INT,
                             G_TYPE_STRING, G_TYPE_BOOLEAN,
                             G_TYPE_STRING, G_TYPE_STRING,
                             G_TYPE_STRING, G_TYPE_STRING,
                             G_TYPE_STRING, G_TYPE_INT);
  connection_list_store = store;

  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), TRUE);
  connection_list_view = GTK_TREE_VIEW(view);

  add_tree_col(view, G_TYPE_STRING, _("Name"),
               CL_COL_USER_NAME, NULL);
  add_tree_col(view, G_TYPE_STRING, _("Record"),
               CL_COL_GGZ_RECORD, "record_col");
  add_tree_col(view, G_TYPE_STRING, _("Rating"),
               CL_COL_GGZ_RATING, "rating_col");
  add_tree_col(view, G_TYPE_BOOLEAN, _("Ready"),
               CL_COL_READY_STATE, NULL);
  add_tree_col(view, G_TYPE_STRING, _("Leader"),
               CL_COL_PLAYER_NAME, NULL);
  add_tree_col(view, G_TYPE_STRING, _("Nation"),
               CL_COL_NATION, NULL);
  add_tree_col(view, G_TYPE_STRING, _("Team"),
               CL_COL_TEAM, NULLENDREP
DELTA 14777 22485 259
SVN  ôRôx} ‡	 – ‡€g ëpˆb/* common & utility *//* client */
#include "chatline_common.h"	/* send_chat() */ 
#include "cityrep.h"
#include "client_mainENDREP
DELTA 15266 128695 1254
SVN  óKóP …~ €U †8¾ òm‡j øOú|/* utility */
#include "fcintl.h"
#include "log.h"
#include "support.h"

/* common *//* client */
#include "citydlg_common.h"
#include "client_mainENDREP
DELTA 14427 82522 236
SVN  ÄÄ7u …j €u ½X†9/* common & utility */
#include "fcintl.h"
#include "game.h"
#include "support.h"

/* client */
#include "client_mainENDREP
DELTA 15074 6822 976
SVN  ‚—‚—;s †/ €s ‚‡/* common */
#include "government.h"
#include "improvement.h"
#include "tech.h"

/* client */
#include "client_mainENDREP
DELTA 14846 52497 7115
SVN  ƒ½%ƒÄ{‡x †< €U !†v€M Œ,ˆU‹ 5”n (– <£W‡ ›>¥€d …iÀµ ‚uÅ_€ ÄÈ2 ‡n² ¬K”i ƒÂ"€O …)Å€] ÃAÊ€M Ó‚(‘ 7‚àD †O‚îVž {‚ô­ ƒ!‚öµ d‚ùµ S‚ùj¨ Â‚û/* utility */
#include "astring.h"
#include "fcintl.h"
#include "log.h"

/* common *//* client */
#include "chatline.h"
#include "cityrep.h"
#include "client_mainCITY_OUTPUTCITY_TRADEROUTERULESETCITY_OUTPUT:
    if (draw_city_output ^ GTK_CHECK_MENU_ITEM(widget)->active) {
      key_city_output  menus_set_sensitive("<main>/_View/City _TraderoutesCITY_TRADEROUTES:
    if (draw_city_traderoutes ^ GTK_CHECK_MENU_ITEM(widget)->active) {
      key_city_traderoutes_toggle();
    }RULESET:
    popup_help_dialog_string(HELP_RULESETCity Output"), "<control>w",
    view_menu_callback, MENU_VIEW_SHOW_CITY_OUTPUT" N_("City _Traderoutes"),		"<control>t",
	view_menu_callback,	MENU_VIEW_SHOW_CITY_TRADEROUTEAbout Ruleset"),             NULL,
	help_menu_callback,	MENU_HELP_RULESET
   during_revolutionCity Output", draw_city_output
                        game.info.borders_sq  menus_set_sensitive("<main>/_View/City _Traderoutes  menus_set_sensitive("<main>/_View/City _TraderoutesCity _Traderoutes", draw_city_traderouteENDREP
DELTA 14427 126562 2871
SVN  ‚µG‚µV/ Š} Š „T‹¢ Š7qƒ ›š(lient_main          if (game.info.borders_sq_sqENDREP
DELTA 15307 29790 15721
SVN  Ð!Ó*~ †W – W†V¸ –wˆV® N?€A R¬<€A M@ ° /* common & utility *//* client */
#include "chatline.h"
#include "client_main  Entry point for whole freeciv client programint main(int argc, char **argv)
{
  return client_main(argc, argv  Entry point for GUI specific portion. Called from client_main()ENDREP
DELTA 4313 60849 6930
SVN  È:Èƒ_äe …f €ƒ Sˆ0€‚ ƒ6Œ9¬ j‘0€t y– Z—¶ QÜ=„ Bš@¾ RÜ=¬ Bš@ o›r€ QÜ=„ Bš@¨ d˜:€L 8” [Ÿ| x [„ Bš@€…R QÜ=„ Bš@€l QÜ=„ Bš@€†W QÜ> G¡T€‚  ¥2€’W KÑu€ƒT ƒ-¶X Uº“ ƒ»q¼ ƒx¿@€g KÄ6 ‚Å€~ È” É7” nÊl€‚U uÏL€‰o ‚NÛy› Þd Mßy€j Bá€‡7 RÜ= (èk€ƒo EÜ>· Aš@€‚1 ø; ÄFŒ l¶\ ‚
þ&€… K…>¤ [±t˜ K } >‰2 _‘:« Aš@ #- ‚DŽQ ‚f‘5€P ”k€U ƒ–€ RÜ=¤ Bš@ Z›p€„t FÜ=§ Aš@€J V‡l€_ Q€x W }¥ Bš@  d˜: `Ä?€ ‚G¶\€l 1º#˜ UËy€M ‚{¼w€ Á˜ 
Â;‡ ‚ÃN€yassert.h>

#include <gdk/gdkkeysyms.h>

/* common */
#include "events.h"
#include "fcintl.h"
#include "game.h"
#include "mem.h"
#include "support.h"

/* client */
#include "chatline_g.h"
#include "citydlg_g.h"
#include "client_main.h"
#include "cma_fec.h"
#include "messagewin_g.h"

#include "cityrep.h"
#include "dialogs.h"
#include "gui_stuff.h"
#include "helpdlg.h"
#include "inputdlgdialog
#define SPECLIST_TYPE struct cma_dialog
#include "speclist.h"

#define dialog_list_iterate(dialoglist, pdialog) \
    TYPED_LIST_ITERATE(struct cma_dialog, dialoglist, pdialog)
#define dialog_list_iterate_end  LIST_ITERATE_END

static struct dialog_list *dialog_listresponse(GtkWidget *w, gint response,
				  void cma_preset_add_callback_destroy(GtkWidget *w, gpointer data);

static void cma_active_callback(GtkWidget *w, gpointer data);
static void cma_activate_preset_callback(GtkTreeView *view, GtkTreePath *path,
				         GtkTreeViewColumn *colvoid cma_fe_init()
{
  dialog_list = dialog_list_new()...
********/
void cma_fe_done()
{
  dialog_list_free(dialog_list)only called when the city dialog is closed.
if (pdialog == NULL) {
    /* A city which is being investigated doesn't contain cma dialog */
    return;
  }
  gtk_widget_destroy(pdialog->shell)...
********/
static void cma_dialog_destroy
  g_object_unref(pdialog->tips);

  dialog_list_unlink(dialog_list, pdialogdialog_list_iterate(...
********/
static gboolean button_press_callback(GtkTreeView *view, GdkEventButton *ev,
				      gpointer data)
{
  GtkTreePath *path;
  GtkTreeViewColumn *column;

  if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(view),
	ev->x, ev->y, &path, &column, NULL, NULL)) {
    if (ev->type == GDK_BUTTON_PRESS) {
      cma_activate_preset_callback(view, path, column, data);
    } else if (ev->type == GDK_2BUTTON_PRESS) {
      struct cma_dialog *pdialog = (struct cma_dialog *) data;
      struct cm_parameter param;

      cmafec_get_fe_parameter(pdialog->pcity, &param);
      cma_put_city_under_agent(pdialog->pcity, &param);
      refresh_city_dialog(pdialog->pcity);
    }
  }
  gtk_tree_path_free(path);

  return FALSE...
********/
static void help_callback(GtkWidget *w, gpointer data)
{
  popup_help_dialog_string(HELP_CMA_ITEM)...
********/
static void cell_data_func(GtkTreeViewColumn *col, GtkCellRenderer *cell,
			   GtkTreeModel *model, GtkTreeIter *it, gpointer data)
{
  struct cma_dialog *pdialog = (struct cma_dialog *) data;
  const char *s1, *s2;
  int i1, i2;
  struct cm_parameter param;
  GtkTreePath *path;

  gtk_tree_model_get(model, it, 0, &s1, -1); 
  path = gtk_tree_model_get_path(model, it);
  i1 = gtk_tree_path_get_indices(path) [0];
  gtk_tree_path_free(path);

  cmafec_get_fe_parameter(pdialog->pcity, &param);
  s2 = cmafec_get_short_descr(&param);
  i2 = cmafec_preset_get_index_of_parameter(&param);

  if (!strcmp(s1, s2) && i1 == i2) {
    g_object_set(G_OBJECT(cell), "style", PANGO_STYLE_ITALIC,
		 "weight", PANGO_WEIGHT_BOLD, NULL);
  } else {
    g_object_set(G_OBJECT(cell), "style", PANGO_STYLE_NORMAL,
		 "weight", PANGO_WEIGHT_NORMAL, NULL);
  })
{
  struct cma_dialog *pdialog;
  struct cm_parameter param;
  GtkWidget *frame, *page, *hbox, *label, *table;
  GtkWidget *vbox, *sw, *hscale, *button, *align;
  GtkListStore *store;
  GtkCellRenderer *rend;
  GtkWidget *view;
  GtkTreeViewColumn *column8);
  gtk_container_set_border_width(GTK_CONTAINER(pdialog->shell), 8);
  g_signal_connect(pdialog->shell, "destroy",
		   G_CALLBACK(cma_dialog_destroy_callback), pdialog);

  pdialog->tips = gtk_tooltips_new();
  g_object_ref(pdialog->tips);
  gtk_object_sink(GTK_OBJECT(pdialog->tips));

  page = gtk_hbox_new(FALSE, 12);
  gtk_box_pack_start(GTK_BOX(pdialog->shell), page, TRUE, TRUE, 0);

  vbox = gtk_vbox_new(FALSE, 2);
  gtk_box_pack_start(GTK_BOX(page), vbox, TRUE, TRUE, 0);

  sw = gtk_scrolled_window_new(NULL, NULL);
  gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
				      GTK_SHADOW_ETCHED_IN);
  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
				 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);

  store = gtk_list_store_new(1, G_TYPE_STRING);
  pdialog->store = store;

  view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
  g_object_unref(store);
  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), FALSE);
  pdialog->preset_list = view;
  pdialog->selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));

  g_signal_connect(pdialog->preset_list, "button_press_event",
      		   G_CALLBACK(button_press_callback), pdialog);

  gtk_tooltips_set_tip(pdialog->tips, view,
		       _("For information on\n"
		         "the citizen governor and governor presets,\n"
			 "including sample presets,\n"
		         "see README.cma."),
		       "");

  rend = gtk_cell_renderer_text_new();
  column = gtk_tree_view_column_new_with_attributes(NULL, rend,
      "text", 0, NULL);
  gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
  gtk_tree_view_column_set_cell_data_func(column, rend, cell_data_func,
      pdialog, NULL);

  label = g_object_new(GTK_TYPE_LABEL,
                       "use-underline", TRUE,
                       "mnemonic-widget", view,
                       "label", _("_Presets:"),
                       "xalign", 0.0, "yalign", 0.5, NULL);
  gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);

  gtk_container_add(GTK_CONTAINER(sw), view);
  gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);

  g_signal_connect(view, "row_activated",
		   G_CALLBACK(cma_activate_preset_callback), pdialog);
  g_signal_connect(view, "key-press-event",
		   G_CALLBACK(cma_preset_key_pressed_callback), pdialog);

  hbox = gtk_hbutton_box_new();
  gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_EDGEadd_preset_command = gtk_button_new_from_stock(GTK_STOCK_NEW);
  gtk_container_add(GTK_CONTAINER(hbox), pdialog->add_preset_command);
  g_signal_connect(pdialog->add_preset_command, "clicked",
		   G_CALLBACK(cma_add_preset_callback), pdialog);

  pdialog->del_preset_command = gtk_button_new_from_stock(GTK_STOCK_DELETE);
  gtk_container_add(GTK_CONTAINER(hbox), pdialog->del_preset_command);
  g_signal_connect(pdialog->del_preset_command, "clicked",
		   G_CALLBACK_O_COUNT + 2, 3, TRUoutput_type_iterate(i) {
    label = gtk_label_new(get_outpu_signal_connect(pdialog->minimal_surplus[i],
		     "value_changed",
		     G_CALLBACK(hscale_changed),0_signal_connect(pdialog->factor[i], "value_changed",
		     G_CALLBACK(hscale_changed), pdialog);
  } output_type_iterate_end;O_COUNT + 1, O_COUNTO_COUNT + 1, O_COUNT_signal_connect(pdialog->happy_button, "toggled",
		   G_CALLBACK(hscale_changed), pdialog);

  pdialog->factor[O_COUNT] =
      GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, 50, 1, 0, 0));

  hscale = gtk_hscale_new(GTK_ADJUSTMENT(pdialog->factor[O_COUNT]));
  gtk_table_attach_defaults(GTK_TABLE(table), hscale, 2, 3,
			    O_COUNT + 1, O_COUNT_signal_connect(pdialog->factor[O_COUNT],
		   "value_changed",
		   G_CALLBACK(hscale_changed), pdialog);

  /* buttons */

  hbox = gtk_hbutton_box_new();
  gtk_button_box_set_layout(GTK_BUTTON_BOX(hbox), GTK_BUTTONBOX_EDGE);
  gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);

  button = gtk_button_new_from_stock(GTK_STOCK_HELP);
  g_signal_connect(button, "clicked",
		   G_CALLBACK(help_callback), NULL);
  gtk_container_add(GTK_CONTAINER(hbox), button);

  pdialog->active_command = gtk_toggle_button_new();
  gtk_container_add(GTK_CONTAINER(hbox), pdialog->active_command);

  align = gtk_alignment_new(0.5, 0.5, 0.0, 0.0);
  gtk_container_add(GTK_CONTAINER(pdialog->active_command), align);

  vbox = gtk_vbox_new(FALSE, 2);
  gtk_container_add(GTK_CONTAINER(align), vbox);

  pdialog->active_image = gtk_image_new();
  gtk_box_pack_start(GTK_BOX(vbox), pdialog->active_image, FALSE, FALSE, 0);

  pdialog->active_label = gtk_label_new(NULL);
  gtk_widget_set_name(pdialog->active_label, "comment_label");
  gtk_box_pack_end(GTK_BOX(vbox), pdialog->active_label, FALSE, FALSE, 0);

  gtk_widget_show_all(pdialog->shell);

  dialog_list_prepend(dialog_list, pdialog);

  update_cma_preset_list(pdialog);

  gtk_tree_view_focus(GTK_TREE_VIEW(view)_result result;
  struct cm_result_from_main_map(&result, pcity, TRUE);
  gtk_label_set_text(GTK_LABEL(pdialog->result_label),
		    gtk_widget_queue_draw(pdialog->preset_list);

  gtk_widget_set_sensitive(pdialog->active_command, can_client_issue_orders());

  g_signal_handlers_disconnect_matched(pdialog->active_command,
      G_SIGNAL_MATCH_FUNC,
      0, 0, NULL, cma_active_callback, NULL);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(pdialog->active_command),
      controlled);
  g_signal_connect(pdialog->active_command, "clicked",
      G_CALLBACK(cma_active_callback), pdialog);

  if (controlled) {
    gtk_image_set_from_stock(GTK_IMAGE(pdialog->active_image),
	GTK_STOCK_YES, GTK_ICON_SIZE_DND);
    gtk_label_set_text_with_mnemonic(GTK_LABEL(pdialog->active_label),
	_("Governor Enabl_ed"));
  } else {
    gtk_image_set_from_stock(GTK_IMAGE(pdialog->active_image),
	GTK_STOCK_NO, GTK_ICON_SIZE_DND);
    gtk_label_set_text_with_mnemonic(GTK_LABEL(pdialog->active_label),
	_("Governor Disabl_ed"));
  }
  gtk_widget_set_sensitive(pdialog->result_label, controlled)char buf[BUFFER_SIZE];
  GtkTreeIter it;
  int i;

  /* Fill preset list */
  gtk_list_store_clear(pdialog->store);

  /* Append the presets */
  if (cmafec_preset_num()) {
    gtk_tooltips_disable(pdialog->tips);

    for (i = 0; i < cmafec_preset_num(); i++) {
      mystrlcpy(buf, cmafec_preset_get_descr(i), sizeof(buf));
      gtk_list_store_append(pdialog->store, &it);
      gtk_list_store_set(pdialog->store, &it, 0, buf, -1);
    }
  } else {
    gtk_tooltips_enable(pdialog->tips);
  }
 callback for selecting a preset from the preset view
/
static void cma_activate_preset_callback(GtkTreeView *view, GtkTreePath *path,
				         GtkTreeViewColumn *col, gpointer data)
{
  struct cma_dialog *pdialog = (struct cma_dialog *) data;
  int preset_index;
  const struct cm_parameter *pparam;

  preset_index = gtk_tree_path_get_indices(path) [0];pparam);
  }const char *default_name;
  GtkWidget *parent = gtk_widget_get_toplevel(pdialog->shell);
  int index;

  if ((index = gtk_tree_selection_get_row(pdialog->selection)) != -1) {
    default_name = cmafec_preset_get_descr(index);
  } else {
    default_name = _("new preset");
  }

  pdialog->name_shell = input_dialog_create(GTK_WINDOW(parent),
				    _("Name new preset"),
				    _("What should we name the preset?"),
				    default_name,
				    G_CALLBACK(cma_preset_add_callback_yes),
				    pdialog,
				    G_CALLBACK(cma_preset_add_callback_no),
				    pdialog);

  g_signal_connect(pdialog->name_shell, "destroy",
		   G_CALLBACK(cma_preset_add_callback_destroyvoid cma_preset_add_callback_destroy
  pdialog->name_shell =callback for the add_preset popup (add it)
int index;

  if ((index = gtk_tree_selection_get_row(pdialog->selection)) == -1index);
      break;
    case GDK_Insert:
      cma_add_preset_callback(NULL, pdialogint index;

  if ((index = gtk_tree_selection_get_row(pdialog->selection)) == -1) {
    return;
  }

  cma_preset_remove(pdialog, index)pops up a dialog to remove a preset
GtkWidget *parent = gtk_widget_get_toplevel(pdialog->shell), *shl;

  pdialog->id = preset_index;
  shl = gtk_message_dialog_new(NULL,
			       GTK_DIALOG_DESTROY_WITH_PARENT,
			       GTK_MESSAGE_QUESTION,
			       GTK_BUTTONS_YES_NO,
			       _("Remove this preset?"));
  setup_dialog(shl, parent);
  pdialog->preset_remove_shell = shl;

  gtk_window_set_title(GTK_WINDOW(shl), cmafec_preset_get_descr(preset_index));
  gtk_window_set_position(GTK_WINDOW(shl), GTK_WIN_POS_CENTER_ON_PARENT);

  g_signal_connect(shl, "response",
		   G_CALLBACK(cma_preset_remove_response), pdialog);

  gtk_window_present(GTK_WINDOW(shl))
 callback for the remove_preset popup
/
static void cma_preset_remove_response(GtkWidget *w, gint response,
				if (response == GTK_RESPONSE_YES) {
    cmafec_preset_remove(pdialog->id);
    pdialog->id = -1, reset to "custom" */
    city_report_dialog_update();
  }
  gtk_widget_destroy(w);
  
  pdialog->preset_remove_shell =activates/deactivates agent control.
********/
static void cma_active} else {
    struct cm_parameter param;

    cmafec_get_fe_parameter(pdialog->pcity, &param);
    cma_put_city_under_agent(pdialog->pcity, &param);
  }_parameter *const parameter,
			struct cma_dialog *pdialog)
{
  allow_refreshes = 0;
  output_type_iterate(i output_type_iterate_endparameter->require_happy);
  gtk_adjustment_set_value(pdialog->factor[O_COUNT_parameter param;

  if (!allow_refreshes) {
    return;
  }

  cmafec_get_fe_parameter(pdialog->pcity, &param);
  output_type_iterate(i output_type_iterate_endO_COUNT    refresh_city_dialog(pdialog->pcity);
  } else {
    refresh_cma_dialog(pdialog->pcity, DONT_REFRESH_HSCALES);
  }
}

ENDREP
DELTA 14427 129459 1198
SVN  ý;ÿ‚% …e €B ƒ†
  Ÿ ‰€C Õ¨7/* utility */
#include "log.h"

/* client */
#include "client_main,
	     [OLAYER_BORDERS_ON_OCEANif (overview.layers[OLAYER_BORDERS_ON_OCEAN]) {
        return get_player_color(tileset, owner);
      } else if (!is_ocean_tile(ptile)) {
        return get_player_color(tileset, owner);
      }ENDREP
DELTA 1865 12465 105
SVN  m™9™9€™9/********************************************************************** 
 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
***********************************************************************/

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <errno.h>

/* utility */
#include "fcintl.h"
#include "log.h"
#include "support.h"

#include "connectdlg_g.h"

/* client */
#include "chatline_common.h"	/* for append_output_window */
#include "client_main.h"
#include "connectdlg.h"
#include "packhand_gen.h"

/**************************************************************************
 Really close and destroy the dialog.
**************************************************************************/
void really_close_connection_dialog(void)
{
  /* PORTME */
}

/**************************************************************************
 Close and destroy the dialog. But only if we don't have a local
 server running (that we started).
**************************************************************************/
void close_connection_dialog()
{
  /* PORTME */
}

/**************************************************************************
 Configure the dialog depending on what type of authentication request the
 server is making.
**************************************************************************/
void handle_authentication_req(enum authentication_type type, char *message)
{
  switch (type) {
  case AUTH_NEWUSER_FIRST:
     /* PORTME: switch configs if need be */
    break;
  case AUTH_NEWUSER_RETRY:
     /* PORTME: switch configs if need be */
    break;
  case AUTH_LOGIN_FIRST:
    /* if we magically have a password already present in 'password'
     * then, use that and skip the password entry dialog */
    if (password[0] != '\0') {
      struct packet_authentication_reply reply;

      sz_strlcpy(reply.password, password);
      send_packet_authentication_reply(&client.conn, &reply);
      return;
    } else {
     /* PORTME: switch configs if need be */
    }
    break;
  case AUTH_LOGIN_RETRY:
     /* PORTME: switch configs if need be */
    break;
  default:
    assert(0);
  }

  /* PORTME etc. */
}

/**************************************************************************
 Provide a packet handler for packet_game_load.

 This regenerates the player information from a loaded game on the
 server.
**************************************************************************/
void handle_game_load(struct packet_game_load *packet)
{ 
  /* PORTME */
}


/**************************************************************************
  Provide an interface for connecting to a FreeCiv server.
**************************************************************************/
void gui_server_connect(void)
{
  /* PORTME */
}
ENDREP
DELTA 14209 90907 8545
SVN  òQóJ,…h ‰ § ‰$€M ª6Šp² 6µ5“ …Y¶z‰ v¼[ ï½Z€ „ ­v€G «? ƒE´@Š …V¸Š VÂv† H«? ZÎ@† I¡= QØ> BÁ*Š „IÂvŠ VÂv‘ H«? ƒ]ÈxŠ OÂv‡ H«? ‹@Í}Š ƒFÙGŠ „_Ý¤ ‹$âŠ …í4/* common & utility */
#include "fcintl/* client */
#include "chatline.h"
#include "client_main.h"
#include "climiscNULL == client.conn.playing || client.conn.playingclient.conn.playingreachablePREREQS_KNOWNplayer_by_number(giver) == client.conn.playing) {
    other = dest;
  } else {
    other = giver;
  }

  dsend_packet_diplomacy_create_clause_req(&client.conplayer_by_number(giver) == client.conn.playing) {
    other = dest;
  } else {
    other = giver;
  }

  dsend_packet_diplomacy_create_clause_req(&client.conn, other, giver,
					   CLAUSE_CITY, cityclient.conclient.conMAP, 0  Callback for trading seamapseamapclient.conclient.conVISION,
					   0client.contype, 0client.conclient.conclient.conn.playing;
  struct playerclient.conENDREP
DELTA 14777 0 308
SVN  ².²0
 ‰\ Š ¨J‰dlient_mainENDREP
DELTA 15161 171 3984
SVN  …Ëo…Ñ9&ƒV …  L…~€+ œf‡Y… ¶e¤I… üÛ8‚ RŽ  EƒŒ@ r‚Øe‚ RŽ  ”]‚Û2‚ Uƒ™? „}‚ðm‚ Vƒ™? EƒŒ@ ¶5‚÷ fƒš@‰ IƒÂ ƒ»‡ aƒš@† EƒÀ>‡ ƒ»‰ bƒš@ˆ DƒÀ? þBƒ±<€~ S‚ß €C .…¿  ›…°W/* utility *//* common */
#include "game.h"
#include "map.h"
#include "movement.h"

/* client */
#include "audio.h"
#include "chatline_g.h"
#include "citydlg_g.h"
#include "client_mainclearclear-1-1-1-1city traderoutestraderouty_traderoutesterrainterraiterraincoastlineoastline  Handle client request to toggle drawing of traderoute information
  by the city name for cities visible on the main map viewkey_city_traderoutes_toggle(void)
{
  request_toggle_city_traderoutENDREP
DELTA 14427 4153 191
SVN  ÄÄ0z ‡" €z ¼‡r/* utility */
#include "fcintl.h"
#include "support.h"

/* common */
#include "game.h"

/* client */
#include "client_mainENDREP
DELTA 14417 119654 462
SVN  ‹-‹X< ‡ – ‡¢ úˆA„ ˆS‚Z/* common & utility *//* client */
#include "client_mainconnENDREP
DELTA 14777 2156 354
SVN  †  †  
 Š Š †•cŠlient_main†  ¾a¾c‚ ¾a = ENDREP
DELTA 15374 0 2046
SVN  ƒ¤oƒ¥" †l Œ 
†kŒ W‡tŠ ƒœˆS/* common *//* client */lient_mainENDREP
DELTA 14427 84459 1390
SVN  €P€v8 ‡V –  ‡U¢ ÷hˆh/* common & utility *//* client */
#include "client_mainENDREP
DELTA 13000 61840 26814
SVN  ‚ª/‚Û„bèq † €‚ ƒn‡d€ †FŒG …>“€q J™P€„: ?Ÿ0€‚ ‚£.€ƒW K¨U» ªR€„/ K­>€…+ b³8€I R´Q™ ¶/€- t·8Ž ‚¸,€…l O¿J€H ÁK€ eÃ3° †RÅ>» jÌ<€„ i@ž Hû  ßx‘ bá sâu€j ƒRå*¼ ~éU€L „Oê 0ïv› qñ6€G xò]“ ˆbóX€R yý“ †5ÿ€[ =†€0 ˆ"‰› W‘<“ a’"€‡N ƒs–:› Rš<“ ›€d ^œk“ X€Z „  A€ rª>‰ @«8 I¬y ¨Aª ƒ-©e V­€ƒn „l°N‘ BµF€‚Y h·l ‚¸_€} »Y€# R½oµ ¾j€‚ ‹!Áp¨ VÍ0€, …?Ï“ ƒpÔm€t nÙ@€g rª2 Œ6Ü¢ Hû  /ê€y pª: £gí€C „t‚‘6€‚X ‚‚™. ‚›=€ \×< ~‚ž$€| q‚ xž fª> ‚¢j€ \×< x‚¥M€~ p‚ yŸ fª>• t‚¢y€ƒ  E×<€…{ fª>€l Hû €6 E×<€†R jª:’ s‚¢z° [×9€e/* utility */
#include "astring.h"
#include "fcintl.h"
#include "log.h"
#include "support.h"

/* common */
#include "combat.h"
#include "game.h"
#include "government.h"
#include "map.h"
#include "unitlist.h"

/* client */
#include "client_main.h"
#include "climap.h"
#include "climisccity_tile_output(NULL, ptile, FALSE, i);

    if (NULL != client.conn.playing) {
      before_penalty = get_player_output_bonus(client.conn.playingtile_city(ptile)TILE_XY(ptile),
		tile_continent(ptile)); 
#endif /*DEBUG*/

  if (client_tile_get_known(ptile) == TILE_UNKNOWN) {
    astr_add(&str, _("Unknown"));
    return str.str;
  }
  astr_add_line(&str, _("Terrain: %s"),  tile_get_info_text(ptile, 0_sq > 0 && !pcity) {
    struct player *owner = tile_owner(ptile);

    if (NULL != client.conn.playing && owner == client.conn.playing) {
      astr_add_line(&str, _("Our territory"));
    } else if (NULL != owner && NULL == client.conn.playing) {
      /* TRANS: "Polish territory" */
      astr_add_line(&str, _("%s territory"),
		    nation_adjective_for_player(owner));
    } else if (NULL != owner) {
      struct player_diplstate *ds = client.conn.playing->diplstates;

      if (ds[player_index(owner)].type == DS_CEASEFIRE) {
	int turns = ds[player_index(owner)nation_adjective_for_player(owner),
		      turns);
      } else {
	int type = ds[player_index(owner)].type;

	/* TRANS: "Polish territory (friendly)" */
	astr_add_line(&str, _("%s territory (%s)"),
		      nation_adjective_for_player(owner),
		      diplo_nation_plural_adjectives[type]int has_improvements = 0;
    struct impr_type *prev_impr = NULL;

    if (NULL == client.conn.playing || owner == client.conn.playing) {
      /* TRANS: "City: Warsaw (Polish)" */
      astr_add_line(&str, _("City: %s (%s)"), 
		    city_name(pcity),
		    nation_adjective_for_player(owner));
    } else {
      struct player_diplstate *ds = client.conn.playing->diplstates;

      if (ds[player_index(owner)].type == DS_CEASEFIRE) {
	int turns = ds[player_index(owner)city_name(pcity),
		      nation_adjective_for_player(owner
		      city_name(pcity),
		      nation_adjective_for_player(owner),
		      diplo_city_adjectives[ds[player_index(owner)].type]);
      }
    }
    improvement_iterate(pimprove) {
      if (is_improvement_visible(pimprove)
       && city_has_building(pcity, pimprove)) {
        if (has_improvements++ > 1) {
          /* TRANS: continue list, in case comma is not the separator of choice. */
          astr_add(&str, Q_("?clistmore:, %s"),
                   improvement_name_translation(prev_impr));
        } else if (has_improvements == 1) {
            astr_add(&str, Q_("?clistbegin: with %s"),
                   improvement_name_translation(pimprove));
        }
        prev_impr = pimprove;
      }
    } improvement_iterate_end;

    if (NULL != prev_impr) {
      if (has_improvements > 2) {
        /* TRANS: This appears with two or more previous entries in the list */
        astr_add(&str, Q_("?clistlast:, and %s"),
		 improvement_name_translation(prev_impr));
      } else if (has_improvements > 1) {
        /* TRANS: This appears with only one previous entry in the list */
        astr_add(&str, Q_("?clistlast: and %s"),
		 improvement_name_translation(prev_impr));
      }
      astr_add(&str, "%s", Q_("?clistend:.game_find_city_by_number(pfocus_unit->homecity);

      if (unit_has_typecity_name(hcity),
		     == 0) {
    base_type_iterate(pbase) {
      if (BV_ISSET(ptile->bases, base_index(pbase))) {
        infracount = 1;
        break;
      }
    } base_type_iterate_end;
  }, ptile->basesNULL == client.conn.playing || owner == client.conn.playing) {
      struct city *pcity = player_find_city_by_id(owner, punit->homecity);

      if (pcity) {
	/* TRANS: "Unit: Musketeers (Polish, Warsaw)" */
	astr_add_line(&str, _("Unit: %s (%s, %s)"),
		      utype_name_translation(ptype),
		      nation_adjective_for_player(owner),
		      city_name(pcity));
      } else {
	/* TRANS: "Unit: Musketeers (Polish)" */
	astr_add_line(&str, _("Unit: %s (%s)"),
		      utype_name_translation(ptype),
		      nation_adjective_for_player(owner));
      }
    } else if (NULL != owner) {
      struct player_diplstate *ds = client.conn.playing->diplstates;

      if (ds[player_index(owner)].type == DS_CEASEFIRE) {
	int turns = ds[player_index(owner)utype_name_translation(ptype),
		      nation_adjective_for_player(owner
		      utype_name_translation(ptype),
		      nation_adjective_for_player(owner),
		      diplo_city_adjectives[ds[player_index(owner)unit_owner(tile_unit) != unit_owner(pfocus_unit)NULL == client.conn.playing || owner == client.conn.playing
                 /* TRANS: on own line immediately following \n, ... <city> */
                 ? _("far from %s")
                 : (sq_dist > 0)
                   /* TRANS: on own line immediately following \n, ... <city> */
                   ? _("near %s")
                   : (sq_dist == 0)
                     /* TRANS: on own line immediately following \n, ... <city> */
                     ? _("in %s")
                     : "%s",
                 pcity
                 ? city_name(pcity)
                 : ""Returns the unit description.
unit_owner(punit)utype_name_translation(ptype)on own line immediately following \n, ... <city> */
    astr_add_line(&str, _("from %s"), city_name(pcity)int ours = 0, theirs = 0;

  if (NULL == client.conn.playingclient.conn.playing, pplayer)->type;

    if (pplayer == client.conn.playingNULL == client.conn.playing
  if (A_UNSET == get_player_research(client.conn.playing)->researchingclient.conn.playingclient.conn.playing);
  static struct astring str = ASTRING_INIT;

  if (!researchclient.conn.playingclient.conn.playing, goal);
  int bulbs = total_bulbs_required_for_goal(client.conn.playingclient.conn.playing);
  static struct astring str = ASTRING_INIT;

  if (!research) {
    return "-";
  }

  astr_clear(&str);

  if (is_tech_a_req_for_goal(client.conn.playingNULL != client.conn.playingclient.conn.playing
  if (NULL != client.conn.playing) {
    astr_add_line(&str, _("Gold: %d (%+d)"),
		  client.conn.playing->economic.gold,
		  player_get_expected_income(client.conn.playing));
    astr_add_line(&str, _("Tax: %d Lux: %d Sci: %d"),
		  client.conn.playing->economic.tax,
		  client.conn.playing->economic.luxury,
		  client.conn.playing->economic.science);
  }
  if (game.info.phase_mode == PMT_PLAYERS_ALTERNATE) {
    if (game.info.phase < 0 || game.info.phase >= player_count()) {
      astr_add_line(&str, _("Moving: Nobody"));
    } else {
      astr_add_line(&str, _("Moving: %s"),
                    player_name(player_by_number(game.info.phase)));
    }
  } else if (game.info.phase_mode == PMT_TEAMS_ALTERNATE) {
    if (game.info.phase < 0 || game.info.phase >= team_count()) {
      astr_add_line(&str, _("Moving: Nobody"));
    } else {
      astr_add_line(&str, _("Moving: %s"),
                    team_name_translation(team_by_number(game.info.phase)));
    }NULL != client.conn.playingclient.conn.playing
  if (NULL != client.conn.playing) {
    astr_add_line(&str, _("Gold: %d"),
		  client.conn.playingclient.conn.playingclient.conn.playing->economic.tax,
		  client.conn.playing->economic.luxury,
		  client.conn.playing->economic.science);
    astr_add_line(&str, _("Researching %s: %s"),
		  advance_name_researching(client.conn.playingNULL != client.conn.playing) {
    astr_add_line(&str, _("Government: %s"),
		  government_name_for_player(client.conn.playing));
  }
itle text1name_translation(unit_list_get(punits, 0)), int linebreak if
   * 'linebreaks' has no flags at all. Otherwise the GUI widgets may be
   * confused and try to resize themselves. If caller asks for
   * conditional 'linebreaks', it should take care of these problems
   * itself. */

  /* Line 1. Goto or activity text. */
  if (count > 0 && hover_state != HOVER_NONE) {
    int min, max;

    if (!goto_get_turns(&min, &max)) {
      /* TRANS: Impossible to reach goto target tile */
      astr_add_line(&str, "%s", Q_("?goto:Unreachable"));
    } elseunit_owner(punit), linebreaks));
    if (infracount == 0) {
      base_type_iterate(pbase) {
        if (BV_ISSET(punit->tile->bases, base_index(pbase))) {
          infracount = 1;
          break;
        }
      } base_type_iterate_end;
    }
    if (infracount > 0) {
      astr_add_line(&str, "%s", get_infrastructure_text(infrastructure, punit->tile->basescity_name(pcity)has_type_flag(punit, F_CIVILIAN)) {
	nonmil++;
      } else {
	mil++;
      }
      types_count[utype_index(unit_type(punit))utype_index(top[2])] < types_count[utype_index(utype)]) {
	top[2] = utype;

	if (!top[1]
	    || types_count[utype_index(top[1])] < types_count[utype_index(top[2])utype_index(top[0])] < types_count[utype_index(utype)utype_index(top[i])] > 0) {
	if (utype_has_flag(top[i], F_CIVILIAN)) {
	  nonmil -= types_count[utype_index(top[i])];
	} else {
	  mil -= types_count[utype_index(top[i])];
	}
	astr_add_line(&str, "%d: %s",
		      types_count[utype_index(top[i])],
		      utype_name_translation(top[i])unit_owner(punit) == client.conn.playingunit_type(punit);
	struct unit_type *to_unittype = can_upgrade_unittype(client.conn.playing,
							     unit_type(punit));
	int cost = unit_upgrade_price(unit_owner(punit)client.conn.playing
  if (NULL != client.conn.playing) {
    struct player_research *research = get_player_research(client.conn.playingclient.conn.playing),
		    research->bulbs_researched,
		    total_bulbs_required(client.conn.playing)overnment_by_number(...)->sprite.

  if (NULL != client.conn.playing) {
    astr_add_line(&str, "%s",
		  government_name_for_player(client.conn.playing));NULL == client.conn.playing
      || pplayer == client.conn.playingNULL != client.conn.playing) {
    /* TRANS: "Republic of the Poles" */
    astr_add_line(&str, _("%s of the %s"),
		  government_name_for_player(client.conn.playing),
		  nation_plural_for_player(client.conn.playing));

    astr_add_line(&str, "%s %s: %s",
		  ruler_title_translation(client.conn.playing),
		  player_name(client.conn.playing)Dtext_happiness_buildings(const struct city *pcity)
{
  char buf[512];
  int faces = 0;
  struct effect_list *plist = effect_list_new();get_effect_req_text(peffect, buf, sizeof(buf));
    if (faces++ > 0) {
      /* only one comment to translators needed. */
      astr_add(&str, Q_("?clistmore:, %s"), buf);
    } else {
      astr_add(&str, "%s", buf);
    }
  } effect_list_iterate_end"%s", Q_("?clistend:."));
  }
Dtext_happiness_wonders(const struct city *pcity)
{
  char buf[512];
  int faces = 0;
  struct effect_list *plist = effect_list_new();get_effect_req_text(peffect, buf, sizeof(buf));
    if (faces++ > 0) {
      /* only one comment to translators needed. */
      astr_add(&str, Q_("?clistmore:, %s"), buf);
    } else {
      astr_add(&str, "%s", buf);
    }
  } effect_list_iterate_end;
"%s",  Q_("?clistend:."));
  }
Describing city factotext_happiness_cities(const struct city *pcity)
{
  struct player *pplayer = city_owner(pcity);
  int cities = city_list_size(pplayer->cities);
  int content = get_player_bonus(pplayer, EFT_CITY_UNHAPPY_SIZE);
  int basis = get_player_bonus(pplayer, EFT_EMPIRE_SIZE_BASE);
  int step = get_player_bonus(pplayer, EFT_EMPIRE_SIZE_STEP);
  int excess = cities - basis;
  int penalty = 0;if (excess > 0) {
    if (step > 0)
      penalty = 1 + (excess - 1) / step;
    else
      penalty = 1;
  } else {
    excess = 0;
    penalty = 0;
  }

  astr_add_line(&str,
                _("Cities: %d total, %d over threshold of %d cities."),
              cities, excess, basis);
  astr_add_line(&str,
                /* TRANS: 0-21 content [citizen(s)] ... */
                PL_("%d content before penalty.",
                    "%d content before penalty.",
                    content),
                content);
  astr_add_line(&str,
                /* TRANS: 0-21 unhappy citizen(s). */
                PL_("%d additional unhappy citizen.",
                    "%d additional unhappy citizens.",
                    penalty),
                penalty);Describing units that affect happiness.
  FIXME: sentence fragments with parenthesis are hard to translate!
****/
const char *text_happiness_units(const struct city *pcity)
{
  int mlmax = get_city_bonus(pcity, EFT_MARTIAL_LAW_MAX);
  int uhcfac = get_city_bonus(pcity, EFT_UNHAPPY_FACTOR);if (mlmax > 0) {
    astr_add_line(&str,
                  /* TRANS: Martial law opening parenthesis */
                  _("Martial law in effect ("));

    if (mlmax == 100) {
      astr_add(&str,
               /* TRANS: no [unit] maximum */
               _("no maximum, "));
    } else {
      astr_add(&str,
               PL_("%d unit maximum, ",
                   "%d units maximum, ",
                   mlmax),
               mlmax);
    }
    astr_add(&str,
             /* TRANS: Martial law closing parenthesis */
             _("%d per unit). "),
             get_city_bonus(pcity, EFT_MARTIAL_LAW_EACH));
  } else if (uhcfac > 0) {
    astr_add_line(&str,
                  _("Military units in the field may cause unhappiness. "));
  } else {
    astr_add_line(&str,
                  _("Military units have no happiness effect. "));Describing luxurietext_happiness_luxuries(const struct city *pcity
                _("Luxury: %d total."),
                pcity->prod[O_LUXURY]);
  return str.str;
}
ENDREP
DELTA 14469 0 6071
SVN  õpö4e † €K šP‡:Œ ¢
Ž eæ: Ñ~£r/* utility */
#include "fcintl.h"
#include "log.h"
#include "support.h"

/* common */
#include "map.h"
#include "combat.h"
#include "government.h"

/* client */
#include "climisc.h"
#include "client_main /* DEBUG */, ptile->basesENDREP
DELTA 15365 0 1175
SVN  ‚Ë‚ËE~ ‡  – Y†€h ‚Án‰1/* common & utility *//* client */
#include "chatline.h"
#include "choice_dialog.h"
#include "citydlg.h"
#include "client_mainENDREP
DELTA 14417 129395 724
SVN  ××E)U ‡| –  ‡{¢ w‰"² ˜Y—A€] ƒ°hŠ ˆ³„ ›¼
/* common & utility *//* client */
#include "client_mainconn.playing),
	      get_player_bonus(client.connconn.playing->economic.tax, 0,
		   client.conn.playing->economic.luxury, 0,
		   client.connclient.conconnENDREP
DELTA 15168 0 363
SVN  éé9; …  l…~Œ [†i¢ á8‡W/* utility *//* common *//* client */
#include "client_mainENDREP
DELTA 14427 192206 31770
SVN  ‚´Y‚¿:}®r †S – t†R€b K‰€ Á§ ƒEè7‘ ˆ[ìƒ Š)ôcœ ‚ ÿ6µ …K‚4€„ R‚‰z€V  ‚š€‡{ Z‚ }€ƒh ‚£R€ŠS J‚¬7” R‚®¨ =‚°	© ‚n‚±k/* common & utility *//* client */
#include "chatline.h"
#include "cityrep.h"
#include "client_main.h"
#include "climiscstruct base_type *pbase = get_base_by_gui_type(BASE_GUI_FORTRESS,
                                                       punit, punit->tile);
        if (pbaseduring_revolution_sqget_num_units_in_focus() > 0      struct unit_list *punits = get_units_in_focus()(can_units_do(punits, can_unit_add_or_build_city)
                      || can_units_do(punits, unit_can_help_build_wonder_here)));
      my_enable_menu(menu, IDM_ORDERS_ROAD,
                     (can_units_do_activity(punits, ACTIVITY_ROAD)
                      || can_units_do_activity(punits, ACTIVITY_RAILROAD)
                      || can_units_do(punits,
                                      unit_can_est_traderoute_here)));
      my_enable_menu(menu, IDM_ORDERS_IRRIGATE,
		     can_units_do_activity(punitss_do_activity(punits, ACTIVITY_MINE));
      my_enable_menu(menu, IDM_ORDERS_TRANSFORM,
		     can_units_do_activity(punits, ACTIVITY_TRANSFORM));
      my_enable_menu(menu, IDM_ORDERS_FORTRESS,
                     can_units_do_base_gui(punits, BASE_GUI_FORTRESS)
		     || can_units_do_activity(punits, ACTIVITY_FORTIFYING));
      my_enable_menu(menu, IDM_ORDERS_AIRBASE,
                     can_units_do_base_gui(punits, BASE_GUI_AIRBASE));
      my_enable_menu(menu, IDM_ORDERS_POLLUTION,
		     (can_units_do_activity(punits, ACTIVITY_POLLUTION)
                      || can_units_do(punits, can_unit_paradrop)));
      my_enable_menu(menu, IDM_ORDERS_FALLOUT,
		     can_units_do_activity(punits, ACTIVITY_FALLOUT));
      my_enable_menu(menu, IDM_ORDERS_SENTRY,
		     can_units_do_activity(punits, ACTIVITY_SENTRY));
      my_enable_menu(menu, IDM_ORDERS_PILLAGE,
		     can_units_do_activity(punits, ACTIVITY_PILLAGE));
      my_enable_menu(menu, IDM_ORDERS_DISBAND,
		     units_have_flag(punits, F_UNDISBANDABLE, FALSE));
      /* FIXME: Upgrade item missing */
      my_enable_menu(menu, IDM_ORDERS_HOMECITY,
		     can_units_do(punits, can_unit_change_homecity));
      my_enable_menu(menu, IDM_ORDERS_LOAD,
                     units_can_load(punits));
      my_enable_menu(menu, IDM_ORDERS_UNLOAD,
                     units_are_occupied(punits));
      my_enable_menu(menu, IDM_ORDERS_WAKEUP_OTHERS,
                     units_have_activity_on_tile(punits,
                                                 ACTIVITY_SENTRY));
      my_enable_menu(menu, IDM_ORDERS_AUTO_SETTLER,
                     can_units_do(punits, can_unit_do_autosettlers));
      my_enable_menu(menu, IDM_ORDERS_AUTO_EXPLORE,
                     can_units_do_activity(punits, ACTIVITY_EXPLORE));
      my_enable_menu(menu, IDM_ORDERS_CONNECT_ROAD,
                     can_units_do_connect(punits, ACTIVITY_ROAD));
      my_enable_menu(menu, IDM_ORDERS_CONNECT_RAIL,
                     can_units_do_connect(punits, ACTIVITY_RAILROAD));
      my_enable_menu(menu, IDM_ORDERS_CONNECT_IRRIGATE,
                     can_units_do_connect(punits                     can_units_do_diplomat_action(punits, DIPLOMAT_ANY_ACTION));
      my_enable_menu(menu, IDM_ORDERS_NUKE,
                     units_have_flag(punits, F_NUCLEAR, TRUE));
      if (units_have_flag(punits, F_HELP_WONDER, TRUE)) {
	my_rename_menu(menu, IDM_ORDERS_BUILD_CITY, N_("Help Build Wonder")
		       "\tB");
      } else {
        bool city_on_tile = FALSE;

        /* FIXME: this overloading doesn't work well with multiple focus
         * units. */
        unit_list_iterate(punits, punit) {
          if (tile_city(punit->tile)) {
            city_on_tile = TRUE;
            break;
          }
        } unit_list_iterate_end;

        if (city_on_tile && units_have_flag(punits, F_ADD_TO_CITY, TRUE)) {
          my_rename_menu(menu, IDM_ORDERS_BUILD_CITY, N_("Add to City")
                         "\tB");
        } else {
	  my_rename_menu(menu, IDM_ORDERS_BUILD_CITY, N_("Build City")
			 "\tB");
        }
      }
 
      if (units_have_flag(punits, F_TRADE_ROUTE, TRUE)) {
        s_have_flag(punits, F_SETTLERS, TRUE)) {
	bool has_road = FALSE;

	/* FIXME: this overloading doesn't work well with multiple focus
	 * units. */
	unit_list_iterate(punits, punit) {
	  if (tile_has_special(punit->tile, S_ROAD)) {
	    has_road = TRUE;
	    break;
	  }
	} unit_list_iterate_end;

	if (has_road) {
          roadtext = N_("Build Railroad") "\tR";
	  road_activity=ACTIVITY_RAILROAD;
	} else {
          roadtext = N_("Build Road") "\tR";
	  road_activity=ACTIVITY_ROAD;
	}
if (unit_list_size(punits) == 1) {
	struct unit *punit = unit_list_get(punits, 0);

        pterrain = tile_terrain(punit->tile);
        if (pterrain->irrigation_result != T_NONE
            && pterrain->irrigation_result != pterrain) {
          my_snprintf(irrtext, sizeof(irrtext), irrfmt,
                      get_tile_change_menu_text(punit->tile,
                                                ACTIVITY_IRRIGATE));
          sz_strlcat(irrtext, "\tI");
        } else if (tile_has_special(punit->tile, S_IRRIGATION)
                   && player_knows_techs_with_flag(client.conn.playing,
                                                   TF_FARMLAND)) {
          sz_strlcpy(irrtext, N_("Build Farmland") "\tI");
        }
        if (pterrain->mining_result != T_NONE
            && pterrain->mining_result != pterrain) {
          my_snprintf(mintext, sizeof(mintext), minfmt,
                      get_tile_change_menu_text(punit->tile, ACTIVITY_MINE));
          sz_strlcat(mintext, "\tM");
        }
        if (pterrain->transform_result != T_NONE
            && pterrain->transform_result != pterrain) {
          my_snprintf(transtext, sizeof(transtext), transfmt,
                      get_tile_change_menu_text(punit->tile,
                                                ACTIVITY_TRANSFORM));
          sz_strlcat(transtext, "\tO");
        }s_do_activity(punitss_have_flag(punits, F_PARATROOPERS, TRUEunits_have_flag(punits, F_SETTLERS, FALSEENDREP
DELTA 14433 12367 4124
SVN  ›"™$A2 †* – ‚)†)Œ }ˆQŠ ‰7‰V G  c–© †¦{€J N¶~ ~®Jƒ …u°GŒ ƒ3¶Bƒ á.¹t/* common & utility *//* client */lient_main
  struct tile *pcenter = city_tile(pcity)_cxy(pcenter, ptile, x, y) {
    if (tile_worked(ptile) == pcity
     && !cxy_cxy(pcentercxyENDREP
DELTA 15218 0 28694
SVN  ‚‚”B1‚ ‹Q Š ÁO‹Y€ @…@€S G  ¢eÍ! ŸWð- G  }‚Šw¥‚lient_mainEntry point for freeciv client program. SDL has macro magic to turn
  this in to function named SDL_main() and it provides actual main()
  itself.
**********/
int main(int argc, char **argv)
{
  return client_main(argc, argv);
}


notify_object_created(int tag, int idENDREP
DELTA 14427 135448 3130
SVN  ÇÇAc …| €V Ãf‡( û|Ë/* utility */
#include "support.h"

/* common */
#include "game.h"
#include "unit.h"
#include "unitlist.h"

/* client */
#include "dialogs_g.h"
#include "chatline.h"
#include "choice_dialog.h"
#include "client_mainPREREQS_KNOWNENDREP
DELTA 7939 23636 826
SVN  ‰7‰Jk …j €r G  .‡€y/* common */
#include "game.h"

/* client */
#include "client_main.h"
#include "control.h"

#include "gotodlg.h"

C_S_RUNNING != client_state()) {
    return;
  }
  if (0 == get_num_units_in_focus()) {
    return;
  }
  /* PORTME */
}
ENDREP
DELTA 14427 224821 258
SVN  ¹¹

 †! Š ²s†)lient_mainENDREP
DELTA 14433 18462 108
SVN  ¡¡;g …| – b…{€Q ™v‡/* common & utility *//* client */
#include "chatline_g.h"
#include "citydlg_g.h"
#include "client_mainENDREP
DELTA 10803 0 4915
SVN  Ú8ä$‚@* †( €ƒ  ™'‰,Ž ƒk¢[Ž ƒ9¦N€H lª€F ~«9· Œ_¬c€ƒ '¼3€  ‰¾7— 2Ç]µ ”nÉ<€f †Qß€= †0ç2 î€A ‡{ð& Jø … )ùn€‚) jû– üx€" `ÿ‚ ‹e€o Lý>€` jŒA– Ž7€" ÿ€H F€o D‚6 ƒ`ƒ{ ƒ‡\ „/œ “ ‚# M€a „G£
® e§nŠ ƒT¨]® e§nŠ ƒT­=€h £> ‚²~€W ‚|µk€x £> ˆ]ºd€f 7µz SÛ~ Â4€W ‡È"» †7Ï[€[ ƒRÖf/* utility */
#include "mem.h"
#include "shared.h"
#include "support.h"

/* common */
#include "diptreaty.h"
#include "fcintl.h"
#include "government.h"
#include "map.h"
#include "packets.h"
#include "player.h"

/* client */
#include "chatline.h"
#include "client_main.h"
#include "climisc.h"
#include "options.h"

#include "diplodlg.h"
#include "gui_main.h"
#include "gui_stuff.h"
#include "mapview.h"
#include "plrplayer_by_numbplayer_by_numb!can_client_issue_orders()) {
    return;
  }

  if (client.conn.playing create_diplomacy_dialog(client.conn.playing,
				      player_by_numbplayer_by_number(initiated_from) == client.conn.playing = FALSE;

    menu = gtk_menu_new();

    advance_index_iterate(A_FIRST, i) {
      if (player_invention_state(plr0, i) == TECH_KNOWN
          && player_invention_reachable(plr1, i)
	  && (player_invention_state(plr1, i) == TECH_UNKNOWN
	      || player_invention_state(plr1, i) == TECH_PREREQS_KNOWN)) {
	item =
	  gtk_menu_item_new_with_label(advance_name_for_player(client.conn.playingayer_number(plr0) << 24) |
					 (player_number(plr1) << 16) |
					 i));
	flag = TRUE;
      }
    } advance_index_iterate_end;name(city_list_ptrs[j])ayer_number(plr0) << 24) |
					 (player_number(plr1)client.conn,
					       player_number(pdialog->treaty.plr1),
					       player_number(pclause->from)client.conn,
					     player_number(pdialog->treaty.plr1));
    break;
  default:
    dsend_packet_diplomacy_cancel_meeting_req(&client.conn,
					      player_number(pdialog->treaty.plr1)nation_plural_for_player(plr1stockbutton(pdialog->dialog, GTK_STOCK_CANCEL,
			     _("_Cancel meeting"), RESPONSE_CANCEL_MEETING);
  gui_dialog_add_stockbutton(pdialog->dialog, GTK_STOCK_DND,
			     _("Accept _treaty"), 20);
label = gtk_label_new(NULL);
  gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
  my_snprintf(buf, sizeof(buf),
	      "<span size=\"large\"><u>%s</u></span>",
              nation_plural_for_player(plr0));
  gtk_label_set_markup(GTK_LABEL(label), buf);
  gtk_box_pack_start(GTK_BOX(vbox), labelnation_of_player(plr0)5, 0.5);
  my_snprintf(buf, sizeof(buf),
	      "<span size=\"large\" weight=\"bold\">%s %s</span>",
	      ruler_title_translation(plr0),
	      player_name(plr0  5, 0.5);
  my_snprintf(buf, sizeof(buf),
	      "<span size=\"large\"><u>%s</u></span>",
              nation_plural_for_player(plr1));
  gtk_label_set_markup(GTK_LABEL(label), buf);
  gtk_box_pack_start(GTK_BOX(vbox), labelnation_of_player(plr1)5, 0.5);
  my_snprintf(buf, sizeof(buf),
	      "<span size=\"large\" weight=\"bold\">%s %s</span>",
	      ruler_title_translation(plr1),
	      player_name(plr11 = image;
  gtk_box_pack_end(GTK_BOX(hbox), image, FALSE, FALSE, 0);
  111  bool blank = TRUE  blank = FALSE;
  } clause_list_iterate_end;

  if (blank) {
    gtk_list_store_append(store, &it);
    gtk_list_store_set(store, &it, 0,
		       _("--- This treaty is blank. "
		 	 "Please add some clauses. ---"), -1);
  }player_by_number(giver) == client.conn.playingclient.conplayer_by_number(giver) == client.conn.playingclient.conclient.conn,
					   player_number(pdialog->treaty.plr1),
					   player_number(pgiver), CLAUSE_MAP, 0);client.conn,
					   player_number(pdialog->treaty.plr1),
					   player_number(pgiver)client.conn,
					   player_number(pdialog->treaty.plr1),
					   player_number(pdialog->treaty.plr0),
					   type, 0);client.conn,
					   player_number(pdialog->treaty.plr1),
					   player_number(pgiver), CLAUSE_VISIONembassy_callback(GtkWidget *wclient.conn,
					   player_number(pdialog->treaty.plr1),
					   player_number(pgiver)client.conn.playing;
  struct player *plr1 = player_by_numbclient.conn,
					     player_number(pdialog->treaty.plr1),
					     player_number(pgiver)ENDREP
DELTA 14417 73870 438
SVN  ‚˜‚˜6( †T – 	†S€f ‚ˆ3 ËPŠ]Š ƒÖ7Š œ;ÙOŠ ‚CöŠ Uøa„ ŽP‚‰5/* common & utility *//* client */
#include "chatline.h"
#include "citydlg.h"
#include "cityrepdata.h"
#include "client_mainclient.conclient.conclient.conclient.conconnENDREP
DELTA 14157 0 10348
SVN  öø'6ƒ † – &†€a aˆ› “Vˆr¬ ŽrœyŠ ‹i«u€J „c·V€H ¡C¼1¾ ˜Ýj/* common & utility *//* client */
#include "chatline.h"
#include "citydlg.h"
#include "client_main.h"
#include "climapeditgui.h"
#include "editorTILE_UNKNOWN != client_tile_get_known(ptile)client.conditor_is_active()) {
    return handle_edit_mouse_button_release(ev);
  }
editor_is_active()) {
    return handle_edit_mouse_button_press(ev);
  }if (editor_is_active()) {
    return handle_edit_mouse_move(evENDREP
DELTA 14417 142068 10300
SVN  ßdß{< †( –  †'¢ Ê%‡N„ rÑr/* common & utility *//* client */
#include "client_mainconnENDREP
DELTA 15296 513 522
SVN  ƒ„yƒ…8 …p – !…o¢ ‚ýV‡#/* common & utility *//* client */
#include "client_mainENDREP
DELTA 15186 0 368
SVN  ƒ¾Aƒ¾g8 †i – r†h¢ ƒµTˆm/* common & utility *//* client */
#include "client_mainENDREP
DELTA 14427 225524 32577
SVN  ‚Í<‚Î"\ Š Š ï'Š — ­?ù?€^ ‚
‚§;€] £;‚ªlient_mainstruct base_type *pbasepbase = get_base_by_gui_type(BASE_GUI_FORTRESS, pUnit, pUnit->tile);
      if (!pCity && pbasepbase = get_base_by_gui_type(BASE_GUI_AIRBASE, pUnit, pUnit->tile);
      if (!pCity && pbaseENDREP
DELTA 14427 97989 7860
SVN  ‚Âj‚ÇA~ˆ[ † ½ f†5¢  E‡. ¿G¨— ‚wçf€h ðj „ì8€n ˜ðj€Q ˜K‰~€J 8¢i… I‰~ Ž¤i€ ‡g³U’ „Z»L’ dÀ6… ¹oÐ$€I p‚’8 ›j‚‹&€x ›a‚§	/* utility */
#include "log.h"
#include "mem.h"

/* common *//* client */
#include "client_main                  const                                      enum known_type known,
                                      const                                         enum known_type known,
                                         const                            const struct tile *dest_tile,
                            int src_cost, int src_extra,
                            int *dest_cost, int *dest_extra,
                            const                             enum direction8 dir,
                        const
no_fights_or_unknown_goto(const struct tile *ptile,
                          enum known_type known,
                          constget_moves_left_reqget_moves_left_reqclear/* Cannot make a path */
      pf_destroy_map(map);
      continue;
    }order.dir = -1;
      order.activity = ACTIVITY_LAST;

      /* ORDER_MOVE would require real direction,
       * ORDER_ACTIVITY would require real activity */
      assert(goto_last_order != ORDER_MOVE
	     && goto_last_order != ORDER_ACTIVITY);
ENDREP
DELTA 15296 3213 18421
SVN  †  †  3f † – ƒ†Œ ‰Š õŠ- ¤=‚€}´ ƒ¥6† Ý<„ÂD Q„ú@/* common & utility *//* client */lient_maingame_remove_player(pplayer);
  player_init(pplayer);, NULL†  §|«‚P §+Q E„ €i E„ €f/*****
  Handle a notification from the server that an object was successfully
  created. The 'tag' was previously sent to the server when the client
  requested the creation. The 'id' is the identifier of the newly created
  object.
*****/
void handle_edit_object_created(int tag, int id)
{
  editgui_notify_object_created(tag, id);
}
ENDREP
DELTA 14271 8835 602
SVN  ‚«‚«9 †I Š œ†Q¯ ‡r£lient_mainresult_from_main_map(&result, pCma->pCity, TRUEENDREP
DELTA 9383 0 10746
SVN  „Üh„ãJ…^ÑV ‰ €ƒ@ JŽ}€[ EŒ® Rzˆ ‰R ‚P˜h‘ ‚!›E“ 9q ®UŸ;“ ‹Î" yÙ( Ú"€B …ÜD€U Bƒ±  â€Q ƒNãf€r …4èCº …:î3 %ó~ ƒ@õD€f ‚7ùz€k ©xþU€T ƒ©€U ªP¬Nœ Š#×0€V †â€W ƒèT€{ Œìˆ )ø€^ ‡eú® ÿ ˜ b„‰< ‰‚„E€‚] ‚6‚u€‚_ <‚u ‚–€‚c à{ ‚šQ€ƒ ‚­?Ÿ `‚¢€~ >‚s t‚¢k€ >‚s• _‚£ € >‚s v‚©€ >‚s” j‚Åf 
ï €„ ‰‚±+ˆ W‚º>€e †y‚¼L™ †U‚ÃY™ W‚ÊB˜ \‚Ì( ŒV‚Í¦ ‚Úi€I ƒW‚é!€9 „i‚ír€‚X „z‚ô{ˆ t‚ùt‰ ‚­? †A‚ûu€†^ `ƒ…@€C ƒ5ƒ†H» …fƒ‰}€„ `ƒ…@ ˆTƒ“A° ƒƒœ;Ÿ ‚™> bƒ y« eƒ¡€B Wƒ£vŠ >ƒ¤W€‚@ nƒ·3“ ‚
ƒ¸0“ ‚sƒºI€` 2‚s ‚Oƒ¿[€q †-ƒÃ€‚& ˆRƒË/€‚@ …;ƒÕW› ŽHƒÛ€3 9ƒísŠ ~ƒï3¶ Rƒìq€ 9ƒísŠ ~ƒï3š ‰@ƒð3¬ „‡ A  T²? ‡„‰+€‚w 5„’j– ‚™? <„•G ‚„—ª ~„™>€m Š:„›+ ‡t„¥o ‡„­n ‚_„µ  –]„·`€9 „Ï0€6 C„Ð}€Z ŠO„Ò/* utility */
#include "fcintl.h"
#include "mem.h"
#include "genlist.h"
#include "shared.h"
#include "support.h"

/* common */
#include "city.h"
#include "connection.h"	/* can_conn_edit */
#include "game.h"
#include "map.h"
#include "packets.h"
#include "player.h"
#include "specialist.h"
#include "unitlist.h"

/* client */
#include "client_main.h"
#include "climap.h"
#include "climisc.h"
#include "control.h"	/* request_xxx and set_unit_focus */ma_fec.h"

#include "canvas.h"
#include "cityrep.h"
#include "cma_fe.h"
#include "colors.h"/* for toggle_callback */
#include "pixcomm.h"itydlg.ht/*int is_modal;*/*dialog_list = NULL = dialog_list_new(
  if (NULL == client.conn.playing
      || city_owner(pcity) == client.conn.playing) {
    city_report_dialog_update_city(pcity);
    economy_report_dialog_update();
  } else {
    if (pdialog)**********
  Updates supported and present units views in city dialogs for given unit = player_find_city_by_id(client.conn.playing, punit->homecity);
  pcity_pre=tile)
{
  struct city_dialog *pdialog;
  
  if(!(pdialog=get_city_dialog(pcity)))
    pdialog=create_city_dialog(pcitydialog_list) > 0) {
    close_city_dialog(dialog_list_get(enum citizen_category c = CITIZEN_SPECIALIST + DEFAULT_SPECIALIST;

  if (tileset_tile_height(tileset)pdialog->shell=
    XtVaCreatePopupShell(city_name(pcity),
/*			 make_modal ? transientShellWidgetClass :*/tileset_full_tile_width(tileset),
			    XtNheight, 3 * tileset_tile_height(tileset)tileset_full_tile_width(tileset),
			    XtNheight, tileset_full_tile_height(tileset)tileset_tile_height(tileset)tileset_full_tile_width(tileset),
			      XtNheight, 3 * tileset_tile_height(tileset)tileset_full_tile_width(tileset),
			      XtNheight, tileset_full_tile_height(tileset)/* FIXME: this ignores the mask. */
  XtVaSetValues(pdialog->shell, XtNiconPixmap,
		get_icon_sprite(tileset, ICON_CITYDLG)prepend(/*
  if(make_modal)
    XtSetSensitive(toplevel, FALSE);
  
  pdialog->is_modal=make_modal;
*/ptile->units) )
    popup_unit_select_dialog(punits_next_prev_callback =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  if (NULL != punit) {
    struct city *pcity = tile_city(punit->tile);

    set_unit_focus(punit);
    if (NULL != pcity) {
      struct city_dialog *pdialog = get_city_dialog(pcity);

      if (NULL != pdialog) {
	city_dialog_update_present_units(pdialog, 0);
      }
    } =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  if (NULL != punit) {
    struct city *pcity = tile_city(punit->tile);

    set_unit_focus(punit);
    if (NULL != pcity) {
      struct city_dialog *pdialog = get_city_dialog(pcity);

      if (NULL != pdialog) {
	city_dialog_update_supported_units(pdialog, 0);
      }
    } =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  destroy_message_dialog(w);

  if (NULL != punit) {
    struct city *pcity = tile_city(punit->tile);

    set_unit_focus(punit);
    if (NULL != pcity) {
      struct city_dialog *pdialog = get_city_dialog(pcity);

      if (NULL != pdialog) {
	close_city_dialog(pdialog);
      } =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  destroy_message_dialog(w);

  if (NULL != punit) {
    struct city *pcity =
      player_find_city_by_id(client.conn.playing, punit->homecity);

    set_unit_focus(punit);
    if (NULL != pcity) {
      struct city_dialog *pdialog = get_city_dialog(pcity);

      if (NULL != pdialog) {
	close_city_dialog(pdialog);
      }
    }
  }static void present_units_sentr =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  if (NULL != punit) {
    request_unit_sentry(punit =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  if (NULL != punit) {
    request_unit_fortify(punitpresent_units_disband =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  if (NULL != punit) {
    request_unit_disband(punit =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  if (NULL != punit) {
    request_unit_change_homecity(punitpresent_units_cancelvoid present_units_callback(Widget w, XtPointer client_data, 
			    XtPointer call_data)
{
  Widget wd;
  struct city_dialog *pdialog;
  struct city *pcity;
  XEvent *e = (XEvent*)call_data;
  struct unit *punit =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);
  
  if ((NULL != punit
       || (can_conn_edit(&client.conn)
           && NULL == client.conn.playing
           && (punit = game_find_unit_by_number((size_t)client_data))))
      && (pcity = tile_city(punit->tile))
      && (pdialog = has_typeNULL == client.conn.playing
	|| (NULL == can_upgrade_unittype(client.conn.playing, unit_type(punit)))city_name(pdialog->pcity)city_name(pdialog->pcity)game_find_city_by_numbercity_name(pcity)city_production_name_translation(pcityenum citizen_category citizens[MAX_CITY_SIZE];
  int i;
  struct city *pcity=pdialog->pcity;
  int num_citizens = get_city_citizen_types(pcity, FEELING_FINAL, citizens);

  for (i = 0; i < num_citizensnum_citizens) {
    i = pdialog->num_citizens_shown - 1;
    /* FIXME: what about the mask? */
    xaw_set_bitmap(pdialog->citizen_labels[i],
		   get_arrow_sprite(tileset, ARROW_RIGHT)Widget wd;
  XEvent *e = (XEvent*)call_data;
  struct unit *punit =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  if (NULL != punit) {
    struct city *pcity = game_find_city_by_number(punit->homecity);

    if (NULL != pcity) {
      struct city_dialog *pdialog = get_city_dialog(pcity);

      if ( NULL != pdialog)has_type    }
  }  int free_upkeep[O_COUNT];
  int free_unhappy = get_city_bonus(pdialog->pcity, EFT_MAKE_CONTENT_MIL);

  output_type_iterate(o) {
    free_upkeep[o] = get_city_output_bonus(pdialog->pcity, get_output_type(o),
                                           EFT_UNIT_UPKEEP_FREE_PER_CITY);
  } output_type_iterate_end;

  if (NULL != client.conn.playing
      && city_owner(pdialog->pcity) != client.conn.playing) {
    plist = pdialog->pcity->info_units_supported;
  } else {
    plist = pdialog->pcity->units_supported;
  }

  adj_base = units_scroll_maintenance(unit_list_size(plist),
                                      pdialog->num_units_shown,
                                      &(pdialog->support_unit_base),
                                      pdialog->support_unit_next_command,
                                      pdialog->support_unit_prev_commandplist, punit) {
    struct canvas store;
    int upkeep_cost[O_COUNT];
    int happy_cost = city_unit_unhappiness(punit, &free_unhappy);
  	 
    city_unit_upkeep(punit, upkeep_cost, free_upkeep),
                                  upkeep_cost, happy_cost (NULL != client.conn.playing
      && city_owner(pdialog->pcity) != client.conn.playing) {
    plist = pdialog->pcity->info_units_present;
  } else {
    plist = pdialog->pcity->tile->units;
  }

  adj_base = units_scroll_maintenance(unit_list_size(plist),
                                      pdialog->num_units_shown,
                                      &(pdialog->present_unit_base),
                                      pdialog->present_unit_next_command,
                                      pdialog->present_unit_prev_commandGovernor: %s"),
	      city_name(pdialog->pcity)city_name(pdialog->pcity), NULLcity_built_iterate(pdialog->pcity, pimprovecity_improvement_name_translation(pdialog->pcity, pimprove)) != 0)
      flag = 1;
    sz_strlcpy(pdialog->improvlist_names[n],
	       city_improvement_name_translation(pdialog->pcity, pimprovecity_builtchar buf[512];
  struct city_dialog *pdialog = (struct city_dialog *)client_data;;
  const char *name = city_production_name_translation(pdialog->pcity);
  int value = city_production_buy_gold_cost(pdialog->pcity);
  
  if (!can_client_issue_orders()) {
    return;
  }

  if (value <= client.conn.playing->economic.goldclient.conn.playingclient.conn.playing =
    player_find_unit_by_id(client.conn.playing, (size_t)client_data);

  /* Is it right place for breaking? -ev */
  if (!can_client_issue_orders()) {
    return;
  }

  if (NULL != punit) {
    request_unit_upgrade(punitchar buf[512];
  struct unit *punit = player_find_unit_by_id(client.conn.playing,
					      (size_t)client_data) (ret->list_index != XAW_LIST_NONE) {
    struct universal target =
      universal_by_number((ret->list_index >= pdialog->change_list_num_improvements)
			     ? VUT_UTYPE : VUT_IMPROVEMENT,
			     pdialog->change_list_ids[ret->list_index]);

    city_change_production(pdialog->pcity, targetutype_name_translation(utype_by_number(idx)), HELP_UNIT);
    } else if (is_great_wonder(improvement_by_number(idx))) {
      popup_help_dialog_typed(improvement_name_translation(improvement_by_number(idx)), HELP_WONDER);
    } else {
      popup_help_dialog_typed(improvement_name_translation(improvement_by_number(idx)struct universal productionovement_iterate(pimprove) {
    if(can_city_build_improvement_now(pdialog->pcity, pimprove)) {
      production.kind = VUT_IMPROVEMENT;
      production.value.building = pimprove;production = improvement_number(pimprove);
    }
  } improvementpunittype) {
    if (can_city_build_unit_now(pdialog->pcity, punittype)) {
      production.kind = VUT_UTYPE;
      production.value.utype = punittype;production = utype_number(punittype)
  city_worklist_commit(pdialog->pcity, pwl)city_built_iterate(pdialog->pcity, pimprove) {
      if (n == ret->list_index) {
	char buf[512];

	if (!can_city_sell_building(pdialog->pcity, pimprove)) {
	  return;
	}

	pdialog->sell_id = improvement_number(pimprove);
	my_snprintf(buf, sizeof(buf), _("Sell %s for %d gold?"),
		    city_improvement_name_translation(pdialog->pcity, pimprove),
		    impr_sell_gold(pimprovecity_built_iterate_endclear(pdialog->pcity->info_units_supportedclear(pdialog->pcity->info_units_present);

/*
  if(pdialog->is_modal)
    XtSetSensitive(toplevel, TRUE);
*/onst char *citycity_name(pcity)onst char *citygame_find_city_by_number(cityopt_city_id);

  if (pcity) {
/*    int i; */
    bv_city_options new_options;
    Boolean b;

    assert(CITYO_LAST == 3);

    BV_CLR_ALL(new_options);
/**/
    XtVaGetValues(cityopt_toggles[4], XtNstate, &b, NULL);
    if (b) {
      BV_SET(new_options, CITYO_DISBAND);
    }
    if (newcitizen_index == 1) {
      BV_SET(new_options, BV_SET(new_options, CITYO_NEW_TAXMAN);
    }
    dsend_packet_city_options_req(&client.conENDREP
DELTA 14417 81446 4535
SVN  Ð#ÐH"o ˆ) €A vˆO¢ Žk‰l„ ™1˜V„ ²„ ³/* utility */
#include "mem.h"
#include "support.h"

/* common *//* client */
#include "client_mainconnconnconnENDREP
DELTA 14370 2641383 6007
SVN  ‚ƒe‚…sbŒ1 Š) Š 0Š1 ƒi˜S Œr‹O G ­ Jœ@ ™{› ·€: c¹9€[ …(»[ Qå@Š Jœ@ ž*Â+‚ ŠjàW€D Sá ‡NíQ³ –
õO‡ ‰/‹[‡ ˆ%•º …=i€ L£vŸ \®v ‘ ¥@€F ƒf¶9‡ ‡º!° ‚EÁN† ‡eÄ ‚Ë|„ ƒ+Î¶ ‚1Ñs€M G  ŽZÕ9€R äq† ?æ€d ‹vé'‚ ŽHõlient_main
******
  Return the name of the given theme.
int log_level = LOG_DEBUG;
log_level, "\"%s\": %s file appears incompatible:",
	    filename, which);
    freelog(log_level, "  datafile options: %s", file_capstr);
    freelog(log_level, "  supported options: %s"log_level, "\"%s\": %s file requires option(s)"
			 " that client doesn't support:",
	    filename, which);
    freelog(log_level, "  datafile options: %s", file_capstr);
    freelog(log_level, "  supported options: %s"Clean up.
nv\"%s\".", real_full_name);
      s = load_gfxfile(real_full_name);
      if (s) {
	return s;
      }
    }
  }

  freelog(LOG_ERROR, "Could not load gfx file \"%s\".", gfx_filename);
  return NULL"Could not load gfx file for the spec file \"%s\"."\"%s\".\"%s\"."Couldn't find a supported gfx file extension for \"%s\"."freelog(LOG_ERROR, "Can't find theme \"%s\".", theme_name); 
    theme_free(t);
    return NULL;
  }
  freelog(LOG_VERBOSE, "themespec file is \"%s\"."Could not open \"%s\".", fnamefreelog(LOG_ERROR, "Can't find spec file \"%s\".", spec_filenames[i]);\"%s\"."Couldn't load gfx file \"%s\" for sprite '%s'."\"%s\".'%s''%s' and alternate '%s' are both missing.", tag, alt);LOG_VERBOSE, tag, alt,\
						   "sprite", #field);	    \
  } while (FALSE)

 int loglevel,
					   const char *tag, const char *alt,
					   const char *what,\"%s\"\"%s\" (instead of \"%s\") for %s \"%s\".",
	    alt, tag, what, name);
    return sp;
  }

  freelog(loglevel,
	  "Don't have graphics tags \"%s\" or \"%s\" for %s \"%s\".",
	  tag, alt, what, name);
  if (LOG_FATAL >= loglevel()ENDREP
DELTA 14427 167952 108
SVN  ‚‰‚‰/ …k € ‚‚>†U/* common */
#include "unitlist.h"

/* client */
#include "chatline.h"
#include "citydlg.h"
#include "cityrep.h"
#include "client_mainENDREP
DELTA 14427 110092 766
SVN  ÈTÈ}u †> – "†=€L Ÿ*ˆ€ Ÿ~¨V/* common & utility *//* client */
#include "canvas.h"
#include "chatline.h"
#include "client_mainreachable(plr1, i)
        && (player_invention_state(plr1, i) == TECH_UNKNOWN
            || player_invention_state(plr1, i) == TECH_PREREQS_KNOWNENDREP
DELTA 14998 0 1165
SVN  ‚±)‚±+
 †g Š ‚ª:†olient_mainENDREP
DELTA 14427 29838 777
SVN  ‚ÕI‚Õo"u †h – D†g¢ ¥}ˆ>… „®D… U²l³ ‚¡]³l/* common & utility *//* client */
#include "client_mainKNOWNKNOWNPREREQS_KNOWN:
    bg = COLOR_REQTREE_PREREQS_KNOWNENDREP
DELTA 14370 2647419 2012
SVN  †…3†…Ec…B Šn €C þT‹C² “"Šdª Š]ž+ª Ùn©-€} ¥h‚„“ ™‚©}€d Š'‚Ã`« ƒO‚ì} š:‚Ñ|€C òL‚ìs€` ‘hƒà­ ©Sƒò'Š é/„œlient_main.h"
#include "climap.h" /* for client_tile_get_known() */
      player_find_unit_by_id(client.conn.playing, (unit_owner(pUnit) == client.conn.playing (unit_owner(pUnit) == client.conn.playingunit_owner(punit) == client.conn.playing
         && ACTIVITY_IDLE == punit->activity
         && !punit->ai.control
        client.conn.playingclient.conn.playing, city_owner(pCity)))
      || is_non_attack_unit_tile(ptile, client.conn.playing (unit_owner(pUnit) == client.conn.playing)client.conn.playing)
	 || (unit_owner(pUnit) == client.conn.playingduring_revolution) {
      continue;
    }

    if (can_change_to_government(client.conn.playing0 <= client.conn.playing->revolution_finishesclient.conENDREP
DELTA 14427 113210 1192
SVN  ­J­p8 †> –  †=¢ ¥z‡P/* common & utility *//* client */
#include "client_mainENDREP
DELTA 14422 36233 3145
SVN  ÓSÓ|.ƒ^ †> —  †>€w ¶ˆ[€‚ ~À[¢ O”~ƒ D½  Ä• ŽÅ@
/* common & utility */
/* client */
#include "chatline.h"
#include "citydlg.h"
#include "client_main.h"
#include "climap.h"
#include "climiscconn.playing->economic.luxury;
  int sci_end = lux_end + client.conn.playing->economic.science;
#if 0 /* Unneeded. */
  int tax_end = 100; 
#endif
  int luxury = client.conn.playing->economic.luxury;
  int science = client.conn.playing->economic.science;
  int tax = client.connclient.conn, tax, luxury, science)*

client.conn, unit_id,ENDREP
DELTA 14417 35958 169
SVN  Ë(Ë?[ ˆ[ – 3ˆZ· ‘ŠI„ ®	œGŠ NÊZ/* common & utility *//* client */
#include "client_main.h"
#include "climiscconnclient.conENDREP
DELTA 15352 0 2106
SVN  Ê_ËN †l – †k¸ ÂLˆ/* common & utility *//* client */
#include "chatline.h"
#include "client_mainENDREP
DELTA 14417 37016 397
SVN  ÌwÍ1ƒ †> – †=€Z G  Y®= ƒ^Šl„ ¨?ŽIŠ ‘4·­ ‚HÈi€c rÌ/* common & utility *//* client */
#include "client_main.h"
#include "gui_stuff.h"
#include "mapview.h"

#include "ratesdlg.h"

extern HINSTANCE freecivhinst;

static HWND ratesdlg;

int rates_tax_value, rates_lux_value, rates_sci_value;


connclient.conconn.playing),
		get_player_bonus(client.connconn.playing->economic.tax, 0,
		      client.conn.playing->economic.luxury, 0,
		      client.connENDREP
DELTA 15074 5180 610
SVN  àà+; ‡'  b‡&Œ ˆ¢ Öd‰/* utility *//* common *//* client */
#include "client_mainENDREP
DELTA 15355 31117 39591
SVN  †  †   †L †3 €c M†{¢ ¨B‡[ˆ …A°“ “SµN„ Éž ™Ö ‚ïp€* ±Vñ>€L ¼=‚¢w¬ ÷]‚ß
¡ KƒÞ7 –!ƒ×,€@ ‚%ƒü< §Gƒï`• Ó7„—#„ {…™# ­v„ëA„ ³…™#‰ x…Ì,‰ ’6…Ú“ ©(…ìF€A |†“P„ 7†”X/* utility */
#include "fcintl.h"
#include "hash.h"
#include "log.h"
#include "mem.h"

/* common *//* client */
#include "client_mainBV_BASESbv_bases v_bv_basesBASEBV_BASES:
    return "bv_basescase VALTYPE_BV_BASES:
    base_type_iterate(pbase) {
      if (BV_ISSET(pv->data.v_bv_bases, base_number(pbase))) {
        count++;
      }
    } base_type_iterate_end;BV_BASES:
    return BV_ARE_EQUAL(pva->data.v_bv_bases, pvb->data.v_bv_basesBASES:
      pv->data.v_bv_bases = tile_basepacket->bases = tile_bases(ptile)case OPID_TILE_BASES:
      packet->bases = pv->data.v_bv_bases;case VALTYPE_BV_BASESBASEBASETILE_BASETILE_BASEcase OPID_TILE_BASEBASES:
    gtk_list_store_clear(store);
    base_type_iterate(pbase) {
      id = base_number(pbase);
      name = base_name_translation(pbase);
      present = BV_ISSET(pv->data.v_bv_bases, idbase†  „Å„Ó\;‹L€‚  VŠ5€‡ ’) „ –’‰ O¤|€ /²— O¤| œ ¨v€` ¬qÄ}• ‚Ó.ñjstore);
    player_slots_iterate(pslot) {
      id = player_number(pslot);
      if (player_slot_is_used(pslot)) {
        name = player_name(pslot);
        pixbuf = get_flag(pslot->nation);
      } else {
        name = "";
        pixbuf = NULL;
      }id, 2, name, -1);
      if (pixbuf) {
        gtk_list_store_set(store, &iter, 1, pixbuf, -1);
        g_object_unref(pixbuf);
        pixbuf = NULL;
      }
      present = BV_ISSET(pv->data.v_tile_vision->tile_known, id);
      gtk_list_store_set(store, &iter, 3, present, -1);
      vision_layer_iterate(v) {
        present = BV_ISSET(pv->data.v_tile_vision->tile_seen[v], id);
        gtk_list_store_set(store, &iter, 4 + v, present, -1);
      } vision_layer_iterate_end;
    } player_slots_iterate_end;
    break;

  case OPID_CITY_BUILDINGS:
    gtk_list_store_clear(store);
    improvement_iterate(pimprove) {
      if (is_special_improvement(pimprove)) {
        continue;
      }
      id = improvement_index(pimprove);
      name = improvement_name_translation(pimprove);
      turn_built = pv->data.v_built[id].turn;
      present = turn_built >= 0;
      built_status_to_string(buf, sizeof(buf), &pv->data.v_bBASETILE_BASEbase_count())) {
      return;
    }
    if (present) {
      BV_SET(pv->data.v_bv_bases, id);
    } else {
      BV_CLR(pv->data.v_bv_bases, id);
    }case OPID_CITY_BUILDINGBASES, _("Bases"), OPF_IN_LISTVIEW
            | OPF_HAS_WIDGET | OPF_EDITABLE, VALTYPE_BV_BASEScase VALTYPE_BV_BASESENDREP
DELTA 15266 14640 395
SVN  ââ;8 ‰C – C‰B¢ Ö}‹/* common & utility *//* client */
#include "client_mainENDREP
DELTA 14777 6356 392
SVN  ‚ß3‚ß5
 †g Š ‚ØD†olient_mainENDREP
DELTA 4749 3585 832
SVN  kÒw~» …; €{ ˆ…L C €^ C €Z C €f C €m C €9 C €‚ C €…3 C €ƒ C €…N C €~ C €„A C €‚ C €ƒ C ª M†€ C €Š? C € G €‚ G €…?fdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <assert.h>

/* common & utility */
#include "connection.h"
#include "fcintl.h"
#include "game.h"
#include "support.h"

/* client */
#include "client_main.h"
#include "climisc.h"
#include "text.h"

  The player-name (aka nation leader) column of the plrdlg.
*******************************************************************/
static const char *col_name(const struct player *player)
{
  return player_name(player);
}


  The username (connection name) column of the plrdlg.
*******************************************************************/
static const char *col_username(const struct player *player)
{
  return player->username;
}


  The name of the player's nation for the plrdlg.
*******************************************************************/
static const char *col_nation(const struct player *player)
{
  return nation_adjective_for_player(player);
}


  The name of the player's team (or empty) for the plrdlg.
*******************************************************************/
static const char *col_team(const struct player *player)
{
  return team_name_translation(player->team);
}


  TRUE if the player is AI-controlled.
*******************************************************************/
static bool col_ai(const struct player *plr)
{
  return plr->ai.control;
}


  Returns a translated string giving the embassy status
  (none/with us/with them/both).
*******************************************************************/
static const char *col_embassy(const struct player *player)
{
  return get_embassy_status(client.conn.playing, player);
}


  Returns a translated string giving the diplomatic status
  ("war" or "ceasefire (5)").
*******************************************************************/
static const char *col_diplstate(const struct player *player)
{
  static char buf[100];
  const struct player_diplstate *pds;

  if (NULL == client.conn.playing || player == client.conn.playing) {
    return "-";
  } else {
    pds = pplayer_get_diplstate(client.conn.playing, player);
    if (pds->type == DS_CEASEFIRE || pds->type == DS_ARMISTICE) {
      my_snprintf(buf, sizeof(buf), "%s (%d)",
		  diplstate_text(pds->type), pds->turns_left);
      return buf;
    } else {
      return diplstate_text(pds->type);
    }
  }
}


  Return a string displaying the AI's love (or not) for you...
*******************************************************************/
static const char *col_love(const struct player *player)
{
  if (NULL == client.conn.playing || player == client.conn.playing
   || !player->ai.control) {
    return "-";
  } else {
    return love_text(player->ai.love[player_index(client.conn.playing)]);
  }
}


  Compares ai's attitude toward the player
******************************************************************/
static int cmp_love(const struct player *player1,
                    const struct player *player2)
{
  int love1, love2;

  if (NULL == client.conn.playing) {
    return player_number(player1) - player_number(player2);
  }

  if (player1 == client.conn.playing || !player1->ai.control) {
    love1 = MAX_AI_LOVE + 999;
  } else {
    love1 = player1->ai.love[player_index(client.conn.playing)];
  }

  if (player2 == client.conn.playing || !player2->ai.control) {
    love2 = MAX_AI_LOVE + 999;
  } else {
    love2 = player2->ai.love[player_index(client.conn.playing)];
  }
  
  return love1 - love2;
}


  Returns a translated string giving our shared-vision status.
*******************************************************************/
static const char *col_vision(const struct player *player)
{
  return get_vision_status(client.conn.playing, player);
}


  Returns a translated string giving the player's "state".

  FIXME: These terms aren't very intuitive for new players.
*******************************************************************/
const char *plrdlg_col_state(const struct player *plr)
{
  if (!plr->is_alive) {
    /* TRANS: Dead -- Rest In Peace -- Reqia In Pace */
    return _("R.I.P.");
  } else if (!plr->is_connected) {
    return "";
  } else if (!is_player_phase(plr, game.info.phase)) {
    return _("waiting");
  } else if (plr->phase_done) {
    return _("done");
  } else {
    return _("moving");
  }
}


  Returns a string telling the player's client's hostname (the
  machine from which he is connecting).
*******************************************************************/
static const char *col_host(const struct player *player)
{
  return player_addr_hack(player);
}


  Returns a string telling how many turns the player has been idle.
*******************************************************************/
static const char *col_idle(const struct player *plr)
{
  int idle;
  static char buf[100];

  if (plr->nturns_idle > 3) {
    idle = plr->nturns_idle - 1;
  } else {
    idle = 0;
  }
  my_snprintf(buf, sizeof(buf), "%d", idle);
  return buf;
}


 Compares score of two players in playersstatic int cmp_score(const struct player* player1,
                     const struct player* player2)
{
  return player1->score.game - player2->score.game;
}


 ...
*******************************************************************/
struct player_dlg_column player_dlg_columns[] = {
  {TRUE, COL_TEXT, N_("?Player:Name"), col_name, NULL, NULL, "name"},
  {FALSE, COL_TEXT, N_("Username"), col_username, NULL, NULL, "username"},
  {TRUE, COL_FLAG, N_("Flag"), NULL, NULL, NULL,  "flag"},
  {TRUE, COL_TEXT, N_("Nation"), col_nation, NULL, NULL,  "nation"},
  {TRUE, COL_COLOR, N_("Border"), NULL, NULL, NULL,  "border"},
  {TRUE, COL_RIGHT_TEXT, N_("Score"), get_score_text, NULL, cmp_score, "score"},
  {TRUE, COL_TEXT, N_("Team"), col_team, NULL, NULL,  "team"},
  {TRUE, COL_BOOLEAN, N_("AI"), NULL, col_ai, NULL,  "ai"},
  {TRUE, COL_TEXT, N_("Attitude"), col_love, NULL, cmp_love,  "attitude"},
  {TRUE, COL_TEXT, N_("Embassy"), col_embassy, NULL, NULL,  "embassy"},
  {TRUE, COL_TEXT, N_("Dipl.State"), col_diplstate, NULL, NULL,  "diplstate"},
  {TRUE, COL_TEXT, N_("Vision"), col_vision, NULL, NULL,  "vision"},
  {TRUE, COL_TEXT, N_("State"), plrdlg_col_state, NULL, NULL,  "state"},
  {FALSE, COL_TEXT, N_("?Player_dlg:Host"), col_host, NULL, NULL,  "host"},
  {FALSE, COL_RIGHT_TEXT, N_("?Player_dlg:Idle"), col_idle, NULL, NULL,  "idle"},
  {FALSE, COL_RIGHT_TEXT, N_("Ping"), get_ping_time_text, NULL, NULL,  "ping"}
};

const int num_player_dlg_columns = ARRAY_SIZE(player_dlg_columns);


 ...
*******************************************************************/
int player_dlg_default_sort_column(void)
{
  return 3;
}

******
  Translate all titles
****************************************************************************/
void init_player_dlg_common()
{
  int i;

  for (i = 0; i < num_player_dlg_columns; i++) {
    player_dlg_columns[i].title = Q_(player_dlg_columns[i].title);
  }
}

****
  The only place where this is used is the player dialog.
  Eventually this should go the way of the dodo with everything here
  moved into col_host above, but some of the older clients (+win32) still
  use this function directly.

  This code in this function is only really needed so that the host is
  kept as a blank address if no one is controlling a player, but there are
  observers.
**************************************************************************/
const char *player_addr_hack(const struct player *pplayer)
{ 
  conn_list_iterate(pplayer->connections, pconn) {
    if (!pconn->observer) {
      return pconn->addr;
    }
  } conn_list_iterate_end;

  return blank_addr_str;
}   
ENDREP
DELTA 14777 20800 1400
SVN  ƒŸ[ƒŸ]
 †m Š ƒ˜f†ulient_mainENDREP
DELTA 10392 0 2744
SVN  ¾
¾d)ˆ † € —.‡„ ˆYžJ„ §)„ ƒ ¶4„ h¹Z€T N—@† KŒ „S¼GŠ kÁ$€y uÃŠ ±}Å€T 9Ÿq ƒ|ù€T 9Ÿq ƒ}ÿ€T 9Ÿq ƒQ…€c 9Ÿq ƒLŠc€ 9Ÿq ƒLT€ 9Ÿq ”;–E„ …3«„ K°?/* common & utility */
#include "capability.h"
#include "hash.h"
#include "log.h"
#include "mem.h"
#include "timing.h"

/* client */
#include "client_mainTESTTESTTESTTEST0 == frozen_level && C_S_RUNNING == client_state()) {
    call_handle_methods();
  }Helperclient.conclient.conn.client.request_id_of_currently_handled_packet &&
      agent->last_outstanding_request_id >=
      client.conclient.con
	  unit_rule_name(punit),
	  TILE_XY(punit->tile),
	  player_name(unit_owner(punit)
	  unit_rule_name(punit),
	  TILE_XY(punit->tile),
	  player_name(unit_owner(punit)
	  unit_rule_name(punit),
	  TILE_XY(punit->tile),
	  player_name(unit_owner(punit) %d=\"%s\") owner=%s",
	  pcity->id,
	  city_name(pcity),
	  nation_rule_name(nation_of_city(pcity) %d=\"%s\") pos=(%d,%d) owner=%s",
	  pcity->id,
	  city_name(pcity),
	  TILE_XY(pcity->tile),
	  nation_rule_name(nation_of_city(pcity) %d=\"%s\") pos=(%d,%d) owner=%s",
	  pcity->id,
	  city_name(pcity),
	  TILE_XY(pcity->tile),
	  nation_rule_name(nation_of_city(pcity)TESTTESTENDREP
DELTA 14417 116430 494
SVN  êêP?V †e — o†e£ éˆi„ ‹qñy„ •qýi„ ”<“Y„ ƒ5¨„ ‰O«H„ ŸPµ„ •#Ôe
/* common & utility */
/* client */
#include "client_mainconnconnconnconnconnconnconnENDREP
DELTA 15200 1406 550
SVN  „ì%„ì'
 Š Š „âŠlient_mainENDREP
DELTA 14777 22845 114
SVN  îî	

 †] Š ç"†elient_mainENDREP
DELTA 15303 326 372
SVN  àà+N †| – †{¸ ×bˆ#/* common & utility *//* client */
#include "chatline.h"
#include "client_mainENDREP
DELTA 9976 113 1014
SVN  Á_ÂB4‚ †( – †'· ‚‡S™ 3Š¼ zš® `©}Š „ªg€D Šq¯! ‡Lº/* common & utility *//* client */
#include "client_main.h"
#include "climiscext.h"
#include "tilespec (game.info.spacerace
     && pplayer == client.conn.playing,
                               gpointer dataclient.con, NULL);
  gui_dialog_set_title(pdialog->shell, player_name(pplayer)_ENDREP
DELTA 11057 4171 226
SVN  ·|¸#'‚ …z § p†¢ ŠE‡¹ ;’€x ‹ = 
«T“ ‹¬m/* common & utility */
#include "fcintl/* client */
#include "client_mainNULL != client.conn.playing
      && !client.conn.playingcity(messages[i].tile);

      messages[i].city_ok =
        (pcity && can_player_see_city_internals(client.conn.playingclient.conn.playingENDREP
DELTA 5785 0 437
SVN  žKžp'„8 † – †€M ‡!ˆ€k „%‘€ B’@€f †~—M/* common & utility *//* client */
#include "chatline.h"
#include "client_main.h"
#include "climisc
  GetWindowText(hchatline,msg_buf2,sizeof(msg_buf2));
  if (strchr(msg_buf2,'\n')) {
    send_chat(msg_buf  Appends the string to the chat output window.  The string should be
  inserted on its own line, although it will have no newline.
********/
void real_append_output_window(const char *astring, int conn_id)
{
  const char *str;
  char *str2;
  char buf[512];

  str=astring;
  while((str2=strchr(str,'\n')))
    {
      /* HACK: We need to add \r to lineends. */ENDREP
DELTA 14977 1076 35294
SVN  ‚ÆO‚ÆQ
 ‡ Š ‚¿4‡lient_mainENDREP
DELTA 7939 12577 2927
SVN  »4«s8…  † €ƒ G €Q I‰ €K )˜? “;Š#‚ ƒ(^ Uµ P³Až "˜? ƒ_¶O€I/* utility */
#include "fcintl.h"
#include "log.h"
#include "support.h"

/* client */
#include "chatline_common.h"	/* for append_output_window */
#include "client_main.h"
#include "clinet.h"		/* connect_to_server() */
#include "gui_main.h"

#include "connectdlg.h"
#include "widget.h"
#include "theme_engine.h"

#ifdef HAVE_WINSOCK
#define ECONNREFUSED WSAECONNREFUSED
#endif

static struct te_screen *screen;

****
  this regenerates the player information from a loaded game on the server.
*/
void handle_game_load(struct packet_game_load *packet)
{
  /* PORT ME */////  te_destroy_screen(screen);gui_set_rulesets(int num_rulesets, char **rulesets)
{
    /* PORTME */
}
ENDREP
DELTA 14427 130747 83
SVN  æ_çU …\ – …[¿ ßD‡/* common & utility *//* client */
#include "chatline_common.h"
#include "client_mainENDREP
DELTA 15296 2051 1081
SVN  ƒÙ0ƒÙV8 ˆ – ‚^ˆ¢ ƒÎ=Šs/* common & utility *//* client */
#include "client_mainENDREP
DELTA 5500 167973 1318
SVN  “„¡„’E G  …+H€‡( G  ˆ	‹?€„‹"SDL.h"

/* utility */
#include "fcintl.h"
#include "log.h"

/* common */
#include "game.h"
#include "government.h"

/* client */
#include "client_main.h"
#include "helpdata.h"

/* gui-sdl */
#include "colors.h"
#include "graphics.h"
#include "gui_id.h"
#include "gui_main.h"
#include "gui_tilespec.h"
#include "mapview.h"
#include "repodlgs.h"
#include "sprite.h"
#include "themespec.h"
#include "widget.h"

#include "helpdlg.h"

static struct ADVANCED_DLG *pHelpDlg = NULL;

struct TECHS_BUTTONS {
  struct widget *pTargets[6], *pSub_Targets[6];
  struct widget *pRequirementButton[2], *pSub_Req[4];
  struct widget *pDock;
  bool show_tree;
  bool show_full_tree;
};

struct UNITS_BUTTONS {
  struct widget *pObsoleteByButton;
  struct widget *pRequirementButton;
  struct widget *pDock;
};

enum help_page_type current_help_dlg = HELP_LAST;

static const int bufsz = 8192;

static int change_tech_callback(struct widget *pWidget);

if (pHelpDlg)
  {
    popdown_window_group_dialog(pHelpDlg->pBeginWidgetList,
                                           pHelpDlg->pEndWidgetList);
    FC_FREE(pHelpDlg->pScroll);
    FC_FREE(pHelpDlg);
    current_help_dlg = HELP_LAST;
  }
}

static int help_dlg_window_callback(struct widget *pWindow)
{
  return -1;
}

static int exit_help_dlg_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    popdown_help_dialog();
    flush_dirty();
  }
  return -1;
}

/* =============================================== */

static int change_gov_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    popup_gov_info(MAX_ID - pWidget->ID);
  }
  return -1;
}

void popup_gov_info(int gov)
{
}


static int change_impr_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    popup_impr_info(MAX_ID - pWidget->ID);
  }
  return -1;
}

static void redraw_impr_info_dlg(void)
{
  SDL_Color bg_color = {255, 255, 255, 64};

  struct widget *pWindow = pHelpDlg->pEndWidgetList;
  struct UNITS_BUTTONS *pStore = (struct UNITS_BUTTONS *)pWindow->data.ptr;
  SDL_Rect dst;

  redraw_group(pWindow->prev, pWindow, FALSE);

  dst.x = pStore->pDock->prev->size.x - adj_size(10);
  dst.y = pStore->pDock->prev->size.y - adj_size(10);
  dst.w = pWindow->size.w - (dst.x - pWindow->size.x) - adj_size(10);
  dst.h = pWindow->size.h - (dst.y - pWindow->size.y) - adj_size(10);

  SDL_FillRectAlpha(pWindow->dst->surface, &dst, &bg_color);
  putframe(pWindow->dst->surface, dst.x , dst.y , dst.x + dst.w , dst.y + dst.h,
    map_rgba(pWindow->dst->surface->format, *get_game_colorRGB(COLOR_THEME_HELPDLG_FRAME)));

  /*------------------------------------- */
  redraw_group(pHelpDlg->pBeginWidgetList, pWindow->prev->prev, FALSE);
  widget_flush(pWindow);
}


void popup_impr_info(Impr_type_id impr)
{
  SDL_Color bg_color = {255, 255, 255, 128};

  struct widget *pWindow;
  struct UNITS_BUTTONS *pStore;

  struct widget *pCloseButton = NULL;
  struct widget *pListToggleButton = NULL;
  struct widget *pImprovementButton = NULL;
  struct widget *pImprNameLabel = NULL;
  struct widget *pCostLabel = NULL;
  struct widget *pUpkeepLabel = NULL;
  struct widget *pRequirementLabel = NULL;
  struct widget *pRequirementLabel2 = NULL;
  struct widget *pObsoleteByLabel = NULL;
  struct widget *pObsoleteByLabel2 = NULL;
  struct widget *pHelptextLabel = NULL;
  
  struct widget *pDock;
  SDL_String16 *pTitle, *pStr;
  SDL_Surface *pSurf;
  int h, start_x, start_y, impr_type_count;
  bool created, text = FALSE;
  int scrollbar_width = 0;
  struct impr_type *pImpr_type;
  char buffer[64000];
  SDL_Rect area;

  if(current_help_dlg != HELP_IMPROVEMENT) {
    popdown_help_dialog();
  }

  if (!pHelpDlg) {
    SDL_Surface *pBackgroundTmpl, *pBackground, *pText, *pIcon;
    SDL_Rect dst;

    current_help_dlg = HELP_IMPROVEMENT;
    created = TRUE;
    
    /* create dialog */
    pHelpDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG));
    pStore = fc_calloc(1, sizeof(struct UNITS_BUTTONS));

    /* create window */
    pTitle = create_str16_from_char(_("Help : Improvements"), adj_font(12));
    pTitle->style |= TTF_STYLE_BOLD;

    pWindow = create_window_skeleton(NULL, pTitle, WF_FREE_DATA);
    pWindow->action = help_dlg_window_callback;
    set_wstate(pWindow , FC_WS_NORMAL);
    pWindow->data.ptr = (void *)pStore;
    add_to_gui_list(ID_WINDOW, pWindow);
    
    pHelpDlg->pEndWidgetList = pWindow;

    area = pWindow->area;
    /* ------------------ */

    /* close button */
    pCloseButton = create_themeicon(pTheme->Small_CANCEL_Icon, pWindow->dst,
                                    WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
    pCloseButton->string16 = create_str16_from_char(_("Close Dialog (Esc)"), adj_font(12));
    pCloseButton->action = exit_help_dlg_callback;
    set_wstate(pCloseButton, FC_WS_NORMAL);
    pCloseButton->key = SDLK_ESCAPE;

    add_to_gui_list(ID_BUTTON, pCloseButton);

    /* ------------------ */
    pDock = pCloseButton;

    pStr = create_string16(NULL, 0, adj_font(10));
    pStr->style |= (TTF_STYLE_BOLD | SF_CENTER);

    /* background template for entries in scroll list */
    pBackgroundTmpl = create_surf_alpha(adj_size(135), adj_size(40), SDL_SWSURFACE);
    SDL_FillRect(pBackgroundTmpl, NULL, map_rgba(pBackgroundTmpl->format, bg_color));
    putframe(pBackgroundTmpl, 0, 0, pBackgroundTmpl->w - 1, pBackgroundTmpl->h - 1,
             map_rgba(pBackgroundTmpl->format, *get_game_colorRGB(COLOR_THEME_HELPDLG_FRAME)));

    impr_type_count = 0;
    improvement_iterate(pImprove) {
      
      /* copy background surface */  
      pBackground = SDL_DisplayFormatAlpha(pBackgroundTmpl);
      
      /* blit improvement name */
      copy_chars_to_string16(pStr, improvement_name_translation(pImprove));
      pText = create_text_surf_smaller_that_w(pStr, adj_size(100 - 4));
      dst.x = adj_size(40) + (pBackground->w - pText->w - adj_size(40)) / 2;
      dst.y = (pBackground->h - pText->h) / 2;
      alphablit(pText, NULL, pBackground, &dst);
      FREESURFACE(pText);

      /* blit improvement icon */
      pIcon = ResizeSurfaceBox(get_building_surface(pImprove),
                               adj_size(36), adj_size(36), 1, TRUE, TRUE);
      dst.x = adj_size(5);
      dst.y = (pBackground->h - pIcon->h) / 2;
      alphablit(pIcon, NULL, pBackground, &dst);
      FREESURFACE(pIcon);

      pImprovementButton = create_icon2(pBackground, pWindow->dst,
                                        WF_FREE_THEME | WF_RESTORE_BACKGROUND);

      set_wstate(pImprovementButton, FC_WS_NORMAL);
      pImprovementButton->action = change_impr_callback;
      add_to_gui_list(MAX_ID - improvement_number(pImprove), pImprovementButton);

      if (++impr_type_count > 10) {
        set_wflag(pImprovementButton, WF_HIDDEN);
      }

    } improvement_iterate_end;

    FREESURFACE(pBackgroundTmpl);

    pHelpDlg->pEndActiveWidgetList = pDock->prev;
    pHelpDlg->pBeginWidgetList = pImprovementButton ? pImprovementButton : pCloseButton;
    pHelpDlg->pBeginActiveWidgetList = pHelpDlg->pBeginWidgetList;

    if (impr_type_count > 10) {
      pHelpDlg->pActiveWidgetList = pHelpDlg->pEndActiveWidgetList;
      scrollbar_width = create_vertical_scrollbar(pHelpDlg, 1, 10, TRUE, TRUE);
    }

    /* toggle techs list button */
    pListToggleButton = create_themeicon_button_from_chars(pTheme->UP_Icon,
                                                           pWindow->dst,
                                                           _("Improvements"),
                                                           adj_font(10), 0);
#if 0
   pListToggleButton->action = toggle_full_tree_mode_in_help_dlg_callback;
   if (pStore->show_tree) {
      set_wstate(pListToggleButton, FC_WS_NORMAL);
   }
#endif

    widget_resize(pListToggleButton, adj_size(160), adj_size(15));
    pListToggleButton->string16->fgcol = *get_game_colorRGB(COLOR_THEME_HELPDLG_TEXT);

    add_to_gui_list(ID_BUTTON, pListToggleButton);

    pDock = pListToggleButton;
    pStore->pDock = pDock;
  } else {
    created = FALSE;
    scrollbar_width = (pHelpDlg->pScroll ? pHelpDlg->pScroll->pUp_Left_Button->size.w : 0);
    pWindow = pHelpDlg->pEndWidgetList;
    pStore = (struct UNITS_BUTTONS *)pWindow->data.ptr;
    pDock = pStore->pDock;

    area = pWindow->area;

    /* delete any previous list entries */
    if (pDock != pHelpDlg->pBeginWidgetList) {
      del_group_of_widgets_from_gui_list(pHelpDlg->pBeginWidgetList,
                                         pDock->prev);
      pHelpDlg->pBeginWidgetList = pDock;
    }
  }

  pImpr_type = improvement_by_number(impr);

  pSurf = get_building_surface(pImpr_type);
  pImprNameLabel = create_iconlabel_from_chars(
                     ResizeSurfaceBox(pSurf, adj_size(64), adj_size(48), 1, TRUE, TRUE),
                     pWindow->dst, city_improvement_name_translation(NULL, pImpr_type),
                     adj_font(24), WF_FREE_THEME);

  pImprNameLabel->ID = ID_LABEL;
  DownAdd(pImprNameLabel, pDock);
  pDock = pImprNameLabel;

  if (!improvement_has_flag(pImpr_type, IF_GOLD)) {
    sprintf(buffer, "%s %d", _("Cost:"), impr_build_shield_cost(pImpr_type));
    pCostLabel = create_iconlabel_from_chars(NULL, pWindow->dst,
                                             buffer, adj_font(12), 0);
    pCostLabel->ID = ID_LABEL;
    DownAdd(pCostLabel, pDock);
    pDock = pCostLabel;
    
    if (!is_wonder(pImpr_type)) {
      sprintf(buffer, "%s %d", _("Upkeep:"), pImpr_type->upkeep);
      pUpkeepLabel = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                 buffer, adj_font(12), 0);
      pUpkeepLabel->ID = ID_LABEL;
      DownAdd(pUpkeepLabel, pDock);
      pDock = pUpkeepLabel;
    }
  }
  
  /* requirement */
  pRequirementLabel = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                  _("Requirement:"),
                                                  adj_font(12), 0);
  pRequirementLabel->ID = ID_LABEL;
  DownAdd(pRequirementLabel, pDock);
  pDock = pRequirementLabel;

  if (!(requirement_vector_size(&pImpr_type->reqs) > 0)) {
    pRequirementLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                     _("None"),
                                                     adj_font(12), 0);
    pRequirementLabel2->ID = ID_LABEL;
  } else {
    /* FIXME: this should show ranges and all the MAX_NUM_REQS reqs.
     * Currently it's limited to 1 req. Remember MAX_NUM_REQS is a compile-time
     * definition. */
    requirement_vector_iterate(&pImpr_type->reqs, preq) {
      pRequirementLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst,
                             universal_name_translation(&preq->source, buffer, sizeof(buffer)),
                             adj_font(12), WF_RESTORE_BACKGROUND);
      pRequirementLabel2->ID = MAX_ID - advance_number(preq->source.value.advance);
      pRequirementLabel2->string16->fgcol = *get_tech_color(advance_number(preq->source.value.advance));
      pRequirementLabel2->action = change_tech_callback;
      set_wstate(pRequirementLabel2, FC_WS_NORMAL);
      break;
    } requirement_vector_iterate_end;
  }
  DownAdd(pRequirementLabel2, pDock);
  pDock = pRequirementLabel2;
  pStore->pRequirementButton = pRequirementLabel2;

  /* obsolete by */
  pObsoleteByLabel = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                 _("Obsolete by:"),
                                                 adj_font(12), 0);
  pObsoleteByLabel->ID = ID_LABEL;
  DownAdd(pObsoleteByLabel, pDock);
  pDock = pObsoleteByLabel;

  if (A_NEVER == pImpr_type->obsolete_by) {
    pObsoleteByLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                    _("Never"), adj_font(12), 0);
    pObsoleteByLabel2->ID = ID_LABEL;
  } else {
    pObsoleteByLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst,
                          advance_name_translation(pImpr_type->obsolete_by),
                          adj_font(12), WF_RESTORE_BACKGROUND);
    pObsoleteByLabel2->ID = MAX_ID - advance_number(pImpr_type->obsolete_by);
    pObsoleteByLabel2->string16->fgcol = *get_tech_color(advance_number(pImpr_type->obsolete_by));
    pObsoleteByLabel2->action = change_tech_callback;
    set_wstate(pObsoleteByLabel2, FC_WS_NORMAL);
  }
  DownAdd(pObsoleteByLabel2, pDock);
  pDock = pObsoleteByLabel2;
  pStore->pObsoleteByButton = pObsoleteByLabel2;

  /* helptext */
  start_x = (area.x + 1 + scrollbar_width + pHelpDlg->pEndActiveWidgetList->size.w + adj_size(20));

  buffer[0] = '\0';
  helptext_building(buffer, sizeof(buffer), client.conn.playing, NULL, pImpr_type);
  if (buffer[0] != '\0')
  {
    SDL_String16 *pStr = create_str16_from_char(buffer, adj_font(12));
    convert_string_to_const_surface_width(pStr, adj_size(640) - start_x - adj_size(20));
    pHelptextLabel = create_iconlabel(NULL, pWindow->dst, pStr, 0);
    pHelptextLabel->ID = ID_LABEL;
    DownAdd(pHelptextLabel, pDock);
    pDock = pHelptextLabel;
    text = TRUE;
  }

  pHelpDlg->pBeginWidgetList = pHelptextLabel ? pHelptextLabel : pObsoleteByLabel2;

  /* --------------------------------------------------------- */
  if (created) {
        
    pSurf = theme_get_background(theme, BACKGROUND_HELPDLG);
    if (resize_window(pWindow, pSurf, NULL, adj_size(640), adj_size(480))) {
      FREESURFACE(pSurf);
    }

    area = pWindow->area;

    widget_set_position(pWindow,
                        (Main.screen->w - pWindow->size.w) / 2,
                        (Main.screen->h - pWindow->size.h) / 2);

    /* exit button */
    pCloseButton = pWindow->prev;
    widget_set_position(pCloseButton,
                        area.x + area.w - pCloseButton->size.w - 1,
                        pWindow->size.y + adj_size(2));

    /* list toggle button */
    pListToggleButton = pStore->pDock;
    widget_set_position(pListToggleButton, area.x, area.y);

    /* list entries */
    h = setup_vertical_widgets_position(1, area.x + scrollbar_width,
                                           area.y + pListToggleButton->size.h, 0, 0,
                                           pHelpDlg->pBeginActiveWidgetList,
                                           pHelpDlg->pEndActiveWidgetList);

    /* scrollbar */
    if (pHelpDlg->pScroll) {
      setup_vertical_scrollbar_area(pHelpDlg->pScroll,
                                    area.x, area.y + pListToggleButton->size.h,
                                    h, FALSE);
    }
  }

  pImprNameLabel = pStore->pDock->prev;
  widget_set_position(pImprNameLabel, start_x, area.y + adj_size(16));
  
  start_y = pImprNameLabel->size.y + pImprNameLabel->size.h + adj_size(10);

  if (!improvement_has_flag(pImpr_type, IF_GOLD)) {
    pCostLabel = pImprNameLabel->prev;
    widget_set_position(pCostLabel, start_x, start_y);
    if (!is_wonder(pImpr_type)) {
      pUpkeepLabel = pCostLabel->prev;
      widget_set_position(pUpkeepLabel,
                          pCostLabel->size.x + pCostLabel->size.w + adj_size(20),
                          start_y);
    }
    start_y += pCostLabel->size.h;
  }

  pRequirementLabel = pStore->pRequirementButton->next;
  widget_set_position(pRequirementLabel, start_x, start_y);

  pRequirementLabel2 = pStore->pRequirementButton;
  widget_set_position(pRequirementLabel2,
                      pRequirementLabel->size.x + pRequirementLabel->size.w + adj_size(5),
                      start_y);

  if (pStore->pObsoleteByButton) {
    pObsoleteByLabel = pStore->pObsoleteByButton->next;
    widget_set_position(pObsoleteByLabel,
                        pRequirementLabel2->size.x + pRequirementLabel2->size.w + adj_size(10),
                        start_y);

    pObsoleteByLabel2 = pStore->pObsoleteByButton;
    widget_set_position(pObsoleteByLabel2,
                        pObsoleteByLabel->size.x + pObsoleteByLabel->size.w + adj_size(5),
                        start_y);
                        
    start_y += pObsoleteByLabel2->size.h;
  }

  start_y += adj_size(30);
  
  if (text) {
    widget_set_position(pHelptextLabel, start_x, start_y);
  }

  redraw_impr_info_dlg();
}

/* ============================================ */
static int change_unit_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    popup_unit_info(MAX_ID - pWidget->ID);
  }
  return -1;
}

static void redraw_unit_info_dlg(void)
{
  SDL_Color bg_color = {255, 255, 255, 64};

  struct widget *pWindow = pHelpDlg->pEndWidgetList;
  struct UNITS_BUTTONS *pStore = (struct UNITS_BUTTONS *)pWindow->data.ptr;
  SDL_Rect dst;

  redraw_group(pWindow->prev, pWindow, FALSE);

  dst.x = pStore->pDock->prev->size.x - adj_size(10);
  dst.y = pStore->pDock->prev->size.y - adj_size(10);
  dst.w = pWindow->size.w - (dst.x - pWindow->size.x) - adj_size(10);
  dst.h = pWindow->size.h - (dst.y - pWindow->size.y) - adj_size(10);

  SDL_FillRectAlpha(pWindow->dst->surface, &dst, &bg_color);
  putframe(pWindow->dst->surface, dst.x , dst.y , dst.x + dst.w , dst.y + dst.h,
    map_rgba(pWindow->dst->surface->format, *get_game_colorRGB(COLOR_THEME_HELPDLG_FRAME)));

  /*------------------------------------- */
  redraw_group(pHelpDlg->pBeginWidgetList, pWindow->prev->prev, FALSE);
  widget_flush(pWindow);
}


void popup_unit_info(Unit_type_id type_id)
{
  SDL_Color bg_color = {255, 255, 255, 128};

  struct widget *pWindow;
  struct UNITS_BUTTONS *pStore;

  struct widget *pCloseButton = NULL;
  struct widget *pListToggleButton = NULL;
  struct widget *pUnitButton = NULL;
  struct widget *pUnitNameLabel = NULL;
  struct widget *pUnitInfoLabel = NULL;
  struct widget *pRequirementLabel = NULL;
  struct widget *pRequirementLabel2 = NULL;
  struct widget *pObsoleteByLabel = NULL;
  struct widget *pObsoleteByLabel2 = NULL;
  struct widget *pHelptextLabel = NULL;

  struct widget *pDock;
  SDL_String16 *pTitle, *pStr;
  SDL_Surface *pSurf;
  int h, start_x, start_y, utype_count;
  bool created, text = FALSE;
  int scrollbar_width = 0;
  struct unit_type *pUnitType;
  char buffer[bufsz];
  SDL_Rect area;

  if(current_help_dlg != HELP_UNIT) {
    popdown_help_dialog();
  }

  /* create new dialog if it doesn't exist yet */
  if (!pHelpDlg) {
    SDL_Surface *pBackgroundTmpl, *pBackground, *pText, *pIcon;
    SDL_Rect dst;

    current_help_dlg = HELP_UNIT;
    created = TRUE;

    /* create dialog */
    pHelpDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG));
    pStore = fc_calloc(1, sizeof(struct UNITS_BUTTONS));

    /* create window */
    pTitle = create_str16_from_char(_("Help : Units"), adj_font(12));
    pTitle->style |= TTF_STYLE_BOLD;

    pWindow = create_window_skeleton(NULL, pTitle, WF_FREE_DATA);
    pWindow->action = help_dlg_window_callback;
    set_wstate(pWindow , FC_WS_NORMAL);
    pWindow->data.ptr = (void *)pStore;
    add_to_gui_list(ID_WINDOW, pWindow);

    pHelpDlg->pEndWidgetList = pWindow;

    area = pWindow->area;

    /* ------------------ */

    /* close button */
    pCloseButton = create_themeicon(pTheme->Small_CANCEL_Icon, pWindow->dst,
                                    WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
    pCloseButton->string16 = create_str16_from_char(_("Close Dialog (Esc)"), adj_font(12));
    pCloseButton->action = exit_help_dlg_callback;
    set_wstate(pCloseButton, FC_WS_NORMAL);
    pCloseButton->key = SDLK_ESCAPE;

    add_to_gui_list(ID_BUTTON, pCloseButton);

    /* ------------------ */
    pDock = pCloseButton;

    /* --- create scrollable unit list on the left side ---*/

    pStr = create_string16(NULL, 0, adj_font(10));
    pStr->style |= (TTF_STYLE_BOLD | SF_CENTER);

    /* background template for entries in scroll list */
    pBackgroundTmpl = create_surf_alpha(adj_size(135), adj_size(40), SDL_SWSURFACE);
    SDL_FillRect(pBackgroundTmpl, NULL, map_rgba(pBackgroundTmpl->format, bg_color));
    putframe(pBackgroundTmpl, 0, 0, pBackgroundTmpl->w - 1, pBackgroundTmpl->h - 1,
             map_rgba(pBackgroundTmpl->format, *get_game_colorRGB(COLOR_THEME_HELPDLG_FRAME)));

    utype_count = 0;
    unit_type_iterate(ut) {

      /* copy background surface */
      pBackground = SDL_DisplayFormatAlpha(pBackgroundTmpl);

      /* blit unit name */
      copy_chars_to_string16(pStr, utype_name_translation(ut));
      pText = create_text_surf_smaller_that_w(pStr, adj_size(100 - 4));
      dst.x = adj_size(35) + (pBackground->w - pText->w - adj_size(35)) / 2;
      dst.y = (pBackground->h - pText->h) / 2;
      alphablit(pText, NULL, pBackground, &dst);
      FREESURFACE(pText);

      /* blit unit icon */
      pIcon = ResizeSurfaceBox(get_unittype_surface(ut),
                               adj_size(36), adj_size(36), 1, TRUE, TRUE);
      dst.x = (adj_size(35) - pIcon->w) / 2;
      dst.y = (pBackground->h - pIcon->h) / 2;
      alphablit(pIcon, NULL, pBackground, &dst);
      FREESURFACE(pIcon);

      pUnitButton = create_icon2(pBackground, pWindow->dst,
                                 WF_FREE_THEME | WF_RESTORE_BACKGROUND);

      set_wstate(pUnitButton, FC_WS_NORMAL);
      pUnitButton->action = change_unit_callback;
      add_to_gui_list(MAX_ID - utype_number(ut), pUnitButton);

      if (++utype_count > 10) {
        set_wflag(pUnitButton, WF_HIDDEN);
      }

    } unit_type_iterate_end;

    FREESURFACE(pBackgroundTmpl);

    pHelpDlg->pEndActiveWidgetList = pDock->prev;
    pHelpDlg->pBeginWidgetList = pUnitButton ? pUnitButton : pCloseButton;
    pHelpDlg->pBeginActiveWidgetList = pHelpDlg->pBeginWidgetList;

    if (utype_count > 10) {
      pHelpDlg->pActiveWidgetList = pHelpDlg->pEndActiveWidgetList;
      scrollbar_width = create_vertical_scrollbar(pHelpDlg, 1, 10, TRUE, TRUE);
    }

    /* toggle techs list button */
    pListToggleButton = create_themeicon_button_from_chars(pTheme->UP_Icon,
                          pWindow->dst,  _("Units"), adj_font(10), 0);
#if 0
    pListToggleButton->action = toggle_full_tree_mode_in_help_dlg_callback;
    if (pStore->show_tree) {
      set_wstate(pListToggleButton, FC_WS_NORMAL);
    }
#endif

    widget_resize(pListToggleButton, adj_size(160), adj_size(15));
    pListToggleButton->string16->fgcol = *get_game_colorRGB(COLOR_THEME_HELPDLG_TEXT);

    add_to_gui_list(ID_BUTTON, pListToggleButton);

    pDock = pListToggleButton;
    pStore->pDock = pDock;
  } else {
    created = FALSE;
    scrollbar_width = (pHelpDlg->pScroll ? pHelpDlg->pScroll->pUp_Left_Button->size.w : 0);
    pWindow = pHelpDlg->pEndWidgetList;
    pStore = (struct UNITS_BUTTONS *)pWindow->data.ptr;
    pDock = pStore->pDock;

    area = pWindow->area;

    /* delete any previous list entries */
    if (pDock != pHelpDlg->pBeginWidgetList) {
      del_group_of_widgets_from_gui_list(pHelpDlg->pBeginWidgetList,
                                         pDock->prev);
      pHelpDlg->pBeginWidgetList = pDock;
    }
  }

  pUnitType = utype_by_number(type_id);
  pUnitNameLabel= create_iconlabel_from_chars(
                adj_surf(get_unittype_surface(pUnitType)),
                pWindow->dst, utype_name_translation(pUnitType),
                adj_font(24), WF_FREE_THEME);

  pUnitNameLabel->ID = ID_LABEL;
  DownAdd(pUnitNameLabel, pDock);
  pDock = pUnitNameLabel;


  {
    char buf[2048];

    my_snprintf(buf, sizeof(buf), "%s %d %s",
              _("Cost:"), utype_build_shield_cost(pUnitType),
              PL_("shield", "shields", utype_build_shield_cost(pUnitType)));

    if(pUnitType->pop_cost)
    {
      cat_snprintf(buf, sizeof(buf), " %d %s",
          pUnitType->pop_cost, PL_("citizen", "citizens", pUnitType->pop_cost));
    }

    cat_snprintf(buf, sizeof(buf), "      %s",  _("Upkeep:"));

    if(pUnitType->upkeep[O_SHIELD])
    {
      cat_snprintf(buf, sizeof(buf), " %d %s",
          pUnitType->upkeep[O_SHIELD], PL_("shield", "shields", pUnitType->upkeep[O_SHIELD]));
     }
    if(pUnitType->upkeep[O_FOOD])
    {
      cat_snprintf(buf, sizeof(buf), " %d %s",
          pUnitType->upkeep[O_FOOD], PL_("food", "foods", pUnitType->upkeep[O_FOOD]));
    }
    if(pUnitType->upkeep[O_GOLD])
    {
      cat_snprintf(buf, sizeof(buf), " %d %s",
          pUnitType->upkeep[O_GOLD], PL_("gold", "golds", pUnitType->upkeep[O_GOLD]));
    }
    if(pUnitType->happy_cost)
    {
      cat_snprintf(buf, sizeof(buf), " %d %s",
          pUnitType->happy_cost, PL_("citizen", "citizens", pUnitType->happy_cost));
    }

    cat_snprintf(buf, sizeof(buf), "\n%s %d %s %d %s %d\n%s %d %s %d %s %d",
              _("Attack:"), pUnitType->attack_strength,
              _("Defense:"), pUnitType->defense_strength,
              _("Move:"), pUnitType->move_rate / SINGLE_MOVE,
              _("Vision:"), pUnitType->vision_radius_sq,
              _("FirePower:"), pUnitType->firepower,
              _("Hitpoints:"), pUnitType->hp);

    pUnitInfoLabel = create_iconlabel_from_chars(NULL, pWindow->dst, buf,
                                                 adj_font(12), 0);
    pUnitInfoLabel->ID = ID_LABEL;
    DownAdd(pUnitInfoLabel, pDock);
    pDock = pUnitInfoLabel;
  }

  /* requirement */
  pRequirementLabel = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                  _("Requirement:"),
                                                  adj_font(12), 0);
  pRequirementLabel->ID = ID_LABEL;
  DownAdd(pRequirementLabel, pDock);
  pDock = pRequirementLabel;

  if(A_NEVER == pUnitType->require_advance ||
     advance_by_number(A_NONE) == pUnitType->require_advance) {
    pRequirementLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                     _("None"), adj_font(12), 0);
    pRequirementLabel2->ID = ID_LABEL;
  } else {
    pRequirementLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst,
          advance_name_translation(pUnitType->require_advance),
          adj_font(12),
                          WF_RESTORE_BACKGROUND);
    pRequirementLabel2->ID = MAX_ID - advance_number(pUnitType->require_advance);
    pRequirementLabel2->string16->fgcol = *get_tech_color(advance_number(pUnitType->require_advance));
    pRequirementLabel2->action = change_tech_callback;
    set_wstate(pRequirementLabel2, FC_WS_NORMAL);
  }
  DownAdd(pRequirementLabel2, pDock);
  pDock = pRequirementLabel2;
  pStore->pRequirementButton = pRequirementLabel2;

  /* obsolete by */
  pObsoleteByLabel = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                 _("Obsolete by:"),
                                                 adj_font(12), 0);
  pObsoleteByLabel->ID = ID_LABEL;
  DownAdd(pObsoleteByLabel, pDock);
  pDock = pObsoleteByLabel;

  if (pUnitType->obsoleted_by == U_NOT_OBSOLETED) {
    pObsoleteByLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                    _("None"),
                                                    adj_font(12), 0);
    pObsoleteByLabel2->ID = ID_LABEL;
  } else {
    struct unit_type *utype = pUnitType->obsoleted_by;
    pObsoleteByLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst,
                                                    utype_name_translation(utype),
                                                    adj_font(12),
                                                    WF_RESTORE_BACKGROUND);
    pObsoleteByLabel2->string16->fgcol = *get_tech_color(advance_number(utype->require_advance));
    pObsoleteByLabel2->ID = MAX_ID - utype_number(pUnitType->obsoleted_by);
    pObsoleteByLabel2->action = change_unit_callback;
    set_wstate(pObsoleteByLabel2, FC_WS_NORMAL);
  }
  DownAdd(pObsoleteByLabel2, pDock);
  pDock = pObsoleteByLabel2;
  pStore->pObsoleteByButton = pObsoleteByLabel2;

  /* helptext */
  start_x = (area.x + 1 + scrollbar_width + pHelpDlg->pActiveWidgetList->size.w + adj_size(20));

  buffer[0] = '\0';
  helptext_unit(buffer, sizeof(buffer), client.conn.playing, "", utype_by_number(type_id));
  if (buffer[0] != '\0') {
    SDL_String16 *pStr = create_str16_from_char(buffer, adj_font(12));
    convert_string_to_const_surface_width(pStr, adj_size(640) - start_x - adj_size(20));
    pHelptextLabel = create_iconlabel(NULL, pWindow->dst, pStr, 0);
    pHelptextLabel->ID = ID_LABEL;
    DownAdd(pHelptextLabel, pDock);
    pDock = pHelptextLabel;
    text = TRUE;
  }

  pHelpDlg->pBeginWidgetList = pHelptextLabel ? pHelptextLabel : pObsoleteByLabel2;

  /* --------------------------------------------------------- */
  if (created) {

    pSurf = theme_get_background(theme, BACKGROUND_HELPDLG);
    if (resize_window(pWindow, pSurf, NULL, adj_size(640), adj_size(480))) {
      FREESURFACE(pSurf);
    }

    area = pWindow->area;

    widget_set_position(pWindow,
                        (Main.screen->w - pWindow->size.w) / 2,
                        (Main.screen->h - pWindow->size.h) / 2);

    /* exit button */
    pCloseButton = pWindow->prev;
    widget_set_position(pCloseButton,
                        area.x + area.w - pCloseButton->size.w - 1,
                        pWindow->size.y + adj_size(2));

    /* list toggle button */
    pListToggleButton = pStore->pDock;
    widget_set_position(pListToggleButton, area.x, area.y);

    /* list entries */
    h = setup_vertical_widgets_position(1, area.x + scrollbar_width,
                                           area.y + pListToggleButton->size.h, 0, 0,
                                           pHelpDlg->pBeginActiveWidgetList,
                                           pHelpDlg->pEndActiveWidgetList);

    /* scrollbar */
    if (pHelpDlg->pScroll) {
      setup_vertical_scrollbar_area(pHelpDlg->pScroll,
                                    area.x, area.y + pListToggleButton->size.h,
                                    h, FALSE);
    }
  }

  pUnitNameLabel = pStore->pDock->prev;
  widget_set_position(pUnitNameLabel, start_x, area.y + adj_size(16));

  start_y = pUnitNameLabel->size.y + pUnitNameLabel->size.h + adj_size(10);

  pUnitInfoLabel = pUnitNameLabel->prev;
  widget_set_position(pUnitInfoLabel, start_x, start_y);

  start_y += pUnitInfoLabel->size.h;

  pRequirementLabel = pStore->pRequirementButton->next;
  widget_set_position(pRequirementLabel, start_x, start_y);

  pRequirementLabel2 = pStore->pRequirementButton;
  widget_set_position(pRequirementLabel2,
                      pRequirementLabel->size.x + pRequirementLabel->size.w + adj_size(5),
                      start_y);

  pObsoleteByLabel = pStore->pObsoleteByButton->next;
  widget_set_position(pObsoleteByLabel,
                      pRequirementLabel2->size.x + pRequirementLabel2->size.w + adj_size(10),
                      start_y);

  pObsoleteByLabel2 = pStore->pObsoleteByButton;
  widget_set_position(pObsoleteByLabel2,
                      pObsoleteByLabel->size.x + pObsoleteByLabel->size.w + adj_size(5),
                      start_y);

  start_y += pObsoleteByLabel2->size.h + adj_size(20);

  if (text) {
    pHelptextLabel = pStore->pObsoleteByButton->prev;
    widget_set_position(pHelptextLabel, start_x, start_y);
  }

  redraw_unit_info_dlg();
}

/* =============================================== */
/* ==================== Tech Tree ================ */
/* =============================================== */


static int change_tech_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    popup_tech_info(MAX_ID - pWidget->ID);
  }
  return -1;
}

static int show_help_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct TECHS_BUTTONS *pStore = (struct TECHS_BUTTONS *)pHelpDlg->pEndWidgetList->data.ptr;
    pStore->show_tree = !pStore->show_tree;
    if (!pStore->show_tree)
    {
      pStore->show_full_tree = FALSE;
      pStore->pDock->theme2 = pTheme->UP_Icon;
    }
    popup_tech_info(MAX_ID - pStore->pDock->prev->ID);
  }
  return -1;
}

static void redraw_tech_info_dlg(void)
{
  SDL_Color bg_color = {255, 255, 255, 64};

  struct widget *pWindow = pHelpDlg->pEndWidgetList;
  struct TECHS_BUTTONS *pStore = (struct TECHS_BUTTONS *)pWindow->data.ptr;
  SDL_Surface *pText0, *pText1 = NULL;
  SDL_String16 *pStr;
  SDL_Rect dst;

  redraw_group(pWindow->prev, pWindow, FALSE);

  dst.x = pStore->pDock->prev->prev->size.x - adj_size(10);
  dst.y = pStore->pDock->prev->prev->size.y - adj_size(10);
  dst.w = pWindow->size.w - (dst.x - pWindow->size.x) - adj_size(10);
  dst.h = pWindow->size.h - (dst.y - pWindow->size.y) - adj_size(10);

  SDL_FillRectAlpha(pWindow->dst->surface, &dst, &bg_color);
  putframe(pWindow->dst->surface, dst.x , dst.y , dst.x + dst.w , dst.y + dst.h,
    map_rgba(pWindow->dst->surface->format, *get_game_colorRGB(COLOR_THEME_HELPDLG_FRAME)));

  /* -------------------------- */
  pStr = create_str16_from_char(_("Allows"), adj_font(14));
  pStr->style |= TTF_STYLE_BOLD;

  pText0 = create_text_surf_from_str16(pStr);
  dst.x = pStore->pDock->prev->prev->size.x;
  if (pStore->pTargets[0])
  {
    dst.y = pStore->pTargets[0]->size.y - pText0->h;
  } else {
    dst.y = pStore->pDock->prev->prev->size.y
              + pStore->pDock->prev->prev->size.h + adj_size(10);
  }

  alphablit(pText0, NULL, pWindow->dst->surface, &dst);
  FREESURFACE(pText0);

  if (pStore->pSub_Targets[0])
  {
    int i;

    change_ptsize16(pStr, adj_font(12));

    copy_chars_to_string16(pStr, _("( with "));
    pText0 = create_text_surf_from_str16(pStr);

    copy_chars_to_string16(pStr, _(" )"));
    pText1 = create_text_surf_from_str16(pStr);
    i = 0;
    while(i < 6 && pStore->pSub_Targets[i])
    {
      dst.x = pStore->pSub_Targets[i]->size.x - pText0->w;
      dst.y = pStore->pSub_Targets[i]->size.y;

      alphablit(pText0, NULL, pWindow->dst->surface, &dst);
      dst.x = pStore->pSub_Targets[i]->size.x + pStore->pSub_Targets[i]->size.w;
      dst.y = pStore->pSub_Targets[i]->size.y;

      alphablit(pText1, NULL, pWindow->dst->surface, &dst);
      i++;
    }

    FREESURFACE(pText0);
    FREESURFACE(pText1);
  }
  FREESTRING16(pStr);

  redraw_group(pHelpDlg->pBeginWidgetList, pWindow->prev->prev, FALSE);
  widget_flush(pWindow);
}

static struct widget * create_tech_info(Tech_type_id tech, int width, struct widget *pWindow, struct TECHS_BUTTONS *pStore)
{
  struct widget *pWidget;
  struct widget *pLast, *pBudynki;
  struct widget *pDock = pStore->pDock;
  int i, targets_count,sub_targets_count, max_width = 0;
  int start_x, start_y, imp_count, unit_count, flags_count, gov_count;
  char buffer[bufsz];
  SDL_Surface *pSurf;

  start_x = (pWindow->area.x + adj_size(1) + width + pHelpDlg->pActiveWidgetList->size.w + adj_size(20));

  /* tech tree icon */
  pWidget = create_icon2(pTheme->Tech_Tree_Icon, pWindow->dst, WF_RESTORE_BACKGROUND);

  set_wstate(pWidget, FC_WS_NORMAL);
  pWidget->action = show_help_callback;
  pWidget->ID = MAX_ID - tech;
  DownAdd(pWidget, pDock);
  pDock = pWidget;

  /* tech name (heading) */
  pWidget= create_iconlabel_from_chars(get_tech_icon(tech),
                    pWindow->dst,
                    advance_name_translation(advance_by_number(tech)),
                    adj_font(24),
                    WF_FREE_THEME);

  pWidget->ID = ID_LABEL;
  DownAdd(pWidget, pDock);
  pDock = pWidget;

  /* target techs */
  targets_count = 0;
  advance_index_iterate(A_FIRST, i)
  {
    if ((targets_count < 6)
        && (advance_required(i, AR_ONE) == tech
           || advance_required(i, AR_TWO) == tech))
    {
      pWidget= create_iconlabel_from_chars(NULL, pWindow->dst,
              advance_name_translation(advance_by_number(i)),
              adj_font(12),
              WF_RESTORE_BACKGROUND);
      pWidget->string16->fgcol = *get_tech_color(i);
      max_width = MAX(max_width, pWidget->size.w);
      set_wstate(pWidget, FC_WS_NORMAL);
      pWidget->action = change_tech_callback;
      pWidget->ID = MAX_ID - i;
      DownAdd(pWidget, pDock);
      pDock = pWidget;
      pStore->pTargets[targets_count++] = pWidget;
    }
  } advance_index_iterate_end;
  if (targets_count < 6) {
    pStore->pTargets[targets_count] = NULL;
  }

  sub_targets_count = 0;
  if (targets_count > 0)
  {
    int sub_tech;
    for(i = 0; i < targets_count; i++)
    {
      sub_tech = MAX_ID - pStore->pTargets[i]->ID;
      if (advance_required(sub_tech, AR_ONE) == tech
       && advance_required(sub_tech, AR_TWO) != A_NONE)
      {
        sub_tech = advance_required(sub_tech, AR_TWO);
      } else if (advance_required(sub_tech, AR_TWO) == tech
              && advance_required(sub_tech, AR_ONE) != A_NONE)
      {
        sub_tech = advance_required(sub_tech, AR_ONE);
      } else {
        continue;
      }
      pWidget= create_iconlabel_from_chars(NULL, pWindow->dst,
              advance_name_translation(advance_by_number(sub_tech)),
              adj_font(12),
              WF_RESTORE_BACKGROUND);
      pWidget->string16->fgcol = *get_tech_color(sub_tech);
      set_wstate(pWidget, FC_WS_NORMAL);
      pWidget->action = change_tech_callback;
      pWidget->ID = MAX_ID - sub_tech;
      DownAdd(pWidget, pDock);
      pDock = pWidget;
      pStore->pSub_Targets[sub_targets_count++] = pWidget;
    }
  }
  if (sub_targets_count < 6)
  {
    pStore->pSub_Targets[sub_targets_count] = NULL;
  }

  /* fill array with iprvm. icons */
  pBudynki = pWidget;

  /* target governments */
  gov_count = 0;
  government_iterate(gov) {
    requirement_vector_iterate(&(gov->reqs), preq) {
      if (VUT_ADVANCE == preq->source.kind
       && advance_number(preq->source.value.advance) == tech) {

        pWidget = create_iconlabel_from_chars(adj_surf(get_government_surface(gov)),
                pWindow->dst,
                government_name_translation(gov),
                adj_font(14),
                WF_RESTORE_BACKGROUND|WF_SELLECT_WITHOUT_BAR | WF_FREE_THEME);
        set_wstate(pWidget, FC_WS_NORMAL);
        pWidget->action = change_gov_callback;
        pWidget->ID = MAX_ID - government_index(gov);
        DownAdd(pWidget, pDock);
        pDock = pWidget;
        gov_count++;
      }
    } requirement_vector_iterate_end;
  } government_iterate_end;

  /* target improvements */
  imp_count = 0;
  improvement_iterate(pImprove) {
    /* FIXME: this should show ranges and all the MAX_NUM_REQS reqs.
     * Currently it's limited to 1 req. Remember MAX_NUM_REQS is a compile-time
     * definition. */
    requirement_vector_iterate(&(pImprove->reqs), preq) {
      if (VUT_ADVANCE == preq->source.kind
       && advance_number(preq->source.value.advance) == tech) {
        pSurf = get_building_surface(pImprove);
        pWidget = create_iconlabel_from_chars(
                ResizeSurfaceBox(pSurf, adj_size(48), adj_size(48), 1, TRUE, TRUE),
                pWindow->dst,
                improvement_name_translation(pImprove),
                adj_font(14),
                WF_RESTORE_BACKGROUND|WF_SELLECT_WITHOUT_BAR);
        set_wstate(pWidget, FC_WS_NORMAL);
        if (is_wonder(pImprove))
        {
               pWidget->string16->fgcol = *get_game_colorRGB(COLOR_THEME_CITYDLG_LUX);
        }
        pWidget->action = change_impr_callback;
        pWidget->ID = MAX_ID - improvement_number(pImprove);
        DownAdd(pWidget, pDock);
        pDock = pWidget;
        imp_count++;
      }

      break;
    } requirement_vector_iterate_end;
  } improvement_iterate_end;

  unit_count = 0;
  unit_type_iterate(un) {
    struct unit_type *pUnitType = un;
    if (advance_number(pUnitType->require_advance) == tech) {
      pWidget = create_iconlabel_from_chars(
                  ResizeSurfaceBox(get_unittype_surface(un),
                                   adj_size(48), adj_size(48), 1, TRUE, TRUE),
                  pWindow->dst, utype_name_translation(pUnitType), adj_font(14),
                  (WF_FREE_THEME|WF_RESTORE_BACKGROUND|WF_SELLECT_WITHOUT_BAR));
      set_wstate(pWidget, FC_WS_NORMAL);
      pWidget->action = change_unit_callback;
      pWidget->ID = MAX_ID - utype_number(un);
      DownAdd(pWidget, pDock);
      pDock = pWidget;
      unit_count++;
    }
  } unit_type_iterate_end;

  buffer[0] = '\0';
  helptext_advance(buffer, sizeof(buffer), client.conn.playing, "", tech);
  if (buffer[0] != '\0')
  {
    SDL_String16 *pStr = create_str16_from_char(buffer, adj_font(12));
    convert_string_to_const_surface_width(pStr, adj_size(640) - start_x - adj_size(20));
    pWidget = create_iconlabel(NULL, pWindow->dst, pStr, 0);
    pWidget->ID = ID_LABEL;
    DownAdd(pWidget, pDock);
    pDock = pWidget;
    flags_count = 1;
  } else {
    flags_count = 0;
  }

  pLast = pWidget;
  /* --------------------------------------------- */

  /* tree button */
  pWidget = pStore->pDock->prev;
  pWidget->size.x = pWindow->area.x + pWindow->area.w - pWidget->size.w - adj_size(17);
  pWidget->size.y = pWindow->area.y + adj_size(16);

  /* Tech label */
  pWidget = pWidget->prev;
  pWidget->size.x = start_x;
  pWidget->size.y = pWindow->area.y + adj_size(16);
  start_y = pWidget->size.y + pWidget->size.h + adj_size(30);

  if (targets_count)
  {
    int j, t0, t1;

    i = 0;
    j = 0;
    t1 = MAX_ID - pStore->pSub_Targets[j]->ID;
    while(i < 6 && pStore->pTargets[i])
    {
      pStore->pTargets[i]->size.x = pWindow->size.x + start_x;
      pStore->pTargets[i]->size.y = start_y;

      if(pStore->pSub_Targets[j])
      {
        t0 = MAX_ID - pStore->pTargets[i]->ID;
        t1 = MAX_ID - pStore->pSub_Targets[j]->ID;
        if (advance_required(t0, AR_ONE) == t1
         || advance_required(t0, AR_TWO) == t1)
        {
          pStore->pSub_Targets[j]->size.x = pWindow->size.x + start_x + max_width + 60;
          pStore->pSub_Targets[j]->size.y = pStore->pTargets[i]->size.y;
          j++;
        }
      }

      start_y += pStore->pTargets[i]->size.h;
      i++;
    }

    start_y += adj_size(10);
  }
  pWidget = NULL;

  if (gov_count)
  {
    pWidget = pBudynki->prev;
    while(gov_count-- && pWidget)
    {
      pWidget->size.x = pWindow->size.x + start_x;
      pWidget->size.y = start_y;
      start_y += pWidget->size.h + adj_size(2);
      pWidget = pWidget->prev;
    }
  }

  if (imp_count)
  {
    if(!pWidget)
    {
      pWidget = pBudynki->prev;
    }
    while(imp_count-- && pWidget)
    {
      pWidget->size.x = pWindow->size.x + start_x;
      pWidget->size.y = start_y;
      start_y += pWidget->size.h + adj_size(2);
      pWidget = pWidget->prev;
    }
  }

  if (unit_count)
  {
    if(!pWidget)
    {
      pWidget = pBudynki->prev;
    }
    while(unit_count-- && pWidget)
    {
      pWidget->size.x = pWindow->size.x + start_x;
      pWidget->size.y = start_y;
      start_y += pWidget->size.h + adj_size(2);
      pWidget = pWidget->prev;
    }
  }

  if (flags_count)
  {
    if(!pWidget)
    {
      pWidget = pBudynki->prev;
    }
    while(flags_count-- && pWidget)
    {
      pWidget->size.x = pWindow->size.x + start_x;
      pWidget->size.y = start_y;
      start_y += pWidget->size.h + adj_size(2);
      pWidget = pWidget->prev;
    }
  }

  return pLast;
}


static void redraw_tech_tree_dlg(void)
{
  SDL_Color line_color = *get_game_colorRGB(COLOR_THEME_HELPDLG_LINE);
  SDL_Color bg_color = {255, 255, 255, 64};

  struct widget *pWindow = pHelpDlg->pEndWidgetList;
  struct widget *pSub0, *pSub1;
  struct TECHS_BUTTONS *pStore = (struct TECHS_BUTTONS *)pWindow->data.ptr;
  struct widget *pTech = pStore->pDock->prev;
  int i,j, tech, count, step, mod;
  SDL_Rect dst;

  /* Redraw Window with exit button */
  redraw_group(pWindow->prev, pWindow, FALSE);

  dst.x = pWindow->area.x + pWindow->area.w - adj_size(459) - adj_size(7);
  dst.y = pWindow->area.y + adj_size(6);
  dst.w = pWindow->area.w - (dst.x - pWindow->area.x) - adj_size(10);
  dst.h = pWindow->area.h - (dst.y - pWindow->area.y) - adj_size(10);

  SDL_FillRectAlpha(pWindow->dst->surface, &dst, &bg_color);
  putframe(pWindow->dst->surface, dst.x , dst.y , dst.x + dst.w , dst.y + dst.h,
    map_rgba(pWindow->dst->surface->format, *get_game_colorRGB(COLOR_THEME_HELPDLG_FRAME)));

  /* Draw Req arrows */
  i = 0;
  while(i < 4 && pStore->pSub_Req[i])
  {
    i++;
  }
  count = i;

  i = 0;
  while(i < 2 && pStore->pRequirementButton[i])
  {
    tech = MAX_ID - pStore->pRequirementButton[i]->ID;

    /*find Sub_Req's */
    if(i)
    {
      pSub0 = NULL;
      for(j=count - 1; j >= 0; j--)
      {
        if (MAX_ID - pStore->pSub_Req[j]->ID == advance_required(tech, AR_ONE))
        {
          pSub0 = pStore->pSub_Req[j];
          break;
        }
      }

      pSub1 = NULL;
      for(j=count - 1; j >= 0; j--)
      {
        if (MAX_ID - pStore->pSub_Req[j]->ID == advance_required(tech, AR_TWO))
        {
          pSub1 = pStore->pSub_Req[j];
          break;
        }
      }
    } else {
      pSub0 = NULL;
      for(j=0; j < 4 && pStore->pSub_Req[j]; j++)
      {
        if (MAX_ID - pStore->pSub_Req[j]->ID == advance_required(tech, AR_ONE))
        {
          pSub0 = pStore->pSub_Req[j];
          break;
        }
      }

      pSub1 = NULL;
      for(j=0; j < 4 && pStore->pSub_Req[j]; j++)
      {
        if (MAX_ID - pStore->pSub_Req[j]->ID == advance_required(tech, AR_TWO))
        {
          pSub1 = pStore->pSub_Req[j];
          break;
        }
      }
    }

    /* draw main Arrow */
    putline(pStore->pRequirementButton[i]->dst->surface,
        pStore->pRequirementButton[i]->size.x + pStore->pRequirementButton[i]->size.w,
        pStore->pRequirementButton[i]->size.y + pStore->pRequirementButton[i]->size.h / 2,
        pTech->size.x,
        pStore->pRequirementButton[i]->size.y + pStore->pRequirementButton[i]->size.h / 2,
        map_rgba(pStore->pRequirementButton[i]->dst->surface->format, line_color));

    /* Draw Sub_Req arrows */
    if (pSub0 || pSub1)
    {
      putline(pStore->pRequirementButton[i]->dst->surface,
        pStore->pRequirementButton[i]->size.x - adj_size(10),
        pStore->pRequirementButton[i]->size.y + pStore->pRequirementButton[i]->size.h / 2,
        pStore->pRequirementButton[i]->size.x ,
        pStore->pRequirementButton[i]->size.y + pStore->pRequirementButton[i]->size.h / 2,
        map_rgba(pStore->pRequirementButton[i]->dst->surface->format, line_color));
    }

    if(pSub0)
    {
      putline(pStore->pRequirementButton[i]->dst->surface,
        pStore->pRequirementButton[i]->size.x - adj_size(10),
        pSub0->size.y + pSub0->size.h / 2,
        pStore->pRequirementButton[i]->size.x - adj_size(10),
        pStore->pRequirementButton[i]->size.y + pStore->pRequirementButton[i]->size.h / 2,
        map_rgba(pStore->pRequirementButton[i]->dst->surface->format, line_color));
      putline(pStore->pRequirementButton[i]->dst->surface,
        pSub0->size.x + pSub0->size.w,
        pSub0->size.y + pSub0->size.h / 2,
        pStore->pRequirementButton[i]->size.x - adj_size(10),
        pSub0->size.y + pSub0->size.h / 2,
        map_rgba(pStore->pRequirementButton[i]->dst->surface->format, line_color));
    }

    if(pSub1)
    {
      putline(pStore->pRequirementButton[i]->dst->surface,
        pStore->pRequirementButton[i]->size.x - adj_size(10),
        pSub1->size.y + pSub1->size.h / 2,
        pStore->pRequirementButton[i]->size.x - adj_size(10),
        pStore->pRequirementButton[i]->size.y + pStore->pRequirementButton[i]->size.h / 2,
        map_rgba(pStore->pRequirementButton[i]->dst->surface->format, line_color));
      putline(pStore->pRequirementButton[i]->dst->surface,
        pSub1->size.x + pSub1->size.w,
        pSub1->size.y + pSub1->size.h / 2,
        pStore->pRequirementButton[i]->size.x - adj_size(10),
        pSub1->size.y + pSub1->size.h / 2,
        map_rgba(pStore->pRequirementButton[i]->dst->surface->format, line_color));
    }
    i++;
  }

  i = 0;
  while(i < 6 && pStore->pTargets[i])
  {
    i++;
  }
  count = i;

  if (count > 4)
  {
    mod = 3;
  } else {
    mod = 2;
  }

  for(i=0; i< count; i++)
  {
    tech = MAX_ID - pStore->pTargets[i]->ID;
    step = pTech->size.h / (count + 1);

    switch((i % mod))
    {
      case 2:
        line_color = *get_game_colorRGB(COLOR_THEME_HELPDLG_LINE2);
      break;
      case 1:
        line_color = *get_game_colorRGB(COLOR_THEME_HELPDLG_LINE3);
      break;
      default:
        line_color = *get_game_colorRGB(COLOR_THEME_HELPDLG_LINE);
      break;
    }

    /*find Sub_Req's */
    if (advance_required(tech, AR_ONE) == MAX_ID - pTech->ID)
    {
      pSub0 = pTech;
    } else {
      pSub0 = NULL;
      for(j=0; j < 6 && pStore->pSub_Targets[j]; j++)
      {
        if (MAX_ID - pStore->pSub_Targets[j]->ID == advance_required(tech, AR_ONE))
        {
          pSub0 = pStore->pSub_Targets[j];
          break;
        }
      }
    }

    if (advance_required(tech, AR_TWO) == MAX_ID - pTech->ID)
    {
      pSub1 = pTech;
    } else {
      pSub1 = NULL;
      for(j=0; j < 6 && pStore->pSub_Targets[j]; j++)
      {
        if (MAX_ID - pStore->pSub_Targets[j]->ID == advance_required(tech, AR_TWO))
        {
          pSub1 = pStore->pSub_Targets[j];
          break;
        }
      }
    }

    /* Draw Sub_Targets arrows */
    if (pSub0 || pSub1)
    {
      putline(pStore->pTargets[i]->dst->surface,
        pStore->pTargets[i]->size.x - ((i % mod) + 1) * 6,
        pStore->pTargets[i]->size.y + pStore->pTargets[i]->size.h / 2,
        pStore->pTargets[i]->size.x ,
        pStore->pTargets[i]->size.y + pStore->pTargets[i]->size.h / 2,
        map_rgba(pStore->pTargets[i]->dst->surface->format, line_color));
    }

    if(pSub0)
    {
      int y;
      if (pSub0 == pTech)
      {
        y = pSub0->size.y + step * (i + 1);
      } else {
        y = pSub0->size.y + pSub0->size.h / 2;
      }

      putline(pStore->pTargets[i]->dst->surface,
        pStore->pTargets[i]->size.x - ((i % mod) + 1) * 6,
        y,
        pStore->pTargets[i]->size.x - ((i % mod) + 1) * 6,
        pStore->pTargets[i]->size.y + pStore->pTargets[i]->size.h / 2,
        map_rgba(pStore->pTargets[i]->dst->surface->format, line_color));
      putline(pStore->pTargets[i]->dst->surface,
        pSub0->size.x + pSub0->size.w,
        y,
        pStore->pTargets[i]->size.x - ((i % mod) + 1) * 6,
        y,
        map_rgba(pStore->pTargets[i]->dst->surface->format, line_color));
    }

    if(pSub1)
    {
      int y;
      if (pSub1 == pTech)
      {
        y = pSub1->size.y + step * (i + 1);
      } else {
        y = pSub1->size.y + pSub1->size.h / 2;
      }
      putline(pStore->pTargets[i]->dst->surface,
        pStore->pTargets[i]->size.x - ((i % mod) + 1) * 6,
        y,
        pStore->pTargets[i]->size.x - ((i % mod) + 1) * 6,
        pStore->pTargets[i]->size.y + pStore->pTargets[i]->size.h / 2,
        map_rgba(pStore->pTargets[i]->dst->surface->format, line_color));
      putline(pStore->pTargets[i]->dst->surface,
        pSub1->size.x + pSub1->size.w,
        y,
        pStore->pTargets[i]->size.x - ((i % mod) + 1) * 6,
        y,
        map_rgba(pStore->pTargets[i]->dst->surface->format, line_color));
    }
  }

  /* Redraw rest */
  redraw_group(pHelpDlg->pBeginWidgetList, pWindow->prev->prev, FALSE);

  widget_flush(pWindow);
}

static int toggle_full_tree_mode_in_help_dlg_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    struct TECHS_BUTTONS *pStore = (struct TECHS_BUTTONS *)pHelpDlg->pEndWidgetList->data.ptr;
    if (pStore->show_full_tree)
    {
      pWidget->theme2 = pTheme->UP_Icon;
    } else {
      pWidget->theme2 = pTheme->DOWN_Icon;
    }
    pStore->show_full_tree = !pStore->show_full_tree;
    popup_tech_info(MAX_ID - pStore->pDock->prev->ID);
  }
  return -1;
}


static struct widget * create_tech_tree(Tech_type_id tech, int width, struct widget *pWindow, struct TECHS_BUTTONS *pStore)
{
  int i, w, h, req_count , targets_count, sub_req_count, sub_targets_count;
  struct widget *pWidget;
  struct widget *pTech;
  SDL_String16 *pStr;
  SDL_Surface *pSurf;
  struct widget *pDock = pStore->pDock;

  pStr = create_string16(NULL, 0, adj_font(10));
  pStr->style |= (TTF_STYLE_BOLD | SF_CENTER);

  copy_chars_to_string16(pStr, advance_name_translation(advance_by_number(tech)));
  pSurf = create_sellect_tech_icon(pStr, tech, FULL_MODE);
  pWidget = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);

  set_wstate(pWidget, FC_WS_NORMAL);
  pWidget->action = show_help_callback;
  pWidget->ID = MAX_ID - tech;
  DownAdd(pWidget, pDock);
  pTech = pWidget;
  pDock = pWidget;

  req_count  = 0;
  for(i = AR_ONE; i <= AR_TWO; i++)
  {
    Tech_type_id ar = advance_required(tech, i);
    struct advance *vap = valid_advance_by_number(ar);

    if (NULL != vap && A_NONE != ar)
    {
      copy_chars_to_string16(pStr, advance_name_translation(vap));
      pSurf = create_sellect_tech_icon(pStr, ar, SMALL_MODE);
      pWidget = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);
      set_wstate(pWidget, FC_WS_NORMAL);
      pWidget->action = change_tech_callback;
      pWidget->ID = MAX_ID - ar;
      DownAdd(pWidget, pDock);
      pDock = pWidget;
      pStore->pRequirementButton[i] = pWidget;
      req_count++;
    } else {
      pStore->pRequirementButton[i] = NULL;
    }
  }

  sub_req_count = 0;

  if (pStore->show_full_tree && req_count)
  {
    int j, sub_tech;
    for(j = 0; j < req_count; j++)
    {
      sub_tech = MAX_ID - pStore->pRequirementButton[j]->ID;
      for(i = AR_ONE; i <= AR_TWO; i++)
      {
        Tech_type_id ar = advance_required(sub_tech, i);
        struct advance *vap = valid_advance_by_number(ar);

        if (NULL != vap && A_NONE != ar)
        {
          copy_chars_to_string16(pStr, advance_name_translation(vap));
          pSurf = create_sellect_tech_icon(pStr, ar, SMALL_MODE);
          pWidget = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);
          set_wstate(pWidget, FC_WS_NORMAL);
          pWidget->action = change_tech_callback;
          pWidget->ID = MAX_ID - ar;
          DownAdd(pWidget, pDock);
          pDock = pWidget;
          pStore->pSub_Req[sub_req_count++] = pWidget;
        }
      }
    }
  }

  if (sub_req_count < 4)
  {
    pStore->pSub_Req[sub_req_count] = NULL;
  }

  targets_count = 0;
  advance_index_iterate(A_FIRST, i)
  {
    if ((targets_count<6)
      && (advance_required(i, AR_ONE) == tech
       || advance_required(i, AR_TWO) == tech))
    {
      copy_chars_to_string16(pStr, advance_name_translation(advance_by_number(i)));
      pSurf = create_sellect_tech_icon(pStr, i, SMALL_MODE);
      pWidget = create_icon2(pSurf, pWindow->dst,
                WF_FREE_THEME | WF_RESTORE_BACKGROUND);

      set_wstate(pWidget, FC_WS_NORMAL);
      pWidget->action = change_tech_callback;
      pWidget->ID = MAX_ID - i;
      DownAdd(pWidget, pDock);
      pDock = pWidget;
      pStore->pTargets[targets_count++] = pWidget;
    }
  } advance_index_iterate_end;
  if (targets_count<6)
  {
    pStore->pTargets[targets_count] = NULL;
  }

  sub_targets_count = 0;
  if (targets_count)
  {
    int sub_tech;
    for(i = 0; i < targets_count; i++)
    {
      sub_tech = MAX_ID - pStore->pTargets[i]->ID;
      if (advance_required(sub_tech, AR_ONE) == tech
       && advance_required(sub_tech, AR_TWO) != A_NONE)
      {
        sub_tech = advance_required(sub_tech, AR_TWO);
      } else if (advance_required(sub_tech, AR_TWO) == tech
              && advance_required(sub_tech, AR_ONE) != A_NONE)
      {
        sub_tech = advance_required(sub_tech, AR_ONE);
      } else {
        continue;
      }

      copy_chars_to_string16(pStr, advance_name_translation(advance_by_number(sub_tech)));
      pSurf = create_sellect_tech_icon(pStr, sub_tech, SMALL_MODE);
      pWidget = create_icon2(pSurf, pWindow->dst,
        WF_FREE_THEME | WF_RESTORE_BACKGROUND);
      set_wstate(pWidget, FC_WS_NORMAL);
      pWidget->action = change_tech_callback;
      pWidget->ID = MAX_ID - sub_tech;
      DownAdd(pWidget, pDock);
      pDock = pWidget;
      pStore->pSub_Targets[sub_targets_count++] = pWidget;
    }
  }
  if (sub_targets_count<6)
  {
    pStore->pSub_Targets[sub_targets_count] = NULL;
  }

  FREESTRING16(pStr);

  /* ------------------------------------------ */
  if (sub_req_count)
  {
    w = (adj_size(20) + pStore->pSub_Req[0]->size.w) * 2;
    w += (pWindow->size.w - (20 + pStore->pSub_Req[0]->size.w + w + pTech->size.w)) / 2;
  } else {
    if (req_count)
    {
      w = (pWindow->area.x + 1 + width + pStore->pRequirementButton[0]->size.w * 2 + adj_size(20));
      w += (pWindow->size.w - ((adj_size(20) + pStore->pRequirementButton[0]->size.w) + w + pTech->size.w)) / 2;
    } else {
      w = (pWindow->size.w - pTech->size.w) / 2;
    }
  }

  pTech->size.x = pWindow->size.x + w;
  pTech->size.y = pWindow->area.y + (pWindow->area.h - pTech->size.h) / 2;

  if(req_count)
  {
    h = (req_count == 1 ? pStore->pRequirementButton[0]->size.h :
        req_count * (pStore->pRequirementButton[0]->size.h + adj_size(80)) - adj_size(80));
    h = pTech->size.y + (pTech->size.h - h) / 2;
    for(i =0; i <req_count; i++)
    {
      pStore->pRequirementButton[i]->size.x = pTech->size.x - adj_size(20) - pStore->pRequirementButton[i]->size.w;
      pStore->pRequirementButton[i]->size.y = h;
      h += (pStore->pRequirementButton[i]->size.h + adj_size(80));
    }
  }

  if(sub_req_count)
  {
    h = (sub_req_count == 1 ? pStore->pSub_Req[0]->size.h :
     sub_req_count * (pStore->pSub_Req[0]->size.h + adj_size(20)) - adj_size(20));
    h = pTech->size.y + (pTech->size.h - h) / 2;
    for(i =0; i <sub_req_count; i++)
    {
      pStore->pSub_Req[i]->size.x = pTech->size.x - (adj_size(20) + pStore->pSub_Req[i]->size.w) * 2;
      pStore->pSub_Req[i]->size.y = h;
      h += (pStore->pSub_Req[i]->size.h + adj_size(20));
    }
  }

  if(targets_count)
  {
    h = (targets_count == 1 ? pStore->pTargets[0]->size.h :
     targets_count * (pStore->pTargets[0]->size.h + adj_size(20)) - adj_size(20));
    h = pTech->size.y + (pTech->size.h - h) / 2;
    for(i =0; i <targets_count; i++)
    {
      pStore->pTargets[i]->size.x = pTech->size.x + pTech->size.w + adj_size(20);
      pStore->pTargets[i]->size.y = h;
      h += (pStore->pTargets[i]->size.h + adj_size(20));
    }
  }

  if(sub_targets_count)
  {
    if(sub_targets_count < 3)
    {
      pStore->pSub_Targets[0]->size.x = pTech->size.x + pTech->size.w - pStore->pSub_Targets[0]->size.w;
      pStore->pSub_Targets[0]->size.y = pTech->size.y - pStore->pSub_Targets[0]->size.h - adj_size(10);
      if (pStore->pSub_Targets[1])
      {
        pStore->pSub_Targets[1]->size.x = pTech->size.x + pTech->size.w - pStore->pSub_Targets[1]->size.w;
        pStore->pSub_Targets[1]->size.y = pTech->size.y + pTech->size.h + adj_size(10);
      }
    }
    else
    {
      if(sub_targets_count < 5)
      {
        for(i =0; i <MIN(sub_targets_count, 4); i++)
        {
          pStore->pSub_Targets[i]->size.x = pTech->size.x + pTech->size.w - pStore->pSub_Targets[i]->size.w;
          if (i < 2)
          {
            pStore->pSub_Targets[i]->size.y = pTech->size.y - (pStore->pSub_Targets[i]->size.h + adj_size(5)) * ( 2 - i );
          } else {
            pStore->pSub_Targets[i]->size.y = pTech->size.y + pTech->size.h + adj_size(5)  + (pStore->pSub_Targets[i]->size.h + adj_size(5)) * ( i - 2 );
          }
        }
      } else {
        h = (pStore->pSub_Targets[0]->size.h + adj_size(6));
        for(i =0; i <MIN(sub_targets_count, 6); i++)
        {
          switch(i)
          {
            case 0:
              pStore->pSub_Targets[i]->size.x = pTech->size.x + pTech->size.w - pStore->pSub_Targets[i]->size.w;
              pStore->pSub_Targets[i]->size.y = pTech->size.y - h * 2;
            break;
            case 1:
              pStore->pSub_Targets[i]->size.x = pTech->size.x + pTech->size.w - pStore->pSub_Targets[i]->size.w * 2 - adj_size(10);
              pStore->pSub_Targets[i]->size.y = pTech->size.y - h - h / 2;
            break;
            case 2:
              pStore->pSub_Targets[i]->size.x = pTech->size.x + pTech->size.w - pStore->pSub_Targets[i]->size.w;
              pStore->pSub_Targets[i]->size.y = pTech->size.y - h;
            break;
            case 3:
              pStore->pSub_Targets[i]->size.x = pTech->size.x + pTech->size.w - pStore->pSub_Targets[i]->size.w;
              pStore->pSub_Targets[i]->size.y = pTech->size.y + pTech->size.h + adj_size(6);
            break;
            case 4:
              pStore->pSub_Targets[i]->size.x = pTech->size.x + pTech->size.w - pStore->pSub_Targets[i]->size.w;
              pStore->pSub_Targets[i]->size.y = pTech->size.y + pTech->size.h + adj_size(6) + h;
            break;
            default:
              pStore->pSub_Targets[i]->size.x = pTech->size.x + pTech->size.w - pStore->pSub_Targets[i]->size.w * 2 - adj_size(10);
              pStore->pSub_Targets[i]->size.y = pTech->size.y + pTech->size.h + adj_size(6) + h / 2 ;
            break;
          };
        }
      }
    }
  }

  return pWidget;
}

void popup_tech_info(Tech_type_id tech)
{
  struct widget *pWindow;
  struct TECHS_BUTTONS *pStore;
  
  struct widget *pCloseButton = NULL;
  struct widget *pAdvanceLabel = NULL;
  struct widget *pListToggleButton = NULL;
  
  struct widget *pDock;
  SDL_String16 *pTitle, *pStr;
  SDL_Surface *pSurf;
  int h, tech_count;
  bool created;
  int scrollbar_width = 0;
  SDL_Rect area;

  if(current_help_dlg != HELP_TECH) {
    popdown_help_dialog();
  }

  /* create new dialog if it doesn't exist yet */
  if (!pHelpDlg) {
    current_help_dlg = HELP_TECH;
    created = TRUE;
    
    /* create dialog */
    pHelpDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG));
    pStore = fc_calloc(1, sizeof(struct TECHS_BUTTONS));

    pStore->show_tree = FALSE;
    pStore->show_full_tree = FALSE;

    /* create window */
    pTitle = create_str16_from_char(_("Help : Advances Tree"), adj_font(12));
    pTitle->style |= TTF_STYLE_BOLD;

    pWindow = create_window_skeleton(NULL, pTitle, WF_FREE_DATA);
    pWindow->data.ptr = (void *)pStore;
    pWindow->action = help_dlg_window_callback;
    set_wstate(pWindow , FC_WS_NORMAL);

    add_to_gui_list(ID_WINDOW, pWindow);
    
    pHelpDlg->pEndWidgetList = pWindow;

    area = pWindow->area;

    /* ------------------ */

    /* close button */
    pCloseButton = create_themeicon(pTheme->Small_CANCEL_Icon, pWindow->dst,
                                    WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
    pCloseButton->string16 = create_str16_from_char(_("Close Dialog (Esc)"), adj_font(12));
    pCloseButton->action = exit_help_dlg_callback;
    set_wstate(pCloseButton, FC_WS_NORMAL);
    pCloseButton->key = SDLK_ESCAPE;

    add_to_gui_list(ID_BUTTON, pCloseButton);

    /* ------------------ */
    pDock = pCloseButton;
    
    /* --- create scrollable advance list on the left side ---*/
    pStr = create_string16(NULL, 0, adj_font(10));
    pStr->style |= (TTF_STYLE_BOLD | SF_CENTER);

    tech_count = 0;
    advance_index_iterate(A_FIRST, i) {
      struct advance *vap = valid_advance_by_number(i);;
      if (vap) {
        copy_chars_to_string16(pStr, advance_name_translation(vap));
        pSurf = create_sellect_tech_icon(pStr, i, SMALL_MODE);
        pAdvanceLabel = create_icon2(pSurf, pWindow->dst,
                                     WF_FREE_THEME | WF_RESTORE_BACKGROUND);

        set_wstate(pAdvanceLabel, FC_WS_NORMAL);
        pAdvanceLabel->action = change_tech_callback;
        add_to_gui_list(MAX_ID - i, pAdvanceLabel);

        if (++tech_count > 10) {
          set_wflag(pAdvanceLabel, WF_HIDDEN);
        }
      }
    } advance_index_iterate_end;

    FREESTRING16(pStr);

    pHelpDlg->pEndActiveWidgetList = pDock->prev;
    pHelpDlg->pBeginWidgetList = pAdvanceLabel ? pAdvanceLabel : pCloseButton;
    pHelpDlg->pBeginActiveWidgetList = pHelpDlg->pBeginWidgetList;

    if (tech_count > 10) {
      pHelpDlg->pActiveWidgetList = pHelpDlg->pEndActiveWidgetList;
      scrollbar_width = create_vertical_scrollbar(pHelpDlg, 1, 10, TRUE, TRUE);
    }

    /* toggle techs list button */
    pListToggleButton = create_themeicon_button_from_chars(pTheme->UP_Icon,
                                                           pWindow->dst,
                                                           _("Advances"),
                                                           adj_font(10), 0);
    pListToggleButton->action = toggle_full_tree_mode_in_help_dlg_callback;
    if (pStore->show_tree) {
      set_wstate(pListToggleButton, FC_WS_NORMAL);
    }
    widget_resize(pListToggleButton, adj_size(160), adj_size(15));
    pListToggleButton->string16->fgcol = *get_game_colorRGB(COLOR_THEME_HELPDLG_TEXT);

    add_to_gui_list(ID_BUTTON, pListToggleButton);

    pDock = pListToggleButton;
    pStore->pDock = pDock;
  } else {
    created = FALSE;
    scrollbar_width = (pHelpDlg->pScroll ? pHelpDlg->pScroll->pUp_Left_Button->size.w: 0);
    pWindow = pHelpDlg->pEndWidgetList;
    pStore = (struct TECHS_BUTTONS *)pWindow->data.ptr;
    pDock = pStore->pDock;

    area = pWindow->area;

    /* delete any previous list entries */
    if (pDock != pHelpDlg->pBeginWidgetList) {
      del_group_of_widgets_from_gui_list(pHelpDlg->pBeginWidgetList, pDock->prev);
      pHelpDlg->pBeginWidgetList = pDock;
    }

    /* show/hide techs list */
    pListToggleButton = pDock;
    
    if (pStore->show_tree) {
      set_wstate(pListToggleButton, FC_WS_NORMAL);
    } else {
      set_wstate(pListToggleButton, FC_WS_DISABLED);
    }

    if (pStore->show_full_tree) {
      /* all entries are visible without scrolling */
      hide_group(pHelpDlg->pBeginActiveWidgetList,
                 pHelpDlg->pEndActiveWidgetList);
      hide_scrollbar(pHelpDlg->pScroll);
    } else {
      int count = pHelpDlg->pScroll->active;
      pAdvanceLabel = pHelpDlg->pActiveWidgetList;
      while(pAdvanceLabel && count--) {
        pAdvanceLabel = pAdvanceLabel->prev;
      }
      pAdvanceLabel = pAdvanceLabel->next;
      show_group(pAdvanceLabel, pHelpDlg->pActiveWidgetList);
      show_scrollbar(pHelpDlg->pScroll);
    }
  }

  /* --------------------------------------------------------- */
  if (created) {

    pSurf = theme_get_background(theme, BACKGROUND_HELPDLG);
    if (resize_window(pWindow, pSurf, NULL, adj_size(640), adj_size(480))) {
      FREESURFACE(pSurf);
    }

    area = pWindow->area;

    widget_set_position(pWindow,
                        (Main.screen->w - pWindow->size.w) / 2,
                        (Main.screen->h - pWindow->size.h) / 2);

    /* exit button */
    pCloseButton = pWindow->prev;
    widget_set_position(pCloseButton,
                        area.x + area.w - pCloseButton->size.w - 1,
                        pWindow->size.y + adj_size(2));

    /* list toggle button */
    pListToggleButton = pStore->pDock;
    widget_set_position(pListToggleButton, area.x, area.y);

    /* list entries */
    h = setup_vertical_widgets_position(1, area.x + scrollbar_width,
                                        area.y + pListToggleButton->size.h, 0, 0,
                                        pHelpDlg->pBeginActiveWidgetList,
                                        pHelpDlg->pEndActiveWidgetList);
    /* scrollbar */
    if (pHelpDlg->pScroll) {
      setup_vertical_scrollbar_area(pHelpDlg->pScroll,
                                    area.x, area.y + pListToggleButton->size.h,
                                    h, FALSE);
    }
  }

  if (pStore->show_tree) {
    pHelpDlg->pBeginWidgetList = create_tech_tree(tech, scrollbar_width, pWindow, pStore);
    redraw_tech_tree_dlg();
  } else {
    pHelpDlg->pBeginWidgetList = create_tech_info(tech, scrollbar_width, pWindow, pStore);
    redraw_tech_info_dlg();
  }
}
ENDREP
DELTA 8367 0 1258
SVN  ‚Á™k?ƒQ †O €+ T‡q G ¨ T™ª G  ‚p–4‚ Nš  &úy pü`€. G  ƒ€| ‚c…6£/* utility */
#include "fcintl.h"
#include "log.h"
#include "packets.h"
#include "support.h"
#include "version.h"

/* client */
#include "client_main.h"
#include "chatline
****
 really close and destroy the dialoreally_close_connection_dialog(void)
{
}

..
    if (is_save) {
      send_save_game(filename);
    } else {
      send_chat_printf("/load %s", filename);
    }

    g_free(filename);
  }

  gtk_widget_destroy(w);
}


void gui_server_connect(void)
{
}

ENDREP
DELTA 13038 756812 9722
SVN  ŠT_‡O †X €Q Š0ˆ%€Q šS“Š ¡W­s€ C×@† AŽ@ ‚@Ñr€@ Ôj M«@ ‚=Ö<¯ BÙn N×@€{ C×@† AŽ@ ‚$èj€ ìU/* utility */
#include "shared.h"
#include "support.h"

/* common */
#include "events.h"
#include "fcintl.h"
#include "government.h"
#include "packets.h"
#include "player.h"

/* client */
#include "client_mainNULL != client.conn.playing) {
    maxrate = get_player_bonus(client.conn.playingclient.conclient.conn.playing->economic.tax, 0,
		   client.conn.playing->economic.luxury, 0,
		   client.conn.playing->economic.science, 0);
  return shell;
}

... 
client.conn.playing),
      get_player_bonus(client.conn.playingprocessing(void)
{
  const char *dp;
  bool b;
}in, gint rid)
{
  switch (rid) {
  case GTK_RESPONSE_ACCEPT:
    option_command_processing();
    save_options();
    break;
  case GTK_RESPONSE_APPLY:
    option_command_processing();
    break;
  default:
    break;
  };
  gtk_widget_destroy(win);
}
... 
 GTK_RESPONSE_CANCEL,
	GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
	GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
	NULL);
  setup_dialog(option_dialog_shell, toplevelENDREP
DELTA 14427 135038 253
SVN  »»
 †Z Š ´*†blient_mainENDREP
DELTA 14427 224006 418
SVN  ‰F‹^ˆ6 ˆf – 3ˆe¢ ¦5Š+¨ l°`Ÿ ±N“ "²`˜ …IÃ€N †(É<³ ‚EÏl² ŠxÒ8€ƒ	 L› šà2€t Gÿ@ üo€\ Kñ@ ‰?€/* common & utility *//* client */
#include "client_main /* HAVE_WORKING_FORK || WIN32_NATIVE */
  char savesdir[MAX_LEN_PATH]; /* WIN32_NATIVE */ /* HAVE_WORKING_FORK */interpret_tilde(savesdir, sizeof(savesdir), "~/.freeciv/saves");

  my_snprintf(options, sizeof(options), "-p %d -q 1 -e%s%s --saves \"%s\"",
	      internal_server_port, logcmdline, scriptcmdline, savesdir /* WIN32_NATIVE */
# endif /* HAVE_WORKING_FORK */ /* WIN32_NATIVE */
#endif /* HAVE_WORKING_FORK */send_chat_printf("/set topology %d",
                   (TF_WRAPX
                    | ((tileset_is_isometric(tileset)
                        && tileset_hex_height(tileset) == 0) ? TF_ISO : 0)
                    | ((tileset_hex_width(tileset) != 0
                        || tileset_hex_height(tileset) != 0) ? TF_HEX : 0)));

  return TRUE;
#endif /* HAVE_WORKING_FORK || WIN32_NATIVE */
}send_chat("/set timeout 0");
  send_chat_printf("/take \"%s\" \"%s\"", user_name, leader_name);
  send_chat("/start"if (filename) {
    send_chat_printf("/save %s", filename);
  } else {
    send_chat("/save"ENDREP
DELTA 14427 135319 101
SVN  ¾4¾[L †( – †'¶ ¶K‡i/* common & utility *//* client */
#include "canvas.h"
#include "client_mainENDREP
DELTA 14427 89458 3656
SVN  ‚Ôu‚Õ! ‰" €! ‚Ê\Š/* utility */
#include "fcintl.h"
#include "mem.h"

/* common */
#include "city.h"
#include "packets.h"
#include "worklist.h"

/* client */
#include "client_mainENDREP
DELTA 15296 1451 70
SVN  æ5æ7
 Š Š ÜŠlient_mainENDREP
DELTA 13024 155576 5215
SVN  ‚ƒ‚…alŒm †l – s†k¼ ‘[‰#‰ …o›€‚ Å}¡s€c Š\è~€a ÕWõ€# ‚2Ëb¬ ‹
Ïg‰ >Û €B ƒyÜi€u †+á@€‚ Né+€ `é/ ŠOø@/* common & utility */
/* client */
#include "client_main.h"
#include "climisc.h"
universaluniversal target = items[item].item;

    if (VUT_UTYPE == target.kind) {
      dest_wids[wids_used] = wid_encode(TRUE, FALSE, utype_number(target.value.utype));
    } else {
      dest_wids[wids_used] = wid_encode(FALSE, FALSE, improvement_number(target.value.building));
    }mprovement_by_number(id))) {
      popup_help_dialog_typed(improvement_name_translation(improvement_by_number(id)), HELP_WONDER);
    } else {
      popup_help_dialog_typed(improvement_name_translation(improvement_by_number(id)wid wid = peditor->worklist_wids[i];
      struct universal prod =
        universal_by_number(wid_is_unit(wid) ? VUT_UTYPE : VUT_IMPROVEMENT,
                               wid_id(wid));

      assert(!wid_is_worklist(wid));universal target =
    universal_by_number(wid_is_unit(wid) ? VUT_UTYPE : VUT_IMPROVEMENT,
                           wid_id(wid));

  assert(!wid_is_worklist(wid)!can_city_build_later(peditor->pcity, targetuniversalVUT_UTYPE == target.kind, FALSE,
					   universal_number(&target)VUT_UTYPE == peditor->pcity->production.kind, FALSE,
                   universal_number(&peditor->pcity->production)    struct universal target;

    if (wid == WORKLIST_END) {
      break;
    }

    assert(!wid_is_worklist(wid));

    target = universal_by_number(wid_is_unit(wid)
                                    ? VUT_UTYPE : VUT_IMPROVEMENT,
                                    wid_id(wid)universal target = 
        universal_by_number(wid_is_unit(wid) ? VUT_UTYPE : VUT_IMPROVEMENT,
                               wid_id(wid));

  ENDREP
DELTA 15264 0 465
SVN  ª3ªKc †  †¿ •=‡A— G  ŒRa/* utility *//* client */
#include "chatline_common.h"
#include "client_mainclear(remains);
  }
}

ENDREP
DELTA 10852 0 4461
SVN  ‚‚!‚ƒk† ˆ` ¹ w‰· ª=Š0„ š´n‰ „Ï€ƒ$ ‡gÖ&‰ ‹ Þ€] Eé~ƒ J› hë+€O ;ù7“ ˆZû“ Žƒj —T‘w Š^©L ¿F´+‰ Ž!ô /* common & utility */
#include "city.h"
#include "fcintl/* client */
#include "client_main.h"
#include "climiscNULLuniversalovement_iterate(pimprove) {
      if (can_city_build_improvement_now(pcity, pimprove)) {
	targets[targets_used].kind = VUT_IMPROVEMENT;
	targets[targets_used].value.building = pimprove;
	targets_used++;
      }
    } improvement_iterate_end;

    unit_type_iterate(punittype) {
      if (can_city_build_unit_now(pcity, punittype)) {
	targets[targets_used].kind = VUT_UTYPE;
	targets[targets_used].value.utype = punittypeuniversalclient.conn, pcity->id);
    }
  } else {
    dsend_packet_city_refresh(&client.conn, 0);
  }
.. (NULL == client.conn.playing || is_report_dialogs_frozen()) {
    return;
  }
client.conn.playingclient.conn.playingcity_name(pcity)00universalENDREP
DELTA 14777 20372 396
SVN  ‚öD‚ön- ‰- €X i‰j€U ‚ë+‹/* utility */
#include "fcintl.h"
#include "shared.h"
#include "support.h"

/* common *//* client */
#include "chatline_common.h" /* for send_chat() */
#include "client_mainENDREP
DELTA 14417 136305 4356
SVN  ……2%K …f – s…e¢ Ân†„ ƒÉl‹ Tø? rÍa„ µDÏR/* common & utility *//* client */
#include "client_mainconnclient.connconnENDREP
DELTA 15396 0 309
SVN  …Ø)…Ø+
 ˆe Š …Ï<ˆmlient_mainENDREP
DELTA 11378 13235 1893
SVN  ½g¾=‚S †X – †W¹ =ˆ |˜D‹ ;¦I‹ ‹X¨  ³q€
 ¶€c G  J  „f¹/* common & utility */#include "unitlist.h"

/* client */
#include "client_main_FALSE, FALSFALSE, FALSplayers_iterate(pplayer) {
    if (!all_cities && pplayer != client.conn.playing) {
      continue;
    }

    city_list_iterate(pplayer->city_name(pcity), 1, pcity->airlift, -1);
    } city_list_iterate_end;
  } players_iterate_end;
}

ENDREP
DELTA 15171 0 467
SVN  ‚ï ‚ï*/ ‰(  _‰'Œ |ŠŒ \‹ Š ‚ã‹d/* utility *//* common *//* client */lient_mainENDREP
DELTA 14223 11959 3809
SVN  ‚‡g‚†VM„? †V § †x€ “AˆXŠ §^œ#Š „ÄŠ Ú\È2 W 1¥ ƒ[¥K© Y§ ¾ «€\ …]®]“ Ó´I/* common & utility */
#include "fcintl/* client */
#include "chatline.h"
#include "client_main.h"
#include "climisc.h"
#include "clinet.h"		/* connect_to_server() */client.conclient.conclient.conchat_printf("/load %s", ofn.lpstrFile  Send parameters for new game to server.set_new_game_params(HWND win)
{
  char buf[512];
  int aiskill  send_chat_printf("/%s", ai_level_cmd(aiskill));

#if 0 
  send_chat("/set autotoggle 1");
#endif

  Edit_GetText(GetDlgItem(newgame_dlg, ID_NEWGAMEDLG_AIFILL), buf, 512);

  send_chat_printf("/set aifill %d", atoi(buf)client.conn.playingENDREP
DELTA 14422 54824 325
SVN  •~–+z …\ €U …N†“ "‹j’ G  ˆ`/* common */
#include "map.h"
#include "shared.h"

/* client */
#include "client_mainNULL == client.connconn.playing);
}

ENDREP
DELTA 14171 44718 4095
SVN  çæzj‹o ‡V €N ¦‰$ž EÑ  ƒW°¾ ³J„ ´Q n·{€‚( E» “ ƒg»T€Y ‰	À€‚U ˆ:Ëg€  „:Õ€ 1Ã: ‚XÛ~Š „Þ`µ 1Ã: |ä_€i/* common & utility */
#include "diptreaty.h"
#include "fcintl.h"
#include "packets.h"
#include "player.h"
#include "support.h"

/* client */
#include "chatline.h"
#include "client_main.h"
#include "climisc
  FIXME: use plrdlg_common.c
state */
      sz_strlcpy(statebuf, plrdlg_col_state(pplayer))
			layer_name(pplayer));
      else
        my_snprintf(namebuf, sizeof(namebuf), "%-16s",player_name(pplayer));
      namebuf[16] = '\0';

      /* text for diplstate type and turns -- not applicable if this is me */
      if (NULL == client.conn.playing
          || pplayer == client.conn.playingclient.conn.playingclient.conn.playing, pplayer),
	      dsbuf,
	      get_vision_status(client.conn.playingNULL != client.conn.playing && pplayer->is_alive) {
      XtSetSensitive(players_war_command,
		     client.conn.playing != pplayer
		     && !pplayers_at_war(client.conn.playing, pplayer));
    }

    if (NULL != client.conn.playing) {
      XtSetSensitive(players_vision_command,
		     gives_shared_vision(client.conn.playing, pplayer));
    struct player *pplayer = player_by_number(player_index);

    if (can_meet_with_player(pplayer)) {
      dsend_packet_diplomacy_init_meeting_req(&client.con    struct player *pplayer = player_by_number(player_index);

    if (can_intel_with_player(pplayer)) {
      popup_intel_dialog(pplayer);
    }client.conclient.conn, player_index,
				       CLAUSE_VISION);    struct player *pplayer = player_by_number(player_index);

    popup_spaceship_dialog(pplayer);
  }
}
ENDREP
DELTA 15354 0 1496
SVN  †  †  8 ˆp – „8ˆo¢ †’ :/* common & utility *//* client */
#include "client_main†  ƒúwƒû&¦ ƒúw VITY_SENTRY:
      s = t->sprites.unitENDREP
DELTA 14777 24364 2620
SVN  ÑpÒb ‡R €@ U‡w¢ Éˆ_/* utility */
#include "fcintl.h"
#include "log.h"

/* common *//* client */
#include "client_mainENDREP
DELTA 15307 45540 773
SVN  ‚W‚“A*‚% ‰% €j  ‰tŠ ¿jŠ|¯ MÌ €C Rõ=¿ RÌ  ÅË;/* utility */
#include "fciconv.h"
#include "fcintl.h"
#include "log.h"
#include "support.h"

/* common */lient_main  Entry point for whole freeciv client program.int main(int argc, char **argv)
{
  return client_main(argc, argv);Entry point for GUI specific portion. Called from client_main()ENDREP
DELTA 5500 235644 1093
SVN  ’S»%4¯* …j €…& A … A‹ €‡g G • Ž%€†# G  ;Ž€™ G Œ  Ž'€‚7/* utility */
#include "fcintl.h"

/* common */
#include "game.h"
#include "packets.h"

/* client */
#include "client_main.h"
#include "text.h"

/* gui-sdl */
#include "graphics.h"
#include "gui_id.h"
#include "gui_main.h"
#include "gui_tilespec.h"
#include "mapview.h"
#include "widget.h"

#include "spaceshipdlg.h"

#define SPECLIST_TAG dialog
#define SPECLIST_TYPE struct SMALL_DLG
#include "speclist.h"

#define dialog_list_iterate(dialoglist, pdialog) \
    TYPED_LIST_ITERATE(struct SMALL_DLG, dialoglist, pdialog)
#define dialog_list_iterate_end  LIST_ITERATE_END
    
static struct dialog_list *dialog_list = NULL;
static bool dialog_list_has_been_initialised = FALSE;


...
/
static struct SMALL_DLG *get_spaceship_dialog(struct player *pplayer)
{
  if (!dialog_list_has_been_initialised) {
    dialog_list = dialog_list_new();
    dialog_list_has_been_initialised = TRUE;
  }

  dialog_list_iterate(dialog_list, pDialog) {
    if (pDialog->pEndWidgetList->data.player == pplayer) {
      return pDialog;
    }
  } dialog_list_iterate_end;

  return NULL;
}

static int space_dialog_window_callback(struct widget *pWindow)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    move_window_group(pWindow->private_data.small_dlg->pBeginWidgetList, pWindow);
  }
  return -1;
}

static int exit_space_dialog_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    popdown_spaceship_dialog(pWidget->data.player);
    flush_dirty();
  }
  return -1;
}

static int launch_spaceship_callback(struct widget *pWidget)
{
  if (Main.event.button.button == SDL_BUTTON_LEFT) {
    send_packet_spaceship_launch(&client.conn);
  }
  return -1;
}

****
  Refresh (updatrefresh_spaceship_dialog(struct player *pPlayer)
{
  struct SMALL_DLG *pSpaceShp;
  struct widget *pBuf;
    
  if(!(pSpaceShp = get_spaceship_dialog(pPlayer)))
    return;
  
  /* launch button */
  pBuf = pSpaceShp->pEndWidgetList->prev->prev;
  if(game.info.spacerace
     && pPlayer == client.conn.playing
     && pPlayer->spaceship.state == SSHIP_STARTED
     && pPlayer->spaceship.success_rate > 0.0) {
    set_wstate(pBuf, FC_WS_NORMAL);
  }
  
  /* update text info */
  pBuf = pBuf->prev;
  copy_chars_to_string16(pBuf->string16,
				get_spaceship_descr(&pPlayer->spaceship));
  /* ------------------------------------------ */
  
    /* redraw */
  redraw_group(pSpaceShp->pBeginWidgetList, pSpaceShp->pEndWidgetList, 0);
  widget_mark_dirty(pSpaceShp->pEndWidgetList);
  
  flush_dirty();
}

Player)
{
  struct SMALL_DLG *pSpaceShp;

  if(!(pSpaceShp = get_spaceship_dialog(pPlayer))) {
    struct widget *pBuf, *pWindow;
    SDL_String16 *pStr;
    char cBuf[128];
    SDL_Rect area;
  
    pSpaceShp = fc_calloc(1, sizeof(struct SMALL_DLG));
    
    my_snprintf(cBuf, sizeof(cBuf), _("The %s Spaceship"),
				    nation_adjective_for_player(pPlayer));
    pStr = create_str16_from_char(cBuf, adj_font(12));
    pStr->style |= TTF_STYLE_BOLD;
  
    pWindow = create_window_skeleton(NULL, pStr, 0);
  
    pWindow->action = space_dialog_window_callback;
    set_wstate(pWindow, FC_WS_NORMAL);
    pWindow->data.player = pPlayer;
    pWindow->private_data.small_dlg = pSpaceShp;
    add_to_gui_list(ID_WINDOW, pWindow);
    pSpaceShp->pEndWidgetList = pWindow;

    area = pWindow->area;
    
    /* ---------- */
    /* create exit button */
    pBuf = create_themeicon(pTheme->Small_CANCEL_Icon, pWindow->dst,
  			    WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
    pBuf->string16 = create_str16_from_char(_("Close Dialog (Esc)"), adj_font(12));
    pBuf->data.player = pPlayer;
    pBuf->action = exit_space_dialog_callback;
    set_wstate(pBuf, FC_WS_NORMAL);
    pBuf->key = SDLK_ESCAPE;
    area.w = MAX(area.w, (pBuf->size.w + adj_size(10)));
  
    add_to_gui_list(ID_BUTTON, pBuf);
  
    pBuf = create_themeicon_button_from_chars(pTheme->OK_Icon, pWindow->dst,
					      _("Launch"), adj_font(12), 0);
        
    pBuf->action = launch_spaceship_callback;
    area.w = MAX(area.w, pBuf->size.w);
    area.h += pBuf->size.h + adj_size(20);
    add_to_gui_list(ID_BUTTON, pBuf);
    
    pStr = create_str16_from_char(get_spaceship_descr(NULL), adj_font(12));
    pStr->bgcol = (SDL_Color) {0, 0, 0, 0};
    pBuf = create_iconlabel(NULL, pWindow->dst, pStr, WF_RESTORE_BACKGROUND);
    area.w = MAX(area.w, pBuf->size.w);
    area.h += pBuf->size.h + adj_size(20);
    add_to_gui_list(ID_LABEL, pBuf);

    pSpaceShp->pBeginWidgetList = pBuf;
    /* -------------------------------------------------------- */
  
    area.w = MAX(area.w, adj_size(300) - (pWindow->size.w - pWindow->area.w));

    resize_window(pWindow, NULL, NULL,
                  (pWindow->size.w - pWindow->area.w) + area.w,
                  (pWindow->size.h - pWindow->area.h) + area.h);
    
    area = pWindow->area;
    
    widget_set_position(pWindow,
                        (Main.screen->w - pWindow->size.w) / 2,
                        (Main.screen->h - pWindow->size.h) / 2);
    
    /* exit button */
    pBuf = pWindow->prev;
    pBuf->size.x = area.x + area.w - pBuf->size.w - 1;
    pBuf->size.y = pWindow->size.y + adj_size(2);

    /* launch button */
    pBuf = pBuf->prev;
    pBuf->size.x = area.x + (area.w - pBuf->size.w) / 2;
    pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(7);
  
    /* info label */
    pBuf = pBuf->prev;
    pBuf->size.x = area.x + (area.w - pBuf->size.w) / 2;
    pBuf->size.y = area.y + adj_size(7);

    dialog_list_prepend(dialog_list, pSpaceShp);
    
    refresh_spaceship_dialog(pPlayer);
  } else {
    if (sellect_window_group_dialog(pSpaceShp->pBeginWidgetList,
				   pSpaceShp->pEndWidgetList)) {
      widget_flush(pSpaceShp->pEndWidgetList);
    }
  }
  
}

****
  Closedown_spaceship_dialog(struct player *pPlayer)
{
  struct SMALL_DLG *pSpaceShp;

  if((pSpaceShp = get_spaceship_dialog(pPlayer))) {
    popdown_window_group_dialog(pSpaceShp->pBeginWidgetList,
					    pSpaceShp->pEndWidgetList);
    dialog_list_unlink(dialog_list, pSpaceShp);
    FC_FREE(pSpaceShp);
  }
  
}
ENDREP
DELTA 14505 0 1248
SVN  ·b·E} † €} ý	‡d ².…4/* utility */
#include "fcintl.h"
#include "log.h"
#include "support.h"

/* common */
#include "combat.h"
#include "game.h"
#include "unitlist.h"

/* client */
#include "agents.h"
#include "chatline_common.h"
#include "cityrep_g.h"
#include "client_mainENDREP
DELTA 7694 432 6764
SVN  ‚™[Ç‚|Öm †Y € P†~­ zˆ8› {‰6 
Š#€j Pá@ ‰x“>€‚ Ož:€†y „j¥:´ Fš@€ƒ9 aÍ´ S›@€D Rá> „%ª$€: X¯0¬ Ná@ Pâ €u Qá<€ L›@€ƒH Qá<€V Pü €p aÊt Uâ ˆ eÀ:° L›@ ‹,È?€„9 ƒ'Û" ‚+ç€z Pá@€a N›@€ Sá=€H N›@€  Rá> mêr€‚" Rá> +ð± Tá< ‚ó4€‚Z Pá= …DöX Uâ €V „T€‚- :¢y€„} Rá> j¨5€… 6¬/€q Rá>€t N›@€ˆ Pá> jûh€‰W ‚[Ï€x 3ÒL­ à~¦ Fš@€ W×x­ Pá> Hâ €„ Tá< e‚—t€h/* utility */
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "rand.h"
#include "support.h"
#include "timing.h"

/* common */player.h"

/* client */
#include "client_maineditgui.h"
#include "editoroverview_commonstatic GtkObject *map_hadj, *map_vadj;
static int cursor_timer_id = 0, cursor_type = -1, cursor_frame = 0;GtkWidget *label;

  label = gtk_frame_get_label_widget(GTK_FRAME(main_frame_civ_name));
  if (NULL != client.conn.playing) {
    gtk_label_set_text(GTK_LABEL(label),
		       nation_plural_for_player(client.conn.playing));
  } else {
    gtk_label_set_text(GTK_LABEL(label), "-");
  }et_indicator_icons(client_research_sprite(),
		      client_warming_sprite(),
		      client_cooling_sprite(),
		      client_government_sprite());

  if (NULL != client.conn.playing) {
    int d = 0;

    for (; d < client.conn.playing->economic.luxury /10; d++) {
      struct sprite *sprite = get_tax_sprite(tileset, O_LUXURY);

      gtk_image_set_from_pixbuf(GTK_IMAGE(econ_label[d]),
				sprite_get_pixbuf(sprite));
    }
 
    for (; d < (client.conn.playing->economic.science
		+ client.conn.playing->economic.luxury) / 10; d++) {
      struct sprite *sprite = get_tax_sprite(tileset, O_SCIENCE);

      gtk_image_set_from_pixbuf(GTK_IMAGE(econ_label[d]),
				sprite_get_pixbuf(sprite));
    }
 
    for (; d < 10; d++) {
      struct sprite *sprite = get_tax_sprite(tileset, O_GOLD);

      gtk_image_set_from_pixbuf(GTK_IMAGE(econ_label[d]),
				sprite_get_pixbuf(sprite));
    }This function is used to animate the mouse cursor. 
****/
static gint anim_cursor_cb(gpointer data)
{
  if (!cursor_timer_id) {
    return FALSE;
  }

  cursor_frame++;
  if (cursor_frame == NUM_CURSOR_FRAMES) {
    cursor_frame = 0;
  }

  if (cursor_type == CURSOR_DEFAULT) {
    gdk_window_set_cursor(root_window, NULL);
    cursor_timer_id = 0;
    return FALSE; 
  }

  gdk_window_set_cursor(root_window,
                fc_cursors[cursor_type][cursor_frame]);
  control_mouse_cursor(NULL  This function will change the current mouse cursorupdate_mouse_cursor(enum cursor_type new_cursor_type)
{
  cursor_type = new_cursor_type;
  if (!cursor_timer_id) {
    cursor_timer_id = gtk_timeout_add(CURSOR_INTERVAL, anim_cursor_cb, NULL);
  }_list *punits)
{
  GtkWidget *label;

  label = gtk_frame_get_label_widget(GTK_FRAME(unit_info_frame));
  gtk_label_set_text(GTK_LABEL(label),
		     get_unit_info_label_text1(punits));
s, 0));

  update_unit_pix_label(punits);
}
GdkPixbuf *get_thumb_pixbuf(int onoff)
{
  return sprite_get_pixbuf(get_treaty_thumb_sprite(tileset, BOOL_VAL(onoff))**
  Set information for the indicator icons typically shown in the main
  client window.  The parameters tell which sprite to use for the
  indicator**/
void set_indicator_icons(struct sprite *bulb, struct sprite *sol,
			 struct sprite *flake, struct sprite *gov)
{
  gtk_image_set_from_pixbuf(GTK_IMAGE(bulb_label),
			    sprite_get_pixbuf(bulb));
  gtk_image_set_from_pixbuf(GTK_IMAGE(sun_label),
			    sprite_get_pixbuf(sol));
  gtk_image_set_from_pixbuf(GTK_IMAGE(flake_label),
			    sprite_get_pixbuf(flake));
  gtk_image_set_from_pixbuf(GTK_IMAGE(government_label),
			    sprite_get_pixbuf(gov)**
  Return the dimensions of the area (container widget; maximum size) for
  the over**/
void get_overview_area_dimensions(int *width, int *height)
{
  gdk_drawable_get_size(overview_canvas->windowoverview**
  Return a canvas that is the overview window!cleared) {
      gtk_widget_queue_draw(w);
      cleared = TRUE;
    }
    map_center = TRUE;
  }
  else
  {
    if (map_exists()) { /* do we have a map at all */
      /* First we mark the area to be updated as dirty.  Then we unqueue
       * any pending updates, to make sure only the most up-to-date data
       * is written (otherwise drawing bugs happen when old data is copied
       * to screen).  Then we draw all changed areas to the screen. */
      unqueue_mapview_updates(FALSE);
      gdk_draw_drawable(map_canvas->window, civ_gc, mapview.store->v.pixmapview.store->v.pixmap,
		    canvas_x, canvas_y, canvas_x, canvas_y,
		    pixel_width, pixel_height);
}

#define MAX_DIRTY_RECTS 20
static int num_dirty_rects = 0;
static GdkRectangle dirty_rects[MAX_DIRTY_RECTS];
static bool is_flush_queued = FALSE;A callback invoked as a result of gtk_idle_add, this function simply
  flushes the mapview canvasstatic gint unqueue_flush(gpointer data)
{
  flush_dirty();
  redraw_selection_rectangle();
  editor_redraw();
  is_flush_queued = FALSE;
  return 0Called when a region is marked dirty, this function queues a flush event
  to be handled later by GTK.  The flush may end up being done
  by freeciv before then, in which case it will be a wasted callstatic void queue_flush(void)
{
  if (!is_flush_queued) {
    gtk_idle_add(unqueue_flush, NULL);
    is_flush_queued = TRUE;
  }if (num_dirty_rects < MAX_DIRTY_RECTS) {
    dirty_rects[num_dirty_rects].x = canvas_x;
    dirty_rects[num_dirty_rects].y = canvas_y;
    dirty_rects[num_dirty_rects].width = pixel_width;
    dirty_rects[num_dirty_rects].height = pixel_height;
    num_dirty_rects++;
    queue_flush();
  }num_dirty_rects = MAX_DIRTY_RECTS;
  queue_flush(if (num_dirty_rects == MAX_DIRTY_RECTS) {
    flush_mapcanvas(0, 0, map_canvas->allocation.width,
		    map_canvas->allocation.height);
  } else {
    int i;

    for (i = 0; i < num_dirty_rects; i++) {
      flush_mapcanvas(dirty_rects[i].x, dirty_rects[i].y,
		      dirty_rects[i].width, dirty_rects[i].height);
    }
  }
  num_dirty_rects = 0put_unit_gpixmap(struct unit *punit, GtkPixcomm *p)
{
  struct canvas canvas_store;

  canvas_store.type = CANVAS_PIXCOMM;
  canvas_store.v.pixcomm = p;

  gtk_pixcomm_freeze(p);
  gtk_pixcomm_clear(p);

  put_unit,
                                    int *upkeep_cost, int happy_cost)
{
  struct canvas store;
 
  store.type = CANVAS_PIXCOMM;
  store.v.pixcomm = p;

  gtk_pixcomm_freeze(p);

  put_unit_city_overlays(punit, &store, 0, tileset_tile_height(tileset),
                         upkeep_cost, happy_costvoid pixmap_put_overlay_tile(GdkDrawable *pixmap,
			     int canvas_x, int canvas_y,
			     struct sprite *ssprite)
{
  if (!ssprite) {
    return;
  }

  if (ssprite->pixmap) {
    gdk_gc_set_clip_origin(civ_gc, canvas_x, canvas_y);
    gdk_gc_set_clip_mask(civ_gc, ssprite->mask);

    gdk_draw_drawable(pixmap, civ_gc, ssprite->pixmap,
		      0, 0,
		      canvas_x, canvas_y,
		      ssprite->width, ssprite->height);
    gdk_gc_set_clip_mask(civ_gc, NULL);
  } else {
    gdk_draw_pixbuf(pixmap, civ_gc, ssprite->pixbuf,
		    0, 0,
		  canvas_x, canvas_y,
		  ssprite->width, ssprite->height,
		  GDK_RGB_DITHER_NONE, 0, 0);
  }sprite *ssprite,
			      int offset_x, int offset_y,
			      int width, int height)
{
#ifdef DEBUG
  static int sprites = 0, pixbufs = 0;
#endif

  if (ssprite->pixmap) {
    if (ssprite->mask) {
      gdk_gc_set_clip_origin(civ_gc, pixmap_x, pixmap_y);
      gdk_gc_set_clip_mask(civ_gc, ssprite->mask);
    }

    gdk_draw_drawable(pixmap, civ_gc, ssprite->pixmap,
		      offset_x, offset_y,
		      pixmap_x + offset_x, pixmap_y + offset_y,
		      MIN(width, MAX(0, ssprite->width - offset_x)),
		      MIN(height, MAX(0, ssprite->height - offset_y)));

    gdk_gc_set_clip_mask(civ_gc, NULL);
  } else {
    gdk_draw_pixbuf(pixmap, civ_gc, ssprite->pixbuf,
		    GDK_RGB_DITHER_NONE, 0, 0);
#ifdef DEBUG
    pixbufs++;
#endif
  }

#ifdef DEBUG
  sprites++;
  if (sprites % 1000 == 0) {
    freelog(LOG_DEBUG, "%5d / %5d pixbufs = %d%%",
	    pixbufs, sprites, 100 * pixbufs / sprites);
  }
#endifCreated a fogged version of the sprite.  This can fail on older systems
  in which case the callers needs a fallbackstatic void fog_sprite(struct sprite *sprite)
{
  int x, y;
  GdkPixbuf *fogged;
  guchar *pixel;
  const int bright = 65; /* Brightness percentage */

  if (sprite->pixmap) {
    fogged = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8,
			    sprite->width, sprite->height);
    gdk_pixbuf_get_from_drawable(fogged, sprite->pixmap, NULL,
				 0, 0, 0, 0, sprite->width, sprite->height);
  } else {
    fogged = gdk_pixbuf_copy(sprite->pixbuf);
  }

  /* Iterate over all pixels, reducing brightness by 50%. */
  for (x = 0; x < sprite->width; x++) {
    for (y = 0; y < sprite->height; y++) {
      pixel = gdk_pixbuf_get_pixels(fogged)
	+ y * gdk_pixbuf_get_rowstride(fogged)
	+ x * gdk_pixbuf_get_n_channels(fogged);

      pixel[0] = pixel[0] * bright / 100;
      pixel[1] = pixel[1] * bright / 100;
      pixel[2] = pixel[2] * bright / 100;
    }
  }

  if (sprite->pixmap) {
    gdk_pixbuf_render_pixmap_and_mask(fogged, &sprite->pixmap_fogged,
				      NULL, 0);
    g_object_unref(fogged);
  } else {
    sprite->pixbuf_fogged = fogged;
  }void pixmap_put_overlay_tile_draw(GdkDrawable *pixmap,
				  int canvas_x, int canvas_y,
				  struct sprite *ssprite,
				  bool fog)
{
  if (!ssprite) {
    return;
  }

  if (fog && better_fog
      && ((ssprite->pixmap && !ssprite->pixmap_fogged)
	  || (!ssprite->pixmap && !ssprite->pixbuf_fogged))) {
    fog_sprite(ssprite);
    if ((ssprite->pixmap && !ssprite->pixmap_fogged)
	|| (!ssprite->pixmap && !ssprite->pixbuf_fogged)) {
      freelog(LOG_NORMAL,
	      _("Better fog will only work in truecolor.  Disabling it"));
      better_fog = FALSE;
    }
  }

  if (fog && better_fog) {
    if (ssprite->pixmap) {
      if (ssprite->mask) {
	gdk_gc_set_clip_origin(civ_gc, canvas_x, canvas_y);
	gdk_gc_set_clip_mask(civ_gc, ssprite->mask);
      }
      gdk_draw_drawable(pixmap, civ_gc,
			ssprite->pixmap_fogged,
			0, 0,
			canvas_x, canvas_y,
			ssprite->width, ssprite->height);
      gdk_gc_set_clip_mask(civ_gc, NULL);
    } else {
      gdk_draw_pixbuf(pixmap, civ_gc, ssprite->pixbuf_fogged,
		      0, 0, canvas_x, canvas_y, 
		      ssprite->width, ssprite->height,
		      GDK_RGB_DITHER_NONE, 0, 0);
    }
    return;
  }

  pixmap_put_sprite(pixmap, canvas_x, canvas_y, ssprite,
		    0, 0, ssprite->width, ssprite->prite_get_mask(ssprite));
    gdk_gc_set_foreground(fill_tile_gc,
			  &get_color(tileset, COLOR_MAPVIEW_UNKNOWN)->color, canvas_y, ssprite->width, ssprite->height); Draws a cross-hair overlay on a tile
****/
void put_cross_overlay_tile(struct tile *ptile)
{
  int canvas_x, canvas_y;

  if (tile_to_canvas_pos(&canvas_x, &canvas_y, ptileget_attention_crosshair_sprite(tileset));
  }GdkPoint points[5];

  gdk_gc_set_foreground(civ_gc,
			&get_color(tileset, COLOR_MAPVIEW_SELECTION)->color);

  /* gdk_draw_rectangle() must start top-left.. */
  points[0].x = canvas_x;
  points[0].y = canvas_y;

  points[1].x = canvas_x + w;
  points[1].y = canvas_y;

  points[2].x = canvas_x + w;
  points[2].y = canvas_y + h;

  points[3].x = canvas_x;
  points[3].y = canvas_y + h;

  points[4].x = canvas_x;
  points[4].y = canvas_y;
  gdk_draw_lines(map_canvas->window, civ_gc, points, ARRAY_SIZE(points)  editgui_tileset_changed();

  /* keep the icon of the executable on Windows (see PR#36491) */
#ifndef WIN32_NATIVE
  gtk_window_set_icon(GTK_WINDOW(toplevel),
		sprite_get_pixbuf(get_icon_sprite(tileset, ICON_FREECIV)));
#endif
}
ENDREP
DELTA 14417 157439 54288
SVN  ƒ°%ƒ°E.} Š" Š ‚¶8Š*€c …z‚Á;„ g‚Ç4„ &‚É„ N‚æ?„ É‚çlient_mainconn.playing, pImprove);
    can_eventually_build =
	can_player_build_improvement_later(client.connconnconnconnconnENDREP
DELTA 15174 2254 279
SVN  øø;{ ‹j – n‹i€e éhŽ-/* common & utility *//* client */
#include "agents.h"
#include "attribute.h"
#include "chatline_g.h"
#include "client_mainENDREP
DELTA 15266 1792 10279
SVN  …á]…áW; …~  b…}Œ †^¢ …„
‡y Õ*…Œ3/* utility *//* common *//* client */
#include "client_mainENDREP
DELTA 15402 0 94
SVN  ÔÔ9, ‡ – ‚;‡Œ †‰HŠ Ä-f/* common & utility *//* client */lient_mainENDREP
DELTA 15266 12687 266
SVN  ƒŸkƒ j †~ – I†}€T ƒ–`‰/* common & utility *//* client */
#include "chatline_common.h"
#include "cityrep.h"
#include "client_mainENDREP
DELTA 15284 484 1305
SVN  ‚—+‚—Uw ˆA €U ‚5ˆ{¢ ‚‹h‹C/* utility */
#include "fcintl.h"
#include "log.h"
#include "support.h"

/* common *//* client */
#include "client_mainENDREP
DELTA 14417 26147 6847
SVN  ƒí{ƒî^u‚Q †? – Y†>€K cˆS –] ˜z—a„ ™$°Z„ ŒsÉ}ª Š×„ â„ ‚vã2„ Èæ'„ ‚®< ‚n‚Ãr …8‚²N„ B‚» ‡ Q‚À=‡ [‚Æs„ „{‚» „ ‚|‚¿z„ g‚®< ƒr‚Ã\„ B‚» † Q‚À=† [‚Æs„ B‚» ‡ o‚À= [Ç ¤ Q‚Æ}„ B‚» ‡ C‚À=‹ Þ; T‚¼@ r‚Ñ=„ †‚Ò.„ ˆ1‚ØE„ Žv‚àu„ Õ‚ïj„ •bƒÄyŠ “ƒÚe/* common & utility *//* client */
#include "canvas.h"
#include "cityrep.h"
#include "client_mainconnconn(city_owner(pdialog->pcity) != client.connconnconnconnconnconn.playing, punit->homecityconndisbandhomecitconnconnconnconnsentryfortifconnfortifystatic void unitupgrade_callback_yesconnupgradeunitupgradeconnconnconnconnconnclient.conENDREP
DELTA 14417 20266 5853
SVN  ­O­f< †P – †O¢ ŸFˆ„ …u§Z/* common & utility *//* client */
#include "client_mainconnENDREP
DELTA 14422 31839 3437
SVN  ÄyÅm ˆJ – ˆI€M …jŠ5Š ´P)/* common & utility *//* client */
#include "chatline.h"
#include "citydlg.h"
#include "client_mainclient.conENDREP
DELTA 14427 173733 137
SVN  ‚Ž&‚Ž(
 ‰r Š ‚„,‰zlient_mainENDREP
DELTA 14956 7131 565
SVN  ‚®‚®* ‡Q €] eˆ0€M ‚¤:‰S#include "fcintl.h"
#include "mem.h"
#include "movement.h"
#include "support.h"

/* common *//* client */
#include "chatline.h"
#include "cityrep.h"
#include "client_mainENDREP
DELTA 11590 8895 3419
SVN  Â3ƒ¢$†V‚Éa † €‹" G ¦ GŠ@€‡* S¥€ aŒ@€ U¥}° GŠ@€; T¥~ª GŠ@€	 T¥~£ GŠ@€‚F T¥~¸ GŠ@€ƒ T¥~œ GŠ@€[ T¥~¯ GŠ@€H U¥}€} GŠ@€E T¥~€S f‘€M T¥~¡ GŠ@€X T¥~® GŠ@€ƒ: T¥~€i GŠ@€‚ U¥}€^ GŠ@€…J S¥€K GŠ@€‘S U¥}€K GŠ@€Y [€ GŠ@€„ U¥}€J GŠ@€Š  S¥· GŠ@€Œ U¥}­ GŠ@€ƒK S¥€r GŠ@€…S U¥}® GŠ@€„ S¥€) GŠ@€[ U¥}€‚; GŠ@€”p S¥€G GŠ@€	 T¥~¿ GŠ@€ T¥~€m GŠ@€‚r S¥€D GŠ@€‚8 S¥¶ GŠ@€ƒN S¥ž GŠ@€ U¥}® GŠ@€ U¥}³ GŠ@€! U¥}­ GŠ@€, U¥}€F GŠ@€…; S¥¥ Z‘€1 T¥~€e GŠ@€‡T T¥~€A GŠ@€C T¥~€@ GŠ@€. T¥~­ GŠ@€> U¥}€T GŠ@€E T¥~´ GŠ@€0 T¥~¼ GŠ@€A V¥|€g GŠ@€†P b‘ ° Z‘€[ T¥~€ GŠ@€F T¥~€B GŠ@€| T¥~€S GŠ@€W T¥~€o Z‘€J T¥~± GŠ@€ U¥}€ƒ GŠ@€ƒZ T¥~€J GŠ@€‚ T¥~° GŠ@€‚& U¥}± GŠ@€‚ U¥}€^ GŠ@€‚i T¥~ª GŠ@€“
 S¥€K GŠ@€…@ T¥~€ GŠ@€' T¥~€J GŠ@€ƒ^ U¥}­ GŠ@€O T¥~¸ GŠ@€… T¥~€v GŠ@€‚v f‘ ® GŠ@€ƒV Z‘ € GŠ@€Šn T¥~€ GŠ@€* T¥~´ GŠ@€ T¥~€G GŠ@€ T¥~€U GŠ@€„t/* utility */
#include "fcintl.h"
#include "hash.h"
#include "log.h"
#include "support.h"

/* common */
#include "map.h"
#include "movement.h"
#include "packets.h"

/* client */
#include "client_main.h"
#include "climap.h"
#include "control.h"
#include "editor.h"
#include "mapctrl_common.h"
#include "mapview_common.h"
#include "tilespec.h"

#include "editgui_g.h"
#include "mapview_g.h"


enum selection_modes {
  SELECTION_MODE_NEW = 0,
  SELECTION_MODE_ADD,
  SELECTION_MODE_REMOVE
};

enum editor_tool_flags {
  ETF_NO_FLAGS  = 0,
  ETF_HAS_VALUE = 1<<0,
  ETF_HAS_SIZE  = 1<<1,
  ETF_HAS_COUNT = 1<<2,
  ETF_HAS_APPLIED_PLAYER = 1<<3,
  ETF_HAS_VALUE_ERASE = 1<<4,
  ETF_HAS_COPY_PASTE = 1<<5
};

struct edit_buffer {
  int type_flags;
  struct tile_list *vtiles;
  const struct tile *origin;
};

struct editor_tool {
  int flags;
  enum editor_tool_mode mode;
  int size;
  int count;
  int applied_player_no;
  const char *name;
  int value;
  const char *tooltip;
  struct edit_buffer *copy_buffer;
};

struct editor_state {
  enum editor_tool_type tool;
  struct editor_tool tools[NUM_EDITOR_TOOL_TYPES];

  const struct tile *current_tile;
  bool tool_active;

  bool selrect_active;
  int selrect_start_x;
  int selrect_start_y;
  int selrect_x;
  int selrect_y;
  int selrect_width;
  int selrect_height;

  enum selection_modes selection_mode;

  struct hash_table *selected_tile_table;
};

static struct editor_state *editor;

******
  Initialize editor tool data.
*****/
static void tool_init(enum editor_tool_type ett, const char *name,
                      int flags, const char *tooltip)
{
  struct editor_tool *tool;

  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return;
  }

  tool = editor->tools + ett;

  tool->mode = ETM_PAINT;
  tool->name = name;
  tool->flags = flags;
  tool->tooltip = tooltip;
  tool->size = 1;
  tool->count = 1;
  tool->applied_player_no = 0;

  if (flags & ETF_HAS_COPY_PASTE) {
    int bt = 0;
    if (ett == ETT_TERRAIN) {
      bt = EBT_TERRAIN;
    } else if (ett == ETT_TERRAIN_RESOURCE) {
      bt = EBT_RESOURCE;
    } else if (ett == ETT_TERRAIN_SPECIAL) {
      bt = EBT_SPECIAL;
    } else if (ett == ETT_MILITARY_BASE) {
      bt = EBT_BASE;
    } else if (ett == ETT_UNIT) {
      bt = EBT_UNIT;
    } else if (ett == ETT_CITY) {
      bt = EBT_CITY;
    }

    if (bt != 0) {
      tool->copy_buffer = edit_buffer_new(bt);
    }
  } Initialize the client's editor state information to some suitable default
  values. This only needs to be done once at client star(void)
{
  if (editor != NULL) {
    return;
  }

  editor = fc_calloc(1, sizeof(struct editor_state));

  tool_init(ETT_TERRAIN, _("Terrain"),
            ETF_HAS_VALUE | ETF_HAS_SIZE | ETF_HAS_COPY_PASTE,
            _("Change tile terrain.\nShortcut: t\n"
              "Select terrain type: shift+t or right-click here."));
  tool_init(ETT_TERRAIN_RESOURCE, _("Terrain Resource"),
            ETF_HAS_VALUE | ETF_HAS_SIZE | ETF_HAS_COPY_PASTE,
            _("Change tile terrain resources.\nShortcut: r\n"
              "Select resource type: shift+r or right-click here."));
  tool_init(ETT_TERRAIN_SPECIAL, _("Terrain Special"), ETF_HAS_VALUE
            | ETF_HAS_SIZE | ETF_HAS_VALUE_ERASE | ETF_HAS_COPY_PASTE,
            _("Modify tile specials.\nShortcut: s\n"
              "Select special type: shift+s or right-click here."));
  tool_init(ETT_MILITARY_BASE, _("Military Base"), ETF_HAS_VALUE
            | ETF_HAS_SIZE | ETF_HAS_VALUE_ERASE | ETF_HAS_COPY_PASTE,
            _("Create a military base.\nShortcut: m\n"
              "Select base type: shift+m or right-click here."));
  tool_init(ETT_UNIT, _("Unit"), ETF_HAS_VALUE
            | ETF_HAS_COUNT | ETF_HAS_APPLIED_PLAYER
            | ETF_HAS_VALUE_ERASE | ETF_HAS_COPY_PASTE,
            _("Create unit.\nShortcut: u\nSelect unit "
              "type: shift+u or right-click here."));
  tool_init(ETT_CITY, _("City"), ETF_HAS_SIZE | ETF_HAS_APPLIED_PLAYER
            | ETF_HAS_COPY_PASTE, _("Create city.\nShortcut: c"));
  tool_init(ETT_VISION, _("Vision"), ETF_HAS_SIZE,
            _("Modify player's tile knowledge.\nShortcut: v"));
  tool_init(ETT_STARTPOS, _("Start Position"), ETF_HAS_APPLIED_PLAYER,
            _("Place a player start position.\nShortcut: p"));

  editor->selected_tile_table = hash_new(hash_fval_keyval,
                                         hash_fcmp_keyval);
  hash_set_no_shrink(editor->selected_tile_table, TRUE Set the current tool to be used by the editor.
*****/
void editor_set_tool(enum editor_tool_type ett)
{
  if (editor == NULL) {
    return;
  }

  if (!(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return;
  }

  editor->tool = ett Get the current tool used by the editor.
*****/
enum editor_tool_type editor_get_tool(void)
{
  if (editor == NULL) {
    return NUM_EDITOR_TOOL_TYPES;
  }

  return editor->tool Set the mode for the editor tool.
*****/
void editor_tool_set_mode(enum editor_tool_type ett,
                          enum editor_tool_mode etm)
{
  if (editor == NULL || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)
      || !(0 <= etm && etm < NUM_EDITOR_TOOL_MODES)
      || !editor_tool_has_mode(ett, etm)) {
    return;
  }

  editor->tools[ett].mode = etm Return TRUE if the given tool supports the given mode.
*****/
bool editor_tool_has_mode(enum editor_tool_type ett,
                          enum editor_tool_mode etm)
{
  if (editor == NULL || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)
      || !(0 <= etm && etm < NUM_EDITOR_TOOL_MODES)) {
    return FALSE;
  }

  if ((etm == ETM_COPY || etm == ETM_PASTE)
      && !(editor->tools[ett].flags & ETF_HAS_COPY_PASTE)) {
    return FALSE;
  }

  return TRUE Get the mode for the tool.
*****/
enum editor_tool_mode editor_tool_get_mode(enum editor_tool_type ett)
{
  if (editor == NULL || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return NUM_EDITOR_TOOL_MODES;
  }
  return editor->tools[ett].mode Returns TRUE if the *client* is in edit mode.
*****/
bool editor_is_active(void)
{
  return can_conn_edit(&client.conn Returns TRUE if the given tool type has sub-values (e.g. the terrain
  tool has values corresponding to the terrain types).
*****/
bool editor_tool_has_value(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return FALSE;
  }
  return editor->tools[ett].flags & ETF_HAS_VALUE Set the value ID for the given tool. How the value is interpreted depends
  on thetool_set_value(enum editor_tool_type ett, int value)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)
      || !editor_tool_has_value(ett)) {
    return;
  }
  editor->tools[ett].value = value Get the current tool sub-value.
*****/
int editor_tool_get_value(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)
      || !editor_tool_has_value(ett)) {
    return 0;
  }
  
  return editor->tools[ett].value Record the start of the selection rectangle.
*****/
static void editor_start_selection_rectangle(int canvas_x, int canvas_y)
{
  if (!editor) {
    return;
  }

  if (editor->selection_mode == SELECTION_MODE_NEW
      && editor_selection_count() > 0) {
    editor_selection_clear();
    update_map_canvas_visible();
  }

  editor->selrect_start_x = canvas_x;
  editor->selrect_start_y = canvas_y;
  editor->selrect_width = 0;
  editor->selrect_height = 0;
  editor->selrect_active = TRUE Temporary convenience function to work-around the fact that certain
  special values (S_RESOURCE_VALID and S_PILLAGE_BASE) do not in fact
  correspond to drawable special types, or are to be phased out soon
  (the base "specials").
*****/
static inline bool tile_really_has_any_specials(const struct tile *ptile)
{
  bv_special specials;

  if (!ptile) {
    return FALSE;
  }

  specials = tile_specials(ptile);

  BV_CLR(specials, S_RESOURCE_VALID);
  BV_CLR(specials, S_PILLAGE_BASE);

  return BV_ISSET_ANY(specials Set the editor's current applied player number according to what exists
  on the given tile.
*****/
static void editor_grab_applied_player(const struct tile *ptile)
{
  int apno = -1;

  if (!editor || !ptile) {
    return;
  }

  if (client_has_player()
      && tile_get_known(ptile, client_player()) == TILE_UNKNOWN) {
    return;
  }

  if (tile_city(ptile) != NULL) {
    apno = player_number(city_owner(tile_city(ptile)));
  } else if (unit_list_size(ptile->units) > 0) {
    struct unit *punit = unit_list_get(ptile->units, 0);
    apno = player_number(unit_owner(punit));
  } else if (tile_owner(ptile) != NULL) {
    apno = player_number(tile_owner(ptile));
  }
  
  if (valid_player_by_number(apno) != NULL) {
    editor_tool_set_applied_player(editor_get_tool(), apno);
    editgui_refresh();
  } Set the editor's current tool according to what exists at the given tile.
*****/
static void editor_grab_tool(const struct tile *ptile)
{
  int ett = -1, value = 0;
  struct base_type *first_base = NULL;

  if (!editor) {
    return;
  }

  if (!ptile) {
    return;
  }

  base_type_iterate(pbase) {
    if (tile_has_base(ptile, pbase)) {
      first_base = pbase;
      break;
    }
  } base_type_iterate_end;

  if (client_has_player()
      && tile_get_known(ptile, client_player()) == TILE_UNKNOWN) {
    ett = ETT_VISION;

  } else if (tile_city(ptile)) {
    ett = ETT_CITY;

  } else if (unit_list_size(ptile->units) > 0) {
    int max_score = 0, score;
    struct unit *grabbed_punit = NULL;
    unit_list_iterate(ptile->units, punit) {
      score = 0;
      if (is_air_unit(punit)) {
        score = 5;
      } else if (is_ground_unit(punit)) {
        score = 4;
      } else if (is_sailing_unit(punit)) {
        score = 3;
      } else {
        score = 2;
      }
      if (punit->transported_by > 0) {
        score = 1;
      }

      if (score > max_score) {
        max_score = score;
        grabbed_punit = punit;
      }
    } unit_list_iterate_end;

    if (grabbed_punit) {
      ett = ETT_UNIT;
      value = utype_number(unit_type(grabbed_punit));
    }
  } else if (first_base != NULL) {
    ett = ETT_MILITARY_BASE;
    value = base_number(first_base);

  } else if (tile_really_has_any_specials(ptile)) {
    int specials_array[S_LAST];
    int count = 0, i, special = -1;

    tile_special_type_iterate(s) {
      specials_array[count++] = s;
    } tile_special_type_iterate_end;

    /* Grab specials in reverse order of enum tile_special_type. */

    for (i = count - 1; i >= 0; i--) {
      if (tile_has_special(ptile, specials_array[i])) {
        special = specials_array[i];
        break;
      }
    }

    if (special >= 0) {
      ett = ETT_TERRAIN_SPECIAL;
      value = special;
    }
  } else if (tile_resource(ptile) != NULL) {
    ett = ETT_TERRAIN_RESOURCE;
    value = resource_number(tile_resource(ptile));

  } else if (tile_terrain(ptile) != NULL) {
    ett = ETT_TERRAIN;
    value = terrain_number(tile_terrain(ptile));
  }

  if (ett < 0) {
    return;
  }

  editor_set_tool(ett);
  if (editor_tool_has_value(ett)) {
    editor_tool_set_value(ett, value);
  }
  editgui_refresh( Returns TRUE if the given tile has some objects with editable properties.
*****/
static inline bool can_edit_tile_properties(struct tile *ptile)
{
  return ptile !Handle a request to edit the properties for the given tile. If the tile
  is part of a selection, then all selected tiles are passed to the
  property editor.
*****/
static void popup_properties(struct tile *ptile)
{
  struct tile_list *tiles;

  if (!ptile) {
    return;
  }

  tiles = tile_list_new();

  if (editor_tile_is_selected(ptile)) {
    hash_iterate(editor->selected_tile_table, sel_tile, dummy) {
      if (can_edit_tile_properties(sel_tile)) {
        tile_list_append(tiles, sel_tile);
      }
    } hash_iterate_end;
  } else {
    if (can_edit_tile_properties(ptile)) {
      tile_list_append(tiles, ptile);
    }
  }

  editgui_popup_properties(tiles);

  tile_list_free(tiles Handle a user's mouse button press at the given point on the map canvas.
*****/
void editor_mouse_button_press(int canvas_x, int canvas_y,
                               int button, int modifiers)
{
  struct tile *ptile;

  if (editor == NULL) {
    return;
  }

  ptile = canvas_pos_to_tile(canvas_x, canvas_y);
  if (ptile == NULL) {
    return;
  }

  switch (button) {

  case MOUSE_BUTTON_LEFT:
    if (modifiers == EKM_SHIFT) {
      editor_grab_tool(ptile);
    } else if (modifiers == EKM_CTRL) {
      editor_grab_applied_player(ptile);
    } else if (modifiers == EKM_NONE) {
      editor->tool_active = TRUE;
      editor_apply_tool(ptile, FALSE);
      editor_notify_edit_finished();
      editor_set_current_tile(ptile);
    }
    break;

  case MOUSE_BUTTON_RIGHT:
    if (modifiers == (EKM_ALT | EKM_CTRL)) {
      popup_properties(ptile);
      break;
    }
    
    if (modifiers == EKM_SHIFT) {
      editor->selection_mode = SELECTION_MODE_ADD;
    } else if (modifiers == EKM_ALT) {
      editor->selection_mode = SELECTION_MODE_REMOVE;
    } else if (modifiers == EKM_NONE) {
      editor->selection_mode = SELECTION_MODE_NEW;
    } else {
      break;
    }
    editor_start_selection_rectangle(canvas_x, canvas_y);
    break;

  case MOUSE_BUTTON_MIDDLE:
    if (modifiers == EKM_NONE) {
      popup_properties(ptile);
    }
    break;

  default:
    break;
  } Record and handle the end of the selection rectangle.
*****/
static void editor_end_selection_rectangle(int canvas_x, int canvas_y)
{
  int w, h;

  if (!editor) {
    return;
  }

  editor->selrect_active = FALSE;

  if (editor->selrect_width <= 0 || editor->selrect_height <= 0) {
    struct tile *ptile;
    
    ptile = canvas_pos_to_tile(canvas_x, canvas_y);
    if (ptile && editor->selection_mode == SELECTION_MODE_ADD) {
      editor_selection_add(ptile);
    } else if (ptile && editor->selection_mode == SELECTION_MODE_REMOVE) {
      editor_selection_remove(ptile);
    } else {
      recenter_button_pressed(canvas_x, canvas_y);
      return;
    }

    if (ptile) {
      refresh_tile_mapcanvas(ptile, TRUE, TRUE);
    }

    return;
  }

  gui_rect_iterate(mapview.gui_x0 + editor->selrect_x,
                   mapview.gui_y0 + editor->selrect_y,
                   editor->selrect_width, editor->selrect_height,
                   ptile, pedge, pcorner, gui_x, gui_y) {
    if (ptile == NULL) {
      continue;
    }
    if (editor->selection_mode == SELECTION_MODE_NEW
        || editor->selection_mode == SELECTION_MODE_ADD) {
      editor_selection_add(ptile);
    } else if (editor->selection_mode == SELECTION_MODE_REMOVE) {
      editor_selection_remove(ptile);
    }
  } gui_rect_iterate_end;

  w = tileset_tile_width(tileset);
  h = tileset_tile_height(tileset);

  update_map_canvas(editor->selrect_x - w,
                    editor->selrect_y - h,
                    editor->selrect_width + 2 * w,
                    editor->selrect_height + 2 * h);
  flush_dirty( Handle the release of a mouse button click.
*****/
void editor_mouse_button_release(int canvas_x, int canvas_y,
                                 int button, int modifiers)
{
  switch (button) {

  case MOUSE_BUTTON_LEFT:
    editor_set_current_tile(NULL);
    editor->tool_active = FALSE;
    break;

  case MOUSE_BUTTON_RIGHT:
    if (editor->selrect_active) {
      editor_end_selection_rectangle(canvas_x, canvas_y);
    }
    break;

  case MOUSE_BUTTON_MIDDLE:
    break;

  default:
    break;
  } Handle a change in the size of the selection rectangle. The given point
  is the new extremity of the rectangle.
*****/
static void editor_resize_selection_rectangle(int canvas_x, int canvas_y)
{
  int x1, y1, x2, y2;

  if (editor->selrect_start_x <= canvas_x) {
    x1 = editor->selrect_start_x;
    x2 = canvas_x;
  } else {
    x1 = canvas_x;
    x2 = editor->selrect_start_x;
  }

  if (editor->selrect_start_y <= canvas_y) {
    y1 = editor->selrect_start_y;
    y2 = canvas_y;
  } else {
    y1 = canvas_y;
    y2 = editor->selrect_start_y;
  }

  dirty_all();
  flush_dirty();

  if (x1 == x2 || y1 == y2) {
    editor->selrect_width = 0;
    editor->selrect_height = 0;
    return;
  }

  editor->selrect_x = x1;
  editor->selrect_y = y1;
  editor->selrect_width = x2 - x1;
  editor->selrect_height = y2 - y1;

  editor_redraw( Handle the mouse moving over the map canvas.
*****/
void editor_mouse_move(int canvas_x, int canvas_y, int modifiers)
{
  const struct tile *ptile, *old;

  if (!editor) {
    return;
  }

  old = editor_get_current_tile();
  ptile = canvas_pos_to_tile(canvas_x, canvas_y);

  if (!ptile) {
    return;
  }

  if (editor->tool_active && old != NULL && old != ptile) {
    editor_apply_tool(ptile, FALSE);
    editor_notify_edit_finished();
    editor_set_current_tile(ptile);
  }

  if (editor->selrect_active) {
    editor_resize_selection_rectangle(canvas_x, canvas_y);
  } Notify the server that a batch of edits has completed. This is used as
  a hint for the server to now do any checks it has saved while the batch
  was being processed.
*****/
void editor_notify_edit_finished(void)
{
  send_packet_edit_check_tiles(&client.conn Apply the current editor tool to the given tile. This function is
  suitable to called over multiple tiles at once. Once the batch of
  operations is finished you should call editor_notify_edit_finished.
  The 'part_of_selection' parameter should be TRUE if the tool is
  being applied to a tile from a selection.
*****/
void editor_apply_tool(const struct tile *ptile,
                       bool part_of_selection)
{
  enum editor_tool_type ett;
  enum editor_tool_mode etm;
  int value, size, count, apno, x, y, id;
  bool erase;
  struct connection *my_conn = &client.conn;

  if (editor == NULL || ptile == NULL) {
    return;
  }

  ett = editor_get_tool();
  etm = editor_tool_get_mode(ett);
  size = editor_tool_get_size(ett);
  count = editor_tool_get_count(ett);
  value = editor_tool_get_value(ett);
  apno = editor_tool_get_applied_player(ett);

  if (ett != ETT_VISION && !client_is_global_observer()
      && client_has_player()
      && tile_get_known(ptile, client_player()) == TILE_UNKNOWN) {
    return;
  }

  if (editor_tool_has_applied_player(ett)
      && valid_player_by_number(apno) == NULL) {
    return;
  }

  if (etm == ETM_COPY || etm == ETM_PASTE) {
    struct edit_buffer *ebuf;
    ebuf = editor_tool_get_copy_buffer(ett);
    if (etm == ETM_COPY) {
      if (part_of_selection) {
        edit_buffer_copy(ebuf, ptile);
      } else {
        edit_buffer_clear(ebuf);
        edit_buffer_copy_square(ebuf, ptile, size);
        editgui_refresh();
      }
    } else {
      edit_buffer_paste(ebuf, ptile);
    }
    return;
  }

  if (part_of_selection && ett != ETT_CITY) {
    size = 1;
  }

  erase = (etm == ETM_ERASE);
  x = ptile->x;
  y = ptile->y;

  switch (ett) {

  case ETT_TERRAIN:
    dsend_packet_edit_tile_terrain(my_conn, x, y, erase ? 0 : value, size);
    break;

  case ETT_TERRAIN_RESOURCE:
    dsend_packet_edit_tile_resource(my_conn, x, y, erase ? -1 : value,
                                    size);
    break;

  case ETT_TERRAIN_SPECIAL:
    dsend_packet_edit_tile_special(my_conn, x, y, value, erase, size);
    break;

  case ETT_MILITARY_BASE:
    dsend_packet_edit_tile_base(my_conn, x, y, value, erase, size);
    break;

  case ETT_UNIT:
    if (erase) {
      dsend_packet_edit_unit_remove(my_conn, apno, x, y, value, count);
    } else {
      dsend_packet_edit_unit_create(my_conn, apno, x, y, value, count, 0);
    }
    break;

  case ETT_CITY:
    if (erase) {
      struct city *pcity = tile_city(ptile);
      if (pcity != NULL) {
        id = pcity->id;
        dsend_packet_edit_city_remove(my_conn, id);
      }
    } else {
      dsend_packet_edit_city_create(my_conn, apno, x, y, size, 0);
    }
    break;

  case ETT_VISION:
    if (client_has_player()) {
      id = client_player_number();
      dsend_packet_edit_player_vision(my_conn, id, x, y, !erase, size);
    }
    break;

  case ETT_STARTPOS:
    dsend_packet_edit_startpos(my_conn, x, y, erase ? -1 : apno);
    break;

  default:
    break;
  } Sets the tile currently assumed to be under the user's mouse pointer.
*****/
void editor_set_current_tile(const struct tile *ptile)
{
  if (editor == NULL) {
    return;
  }
  
  editor->current_tile = ptile Get the tile that the user's mouse pointer is currently over.
*****/
const struct tile *editor_get_current_tile(void)
{
  if (editor == NULL) {
    return NULL;
  }
  
  return editor->current_tile Redraw any editor-specific decorations. This should usually be called
  whenever the map canvas is redrawn.
*****/
void editor_redraw(void)
{
  if (!editor) {
    return;
  }

  if (editor->selrect_active && editor->selrect_width > 0
      && editor->selrect_height > 0) {
    draw_selection_rectangle(editor->selrect_x,
                             editor->selrect_y,
                             editor->selrect_width,
                             editor->selrect_height);
  } Toggle the current tool mode between the given mode and ETM_PAINT.
*****/
void editor_tool_toggle_mode(enum editor_tool_type ett,
                             enum editor_tool_mode etm)
{
  if (!editor_tool_has_mode(ett, etm)) {
    return;
  }
  if (editor_tool_get_mode(ett) == etm) {
    editor_tool_set_mode(ett, ETM_PAINT);
  } else {
    editor_tool_set_mode(ett, etm);
  } Set the editor tool mode to the next available mode.
*****/
void editor_tool_cycle_mode(enum editor_tool_type ett)
{
  int mode, count;
  bool found = FALSE;

  mode = editor_tool_get_mode(ett);
  if (!(0 <= mode && mode < NUM_EDITOR_TOOL_MODES)) {
    return;
  }

  for (count = 0; count < NUM_EDITOR_TOOL_MODES; count++) {
    mode = (mode + 1) % NUM_EDITOR_TOOL_MODES;
    if (editor_tool_has_mode(ett, mode)) {
      found = TRUE;
      break;
    }
  }

  if (found) {
    editor_tool_set_mode(ett, mode);
  } Unselect all selected tiles.
*****/
void editor_selection_clear(void)
{
  if (!editor) {
    return;
  }
  hash_delete_all_entries(editor->selected_tile_table Add the given tile to the current selection.
*****/
void editor_selection_add(const struct tile *ptile)
{
  if (!editor || !ptile) {
    return;
  }
  hash_insert(editor->selected_tile_table, ptile, NULL Remove the given tile from the current selection.
*****/
void editor_selection_remove(const struct tile *ptile)
{
  if (!editor || !ptile) {
    return;
  }
  hash_delete_entry(editor->selected_tile_table, ptile Returns TRUE if the given tile is selected.
*****/
bool editor_tile_is_selected(const struct tile *ptile)
{
  if (!editor || !ptile) {
    return FALSE;
  }
  return hash_key_exists(editor->selected_tile_table, ptile Apply the current editor tool to all tiles in the current selection.
*****/
void editor_apply_tool_to_selection(void)
{
  enum editor_tool_type ett;

  if (!editor || editor_selection_count() <= 0) {
    return;
  }

  ett = editor_get_tool();
  if (editor_tool_get_mode(ett) == ETM_COPY) {
    struct edit_buffer *ebuf;
    ebuf = editor_tool_get_copy_buffer(ett);
    edit_buffer_clear(ebuf);
    edit_buffer_set_origin(ebuf, editor_get_selection_center());
  }

  connection_do_buffer(&client.conn);
  hash_iterate(editor->selected_tile_table, ptile, dummy) {
    editor_apply_tool(ptile, TRUE);
  } hash_iterate_end;
  editor_notify_edit_finished();
  connection_do_unbuffer(&client.conn);

  if (editor_tool_get_mode(ett) == ETM_COPY) {
    editgui_refresh();
  } Get the translated name of the givenconst char *editor_tool_get_name(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return "";
  }

  return editor->tools[ett].name Get the translated name of the given tool value. If no such name exists,
  returns an empty string.
*****/
const char *editor_tool_get_value_name(enum editor_tool_type emt, int value)
{
  struct terrain *pterrain;
  struct resource *presource;
  struct unit_type *putype;
  struct base_type *pbase;

  if (!editor) {
    return "";
  }

  switch (emt) {
  case ETT_TERRAIN:
    pterrain = terrain_by_number(value);
    return pterrain ? terrain_name_translation(pterrain) : "";
    break;
  case ETT_TERRAIN_RESOURCE:
    presource = resource_by_number(value);
    return presource ? resource_name_translation(presource) : "";
    break;
  case ETT_TERRAIN_SPECIAL:
    if (!(0 <= value && value < S_LAST)) {
      return "";
    }
    return special_name_translation(value);
    break;
  case ETT_MILITARY_BASE:
    pbase = base_by_number(value);
    return pbase != NULL ? base_name_translation(pbase) : "";
    break;
  case ETT_UNIT:
    putype = utype_by_number(value);
    return putype ? utype_name_translation(putype) : "";
    break;
  default:
    break;
  }
  return "" Return TRUE if the given editor tool uses the 'size' parameter.
*****/
bool editor_tool_has_size(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return FALSE;
  }
  return editor->tools[ett].flags & ETF_HAS_SIZE Returns the current size parameter for the given editor tools.
*****/
int editor_tool_get_size(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return 1;
  }
  return editor->tools[ett].size Sets the size parameter for the given tool.
*****/
void editor_tool_set_size(enum editor_tool_type ett, int size)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return;
  }
  editor->tools[ett].size = MAX(1, size Return TRUE if it is meaningful for the given tool to use the 'count'
  parameter.
*****/
bool editor_tool_has_count(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return FALSE;
  }
  return editor->tools[ett].flags & ETF_HAS_COUNT Returns the 'count' parameter for the editor tool.
*****/
int editor_tool_get_count(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return 1;
  }
  return editor->tools[ett].count Sets the 'count' parameter of the tool to the given value.
*****/
void editor_tool_set_count(enum editor_tool_type ett, int count)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return;
  }
  editor->tools[ett].count = MAX(1, coun Returns a sprite containing an icon for the given tool type. Returns
  NULL if no such sprite exists.
*****/
struct sprite *editor_tool_get_sprite(enum editor_tool_type ett)
{
  const struct editor_sprites *sprites;

  if (!tileset || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return NULL;
  }

  sprites = get_editor_sprites(tileset);
  if (!sprites) {
    return NULL;
  }

  switch (ett) {
  case ETT_TERRAIN:
    return sprites->terrain;
    break;
  case ETT_TERRAIN_RESOURCE:
    return sprites->terrain_resource;
    break;
  case ETT_TERRAIN_SPECIAL:
    return sprites->terrain_special;
    break;
  case ETT_MILITARY_BASE:
    return sprites->military_base;
    break;
  case ETT_UNIT:
    return sprites->unit;
    break;
  case ETT_CITY:
    return sprites->city;
    break;
  case ETT_VISION:
    return sprites->vision;
    break;
  case ETT_STARTPOS:
    return sprites->startpos;
    break;
  default:
    break;
  }

  returna translated "tooltip" description for the givenconst char *editor_tool_get_tooltip(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)
      || !editor->tools[ett].tooltip) {
    return "";
  }
  return editor->tools[ett].tooltip Returns the current applied player number for the editor tool.

  May return a player number for which valid_player_by_number returns NULL.
*****/
int editor_tool_get_applied_player(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return -1;
  }
  return editor->tools[ett].applied_player_no Sets the editor tool's applied player number to the given value.
*****/
void editor_tool_set_applied_player(enum editor_tool_type ett,
                                    int player_no)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return;
  }
  editor->tools[ett].applied_player_no = player_no Returns TRUE if the given tool makes use of the editor's applied player
  number.
*****/
bool editor_tool_has_applied_player(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return FALSE;
  }
  return editor->tools[ett].flags & ETF_HAS_APPLIED_PLAYER Returns TRUE if erase mode for the given tool erases by sub-value instead
  of any object corresponding to thebool editor_tool_has_value_erase(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return FALSE;
  }
  return editor->tools[ett].flags & ETF_HAS_VALUE_ERASE Returns the number of currently selected tiles.
*****/
int editor_selection_count(void)
{
  if (!editor) {
    return 0;
  }
  return hash_num_entries(editor->selected_tile_table Creates a virtual unit (like create_unit_virtual) based on the current
  editor state. You should free() the unit when it is no longer needed.
  If creation is not possible, then NULL is returned.

  The virtual unit has no homecity or tile. It is owned by the player
  corresponding to the current 'applied player' parameter and has unit type
  given by the sub-value of the unit tool (ETT_UNIT).
*****/
struct unit *editor_create_unit_virtual(void)
{
  struct unit *vunit;
  struct player *pplayer;
  struct unit_type *putype;
  int apno, value;

  value = editor_tool_get_value(ETT_UNIT);
  putype = utype_by_number(value);

  if (!putype) {
    return NULL;
  }

  apno = editor_tool_get_applied_player(ETT_UNIT);
  pplayer = valid_player_by_number(apno);
  if (!pplayer) {
    return NULL;
  }

  vunit = create_unit_virtual(pplayer, NULL, putype, 0);

  return vunit Create a new edit buffer corresponding to all types set in 'type_flags'.
*****/
struct edit_buffer *edit_buffer_new(int type_flags)
{
  struct edit_buffer *ebuf;

  if (!(0 <= type_flags && type_flags <= EBT_ALL)) {
    return NULL;
  }

  ebuf = fc_calloc(1, sizeof(*ebuf));
  ebuf->type_flags = type_flags;
  ebuf->vtiles = tile_list_new();

  return ebuf Free all memory allocated for the edit buffer.
*****/
void edit_buffer_free(struct edit_buffer *ebuf)
{
  if (!ebuf) {
    return;
  }

  if (ebuf->vtiles) {
    tile_list_iterate(ebuf->vtiles, vtile) {
      destroy_tile_virtual(vtile);
    } tile_list_iterate_end;
    tile_list_free(ebuf->vtiles);
    ebuf->vtiles = NULL;
  }
  free(ebuf Remove all copy data stored in the edit buffer.
*****/
void edit_buffer_clear(struct edit_buffer *ebuf)
{
  if (!ebuf || !ebuf->vtiles) {
    return;
  }

  tile_list_iterate(ebuf->vtiles, vtile) {
    destroy_tile_virtual(vtile);
  } tile_list_iterate_end;
  tile_list_clear(ebuf->vtiles);

  edit_buffer_set_origin(ebuf, NULL Copy from a square region of half-width 'radius' centered around 'center'
  into the buffer.
*****/
void edit_buffer_copy_square(struct edit_buffer *ebuf,
                             const struct tile *center,
                             int radius)
{
  if (!ebuf || !center || radius < 1) {
    return;
  }

  edit_buffer_set_origin(ebuf, center);
  square_iterate(center, radius - 1, ptile) {
    edit_buffer_copy(ebuf, ptile);
  } square_iterate_end Append a single tile to the copy buffer.
*****/
void edit_buffer_copy(struct edit_buffer *ebuf, const struct tile *ptile)
{
  struct tile *vtile;
  struct unit *vunit;
  const struct tile *origin;
  int dx, dy;
  bool copied = FALSE;

  if (!ebuf || !ptile) {
    return;
  }

  origin = edit_buffer_get_origin(ebuf);
  if (origin) {
    map_distance_vector(&dx, &dy, origin, ptile);
  } else {
    dx = 0;
    dy = 0;
  }
  vtile = create_tile_virtual();
  vtile->x = dx;
  vtile->y = dy;

  edit_buffer_type_iterate(ebuf, type) {
    switch (type) {
    case EBT_TERRAIN:
      if (tile_terrain(ptile)) {
        tile_set_terrain(vtile, tile_terrain(ptile));
        copied = TRUE;
      }
      break;
    case EBT_RESOURCE:
      if (tile_resource(ptile)) {
        tile_set_resource(vtile, tile_resource(ptile));
        copied = TRUE;
      }
      break;
    case EBT_SPECIAL:
      if (tile_has_any_specials(ptile)) {
        tile_set_specials(vtile, tile_specials(ptile));
        copied = TRUE;
      }
      break;
    case EBT_BASE:
      if (tile_has_any_bases(ptile)) {
        tile_set_bases(vtile, tile_bases(ptile));
        copied = TRUE;
      }
      break;
    case EBT_UNIT:
      unit_list_iterate(ptile->units, punit) {
        if (!punit) {
          continue;
        }
        vunit = create_unit_virtual(unit_owner(punit), NULL,
                                    unit_type(punit), punit->veteran);
        vunit->homecity = punit->homecity;
        vunit->hp = punit->hp;
        unit_list_append(vtile->units, vunit);
        copied = TRUE;
      } unit_list_iterate_end;
      break;
    case EBT_CITY:
      if (tile_city(ptile)) {
        struct city *pcity, *vcity;
        char name[MAX_LEN_NAME];

        pcity = tile_city(ptile);
        my_snprintf(name, sizeof(name), "Virtual copy of %s",
                    city_name(pcity));
        vcity = create_city_virtual(city_owner(pcity), NULL, name);
        vcity->size = pcity->size;
        improvement_iterate(pimprove) {
          if (!is_improvement(pimprove)
              || !city_has_building(pcity, pimprove)) {
            continue;
          }
          city_add_improvement(vcity, pimprove);
        } improvement_iterate_end;
        tile_set_worked(vtile, vcity);
        copied = TRUE;
      }
      break;
    default:
      break;
    }
  } edit_buffer_type_iterate_end;

  if (copied) {
    tile_list_append(ebuf->vtiles, vtile);
  } else {
    destroy_tile_virtual(vtile);
  } Helper function to fill in an edit packet with the tile's current values.
*****/
static void fill_tile_edit_packet(struct packet_edit_tile *packet,
                                  const struct tile *ptile)
{
  const struct resource *presource;
  const struct terrain *pterrain;
  const struct nation_type *pnation;

  if (!packet || !ptile) {
    return;
  }
  packet->id = tile_index(ptile);
  packet->specials = tile_specials(ptile);
  packet->bases = tile_bases(ptile);

  presource = tile_resource(ptile);
  packet->resource = presource ? resource_number(presource) : -1;

  pterrain = tile_terrain(ptile);
  packet->terrain = pterrain ? terrain_number(pterrain) : -1;

  pnation = map_get_startpos(ptile);
  packet->startpos_nation = pnation ? nation_number(pnation) : -1 Helper function for edit_buffer_paste(). Do a single paste of the stuff set
  in the buffer on the virtual tile to the destination tile 'ptile_dest'.
*****/
static void paste_tile(struct edit_buffer *ebuf,
                       const struct tile *vtile,
                       const struct tile *ptile_dest)
{
  struct connection *my_conn = &client.conn;
  struct packet_edit_tile tile_packet;
  struct city *vcity;
  int value, owner, x, y;

  if (!ebuf || !vtile || !ptile_dest) {
    return;
  }

  x = ptile_dest->x;
  y = ptile_dest->y;

  edit_buffer_type_iterate(ebuf, type) {
    switch (type) {
    case EBT_TERRAIN:
      if (!tile_terrain(vtile)) {
        continue;
      }
      value = terrain_number(tile_terrain(vtile));
      dsend_packet_edit_tile_terrain(my_conn, x, y, value, 1);
      break;
    case EBT_RESOURCE:
      if (!tile_resource(vtile)) {
        continue;
      }
      value = resource_number(tile_resource(vtile));
      dsend_packet_edit_tile_resource(my_conn, x, y, value, 1);
      break;
    case EBT_SPECIAL:
      fill_tile_edit_packet(&tile_packet, ptile_dest);
      tile_packet.specials = tile_specials(vtile);
      send_packet_edit_tile(my_conn, &tile_packet);
      break;
    case EBT_BASE:
      fill_tile_edit_packet(&tile_packet, ptile_dest);
      tile_packet.bases = tile_bases(vtile);
      send_packet_edit_tile(my_conn, &tile_packet);
      break;
    case EBT_UNIT:
      unit_list_iterate(vtile->units, vunit) {
        value = utype_number(unit_type(vunit));
        owner = player_number(unit_owner(vunit));
        dsend_packet_edit_unit_create(my_conn, owner, x, y, value, 1, 0);
        /* FIXME: Handle unit attributes via tag. */
      } unit_list_iterate_end;
      break;
    case EBT_CITY:
      vcity = tile_city(vtile);
      if (!vcity) {
        continue;
      }
      owner = player_number(city_owner(vcity));
      value = vcity->size;
      dsend_packet_edit_city_create(my_conn, owner, x, y, value, 0);
      /* FIXME: Handle city attributes via tag. */
      break;
    default:
      break;
    }
  } edit_buffer_type_iterate_end Paste the entire contents of the edit buffer using 'dest' as the origin.
*****/
void edit_buffer_paste(struct edit_buffer *ebuf, const struct tile *dest)
{
  struct connection *my_conn = &client.conn;
  const struct tile *ptile;

  if (!ebuf || !dest) {
    return;
  }

  connection_do_buffer(my_conn);
  tile_list_iterate(ebuf->vtiles, vtile) {
    ptile = map_pos_to_tile(dest->x + vtile->x, dest->y + vtile->y);
    if (!ptile) {
      continue;
    }
    paste_tile(ebuf, vtile, ptile);
  } tile_list_iterate_end;
  connection_do_unbuffer(my_conn Returns the copy buffer for the given tool.
*****/
struct edit_buffer *editor_tool_get_copy_buffer(enum editor_tool_type ett)
{
  if (!editor || !(0 <= ett && ett < NUM_EDITOR_TOOL_TYPES)) {
    return NULL;
  }
  return editor->tools[ett].copy_buffer Returns the translated string name for the given mode.
*****/
const char *editor_tool_get_mode_name(enum editor_tool_type ett,
                                      enum editor_tool_mode etm)
{
  bool value_erase;

  value_erase = editor_tool_has_value_erase(ett);

  switch (etm) {
  case ETM_PAINT:
    return _("Paint");
    break;
  case ETM_ERASE:
    if (value_erase) {
      return _("Erase Value");
    } else {
      return _("Erase");
    }
    break;
  case ETM_COPY:
    return _("Copy");
    break;
  case ETM_PASTE:
    return _("Paste");
    break;
  default:
    freelog(LOG_ERROR, "Unrecognized editor tool mode %d "
            "in editor_tool_get_mode_name().", etm);
    break;
  }

  return "" Returns a translated tooltip string assumed to be used for the toggle
  button for this tool mode in the editor gui.
*****/
const char *editor_get_mode_tooltip(enum editor_tool_mode etm)
{
  switch (etm) {
  case ETM_ERASE:
    return _("Toggle erase mode.\nShortcut: shift-d");
    break;
  case ETM_COPY:
    return _("Toggle copy mode.\nShortcut: shift-c");
    break;
  case ETM_PASTE:
    return _("Toggle paste mode.\nShortcut: shift-v");
    break;
  default:
    break;
  }

  returneditor sprite corresponding to the tool mode.
*****/
struct sprite *editor_get_mode_sprite(enum editor_tool_mode etm)
{
  const struct editor_sprites *sprites;

  sprites = get_editor_sprites(tileset);
  if (!sprites) {
    return NULL;
  }

  switch (etm) {
  case ETM_PAINT:
    return sprites->brush;
    break;
  case ETM_ERASE:
    return sprites->erase;
    break;
  case ETM_COPY:
    return sprites->copy;
    break;
  case ETM_PASTE:
    return sprites->paste;
    break;
  default:
    break;
  }

  returnFill the supplied buffer with a translated string describing the edit
  buffer's current state. Returns the number of bytes used.
*****/
int edit_buffer_get_status_string(const struct edit_buffer *ebuf,
                                  char *buf, int buflen)
{
  int ret, count, total;
  const char *fmt;

  if (!buf || buflen < 1) {
    return 0;
  }

  ret = mystrlcpy(buf, _("Buffer empty."), buflen);
  if (!ebuf || !ebuf->vtiles) {
    return ret;
  }

  total = 0;
  edit_buffer_type_iterate(ebuf, type) {
    count = 0;
    switch (type) {
    case EBT_SPECIAL:
      tile_list_iterate(ebuf->vtiles, vtile) {
        tile_special_type_iterate(spe) {
          count += tile_has_special(vtile, spe);
        } tile_special_type_iterate_end;
      } tile_list_iterate_end;
      break;
    case EBT_BASE:
      tile_list_iterate(ebuf->vtiles, vtile) {
        base_type_iterate(pbase) {
          count += tile_has_base(vtile, pbase);
        } base_type_iterate_end;
      } tile_list_iterate_end;
      break;
    case EBT_UNIT:
      tile_list_iterate(ebuf->vtiles, vtile) {
        count += unit_list_size(vtile->units);
      } tile_list_iterate_end;
      break;
    case EBT_TERRAIN:
    case EBT_RESOURCE:
    case EBT_CITY:
    default:
      count = tile_list_size(ebuf->vtiles);
      break;
    }

    total += count;
  } edit_buffer_type_iterate_end;

  if (total > 0) {
    fmt = PL_("%d object copied.", "%d objects copied.", total);
    ret = my_snprintf(buf, buflen, fmt, total);
  }

  return ret Set the "origin" for subsequent copy operations. This controls the x and
  y offset of newly created virtual tiles in the buffer.
*****/
void edit_buffer_set_origin(struct edit_buffer *ebuf,
                            const struct tile *ptile)
{
  if (!ebuf) {
    return;
  }
  ebuf->origin = ptile Return the previously set origin, or NULL if none.
*****/
const struct tile *edit_buffer_get_origin(const struct edit_buffer *ebuf)
{
  if (!ebuf) {
    return NULL;
  }
  return ebuf->origin Returns TRUE if the edit buffer was created with the given type flag.
*****/
bool edit_buffer_has_type(const struct edit_buffer *ebuf, int type)
{
  if (!ebuf) {
    return FALSE;
  }
  return ebuf->type_flags & type Returns the "center" tile of a group of selected tiles, or NULL.
  The center is calculated as the vector sum divided by the number of tiles,
  i.e. the average of the map distance vectors of the selected tiles.
*****/
const struct tile *editor_get_selection_center(void)
{
  int count;
  const struct tile *origin, *center;
  int dx, dy, cx, cy;
  int xsum = 0, ysum = 0;

  if (!editor || !editor->selected_tile_table) {
    return NULL;
  }

  count = hash_num_entries(editor->selected_tile_table);
  if (count < 1) {
    return NULL;
  }

  origin = map_pos_to_tile(0, 0);
  hash_iterate(editor->selected_tile_table, ptile, dummy) {
    map_distance_vector(&dx, &dy, origin, ptile);
    xsum += dx;
    ysum += dy;
  } hash_iterate_end;

  cx = xsum / count;
  cy = ysum / count;
  center = map_pos_to_tile(cx, cy);

  return center;
}
ENDREP
DELTA 15307 2197 933
SVN  ÜBÞZ4 ˆ. Š ž
ˆ6® G“@€F TÄ>¶ µS¦olient_mainEntry point for whole freeciv client program.
***/
int main(int argc, char **argv)
{
  return client_main(argc, argvThe main loop for the UI.  This is called from client_ENDREP
DELTA 10071 0 2104
SVN  ¤V¸j‹  …~ €n ˆ;†8¬ N’ €A S} ‚^Žr¦ G”@’ c’o …‘P€U S’  :—0€D S’  y™;ž S’ ‡ s—7€n T‘ i’j€‚ ƒ<›]´ S’ ¤ a’o ƒK¡ G ¢ G”@« N‘ ž G”@£ N‘ ž G”@€E N‘ ž G”@€T N‘ ž G”@¾/* utility */
#include "fciconv.h"
#include "log.h"

/* client */
#include "client_main.h"
#include "editgui_gEntry point for whole freeciv client programint main(int argc, char **argv)
{
  return client_main(argc, argv Do any necessary UI-specific cleanup
***/
void ui_exit(
  This function is called after the client succesfully has connected
  to the server
  This function is called if the client disconnects from the serverCalled to monitor a GGZ socketadd_ggzCalled on disconnection to remove monitoring on the GGZ socket.  Only
  call this if we're actually in GGZ modremove_ggz_inputSet one of the unit icons (specified by idx) in the information area
  based on punit.

  punit is the unit the information should be taken from. Use NULL to
  clear the icon.

  idx specified which icon should be modified. Use idx==-1 to indicate
  the icon for the active unit. Oor
  deactivate the arrow.

  Is disabled by defaultset_unit_icons_more_arrow(bool onoff
******
  Stub for editor function
*****/
void editgui_tileset_changed(void)
{**
  Stub for editor function
*****/
void editgui_refresh(void)
{**
  Stub for editor function
*****/
void editgui_popup_properties(const struct tile_list *tiles)
{**
  Stub for editor function
*****/
void editgui_notify_object_changed(int objtype, int object_id, bool remove)
{**
  Stub for editor function
*****/
void editgui_notify_object_created(int tag, int id)
{}
ENDREP
DELTA 15304 5796 3796
SVN  ÆÆ-; Šz  +ŠyŒ fŒ#¢ ¸g/* utility *//* common *//* client */
#include "client_mainENDREP
DELTA 14417 37440 13374
SVN  äIóK~Œ † – 1†€f Vˆ.† ‰^ˆv› „+’L¥ ž;–N™ ƒµ€‚d ˆ·N€‚ _¿F€ƒ
 ZÍg …^Ð%’ Õv ƒ}Öi  3Úc‹ Ü  ë2Ý“ ‘;È<“ ŠLÙ} ZÞ@° C…€/* common & utility *//* client */
#include "audio.h"
#include "chatline_g.h"
#include "cityrepdata.h"
#include "client_mainmenu_gauto_center_each_turn = TRUstatic void draw_full_citybar_changeddraw_full_citybar_changedreqtree_curved_lines,
                     N_("Use curved lines in the technology tree"),
                     N_("Setting this option make the technology tree "
                        "diagram use curved lines to show technology "
                        "relations. Turning this option off causes "
                        "the lines to be drawn straighauto_center_each_turn, N_("Auto Center on New Turn"),
                  N_("Set this option to have the client automatically "
                     "recenter the map on a suitable location at the "
                     "start of each turn."),
                BORDERS_ON_OCEAN],
                     N_("Borders layer on ocean tiles"),
                     N_("The borders layer of the overview are drawn on "
                        "ocean tiles as well (this may look ugly with many "
                        "islands). This option is only of interest if you "
                        "have set the option \"Borders layer\" already."),
                city_output = FALScity_traderoutebool reqtree_curved_lines = FALScity_outputcity_traderouteNULL != client.connNULL != client.connfor when the draw_full_citybar option is changed***********/
static void draw_full_citybar_changed_callback(struct client_option *option)
{
  update_menus();
  update_map_canvas_visible();
}
ENDREP
DELTA 15402 1103 4342
SVN  ƒùOƒùuN ˆ! – pˆ ¸ ƒïŠ9/* common & utility *//* client */
#include "chatline.h"
#include "client_mainENDREP
DELTA 14427 114881 2830
SVN  ’’>b †? – ‚†>€L ‰‰/* common & utility *//* client */
#include "canvas.h"
#include "citydlg.h" 
#include "client_mainENDREP
id: zh.5ck.r15410/336188
type: file
pred: zh.5bk.r14433/49352
count: 40
text: 15410 186250 1216 24420 24aa245a4aa2758f39e68f003981c83e
props: 10755 60573 111 0 1767e81bb248f04892a3d72080d82dc5
cpath: /trunk/client/agents/agents.c
copyroot: 15280 /trunk

id: zj.5ck.r15410/336442
type: file
pred: zj.5bk.r14449/68248
count: 90
text: 15410 150254 257 19620 dfdf38eec6481f1a2e7110a4d4d7803a
props: 11025 295 111 0 995497afc7013c9f20b8d3ebef449f37
cpath: /trunk/client/agents/cma_core.c
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 24
file zg.5ck.r15407/27355
K 8
agents.c
V 25
file zh.5ck.r15410/336188
K 8
agents.h
V 22
file zi.0.r8387/119237
K 10
cma_core.c
V 25
file zj.5ck.r15410/336442
K 10
cma_core.h
V 20
file zk.0.r8132/2370
K 9
cma_fec.c
V 25
file zl.5bk.r15266/140768
K 9
cma_fec.h
V 20
file zm.0.r8132/1669
K 5
sha.c
V 25
file 2fy.5bk.r14268/23077
K 5
sha.h
V 23
file 2fz.0.r9577/101433
END
ENDREP
id: zf.5ck.r15410/337098
type: dir
pred: zf.5ck.r15407/28004
count: 149
text: 15410 336695 390 390 505961cc361e2c0e89e1c55102bc09bb
props: 11108 11608 65 0 c67827893bff2f279fa7f0439c4cba47
cpath: /trunk/client/agents
copyroot: 15280 /trunk

id: 2ym.5ck.r15410/337339
type: file
pred: 2ym.5bk.r15074/8083
count: 31
text: 15410 107904 140 35771 cf749b46478fd4b212091bcf25f6b146
props: 11057 36702 111 0 5396249b3009eb64cd90e5da0b7a56fa
cpath: /trunk/client/reqtree.c
copyroot: 15280 /trunk

id: z4.5ck.r15410/337587
type: file
pred: z4.5ck.r15296/71128
count: 110
text: 15410 107522 183 31184 7b344b0c5e5022cddf4578d38edf5602
props: 11067 4204 111 0 32cf26490c5995022c752556481ff094
cpath: /trunk/client/citydlg_common.c
copyroot: 15280 /trunk

id: 2yk.5ck.r15410/337841
type: file
pred: 2yk.5bk.r15036/1452
count: 26
text: 15410 123166 330 16283 22f39bb748b36be03630adc5e68aea10
props: 11057 37417 111 0 df9f31216c5039327c376b7fe82756f5
cpath: /trunk/client/overview_common.c
copyroot: 15280 /trunk

id: gz.5ck.r15410/338097
type: file
pred: gz.5ck.r15296/71377
count: 236
text: 15410 127846 651 92345 eb5a82cb124da52bf1c2988cd98e8757
props: 11088 7720 112 0 89a05fc93c37a832d4b63085dac12c4b
cpath: /trunk/client/control.c
copyroot: 15280 /trunk

id: zy.5ck.r15410/338344
type: file
pred: zy.5ck.r15396/337
count: 167
text: 15410 265031 34 93227 5f0f2c0763057b18fb150021a6a381bc
props: 11072 618 112 0 0564c5503f2d15442a967c72794b21e8
cpath: /trunk/client/gui-gtk-2.0/citydlg.c
copyroot: 15280 /trunk

id: 10e.5ck.r15410/338599
type: file
pred: 10e.5bk.r15239/77
count: 24
text: 15410 265090 412 7950 6cad7813a1eda865a8350e1a3fb6afb8
props: 10534 1625 111 0 2a5912525b098cb46a1301ee940f7617
cpath: /trunk/client/gui-gtk-2.0/gotodlg.c
copyroot: 15280 /trunk

id: 10x.5ck.r15410/338855
type: file
pred: 10x.5bk.r14846/117082
count: 192
text: 15410 275360 11512 25473 6ec8ae885fe32ede175f6c07207e79ad
props: 11084 1701 112 0 86d6a13b4b5d042ef40af0a2a7a26786
cpath: /trunk/client/gui-gtk-2.0/mapview.c
copyroot: 15280 /trunk

id: 118.5ck.r15410/339119
type: file
pred: 118.5bk.r15266/141967
count: 125
text: 15410 287528 137 53265 18fbd5871cc6be0c44d1c17a87e0d15a
props: 11057 38502 111 0 89e24921275908e1dbda216a065c4859
cpath: /trunk/client/gui-gtk-2.0/repodlgs.c
copyroot: 15280 /trunk

id: 10k.5ck.r15410/339383
type: file
pred: 10k.5ck.r15402/6004
count: 197
text: 15410 335891 108 64757 1afe9a62a0b2c9b633627d957c8ff855
props: 11057 38870 112 0 ec3aa248409009be6c82cab2c7e95ef5
cpath: /trunk/client/gui-gtk-2.0/gui_main.c
copyroot: 15280 /trunk

id: 376.5ck.r15410/339645
type: file
pred: 376.5bk.r14427/275410
count: 6
text: 15410 0 193 5180 5adb6998735452083fcc44396bb19d5c
props: 12670 98153 34 0 25e6c2f7558b7484000d4d090dea5b92
cpath: /trunk/client/gui-gtk-2.0/caravan_dialog.c
copyroot: 15280 /trunk

id: 4ej.5ck.r15410/339906
type: file
pred: 4ej.5ck.r15401/7484
count: 18
text: 15410 222 216 56225 1d405ba39156c0b1a0601fc51adb18bd
cpath: /trunk/client/gui-gtk-2.0/editgui.c
copyroot: 15280 /trunk

id: 2pi.5ck.r15410/340105
type: file
pred: 2pi.5ck.r15298/7957
count: 78
text: 15410 104399 2910 82818 e9d47a92be67976e529857a6c0f21f3f
props: 11100 16432 111 0 622f1432038f91cce287c1d90e4f7964
cpath: /trunk/client/gui-gtk-2.0/pages.c
copyroot: 15280 /trunk

id: 10z.5ck.r15410/340364
type: file
pred: 10z.5bk.r15200/30204
count: 120
text: 15410 108072 1182 57979 ac993d03e9563365cfdca4919d44aaef
props: 11057 39977 111 0 05d0c9433d86d9823b0e8b2536eb2299
cpath: /trunk/client/gui-gtk-2.0/menu.c
copyroot: 15280 /trunk

id: 102.5ck.r15410/340624
type: file
pred: 102.5bk.r14433/50813
count: 32
text: 15410 109742 13395 25605 27b0a11073d5ae84af236a4d47a60dcf
props: 9773 10560 111 0 23629f8214b2309975780a037517e920
cpath: /trunk/client/gui-gtk-2.0/cma_fe.c
copyroot: 15280 /trunk

id: 100.5ck.r15410/340885
type: file
pred: 100.5ck.r15374/2071
count: 95
text: 15410 128901 69 53899 17870ecbaa949a7cc802ba3780c0b69f
props: 11057 40343 111 0 9323cb943074f1605bbe84192873bd2e
cpath: /trunk/client/gui-gtk-2.0/cityrep.c
copyroot: 15280 /trunk

id: 108.5ck.r15410/341144
type: file
pred: 108.5ck.r15365/1205
count: 153
text: 15410 143487 157 42437 71b2fcaf284509817a65c389a50738c1
props: 11088 8070 112 0 858133ad234580a5fc7c24a791c3b702
cpath: /trunk/client/gui-gtk-2.0/dialogs.c
copyroot: 15280 /trunk

id: 36n.5ck.r15410/341404
type: file
pred: 36n.5bk.r14777/43839
count: 18
text: 15410 150909 259 25537 ba2014aba4ea445b646e6912bad24c91
props: 11088 8800 110 0 94a2a96823d3c54fff31bdd51de17982
cpath: /trunk/client/gui-gtk-2.0/diplomat_dialog.c
copyroot: 15280 /trunk

id: 10a.5ck.r15410/341672
type: file
pred: 10a.5bk.r14777/44120
count: 48
text: 15410 151713 4089 29220 5c7eb17d91d2968b2fffd9ff8add7071
props: 11093 473 111 0 7a0697bf766451f41e947e71ce1310bc
cpath: /trunk/client/gui-gtk-2.0/diplodlg.c
copyroot: 15280 /trunk

id: 10v.5ck.r15410/341933
type: file
pred: 10v.5bk.r14846/118845
count: 68
text: 15410 156093 474 15399 e21aec96b5cf21dfef84c7159af9b124
props: 10781 197 111 0 9c2dbf68c7baabdec873d497eccc2dc6
cpath: /trunk/client/gui-gtk-2.0/mapctrl.c
copyroot: 15280 /trunk

id: 10u.5ck.r15410/342193
type: file
pred: 10u.5bk.r14427/277908
count: 34
text: 15410 156594 93 12283 cc1db738ff1ab390d74bd3e3459191a4
props: 11054 96 111 0 0b146d6d431c2ad00452618c43381276
cpath: /trunk/client/gui-gtk-2.0/inteldlg.c
copyroot: 15280 /trunk

id: 10q.5ck.r15410/342452
type: file
pred: 10q.5bk.r14777/44394
count: 86
text: 15410 173044 164 43759 dc9f3737ba1bc7861d9594611515c4d2
props: 10865 34829 111 0 a3a3251698e05efa35962766e5c7e5c1
cpath: /trunk/client/gui-gtk-2.0/helpdlg.c
copyroot: 15280 /trunk

id: 115.5ck.r15410/342713
type: file
pred: 115.5ck.r15352/2132
count: 91
text: 15410 174926 107 25989 56582c1975d89319de7e09032f35670c
props: 11057 41078 111 0 3f70303ff9ea148b5e232db96a904e98
cpath: /trunk/client/gui-gtk-2.0/plrdlg.c
copyroot: 15280 /trunk

id: 4el.5ck.r15410/342972
type: file
pred: 4el.5ck.r15356/30541
count: 14
text: 15410 175669 2574 178652 3bdb1e3ad239403951d522f871b3a3ff
cpath: /trunk/client/gui-gtk-2.0/editprop.c
copyroot: 15280 /trunk

id: 11c.5ck.r15410/343178
type: file
pred: 11c.5bk.r14427/279006
count: 24
text: 15410 187937 351 8514 f9a1ef7489ebbbb0d68c2c7471e65038
props: 10731 5970 111 0 df9f31216c5039327c376b7fe82756f5
cpath: /trunk/client/gui-gtk-2.0/spaceshipdlg.c
copyroot: 15280 /trunk

id: 11e.5ck.r15410/343443
type: file
pred: 11e.5bk.r14977/44405
count: 65
text: 15410 189306 34 41809 7e8041aff8af084c0c7e72763f23135d
props: 11057 41445 111 0 9c2dbf68c7baabdec873d497eccc2dc6
cpath: /trunk/client/gui-gtk-2.0/wldlg.c
copyroot: 15280 /trunk

id: 106.5ck.r15410/343701
type: file
pred: 106.5bk.r14775/5066
count: 56
text: 15410 258370 541 3307 cb35ceb9bddd2ec0a5db90aaed33fd54
props: 10804 2613 111 0 93646be3752db5a3cd8e77177837d494
cpath: /trunk/client/gui-gtk-2.0/connectdlg.c
copyroot: 15280 /trunk

id: 10d.5ck.r15410/343962
type: file
pred: 10d.5bk.r14427/279835
count: 36
text: 15410 258936 1084 18060 9338083d12c999205664c178095bad50
props: 11057 41811 111 0 b4233197920770c602c29330b7f7c623
cpath: /trunk/client/gui-gtk-2.0/gamedlgs.c
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 24
file zu.5ck.r15407/28244
K 8
canvas.c
V 24
file 2y6.5bk.r15074/8344
K 8
canvas.h
V 23
file 2y7.0.r10096/14437
K 16
caravan_dialog.c
V 26
file 376.5ck.r15410/339645
K 10
chatline.c
V 25
file zw.5bk.r14427/278736
K 10
chatline.h
V 22
file zx.0.r9577/109355
K 15
choice_dialog.c
V 23
file 377.0.r13481/22903
K 15
choice_dialog.h
V 23
file 378.0.r12670/99360
K 9
citydlg.c
V 25
file zy.5ck.r15410/338344
K 9
citydlg.h
V 20
file zz.0.r5493/6351
K 9
cityrep.c
V 26
file 100.5ck.r15410/340885
K 9
cityrep.h
V 22
file 101.0.r9098/11480
K 8
cma_fe.c
V 26
file 102.5ck.r15410/340624
K 8
cma_fe.h
V 23
file 103.0.r10181/13675
K 8
colors.c
V 22
file 104.0.r10458/4290
K 8
colors.h
V 22
file 105.0.r10458/4652
K 12
connectdlg.c
V 26
file 106.5ck.r15410/343701
K 12
connectdlg.h
V 21
file 107.0.r7580/6878
K 9
dialogs.c
V 26
file 108.5ck.r15410/341144
K 9
dialogs.h
V 22
file 109.0.r11212/7101
K 10
diplodlg.c
V 26
file 10a.5ck.r15410/341672
K 10
diplodlg.h
V 23
file 10b.0.r9577/108261
K 17
diplomat_dialog.c
V 26
file 36n.5ck.r15410/341404
K 9
editgui.c
V 26
file 4ej.5ck.r15410/339906
K 9
editgui.h
V 25
file 4ek.5ck.r15355/70937
K 10
editprop.c
V 26
file 4el.5ck.r15410/342972
K 10
editprop.h
V 25
file 3bj.5cl.r15307/98243
K 9
finddlg.c
V 26
file 10c.5bk.r14209/167623
K 9
finddlg.h
V 22
file 2d0.0.r5989/22356
K 10
gamedlgs.c
V 26
file 10d.5ck.r15410/343962
K 9
gotodlg.c
V 26
file 10e.5ck.r15410/338599
K 9
gotodlg.h
V 23
file 10f.0.r4313/263426
K 10
graphics.c
V 23
file 10g.0.r11337/79662
K 10
graphics.h
V 23
file 10h.0.r11337/80150
K 12
gtkpixcomm.c
V 22
file 10i.0.r10800/1239
K 12
gtkpixcomm.h
V 22
file 10j.0.r10800/1606
K 10
gui_main.c
V 26
file 10k.5ck.r15410/339383
K 10
gui_main.h
V 24
file 10l.5ck.r15298/7699
K 11
gui_stuff.c
V 25
file 10m.5ck.r15307/97525
K 11
gui_stuff.h
V 25
file 10n.5ck.r15307/97783
K 11
happiness.c
V 24
file 10o.5bk.r14284/4172
K 11
happiness.h
V 23
file 10p.0.r9577/106064
K 9
helpdlg.c
V 26
file 10q.5ck.r15410/342452
K 9
helpdlg.h
V 23
file 10r.0.r4313/267882
K 10
inputdlg.c
V 20
file 10s.0.r8860/225
K 10
inputdlg.h
V 21
file 10t.0.r7580/3991
K 10
inteldlg.c
V 26
file 10u.5ck.r15410/342193
K 10
inteldlg.h
V 23
file 2d1.0.r9577/108626
K 9
mapctrl.c
V 26
file 10v.5ck.r15410/341933
K 9
mapctrl.h
V 25
file 10w.5bk.r14157/11089
K 9
mapview.c
V 26
file 10x.5ck.r15410/338855
K 9
mapview.h
V 23
file 10y.0.r12881/17128
K 6
menu.c
V 26
file 10z.5ck.r15410/340364
K 6
menu.h
V 22
file 110.0.r4315/16581
K 12
messagedlg.c
V 23
file 111.0.r11771/10924
K 12
messagedlg.h
V 22
file 2d2.0.r5989/22693
K 12
messagewin.c
V 26
file 112.5bk.r14427/275965
K 12
messagewin.h
V 23
file 113.0.r10108/19424
K 11
optiondlg.h
V 23
file 114.0.r4313/264106
K 7
pages.c
V 26
file 2pi.5ck.r15410/340105
K 7
pages.h
V 24
file 2pj.5ck.r15298/8213
K 8
plrdlg.c
V 26
file 115.5ck.r15410/342713
K 8
plrdlg.h
V 22
file 116.0.r10803/7069
K 10
ratesdlg.h
V 22
file 2d3.0.r5989/22018
K 4
rc2c
V 23
file 117.0.r4313/274431
K 10
repodlgs.c
V 26
file 118.5ck.r15410/339119
K 10
repodlgs.h
V 21
file 119.0.r9098/9312
K 11
resources.c
V 23
file 11a.0.r5390/112550
K 11
resources.h
V 23
file 11b.0.r4313/267539
K 14
spaceshipdlg.c
V 26
file 11c.5ck.r15410/343178
K 14
spaceshipdlg.h
V 23
file 11d.0.r9577/110090
K 8
sprite.c
V 27
file 2y8.5bk.r14377/2286871
K 8
sprite.h
V 23
file 2y9.0.r10141/29270
K 11
theme_dlg.c
V 25
file 47d.5bk.r13968/60105
K 8
themes.c
V 23
file 34x.0.r13227/13852
K 13
tileset_dlg.c
V 25
file 45i.5bk.r13968/60424
K 7
wldlg.c
V 26
file 11e.5ck.r15410/343443
K 7
wldlg.h
V 21
file 11f.0.r7682/2202
END
ENDREP
id: zs.5ck.r15410/347783
type: dir
pred: zs.5ck.r15407/32030
count: 1119
text: 15410 344226 3544 3544 fe5edb43ffe92f7a9cc58d207c7c88b8
props: 11108 11912 79 0 480bb3268560e84c2d6c8376c422c65e
cpath: /trunk/client/gui-gtk-2.0
copyroot: 15280 /trunk

id: 2g3.5ck.r15410/348032
type: file
pred: 2g3.5ck.r15296/75908
count: 96
text: 15410 129111 14050 44429 50e7e42170cc80bc04187b1630b04d2a
props: 11057 45424 111 0 93646be3752db5a3cd8e77177837d494
cpath: /trunk/client/text.c
copyroot: 15280 /trunk

id: 11i.5ck.r15410/348280
type: file
pred: 11i.5bk.r15168/392
count: 47
text: 15410 143966 90 13497 80a1650a66d432981e781a1d56fb5542
props: 11057 45776 111 0 9b377c828b4ca1827963af8e19878787
cpath: /trunk/client/repodlgs_common.c
copyroot: 15280 /trunk

id: 9w.5ck.r15410/348534
type: file
pred: 9w.5ck.r15296/76151
count: 160
text: 15410 159205 11203 78282 4d1a3ed78af6faced5a843db2d7a9da8
props: 10820 1319 112 0 e0e21d00fa120c81b59fd1c92d742949
cpath: /trunk/client/gui-xaw/citydlg.c
copyroot: 15280 /trunk

id: ab.5ck.r15410/348791
type: file
pred: ab.5bk.r14427/284902
count: 34
text: 15410 170434 156 10312 5f1d3533d6f0a0e97d76c01cf91c0a29
props: 10536 6353 111 0 eaeaff8c6ba56cfe19b921c33649c016
cpath: /trunk/client/gui-xaw/gotodlg.c
copyroot: 15280 /trunk

id: nt.5ck.r15410/349046
type: file
pred: nt.5bk.r14427/285172
count: 35
text: 15410 172478 161 33967 5b60f5a1773ec59d23dec8c8b96dde90
props: 10957 5214 111 0 b4233197920770c602c29330b7f7c623
cpath: /trunk/client/gui-xaw/actions.c
copyroot: 15280 /trunk

id: al.5ck.r15410/349301
type: file
pred: al.5bk.r15074/12408
count: 219
text: 15410 175547 94 28715 51fcee4ba224326593dad83ae44c905d
props: 11084 5307 112 0 a976793c1b86634c19e93e3af962ba38
cpath: /trunk/client/gui-xaw/mapview.c
copyroot: 15280 /trunk

id: ay.5ck.r15410/349555
type: file
pred: ay.5bk.r14777/48361
count: 99
text: 15410 264641 205 47982 c01b6fc1d148855ea5859a7cadd8d0e0
props: 10957 5571 111 0 04c7a6fe9bf3a5db3539a62041388438
cpath: /trunk/client/gui-xaw/repodlgs.c
copyroot: 15280 /trunk

id: bm.5ck.r15410/349810
type: file
pred: bm.5ck.r15402/10038
count: 142
text: 15410 268519 349 35265 05b54f5a84f4f1fb7d598b2e48111f30
props: 10925 3549 112 0 177404f64081975a31585790400154e7
cpath: /trunk/client/gui-xaw/gui_main.c
copyroot: 15280 /trunk

id: 2qm.5ck.r15410/350066
type: file
pred: 2qm.5bk.r14427/286261
count: 13
text: 15410 128525 144 8752 cda5be075de682b2ebf06efeecd1601d
props: 10598 2663 110 0 fdfdab56f53d2388a66f6a5ce0985f95
cpath: /trunk/client/gui-xaw/pages.c
copyroot: 15280 /trunk

id: an.5ck.r15410/350320
type: file
pred: an.5bk.r14956/50126
count: 101
text: 15410 288859 202 38682 7e2b8143e91fa8dc9bdb47f22b0ed95d
props: 10882 2348 111 0 014f4f31d8fa52a1c17e04bfb7ac7579
cpath: /trunk/client/gui-xaw/menu.c
copyroot: 15280 /trunk

id: 2ei.5ck.r15410/350572
type: file
pred: 2ei.5bk.r15266/146849
count: 15
text: 15410 178274 86 28987 0219710af96c13b1878c03f55748338b
props: 9853 84 111 0 b491beec13ba952c0167e367d3cb48d2
cpath: /trunk/client/gui-xaw/cma_fe.c
copyroot: 15280 /trunk

id: 9y.5ck.r15410/350824
type: file
pred: 9y.5bk.r14427/287062
count: 72
text: 15410 263700 915 33172 564cd339d612a9e64a2630cbf55baaaa
props: 10852 5556 111 0 ae073b1a8624f4e72ab3bef202bf2f05
cpath: /trunk/client/gui-xaw/cityrep.c
copyroot: 15280 /trunk

id: a6.5ck.r15410/351079
type: file
pred: a6.5bk.r15171/497
count: 141
text: 15410 265532 86 47018 0d1eec358fecafeffeeca00fc81a01be
props: 10957 6289 112 0 ac8a0c5808e41faff6290e5ee8a4284e
cpath: /trunk/client/gui-xaw/dialogs.c
copyroot: 15280 /trunk

id: 37p.5ck.r15410/351331
type: file
pred: 37p.5bk.r14777/48629
count: 17
text: 15410 268361 128 26906 0f0c2e68a85664a57710d453410698ce
props: 12670 103088 34 0 25e6c2f7558b7484000d4d090dea5b92
cpath: /trunk/client/gui-xaw/diplomat_dialog.c
copyroot: 15280 /trunk

id: a8.5ck.r15410/351596
type: file
pred: a8.5bk.r14777/48910
count: 52
text: 15410 126826 931 31178 10f697fa3a548a5d1cacda976f6be86e
props: 10442 1972 111 0 8ba011ca1ef4e408ab91a853a48e15eb
cpath: /trunk/client/gui-xaw/diplodlg.c
copyroot: 15280 /trunk

id: ad.5ck.r15410/351851
type: file
pred: ad.5bk.r14427/288157
count: 78
text: 15410 128697 96 17880 22f0e56dbd53922821f1572ca722bd36
props: 10789 5855 111 0 3d8b904835b9008e2a0a4d4db6ee628d
cpath: /trunk/client/gui-xaw/graphics.c
copyroot: 15280 /trunk

id: aj.5ck.r15410/352106
type: file
pred: aj.5bk.r14427/288427
count: 98
text: 15410 288622 143 8843 e8a6cfdc2dc18d35712fb0cc8d645352
props: 10532 8830 111 0 84ca0344c22ad8149c962ec888471b3d
cpath: /trunk/client/gui-xaw/mapctrl.c
copyroot: 15280 /trunk

id: ai.5ck.r15410/352360
type: file
pred: ai.5bk.r14427/288695
count: 41
text: 15410 128996 85 16502 243f947fda7b4a8ece72fa94e00adf12
props: 10696 129 111 0 23629f8214b2309975780a037517e920
cpath: /trunk/client/gui-xaw/inteldlg.c
copyroot: 15280 /trunk

id: ax.5ck.r15410/352614
type: file
pred: ax.5bk.r14427/288966
count: 26
text: 15410 143670 266 11205 7d03dbba5eef5bc16fe80fd785fb75c5
props: 10442 2333 111 0 5515c59917848b493fbf45ffb42836b3
cpath: /trunk/client/gui-xaw/ratesdlg.c
copyroot: 15280 /trunk

id: af.5ck.r15410/352870
type: file
pred: af.5bk.r14777/49179
count: 88
text: 15410 634 1601 37320 27a85410ee6fd1f20fd0bd43a9f47b53
props: 10882 3426 111 0 10d822456e37f81dabb45dad0c15b842
cpath: /trunk/client/gui-xaw/helpdlg.c
copyroot: 15280 /trunk

id: aw.5ck.r15410/353122
type: file
pred: aw.5bk.r14427/289509
count: 52
text: 15410 266527 1637 13178 8a27e8f7f227cd2bceb864e019806c06
props: 10442 2694 111 0 77af0ec85c332e0d4fd7e7ef86a518fd
cpath: /trunk/client/gui-xaw/plrdlg.c
copyroot: 15280 /trunk

id: b2.5ck.r15410/353377
type: file
pred: b2.5bk.r14427/290042
count: 30
text: 15410 174768 129 9663 bf78fc4beba681475ee7cc7819a6ec6c
props: 10442 3053 111 0 7c94b769c2c0998a2747d858cb1e860f
cpath: /trunk/client/gui-xaw/spaceshipdlg.c
copyroot: 15280 /trunk

id: o5.5ck.r15410/353636
type: file
pred: o5.5bk.r14427/290313
count: 37
text: 15410 261464 188 43679 401ee880343a1384819d9ec25e8de3ad
props: 10820 2037 111 0 9b377c828b4ca1827963af8e19878787
cpath: /trunk/client/gui-xaw/wldlg.c
copyroot: 15280 /trunk

id: a4.5ck.r15410/353889
type: file
pred: a4.5bk.r14427/290852
count: 42
text: 15410 2265 234 18017 23d0c2d83c16a074b7f1112160fe9295
props: 10882 3786 111 0 2e2357461112b5dbc5fe4daab6abde1a
cpath: /trunk/client/gui-xaw/connectdlg.c
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 24
file bq.5ck.r15407/32276
K 9
actions.c
V 25
file nt.5ck.r15410/349046
K 9
actions.h
V 21
file nu.0.r1888/21779
K 4
ad2c
V 22
file 9q.0.r1186/243967
K 8
canvas.c
V 21
file 9r.0.r3959/87925
K 8
canvas.h
V 20
file 9s.0.r4034/9073
K 9
canvasp.h
V 20
file 9t.0.r4034/8365
K 10
chatline.c
V 25
file 9u.5bk.r14427/289778
K 10
chatline.h
V 21
file 9v.0.r2187/10435
K 9
citydlg.c
V 25
file 9w.5ck.r15410/348534
K 9
citydlg.h
V 20
file 9x.0.r2187/8309
K 9
cityrep.c
V 25
file 9y.5ck.r15410/350824
K 9
cityrep.h
V 20
file g1.0.r5489/4916
K 8
cma_fe.c
V 26
file 2ei.5ck.r15410/350572
K 8
cma_fe.h
V 21
file 2ej.0.r6908/4433
K 8
colors.c
V 21
file a2.0.r10532/8601
K 8
colors.h
V 21
file a3.0.r10532/9312
K 12
connectdlg.c
V 25
file a4.5ck.r15410/353889
K 12
connectdlg.h
V 21
file a5.0.r2187/12228
K 9
dialogs.c
V 25
file a6.5ck.r15410/351079
K 9
dialogs.h
V 21
file a7.0.r10882/3191
K 10
diplodlg.c
V 25
file a8.5ck.r15410/351596
K 10
diplodlg.h
V 20
file a9.0.r2187/7955
K 17
diplomat_dialog.c
V 26
file 37p.5ck.r15410/351331
K 9
finddlg.c
V 25
file aa.5bk.r14209/174834
K 9
finddlg.h
V 22
file 2dk.0.r5989/31562
K 9
gotodlg.c
V 25
file ab.5ck.r15410/348791
K 9
gotodlg.h
V 21
file ac.0.r1888/21069
K 10
graphics.c
V 25
file ad.5ck.r15410/351851
K 10
graphics.h
V 21
file ae.0.r10789/6338
K 10
gui_main.c
V 25
file bm.5ck.r15410/349810
K 10
gui_main.h
V 22
file bn.0.r11408/10219
K 11
gui_stuff.c
V 22
file bo.0.r6129/126486
K 11
gui_stuff.h
V 21
file bp.0.r4964/56392
K 9
helpdlg.c
V 25
file af.5ck.r15410/352870
K 9
helpdlg.h
V 21
file g2.0.r1888/23188
K 10
inputdlg.c
V 20
file ag.0.r7586/1961
K 10
inputdlg.h
V 20
file ah.0.r7586/2315
K 10
inteldlg.c
V 25
file ai.5ck.r15410/352360
K 10
inteldlg.h
V 23
file 2dl.0.r10108/22972
K 9
mapctrl.c
V 25
file aj.5ck.r15410/352106
K 9
mapctrl.h
V 21
file ak.0.r10532/9667
K 9
mapview.c
V 25
file al.5ck.r15410/349301
K 9
mapview.h
V 24
file am.5bk.r13912/46304
K 6
menu.c
V 25
file an.5ck.r15410/350320
K 6
menu.h
V 21
file ao.0.r12091/4447
K 12
messagedlg.c
V 25
file ap.5bk.r14427/290582
K 12
messagedlg.h
V 22
file 2dm.0.r5989/31896
K 12
messagewin.c
V 25
file aq.5bk.r14427/286529
K 12
messagewin.h
V 20
file g3.0.r5489/3851
K 11
optiondlg.c
V 25
file ar.5bk.r14427/284361
K 11
optiondlg.h
V 21
file as.0.r1432/23133
K 7
pages.c
V 26
file 2qm.5ck.r15410/350066
K 7
pages.h
V 22
file 2qn.0.r10536/7909
K 9
pixcomm.c
V 21
file at.0.r3145/18494
K 9
pixcomm.h
V 20
file au.0.r4034/9777
K 10
pixcommp.h
V 20
file av.0.r4034/8719
K 8
plrdlg.c
V 25
file aw.5ck.r15410/353122
K 8
plrdlg.h
V 20
file g4.0.r5489/3140
K 10
ratesdlg.c
V 25
file ax.5ck.r15410/352614
K 10
ratesdlg.h
V 22
file 2dn.0.r5989/31227
K 10
repodlgs.c
V 25
file ay.5ck.r15410/349555
K 10
repodlgs.h
V 21
file az.0.r10957/6056
K 11
resources.c
V 20
file b0.0.r9310/2224
K 11
resources.h
V 21
file b1.0.r3145/14204
K 14
spaceshipdlg.c
V 25
file b2.5ck.r15410/353377
K 14
spaceshipdlg.h
V 21
file b3.0.r2187/11152
K 8
themes.c
V 23
file 350.0.r10945/14451
K 7
wldlg.c
V 25
file o5.5ck.r15410/353636
K 7
wldlg.h
V 22
file o6.0.r10181/18680
END
ENDREP
id: 9o.5ck.r15410/357221
type: dir
pred: 9o.5ck.r15407/35594
count: 864
text: 15410 354145 3063 3063 e88889bc1e7854222973e12eaaee6b92
props: 11108 12237 78 0 a27c61ac5fddbd709df8c1876129f940
cpath: /trunk/client/gui-xaw
copyroot: 15280 /trunk

id: xm.5ck.r15410/357465
type: file
pred: xm.5bk.r14427/294453
count: 122
text: 15410 287872 597 63326 8dc14d95bd2a063b5ede58f80b1bc3e2
props: 10989 3245 112 0 e7136c353c3addf3d4cc60888f1c16d6
cpath: /trunk/client/gui-win32/citydlg.c
copyroot: 15280 /trunk

id: xz.5ck.r15410/357723
type: file
pred: xz.5bk.r14427/294727
count: 18
text: 15410 288499 93 5862 849d9b4dd58f503a9f19959fc7d89eb2
props: 10534 8699 111 0 5396249b3009eb64cd90e5da0b7a56fa
cpath: /trunk/client/gui-win32/gotodlg.c
copyroot: 15280 /trunk

id: ye.5ck.r15410/357978
type: file
pred: ye.5bk.r14427/294998
count: 169
text: 15410 336028 129 18750 e5d99395a6a4c0f40b08ddb575a11106
props: 11084 8847 112 0 64942f9576ccbd6a94350596bbb7a5cc
cpath: /trunk/client/gui-win32/mapview.c
copyroot: 15280 /trunk

id: yq.5ck.r15410/358236
type: file
pred: yq.5bk.r14777/52776
count: 75
text: 15410 107337 156 31352 bdbf9dd34cb0999b734618e282190d84
props: 10883 3315 111 0 93646be3752db5a3cd8e77177837d494
cpath: /trunk/client/gui-win32/repodlgs.c
copyroot: 15280 /trunk

id: y3.5ck.r15410/358493
type: file
pred: y3.5ck.r15402/13599
count: 66
text: 15410 109401 310 27031 0c6b945d144dec72f0271e15f220c48e
props: 10519 872 111 0 910e8d1010fade384d0a5659f339617e
cpath: /trunk/client/gui-win32/gui_main.c
copyroot: 15280 /trunk

id: yg.5ck.r15410/358749
type: file
pred: yg.5bk.r15084/34273
count: 68
text: 15410 144081 6141 40890 f9c3151e117edf74e324d0f38b11f2ff
props: 10989 3605 111 0 d69121ee529fb8cb3643d711ec0f2158
cpath: /trunk/client/gui-win32/menu.c
copyroot: 15280 /trunk

id: 2fu.5ck.r15410/359003
type: file
pred: 2fu.5bk.r14433/58393
count: 11
text: 15410 151551 133 20667 6c0f62470b9c04e8e07272fcd6c663cf
props: 9591 2990 111 0 3d57169d64a739976bce7d2e578e29eb
cpath: /trunk/client/gui-win32/cma_fe.c
copyroot: 15280 /trunk

id: xo.5ck.r15410/359259
type: file
pred: xo.5bk.r14427/296090
count: 46
text: 15410 155828 236 35848 3285be481d7df17b8f172453721459b0
props: 10839 2574 111 0 2e2357461112b5dbc5fe4daab6abde1a
cpath: /trunk/client/gui-win32/cityrep.c
copyroot: 15280 /trunk

id: xu.5ck.r15410/359516
type: file
pred: xu.5bk.r15186/797
count: 103
text: 15410 156832 86 57191 bd0adf88830e141e20aa5f3d7f677b57
props: 10989 3964 111 0 8264fa93116f43c430f41dcf0da62390
cpath: /trunk/client/gui-win32/dialogs.c
copyroot: 15280 /trunk

id: xw.5ck.r15410/359770
type: file
pred: xw.5bk.r14777/53318
count: 38
text: 15410 172669 285 25725 adb92b51506d14ae19e4ba9637cc14ca
props: 10411 156138 111 0 23629f8214b2309975780a037517e920
cpath: /trunk/client/gui-win32/diplodlg.c
copyroot: 15280 /trunk

id: yc.5ck.r15410/360029
type: file
pred: yc.5bk.r14427/296912
count: 50
text: 15410 174202 536 10748 e01d36eb0fa73973bd0341f24de178ad
props: 10387 23931 111 0 e9cbe3af5d5934f88ab895fd46902062
cpath: /trunk/client/gui-win32/mapctrl.c
copyroot: 15280 /trunk

id: yb.5ck.r15410/360287
type: file
pred: yb.5bk.r14427/297184
count: 25
text: 15410 174088 83 5872 8176dd6989a3621731234f246d441ac7
props: 10736 12122 111 0 d4514082fc7e52be026d3360dec4dcb0
cpath: /trunk/client/gui-win32/inteldlg.c
copyroot: 15280 /trunk

id: yp.5ck.r15410/360544
type: file
pred: yp.5bk.r14427/297459
count: 14
text: 15410 175059 459 9870 49b730435b8eccf9b130a97451b83e36
props: 10989 4324 111 0 3d57169d64a739976bce7d2e578e29eb
cpath: /trunk/client/gui-win32/ratesdlg.c
copyroot: 15280 /trunk

id: y7.5ck.r15410/360801
type: file
pred: y7.5bk.r14427/297730
count: 62
text: 15410 187492 162 30032 f3f3f1f067b9d8312a91f26e20685637
props: 10989 4683 111 0 fd48e7132065a890e4a210dc3646defe
cpath: /trunk/client/gui-win32/helpdlg.c
copyroot: 15280 /trunk

id: yn.5ck.r15410/361058
type: file
pred: yn.5ck.r15303/9977
count: 31
text: 15410 187806 104 12331 83365ab3c997646f9e0d7b187780363e
props: 10427 5013 111 0 0b146d6d431c2ad00452618c43381276
cpath: /trunk/client/gui-win32/plrdlg.c
copyroot: 15280 /trunk

id: xk.5ck.r15410/361312
type: file
pred: xk.5bk.r14427/298273
count: 12
text: 15410 188663 619 3952 688e91affcc2ab0b00d343b842ebbd79
props: 7930 24074 111 0 b491beec13ba952c0167e367d3cb48d2
cpath: /trunk/client/gui-win32/chatline.c
copyroot: 15280 /trunk

id: yt.5ck.r15410/361569
type: file
pred: yt.5bk.r14444/69
count: 22
text: 15410 261331 103 8027 1451b57d5d682198fb1f3d868b8bce9e
props: 10427 5374 111 0 433ca8234d38d2ba821c9aa09a03d731
cpath: /trunk/client/gui-win32/spaceshipdlg.c
copyroot: 15280 /trunk

id: yv.5ck.r15410/361826
type: file
pred: yv.5bk.r14427/298816
count: 28
text: 15410 261743 1767 33505 ae9b953846e39a0778f48c4cf48ac06d
props: 10839 2935 111 0 1912998302effd94f7d1c131050552ad
cpath: /trunk/client/gui-win32/wldlg.c
copyroot: 15280 /trunk

id: xs.5ck.r15410/362082
type: file
pred: xs.5bk.r14775/12903
count: 52
text: 15410 265643 666 33622 fafc04e1bf3ba419f744c36160862079
props: 10884 2435 111 0 14533b38c2d22fb145a05b253c8fb2e8
cpath: /trunk/client/gui-win32/connectdlg.c
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 24
file nr.5ck.r15407/35836
K 8
canvas.c
V 25
file 2ya.5bk.r15074/17854
K 8
canvas.h
V 22
file 2yb.0.r10131/2132
K 10
chatline.c
V 25
file xk.5ck.r15410/361312
K 10
chatline.h
V 20
file xl.0.r5785/7678
K 9
citydlg.c
V 25
file xm.5ck.r15410/357465
K 9
citydlg.h
V 19
file xn.0.r5671/865
K 9
cityrep.c
V 25
file xo.5ck.r15410/359259
K 9
cityrep.h
V 22
file xp.0.r3745/159022
K 8
cma_fe.c
V 26
file 2fu.5ck.r15410/359003
K 8
cma_fe.h
V 20
file 2fv.0.r7442/210
K 8
colors.c
V 21
file xq.0.r10461/1484
K 8
colors.h
V 21
file xr.0.r10461/1841
K 12
connectdlg.c
V 25
file xs.5ck.r15410/362082
K 12
connectdlg.h
V 20
file xt.0.r8331/7783
K 9
dialogs.c
V 25
file xu.5ck.r15410/359516
K 9
dialogs.h
V 21
file xv.0.r10883/4520
K 10
diplodlg.c
V 25
file xw.5ck.r15410/359770
K 10
diplodlg.h
V 22
file xx.0.r13481/26989
K 9
finddlg.c
V 25
file xy.5bk.r14209/180555
K 9
finddlg.h
V 22
file 2dg.0.r5989/39776
K 9
gotodlg.c
V 25
file xz.5ck.r15410/357723
K 9
gotodlg.h
V 20
file y0.0.r3786/3776
K 10
graphics.c
V 24
file y1.5ck.r15296/79962
K 10
graphics.h
V 21
file y2.0.r10294/2998
K 10
gui_main.c
V 25
file y3.5ck.r15410/358493
K 10
gui_main.h
V 20
file y4.0.r10222/314
K 11
gui_stuff.c
V 22
file y5.0.r13328/10611
K 11
gui_stuff.h
V 22
file y6.0.r13328/10851
K 11
happiness.c
V 23
file 137.5bk.r14335/341
K 11
happiness.h
V 23
file 138.0.r13481/26751
K 9
helpdlg.c
V 25
file y7.5ck.r15410/360801
K 9
helpdlg.h
V 22
file y8.0.r3745/150873
K 10
inputdlg.c
V 19
file y9.0.r8895/460
K 10
inputdlg.h
V 22
file ya.0.r3745/153242
K 10
inteldlg.c
V 25
file yb.5ck.r15410/360287
K 10
inteldlg.h
V 22
file 2dh.0.r5989/39102
K 9
mapctrl.c
V 25
file yc.5ck.r15410/360029
K 9
mapctrl.h
V 21
file yd.0.r6430/14685
K 9
mapview.c
V 25
file ye.5ck.r15410/357978
K 9
mapview.h
V 22
file yf.0.r13412/11359
K 6
menu.c
V 25
file yg.5ck.r15410/358749
K 6
menu.h
V 20
file yh.0.r5785/9458
K 12
messagedlg.c
V 25
file yi.5bk.r14427/299083
K 12
messagedlg.h
V 22
file 2di.0.r5989/40112
K 12
messagewin.c
V 25
file yj.5bk.r14427/295548
K 12
messagewin.h
V 22
file yk.0.r3745/155966
K 11
optiondlg.c
V 22
file yl.0.r13412/10878
K 11
optiondlg.h
V 21
file ym.0.r3959/96575
K 7
pages.c
V 23
file 2qk.0.r13412/11835
K 7
pages.h
V 22
file 2ql.0.r8639/12634
K 8
plrdlg.c
V 25
file yn.5ck.r15410/361058
K 8
plrdlg.h
V 20
file yo.0.r3847/6164
K 10
ratesdlg.c
V 25
file yp.5ck.r15410/360544
K 10
ratesdlg.h
V 22
file 2dj.0.r5989/39439
K 10
repodlgs.c
V 25
file yq.5ck.r15410/358236
K 10
repodlgs.h
V 22
file yr.0.r3745/151547
K 14
spaceshipdlg.c
V 25
file yt.5ck.r15410/361569
K 14
spaceshipdlg.h
V 20
file yu.0.r3778/5068
K 8
sprite.c
V 22
file 2yc.0.r10294/2273
K 8
sprite.h
V 23
file 2yd.0.r10141/44406
K 8
themes.c
V 23
file 34z.0.r10945/20562
K 7
wldlg.c
V 25
file yv.5ck.r15410/361826
K 7
wldlg.h
V 21
file yw.0.r12515/1620
END
ENDREP
id: np.5ck.r15410/365160
type: dir
pred: np.5ck.r15407/38896
count: 647
text: 15410 362341 2806 2806 15ef33efef98cb20300a1bca3a278509
props: 11108 12557 68 0 fbaef5f6348d6ae4b0cc177104ca4ad2
cpath: /trunk/client/gui-win32
copyroot: 15280 /trunk

id: vu.5ck.r15410/365406
type: file
pred: vu.5ck.r15364/73074
count: 108
text: 15410 157243 1255 41921 d91d8b5b0323468b3f11da123c7850cb
props: 11057 46140 111 0 8ab1a522471ad7dd5014b23b42c49491
cpath: /trunk/client/goto.c
copyroot: 15280 /trunk

id: n.5ck.r15410/365652
type: file
pred: n.5ck.r15403/22854
count: 676
text: 15410 158528 530 107909 4561cda15506fef5c944321b14b8bf14
props: 11088 14698 112 0 2c9d3e41a2f20488aa9cdb8d740d094e
cpath: /trunk/client/packhand.c
copyroot: 15280 /trunk

id: 18d.5ck.r15410/365900
type: file
pred: 18d.5bk.r15200/34793
count: 81
text: 15410 2526 34 80684 03782e26c1c3fc1f4f07c8411578ba35
props: 9803 3079 111 0 9b377c828b4ca1827963af8e19878787
cpath: /trunk/client/gui-sdl/optiondlg.c
copyroot: 15280 /trunk

id: 170.5ck.r15410/366154
type: file
pred: 170.5ck.r15296/83752
count: 128
text: 15410 2650 101720 123773 b93bde8c202a6946816352a7f10153bf
props: 10779 67589 111 0 515f6afa6448327e59cdac91d637f582
cpath: /trunk/client/gui-sdl/citydlg.c
copyroot: 15280 /trunk

id: 17f.5ck.r15410/366414
type: file
pred: 17f.5bk.r14427/303779
count: 45
text: 15410 2589 31 11270 4fe9b87f8dc1243b71b4370f06eb604b
props: 10534 12701 111 0 3d57169d64a739976bce7d2e578e29eb
cpath: /trunk/client/gui-sdl/gotodlg.c
copyroot: 15280 /trunk

id: 186.5ck.r15410/366669
type: file
pred: 186.5bk.r15084/37608
count: 170
text: 15410 109284 86 39638 6651f717f3cf59568f78520a5fb2696c
props: 10779 67955 111 0 1566ee949d8102994e5ce1bbf3530de9
cpath: /trunk/client/gui-sdl/mapview.c
copyroot: 15280 /trunk

id: 191.5ck.r15410/366926
type: file
pred: 191.5bk.r14777/56657
count: 55
text: 15410 127787 34 22832 5b0829fdb560131ab4985840f835b749
props: 10141 49776 111 0 0b146d6d431c2ad00452618c43381276
cpath: /trunk/client/gui-sdl/gui_tilespec.c
copyroot: 15280 /trunk

id: 18i.5ck.r15410/367187
type: file
pred: 18i.5bk.r14777/56930
count: 111
text: 15410 128823 50 110435 eb99afe6e2c593492852afbcecc48f7a
props: 10779 68322 111 0 622f1432038f91cce287c1d90e4f7964
cpath: /trunk/client/gui-sdl/repodlgs.c
copyroot: 15280 /trunk

id: 17o.5ck.r15410/367446
type: file
pred: 17o.5ck.r15402/16902
count: 132
text: 15410 150541 341 35394 c844e12c39ff9216cbc29f4198466089
props: 10411 162763 111 0 93121dcfd7714818c8d46f9c51a886fa
cpath: /trunk/client/gui-sdl/gui_main.c
copyroot: 15280 /trunk

id: 3bp.5ck.r15410/367706
type: file
pred: 3bp.5bk.r14427/305162
count: 15
text: 15410 151490 31 7326 7eb03d3625a6e4b56f19a5c7644ba1db
props: 12670 110608 34 0 25e6c2f7558b7484000d4d090dea5b92
cpath: /trunk/client/gui-sdl/caravan_dialog.c
copyroot: 15280 /trunk

id: 188.5ck.r15410/367969
type: file
pred: 188.5bk.r15137/284
count: 66
text: 15410 156943 268 42783 78d48a15b0f593196431d7251e867814
props: 10805 77668 111 0 18cdb9becb11c47631b7a093e907200c
cpath: /trunk/client/gui-sdl/menu.c
copyroot: 15280 /trunk

id: 174.5ck.r15410/368221
type: file
pred: 174.5bk.r14433/62002
count: 54
text: 15410 159088 89 38280 a5488e87f53fb701b8dced9f681a8de2
props: 9108 25970 111 0 433ca8234d38d2ba821c9aa09a03d731
cpath: /trunk/client/gui-sdl/cma_fe.c
copyroot: 15280 /trunk

id: 390.5ck.r15410/368475
type: file
pred: 390.5bk.r14377/2300196
count: 18
text: 15410 170620 1826 33523 69134763a3fecbad5f25c2d2e602165b
props: 12670 112635 34 0 25e6c2f7558b7484000d4d090dea5b92
cpath: /trunk/client/gui-sdl/themespec.c
copyroot: 15280 /trunk

id: 172.5ck.r15410/368737
type: file
pred: 172.5bk.r14998/1191
count: 61
text: 15410 172984 34 39083 bffcda982ed0cf375dbf0f9543e733fa
props: 10779 68689 111 0 df9f31216c5039327c376b7fe82756f5
cpath: /trunk/client/gui-sdl/cityrep.c
copyroot: 15280 /trunk

id: 17a.5ck.r15410/368992
type: file
pred: 17a.5bk.r14956/57311
count: 148
text: 15410 173237 819 99013 8f797b1a3f2cadeb07580ba0a136040d
props: 10805 78030 111 0 ae073b1a8624f4e72ab3bef202bf2f05
cpath: /trunk/client/gui-sdl/dialogs.c
copyroot: 15280 /trunk

id: 3bn.5ck.r15410/369250
type: file
pred: 3bn.5bk.r14777/57201
count: 35
text: 15410 178389 34 44981 7834378a0eb71627815a3148ba941f7c
props: 12670 114091 34 0 25e6c2f7558b7484000d4d090dea5b92
cpath: /trunk/client/gui-sdl/diplomat_dialog.c
copyroot: 15280 /trunk

id: 17c.5ck.r15410/369514
type: file
pred: 17c.5bk.r14777/57480
count: 53
text: 15410 186186 34 53213 660c0c1d0c97b71532b94c97146f7bcc
props: 10411 163500 111 0 433ca8234d38d2ba821c9aa09a03d731
cpath: /trunk/client/gui-sdl/diplodlg.c
copyroot: 15280 /trunk

id: 184.5ck.r15410/369772
type: file
pred: 184.5bk.r15200/35329
count: 99
text: 15410 187684 34 79399 e268c09470c95c7f43a70cd47a9ef4f4
props: 9803 6307 111 0 4135f0dfb17a4d11b2424d95e27830f5
cpath: /trunk/client/gui-sdl/mapctrl.c
copyroot: 15280 /trunk

id: 183.5ck.r15410/370026
type: file
pred: 183.5bk.r14777/57755
count: 51
text: 15410 187746 31 14089 bafd930c5fe6c5939be20783e770199b
props: 10411 163869 111 0 d4514082fc7e52be026d3360dec4dcb0
cpath: /trunk/client/gui-sdl/inteldlg.c
copyroot: 15280 /trunk

id: 17z.5ck.r15410/370284
type: file
pred: 17z.5bk.r14498/456
count: 64
text: 15410 190395 67945 69767 29a73721bbd1ee7f91324349aa5d69bd
props: 10411 164601 111 0 3d57169d64a739976bce7d2e578e29eb
cpath: /trunk/client/gui-sdl/helpdlg.c
copyroot: 15280 /trunk

id: 18f.5ck.r15410/370542
type: file
pred: 18f.5bk.r14427/307641
count: 51
text: 15410 260051 34 23950 2abb8c1aba0916be33ed7d87ff3db6c4
props: 10411 164967 111 0 28e613ef70fc8e4efe7ed7b15f74e6e7
cpath: /trunk/client/gui-sdl/plrdlg.c
copyroot: 15280 /trunk

id: 16y.5ck.r15410/370799
type: file
pred: 16y.5ck.r15296/84262
count: 51
text: 15410 261682 34 29495 1ca76bfafd83016b6f3323957c69a1c5
props: 9030 114052 111 0 2a5912525b098cb46a1301ee940f7617
cpath: /trunk/client/gui-sdl/chatline.c
copyroot: 15280 /trunk

id: 18m.5ck.r15410/371056
type: file
pred: 18m.5bk.r14427/308190
count: 32
text: 15410 268897 6122 7589 3822d45e45ff8d964fdb0f37fc9e59ae
props: 9803 7024 111 0 3d57169d64a739976bce7d2e578e29eb
cpath: /trunk/client/gui-sdl/spaceshipdlg.c
copyroot: 15280 /trunk

id: 18q.5ck.r15410/371317
type: file
pred: 18q.5bk.r14427/308465
count: 66
text: 15410 286899 184 55365 67c9e074d528139227fa2f3d21d11994
props: 10779 69053 111 0 433ca8234d38d2ba821c9aa09a03d731
cpath: /trunk/client/gui-sdl/wldlg.c
copyroot: 15280 /trunk

id: 178.5ck.r15410/371573
type: file
pred: 178.5bk.r14427/308737
count: 55
text: 15410 288795 34 34600 913331a56649ea874941f04d13fc088e
props: 10804 14832 111 0 45c0e160a790dc8f7645f8a7eabea654
cpath: /trunk/client/gui-sdl/connectdlg.c
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 25
file 16u.5ck.r15407/39140
K 14
SDL_rotozoom.c
V 24
file 3jy.0.r12670/115301
K 14
SDL_rotozoom.h
V 24
file 3jz.0.r12670/115888
K 9
SDL_ttf.c
V 24
file 2dz.5bk.r13597/7386
K 9
SDL_ttf.h
V 24
file 2e0.5bk.r13597/7647
K 11
alphablit.c
V 23
file 3be.0.r13354/59832
K 8
canvas.c
V 25
file 39i.5bk.r15074/21186
K 8
canvas.h
V 23
file 39j.0.r13354/56918
K 16
caravan_dialog.c
V 26
file 3bp.5ck.r15410/367706
K 10
chatline.c
V 26
file 16y.5ck.r15410/370799
K 10
chatline.h
V 25
file 16z.5bk.r13794/18245
K 9
citydlg.c
V 26
file 170.5ck.r15410/366154
K 9
citydlg.h
V 23
file 171.0.r13354/55222
K 9
cityrep.c
V 26
file 172.5ck.r15410/368737
K 9
cityrep.h
V 22
file 173.0.r12769/2941
K 8
cma_fe.c
V 26
file 174.5ck.r15410/368221
K 8
cma_fe.h
V 23
file 175.0.r11361/43495
K 8
colors.c
V 23
file 176.0.r13354/62500
K 8
colors.h
V 24
file 177.5bk.r14076/4693
K 12
connectdlg.c
V 26
file 178.5ck.r15410/371573
K 12
connectdlg.h
V 23
file 179.0.r12349/45319
K 9
dialogs.c
V 26
file 17a.5ck.r15410/368992
K 9
dialogs.h
V 23
file 17b.0.r13354/61529
K 10
diplodlg.c
V 26
file 17c.5ck.r15410/369514
K 10
diplodlg.h
V 22
file 17d.0.r11584/2869
K 17
diplomat_dialog.c
V 26
file 3bn.5ck.r15410/369250
K 9
finddlg.c
V 25
file 17e.5ck.r15303/13276
K 9
finddlg.h
V 20
file 2d8.0.r5991/702
K 9
gotodlg.c
V 26
file 17f.5ck.r15410/366414
K 9
gotodlg.h
V 22
file 17g.0.r6515/58208
K 10
graphics.c
V 27
file 17h.5bk.r14377/2300750
K 10
graphics.h
V 23
file 17i.0.r12611/13939
K 11
gui_iconv.c
V 22
file 17l.5bk.r14362/60
K 11
gui_iconv.h
V 23
file 17m.0.r13354/66657
K 8
gui_id.h
V 25
file 17n.5bk.r15200/35062
K 10
gui_main.c
V 26
file 17o.5ck.r15410/367446
K 10
gui_main.h
V 23
file 17p.0.r13354/59593
K 11
gui_mouse.c
V 23
file 3ca.0.r13354/59349
K 11
gui_mouse.h
V 24
file 3cb.0.r12670/112397
K 12
gui_string.c
V 24
file 17r.5bk.r13666/2840
K 12
gui_string.h
V 23
file 17s.0.r13481/30445
K 14
gui_tilespec.c
V 26
file 191.5ck.r15410/366926
K 14
gui_tilespec.h
V 25
file 192.5bk.r13912/53929
K 11
happiness.c
V 23
file 17x.0.r11361/41144
K 11
happiness.h
V 23
file 17y.0.r11361/41867
K 9
helpdlg.c
V 26
file 17z.5ck.r15410/370284
K 9
helpdlg.h
V 23
file 180.0.r11361/47416
K 10
inputdlg.c
V 23
file 181.0.r11361/47897
K 10
inputdlg.h
V 23
file 182.0.r5500/260641
K 10
inteldlg.c
V 26
file 183.5ck.r15410/370026
K 10
inteldlg.h
V 22
file 2d9.0.r11409/2687
K 9
mapctrl.c
V 26
file 184.5ck.r15410/369772
K 9
mapctrl.h
V 23
file 185.0.r13354/63700
K 9
mapview.c
V 26
file 186.5ck.r15410/366669
K 9
mapview.h
V 23
file 187.0.r13354/56676
K 6
menu.c
V 26
file 188.5ck.r15410/367969
K 6
menu.h
V 25
file 189.5bk.r13856/57405
K 12
messagedlg.c
V 23
file 18a.0.r11361/49350
K 12
messagedlg.h
V 22
file 2da.0.r5989/48394
K 12
messagewin.c
V 23
file 18b.0.r13354/60073
K 12
messagewin.h
V 23
file 18c.0.r6286/140236
K 5
mmx.h
V 23
file 2e1.0.r6286/134429
K 11
optiondlg.c
V 26
file 18d.5ck.r15410/365900
K 11
optiondlg.h
V 22
file 18e.0.r12381/2174
K 7
pages.c
V 25
file 2qg.5bk.r14478/12831
K 7
pages.h
V 22
file 2qh.0.r8639/16416
K 8
plrdlg.c
V 26
file 18f.5ck.r15410/370542
K 8
plrdlg.h
V 22
file 18g.0.r6387/81301
K 10
ratesdlg.h
V 22
file 2db.0.r5989/47726
K 10
repodlgs.c
V 26
file 18i.5ck.r15410/367187
K 10
repodlgs.h
V 23
file 18j.0.r13354/58129
K 14
spaceshipdlg.c
V 26
file 18m.5ck.r15410/371056
K 14
spaceshipdlg.h
V 23
file 18n.0.r5500/263363
K 8
sprite.c
V 23
file 39k.0.r13354/55462
K 8
sprite.h
V 24
file 39l.0.r12670/108062
K 18
themebackgrounds.c
V 25
file 3ff.5bk.r13794/17164
K 18
themebackgrounds.h
V 25
file 3fg.5bk.r13794/17440
K 13
themecolors.c
V 24
file 392.0.r12670/113849
K 13
themecolors.h
V 24
file 393.0.r12670/114433
K 8
themes.c
V 23
file 38p.5bk.r14439/742
K 11
themespec.c
V 26
file 390.5ck.r15410/368475
K 11
themespec.h
V 27
file 391.5bk.r14377/2300476
K 11
unistring.c
V 23
file 18o.0.r13354/57401
K 11
unistring.h
V 23
file 18p.0.r13481/30205
K 8
widget.c
V 25
file 3fu.5bk.r15218/30693
K 8
widget.h
V 25
file 3fv.5bk.r15218/31232
K 15
widget_button.c
V 24
file 3fh.5bk.r14076/3619
K 15
widget_button.h
V 24
file 3g7.0.r12670/113556
K 17
widget_checkbox.c
V 24
file 3fi.5bk.r14076/6064
K 17
widget_checkbox.h
V 24
file 3g8.0.r12670/106620
K 13
widget_core.c
V 23
file 3fj.0.r13354/61769
K 13
widget_edit.c
V 23
file 3fk.0.r13354/64909
K 13
widget_edit.h
V 24
file 3g9.0.r12670/115595
K 13
widget_icon.c
V 23
file 3fl.0.r13354/59104
K 13
widget_icon.h
V 24
file 3ga.0.r12670/112107
K 14
widget_label.c
V 24
file 3fm.5bk.r13597/6851
K 14
widget_label.h
V 24
file 3gb.0.r12670/110079
K 10
widget_p.h
V 24
file 3fn.0.r12670/107197
K 18
widget_scrollbar.c
V 24
file 3fo.5bv.r14076/5760
K 18
widget_scrollbar.h
V 24
file 3gc.0.r12670/116811
K 15
widget_window.c
V 23
file 3fp.0.r13354/55944
K 15
widget_window.h
V 23
file 3gd.0.r12699/32533
K 7
wldlg.c
V 26
file 18q.5ck.r15410/371317
K 7
wldlg.h
V 23
file 18r.0.r11361/49592
END
ENDREP
id: 16t.5ck.r15410/376691
type: dir
pred: 16t.5ck.r15407/44230
count: 531
text: 15410 371833 4845 4845 a526d81a2be0ec80dfe591fe1afd5f9e
props: 11108 12869 78 0 a27c61ac5fddbd709df8c1876129f940
cpath: /trunk/client/gui-sdl
copyroot: 15280 /trunk

id: 14u.5ck.r15410/376937
type: file
pred: 14u.5bk.r14427/314135
count: 32
text: 15410 178451 7708 10615 6ab9e7a7cd6d3d6187f42504c2fbf707
props: 11094 491 111 0 45c0e160a790dc8f7645f8a7eabea654
cpath: /trunk/client/plrdlg_common.c
copyroot: 15280 /trunk

id: 14s.5ck.r15410/377192
type: file
pred: 14s.5bk.r14427/314404
count: 28
text: 15410 188315 320 7203 f6c049194e445134c5910f5a568d7fc3
props: 11057 47206 111 0 45c0e160a790dc8f7645f8a7eabea654
cpath: /trunk/client/messagewin_common.c
copyroot: 15280 /trunk

id: 2kn.5ck.r15410/377451
type: file
pred: 2kn.5bk.r14121/215661
count: 4
text: 15410 151199 263 1226 d7a5d639c23c5ef902b46f4390209539
props: 7939 65106 110 0 94a2a96823d3c54fff31bdd51de17982
cpath: /trunk/client/gui-ftwl/gotodlg.c
copyroot: 15280 /trunk

id: 2kz.5ck.r15410/377707
type: file
pred: 2kz.5ck.r15296/89598
count: 43
text: 15410 156719 86 49823 8a27c4130d0bbd8a6d3d5a0fed1b9ec5
props: 10452 1016 111 0 45c0e160a790dc8f7645f8a7eabea654
cpath: /trunk/client/gui-ftwl/mapview.c
copyroot: 15280 /trunk

id: 2kr.5ck.r15410/377963
type: file
pred: 2kr.5ck.r15402/22242
count: 22
text: 15410 332196 219 12122 e08d53f5b2b5ea48c759ff91c29d3195
props: 10130 8501 111 0 d4514082fc7e52be026d3360dec4dcb0
cpath: /trunk/client/gui-ftwl/gui_main.c
copyroot: 15280 /trunk

id: 2kf.5ck.r15410/378221
type: file
pred: 2kf.5bk.r14427/315219
count: 8
text: 15410 189370 740 5619 a2cb720698b98f7f8ec75bf7998bf86b
props: 10804 18979 110 0 fdfdab56f53d2388a66f6a5ce0985f95
cpath: /trunk/client/gui-ftwl/connectdlg.c
copyroot: 15280 /trunk

id: 2kh.5ck.r15410/378481
type: file
pred: 2kh.5bk.r14427/315489
count: 19
text: 15410 190139 112 13189 b5e749254b6fcf0da90e6362d9488d43
props: 10452 1380 111 0 3d57169d64a739976bce7d2e578e29eb
cpath: /trunk/client/gui-ftwl/dialogs.c
copyroot: 15280 /trunk

id: 2mr.5ck.r15410/378739
type: file
pred: 2mr.5bk.r15188/4564
count: 34
text: 15410 143192 269 15156 a028f5498be9fa09997c25a4a844ebc7
props: 10805 82177 111 0 8e6f231ffe21dad0a34f68090b1c0b69
cpath: /trunk/client/gui-ftwl/gui_text.c
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 25
file 2k4.5ck.r15407/44474
K 8
canvas.c
V 25
file 2ye.5bk.r15074/26546
K 8
canvas.h
V 23
file 2yf.0.r10109/10676
K 6
chat.c
V 26
file 2k5.5bk.r14427/314951
K 6
chat.h
V 22
file 2k6.0.r7939/79684
K 10
chatline.c
V 22
file 2k7.0.r11941/6451
K 10
chatline.h
V 22
file 2k8.0.r7939/74301
K 9
citydlg.c
V 27
file 2k9.5bk.r14370/4412944
K 9
citydlg.h
V 22
file 2ka.0.r7939/67918
K 9
cityrep.c
V 22
file 2kb.0.r7939/78333
K 9
cityrep.h
V 22
file 2kc.0.r7939/80015
K 8
colors.c
V 22
file 2kd.0.r11941/5347
K 8
colors.h
V 22
file 2ke.0.r11941/5582
K 12
connectdlg.c
V 26
file 2kf.5ck.r15410/378221
K 12
connectdlg.h
V 22
file 2kg.0.r7939/80350
K 9
dialogs.c
V 26
file 2kh.5ck.r15410/378481
K 9
dialogs.h
V 22
file 2ki.0.r7939/80688
K 10
diplodlg.c
V 22
file 2kj.0.r7939/64892
K 10
diplodlg.h
V 22
file 2kk.0.r7939/67247
K 9
finddlg.c
V 22
file 2kl.0.r7939/69930
K 9
finddlg.h
V 22
file 2km.0.r7939/70941
K 9
gotodlg.c
V 26
file 2kn.5ck.r15410/377451
K 9
gotodlg.h
V 22
file 2ko.0.r7939/67583
K 10
graphics.c
V 23
file 2kp.0.r10141/54754
K 10
graphics.h
V 22
file 2kq.0.r7939/68252
K 10
gui_main.c
V 26
file 2kr.5ck.r15410/377963
K 10
gui_main.h
V 22
file 2ks.0.r11943/1292
K 10
gui_text.c
V 26
file 2mr.5ck.r15410/378739
K 10
gui_text.h
V 22
file 2ms.0.r11941/8598
K 9
helpdlg.c
V 22
file 2kt.0.r7939/71611
K 9
helpdlg.h
V 22
file 2ku.0.r7939/72285
K 10
inteldlg.c
V 22
file 2kv.0.r7939/66910
K 10
inteldlg.h
V 22
file 2kw.0.r7939/69594
K 9
mapctrl.c
V 27
file 2kx.5bk.r14370/4413216
K 9
mapctrl.h
V 22
file 2ky.0.r7939/69259
K 9
mapview.c
V 26
file 2kz.5ck.r15410/377707
K 9
mapview.h
V 21
file 2l0.0.r11943/817
K 6
menu.c
V 22
file 2l1.0.r7939/75312
K 6
menu.h
V 22
file 2l2.0.r7939/76324
K 12
messagedlg.c
V 22
file 2l3.0.r7939/76990
K 12
messagedlg.h
V 22
file 2l4.0.r7939/79008
K 12
messagewin.c
V 23
file 2l5.0.r9577/142349
K 12
messagewin.h
V 22
file 2l6.0.r7939/75986
K 7
pages.c
V 22
file 2qc.0.r11943/1528
K 7
pages.h
V 22
file 2qd.0.r8639/25123
K 8
plrdlg.c
V 23
file 2l7.0.r9577/141628
K 8
plrdlg.h
V 22
file 2l8.0.r7939/73967
K 10
ratesdlg.c
V 22
file 2l9.0.r7939/68588
K 10
ratesdlg.h
V 22
file 2la.0.r7939/70605
K 10
repodlgs.c
V 22
file 2lb.0.r7939/71947
K 10
repodlgs.h
V 22
file 2lc.0.r7939/72955
K 14
spaceshipdlg.c
V 22
file 2ld.0.r7939/75645
K 14
spaceshipdlg.h
V 22
file 2le.0.r7939/77329
K 8
sprite.c
V 23
file 2yg.0.r11958/37010
K 8
sprite.h
V 23
file 2yh.0.r10141/56198
K 8
themes.c
V 24
file 3cc.0.r12670/122700
K 7
wldlg.c
V 22
file 2lf.0.r7939/76656
K 7
wldlg.h
V 22
file 2lg.0.r7939/77669
END
ENDREP
id: 2k2.5ck.r15410/381543
type: dir
pred: 2k2.5ck.r15407/47272
count: 106
text: 15410 378997 2533 2533 ee50388b64f1fa5406f2a8f1a9b244ab
props: 11108 13191 78 0 667fe0aa2722f6798d567486294a1d2e
cpath: /trunk/client/gui-ftwl
copyroot: 15280 /trunk

id: h1.5ck.r15410/381790
type: file
pred: h1.5ck.r15296/92639
count: 181
text: 15410 190280 86 60630 8ae4212b75e2479a474b492b97a84787
props: 10865 39466 112 0 7c92b74246787b3b87930d3304880700
cpath: /trunk/client/helpdata.c
copyroot: 15280 /trunk

id: 2fw.5ck.r15410/382038
type: file
pred: 2fw.5bk.r15208/48
count: 44
text: 15410 260115 1186 17820 95c584db58fbb702a8103eac7218b167
props: 9999 36135 111 0 b4233197920770c602c29330b7f7c623
cpath: /trunk/client/connectdlg_common.c
copyroot: 15280 /trunk

id: 14q.5ck.r15410/382294
type: file
pred: 14q.5ck.r15296/92887
count: 14
text: 15410 263541 134 5451 6755ec38c0cd4897237b5e02f03c10bd
props: 9577 150942 110 0 2297367bb62237eae251d6a189335c2c
cpath: /trunk/client/chatline_common.c
copyroot: 15280 /trunk

id: xh.5ck.r15410/382550
type: file
pred: xh.5bk.r14427/319391
count: 26
text: 15410 264875 125 17074 766160688b297ead275b7c9c9e2de9fd
props: 11057 47571 111 0 1912998302effd94f7d1c131050552ad
cpath: /trunk/client/attribute.c
copyroot: 15280 /trunk

id: 197.5ck.r15410/382800
type: file
pred: 197.5bk.r14427/319656
count: 14
text: 15410 266339 159 2859 2a179a031b4914451056880bf82a9796
props: 11057 47923 111 0 b491beec13ba952c0167e367d3cb48d2
cpath: /trunk/client/climap.c
copyroot: 15280 /trunk

id: hl.5ck.r15410/383048
type: file
pred: hl.5ck.r15354/29004
count: 409
text: 15410 268194 141 167325 914aa4e2f0e2ea5e0d2e8a082ee99785
props: 11096 3792 112 0 71c6b453a620995957914f193a952f13
cpath: /trunk/client/tilespec.c
copyroot: 15280 /trunk

id: 15m.5ck.r15410/383297
type: file
pred: 15m.5bk.r14846/126613
count: 90
text: 15410 275049 285 23493 69436d59ce36a4d338264d07100c190a
props: 11057 48634 111 0 e77f29e20031f26b4b1e16b63c7aa55c
cpath: /trunk/client/mapctrl_common.c
copyroot: 15280 /trunk

id: n0.5ck.r15410/383554
type: file
pred: n0.5bk.r14121/219530
count: 5
text: 15410 465 139 1226 b486b9356f623201a8077cd7c1480692
props: 5491 32851 110 0 fd27c383f48a4fbbd90a59fbcfc8b3be
cpath: /trunk/client/gui-stub/gotodlg.c
copyroot: 15280 /trunk

id: nb.5ck.r15410/383805
type: file
pred: nb.5bk.r14427/320454
count: 59
text: 15410 107736 139 8759 c5a34a7180474a063ae1b13ffea26ead
props: 10411 182447 111 0 515f6afa6448327e59cdac91d637f582
cpath: /trunk/client/gui-stub/mapview.c
copyroot: 15280 /trunk

id: n4.5ck.r15410/384062
type: file
pred: n4.5ck.r15402/25285
count: 24
text: 15410 332443 1580 7274 5facaebe3bac7904f4f2497beb4ebee2
props: 10144 10256 111 0 4b4193808cb95e702a5e5065e4345324
cpath: /trunk/client/gui-stub/gui_main.c
copyroot: 15280 /trunk

id: mt.5ck.r15410/384319
type: file
pred: mt.5bk.r14427/320726
count: 16
text: 15410 123527 3271 3257 18aa124a26793d17a9867346589fb27b
props: 10804 25736 111 0 28e613ef70fc8e4efe7ed7b15f74e6e7
cpath: /trunk/client/gui-stub/connectdlg.c
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 24
file mj.5ck.r15407/47517
K 8
canvas.c
V 25
file 2y0.5bk.r15074/29613
K 8
canvas.h
V 23
file 2y1.0.r10095/12720
K 10
chatline.c
V 21
file ml.0.r7930/39139
K 10
chatline.h
V 21
file mm.0.r5491/41569
K 9
citydlg.c
V 25
file mn.5bk.r13949/170892
K 9
citydlg.h
V 21
file mo.0.r5491/35843
K 9
cityrep.c
V 22
file mp.0.r10144/11456
K 9
cityrep.h
V 21
file mq.0.r5491/46587
K 8
colors.c
V 22
file mr.0.r10458/11165
K 8
colors.h
V 22
file ms.0.r10458/11524
K 12
connectdlg.c
V 25
file mt.5ck.r15410/384319
K 12
connectdlg.h
V 21
file mu.0.r5491/46943
K 9
dialogs.c
V 24
file mv.5bk.r13745/46009
K 9
dialogs.h
V 20
file mw.0.r8956/1107
K 10
diplodlg.c
V 21
file mx.0.r10144/8226
K 10
diplodlg.h
V 21
file my.0.r5491/35128
K 9
finddlg.c
V 21
file mz.0.r5491/37629
K 9
finddlg.h
V 22
file 2dc.0.r5989/44093
K 9
gotodlg.c
V 25
file n0.5ck.r15410/383554
K 9
gotodlg.h
V 21
file n1.0.r5491/35486
K 10
graphics.c
V 22
file n2.0.r10141/65831
K 10
graphics.h
V 21
file n3.0.r5491/36199
K 10
gui_main.c
V 25
file n4.5ck.r15410/384062
K 10
gui_main.h
V 21
file n5.0.r5491/41925
K 9
helpdlg.c
V 21
file n6.0.r10144/9660
K 9
helpdlg.h
V 21
file n7.0.r5491/39423
K 10
inteldlg.c
V 21
file n8.0.r7847/24779
K 10
inteldlg.h
V 22
file 2dd.0.r5989/43421
K 9
mapctrl.c
V 21
file n9.0.r7018/49625
K 9
mapctrl.h
V 21
file na.0.r5491/37272
K 9
mapview.c
V 25
file nb.5ck.r15410/383805
K 9
mapview.h
V 21
file nc.0.r5491/38349
K 6
menu.c
V 22
file nd.0.r10144/11100
K 6
menu.h
V 21
file ne.0.r5491/43723
K 12
messagedlg.c
V 21
file nf.0.r5491/44434
K 12
messagedlg.h
V 22
file 2de.0.r5989/44428
K 12
messagewin.c
V 21
file ng.0.r9098/29017
K 12
messagewin.h
V 21
file nh.0.r5491/43363
K 7
pages.c
V 22
file 2qi.0.r11749/2340
K 7
pages.h
V 22
file 2qj.0.r8639/28697
K 8
plrdlg.c
V 21
file ni.0.r9098/28662
K 8
plrdlg.h
V 21
file nj.0.r5491/41213
K 10
ratesdlg.c
V 21
file nk.0.r5491/36557
K 10
ratesdlg.h
V 22
file 2df.0.r5989/43757
K 10
repodlgs.c
V 22
file nl.0.r10144/10019
K 10
repodlgs.h
V 21
file nm.0.r5491/40138
K 14
spaceshipdlg.c
V 21
file nn.0.r5491/42999
K 14
spaceshipdlg.h
V 21
file no.0.r5491/44796
K 8
sprite.c
V 22
file 2y2.0.r11749/1632
K 8
sprite.h
V 23
file 2y3.0.r10095/12384
K 8
themes.c
V 23
file 34y.0.r10945/24922
K 7
wldlg.c
V 21
file qj.0.r5491/44077
K 7
wldlg.h
V 21
file qk.0.r5491/45158
END
ENDREP
id: mh.5ck.r15410/386902
type: dir
pred: mh.5ck.r15407/50091
count: 145
text: 15410 384579 2310 2310 d006b2b4b4e60d214d93d765a7f312e1
props: 11108 13796 68 0 fbaef5f6348d6ae4b0cc177104ca4ad2
cpath: /trunk/client/gui-stub
copyroot: 15280 /trunk

id: hc.5ck.r15410/387147
type: file
pred: hc.5bk.r15174/20536
count: 125
text: 15410 287115 151 15419 b627e383ce9db4fe9c4b55c34e05565d
props: 10997 68 112 0 8869376353a720fe76c0d512d1b8c326
cpath: /trunk/client/clinet.c
copyroot: 15280 /trunk

id: z2.5ck.r15410/387391
type: file
pred: z2.5ck.r15296/93134
count: 274
text: 15410 287294 100 94423 9ac8d434b55b9619503d99273f461d68
props: 11084 12552 112 0 73ff9df0f3aabd6f615c7264c2fe22c7
cpath: /trunk/client/mapview_common.c
copyroot: 15280 /trunk

id: 2f.5cp.r15410/387646
type: file
pred: 2f.5cp.r15407/50483
count: 269
text: 15410 287424 80 27193 22ec0dc70b19c97f7242bf1ea390dcc3
props: 15407 50334 136 0 d530209ca649bf20b5cecaa6957aa1ef
cpath: /trunk/client/client_main.c
copyroot: 15407 /trunk/client/client_main.c

id: d5.5ck.r15410/387918
type: file
pred: d5.5ck.r15284/46944
count: 195
text: 15410 287694 150 35797 c7d0ed31c0305e878cfcbd74ff57a45c
props: 11057 49717 112 0 a13a5521476fb3b00a5e0433e6f85ac7
cpath: /trunk/client/climisc.c
copyroot: 15280 /trunk

id: 3bg.5ck.r15410/388166
type: file
pred: 3bg.5ck.r15401/11456
count: 32
text: 15410 289089 43078 53540 4a248022c42ddb01f7fb48996c8a8eed
props: 12670 125674 34 0 25e6c2f7558b7484000d4d090dea5b92
cpath: /trunk/client/editor.c
copyroot: 15280 /trunk

id: 33x.5ck.r15410/388416
type: file
pred: 33x.5ck.r15304/13257
count: 25
text: 15410 334049 94 25389 12c1b18d8b2d9a2b5ac5cc6477748c4b
props: 11101 62 110 0 fdfdab56f53d2388a66f6a5ce0985f95
cpath: /trunk/client/servers.c
copyroot: 15280 /trunk

id: dc.5ck.r15410/388661
type: file
pred: dc.5ck.r15285/6369
count: 168
text: 15410 334172 1688 31179 7ad73ba0922222b2c9295c4604db061d
props: 10965 83 112 0 b4bb2e29c9087472d2e44c6eab39b6d6
cpath: /trunk/client/options.c
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 24
file 5f.5ck.r15407/51160
K 6
agents
V 24
dir zf.5ck.r15410/337098
K 11
attribute.c
V 25
file xh.5ck.r15410/382550
K 11
attribute.h
V 19
file xi.0.r4715/844
K 7
audio.c
V 27
file 139.5bk.r14370/4417393
K 7
audio.h
V 22
file 13a.0.r10416/6162
K 12
audio_none.c
V 23
file 13d.0.r6129/145164
K 12
audio_none.h
V 22
file 13e.0.r4452/27228
K 11
audio_sdl.c
V 27
file 13f.5bk.r14377/2306692
K 11
audio_sdl.h
V 22
file 13g.0.r4452/26570
K 17
chatline_common.c
V 26
file 14q.5ck.r15410/382294
K 17
chatline_common.h
V 25
file 14r.5bk.r14775/22153
K 16
citydlg_common.c
V 25
file z4.5ck.r15410/337587
K 16
citydlg_common.h
V 24
file z5.5bk.r13912/41313
K 13
cityrepdata.c
V 21
file mb.5bk.r14714/94
K 13
cityrepdata.h
V 21
file mc.0.r9153/21475
K 11
civclient.c
V 23
file 4f2.5ck.r15408/695
K 13
client_main.c
V 25
file 2f.5cp.r15410/387646
K 13
client_main.h
V 24
file hz.5cq.r15407/50895
K 8
climap.c
V 26
file 197.5ck.r15410/382800
K 8
climap.h
V 25
file 198.5bk.r13917/12934
K 9
climisc.c
V 25
file d5.5ck.r15410/387918
K 9
climisc.h
V 23
file i0.0.r13297/489637
K 8
clinet.c
V 25
file hc.5ck.r15410/387147
K 8
clinet.h
V 25
file i1.5bk.r14427/324634
K 15
colors_common.c
V 25
file 33a.5bk.r14777/43029
K 15
colors_common.h
V 25
file 33b.5bk.r14777/43294
K 19
connectdlg_common.c
V 26
file 2fw.5ck.r15410/382038
K 19
connectdlg_common.h
V 26
file 2fx.5bk.r14209/198288
K 9
control.c
V 25
file gz.5ck.r15410/338097
K 9
control.h
V 24
file i2.5bk.r15200/34275
K 8
editor.c
V 26
file 3bg.5ck.r15410/388166
K 8
editor.h
V 25
file 3bh.5ck.r15355/75368
K 11
ggzclient.c
V 24
file 394.0.r12670/122138
K 11
ggzclient.h
V 24
file 395.0.r12670/122419
K 6
goto.c
V 25
file vu.5ck.r15410/365406
K 6
goto.h
V 24
file vv.5bk.r13900/41957
K 8
gui-ftwl
V 25
dir 2k2.5ck.r15410/381543
K 11
gui-gtk-2.0
V 24
dir zs.5ck.r15410/347783
K 7
gui-sdl
V 25
dir 16t.5ck.r15410/376691
K 8
gui-stub
V 24
dir mh.5ck.r15410/386902
K 9
gui-win32
V 24
dir np.5ck.r15410/365160
K 7
gui-xaw
V 24
dir 9o.5ck.r15410/357221
K 10
helpdata.c
V 25
file h1.5ck.r15410/381790
K 10
helpdata.h
V 25
file i3.5bk.r14417/261925
K 7
include
V 24
dir b8.5ck.r15307/107511
K 16
mapctrl_common.c
V 26
file 15m.5ck.r15410/383297
K 16
mapctrl_common.h
V 23
file 15n.0.r11378/41712
K 16
mapview_common.c
V 25
file z2.5ck.r15410/387391
K 16
mapview_common.h
V 24
file z3.5bk.r15200/41479
K 19
messagewin_common.c
V 26
file 14s.5ck.r15410/377192
K 19
messagewin_common.h
V 24
file 14t.0.r13297/482271
K 9
options.c
V 25
file dc.5ck.r15410/388661
K 9
options.h
V 23
file i4.5ck.r15285/5644
K 17
overview_common.c
V 26
file 2yk.5ck.r15410/337841
K 17
overview_common.h
V 24
file 2yl.5bk.r15036/1721
K 10
packhand.c
V 24
file n.5ck.r15410/365652
K 10
packhand.h
V 24
file i5.5bk.r14422/90154
K 15
plrdlg_common.c
V 26
file 14u.5ck.r15410/376937
K 15
plrdlg_common.h
V 26
file 14v.5bk.r14417/257761
K 17
repodlgs_common.c
V 26
file 11i.5ck.r15410/348280
K 17
repodlgs_common.h
V 25
file 11j.5bk.r14162/22062
K 9
reqtree.c
V 26
file 2ym.5ck.r15410/337339
K 9
reqtree.h
V 23
file 2yn.0.r13481/22674
K 9
servers.c
V 26
file 33x.5ck.r15410/388416
K 9
servers.h
V 27
file 33y.5bk.r14377/2285674
K 6
text.c
V 26
file 2g3.5ck.r15410/348032
K 6
text.h
V 24
file 2g4.5bk.r14284/8380
K 15
themes_common.c
V 23
file 352.0.r13227/35243
K 15
themes_common.h
V 23
file 353.0.r13227/35479
K 10
tilespec.c
V 25
file hl.5ck.r15410/383048
K 10
tilespec.h
V 24
file i6.5ck.r15354/29248
END
ENDREP
id: d.5ck.r15410/392346
type: dir
pred: d.5ck.r15408/4256
count: 4427
text: 15410 388906 3427 3427 1bbbd9698a2c32cea980ac9c37af4c2a
props: 12883 2898 109 0 732f4656541fb514e4368d9517bdf317
cpath: /trunk/client
copyroot: 15280 /trunk

PLAIN
K 9
ABOUT-NLS
V 22
file fu.0.r13215/85704
K 7
AUTHORS
V 19
file 5u.0.r12982/94
K 7
COPYING
V 19
file 1h.0.r9643/400
K 9
ChangeLog
V 23
file 6l.5bk.r13891/2383
K 7
INSTALL
V 21
file 6.5bk.r14672/184
K 11
Makefile.am
V 23
file 59.5bk.r14918/1267
K 4
NEWS
V 22
file 6m.5bk.r13824/202
K 6
README
V 20
file 7.0.r4421/96382
K 2
ai
V 22
dir 8.5ck.r15407/15440
K 10
autogen.sh
V 22
file 12o.5ck.r15409/50
K 9
bootstrap
V 23
dir 2p5.5bk.r14968/1617
K 6
client
V 23
dir d.5ck.r15410/392346
K 6
common
V 22
dir p.5ck.r15407/13203
K 12
config.mac.h
V 20
file hb.0.r6045/5982
K 12
configure.ac
V 25
file 149.5ck.r15407/15669
K 4
data
V 22
dir w.5ck.r15392/11814
K 6
debian
V 20
dir 5w.0.r13441/7348
K 12
dependencies
V 22
dir 2yu.5ck.r15306/181
K 11
diff_ignore
V 19
file qq.0.r13200/42
K 3
doc
V 23
dir k7.5bk.r15200/25150
K 2
m4
V 23
dir 12p.5ck.r15407/8595
K 6
manual
V 24
dir 2m2.5ck.r15407/27128
K 2
po
V 23
dir fs.5ck.r15393/17396
K 7
scripts
V 23
dir 2yo.5bk.r14810/1300
K 6
server
V 22
dir z.5ck.r15407/26304
K 10
stamp-h.in
V 19
file 80.0.r1125/241
K 5
tests
V 21
dir 2g9.0.r13445/1146
K 7
utility
V 23
dir 1c.5ck.r15407/20003
K 10
version.in
V 24
file 2lo.5ck.r15388/8334
K 3
vms
V 21
dir u9.0.r11105/70719
K 5
win32
V 24
dir 2eu.5bk.r13732/30345
END
ENDREP
id: 3.5ck.r15410/393841
type: dir
pred: 3.5ck.r15409/1539
count: 11965
text: 15410 392580 1248 1248 c0775e87e8fa793b8d108fab65c0ef76
props: 11109 0 255 0 8cbc80e0da9c47b05b8ffee17ea9b0f1
cpath: /trunk
copyroot: 15280 /trunk

PLAIN
K 8
branches
V 19
dir 1.0.r15397/6413
K 4
tags
V 19
dir 2.0.r15347/4951
K 5
trunk
V 23
dir 3.5ck.r15410/393841
K 7
website
V 18
dir 3ge.0.r12388/0
END
ENDREP
id: 0.0.r15410/394230
type: dir
pred: 0.0.r15409/1921
count: 15410
text: 15410 394066 151 151 095da391708241c068e5b6603365ed01
cpath: /
copyroot: 0 /

14q.5ck.t15409-1 modify true false /trunk/client/chatline_common.c

9y.5ck.t15409-1 modify true false /trunk/client/gui-xaw/cityrep.c

ay.5ck.t15409-1 modify true false /trunk/client/gui-xaw/repodlgs.c

xh.5ck.t15409-1 modify true false /trunk/client/attribute.c

zy.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/citydlg.c

10e.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/gotodlg.c

a6.5ck.t15409-1 modify true false /trunk/client/gui-xaw/dialogs.c

xs.5ck.t15409-1 modify true false /trunk/client/gui-win32/connectdlg.c

197.5ck.t15409-1 modify true false /trunk/client/climap.c

aw.5ck.t15409-1 modify true false /trunk/client/gui-xaw/plrdlg.c

hl.5ck.t15409-1 modify true false /trunk/client/tilespec.c

37p.5ck.t15409-1 modify true false /trunk/client/gui-xaw/diplomat_dialog.c

bm.5ck.t15409-1 modify true false /trunk/client/gui-xaw/gui_main.c

18m.5ck.t15409-1 modify true false /trunk/client/gui-sdl/spaceshipdlg.c

15m.5ck.t15409-1 modify true false /trunk/client/mapctrl_common.c

10x.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/mapview.c

18q.5ck.t15409-1 modify true false /trunk/client/gui-sdl/wldlg.c

hc.5ck.t15409-1 modify true false /trunk/client/clinet.c

z2.5ck.t15409-1 modify true false /trunk/client/mapview_common.c

2f.5cp.t15409-1 modify true false /trunk/client/client_main.c

118.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/repodlgs.c

d5.5ck.t15409-1 modify true false /trunk/client/climisc.c

xm.5ck.t15409-1 modify true false /trunk/client/gui-win32/citydlg.c

xz.5ck.t15409-1 modify true false /trunk/client/gui-win32/gotodlg.c

aj.5ck.t15409-1 modify true false /trunk/client/gui-xaw/mapctrl.c

178.5ck.t15409-1 modify true false /trunk/client/gui-sdl/connectdlg.c

an.5ck.t15409-1 modify true false /trunk/client/gui-xaw/menu.c

3bg.5ck.t15409-1 modify true false /trunk/client/editor.c

2kr.5ck.t15409-1 modify true false /trunk/client/gui-ftwl/gui_main.c

n4.5ck.t15409-1 modify true false /trunk/client/gui-stub/gui_main.c

33x.5ck.t15409-1 modify true false /trunk/client/servers.c

dc.5ck.t15409-1 modify true false /trunk/client/options.c

10k.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/gui_main.c

ye.5ck.t15409-1 modify true false /trunk/client/gui-win32/mapview.c

n0.5ck.t15409-1 modify true false /trunk/client/gui-stub/gotodlg.c

4ej.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/editgui.c

376.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/caravan_dialog.c

af.5ck.t15409-1 modify true false /trunk/client/gui-xaw/helpdlg.c

a4.5ck.t15409-1 modify true false /trunk/client/gui-xaw/connectdlg.c

yq.5ck.t15409-1 modify true false /trunk/client/gui-win32/repodlgs.c

2pi.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/pages.c

170.5ck.t15409-1 modify true false /trunk/client/gui-sdl/citydlg.c

17f.5ck.t15409-1 modify true false /trunk/client/gui-sdl/gotodlg.c

18d.5ck.t15409-1 modify true false /trunk/client/gui-sdl/optiondlg.c

2ym.5ck.t15409-1 modify true false /trunk/client/reqtree.c

nb.5ck.t15409-1 modify true false /trunk/client/gui-stub/mapview.c

z4.5ck.t15409-1 modify true false /trunk/client/citydlg_common.c

10z.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/menu.c

y3.5ck.t15409-1 modify true false /trunk/client/gui-win32/gui_main.c

186.5ck.t15409-1 modify true false /trunk/client/gui-sdl/mapview.c

102.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/cma_fe.c

2yk.5ck.t15409-1 modify true false /trunk/client/overview_common.c

mt.5ck.t15409-1 modify true false /trunk/client/gui-stub/connectdlg.c

a8.5ck.t15409-1 modify true false /trunk/client/gui-xaw/diplodlg.c

191.5ck.t15409-1 modify true false /trunk/client/gui-sdl/gui_tilespec.c

gz.5ck.t15409-1 modify true false /trunk/client/control.c

2qm.5ck.t15409-1 modify true false /trunk/client/gui-xaw/pages.c

ad.5ck.t15409-1 modify true false /trunk/client/gui-xaw/graphics.c

18i.5ck.t15409-1 modify true false /trunk/client/gui-sdl/repodlgs.c

100.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/cityrep.c

ai.5ck.t15409-1 modify true false /trunk/client/gui-xaw/inteldlg.c

2g3.5ck.t15409-1 modify true false /trunk/client/text.c

2mr.5ck.t15409-1 modify true false /trunk/client/gui-ftwl/gui_text.c

108.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/dialogs.c

ax.5ck.t15409-1 modify true false /trunk/client/gui-xaw/ratesdlg.c

11i.5ck.t15409-1 modify true false /trunk/client/repodlgs_common.c

yg.5ck.t15409-1 modify true false /trunk/client/gui-win32/menu.c

zj.5ck.t15409-1 modify true false /trunk/client/agents/cma_core.c

36n.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/diplomat_dialog.c

17o.5ck.t15409-1 modify true false /trunk/client/gui-sdl/gui_main.c

2kn.5ck.t15409-1 modify true false /trunk/client/gui-ftwl/gotodlg.c

2fu.5ck.t15409-1 modify true false /trunk/client/gui-win32/cma_fe.c

3bp.5ck.t15409-1 modify true false /trunk/client/gui-sdl/caravan_dialog.c

10a.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/diplodlg.c

xo.5ck.t15409-1 modify true false /trunk/client/gui-win32/cityrep.c

xu.5ck.t15409-1 modify true false /trunk/client/gui-win32/dialogs.c

2kz.5ck.t15409-1 modify true false /trunk/client/gui-ftwl/mapview.c

10u.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/inteldlg.c

10v.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/mapctrl.c

vu.5ck.t15409-1 modify true false /trunk/client/goto.c

188.5ck.t15409-1 modify true false /trunk/client/gui-sdl/menu.c

n.5ck.t15409-1 modify true false /trunk/client/packhand.c

174.5ck.t15409-1 modify true false /trunk/client/gui-sdl/cma_fe.c

ab.5ck.t15409-1 modify true false /trunk/client/gui-xaw/gotodlg.c

9w.5ck.t15409-1 modify true false /trunk/client/gui-xaw/citydlg.c

nt.5ck.t15409-1 modify true false /trunk/client/gui-xaw/actions.c

390.5ck.t15409-1 modify true false /trunk/client/gui-sdl/themespec.c

xw.5ck.t15409-1 modify true false /trunk/client/gui-win32/diplodlg.c

10q.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/helpdlg.c

172.5ck.t15409-1 modify true false /trunk/client/gui-sdl/cityrep.c

yc.5ck.t15409-1 modify true false /trunk/client/gui-win32/mapctrl.c

yb.5ck.t15409-1 modify true false /trunk/client/gui-win32/inteldlg.c

17a.5ck.t15409-1 modify true false /trunk/client/gui-sdl/dialogs.c

b2.5ck.t15409-1 modify true false /trunk/client/gui-xaw/spaceshipdlg.c

115.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/plrdlg.c

al.5ck.t15409-1 modify true false /trunk/client/gui-xaw/mapview.c

yp.5ck.t15409-1 modify true false /trunk/client/gui-win32/ratesdlg.c

4el.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/editprop.c

2ei.5ck.t15409-1 modify true false /trunk/client/gui-xaw/cma_fe.c

3bn.5ck.t15409-1 modify true false /trunk/client/gui-sdl/diplomat_dialog.c

14u.5ck.t15409-1 modify true false /trunk/client/plrdlg_common.c

17c.5ck.t15409-1 modify true false /trunk/client/gui-sdl/diplodlg.c

zh.5ck.t15409-1 modify true false /trunk/client/agents/agents.c

y7.5ck.t15409-1 modify true false /trunk/client/gui-win32/helpdlg.c

184.5ck.t15409-1 modify true false /trunk/client/gui-sdl/mapctrl.c

183.5ck.t15409-1 modify true false /trunk/client/gui-sdl/inteldlg.c

yn.5ck.t15409-1 modify true false /trunk/client/gui-win32/plrdlg.c

11c.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/spaceshipdlg.c

14s.5ck.t15409-1 modify true false /trunk/client/messagewin_common.c

xk.5ck.t15409-1 modify true false /trunk/client/gui-win32/chatline.c

11e.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/wldlg.c

2kf.5ck.t15409-1 modify true false /trunk/client/gui-ftwl/connectdlg.c

2kh.5ck.t15409-1 modify true false /trunk/client/gui-ftwl/dialogs.c

h1.5ck.t15409-1 modify true false /trunk/client/helpdata.c

17z.5ck.t15409-1 modify true false /trunk/client/gui-sdl/helpdlg.c

106.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/connectdlg.c

10d.5ck.t15409-1 modify true false /trunk/client/gui-gtk-2.0/gamedlgs.c

18f.5ck.t15409-1 modify true false /trunk/client/gui-sdl/plrdlg.c

2fw.5ck.t15409-1 modify true false /trunk/client/connectdlg_common.c

yt.5ck.t15409-1 modify true false /trunk/client/gui-win32/spaceshipdlg.c

o5.5ck.t15409-1 modify true false /trunk/client/gui-xaw/wldlg.c

16y.5ck.t15409-1 modify true false /trunk/client/gui-sdl/chatline.c

yv.5ck.t15409-1 modify true false /trunk/client/gui-win32/wldlg.c


394230 394381
