Freeciv-3.2
Loading...
Searching...
No Matches
Functions | Variables
mapctrl.c File Reference
#include <gtk/gtk.h>
#include "fcintl.h"
#include "support.h"
#include "combat.h"
#include "game.h"
#include "map.h"
#include "player.h"
#include "unit.h"
#include "overview_common.h"
#include "client_main.h"
#include "climap.h"
#include "climisc.h"
#include "control.h"
#include "editor.h"
#include "tilespec.h"
#include "text.h"
#include "zoom.h"
#include "cma_core.h"
#include "chatline.h"
#include "citydlg.h"
#include "colors.h"
#include "dialogs.h"
#include "editgui.h"
#include "graphics.h"
#include "gui_main.h"
#include "infradlg.h"
#include "inputdlg.h"
#include "mapview.h"
#include "menu.h"
#include "rallypointdlg.h"
#include "mapctrl.h"

Go to the source code of this file.

Functions

static void popit (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 popup_newcity_dialog (struct unit *punit, const char *suggestname)
 
void set_turn_done_button_state (bool state)
 
gboolean left_butt_up_mapcanvas (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
gboolean right_butt_up_mapcanvas (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
gboolean left_butt_down_mapcanvas (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
gboolean right_butt_down_mapcanvas (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
gboolean middle_butt_down_mapcanvas (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
void create_line_at_mouse_pos (void)
 
void update_rect_at_mouse_pos (void)
 
gboolean move_mapcanvas (GtkEventControllerMotion *controller, gdouble x, gdouble y, gpointer data)
 
gboolean leave_mapcanvas (GtkEventControllerMotion *controller, gpointer data)
 
gboolean move_overviewcanvas (GtkEventControllerMotion *controller, gdouble x, gdouble y, gpointer data)
 
gboolean left_butt_down_overviewcanvas (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
gboolean right_butt_down_overviewcanvas (GtkGestureClick *gesture, int n_press, double x, double y, gpointer data)
 
void center_on_unit (void)
 

Variables

gint cur_x
 
gint cur_y
 

Function Documentation

◆ center_on_unit()

void center_on_unit ( void  )

Best effort to center the map on the currently selected unit(s)

Definition at line 520 of file mapctrl.c.

◆ create_line_at_mouse_pos()

void create_line_at_mouse_pos ( void  )

Update goto line so that destination is at current mouse pointer location.

Definition at line 364 of file mapctrl.c.

◆ leave_mapcanvas()

gboolean leave_mapcanvas ( GtkEventControllerMotion controller,
gpointer  data 
)

This function will reset the mouse cursor if it leaves the map.

Definition at line 451 of file mapctrl.c.

◆ left_butt_down_mapcanvas()

gboolean left_butt_down_mapcanvas ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)

Handle all left mouse button presses on canvas. Future feature: User-configurable mouse clicks.

Definition at line 206 of file mapctrl.c.

Referenced by setup_widgets().

◆ left_butt_down_overviewcanvas()

gboolean left_butt_down_overviewcanvas ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)

Left button pressed at overview

Definition at line 474 of file mapctrl.c.

Referenced by setup_widgets().

◆ left_butt_up_mapcanvas()

gboolean left_butt_up_mapcanvas ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)

Handle 'Left mouse button released'. Because of the quickselect feature, the release of both left and right mousebutton can launch the goto.

Definition at line 164 of file mapctrl.c.

Referenced by setup_widgets().

◆ middle_butt_down_mapcanvas()

gboolean middle_butt_down_mapcanvas ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)

Handle all middle mouse button presses on canvas. Future feature: User-configurable mouse clicks.

Definition at line 330 of file mapctrl.c.

Referenced by setup_widgets().

◆ move_mapcanvas()

gboolean move_mapcanvas ( GtkEventControllerMotion controller,
gdouble  x,
gdouble  y,
gpointer  data 
)

Triggered by the mouse moving on the mapcanvas, this function will update the mouse cursor and goto lines.

Definition at line 418 of file mapctrl.c.

◆ move_overviewcanvas()

gboolean move_overviewcanvas ( GtkEventControllerMotion controller,
gdouble  x,
gdouble  y,
gpointer  data 
)

Overview canvas moved

Definition at line 463 of file mapctrl.c.

◆ name_new_city_popup_callback()

static void name_new_city_popup_callback ( gpointer  data,
gint  response,
const char input 
)
static

Callback from city name dialog for new city.

Definition at line 119 of file mapctrl.c.

◆ popit()

static void popit ( struct tile ptile)
static

Popup a label with information about the tile, unit, city, when the user used the middle mouse button on the map.

Definition at line 68 of file mapctrl.c.

◆ popup_newcity_dialog()

void popup_newcity_dialog ( struct unit punit,
const char suggestname 
)

Popup dialog where the user choose the name of the new city punit = (settler) unit which builds the city suggestname = suggestion of the new city's name

Definition at line 140 of file mapctrl.c.

◆ popupinfo_popdown_callback()

void popupinfo_popdown_callback ( GtkWidget w,
gpointer  data 
)

Information label destruction requested

Definition at line 110 of file mapctrl.c.

◆ right_butt_down_mapcanvas()

gboolean right_butt_down_mapcanvas ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)

Handle all right mouse button presses on canvas. Future feature: User-configurable mouse clicks.

Definition at line 261 of file mapctrl.c.

Referenced by setup_widgets().

◆ right_butt_down_overviewcanvas()

gboolean right_butt_down_overviewcanvas ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)

Right button pressed at overview

Definition at line 499 of file mapctrl.c.

Referenced by setup_widgets().

◆ right_butt_up_mapcanvas()

gboolean right_butt_up_mapcanvas ( GtkGestureClick gesture,
int  n_press,
double  x,
double  y,
gpointer  data 
)

Handle 'Right mouse button released'. Because of the quickselect feature, the release of both left and right mousebutton can launch the goto.

Definition at line 181 of file mapctrl.c.

Referenced by setup_widgets().

◆ set_turn_done_button_state()

void set_turn_done_button_state ( bool  state)

Enable or disable the turn done button. Should probably some where else.

Definition at line 153 of file mapctrl.c.

◆ update_rect_at_mouse_pos()

void update_rect_at_mouse_pos ( void  )

The Area Selection rectangle. Called by center_tile_mapcanvas() and when the mouse pointer moves.

Definition at line 389 of file mapctrl.c.

Variable Documentation

◆ cur_x

gint cur_x
extern

Definition at line 184 of file gui_main.c.

Referenced by mouse_scroll_mapcanvas(), and mouse_scroll_mapcanvas().

◆ cur_y

gint cur_y

Definition at line 62 of file mapctrl.c.