JSON protocol: fix field_addr memory leak.
[freeciv.git] / client / gui-stub / dialogs.c
blob61ae299fe1b22873442c27f82c34e0d27db1aed1
1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 ***********************************************************************/
14 #ifdef HAVE_CONFIG_H
15 #include <fc_config.h>
16 #endif
18 /* common */
19 #include "game.h"
20 #include "government.h"
22 /* gui main header */
23 #include "gui_stub.h"
25 #include "dialogs.h"
27 /**************************************************************************
28 Popup a dialog to display information about an event that has a
29 specific location. The user should be given the option to goto that
30 location.
31 **************************************************************************/
32 void popup_notify_goto_dialog(const char *headline, const char *lines,
33 const struct text_tag_list *tags,
34 struct tile *ptile)
36 /* PORTME */
39 /**************************************************************************
40 Popup a dialog to display connection message from server.
41 **************************************************************************/
42 void popup_connect_msg(const char *headline, const char *message)
44 /* PORTME */
47 /**************************************************************************
48 Popup a generic dialog to display some generic information.
49 **************************************************************************/
50 void popup_notify_dialog(const char *caption, const char *headline,
51 const char *lines)
53 /* PORTME */
56 /**************************************************************************
57 Popup the nation selection dialog.
58 **************************************************************************/
59 void popup_races_dialog(struct player *pplayer)
61 /* PORTME */
64 /**************************************************************************
65 Close the nation selection dialog. This should allow the user to
66 (at least) select a unit to activate.
67 **************************************************************************/
68 void popdown_races_dialog(void)
70 /* PORTME */
73 /**************************************************************************
74 Popup a dialog window to select units on a particular tile.
75 **************************************************************************/
76 void unit_select_dialog_popup(struct tile *ptile)
78 /* PORTME */
81 /**************************************************************************
82 Update the dialog window to select units on a particular tile.
83 **************************************************************************/
84 void unit_select_dialog_update_real(void)
86 /* PORTME */
89 /**************************************************************************
90 The server has changed the set of selectable nations.
91 **************************************************************************/
92 void races_update_pickable(bool nationset_change)
94 /* PORTME */
97 /**************************************************************************
98 In the nation selection dialog, make already-taken nations unavailable.
99 This information is contained in the packet_nations_used packet.
100 **************************************************************************/
101 void races_toggles_set_sensitive(void)
103 /* PORTME */
106 /**************************************************************************
107 Popup a dialog asking if the player wants to start a revolution.
108 **************************************************************************/
109 void popup_revolution_dialog(void)
111 /* PORTME */
114 /**************************************************************************
115 Popup a dialog that allows the player to select what action a unit
116 should take.
117 **************************************************************************/
118 void popup_action_selection(struct unit *actor_unit,
119 struct city *target_city,
120 struct unit *target_unit,
121 struct tile *target_tile,
122 const struct act_prob *act_probs)
124 /* PORTME */
127 /**************************************************************************
128 Popup a window asking a diplomatic unit if it wishes to incite the
129 given enemy city.
130 **************************************************************************/
131 void popup_incite_dialog(struct unit *actor, struct city *pcity, int cost)
133 /* PORTME */
136 /**************************************************************************
137 Popup a dialog asking a diplomatic unit if it wishes to bribe the
138 given enemy unit.
139 **************************************************************************/
140 void popup_bribe_dialog(struct unit *actor, struct unit *punit, int cost)
142 /* PORTME */
145 /**************************************************************************
146 Popup a dialog asking a diplomatic unit if it wishes to sabotage the
147 given enemy city.
148 **************************************************************************/
149 void popup_sabotage_dialog(struct unit *actor, struct city *pcity)
151 /* PORTME */
154 /**************************************************************************
155 Popup a dialog asking the unit which improvement they would like to
156 pillage.
157 **************************************************************************/
158 void popup_pillage_dialog(struct unit *punit, bv_extras may_pillage)
160 /* PORTME */
163 /****************************************************************************
164 Pops up a dialog to confirm disband of the unit(s).
165 ****************************************************************************/
166 void popup_disband_dialog(struct unit_list *punits)
168 /* PORTME */
171 /**************************************************************************
172 Ruleset (modpack) has suggested loading certain tileset. Confirm from
173 user and load.
174 **************************************************************************/
175 void popup_tileset_suggestion_dialog(void)
177 /* PORTME */
180 /****************************************************************
181 Ruleset (modpack) has suggested loading certain soundset. Confirm from
182 user and load.
183 *****************************************************************/
184 void popup_soundset_suggestion_dialog(void)
186 /* PORTME */
189 /****************************************************************
190 Ruleset (modpack) has suggested loading certain musicset. Confirm from
191 user and load.
192 *****************************************************************/
193 void popup_musicset_suggestion_dialog(void)
195 /* PORTME */
198 /**************************************************************************
199 Tileset (modpack) has suggested loading certain theme. Confirm from
200 user and load.
201 **************************************************************************/
202 bool popup_theme_suggestion_dialog(const char *theme_name)
204 /* PORTME */
205 return FALSE;
208 /**************************************************************************
209 This function is called when the client disconnects or the game is
210 over. It should close all dialog windows for that game.
211 **************************************************************************/
212 void popdown_all_game_dialogs(void)
214 /* PORTME */
217 /**************************************************************************
218 Returns the id of the actor unit currently handled in action selection
219 dialog when the action selection dialog is open.
220 Returns IDENTITY_NUMBER_ZERO if no action selection dialog is open.
221 **************************************************************************/
222 int action_selection_actor_unit(void)
224 /* PORTME */
225 return IDENTITY_NUMBER_ZERO;
228 /**************************************************************************
229 Returns id of the target city of the actions currently handled in action
230 selection dialog when the action selection dialog is open and it has a
231 city target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog
232 is open or no city target is present in the action selection dialog.
233 **************************************************************************/
234 int action_selection_target_city(void)
236 /* PORTME */
237 return IDENTITY_NUMBER_ZERO;
240 /**************************************************************************
241 Returns id of the target unit of the actions currently handled in action
242 selection dialog when the action selection dialog is open and it has a
243 unit target. Returns IDENTITY_NUMBER_ZERO if no action selection dialog
244 is open or no unit target is present in the action selection dialog.
245 **************************************************************************/
246 int action_selection_target_unit(void)
248 /* PORTME */
249 return IDENTITY_NUMBER_ZERO;
252 /**************************************************************************
253 Updates the action selection dialog with new information.
254 **************************************************************************/
255 void action_selection_refresh(struct unit *actor_unit,
256 struct city *target_city,
257 struct unit *target_unit,
258 struct tile *target_tile,
259 const struct act_prob *act_probs)
261 /* TODO: port me. */
264 /****************************************************************
265 Closes the action selection dialog
266 ****************************************************************/
267 void action_selection_close(void)
269 /* PORTME */
272 /****************************************************************
273 Player has gained a new tech.
274 *****************************************************************/
275 void show_tech_gained_dialog(Tech_type_id tech)
277 /* PORTME */
280 /****************************************************************
281 Show tileset error dialog.
282 *****************************************************************/
283 void show_tileset_error(const char *msg)
285 /* PORTME */
288 /****************************************************************
289 Give a warning when user is about to edit scenario with manually
290 set properties.
291 *****************************************************************/
292 bool gui_handmade_scenario_warning(void)
294 /* Just tell the client common code to handle this. */
295 return FALSE;
298 /****************************************************************
299 Unit wants to get into some transport on given tile.
300 *****************************************************************/
301 bool gui_request_transport(struct unit *pcargo, struct tile *ptile)
303 return FALSE; /* Unit was not handled here. */
306 /***************************************************************************
307 Popup detailed information about battle or save information for
308 some kind of statistics
309 ***************************************************************************/
310 void gui_popup_combat_info(int attacker_unit_id, int defender_unit_id,
311 int attacker_hp, int defender_hp,
312 bool make_winner_veteran)