Freeciv-3.3: /fast/freeciv/nightly/main/client/gui-gtk-5.0/mapctrl.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
mapctrl.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18#include <gtk/gtk.h>
19
20/* utility */
21#include "fcintl.h"
22#include "support.h"
23
24/* common */
25#include "combat.h"
26#include "game.h"
27#include "map.h"
28#include "player.h"
29#include "unit.h"
30
31#include "overview_common.h"
32
33/* client */
34#include "client_main.h"
35#include "climap.h"
36#include "climisc.h"
37#include "control.h"
38#include "editor.h"
39#include "tilespec.h"
40#include "text.h"
41#include "zoom.h"
42
43/* client/agents */
44#include "cma_core.h"
45
46/* client/gui-gtk-5.0 */
47#include "chatline.h"
48#include "citydlg.h"
49#include "colors.h"
50#include "dialogs.h"
51#include "editgui.h"
52#include "graphics.h"
53#include "gui_main.h"
54#include "infradlg.h"
55#include "inputdlg.h"
56#include "mapview.h"
57#include "menu.h"
58#include "rallypointdlg.h"
59
60#include "mapctrl.h"
61
62 extern gint cur_x, cur_y;
63
64/**********************************************************************/
68 static void popit(struct tile *ptile)
69{
70 if (TILE_UNKNOWN != client_tile_get_known(ptile)) {
71 GtkWidget *p;
72 struct unit *punit;
73 GdkRectangle rect;
74 GtkAllocation alloc;
75 float canvas_x, canvas_y;
76
77 tile_to_canvas_pos(&canvas_x, &canvas_y, map_zoom, ptile);
78 gtk_widget_get_allocation(map_canvas, &alloc);
79 rect.x = (canvas_x * mouse_zoom / map_zoom) - alloc.x;
80 rect.y = (canvas_y * mouse_zoom / map_zoom) - alloc.y;
81 rect.width = tileset_full_tile_width(tileset);
82 rect.height = tileset_tile_height(tileset);
83
84 p = gtk_popover_new();
85
86 gtk_widget_set_parent(p, map_canvas);
87 gtk_popover_set_pointing_to(GTK_POPOVER(p), &rect);
88 gtk_popover_set_child(GTK_POPOVER(p), gtk_label_new(popup_info_text(ptile)));
89
90 punit = find_visible_unit(ptile);
91
92 if (punit) {
93 mapdeco_set_gotoroute(punit);
94 if (punit->goto_tile) {
95 mapdeco_set_crosshair(punit->goto_tile, TRUE);
96 }
97 }
98 mapdeco_set_crosshair(ptile, TRUE);
99
100 g_signal_connect(p, "closed",
101 G_CALLBACK(popupinfo_popdown_callback), NULL);
102
103 gtk_popover_popup(GTK_POPOVER(p));
104 }
105}
106
107/**********************************************************************/
110 void popupinfo_popdown_callback(GtkWidget *w, gpointer data)
111{
112 mapdeco_clear_crosshairs();
113 mapdeco_clear_gotoroutes();
114}
115
116/**********************************************************************/
119 static void name_new_city_popup_callback(gpointer data, gint response,
120 const char *input)
121{
122 int idx = GPOINTER_TO_INT(data);
123
124 switch (response) {
125 case GTK_RESPONSE_OK:
126 finish_city(index_to_tile(&(wld.map), idx), input);
127 break;
128 case GTK_RESPONSE_CANCEL:
129 case GTK_RESPONSE_DELETE_EVENT:
130 cancel_city(index_to_tile(&(wld.map), idx));
131 break;
132 }
133}
134
135/**********************************************************************/
140 void popup_newcity_dialog(struct unit *punit, const char *suggestname)
141{
142 input_dialog_create(GTK_WINDOW(toplevel), /*"shellnewcityname" */
143 _("Build New City"),
144 _("What should we call our new city?"), suggestname,
145 name_new_city_popup_callback,
146 GINT_TO_POINTER(tile_index(unit_tile(punit))));
147}
148
149/**********************************************************************/
153 void set_turn_done_button_state(bool state)
154{
155 gtk_widget_set_sensitive(turn_done_button, state);
156
157 update_turn_done_tooltip();
158}
159
160/**********************************************************************/
164 gboolean left_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press,
165 double x, double y, gpointer data)
166{
167 if (editor_is_active()) {
168 return handle_edit_mouse_button_release(gesture, MOUSE_BUTTON_LEFT,
169 x, y);
170 }
171
172 release_goto_button(x, y);
173
174 return TRUE;
175}
176
177/**********************************************************************/
181 gboolean right_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press,
182 double x, double y, gpointer data)
183{
184 if (editor_is_active()) {
185 return handle_edit_mouse_button_release(gesture, MOUSE_BUTTON_RIGHT,
186 x, y);
187 }
188
189 release_goto_button(x, y);
190
191 if (rbutton_down || hover_state != HOVER_NONE) {
192 GdkModifierType state;
193
194 state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
195 release_right_button(x, y,
196 (state & GDK_SHIFT_MASK) != 0);
197 }
198
199 return TRUE;
200}
201
202/**********************************************************************/
206 gboolean left_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press,
207 double x, double y, gpointer data)
208{
209 struct tile *ptile = NULL;
210 GdkModifierType state;
211
212 if (editor_is_active()) {
213 return handle_edit_mouse_button_press(gesture, MOUSE_BUTTON_LEFT,
214 x, y);
215 }
216
217 if (!can_client_change_view()) {
218 return TRUE;
219 }
220
221 gtk_widget_grab_focus(map_canvas);
222 ptile = canvas_pos_to_tile(x, y, mouse_zoom);
223
224 state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
225
226 /* <SHIFT> + <CONTROL> + LMB : Adjust workers. */
227 if ((state & GDK_SHIFT_MASK) && (state & GDK_CONTROL_MASK)) {
228 adjust_workers_button_pressed(x, y);
229 } else if (state & GDK_CONTROL_MASK) {
230 /* <CONTROL> + LMB : Quickselect a sea unit. */
231 action_button_pressed(x, y, SELECT_SEA);
232 } else if (ptile && (state & GDK_SHIFT_MASK)) {
233 /* <SHIFT> + LMB: Append focus unit. */
234 action_button_pressed(x, y, SELECT_APPEND);
235 } else if (ptile && (state & GDK_ALT_MASK)) {
236 /* <ALT> + LMB: popit (same as middle-click) */
237 /* FIXME: we need a general mechanism for letting freeciv work with
238 * 1- or 2-button mice. */
239 popit(ptile);
240 } else if (tiles_hilited_cities) {
241 /* LMB in Area Selection mode. */
242 if (ptile) {
243 toggle_tile_hilite(ptile);
244 }
245 } else if (rally_set_tile(ptile)) {
246 /* Nothing here, rally_set_tile() already did what we wanted */
247 } else if (infra_placement_mode()) {
248 infra_placement_set_tile(ptile);
249 } else {
250 /* Plain LMB click. */
251 action_button_pressed(x, y, SELECT_POPUP);
252 }
253
254 return TRUE;
255}
256
257/**********************************************************************/
261 gboolean right_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press,
262 double x, double y, gpointer data)
263{
264 struct city *pcity = NULL;
265 struct tile *ptile = NULL;
266 GdkModifierType state;
267
268 if (editor_is_active()) {
269 return handle_edit_mouse_button_press(gesture, MOUSE_BUTTON_RIGHT,
270 x, y);
271 }
272
273 if (!can_client_change_view()) {
274 return TRUE;
275 }
276
277 gtk_widget_grab_focus(map_canvas);
278 ptile = canvas_pos_to_tile(x, y, mouse_zoom);
279 pcity = ptile ? tile_city(ptile) : NULL;
280
281 state = gtk_event_controller_get_current_event_state(
282 GTK_EVENT_CONTROLLER(gesture));
283
284 /* <CONTROL> + <ALT> + RMB : insert city or tile chat link. */
285 /* <CONTROL> + <ALT> + <SHIFT> + RMB : insert unit chat link. */
286 if (ptile && (state & GDK_ALT_MASK)
287 && (state & GDK_CONTROL_MASK)) {
288 inputline_make_chat_link(ptile, (state & GDK_SHIFT_MASK) != 0);
289 } else if ((state & GDK_SHIFT_MASK) && (state & GDK_ALT_MASK)) {
290 /* <SHIFT> + <ALT> + RMB : Show/hide workers. */
291 key_city_overlay(x, y);
292 } else if ((state & GDK_SHIFT_MASK) && (state & GDK_CONTROL_MASK)
293 && pcity != NULL) {
294 /* <SHIFT + CONTROL> + RMB: Paste Production. */
295 clipboard_paste_production(pcity);
296 cancel_tile_hiliting();
297 } else if (state & GDK_SHIFT_MASK
298 && clipboard_copy_production(ptile)) {
299 /* <SHIFT> + RMB on city/unit: Copy Production. */
300 /* If nothing to copy, fall through to rectangle selection. */
301
302 /* Already done the copy */
303 } else if (state & GDK_CONTROL_MASK) {
304 /* <CONTROL> + RMB : Quickselect a land unit. */
305 action_button_pressed(x, y, SELECT_LAND);
306 } else {
307 /* Plain RMB click. Area selection. */
308 /* A foolproof user will depress button on canvas,
309 * release it on another widget, and return to canvas
310 * to find rectangle still active.
311 */
312 if (rectangle_active) {
313 release_right_button(x, y,
314 (state & GDK_SHIFT_MASK) != 0);
315 return TRUE;
316 }
317 if (hover_state == HOVER_NONE) {
318 anchor_selection_rectangle(x, y);
319 rbutton_down = TRUE; /* Causes rectangle updates */
320 }
321 }
322
323 return TRUE;
324}
325
326/**********************************************************************/
330 gboolean middle_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press,
331 double x, double y, gpointer data)
332{
333 struct tile *ptile = NULL;
334 GdkModifierType state;
335
336 if (editor_is_active()) {
337 return handle_edit_mouse_button_press(gesture, MOUSE_BUTTON_MIDDLE,
338 x, y);
339 }
340
341 if (!can_client_change_view()) {
342 return TRUE;
343 }
344
345 gtk_widget_grab_focus(map_canvas);
346 ptile = canvas_pos_to_tile(x, y, mouse_zoom);
347
348 state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
349
350 /* <CONTROL> + MMB: Wake up sentries. */
351 if (state & GDK_CONTROL_MASK) {
352 wakeup_button_pressed(x, y);
353 } else if (ptile) {
354 /* Plain Middle click. */
355 popit(ptile);
356 }
357
358 return TRUE;
359}
360
361/**********************************************************************/
364 void create_line_at_mouse_pos(void)
365{
366 double x, y;
367 GdkSeat *seat = gdk_display_get_default_seat(gtk_widget_get_display(toplevel));
368 GdkDevice *pointer = gdk_seat_get_pointer(seat);
369 GdkSurface *window;
370
371 if (!pointer) {
372 return;
373 }
374
375 window = gdk_device_get_surface_at_position(pointer, &x, &y);
376 if (window) {
377 if (window == gtk_native_get_surface(gtk_widget_get_native(map_canvas))) {
378 update_line(x, y);
379 } else if (window == gtk_native_get_surface(gtk_widget_get_native(overview_canvas))) {
380 overview_update_line(x, y);
381 }
382 }
383}
384
385/**********************************************************************/
389 void update_rect_at_mouse_pos(void)
390{
391 double x, y;
392 GdkSurface *window;
393 GdkDevice *pointer;
394 GdkDevice *keyboard;
395 GdkModifierType mask;
396 GdkSeat *seat = gdk_display_get_default_seat(gtk_widget_get_display(toplevel));
397
398 pointer = gdk_seat_get_pointer(seat);
399 if (!pointer) {
400 return;
401 }
402
403 window = gdk_device_get_surface_at_position(pointer, &x, &y);
404 if (window
405 && window == gtk_native_get_surface(gtk_widget_get_native(map_canvas))) {
406 keyboard = gdk_seat_get_keyboard(seat);
407 mask = gdk_device_get_modifier_state(keyboard);
408 if (mask & GDK_BUTTON3_MASK) {
409 update_selection_rectangle(x, y);
410 }
411 }
412}
413
414/**********************************************************************/
418 gboolean move_mapcanvas(GtkEventControllerMotion *controller,
419 gdouble x, gdouble y, gpointer data)
420{
421 GdkModifierType state;
422
423 if (GUI_GTK_OPTION(mouse_over_map_focus)
424 && !gtk_widget_has_focus(map_canvas)) {
425 gtk_widget_grab_focus(map_canvas);
426 }
427
428 if (editor_is_active()) {
429 return handle_edit_mouse_move(controller, x, y);
430 }
431
432 cur_x = x;
433 cur_y = y;
434 update_line(x, y);
435 state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(controller));
436 if (rbutton_down && (state & GDK_BUTTON3_MASK)) {
437 update_selection_rectangle(x, y);
438 }
439
440 if (keyboardless_goto_button_down && hover_state == HOVER_NONE) {
441 maybe_activate_keyboardless_goto(x, y);
442 }
443 control_mouse_cursor(canvas_pos_to_tile(x, y, mouse_zoom));
444
445 return TRUE;
446}
447
448/**********************************************************************/
451 gboolean leave_mapcanvas(GtkEventControllerMotion *controller,
452 gpointer data)
453{
454 update_mouse_cursor(CURSOR_DEFAULT);
455 update_unit_info_label(get_units_in_focus());
456
457 return TRUE;
458}
459
460/**********************************************************************/
463 gboolean move_overviewcanvas(GtkEventControllerMotion *controller,
464 gdouble x, gdouble y, gpointer data)
465{
466 overview_update_line(x, y);
467
468 return TRUE;
469}
470
471/**********************************************************************/
474 gboolean left_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press,
475 double x, double y, gpointer data)
476{
477 int xtile, ytile;
478
479 if (n_press != 1) {
480 return TRUE; /* Double-clicks? Triple-clicks? No thanks! */
481 }
482
483 overview_to_map_pos(&xtile, &ytile, x, y);
484
485 if (can_client_issue_orders()) {
486 GdkModifierType state;
487
488 state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(gesture));
489 do_map_click(map_pos_to_tile(&(wld.map), xtile, ytile),
490 (state & GDK_SHIFT_MASK) ? SELECT_APPEND : SELECT_POPUP);
491 }
492
493 return TRUE;
494}
495
496/**********************************************************************/
499 gboolean right_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press,
500 double x, double y, gpointer data)
501{
502 int xtile, ytile;
503
504 if (n_press != 1) {
505 return TRUE; /* Double-clicks? Triple-clicks? No thanks! */
506 }
507
508 overview_to_map_pos(&xtile, &ytile, x, y);
509
510 if (can_client_change_view()) {
511 center_tile_mapcanvas(map_pos_to_tile(&(wld.map), xtile, ytile));
512 }
513
514 return TRUE;
515}
516
517/**********************************************************************/
520 void center_on_unit(void)
521{
522 request_center_focus_unit();
523}
canvas_y
struct canvas int int canvas_y
Definition canvas_g.h:43
canvas_x
struct canvas int canvas_x
Definition canvas_g.h:43
can_client_issue_orders
bool can_client_issue_orders(void)
Definition client_main.c:1272
can_client_change_view
bool can_client_change_view(void)
Definition client_main.c:1320
client_main.h
client_tile_get_known
enum known_type client_tile_get_known(const struct tile *ptile)
Definition climap.c:36
climap.h
climisc.h
cma_core.h
combat.h
incite_cost
char * incite_cost
Definition comments.c:74
do_map_click
void do_map_click(struct tile *ptile, enum quickselect_type qtype)
Definition control.c:2882
get_units_in_focus
struct unit_list * get_units_in_focus(void)
Definition control.c:177
request_center_focus_unit
void request_center_focus_unit(void)
Definition control.c:2723
hover_state
enum cursor_hover_state hover_state
Definition control.c:89
finish_city
void finish_city(struct tile *ptile, const char *name)
Definition control.c:4064
find_visible_unit
struct unit * find_visible_unit(struct tile *ptile)
Definition control.c:804
control_mouse_cursor
void control_mouse_cursor(struct tile *ptile)
Definition control.c:1189
cancel_city
void cancel_city(struct tile *ptile)
Definition control.c:4083
control.h
SELECT_LAND
@ SELECT_LAND
Definition control.h:38
SELECT_APPEND
@ SELECT_APPEND
Definition control.h:38
SELECT_SEA
@ SELECT_SEA
Definition control.h:38
SELECT_POPUP
@ SELECT_POPUP
Definition control.h:38
HOVER_NONE
@ HOVER_NONE
Definition control.h:26
punit
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
Definition dialogs_g.h:74
editor_is_active
bool editor_is_active(void)
Definition editor.c:346
editor.h
MOUSE_BUTTON_LEFT
@ MOUSE_BUTTON_LEFT
Definition editor.h:126
MOUSE_BUTTON_RIGHT
@ MOUSE_BUTTON_RIGHT
Definition editor.h:128
MOUSE_BUTTON_MIDDLE
@ MOUSE_BUTTON_MIDDLE
Definition editor.h:127
fcintl.h
_
#define _(String)
Definition fcintl.h:67
wld
struct world wld
Definition game.c:62
game.h
inputline_make_chat_link
void inputline_make_chat_link(struct tile *ptile, bool unit)
Definition chatline.c:475
handle_edit_mouse_button_release
gboolean handle_edit_mouse_button_release(GdkEventButton *ev)
Definition editgui.c:956
handle_edit_mouse_button_press
gboolean handle_edit_mouse_button_press(GdkEventButton *ev)
Definition editgui.c:940
handle_edit_mouse_move
gboolean handle_edit_mouse_move(GdkEventMotion *ev)
Definition editgui.c:971
turn_done_button
GtkWidget * turn_done_button
Definition gui_main.c:149
overview_canvas
GtkWidget * overview_canvas
Definition gui_main.c:111
toplevel
GtkWidget * toplevel
Definition gui_main.c:125
map_canvas
GtkWidget * map_canvas
Definition gui_main.c:107
update_turn_done_tooltip
void update_turn_done_tooltip(void)
Definition gui_main.c:1131
GUI_GTK_OPTION
#define GUI_GTK_OPTION(optname)
Definition gui_main.h:25
infra_placement_mode
bool infra_placement_mode(void)
Definition infradlg.c:155
infra_placement_set_tile
void infra_placement_set_tile(struct tile *ptile)
Definition infradlg.c:163
input_dialog_create
GtkWidget * input_dialog_create(GtkWindow *parent, const char *dialogname, const char *text, const char *postinputtest, input_dialog_callback_t response_callback, gpointer response_cli_data)
Definition inputdlg.c:66
move_overviewcanvas
gboolean move_overviewcanvas(GtkWidget *w, GdkEventMotion *ev, gpointer data)
Definition mapctrl.c:463
cur_y
gint cur_y
Definition mapctrl.c:63
popup_newcity_dialog
void popup_newcity_dialog(struct unit *punit, const char *suggestname)
Definition mapctrl.c:197
center_on_unit
void center_on_unit(void)
Definition mapctrl.c:496
create_line_at_mouse_pos
void create_line_at_mouse_pos(void)
Definition mapctrl.c:355
move_mapcanvas
gboolean move_mapcanvas(GtkWidget *w, GdkEventMotion *ev, gpointer data)
Definition mapctrl.c:406
popit
static void popit(GdkEventButton *ev, struct tile *ptile)
Definition mapctrl.c:121
cur_x
gint cur_x
Definition gui_main.c:184
set_turn_done_button_state
void set_turn_done_button_state(bool state)
Definition mapctrl.c:210
leave_mapcanvas
gboolean leave_mapcanvas(GtkWidget *widget, GdkEventCrossing *event)
Definition mapctrl.c:435
popupinfo_popdown_callback
void popupinfo_popdown_callback(GtkWidget *w, gpointer data)
Definition mapctrl.c:167
name_new_city_popup_callback
static void name_new_city_popup_callback(gpointer data, gint response, const char *input)
Definition mapctrl.c:176
update_rect_at_mouse_pos
void update_rect_at_mouse_pos(void)
Definition mapctrl.c:380
update_unit_info_label
void update_unit_info_label(struct unit_list *punits)
Definition mapview.c:275
update_mouse_cursor
void update_mouse_cursor(enum cursor_type new_cursor_type)
Definition mapview.c:257
rally_set_tile
bool rally_set_tile(struct tile *ptile)
Definition rallypointdlg.c:133
right_butt_down_overviewcanvas
gboolean right_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
Definition mapctrl.c:499
left_butt_up_mapcanvas
gboolean left_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
Definition mapctrl.c:164
right_butt_up_mapcanvas
gboolean right_butt_up_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
Definition mapctrl.c:181
left_butt_down_overviewcanvas
gboolean left_butt_down_overviewcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
Definition mapctrl.c:474
left_butt_down_mapcanvas
gboolean left_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
Definition mapctrl.c:206
right_butt_down_mapcanvas
gboolean right_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
Definition mapctrl.c:261
middle_butt_down_mapcanvas
gboolean middle_butt_down_mapcanvas(GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
Definition mapctrl.c:330
editgui.h
infradlg.h
inputdlg.h
rallypointdlg.h
chatline.h
citydlg.h
colors.h
dialogs.h
graphics.h
gui_main.h
mapctrl.h
mapview.h
menu.h
index_to_tile
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
Definition map.c:462
map_pos_to_tile
struct tile * map_pos_to_tile(const struct civ_map *nmap, int map_x, int map_y)
Definition map.c:425
map.h
update_line
void update_line(int canvas_x, int canvas_y)
Definition mapctrl_common.c:665
maybe_activate_keyboardless_goto
void maybe_activate_keyboardless_goto(int canvas_x, int canvas_y)
Definition mapctrl_common.c:507
adjust_workers_button_pressed
void adjust_workers_button_pressed(int canvas_x, int canvas_y)
Definition mapctrl_common.c:597
rbutton_down
bool rbutton_down
Definition mapctrl_common.c:55
rectangle_active
bool rectangle_active
Definition mapctrl_common.c:56
release_goto_button
void release_goto_button(int canvas_x, int canvas_y)
Definition mapctrl_common.c:487
tiles_hilited_cities
bool tiles_hilited_cities
Definition mapctrl_common.c:60
action_button_pressed
void action_button_pressed(int canvas_x, int canvas_y, enum quickselect_type qtype)
Definition mapctrl_common.c:570
wakeup_button_pressed
void wakeup_button_pressed(int canvas_x, int canvas_y)
Definition mapctrl_common.c:585
release_right_button
void release_right_button(int canvas_x, int canvas_y, bool shift)
Definition mapctrl_common.c:321
keyboardless_goto_button_down
bool keyboardless_goto_button_down
Definition mapctrl_common.c:69
key_city_overlay
void key_city_overlay(int canvas_x, int canvas_y)
Definition mapctrl_common.c:359
update_selection_rectangle
void update_selection_rectangle(float canvas_x, float canvas_y)
Definition mapctrl_common.c:201
overview_update_line
void overview_update_line(int overview_x, int overview_y)
Definition mapctrl_common.c:697
anchor_selection_rectangle
void anchor_selection_rectangle(int canvas_x, int canvas_y)
Definition mapctrl_common.c:87
cancel_tile_hiliting
void cancel_tile_hiliting(void)
Definition mapctrl_common.c:309
clipboard_paste_production
void clipboard_paste_production(struct city *pcity)
Definition mapctrl_common.c:424
clipboard_copy_production
bool clipboard_copy_production(struct tile *ptile)
Definition mapctrl_common.c:379
toggle_tile_hilite
void toggle_tile_hilite(struct tile *ptile)
Definition mapctrl_common.c:336
mapdeco_set_crosshair
void mapdeco_set_crosshair(const struct tile *ptile, bool crosshair)
Definition mapview_common.c:3363
canvas_pos_to_tile
struct tile * canvas_pos_to_tile(float canvas_x, float canvas_y, float zoom)
Definition mapview_common.c:763
mapdeco_set_gotoroute
void mapdeco_set_gotoroute(const struct unit *punit)
Definition mapview_common.c:3486
mapdeco_clear_gotoroutes
void mapdeco_clear_gotoroutes(void)
Definition mapview_common.c:3542
center_tile_mapcanvas
void center_tile_mapcanvas(const struct tile *ptile)
Definition mapview_common.c:1237
mapdeco_clear_crosshairs
void mapdeco_clear_crosshairs(void)
Definition mapview_common.c:3398
tile_to_canvas_pos
bool tile_to_canvas_pos(float *canvas_x, float *canvas_y, float zoom, const struct tile *ptile)
Definition mapview_common.c:706
overview_to_map_pos
void overview_to_map_pos(int *map_x, int *map_y, int overview_x, int overview_y)
Definition overview_common.c:358
overview_common.h
player.h
mask
struct sprite int int int int struct sprite * mask
Definition sprite_g.h:32
y
struct sprite int int y
Definition sprite_g.h:31
x
struct sprite int x
Definition sprite_g.h:31
city
Definition city.h:320
tile
Definition tile.h:50
tileset
Definition tilespec.c:482
unit
Definition unit.h:140
unit::goto_tile
struct tile * goto_tile
Definition unit.h:157
world::map
struct civ_map map
Definition world_object.h:38
support.h
TRUE
#define TRUE
Definition support.h:46
popup_info_text
const char * popup_info_text(struct tile *ptile)
Definition text.c:147
text.h
tile_city
struct city * tile_city(const struct tile *ptile)
Definition tile.c:83
tile_index
#define tile_index(_pt_)
Definition tile.h:89
TILE_UNKNOWN
@ TILE_UNKNOWN
Definition tile.h:36
tileset_tile_height
int tileset_tile_height(const struct tileset *t)
Definition tilespec.c:766
tileset_full_tile_width
int tileset_full_tile_width(const struct tileset *t)
Definition tilespec.c:777
tilespec.h
CURSOR_DEFAULT
@ CURSOR_DEFAULT
Definition tilespec.h:302
unit.h
unit_tile
#define unit_tile(_pu)
Definition unit.h:397
mouse_zoom
float mouse_zoom
Definition zoom.c:28
map_zoom
float map_zoom
Definition zoom.c:25
zoom.h