21#include <gdk/gdkkeysyms.h>
68 const struct city *pcity,
80 GCallback edit_callback,
81 gpointer callback_userdata);
88#define SPECHASH_TAG stored_tag
89#define SPECHASH_INT_KEY_TYPE
90#define SPECHASH_INT_DATA_TYPE
117#define PF_MAX_CLAUSES 16
118#define PF_DISJUNCTION_SEPARATOR "|"
119#define PF_CONJUNCTION_SEPARATOR "&"
266#define SPECHASH_TAG propstate
267#define SPECHASH_INT_KEY_TYPE
268#define SPECHASH_IDATA_TYPE struct propstate *
269#define SPECHASH_IDATA_FREE propstate_destroy
424 GtkTreeViewColumn *col);
431 const char *widget_name,
434 const char *widget_name);
446#define SPECHASH_TAG objprop
447#define SPECHASH_INT_KEY_TYPE
448#define SPECHASH_IDATA_TYPE struct objprop *
460 GtkTreeRowReference *
rowref;
497 GtkTreeRowReference *rr);
500#define SPECHASH_TAG objbind
501#define SPECHASH_INT_KEY_TYPE
502#define SPECHASH_IDATA_TYPE struct objbind *
503#define SPECHASH_IDATA_FREE objbind_destroy
571 const struct tile_list *tiles);
573 const struct tile *ptile);
577 gpointer object_data);
590 gboolean currently_selected,
601 struct tile_list *hint_tiles);
611 int tag,
int object_id);
632#define property_page_objprop_iterate(ARG_pp, NAME_op) \
633 TYPED_HASH_DATA_ITERATE(struct objprop *, (ARG_pp)->objprop_table, NAME_op)
634#define property_page_objprop_iterate_end HASH_DATA_ITERATE_END
636#define property_page_objbind_iterate(ARG_pp, NAME_ob) \
637 TYPED_HASH_DATA_ITERATE(struct objbind *, (ARG_pp)->objbind_table, NAME_ob)
638#define property_page_objbind_iterate_end HASH_DATA_ITERATE_END
670 return _(
"Start Position");
678 return Q_(
"?play:Game");
683 log_error(
"%s() Unhandled request to get name of object type %d.",
702 return ((
struct unit *)
object)->id;
704 return ((
struct city *)
object)->id;
713 log_error(
"%s(): Unhandled request to get object ID from object %p of "
714 "type %d (%s).", __FUNCTION__,
object,
objtype,
742 log_error(
"%s(): Unhandled request to get object of type %d (%s) "
743 "with ID %d.", __FUNCTION__,
objtype,
768 log_error(
"%s(): Unhandled request for object type %d (%s)).",
790 return "struct built_status[B_LAST]";
792 return "bool[A_LAST]";
802 return "struct nation_hash";
806 return "struct tile_vision_data";
809 log_error(
"%s(): unhandled value type %d.", __FUNCTION__, valtype);
823 GCallback edit_callback,
826 GtkCellRenderer *cell;
827 GtkTreeViewColumn *col;
828 const char *attr = NULL;
830 if (gtype == G_TYPE_BOOLEAN) {
831 cell = gtk_cell_renderer_toggle_new();
832 gtk_cell_renderer_toggle_set_radio(GTK_CELL_RENDERER_TOGGLE(cell),
835 g_signal_connect(cell,
"toggled", edit_callback, userdata);
838 }
else if (gtype == GDK_TYPE_PIXBUF) {
839 cell = gtk_cell_renderer_pixbuf_new();
842 cell = gtk_cell_renderer_text_new();
844 g_object_set(cell,
"editable",
TRUE, NULL);
845 g_signal_connect(cell,
"edited", edit_callback, userdata);
850 col = gtk_tree_view_column_new_with_attributes(
name, cell,
852 gtk_tree_view_append_column(GTK_TREE_VIEW(
view), col);
870 return g_strdup_printf(
"%d", pv->
data.
v_int);
873 return g_strdup_printf(
"%s", pv->
data.
v_bool ?
_(
"TRUE") :
_(
"FALSE"));
887 int great_wonder_count = 0, small_wonder_count = 0, building_count = 0;
896 great_wonder_count++;
898 small_wonder_count++;
905 return g_strdup_printf(
_(
"%db %ds %dW"),
906 building_count, small_wonder_count,
917 return g_strdup_printf(
_(
"%d known"), count);
927 return g_strdup_printf(
_(
"%d present"), count);
937 return g_strdup_printf(
_(
"%d present"), count);
947 return g_strdup_printf(
_(
"%d present"), count);
952 return g_strdup(
_(
"All nations"));
954 return g_strdup_printf(
PL_(
"%d nation",
"%d nations",
961 return g_strdup_printf(
PL_(
"%d byte",
"%d bytes", count),
969 log_error(
"%s(): Unhandled value type %d for property value %p.",
970 __FUNCTION__, pv->
valtype, pv);
982 turn_built = bs->
turn;
986 return g_strdup(
_(
"(never)"));
989 return g_strdup(
_(
"(destroyed)"));
991 return g_strdup_printf(
"%d", turn_built);
1033 static int tag_series = 0;
1114 log_error(
"%s(): Unhandled value type %d for property value %p.",
1115 __FUNCTION__, pv->
valtype, pv);
1168 log_error(
"%s(): Unhandled request to free data %p (type %s).",
1214 if (vatb < 0 && vbtb < 0) {
1251 log_error(
"%s(): Unhandled value type %d for property values %p and %p.",
1252 __FUNCTION__, pva->
valtype, pva, pvb);
1342 if (
object == NULL) {
1427 log_error(
"%s(): Unhandled request to destroy object %p (ID %d) of type "
1462 if (NULL == ptile) {
1475 case OPID_TILE_ADDRESS:
1484 if (NULL != pterrain) {
1495 if (NULL != presource) {
1503 pv->
data.
v_string = g_strdup_printf(
"(%d, %d)", tile_x, tile_y);
1575 if (ptile->
label != NULL) {
1582 log_error(
"%s(): Unhandled request for value of property %d "
1583 "(%s) from object of type \"%s\".", __FUNCTION__,
1593 const struct tile *ptile;
1618 log_error(
"%s(): Unhandled request for value of property %d "
1619 "(%s) from object of type \"%s\".", __FUNCTION__,
1630 if (NULL ==
punit) {
1640 case OPID_UNIT_ADDRESS:
1685 log_error(
"%s(): Unhandled request for value of property %d "
1686 "(%s) from object of type \"%s\".", __FUNCTION__,
1697 if (NULL == pcity) {
1707 case OPID_CITY_ADDRESS:
1744 log_error(
"%s(): Unhandled request for value of property %d "
1745 "(%s) from object of type \"%s\".", __FUNCTION__,
1757 if (NULL == pplayer) {
1775 case OPID_PLAYER_ADDRESS:
1800 log_error(
"%s(): Unhandled request for value of property %d "
1801 "(%s) from object of type \"%s\".", __FUNCTION__,
1812 if (NULL == pgame) {
1848 log_error(
"%s(): Unhandled request for value of property %d "
1849 "(%s) from object of type \"%s\".", __FUNCTION__,
1860 log_error(
"%s(): Unhandled request for object type \"%s\" (nb %d).",
1896 if (NULL != pstep) {
1901 if (NULL != pbig_step) {
1917 log_error(
"%s(): Unhandled request for value range of property %d (%s) "
1918 "from object of type \"%s\".", __FUNCTION__,
1927 if (NULL ==
punit) {
1962 log_error(
"%s(): Unhandled request for value range of property %d (%s) "
1963 "from object of type \"%s\".", __FUNCTION__,
1971 if (NULL == pcity) {
2004 log_error(
"%s(): Unhandled request for value range of property %d (%s) "
2005 "from object of type \"%s\".", __FUNCTION__,
2026 log_error(
"%s(): Unhandled request for value range of property %d (%s) "
2027 "from object of type \"%s\".", __FUNCTION__,
2032 log_error(
"%s(): Unhandled request for value range of property %d (%s) "
2033 "from object of type \"%s\".", __FUNCTION__,
2041 log_error(
"%s(): Unhandled request for object type \"%s\" (nb %d).",
2114 struct propval *pv_old, *pv_copy;
2183 gtk_tree_row_reference_free(ob->
rowref);
2234 if (NULL == ptile) {
2260 if (NULL ==
punit) {
2283 if (NULL == pcity) {
2287 packet->
id32 = pcity->
id;
2292 for (i = 0; i <
B_LAST; i++) {
2308 if (NULL == pplayer) {
2333 if (NULL == pgame) {
2353 log_error(
"%s(): Unhandled object type %s (nb %d).", __FUNCTION__,
2432 log_error(
"%s(): Unhandled request to pack value of property "
2433 "%d (%s) from object of type \"%s\".", __FUNCTION__,
2455 log_error(
"%s(): Unhandled request to pack value of property "
2456 "%d (%s) from object of type \"%s\".", __FUNCTION__,
2490 log_error(
"%s(): Unhandled request to pack value of property "
2491 "%d (%s) from object of type \"%s\".", __FUNCTION__,
2519 for (i = 0; i <
B_LAST; i++) {
2528 log_error(
"%s(): Unhandled request to pack value of property "
2529 "%d (%s) from object of type \"%s\".", __FUNCTION__,
2565 log_error(
"%s(): Unhandled request to pack value of property "
2566 "%d (%s) from object of type \"%s\".", __FUNCTION__,
2609 log_error(
"%s(): Unhandled request to pack value of property "
2610 "%d (%s) from object of type \"%s\".", __FUNCTION__,
2618 log_error(
"%s(): Unhandled request for object type \"%s\" (nb %d).",
2627 GtkTreeRowReference *rr)
2676 return G_TYPE_STRING;
2684 return G_TYPE_STRING;
2688 return GDK_TYPE_PIXBUF;
2742 if (gtype == G_TYPE_INT || gtype == G_TYPE_STRING
2743 || gtype == G_TYPE_BOOLEAN) {
2745 }
else if (gtype == GDK_TYPE_PIXBUF) {
2783 GtkTreeViewColumn *col)
2832 GtkCellRenderer *cell = NULL;
2837 if (gtype == G_TYPE_INT || gtype == G_TYPE_STRING
2838 || gtype == G_TYPE_BOOLEAN) {
2839 cell = gtk_cell_renderer_text_new();
2840 }
else if (gtype == GDK_TYPE_PIXBUF) {
2841 cell = gtk_cell_renderer_pixbuf_new();
2858 return gtype == G_TYPE_INT || gtype == G_TYPE_STRING;
2884 value.
data.
v_const_string = gtk_entry_buffer_get_text(gtk_text_get_buffer(GTK_TEXT(text)));
2901 value.
data.
v_int = gtk_spin_button_get_value_as_int(spin);
2918 value.
data.
v_bool = gtk_toggle_button_get_active(button);
2928 GtkWidget *hbox, *hbox2, *label, *image, *text, *spin, *button;
2940 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
2944 gtk_widget_set_halign(label, GTK_ALIGN_START);
2945 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
2946 gtk_box_append(GTK_BOX(hbox), label);
2969 case OPID_TILE_ADDRESS:
2970 case OPID_UNIT_ADDRESS:
2971 case OPID_CITY_ADDRESS:
2972 case OPID_PLAYER_ADDRESS:
2974 label = gtk_label_new(NULL);
2975 gtk_widget_set_hexpand(label,
TRUE);
2976 gtk_widget_set_halign(label, GTK_ALIGN_START);
2977 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
2978 gtk_box_append(GTK_BOX(hbox), label);
2986 image = gtk_image_new();
2987 gtk_widget_set_size_request(image,
2990 gtk_widget_set_hexpand(image,
TRUE);
2991 gtk_widget_set_halign(image, GTK_ALIGN_START);
2992 gtk_widget_set_valign(image, GTK_ALIGN_CENTER);
2993 gtk_box_append(GTK_BOX(hbox), image);
3001 text = gtk_text_new();
3002 gtk_widget_set_hexpand(text,
TRUE);
3003 gtk_widget_set_halign(text, GTK_ALIGN_END);
3004 gtk_editable_set_width_chars(GTK_EDITABLE(text), 8);
3005 g_signal_connect(text,
"changed",
3007 gtk_box_append(GTK_BOX(hbox), text);
3017 spin = gtk_spin_button_new_with_range(0.0, 100.0, 1.0);
3018 gtk_widget_set_hexpand(spin,
TRUE);
3019 gtk_widget_set_halign(spin, GTK_ALIGN_END);
3020 g_signal_connect(spin,
"value-changed",
3022 gtk_box_append(GTK_BOX(hbox), spin);
3030 hbox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
3031 gtk_widget_set_hexpand(hbox2,
TRUE);
3032 gtk_widget_set_halign(hbox2, GTK_ALIGN_END);
3033 gtk_box_append(GTK_BOX(hbox), hbox2);
3034 spin = gtk_spin_button_new_with_range(0.0, 100.0, 1.0);
3035 g_signal_connect(spin,
"value-changed",
3037 gtk_box_append(GTK_BOX(hbox2), spin);
3039 label = gtk_label_new(NULL);
3040 gtk_widget_set_halign(label, GTK_ALIGN_START);
3041 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
3042 gtk_box_append(GTK_BOX(hbox2), label);
3077 button = gtk_toggle_button_new();
3078 gtk_widget_set_hexpand(button,
TRUE);
3079 gtk_widget_set_halign(button, GTK_ALIGN_END);
3080 g_signal_connect(button,
"toggled",
3083 gtk_box_append(GTK_BOX(hbox), button);
3088 log_error(
"%s(): Unhandled request to create widget for property %d (%s).",
3103 GtkWidget *w, *label, *image, *text, *spin, *button;
3108 double min, max,
step, big_step;
3110 const char *newtext;
3111 GtkEntryBuffer *buffer;
3131 if (pv && modified) {
3156 gtk_image_set_from_pixbuf(GTK_IMAGE(image), pv->
data.
v_pixbuf);
3158 gtk_image_set_from_pixbuf(GTK_IMAGE(image), NULL);
3170 case OPID_TILE_ADDRESS:
3171 case OPID_UNIT_ADDRESS:
3172 case OPID_CITY_ADDRESS:
3173 case OPID_PLAYER_ADDRESS:
3177 gtk_label_set_text(GTK_LABEL(label), pv->
data.
v_string);
3179 gtk_label_set_text(GTK_LABEL(label), NULL);
3197 gtk_label_set_text(GTK_LABEL(label), agebuf);
3199 gtk_label_set_text(GTK_LABEL(label), NULL);
3215 buffer = gtk_text_get_buffer(GTK_TEXT(text));
3219 if (strcmp(newtext, gtk_entry_buffer_get_text(buffer))) {
3220 gtk_entry_buffer_set_text(buffer, newtext, -1);
3222 gtk_widget_set_sensitive(text, pv != NULL);
3236 &
step, &big_step)) {
3237 gtk_spin_button_set_range(GTK_SPIN_BUTTON(spin), min, max);
3238 gtk_spin_button_set_increments(GTK_SPIN_BUTTON(spin),
3241 gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), pv->
data.
v_int);
3245 gtk_widget_set_sensitive(spin, pv != NULL);
3258 &
step, &big_step)) {
3259 gtk_spin_button_set_range(GTK_SPIN_BUTTON(spin), min, max);
3260 gtk_spin_button_set_increments(GTK_SPIN_BUTTON(spin),
3263 gtk_label_set_text(GTK_LABEL(label), buf);
3265 gtk_label_set_text(GTK_LABEL(label), NULL);
3267 gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin), pv->
data.
v_int);
3271 gtk_label_set_text(GTK_LABEL(label), NULL);
3273 gtk_widget_set_sensitive(spin, pv != NULL);
3311 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
3314 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
FALSE);
3318 gtk_widget_set_sensitive(button, pv != NULL);
3333 "<span foreground=\"red\">%s</span>",
name);
3334 gtk_label_set_markup(GTK_LABEL(label), namebuf);
3336 gtk_label_set_text(GTK_LABEL(label),
name);
3361 const char *widget_name,
3366 if (!op || !widget_name || !
widget) {
3372 log_error(
"Cannot store child widget %p under name "
3373 "\"%s\" using objprop_set_child_widget for object "
3374 "property %d (%s) because objprop_get_widget does "
3375 "not return a valid widget.",
3380 g_object_set_data(G_OBJECT(w), widget_name,
widget);
3388 const char *widget_name)
3390 GtkWidget *w, *child;
3392 if (!op || !widget_name) {
3398 log_error(
"Cannot retrieve child widget under name "
3399 "\"%s\" using objprop_get_child_widget for object "
3400 "property %d (%s) because objprop_get_widget does "
3401 "not return a valid widget.",
3406 child = g_object_get_data(G_OBJECT(w), widget_name);
3408 log_error(
"Child widget \"%s\" not found for object "
3409 "property %d (%s) via objprop_get_child_widget.",
3482 GtkWidget *hbox, *vbox, *label, *button, *scrollwin, *image;
3483 GtkWidget *
view = NULL;
3484 GtkTreeSelection *sel;
3485 GtkListStore *
store = NULL;
3486 GtkTextBuffer *
textbuf = NULL;
3512 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
3515 label = gtk_label_new(NULL);
3516 gtk_widget_set_halign(label, GTK_ALIGN_START);
3517 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
3518 gtk_box_append(GTK_BOX(hbox), label);
3524 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
3527 label = gtk_label_new(NULL);
3528 gtk_widget_set_halign(label, GTK_ALIGN_START);
3529 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
3530 gtk_box_append(GTK_BOX(vbox), label);
3533 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
3534 gtk_box_append(GTK_BOX(vbox), hbox);
3536 image = gtk_image_new();
3538 gtk_widget_set_size_request(image,
3543 gtk_widget_set_size_request(image, 100, 40);
3545 gtk_widget_set_halign(image, GTK_ALIGN_START);
3546 gtk_widget_set_valign(image, GTK_ALIGN_CENTER);
3547 gtk_box_append(GTK_BOX(hbox), image);
3552 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
3557 log_error(
"Unhandled request to create panel widget "
3558 "for property %d (%s) in extviewer_new().",
3560 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
3566 button = gtk_button_new_with_label(
Q_(
"?verb:View"));
3568 button = gtk_button_new_with_label(
_(
"Edit"));
3570 g_signal_connect(button,
"clicked",
3572 gtk_box_append(GTK_BOX(hbox), button);
3583 store = gtk_list_store_new(3, G_TYPE_BOOLEAN, G_TYPE_INT,
3587 num_cols = 3 + 1 + V_COUNT;
3588 gtypes =
fc_malloc(num_cols *
sizeof(GType));
3589 gtypes[0] = G_TYPE_INT;
3590 gtypes[1] = GDK_TYPE_PIXBUF;
3591 gtypes[2] = G_TYPE_STRING;
3592 gtypes[3] = G_TYPE_BOOLEAN;
3594 gtypes[4 + v] = G_TYPE_BOOLEAN;
3596 store = gtk_list_store_newv(num_cols, gtypes);
3600 store = gtk_list_store_new(4, G_TYPE_BOOLEAN, G_TYPE_INT,
3601 G_TYPE_STRING, G_TYPE_STRING);
3606 store = gtk_list_store_new(4, G_TYPE_BOOLEAN, G_TYPE_INT,
3607 GDK_TYPE_PIXBUF, G_TYPE_STRING);
3611 textbuf = gtk_text_buffer_new(NULL);
3614 log_error(
"Unhandled request to create data store "
3615 "for property %d (%s) in extviewer_new().",
3625 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
3629 gtk_widget_set_halign(label, GTK_ALIGN_START);
3630 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
3631 gtk_box_append(GTK_BOX(vbox), label);
3635 scrollwin = gtk_scrolled_window_new();
3636 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(scrollwin),
3638 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
3639 GTK_POLICY_AUTOMATIC,
3640 GTK_POLICY_AUTOMATIC);
3641 gtk_box_append(GTK_BOX(vbox), scrollwin);
3644 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(
store));
3645 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(
view));
3646 gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE);
3651 gtk_text_view_set_editable(GTK_TEXT_VIEW(
view), editable);
3652 gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(
view), editable);
3654 gtk_widget_set_hexpand(
view,
TRUE);
3655 gtk_widget_set_vexpand(
view,
TRUE);
3657 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrollwin),
view);
3741 g_signal_connect(
textbuf,
"changed",
3746 log_error(
"Unhandled request to configure view widget "
3747 "for property %d (%s) in extviewer_new().",
3805 GtkListStore *store;
3806 GtkTextBuffer *textbuf;
3832 gtk_list_store_clear(store);
3834 id = spe->data.special_idx;
3837 gtk_list_store_append(store, &iter);
3838 gtk_list_store_set(store, &iter, 0, present, 1,
id, 2,
name, -1);
3841 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
3846 gtk_list_store_clear(store);
3853 gtk_list_store_append(store, &iter);
3854 gtk_list_store_set(store, &iter, 0, present, 1,
id, 2,
name, -1);
3857 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
3862 gtk_list_store_clear(store);
3869 gtk_list_store_append(store, &iter);
3870 gtk_list_store_set(store, &iter, 0, present, 1,
id, 2,
name, -1);
3873 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
3878 gtk_list_store_clear(store);
3890 gtk_list_store_append(store, &iter);
3891 gtk_list_store_set(store, &iter, 0,
id, 2,
name, -1);
3893 gtk_list_store_set(store, &iter, 1, pixbuf, -1);
3894 g_object_unref(pixbuf);
3898 gtk_list_store_set(store, &iter, 3, present, -1);
3901 gtk_list_store_set(store, &iter, 4 + v, present, -1);
3907 gtk_list_store_clear(store);
3908 gtk_list_store_append(store, &iter);
3910 gtk_list_store_set(store, &iter, 0, all, 1, -1, 3,
3911 _(
"All nations"), -1);
3920 gtk_list_store_append(store, &iter);
3921 gtk_list_store_set(store, &iter, 0, present, 1,
id,
3922 2, pixbuf, 3,
name, -1);
3924 g_object_unref(pixbuf);
3929 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
3934 gtk_list_store_clear(store);
3942 present = turn_built >= 0;
3944 gtk_list_store_append(store, &iter);
3945 gtk_list_store_set(store, &iter, 0, present, 1,
id, 2,
name,
3950 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
3956 enum barbarian_type barbarian_type =
3959 gtk_list_store_clear(store);
3963 && (barbarian_type != NOT_A_BARBARIAN
3969 gtk_list_store_append(store, &iter);
3970 gtk_list_store_set(store, &iter, 0, present, 1,
id,
3971 2, pixbuf, 3,
name, -1);
3973 g_object_unref(pixbuf);
3980 gtk_image_set_from_pixbuf(GTK_IMAGE(ev->
panel_image), pixbuf);
3982 g_object_unref(pixbuf);
3989 gtk_list_store_clear(store);
3995 gtk_list_store_append(store, &iter);
3996 gtk_list_store_set(store, &iter, 0, present, 1,
id,
3997 2, pixbuf, 3,
name, -1);
3999 g_object_unref(pixbuf);
4007 gtk_label_set_text(GTK_LABEL(ev->
panel_label),
"?");
4012 gtk_image_set_from_pixbuf(GTK_IMAGE(ev->
panel_image), pixbuf);
4014 g_object_unref(pixbuf);
4020 gtk_list_store_clear(store);
4025 gtk_list_store_append(store, &iter);
4026 gtk_list_store_set(store, &iter, 0, present, 1,
id, 2,
name, -1);
4029 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
4038 GtkTextIter start, end;
4042 gtk_text_buffer_get_bounds(textbuf, &start, &end);
4043 oldtext = gtk_text_buffer_get_text(textbuf, &start, &end,
TRUE);
4052 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
4057 log_error(
"Unhandled request to refresh widgets "
4058 "extviewer_refresh_widgets() for objprop id=%d "
4083 gtk_label_set_text(GTK_LABEL(ev->
panel_label), NULL);
4094 gtk_list_store_clear(ev->
store);
4098 gtk_list_store_clear(ev->
store);
4099 gtk_image_set_from_pixbuf(GTK_IMAGE(ev->
panel_image), NULL);
4105 gtk_text_buffer_set_text(ev->
textbuf,
"", -1);
4111 log_error(
"Unhandled request to clear widgets "
4112 "in extviewer_clear_widgets() for objprop id=%d "
4150 GtkTreeModel *model;
4152 int id, old_id, turn_built;
4154 bool active, present;
4156 GdkPixbuf *pixbuf = NULL;
4170 active = gtk_cell_renderer_toggle_get_active(cell);
4173 model = GTK_TREE_MODEL(ev->
store);
4174 if (!gtk_tree_model_get_iter_from_string(model, &iter, path)) {
4183 gtk_tree_model_get(model, &iter, 1, &
id, -1);
4192 gtk_list_store_set(ev->
store, &iter, 0, present, -1);
4194 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
4199 gtk_tree_model_get(model, &iter, 1, &
id, -1);
4208 gtk_list_store_set(ev->
store, &iter, 0, present, -1);
4210 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
4215 gtk_tree_model_get(model, &iter, 1, &
id, -1);
4224 gtk_list_store_set(ev->
store, &iter, 0, present, -1);
4226 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
4231 gtk_tree_model_get(model, &iter, 1, &
id, -1);
4237 gtk_list_store_set(ev->
store, &iter, 0, present, -1);
4238 gtk_tree_model_get_iter_first(model, &iter);
4240 while (gtk_tree_model_iter_next(model, &iter)) {
4241 gtk_list_store_set(ev->
store, &iter, 0,
FALSE, -1);
4248 gtk_tree_model_iter_next(model, &iter);
4249 gtk_tree_model_get(model, &iter, 0, &id2, -1);
4250 gtk_list_store_set(ev->
store, &iter, 0,
TRUE, -1);
4258 gtk_list_store_set(ev->
store, &iter, 0, present, -1);
4265 gtk_tree_model_get_iter_first(model, &iter);
4267 gtk_list_store_set(ev->
store, &iter, 0, all, -1);
4270 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
4275 gtk_tree_model_get(model, &iter, 1, &
id, -1);
4276 if (!(0 <=
id &&
id <
B_LAST)) {
4282 gtk_list_store_set(ev->
store, &iter, 0, present, 3, buf, -1);
4285 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
4290 gtk_tree_model_get(model, &iter, 1, &
id, -1);
4296 gtk_list_store_set(ev->
store, &iter, 0,
TRUE, -1);
4297 gtk_tree_model_iter_nth_child(model, &iter, NULL, old_id);
4298 gtk_list_store_set(ev->
store, &iter, 0,
FALSE, -1);
4302 gtk_image_set_from_pixbuf(GTK_IMAGE(ev->
panel_image), pixbuf);
4304 g_object_unref(pixbuf);
4309 gtk_tree_model_get(model, &iter, 1, &
id, -1);
4316 gtk_list_store_set(ev->
store, &iter, 0,
TRUE, -1);
4317 gtk_tree_model_iter_nth_child(model, &iter, NULL, old_id);
4318 gtk_list_store_set(ev->
store, &iter, 0,
FALSE, -1);
4321 gtk_list_store_set(ev->
store, &iter, 0,
TRUE, -1);
4327 gtk_image_set_from_pixbuf(GTK_IMAGE(ev->
panel_image), pixbuf);
4329 g_object_unref(pixbuf);
4334 gtk_tree_model_get(model, &iter, 1, &
id, -1);
4343 gtk_list_store_set(ev->
store, &iter, 0, present, -1);
4345 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
4350 log_error(
"Unhandled widget toggled signal in "
4351 "extviewer_view_cell_toggled() for objprop id=%d "
4371 GtkTextIter start, end;
4384 gtk_text_buffer_get_start_iter(textbuf, &start);
4385 gtk_text_buffer_get_end_iter(textbuf, &end);
4386 text = gtk_text_buffer_get_text(textbuf, &start, &end,
FALSE);
4394 gtk_label_set_text(GTK_LABEL(ev->
panel_label), buf);
4398 log_error(
"Unhandled widget modified signal in "
4399 "extviewer_textbuf_changed() for objprop id=%d "
4414#define ADDPROP(ARG_id, ARG_name, ARG_tooltip, ARG_flags, ARG_valtype) do { \
4415 struct objprop *MY_op = objprop_new(ARG_id, ARG_name, ARG_tooltip, \
4416 ARG_flags, ARG_valtype, pp); \
4417 objprop_hash_insert(pp->objprop_table, MY_op->id, MY_op); \
4456 ADDPROP(OPID_TILE_ADDRESS,
_(
"Address"), NULL,
4486 ADDPROP(OPID_UNIT_ADDRESS,
_(
"Address"), NULL,
4518 ADDPROP(OPID_CITY_ADDRESS,
_(
"Address"), NULL,
4543 ADDPROP(OPID_PLAYER_ADDRESS,
_(
"Address"), NULL,
4571 _(
"Scenario Name"), NULL,
4575 _(
"Scenario Authors"), NULL,
4579 _(
"Scenario Description"), NULL,
4583 _(
"Save Random Number State"), NULL,
4586 _(
"Save Players"), NULL,
4589 _(
"Nation Start Positions"), NULL,
4592 _(
"Prevent New Cities"), NULL,
4595 _(
"Saltwater Flooding Lakes"), NULL,
4598 _(
"Lock to current Ruleset"), NULL,
4606 log_error(
"%s(): Unhandled page object type %s (nb %d).", __FUNCTION__,
4626 if (gtk_tree_selection_count_selected_rows(sel) < 1) {
4641 GtkTreeModel *model,
4642 GtkTreePath *sel_path,
4643 gboolean currently_selected,
4647 struct objbind *ob = NULL, *old_ob;
4651 if (!pp || !sel_path) {
4655 if (!gtk_tree_model_get_iter(model, &iter, sel_path)) {
4660 gtk_tree_model_get(model, &iter, 0, &ob, -1);
4661 if (currently_selected) {
4665 struct objbind *new_ob = NULL;
4667 rows = gtk_tree_selection_get_selected_rows(sel, NULL);
4668 for (p = rows; p != NULL; p = p->next) {
4670 if (gtk_tree_model_get_iter(model, &iter, path)) {
4671 struct objbind *test_ob = NULL;
4672 gtk_tree_model_get(model, &iter, 0, &test_ob, -1);
4673 if (test_ob == ob) {
4680 g_list_foreach(rows, (GFunc) gtk_tree_path_free, NULL);
4701 GtkTreeViewColumn *col;
4706 text = gtk_entry_buffer_get_text(gtk_entry_get_buffer(GTK_ENTRY(
entry)));
4725 gtk_tree_view_column_set_visible(col, matched);
4741 GtkWidget *vgrid, *vgrid2, *hgrid, *hgrid2, *paned, *frame, *w;
4742 GtkWidget *scrollwin, *
view, *label, *
entry, *notebook;
4743 GtkWidget *button, *hsep;
4744 GtkTreeSelection *sel;
4745 GtkCellRenderer *cell;
4746 GtkTreeViewColumn *col;
4747 GtkSizeGroup *sizegroup;
4748 int num_columns = 0;
4766 sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
4784 gtype_array =
fc_malloc(num_columns *
sizeof(GType));
4785 gtype_array[0] = G_TYPE_POINTER;
4795 pp->
object_store = gtk_list_store_newv(num_columns, gtype_array);
4798 paned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
4799 gtk_paned_set_position(GTK_PANED(paned), 256);
4804 vgrid = gtk_grid_new();
4805 gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
4806 GTK_ORIENTATION_VERTICAL);
4807 gtk_grid_set_row_spacing(GTK_GRID(vgrid), 4);
4808 gtk_widget_set_margin_start(vgrid, 4);
4809 gtk_widget_set_margin_end(vgrid, 4);
4810 gtk_widget_set_margin_top(vgrid, 4);
4811 gtk_widget_set_margin_bottom(vgrid, 4);
4812 gtk_paned_set_start_child(GTK_PANED(paned), vgrid);
4814 scrollwin = gtk_scrolled_window_new();
4815 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(scrollwin),
4817 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
4818 GTK_POLICY_AUTOMATIC,
4819 GTK_POLICY_AUTOMATIC);
4820 gtk_grid_attach(GTK_GRID(vgrid), scrollwin, 0, grid_row++, 1, 1);
4823 gtk_widget_set_hexpand(
view,
TRUE);
4824 gtk_widget_set_vexpand(
view,
TRUE);
4832 if (!attr_type_str) {
4848 col = gtk_tree_view_column_new_with_attributes(
name, cell,
4849 attr_type_str, col_id,
4852 gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
4853 gtk_tree_view_column_set_resizable(col,
TRUE);
4854 gtk_tree_view_column_set_reorderable(col,
TRUE);
4856 gtk_tree_view_column_set_clickable(col,
TRUE);
4857 gtk_tree_view_column_set_sort_column_id(col, col_id);
4859 gtk_tree_view_column_set_clickable(col,
FALSE);
4861 gtk_tree_view_append_column(GTK_TREE_VIEW(
view), col);
4866 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(
view));
4867 gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE);
4868 g_signal_connect(sel,
"changed",
4870 gtk_tree_selection_set_select_function(sel,
4873 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrollwin),
view);
4877 hgrid = gtk_grid_new();
4878 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 4);
4879 gtk_grid_attach(GTK_GRID(vgrid), hgrid, 0, grid_row++, 1, 1);
4881 button = gtk_button_new();
4882 gtk_button_set_icon_name(GTK_BUTTON(button),
"list-add");
4883 gtk_button_set_label(GTK_BUTTON(button),
_(
"Create"));
4884 gtk_size_group_add_widget(sizegroup, button);
4885 gtk_widget_set_tooltip_text(button,
4886 _(
"Pressing this button will create a new object of the "
4887 "same type as the current property page and add it to "
4888 "the page. The specific type and count of the objects "
4889 "is taken from the editor tool state. So for example, "
4890 "the \"tool value\" of the unit tool and its \"count\" "
4891 "parameter affect unit creation."));
4892 g_signal_connect(button,
"clicked",
4894 gtk_grid_attach(GTK_GRID(hgrid), button, grid_col++, 0, 1, 1);
4896 button = gtk_button_new();
4897 gtk_button_set_icon_name(GTK_BUTTON(button),
"list-remove");
4898 gtk_button_set_label(GTK_BUTTON(button),
_(
"Destroy"));
4899 gtk_size_group_add_widget(sizegroup, button);
4900 gtk_widget_set_tooltip_text(button,
4901 _(
"Pressing this button will send a request to the server "
4902 "to destroy (i.e. erase) the objects selected in the object "
4904 g_signal_connect(button,
"clicked",
4906 gtk_grid_attach(GTK_GRID(hgrid), button, grid_col++, 0, 1, 1);
4911 hgrid = gtk_grid_new();
4913 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 4);
4914 gtk_paned_set_end_child(GTK_PANED(paned), hgrid);
4916 vgrid = gtk_grid_new();
4917 gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
4918 GTK_ORIENTATION_VERTICAL);
4919 gtk_grid_set_row_spacing(GTK_GRID(vgrid), 4);
4920 gtk_widget_set_margin_start(vgrid, 4);
4921 gtk_widget_set_margin_end(vgrid, 4);
4922 gtk_widget_set_margin_top(vgrid, 4);
4923 gtk_widget_set_margin_bottom(vgrid, 4);
4924 gtk_grid_attach(GTK_GRID(hgrid), vgrid, grid_col++, 0, 1, 1);
4930 vgrid2 = gtk_grid_new();
4931 gtk_widget_set_hexpand(vgrid2,
TRUE);
4932 gtk_widget_set_vexpand(vgrid,
TRUE);
4933 gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid2),
4934 GTK_ORIENTATION_VERTICAL);
4935 gtk_grid_set_row_spacing(GTK_GRID(vgrid2), 4);
4936 gtk_grid_attach(GTK_GRID(hgrid), vgrid2, grid_col++, 0, 1, 1);
4938 notebook = gtk_notebook_new();
4939 gtk_widget_set_vexpand(notebook,
TRUE);
4940 gtk_widget_set_size_request(notebook, 256, -1);
4941 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook),
FALSE);
4942 gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook),
FALSE);
4943 gtk_grid_attach(GTK_GRID(vgrid2), notebook, 0, grid2_row++, 1, 1);
4946 hsep = gtk_separator_new(GTK_ORIENTATION_HORIZONTAL);
4947 gtk_grid_attach(GTK_GRID(vgrid2), hsep, 0, grid2_row++, 1, 1);
4949 hgrid2 = gtk_grid_new();
4950 gtk_widget_set_margin_start(hgrid2, 4);
4951 gtk_widget_set_margin_end(hgrid2, 4);
4952 gtk_widget_set_margin_top(hgrid2, 4);
4953 gtk_widget_set_margin_bottom(hgrid2, 4);
4954 gtk_grid_attach(GTK_GRID(vgrid2), hgrid2, 0, grid2_row++, 1, 1);
4956 button = gtk_button_new_with_mnemonic(
_(
"_Close"));
4957 gtk_size_group_add_widget(sizegroup, button);
4958 g_signal_connect_swapped(button,
"clicked",
4959 G_CALLBACK(gtk_widget_hide), pe->
widget);
4960 gtk_grid_attach(GTK_GRID(hgrid2), button, grid2_col++, 0, 1, 1);
4966 title = g_strdup_printf(
_(
"%s Properties"),
4968 frame = gtk_frame_new(
title);
4970 gtk_widget_set_size_request(frame, 256, -1);
4971 gtk_grid_attach(GTK_GRID(vgrid), frame, 0, grid_row++, 1, 1);
4973 scrollwin = gtk_scrolled_window_new();
4974 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(scrollwin),
4976 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
4977 GTK_POLICY_AUTOMATIC,
4978 GTK_POLICY_AUTOMATIC);
4979 gtk_frame_set_child(GTK_FRAME(frame), scrollwin);
4981 vgrid2 = gtk_grid_new();
4983 gtk_widget_set_vexpand(vgrid2,
TRUE);
4984 gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid2),
4985 GTK_ORIENTATION_VERTICAL);
4986 gtk_grid_set_row_spacing(GTK_GRID(vgrid2), 4);
4987 gtk_widget_set_margin_start(vgrid2, 4);
4988 gtk_widget_set_margin_end(vgrid2, 4);
4989 gtk_widget_set_margin_top(vgrid2, 4);
4990 gtk_widget_set_margin_bottom(vgrid2, 4);
4991 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrollwin), vgrid2);
5001 gtk_grid_attach(GTK_GRID(vgrid2), w, 0, grid2_row++, 1, 1);
5004 gtk_widget_set_tooltip_text(w,
tooltip);
5008 hgrid2 = gtk_grid_new();
5010 gtk_widget_set_margin_top(hgrid2, 4);
5011 gtk_widget_set_margin_bottom(hgrid2, 4);
5012 gtk_grid_set_column_spacing(GTK_GRID(hgrid2), 4);
5013 gtk_grid_attach(GTK_GRID(vgrid), hgrid2, 0, grid_row++, 1, 1);
5015 label = gtk_label_new(
_(
"Filter:"));
5016 gtk_grid_attach(GTK_GRID(hgrid2), label, grid2_col++, 0, 1, 1);
5018 entry = gtk_entry_new();
5019 gtk_widget_set_tooltip_text(
entry,
5020 _(
"Enter a filter string to limit which properties are shown. "
5021 "The filter is one or more text patterns separated by | "
5022 "(\"or\") or & (\"and\"). The symbol & has higher precedence "
5023 "than |. A pattern may also be negated by prefixing it with !."));
5024 g_signal_connect(
entry,
"changed",
5026 gtk_grid_attach(GTK_GRID(hgrid2),
entry, grid2_col++, 0, 1, 1);
5028 hgrid2 = gtk_grid_new();
5030 gtk_grid_set_column_spacing(GTK_GRID(hgrid2), 4);
5031 gtk_grid_attach(GTK_GRID(vgrid), hgrid2, 0, grid_row++, 1, 1);
5033 button = gtk_button_new_with_mnemonic(
_(
"_Refresh"));
5034 gtk_size_group_add_widget(sizegroup, button);
5035 gtk_widget_set_tooltip_text(button,
5036 _(
"Pressing this button will reset all modified properties of "
5037 "the selected objects to their current values (the values "
5038 "they have on the server)."));
5039 g_signal_connect(button,
"clicked",
5041 gtk_grid_attach(GTK_GRID(hgrid2), button, grid2_col++, 0, 1, 1);
5043 button = gtk_button_new_with_mnemonic(
_(
"_Apply"));
5044 gtk_size_group_add_widget(sizegroup, button);
5045 gtk_widget_set_tooltip_text(button,
5046 _(
"Pressing this button will send all modified properties of "
5047 "the objects selected in the object list to the server. "
5048 "Modified properties' names are shown in red in the properties "
5050 g_signal_connect(button,
"clicked",
5052 gtk_grid_attach(GTK_GRID(hgrid2), button, grid2_col++, 0, 1, 1);
5128 const struct city *pcity,
5140 canvas.
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, fw, fh);
5143 cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
5155 ptile, NULL, NULL,
punit, pcity,
5184 gpointer object_data)
5220 const struct tile *ptile)
5223 if (!pp || !ptile) {
5262 log_error(
"%s(): Unhandled page object type %s (nb %d).", __FUNCTION__,
5282 GdkPixbuf *pixbuf = NULL;
5283 GtkListStore *store;
5311 gtk_list_store_set(store, iter, col_id, pv->
data.
v_int, -1);
5321 for (p = buf; *p; p++) {
5322 if (*p ==
'\n' || *p ==
'\t' || *p ==
'\r') {
5326 gtk_list_store_set(store, iter, col_id, buf, -1);
5329 gtk_list_store_set(store, iter, col_id, pv->
data.
v_pixbuf, -1);
5338 gtk_list_store_set(store, iter, col_id, buf2, -1);
5343 gtk_list_store_set(store, iter, col_id, pixbuf, -1);
5345 g_object_unref(pixbuf);
5355 gtk_list_store_set(store, iter, col_id, pixbuf, -1);
5357 g_object_unref(pixbuf);
5383 GtkTreeRowReference *rr;
5384 GtkTreeModel *model;
5394 gtk_list_store_set(pp->
object_store, &iter, 0, ob, -1);
5395 path = gtk_tree_model_get_path(model, &iter);
5396 rr = gtk_tree_row_reference_new(model, path);
5397 gtk_tree_path_free(path);
5405 if (gtk_tree_model_get_iter_first(model, &iter)) {
5406 GtkTreeSelection *sel;
5407 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->
object_view));
5408 gtk_tree_selection_select_iter(sel, &iter);
5465 const struct tile_list *tiles)
5467 if (!pp || !tiles) {
5497 GtkTreeSelection *sel;
5498 GtkTreeModel *model;
5503 bool changed =
FALSE;
5513 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->
object_view));
5514 rows = gtk_tree_selection_get_selected_rows(sel, &model);
5516 for (p = rows; p != NULL; p = p->next) {
5518 if (gtk_tree_model_get_iter(model, &iter, path)) {
5519 gtk_tree_model_get(model, &iter, 0, &ob, -1);
5522 gtk_tree_path_free(path);
5537 GtkTreeSelection *sel;
5538 GtkTreeModel *model;
5550 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->
object_view));
5551 if (gtk_tree_selection_count_selected_rows(sel) < 1) {
5560 rows = gtk_tree_selection_get_selected_rows(sel, &model);
5562 for (p = rows; p != NULL; p = p->next) {
5564 if (gtk_tree_model_get_iter(model, &iter, path)) {
5565 gtk_tree_model_get(model, &iter, 0, &ob, -1);
5577 gtk_tree_path_free(path);
5663 log_error(
"%s(): Unhandled object type %s (nb %d).",
5693 GtkTreeSelection *sel;
5694 GtkTreeModel *model;
5704 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->
object_view));
5705 if (gtk_tree_selection_count_selected_rows(sel) < 1) {
5709 rows = gtk_tree_selection_get_selected_rows(sel, &model);
5710 for (p = rows; p != NULL; p = p->next) {
5712 if (gtk_tree_model_get_iter(model, &iter, path)) {
5713 gtk_tree_model_get(model, &iter, 0, &ob, -1);
5719 gtk_tree_path_free(path);
5734 GtkTreeSelection *sel;
5735 GtkTreeModel *model;
5746 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(pp->
object_view));
5747 if (gtk_tree_selection_count_selected_rows(sel) < 1) {
5751 rows = gtk_tree_selection_get_selected_rows(sel, &model);
5753 for (p = rows; p != NULL; p = p->next) {
5755 if (gtk_tree_model_get_iter(model, &iter, path)) {
5756 gtk_tree_model_get(model, &iter, 0, &ob, -1);
5759 gtk_tree_path_free(path);
5772 struct tile_list *hint_tiles)
5775 int apno, value, count,
size;
5778 struct tile *ptile = NULL;
5804 if (NULL == ptile) {
5808 if (NULL == ptile) {
5854 if (pplayer && hint_tiles) {
5901 GtkTreeRowReference *rr;
5909 if (rr && gtk_tree_row_reference_valid(rr)) {
5912 GtkTreeModel *model;
5915 path = gtk_tree_row_reference_get_path(rr);
5917 if (gtk_tree_model_get_iter(model, &iter, path)) {
5927 gtk_tree_path_free(path);
5998 GtkNotebook *notebook;
6011 page = gtk_notebook_page_num(notebook, w);
6012 gtk_notebook_set_current_page(notebook, page);
6026 if (stored_tag_hash_lookup(pp->
tag_table, tag, NULL)) {
6027 log_error(
"Attempted to insert object creation tag %d "
6028 "twice into tag table for property page %p (%d %s).",
6034 stored_tag_hash_insert(pp->
tag_table, tag, count);
6050 if (stored_tag_hash_lookup(pp->
tag_table, tag, &count)) {
6052 stored_tag_hash_remove(pp->
tag_table, tag);
6065 return stored_tag_hash_lookup(pp->
tag_table, tag, NULL);
6107 struct tile_list *tiles = NULL;
6115 tiles = tile_list_new();
6120 tile_list_append(tiles, ptile);
6125 tile_list_destroy(tiles);
6163 label = gtk_label_new(
name);
6164 gtk_notebook_append_page(GTK_NOTEBOOK(pe->
notebook),
6200 win = gtk_window_new();
6201 gtk_window_set_title(GTK_WINDOW(win),
_(
"Property Editor"));
6202 gtk_window_set_resizable(GTK_WINDOW(win),
TRUE);
6203 gtk_window_set_default_size(GTK_WINDOW(win), 780, 560);
6204 gtk_window_set_transient_for(GTK_WINDOW(win), GTK_WINDOW(
toplevel));
6205 gtk_window_set_destroy_with_parent(GTK_WINDOW(win),
TRUE);
6206 gtk_widget_set_margin_start(win, 4);
6207 gtk_widget_set_margin_end(win, 4);
6208 gtk_widget_set_margin_top(win, 4);
6209 gtk_widget_set_margin_bottom(win, 4);
6210 gtk_window_set_hide_on_close(GTK_WINDOW(win),
TRUE);
6213 vgrid = gtk_grid_new();
6214 gtk_window_set_child(GTK_WINDOW(win), vgrid);
6219 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(
notebook),
TRUE);
6220 gtk_grid_attach(GTK_GRID(vgrid),
notebook, 0, grid_row++, 1, 1);
6245 const struct tile_list *tiles)
6257 if (!pe || !tiles) {
6266 for (i = 0; i <
ARRAY_SIZE(preferred) - 1; i++) {
6283 if (!pe || !pe->
widget) {
6287 gtk_widget_show(pe->
widget);
6289 gtk_window_present(GTK_WINDOW(pe->
widget));
6300 if (!pe || !pe->
widget) {
6303 gtk_widget_hide(pe->
widget);
6333 int tag,
int object_id)
6423 int or_clause_count, and_clause_count;
6425 const char *pattern;
6430 if (!filter || filter[0] ==
'\0') {
6434 or_clause_count =
get_tokens(filter, or_clauses,
6438 for (i = 0; i < or_clause_count; i++) {
6439 if (or_clauses[i][0] ==
'\0') {
6444 and_clause_count =
get_tokens(or_clauses[i], and_clauses,
6448 for (j = 0; j < and_clause_count; j++) {
6449 if (and_clauses[j][0] ==
'\0') {
6453 pattern = and_clauses[j];
6455 switch (pattern[0]) {
6498 bool match, or_result, and_result;
6513 if (pf->
count < 1) {
6519 for (i = 0; i < pf->
count; i++) {
6522 for (j = 0; j < pfc->
count; j++) {
6524 match = (pfp->
text[0] ==
'\0'
6529 and_result = and_result && match;
6534 or_result = or_result || and_result;
6556 for (i = 0; i < pf->
count; i++) {
6558 for (j = 0; j < pfc->
count; j++) {
6560 if (pfp->
text != NULL) {
6579 return _(
"Seen (Main)");
6582 return _(
"Seen (Invis)");
6585 return _(
"Seen (Subsurface)");
6590 log_error(
"%s(): Unrecognized vision layer %d.", __FUNCTION__, vl);
6591 return _(
"Unknown");
Base_type_id base_number(const struct base_type *pbase)
Base_type_id base_count(void)
bool dbv_isset(const struct dbv *pdbv, int bit)
#define BV_ARE_EQUAL(vec1, vec2)
#define BV_ISSET(bv, bit)
struct canvas int int canvas_y
struct canvas int canvas_x
int city_granary_size(int city_size)
bool city_can_be_built_here(const struct civ_map *nmap, const struct tile *ptile, const struct unit *punit, bool hut_test)
#define city_tile(_pcity_)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
bool client_nation_is_in_current_set(const struct nation_type *pnation)
void connection_do_buffer(struct connection *pc)
void connection_do_unbuffer(struct connection *pc)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
int editor_tool_get_size(enum editor_tool_type ett)
int editor_tool_get_value(enum editor_tool_type ett)
int editor_tool_get_count(enum editor_tool_type ett)
struct unit * editor_unit_virtual_create(void)
int editor_tool_get_applied_player(enum editor_tool_type ett)
void free_tokens(char **tokens, size_t ntokens)
int get_tokens(const char *str, char **tokens, size_t num_tokens, const char *delimiterset)
const struct functions * fc_funcs
#define PL_(String1, String2, n)
struct unit * game_unit_by_number(int id)
struct city * game_city_by_number(int id)
const char * government_name_translation(const struct government *pgovern)
Government_type_id government_count(void)
struct government * government_by_number(const Government_type_id gov)
Government_type_id government_index(const struct government *pgovern)
#define governments_iterate(NAME_pgov)
#define governments_iterate_end
#define FC_STATIC_CANVAS_INIT
static void add_column(GtkWidget *view, int col_id, const char *name, GType gtype, bool editable, bool is_radio, GCallback edit_callback, gpointer callback_userdata)
static void property_page_reset_objbinds(struct property_page *pp)
static void property_page_send_values(struct property_page *pp)
static void objprop_setup_widget(struct objprop *op)
static void property_page_store_creation_tag(struct property_page *pp, int tag, int count)
static gchar * propval_as_string(struct propval *pv)
static struct property_page * objprop_get_property_page(const struct objprop *op)
static const char * objprop_get_name(const struct objprop *op)
const char * vision_layer_get_name(enum vision_layer)
static int objbind_get_object_id(struct objbind *ob)
static void objprop_set_extviewer(struct objprop *op, struct extviewer *ev)
static GtkWidget * extviewer_get_panel_widget(struct extviewer *ev)
static gpointer objtype_get_object_from_id(enum editor_object_type objtype, int id)
void property_editor_handle_object_changed(struct property_editor *pe, enum editor_object_type objtype, int object_id, bool remove)
static struct propstate * propstate_new(struct objprop *op, struct propval *pv)
static const char * valtype_get_name(enum value_types valtype)
static void propstate_destroy(struct propstate *ps)
static bool objbind_set_modified_value(struct objbind *ob, struct objprop *op, struct propval *pv)
static GtkCellRenderer * objprop_create_cell_renderer(const struct objprop *op)
static void extviewer_clear_widgets(struct extviewer *ev)
@ VALTYPE_INVENTIONS_ARRAY
@ VALTYPE_TILE_VISION_DATA
static void objprop_set_child_widget(struct objprop *op, const char *widget_name, GtkWidget *widget)
static bool property_editor_add_page(struct property_editor *pe, enum editor_object_type objtype)
static void propstate_clear_value(struct propstate *ps)
static void objbind_pack_modified_value(struct objbind *ob, struct objprop *op, union packetdata packet)
static struct objbind * property_page_get_focused_objbind(struct property_page *pp)
static bool objprop_has_widget(const struct objprop *op)
static int objtype_get_id_from_object(enum editor_object_type objtype, gpointer object)
static enum editor_object_type objbind_get_objtype(const struct objbind *ob)
static struct extviewer * objprop_get_extviewer(struct objprop *op)
static void extviewer_refresh_widgets(struct extviewer *ev, struct propval *pv)
static enum editor_object_type property_page_get_objtype(const struct property_page *pp)
#define property_page_objbind_iterate_end
static void property_page_show_extviewer(struct property_page *pp, struct extviewer *ev)
static gpointer objbind_get_object(struct objbind *ob)
static const char * property_page_get_name(const struct property_page *pp)
void property_editor_handle_object_created(struct property_editor *pe, int tag, int object_id)
static bool objbind_property_is_modified(struct objbind *ob, struct objprop *op)
static struct propval * propstate_get_value(struct propstate *ps)
static void property_page_clear_tags(struct property_page *pp)
static void property_page_object_created(struct property_page *pp, int tag, int object_id)
static bool property_page_tag_is_known(struct property_page *pp, int tag)
static void property_page_remove_creation_tag(struct property_page *pp, int tag)
static void property_page_load_tiles(struct property_page *pp, const struct tile_list *tiles)
static void property_page_create_objects(struct property_page *pp, struct tile_list *hint_tiles)
static void property_page_add_extviewer(struct property_page *pp, struct extviewer *ev)
static void property_page_refresh_button_clicked(GtkButton *button, gpointer userdata)
static void property_page_set_focused_objbind(struct property_page *pp, struct objbind *ob)
static void property_page_setup_objprops(struct property_page *pp)
static void objbind_set_rowref(struct objbind *ob, GtkTreeRowReference *rr)
static void objbind_clear_modified_value(struct objbind *ob, struct objprop *op)
static struct propval * objbind_get_value_from_object(struct objbind *ob, struct objprop *op)
static void propval_free(struct propval *pv)
static struct property_filter * property_filter_new(const char *filter)
static bool property_page_set_store_value(struct property_page *pp, struct objprop *op, struct objbind *ob, GtkTreeIter *iter)
static const char * objtype_get_name(enum editor_object_type objtype)
static void objbind_clear_all_modified_values(struct objbind *ob)
static bool property_filter_match(struct property_filter *pf, const struct objprop *op)
void property_editor_popup(struct property_editor *pe, enum editor_object_type objtype)
static void property_page_destroy_button_clicked(GtkButton *button, gpointer userdata)
static struct objbind * objbind_new(enum editor_object_type objtype, gpointer object)
static gboolean property_page_selection_func(GtkTreeSelection *sel, GtkTreeModel *model, GtkTreePath *path, gboolean currently_selected, gpointer data)
static int property_page_get_num_objbinds(const struct property_page *pp)
static bool objprop_show_in_listview(const struct objprop *op)
static GType objprop_get_gtype(const struct objprop *op)
static void objprop_set_treeview_column(struct objprop *op, GtkTreeViewColumn *col)
static void objbind_pack_current_values(struct objbind *ob, union packetdata packet)
static const char * objprop_get_attribute_type_string(const struct objprop *op)
static struct propval * propval_copy(struct propval *pv)
struct property_editor * editprop_get_property_editor(void)
void property_editor_reload(struct property_editor *pe, enum editor_object_type objtype)
static GdkPixbuf * create_unit_pixbuf(const struct unit *punit)
static void extviewer_view_cell_toggled(GtkCellRendererToggle *cell, gchar *path, gpointer userdata)
static struct property_editor * property_editor_new(void)
static void property_page_send_packet(struct property_page *pp, union packetdata packet)
static gchar * built_status_to_string(struct built_status *bs)
static int objprop_get_id(const struct objprop *op)
@ OPID_GAME_LAKE_FLOODING
@ OPID_GAME_SCENARIO_NAME
@ OPID_GAME_SCENARIO_AUTHORS
@ OPID_GAME_PREVENT_CITIES
@ OPID_GAME_SCENARIO_DESC
@ OPID_GAME_STARTPOS_NATIONS
@ OPID_PLAYER_SCENARIO_RESERVED
@ OPID_GAME_SCENARIO_RANDSTATE
@ OPID_GAME_SCENARIO_PLAYERS
@ OPID_GAME_RULESET_LOCKED
static enum value_types objprop_get_valtype(const struct objprop *op)
static int get_next_unique_tag(void)
static bool objprop_is_sortable(const struct objprop *op)
static void property_page_add_objbinds_from_tile(struct property_page *pp, const struct tile *ptile)
static const char * objprop_get_tooltip(const struct objprop *op)
static GtkTreeRowReference * objbind_get_rowref(struct objbind *ob)
static void property_filter_free(struct property_filter *pf)
static void objprop_widget_spin_button_changed(GtkSpinButton *spin, gpointer userdata)
#define PF_DISJUNCTION_SEPARATOR
static GtkWidget * objprop_get_child_widget(struct objprop *op, const char *widget_name)
static void property_page_selection_changed(GtkTreeSelection *sel, gpointer userdata)
static bool objtype_is_conserved(enum editor_object_type objtype)
static struct extviewer * extviewer_new(struct objprop *op)
static bool propval_equal(struct propval *pva, struct propval *pvb)
static void property_page_quick_find_entry_changed(GtkWidget *entry, gpointer userdata)
static void objprop_refresh_widget(struct objprop *op, struct objbind *ob)
void property_editor_popdown(struct property_editor *pe)
static void objbind_destroy(struct objbind *ob)
static void property_page_add_objbind(struct property_page *pp, gpointer object_data)
static void objbind_request_destroy_object(struct objbind *ob)
static void property_page_create_button_clicked(GtkButton *button, gpointer userdata)
static GdkPixbuf * create_pixbuf_from_layers(const struct tile *ptile, const struct unit *punit, const struct city *pcity, enum layer_category category)
static union packetdata property_page_new_packet(struct property_page *pp)
static void propstate_set_value(struct propstate *ps, struct propval *pv)
static int objprop_get_column_id(const struct objprop *op)
static GdkPixbuf * create_tile_pixbuf(const struct tile *ptile)
static struct objprop * extviewer_get_objprop(struct extviewer *ev)
static bool can_create_unit_at_tile(struct tile *ptile)
static struct objbind * property_page_get_objbind(struct property_page *pp, int object_id)
static bool objbind_get_allowed_value_span(struct objbind *ob, struct objprop *op, double *pmin, double *pmax, double *pstep, double *pbig_step)
static void property_page_free_packet(struct property_page *pp, union packetdata packet)
static GdkPixbuf * create_city_pixbuf(const struct city *pcity)
#define ADDPROP(ARG_id, ARG_name, ARG_tooltip, ARG_flags, ARG_valtype)
static void extviewer_panel_button_clicked(GtkButton *button, gpointer userdata)
static void property_page_destroy_objects(struct property_page *pp)
void property_editor_load_tiles(struct property_editor *pe, const struct tile_list *tiles)
static struct property_page * property_page_new(enum editor_object_type objtype, struct property_editor *parent)
#define property_page_objprop_iterate_end
static void property_page_clear_objbinds(struct property_page *pp)
void property_editor_clear(struct property_editor *pe)
#define property_page_objprop_iterate(ARG_pp, NAME_op)
static void objprop_set_column_id(struct objprop *op, int col_id)
static void objbind_bind_properties(struct objbind *ob, struct property_page *pp)
static void property_page_fill_widgets(struct property_page *pp)
static bool objbind_has_modified_properties(struct objbind *ob)
static void property_page_change_value(struct property_page *pp, struct objprop *op, struct propval *pv)
static void objprop_widget_toggle_button_changed(GtkToggleButton *button, gpointer userdata)
#define PF_CONJUNCTION_SEPARATOR
static void property_page_apply_button_clicked(GtkButton *button, gpointer userdata)
static struct objprop * objprop_new(int id, const char *name, const char *tooltip, enum object_property_flags flags, enum value_types valtype, struct property_page *parent)
static GtkWidget * extviewer_get_view_widget(struct extviewer *ev)
static GtkWidget * objprop_get_widget(struct objprop *op)
static void propval_free_data(struct propval *pv)
static void extviewer_textbuf_changed(GtkTextBuffer *textbuf, gpointer userdata)
static struct property_editor * the_property_editor
static void property_page_object_changed(struct property_page *pp, int object_id, bool remove)
static bool objprop_is_readonly(const struct objprop *op)
#define property_page_objbind_iterate(ARG_pp, NAME_ob)
static GtkTreeViewColumn * objprop_get_treeview_column(const struct objprop *op)
static struct property_page * property_editor_get_page(struct property_editor *pe, enum editor_object_type objtype)
static struct propval * objbind_get_modified_value(struct objbind *ob, struct objprop *op)
void disable_gobject_callback(GObject *obj, GCallback cb)
void enable_gobject_callback(GObject *obj, GCallback cb)
GdkPixbuf * get_flag(const struct nation_type *nation)
GdkPixbuf * surface_get_pixbuf(cairo_surface_t *surf, int width, int height)
GdkPixbuf * sprite_get_pixbuf(struct sprite *sprite)
static void objprop_widget_text_changed(GtkEditable *text, gpointer userdata)
bool is_special_improvement(const struct impr_type *pimprove)
Impr_type_id improvement_index(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
bool is_small_wonder(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
struct startpos * map_startpos_get(const struct tile *ptile)
int startpos_number(const struct startpos *psp)
struct tile * startpos_tile(const struct startpos *psp)
const struct nation_hash * startpos_raw_nations(const struct startpos *psp)
bool startpos_pack(const struct startpos *psp, struct packet_edit_startpos_full *packet)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
bool startpos_is_excluding(const struct startpos *psp)
struct startpos * map_startpos_by_number(int id)
#define index_to_native_pos(pnat_x, pnat_y, mindex)
#define index_to_map_pos(pmap_x, pmap_y, mindex)
struct tile * get_center_tile_mapcanvas(void)
void put_one_element(struct canvas *pcanvas, float zoom, enum mapview_layer layer, const struct tile *ptile, const struct tile_edge *pedge, const struct tile_corner *pcorner, const struct unit *punit, const struct city *pcity, int canvas_x, int canvas_y, const struct city *citymode, const struct unit_type *putype)
#define fc_calloc(n, esz)
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
Nation_type_id nation_count(void)
Nation_type_id nation_number(const struct nation_type *pnation)
const char * nation_adjective_translation(const struct nation_type *pnation)
struct nation_type * nation_by_number(const Nation_type_id nation)
struct nation_type * nation_of_player(const struct player *pplayer)
bool is_nation_playable(const struct nation_type *nation)
Nation_type_id nation_index(const struct nation_type *pnation)
enum barbarian_type nation_barbarian_type(const struct nation_type *nation)
#define nation_hash_iterate(nationhash, pnation)
#define nations_iterate_end
#define nations_iterate(NAME_pnation)
#define nation_hash_iterate_end
int dsend_packet_edit_city_create(struct connection *pc, int owner, int tile, int size, int tag)
int send_packet_edit_city(struct connection *pc, const struct packet_edit_city *packet)
int send_packet_edit_game(struct connection *pc, const struct packet_edit_game *packet)
int dsend_packet_edit_city_remove(struct connection *pc, int id16, int id32)
int dsend_packet_edit_unit_remove_by_id(struct connection *pc, int id16, int id32)
int send_packet_edit_startpos_full(struct connection *pc, const struct packet_edit_startpos_full *packet)
int dsend_packet_edit_startpos(struct connection *pc, int id, bool removal, int tag)
int send_packet_edit_player(struct connection *pc, const struct packet_edit_player *packet)
int dsend_packet_edit_player_create(struct connection *pc, int tag)
int send_packet_edit_unit(struct connection *pc, const struct packet_edit_unit *packet)
int send_packet_edit_scenario_desc(struct connection *pc, const struct packet_edit_scenario_desc *packet)
int dsend_packet_edit_unit_create(struct connection *pc, int owner, int tile, Unit_type_id type, int count, int tag)
int dsend_packet_edit_player_remove(struct connection *pc, int id)
int send_packet_edit_tile(struct connection *pc, const struct packet_edit_tile *packet)
bool player_slot_is_used(const struct player_slot *pslot)
struct player * player_by_number(const int player_id)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
int player_slot_index(const struct player_slot *pslot)
bool player_has_flag(const struct player *pplayer, enum plr_flag_id flag)
int player_index(const struct player *pplayer)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
struct player * player_slot_get_player(const struct player_slot *pslot)
#define players_iterate_end
#define players_iterate(_pplayer)
#define player_slots_iterate(_pslot)
#define player_slots_iterate_end
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
Road_type_id road_count(void)
Road_type_id road_number(const struct road_type *proad)
cairo_surface_t * surface
struct built_status built[B_LAST]
struct packet_scenario_description scenario_desc
struct packet_game_info info
struct packet_scenario_info scenario
struct government * government_during_revolution
struct propval * pv_cached
bool(* player_tile_vision_get)(const struct tile *ptile, const struct player *pplayer, enum vision_layer vision)
struct propstate_hash * propstate_table
struct property_page * parent_property_page
GtkTreeRowReference * rowref
enum editor_object_type objtype
struct property_page * parent_page
enum object_property_flags flags
struct extviewer * extviewer
GtkTreeViewColumn * view_column
char name[MAX_LEN_CITYNAME]
char scenario_authors[MAX_LEN_PACKET/3]
Government_type_id government
bool inventions[A_LAST+1]
bv_startpos_nations nations
char description[MAX_LEN_CONTENT]
char authors[MAX_LEN_PACKET/3]
struct pf_pattern conjunction[PF_MAX_CLAUSES]
struct government * government
struct player_economic economic
struct nation_type * nation
struct property_page * property_pages[NUM_OBJTYPES]
struct pf_conjunction disjunction[PF_MAX_CLAUSES]
GtkListStore * object_store
struct property_editor * pe_parent
GtkWidget * extviewer_notebook
struct objbind_hash * objbind_table
struct objbind * focused_objbind
struct stored_tag_hash * tag_table
enum editor_object_type objtype
struct objprop_hash * objprop_table
struct propval * property_value
bv_player tile_seen[V_COUNT]
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
char * fc_strcasestr(const char *haystack, const char *needle)
#define sz_strlcpy(dest, src)
#define sz_strlcat(dest, src)
const char * advance_name_translation(const struct advance *padvance)
Tech_type_id advance_index(const struct advance *padvance)
#define advance_index_iterate_end
#define advance_iterate(_start, _p)
static Tech_type_id advance_count(void)
#define advance_iterate_end
#define advance_index_iterate(_start, _index)
const char * terrain_name_translation(const struct terrain *pterrain)
struct city * tile_city(const struct tile *ptile)
#define tile_resource(_tile)
#define tile_list_iterate(tile_list, ptile)
#define tile_terrain(_tile)
#define tile_list_iterate_end
static const bv_extras * tile_extras(const struct tile *ptile)
#define tile_has_extra(ptile, pextra)
struct sprite * get_government_sprite(const struct tileset *t, const struct government *gov)
int tileset_small_sprite_width(const struct tileset *t)
int tileset_full_tile_height(const struct tileset *t)
bool tileset_layer_in_category(enum mapview_layer layer, enum layer_category cat)
int tileset_small_sprite_height(const struct tileset *t)
int tileset_tile_height(const struct tileset *t)
int tileset_full_tile_width(const struct tileset *t)
int tileset_tile_width(const struct tileset *t)
#define mapview_layer_iterate(layer)
#define mapview_layer_iterate_end
struct packet_edit_tile * tile
struct packet_edit_unit * unit
struct packetdata::@145 pointers
struct packet_edit_player * player
struct packet_edit_city * city
struct packet_edit_game * game
struct packet_edit_startpos_full * startpos
struct government * v_gov
bv_max_extras v_bv_special
struct tile_vision_data * v_tile_vision
struct built_status * v_built
struct nation_type * v_nation
struct nation_hash * v_nation_hash
const char * v_const_string
static bool is_enemy_unit_tile(const struct tile *ptile, const struct player *pplayer)
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
int utype_veteran_levels(const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
#define utype_fuel(ptype)
#define vision_layer_iterate(v)
#define vision_layer_iterate_end