24#include <gdk/gdkkeysyms.h>
117 GtkWidget *tb = NULL;
134 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb), i == etm);
145 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(tb),
TRUE);
161 etm = GPOINTER_TO_INT(userdata);
166 active = gtk_toggle_button_get_active(tb);
186 dialog = gtk_message_dialog_new(GTK_WINDOW(
toplevel),
187 GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
188 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
"%s",
189 _(
"The current ruleset does not define any "
190 "objects corresponding to this editor tool."));
193 gtk_window_destroy(GTK_WINDOW(dialog));
208 active = gtk_toggle_button_get_active(tb);
209 ett = GPOINTER_TO_INT(userdata);
237 gtk_list_store_clear(store);
239 gtk_list_store_append(store, &iter);
240 gtk_list_store_set(store, &iter,
PPV_COL_NAME,
_(
"Global Observer"),
245 gtk_list_store_append(store, &iter);
253 gtk_list_store_set(store, &iter,
PPV_COL_FLAG, flag, -1);
254 g_object_unref(flag);
268 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), index);
281 struct editbar *eb = user_data;
287 if (eb == NULL || eb->
widget == NULL
288 || !gtk_widget_get_visible(eb->
widget)) {
292 if (!gtk_combo_box_get_active_iter(combo, &iter)) {
296 model = gtk_combo_box_get_model(combo);
311 if (pplayer != NULL) {
324 GtkTreeSelection *sel;
335 gtk_widget_hide(dialog);
337 if (res != GTK_RESPONSE_ACCEPT) {
341 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tvs->
view));
342 if (!gtk_tree_selection_get_selected(sel, &model, &iter)) {
346 gtk_tree_model_get(model, &iter,
TVS_COL_ID, &
id, -1);
392 double x,
double y, gpointer data)
405 GtkWidget *pic, *button, *hbox;
406 GtkToggleButton *parent = NULL;
410 GtkEventController *controller;
423 if (parent == NULL) {
424 button = gtk_toggle_button_new();
426 button = gtk_toggle_button_new();
427 gtk_toggle_button_set_group(GTK_TOGGLE_BUTTON(button),
428 GTK_TOGGLE_BUTTON(parent));
434 pic = gtk_picture_new_for_pixbuf(pixbuf);
435 g_object_unref(G_OBJECT(pixbuf));
437 gtk_button_set_child(GTK_BUTTON(button), pic);
438 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
FALSE);
440 gtk_size_group_add_widget(eb->
size_group, button);
441 gtk_button_set_has_frame(GTK_BUTTON(button),
FALSE);
442 gtk_widget_set_focus_on_click(button,
FALSE);
444 g_signal_connect(button,
"toggled",
446 GINT_TO_POINTER(ett));
448 gesture = gtk_gesture_click_new();
449 gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(gesture), 3);
450 controller = GTK_EVENT_CONTROLLER(gesture);
451 g_signal_connect(controller,
"pressed",
453 GINT_TO_POINTER(ett));
454 gtk_widget_add_controller(button, controller);
457 gtk_box_append(GTK_BOX(hbox), button);
487 GtkWidget *pic, *button, *hbox;
495 button = gtk_toggle_button_new();
500 pic = gtk_picture_new_for_pixbuf(pixbuf);
501 g_object_unref(G_OBJECT(pixbuf));
503 gtk_button_set_child(GTK_BUTTON(button), pic);
504 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button),
FALSE);
507 gtk_widget_set_tooltip_text(button,
tooltip);
509 gtk_size_group_add_widget(eb->
size_group, button);
510 gtk_button_set_has_frame(GTK_BUTTON(button),
FALSE);
511 gtk_widget_set_focus_on_click(button,
FALSE);
513 g_signal_connect(button,
"toggled",
515 GINT_TO_POINTER(etm));
518 gtk_box_append(GTK_BOX(hbox), button);
528 GtkWidget *hbox, *button, *combo, *pic, *separator, *vgrid;
530 GtkCellRenderer *cell;
537 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 4);
539 eb->
size_group = gtk_size_group_new(GTK_SIZE_GROUP_BOTH);
545 separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
546 gtk_box_append(GTK_BOX(hbox), separator);
559 separator = gtk_separator_new(GTK_ORIENTATION_VERTICAL);
560 gtk_box_append(GTK_BOX(hbox), separator);
563 vgrid = gtk_grid_new();
564 gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
565 GTK_ORIENTATION_VERTICAL);
566 gtk_box_append(GTK_BOX(hbox), vgrid);
574 combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
576 cell = gtk_cell_renderer_pixbuf_new();
577 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell,
FALSE);
578 gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo),
581 cell = gtk_cell_renderer_text_new();
582 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell,
TRUE);
583 gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo),
586 gtk_widget_set_size_request(combo, 140, -1);
587 g_signal_connect(combo,
"changed",
590 gtk_widget_set_tooltip_text(combo,
591 _(
"Switch player point-of-view. Use this to edit "
592 "from the perspective of different players, or "
593 "even as a global observer."));
594 gtk_grid_attach(GTK_GRID(vgrid), combo, 0, grid_row++, 1, 1);
598 button = gtk_button_new();
600 pic = gtk_picture_new_for_pixbuf(pixbuf);
601 g_object_unref(G_OBJECT(pixbuf));
602 gtk_button_set_child(GTK_BUTTON(button), pic);
603 gtk_widget_set_tooltip_text(button,
_(
"Show the property editor."));
604 gtk_size_group_add_widget(eb->
size_group, button);
605 gtk_button_set_has_frame(GTK_BUTTON(button),
FALSE);
606 gtk_widget_set_focus_on_click(button,
FALSE);
607 g_signal_connect(button,
"clicked",
609 gtk_box_append(GTK_BOX(hbox), button);
621 GtkTreeSelection *sel;
624 int value, store_value;
638 model = GTK_TREE_MODEL(tvs->
store);
639 if (!gtk_tree_model_get_iter_first(model, &iter)) {
644 gtk_tree_model_get(model, &iter,
TVS_COL_ID, &store_value, -1);
645 if (value == store_value) {
646 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(tvs->
view));
647 gtk_tree_selection_select_iter(sel, &iter);
650 }
while (gtk_tree_model_iter_next(model, &iter));
677 if (eb == NULL || eb->
widget == NULL) {
682 gtk_widget_hide(eb->
widget);
690 gtk_widget_show(eb->
widget);
712 canvas.
surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
715 cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
719 for (i = 0; i < 3; i++) {
739 GtkTreeModel *model = GTK_TREE_MODEL(store);
741 if (gtk_tree_model_get_iter_first(model, &iter)) {
745 gtk_tree_model_get(model, &iter,
TVS_COL_IMAGE, &pixbuf, -1);
746 if (pixbuf != NULL) {
747 g_object_unref(pixbuf);
749 }
while (gtk_tree_model_iter_next(model, &iter));
752 gtk_list_store_clear(store);
779 if (eb == NULL ||
tileset == NULL) {
791 gtk_list_store_append(
store, &iter);
792 gtk_list_store_set(
store, &iter,
797 if (pixbuf != NULL) {
799 g_object_unref(pixbuf);
810 gtk_list_store_append(
store, &iter);
811 gtk_list_store_set(
store, &iter,
816 if (pixbuf != NULL) {
818 g_object_unref(pixbuf);
828 gtk_list_store_append(
store, &iter);
829 gtk_list_store_set(
store, &iter,
834 if (pixbuf != NULL) {
836 g_object_unref(pixbuf);
846 gtk_list_store_append(
store, &iter);
847 gtk_list_store_set(
store, &iter,
852 if (pixbuf != NULL) {
854 g_object_unref(pixbuf);
864 gtk_list_store_append(
store, &iter);
865 gtk_list_store_set(
store, &iter,
870 if (pixbuf != NULL) {
872 g_object_unref(pixbuf);
883 gtk_list_store_append(
store, &iter);
884 gtk_list_store_set(
store, &iter,
893 if (pixbuf != NULL) {
895 g_object_unref(G_OBJECT(pixbuf));
907 if (gdk_event_state & GDK_SHIFT_MASK) {
910 if (gdk_event_state & GDK_CONTROL_MASK) {
913 if (gdk_event_state & GDK_ALT_MASK) {
924 int editor_mouse_button,
927 GdkModifierType state;
929 state = gtk_event_controller_get_current_event_state(
930 GTK_EVENT_CONTROLLER(gesture));
941 int editor_mouse_button,
944 GdkModifierType state;
946 state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
957 gdouble x, gdouble y)
959 GdkModifierType state;
961 state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(controller));
972 GtkTreeViewColumn *col,
977 gtk_dialog_response(GTK_DIALOG(tvs->
dialog), GTK_RESPONSE_ACCEPT);
988 GtkWidget *vbox, *
view, *scrollwin;
989 GtkCellRenderer *cell;
991 GtkTreeViewColumn *col;
992 GtkTreeSelection *sel;
998 tvs->
dialog = gtk_dialog_new_with_buttons(
_(
"Select Tool Value"),
999 GTK_WINDOW(
toplevel), GTK_DIALOG_MODAL,
1000 _(
"_OK"), GTK_RESPONSE_ACCEPT,
1001 _(
"_Cancel"), GTK_RESPONSE_REJECT,
1003 vbox = gtk_dialog_get_content_area(GTK_DIALOG(tvs->
dialog));
1011 scrollwin = gtk_scrolled_window_new();
1012 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(scrollwin),
TRUE);
1013 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin),
1015 GTK_POLICY_AUTOMATIC);
1016 gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrollwin),
1018 gtk_box_insert_child_after(GTK_BOX(vbox), scrollwin, NULL);
1020 view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(tvs->
store));
1023 g_signal_connect(
view,
"row-activated",
1026 sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(
view));
1027 gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
1029 cell = gtk_cell_renderer_pixbuf_new();
1033 gtk_tree_view_column_set_resizable(col,
FALSE);
1034 gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
1035 gtk_tree_view_column_set_reorderable(col,
FALSE);
1036 gtk_tree_view_column_set_clickable(col,
FALSE);
1037 gtk_tree_view_append_column(GTK_TREE_VIEW(
view), col);
1039 cell = gtk_cell_renderer_text_new();
1040 col = gtk_tree_view_column_new_with_attributes(
"ID", cell,
1042 gtk_tree_view_column_set_resizable(col,
FALSE);
1043 gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
1044 gtk_tree_view_column_set_reorderable(col,
FALSE);
1045 gtk_tree_view_column_set_clickable(col,
FALSE);
1046 gtk_tree_view_column_set_sort_column_id(col,
TVS_COL_ID);
1047 gtk_tree_view_append_column(GTK_TREE_VIEW(
view), col);
1049 cell = gtk_cell_renderer_text_new();
1050 col = gtk_tree_view_column_new_with_attributes(
"Name", cell,
1052 gtk_tree_view_column_set_resizable(col,
FALSE);
1053 gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
1054 gtk_tree_view_column_set_reorderable(col,
FALSE);
1055 gtk_tree_view_column_set_clickable(col,
FALSE);
1056 gtk_tree_view_column_set_sort_column_id(col,
TVS_COL_NAME);
1057 gtk_tree_view_append_column(GTK_TREE_VIEW(
view), col);
1059 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scrollwin),
view);
1063 gtk_widget_show(vbox);
1072 GtkGestureClick *gesture,
1085 GtkGestureClick *gesture,
1111 value = gtk_spin_button_get_value_as_int(spinbutton);
1112 which = GPOINTER_TO_INT(userdata);
1139 GtkTreeModel *model;
1146 if (!gtk_combo_box_get_active_iter(combo, &iter)) {
1150 model = gtk_combo_box_get_model(combo);
1161 GtkWidget *label, *vgrid, *frame, *hgrid, *vgrid2, *pic;
1162 GtkWidget *spin, *combo;
1163 GtkListStore *store;
1164 GtkCellRenderer *cell;
1165 GtkEventController *controller;
1176 frame = gtk_frame_new(
_(
"Editor Tool"));
1177 gtk_widget_set_margin_start(frame, 4);
1178 gtk_widget_set_margin_end(frame, 4);
1179 gtk_widget_set_margin_top(frame, 4);
1180 gtk_widget_set_margin_bottom(frame, 4);
1183 vgrid = gtk_grid_new();
1184 gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid),
1185 GTK_ORIENTATION_VERTICAL);
1186 gtk_grid_set_row_spacing(GTK_GRID(vgrid), 8);
1187 gtk_widget_set_margin_start(vgrid, 4);
1188 gtk_widget_set_margin_end(vgrid, 4);
1189 gtk_widget_set_margin_top(vgrid, 4);
1190 gtk_widget_set_margin_bottom(vgrid, 4);
1191 gtk_frame_set_child(GTK_FRAME(frame), vgrid);
1194 hgrid = gtk_grid_new();
1195 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 8);
1196 gtk_grid_attach(GTK_GRID(vgrid), hgrid, 0, grid_row++, 1, 1);
1198 pic = gtk_picture_new();
1199 gtk_widget_set_tooltip_text(pic,
_(
"Click to change value if applicable."));
1201 controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
1202 g_signal_connect(controller,
"pressed",
1205 gtk_widget_add_controller(pic, controller);
1207 gtk_grid_attach(GTK_GRID(hgrid), pic, grid_col++, 0, 1, 1);
1210 vgrid2 = gtk_grid_new();
1211 gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid2),
1212 GTK_ORIENTATION_VERTICAL);
1213 gtk_grid_set_row_spacing(GTK_GRID(vgrid2), 4);
1214 gtk_grid_attach(GTK_GRID(hgrid), vgrid2, grid_col++, 0, 1, 1);
1216 label = gtk_label_new(NULL);
1217 gtk_widget_set_halign(label, GTK_ALIGN_START);
1218 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
1219 gtk_grid_attach(GTK_GRID(vgrid2), label, 0, grid2_row++, 1, 1);
1222 label = gtk_label_new(NULL);
1223 gtk_widget_set_halign(label, GTK_ALIGN_START);
1224 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
1225 gtk_grid_attach(GTK_GRID(vgrid2), label, 0, grid2_row++, 1, 1);
1229 hgrid = gtk_grid_new();
1231 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 8);
1232 gtk_grid_attach(GTK_GRID(vgrid), hgrid, 0, grid_row++, 1, 1);
1234 pic = gtk_picture_new();
1235 gtk_widget_set_tooltip_text(pic,
_(
"Click to change tool mode."));
1237 controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
1238 g_signal_connect(controller,
"pressed",
1241 gtk_widget_add_controller(pic, controller);
1243 gtk_grid_attach(GTK_GRID(hgrid), pic, grid_col++, 0, 1, 1);
1246 vgrid2 = gtk_grid_new();
1248 gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid2),
1249 GTK_ORIENTATION_VERTICAL);
1250 gtk_grid_set_row_spacing(GTK_GRID(vgrid2), 4);
1251 gtk_grid_attach(GTK_GRID(hgrid), vgrid2, grid_col++, 0, 1, 1);
1253 label = gtk_label_new(NULL);
1254 fc_snprintf(buf,
sizeof(buf),
"<span weight=\"bold\">%s</span>",
1256 gtk_label_set_markup(GTK_LABEL(label), buf);
1257 gtk_widget_set_halign(label, GTK_ALIGN_START);
1258 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
1259 gtk_grid_attach(GTK_GRID(vgrid2), label, 0, grid2_row++, 1, 1);
1261 label = gtk_label_new(NULL);
1262 gtk_widget_set_halign(label, GTK_ALIGN_START);
1263 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
1264 gtk_grid_attach(GTK_GRID(vgrid2), label, 0, grid2_row++, 1, 1);
1268 hgrid = gtk_grid_new();
1270 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 8);
1271 gtk_grid_attach(GTK_GRID(vgrid), hgrid, 0, grid_row++, 1, 1);
1273 spin = gtk_spin_button_new_with_range(1, 255, 1);
1274 gtk_widget_set_tooltip_text(spin,
1275 _(
"Use this to change the \"size\" parameter for the tool. "
1276 "This parameter controls for example the half-width "
1277 "of the square of tiles that will be affected by the "
1278 "tool, or the size of a created city."));
1279 g_signal_connect(spin,
"value-changed",
1282 gtk_grid_attach(GTK_GRID(hgrid), spin, grid_col++, 0, 1, 1);
1284 label = gtk_label_new(
_(
"Size"));
1285 gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
1287 hgrid = gtk_grid_new();
1289 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 8);
1290 gtk_grid_attach(GTK_GRID(vgrid), hgrid, 0, grid_row++, 1, 1);
1292 spin = gtk_spin_button_new_with_range(1, 255, 1);
1293 gtk_widget_set_tooltip_text(spin,
1294 _(
"Use this to change the tool's \"count\" parameter. "
1295 "This controls for example how many units are placed "
1296 "at once with the unit tool."));
1297 g_signal_connect(spin,
"value-changed",
1300 gtk_grid_attach(GTK_GRID(hgrid), spin, grid_col++, 0, 1, 1);
1302 label = gtk_label_new(
_(
"Count"));
1303 gtk_grid_attach(GTK_GRID(hgrid), label, grid_col++, 0, 1, 1);
1311 combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
1313 cell = gtk_cell_renderer_pixbuf_new();
1314 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell,
FALSE);
1315 gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo),
1318 cell = gtk_cell_renderer_text_new();
1319 gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), cell,
TRUE);
1320 gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo),
1323 gtk_widget_set_size_request(combo, 132, -1);
1324 g_signal_connect(combo,
"changed",
1327 gtk_widget_set_tooltip_text(combo,
1328 _(
"Use this to change the \"applied player\" tool parameter. "
1329 "This controls for example under which player units and cities "
1331 gtk_grid_attach(GTK_GRID(vgrid), combo, 0, grid_row++, 1, 1);
1337 g_object_ref(ei->
widget);
1341 gtk_widget_show(ei->
widget);
1353 GtkListStore *store;
1367 if (!combo || !store) {
1372 gtk_widget_hide(combo);
1376 gtk_list_store_clear(store);
1383 gtk_list_store_append(store, &iter);
1384 gtk_list_store_set(store, &iter,
1392 gtk_list_store_set(store, &iter,
TAP_COL_FLAG, flag, -1);
1393 g_object_unref(flag);
1408 gtk_combo_box_set_active(GTK_COMBO_BOX(combo), index);
1409 gtk_widget_show(combo);
1422 GdkPixbuf *pixbuf = NULL;
1491 GdkPixbuf *pixbuf = NULL;
1516 parent = gtk_widget_get_parent(old);
1521 gtk_widget_hide(old);
1523 if (GTK_IS_FRAME(parent)) {
1524 gtk_frame_set_child(GTK_FRAME(parent),
new);
1528 gtk_box_remove(GTK_BOX(parent), old);
1529 gtk_box_append(GTK_BOX(parent),
new);
1532 gtk_widget_show(
new);
1540 GdkPixbuf *pixbuf = NULL;
1564 gtk_picture_set_pixbuf(GTK_PICTURE(ei->
mode_pic), pixbuf);
1566 g_object_unref(pixbuf);
1570 fc_snprintf(buf,
sizeof(buf),
"<span weight=\"bold\">%s</span>",
1572 gtk_label_set_markup(GTK_LABEL(ei->
tool_label), buf);
1585 gtk_picture_set_pixbuf(GTK_PICTURE(ei->
tool_pic), pixbuf);
1587 g_object_unref(G_OBJECT(pixbuf));
1592 gtk_picture_set_pixbuf(GTK_PICTURE(ei->
tool_pic), pixbuf);
1594 g_object_unref(pixbuf);
1687 if (state & GDK_CONTROL_MASK) {
1691 if (state & GDK_SHIFT_MASK) {
1727 case GDK_KEY_KP_Add:
1739 case GDK_KEY_underscore:
1740 case GDK_KEY_KP_Subtract:
1859 g_object_unref(ei->
widget);
int send_chat_printf(const char *format,...)
int send_chat(const char *message)
bool client_is_global_observer(void)
int client_player_number(void)
editgui_notify_object_changed
int edit_buffer_get_status_string(const struct edit_buffer *ebuf, char *buf, int buflen)
bool editor_is_active(void)
int editor_tool_get_size(enum editor_tool_type ett)
void editor_set_tool(enum editor_tool_type ett)
void editor_mouse_button_press(int canvas_x, int canvas_y, int button, int modifiers)
void editor_mouse_move(int canvas_x, int canvas_y, int modifiers)
enum editor_tool_mode editor_tool_get_mode(enum editor_tool_type ett)
void editor_tool_set_count(enum editor_tool_type ett, int count)
void editor_tool_toggle_mode(enum editor_tool_type ett, enum editor_tool_mode etm)
const char * editor_tool_get_value_name(enum editor_tool_type emt, int value)
int editor_tool_get_value(enum editor_tool_type ett)
struct edit_buffer * editor_get_copy_buffer(void)
void editor_tool_set_applied_player(enum editor_tool_type ett, int player_no)
const char * editor_tool_get_mode_name(enum editor_tool_type ett, enum editor_tool_mode etm)
void editor_tool_cycle_mode(enum editor_tool_type ett)
int editor_tool_get_count(enum editor_tool_type ett)
void editor_tool_set_size(enum editor_tool_type ett, int size)
const char * editor_get_mode_tooltip(enum editor_tool_mode etm)
bool editor_tool_is_usable(enum editor_tool_type ett)
enum editor_tool_type editor_get_tool(void)
bool editor_tool_has_applied_player(enum editor_tool_type ett)
bool editor_tool_has_size(enum editor_tool_type ett)
void editor_tool_set_value(enum editor_tool_type ett, int value)
bool editor_tool_has_value(enum editor_tool_type ett)
const char * editor_tool_get_tooltip(enum editor_tool_type ett)
void editor_mouse_button_release(int canvas_x, int canvas_y, int button, int modifiers)
struct sprite * editor_tool_get_sprite(enum editor_tool_type ett)
void editor_apply_tool_to_selection(void)
bool editor_tool_has_mode(enum editor_tool_type ett, enum editor_tool_mode etm)
int editor_tool_get_applied_player(enum editor_tool_type ett)
bool editor_tool_has_count(enum editor_tool_type ett)
struct sprite * editor_get_mode_sprite(enum editor_tool_mode etm)
const char * editor_tool_get_name(enum editor_tool_type ett)
void editor_tool_set_mode(enum editor_tool_type ett, enum editor_tool_mode etm)
#define FC_STATIC_CANVAS_INIT
static void refresh_all_buttons(struct editbar *eb)
static void editbar_player_properties_button_clicked(GtkButton *b, gpointer userdata)
tool_applied_player_columns
static bool editgui_run_tool_selection(enum editor_tool_type ett)
static void editinfobox_refresh(struct editinfobox *ei)
void editgui_popup_properties(const struct tile_list *tiles, int objtype)
void editgui_notify_object_created(int tag, int id)
static void clear_tool_stores(struct editbar *eb)
static int convert_modifiers(int gdk_event_state)
static void try_to_set_editor_tool(enum editor_tool_type ett)
static void clear_tool_store(GtkListStore *store)
gboolean handle_edit_mouse_button_release(GdkEventButton *ev)
static gboolean handle_edit_key_press_with_ctrl(GdkEventKey *ev)
gboolean handle_edit_key_press(GdkEventKey *ev)
static int tool_value_selector_run(struct tool_value_selector *tvs)
static void editbar_add_mode_button(struct editbar *eb, enum editor_tool_mode etm)
static void editbar_tool_button_toggled(GtkToggleButton *tb, gpointer userdata)
static void editbar_add_tool_button(struct editbar *eb, enum editor_tool_type ett)
void editgui_create_widgets(void)
static struct editbar * editbar_create(void)
void editgui_popdown_all(void)
static void editbar_reload_tileset(struct editbar *eb)
static void tool_value_selector_treeview_row_activated(GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer user_data)
static void editinfobox_spin_button_value_changed(GtkSpinButton *spinbutton, gpointer userdata)
static void refresh_tool_applied_player_combo(struct editinfobox *ei)
static void editbar_mode_button_toggled(GtkToggleButton *tb, gpointer userdata)
static void editinfobox_tool_applied_player_changed(GtkComboBox *combo, gpointer userdata)
static gboolean handle_edit_key_press_with_shift(GdkEventKey *ev)
static void refresh_all_tool_value_selectors(struct editbar *eb)
gboolean handle_edit_mouse_button_press(GdkEventButton *ev)
static struct tool_value_selector * create_tool_value_selector(struct editbar *eb_parent, enum editor_tool_type ett)
static GdkPixbuf * create_terrain_pixbuf(struct terrain *pterrain)
static void replace_widget(GtkWidget *old, GtkWidget *new)
static void editbar_player_pov_combobox_changed(GtkComboBox *combo, gpointer user_data)
struct editinfobox * editgui_get_editinfobox(void)
gboolean handle_edit_mouse_move(GdkEventMotion *ev)
tool_value_selector_columns
void editgui_refresh(void)
static void editbar_refresh(struct editbar *eb)
static struct editinfobox * editor_infobox
static struct editbar * editor_toolbar
static gboolean editinfobox_handle_tool_image_button_press(GtkWidget *evbox, GdkEventButton *ev, gpointer data)
struct editbar * editgui_get_editbar(void)
static void refresh_tool_value_selector(struct editbar *eb, enum editor_tool_type ett)
static struct editinfobox * editinfobox_create(void)
static void refresh_player_pov_indicator(struct editbar *eb)
void editgui_tileset_changed(void)
static gboolean editinfobox_handle_mode_image_button_press(GtkWidget *evbox, GdkEventButton *ev, gpointer data)
static GdkPixbuf * get_tool_value_pixbuf(enum editor_tool_type ett, int value)
static GdkPixbuf * get_tool_mode_pixbuf(enum editor_tool_mode etm)
void property_editor_handle_object_changed(struct property_editor *pe, enum editor_object_type objtype, int object_id, bool remove)
void property_editor_handle_object_created(struct property_editor *pe, int tag, int object_id)
void property_editor_popup(struct property_editor *pe, enum editor_object_type objtype)
struct property_editor * editprop_get_property_editor(void)
void property_editor_reload(struct property_editor *pe, enum editor_object_type objtype)
void property_editor_popdown(struct property_editor *pe)
void property_editor_load_tiles(struct property_editor *pe, const struct tile_list *tiles)
void property_editor_clear(struct property_editor *pe)
GtkWidget * unit_info_box
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)
GdkPixbuf * create_extra_pixbuf(const struct extra_type *pextra)
static gboolean editbar_tool_right_button(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
gint blocking_dialog(GtkWidget *dlg)
#define fc_assert_ret(condition)
#define fc_assert(condition)
void put_drawn_sprites(struct canvas *pcanvas, float zoom, int canvas_x, int canvas_y, int count, struct drawn_sprite *pdrawn, bool fog)
#define fc_calloc(n, esz)
#define NO_NATION_SELECTED
struct player * player_by_number(const int player_id)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
#define players_iterate_end
#define players_iterate(_pplayer)
cairo_surface_t * surface
GtkWidget * tool_buttons[NUM_EDITOR_TOOL_TYPES]
GtkWidget * player_pov_combobox
GtkListStore * player_pov_store
GtkSizeGroup * size_group
GtkWidget * mode_buttons[NUM_EDITOR_TOOL_MODES]
struct tool_value_selector * tool_selectors[NUM_EDITOR_TOOL_TYPES]
GtkListStore * tool_applied_player_store
GtkWidget * size_spin_button
GtkWidget * tool_applied_player_combobox
GtkWidget * tool_value_label
GtkWidget * count_spin_button
struct sprite * copypaste
struct sprite * properties
int fc_snprintf(char *str, size_t n, const char *format,...)
const char * terrain_name_translation(const struct terrain *pterrain)
struct terrain * terrain_by_number(const Terrain_type_id type)
Terrain_type_id terrain_number(const struct terrain *pterrain)
#define terrain_type_iterate(_p)
#define terrain_type_iterate_end
struct sprite * get_unittype_sprite(const struct tileset *t, const struct unit_type *punittype, enum direction8 facing)
int fill_basic_terrain_layer_sprite_array(struct tileset *t, struct drawn_sprite *sprs, int layer, struct terrain *pterrain)
int tileset_tile_height(const struct tileset *t)
int tileset_tile_width(const struct tileset *t)
const struct editor_sprites * get_editor_sprites(const struct tileset *t)
struct unit_type * utype_by_number(const Unit_type_id id)
Unit_type_id utype_number(const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
#define unit_type_iterate(_p)
#define unit_type_iterate_end