1025 GtkWidget *page, *hgrid, *hgrid2, *label;
1026 GtkWidget *frame, *table, *table2, *paned, *sw, *text;
1027 GtkWidget *button, *
view, *mainbox, *vbox, *right_vbox = NULL;
1030 GtkWidget *dtach_lowbox = NULL;
1036 GtkGesture *mc_gesture;
1037 GtkEventController *mc_controller;
1042 notebook = gtk_notebook_new();
1045 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook),
FALSE);
1046 gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook),
FALSE);
1047 mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 4);
1048 gtk_window_set_child(GTK_WINDOW(
toplevel), mainbox);
1049 gtk_box_append(GTK_BOX(mainbox), notebook);
1051 gtk_box_append(GTK_BOX(mainbox),
statusbar);
1053 gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
1055 gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
1057 gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
1059 gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
1061 gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
1074 page = gtk_scrolled_window_new();
1075 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(page),
1076 GTK_POLICY_AUTOMATIC,
1077 GTK_POLICY_AUTOMATIC);
1078 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(page),
1080 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, NULL);
1083 gtk_orientable_set_orientation(GTK_ORIENTABLE(
top_vbox),
1084 GTK_ORIENTATION_VERTICAL);
1085 gtk_grid_set_row_spacing(GTK_GRID(
top_vbox), 5);
1086 hgrid = gtk_grid_new();
1091 right_vbox = gtk_grid_new();
1093 gtk_orientable_set_orientation(GTK_ORIENTABLE(right_vbox),
1094 GTK_ORIENTATION_VERTICAL);
1095 gtk_grid_attach(GTK_GRID(hgrid), right_vbox, grid_col++, 0, 1, 1);
1097 paned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
1098 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(page),
top_vbox);
1099 gtk_grid_attach(GTK_GRID(
top_vbox), hgrid, 0, top_row++, 1, 1);
1100 gtk_grid_attach(GTK_GRID(right_vbox), paned, 0, right_row++, 1, 1);
1101 gtk_grid_attach(GTK_GRID(right_vbox),
ingame_votebar, 0, right_row++, 1, 1);
1109 paned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
1110 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(page), paned);
1111 gtk_paned_set_start_child(GTK_PANED(paned),
top_vbox);
1112 gtk_grid_attach(GTK_GRID(
top_vbox), hgrid, 0, top_row++, 1, 1);
1120 vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 3);
1123 gtk_grid_attach_next_to(GTK_GRID(hgrid), vbox, right_vbox,
1124 GTK_POS_LEFT, 1, 1);
1131 gtk_box_append(GTK_BOX(vbox),
ahbox);
1140 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
1160 mc_controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
1161 g_signal_connect(mc_controller,
"pressed",
1164 mc_gesture = gtk_gesture_click_new();
1165 gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(mc_gesture), 3);
1166 mc_controller = GTK_EVENT_CONTROLLER(mc_gesture);
1167 g_signal_connect(mc_controller,
"pressed",
1170 mc_controller = gtk_event_controller_motion_new();
1171 g_signal_connect(mc_controller,
"motion",
1177 gtk_box_append(GTK_BOX(vbox),
ahbox);
1181 gtk_widget_set_valign(
avbox, GTK_ALIGN_FILL);
1184 frame = gtk_frame_new(
"");
1185 gtk_box_append(GTK_BOX(
avbox), frame);
1189 mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
1190 gtk_frame_set_child(GTK_FRAME(frame), mainbox);
1191 gtk_widget_set_hexpand(mainbox,
TRUE);
1193 label = gtk_label_new(NULL);
1194 gtk_widget_set_halign(label, GTK_ALIGN_START);
1195 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
1196 gtk_widget_set_margin_start(label, 2);
1197 gtk_widget_set_margin_end(label, 2);
1198 gtk_widget_set_margin_top(label, 2);
1199 gtk_widget_set_margin_bottom(label, 2);
1201 mc_controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
1202 g_signal_connect(mc_controller,
"pressed",
1204 gtk_widget_add_controller(label, mc_controller);
1205 gtk_box_append(GTK_BOX(mainbox), label);
1209 table = gtk_grid_new();
1210 gtk_widget_set_halign(table, GTK_ALIGN_CENTER);
1211 gtk_grid_set_column_homogeneous(GTK_GRID(table),
TRUE);
1212 gtk_box_append(GTK_BOX(
avbox), table);
1215 table2 = gtk_grid_new();
1216 gtk_grid_attach(GTK_GRID(table), table2, 0, 0, 10, 1);
1219 for (i = 0; i < 10; i++) {
1220 GtkEventController *controller;
1225 g_object_set_data(G_OBJECT(
econ_label[i]),
"rate_button", GUINT_TO_POINTER(i));
1226 controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
1227 g_signal_connect(controller,
"pressed",
1229 gtk_widget_add_controller(
econ_label[i], controller);
1230 mc_gesture = gtk_gesture_click_new();
1231 gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(mc_gesture), 3);
1232 controller = GTK_EVENT_CONTROLLER(mc_gesture);
1233 g_signal_connect(controller,
"pressed",
1235 gtk_widget_add_controller(
econ_label[i], controller);
1236 gtk_grid_attach(GTK_GRID(table2),
econ_label[i], i, 0, 1, 1);
1268 for (i = 0; i < 4; i++) {
1287 gtk_widget_set_halign(w, GTK_ALIGN_START);
1288 gtk_widget_set_valign(w, GTK_ALIGN_START);
1289 gtk_widget_set_margin_start(w, 0);
1290 gtk_widget_set_margin_end(w, 0);
1291 gtk_widget_set_margin_top(w, 0);
1292 gtk_widget_set_margin_bottom(w, 0);
1293 gtk_grid_attach(GTK_GRID(table), w, i, 1, 1, 1);
1298 frame = gtk_frame_new(NULL);
1299 gtk_grid_attach(GTK_GRID(table), frame, 4, 1, 6, 1);
1329 sw = gtk_scrolled_window_new();
1330 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
TRUE);
1331 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1332 GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
1335 label = gtk_label_new(NULL);
1336 gtk_widget_set_hexpand(label,
TRUE);
1337 gtk_widget_set_halign(label, GTK_ALIGN_START);
1338 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
1339 gtk_widget_set_margin_start(label, 2);
1340 gtk_widget_set_margin_end(label, 2);
1341 gtk_widget_set_margin_top(label, 2);
1342 gtk_widget_set_margin_bottom(label, 2);
1343 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), label);
1346 hgrid2 = gtk_grid_new();
1349 table = gtk_grid_new();
1350 gtk_widget_set_margin_bottom(table, 5);
1351 gtk_widget_set_margin_end(table, 5);
1352 gtk_widget_set_margin_start(table, 5);
1353 gtk_widget_set_margin_top(table, 5);
1354 gtk_grid_attach(GTK_GRID(hgrid2), table, grid2_col++, 0, 1, 1);
1356 gtk_grid_set_row_spacing(GTK_GRID(table), 2);
1357 gtk_grid_set_column_spacing(GTK_GRID(table), 2);
1366 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(
top_notebook), GTK_POS_BOTTOM);
1371 gtk_paned_set_start_child(GTK_PANED(paned),
top_notebook);
1373 right_vbox = gtk_grid_new();
1375 gtk_orientable_set_orientation(GTK_ORIENTABLE(right_vbox),
1376 GTK_ORIENTATION_VERTICAL);
1378 gtk_grid_attach(GTK_GRID(right_vbox),
top_notebook, 0, right_row++, 1, 1);
1379 gtk_grid_attach(GTK_GRID(right_vbox),
ingame_votebar, 0, right_row++, 1, 1);
1380 gtk_grid_attach(GTK_GRID(hgrid), right_vbox, grid_col++, 0, 1, 1);
1382 gtk_grid_attach(GTK_GRID(hgrid),
top_notebook, grid_col++, 0, 1, 1);
1387 mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
1388 gtk_box_append(GTK_BOX(mainbox),
map_widget);
1392 gtk_widget_set_margin_bottom(ebar, 4);
1393 gtk_widget_set_margin_end(ebar, 4);
1394 gtk_widget_set_margin_start(ebar, 4);
1395 gtk_widget_set_margin_top(ebar, 4);
1397 label = gtk_label_new(
Q_(
"?noun:View"));
1398 gtk_notebook_append_page(GTK_NOTEBOOK(
top_notebook), mainbox, label);
1400 frame = gtk_frame_new(NULL);
1401 gtk_grid_attach(GTK_GRID(
map_widget), frame, 0, 0, 1, 1);
1406 gtk_widget_set_size_request(
map_canvas, 300, 300);
1422 gtk_frame_set_child(GTK_FRAME(frame),
map_canvas);
1425 gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, NULL);
1429 gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, NULL);
1435 mc_controller = GTK_EVENT_CONTROLLER(gtk_gesture_click_new());
1436 g_signal_connect(mc_controller,
"pressed",
1438 g_signal_connect(mc_controller,
"released",
1440 gtk_widget_add_controller(
map_canvas, mc_controller);
1441 mc_gesture = gtk_gesture_click_new();
1442 gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(mc_gesture), 3);
1443 mc_controller = GTK_EVENT_CONTROLLER(mc_gesture);
1444 g_signal_connect(mc_controller,
"pressed",
1446 g_signal_connect(mc_controller,
"released",
1448 gtk_widget_add_controller(
map_canvas, mc_controller);
1449 mc_gesture = gtk_gesture_click_new();
1450 gtk_gesture_single_set_button(GTK_GESTURE_SINGLE(mc_gesture), 2);
1451 mc_controller = GTK_EVENT_CONTROLLER(mc_gesture);
1452 g_signal_connect(mc_controller,
"pressed",
1454 gtk_widget_add_controller(
map_canvas, mc_controller);
1455 mc_controller = gtk_event_controller_scroll_new(GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES);
1456 g_signal_connect(mc_controller,
"scroll",
1458 gtk_widget_add_controller(
map_canvas, mc_controller);
1459 mc_controller = gtk_event_controller_motion_new();
1460 g_signal_connect(mc_controller,
"motion",
1462 g_signal_connect(mc_controller,
"leave",
1464 gtk_widget_add_controller(
map_canvas, mc_controller);
1469 mc_controller = gtk_event_controller_key_new();
1470 g_signal_connect(mc_controller,
"key-pressed",
1472 gtk_widget_add_controller(
toplevel, mc_controller);
1483 gtk_paned_set_end_child(GTK_PANED(paned), dtach_lowbox);
1486 mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
1490 gtk_box_append(GTK_BOX(
avbox), mainbox);
1493 hpaned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
1495 hpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
1497 gtk_box_append(GTK_BOX(mainbox), hpaned);
1498 gtk_widget_set_margin_bottom(hpaned, 4);
1499 gtk_widget_set_margin_end(hpaned, 4);
1500 gtk_widget_set_margin_start(hpaned, 4);
1501 gtk_widget_set_margin_top(hpaned, 4);
1511 gtk_notebook_set_tab_pos(GTK_NOTEBOOK(
right_notebook), GTK_POS_TOP);
1518 mainbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
1520 sw = gtk_scrolled_window_new();
1521 gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw),
1523 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
1524 GTK_POLICY_AUTOMATIC,
1526 gtk_box_append(GTK_BOX(mainbox), sw);
1528 label = gtk_label_new(
_(
"Chat"));
1529 gtk_notebook_append_page(GTK_NOTEBOOK(
bottom_notebook), mainbox, label);
1532 gtk_widget_set_hexpand(text,
TRUE);
1533 gtk_widget_set_vexpand(text,
TRUE);
1535 gtk_text_view_set_editable(GTK_TEXT_VIEW(text),
FALSE);
1536 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), text);
1538 gtk_widget_set_name(text,
"chatline");
1540 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
1541 gtk_widget_realize(text);
1542 gtk_text_view_set_left_margin(GTK_TEXT_VIEW(text), 5);
1545 if (dtach_lowbox != NULL) {
1546 g_object_set_data(G_OBJECT(dtach_lowbox),
"hide-over-reparent",
main_message_area);
1553 gtk_box_append(GTK_BOX(mainbox),
view);
1554 gtk_widget_set_margin_bottom(
view, 3);
1555 gtk_widget_set_margin_end(
view, 3);
1556 gtk_widget_set_margin_start(
view, 3);
1557 gtk_widget_set_margin_top(
view, 3);
1559 button = gtk_check_button_new_with_label(
_(
"Allies Only"));
1560 gtk_widget_set_focus_on_click(button,
FALSE);
1561 gtk_check_button_set_active(GTK_CHECK_BUTTON(button),
1563 g_signal_connect(button,
"toggled",
1568 button = gtk_button_new_with_label(
_(
"Clear links"));
1569 g_signal_connect(button,
"clicked",
1575 gtk_widget_show(gtk_window_get_child(GTK_WINDOW(
toplevel)));
1581 gtk_notebook_set_current_page(GTK_NOTEBOOK(
top_notebook), 0);