23#include <gdk/gdkkeysyms.h>
52#define MAX_CHATLINE_HISTORY 20
73 return gtk_widget_has_focus(
toolkit.entry);
81 gtk_widget_grab_focus(
toolkit.entry);
89 return gtk_widget_get_mapped(
toolkit.entry);
110 if (s[0] ==
'\'' || s[0] ==
'"') {
111 p = strchr(s + 1, s[0]);
125 while (p != NULL && *p !=
'\0') {
141 const char *theinput;
143 theinput = gtk_entry_get_text(w);
169 gtk_entry_set_text(w,
"");
184 return pplayer->
name;
203 const char **matches,
204 const int max_matches)
206 int matches_id[max_matches * 2], ind, num;
212 prefix, &ind, matches_id,
213 max_matches * 2, &num)) {
224 for (i = 0; i < num && c < max_matches; i++) {
226 for (j = 0; j < c; j++) {
259 char *buf,
size_t buf_len)
266 for (i = 1; i < num_prefixes; i++) {
267 for (p = prefixes[i], q = buf; *p !=
'\0' && *q !=
'\0';
268 p = g_utf8_next_char(p), q = g_utf8_next_char(q)) {
269 if (g_unichar_toupper(g_utf8_get_char(p))
270 != g_unichar_toupper(g_utf8_get_char(q))) {
277 return g_utf8_strlen(buf, -1);
286#define MAX_MATCHES 10
290 gchar *chars, *p, *prev;
295 pos = gtk_editable_get_position(editable);
296 chars = gtk_editable_get_chars(editable, 0,
pos);
298 p = chars + strlen(chars);
299 while ((prev = g_utf8_find_prev_char(chars, p))) {
300 if (!g_unichar_isalnum(g_utf8_get_char(prev))) {
307 prefix_len = g_utf8_strlen(p, -1);
308 if (0 == prefix_len) {
317 gtk_editable_delete_text(editable,
pos - prefix_len,
pos);
319 gtk_editable_insert_text(editable,
name[0], strlen(
name[0]), &
pos);
320 gtk_editable_set_position(editable,
pos);
323 }
else if (num > 1) {
325 gtk_editable_delete_text(editable,
pos - prefix_len,
pos);
327 gtk_editable_insert_text(editable, buf, strlen(buf), &
pos);
328 gtk_editable_set_position(editable,
pos);
331 for (i = 1; i < num; i++) {
347 if ((ev->state & GDK_CONTROL_MASK)) {
349 switch (ev->keyval) {
376 switch (ev->keyval) {
379 gtk_entry_set_text(GTK_ENTRY(w),
381 gtk_editable_set_position(GTK_EDITABLE(w), -1);
391 gtk_entry_set_text(GTK_ENTRY(w),
394 gtk_entry_set_text(GTK_ENTRY(w),
"");
396 gtk_editable_set_position(GTK_EDITABLE(w), -1);
419 GtkEditable *editable = GTK_EDITABLE(
entry);
420 gint start_pos, end_pos;
422 gchar *fg_color_text = NULL, *bg_color_text = NULL;
424 if (!gtk_editable_get_selection_bounds(editable, &start_pos, &end_pos)) {
426 start_pos = end_pos = gtk_editable_get_position(editable);
429 selection = gtk_editable_get_chars(editable, start_pos, end_pos);
433 GdkRGBA *fg_color = g_object_get_data(G_OBJECT(
entry),
"fg_color");
434 GdkRGBA *bg_color = g_object_get_data(G_OBJECT(
entry),
"bg_color");
436 if (!fg_color && !bg_color) {
441 fg_color_text = gdk_rgba_to_string(fg_color);
444 bg_color_text = gdk_rgba_to_string(bg_color);
459 gtk_editable_delete_text(editable, start_pos, end_pos);
461 gtk_editable_insert_text(editable, buf, -1, &end_pos);
462 gtk_editable_select_region(editable, start_pos, end_pos);
466 g_free(fg_color_text);
467 g_free(bg_color_text);
478 GtkEditable *editable = GTK_EDITABLE(
entry);
479 gint start_pos, end_pos;
494 if (gtk_editable_get_selection_bounds(editable, &start_pos, &end_pos)) {
499 chars = gtk_editable_get_chars(editable, start_pos, end_pos);
514 gtk_editable_delete_text(editable, start_pos, end_pos);
516 gtk_editable_insert_text(editable, buf, -1, &end_pos);
517 gtk_widget_grab_focus(
entry);
518 gtk_editable_select_region(editable, start_pos, end_pos);
522 start_pos = gtk_editable_get_position(editable);
524 chars = gtk_editable_get_chars(editable,
MAX(start_pos - 1, 0),
534 if (start_pos > 0 && strlen(chars) > 0 && chars[0] !=
' ') {
536 gtk_editable_insert_text(editable,
" ", 1, &end_pos);
538 gtk_editable_insert_text(editable, buf, -1, &end_pos);
539 if (chars[start_pos > 0 ? 1 : 0] !=
'\0'
540 && chars[start_pos > 0 ? 1 : 0] !=
' ') {
542 gtk_editable_insert_text(editable,
" ", 1, &end_pos);
544 gtk_widget_grab_focus(
entry);
545 gtk_editable_set_position(editable, end_pos);
561 gdouble val, max, upper, page_size;
566 sw = gtk_widget_get_parent(GTK_WIDGET(textview));
570 vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw));
571 val = gtk_adjustment_get_value(vadj);
572 g_object_get(G_OBJECT(vadj),
"upper", &upper,
573 "page-size", &page_size, NULL);
574 max = upper - page_size;
575 if (max - val < 10.0) {
576 gtk_text_view_scroll_to_mark(GTK_TEXT_VIEW(textview), scroll_target,
577 0.0,
TRUE, 1.0, 0.0);
586 GtkTextIter start, end, iter;
587 GtkTextBuffer *buffer;
590 struct tile *ptile = NULL;
592 if (
event->type != GDK_BUTTON_RELEASE ||
event->button != 1) {
596 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
599 gtk_text_buffer_get_selection_bounds(buffer, &start, &end);
600 if (gtk_text_iter_get_offset(&start) != gtk_text_iter_get_offset(&end)) {
604 gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW (text_view),
605 GTK_TEXT_WINDOW_WIDGET,
608 gtk_text_view_get_iter_at_location(GTK_TEXT_VIEW(text_view), &iter, x, y);
610 if ((tags = gtk_text_iter_get_tags(&iter))) {
611 for (tagp = tags; tagp; tagp = tagp->next) {
612 GtkTextTag *tag = tagp->data;
614 GPOINTER_TO_INT(g_object_get_data(G_OBJECT(tag),
"type"));
618 int id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(tag),
"id"));
642 _(
"This tile doesn't exist in this game!"));
661 gtk_widget_grab_focus(GTK_WIDGET(
map_canvas));
676 static gboolean hovering_over_link =
FALSE;
677 static GdkCursor *hand_cursor = NULL;
678 static GdkCursor *regular_cursor = NULL;
681 gboolean hovering =
FALSE;
685 hand_cursor = gdk_cursor_new_for_display(
686 gtk_widget_get_display(GTK_WIDGET(text_view)), GDK_HAND2);
688 if (!regular_cursor) {
689 regular_cursor = gdk_cursor_new_for_display(
690 gtk_widget_get_display(GTK_WIDGET(text_view)), GDK_XTERM);
693 gtk_text_view_get_iter_at_location(text_view, &iter, x, y);
695 tags = gtk_text_iter_get_tags(&iter);
696 for (tagp = tags; tagp; tagp = tagp->next) {
698 GPOINTER_TO_INT(g_object_get_data(G_OBJECT(tagp->data),
"type"));
706 if (hovering != hovering_over_link) {
707 hovering_over_link = hovering;
709 if (hovering_over_link) {
710 gdk_window_set_cursor(gtk_text_view_get_window(text_view,
711 GTK_TEXT_WINDOW_TEXT),
714 gdk_window_set_cursor(gtk_text_view_get_window(text_view,
715 GTK_TEXT_WINDOW_TEXT),
729 GdkEventMotion *
event)
733 gtk_text_view_window_to_buffer_coords(GTK_TEXT_VIEW(text_view),
734 GTK_TEXT_WINDOW_WIDGET,
746 g_signal_connect(
view,
"event-after",
748 g_signal_connect(
view,
"motion-notify-event",
759 GtkTextIter start, stop;
762 gtk_text_buffer_create_tag(buf,
"bold",
763 "weight", PANGO_WEIGHT_BOLD, NULL);
764 gtk_text_buffer_create_tag(buf,
"italic",
765 "style", PANGO_STYLE_ITALIC, NULL);
766 gtk_text_buffer_create_tag(buf,
"strike",
767 "strikethrough",
TRUE, NULL);
768 gtk_text_buffer_create_tag(buf,
"underline",
769 "underline", PANGO_UNDERLINE_SINGLE, NULL);
778 gtk_text_buffer_get_iter_at_offset(buf, &start, text_start_offset
779 + g_utf8_pointer_to_offset(text,
782 gtk_text_buffer_get_end_iter(buf, &stop);
784 gtk_text_buffer_get_iter_at_offset(buf, &stop, text_start_offset
785 + g_utf8_pointer_to_offset(text,
791 gtk_text_buffer_apply_tag_by_name(buf,
"bold", &start, &stop);
794 gtk_text_buffer_apply_tag_by_name(buf,
"italic", &start, &stop);
797 gtk_text_buffer_apply_tag_by_name(buf,
"strike", &start, &stop);
800 gtk_text_buffer_apply_tag_by_name(buf,
"underline", &start, &stop);
805 GtkTextTag *tag = NULL;
809 if (foreground && foreground[0]) {
810 if (background && background[0]) {
811 tag = gtk_text_buffer_create_tag(buf, NULL,
812 "foreground", foreground,
813 "background", background,
816 tag = gtk_text_buffer_create_tag(buf, NULL,
817 "foreground", foreground,
820 }
else if (background && background[0]) {
821 tag = gtk_text_buffer_create_tag(buf, NULL,
822 "background", background,
829 gtk_text_buffer_apply_tag(buf, tag, &start, &stop);
853 tag = gtk_text_buffer_create_tag(buf, NULL,
854 "foreground-rgba", &
pcolor->color,
855 "underline", PANGO_UNDERLINE_SINGLE,
860 g_object_set_data(G_OBJECT(tag),
"type",
862 g_object_set_data(G_OBJECT(tag),
"id",
864 gtk_text_buffer_apply_tag(buf, tag, &start, &stop);
875 const struct text_tag_list *tags,
891 gtk_text_buffer_get_end_iter(buf, &iter);
892 gtk_text_buffer_insert(buf, &iter,
"\n", -1);
893 mark = gtk_text_buffer_create_mark(buf, NULL, &iter,
TRUE);
902 strftime(timebuf,
sizeof(timebuf),
"[%H:%M:%S] ", &now_tm);
903 gtk_text_buffer_insert(buf, &iter, timebuf, -1);
906 text_start_offset = gtk_text_iter_get_offset(&iter);
907 gtk_text_buffer_insert(buf, &iter,
astring, -1);
918 gtk_text_buffer_delete_mark(buf, mark);
930 GtkTextIter start, end;
963 gdouble val, max, upper, page_size;
975 sw = gtk_widget_get_parent(w);
976 vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(sw));
977 val = gtk_adjustment_get_value(vadj);
978 g_object_get(G_OBJECT(vadj),
"upper", &upper,
979 "page-size", &page_size, NULL);
980 max = upper - page_size;
983 return max - val < 0.00000001;
998 *((guint *) data) = 0;
1008 static guint callback_id = 0;
1011 if (callback_id == 0) {
1021 &end, 0.0,
TRUE, 1.0, 0.0);
1025 &end, 0.0,
TRUE, 1.0, 0.0);
1036 GPOINTER_TO_INT(g_object_get_data(G_OBJECT(button),
1043static void color_set(GObject *
object,
const gchar *color_target,
1044 GdkRGBA *
color, GtkToolButton *button)
1046 GdkRGBA *current_color = g_object_get_data(
object, color_target);
1048 if (NULL ==
color) {
1050 if (NULL != current_color) {
1051 gdk_rgba_free(current_color);
1052 g_object_set_data(
object, color_target, NULL);
1053 if (NULL != button) {
1054 gtk_tool_button_set_icon_widget(button, NULL);
1059 if (NULL != current_color) {
1061 *current_color = *
color;
1064 current_color = gdk_rgba_copy(
color);
1065 g_object_set_data(
object, color_target, current_color);
1068 if (NULL != button) {
1074 cairo_surface_t *surface = cairo_image_surface_create(
1075 CAIRO_FORMAT_RGB24, 16, 16);
1076 cairo_t *cr = cairo_create(surface);
1077 gdk_cairo_set_source_rgba(cr, current_color);
1080 pixbuf = gdk_pixbuf_get_from_surface(surface, 0, 0, 16, 16);
1081 cairo_surface_destroy(surface);
1083 image = gtk_image_new_from_pixbuf(pixbuf);
1084 gtk_tool_button_set_icon_widget(button, image);
1085 gtk_widget_show(image);
1086 g_object_unref(G_OBJECT(pixbuf));
1096 GtkToolButton *button =
1097 GTK_TOOL_BUTTON(g_object_get_data(G_OBJECT(dialog),
"button"));
1098 const gchar *color_target =
1099 g_object_get_data(G_OBJECT(button),
"color_target");
1101 if (res == GTK_RESPONSE_REJECT) {
1103 color_set(G_OBJECT(data), color_target, NULL, button);
1104 }
else if (res == GTK_RESPONSE_OK) {
1106 GtkColorChooser *chooser =
1107 GTK_COLOR_CHOOSER(g_object_get_data(G_OBJECT(dialog),
"chooser"));
1110 gtk_color_chooser_get_rgba(chooser, &new_color);
1111 color_set(G_OBJECT(data), color_target, &new_color, button);
1114 gtk_widget_destroy(GTK_WIDGET(dialog));
1122 GtkWidget *dialog, *chooser;
1124 const gchar *color_target = g_object_get_data(G_OBJECT(button),
1126 GdkRGBA *current_color = g_object_get_data(G_OBJECT(data), color_target);
1129 gchar *buf = g_strdup_printf(
_(
"Select the %s color"),
1130 (
const char *) g_object_get_data(G_OBJECT(button),
1132 dialog = gtk_dialog_new_with_buttons(buf, NULL, GTK_DIALOG_MODAL,
1133 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
1134 GTK_STOCK_CLEAR, GTK_RESPONSE_REJECT,
1135 GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
1137 g_object_set_data(G_OBJECT(dialog),
"button", button);
1138 g_signal_connect(dialog,
"response", G_CALLBACK(
color_selected), data);
1140 chooser = gtk_color_chooser_widget_new();
1141 gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
1143 g_object_set_data(G_OBJECT(dialog),
"chooser", chooser);
1144 if (current_color) {
1145 gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(chooser), current_color);
1148 gtk_widget_show_all(dialog);
1159 GtkWidget *parent = gtk_widget_get_parent(ptoolkit->
main_widget);
1160 GtkWidget *
button_box = GTK_WIDGET(g_object_get_data(G_OBJECT(toolkit_view),
1165 if (parent == toolkit_view) {
1172 gtk_widget_hide(ptoolkit->
toolbar);
1174 gtk_widget_reparent(ptoolkit->
main_widget, toolkit_view);
1176 gtk_widget_show(ptoolkit->
toolbar);
1185 gtk_widget_hide(ptoolkit->
toolbar);
1189 list = gtk_container_get_children(GTK_CONTAINER(ptoolkit->
button_box));
1190 for (iter =
list; iter != NULL; iter = g_list_next(iter)) {
1191 GtkWidget *
widget = GTK_WIDGET(iter->data);
1201 gtk_container_add(GTK_CONTAINER(toolkit_view), ptoolkit->
main_widget);
1216 GtkToggleButton *button = GTK_TOGGLE_BUTTON(
toolkit.toggle_button);
1219 if (!gtk_toggle_button_get_active(button)) {
1221 gtk_toggle_button_set_active(button,
TRUE);
1224 gtk_widget_show(ptoolkit->
toolbar);
1227 if (gtk_toggle_button_get_active(button)) {
1229 gtk_toggle_button_set_active(button,
FALSE);
1232 gtk_widget_hide(ptoolkit->
toolbar);
1246 if (gtk_toggle_button_get_active(button)) {
1247 gtk_widget_show(ptoolkit->
toolbar);
1254 gtk_widget_hide(ptoolkit->
toolbar);
1268 GtkWidget *toolkit_view, *bbox;
1271 toolkit_view = gtk_grid_new();
1272 gtk_orientable_set_orientation(GTK_ORIENTABLE(toolkit_view),
1273 GTK_ORIENTATION_VERTICAL);
1274 g_signal_connect_after(toolkit_view,
"map",
1278 bbox = gtk_grid_new();
1279 gtk_grid_set_column_spacing(GTK_GRID(bbox), 12);
1280 g_object_set_data(G_OBJECT(toolkit_view),
"button_box", bbox);
1282 return toolkit_view;
1291 gtk_container_add(GTK_CONTAINER(g_object_get_data(G_OBJECT(toolkit_view),
1292 "button_box")), button);
1300 GtkWidget *vbox, *
toolbar, *hbox, *button, *
entry, *bbox;
1313 vbox = gtk_grid_new();
1314 gtk_grid_set_row_spacing(GTK_GRID(vbox), 2);
1315 gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox),
1316 GTK_ORIENTATION_VERTICAL);
1318 g_signal_connect_after(vbox,
"map",
1321 entry = gtk_entry_new();
1322 g_object_set(
entry,
"margin", 2, NULL);
1328 gtk_container_add(GTK_CONTAINER(vbox),
toolbar);
1329 gtk_toolbar_set_icon_size(GTK_TOOLBAR(
toolbar), GTK_ICON_SIZE_MENU);
1330 gtk_toolbar_set_show_arrow(GTK_TOOLBAR(
toolbar),
FALSE);
1331 gtk_toolbar_set_style(GTK_TOOLBAR(
toolbar), GTK_TOOLBAR_BOTH_HORIZ);
1332 gtk_orientable_set_orientation(GTK_ORIENTABLE(
toolbar),
1333 GTK_ORIENTATION_HORIZONTAL);
1337 item = gtk_tool_button_new_from_stock(GTK_STOCK_BOLD);
1338 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
item, -1);
1339 g_object_set_data(G_OBJECT(
item),
"text_tag_type",
1342 gtk_widget_set_tooltip_text(GTK_WIDGET(
item),
_(
"Bold (Ctrl-B)"));
1345 item = gtk_tool_button_new_from_stock(GTK_STOCK_ITALIC);
1346 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
item, -1);
1347 g_object_set_data(G_OBJECT(
item),
"text_tag_type",
1350 gtk_widget_set_tooltip_text(GTK_WIDGET(
item),
_(
"Italic (Ctrl-I)"));
1353 item = gtk_tool_button_new_from_stock(GTK_STOCK_STRIKETHROUGH);
1354 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
item, -1);
1355 g_object_set_data(G_OBJECT(
item),
"text_tag_type",
1358 gtk_widget_set_tooltip_text(GTK_WIDGET(
item),
_(
"Strikethrough (Ctrl-S)"));
1361 item = gtk_tool_button_new_from_stock(GTK_STOCK_UNDERLINE);
1362 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
item, -1);
1363 g_object_set_data(G_OBJECT(
item),
"text_tag_type",
1366 gtk_widget_set_tooltip_text(GTK_WIDGET(
item),
_(
"Underline (Ctrl-U)"));
1369 item = gtk_tool_button_new_from_stock(GTK_STOCK_SELECT_COLOR);
1370 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
item, -1);
1371 g_object_set_data(G_OBJECT(
item),
"text_tag_type",
1374 gtk_widget_set_tooltip_text(GTK_WIDGET(
item),
_(
"Color (Ctrl-C)"));
1376 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
1377 gtk_separator_tool_item_new(), -1);
1380 item = gtk_tool_button_new(NULL,
"");
1381 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
item, -1);
1382 g_object_set_data(G_OBJECT(
item),
"color_target",
fc_strdup(
"fg_color"));
1383 g_object_set_data(G_OBJECT(
item),
"color_info",
1385 g_signal_connect(
item,
"clicked",
1387 gtk_widget_set_tooltip_text(GTK_WIDGET(
item),
_(
"Select the text color"));
1388 if (gdk_rgba_parse(&
color,
"#000000")) {
1392 log_error(
"Failed to set the default foreground color.");
1396 item = gtk_tool_button_new(NULL,
"");
1397 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
item, -1);
1398 g_object_set_data(G_OBJECT(
item),
"color_target",
fc_strdup(
"bg_color"));
1399 g_object_set_data(G_OBJECT(
item),
"color_info",
1401 g_signal_connect(
item,
"clicked",
1403 gtk_widget_set_tooltip_text(GTK_WIDGET(
item),
1404 _(
"Select the background color"));
1405 if (gdk_rgba_parse(&
color,
"#ffffff")) {
1409 log_error(
"Failed to set the default background color.");
1412 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
1413 gtk_separator_tool_item_new(), -1);
1416 item = gtk_tool_button_new_from_stock(GTK_STOCK_OK);
1417 gtk_toolbar_insert(GTK_TOOLBAR(
toolbar),
item, -1);
1418 g_signal_connect_swapped(
item,
"clicked",
1420 gtk_widget_set_tooltip_text(GTK_WIDGET(
item),
1422 _(
"Send the chat (Return)"));
1425 hbox = gtk_grid_new();
1426 gtk_grid_set_column_spacing(GTK_GRID(hbox), 4);
1427 gtk_container_add(GTK_CONTAINER(vbox), hbox);
1430 button = gtk_toggle_button_new();
1431 g_object_set(button,
"margin", 2, NULL);
1432 gtk_container_add(GTK_CONTAINER(hbox), button);
1433 gtk_button_set_image(GTK_BUTTON(button),
1435 GTK_ICON_SIZE_MENU));
1437 gtk_widget_set_tooltip_text(GTK_WIDGET(button),
_(
"Chat tools"));
1438 toolkit.toggle_button = button;
1441 gtk_container_add(GTK_CONTAINER(hbox),
entry);
1443 g_signal_connect(
entry,
"key_press_event",
1447 bbox = gtk_grid_new();
1448 gtk_container_add(GTK_CONTAINER(hbox), bbox);
1457 char *vertext = (
char *)user_data;
1463 return G_SOURCE_REMOVE;
1471 int len = strlen(vertext) + 1;
struct canvas int int struct sprite bool int int fog_y struct canvas struct sprite struct color * pcolor
#define CHAT_DIRECT_PREFIX
#define CHAT_ALLIES_PREFIX
#define SERVER_COMMAND_PREFIX
int send_chat(const char *message)
void output_window_append(const struct ft_color color, const char *featured_text)
void write_chatline_content(const char *txt)
void output_window_printf(const struct ft_color color, const char *format,...)
enum client_states client_state(void)
struct tile * client_city_tile(const struct city *pcity)
static struct fc_sockaddr_list * list
struct color * get_color(const struct tileset *t, enum color_std stdcolor)
struct unit * find_visible_unit(struct tile *ptile)
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
size_t featured_text_apply_tag(const char *text_source, char *featured_text, size_t featured_text_len, enum text_tag_type tag_type, ft_offset_t start_offset, ft_offset_t stop_offset,...)
enum text_link_type text_tag_link_type(const struct text_tag *ptag)
const char * tile_link(const struct tile *ptile)
ft_offset_t text_tag_stop_offset(const struct text_tag *ptag)
const char * text_tag_color_foreground(const struct text_tag *ptag)
const struct ft_color ftc_client
const char * city_link(const struct city *pcity)
int text_tag_link_id(const struct text_tag *ptag)
ft_offset_t text_tag_start_offset(const struct text_tag *ptag)
const char * unit_link(const struct unit *punit)
const char * text_tag_color_background(const struct text_tag *ptag)
#define text_tag_list_iterate_end
#define text_tag_list_iterate(tags, ptag)
static struct ft_color ft_color_construct(const char *foreground, const char *background)
struct unit * game_unit_by_number(int id)
struct city * game_city_by_number(int id)
bool genlist_remove(struct genlist *pgenlist, const void *punlink)
struct genlist * genlist_new(void)
void * genlist_get(const struct genlist *pgenlist, int idx)
void genlist_prepend(struct genlist *pgenlist, void *data)
int genlist_size(const struct genlist *pgenlist)
bool inputline_has_focus(void)
static void set_cursor_if_appropriate(GtkTextView *text_view, gint x, gint y)
static size_t get_common_prefix(const char *const *prefixes, size_t num_prefixes, char *buf, size_t buf_len)
#define MAX_CHATLINE_HISTORY
static gboolean version_message_main_thread(gpointer user_data)
void inputline_toolkit_view_append_button(GtkWidget *toolkit_view, GtkWidget *button)
void version_message(const char *vertext)
static const char * get_player_or_user_name(int id)
GtkWidget * inputline_toolkit_view_new(void)
void log_output_window(void)
static gboolean chatline_scroll_callback(gpointer data)
void set_message_buffer_view_link_handlers(GtkWidget *view)
static gboolean motion_notify_event(GtkWidget *text_view, GdkEventMotion *event)
static void button_toggled(GtkToggleButton *button, gpointer data)
static void select_color_callback(GtkToolButton *button, gpointer data)
void scroll_if_necessary(GtkTextView *textview, GtkTextMark *scroll_target)
bool inputline_is_visible(void)
static void color_selected(GtkDialog *dialog, gint res, gpointer data)
static bool is_plain_public_message(const char *s)
static bool chatline_autocomplete(GtkEditable *editable)
static struct genlist * history_list
void clear_output_window(void)
void apply_text_tag(const struct text_tag *ptag, GtkTextBuffer *buf, ft_offset_t text_start_offset, const char *text)
static void make_tag_callback(GtkToolButton *button, gpointer data)
static int check_player_or_user_name(const char *prefix, const char **matches, const int max_matches)
static struct inputline_toolkit toolkit
void inputline_make_chat_link(struct tile *ptile, bool unit)
bool chatline_is_scrolled_to_bottom(void)
static gboolean event_after(GtkWidget *text_view, GdkEventButton *event)
void real_output_window_append(const char *astring, const struct text_tag_list *tags, int conn_id)
static gboolean set_toolbar_visibility(GtkWidget *w, gpointer data)
static gboolean inputline_handler(GtkWidget *w, GdkEventKey *ev)
static void inputline_return(GtkEntry *w, gpointer data)
void inputline_grab_focus(void)
void chatline_scroll_to_bottom(bool delayed)
static gboolean move_toolkit(GtkWidget *toolkit_view, gpointer data)
static void inputline_make_tag(GtkEntry *entry, enum text_tag_type type)
GtkTextBuffer * message_buffer
GtkTextView * main_message_area
#define GUI_GTK_OPTION(optname)
void setup_dialog(GtkWidget *shell, GtkWidget *parent)
void append_network_statusbar(const char *text, bool force)
GtkWidget * start_message_area
static GtkWidget * persistent
#define set_output_window_text(_pstr_)
#define fc_assert_ret(condition)
#define log_error(message,...)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
void link_mark_restore(enum text_link_type type, int id)
void center_tile_mapcanvas(const struct tile *ptile)
#define color_set(color_tgt, color)
enum client_pages get_client_page(void)
struct player * player_by_number(const int player_id)
int player_slot_count(void)
enum m_pre_result match_prefix_full(m_pre_accessor_fn_t accessor_fn, size_t n_names, size_t max_len_name, m_pre_strncmp_fn_t cmp_fn, m_strlen_fn_t len_fn, const char *prefix, int *ind_result, int *matches, int max_matches, int *pnum_matches)
struct conn_list * all_connections
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
struct tm * fc_localtime(const time_t *timep, struct tm *result)
int cat_snprintf(char *str, size_t n, const char *format,...)
int fc_strncasecmp(const char *str0, const char *str1, size_t n)
#define sz_strlcpy(dest, src)
struct city * tile_city(const struct tile *ptile)