70 gtk_widget_destroy(w);
89 gint minx, miny, maxy;
91 gdk_window_get_origin(gtk_widget_get_window(
map_canvas), &minx, &miny);
92 maxy = miny + gtk_widget_get_allocated_height(
map_canvas);
99 y =
CLIP(miny, y, maxy - alloc->height);
101 gtk_window_move(GTK_WINDOW(w), x - alloc->width, y);
107 y =
CLIP(miny, y, maxy - alloc->height);
109 gtk_window_move(GTK_WINDOW(w), x, y);
125 p = gtk_window_new(GTK_WINDOW_POPUP);
126 gtk_container_set_border_width(GTK_CONTAINER(p), 4);
127 gtk_window_set_transient_for(GTK_WINDOW(p), GTK_WINDOW(
toplevel));
128 gtk_container_add(GTK_CONTAINER(p), gtk_label_new(
popup_info_text(ptile)));
140 g_signal_connect(p,
"destroy",
143 mousepos.
x =
event->x;
144 mousepos.
y =
event->y;
146 g_signal_connect(p,
"size-allocate",
150 gtk_widget_show_all(p);
151 gdk_device_grab(
event->device, gtk_widget_get_window(p),
152 GDK_OWNERSHIP_NONE,
TRUE, GDK_BUTTON_RELEASE_MASK, NULL,
156 g_signal_connect_after(p,
"button_release_event",
176 int idx = GPOINTER_TO_INT(data);
179 case GTK_RESPONSE_OK:
182 case GTK_RESPONSE_CANCEL:
183 case GTK_RESPONSE_DELETE_EVENT:
198 _(
"What should we call our new city?"), suggestname,
222 if (ev->button == 1 || ev->button == 3) {
227 (ev->state & GDK_SHIFT_MASK) != 0);
239 struct city *pcity = NULL;
240 struct tile *ptile = NULL;
254 switch (ev->button) {
259 if ((ev->state & GDK_SHIFT_MASK) && (ev->state & GDK_CONTROL_MASK)) {
261 }
else if (ev->state & GDK_CONTROL_MASK) {
264 }
else if (ptile && (ev->state & GDK_SHIFT_MASK)) {
267 }
else if (ptile && (ev->state & GDK_MOD1_MASK)) {
286 if (ev->state & GDK_CONTROL_MASK) {
298 if (ptile && (ev->state & GDK_MOD1_MASK)
299 && (ev->state & GDK_CONTROL_MASK)) {
301 }
else if ((ev->state & GDK_SHIFT_MASK) && (ev->state & GDK_MOD1_MASK)) {
304 }
else if ((ev->state & GDK_SHIFT_MASK) && (ev->state & GDK_CONTROL_MASK)
309 }
else if (ev->state & GDK_SHIFT_MASK
315 }
else if (ev->state & GDK_CONTROL_MASK) {
327 (ev->state & GDK_SHIFT_MASK) != 0);
351 GdkDeviceManager *manager =
352 gdk_display_get_device_manager(gtk_widget_get_display(
toplevel));
353 GdkDevice *pointer = gdk_device_manager_get_client_pointer(manager);
359 window = gdk_device_get_window_at_position(pointer, &x, &y);
361 if (window == gtk_widget_get_window(
map_canvas)) {
378 GdkModifierType mask;
379 GdkDeviceManager *manager =
380 gdk_display_get_device_manager(gtk_widget_get_display(
toplevel));
382 pointer = gdk_device_manager_get_client_pointer(manager);
387 window = gdk_device_get_window_at_position(pointer, &x, &y);
388 if (window && window == gtk_widget_get_window(
map_canvas)) {
389 gdk_device_get_state(pointer, window, NULL, &mask);
390 if (mask & GDK_BUTTON3_MASK) {
431 if (gtk_notebook_get_current_page(GTK_NOTEBOOK(
top_notebook))
471 if (ev->type != GDK_BUTTON_PRESS) {
bool can_client_issue_orders(void)
bool can_client_change_view(void)
enum known_type client_tile_get_known(const struct tile *ptile)
void do_map_click(struct tile *ptile, enum quickselect_type qtype)
struct unit_list * get_units_in_focus(void)
void request_center_focus_unit(void)
enum cursor_hover_state hover_state
void finish_city(struct tile *ptile, const char *name)
struct unit * find_visible_unit(struct tile *ptile)
void control_mouse_cursor(struct tile *ptile)
void cancel_city(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
bool editor_is_active(void)
void inputline_make_chat_link(struct tile *ptile, bool unit)
gboolean handle_edit_mouse_button_release(GdkEventButton *ev)
gboolean handle_edit_mouse_button_press(GdkEventButton *ev)
gboolean handle_edit_mouse_move(GdkEventMotion *ev)
GtkWidget * turn_done_button
GtkWidget * overview_canvas
#define GUI_GTK_OPTION(optname)
gboolean butt_release_mapcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data)
gboolean move_overviewcanvas(GtkWidget *w, GdkEventMotion *ev, gpointer data)
gboolean butt_down_overviewcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data)
void popup_newcity_dialog(struct unit *punit, const char *suggestname)
void center_on_unit(void)
void create_line_at_mouse_pos(void)
static gboolean popit_button_release(GtkWidget *w, GdkEventButton *event)
gboolean butt_down_mapcanvas(GtkWidget *w, GdkEventButton *ev, gpointer data)
gboolean move_mapcanvas(GtkWidget *w, GdkEventMotion *ev, gpointer data)
void set_turn_done_button_state(bool state)
gboolean leave_mapcanvas(GtkWidget *widget, GdkEventCrossing *event)
static void popupinfo_positioning_callback(GtkWidget *w, GtkAllocation *alloc, gpointer data)
static void popit(GdkEventButton *event, struct tile *ptile)
void popupinfo_popdown_callback(GtkWidget *w, gpointer data)
static void name_new_city_popup_callback(gpointer data, gint response, const char *input)
void update_rect_at_mouse_pos(void)
void update_unit_info_label(struct unit_list *punits)
void update_mouse_cursor(enum cursor_type new_cursor_type)
struct tile * index_to_tile(const struct civ_map *imap, int mindex)
struct tile * map_pos_to_tile(const struct civ_map *nmap, int map_x, int map_y)
void update_line(int canvas_x, int canvas_y)
void maybe_activate_keyboardless_goto(int canvas_x, int canvas_y)
void adjust_workers_button_pressed(int canvas_x, int canvas_y)
void release_goto_button(int canvas_x, int canvas_y)
bool tiles_hilited_cities
void action_button_pressed(int canvas_x, int canvas_y, enum quickselect_type qtype)
void wakeup_button_pressed(int canvas_x, int canvas_y)
void release_right_button(int canvas_x, int canvas_y, bool shift)
bool keyboardless_goto_button_down
void key_city_overlay(int canvas_x, int canvas_y)
void update_selection_rectangle(float canvas_x, float canvas_y)
void overview_update_line(int overview_x, int overview_y)
void anchor_selection_rectangle(int canvas_x, int canvas_y)
void cancel_tile_hiliting(void)
void clipboard_paste_production(struct city *pcity)
bool clipboard_copy_production(struct tile *ptile)
void toggle_tile_hilite(struct tile *ptile)
void mapdeco_set_crosshair(const struct tile *ptile, bool crosshair)
struct tile * canvas_pos_to_tile(float canvas_x, float canvas_y, float zoom)
void mapdeco_set_gotoroute(const struct unit *punit)
void mapdeco_clear_gotoroutes(void)
void center_tile_mapcanvas(const struct tile *ptile)
void mapdeco_clear_crosshairs(void)
bool tile_to_canvas_pos(float *canvas_x, float *canvas_y, float zoom, const struct tile *ptile)
void overview_to_map_pos(int *map_x, int *map_y, int overview_x, int overview_y)
#define CLIP(lower, current, upper)
const char * popup_info_text(struct tile *ptile)
struct city * tile_city(const struct tile *ptile)
int tileset_tile_height(const struct tileset *t)
int tileset_tile_width(const struct tileset *t)